Changes in uspace/drv/usbhid/kbd/kbddev.c [3a6e423:252cf2a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
r3a6e423 r252cf2a 313 313 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 314 314 hid_dev->report, NULL, kbd_dev->led_path, 315 USB_HID_PATH_COMPARE_ END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,315 USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END, 316 316 USB_HID_REPORT_TYPE_OUTPUT); 317 317 318 while (field != NULL) { 319 318 while (field != NULL) { 319 320 320 if ((field->usage == USB_HID_LED_NUM_LOCK) 321 321 && (kbd_dev->mods & KM_NUM_LOCK)){ … … 334 334 335 335 field = usb_hid_report_get_sibling(hid_dev->report, field, 336 kbd_dev->led_path, 337 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 338 USB_HID_REPORT_TYPE_OUTPUT); 336 kbd_dev->led_path, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 337 | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT); 339 338 } 340 339 … … 678 677 // callbacks, kbd_dev); 679 678 usb_hid_report_path_t *path = usb_hid_report_path(); 680 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_ KEYBOARD, 0);679 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_GENERIC_DESKTOP, 6); 681 680 //usb_hid_report_path_set_report_id(path, 0); 682 681 … … 696 695 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 697 696 hid_dev->report, NULL, path, 698 USB_HID_PATH_COMPARE_ END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,697 USB_HID_PATH_COMPARE_BEGIN, 699 698 USB_HID_REPORT_TYPE_INPUT); 700 699 unsigned i = 0; 701 700 702 701 while (field != NULL) { 703 usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",704 field, field->value, field->usage);702 //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n", 703 // field, field->value, field->usage); 705 704 706 705 assert(i < kbd_dev->key_count); … … 717 716 * two parts of the Report somehow. 718 717 */ 718 usb_log_debug("value(%x), usage(%x)\n", field->value, field->usage); 719 719 if (field->value != 0) { 720 kbd_dev->keys[i] = field->usage;720 //kbd_dev->keys[i] = field->usage; 721 721 } 722 722 else { 723 kbd_dev->keys[i] = 0;723 //kbd_dev->keys[i] = 0; 724 724 } 725 usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]);725 //usb_log_debug2("Saved %u. key usage %d\n", i, kbd_dev->keys[i]); 726 726 727 727 ++i; 728 728 field = usb_hid_report_get_sibling(hid_dev->report, field, path, 729 USB_HID_PATH_COMPARE_END 730 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 729 USB_HID_PATH_COMPARE_BEGIN, 731 730 USB_HID_REPORT_TYPE_INPUT); 731 usb_log_debug("field -- %p\n", field); 732 732 } 733 733 … … 861 861 * TODO: make more general 862 862 */ 863 usb_hid_report_path_t *path = usb_hid_report_path();864 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);865 866 usb_hid_report_path_set_report_id(path, 0);867 868 863 kbd_dev->key_count = usb_hid_report_size( 869 hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT); 870 usb_hid_report_path_free(path); 871 872 usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count); 873 864 hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT); 865 866 usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count); 874 867 kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t)); 875 868 … … 908 901 kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0); 909 902 910 kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report, 911 0,USB_HID_REPORT_TYPE_OUTPUT);903 kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report, 0, 904 USB_HID_REPORT_TYPE_OUTPUT); 912 905 913 906 usb_log_debug("Output report size (in items): %zu\n", … … 987 980 return rc; 988 981 } 989 982 990 983 return EOK; 991 984 }
Note:
See TracChangeset
for help on using the changeset viewer.