Changeset 13b9cb5 in mainline


Ignore:
Timestamp:
2011-03-19T09:32:04Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4fb6d9ee
Parents:
ebf59e4
Message:

Use horizontal list instead of vertical in uhci scheduler

This breaks debug fibril algo so turn it of for now

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

Legend:

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

    rebf59e4 r13b9cb5  
    7979        if (!instance->queue_head)
    8080                return;
    81         /* Set both next and element to point to the same QH */
     81        /* Set both queue_head.next to point to the follower */
    8282        qh_set_next_qh(instance->queue_head, next->queue_head_pa);
    83         qh_set_element_qh(instance->queue_head, next->queue_head_pa);
    8483}
    8584/*----------------------------------------------------------------------------*/
     
    9897        usb_log_debug2("Queue %s: Adding batch(%p).\n", instance->name, batch);
    9998
    100         const uint32_t pa = addr_to_phys(batch->qh);
    101         assert((pa & LINK_POINTER_ADDRESS_MASK) == pa);
    102 
    103         /* New batch will be added to the end of the current list
    104          * so set the link accordingly */
    105         qh_set_next_qh(batch->qh, instance->queue_head->next);
    10699
    107100        fibril_mutex_lock(&instance->guard);
    108101
     102        qh_t *last_qh = NULL;
    109103        /* Add to the hardware queue. */
    110104        if (list_empty(&instance->batch_list)) {
    111105                /* There is nothing scheduled */
    112                 qh_t *qh = instance->queue_head;
    113                 assert(qh->element == qh->next);
    114                 qh_set_element_qh(qh, pa);
     106                last_qh = instance->queue_head;
    115107        } else {
    116108                /* There is something scheduled */
    117109                batch_t *last = list_get_instance(
    118110                    instance->batch_list.prev, batch_t, link);
    119                 qh_set_next_qh(last->qh, pa);
    120         }
     111                last_qh = last->qh;
     112        }
     113        const uint32_t pa = addr_to_phys(batch->qh);
     114        assert((pa & LINK_POINTER_ADDRESS_MASK) == pa);
     115
     116        batch->qh->next = last_qh->next;
     117        qh_set_next_qh(last_qh, pa);
     118
    121119        /* Add to the driver list */
    122120        list_append(&batch->link, &instance->batch_list);
     
    174172{
    175173        fibril_mutex_lock(&instance->guard);
    176         while (list_empty(&instance->batch_list)) {
     174        while (!list_empty(&instance->batch_list)) {
    177175                link_t *current = instance->batch_list.next;
    178176                batch_t *batch = list_get_instance(current, batch_t, link);
     
    204202        if (batch->link.prev == &instance->batch_list) {
    205203                /* I'm the first one here */
    206                 qh_set_element_qh(instance->queue_head, batch->qh->next);
     204                instance->queue_head->next = batch->qh->next;
    207205                pos = "FIRST";
    208206        } else {
    209207                batch_t *prev =
    210208                    list_get_instance(batch->link.prev, batch_t, link);
    211                 qh_set_next_qh(prev->qh, batch->qh->next);
     209                prev->qh->next = batch->qh->next;
    212210                pos = "NOT FIRST";
    213211        }
  • uspace/drv/uhci-hcd/uhci_hc.c

    rebf59e4 r13b9cb5  
    123123        }
    124124
    125         instance->debug_checker = fibril_create(uhci_hc_debug_checker, instance);
    126         fibril_add_ready(instance->debug_checker);
     125        instance->debug_checker =
     126            fibril_create(uhci_hc_debug_checker, instance);
     127//      fibril_add_ready(instance->debug_checker);
    127128
    128129        usb_log_info("Started UHCI driver.\n");
Note: See TracChangeset for help on using the changeset viewer.