Changeset 1cbb4b7 in mainline
- Timestamp:
- 2011-04-10T18:28:45Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 777e336, c7bdfa7
- Parents:
- f76153ce
- Location:
- uspace
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhid/subdrivers.c
rf76153ce r1cbb4b7 35 35 36 36 #include "subdrivers.h" 37 #include "usb/classes/hidut.h" 37 38 38 static usb_hid_subdriver_usage_t path_kbd[] = {{ 0, 7}};39 static usb_hid_subdriver_usage_t path_kbd[] = {{USB_HIDUT_PAGE_KEYBOARD, 0}}; 39 40 40 41 const usb_hid_subdriver_mapping_t usb_hid_subdrivers[] = { -
uspace/drv/usbhid/usbhid.c
rf76153ce r1cbb4b7 171 171 usb_hid_report_path_t *usage_path = usb_hid_report_path(); 172 172 if (usage_path == NULL) { 173 usb_log_debug("Failed to create usage path.\n"); 173 174 return false; 174 175 } … … 177 178 if (usb_hid_report_path_append_item(usage_path, 178 179 path[i].usage_page, path[i].usage) != EOK) { 180 usb_log_debug("Failed to append to usage path.\n"); 179 181 usb_hid_report_path_free(usage_path); 180 182 return false; … … 182 184 } 183 185 184 bool matches = (usb_hid_report_input_length(hid_dev->parser, usage_path, 185 compare) > 0); 186 assert(hid_dev->parser != NULL); 187 188 usb_log_debug("Compare flags: %d\n", compare); 189 size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path, 190 compare); 191 usb_log_debug("Size of the input report: %d\n", size); 186 192 187 193 usb_hid_report_path_free(usage_path); 188 194 189 return matches;195 return (size > 0); 190 196 } 191 197 … … 260 266 261 267 if (mapping->usage_path != NULL) { 268 usb_log_debug("Comparing device against usage path.\n"); 262 269 if (usb_hid_path_matches(hid_dev, 263 270 mapping->usage_path, mapping->path_size, 264 271 mapping->compare)) { 265 272 subdrivers[count++] = &mapping->subdriver; 273 } else { 274 usb_log_debug("Not matched.\n"); 266 275 } 267 276 } … … 552 561 // free the subdrivers info 553 562 if ((*hid_dev)->subdrivers != NULL) { 554 free( subdrivers);563 free((*hid_dev)->subdrivers); 555 564 } 556 565 -
uspace/lib/usb/src/hidparser.c
rf76153ce r1cbb4b7 900 900 item->usage_page = usage_page; 901 901 902 usb_log_debug("Appending usage %d, usage page %d\n", usage, usage_page); 903 902 904 list_append (&usage_path->link, &item->link); 903 905 usage_path->depth++;
Note:
See TracChangeset
for help on using the changeset viewer.