Changeset 19e0560e in mainline for uspace/drv/usbhid/usbhid.c
- Timestamp:
- 2011-05-30T19:06:57Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 173922f
- Parents:
- 1aba480
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/usbhid.c
r1aba480 r19e0560e 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 68 65 /*----------------------------------------------------------------------------*/ 69 66 … … 206 203 } 207 204 208 // if (mapping->report_id >= 0) {209 // usb_hid_report_path_set_report_id(usage_path,210 // mapping->report_id);211 // }212 213 205 assert(hid_dev->report != NULL); 214 206 215 207 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;219 208 220 209 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);225 210 uint8_t report_id = mapping->report_id; 226 211 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 212 do { 234 213 usb_log_debug("Trying report id %u\n", report_id); 235 214 … … 247 226 248 227 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);253 228 matches = true; 254 229 break; … … 258 233 hid_dev->report, report_id, 259 234 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 // }277 235 } while (!matches && report_id != 0); 278 236 279 // usb_log_debug("Size of the input report: %zu\n", size);280 237 usb_hid_report_path_free(usage_path); 281 238 … … 423 380 424 381 uint8_t report_id = 0; 425 size_t size;/* = usb_hid_report_byte_size(hid_dev->report, report_id, 426 USB_HID_REPORT_TYPE_INPUT);*/ 382 size_t size; 427 383 428 384 size_t max_size = 0; … … 503 459 rc = usb_hid_check_pipes(hid_dev, dev); 504 460 if (rc != EOK) { 505 //usb_hid_free(&hid_dev);506 461 return rc; 507 462 } … … 551 506 == USB_HID_GENERIC_POLL_EP_NO); 552 507 553 /* TODO: this has no meaning if the report descriptor554 is not parsed */555 508 usb_log_info("Falling back to generic HID driver.\n"); 556 509 rc = usb_hid_set_generic_hid_subdriver(hid_dev); … … 563 516 usb_log_debug("Subdriver count: %d\n", 564 517 hid_dev->subdriver_count); 565 //usb_hid_free(&hid_dev);566 518 567 519 } else { … … 619 571 usb_hid_dev_t *hid_dev = (usb_hid_dev_t *)arg; 620 572 621 // int allocated = (hid_dev->input_report != NULL);622 573 assert(hid_dev->input_report != NULL); 623 574 usb_log_debug("Max input report size: %zu, buffer size: %zu\n", 624 575 hid_dev->max_input_report_size, buffer_size); 625 //assert(hid_dev->max_input_report_size >= buffer_size); 576 626 577 if (hid_dev->max_input_report_size >= buffer_size) { 627 578 /*! @todo This should probably be atomic. */ … … 670 621 /*----------------------------------------------------------------------------*/ 671 622 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 connected691 // // to the console; there is probably no better way to do this692 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 707 623 void usb_hid_new_report(usb_hid_dev_t *hid_dev) 708 624 { … … 716 632 return hid_dev->report_nr; 717 633 } 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 //}732 634 733 635 /*----------------------------------------------------------------------------*/
Note:
See TracChangeset
for help on using the changeset viewer.