Re: [usb-storage] Toshiba G450 kernel patch

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

 




On Wednesday 07 October 2009 18:23:02 Josua Dietze wrote:
> Alan Stern schrieb:
> 
> > On Wed, 7 Oct 2009, Peter Magdina wrote:
> >> 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 agree, the IDs should be added to the option driver.  That is a 
> > small, self-contained, unobjectionable patch.  When it is added, the 
> > user won't need to do anything other than run the eject or modeswitch 
> > programs.
> 
> There is really no argument about the eventual adding of IDs to the 
> modem drivers. The "new_id" method is mainly an instant help for 
> hitherto unknown devices.

Here is my temporary solution with udev rules file:
# Switch the device over from CD-ROM emulation mode to modem mode
ACTION=="add", SUBSYSTEM=="scsi_generic", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="0d46", RUN+="/usr/bin/eject /dev/%k"

# Load option module when the modem mode of the device is detected
ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="0d45", RUN+="/sbin/modprobe option"

# Set modem IDs as a new serial port device to option driver
ACTION=="add", SUBSYSTEM=="drivers", DEVPATH=="/bus/usb-serial/drivers/option*", RUN+="/bin/sh -c 'echo 0930 0d45 >/sys/%p/new_id'"

# Toshiba G450 HSDPA modem udev rules
# Signed-off-by: Peter Magdina <peter@xxxxxxxxxx>

# Switch the device over from CD-ROM emulation mode to modem mode
ACTION=="add", SUBSYSTEM=="scsi_generic", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="0d46", RUN+="/usr/bin/eject /dev/%k"

# Load option module when the modem mode of the device is detected
ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="0d45", RUN+="/sbin/modprobe option"

# Set modem IDs as a new serial port device to option driver
ACTION=="add", SUBSYSTEM=="drivers", DEVPATH=="/bus/usb-serial/drivers/option*", RUN+="/bin/sh -c 'echo 0930 0d45 >/sys/%p/new_id'"

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

  Powered by Linux