All of lore.kernel.org
 help / color / mirror / Atom feed
* Extend device driver?
@ 2016-09-10 14:41 Pol Eyschen
  2016-09-10 15:14 ` Greg KH
  0 siblings, 1 reply; 5+ messages in thread
From: Pol Eyschen @ 2016-09-10 14:41 UTC (permalink / raw)
  To: kernelnewbies

Hi everyone,

I want to implement some custom functions of my mouse (Madcatz RAT5) in 
Linux, e.g custom DPI-values. As this requires writing over USB to the 
firmware of the mouse I was thinking of writing a module to accomplish 
this. However I don't want to reimplement a whole mouse-driver,so I 
wanted to ask if there is a possibility of binding the device to 2 
modules or having my module extend usbhid, so that my module would only 
be used to perform these custom operations while usbhid stays in charge 
of the whole "mouse business".


Thanks

Pol

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Extend device driver?
  2016-09-10 14:41 Extend device driver? Pol Eyschen
@ 2016-09-10 15:14 ` Greg KH
  2016-09-10 17:53   ` Daniel.
  2016-09-10 18:58   ` Pol Eyschen
  0 siblings, 2 replies; 5+ messages in thread
From: Greg KH @ 2016-09-10 15:14 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Sep 10, 2016 at 04:41:34PM +0200, Pol Eyschen wrote:
> Hi everyone,
> 
> I want to implement some custom functions of my mouse (Madcatz RAT5) in 
> Linux, e.g custom DPI-values. As this requires writing over USB to the 
> firmware of the mouse I was thinking of writing a module to accomplish 
> this. However I don't want to reimplement a whole mouse-driver,so I 
> wanted to ask if there is a possibility of binding the device to 2 
> modules or having my module extend usbhid, so that my module would only 
> be used to perform these custom operations while usbhid stays in charge 
> of the whole "mouse business".

Please just use the hidraw userspace driver/library instead, that way
you don't have to unbind the kernel driver and everything should work
just fine without having to touch the kernel at all.

Hope this helps,

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Extend device driver?
  2016-09-10 15:14 ` Greg KH
@ 2016-09-10 17:53   ` Daniel.
  2016-09-10 18:58   ` Pol Eyschen
  1 sibling, 0 replies; 5+ messages in thread
From: Daniel. @ 2016-09-10 17:53 UTC (permalink / raw)
  To: kernelnewbies

You may want to look at http://www.signal11.us/oss/hidapi/ too, it has
nice interface to HID device and supports libusb and hidraw backends
(y)

Regards,

2016-09-10 12:14 GMT-03:00 Greg KH <greg@kroah.com>:
> On Sat, Sep 10, 2016 at 04:41:34PM +0200, Pol Eyschen wrote:
>> Hi everyone,
>>
>> I want to implement some custom functions of my mouse (Madcatz RAT5) in
>> Linux, e.g custom DPI-values. As this requires writing over USB to the
>> firmware of the mouse I was thinking of writing a module to accomplish
>> this. However I don't want to reimplement a whole mouse-driver,so I
>> wanted to ask if there is a possibility of binding the device to 2
>> modules or having my module extend usbhid, so that my module would only
>> be used to perform these custom operations while usbhid stays in charge
>> of the whole "mouse business".
>
> Please just use the hidraw userspace driver/library instead, that way
> you don't have to unbind the kernel driver and everything should work
> just fine without having to touch the kernel at all.
>
> Hope this helps,
>
> greg k-h
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies



-- 
"Do or do not. There is no try"
  Yoda Master

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Extend device driver?
  2016-09-10 15:14 ` Greg KH
  2016-09-10 17:53   ` Daniel.
@ 2016-09-10 18:58   ` Pol Eyschen
  2016-09-11  7:43     ` Greg KH
  1 sibling, 1 reply; 5+ messages in thread
From: Pol Eyschen @ 2016-09-10 18:58 UTC (permalink / raw)
  To: kernelnewbies

On 10/09/16 17:14, Greg KH wrote:
> On Sat, Sep 10, 2016 at 04:41:34PM +0200, Pol Eyschen wrote:
>> Hi everyone,
>>
>> I want to implement some custom functions of my mouse (Madcatz RAT5) in
>> Linux, e.g custom DPI-values. As this requires writing over USB to the
>> firmware of the mouse I was thinking of writing a module to accomplish
>> this. However I don't want to reimplement a whole mouse-driver,so I
>> wanted to ask if there is a possibility of binding the device to 2
>> modules or having my module extend usbhid, so that my module would only
>> be used to perform these custom operations while usbhid stays in charge
>> of the whole "mouse business".
>
> Please just use the hidraw userspace driver/library instead, that way
> you don't have to unbind the kernel driver and everything should work
> just fine without having to touch the kernel at all.
>
> Hope this helps,
>
> greg k-h
>

I looked at hidraw, unfortunately it doesn't work for me, as the mouse 
expects control URBs with proprietary requests, hence my thought for a 
kernel module.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Extend device driver?
  2016-09-10 18:58   ` Pol Eyschen
@ 2016-09-11  7:43     ` Greg KH
  0 siblings, 0 replies; 5+ messages in thread
From: Greg KH @ 2016-09-11  7:43 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Sep 10, 2016 at 08:58:07PM +0200, Pol Eyschen wrote:
> On 10/09/16 17:14, Greg KH wrote:
> > On Sat, Sep 10, 2016 at 04:41:34PM +0200, Pol Eyschen wrote:
> > > Hi everyone,
> > > 
> > > I want to implement some custom functions of my mouse (Madcatz RAT5) in
> > > Linux, e.g custom DPI-values. As this requires writing over USB to the
> > > firmware of the mouse I was thinking of writing a module to accomplish
> > > this. However I don't want to reimplement a whole mouse-driver,so I
> > > wanted to ask if there is a possibility of binding the device to 2
> > > modules or having my module extend usbhid, so that my module would only
> > > be used to perform these custom operations while usbhid stays in charge
> > > of the whole "mouse business".
> > 
> > Please just use the hidraw userspace driver/library instead, that way
> > you don't have to unbind the kernel driver and everything should work
> > just fine without having to touch the kernel at all.
> > 
> > Hope this helps,
> > 
> > greg k-h
> > 
> 
> I looked at hidraw, unfortunately it doesn't work for me, as the mouse
> expects control URBs with proprietary requests, hence my thought for a
> kernel module.

Ok, then yes, you need to have a separate kernel driver.  Look at one of
the many examples of this in the kernel already, this is quite common.

For specific questions about this, I suggest asking on the linux-input
mailing list, as that is where the developers of this code live.

good luck!

greg k-h

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-09-11  7:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-10 14:41 Extend device driver? Pol Eyschen
2016-09-10 15:14 ` Greg KH
2016-09-10 17:53   ` Daniel.
2016-09-10 18:58   ` Pol Eyschen
2016-09-11  7:43     ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.