|
From: Martin R. <spl...@gm...> - 2017-11-13 08:01:26
|
>What, exactly, are you hoping to do? There's really no opportunity to do anything fancy or innovative with a USB mouse. It does what the spec requires. There are no hidden capabilities. It works as it should, but it cannot be *configured* within a Linux distro. The mouse in question is A4TECH bloody P85, It has 8 RGB LEDs on different parts of the mouse, profile switching, macros and possibly more. I ideally want to write something that replaces at least some parts of the proprietary driver. https://i.imgur.com/wGg7D1G.png - screen of some of the parts that I'm trying to reverse atm. >I don't know what you mean by "not passed through" Virtualization software let's you pass through a USB device to the VM, so the VM has "direct" access to it. I am not sure what actually happens behind the scenes for this, but it gives enough access to even flash firmware to the device. - screen of virt-manager's UI for this https://i.imgur.com/DyUOEAp.png >Note that, in Linux, each device can be owned by only one driver. You can't have your driver AND have another driver still operate. I think I may perhaps have caused confusion by calling what I want to write a "driver". I don't want to write something that translates mouse movement/button presses and interprets them, I want to write something that can interact with the LEDs and possibly flash configuration to the mouse's in-built memory so I can set stuff like macros within Linux. Should I call this something else than a "driver"? > That's EBUSY. It could mean that you are sending a control message aimed at one of the HID interfaces, and you have not claimed the HID interface. I don't see any calls to claim interfaces in your code at all. Thanks, something to read about. Hopefully I can both make my "app" work while the device is passed through after understanding that. It's very annoying to turn the VM on, test something in the proprietary driver and then have to shut it off when I want to try send instructions to it on my own. I guess in the worst case I could possibly work around this by writing something that runs on the VM and control it from there. On Mon, Nov 13, 2017 at 6:33 AM, Tim Roberts <ti...@pr...> wrote: > On Nov 12, 2017, at 12:38 PM, Martin Rys <spl...@gm...> wrote: > > > I've decided to reverse a driver for the mouse I bought, and I got to > a point where I have a working VM with proprietary drivers I'm trying > to reverse and wireshark works to see what's happening on USB. > > > There's really no need to reverse-engineer this. All USB mice work exactly > the same, and all of the USB specifications are detailed and freely > available. You can download the HID class spec fro the USB Implementor's > Forum at www.usb.org and learn exactly what your device is doing. > > What, exactly, are you hoping to do? There's really no opportunity to do > anything fancy or innovative with a USB mouse. It does what the spec > requires. There are no hidden capabilities. > > > My issue is that __I can only run this program while the device is not > passed through__, if I do I get what seems to be an IO error. > > > I don't know what you mean by "not passed through". A USB device can only > be claimed by one driver at a time. If some other driver owns your mouse, > you can't have it. > > > libusb: error [submit_control_transfer] submiturb failed error -1 errno=16 > > > That's EBUSY. It could mean that you are sending a control message aimed at > one of the HID interfaces, and you have not claimed the HID interface. I > don't see any calls to claim interfaces in your code at all. > > > I'd welcome any help or pointers on how to fix the issue so I can send > custom commands to the mouse while also having it work with the > proprietary drivers at the same time. > > > Are you sure it uses proprietary drivers, and not the standard HID driver? > Note that, in Linux, each device can be owned by only one driver. You can't > have your driver AND have another driver still operate. > — > Tim Roberts, ti...@pr... > Providenza & Boekelheide, Inc. > > > ------------------------------------------------------------------------------ > Check out the vibrant tech community on one of the world's most > engaging tech sites, Slashdot.org! http://sdm.link/slashdot > _______________________________________________ > libusb-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libusb-devel > |