Changeset e1dbcbc in mainline for uspace/drv/usbkbd/kbddev.c
- Timestamp:
- 2011-04-29T13:43:01Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a81a1d09
- Parents:
- 380e0364 (diff), f19f1b7 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/kbddev.c
r380e0364 re1dbcbc 128 128 0x15, 0x00, // Logical Minimum (0), 129 129 0x25, 0x01, // Logical Maximum (1), 130 //0x85, 0x00, // Report ID, 131 //0xA4, // Push 130 132 0x81, 0x02, // Input (Data, Variable, Absolute), ; Modifier byte 131 0x95, 0x01, // Report Count (1), 132 0x75, 0x08, // Report Size (8), 133 //0xB4, // Pop 134 0x75, 0x08, // Report Size (1), 135 0x95, 0x01, // Report Count (8), 133 136 0x81, 0x01, // Input (Constant), ; Reserved byte 134 137 0x95, 0x05, // Report Count (5), … … 268 271 return; 269 272 } 270 273 271 274 unsigned i = 0; 272 275 … … 290 293 291 294 usb_log_debug("Creating output report.\n"); 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);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); 298 301 299 302 if (rc != EOK) { … … 563 566 assert(kbd_dev != NULL); 564 567 565 usb_log_debug("Got keys from parser (report id: % u): %s\n",566 report_id,usb_debug_str_buffer(key_codes, count, 0));568 usb_log_debug("Got keys from parser (report id: %d): %s\n", report_id, 569 usb_debug_str_buffer(key_codes, count, 0)); 567 570 568 571 if (count != kbd_dev->key_count) { 569 usb_log_warning("Number of received keycodes (% d) differs from"570 " expected number (%d).\n", count, kbd_dev->key_count);572 usb_log_warning("Number of received keycodes (%zu) differs from" 573 " expected (%zu).\n", count, kbd_dev->key_count); 571 574 return; 572 575 } … … 614 617 usb_hid_report_path_t *path = usb_hid_report_path(); 615 618 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 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); 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); 622 623 623 624 usb_hid_report_path_free (path); … … 663 664 memset(kbd_dev, 0, sizeof(usb_kbd_t)); 664 665 665 kbd_dev->parser = (usb_hid_report_ parser_t *)(malloc(sizeof(666 usb_hid_report_ parser_t)));666 kbd_dev->parser = (usb_hid_report_t *)(malloc(sizeof( 667 usb_hid_report_t))); 667 668 if (kbd_dev->parser == NULL) { 668 669 usb_log_fatal("No memory!\n"); … … 732 733 733 734 /* Initialize the report parser. */ 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 }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 //} 739 740 740 741 /* Get the report descriptor and parse it. */ … … 771 772 772 773 kbd_dev->key_count = usb_hid_report_input_length( 773 kbd_dev->parser, path, 774 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY); 774 kbd_dev->parser, path, USB_HID_PATH_COMPARE_END); 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 );792 if (kbd_dev->output_buffer == NULL && kbd_dev->output_size != 0) {791 &kbd_dev->output_size, 0x00); 792 if (kbd_dev->output_buffer == NULL) { 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); 803 804 804 805 kbd_dev->led_output_size = usb_hid_report_output_size(kbd_dev->parser, … … 849 850 * Set Idle rate 850 851 */ 851 usb_kbd_set_led(kbd_dev); 852 usb_kbd_set_led(kbd_dev); 852 853 853 854 usbhid_req_set_idle(&kbd_dev->usb_dev->ctrl_pipe, … … 934 935 // destroy the parser 935 936 if ((*kbd_dev)->parser != NULL) { 936 usb_hid_free_report _parser((*kbd_dev)->parser);937 usb_hid_free_report((*kbd_dev)->parser); 937 938 } 938 939
Note:
See TracChangeset
for help on using the changeset viewer.