Changeset dd6f59f in mainline


Ignore:
Timestamp:
2011-03-12T12:44:59Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0f3e68c
Parents:
df949c5 (diff), 0db3ad6 (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:

Minor fixes in initialization routine and hc interrupt handling

Location:
uspace/drv
Files:
4 edited

Legend:

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

    rdf949c5 rdd6f59f  
    318318                ++packet;
    319319        }
     320        instance->tds[packet - 1].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG;
    320321        device_keeper_set_toggle(instance->manager, instance->target, toggle);
    321322}
  • uspace/drv/uhci-hcd/uhci.c

    rdf949c5 rdd6f59f  
    372372        assert(instance);
    373373        /* TODO: Check interrupt cause here */
    374         transfer_list_remove_finished(&instance->transfers_interrupt);
    375         transfer_list_remove_finished(&instance->transfers_control_slow);
    376         transfer_list_remove_finished(&instance->transfers_control_full);
    377         transfer_list_remove_finished(&instance->transfers_bulk_full);
     374        /* Lower 2 bits are transaction error and transaction complete */
     375        if (status & 0x3) {
     376                transfer_list_remove_finished(&instance->transfers_interrupt);
     377                transfer_list_remove_finished(&instance->transfers_control_slow);
     378                transfer_list_remove_finished(&instance->transfers_control_full);
     379                transfer_list_remove_finished(&instance->transfers_bulk_full);
     380        }
    378381}
    379382/*----------------------------------------------------------------------------*/
     
    390393
    391394        while (1) {
     395                /* read and ack interrupts */
    392396                uint16_t status = pio_read_16(&instance->registers->usbsts);
     397                pio_write_16(&instance->registers->usbsts, 0x1f);
    393398                if (status != 0)
    394399                        usb_log_debug2("UHCI status: %x.\n", status);
    395                 status |= 1;
    396400                uhci_interrupt(instance, status);
    397                 pio_write_16(&instance->registers->usbsts, 0x1f);
    398401                async_usleep(UHCI_CLEANER_TIMEOUT);
    399402        }
  • uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h

    rdf949c5 rdd6f59f  
    9191
    9292
    93 void td_init(td_t *instance, int error_count, size_t size, bool toggle, bool iso,
    94     bool low_speed, usb_target_t target, usb_packet_id pid, void *buffer,
    95     td_t *next);
     93void td_init(td_t *instance, int error_count, size_t size, bool toggle,
     94    bool iso, bool low_speed, usb_target_t target, usb_packet_id pid,
     95    void *buffer, td_t *next);
    9696
    9797int td_status(td_t *instance);
  • uspace/drv/uhci-rhd/port.c

    rdf949c5 rdd6f59f  
    181181        uhci_port_t *port = (uhci_port_t *) arg;
    182182
    183         usb_log_debug2("%s: new_device_enable_port.\n",
    184             port->id_string);
     183        usb_log_debug2("%s: new_device_enable_port.\n", port->id_string);
    185184
    186185        /*
     
    190189        async_usleep(100000);
    191190
    192 
    193         /* The hub maintains the reset signal to that port for 10 ms
    194          * (See Section 11.5.1.5)
     191        /*
     192         * Resets from root ports should be nominally 50ms
    195193         */
    196194        {
    197                 usb_log_debug("%s: Reset Signal start.\n",
    198                     port->id_string);
     195                usb_log_debug("%s: Reset Signal start.\n", port->id_string);
    199196                port_status_t port_status = uhci_port_read_status(port);
    200197                port_status |= STATUS_IN_RESET;
    201198                uhci_port_write_status(port, port_status);
    202                 async_usleep(10000);
     199                async_usleep(50000);
    203200                port_status = uhci_port_read_status(port);
    204201                port_status &= ~STATUS_IN_RESET;
    205202                uhci_port_write_status(port, port_status);
    206                 usb_log_debug("%s: Reset Signal stop.\n",
    207                     port->id_string);
    208         }
     203                usb_log_debug("%s: Reset Signal stop.\n", port->id_string);
     204        }
     205
     206        /* the reset recovery time 10ms */
     207        async_usleep(10000);
    209208
    210209        /* Enable the port. */
    211210        uhci_port_set_enabled(port, true);
     211
    212212        return EOK;
    213213}
     
    226226        assert(usb_hc_connection_is_opened(&port->hc_connection));
    227227
    228         usb_log_info("%s: Detected new device.\n",
    229             port->id_string);
     228        usb_log_info("%s: Detected new device.\n", port->id_string);
    230229
    231230        usb_address_t dev_addr;
Note: See TracChangeset for help on using the changeset viewer.