Changeset e3a07bba in mainline for uspace/drv/bus/usb/uhci/uhci.c


Ignore:
Timestamp:
2013-12-31T22:31:21Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ba4a03a5
Parents:
1bb9833
Message:

uhci: move legacy disabling to main

File:
1 edited

Legend:

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

    r1bb9833 re3a07bba  
    3838#include <ddf/interrupt.h>
    3939#include <device/hw_res_parsed.h>
    40 #include <pci_dev_iface.h>
    4140#include <devman.h>
    4241#include <errno.h>
     
    7574}
    7675
    77 /** Call the PCI driver with a request to clear legacy support register
    78  *
    79  * @param[in] device Device asking to disable interrupts
    80  * @return Error code.
    81  */
    82 static int disable_legacy(ddf_dev_t *device)
    83 {
    84         assert(device);
    85 
    86         async_sess_t *parent_sess = devman_parent_device_connect(
    87             EXCHANGE_SERIALIZE, ddf_dev_get_handle(device), IPC_FLAG_BLOCKING);
    88         if (!parent_sess)
    89                 return ENOMEM;
    90 
    91         /* See UHCI design guide page 45 for these values.
    92          * Write all WC bits in USB legacy register */
    93         const int rc = pci_config_space_write_16(parent_sess, 0xc0, 0xaf00);
    94 
    95         async_hangup(parent_sess);
    96         return rc;
    97 }
    98 
    9976/** Initialize hc and rh DDF structures and their respective drivers.
    10077 *
     
    10380 * This function does all the preparatory work for hc and rh drivers:
    10481 *  - gets device's hw resources
    105  *  - disables UHCI legacy support (PCI config space)
    10682 *  - attempts to enable interrupts
    10783 *  - registers interrupt handler
     
    152128        }
    153129
    154         ret = disable_legacy(device);
    155         if (ret != EOK) {
    156                 usb_log_error("Failed to disable legacy USB: %s.\n",
    157                     str_error(ret));
    158                 goto irq_unregister;
    159         }
    160 
    161130        ret = hc_init(hc, &regs, interrupts);
    162131        if (ret != EOK) {
Note: See TracChangeset for help on using the changeset viewer.