Changeset d1984e0 in mainline for uspace/drv/uhci/uhci.c


Ignore:
Timestamp:
2011-01-28T15:47:39Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
54229db
Parents:
a8e96683
Message:

Added UHCI command register values

HC is started on initialization.

File:
1 edited

Legend:

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

    ra8e96683 rd1984e0  
    5555
    5656        uhci_print_verbose("Initializing frame list.\n");
    57         instance->frame_list =
    58           memallign32(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT, 4096);
     57        instance->frame_list = get_page();
     58//        memalign32(sizeof(link_pointer_t) * UHCI_FRAME_LIST_COUNT, 4096);
    5959        if (instance->frame_list == NULL) {
    6060                uhci_print_error("Failed to allocate frame list pointer.\n");
     
    7979        instance->cleaner = fibril_create(uhci_clean_finished, instance);
    8080        fibril_add_ready(instance->cleaner);
     81
     82        uhci_print_verbose("Starting UHCI HC.\n");
     83        uint16_t cmd = pio_read_16(&instance->registers->usbcmd);
     84        cmd |= UHCI_CMD_RUN_STOP | UHCI_CMD_CONFIGURE;
     85        pio_write_16(&instance->registers->usbcmd, cmd);
    8186
    8287        device->driver_data = instance;
     
    177182
    178183        while(1) {
    179                 uhci_print_verbose("Running cleaning fibril on %p.\n", instance);
     184                uhci_print_verbose("Running cleaning fibril on: %p.\n", instance);
    180185                /* iterate all transfer queues */
    181                 usb_transfer_type_t i = USB_TRANSFER_BULK;
    182                 for (; i > USB_TRANSFER_ISOCHRONOUS; --i) {
     186                int i = 1;
     187                for (; i < TRANSFER_QUEUES; ++i) {
    183188                        /* Remove inactive transfers from the top of the queue
    184189                         * TODO: should I reach queue head or is this enough? */
     190                        uhci_print_verbose("Running cleaning fibril on queue: %p.\n",
     191                                &instance->transfers[i]);
    185192                        while (instance->transfers[i].first &&
    186193                         !(instance->transfers[i].first->status & TD_STATUS_ERROR_ACTIVE)) {
Note: See TracChangeset for help on using the changeset viewer.