0
votes

Every USB device has to come under some USB device class definition based on the device driver will get use on the Linux system.. that part i understood.

but I can't understand something. For example, mostly all USB modem come under communication device class.. I have one 3G USB modem and one 3G USB dongle (e.g.,tata photon), both come under the same communication class but 3G USB modem uses CDC-ACM driver and 3G dongle uses serial converter driver(USB-Serial). What makes these devices differs?

Can anyone explain this?

3
Could you include the output of verbose lsusb for each device you mentioned? Also, what commands did you run to determine the devices use different drivers and what were the outputs of those commands?David Grayson

3 Answers

1
votes

The source code of Linux is available so you can look to see how it works. Here is the source code of the cdc-acm USB driver you mentioned: http://lxr.linux.no/linux+v3.12.2/drivers/usb/class/cdc-acm.c

Look at the acm_ids[] array near line 1516. This is a big array of structs that describe which USB devices the cdc-acm driver will match to. It looks like the array starts with quirky devices and then at the end has more standard, generic devices. See if you can find the line that matches each device you have! This array is passed to some more general USB code in the kernel that takes care of matching USB devices to drivers.

0
votes

The USB device dictates what type of driver will load. If it presents itself with CDC Class descriptors then it will load a CDC class driver (the same goes for other types of devices such as USBAudio, HID Keyboard/Mouse, etc.).

If the USB device presents itself with vendor specific descriptors then it will need to do matching on the VID and PID to determine which vendor specific driver to load. In the case of USB to serial bridges there are many vendors, so the driver loaded depends on your specific cable. You can find the source for the usbserial based drivers in root/drivers/usb/serial/, and from there you can grep for the VID/PID of your device to find out which driver is being loaded for that interface.

It looks like there was a recent commit for a 3G dongle, maybe this is what you are looking for?

-1
votes

The source code for all Linux drivers is available... you could see for yourself by looking at the source code.