Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 665368c in mainline


Ignore:
Timestamp:
2018-01-11T17:59:21Z (4 years ago)
Author:
Salmelu <salmelu@…>
Branches:
lfn, master
Children:
f3baab1
Parents:
69a93d02
Message:

xhci: Start tracking mfindex wraps

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

Legend:

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

    r69a93d02 r665368c  
    192192        hc->ac64 = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_AC64);
    193193        hc->max_slots = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_SLOTS);
     194        hc->wrap_count = 0;
    194195        unsigned ist = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_IST);
    195196        hc->ist = (ist & 0x10 >> 1) * (ist & 0xf);
     
    377378
    378379/**
    379  * Ask the xHC to reset its state. Implements sequence 
     380 * Ask the xHC to reset its state. Implements sequence
    380381 */
    381382static int hc_reset(xhci_hc_t *hc)
     
    422423        XHCI_REG_WR(hc->op_regs, XHCI_OP_CRCR_LO, LOWER32(crcr));
    423424        XHCI_REG_WR(hc->op_regs, XHCI_OP_CRCR_HI, UPPER32(crcr));
     425
     426        XHCI_REG_SET(hc->op_regs, XHCI_OP_EWE, 1);
    424427
    425428        xhci_interrupter_regs_t *intr0 = &hc->rt_regs->ir[0];
     
    432435        XHCI_REG_WR(intr0, XHCI_INTR_ERSTBA_HI, UPPER32(erstptr));
    433436
     437
    434438        if (irq) {
    435439                XHCI_REG_SET(intr0, XHCI_INTR_IE, 1);
     
    470474}
    471475
     476static int xhci_handle_mfindex_wrap_event(xhci_hc_t *hc, xhci_trb_t *trb)
     477{
     478        ++hc->wrap_count;
     479        return EOK;
     480}
     481
    472482typedef int (*event_handler) (xhci_hc_t *, xhci_trb_t *trb);
    473483
     
    476486        [XHCI_TRB_TYPE_PORT_STATUS_CHANGE_EVENT] = &xhci_rh_handle_port_status_change_event,
    477487        [XHCI_TRB_TYPE_TRANSFER_EVENT] = &xhci_handle_transfer_event,
     488        [XHCI_TRB_TYPE_MFINDEX_WRAP_EVENT] = &xhci_handle_mfindex_wrap_event,
    478489};
    479490
     
    650661 * Issue a Disable Slot command for a slot occupied by device.
    651662 *
    652  * Frees the device context 
     663 * Frees the device context
    653664 */
    654665int hc_disable_slot(xhci_hc_t *hc, xhci_device_t *dev)
  • uspace/drv/bus/usb/xhci/hc.h

    r69a93d02 r665368c  
    8484        unsigned max_slots;
    8585        bool ac64;
     86        uint32_t wrap_count;    /** Amount of mfindex wraps HC has done */
    8687        unsigned ist;                   /**< IST in microframes */
    8788
Note: See TracChangeset for help on using the changeset viewer.