Changeset b83edb93 in mainline
- Timestamp:
- 2011-04-07T20:06:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fd9ba204
- Parents:
- 15a9e63
- Location:
- uspace/drv/usbkbd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbkbd/kbddev.c
r15a9e63 rb83edb93 265 265 static void usb_kbd_set_led(usb_kbd_t *kbd_dev) 266 266 { 267 if (kbd_dev->output_size == 0) { 268 return; 269 } 270 267 271 unsigned i = 0; 268 272 … … 288 292 289 293 int rc = usb_hid_report_output_translate(kbd_dev->parser, 290 kbd_dev->led_path, USB_HID_PATH_COMPARE_END, kbd_dev->output_buffer, 294 kbd_dev->led_path, 295 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 296 kbd_dev->output_buffer, 291 297 kbd_dev->output_size, kbd_dev->led_data, kbd_dev->led_output_size); 292 298 … … 539 545 * according to HID Usage Tables. 540 546 * @param count Number of key codes in report (size of the report). 541 * @param modifiers Bitmap of modifiers (Ctrl, Alt, Shift, GUI).547 * @param report_id 542 548 * @param arg User-specified argument. Expects pointer to the keyboard device 543 549 * structure representing the keyboard. … … 546 552 */ 547 553 static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count, 548 uint8_t modifiers, void *arg)554 uint8_t report_id, void *arg) 549 555 { 550 556 if (arg == NULL) { … … 557 563 assert(kbd_dev != NULL); 558 564 559 usb_log_debug("Got keys from parser : %s\n",560 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)); 561 567 562 568 if (count != kbd_dev->key_count) { … … 608 614 usb_hid_report_path_t *path = usb_hid_report_path(); 609 615 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 616 usb_hid_report_path_set_report_id(path, 1); 610 617 611 618 int rc = usb_hid_parse_report(kbd_dev->parser, buffer, 612 actual_size, path, USB_HID_PATH_COMPARE_STRICT, callbacks, kbd_dev); 619 actual_size, path, 620 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 621 callbacks, kbd_dev); 613 622 614 623 usb_hid_report_path_free (path); … … 758 767 usb_hid_report_path_t *path = usb_hid_report_path(); 759 768 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 769 770 usb_hid_report_path_set_report_id(path, 1); 771 760 772 kbd_dev->key_count = usb_hid_report_input_length( 761 kbd_dev->parser, path, USB_HID_PATH_COMPARE_STRICT); 773 kbd_dev->parser, path, 774 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY); 762 775 usb_hid_report_path_free (path); 763 776 … … 777 790 kbd_dev->output_buffer = usb_hid_report_output(kbd_dev->parser, 778 791 &kbd_dev->output_size); 779 if (kbd_dev->output_buffer == NULL ) {792 if (kbd_dev->output_buffer == NULL && kbd_dev->output_size != 0) { 780 793 usb_log_warning("Error creating output report buffer.\n"); 781 794 free(kbd_dev->keys); … … 790 803 791 804 kbd_dev->led_output_size = usb_hid_report_output_size(kbd_dev->parser, 792 kbd_dev->led_path, USB_HID_PATH_COMPARE_END); 805 kbd_dev->led_path, 806 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY); 793 807 794 808 usb_log_debug("Output report size (in items): %zu\n", -
uspace/drv/usbkbd/main.c
r15a9e63 rb83edb93 105 105 usb_kbd_free(&kbd_dev); 106 106 return rc; 107 } 107 } 108 108 109 109 usb_log_debug("USB/HID KBD device structure initialized.\n"); … … 201 201 if (dev->interface_no < 0) { 202 202 usb_log_warning("Device is not a supported keyboard.\n"); 203 usb_log_error("Failed to add USB KBD device: endpoint not found."204 " \n");203 usb_log_error("Failed to add USB KBD device: endpoint not " 204 "found.\n"); 205 205 return ENOTSUP; 206 206 }
Note:
See TracChangeset
for help on using the changeset viewer.