aboutsummaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlfred Perlstein <alfred@FreeBSD.org>2009-02-02 00:49:39 +0000
committerAlfred Perlstein <alfred@FreeBSD.org>2009-02-02 00:49:39 +0000
commit7e474656a64be272ad26be7548187f62f4ad6876 (patch)
treeaa7463911cd2ff8c202e86c06090486f3bd452b5 /usr.bin
parent3042cc43f09c5d2300f94d6a5c4c4fd0aa96295a (diff)
downloadsrc-7e474656a64be272ad26be7548187f62f4ad6876.tar.gz
src-7e474656a64be272ad26be7548187f62f4ad6876.zip
src/usr.bin/usbhidaction/usbhidaction.c
src/usr.bin/usbhidctl/usbhid.c src/sys/dev/usb2/include/usb2_hid.h src/sys/dev/usb2/input/uhid2.c src/lib/libusbhid/Makefile src/lib/libusbhid/descr.c src/lib/libusbhid/descr_compat.c src/lib/libusbhid/usbhid.3 src/lib/libusbhid/usbhid.h src/lib/libusbhid/usbvar.h Patches to make libusbhid and HID userland utilities compatible with the new USB stack. All HID ioctls should go through the libusbhid library to ensure compatibility. I have found at least one piece of software in /usr/ports which needs to get updated before USB HID devices will work. This is the X joystick input driver. Reported and tested by: Daichi GOTO and Masanori OZAWA. src/sys/dev/usb2/core/usb2_process.c Correct USB process names. Reported by: Andre Guibert de Bruet src/sys/dev/usb2/serial/uftdi2.c Integrate changes from old USB stack. Submitted by: hps
Notes
Notes: svn path=/head/; revision=187994
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/usbhidaction/usbhidaction.c7
-rw-r--r--usr.bin/usbhidctl/usbhid.c7
2 files changed, 4 insertions, 10 deletions
diff --git a/usr.bin/usbhidaction/usbhidaction.c b/usr.bin/usbhidaction/usbhidaction.c
index e0d459d2c2b3..a3aa3c5c2f4e 100644
--- a/usr.bin/usbhidaction/usbhidaction.c
+++ b/usr.bin/usbhidaction/usbhidaction.c
@@ -46,9 +46,7 @@
#include <limits.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/ioctl.h>
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
+#include <dev/usb2/include/usb2_hid.h>
#include <usbhid.h>
#include <syslog.h>
#include <signal.h>
@@ -155,8 +153,7 @@ main(int argc, char **argv)
fd = open(dev, O_RDWR);
if (fd < 0)
err(1, "%s", dev);
- if (ioctl(fd, USB_GET_REPORT_ID, &reportid) < 0)
- reportid = -1;
+ reportid = hid_get_report_id(fd);
repd = hid_get_report_desc(fd);
if (repd == NULL)
err(1, "hid_get_report_desc() failed");
diff --git a/usr.bin/usbhidctl/usbhid.c b/usr.bin/usbhidctl/usbhid.c
index ff7c544fe1c6..917666eda1fb 100644
--- a/usr.bin/usbhidctl/usbhid.c
+++ b/usr.bin/usbhidctl/usbhid.c
@@ -42,14 +42,12 @@
#include <string.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <unistd.h>
#include <err.h>
#include <ctype.h>
#include <errno.h>
#include <usbhid.h>
-#include <dev/usb/usb.h>
-#include <dev/usb/usbhid.h>
+#include <dev/usb2/include/usb2_hid.h>
int verbose = 0;
int all = 0;
@@ -207,7 +205,6 @@ dumpdata(int f, report_desc_t rd, int loop)
struct hid_item h, *hids, *n;
int r, dlen;
u_char *dbuf;
- static int one = 1;
u_int32_t colls[100];
int sp = 0;
char namebuf[10000], *namep;
@@ -231,7 +228,7 @@ dumpdata(int f, report_desc_t rd, int loop)
dlen = hid_report_size(rd, hid_input, 0);
dbuf = malloc(dlen);
if (!loop)
- if (ioctl(f, USB_SET_IMMED, &one) < 0) {
+ if (hid_set_immed(f, 1) < 0) {
if (errno == EOPNOTSUPP)
warnx("device does not support immediate mode, only changes reported.");
else