802
static int usbhid_get_raw_report(struct hid_device *hid,
803
unsigned char report_number, __u8 *buf, size_t count,
804
unsigned char report_type)
806
struct usbhid_device *usbhid = hid->driver_data;
807
struct usb_device *dev = hid_to_usb_dev(hid);
808
struct usb_interface *intf = usbhid->intf;
809
struct usb_host_interface *interface = intf->cur_altsetting;
810
int skipped_report_id = 0;
813
/* Byte 0 is the report number. Report data starts at byte 1.*/
814
buf[0] = report_number;
815
if (report_number == 0x0) {
816
/* Offset the return buffer by 1, so that the report ID
817
will remain in byte 0. */
820
skipped_report_id = 1;
822
ret = usb_control_msg(dev, usb_rcvctrlpipe(dev, 0),
824
USB_DIR_IN | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
825
((report_type + 1) << 8) | report_number,
826
interface->desc.bInterfaceNumber, buf, count,
827
USB_CTRL_SET_TIMEOUT);
829
/* count also the report id */
830
if (ret > 0 && skipped_report_id)
802
836
static int usbhid_output_raw_report(struct hid_device *hid, __u8 *buf, size_t count,
803
837
unsigned char report_type)
1140
1174
usb_set_intfdata(intf, hid);
1141
1175
hid->ll_driver = &usb_hid_driver;
1176
hid->hid_get_raw_report = usbhid_get_raw_report;
1142
1177
hid->hid_output_raw_report = usbhid_output_raw_report;
1143
1178
hid->ff_init = hid_pidff_init;
1144
1179
#ifdef CONFIG_USB_HIDDEV