Changeset 35c37fc in mainline for uspace/drv/bus/usb/ehci/ehci_bus.c


Ignore:
Timestamp:
2018-01-05T20:15:08Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9e5b162
Parents:
b60944b
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-05 16:11:04)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-05 20:15:08)
Message:

ehci: refactor to dma_buffers

One big hidden thing was refactored - now TDs are allocated in one
buffer together with setup and data buffers themselves. This reduces the
number of allocated pages per transfer to minimum.

File:
1 edited

Legend:

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

    rb60944b r35c37fc  
    3636#include <assert.h>
    3737#include <stdlib.h>
    38 #include <usb/host/utils/malloc32.h>
    3938#include <usb/host/bandwidth.h>
    4039#include <usb/debug.h>
     
    9089
    9190        // TODO: extract USB2 information from desc
     91       
     92        if (dma_buffer_alloc(&ehci_ep->dma_buffer, sizeof(qh_t)))
     93                return NULL;
    9294
    93         ehci_ep->qh = malloc32(sizeof(qh_t));
    94         if (ehci_ep->qh == NULL) {
    95                 free(ehci_ep);
    96                 return NULL;
    97         }
     95        ehci_ep->qh = ehci_ep->dma_buffer.virt;
    9896
    9997        link_initialize(&ehci_ep->link);
     
    111109        ehci_endpoint_t *instance = ehci_endpoint_get(ep);
    112110
    113         free32(instance->qh);
     111        dma_buffer_free(&instance->dma_buffer);
    114112        free(instance);
    115113}
Note: See TracChangeset for help on using the changeset viewer.