Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-rhd/root_hub.c

    r275bf456 rdced52a  
    4040#include "root_hub.h"
    4141
    42 /** Initializes UHCI root hub instance.
    43  *
    44  * @param[in] instance Driver memory structure to use.
    45  * @param[in] addr Address of I/O registers.
    46  * @param[in] size Size of available I/O space.
    47  * @param[in] rh Pointer to ddf instance fo the root hub driver.
    48  * @return Error code.
    49  */
    5042int uhci_root_hub_init(
    5143  uhci_root_hub_t *instance, void *addr, size_t size, ddf_dev_t *rh)
     
    5547        int ret;
    5648
    57         /* Allow access to root hub port registers */
    58         assert(sizeof(port_status_t) * UHCI_ROOT_HUB_PORT_COUNT <= size);
     49        /* allow access to root hub registers */
     50        assert(sizeof(port_status_t) * UHCI_ROOT_HUB_PORT_COUNT == size);
    5951        port_status_t *regs;
    6052        ret = pio_enable(addr, size, (void**)&regs);
     53
    6154        if (ret < 0) {
    62                 usb_log_error(
    63                     "Failed to gain access to port registers at %p\n", regs);
     55                usb_log_error("Failed to gain access to port registers at %p\n", regs);
    6456                return ret;
    6557        }
     
    6860        unsigned i = 0;
    6961        for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) {
    70                 /* NOTE: mind pointer arithmetics here */
     62                /* mind pointer arithmetics */
    7163                ret = uhci_port_init(
    72                     &instance->ports[i], regs + i, i, ROOT_HUB_WAIT_USEC, rh);
     64                  &instance->ports[i], regs + i, i, ROOT_HUB_WAIT_USEC, rh);
    7365                if (ret != EOK) {
    7466                        unsigned j = 0;
     
    8274}
    8375/*----------------------------------------------------------------------------*/
    84 /** Finishes UHCI root hub instance.
    85  *
    86  * @param[in] instance Driver memory structure to use.
    87  * @return Error code.
    88  */
    89 int uhci_root_hub_fini(uhci_root_hub_t* instance)
     76int uhci_root_hub_fini( uhci_root_hub_t* instance )
    9077{
    91         assert(instance);
    92         unsigned i = 0;
    93         for (; i < UHCI_ROOT_HUB_PORT_COUNT; ++i) {
    94                 uhci_port_fini(&instance->ports[i]);
    95         }
     78        assert( instance );
     79        // TODO:
     80        //destroy fibril here
     81        //disable access to registers
    9682        return EOK;
    9783}
Note: See TracChangeset for help on using the changeset viewer.