Lines Matching refs:raw_data

77 	u8 raw_data[3];  in picolcd_debug_eeprom_read()  local
86 raw_data[0] = *off & 0xff; in picolcd_debug_eeprom_read()
87 raw_data[1] = (*off >> 8) & 0xff; in picolcd_debug_eeprom_read()
88 raw_data[2] = s < 20 ? s : 20; in picolcd_debug_eeprom_read()
89 if (*off + raw_data[2] > 0xff) in picolcd_debug_eeprom_read()
90 raw_data[2] = 0x100 - *off; in picolcd_debug_eeprom_read()
91 resp = picolcd_send_and_wait(data->hdev, REPORT_EE_READ, raw_data, in picolcd_debug_eeprom_read()
92 sizeof(raw_data)); in picolcd_debug_eeprom_read()
98 ret = resp->raw_data[2]; in picolcd_debug_eeprom_read()
101 if (copy_to_user(u, resp->raw_data+3, ret)) in picolcd_debug_eeprom_read()
117 u8 raw_data[23]; in picolcd_debug_eeprom_write() local
124 memset(raw_data, 0, sizeof(raw_data)); in picolcd_debug_eeprom_write()
125 raw_data[0] = *off & 0xff; in picolcd_debug_eeprom_write()
126 raw_data[1] = (*off >> 8) & 0xff; in picolcd_debug_eeprom_write()
127 raw_data[2] = min_t(size_t, 20, s); in picolcd_debug_eeprom_write()
128 if (*off + raw_data[2] > 0xff) in picolcd_debug_eeprom_write()
129 raw_data[2] = 0x100 - *off; in picolcd_debug_eeprom_write()
131 if (copy_from_user(raw_data+3, u, min((u8)20, raw_data[2]))) in picolcd_debug_eeprom_write()
133 resp = picolcd_send_and_wait(data->hdev, REPORT_EE_WRITE, raw_data, in picolcd_debug_eeprom_write()
134 sizeof(raw_data)); in picolcd_debug_eeprom_write()
141 if (memcmp(raw_data, resp->raw_data, 3+raw_data[2]) == 0) { in picolcd_debug_eeprom_write()
142 *off += raw_data[2]; in picolcd_debug_eeprom_write()
143 ret = raw_data[2]; in picolcd_debug_eeprom_write()
183 u8 raw_data[4]; in _picolcd_flash_read() local
189 len_off = _picolcd_flash_setaddr(data, raw_data, *off); in _picolcd_flash_read()
190 raw_data[len_off] = s > 32 ? 32 : s; in _picolcd_flash_read()
191 resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, len_off+1); in _picolcd_flash_read()
196 if (memcmp(raw_data, resp->raw_data, len_off+1) != 0) in _picolcd_flash_read()
198 if (copy_to_user(u+ret, resp->raw_data+len_off+1, raw_data[len_off])) { in _picolcd_flash_read()
202 *off += raw_data[len_off]; in _picolcd_flash_read()
203 s -= raw_data[len_off]; in _picolcd_flash_read()
204 ret += raw_data[len_off]; in _picolcd_flash_read()
238 u8 raw_data[3]; in _picolcd_flash_erase64() local
245 len_off = _picolcd_flash_setaddr(data, raw_data, *off); in _picolcd_flash_erase64()
246 resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, len_off); in _picolcd_flash_erase64()
251 if (memcmp(raw_data, resp->raw_data, len_off) != 0) in _picolcd_flash_erase64()
265 u8 raw_data[36]; in _picolcd_flash_write() local
271 len_off = _picolcd_flash_setaddr(data, raw_data, *off); in _picolcd_flash_write()
272 raw_data[len_off] = s > 32 ? 32 : s; in _picolcd_flash_write()
273 if (copy_from_user(raw_data+len_off+1, u, raw_data[len_off])) { in _picolcd_flash_write()
277 resp = picolcd_send_and_wait(data->hdev, report_id, raw_data, in _picolcd_flash_write()
278 len_off+1+raw_data[len_off]); in _picolcd_flash_write()
283 if (memcmp(raw_data, resp->raw_data, len_off+1+raw_data[len_off]) != 0) in _picolcd_flash_write()
285 *off += raw_data[len_off]; in _picolcd_flash_write()
286 s -= raw_data[len_off]; in _picolcd_flash_write()
287 ret += raw_data[len_off]; in _picolcd_flash_write()
387 u8 *raw_data; in picolcd_debug_out_report() local
400 raw_data = hid_alloc_report_buf(report, GFP_ATOMIC); in picolcd_debug_out_report()
401 if (!raw_data) { in picolcd_debug_out_report()
409 raw_data[0] = report->id; in picolcd_debug_out_report()
410 hid_output_report(report, raw_data); in picolcd_debug_out_report()
411 dump_buff_as_hex(buff, BUFF_SZ, raw_data, raw_size); in picolcd_debug_out_report()
420 snprintf(buff, BUFF_SZ, "\tGPO state: 0x%02x\n", raw_data[1]); in picolcd_debug_out_report()
428 snprintf(buff, BUFF_SZ, "\tBrightness: 0x%02x\n", raw_data[1]); in picolcd_debug_out_report()
436 snprintf(buff, BUFF_SZ, "\tContrast: 0x%02x\n", raw_data[1]); in picolcd_debug_out_report()
445 raw_data[2], raw_data[1], raw_data[2] << 8 | raw_data[1]); in picolcd_debug_out_report()
475 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
477 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[3]); in picolcd_debug_out_report()
486 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
488 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[3]); in picolcd_debug_out_report()
490 if (raw_data[3] == 0) { in picolcd_debug_out_report()
492 } else if (raw_data[3] + 4 <= raw_size) { in picolcd_debug_out_report()
495 dump_buff_as_hex(buff, BUFF_SZ, raw_data+4, raw_data[3]); in picolcd_debug_out_report()
510 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
514 raw_data[3], raw_data[2], raw_data[1]); in picolcd_debug_out_report()
530 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
532 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[3]); in picolcd_debug_out_report()
536 raw_data[3], raw_data[2], raw_data[1]); in picolcd_debug_out_report()
538 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[4]); in picolcd_debug_out_report()
554 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
556 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[3]); in picolcd_debug_out_report()
558 if (raw_data[3] == 0) { in picolcd_debug_out_report()
560 } else if (raw_data[3] + 4 <= raw_size) { in picolcd_debug_out_report()
563 dump_buff_as_hex(buff, BUFF_SZ, raw_data+4, raw_data[3]); in picolcd_debug_out_report()
570 raw_data[3], raw_data[2], raw_data[1]); in picolcd_debug_out_report()
572 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[4]); in picolcd_debug_out_report()
574 if (raw_data[4] == 0) { in picolcd_debug_out_report()
576 } else if (raw_data[4] + 5 <= raw_size) { in picolcd_debug_out_report()
579 dump_buff_as_hex(buff, BUFF_SZ, raw_data+5, raw_data[4]); in picolcd_debug_out_report()
597 raw_data[1] | (raw_data[2] << 8), in picolcd_debug_out_report()
598 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
626 raw_data[1] | (raw_data[2] << 8), in picolcd_debug_out_report()
627 raw_data[2], raw_data[1]); in picolcd_debug_out_report()
637 kfree(raw_data); in picolcd_debug_out_report()
643 u8 *raw_data, int size) in picolcd_debug_raw_event() argument
662 if (raw_data[2] < ARRAY_SIZE(error_codes)) in picolcd_debug_raw_event()
664 raw_data[2], error_codes[raw_data[2]], raw_data[1]); in picolcd_debug_raw_event()
667 raw_data[2], raw_data[1]); in picolcd_debug_raw_event()
675 if (raw_data[1] == 0) in picolcd_debug_raw_event()
677 else if (raw_data[2] == 0) in picolcd_debug_raw_event()
679 raw_data[1], raw_data[1]); in picolcd_debug_raw_event()
682 raw_data[1], raw_data[1], raw_data[2], raw_data[2]); in picolcd_debug_raw_event()
690 if (raw_data[1] == 0) { in picolcd_debug_raw_event()
693 } else if (raw_data[1] + 1 <= size) { in picolcd_debug_raw_event()
695 raw_data[1]); in picolcd_debug_raw_event()
697 dump_buff_as_hex(buff, BUFF_SZ, raw_data+2, raw_data[1]); in picolcd_debug_raw_event()
701 raw_data[1]-1); in picolcd_debug_raw_event()
711 raw_data[2], raw_data[1]); in picolcd_debug_raw_event()
713 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[3]); in picolcd_debug_raw_event()
715 if (raw_data[3] == 0) { in picolcd_debug_raw_event()
718 } else if (raw_data[3] + 4 <= size) { in picolcd_debug_raw_event()
721 dump_buff_as_hex(buff, BUFF_SZ, raw_data+4, raw_data[3]); in picolcd_debug_raw_event()
736 raw_data[2], raw_data[1]); in picolcd_debug_raw_event()
738 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[3]); in picolcd_debug_raw_event()
740 if (raw_data[3] == 0) { in picolcd_debug_raw_event()
742 } else if (raw_data[3] + 4 <= size) { in picolcd_debug_raw_event()
745 dump_buff_as_hex(buff, BUFF_SZ, raw_data+4, raw_data[3]); in picolcd_debug_raw_event()
752 raw_data[3], raw_data[2], raw_data[1]); in picolcd_debug_raw_event()
754 snprintf(buff, BUFF_SZ, "\tData length: %d\n", raw_data[4]); in picolcd_debug_raw_event()
756 if (raw_data[4] == 0) { in picolcd_debug_raw_event()
758 } else if (raw_data[4] + 5 <= size) { in picolcd_debug_raw_event()
761 dump_buff_as_hex(buff, BUFF_SZ, raw_data+5, raw_data[4]); in picolcd_debug_raw_event()
776 raw_data[2], raw_data[1]); in picolcd_debug_raw_event()
802 raw_data[1], raw_data[2], raw_data[3], raw_data[4]); in picolcd_debug_raw_event()
805 raw_data[5]); in picolcd_debug_raw_event()
813 (raw_data[2] << 8) | raw_data[1]); in picolcd_debug_raw_event()
816 (raw_data[4] << 8) | raw_data[3]); in picolcd_debug_raw_event()
824 raw_data[1], raw_data[2]); in picolcd_debug_raw_event()