Changeset 1be39e9 in mainline
- Timestamp:
- 2011-05-06T14:52:27Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5f7b75a
- Parents:
- 674cf89
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hiddescriptor.c
r674cf89 r1be39e9 551 551 usb_hid_report_item_t *report_item, usb_hid_report_path_t *usage_path) 552 552 { 553 switch(report_item->in_delimiter) { 554 case INSIDE_DELIMITER_SET: 555 // nothing to do 556 break; 557 case START_DELIMITER_SET: 558 report_item->in_delimiter = INSIDE_DELIMITER_SET; 559 case OUTSIDE_DELIMITER_SET: 560 561 switch(tag) { 562 case USB_HID_REPORT_TAG_USAGE: 553 switch(tag) { 554 case USB_HID_REPORT_TAG_USAGE: 555 switch(report_item->in_delimiter) { 556 case INSIDE_DELIMITER_SET: 557 // nothing to do 558 break; 559 case START_DELIMITER_SET: 560 report_item->in_delimiter = INSIDE_DELIMITER_SET; 561 case OUTSIDE_DELIMITER_SET: 563 562 report_item->usages[report_item->usages_count] = usb_hid_report_tag_data_uint32(data,item_size); 564 563 report_item->usages_count++; 565 564 break; 566 case USB_HID_REPORT_TAG_USAGE_MINIMUM: 567 if (item_size == 3) { 568 // usage extended usages 569 report_item->extended_usage_page = (usb_hid_report_tag_data_uint32(data,item_size) & 0xFF00) >> 16; 570 report_item->usage_minimum = usb_hid_report_tag_data_uint32(data,item_size) & 0xFF; 571 } 572 else { 573 report_item->usage_minimum = usb_hid_report_tag_data_uint32(data,item_size); 574 } 575 break; 576 case USB_HID_REPORT_TAG_USAGE_MAXIMUM: 577 if (item_size == 3) { 578 // usage extended usages 579 report_item->extended_usage_page = (usb_hid_report_tag_data_uint32(data,item_size) & 0xFF00) >> 16; 580 report_item->usage_maximum = usb_hid_report_tag_data_uint32(data,item_size) & 0xFF; 581 } 582 else { 583 report_item->usage_maximum = usb_hid_report_tag_data_uint32(data,item_size); 584 } 585 break; 586 case USB_HID_REPORT_TAG_DESIGNATOR_INDEX: 587 report_item->designator_index = usb_hid_report_tag_data_uint32(data,item_size); 588 break; 589 case USB_HID_REPORT_TAG_DESIGNATOR_MINIMUM: 590 report_item->designator_minimum = usb_hid_report_tag_data_uint32(data,item_size); 591 break; 592 case USB_HID_REPORT_TAG_DESIGNATOR_MAXIMUM: 593 report_item->designator_maximum = usb_hid_report_tag_data_uint32(data,item_size); 594 break; 595 case USB_HID_REPORT_TAG_STRING_INDEX: 596 report_item->string_index = usb_hid_report_tag_data_uint32(data,item_size); 597 break; 598 case USB_HID_REPORT_TAG_STRING_MINIMUM: 599 report_item->string_minimum = usb_hid_report_tag_data_uint32(data,item_size); 600 break; 601 case USB_HID_REPORT_TAG_STRING_MAXIMUM: 602 report_item->string_maximum = usb_hid_report_tag_data_uint32(data,item_size); 603 break; 604 case USB_HID_REPORT_TAG_DELIMITER: 605 report_item->in_delimiter = usb_hid_report_tag_data_uint32(data,item_size); 606 break; 607 608 default: 609 return USB_HID_NO_ACTION; 610 } 611 612 break; 613 } 614 565 } 566 break; 567 case USB_HID_REPORT_TAG_USAGE_MINIMUM: 568 if (item_size == 3) { 569 // usage extended usages 570 report_item->extended_usage_page = (usb_hid_report_tag_data_uint32(data,item_size) & 0xFF00) >> 16; 571 report_item->usage_minimum = usb_hid_report_tag_data_uint32(data,item_size) & 0xFF; 572 } 573 else { 574 report_item->usage_minimum = usb_hid_report_tag_data_uint32(data,item_size); 575 } 576 break; 577 case USB_HID_REPORT_TAG_USAGE_MAXIMUM: 578 if (item_size == 3) { 579 // usage extended usages 580 report_item->extended_usage_page = (usb_hid_report_tag_data_uint32(data,item_size) & 0xFF00) >> 16; 581 report_item->usage_maximum = usb_hid_report_tag_data_uint32(data,item_size) & 0xFF; 582 } 583 else { 584 report_item->usage_maximum = usb_hid_report_tag_data_uint32(data,item_size); 585 } 586 break; 587 case USB_HID_REPORT_TAG_DESIGNATOR_INDEX: 588 report_item->designator_index = usb_hid_report_tag_data_uint32(data,item_size); 589 break; 590 case USB_HID_REPORT_TAG_DESIGNATOR_MINIMUM: 591 report_item->designator_minimum = usb_hid_report_tag_data_uint32(data,item_size); 592 break; 593 case USB_HID_REPORT_TAG_DESIGNATOR_MAXIMUM: 594 report_item->designator_maximum = usb_hid_report_tag_data_uint32(data,item_size); 595 break; 596 case USB_HID_REPORT_TAG_STRING_INDEX: 597 report_item->string_index = usb_hid_report_tag_data_uint32(data,item_size); 598 break; 599 case USB_HID_REPORT_TAG_STRING_MINIMUM: 600 report_item->string_minimum = usb_hid_report_tag_data_uint32(data,item_size); 601 break; 602 case USB_HID_REPORT_TAG_STRING_MAXIMUM: 603 report_item->string_maximum = usb_hid_report_tag_data_uint32(data,item_size); 604 break; 605 case USB_HID_REPORT_TAG_DELIMITER: 606 report_item->in_delimiter = usb_hid_report_tag_data_uint32(data,item_size); 607 break; 608 609 default: 610 return USB_HID_NO_ACTION; 611 } 612 615 613 return EOK; 616 614 }
Note:
See TracChangeset
for help on using the changeset viewer.