Re: USB device driver - how use my own?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi,

yes, u are almost near. but first u need to get the vendor and product
id of the mouse for allowing the probe after usb_register() has
registered your driver and probe function.

secondly, u need to know how to read data from the mouse, which all
endpoints exist and what they contain. most often there will be a
standard set of commands sent to the generic devices. u can get such
info from your existing driver.

i've briefed much, and i hope it'll be helpful to you.


On 6/8/06, mgr@xxxxxxxxxxx <mgr@xxxxxxxxxxx> wrote:
Hi again,

Thanks for the answer. I have got the book Linux Device Drivers 3 and I
have read a couple of chapters in it. Though I have some basic questions
anyhow:

I want to experiment with a simple device driver code for a USB mouse. I
have found source code for a USB mouse device driver at
/usr/src/linux-2.6.16.16/drivers/usb/input/usbmouse.c.

I have tested to compile this code and load it into the kernel with insmod.

Now I want to test my device driver in some way, that is, I want to see
that the mouse is using the device driver that I loaded into the kernel.
As I understand it, I have to create a node in /dev and "connect" the
device driver to that node in some way. For instance, if I write cat
/dev/input/mice, I can see some bizarre characters printed in the terminal
as I move the mouse. I guess that I want to create a node
/dev/my_mouse_driver and "attach" my driver to that node and see what
happens when I move the mouse.

Later, I want to write my own device driver code that "answers", that is,
prints with printk to /var/log/messages as I press the buttons on the
mouse. Do you have some suggestions of how to do it?

Thanks a lot in advance.
/ mgr


--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux