Ignore:
Timestamp:
2018-02-28T16:37:50Z (6 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1b20da0
Parents:
f5e5f73 (diff), b2dca8de (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.
git-author:
Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
git-committer:
Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
Message:

Merge github.com:helenos-xhci-team/helenos

This commit merges support for USB 3 and generally refactors, fixes,
extends and cleans up the existing USB framework.

Notable additions and features:

  • new host controller driver has been implemented to control various xHC models (among others, NEC Renesas uPD720200)
  • isochronous data transfer mode
  • support for explicit USB device removal
  • USB tablet driver
File:
1 edited

Legend:

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

    rf5e5f73 rdf6ded8  
    11/*
    22 * Copyright (c) 2014 Jan Vesely
     3 * Copyright (c) 2018 Ondrej Hlavaty
    34 * All rights reserved.
    45 *
     
    5455        assert(instance);
    5556        instance->name = name;
    56         instance->list_head = malloc32(sizeof(qh_t));
    57         if (!instance->list_head) {
     57        if (dma_buffer_alloc(&instance->dma_buffer, sizeof(qh_t))) {
    5858                usb_log_error("EPL(%p-%s): Failed to allocate list head.",
    5959                    instance, name);
    6060                return ENOMEM;
    6161        }
     62        instance->list_head = instance->dma_buffer.virt;
    6263        qh_init(instance->list_head, NULL);
    6364
     
    9596{
    9697        assert(instance);
     98        assert(instance->list_head);
    9799        assert(ep);
    98100        assert(ep->qh);
    99         usb_log_debug2("EPL(%p-%s): Append endpoint(%p).\n",
     101        usb_log_debug2("EPL(%p-%s): Append endpoint(%p).",
    100102            instance, instance->name, ep);
    101103
     
    124126        write_barrier();
    125127        /* Add to the sw list */
    126         list_append(&ep->link, &instance->endpoint_list);
     128        list_append(&ep->eplist_link, &instance->endpoint_list);
    127129
    128130        ehci_endpoint_t *first = ehci_endpoint_list_instance(
    129131            list_first(&instance->endpoint_list));
    130         usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p).\n",
     132        usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p).",
    131133            instance, instance->name, ep, first, first->qh);
    132134        if (last_qh == instance->list_head) {
    133                 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x.\n",
     135                usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x.",
    134136                    instance, instance->name, last_qh,
    135137                    addr_to_phys(instance->list_head),
     
    153155        fibril_mutex_lock(&instance->guard);
    154156
    155         usb_log_debug2("EPL(%p-%s): removing EP(%p).\n",
     157        usb_log_debug2("EPL(%p-%s): removing EP(%p).",
    156158            instance, instance->name, ep);
    157159
     
    159161        qh_t *prev_qh;
    160162        /* Remove from the hardware queue */
    161         if (list_first(&instance->endpoint_list) == &ep->link) {
     163        if (list_first(&instance->endpoint_list) == &ep->eplist_link) {
    162164                /* I'm the first one here */
    163165                prev_qh = instance->list_head;
    164166                qpos = "FIRST";
    165167        } else {
    166                 prev_qh = ehci_endpoint_list_instance(ep->link.prev)->qh;
     168                prev_qh = ehci_endpoint_list_instance(ep->eplist_link.prev)->qh;
    167169                qpos = "NOT FIRST";
    168170        }
     
    172174        write_barrier();
    173175
    174         usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x.\n",
     176        usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x.",
    175177            instance, instance->name,  ep, qpos, ep->qh->horizontal);
    176178
    177179        /* Remove from the endpoint list */
    178         list_remove(&ep->link);
     180        list_remove(&ep->eplist_link);
    179181        fibril_mutex_unlock(&instance->guard);
    180182}
Note: See TracChangeset for help on using the changeset viewer.