|
From: Johann D. <jo...@do...> - 2002-04-08 12:30:23
|
Fabien Brachere wrote: > Hello, Hi, > I'm new to the list, and I'm working on a Microsoft Sidewinder Force > Feedback 2 driver (Product ID=0x001b, Vendor ID=0x045e). > I started to study USB, HID and PID protocols and the joystick seems to > follow PID specification. > I implemented a skeleton driver (with latest development kernel 2.5.7) > which do the following things: > when insmod'ed : reset device, adjust gain, upload an arbitrary effect > (sort of machine-gun effect sniffed from the Windows test of the > joystick) and play it, and it works ! > when rmmod'ed : stop effect, reset device. That sounds really interesting. > For the moment, no IOCTL and no relation with evdev except for position > of joystick and buttons. > > The theory of operations: > the driver uses 4 flow of data with the device: control in (for "block > load report" and "pid pool report": see pid spec.), control out (for > "create new effect report") , interrupt in (for joystick state (axes, > buttons, power, optical switch)) and interrupt out for all other > commands (set effect report, set envelope report, device gain report, > pid device control , ....) > > I've not release yet any file, because it's in early alpha stage and > it's very dirty code, must clean up before all, implement correct data > structures to follow PID spec... There really is no reason to be ashamed of dirty code. I don't think any hacker really cares about dirtyness at such early development stages. Several people already started to work on this subject, and I believe the amount of code we have seen does not reflect the total amount of time spent on it. Furthermore, if you have an heart attack today, what I don't wish you, we lose all your work. > I think in a few weeks (depend on the time I have), I put all of that on > a Web site. > > I've a problem with this driver: I can't insert it without rmmod hid, I > think it's the fault of hid-input who register the device, so I can't > register it twice. Any idea ? (without modify hid code). > This is how I did for the Logitech WingMan Cordless Rumble Pad: I slightly modified hid.h, hid-core.c and hid-input.c to add new function entries. Then I added a file called hid-ff.c where the code for force feedback goes. It's available in linuxconsole's CVS on sourceforge. I designed the framework so that other protocols could be added. Please have a look. If you like the way it's done, please use the existing framework. If you don't, please explain why so that we can improve it ;) By the way, I think we should have discussions about drivers on the linuxconsole mailing list, and discussions about the userland force feedback library on libff-devel. -- Johann Deneux |