Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 95a62dc in mainline


Ignore:
Timestamp:
2017-12-27T20:52:25Z (4 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
lfn, master
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)
Message:

xhci: add [some] docstrings in bus.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/bus.c

    r2e2af3a r95a62dc  
    5050
    5151
     52/** Initial descriptor used for control endpoint 0 before more configuration is retrieved. */
    5253static const usb_endpoint_desc_t ep0_initial_desc = {
    5354        .endpoint_no = 0,
     
    6061static endpoint_t *endpoint_create(device_t *, const usb_endpoint_desc_t *);
    6162
     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 */
    6269static int address_device(xhci_bus_t *bus, xhci_device_t *dev)
    6370{
     
    106113}
    107114
     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 */
    108121static int setup_ep0_packet_size(xhci_hc_t *hc, xhci_device_t *dev)
    109122{
     
    131144}
    132145
     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 */
    133153int xhci_bus_enumerate_device(xhci_bus_t *bus, device_t *dev)
    134154{
     
    182202static int endpoint_unregister(endpoint_t *);
    183203
     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 */
    184211int xhci_bus_remove_device(xhci_bus_t *bus, device_t *dev)
    185212{
     
    244271        return (xhci_bus_t *) bus_base;
    245272}
     273
     274// TODO: Fill in docstrings for XHCI bus callbacks once generic bus callbacks get their docstrings.
    246275
    247276static int device_enumerate(device_t *dev)
     
    479508}
    480509
     510/** Structure binding XHCI static callbacks to generic bus callbacks. */
    481511static 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.
    482513#define BIND_OP(op) .op = op,
    483514        BIND_OP(reserve_default_address)
     
    507538};
    508539
     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 */
    509546int xhci_bus_init(xhci_bus_t *bus, xhci_hc_t *hc)
    510547{
     
    523560}
    524561
     562/** Finalize XHCI bus.
     563 * @param[in] bus XHCI bus to finalize.
     564 */
    525565void xhci_bus_fini(xhci_bus_t *bus)
    526566{
    527 
     567        // FIXME: Deallocate bus->devices_by_slot?
     568        // FIXME: Should there be some bus_fini() to call?
     569        // FIXME: Something else we forgot?
    528570}
    529571
Note: See TracChangeset for help on using the changeset viewer.