Date: Wed, 16 Jul 2014 06:25:45 +0000 (UTC) From: Hans Petter Selasky <hselasky@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r268740 - stable/8/sys/dev/usb/input Message-ID: <201407160625.s6G6Pj7k081693@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: hselasky Date: Wed Jul 16 06:25:44 2014 New Revision: 268740 URL: http://svnweb.freebsd.org/changeset/base/268740 Log: MFC r268583: Turn off blinking device leds at attach. PR: 183735 Modified: stable/8/sys/dev/usb/input/uhid.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/input/uhid.c ============================================================================== --- stable/8/sys/dev/usb/input/uhid.c Wed Jul 16 06:23:54 2014 (r268739) +++ stable/8/sys/dev/usb/input/uhid.c Wed Jul 16 06:25:44 2014 (r268740) @@ -759,9 +759,20 @@ uhid_attach(device_t dev) sc->sc_flags |= UHID_FLAG_STATIC_DESC; } } else if ((uaa->info.bInterfaceClass == UICLASS_VENDOR) && - (uaa->info.bInterfaceSubClass == UISUBCLASS_XBOX360_CONTROLLER) && + (uaa->info.bInterfaceSubClass == UISUBCLASS_XBOX360_CONTROLLER) && (uaa->info.bInterfaceProtocol == UIPROTO_XBOX360_GAMEPAD)) { - + static const uint8_t reportbuf[3] = {1, 3, 0}; + /* + * Turn off the four LEDs on the gamepad which + * are blinking by default: + */ + error = usbd_req_set_report(uaa->device, NULL, + __DECONST(void *, reportbuf), sizeof(reportbuf), + uaa->info.bIfaceIndex, UHID_OUTPUT_REPORT, 0); + if (error) { + DPRINTF("set output report failed, error=%s (ignored)\n", + usbd_errstr(error)); + } /* the Xbox 360 gamepad has no report descriptor */ sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr); sc->sc_repdesc_ptr = (void *)&uhid_xb360gp_report_descr;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407160625.s6G6Pj7k081693>