On Fri, 2 Feb 2007 17:53:29 +0100, Wolfgang Mües <[EMAIL PROTECTED]> wrote:
> On Freitag, 2. Februar 2007, Till Harbaum / Lists wrote:

> > > > [  221.798000] SCSI device sdc: 1992704 512-byte hdwr sectors (1020 MB)

> > > There you see it.  The card reader reports that the card contains only 
> > > about 1 GB, not 2 GB.

> > i have a similar card. I somehow figured out that this card in fact
> > has 1k sectors, not 512 bytes
> 
> No. The card has 512 bytes per sector (this is fixed for all SD cards),
> but the CAPACITY of the card is reported in 1K sectors. (because with 
> 512 Byte sectors, it is NOT possible to report 2 GByte capacity for a 
> SD card).

Capacity may be reported in 1K sectors by the SD card, but as you see
the reader reported it in 512 byte sectors. The sector size is reported
in the SCSI's READ CAPACITY response, but obviously the reader provides
the remapping.

> The driver is supposed to "know" this anomaly and always use 512 as the 
> sector size. (Or the card reader microcontroler?!?).

I'm afraid the USB storage driver can't help it. It operates within
the framework of SCSI.

BTW, I suspect that remapping is always necessary, if SD standard devices
report _capacity_, because SCSI devices actually report _last block
address_ (which is 1 less than the capacity). The reader's firmware
has to subtract 1 even if it puts 1024 into the block size in the
reply payload.

The interesting question is, how does that combination of card and reader
works in Windows for Kobajashi? I do not see an obvious software trick.
The only remote possibility is to ignore the size reported by the
device, and use the size set in the partition table. A program can
be run which reads the partition table, then forces the device size
through /sys/block/sda/size_override or something.

-- Pete

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to