Ignore:
Timestamp:
2012-02-18T16:47:38Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4449c6c
Parents:
bd5f3b7 (diff), f943dd3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rbd5f3b7 r00aece0  
    6060            name, instance->list_head, instance->list_head_pa);
    6161
    62         ed_init(instance->list_head, NULL);
     62        ed_init(instance->list_head, NULL, NULL);
    6363        list_initialize(&instance->endpoint_list);
    6464        fibril_mutex_initialize(&instance->guard);
     
    7373 * Does not check whether this replaces an existing list.
    7474 */
    75 void endpoint_list_set_next(endpoint_list_t *instance, endpoint_list_t *next)
     75void endpoint_list_set_next(
     76    const endpoint_list_t *instance, const endpoint_list_t *next)
    7677{
    7778        assert(instance);
     
    8788 * The endpoint is added to the end of the list and queue.
    8889 */
    89 void endpoint_list_add_ep(endpoint_list_t *instance, hcd_endpoint_t *hcd_ep)
     90void endpoint_list_add_ep(endpoint_list_t *instance, ohci_endpoint_t *ep)
    9091{
    9192        assert(instance);
    92         assert(hcd_ep);
    93         usb_log_debug2("Queue %s: Adding endpoint(%p).\n",
    94             instance->name, hcd_ep);
     93        assert(ep);
     94        usb_log_debug2("Queue %s: Adding endpoint(%p).\n", instance->name, ep);
    9595
    9696        fibril_mutex_lock(&instance->guard);
     
    103103        } else {
    104104                /* There are active EDs, get the last one */
    105                 hcd_endpoint_t *last = list_get_instance(
    106                     list_last(&instance->endpoint_list), hcd_endpoint_t, link);
     105                ohci_endpoint_t *last = list_get_instance(
     106                    list_last(&instance->endpoint_list), ohci_endpoint_t, link);
    107107                last_ed = last->ed;
    108108        }
    109109        /* Keep link */
    110         hcd_ep->ed->next = last_ed->next;
     110        ep->ed->next = last_ed->next;
    111111        /* Make sure ED is written to the memory */
    112112        write_barrier();
    113113
    114114        /* Add ed to the hw queue */
    115         ed_append_ed(last_ed, hcd_ep->ed);
     115        ed_append_ed(last_ed, ep->ed);
    116116        /* Make sure ED is updated */
    117117        write_barrier();
    118118
    119119        /* Add to the sw list */
    120         list_append(&hcd_ep->link, &instance->endpoint_list);
     120        list_append(&ep->link, &instance->endpoint_list);
    121121
    122         hcd_endpoint_t *first = list_get_instance(
    123             list_first(&instance->endpoint_list), hcd_endpoint_t, link);
     122        ohci_endpoint_t *first = list_get_instance(
     123            list_first(&instance->endpoint_list), ohci_endpoint_t, link);
    124124        usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p).\n",
    125                 hcd_ep, instance->name, first, first->ed);
     125                ep, instance->name, first, first->ed);
    126126        if (last_ed == instance->list_head) {
    127127                usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x.\n",
     
    138138 * @param[in] endpoint Endpoint to remove.
    139139 */
    140 void endpoint_list_remove_ep(endpoint_list_t *instance, hcd_endpoint_t *hcd_ep)
     140void endpoint_list_remove_ep(endpoint_list_t *instance, ohci_endpoint_t *ep)
    141141{
    142142        assert(instance);
    143143        assert(instance->list_head);
    144         assert(hcd_ep);
    145         assert(hcd_ep->ed);
     144        assert(ep);
     145        assert(ep->ed);
    146146
    147147        fibril_mutex_lock(&instance->guard);
    148148
    149         usb_log_debug2(
    150             "Queue %s: removing endpoint(%p).\n", instance->name, hcd_ep);
     149        usb_log_debug2("Queue %s: removing endpoint(%p).\n", instance->name, ep);
    151150
    152151        const char *qpos = NULL;
    153152        ed_t *prev_ed;
    154153        /* Remove from the hardware queue */
    155         if (list_first(&instance->endpoint_list) == &hcd_ep->link) {
     154        if (list_first(&instance->endpoint_list) == &ep->link) {
    156155                /* I'm the first one here */
    157156                prev_ed = instance->list_head;
    158157                qpos = "FIRST";
    159158        } else {
    160                 hcd_endpoint_t *prev =
    161                     list_get_instance(hcd_ep->link.prev, hcd_endpoint_t, link);
     159                ohci_endpoint_t *prev =
     160                    list_get_instance(ep->link.prev, ohci_endpoint_t, link);
    162161                prev_ed = prev->ed;
    163162                qpos = "NOT FIRST";
    164163        }
    165         assert((prev_ed->next & ED_NEXT_PTR_MASK) == addr_to_phys(hcd_ep->ed));
    166         prev_ed->next = hcd_ep->ed->next;
     164        assert((prev_ed->next & ED_NEXT_PTR_MASK) == addr_to_phys(ep->ed));
     165        prev_ed->next = ep->ed->next;
    167166        /* Make sure ED is updated */
    168167        write_barrier();
    169168
    170169        usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x.\n",
    171             hcd_ep, qpos, instance->name, hcd_ep->ed->next);
     170            ep, qpos, instance->name, ep->ed->next);
    172171
    173172        /* Remove from the endpoint list */
    174         list_remove(&hcd_ep->link);
     173        list_remove(&ep->link);
    175174        fibril_mutex_unlock(&instance->guard);
    176175}
Note: See TracChangeset for help on using the changeset viewer.