USB multi card reader == SCSI multi lun target
This is probably old news to USB folks but those nifty little USB multi card readers (e.g. CF, SD, MMC, SMC cards etc) appear in Linux as multi lun targets.
Most distros only scan for lun 0 **. So to see
luns > 0, commands like these are needed:
echo "scsi add-single-device 1 0 0 1" > /proc/scsi/scsi echo "scsi add-single-device 1 0 0 2" > /proc/scsi/scsi echo "scsi add-single-device 1 0 0 3" > /proc/scsi/scsi
The above sequence was needed for a 4 slot multi card reader. Following is some /proc/scsi/scsi output after an "scsi add-single-device 1 0 0 1" in a 2 slot multi card reader. Notice the end of the model string tells you what type of card is read at that lun.
# cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 02 Lun: 00 Vendor: hp Model: scanjet 7400c Rev: 0.8A Type: Scanner ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: Generic Model: USB Storage-SMC Rev: 0090 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 01 Vendor: Generic Model: USB Storage-CFC Rev: 0090 Type: Direct-Access ANSI SCSI revision: 02
** Most distros don't set CONFIG_SCSI_MULTI_LUN because some "scsi" devices answer all luns. I think that bug in ide-scsi has been fixed in lk 2.4.22 (I've sent patches to this list for 2.4 and 2.5 to fix this). A scipt may be useful to scan the output of /proc/scsi/scsi for this class of device and if found manually scan for luns > 0.
Doug Gilbert
BTW, this is in the Linux USB FAQ;
http://www.linux-usb.org/FAQ.html#ts9
Quoted 38 lines · Douglas Gilbert
This is probably old news to USB folks but those
nifty little USB multi card readers (e.g. CF, SD,
MMC, SMC cards etc) appear in Linux as multi lun
targets.Most distros only scan for lun 0 **. So to see
luns > 0, commands like these are needed:echo "scsi add-single-device 1 0 0 1" >
/proc/scsi/scsiecho "scsi add-single-device 1 0 0 2" >/proc/scsi/scsiecho "scsi add-single-device 1 0 0 3" >/proc/scsi/scsiThe above sequence was needed for a 4 slot multi card reader. Following is some
/proc/scsi/scsioutput after an "scsi add-single-device 1 0 0 1" in a 2 slot multi card reader. Notice the end of the model string tells you what type of card is read at that lun.# cat /proc/scsi/scsi Attached devices: Host: scsi0 Channel: 00 Id: 02 Lun: 00 Vendor: hp Model: scanjet 7400c Rev: 0.8A Type: Scanner ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 00 Vendor: Generic Model: USB Storage-SMC Rev: 0090 Type: Direct-Access ANSI SCSI revision: 02 Host: scsi1 Channel: 00 Id: 00 Lun: 01 Vendor: Generic Model: USB Storage-CFC Rev: 0090 Type: Direct-Access ANSI SCSI revision: 02** Most distros don't set
CONFIG_SCSI_MULTI_LUNbecause some "scsi" devices answer all luns. I think that bug in ide-scsi has been fixed in lk 2.4.22 (I've sent patches to this list for 2.4 and 2.5 to fix this). A scipt may be useful to scan the output of/proc/scsi/scsifor this class of device and if found manually scan for luns > 0.
Quoted 8 lines
Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
--
/------------------------------------+-------------------------\
|Stephen J. Gowdy | SLAC, MailStop 34, | |http://www.slac.stanford.edu/~gowdy/ | 2575 Sand Hill Road, | |http://calendar.yahoo.com/gowdy | Menlo Park CA 94025, USA | |EMail: [email protected] | Tel: +1 650 926 3144 |
\------------------------------------+-------------------------/