Skip to contentSkip to conversation

help with writing a usb mouse driver

DISCUSSION Jeffrey Lim 2 participants 2 messages Nov 27, 2004 – Dec 1, 2004

lore
Share & tools
lore
#0 lore raw

Note: pls cc me in any replies as i'm not subscribed to the list.

hi guys, i've been trying to write a usb mouse driver for a custom mouse, but i'm getting stuck.

I previously started out with trying to hack usbmouse.c, but apparently after a wild goose chase, it seems that that is not the recommended path to take. It supposedly conflicts with the hid driver, though in what way i do not know. (If somebody could enlighten me on this, pls do. Documentation/input/input.txt does not really explain why).

So now it almost seems as if the only code i have for analysis and as a sample is the hid code (hid-core.c, hid-input.c, i assume). But the problem for me is that this code is too complex for me, and really doesn't offer the easiest way to get started on this project. I'm not too sure usb-skeleton.c does it either, because it doesn't have the code for interfacing with the input layer.

While i could take some pointers for interfacing with the input layer from usbmouse.c, i really don't see how I could differentiate what code to take, cos heck, that thing doesnt even work (conflicts with hid), and I don't even know why! (That thing looks pretty ok to me).

Could somebody give me some pointers on how to go about starting my project, and where I might perhaps be able to get my hands on some code that i can work with?

I'm using kernel 2.4.20.

Thanks,
-jf

#1 lore raw
Quoted 11 lines · Jeffrey Lim

Note: pls cc me in any replies as i'm not subscribed to the list.

hi guys, i've been trying to write a usb mouse driver for a custom mouse, but i'm getting stuck.

I previously started out with trying to hack usbmouse.c, but apparently after a wild goose chase, it seems that that is not the recommended path to take. It supposedly conflicts with the hid driver, though in what way i do not know. (If somebody could enlighten me on this, pls do. Documentation/input/input.txt does not really explain why).

The Kconfig documentation for that driver should explain why. usbmouse.c is for USB Boot Protocol Mice only. Only if you understand what this protocol is, should you use that driver. Everyone else should use the hid driver.

Quoted 6 lines

So now it almost seems as if the only code i have for analysis and as a sample is the hid code (hid-core.c, hid-input.c, i assume). But the problem for me is that this code is too complex for me, and really doesn't offer the easiest way to get started on this project. I'm not too sure usb-skeleton.c does it either, because it doesn't have the code for interfacing with the input layer.

What kind of usb mouse do you have? Is it a HID mouse? Or some custom protocol?

Also, this should be discussed on the linux-usb-devel mailing list, there are more Linux usb developers there than on linux-kernel.

Quoted 1 line

I'm using kernel 2.4.20.

Ick, why? What's wrong with the latest 2.4 or 2.6 kernel?

thanks,

greg k-h