Lines Matching refs:report
89 struct hid_report *report; in hid_register_report() local
96 report = kzalloc(sizeof(struct hid_report), GFP_KERNEL); in hid_register_report()
97 if (!report) in hid_register_report()
103 report->id = id; in hid_register_report()
104 report->type = type; in hid_register_report()
105 report->size = 0; in hid_register_report()
106 report->device = device; in hid_register_report()
107 report->application = application; in hid_register_report()
108 report_enum->report_id_hash[id] = report; in hid_register_report()
110 list_add_tail(&report->list, &report_enum->report_list); in hid_register_report()
111 INIT_LIST_HEAD(&report->field_entry_list); in hid_register_report()
113 return report; in hid_register_report()
121 static struct hid_field *hid_register_field(struct hid_report *report, unsigned usages) in hid_register_field() argument
125 if (report->maxfield == HID_MAX_FIELDS) { in hid_register_field()
126 hid_err(report->device, "too many fields in report\n"); in hid_register_field()
136 field->index = report->maxfield++; in hid_register_field()
137 report->field[field->index] = field; in hid_register_field()
142 field->report = report; in hid_register_field()
289 struct hid_report *report; in hid_add_field() local
299 report = hid_register_report(parser->device, report_type, in hid_add_field()
301 if (!report) { in hid_add_field()
319 offset = report->size; in hid_add_field()
320 report->size += parser->global.report_size * parser->global.report_count; in hid_add_field()
326 if (report->size > (max_buffer_size - 1) << 3) { in hid_add_field()
337 field = hid_register_field(report, usages); in hid_add_field()
693 static void hid_free_report(struct hid_report *report) in hid_free_report() argument
697 kfree(report->field_entries); in hid_free_report()
699 for (n = 0; n < report->maxfield; n++) in hid_free_report()
700 kvfree(report->field[n]); in hid_free_report()
701 kfree(report); in hid_free_report()
716 struct hid_report *report = report_enum->report_id_hash[j]; in hid_close_report() local
717 if (report) in hid_close_report()
718 hid_free_report(report); in hid_close_report()
1027 struct hid_report *report; in hid_validate_values() local
1049 report = list_first_entry_or_null( in hid_validate_values()
1053 report = hid->report_enum[type].report_id_hash[id]; in hid_validate_values()
1055 if (!report) { in hid_validate_values()
1059 if (report->maxfield <= field_index) { in hid_validate_values()
1064 if (report->field[field_index]->report_count < report_counts) { in hid_validate_values()
1069 return report; in hid_validate_values()
1386 static u32 __extract(u8 *report, unsigned offset, int n) in __extract() argument
1396 value |= ((u32)report[idx] >> bit_shift) << bit_nr; in __extract()
1407 u32 hid_field_extract(const struct hid_device *hid, u8 *report, in hid_field_extract() argument
1416 return __extract(report, offset, n); in hid_field_extract()
1429 static void __implement(u8 *report, unsigned offset, int n, u32 value) in __implement() argument
1436 report[idx] &= ~(0xff << bit_shift); in __implement()
1437 report[idx] |= value << bit_shift; in __implement()
1448 report[idx] &= ~(bit_mask << bit_shift); in __implement()
1449 report[idx] |= value << bit_shift; in __implement()
1453 static void implement(const struct hid_device *hid, u8 *report, in implement() argument
1471 __implement(report, offset, n, value); in implement()
1495 static int hid_match_report(struct hid_device *hid, struct hid_report *report) in hid_match_report() argument
1504 id->report_type == report->type) in hid_match_report()
1684 struct hid_report *report, in hid_process_report() argument
1693 for (a = 0; a < report->maxfield; a++) in hid_process_report()
1694 hid_input_fetch_field(hid, report->field[a], data); in hid_process_report()
1696 if (!list_empty(&report->field_entry_list)) { in hid_process_report()
1699 &report->field_entry_list, in hid_process_report()
1714 for (a = 0; a < report->maxfield; a++) { in hid_process_report()
1715 field = report->field[a]; in hid_process_report()
1723 for (a = 0; a < report->maxfield; a++) { in hid_process_report()
1724 field = report->field[a]; in hid_process_report()
1742 struct hid_report *report, in __hid_insert_field_entry() argument
1755 &report->field_entry_list, in __hid_insert_field_entry()
1768 list_add_tail(&entry->list, &report->field_entry_list); in __hid_insert_field_entry()
1772 struct hid_report *report) in hid_report_process_ordering() argument
1780 for (a = 0; a < report->maxfield; a++) { in hid_report_process_ordering()
1781 field = report->field[a]; in hid_report_process_ordering()
1794 report->field_entries = entries; in hid_report_process_ordering()
1804 for (a = 0; a < report->maxfield; a++) { in hid_report_process_ordering()
1805 field = report->field[a]; in hid_report_process_ordering()
1809 __hid_insert_field_entry(hid, report, in hid_report_process_ordering()
1815 __hid_insert_field_entry(hid, report, &entries[usages], in hid_report_process_ordering()
1824 struct hid_report *report; in hid_process_ordering() local
1827 list_for_each_entry(report, &report_enum->report_list, list) in hid_process_ordering()
1828 hid_report_process_ordering(hid, report); in hid_process_ordering()
1856 static size_t hid_compute_report_size(struct hid_report *report) in hid_compute_report_size() argument
1858 if (report->size) in hid_compute_report_size()
1859 return ((report->size - 1) >> 3) + 1; in hid_compute_report_size()
1869 void hid_output_report(struct hid_report *report, __u8 *data) in hid_output_report() argument
1873 if (report->id > 0) in hid_output_report()
1874 *data++ = report->id; in hid_output_report()
1876 memset(data, 0, hid_compute_report_size(report)); in hid_output_report()
1877 for (n = 0; n < report->maxfield; n++) in hid_output_report()
1878 hid_output_field(report->device, report->field[n], data); in hid_output_report()
1885 u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags) in hid_alloc_report_buf() argument
1895 u32 len = hid_report_len(report) + 7 + (report->id == 0); in hid_alloc_report_buf()
1916 hid_dump_input(field->report->device, field->usage + offset, value); in hid_set_field()
1919 hid_err(field->report->device, "offset (%d) exceeds report_count (%d)\n", in hid_set_field()
1925 hid_err(field->report->device, "value %d is out of range\n", value); in hid_set_field()
1938 struct hid_report *report; in hid_find_field() local
1941 list_for_each_entry(report, report_list, list) { in hid_find_field()
1942 if (report->application != application) in hid_find_field()
1945 for (i = 0; i < report->maxfield; i++) { in hid_find_field()
1946 struct hid_field *field = report->field[i]; in hid_find_field()
1962 struct hid_report *report; in hid_get_report() local
1969 report = report_enum->report_id_hash[n]; in hid_get_report()
1970 if (report == NULL) in hid_get_report()
1973 return report; in hid_get_report()
1980 int __hid_request(struct hid_device *hid, struct hid_report *report, in __hid_request() argument
1987 buf = hid_alloc_report_buf(report, GFP_KERNEL); in __hid_request()
1992 len = hid_report_len(report); in __hid_request()
1994 if (report->id == 0) { in __hid_request()
2001 hid_output_report(report, data_buf); in __hid_request()
2003 ret = hid_hw_raw_request(hid, report->id, buf, len, report->type, reqtype); in __hid_request()
2010 hid_input_report(hid, report->type, buf, ret, 0); in __hid_request()
2024 struct hid_report *report; in hid_report_raw_event() local
2031 report = hid_get_report(report_enum, data); in hid_report_raw_event()
2032 if (!report) in hid_report_raw_event()
2040 rsize = hid_compute_report_size(report); in hid_report_raw_event()
2051 dbg_hid("report %d is too short, (%d < %d)\n", report->id, in hid_report_raw_event()
2057 hid->hiddev_report_event(hid, report); in hid_report_raw_event()
2064 if (hid->claimed != HID_CLAIMED_HIDRAW && report->maxfield) { in hid_report_raw_event()
2065 hid_process_report(hid, report, cdata, interrupt); in hid_report_raw_event()
2067 if (hdrv && hdrv->report) in hid_report_raw_event()
2068 hdrv->report(hid, report); in hid_report_raw_event()
2072 hidinput_report_event(hid, report); in hid_report_raw_event()
2085 struct hid_report *report; in __hid_input_report() local
2122 report = hid_get_report(report_enum, data); in __hid_input_report()
2124 if (!report) { in __hid_input_report()
2129 if (hdrv && hdrv->raw_event && hid_match_report(hid, report)) { in __hid_input_report()
2130 ret = hdrv->raw_event(hid, report, data, size); in __hid_input_report()
2455 struct hid_report *report, enum hid_class_request reqtype) in hid_hw_request() argument
2458 return hdev->ll_driver->request(hdev, report, reqtype); in hid_hw_request()
2460 __hid_request(hdev, report, reqtype); in hid_hw_request()