usbhidaction.c (171101) | usbhidaction.c (187994) |
---|---|
1/* $NetBSD: usbhidaction.c,v 1.8 2002/06/11 06:06:21 itojun Exp $ */ | 1/* $NetBSD: usbhidaction.c,v 1.8 2002/06/11 06:06:21 itojun Exp $ */ |
2/* $FreeBSD: head/usr.bin/usbhidaction/usbhidaction.c 171101 2007-06-30 03:58:01Z imp $ */ | 2/* $FreeBSD: head/usr.bin/usbhidaction/usbhidaction.c 187994 2009-02-02 00:49:39Z alfred $ */ |
3 4/* 5 * Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Lennart Augustsson <lennart@augustsson.net>. 10 * --- 30 unchanged lines hidden (view full) --- 41#include <stdlib.h> 42#include <string.h> 43#include <ctype.h> 44#include <err.h> 45#include <fcntl.h> 46#include <limits.h> 47#include <unistd.h> 48#include <sys/types.h> | 3 4/* 5 * Copyright (c) 2000, 2002 The NetBSD Foundation, Inc. 6 * All rights reserved. 7 * 8 * This code is derived from software contributed to The NetBSD Foundation 9 * by Lennart Augustsson <lennart@augustsson.net>. 10 * --- 30 unchanged lines hidden (view full) --- 41#include <stdlib.h> 42#include <string.h> 43#include <ctype.h> 44#include <err.h> 45#include <fcntl.h> 46#include <limits.h> 47#include <unistd.h> 48#include <sys/types.h> |
49#include <sys/ioctl.h> 50#include <dev/usb/usb.h> 51#include <dev/usb/usbhid.h> | 49#include <dev/usb2/include/usb2_hid.h> |
52#include <usbhid.h> 53#include <syslog.h> 54#include <signal.h> 55#include <errno.h> 56#include <sys/stat.h> 57 58static int verbose = 0; 59static int isdemon = 0; --- 90 unchanged lines hidden (view full) --- 150 snprintf(devnamebuf, sizeof(devnamebuf), "/dev/%s%s", 151 isdigit(dev[0]) ? "uhid" : "", dev); 152 dev = devnamebuf; 153 } 154 155 fd = open(dev, O_RDWR); 156 if (fd < 0) 157 err(1, "%s", dev); | 50#include <usbhid.h> 51#include <syslog.h> 52#include <signal.h> 53#include <errno.h> 54#include <sys/stat.h> 55 56static int verbose = 0; 57static int isdemon = 0; --- 90 unchanged lines hidden (view full) --- 148 snprintf(devnamebuf, sizeof(devnamebuf), "/dev/%s%s", 149 isdigit(dev[0]) ? "uhid" : "", dev); 150 dev = devnamebuf; 151 } 152 153 fd = open(dev, O_RDWR); 154 if (fd < 0) 155 err(1, "%s", dev); |
158 if (ioctl(fd, USB_GET_REPORT_ID, &reportid) < 0) 159 reportid = -1; | 156 reportid = hid_get_report_id(fd); |
160 repd = hid_get_report_desc(fd); 161 if (repd == NULL) 162 err(1, "hid_get_report_desc() failed"); 163 164 commands = parse_conf(conf, repd, reportid, ignore); 165 166 sz = (size_t)hid_report_size(repd, hid_input, reportid); 167 --- 333 unchanged lines hidden --- | 157 repd = hid_get_report_desc(fd); 158 if (repd == NULL) 159 err(1, "hid_get_report_desc() failed"); 160 161 commands = parse_conf(conf, repd, reportid, ignore); 162 163 sz = (size_t)hid_report_size(repd, hid_input, reportid); 164 --- 333 unchanged lines hidden --- |