Changeset 6991188 in mainline for uspace/drv/ohci/hc.c


Ignore:
Timestamp:
2011-04-11T13:40:00Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d91645ab
Parents:
1a46610 (diff), 9f104af4 (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:

OHCI prototype works (INT transfers too)

Tested on vbox 4.0.4, MS mouse and Logitech keyboard work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/hc.c

    r1a46610 r6991188  
    113113            ret, str_error(ret));
    114114        hc_init_hw(instance);
     115        fibril_mutex_initialize(&instance->guard);
    115116
    116117        rh_init(&instance->rh, dev, instance->registers);
     
    135136        }
    136137
     138        fibril_mutex_lock(&instance->guard);
    137139        switch (batch->transfer_type) {
    138140        case USB_TRANSFER_CONTROL:
     
    157159        case USB_TRANSFER_INTERRUPT:
    158160        case USB_TRANSFER_ISOCHRONOUS:
    159                 instance->registers->control &= ~C_PLE;
     161                instance->registers->control &= (~C_PLE & ~C_IE);
    160162                transfer_list_add_batch(
    161163                    instance->transfers[batch->transfer_type], batch);
    162                 instance->registers->control |= C_PLE;
     164                instance->registers->control |= C_PLE | C_IE;
     165                usb_log_debug2("Added periodic transfer: %x.\n",
     166                    instance->registers->periodic_current);
    163167                break;
    164168        default:
    165169                break;
    166170        }
     171        fibril_mutex_unlock(&instance->guard);
    167172        return EOK;
    168173}
     
    178183        usb_log_debug("OHCI interrupt: %x.\n", status);
    179184
    180 
    181185        if (status & IS_WDH) {
     186                fibril_mutex_lock(&instance->guard);
     187                usb_log_debug2("HCCA: %p-%p(%p).\n", instance->hcca,
     188                    instance->registers->hcca, addr_to_phys(instance->hcca));
     189                usb_log_debug2("Periodic current: %p.\n",
     190                    instance->registers->periodic_current);
    182191                LIST_INITIALIZE(done);
    183192                transfer_list_remove_finished(
     
    197206                        usb_transfer_batch_finish(batch);
    198207                }
     208                fibril_mutex_unlock(&instance->guard);
    199209        }
    200210}
     
    208218                instance->registers->interrupt_status = status;
    209219                hc_interrupt(instance, status);
    210                 async_usleep(10000);
     220                async_usleep(50000);
    211221        }
    212222        return EOK;
     
    345355        SETUP_TRANSFER_LIST(transfers_control, "CONTROL");
    346356        SETUP_TRANSFER_LIST(transfers_bulk, "BULK");
    347 
     357#undef SETUP_TRANSFER_LIST
    348358        transfer_list_set_next(&instance->transfers_interrupt,
    349359            &instance->transfers_isochronous);
     
    360370
    361371        return EOK;
    362 #undef CHECK_RET_CLEAR_RETURN
    363372}
    364373/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.