Welcome to the Linux Foundation Forum!

How to get device pointer address in Kernel Module

Hi everybody,

I want to use

static inline int hid_hw_raw_request(struct hid_device *hdev,
unsigned char reportnum, __u8 *buf,
size_t len, unsigned char rtype, int reqtype)
{

https://elixir.bootlin.com/linux/v4.14.188/source/include/linux/hid.h#L1019

in my kernel module. How can I get hdev of existing /dev/hidraw0 ?

hdev = give_me_the_address_of(dev/hidraw0) :smiley:

Regards, PP

Comments

  • powerpenguinpowerpenguin Posts: 4
    edited July 11

    No Ideas ? whats going on with the kernel module professionals !
    Is it not possibe to catch a already existing registered device class pointer out of its own defined module class ? No one knows how to do ?
    Looks like its not triva ..but dissapapoiting !

  • Is there an alternative Forum URL where i can find Linux Guru Level Kernel Module Know How.. Looks like you will not get any answer if you are not a platinum sponser like my company is :-)

  • Oh a good hint for the "Security Architects" Kernel module classes schuld only communicate by user space, but hidraw input module e.g keybord is dowing nearly same i want in my kernel module.. now one knows how it grabs the dev of the /dev/hidraw x ? By self registers a own class. I have Plattform module class !

Sign In or Register to comment.