Usb module loading

selva selvabe99 at gmail.com
Fri Aug 8 02:12:05 EDT 2014


Hi All

I have written a usb module which will be linked if any keyboard
is hot plug.

I follow the step below to make it work

1) rmmod usbhid

2) insmod hello.ko

3) hot plug the keyboard

when the keyboard is hot plugged my kernel module gets loaded and in
syslog the messages regarding the detection of the keyboard are present.

My problem is i have to always remove "usbhid", if i donot that
then "usbhid" module is always linked with the keyboard.

How to make make sure that my module usb_kbd.ko gets linked to the keyboard
with out removing "usbhid" ?

My code is present in the following link

https://github.com/selvagit/little_penguin/blob/master/task_05/hello.c

The syslog is present in the following path

https://github.com/selvagit/little_penguin/blob/master/task_05/syslog

I had looked at udev rules, but what i have understood is we can set attributes
for the modules but we can not determine which kernel module should be
loaded for
any device.

Thanks,
Selvaraj



More information about the Kernelnewbies mailing list