Changeset fb28cde in mainline


Ignore:
Timestamp:
2018-01-18T17:12:30Z (6 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8fe29a7c
Parents:
e7f21884
Message:

xhci: changed api to get dequeue state of trb ring

Location:
uspace/drv/bus/usb/xhci
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/commands.c

    re7f21884 rfb28cde  
    546546        TRB_SET_DEQUEUE_PTR(cmd->_header.trb, cmd->dequeue_ptr);
    547547
    548         /**
    549          * TODO: Set DCS (see section 4.6.10).
    550          */
    551 
    552548        return enqueue_command(hc, cmd);
    553549}
  • uspace/drv/bus/usb/xhci/hc.c

    re7f21884 rfb28cde  
    477477        XHCI_REG_WR(hc->op_regs, XHCI_OP_MAX_SLOTS_EN, hc->max_slots);
    478478
    479         uint64_t crcr = xhci_trb_ring_get_dequeue_ptr(&hc->cr.trb_ring);
    480         if (hc->cr.trb_ring.pcs)
    481                 crcr |= XHCI_REG_MASK(XHCI_OP_RCS);
     479        uintptr_t crcr;
     480        xhci_trb_ring_reset_dequeue_state(&hc->cr.trb_ring, &crcr);
    482481        XHCI_REG_WR(hc->op_regs, XHCI_OP_CRCR_LO, LOWER32(crcr));
    483482        XHCI_REG_WR(hc->op_regs, XHCI_OP_CRCR_HI, UPPER32(crcr));
  • uspace/drv/bus/usb/xhci/trb_ring.c

    re7f21884 rfb28cde  
    272272}
    273273
     274void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr)
     275{
     276        assert(ring);
     277
     278        ring->dequeue = trb_ring_enqueue_phys(ring);
     279
     280        if (addr)
     281                *addr = ring->dequeue | ring->pcs;
     282}
     283
    274284/**
    275285 * Initializes an event ring.
  • uspace/drv/bus/usb/xhci/trb_ring.h

    re7f21884 rfb28cde  
    7979int xhci_trb_ring_enqueue_multiple(xhci_trb_ring_t *, xhci_trb_t *, size_t, uintptr_t *);
    8080
    81 /**
    82  * Get the initial value to fill into CRCR.
    83  */
    84 static inline uintptr_t xhci_trb_ring_get_dequeue_ptr(xhci_trb_ring_t *ring)
    85 {
    86         return ring->dequeue;
    87 }
     81void xhci_trb_ring_reset_dequeue_state(xhci_trb_ring_t *ring, uintptr_t *addr);
    8882
    8983/**
     
    9488        ring->dequeue = phys;
    9589}
    96 
    97 uintptr_t xhci_trb_ring_get_dequeue_ptr(xhci_trb_ring_t *);
    9890
    9991/**
Note: See TracChangeset for help on using the changeset viewer.