Changeset 4fa0a384 in mainline
- Timestamp:
- 2011-04-10T13:26:33Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 231748a
- Parents:
- 6ee6e6f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/devdrv.c
r6ee6e6f r4fa0a384 343 343 /** Retrieve basic descriptors from the device. 344 344 * 345 * @param[in] ctrl_pipe Control pipe with opened session.345 * @param[in] ctrl_pipe Control endpoint pipe. 346 346 * @param[out] descriptors Where to store the descriptors. 347 347 * @return Error code. … … 351 351 { 352 352 assert(descriptors != NULL); 353 assert(usb_pipe_is_session_started(ctrl_pipe));354 353 355 354 descriptors->configuration = NULL; 356 355 357 356 int rc; 357 358 /* It is worth to start a long transfer. */ 359 rc = usb_pipe_start_long_transfer(ctrl_pipe); 360 if (rc != EOK) { 361 return rc; 362 } 358 363 359 364 /* Get the device descriptor. */ 360 365 rc = usb_request_get_device_descriptor(ctrl_pipe, &descriptors->device); 361 366 if (rc != EOK) { 362 return rc;367 goto leave; 363 368 } 364 369 … … 367 372 ctrl_pipe, 0, (void **) &descriptors->configuration, 368 373 &descriptors->configuration_size); 369 if (rc != EOK) { 370 return rc; 371 }372 373 return EOK;374 375 leave: 376 usb_pipe_end_long_transfer(ctrl_pipe); 377 378 return rc; 374 379 } 375 380 … … 575 580 dev->interface_no = usb_device_get_assigned_interface(dev->ddf_dev); 576 581 577 /*578 * We will do some querying of the device, it is worth to prepare579 * the long transfer.580 */581 rc = usb_pipe_start_long_transfer(&dev->ctrl_pipe);582 if (rc != EOK) {583 *errmsg = "transfer start";584 return rc;585 }586 587 582 /* Retrieve the descriptors. */ 588 583 rc = usb_device_retrieve_descriptors(&dev->ctrl_pipe, … … 591 586 *errmsg = "descriptor retrieval"; 592 587 } 593 594 usb_pipe_end_long_transfer(&dev->ctrl_pipe);595 588 596 589 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.