Actually, we are doing the prototype of USB-HID extending project. The goal is to recognize and support non-keyboard-mouse HID devices. It is great to hear that someone is also doing the similar work.
Our design: 1. develop the stream modules and then let the upper (e.g Xorg driver) push the modules on the device nodes; 2. extend the hid driver and hidparser to make the more HID features supported (e.g. push/pop); 3. develop or port the corresponding Xorg drivers to drive the HID devices on X. 4. develop or port some configuration tools for the specific HID devices(e.g. tablet). Our initial supporting devices: 1. multi-media keys on some advanced keyboards & horizontal scrolling; 2. Wacom tablet (belonging to the Digitizer Usage Page). The difficult point: There are often more than one usage pages within one interface descriptor in USB HID devices. It is hard to support each different usage page in one module under current stream mechanism. We plan to create a device node for each different usage page and then let the corresponding stream module handle the device nodes belonging to one kind of usage page or usage. In principle, the vendor-ID and product-ID are only used for the vendor specific devices or data. I also investigated the USB Joystick and Gamepad. They look like to have only one kind of usage(joystick) and usage page(Generic Desktop) in an interface descriptor. It seems to be not hard to support. A stream module and Xorg driver are needed. The hid driver need to be modified. Hope this help you. Welcome to any problems. Regards, Strony Doug Scott : > Hey, > Just thought I would give you an update the progress I have made so > far in building a Joystick driver for OpenSolaris. > > The goals of doing this was - > 1) The least user intervention as possible. Asking a user to find > their product and vendor ID and modify /etc/driver-aliases, or > /kernel/drv/<driver>.conf is very undesirable. All that should be > required is to plug in the joystick and run the game. > > 2) Try to be compatible (as possible) with existing drivers/libraries > from BSD and/or Linux. > > 3) The driver should support all Joysticks which comply with the > USB-HID joystick standard. Other devices are out of scope at the moment. > > 4) Try as much as possible to change existing drivers. (Maybe impossible) > > The Investigation > ----------------- > > Currently when you plug in a USB joystick, it should automatically be > attached to the Solaris hid driver. You can see that this has happened > by simply looking through the /devices directory for a file with the > minor name of 'hid_1_4' (The '1' is for a 'Generic Desktop Device' and > the '4' is that is a joystick). > > doug at prae> find /devices -name \*hid_1_4 > /devices/pci at 0,0/pci1043,815a at 2/input at 8:hid_1_4 > /devices/pci at 0,0/pci1043,815a at 2/input at 7:hid_1_4 > > The problem here is that the hid driver has attached to the device, > but has no idea what to do with them. The other issue is that there is > no usable link added to /dev/usb which libusb.so can use. > > My first test was to attach the ugen driver to the device and build a > user-land driver with libusb.so. This actually works quite well, as I > was able to find all of the joystick buttons, axis etc, and read the > raw data quite easily. Unfortunately this breaks goal 1, and requires > to much user intervention. I knew that this would not be the ideal > solution, but it was the easiest way to play around with the device > and learn what it does :) > > The next test was to write a driver that attaches to the existing hid > driver and correctly adds minor node for each joystick found. I > started doing this by writing a Solaris layered driver. It correctly > attached to all of the usb joysticks on my system and added a minor > node for each physical joystick (some have 2 physical joysticks on the > same usb hid device). By opening each minor node the raw values from > each of the joysticks buttons, and axis could easily be read. Doing > this I realised that by not only looking for just joysticks, but > adding minor nodes for all hid devices which currently are not > supported by the Solaris hid device driver, this would be a BSD uhid > compatible device driver. So I change the name of the device to uhid, > and ported the BSD libusbhid library to Solaris. This would allow the > access to many other usb hid devices other than joysticks. At this > point I thought I was on the home run. All I need to do was to > implement the BSD uhid ioctl calls in my driver. > > Suddenly I hit a brick wall. Since the current hid driver within > Solaris does not implement any ioctl calls (it's a stream driver so > actually M_IOCTL), and you can not access the M_CTL calls though > ioctl, going this direction is totally stuffed unless I change the uid > driver to support the required M_IOCTL's. Therefore the layered driver > 'uhid' would not be required, and I should just focus on modifying the > current hid driver. > > The nice thing here is that the current code for M_IOCTL simply > returns ENOTTY error. Therefore the changes are adding functionality > rather than changing existing calls. At this point I am most of the > way through adding the M_IOCTLS code to support a mofified BSD > libusbhid library. Once I have finished the last bit of coding, I > should be able to share the code changes for the hid driver, > libusbhid, and libSDL. > > Any thoughts/questions/feedback > > Doug > > > _______________________________________________ > driver-usb mailing list > driver-usb at opensolaris.org > http://opensolaris.org/mailman/listinfo/driver-usb
