Changeset e1dbcbc in mainline for uspace/lib/usb/src/hidreport.c
- Timestamp:
- 2011-04-29T13:43:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a81a1d09
- Parents:
- 380e0364 (diff), f19f1b7 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hidreport.c
r380e0364 re1dbcbc 109 109 110 110 if (*d != sizeof(usb_standard_hid_descriptor_t)) { 111 usb_log_error("HID descriptor has s wrong size (%u, expected %u"111 usb_log_error("HID descriptor has wrong size (%u, expected %zu" 112 112 ")\n", *d, sizeof(usb_standard_hid_descriptor_t)); 113 113 return EINVAL; … … 119 119 uint16_t length = hid_desc->report_desc_info.length; 120 120 size_t actual_size = 0; 121 122 /*123 * Start session for the control transfer.124 */125 int sess_rc = usb_pipe_start_session(&dev->ctrl_pipe);126 if (sess_rc != EOK) {127 usb_log_warning("Failed to start a session: %s.\n",128 str_error(sess_rc));129 return sess_rc;130 }131 121 132 122 /* … … 159 149 free(*report_desc); 160 150 *report_desc = NULL; 161 usb_log_error("Report descriptor has wrong size (% u, expected "151 usb_log_error("Report descriptor has wrong size (%zu, expected " 162 152 "%u)\n", actual_size, length); 163 153 return EINVAL; 164 154 } 165 155 166 /*167 * End session for the control transfer.168 */169 sess_rc = usb_pipe_end_session(&dev->ctrl_pipe);170 if (sess_rc != EOK) {171 usb_log_warning("Failed to end a session: %s.\n",172 str_error(sess_rc));173 free(*report_desc);174 *report_desc = NULL;175 return sess_rc;176 }177 178 156 *size = length; 179 157 … … 186 164 187 165 int usb_hid_process_report_descriptor(usb_device_t *dev, 188 usb_hid_report_ parser_t *parser)166 usb_hid_report_t *report) 189 167 { 190 if (dev == NULL || parser== NULL) {168 if (dev == NULL || report == NULL) { 191 169 usb_log_error("Failed to process Report descriptor: wrong " 192 170 "parameters given.\n"); … … 211 189 assert(report_desc != NULL); 212 190 213 rc = usb_hid_parse_report_descriptor( parser, report_desc, report_size);191 rc = usb_hid_parse_report_descriptor(report, report_desc, report_size); 214 192 if (rc != EOK) { 215 193 usb_log_error("Problem parsing Report descriptor: %s.\n", … … 219 197 } 220 198 221 usb_hid_descriptor_print( parser);199 usb_hid_descriptor_print(report); 222 200 free(report_desc); 223 201
Note:
See TracChangeset
for help on using the changeset viewer.