Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 May 2006 11:42:59 +0200 (CEST)
From:      Ed Schouten <ed@fxq.nl>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   usb/97169: [uhid + Xbox 360 gamepad] Turn off blinking LED on attach
Message-ID:  <20060512094259.B1CF217101@palm.hoeg.nl>
Resent-Message-ID: <200605120950.k4C9oK4d019224@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>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@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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060512094259.B1CF217101>