Changes in uspace/drv/usbhid/usbhid.c [19e0560e:f3f9733] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/usbhid.c
r19e0560e rf3f9733 63 63 static const int USB_HID_MAX_SUBDRIVERS = 10; 64 64 65 /** @todo What happens if this is not fibril local? */ 66 //static fibril_local bool report_number; 67 65 68 /*----------------------------------------------------------------------------*/ 66 69 … … 203 206 } 204 207 208 // if (mapping->report_id >= 0) { 209 // usb_hid_report_path_set_report_id(usage_path, 210 // mapping->report_id); 211 // } 212 205 213 assert(hid_dev->report != NULL); 206 214 207 215 usb_log_debug("Compare flags: %d\n", mapping->compare); 216 // size_t size = usb_hid_report_size(hid_dev->report, 0, 217 // USB_HID_REPORT_TYPE_INPUT); 218 // size_t size = 0; 208 219 209 220 bool matches = false; 221 222 // usb_hid_report_description_t *report_des = 223 // usb_hid_report_find_description(hid_dev->report, 224 // mapping->report_id, USB_HID_REPORT_TYPE_INPUT); 210 225 uint8_t report_id = mapping->report_id; 211 226 212 do { 227 /*while(report_des != NULL)*/do { 228 229 // if((mapping->report_id) == 0 && (report_des->report_id != 0)) { 230 // usb_hid_report_path_set_report_id(usage_path, 231 // report_des->report_id); 232 // } 233 213 234 usb_log_debug("Trying report id %u\n", report_id); 214 235 … … 226 247 227 248 if (field != NULL) { 249 // size++; 250 // field = usb_hid_report_get_sibling(hid_dev->report, 251 // field, usage_path, mapping->compare, 252 // USB_HID_REPORT_TYPE_INPUT); 228 253 matches = true; 229 254 break; … … 233 258 hid_dev->report, report_id, 234 259 USB_HID_REPORT_TYPE_INPUT); 260 261 // if((mapping->report_id == 0) && (report_des->report_id != 0)) { 262 // uint8_t report_id = usb_hid_get_next_report_id( 263 // hid_dev->report, report_des->report_id, 264 // USB_HID_REPORT_TYPE_INPUT); 265 266 // if(report_id == 0) { 267 // break; 268 // } 269 270 // report_des = usb_hid_report_find_description( 271 // hid_dev->report, report_id, 272 // USB_HID_REPORT_TYPE_INPUT); 273 // } 274 // else { 275 // break; 276 // } 235 277 } while (!matches && report_id != 0); 236 278 279 // usb_log_debug("Size of the input report: %zu\n", size); 237 280 usb_hid_report_path_free(usage_path); 238 281 … … 380 423 381 424 uint8_t report_id = 0; 382 size_t size; 425 size_t size;/* = usb_hid_report_byte_size(hid_dev->report, report_id, 426 USB_HID_REPORT_TYPE_INPUT);*/ 383 427 384 428 size_t max_size = 0; … … 459 503 rc = usb_hid_check_pipes(hid_dev, dev); 460 504 if (rc != EOK) { 505 //usb_hid_free(&hid_dev); 461 506 return rc; 462 507 } … … 506 551 == USB_HID_GENERIC_POLL_EP_NO); 507 552 553 /* TODO: this has no meaning if the report descriptor 554 is not parsed */ 508 555 usb_log_info("Falling back to generic HID driver.\n"); 509 556 rc = usb_hid_set_generic_hid_subdriver(hid_dev); … … 516 563 usb_log_debug("Subdriver count: %d\n", 517 564 hid_dev->subdriver_count); 565 //usb_hid_free(&hid_dev); 518 566 519 567 } else { … … 571 619 usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg; 572 620 621 // int allocated = (hid_dev->input_report != NULL); 573 622 assert(hid_dev->input_report != NULL); 574 623 usb_log_debug("Max input report size: %zu, buffer size: %zu\n", 575 624 hid_dev->max_input_report_size, buffer_size); 576 625 //assert(hid_dev->max_input_report_size >= buffer_size); 577 626 if (hid_dev->max_input_report_size >= buffer_size) { 578 627 /*! @todo This should probably be atomic. */ … … 621 670 /*----------------------------------------------------------------------------*/ 622 671 672 //const char *usb_hid_get_function_name(const usb_hid_dev_t *hid_dev) 673 //{ 674 // switch (hid_dev->poll_pipe_index) { 675 // case USB_HID_KBD_POLL_EP_NO: 676 // return HID_KBD_FUN_NAME; 677 // break; 678 // case USB_HID_MOUSE_POLL_EP_NO: 679 // return HID_MOUSE_FUN_NAME; 680 // break; 681 // default: 682 // return HID_GENERIC_FUN_NAME; 683 // } 684 //} 685 686 /*----------------------------------------------------------------------------*/ 687 688 //const char *usb_hid_get_class_name(const usb_hid_dev_t *hid_dev) 689 //{ 690 // // this means that only boot protocol keyboards will be connected 691 // // to the console; there is probably no better way to do this 692 693 // switch (hid_dev->poll_pipe_index) { 694 // case USB_HID_KBD_POLL_EP_NO: 695 // return HID_KBD_CLASS_NAME; 696 // break; 697 // case USB_HID_MOUSE_POLL_EP_NO: 698 // return HID_MOUSE_CLASS_NAME; 699 // break; 700 // default: 701 // return HID_GENERIC_CLASS_NAME; 702 // } 703 //} 704 705 /*----------------------------------------------------------------------------*/ 706 623 707 void usb_hid_new_report(usb_hid_dev_t *hid_dev) 624 708 { … … 632 716 return hid_dev->report_nr; 633 717 } 718 719 /*----------------------------------------------------------------------------*/ 720 721 //void usb_hid_report_received(void) 722 //{ 723 // ++report_number; 724 //} 725 726 /*----------------------------------------------------------------------------*/ 727 728 //bool usb_hid_report_ready(void) 729 //{ 730 // return !report_received; 731 //} 634 732 635 733 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.