Changeset f123909 in mainline for uspace/drv/uhci-rhd/port.h


Ignore:
Timestamp:
2011-03-13T23:10:50Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3bd96bb
Parents:
a9f91cd
Message:

Doxygen fixes and refactoring.

UHCI root hub driver should be complete (except may be for the BUG)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-rhd/port.h

    ra9f91cd rf123909  
    11/*
    2  * Copyright (c) 2010 Jan Vesely
     2 * Copyright (c) 2011 Jan Vesely
    33 * All rights reserved.
    44 *
     
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup usb
     28/** @addtogroup drvusbuhcirh
    2929 * @{
    3030 */
    3131/** @file
    32  * @brief UHCI port driver
     32 * @brief UHCI root hub port routines
    3333 */
    3434#ifndef DRV_UHCI_PORT_H
    3535#define DRV_UHCI_PORT_H
    3636
    37 #include <assert.h>
    3837#include <stdint.h>
     38#include <fibril.h>
    3939#include <ddf/driver.h>
    40 #include <libarch/ddi.h> /* pio_read and pio_write */
    41 #include <usb/usbdevice.h>
     40#include <usb/usbdevice.h> /* usb_hc_connection_t */
    4241
    4342typedef uint16_t port_status_t;
    44 
    4543#define STATUS_CONNECTED         (1 << 0)
    4644#define STATUS_CONNECTED_CHANGED (1 << 1)
     
    7472void uhci_port_fini(uhci_port_t *port);
    7573
    76 static inline port_status_t uhci_port_read_status(uhci_port_t *port)
    77 {
    78         assert(port);
    79         return pio_read_16(port->address);
    80 }
    81 
    82 static inline void uhci_port_write_status(
    83     uhci_port_t *port, port_status_t value)
    84 {
    85         assert(port);
    86         pio_write_16(port->address, value);
    87 }
    88 
    89 static inline void uhci_port_print_status(
    90     uhci_port_t *port, const port_status_t value)
    91 {
    92         assert(port);
    93         usb_log_debug2("%s Port status(%#x):%s%s%s%s%s%s%s%s%s%s%s.\n",
    94             port->id_string, value,
    95             (value & STATUS_SUSPEND) ? " SUSPENDED," : "",
    96             (value & STATUS_RESUME) ? " IN RESUME," : "",
    97             (value & STATUS_IN_RESET) ? " IN RESET," : "",
    98             (value & STATUS_LINE_D_MINUS) ? " VD-," : "",
    99             (value & STATUS_LINE_D_PLUS) ? " VD+," : "",
    100             (value & STATUS_LOW_SPEED) ? " LOWSPEED," : "",
    101             (value & STATUS_ENABLED_CHANGED) ? " ENABLED-CHANGE," : "",
    102             (value & STATUS_ENABLED) ? " ENABLED," : "",
    103             (value & STATUS_CONNECTED_CHANGED) ? " CONNECTED-CHANGE," : "",
    104             (value & STATUS_CONNECTED) ? " CONNECTED," : "",
    105             (value & STATUS_ALWAYS_ONE) ? " ALWAYS ONE" : " ERROR: NO ALWAYS ONE"
    106         );
    107 }
    10874#endif
    10975/**
Note: See TracChangeset for help on using the changeset viewer.