Ignore:
File:
1 edited

Legend:

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

    r45a9cf4 r5203e256  
    6161        assert(io_reg_size);
    6262        assert(irq_no);
    63 
     63       
    6464        async_sess_t *parent_sess =
    6565            devman_parent_device_connect(EXCHANGE_SERIALIZE, dev->handle,
     
    6767        if (!parent_sess)
    6868                return ENOMEM;
    69 
     69       
    7070        hw_resource_list_t hw_resources;
    71         const int rc = hw_res_get_resource_list(parent_sess, &hw_resources);
    72         async_hangup(parent_sess);
     71        int rc = hw_res_get_resource_list(parent_sess, &hw_resources);
    7372        if (rc != EOK) {
     73                async_hangup(parent_sess);
    7474                return rc;
    7575        }
    76 
     76       
    7777        uintptr_t io_address = 0;
    7878        size_t io_size = 0;
    7979        bool io_found = false;
    80 
     80       
    8181        int irq = 0;
    8282        bool irq_found = false;
    83 
     83       
    8484        size_t i;
    8585        for (i = 0; i < hw_resources.count; i++) {
     
    102102                }
    103103        }
    104         free(hw_resources.resources);
    105 
     104       
     105        async_hangup(parent_sess);
     106       
    106107        if (!io_found || !irq_found)
    107108                return ENOENT;
    108 
     109       
    109110        *io_reg_address = io_address;
    110111        *io_reg_size = io_size;
    111112        *irq_no = irq;
    112 
     113       
    113114        return EOK;
    114115}
    115 /*----------------------------------------------------------------------------*/
     116
    116117/** Call the PCI driver with a request to enable interrupts
    117118 *
     
    126127        if (!parent_sess)
    127128                return ENOMEM;
    128 
     129       
    129130        const bool enabled = hw_res_enable_interrupt(parent_sess);
    130131        async_hangup(parent_sess);
    131 
     132       
    132133        return enabled ? EOK : EIO;
    133134}
    134 /*----------------------------------------------------------------------------*/
     135
    135136/** Call the PCI driver with a request to clear legacy support register
    136137 *
     
    141142{
    142143        assert(device);
    143 
     144       
    144145        async_sess_t *parent_sess =
    145146            devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
     
    147148        if (!parent_sess)
    148149                return ENOMEM;
    149 
     150       
    150151        /* See UHCI design guide for these values p.45,
    151152         * write all WC bits in USB legacy register */
    152153        const sysarg_t address = 0xc0;
    153154        const sysarg_t value = 0xaf00;
    154 
     155       
    155156        async_exch_t *exch = async_exchange_begin(parent_sess);
    156 
     157       
    157158        const int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
    158159            IPC_M_CONFIG_SPACE_WRITE_16, address, value);
    159 
     160       
    160161        async_exchange_end(exch);
    161162        async_hangup(parent_sess);
    162 
     163       
    163164        return rc;
    164165}
Note: See TracChangeset for help on using the changeset viewer.