Commit 949de2a6 authored by John Ballance's avatar John Ballance
Browse files

Updated SCSIFS with a mechanism to ignore HotPlug SCSI drives that are not required.

Detail:
	Typically USB card readers contain several readers as different LUNs.
	Usually a user is not interested in all readers and some can safely
	be ignored. There is now a mechanism in SCSIFS to remember this.
	(otherwise readers can occupy all the available icons, making it
	impossible for a user to add other devices e.g. 'pens'.)
	A new file, Boot:Choices.SCSIFS.Hide, is used to store data on
	sub-devices for which no SCSIFS 'drive' is desired. This data
	is the 8 byte Vendor + 16 byte Product + 4 byte Revision fields
	(concatenated and LF terminated) returned by the SCSI Inquiry command.
	If a device/LUN's inquiry completely mateches a file entry, no
	SCSIFS drive will be created. A simple App will be created to manage
	this file in due course.
Admin:  TESTED AT Castle.. due for beta release.


Version 1.16. Tagged as 'SCSIFS-1_16'
parent cfa6c9e0
| this file is Boot:Choices.SCSIFS.Hide
|
| Comments begin with a | character and can be any length
| otherwise lines MUST be 28 characters long followed by a line feed
|
| These 28 characters are 3 concatenated fields from the SCSI Inquiry command
| 8 chars for Vendor
| 16 chars for Product
| 4 chars for Revision
|
|--- 28 chars inclusive ---|
| this one matches, so is hidden
USB2.0 CardReader Combo0.0>
| this one doesn't match, so is shown
USb2.0 CardReader CF RW0.0>
......@@ -11,13 +11,13 @@
GBLS Module_HelpVersion
GBLS Module_ComponentName
GBLS Module_ComponentPath
Module_MajorVersion SETS "1.15"
Module_Version SETA 115
Module_MajorVersion SETS "1.16"
Module_Version SETA 116
Module_MinorVersion SETS ""
Module_Date SETS "28 Apr 2005"
Module_ApplicationDate SETS "28-Apr-05"
Module_Date SETS "27 Jun 2005"
Module_ApplicationDate SETS "27-Jun-05"
Module_ComponentName SETS "SCSIFS"
Module_ComponentPath SETS "RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
Module_FullVersion SETS "1.15"
Module_HelpVersion SETS "1.15 (28 Apr 2005)"
Module_FullVersion SETS "1.16"
Module_HelpVersion SETS "1.16 (27 Jun 2005)"
END
/* (1.15)
/* (1.16)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.2.
*
*/
#define Module_MajorVersion_CMHG 1.15
#define Module_MajorVersion_CMHG 1.16
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 28 Apr 2005
#define Module_Date_CMHG 27 Jun 2005
#define Module_MajorVersion "1.15"
#define Module_Version 115
#define Module_MajorVersion "1.16"
#define Module_Version 116
#define Module_MinorVersion ""
#define Module_Date "28 Apr 2005"
#define Module_Date "27 Jun 2005"
#define Module_ApplicationDate "28-Apr-05"
#define Module_ApplicationDate "27-Jun-05"
#define Module_ComponentName "SCSIFS"
#define Module_ComponentPath "RiscOS/Sources/FileSys/SCSIFS/SCSIFS"
#define Module_FullVersion "1.15"
#define Module_HelpVersion "1.15 (28 Apr 2005)"
#define Module_LibraryVersionInfo "1:15"
#define Module_FullVersion "1.16"
#define Module_HelpVersion "1.16 (27 Jun 2005)"
#define Module_LibraryVersionInfo "1:16"
......@@ -599,11 +599,144 @@ CDB_Inquiry
]
[ HotPlug
[ {TRUE}
CDB_Inquiryfull
DCB &12 ; INQUIRY
DCB 0
DCB 0
DCB 0
DCB 36
DCB 0
ALIGN
; check if this drive is 'disabled'. A drive is 'disabled' if its
; inquiry string from offset 8 to offset 31 inclusive matches one
; in file Boot:Choices.SCSIFS.Hide
; otherwise it is allowed.
; in : R1=driveID
; out: EQ if not allowed, else NE
CheckDriveAllowed ROUT
Push "R0-R5,R8,LR"
[ Debug7
wrhex R1
mess ,"MapInDrive",NL
]
ORR R0, R1, #CTL_TXREAD
MOV R1, #6
ADR R2, CDB_Inquiryfull
SUB StkPtr, StkPtr, #36 + 44
MOV R3, StkPtr
MOV R4, #36
MOV R5, #100
MOV R8, R12
SWI XSCSI_Op
BVS CDANotAllowed ; wont allow drive if error
TEQ R4, #0
BNE CDANotAllowed ; wont allow if no full enquiry response
Push "R3"
ADR R0, BootPath
MOV R1, R3
MOV r2, #-1
MOV R3, #0
MOV R4, #0
SWI XOS_ReadVarVal ; does it exist?
TEQ R2, #0
Pull "R3", EQ ; no
BEQ CDAAllowed
; the Boot: path exists.. look for our choices.Hide file
MOV R0, #&4f ; 4f open R/O no path
ADR R1, ChoicesHide
SWI XOS_Find
; choices didnt open
Pull "R3", VS ; no
BVS CDAAllowed
MOV R1, R0 ; file handle
lp0 MOV R0, #4 ; use current pointer
LDR R2, [StkPtr] ; buffer space after enquiry data
MOV R3, #1 ; first byte
SWI XOS_GBPB ; read first byte
TEQ R3,#0 ; all read?
BNE goteof ; incomplete line .. file end reached
LDR R5, [StkPtr] ; buffer space after enquiry data
LDRB R5, [R5]
TEQ R5, #'|' ; a comment line?
BNE lp1
lp2 MOV R0, #4 ; use current pointer
LDR R2, [StkPtr] ; buffer space after enquiry data
MOV R3, #1 ; first byte
SWI XOS_GBPB ; read first byte
TEQ R3,#0 ; all read?
BNE goteof ; incomplete line .. file end reached
LDR R5, [StkPtr] ; buffer space after enquiry data
LDRB R5, [R5]
TEQ R5, #10 ; end line?
BNE lp2 ; no.. go there
B lp0 ; back for next line
lp1 MOV R0, #4 ; use current pointer
MOV R3, #8 + 16 + 4 ; rest of enquiry data + 1 linefeed
SWI XOS_GBPB ; read first line
TEQ R3,#0 ; all read?
BNE goteof ; incomplete line .. file end reached
SUB R2, R2, #5 ; point to last word of enq data read
LDR R4, [StkPtr] ; buffer space after enquiry data
SUB R4, R4, #4 ; last word of this enq data
[ Debug7
wrhex R2
wrhex R4
mess ,"MapInDrive",NL
]
MOV R5, #8 + 16 + 4
cmpr LDR R0, [R2], #-4 ; compare strings
LDR R3, [R4], #-4
TEQ R0, R3
BNE lp0 ; not a match.. try next
SUBS R5, R5, #4
BGT cmpr ; loop
; match found
MOV R0, #0
SWI XOS_Find ; close the file again
Pull "R3"
B CDANotAllowed
goteof MOV R0, #0
SWI XOS_Find ; close the file again
Pull "R3"
CDAAllowed
ADD StkPtr, StkPtr, #36 + 44
TEQ PC, #0
Pull "R0-R5,R8,PC" ; exit NE.. allowed
CDANotAllowed
ADD StkPtr, StkPtr, #36 + 44
TEQ R0, R0
Pull "R0-R5,R8,PC" ; exit EQ.. not allowed
BootPath
= "Boot$Path",0
ChoicesHide
= "Boot:Choices.SCSIFS.Hide",0
ALIGN
]
; In: R0 = 0 or 4 (indicating drive number range)
; R1 = device number
; Out: NE if found a slot
MapInDevice
Push "R0,R1,R3,R5,LR"
BL CheckDriveAllowed
Pull "R0,R1,R3,R5,PC",EQ ; Exit (with EQ)
10
DrvRecPtr R5,R0
mapDrvToDevLo R3,R0,R5
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment