Re: The problems about the dynamic id loading in Linux usb drivers.

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

 



On Sat, Jan 24, 2009 at 03:34:34PM +0800, fangxiaozhi 00110321 wrote:
> 
> Dear Greg KH:
> 
>     How are you?
> 
> I am sorry to trouble you about the problem about the USB serial
> driver dynamic ID loading.
> 
> We have a composite device with new PID, which the current linux
> current can not support.
> 
> So we want to make the linux kernel can support it with the dynamic ID
> feature, but not the static ID feature.
> 
> I rebuild the linux kernel source code, such as 2.6.25.5, and change
> the dynamic ID feature switch "no_dynamic_id"of usb-serial.c and
> option.c from 1 into 0.
>      static struct usb_driver usb_serial_driver = {
>          .name =  "usbserial",
>          .probe = usb_serial_probe,
>          .disconnect = usb_serial_disconnect,
>          .suspend = usb_serial_suspend,
>          .resume = usb_serial_resume,
>          .no_dynamic_id =  0,/*its default value is 1*/
> };

Ick, no, that's not going to work.

> After rebuilded, I reboot the system, then plug our device into
> system, before or after running the following command sequences:
>        modprobe usbserial
>        echo 12d1 140c > /sys/bus/usb/drivers/usbserial/new_id
> 
> Then I find the system will run the function of store_new_id(), which
> is in ../core/driver.c, but not in ../serial/bus.c, then
> usb_store_new_id() is called to add the dynamic ID into the dynamic
> list of usbserial, then tries to attach usbserial driver to the usb
> devices in the bus.

Note that you need the usb-serial driver to bind to the usb device.
Then an additional "bus" is created that the usb-serial drivers bind to,
which is what you want your driver to bind to, right?

> Can you help me to find the problems what it is?

Just write your new id to the usb-serial driver's "new_id" file.

For example, if you want to add a new id to the pl2303 driver, you would
write it to:
	/sys/bus/usb-serial/drivers/pl2303/new_id/

What driver do you want to add your device id to?  Why not just send a
patch with that id in it so we can add it to the kernel tree properly?

thanks,

greg k-h
--
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