Changes in uspace/drv/usbkbd/kbddev.c [cfbbe1d3:7f2e33a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/kbddev.c
rcfbbe1d3 r7f2e33a 128 128 0x15, 0x00, // Logical Minimum (0), 129 129 0x25, 0x01, // Logical Maximum (1), 130 //0x85, 0x00, // Report ID,131 //0xA4, // Push132 130 0x81, 0x02, // Input (Data, Variable, Absolute), ; Modifier byte 133 //0xB4, // Pop 134 0x75, 0x08, // Report Size (1), 135 0x95, 0x01, // Report Count (8), 131 0x95, 0x01, // Report Count (1), 132 0x75, 0x08, // Report Size (8), 136 133 0x81, 0x01, // Input (Constant), ; Reserved byte 137 134 0x95, 0x05, // Report Count (5), … … 271 268 return; 272 269 } 273 270 274 271 unsigned i = 0; 275 272 … … 293 290 294 291 usb_log_debug("Creating output report.\n"); 295 296 usb_hid_report_output_set_data(kbd_dev->parser, kbd_dev->led_path,297 USB_HID_PATH_COMPARE_END , kbd_dev->led_data,298 kbd_dev->led_output_size);299 int rc = usb_hid_report_output_translate(kbd_dev->parser, 0,300 kbd_dev->output_ buffer, kbd_dev->output_size);292 293 int rc = usb_hid_report_output_translate(kbd_dev->parser, 294 kbd_dev->led_path, 295 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 296 kbd_dev->output_buffer, 297 kbd_dev->output_size, kbd_dev->led_data, kbd_dev->led_output_size); 301 298 302 299 if (rc != EOK) { … … 566 563 assert(kbd_dev != NULL); 567 564 568 usb_log_debug("Got keys from parser (report id: % d): %s\n", report_id,569 usb_debug_str_buffer(key_codes, count, 0));565 usb_log_debug("Got keys from parser (report id: %u): %s\n", 566 report_id, usb_debug_str_buffer(key_codes, count, 0)); 570 567 571 568 if (count != kbd_dev->key_count) { … … 617 614 usb_hid_report_path_t *path = usb_hid_report_path(); 618 615 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 619 620 uint8_t report_id; 621 int rc = usb_hid_parse_report(kbd_dev->parser, buffer, actual_size, &report_id); 622 usb_hid_descriptor_print (kbd_dev->parser); 616 usb_hid_report_path_set_report_id(path, 0); 617 618 int rc = usb_hid_parse_report(kbd_dev->parser, buffer, 619 actual_size, path, 620 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 621 callbacks, kbd_dev); 623 622 624 623 usb_hid_report_path_free (path); … … 664 663 memset(kbd_dev, 0, sizeof(usb_kbd_t)); 665 664 666 kbd_dev->parser = (usb_hid_report_ t *)(malloc(sizeof(667 usb_hid_report_ t)));665 kbd_dev->parser = (usb_hid_report_parser_t *)(malloc(sizeof( 666 usb_hid_report_parser_t))); 668 667 if (kbd_dev->parser == NULL) { 669 668 usb_log_fatal("No memory!\n"); … … 733 732 734 733 /* Initialize the report parser. */ 735 //rc = usb_hid_parser_init(kbd_dev->parser);736 //if (rc != EOK) {737 //usb_log_error("Failed to initialize report parser.\n");738 //return rc;739 //}734 rc = usb_hid_parser_init(kbd_dev->parser); 735 if (rc != EOK) { 736 usb_log_error("Failed to initialize report parser.\n"); 737 return rc; 738 } 740 739 741 740 /* Get the report descriptor and parse it. */ … … 772 771 773 772 kbd_dev->key_count = usb_hid_report_input_length( 774 kbd_dev->parser, path, USB_HID_PATH_COMPARE_END); 773 kbd_dev->parser, path, 774 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY); 775 775 usb_hid_report_path_free (path); 776 776 … … 789 789 kbd_dev->output_size = 0; 790 790 kbd_dev->output_buffer = usb_hid_report_output(kbd_dev->parser, 791 &kbd_dev->output_size , 0x00);792 if (kbd_dev->output_buffer == NULL ) {791 &kbd_dev->output_size); 792 if (kbd_dev->output_buffer == NULL && kbd_dev->output_size != 0) { 793 793 usb_log_warning("Error creating output report buffer.\n"); 794 794 free(kbd_dev->keys); … … 801 801 usb_hid_report_path_append_item( 802 802 kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0); 803 usb_hid_report_path_set_report_id(kbd_dev->led_path, 0x00);804 803 805 804 kbd_dev->led_output_size = usb_hid_report_output_size(kbd_dev->parser, … … 850 849 * Set Idle rate 851 850 */ 852 usb_kbd_set_led(kbd_dev); 851 usb_kbd_set_led(kbd_dev); 853 852 854 853 usbhid_req_set_idle(&kbd_dev->usb_dev->ctrl_pipe, … … 935 934 // destroy the parser 936 935 if ((*kbd_dev)->parser != NULL) { 937 usb_hid_free_report ((*kbd_dev)->parser);936 usb_hid_free_report_parser((*kbd_dev)->parser); 938 937 } 939 938
Note:
See TracChangeset
for help on using the changeset viewer.