Skip to contentSkip to conversation

hid-core.c: hid->name = dev->manufacturer + dev->product ... why not + dev->serial?

BUG? Melchior FRANZ 1 participant 1 message Jun 14, 2010 HID

lore
Share & tools
lore
#0 lore raw

* Melchior FRANZ -- Tuesday 09 March 2010:

Quoted 8 lines

Anyway, my kernel is "fixed", so it's not about me at all. I just feel a bit uncomfortably if I have to hack my kernel. Before the fix I got this information from js_demo/JSIOCGNAME:

Joystick 0: "Leo Bodnar BU0836A Interface"
Joystick 1: "Leo Bodnar BU0836A Interface"
Joystick 2: "SAITEK CYBORG 3D USB"

Quoted 5 lines

and now I get:

Joystick 0: "Leo Bodnar BU0836A Interface A12107" Joystick 1: "Leo Bodnar BU0836A Interface A12100" Joystick 2: "SAITEK CYBORG 3D USB"

As my fix[1] for this kernel flaw was brushed away without arguments (other than a disingenious "the joystick interface sucks, anyway, just use something else"), but people come across this thread and then ask me privatly about solutions, (which doesn't bother me at all, btw), here again, strictly for the archive:

There's now a preload library[1] available, which overrides ioctl(), watches for JSIOCGNAME and replaces the retarded generic product name by the actual device identifier, which is taken from the /dev/input/by-id/ name. For some reason the latter interface actually thinks the serial number belongs to the joystick name. I totally agree with it! :-}

Howto build:

  $ git clone git://gitorious.org/bu0836/bu0836.git
  $ cd bu0836/js_serial_preload/
  $ make
  $ sudo make install

Howto use:

  $ LD_PRELOAD=/usr/local/lib/js_serial_preload.so fgfs --aircraft=bo105

Viola. Everything works as intended without having to patch the broken kernel.

m.

[1] http://members.aon.at/mfranz/bu0836a.html
[2] http://gitorious.org/bu0836/