Lines Matching refs:data

84     parser->data.report_id = 1; // we must give it a non-zero value or the parser doesn't work  in hid_reset_parser()
113 static bool hid_parse(struct hid_parser *parser, struct hid_data_t *data) in hid_parse() argument
186 parser->data.path.node[parser->data.path.size].u_page = parser->usage_table[0].u_page; in hid_parse()
187 parser->data.path.node[parser->data.path.size].usage = parser->usage_table[0].usage; in hid_parse()
188 ++parser->data.path.size; in hid_parse()
197 parser->data.path.node[parser->data.path.size].u_page = 0xff; in hid_parse()
198 parser->data.path.node[parser->data.path.size].usage = parser->value & 0x7f; in hid_parse()
199 ++parser->data.path.size; in hid_parse()
208 --parser->data.path.size; // 为什么要--????? in hid_parse()
210 if (parser->data.path.node[parser->data.path.size].u_page == 0xff) in hid_parse()
211 --parser->data.path.size; in hid_parse()
233 parser->data.path.node[parser->data.path.size].u_page = parser->usage_table[0].u_page; in hid_parse()
234 parser->data.path.node[parser->data.path.size].usage = parser->usage_table[0].usage; in hid_parse()
235 ++parser->data.path.size; in hid_parse()
241 parser->data.type = (uint8_t)(parser->item & HID_ITEM_MASK); in hid_parse()
242 parser->data.attribute = (uint8_t)parser->value; in hid_parse()
244 … __get_report_offset(parser, parser->data.report_id, (uint8_t)(parser->item & HID_ITEM_MASK)); in hid_parse()
251 parser->data.offset = *offset_ptr; in hid_parse()
254 memcpy(data, &parser->data, sizeof(struct hid_data_t)); in hid_parse()
257 *offset_ptr = (*offset_ptr) + parser->data.size; in hid_parse()
260 --parser->data.path.size; in hid_parse()
293 parser->data.report_id = (uint8_t)parser->value; in hid_parse()
295 printk("%sReport ID: %i", __spaces(space_cnt), parser->data.report_id); in hid_parse()
298 parser->data.size = parser->value; in hid_parse()
300 printk("%sReport size (%i)", __spaces(space_cnt), parser->data.size); in hid_parse()
308 parser->data.unit_exp = (int8_t)parser->value; in hid_parse()
309 if (parser->data.unit_exp > 7) in hid_parse()
310 parser->data.unit_exp |= 0xf0; in hid_parse()
312 printk("%sUnit Exp (%i)", __spaces(space_cnt), parser->data.unit_exp); in hid_parse()
315 parser->data.unit = parser->value; in hid_parse()
317 printk("%sUnit (%i)", __spaces(space_cnt), parser->data.unit); in hid_parse()
320 … parser->data.logical_min = __format_value(parser->value, item_size[parser->item & HID_SIZE_MASK]); in hid_parse()
322 printk("%sLogical Min (%i)", __spaces(space_cnt), parser->data.logical_min); in hid_parse()
325 … parser->data.logical_max = __format_value(parser->value, item_size[parser->item & HID_SIZE_MASK]); in hid_parse()
327 printk("%sLogical Max (%i)", __spaces(space_cnt), parser->data.logical_max); in hid_parse()
330 … parser->data.phys_min = __format_value(parser->value, item_size[parser->item & HID_SIZE_MASK]); in hid_parse()
332 printk("%Physical Min (%i)", __spaces(space_cnt), parser->data.phys_min); in hid_parse()
335 … parser->data.phys_max = __format_value(parser->value, item_size[parser->item & HID_SIZE_MASK]); in hid_parse()
337 printk("%Physical Max (%i)", __spaces(space_cnt), parser->data.phys_max); in hid_parse()
357 struct hid_data_t data; in hid_parse_report() local
363 while (hid_parse(&parser, &data)) in hid_parse_report()
521 static __always_inline bool __find_object(struct hid_parser *parser, struct hid_data_t *data) in __find_object() argument
523 …g("target_type=%d report_id=%d, offset=%d, size=%d", data->type, data->report_id, data->offset, da… in __find_object()
531 if ((data->path.size > 0) && (found_data.type == data->type) && in __find_object()
532 … (memcmp(found_data.path.node, data->path.node, data->path.size * sizeof(struct hid_node_t)) == 0)) in __find_object()
537 else if ((found_data.report_id == data->report_id) && (found_data.type == data->type) && in __find_object()
538 (found_data.offset == data->offset)) in __find_object()
546 memcpy(data, &found_data, sizeof(struct hid_data_t)); in __find_object()
547 data->report_count = parser->report_count; in __find_object()
559 bool hid_parse_find_object(const void *hid_report, const int report_size, struct hid_data_t *data) in hid_parse_find_object() argument
568 if (__find_object(&parser, data)) in hid_parse_find_object()
575 data->size, data->offset, data->logical_min, data->logical_max, data->attribute); in hid_parse_find_object()