Changes in uspace/lib/usbhid/src/hiddescriptor.c [9d58539:feeac0d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhid/src/hiddescriptor.c
r9d58539 rfeeac0d 41 41 #include <assert.h> 42 42 43 /*---------------------------------------------------------------------------*/ 43 44 44 /* 45 45 * Constants defining current parsing mode for correct parsing of the set of … … 61 61 #define INSIDE_DELIMITER_SET 2 62 62 63 /*---------------------------------------------------------------------------*/ 63 64 64 65 65 /** The new report item flag. Used to determine when the item is completly … … 78 78 #define USB_HID_UNKNOWN_TAG -99 79 79 80 /*---------------------------------------------------------------------------*/ 80 81 81 /** 82 82 * Checks if given collection path is already present in report structure and … … 124 124 } 125 125 126 /*---------------------------------------------------------------------------*/ 126 127 127 /** 128 128 * Initialize the report descriptor parser structure … … 147 147 } 148 148 149 /*---------------------------------------------------------------------------*/ 149 150 150 151 151 /** … … 314 314 return EOK; 315 315 } 316 /*---------------------------------------------------------------------------*/ 316 317 317 /** 318 318 * Finds description of report with given report_id and of given type in … … 333 333 } 334 334 335 usb_hid_report_description_t *report_des = NULL; 336 337 list_foreach(report->reports, report_it) { 338 report_des = list_get_instance(report_it, 339 usb_hid_report_description_t, reports_link); 340 335 list_foreach(report->reports, reports_link, 336 usb_hid_report_description_t, report_des) { 341 337 // if report id not set, return the first of the type 342 338 if(((report_des->report_id == report_id) || (report_id == 0)) && … … 348 344 return NULL; 349 345 } 350 /*---------------------------------------------------------------------------*/ 346 351 347 352 348 /** Parse HID report descriptor. … … 536 532 } 537 533 538 /*---------------------------------------------------------------------------*/ 534 539 535 540 536 /** … … 871 867 return EOK; 872 868 } 873 /*---------------------------------------------------------------------------*/ 869 874 870 875 871 /** … … 892 888 return result; 893 889 } 894 /*---------------------------------------------------------------------------*/ 890 895 891 896 892 /** … … 902 898 void usb_hid_descriptor_print_list(list_t *list) 903 899 { 904 usb_hid_report_field_t *report_item;905 906 900 if(list == NULL || list_empty(list)) { 907 901 usb_log_debug("\tempty\n"); … … 909 903 } 910 904 911 list_foreach(*list, item) { 912 report_item = list_get_instance(item, usb_hid_report_field_t, 913 ritems_link); 914 905 list_foreach(*list, ritems_link, usb_hid_report_field_t, 906 report_item) { 915 907 usb_log_debug("\t\tOFFSET: %X\n", report_item->offset); 916 908 usb_log_debug("\t\tSIZE: %zu\n", report_item->size); … … 937 929 938 930 usb_log_debug("\n"); 939 940 } 941 942 } 943 /*---------------------------------------------------------------------------*/ 931 } 932 } 933 944 934 945 935 /** … … 951 941 void usb_hid_descriptor_print(usb_hid_report_t *report) 952 942 { 953 if (report == NULL) {943 if (report == NULL) 954 944 return; 955 } 956 957 usb_hid_report_description_t *report_des; 958 959 list_foreach(report->reports, report_it) { 960 report_des = list_get_instance(report_it, 961 usb_hid_report_description_t, reports_link); 945 946 list_foreach(report->reports, reports_link, 947 usb_hid_report_description_t, report_des) { 962 948 usb_log_debug("Report ID: %d\n", report_des->report_id); 963 949 usb_log_debug("\tType: %d\n", report_des->type); … … 972 958 } 973 959 } 974 /*---------------------------------------------------------------------------*/ 960 975 961 976 962 … … 1022 1008 return; 1023 1009 } 1024 /*---------------------------------------------------------------------------*/ 1010 1025 1011 1026 1012 /**
Note:
See TracChangeset
for help on using the changeset viewer.