Changeset dcb7d7cd in mainline for uspace/drv/usbhid/usbhid.c


Ignore:
Timestamp:
2011-05-30T14:06:39Z (14 years ago)
Author:
Matej Klonfar <maklf@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8357fc9
Parents:
ee7e7c93
Message:

subdrivers matching without specified report_id

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhid/usbhid.c

    ree7e7c93 rdcb7d7cd  
    207207//          USB_HID_REPORT_TYPE_INPUT);
    208208        size_t size = 0;
    209         usb_hid_report_field_t *field = usb_hid_report_get_sibling (hid_dev->report,
    210                 NULL, usage_path, mapping->compare, USB_HID_REPORT_TYPE_INPUT);
    211         while(field != NULL) {
    212                 size++;
    213                 field = usb_hid_report_get_sibling (hid_dev->report,
     209
     210        usb_hid_report_description_t *report_des =
     211                usb_hid_report_find_description(hid_dev->report,
     212                mapping->report_id, USB_HID_REPORT_TYPE_INPUT);
     213
     214        while(report_des != NULL) {
     215
     216                if((mapping->report_id) == 0 && (report_des->report_id != 0)) {
     217                        usb_hid_report_path_set_report_id(usage_path,
     218                                report_des->report_id);
     219                }
     220
     221                usb_hid_report_field_t *field = usb_hid_report_get_sibling (
     222                        hid_dev->report,
     223                        NULL, usage_path, mapping->compare,
     224                        USB_HID_REPORT_TYPE_INPUT);
     225
     226                while(field != NULL) {
     227                        size++;
     228                        field = usb_hid_report_get_sibling (hid_dev->report,
    214229                                        field, usage_path, mapping->compare,
    215230                            USB_HID_REPORT_TYPE_INPUT);
     231                }
     232
     233                if((mapping->report_id == 0) && (report_des->report_id != 0)) {
     234                        uint8_t report_id = usb_hid_get_next_report_id(
     235                                hid_dev->report, report_des->report_id,
     236                                USB_HID_REPORT_TYPE_INPUT);
     237
     238                        if(report_id == 0) {
     239                                break;
     240                        }
     241
     242                        report_des = usb_hid_report_find_description(
     243                                hid_dev->report, report_id,
     244                                USB_HID_REPORT_TYPE_INPUT);
     245                }
     246                else {
     247                        break;
     248                }
    216249        }
    217250       
Note: See TracChangeset for help on using the changeset viewer.