Changes in uspace/drv/ohci/hc.c [c6fe469:8790650] in mainline


Ignore:
File:
1 edited

Legend:

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

    rc6fe469 r8790650  
    135135        }
    136136
     137        transfer_list_add_batch(
     138            instance->transfers[batch->transfer_type], batch);
     139
    137140        switch (batch->transfer_type) {
    138141        case USB_TRANSFER_CONTROL:
    139142                instance->registers->control &= ~C_CLE;
    140                 transfer_list_add_batch(
    141                     instance->transfers[batch->transfer_type], batch);
    142143                instance->registers->command_status |= CS_CLF;
    143                 usb_log_debug2("Set CS control transfer filled: %x.\n",
     144                usb_log_debug2("Set control transfer filled: %x.\n",
    144145                        instance->registers->command_status);
    145                 instance->registers->control_current = 0;
    146146                instance->registers->control |= C_CLE;
    147147                break;
    148148        case USB_TRANSFER_BULK:
    149                 instance->registers->control &= ~C_BLE;
    150                 transfer_list_add_batch(
    151                     instance->transfers[batch->transfer_type], batch);
    152149                instance->registers->command_status |= CS_BLF;
    153150                usb_log_debug2("Set bulk transfer filled: %x.\n",
    154151                        instance->registers->command_status);
    155                 instance->registers->control |= C_BLE;
    156                 break;
    157         case USB_TRANSFER_INTERRUPT:
    158         case USB_TRANSFER_ISOCHRONOUS:
    159                 instance->registers->control &= ~C_PLE;
    160                 transfer_list_add_batch(
    161                     instance->transfers[batch->transfer_type], batch);
    162                 instance->registers->control |= C_PLE;
    163152                break;
    164153        default:
     
    176165                rh_interrupt(&instance->rh);
    177166
    178         usb_log_debug("OHCI interrupt: %x.\n", status);
    179 
    180 
    181         if (status & IS_WDH) {
    182                 LIST_INITIALIZE(done);
    183                 transfer_list_remove_finished(
    184                     &instance->transfers_interrupt, &done);
    185                 transfer_list_remove_finished(
    186                     &instance->transfers_isochronous, &done);
    187                 transfer_list_remove_finished(
    188                     &instance->transfers_control, &done);
    189                 transfer_list_remove_finished(
    190                     &instance->transfers_bulk, &done);
    191 
    192                 while (!list_empty(&done)) {
    193                         link_t *item = done.next;
    194                         list_remove(item);
    195                         usb_transfer_batch_t *batch =
    196                             list_get_instance(item, usb_transfer_batch_t, link);
    197                         usb_transfer_batch_finish(batch);
    198                 }
     167        usb_log_info("OHCI interrupt: %x.\n", status);
     168
     169
     170        LIST_INITIALIZE(done);
     171        transfer_list_remove_finished(&instance->transfers_interrupt, &done);
     172        transfer_list_remove_finished(&instance->transfers_isochronous, &done);
     173        transfer_list_remove_finished(&instance->transfers_control, &done);
     174        transfer_list_remove_finished(&instance->transfers_bulk, &done);
     175
     176        while (!list_empty(&done)) {
     177                link_t *item = done.next;
     178                list_remove(item);
     179                usb_transfer_batch_t *batch =
     180                    list_get_instance(item, usb_transfer_batch_t, link);
     181                usb_transfer_batch_finish(batch);
    199182        }
    200183}
     
    208191                instance->registers->interrupt_status = status;
    209192                hc_interrupt(instance, status);
    210                 async_usleep(10000);
     193                async_usleep(1000);
    211194        }
    212195        return EOK;
     
    284267            instance->registers->control);
    285268
    286         /* Use HCCA */
    287         instance->registers->hcca = addr_to_phys(instance->hcca);
    288 
    289         /* Use queues */
    290         instance->registers->bulk_head = instance->transfers_bulk.list_head_pa;
    291         usb_log_debug2("Bulk HEAD set to: %p(%p).\n",
    292             instance->transfers_bulk.list_head,
    293             instance->transfers_bulk.list_head_pa);
    294 
    295         instance->registers->control_head =
    296             instance->transfers_control.list_head_pa;
    297         usb_log_debug2("Control HEAD set to: %p(%p).\n",
    298             instance->transfers_control.list_head,
    299             instance->transfers_control.list_head_pa);
    300 
    301269        /* Enable queues */
    302270        instance->registers->control |= (C_PLE | C_IE | C_CLE | C_BLE);
     
    374342                return ENOMEM;
    375343        bzero(instance->hcca, sizeof(hcca_t));
    376         usb_log_debug2("OHCI HCCA initialized at %p.\n", instance->hcca);
     344        instance->registers->hcca = addr_to_phys(instance->hcca);
     345        usb_log_debug2("OHCI HCCA initialized at %p(%p).\n",
     346            instance->hcca, instance->registers->hcca);
     347
     348        /* Use queues */
     349        instance->registers->bulk_head = instance->transfers_bulk.list_head_pa;
     350        usb_log_debug2("Bulk HEAD set to: %p(%p).\n",
     351            instance->transfers_bulk.list_head,
     352            instance->transfers_bulk.list_head_pa);
     353
     354        instance->registers->control_head =
     355            instance->transfers_control.list_head_pa;
     356        usb_log_debug2("Control HEAD set to: %p(%p).\n",
     357            instance->transfers_control.list_head,
     358            instance->transfers_control.list_head_pa);
    377359
    378360        unsigned i = 0;
Note: See TracChangeset for help on using the changeset viewer.