I know I am not supposed to get too much help on the eudyptula challenges, but I can't seem to figure this last thing out. The goal is to write (the skeleton of) a usb driver module that loads and registers the driver when a usb keyboard is plugged in. What I have so far does exactly that except that the struct usb_driver: 1) probe function is not called (neither via keyboard plugin nor when module is loaded manually with modprobe). 2) disconnect function is called only after the module is unloaded (with rmmod) AND THEN the keyboard is unplugged.
From ldd3: for probe: "This function is called by the USB core when it thinks it has a struct usb_interface that this driver can handle." for disconnect: "This function is called by the USB core when the struct usb_interface has been removed from the system or when the driver is being unloaded from the USB core."
From the quotes, it seems the kernel does not think my driver is valid to handle the keyboard (though 2 may not actually be abnormal behavior). I am thinking, perhaps the struct usb_device_id table is wrong or incomplete:
static struct usb_device_id hw_id_table[] = { {USB_INTERFACE_INFO(USB_INTERFACE_CLASS_HID, USB_INTERFACE_SUBCLASS_BOOT, USB_INTERFACE_PROTOCOL_KEYBOARD)}, {} }; MODULE_DEVICE_TABLE(usb, hw_id_table); There is also a USB_DEVICE_INFO() macro, but I cannot seem to find a file analogous to include/uapi/linux/hid.h which (would) define the arguments to USB_DEVICE_INFO(). Is this the problem? Or am I missing something else? Thanks for the info, Jaret
Well...I guess I've learned my lesson. I apologize for asking the previous question related to the Eudyptula Challenge. I did not read the August 2014 status report well enough and did not realize it was against the rules to ask questions the community. It was not my intention to start off my interactions with the community on the wrong foot. If it is any consolation, the main reason I asked is that I thought there might be an outside module, or something else, in the kernel affecting my particular usb driver module. Since this (possible) "outside interference" wasn't directly related to the understanding of code within the module itself (which I wrote on my own), I thought it would OK to get some input on where to go. My apologies again for the question and I hope I can interact with you all in a more positive light in the future. -Jaret On Thu, Aug 14, 2014 at 3:21 PM, Jaret Flores <jarflores@gmail.com> wrote:
I know I am not supposed to get too much help on the eudyptula challenges, but I can't seem to figure this last thing out.
The goal is to write (the skeleton of) a usb driver module that loads and registers the driver when a usb keyboard is plugged in. What I have so far does exactly that except that the struct usb_driver:
1) probe function is not called (neither via keyboard plugin nor when module is loaded manually with modprobe). 2) disconnect function is called only after the module is unloaded (with rmmod) AND THEN the keyboard is unplugged.
From ldd3: for probe: "This function is called by the USB core when it thinks it has a struct usb_interface that this driver can handle." for disconnect: "This function is called by the USB core when the struct usb_interface has been removed from the system or when the driver is being unloaded from the USB core."
From the quotes, it seems the kernel does not think my driver is valid to handle the keyboard (though 2 may not actually be abnormal behavior). I am thinking, perhaps the struct usb_device_id table is wrong or incomplete:
static struct usb_device_id hw_id_table[] = { {USB_INTERFACE_INFO(USB_INTERFACE_CLASS_HID, USB_INTERFACE_SUBCLASS_BOOT, USB_INTERFACE_PROTOCOL_KEYBOARD)}, {} };
MODULE_DEVICE_TABLE(usb, hw_id_table);
There is also a USB_DEVICE_INFO() macro, but I cannot seem to find a file analogous to include/uapi/linux/hid.h which (would) define the arguments to USB_DEVICE_INFO(). Is this the problem? Or am I missing something else?
Thanks for the info, Jaret
On Aug 15, 2014 8:28 AM, "Jaret Flores" <jarflores@gmail.com> wrote:
Well...I guess I've learned my lesson. I apologize for asking the previous question related to the Eudyptula Challenge. I did not read the August 2014 status report well enough and did not realize it was against the rules to ask questions the community. It was not my intention to start off my interactions with the community on the wrong foot.
Its part of the fun to find out yourself how to do this task. i have taken the longest time and maximum number of attempts for this task.but when finally little tells you that task is complete , you will get a feeling of achievement and you will also say "sh** .. it was this easy...". i hope i have not broken the rules by replying....
If it is any consolation, the main reason I asked is that I thought there might be an outside module, or something else, in the kernel affecting my particular usb driver module. Since this (possible) "outside interference" wasn't directly related to the understanding of code within the module itself (which I wrote on my own), I thought it would OK to get some input on where to go.
My apologies again for the question and I hope I can interact with you all in a more positive light in the future. -Jaret
On Thu, Aug 14, 2014 at 3:21 PM, Jaret Flores <jarflores@gmail.com> wrote:
I know I am not supposed to get too much help on the eudyptula challenges, but I can't seem to figure this last thing out.
The goal is to write (the skeleton of) a usb driver module that loads and registers the driver when a usb keyboard is plugged in. What I have so far does exactly that except that the struct usb_driver:
1) probe function is not called (neither via keyboard plugin nor when module is loaded manually with modprobe). 2) disconnect function is called only after the module is unloaded (with rmmod) AND THEN the keyboard is unplugged.
From ldd3: for probe: "This function is called by the USB core when it thinks it has a struct usb_interface that this driver can handle." for disconnect: "This function is called by the USB core when the struct usb_interface has been removed from the system or when the driver is being unloaded from the USB core."
From the quotes, it seems the kernel does not think my driver is valid to handle the keyboard (though 2 may not actually be abnormal behavior). I am thinking, perhaps the struct usb_device_id table is wrong or incomplete:
static struct usb_device_id hw_id_table[] = { {USB_INTERFACE_INFO(USB_INTERFACE_CLASS_HID, USB_INTERFACE_SUBCLASS_BOOT, USB_INTERFACE_PROTOCOL_KEYBOARD)}, {} };
MODULE_DEVICE_TABLE(usb, hw_id_table);
There is also a USB_DEVICE_INFO() macro, but I cannot seem to find a file analogous to include/uapi/linux/hid.h which (would) define the arguments to USB_DEVICE_INFO(). Is this the problem? Or am I missing something else?
Thanks for the info, Jaret
_______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
On Fri, 15 Aug 2014 09:35:57 +0530, Sudip Mukherjee said:
finally little tells you that task is complete , you will get a feeling of achievement and you will also say "sh** .. it was this easy...".
Later on, you'll realize that there were at least 3 even easier ways to do it. :)
i hope i have not broken the rules by replying....
No, you're no afoul of the rules. Now, if you'd talked about the actual solution, *then* we'd have to smack you. :)
On Aug 15, 2014 9:46 AM, <Valdis.Kletnieks@vt.edu> wrote:
On Fri, 15 Aug 2014 09:35:57 +0530, Sudip Mukherjee said:
finally little tells you that task is complete , you will get a
feeling of
achievement and you will also say "sh** .. it was this easy...".
Later on, you'll realize that there were at least 3 even easier ways to do it. :)
I was thinking i have done it the easiest way ... 3 more ways?? great.. i was thinking what to do while i am waiting for my task14 results .. after i find the other ways, can i send the result to little again to check??
i hope i have not broken the rules by replying....
No, you're no afoul of the rules. Now, if you'd talked about the actual solution, *then* we'd have to smack you. :)
Actually, is it possible to obtain what the tasks are even if you are not part of the challenge? I am sour about being removed from the challenge, but ultimately just want to do the tasks. It isn't all that important to me to do it officially. On Friday, August 15, 2014, <Valdis.Kletnieks@vt.edu> wrote:
On Fri, 15 Aug 2014 09:35:57 +0530, Sudip Mukherjee said:
finally little tells you that task is complete , you will get a feeling of achievement and you will also say "sh** .. it was this easy...".
Later on, you'll realize that there were at least 3 even easier ways to do it. :)
i hope i have not broken the rules by replying....
No, you're no afoul of the rules. Now, if you'd talked about the actual solution, *then* we'd have to smack you. :)
Its part of the fun to find out yourself how to do this task. i have taken the longest time and maximum number of attempts for this task.but when finally little tells you that task is complete , you will get a feeling of achievement and you will also say "sh** .. it was this easy...". i hope i have not broken the rules by replying....
I agree with this. Like I said, I only asked because I thought there might be another module loaded keeping mine from working correctly. Also, I wouldn't have asked if I knew it was against the rules! (and certainly would not have mentioned the challenge in the first line of my email!) But perhaps directing my own kernel studies will provide me a better understanding than doing tasks handed out to me....or maybe that is just positive thinking.
participants (3)
-
Jaret Flores -
Sudip Mukherjee -
Valdis.Kletnieks@vt.edu