Date: Sun, 25 Jan 2009 11:26:18 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 156645 for review Message-ID: <200901251126.n0PBQIRr092233@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=156645 Change 156645 by hselasky@hselasky_laptop001 on 2009/01/25 11:26:13 All HID ioctl's should go through the HID library! That makes porting easier. Affected files ... .. //depot/projects/usb/src/lib/libusbhid/descr.c#3 edit .. //depot/projects/usb/src/lib/libusbhid/usbhid.3#3 edit .. //depot/projects/usb/src/lib/libusbhid/usbhid.h#3 edit .. //depot/projects/usb/src/usr.bin/usbhidaction/Makefile#1 branch .. //depot/projects/usb/src/usr.bin/usbhidaction/usbhidaction.1#1 branch .. //depot/projects/usb/src/usr.bin/usbhidaction/usbhidaction.c#1 add .. //depot/projects/usb/src/usr.bin/usbhidctl/Makefile#1 branch .. //depot/projects/usb/src/usr.bin/usbhidctl/usbhid.c#1 add .. //depot/projects/usb/src/usr.bin/usbhidctl/usbhidctl.1#1 branch Differences ... ==== //depot/projects/usb/src/lib/libusbhid/descr.c#3 (text+ko) ==== @@ -45,6 +45,12 @@ #include "usbvar.h" int +hid_set_immed(int fd, int enable) +{ + return (ioctl(fd, USB_SET_IMMED, &enable)); +} + +int hid_get_report_id(int fd) { int temp = -1; ==== //depot/projects/usb/src/lib/libusbhid/usbhid.3#3 (text+ko) ==== @@ -54,6 +54,8 @@ .Fn hid_get_report_desc "int file" .Ft int .Fn hid_get_report_id "int file" +.Ft int +.Fn hid_set_immed "int fd" "int enable" .Ft report_desc_t .Fn hid_use_report_desc "unsigned char *data" "unsigned int size" .Ft void @@ -97,6 +99,10 @@ The routines can be divided into four parts: extraction of the descriptor, parsing of the descriptor, translating to/from symbolic names, and data manipulation. +.Ss Synchronous HID operation +Synchronous HID operation can be enabled or disabled by a call to +.Fn hid_set_immed . +The function returns a negative value on failure. .Ss Descriptor Functions The report descriptor ID can be obtained by calling .Fn hid_get_report_id . ==== //depot/projects/usb/src/lib/libusbhid/usbhid.h#3 (text+ko) ==== @@ -88,6 +88,7 @@ report_desc_t hid_use_report_desc(unsigned char *data, unsigned int size); void hid_dispose_report_desc(report_desc_t); int hid_get_report_id(int file); +int hid_set_immed(int fd, int enable); /* Parsing of a HID report descriptor, parse.c: */ hid_data_t hid_start_parse(report_desc_t d, int kindset, int id);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200901251126.n0PBQIRr092233>