macOS, bypassing HID for raw userland USB

I’ve a particular HID device whose support/operation is lacking using the normal HID driver, basically it won’t deliver certain reports (that the driver can’t identify from parsing the descriptor..).

However, I know exactly how to control and listen to it via sniffing the traffic.

It should be straightforward for me to write a userland usb driver, but how in these 10.13+ days do we tell the original HID driver to stop taking control of it?

I believe in the past it was a matter of a codeless kext, and presumably I’d also have to disable SIP (or do they hand out certs for this usage?).

Are there any ‘nicer’ ways of blacklisting a particular device from the HID driver, or some other approach that would be better?



ps, likely incoming apple bug report once I better determine how the HID driver is failing, specifically why the descriptor looks truncated.

Follow up on a detail I’ve not seen documented or mentioned elsewhere.


It would seem that if you have a userspace USB driver waiting on a matching notification, then it will (can/always?) grab exclusive access of the device before the default HID driver does.

Whilst this doesn’t help if the device was already attached at boot, it is rather handy during development when you can plug/unplug the device at will.

macOS, bypassing HID for raw userland USB
 
 
Q