Changeset 4687fcd4 in mainline for uspace/drv/uhci


Ignore:
Timestamp:
2011-01-29T10:19:04Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
72e19f50
Parents:
67a1b78 (diff), a09128c (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:

Changes from devel, break stuff.

Location:
uspace/drv/uhci
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/Makefile

    r67a1b78 r4687fcd4  
    4141        transfer_list.c \
    4242        uhci.c \
    43         uhci_struct/transfer_descriptor.c
     43        uhci_struct/transfer_descriptor.c \
     44        pci.c
    4445
    4546include $(USPACE_PREFIX)/Makefile.common
  • uspace/drv/uhci/main.c

    r67a1b78 r4687fcd4  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28#include <driver.h>
     29#include <errno.h>
     30#include <str_error.h>
    2831#include <usb_iface.h>
    29 #include <errno.h>
    3032
    3133#include "debug.h"
     
    5759        device->ops = &uhci_ops;
    5860
    59         // TODO: get this value out of pci driver
    60         return uhci_init(device, (void*)0xc020);
     61        uintptr_t io_reg_base;
     62        size_t io_reg_size;
     63        int irq;
     64
     65        int rc = pci_get_my_registers(device,
     66            &io_reg_base, &io_reg_size, &irq);
     67
     68        if (rc != EOK) {
     69                uhci_print_fatal("failed to get I/O registers addresses: %s.\n",
     70                    str_error(rc));
     71                return rc;
     72        }
     73
     74        uhci_print_info("I/O regs at 0x%X (size %zu), IRQ %d.\n",
     75            io_reg_base, io_reg_size, irq);
     76
     77        return uhci_init(device, (void*)io_reg_base, io_reg_size);
    6178}
    6279
  • uspace/drv/uhci/uhci.c

    r67a1b78 r4687fcd4  
    1313static int uhci_debug_checker(void *arg);
    1414
    15 int uhci_init(device_t *device, void *regs)
     15int uhci_init(device_t *device, void *regs, size_t reg_size)
    1616{
    1717        assert(device);
     
    4040        /* allow access to hc control registers */
    4141        regs_t *io;
    42         ret = pio_enable(regs, sizeof(regs_t), (void**)&io);
     42        assert(reg_size >= sizeof(regs_t));
     43        ret = pio_enable(regs, reg_size, (void**)&io);
    4344        CHECK_RET_FREE_INSTANCE("Failed to gain access to registers at %p.\n", io);
    4445        instance->registers = io;
  • uspace/drv/uhci/uhci.h

    r67a1b78 r4687fcd4  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
    28 /** @addtogroup usb
     28
     29/** @addtogroup drvusbuhci
    2930 * @{
    3031 */
     
    8687
    8788/* init uhci specifics in device.driver_data */
    88 int uhci_init( device_t *device, void *regs );
     89int uhci_init( device_t *device, void *regs, size_t reg_size );
    8990
    9091int uhci_destroy( device_t *device );
     
    101102  void *arg );
    102103
     104int pci_get_my_registers(device_t *, uintptr_t *, size_t *, int *);
     105
    103106#endif
    104107/**
Note: See TracChangeset for help on using the changeset viewer.