From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 8 22:56:48 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4C89116A41F for ; Thu, 8 Dec 2005 22:56:48 +0000 (GMT) (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 215BA43D7E for ; Thu, 8 Dec 2005 22:56:45 +0000 (GMT) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 67A621702B; Thu, 8 Dec 2005 23:56:44 +0100 (CET) Date: Thu, 8 Dec 2005 23:56:44 +0100 From: Ed Schouten To: FreeBSD Hackers Message-ID: <20051208225644.GJ15719@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6lCXDTVICvIQMz0h" Content-Disposition: inline User-Agent: Mutt/1.5.11 X-Mailman-Approved-At: Thu, 08 Dec 2005 23:01:05 +0000 Cc: Subject: [WIP] uhid(4): Support for the Microsoft Xbox360 gamepad X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Dec 2005 22:56:48 -0000 --6lCXDTVICvIQMz0h Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hello, Last week I heard that Microsoft's new Xbox360 uses regular USB connectors for their gamepads. Because the guys at Xbox-Linux.org already wrote a driver for Linux, I decided to buy one and write a FreeBSD driver for it. The Xbox360 gamepad is like any normal HID gamepad, except that it has been slightly crippled by Microsoft: - They don't use the regular HID interface class, but the vendor specific class in combination with an interface subclass. - Their device does not contain a HID report descriptor. The first problem was easy to solve; I just changed the USB_MATCH code to accept the UICLASS_VENDOR in combination with the interface subclass and interface protocol. Limiting vendor and product ID's should be avoided because that would block third party gamepads. The second problem was a little trickier because I had no experience with writing report descriptors. After taking a look at examples and reading documents at usb.org, I hacked one together. It's quite nice the FreeBSD driver was somewhat prepared for custom report descriptors (the Wacom Graphire gets a custom report descriptor for example). The result can be found here: http://g-rave.nl/files/xbox/freebsd-xbox360-gamepad.diff There are only some small unfinished parts though: - I don't know the output format state; I cannot control the rumbles or the LEDs on the gamepad (I constantly see green leds flashing) - For some reason, I can only read data when polling the gamepad. `usbhidctl -f -al` does not return any output. Useful hints would really be appreciated; I'm not a real wizard when it comes to USB ;-) Yours, --=20 Ed Schouten WWW: http://g-rave.nl/ --6lCXDTVICvIQMz0h Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDmLosmVI4SHXwmhERAiUTAKDSWkd/VvXandrMDUo3T3Ih+iM8ewCgwQTs fSC4YHRh9SQjFBeXtAHwOJw= =lNtj -----END PGP SIGNATURE----- --6lCXDTVICvIQMz0h--