lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201028173217.GA25456@amd>
Date:   Wed, 28 Oct 2020 18:32:17 +0100
From:   Pavel Machek <pavel@....cz>
To:     Jiri Kosina <jikos@...nel.org>
Cc:     dmitry.torokhov@...il.com, vojtech@...e.cz,
        linux-input@...r.kernel.org,
        kernel list <linux-kernel@...r.kernel.org>
Subject: Re: Proper support for Saitek X36F joystick

On Wed 2020-10-28 17:29:23, Jiri Kosina wrote:
> On Wed, 28 Oct 2020, Pavel Machek wrote:
> 
> > So no, I can't even replace it with equivalent one. Perhaps hrdc got
> > decompilation wrong, or I'm doing something else wrong.
> 
> You don't need to do any decompilation -- the descriptor can be obtained 
> from /sys/kernel/debug/hid/<device>/rdesc (also lsusb in verbose enough 
> mode should present it in case no driver is bound to the device).

I discovered problem in the meantime. hrdc (I was using to de-compile
and re-compile hid descriptors) was adding padding.

But thanks for the pointer. That is very useful:

This device has four hat switches... I declared two so far

     0x0b, 0x39, 0x00, 0x01, 0x00,  //     Usage (desktop.HatSwitch)
     0x35, 0x00,                    //     PhysicalMinimum (0)
     0x46, 0x3b, 0x01,              //     PhysicalMaximum (315)
     0x15, 0x01,                    //     LogicalMinimum (1)
     0x25, 0x08,                    //     LogicalMaximum (8)
     0x65, 0x14,                    //     Unit (Degree)
     0x55, 0x00,                    //     UnitExponent (0)
     0x95, 0x01,                    //     ReportCount (1)
     0x75, 0x04,                    //     ReportSize (4)
     0x81, 0x42,                    //     Input (Variable|NullState)

     0x95, 0x01,                    //     ReportCount (1)
     0x75, 0x02,                    //     ReportSize (2)
     0x81, 0x03,                    //     Input (Constant|Variable)
     0x0b, 0x39, 0x00, 0x01, 0x00,  //     Usage (desktop.HatSwitch)
     0x35, 0x00,                    //     PhysicalMinimum (0)
     0x46, 0x3b, 0x01,              //     PhysicalMaximum (315)
     0x15, 0x01,                    //     LogicalMinimum (1)
     0x25, 0x08,                    //     LogicalMaximum (8)
     0x65, 0x14,                    //     Unit (Degree)
     0x55, 0x00,                    //     UnitExponent (0)
     0x95, 0x01,                    //     ReportCount (1)
     0x75, 0x04,                    //     ReportSize (4)
     0x81, 0x42,                    //     Input (Variable|NullState)
     0xc0,                          // EndCollection

...but Linux seems to only recognize first of them:

GenericDesktop.HatSwitch ---> Absolute.Hat0X
GenericDesktop.HatSwitch ---> Sync.Report

Is there way to get extra hats mapped as Hat1X, Hat2X and Hat3X?

(Plus, they may have different bit orders than hid expects...?)

I'm thinking that maybe I should ignore this hid stuff and just do
"normal" driver in C? Is there precedent/example for that?

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ