Changeset ff76509 in mainline
- Timestamp:
- 2011-04-15T13:38:28Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- be11749
- Parents:
- 9063484 (diff), 8fd4ba0 (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. - Files:
-
- 8 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
.bzrignore
r9063484 rff76509 94 94 ./uspace/drv/usbhid/usbhid 95 95 ./uspace/drv/usbkbd/usbkbd 96 ./uspace/drv/usbmast/usbmast 96 97 ./uspace/drv/usbmid/usbmid 97 98 ./uspace/drv/usbmouse/usbmouse -
boot/arch/amd64/Makefile.inc
r9063484 rff76509 51 51 usbkbd \ 52 52 usbhid \ 53 usbmast \ 53 54 usbmid \ 54 55 usbmouse \ -
uspace/Makefile
r9063484 rff76509 125 125 drv/usbhid \ 126 126 drv/usbhub \ 127 drv/usbmast \ 127 128 drv/usbmid \ 128 129 drv/usbmouse \ … … 146 147 drv/usbhid \ 147 148 drv/usbhub \ 149 drv/usbmast \ 148 150 drv/usbmid \ 149 151 drv/usbmouse \ -
uspace/doc/doxygroups.h
r9063484 rff76509 251 251 252 252 /** 253 * @defgroup drvusbmast USB mass storage driver 254 * @ingroup usb 255 * @brief USB driver for mass storage devices (bulk-only protocol). 256 * This driver is a only a stub and is currently used only for 257 * testing that bulk transfers work. 258 */ 259 260 /** 253 261 * @defgroup drvusbuhci UHCI driver 254 262 * @ingroup usb -
uspace/drv/usbhid/usbhid.c
r9063484 rff76509 360 360 rc = usb_hid_check_pipes(hid_dev, dev); 361 361 if (rc != EOK) { 362 usb_hid_free(&hid_dev);362 //usb_hid_free(&hid_dev); 363 363 return rc; 364 364 } … … 368 368 if (rc != EOK) { 369 369 usb_log_error("Failed to initialize report parser.\n"); 370 usb_hid_free(&hid_dev);370 //usb_hid_free(&hid_dev); 371 371 return rc; 372 372 } … … 386 386 " device.\n"); 387 387 fallback = true; 388 assert(hid_dev->subdrivers == NULL); 389 assert(hid_dev->subdriver_count == 0); 388 390 } 389 391 } else { … … 426 428 usb_log_error("No subdriver for handling this device could be" 427 429 " initialized: %s.\n", str_error(rc)); 428 usb_hid_free(&hid_dev); 430 usb_log_debug("Subdriver count: %d\n", 431 hid_dev->subdriver_count); 432 //usb_hid_free(&hid_dev); 429 433 } else { 430 434 bool ok = false; … … 550 554 } 551 555 556 usb_log_debug("Subdrivers: %p, subdriver count: %d\n", 557 (*hid_dev)->subdrivers, (*hid_dev)->subdriver_count); 558 552 559 assert((*hid_dev)->subdrivers != NULL 553 560 || (*hid_dev)->subdriver_count == 0); -
uspace/lib/usb/src/hidreport.c
r9063484 rff76509 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 /* … … 162 152 "%u)\n", actual_size, length); 163 153 return EINVAL; 164 }165 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 154 } 177 155 -
uspace/lib/usb/src/hidreq.c
r9063484 rff76509 56 56 * @retval EOK if successful. 57 57 * @retval EINVAL if no HID device is given. 58 * @return Other value inherited from one of functions 59 * usb_pipe_start_session(), usb_pipe_end_session(), 60 * usb_control_request_set(). 58 * @return Other value inherited from function usb_control_request_set(). 61 59 */ 62 60 int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no, … … 79 77 */ 80 78 81 int rc, sess_rc; 82 83 sess_rc = usb_pipe_start_session(ctrl_pipe); 84 if (sess_rc != EOK) { 85 usb_log_warning("Failed to start a session: %s.\n", 86 str_error(sess_rc)); 87 return sess_rc; 88 } 79 int rc; 89 80 90 81 uint16_t value = 0; … … 97 88 USB_HIDREQ_SET_REPORT, value, iface_no, buffer, buf_size); 98 89 99 sess_rc = usb_pipe_end_session(ctrl_pipe); 100 101 if (rc != EOK) { 102 usb_log_warning("Error sending output report to the keyboard: " 103 "%s.\n", str_error(rc)); 104 return rc; 105 } 106 107 if (sess_rc != EOK) { 108 usb_log_warning("Error closing session: %s.\n", 109 str_error(sess_rc)); 110 return sess_rc; 90 if (rc != EOK) { 91 usb_log_warning("Error sending output report to the keyboard: " 92 "%s.\n", str_error(rc)); 93 return rc; 111 94 } 112 95 … … 123 106 * @retval EOK if successful. 124 107 * @retval EINVAL if no HID device is given. 125 * @return Other value inherited from one of functions 126 * usb_pipe_start_session(), usb_pipe_end_session(), 127 * usb_control_request_set(). 108 * @return Other value inherited from function usb_control_request_set(). 128 109 */ 129 110 int usbhid_req_set_protocol(usb_pipe_t *ctrl_pipe, int iface_no, … … 146 127 */ 147 128 148 int rc, sess_rc; 149 150 sess_rc = usb_pipe_start_session(ctrl_pipe); 151 if (sess_rc != EOK) { 152 usb_log_warning("Failed to start a session: %s.\n", 153 str_error(sess_rc)); 154 return sess_rc; 155 } 129 int rc; 156 130 157 131 usb_log_debug("Sending Set_Protocol request to the device (" … … 162 136 USB_HIDREQ_SET_PROTOCOL, protocol, iface_no, NULL, 0); 163 137 164 sess_rc = usb_pipe_end_session(ctrl_pipe); 165 166 if (rc != EOK) { 167 usb_log_warning("Error sending output report to the keyboard: " 168 "%s.\n", str_error(rc)); 169 return rc; 170 } 171 172 if (sess_rc != EOK) { 173 usb_log_warning("Error closing session: %s.\n", 174 str_error(sess_rc)); 175 return sess_rc; 138 if (rc != EOK) { 139 usb_log_warning("Error sending output report to the keyboard: " 140 "%s.\n", str_error(rc)); 141 return rc; 176 142 } 177 143 … … 189 155 * @retval EOK if successful. 190 156 * @retval EINVAL if no HID device is given. 191 * @return Other value inherited from one of functions 192 * usb_pipe_start_session(), usb_pipe_end_session(), 193 * usb_control_request_set(). 157 * @return Other value inherited from function usb_control_request_set(). 194 158 */ 195 159 int usbhid_req_set_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t duration) … … 211 175 */ 212 176 213 int rc, sess_rc; 214 215 sess_rc = usb_pipe_start_session(ctrl_pipe); 216 if (sess_rc != EOK) { 217 usb_log_warning("Failed to start a session: %s.\n", 218 str_error(sess_rc)); 219 return sess_rc; 220 } 177 int rc; 221 178 222 179 usb_log_debug("Sending Set_Idle request to the device (" … … 229 186 USB_HIDREQ_SET_IDLE, value, iface_no, NULL, 0); 230 187 231 sess_rc = usb_pipe_end_session(ctrl_pipe); 232 233 if (rc != EOK) { 234 usb_log_warning("Error sending output report to the keyboard: " 235 "%s.\n", str_error(rc)); 236 return rc; 237 } 238 239 if (sess_rc != EOK) { 240 usb_log_warning("Error closing session: %s.\n", 241 str_error(sess_rc)); 242 return sess_rc; 188 if (rc != EOK) { 189 usb_log_warning("Error sending output report to the keyboard: " 190 "%s.\n", str_error(rc)); 191 return rc; 243 192 } 244 193 … … 259 208 * @retval EOK if successful. 260 209 * @retval EINVAL if no HID device is given. 261 * @return Other value inherited from one of functions 262 * usb_pipe_start_session(), usb_pipe_end_session(), 263 * usb_control_request_set(). 210 * @return Other value inherited from function usb_control_request_set(). 264 211 */ 265 212 int usbhid_req_get_report(usb_pipe_t *ctrl_pipe, int iface_no, … … 283 230 */ 284 231 285 int rc, sess_rc; 286 287 sess_rc = usb_pipe_start_session(ctrl_pipe); 288 if (sess_rc != EOK) { 289 usb_log_warning("Failed to start a session: %s.\n", 290 str_error(sess_rc)); 291 return sess_rc; 292 } 232 int rc; 293 233 294 234 uint16_t value = 0; … … 302 242 actual_size); 303 243 304 sess_rc = usb_pipe_end_session(ctrl_pipe); 305 306 if (rc != EOK) { 307 usb_log_warning("Error sending output report to the keyboard: " 308 "%s.\n", str_error(rc)); 309 return rc; 310 } 311 312 if (sess_rc != EOK) { 313 usb_log_warning("Error closing session: %s.\n", 314 str_error(sess_rc)); 315 return sess_rc; 244 if (rc != EOK) { 245 usb_log_warning("Error sending output report to the keyboard: " 246 "%s.\n", str_error(rc)); 247 return rc; 316 248 } 317 249 … … 328 260 * @retval EOK if successful. 329 261 * @retval EINVAL if no HID device is given. 330 * @return Other value inherited from one of functions 331 * usb_pipe_start_session(), usb_pipe_end_session(), 332 * usb_control_request_set(). 262 * @return Other value inherited from function usb_control_request_set(). 333 263 */ 334 264 int usbhid_req_get_protocol(usb_pipe_t *ctrl_pipe, int iface_no, … … 351 281 */ 352 282 353 int rc, sess_rc; 354 355 sess_rc = usb_pipe_start_session(ctrl_pipe); 356 if (sess_rc != EOK) { 357 usb_log_warning("Failed to start a session: %s.\n", 358 str_error(sess_rc)); 359 return sess_rc; 360 } 283 int rc; 361 284 362 285 usb_log_debug("Sending Get_Protocol request to the device (" … … 370 293 USB_HIDREQ_GET_PROTOCOL, 0, iface_no, buffer, 1, &actual_size); 371 294 372 sess_rc = usb_pipe_end_session(ctrl_pipe); 373 374 if (rc != EOK) { 375 usb_log_warning("Error sending output report to the keyboard: " 376 "%s.\n", str_error(rc)); 377 return rc; 378 } 379 380 if (sess_rc != EOK) { 381 usb_log_warning("Error closing session: %s.\n", 382 str_error(sess_rc)); 383 return sess_rc; 295 if (rc != EOK) { 296 usb_log_warning("Error sending output report to the keyboard: " 297 "%s.\n", str_error(rc)); 298 return rc; 384 299 } 385 300 … … 427 342 */ 428 343 429 int rc, sess_rc; 430 431 sess_rc = usb_pipe_start_session(ctrl_pipe); 432 if (sess_rc != EOK) { 433 usb_log_warning("Failed to start a session: %s.\n", 434 str_error(sess_rc)); 435 return sess_rc; 436 } 344 int rc; 437 345 438 346 usb_log_debug("Sending Get_Idle request to the device (" … … 448 356 &actual_size); 449 357 450 sess_rc = usb_pipe_end_session(ctrl_pipe); 451 452 if (rc != EOK) { 453 usb_log_warning("Error sending output report to the keyboard: " 454 "%s.\n", str_error(rc)); 455 return rc; 456 } 457 458 if (sess_rc != EOK) { 459 usb_log_warning("Error closing session: %s.\n", 460 str_error(sess_rc)); 461 return sess_rc; 358 if (rc != EOK) { 359 usb_log_warning("Error sending output report to the keyboard: " 360 "%s.\n", str_error(rc)); 361 return rc; 462 362 } 463 363
Note:
See TracChangeset
for help on using the changeset viewer.