From: Josua Dietze on
Oliver Neukum schrieb:

> Am Donnerstag, 17. Dezember 2009 14:33:06 schrieb Josua Dietze:
>> If you are thinking about the two specific devices at hand
>> there is no need to tell them apart. Same IDs on plugin, same
>> switching procedure, different IDs on return, different drivers
>> take care.
>
> How do you issue an eject command without a /dev/sgX node?


You're thinking of handling one device in the kernel and the other
one (same ID, same switching procedure) on the outside?

Well, as I said, you'd have to "filter" additional data (USB
model/manufacturer etc., SCSI_INQUIRY strings). But obviously you
would need to have the data of the two devices to note the differences.

BTW, usb_modeswitch does not need SCSI device nodes, because it
talks to the USB device directly via the bulk message layer once the
endpoints are up. Slight advantage over "eject".


Cheers,
Josua

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Matthew Dharm on
On Thu, Dec 17, 2009 at 02:02:41PM +0100, Oliver Neukum wrote:
> Am Mittwoch, 16. Dezember 2009 20:52:58 schrieb Matthew Dharm:
> > > > If this is the case, then the only reasonable answer to is to push the
> > > > modeswitch code for both into udev and out of the kernel. It will take
> > >
> > > you mean usb_modeswitch, not udev actually.
> >
> > That is correct; I had mis-typed. Tho, the actual implementation is udev
> > calling usb_modeswitch and/or eject.
>
> Can storage tell the devices apart so that it knows which ones to leave
> to the kernel solution and which devices to accept so that udev can
> issue an eject command?

Maybe. Depends on how identical the devices are. We would need to compare
descriptors between the two devices.

Matt

--
Matthew Dharm Home: mdharm-usb(a)one-eyed-alien.net
Maintainer, Linux USB Mass Storage Driver

E: You run this ship with Windows?! YOU IDIOT!
L: Give me a break, it came bundled with the computer!
-- ESR and Lan Solaris
User Friendly, 12/8/1998