Changeset f126c87 in mainline for uspace/lib/usbdev/src/devdrv.c
- Timestamp:
- 2016-09-01T16:46:27Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2a2fbc8
- Parents:
- 9befb0d (diff), bdfdc51c (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/usbdev/src/devdrv.c
r9befb0d rf126c87 27 27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 28 */ 29 29 30 /** @addtogroup libusbdev 30 31 * @{ … … 55 56 /** Connection to device on USB bus */ 56 57 usb_dev_session_t *bus_session; 58 57 59 /** devman handle */ 58 60 devman_handle_t handle; 61 59 62 /** The default control pipe. */ 60 63 usb_pipe_t ctrl_pipe; 61 64 62 65 /** Other endpoint pipes. 66 * 63 67 * This is an array of other endpoint pipes in the same order as 64 68 * in usb_driver_t. 65 69 */ 66 70 usb_endpoint_mapping_t *pipes; 71 67 72 /** Number of other endpoint pipes. */ 68 73 size_t pipes_count; 74 69 75 /** Current interface. 76 * 70 77 * Usually, drivers operate on single interface only. 71 78 * This item contains the value of the interface or -1 for any. 72 79 */ 73 80 int interface_no; 81 74 82 /** Alternative interfaces. */ 75 83 usb_alternate_interfaces_t alternate_interfaces; 84 76 85 /** Some useful descriptors for USB device. */ 77 86 usb_device_descriptors_t descriptors; 87 78 88 /** Generic DDF device backing this one. DO NOT TOUCH! */ 79 89 ddf_dev_t *ddf_dev; 90 80 91 /** Custom driver data. 92 * 81 93 * Do not use the entry in generic device, that is already used 82 94 * by the framework. 83 95 */ 84 96 void *driver_data; 85 86 97 } usb_device_t; 87 98 … … 135 146 return rc; 136 147 } 137 148 138 149 /* Change current alternative */ 139 150 usb_dev->alternate_interfaces.current = alternate_setting; … … 279 290 * 280 291 * @param[in] usb_dev USB device. 292 * 281 293 */ 282 294 void usb_device_destroy_pipes(usb_device_t *usb_dev) … … 284 296 assert(usb_dev); 285 297 assert(usb_dev->pipes || usb_dev->pipes_count == 0); 298 286 299 /* Destroy the pipes. */ 287 300 for (size_t i = 0; i < usb_dev->pipes_count; ++i) { … … 291 304 usb_pipe_unregister(&usb_dev->pipes[i].pipe); 292 305 } 306 293 307 free(usb_dev->pipes); 294 308 usb_dev->pipes = NULL; … … 448 462 assert(handle); 449 463 assert(iface_no); 464 450 465 async_exch_t *exch = async_exchange_begin(sess); 451 466 if (!exch) 452 467 return EPARTY; 468 453 469 int ret = usb_get_my_device_handle(exch, handle); 454 470 if (ret == EOK) { … … 459 475 } 460 476 } 477 461 478 async_exchange_end(exch); 462 479 return ret;
Note:
See TracChangeset
for help on using the changeset viewer.