Changeset 132ab5d1 in mainline for uspace/lib/usbhid/src
- Timestamp:
- 2018-01-30T03:20:45Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5a6cc679
- Parents:
- 8bfb163 (diff), 6a5d05b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- uspace/lib/usbhid/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
r8bfb163 r132ab5d1 36 36 #include <errno.h> 37 37 #include <stdio.h> 38 #include <malloc.h>39 38 #include <mem.h> 40 39 #include <usb/debug.h> 41 40 #include <assert.h> 41 #include <stdlib.h> 42 42 43 43 … … 75 75 #define USB_HID_RESET_OFFSET 3 76 76 77 #define USB_HID_INVALID -98 77 78 /** Unknown tag was founded in report descriptor data*/ 78 79 #define USB_HID_UNKNOWN_TAG -99 … … 103 104 104 105 if(usb_hid_report_compare_usage_path(path, cmp_path, 105 USB_HID_PATH_COMPARE_STRICT) == EOK){106 USB_HID_PATH_COMPARE_STRICT) == 0){ 106 107 break; 107 108 } … … 539 540 540 541 if((ret=usb_hid_report_parse_main_tag(tag, data, item_size, 541 report_item, usage_path)) == EOK) {542 report_item, usage_path)) == 0) { 542 543 543 544 return USB_HID_NEW_REPORT_ITEM; … … 570 571 * @param Length of data buffer 571 572 * @param Current state table 572 * @return Errorcode573 * @return 0 or USB_HID_ code 573 574 */ 574 575 … … 585 586 case USB_HID_REPORT_TAG_FEATURE: 586 587 report_item->item_flags = *data; 587 return EOK;588 return 0; 588 589 break; 589 590 … … 625 626 } 626 627 627 return EOK;628 return 0; 628 629 } 629 630 … … 635 636 * @param Length of data buffer 636 637 * @param Current state table 637 * @return Errorcode638 * @return 0 or USB_HID_ code 638 639 */ 639 640 int usb_hid_report_parse_global_tag(uint8_t tag, const uint8_t *data, … … 711 712 } 712 713 713 return EOK;714 return 0; 714 715 } 715 716 … … 721 722 * @param Length of data buffer 722 723 * @param Current state table 723 * @return Errorcode724 * @return 0 or USB_HID_ code 724 725 */ 725 726 int usb_hid_report_parse_local_tag(uint8_t tag, const uint8_t *data, … … 777 778 USB_HID_EXTENDED_USAGE_PAGE( 778 779 usb_hid_report_tag_data_uint32(data, item_size))) { 779 return EINVAL;780 return USB_HID_INVALID; 780 781 } 781 782 … … 848 849 } 849 850 850 return EOK;851 return 0; 851 852 } 852 853 -
uspace/lib/usbhid/src/hidparser.c
r8bfb163 r132ab5d1 36 36 #include <errno.h> 37 37 #include <stdio.h> 38 #include < malloc.h>38 #include <stdlib.h> 39 39 #include <mem.h> 40 40 #include <usb/debug.h> … … 518 518 519 519 if (usb_hid_report_compare_usage_path( 520 field->collection_path, path, flags) == EOK) {520 field->collection_path, path, flags) == 0) { 521 521 usb_hid_report_remove_last_item( 522 522 field->collection_path); -
uspace/lib/usbhid/src/hidpath.c
r8bfb163 r132ab5d1 36 36 #include <errno.h> 37 37 #include <stdio.h> 38 #include <malloc.h>39 38 #include <mem.h> 39 #include <stdlib.h> 40 40 #include <usb/debug.h> 41 41 #include <assert.h> … … 191 191 * @param flags Flags determining the mode of comparison 192 192 * 193 * @return EOKif both paths are identical, non zero number otherwise193 * @return 0 if both paths are identical, non zero number otherwise 194 194 * 195 195 */ … … 213 213 // Empty path match all others 214 214 if (path->depth == 0) { 215 return EOK;215 return 0; 216 216 } 217 217 … … 239 239 if (USB_HID_SAME_USAGE(report_item->usage, 240 240 path_item->usage)) 241 return EOK;241 return 0; 242 242 } else { 243 return EOK;243 return 0; 244 244 } 245 245 } … … 285 285 ((report_link == &report_path->items.head) && 286 286 (path_link == &path->items.head))) { 287 return EOK;287 return 0; 288 288 } else { 289 289 return 1; … … 297 297 298 298 if (list_empty(&path->items)) { 299 return EOK;299 return 0; 300 300 } 301 301 … … 320 320 321 321 if (path_link == &path->items.head) { 322 return EOK;322 return 0; 323 323 } else { 324 324 return 1; … … 327 327 328 328 default: 329 return EINVAL;329 return -1; 330 330 } 331 331 }
Note:
See TracChangeset
for help on using the changeset viewer.