From owner-freebsd-usb@FreeBSD.ORG Fri Dec 9 02:12:33 2005 Return-Path: X-Original-To: freebsd-usb@freebsd.org Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C5F216A431; Fri, 9 Dec 2005 02:12:33 +0000 (GMT) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe07.swip.net [212.247.154.193]) by mx1.FreeBSD.org (Postfix) with ESMTP id F399643D5C; Fri, 9 Dec 2005 02:12:14 +0000 (GMT) (envelope-from hselasky@c2i.net) X-T2-Posting-ID: Y1QAsIk9O44SO+J/q9KNyQ== X-Cloudmark-Score: 0.000000 [] Received: from mp-216-88-125.daxnet.no ([193.216.88.125] verified) by mailfe07.swip.net (CommuniGate Pro SMTP 5.0.2) with ESMTP id 41217186; Fri, 09 Dec 2005 03:12:07 +0100 From: Hans Petter Selasky To: freebsd-hackers@freebsd.org, freebsd-usb@freebsd.org, Ed Schouten Date: Fri, 9 Dec 2005 03:13:26 +0100 User-Agent: KMail/1.7 References: <20051208225644.GJ15719@hoeg.nl> In-Reply-To: <20051208225644.GJ15719@hoeg.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200512090313.27392.hselasky@c2i.net> Cc: Subject: Re: [WIP] uhid(4): Support for the Microsoft Xbox360 gamepad X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: hselasky@c2i.net List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Dec 2005 02:12:33 -0000 On Thursday 08 December 2005 23:56, Ed Schouten wrote: > 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, Hi, Maybe when you have tested this patch more, then make a PR, see "man send-pr", using "Category: usb", so that it does not get lost. --HPS