Changeset eb292a0 in mainline


Ignore:
Timestamp:
2011-02-26T02:08:50Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0063838
Parents:
86c2ccd
Message:

Reset whole hc during initialization

Increase debug level of hw interrupt messages
use better error values for transfer_descriptor

Location:
uspace/drv/uhci-hcd
Files:
2 edited

Legend:

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

    r86c2ccd reb292a0  
    153153void uhci_init_hw(uhci_t *instance)
    154154{
    155         /* reset hc, who knows what touched it before us */
     155        /* reset everything, who knows what touched it before us */
    156156        pio_write_16(&instance->registers->usbcmd, UHCI_CMD_GLOBAL_RESET);
    157157        async_usleep(10000); /* 10ms according to USB spec */
    158158        pio_write_16(&instance->registers->usbcmd, 0);
     159
     160        /* reset hc, all states and counters */
     161        pio_write_16(&instance->registers->usbcmd, UHCI_CMD_HCRESET);
     162        while ((pio_read_16(&instance->registers->usbcmd) & UHCI_CMD_HCRESET) != 0)
     163                { async_usleep(10); }
    159164
    160165        /* set framelist pointer */
     
    284289        if ((status & (UHCI_STATUS_INTERRUPT | UHCI_STATUS_ERROR_INTERRUPT)) == 0)
    285290                return;
    286         usb_log_debug("UHCI interrupt: %X.\n", status);
     291        usb_log_debug2("UHCI interrupt: %X.\n", status);
    287292        transfer_list_remove_finished(&instance->transfers_interrupt);
    288293        transfer_list_remove_finished(&instance->transfers_control_slow);
     
    299304        while (1) {
    300305                uint16_t status = pio_read_16(&instance->registers->usbsts);
    301                 usb_log_debug("UHCI status: %x.\n", status);
     306                usb_log_debug2("UHCI status: %x.\n", status);
    302307                status |= 1;
    303308                uhci_interrupt(instance, status);
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c

    r86c2ccd reb292a0  
    7777
    7878        if ((instance->status & TD_STATUS_ERROR_STALLED) != 0)
    79                 return EIO;
     79                return ESTALL;
    8080
    8181        if ((instance->status & TD_STATUS_ERROR_CRC) != 0)
    82                 return EAGAIN;
     82                return EBADCHECKSUM;
    8383
    8484        if ((instance->status & TD_STATUS_ERROR_BUFFER) != 0)
Note: See TracChangeset for help on using the changeset viewer.