Changeset e1dbcbc in mainline for uspace/drv/uhci-rhd/port.c


Ignore:
Timestamp:
2011-04-29T13:43:01Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a81a1d09
Parents:
380e0364 (diff), f19f1b7 (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.
Message:

Merge development/ changes

File:
1 edited

Legend:

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

    r380e0364 re1dbcbc  
    6868 * @return Error code. (Always EOK)
    6969 */
    70 static inline void uhci_port_write_status(
    71     uhci_port_t *port, port_status_t value)
    72 {
    73         assert(port);
    74         pio_write_16(port->address, value);
     70static inline void uhci_port_write_status(uhci_port_t *port, port_status_t val)
     71{
     72        assert(port);
     73        pio_write_16(port->address, val);
    7574}
    7675/*----------------------------------------------------------------------------*/
     
    9089{
    9190        assert(port);
    92         asprintf(&port->id_string, "Port (%p - %d)", port, number);
     91        asprintf(&port->id_string, "Port (%p - %u)", port, number);
    9392        if (port->id_string == NULL) {
    9493                return ENOMEM;
     
    101100        port->rh = rh;
    102101
    103         int rc = usb_hc_connection_initialize_from_device(
    104             &port->hc_connection, rh);
    105         if (rc != EOK) {
     102        int ret =
     103            usb_hc_connection_initialize_from_device(&port->hc_connection, rh);
     104        if (ret != EOK) {
    106105                usb_log_error("Failed to initialize connection to HC.");
    107                 return rc;
     106                return ret;
    108107        }
    109108
     
    116115
    117116        fibril_add_ready(port->checker);
    118         usb_log_debug("%s: Started polling fibril(%x).\n",
     117        usb_log_debug("%s: Started polling fibril (%" PRIun ").\n",
    119118            port->id_string, port->checker);
    120119        return EOK;
     
    238237        /* Enable the port. */
    239238        uhci_port_set_enabled(port, true);
    240 
    241239        return EOK;
    242240}
     
    269267        }
    270268
    271         usb_log_info("New device at port %u, address %d (handle %llu).\n",
     269        usb_log_info("New device at port %u, address %d (handle %" PRIun ").\n",
    272270            port->number, dev_addr, port->attached_device);
    273 
    274271        return EOK;
    275272}
     
    286283int uhci_port_remove_device(uhci_port_t *port)
    287284{
    288         usb_log_error("%s: Don't know how to remove device %llu.\n",
     285        usb_log_error("%s: Don't know how to remove device %" PRIun ".\n",
    289286            port->id_string, port->attached_device);
    290287        return ENOTSUP;
     
    313310        /* Write new value. */
    314311        uhci_port_write_status(port, port_status);
     312
     313        /* Wait for port to become enabled */
     314        do {
     315                async_usleep(1000);
     316                port_status = uhci_port_read_status(port);
     317        } while ((port_status & STATUS_CONNECTED) &&
     318            !(port_status & STATUS_ENABLED));
    315319
    316320        usb_log_debug("%s: %sabled port.\n",
Note: See TracChangeset for help on using the changeset viewer.