Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is linux kernel not using my driver
    primarykey
    data
    text
    <p>I have tried to write a simple linux char device driver using this tutorial: <a href="http://matthias.vallentin.net/blog/2007/04/writing-a-linux-kernel-driver-for-an-unknown-usb-device/" rel="nofollow">http://matthias.vallentin.net/blog/2007/04/writing-a-linux-kernel-driver-for-an-unknown-usb-device/</a></p> <p>I am using slightly newer device and slightly newer kernel. So I used their code changing product and vendor id and I am just trying to make kernel call probe function when device is attached which I failed to do looking at my /var/log/messages. Driver loads successfully: </p> <pre><code>Sep 5 18:32:43 manticore kernel: [10673.664884] usbcore: deregistering interface driver missile_launcher Sep 5 18:32:43 manticore kernel: [10673.664908] [info] usb_ml_exit(661): module deregistered Sep 5 18:32:43 manticore kernel: [10673.666314] usbcore: registered new interface driver missile_launcher Sep 5 18:32:43 manticore kernel: [10673.666317] [info] usb_ml_init(651): driver registered successfully </code></pre> <p>But when device is attached the driver is not used:</p> <pre><code>Sep 5 17:58:12 manticore kernel: [ 8607.295688] usb 3-1.1: New USB device found, idVendor=2123, idProduct=1010 Sep 5 17:58:12 manticore kernel: [ 8607.295689] usb 3-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 Sep 5 17:58:12 manticore kernel: [ 8607.295691] usb 3-1.1: Product: USB Missile Launcher Sep 5 17:58:12 manticore kernel: [ 8607.295693] usb 3-1.1: Manufacturer: Syntek Sep 5 17:58:12 manticore kernel: [ 8607.295789] usb 3-1.1: usb_probe_device Sep 5 17:58:12 manticore kernel: [ 8607.295791] usb 3-1.1: configuration #1 chosen from 1 choice Sep 5 17:58:12 manticore kernel: [ 8607.295797] usb 3-1.1: ep 0x81 - rounding interval to 64 microframes, ep desc says 80 microframes Sep 5 17:58:12 manticore kernel: [ 8607.295855] usb 3-1.1: Successful Endpoint Configure command Sep 5 17:58:12 manticore kernel: [ 8607.296132] usb 3-1.1: adding 3-1.1:1.0 (config #1, interface 0) Sep 5 17:58:12 manticore kernel: [ 8607.296173] usbhid 3-1.1:1.0: usb_probe_interface Sep 5 17:58:12 manticore kernel: [ 8607.296174] usbhid 3-1.1:1.0: usb_probe_interface - got id Sep 5 17:58:12 manticore kernel: [ 8607.298577] usbhid 3-1.1:1.0: looking for a minor, starting at 96 Sep 5 17:58:12 manticore kernel: [ 8607.298697] generic-usb 0003:2123:1010.0008: hiddev0,hidraw2: USB HID v1.10 Device [Syntek USB Missile Launcher] on usb-0000:00:14.0-1.1/input0 Sep 5 17:58:12 manticore kernel: [ 8607.298712] drivers/usb/core/inode.c: creating file '016' Sep 5 17:58:12 manticore kernel: [ 8607.298754] hub 3-1:1.0: port 2, status 0101, change 0000, 12 Mb/s Sep 5 17:58:12 manticore kernel: [ 8607.310627] hub 3-1:1.0: port 2 not reset yet, waiting 10ms Sep 5 17:58:12 manticore kernel: [ 8607.372509] usb 3-1.2: new high-speed USB device number 17 using xhci_hcd Sep 5 17:58:12 manticore kernel: [ 8607.418456] usb 3-1.2: skipped 1 descriptor after configuration Sep 5 17:58:12 manticore kernel: [ 8607.418460] usb 3-1.2: skipped 6 descriptors after interface Sep 5 17:58:12 manticore kernel: [ 8607.418462] usb 3-1.2: skipped 1 descriptor after endpoint Sep 5 17:58:12 manticore kernel: [ 8607.418463] usb 3-1.2: skipped 9 descriptors after interface Sep 5 17:58:12 manticore kernel: [ 8607.419100] usb 3-1.2: default language 0x0409 Sep 5 17:58:12 manticore kernel: [ 8607.421607] usb 3-1.2: udev 17, busnum 3, minor = 272 </code></pre> <p>The code I have that is responsible for making this association is:</p> <pre><code>#define ML_VENDOR_ID 0x2123 #define ML_PRODUCT_ID 0x1010 static struct usb_device_id ml_table [] = { { USB_DEVICE(ML_VENDOR_ID, ML_PRODUCT_ID) }, { } }; static struct usb_driver ml_driver = { .name = "missile_launcher", .id_table = ml_table, .probe = ml_probe, .disconnect = ml_disconnect, }; </code></pre> <p>My kernel version is 3.3.8</p> <p>Any ideas what might be wrong?</p> <p>BTW. I am completely new at this so it is very likely that I skipped some relevant information please ask me if something more is needed.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload