usb/97169: [uhid + Xbox 360 gamepad] Turn off blinking LED on attach
Ed Schouten
ed at fxq.nl
Fri May 12 09:50:21 UTC 2006
>Number: 97169
>Category: usb
>Synopsis: [uhid + Xbox 360 gamepad] Turn off blinking LED on attach
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-usb
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Fri May 12 09:50:19 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Ed Schouten
>Release: FreeBSD 7.0-CURRENT i386
>Organization:
n/a
>Environment:
System: FreeBSD zonk.fxq.nl 7.0-CURRENT FreeBSD 7.0-CURRENT #7: Fri May 12 01:11:45 CEST 2006 root at zonk.fxq.nl:/usr/obj/export/src/sys/ZONK i386
>Description:
When attaching an Xbox 360 gamepad a computer, the LED on the gamepad
blinks by default. When the operating system (read: normally an Xbox
360) initializes the gamepad, the LED stops blinking.
FreeBSD does not disable the LED, which is quite irritating, as the LED
is quite bright.
>How-To-Repeat:
Connect an Xbox 360 gamepad to a machine running FreeBSD 6.1 or higher.
>Fix:
The following patch sends a packet containing 0x01 0x03 0x00 to the
device. This stops the LED from blinking. See
http://www.free60.org/wiki/Gamepad for details.
%%%
--- uhid.c Fri May 12 01:11:20 2006
+++ uhid.c Fri May 12 01:11:34 2006
@@ -280,6 +280,12 @@
} else if (id->bInterfaceClass == UICLASS_VENDOR &&
id->bInterfaceSubClass == UISUBCLASS_XBOX360_CONTROLLER &&
id->bInterfaceProtocol == UIPROTO_XBOX360_GAMEPAD) {
+ static uByte reportbuf[] = {1, 3, 0};
+
+ /* The four LEDs on the gamepad are blinking by default. */
+ usbd_set_report(uaa->iface, UHID_OUTPUT_REPORT, 0,
+ &reportbuf, sizeof reportbuf);
+
/* The Xbox 360 gamepad has no report descriptor. */
size = sizeof uhid_xb360gp_report_descr;
descptr = uhid_xb360gp_report_descr;
%%%
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-usb
mailing list