return hid_parse_report(hid, uhid->rd_data, uhid->rd_size);
}
-static int uhid_hid_get_raw(struct hid_device *hid, unsigned char rnum,
- __u8 *buf, size_t count, unsigned char rtype)
+static int uhid_hid_get_report(struct hid_device *hid, unsigned char rnum,
+ __u8 *buf, size_t count, unsigned char rtype)
{
struct uhid_device *uhid = hid->driver_data;
__u8 report_type;
unsigned long flags;
int ret;
size_t uninitialized_var(len);
- struct uhid_feature_answer_req *req;
+ struct uhid_get_report_reply_req *req;
if (!uhid->running)
return -EIO;
}
spin_lock_irqsave(&uhid->qlock, flags);
- ev->type = UHID_FEATURE;
- ev->u.feature.id = ++uhid->report_id;
- ev->u.feature.rnum = rnum;
- ev->u.feature.rtype = report_type;
+ ev->type = UHID_GET_REPORT;
+ ev->u.get_report.id = ++uhid->report_id;
+ ev->u.get_report.rnum = rnum;
+ ev->u.get_report.rtype = report_type;
uhid->report_running = true;
uhid_queue(uhid, ev);
ret = -ERESTARTSYS;
} else {
spin_lock_irqsave(&uhid->qlock, flags);
- req = &uhid->report_buf.u.feature_answer;
+ req = &uhid->report_buf.u.get_report_reply;
if (req->err) {
ret = -EIO;
{
switch (reqtype) {
case HID_REQ_GET_REPORT:
- return uhid_hid_get_raw(hid, reportnum, buf, len, rtype);
+ return uhid_hid_get_report(hid, reportnum, buf, len, rtype);
case HID_REQ_SET_REPORT:
/* TODO: implement proper SET_REPORT functionality */
return -ENOSYS;
return 0;
}
-static int uhid_dev_feature_answer(struct uhid_device *uhid,
- struct uhid_event *ev)
+static int uhid_dev_get_report_reply(struct uhid_device *uhid,
+ struct uhid_event *ev)
{
unsigned long flags;
spin_lock_irqsave(&uhid->qlock, flags);
/* id for old report; drop it silently */
- if (uhid->report_id != ev->u.feature_answer.id)
+ if (uhid->report_id != ev->u.get_report_reply.id)
goto unlock;
if (!uhid->report_running)
goto unlock;
case UHID_INPUT2:
ret = uhid_dev_input2(uhid, &uhid->input_buf);
break;
- case UHID_FEATURE_ANSWER:
- ret = uhid_dev_feature_answer(uhid, &uhid->input_buf);
+ case UHID_GET_REPORT_REPLY:
+ ret = uhid_dev_get_report_reply(uhid, &uhid->input_buf);
break;
default:
ret = -EOPNOTSUPP;
UHID_OUTPUT,
UHID_OUTPUT_EV, /* obsolete! */
UHID_INPUT,
- UHID_FEATURE,
- UHID_FEATURE_ANSWER,
+ UHID_FEATURE, /* obsolete! use UHID_GET_REPORT */
+ UHID_GET_REPORT = UHID_FEATURE,
+ UHID_FEATURE_ANSWER, /* obsolete! use UHID_GET_REPORT_REPLY */
+ UHID_GET_REPORT_REPLY = UHID_FEATURE_ANSWER,
UHID_CREATE2,
UHID_INPUT2,
};
__s32 value;
} __attribute__((__packed__));
+/* Obsolete! Kernel uses ABI compatible UHID_GET_REPORT. */
struct uhid_feature_req {
__u32 id;
__u8 rnum;
__u8 rtype;
} __attribute__((__packed__));
+struct uhid_get_report_req {
+ __u32 id;
+ __u8 rnum;
+ __u8 rtype;
+} __attribute__((__packed__));
+
+/* Obsolete! Use ABI compatible UHID_GET_REPORT_REPLY. */
struct uhid_feature_answer_req {
__u32 id;
__u16 err;
__u8 data[UHID_DATA_MAX];
} __attribute__((__packed__));
+struct uhid_get_report_reply_req {
+ __u32 id;
+ __u16 err;
+ __u16 size;
+ __u8 data[UHID_DATA_MAX];
+} __attribute__((__packed__));
+
struct uhid_event {
__u32 type;
struct uhid_output_req output;
struct uhid_output_ev_req output_ev;
struct uhid_feature_req feature;
+ struct uhid_get_report_req get_report;
struct uhid_feature_answer_req feature_answer;
+ struct uhid_get_report_reply_req get_report_reply;
struct uhid_create2_req create2;
struct uhid_input2_req input2;
} u;