Changeset 579dec2 in mainline


Ignore:
Timestamp:
2011-01-28T11:52:48Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
dcc5b9d
Parents:
c13ecfe
Message:

Implemented cleanup fibril cycle

File:
1 edited

Legend:

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

    rc13ecfe r579dec2  
    217217        CHECK_RET_TRANS_FREE_JOB_TD("Failed to allocate transfer descriptor.\n");
    218218
    219         ret = transfer_descriptor_init(td, 3, size, false, target, pid);
    220         CHECK_RET_TRANS_FREE_JOB_TD("Failed to initialize transfer descriptor.\n");
     219        transfer_descriptor_init(td, 3, size, false, target, pid);
     220//      CHECK_RET_TRANS_FREE_JOB_TD("Failed to initialize transfer descriptor.\n");
    221221
    222222        td->callback = job;
     
    237237        uhci_t *instance = (uhci_t*)arg;
    238238        assert(instance);
     239
    239240        while(1) {
    240241                uhci_print_verbose("Running cleaning fibril on %p.\n", instance);
     242                /* iterate all transfer queues */
     243                usb_transfer_type_t i = USB_TRANSFER_BULK;
     244                for (; i > USB_TRANSFER_ISOCHRONOUS; --i) {
     245                        /* Remove inactive transfers from the top of the queue
     246                         * TODO: should I reach queue head or is this enough? */
     247                        while (instance->transfers[i].first &&
     248                         !(instance->transfers[i].first->status & TD_STATUS_ERROR_ACTIVE)) {
     249                                transfer_descriptor_t *transfer = instance->transfers[i].first;
     250                                uhci_print_verbose("Cleaning fibril found inactive transport.");
     251                                instance->transfers[i].first = transfer->next_va;
     252                                transfer_descriptor_fini(transfer);
     253                                trans_free(transfer);
     254                        }
     255                        if (!instance->transfers[i].first)
     256                                instance->transfers[i].last = instance->transfers[i].first;
     257                }
    241258
    242259                async_usleep(1000000);
Note: See TracChangeset for help on using the changeset viewer.