Ignore:
Timestamp:
2011-09-24T14:20:29Z (13 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5bf76c1
Parents:
867e2555 (diff), 1ab4aca (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

    r867e2555 r925a21e  
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup drvusbohci
    2930 * @{
     
    3233 * @brief OHCI driver transfer list implementation
    3334 */
     35
    3436#include <errno.h>
    3537#include <usb/debug.h>
    36 #include <arch/barrier.h>
    37 
     38#include <libarch/barrier.h>
    3839#include "endpoint_list.h"
    3940
     
    8687 * The endpoint is added to the end of the list and queue.
    8788 */
    88 void endpoint_list_add_ep(endpoint_list_t *instance, hcd_endpoint_t *hcd_ep)
     89void endpoint_list_add_ep(endpoint_list_t *instance, ohci_endpoint_t *ep)
    8990{
    9091        assert(instance);
    91         assert(hcd_ep);
    92         usb_log_debug2("Queue %s: Adding endpoint(%p).\n",
    93             instance->name, hcd_ep);
     92        assert(ep);
     93        usb_log_debug2("Queue %s: Adding endpoint(%p).\n", instance->name, ep);
    9494
    9595        fibril_mutex_lock(&instance->guard);
     
    102102        } else {
    103103                /* There are active EDs, get the last one */
    104                 hcd_endpoint_t *last = list_get_instance(
    105                     list_last(&instance->endpoint_list), hcd_endpoint_t, link);
     104                ohci_endpoint_t *last = list_get_instance(
     105                    list_last(&instance->endpoint_list), ohci_endpoint_t, link);
    106106                last_ed = last->ed;
    107107        }
    108108        /* Keep link */
    109         hcd_ep->ed->next = last_ed->next;
     109        ep->ed->next = last_ed->next;
    110110        /* Make sure ED is written to the memory */
    111111        write_barrier();
    112112
    113113        /* Add ed to the hw queue */
    114         ed_append_ed(last_ed, hcd_ep->ed);
     114        ed_append_ed(last_ed, ep->ed);
    115115        /* Make sure ED is updated */
    116116        write_barrier();
    117117
    118118        /* Add to the sw list */
    119         list_append(&hcd_ep->link, &instance->endpoint_list);
     119        list_append(&ep->link, &instance->endpoint_list);
    120120
    121         hcd_endpoint_t *first = list_get_instance(
    122             list_first(&instance->endpoint_list), hcd_endpoint_t, link);
     121        ohci_endpoint_t *first = list_get_instance(
     122            list_first(&instance->endpoint_list), ohci_endpoint_t, link);
    123123        usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p).\n",
    124                 hcd_ep, instance->name, first, first->ed);
     124                ep, instance->name, first, first->ed);
    125125        if (last_ed == instance->list_head) {
    126126                usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x.\n",
     
    137137 * @param[in] endpoint Endpoint to remove.
    138138 */
    139 void endpoint_list_remove_ep(endpoint_list_t *instance, hcd_endpoint_t *hcd_ep)
     139void endpoint_list_remove_ep(endpoint_list_t *instance, ohci_endpoint_t *ep)
    140140{
    141141        assert(instance);
    142142        assert(instance->list_head);
    143         assert(hcd_ep);
    144         assert(hcd_ep->ed);
     143        assert(ep);
     144        assert(ep->ed);
    145145
    146146        fibril_mutex_lock(&instance->guard);
    147147
    148         usb_log_debug2(
    149             "Queue %s: removing endpoint(%p).\n", instance->name, hcd_ep);
     148        usb_log_debug2("Queue %s: removing endpoint(%p).\n", instance->name, ep);
    150149
    151150        const char *qpos = NULL;
    152151        ed_t *prev_ed;
    153152        /* Remove from the hardware queue */
    154         if (list_first(&instance->endpoint_list) == &hcd_ep->link) {
     153        if (list_first(&instance->endpoint_list) == &ep->link) {
    155154                /* I'm the first one here */
    156155                prev_ed = instance->list_head;
    157156                qpos = "FIRST";
    158157        } else {
    159                 hcd_endpoint_t *prev =
    160                     list_get_instance(hcd_ep->link.prev, hcd_endpoint_t, link);
     158                ohci_endpoint_t *prev =
     159                    list_get_instance(ep->link.prev, ohci_endpoint_t, link);
    161160                prev_ed = prev->ed;
    162161                qpos = "NOT FIRST";
    163162        }
    164         assert((prev_ed->next & ED_NEXT_PTR_MASK) == addr_to_phys(hcd_ep->ed));
    165         prev_ed->next = hcd_ep->ed->next;
     163        assert((prev_ed->next & ED_NEXT_PTR_MASK) == addr_to_phys(ep->ed));
     164        prev_ed->next = ep->ed->next;
    166165        /* Make sure ED is updated */
    167166        write_barrier();
    168167
    169168        usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x.\n",
    170             hcd_ep, qpos, instance->name, hcd_ep->ed->next);
     169            ep, qpos, instance->name, ep->ed->next);
    171170
    172171        /* Remove from the endpoint list */
    173         list_remove(&hcd_ep->link);
     172        list_remove(&ep->link);
    174173        fibril_mutex_unlock(&instance->guard);
    175174}
Note: See TracChangeset for help on using the changeset viewer.