Changeset e67c50a in mainline for uspace/drv/bus/usb/ohci/hw_struct


Ignore:
Timestamp:
2018-02-01T21:13:23Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64ce0c1
Parents:
3e6ff9a
git-author:
Ondřej Hlavatý <aearsis@…> (2018-02-01 21:13:22)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-02-01 21:13:23)
Message:

ohci: use dma memory responsibly

Instead of leaving arbitrary TD behind to be used by next transfer,
prepare two of them in endpoint and use them in a cyclic manner. This
reduces the number of pages allocated per transfer to one.

Location:
uspace/drv/bus/usb/ohci/hw_struct
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hw_struct/endpoint_descriptor.h

    r3e6ff9a re67c50a  
    165165
    166166/**
     167 * Set the HeadP of ED. Do not call unless the ED is Halted.
     168 * @param instance ED
     169 */
     170static inline void ed_set_head_td(ed_t *instance, const td_t *td)
     171{
     172        assert(instance);
     173        const uintptr_t pa = addr_to_phys(td);
     174        OHCI_MEM32_WR(instance->td_head, pa & ED_TDHEAD_PTR_MASK);
     175}
     176
     177/**
    167178 * Set next ED in ED chain.
    168179 * @param instance ED to modify
  • uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.c

    r3e6ff9a re67c50a  
    8888        }
    8989
     90        td_set_next(instance, next);
     91}
     92
     93void td_set_next(td_t *instance, const td_t *next)
     94{
    9095        OHCI_MEM32_WR(instance->next, addr_to_phys(next) & TD_NEXT_PTR_MASK);
     96}
    9197
    92 }
    9398/**
    9499 * @}
  • uspace/drv/bus/usb/ohci/hw_struct/transfer_descriptor.h

    r3e6ff9a re67c50a  
    9292} __attribute__((packed)) td_t;
    9393
    94 void td_init(td_t *instance, const td_t *next,
    95     usb_direction_t dir, const void *buffer, size_t size, int toggle);
     94void td_init(td_t *, const td_t *, usb_direction_t, const void *, size_t, int);
     95void td_set_next(td_t *, const td_t *);
    9696
    9797/**
Note: See TracChangeset for help on using the changeset viewer.