Changeset e3b5129 in mainline for uspace/drv/usbhid/usbhid.c
- Timestamp:
- 2011-04-12T19:00:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 11d2e96a, c7dd69d
- Parents:
- a6610d4
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/usbhid.c
ra6610d4 re3b5129 164 164 165 165 static bool usb_hid_path_matches(usb_hid_dev_t *hid_dev, 166 const usb_hid_subdriver_ usage_t *path, int compare)166 const usb_hid_subdriver_mapping_t *mapping) 167 167 { 168 168 assert(hid_dev != NULL); 169 assert( path!= NULL);169 assert(mapping != NULL); 170 170 171 171 usb_hid_report_path_t *usage_path = usb_hid_report_path(); … … 175 175 } 176 176 int i = 0; 177 while (path[i].usage != 0 || path[i].usage_page != 0) { 177 while (mapping->usage_path[i].usage != 0 178 || mapping->usage_path[i].usage_page != 0) { 178 179 if (usb_hid_report_path_append_item(usage_path, 179 path[i].usage_page, path[i].usage) != EOK) { 180 mapping->usage_path[i].usage_page, 181 mapping->usage_path[i].usage) != EOK) { 180 182 usb_log_debug("Failed to append to usage path.\n"); 181 183 usb_hid_report_path_free(usage_path); … … 185 187 } 186 188 189 if (mapping->report_id >= 0) { 190 usb_hid_report_path_set_report_id(usage_path, 191 mapping->report_id); 192 } 193 187 194 assert(hid_dev->parser != NULL); 188 195 189 usb_log_debug("Compare flags: %d\n", compare);196 usb_log_debug("Compare flags: %d\n", mapping->compare); 190 197 size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path, 191 compare);198 mapping->compare); 192 199 usb_log_debug("Size of the input report: %d\n", size); 193 200 … … 273 280 if (mapping->usage_path != NULL) { 274 281 usb_log_debug("Comparing device against usage path.\n"); 275 if (usb_hid_path_matches(hid_dev, 276 mapping->usage_path, mapping->compare)) { 282 if (usb_hid_path_matches(hid_dev, mapping)) { 277 283 // does not matter if IDs were matched 278 284 matched = true;
Note:
See TracChangeset
for help on using the changeset viewer.