Changeset 9c10e51 in mainline for uspace/drv/bus/usb/ohci/hc.c


Ignore:
Timestamp:
2011-08-31T22:50:21Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4e9ecf4
Parents:
f18d82f0
Message:

ohci: use driver specific structure instead of the generic one

ohci: do not create hw structures if communicating with root hub

File:
1 edited

Legend:

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

    rf18d82f0 r9c10e51  
    289289{
    290290        assert(hcd);
    291         batch_init_ohci(batch);
    292291        hc_t *instance = hcd->private_data;
    293292        assert(instance);
     
    298297                return EOK;
    299298        }
     299        ohci_transfer_batch_t *ohci_batch = ohci_transfer_batch_get(batch);
     300        if (!ohci_batch)
     301                return ENOMEM;
    300302
    301303        fibril_mutex_lock(&instance->guard);
    302         list_append(&batch->link, &instance->pending_batches);
    303         batch_commit(batch);
     304        list_append(&ohci_batch->link, &instance->pending_batches);
     305        ohci_transfer_batch_commit(ohci_batch);
    304306
    305307        /* Control and bulk schedules need a kick to start working */
     
    341343                    instance->registers->periodic_current);
    342344
    343                 link_t *current = instance->pending_batches.head.next;
    344                 while (current != &instance->pending_batches.head) {
     345                link_t *current = list_first(&instance->pending_batches);
     346                while (current && current != &instance->pending_batches.head) {
    345347                        link_t *next = current->next;
    346                         usb_transfer_batch_t *batch =
    347                             usb_transfer_batch_from_link(current);
    348 
    349                         if (batch_is_complete(batch)) {
     348                        ohci_transfer_batch_t *batch =
     349                            ohci_transfer_batch_from_link(current);
     350
     351                        if (ohci_transfer_batch_is_complete(batch)) {
    350352                                list_remove(current);
    351                                 usb_transfer_batch_finish(batch);
     353                                ohci_transfer_batch_finish_dispose(batch);
    352354                        }
    353355
Note: See TracChangeset for help on using the changeset viewer.