Changes in / [118d38d:8357fc9] in mainline


Ignore:
Location:
uspace
Files:
3 edited

Legend:

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

    r118d38d r8357fc9  
    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       
  • uspace/lib/usbhid/src/hiddescriptor.c

    r118d38d r8357fc9  
    336336                                usb_hid_report_description_t, link);
    337337
    338                 if((report_des->report_id == report_id) &&
     338                // if report id not set, return the first of the type
     339                if(((report_des->report_id == report_id) || (report_id == 0)) &&
    339340                   (report_des->type == type)) {
    340341                        return report_des;
  • uspace/lib/usbhid/src/hidpath.c

    r118d38d r8357fc9  
    211211
    212212        if(report_path->report_id != path->report_id) {
    213                 return 1;
     213                if(path->report_id != 0) {
     214                        return 1;
     215                }
    214216        }
    215217
Note: See TracChangeset for help on using the changeset viewer.