xbox one controller

Stephane D'Alu sdalu at sdalu.com
Tue Jun 25 17:46:15 UTC 2019


On 6/25/19 9:16 AM, Hans Petter Selasky wrote:
>> [...]
>> Found my device (vendor=0x045e, product=0x02ea) in 
>> media_tree/drivers/input/joystick/xpad.c but the module_param present 
>> in that file dont seem useful (related to button/sticks behavior or 
>> wireless)
>>
>> Well, the xpad.c file doesn't seem to be compiled in
>> (and INPUT is set in port config)
>>
>>
> 
> The xpad.c has some compile failures, but if you want to fix them, I'm 
> happy to submit the patches!
> 

I don't know how to fix this line in kernel/linux_defs.h
#define	IS_ENABLED(x,...) defined(x##__VA_ARGS__)

that's seems to be problematic when using clang preprocessor as 
"defined" is not interpreted after macro expantion.
so I've been forced to patch xpad.c which is ugly

Otherwise I added the necessary structure and missing functions,
it seems to work, at least I have /dev/input/js0 which is outputing data 
when precessing gamepad button or using sticks.

I know nothing about usb stack, so my patch will need strong review.


This bring another question on the gamepad/joystick side,
I'm using the port emulators/qmc2, which detect gamepad/joystick when 
provided as uhid interface but doesn't seems to catch it as 
/dev/input/js0. Am I still missing a step?

-- 
Stephane D'Alu
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xpad.diff
Type: text/x-patch
Size: 7544 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-usb/attachments/20190625/0be913d6/attachment.bin>


More information about the freebsd-usb mailing list