LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-27-2013, 03:53 AM   #1
mateo23
LQ Newbie
 
Registered: Nov 2013
Posts: 4

Rep: Reputation: Disabled
driver writing: how to retrieve a hid_device out of context


Hi all,

I am trying to write a custom driver for a HID device.

I understand how to access the device when my driver is called by hid-core hooks (like : .open/.probe/.remove/.raw_event...), since the "struct* hid_device" context comes along.

But I am not quite sure how to have a user-space event trigger access to the device (e.g. by echoing into a chardev node). How can I then retrieve the proper *hid_device , out of context?

I try and learn by reading existing in-kernel specific hid driver but somehow I can't figure out that part.
Thanks for any lead, I 'll do my homework.

m
 
Old 12-10-2013, 02:57 AM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
I don't have much experience with this type of practice. Sorry

These links may prove as useful and get you started.
http://stackoverflow.com/questions/1...out-of-context
http://www.usb.org/developers/hidpage/
http://linux.die.net/man/7/create_trigger
http://unix.stackexchange.com/questi...sb-hid-devices

You could just use a custom driver or generic that would normally take over the device.

In my search for you I found out that the HID subsystem needs 2 kinds of drivers-
http://www.mjmwired.net/kernel/Docum...n/hid/uhid.txt

Hope that helps
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How can I retrieve pci domain from struct pci_dev in pci driver probe? dbrazeau Linux - Kernel 0 04-07-2013 02:47 AM
Is it possible to retrieve an opengl context from *nix the command line? FragBoog Programming 5 03-14-2009 05:20 AM
failed to retrieve proprietary driver swright007 Linux - Newbie 1 12-20-2008 05:00 AM
writing driver alice95089 Linux - Software 0 04-06-2005 03:55 AM
writing driver modules unicorn21 Programming 1 12-15-2003 01:01 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration