Changes in / [f55ded3:7aaf403e] in mainline
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/kbd/kbddev.c
rf55ded3 r7aaf403e 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_ USAGE_PAGE_ONLY | USB_HID_PATH_COMPARE_END,315 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 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, USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY 337 | USB_HID_PATH_COMPARE_END, USB_HID_REPORT_TYPE_OUTPUT); 336 kbd_dev->led_path, 337 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 338 USB_HID_REPORT_TYPE_OUTPUT); 338 339 } 339 340 … … 677 678 // callbacks, kbd_dev); 678 679 usb_hid_report_path_t *path = usb_hid_report_path(); 679 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_ GENERIC_DESKTOP, 6);680 usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0); 680 681 //usb_hid_report_path_set_report_id(path, 0); 681 682 … … 695 696 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 696 697 hid_dev->report, NULL, path, 697 USB_HID_PATH_COMPARE_ BEGIN,698 USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 698 699 USB_HID_REPORT_TYPE_INPUT); 699 700 unsigned i = 0; 700 701 701 702 while (field != NULL) { 702 //usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n",703 //field, field->value, field->usage);703 usb_log_debug2("FIELD (%p) - VALUE(%d) USAGE(%u)\n", 704 field, field->value, field->usage); 704 705 705 706 assert(i < kbd_dev->key_count); … … 716 717 * two parts of the Report somehow. 717 718 */ 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_BEGIN, 729 USB_HID_PATH_COMPARE_END 730 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 730 731 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 863 868 kbd_dev->key_count = usb_hid_report_size( 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); 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 867 874 kbd_dev->keys = (int32_t *)calloc(kbd_dev->key_count, sizeof(int32_t)); 868 875 … … 901 908 kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0); 902 909 903 kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report, 0,904 USB_HID_REPORT_TYPE_OUTPUT);910 kbd_dev->led_output_size = usb_hid_report_size(hid_dev->report, 911 0, USB_HID_REPORT_TYPE_OUTPUT); 905 912 906 913 usb_log_debug("Output report size (in items): %zu\n", … … 980 987 return rc; 981 988 } 982 989 983 990 return EOK; 984 991 } -
uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
rf55ded3 r7aaf403e 180 180 * @param key Key code of the key according to HID Usage Tables. 181 181 */ 182 /*183 182 static void usb_lgtch_push_ev(usb_hid_dev_t *hid_dev, int type, 184 183 unsigned int key) … … 207 206 ev.mods, ev.c); 208 207 } 209 */ 208 210 209 /*----------------------------------------------------------------------------*/ 211 210 … … 301 300 usb_hid_report_path_set_report_id(path, 1); 302 301 303 lgtch_dev->key_count = usb_hid_report_size(hid_dev->report, 1, 304 USB_HID_REPORT_TYPE_INPUT); 305 302 lgtch_dev->key_count = usb_hid_report_size( 303 hid_dev->report, 0, USB_HID_REPORT_TYPE_INPUT); 306 304 usb_hid_report_path_free(path); 307 305 … … 397 395 398 396 usb_hid_report_field_t *field = usb_hid_report_get_sibling( 399 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_ BEGIN397 hid_dev->report, NULL, path, USB_HID_PATH_COMPARE_END 400 398 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 401 399 USB_HID_REPORT_TYPE_INPUT); … … 407 405 */ 408 406 while (field != NULL) { 409 usb_log_debug("\n");410 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value,411 field->usage);407 if(field->value != 0) { 408 usb_log_debug(NAME " KEY VALUE(%X) USAGE(%X)\n", field->value, 409 field->usage); 412 410 413 // key = usb_lgtch_map_usage(field->usage); 414 // usb_lgtch_push_ev(hid_dev, KEY_PRESS, key); 411 //key = usb_lgtch_map_usage(field->usage); 412 usb_lgtch_push_ev(hid_dev, KEY_PRESS, field->usage); 413 } 415 414 416 415 field = usb_hid_report_get_sibling( 417 hid_dev->report, field, path, USB_HID_PATH_COMPARE_ BEGIN416 hid_dev->report, field, path, USB_HID_PATH_COMPARE_END 418 417 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 419 418 USB_HID_REPORT_TYPE_INPUT); -
uspace/drv/usbhid/subdrivers.c
rf55ded3 r7aaf403e 42 42 43 43 static usb_hid_subdriver_usage_t path_kbd[] = { 44 {USB_HIDUT_PAGE_GENERIC_DESKTOP, 6},44 {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_KEYBOARD}, 45 45 {0, 0} 46 46 }; 47 47 48 48 static usb_hid_subdriver_usage_t path_mouse2[] = { 49 {USB_HIDUT_PAGE_GENERIC_DESKTOP, 2},49 {USB_HIDUT_PAGE_GENERIC_DESKTOP, USB_HIDUT_USAGE_GENERIC_DESKTOP_MOUSE}, 50 50 {0, 0} 51 51 }; … … 59 59 { 60 60 path_kbd, 61 -1,62 USB_HID_PATH_COMPARE_BEGIN 61 0, 62 USB_HID_PATH_COMPARE_BEGIN, 63 63 -1, 64 64 -1, … … 74 74 lgtch_path, 75 75 1, 76 USB_HID_PATH_COMPARE_BEGIN, 76 USB_HID_PATH_COMPARE_BEGIN 77 | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 77 78 0x046d, 78 79 0xc30e, … … 86 87 { 87 88 path_mouse2, 88 -1,89 0, 89 90 USB_HID_PATH_COMPARE_BEGIN, 90 91 -1, -
uspace/drv/usbhid/usbhid.c
rf55ded3 r7aaf403e 199 199 mapping->report_id); 200 200 } 201 202 uint8_t report_id = (mapping->report_id >= 0) ? mapping->report_id : 0; 201 203 202 assert(hid_dev->report != NULL); 204 203 205 204 usb_log_debug("Compare flags: %d\n", mapping->compare); 206 size_t size = usb_hid_report_size(hid_dev->report, report_id, 207 USB_HID_REPORT_TYPE_INPUT); 205 // size_t size = usb_hid_report_size(hid_dev->report, 0, 206 // USB_HID_REPORT_TYPE_INPUT); 207 size_t size = 0; 208 usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->report, 209 NULL, usage_path, mapping->compare, USB_HID_REPORT_TYPE_INPUT); 210 while(field != NULL) { 211 size++; 212 field = usb_hid_report_get_sibling (hid_dev->report, 213 field, usage_path, mapping->compare, 214 USB_HID_REPORT_TYPE_INPUT); 215 } 216 208 217 usb_log_debug("Size of the input report: %zuB\n", size); 209 210 218 usb_hid_report_path_free(usage_path); 211 219 -
uspace/drv/usbkbd/kbddev.c
rf55ded3 r7aaf403e 803 803 usb_hid_report_path_set_report_id(kbd_dev->led_path, 0x00); 804 804 805 kbd_dev->led_output_size = usb_hid_report_size(kbd_dev->parser, 0, 806 USB_HID_REPORT_TYPE_OUTPUT); 805 kbd_dev->led_output_size = usb_hid_report_size(kbd_dev->parser, 806 0, 807 USB_HID_REPORT_TYPE_INPUT); 807 808 808 809 usb_log_debug("Output report size (in items): %zu\n", -
uspace/lib/usb/src/hiddescriptor.c
rf55ded3 r7aaf403e 155 155 } 156 156 else { 157 157 158 /* Fill the correct Usage and Usage Page */ 158 159 int32_t usage; … … 462 463 463 464 case USB_HID_REPORT_TAG_COLLECTION: 465 464 466 // store collection atributes 465 467 path_item = list_get_instance(usage_path->head.prev, usb_hid_report_usage_path_t, link); -
uspace/lib/usb/src/hidparser.c
rf55ded3 r7aaf403e 333 333 report_item = list_get_instance(item, usb_hid_report_field_t, link); 334 334 335 usb_log_debug("OUTPUT ITEM usage(%x), value(%x)\n", report_item->usage, report_item->value); 336 335 337 if(USB_HID_ITEM_FLAG_VARIABLE(report_item->item_flags) == 0) { 336 338
Note:
See TracChangeset
for help on using the changeset viewer.