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


Ignore:
Timestamp:
2011-09-16T14:50:20Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
432a269, d1e18573
Parents:
47fecbb (diff), 82a31261 (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 USB changes from bzr://krabicka.net/orome/helenos/usb/

  • Move common HC code from uhci/ohci drivers to libusbhost
  • Rewrite USB HC interface to have common read/write functions for all transfer types.
  • Restructure hc drivers to avoid some hooks and void* casts
  • Cleanup the code and remove unnecessary mallocs.
File:
1 edited

Legend:

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

    r47fecbb rfd07e526  
    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;
    7171        int rc = hw_res_get_resource_list(parent_sess, &hw_resources);
     
    7474                return rc;
    7575        }
    76        
     76
    7777        uintptr_t io_address = 0;
    7878        size_t io_size = 0;
     
    102102                }
    103103        }
    104        
     104
    105105        async_hangup(parent_sess);
    106        
     106
    107107        if (!io_found || !irq_found)
    108108                return ENOENT;
    109        
     109
    110110        *io_reg_address = io_address;
    111111        *io_reg_size = io_size;
    112112        *irq_no = irq;
    113        
     113
    114114        return EOK;
    115115}
    116 
     116/*----------------------------------------------------------------------------*/
    117117/** Call the PCI driver with a request to enable interrupts
    118118 *
     
    127127        if (!parent_sess)
    128128                return ENOMEM;
    129        
     129
    130130        const bool enabled = hw_res_enable_interrupt(parent_sess);
    131131        async_hangup(parent_sess);
    132        
     132
    133133        return enabled ? EOK : EIO;
    134134}
    135 
     135/*----------------------------------------------------------------------------*/
    136136/** Call the PCI driver with a request to clear legacy support register
    137137 *
     
    142142{
    143143        assert(device);
    144        
     144
    145145        async_sess_t *parent_sess =
    146146            devman_parent_device_connect(EXCHANGE_SERIALIZE, device->handle,
     
    148148        if (!parent_sess)
    149149                return ENOMEM;
    150        
     150
    151151        /* See UHCI design guide for these values p.45,
    152152         * write all WC bits in USB legacy register */
    153153        const sysarg_t address = 0xc0;
    154154        const sysarg_t value = 0xaf00;
    155        
     155
    156156        async_exch_t *exch = async_exchange_begin(parent_sess);
    157        
     157
    158158        const int rc = async_req_3_0(exch, DEV_IFACE_ID(PCI_DEV_IFACE),
    159159            IPC_M_CONFIG_SPACE_WRITE_16, address, value);
    160        
     160
    161161        async_exchange_end(exch);
    162162        async_hangup(parent_sess);
    163        
     163
    164164        return rc;
    165165}
Note: See TracChangeset for help on using the changeset viewer.