Subject: Re: usb flash reader
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 08/29/2002 22:15:20
On Wed, Aug 28, 2002 at 12:25:18AM +0400, Valeriy E. Ushakov wrote:
> I've bought a PQI 7-in-1 USB flash reader and after adding few quirks
> it attaches like this:
> 
> umass0 at uhub0 port 1 configuration 1 interface 0
> umass0: Neodio Multi-format Flash Controller, rev 1.10/1.00, addr 2
> umass0: using SCSI over Bulk-Only
> scsibus0 at umass0: 2 targets, 4 luns per target
> scsibus0: waiting 2 seconds for devices to settle...
> sd0 at scsibus0 target 1 lun 0: <Generic, USB Storage-SMC, 0090> SCSI0 0/direct removable
> sd0(umass0:0:1:0):  Check Condition on CDB: 0x25 00 00 00 00 00 00 00 00 00
>     SENSE KEY:  Not Ready
>      ASC/ASCQ:  Medium Not Present
> 
> sd0(umass0:0:1:0): could not get size
> sd0: 0, 0 cyl, 64 head, 32 sec, 512 bytes/sect x 0 sectors
> sd1 at scsibus0 target 1 lun 1: <Generic, USB Storage-CFC, 0090> SCSI0 0/direct removable
> sd1: 14656 KB, 14 cyl, 64 head, 32 sec, 512 bytes/sect x 29313 sectors
> sd2 at scsibus0 target 1 lun 2: <Generic, USB Storage-MMC, 0090> SCSI0 0/direct removable
> sd2(umass0:0:1:2):  Check Condition on CDB: 0x25 40 00 00 00 00 00 00 00 00
>     SENSE KEY:  Not Ready
>      ASC/ASCQ:  Medium Not Present
> 
> sd2(umass0:0:1:2): could not get size
> sd2: 0, 0 cyl, 64 head, 32 sec, 512 bytes/sect x 0 sectors
> sd3 at scsibus0 target 1 lun 3: <Generic, USB Storage-MSC, 0090> SCSI0 0/direct removable
> sd3: 3952 KB, 3 cyl, 64 head, 32 sec, 512 bytes/sect x 7904 sectors
> 
> 
> Is it possible to convince the kernel not to attach sdN that don't
> have a flash card plugged in (sd0 and sd2 in this case), i.e. when
> device reports that medium is not present?

Dynamically, it's not possible without hacking the sources.
In your kernel config file you can probably hardwire to only attach sd1 and sd3:
scsibus0 at umass?
sd0 at scsibus0 target 1 lun 1
sd1 at scsibus0 target 1 lun 3
But it won't be confortable if you have more than one scsibus.

I don't know why the kernel is so verbose here. It should probably
just print "drive offline" for empty slots.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
--