From owner-freebsd-usb@FreeBSD.ORG Fri May 12 09:50:20 2006 Return-Path: X-Original-To: freebsd-usb@hub.freebsd.org Delivered-To: freebsd-usb@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id EAA6216A403 for ; Fri, 12 May 2006 09:50:20 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77C7443D53 for ; Fri, 12 May 2006 09:50:20 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k4C9oKRd019225 for ; Fri, 12 May 2006 09:50:20 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k4C9oK4d019224; Fri, 12 May 2006 09:50:20 GMT (envelope-from gnats) Resent-Date: Fri, 12 May 2006 09:50:20 GMT Resent-Message-Id: <200605120950.k4C9oK4d019224@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Ed Schouten Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E542D16A402 for ; Fri, 12 May 2006 09:43:01 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [83.98.131.211]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3B4AE43D60 for ; Fri, 12 May 2006 09:43:00 +0000 (GMT) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id B1CF217101; Fri, 12 May 2006 11:42:59 +0200 (CEST) Message-Id: <20060512094259.B1CF217101@palm.hoeg.nl> Date: Fri, 12 May 2006 11:42:59 +0200 (CEST) From: Ed Schouten To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: Subject: usb/97169: [uhid + Xbox 360 gamepad] Turn off blinking LED on attach X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Ed Schouten List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 May 2006 09:50:21 -0000 >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: