Re: [usb-storage] Toshiba G450 kernel patch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wednesday 07 October 2009 11:25:10 Peter Magdina wrote:
> 
> On Wednesday 07 October 2009 08:56:45 Josua Dietze wrote:
> > Greg KH schrieb:
> > 
> > > On Tue, Oct 06, 2009 at 05:21:01PM -0700, Matthew Dharm wrote:
> > >> On Tue, Oct 06, 2009 at 03:40:35PM -0700, Greg KH wrote:
> > >>> On Tue, Oct 06, 2009 at 02:24:03PM -0700, Matthew Dharm wrote:
> > >>>> On Tue, Oct 06, 2009 at 11:16:07PM +0200, Peter Magdina wrote:
> > >>>>> Imagine you already have some USB serial device plugged and running
> > >>>>> and you decide to plug this one. I am not sure, because I don't
> > >>>>> have much experiences, but I guess you will have to unload usbserial
> > >>>>> module and load it once again with vendor/product params, don't you?
> > >>>>> And what will happen with already using other USB device ?
> > >>>> That's a fair criticism.  But I think the right thing to do here is to make
> > >>>> usb-serial accept new VID/PIDs without needing to be unloaded/reloaded,
> > >>>> then do everything in userspace.
> > >>> That works today for all usb devices with the sysfs new_id file.  So
> > >>> nothing needs to be done :)
> > >> In that case, we should reject this patch and push all of this into
> > >> userspace.
> > > 
> > > Ok, if it works there, fine :)
> > 
> > It does. As I said the script of usb_modeswitch will add the ID to 
> > "option" after switching via "new_id" (if it's not bound to "cdc_acm").
> > 
> > And in the case of the Toshiba device "eject" should work for 
> > switching as well.
> > 
> 
> It seems that decision has been made. 
> Let me please test whole your solution. I can not do it now, 
> but later in the afternoon or in the evening I will test it 
> and let you know the result.

Finally I did this test on kernel without my patch to proof
that it fully works also from userspace:
- plugged Toshiba G450 modem into USB port
- usb-storage module was loaded and detected it as a CD-ROM
- I ran eject /dev/sr1  command which ejected the device from /dev/sr1
- devices switched over to modem - I saw it in syslog 
- as I did not have usbserial and option modules loaded, I had to load them
  to have /sys/bus/usb-serial/drivers/option1/new_id available
- then I did: echo '0930 0d45' >new_id
- option modules discovered 3 serial ports and created 3 serial devices in /dev
- than I also tried pppd connection to the provider and browsed a bit
It works perfect.

However, one conclusion is here.
If you want to put it only into userspace (without even patching option
driver to support this device), then udev scripts must handle if option
driver is already loaded or not and eventually load it and write new VID/PID
to "new_id".
If this whole handling is ok according to you, then I don't mind.
But as far as there exists other VIDs/PIDs in option driver, it would be
nice to put also this one there and than the only thing which will have to
be done by udev script is to eject the device.

I also tried this (I was thinking to use it in udev script):
/lib/udev/modem-modeswitch -v 0x0930 -p 0x0d46 -t option-zerocd -d
D: Found mass storage device:
D:   Endpoints: 2
D:   Class:     0x8
D:   SubClass:  0x6
D:   Protocol:  0x50
D: Found modem mass storage device '006'
D: 006: REZERO command sent.
D: 006: failed to switch device to modem mode.

This is used in /lib/udev/rules.d/61-option-modem-modeswitch.rules
but as you can see, it didn't work.

Peter
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux