Re: HID device question.

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

 



On Mon, 5 Sep 2011, Chris Furlough wrote:

> Alan, I'm learning as I go on this stuff.
> 
> Let me tell you what I need to do, and if you can tell me the proper way to 
> take over the file ops, I'll do that, and I believe I can handle the rest on 
> my own.
> 
> Client applications will use libusb to talk to the device.
> 
> The device may be inserted before the driver is loaded, in which case it 
> will be claimed by the HID driver.  (It ISN'T a HID device, and doesn't 
> support the "reports" interface.  All communications are accomplished 
> through the IOCTLS issued from inside libusb.)
> 
> That being the case, I need to take over the IOCTL "vector" for 
> communications with the device.  Open, Release, Read, Write, can all stay 
> the same.
> 
> I would gladly accept API references, pointers to example code, etc.

I'm not particularly familiar with the chardev interface -- the Linux 
Device Drivers book is probably a good place to start.

I think what you need to do is overwrite the file ops pointer in 
usb_device_cdev.  Your new file_operations can be the same as the 
existing one, all except for the ioctl method pointer.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux