Ignore:
Timestamp:
2014-01-24T16:12:32Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
763dbcb
Parents:
dc44023
Message:

ehci: Implement endpoint list enqueue

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/endpoint_list.c

    rdc44023 r5f5321ee  
    8282        assert(ep);
    8383        assert(ep->qh);
    84         usb_log_debug2("Queue %s: Adding endpoint(%p).\n", instance->name, ep);
     84        usb_log_debug2("Queue %s: Append endpoint(%p).\n", instance->name, ep);
    8585
    8686        fibril_mutex_lock(&instance->guard);
     
    103103        write_barrier();
    104104
    105         /* Add ed to the hw queue */
     105        /* Add QH to the hw queue */
    106106        qh_append_qh(last_qh, ep->qh);
    107         /* Make sure ED is updated */
     107        /* Make sure QH is updated */
    108108        write_barrier();
    109109        /* Add to the sw list */
     
    122122}
    123123
     124/** Add endpoint to the beginning of the list and queue.
     125 *
     126 * @param[in] instance List to use.
     127 * @param[in] endpoint Endpoint to add.
     128 *
     129 * The endpoint is added to the end of the list and queue.
     130 */
     131void endpoint_list_prepend_ep(endpoint_list_t *instance, ehci_endpoint_t *ep)
     132{
     133        assert(instance);
     134        assert(ep);
     135        assert(ep->qh);
     136        usb_log_debug2("Queue %s: Prepend endpoint(%p).\n", instance->name, ep);
     137
     138        fibril_mutex_lock(&instance->guard);
     139        ep->qh->horizontal = instance->list_head->horizontal;
     140        /* Make sure QH is updated */
     141        write_barrier();
     142        /* Add QH to the hw queue */
     143        qh_append_qh(instance->list_head, ep->qh);
     144        /* Add to the sw list */
     145        list_prepend(&ep->link, &instance->endpoint_list);
     146        fibril_mutex_unlock(&instance->guard);
     147
     148}
    124149/** Remove endpoint from the list and queue.
    125150 *
Note: See TracChangeset for help on using the changeset viewer.