Phew, this is a really complex topic. Multiple LUNs at multiple levels :(

[EMAIL PROTECTED] wrote:
My own sources have somewhere at the top of datafab.c the comment

/*
 * Commands: 8 bytes
 * Three commands are known:
 *
 * Identify:     00 01 00 00 00 a0 ec 01
 * (with b0 instead of a0 for LUN 1).
 *
 * Read:         00 nn xx xx xx ex 20 01
 * (with f0 instead of e0 for LUN 1;
 *  nn: sector count, xx: sector, 28 bits, little endian)
 *
 * Write:        00 nn xx xx xx ex 30 02
 * (idem; returns 2-byte status reply)
 *
 * Note that EC, 20, 30 are the ATA commands
 * IDENTIFY DRIVE, READ SECTORS, WRITE SECTORS.
 */

The device I played with recently is an Apacer CF+SM,
where this datafab.c is used for the CF part, which is lun 0
of the device, and I use lun 0 of the datafab part.

(There are various concepts of lun here. In the below I do not
mean scsi or usb lun, but info->lun, the datafab lun.)

From you I understand that you have a single-use device
and both lun 0 and lun 1 work - is that true?
> That is, does your device work both with info->lun = 0
> and with info->lun = 1?

Well, no: If "b0" is sent during Identify to the device I never get a proper 512 byte (aka. medium present) result, only for "a0". Maybe it is possible with some soldering to make my CF reader a dual slot CF reader, I don't know. But when lun detection determines the lun the same CF can be accessed by means of using "sda" or "sdb" which is somehow shaky.

I have a more fundamental question: Why do we need lun detection?

You wrote


info->lun = srb->device->lun;

Keep in mind that this does only work when the two subdevices are never accessed parallel! My idea was to remove the info->lun variable and add a lun parameter to every datafab.c function.


and maybe that would work. These are two very different animals
in principle, but maybe it is true that if the datafab is used
for two devices the usb 0,1 are mapped this way, randomly, to
the datafab 0,1. While if the datafab is used for one device
maybe it does not matter which lun is used.

That last sentence expresses my uncertainty: it is conceivable
that datafab.c is called with srb->device->lun == 1 while
only datafab lun 0 works. That would be a case where we need
detection.

IMHO it does not matter if only a single lun works. The user has to find the correct one, which should be in all cases the first one (sda). The second one will always be reported as "medium not present". Or we simply report the datafab as a single lun device and use the lun detection.


greetings,
eduard.



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to