Lines Matching refs:report

62 	struct hid_report *report;  in hid_register_report()  local
69 report = kzalloc(sizeof(struct hid_report), GFP_KERNEL); in hid_register_report()
70 if (!report) in hid_register_report()
76 report->id = id; in hid_register_report()
77 report->type = type; in hid_register_report()
78 report->size = 0; in hid_register_report()
79 report->device = device; in hid_register_report()
80 report->application = application; in hid_register_report()
81 report_enum->report_id_hash[id] = report; in hid_register_report()
83 list_add_tail(&report->list, &report_enum->report_list); in hid_register_report()
85 return report; in hid_register_report()
93 static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages) in hid_register_field() argument
97 if (report->maxfield == HID_MAX_FIELDS) { in hid_register_field()
98 hid_err(report->device, "too many fields in report\n"); in hid_register_field()
108 field->index = report->maxfield++; in hid_register_field()
109 report->field[field->index] = field; in hid_register_field()
112 field->report = report; in hid_register_field()
259 struct hid_report *report; in hid_add_field() local
268 report = hid_register_report(parser->device, report_type, in hid_add_field()
270 if (!report) { in hid_add_field()
288 offset = report->size; in hid_add_field()
289 report->size += parser->global.report_size * parser->global.report_count; in hid_add_field()
292 if (report->size > (HID_MAX_BUFFER_SIZE - 1) << 3) { in hid_add_field()
303 field = hid_register_field(report, usages); in hid_add_field()
655 static void hid_free_report(struct hid_report *report) in hid_free_report() argument
659 for (n = 0; n < report->maxfield; n++) in hid_free_report()
660 kfree(report->field[n]); in hid_free_report()
661 kfree(report); in hid_free_report()
676 struct hid_report *report = report_enum->report_id_hash[j]; in hid_close_report() local
677 if (report) in hid_close_report()
678 hid_free_report(report); in hid_close_report()
969 struct hid_report *report; in hid_validate_values() local
991 report = list_entry( in hid_validate_values()
995 report = hid->report_enum[type].report_id_hash[id]; in hid_validate_values()
997 if (!report) { in hid_validate_values()
1001 if (report->maxfield <= field_index) { in hid_validate_values()
1006 if (report->field[field_index]->report_count < report_counts) { in hid_validate_values()
1011 return report; in hid_validate_values()
1351 static u32 __extract(u8 *report, unsigned offset, int n) in __extract() argument
1361 value |= ((u32)report[idx] >> bit_shift) << bit_nr; in __extract()
1372 u32 hid_field_extract(const struct hid_device *hid, u8 *report, in hid_field_extract() argument
1381 return __extract(report, offset, n); in hid_field_extract()
1394 static void __implement(u8 *report, unsigned offset, int n, u32 value) in __implement() argument
1401 report[idx] &= ~(0xff << bit_shift); in __implement()
1402 report[idx] |= value << bit_shift; in __implement()
1413 report[idx] &= ~(bit_mask << bit_shift); in __implement()
1414 report[idx] |= value << bit_shift; in __implement()
1418 static void implement(const struct hid_device *hid, u8 *report, in implement() argument
1437 __implement(report, offset, n, value); in implement()
1461 static int hid_match_report(struct hid_device *hid, struct hid_report *report) in hid_match_report() argument
1470 id->report_type == report->type) in hid_match_report()
1613 static size_t hid_compute_report_size(struct hid_report *report) in hid_compute_report_size() argument
1615 if (report->size) in hid_compute_report_size()
1616 return ((report->size - 1) >> 3) + 1; in hid_compute_report_size()
1626 void hid_output_report(struct hid_report *report, __u8 *data) in hid_output_report() argument
1630 if (report->id > 0) in hid_output_report()
1631 *data++ = report->id; in hid_output_report()
1633 memset(data, 0, hid_compute_report_size(report)); in hid_output_report()
1634 for (n = 0; n < report->maxfield; n++) in hid_output_report()
1635 hid_output_field(report->device, report->field[n], data); in hid_output_report()
1642 u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags) in hid_alloc_report_buf() argument
1649 u32 len = hid_report_len(report) + 7; in hid_alloc_report_buf()
1670 hid_dump_input(field->report->device, field->usage + offset, value); in hid_set_field()
1673 hid_err(field->report->device, "offset (%d) exceeds report_count (%d)\n", in hid_set_field()
1679 hid_err(field->report->device, "value %d is out of range\n", value); in hid_set_field()
1691 struct hid_report *report; in hid_get_report() local
1698 report = report_enum->report_id_hash[n]; in hid_get_report()
1699 if (report == NULL) in hid_get_report()
1702 return report; in hid_get_report()
1709 int __hid_request(struct hid_device *hid, struct hid_report *report, in __hid_request() argument
1716 buf = hid_alloc_report_buf(report, GFP_KERNEL); in __hid_request()
1720 len = hid_report_len(report); in __hid_request()
1723 hid_output_report(report, buf); in __hid_request()
1725 ret = hid->ll_driver->raw_request(hid, report->id, buf, len, in __hid_request()
1726 report->type, reqtype); in __hid_request()
1733 hid_input_report(hid, report->type, buf, ret, 0); in __hid_request()
1747 struct hid_report *report; in hid_report_raw_event() local
1754 report = hid_get_report(report_enum, data); in hid_report_raw_event()
1755 if (!report) in hid_report_raw_event()
1763 rsize = hid_compute_report_size(report); in hid_report_raw_event()
1771 dbg_hid("report %d is too short, (%d < %d)\n", report->id, in hid_report_raw_event()
1777 hid->hiddev_report_event(hid, report); in hid_report_raw_event()
1784 if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) { in hid_report_raw_event()
1785 for (a = 0; a < report->maxfield; a++) in hid_report_raw_event()
1786 hid_input_field(hid, report->field[a], cdata, interrupt); in hid_report_raw_event()
1788 if (hdrv && hdrv->report) in hid_report_raw_event()
1789 hdrv->report(hid, report); in hid_report_raw_event()
1793 hidinput_report_event(hid, report); in hid_report_raw_event()
1814 struct hid_report *report; in hid_input_report() local
1840 report = hid_get_report(report_enum, data); in hid_input_report()
1842 if (!report) { in hid_input_report()
1847 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) { in hid_input_report()
1848 ret = hdrv->raw_event(hid, report, data, size); in hid_input_report()