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?

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

You wrote

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

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.

Let me try to ask the original author why detection was needed
for him and cc Jimmie Mayfield.

Andries


-------------------------------------------------------
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