Changeset 95a62dc in mainline
- Timestamp:
- 2017-12-27T20:52:25Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 67d58e8
- Parents:
- 2e2af3a
- git-author:
- Petr Manek <petr.manek@…> (2017-12-27 20:46:36)
- git-committer:
- Petr Manek <petr.manek@…> (2017-12-27 20:52:25)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/bus.c
r2e2af3a r95a62dc 50 50 51 51 52 /** Initial descriptor used for control endpoint 0 before more configuration is retrieved. */ 52 53 static const usb_endpoint_desc_t ep0_initial_desc = { 53 54 .endpoint_no = 0, … … 60 61 static endpoint_t *endpoint_create(device_t *, const usb_endpoint_desc_t *); 61 62 63 /** Assign address and control endpoint to a new XHCI device. 64 * @param[in] bus XHCI bus, in which the address is assigned. 65 * @param[in] dev New device to address and configure. 66 * 67 * @return Error code. 68 */ 62 69 static int address_device(xhci_bus_t *bus, xhci_device_t *dev) 63 70 { … … 106 113 } 107 114 115 /** Retrieve and set maximum packet size for endpoint zero of a XHCI device. 116 * @param[in] hc Host controller, which manages the device. 117 * @param[in] dev Device with operational endpoint zero. 118 * 119 * @return Error code. 120 */ 108 121 static int setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev) 109 122 { … … 131 144 } 132 145 146 /** Respond to a new device on the XHCI bus. Address it, negotiate packet size 147 * and retrieve USB descriptors. 148 * @param[in] bus XHCI bus, where the new device emerged. 149 * @param[in] dev XHCI device, which has appeared on the bus. 150 * 151 * @return Error code. 152 */ 133 153 int xhci_bus_enumerate_device(xhci_bus_t *bus, device_t *dev) 134 154 { … … 182 202 static int endpoint_unregister(endpoint_t *); 183 203 204 /** Remove device from XHCI bus. Transition it to the offline state, abort all 205 * ongoing transfers and unregister all of its endpoints. 206 * @param[in] bus XHCI bus, from which the device is removed. 207 * @param[in] dev XHCI device, which is removed from the bus. 208 * 209 * @return Error code. 210 */ 184 211 int xhci_bus_remove_device(xhci_bus_t *bus, device_t *dev) 185 212 { … … 244 271 return (xhci_bus_t *) bus_base; 245 272 } 273 274 // TODO: Fill in docstrings for XHCI bus callbacks once generic bus callbacks get their docstrings. 246 275 247 276 static int device_enumerate(device_t *dev) … … 479 508 } 480 509 510 /** Structure binding XHCI static callbacks to generic bus callbacks. */ 481 511 static const bus_ops_t xhci_bus_ops = { 512 // TODO: Is it good idea to use this macro? It blurrs the fact that the callbacks and static functions are called the same. 482 513 #define BIND_OP(op) .op = op, 483 514 BIND_OP(reserve_default_address) … … 507 538 }; 508 539 540 /** Initialize XHCI bus. 541 * @param[in] bus Allocated XHCI bus to initialize. 542 * @param[in] hc Associated host controller, which manages the bus. 543 * 544 * @return Error code. 545 */ 509 546 int xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc) 510 547 { … … 523 560 } 524 561 562 /** Finalize XHCI bus. 563 * @param[in] bus XHCI bus to finalize. 564 */ 525 565 void xhci_bus_fini(xhci_bus_t *bus) 526 566 { 527 567 // FIXME: Deallocate bus->devices_by_slot? 568 // FIXME: Should there be some bus_fini() to call? 569 // FIXME: Something else we forgot? 528 570 } 529 571
Note:
See TracChangeset
for help on using the changeset viewer.