Lines 3034-3039
Link Here
|
3034 |
return (0); |
3034 |
return (0); |
3035 |
} |
3035 |
} |
3036 |
|
3036 |
|
|
|
3037 |
static uint32_t |
3038 |
xhci_read_portsc(struct xhci_softc *sc, uint16_t i) |
3039 |
{ |
3040 |
uint32_t value; |
3041 |
uint32_t timeout = 16; |
3042 |
|
3043 |
do { |
3044 |
value = XREAD4(sc, oper, XHCI_PORTSC(i)); |
3045 |
if (value != -1U) |
3046 |
break; |
3047 |
} while (timeout--); |
3048 |
|
3049 |
return (value); |
3050 |
} |
3051 |
|
3037 |
static void |
3052 |
static void |
3038 |
xhci_root_intr(struct xhci_softc *sc) |
3053 |
xhci_root_intr(struct xhci_softc *sc) |
3039 |
{ |
3054 |
{ |
Lines 3046-3052
Link Here
|
3046 |
|
3061 |
|
3047 |
for (i = 1; i <= sc->sc_noport; i++) { |
3062 |
for (i = 1; i <= sc->sc_noport; i++) { |
3048 |
/* pick out CHANGE bits from the status register */ |
3063 |
/* pick out CHANGE bits from the status register */ |
3049 |
if (XREAD4(sc, oper, XHCI_PORTSC(i)) & ( |
3064 |
if (xhci_read_portsc(sc, i) & ( |
3050 |
XHCI_PS_CSC | XHCI_PS_PEC | |
3065 |
XHCI_PS_CSC | XHCI_PS_PEC | |
3051 |
XHCI_PS_OCC | XHCI_PS_WRC | |
3066 |
XHCI_PS_OCC | XHCI_PS_WRC | |
3052 |
XHCI_PS_PRC | XHCI_PS_PLC | |
3067 |
XHCI_PS_PRC | XHCI_PS_PLC | |
Lines 3444-3451
Link Here
|
3444 |
goto done; |
3459 |
goto done; |
3445 |
} |
3460 |
} |
3446 |
port = XHCI_PORTSC(index); |
3461 |
port = XHCI_PORTSC(index); |
|
|
3462 |
v = xhci_read_portsc(sc, index); |
3447 |
|
3463 |
|
3448 |
v = XREAD4(sc, oper, port); |
|
|
3449 |
i = XHCI_PS_PLS_GET(v); |
3464 |
i = XHCI_PS_PLS_GET(v); |
3450 |
v &= ~XHCI_PS_CLEAR; |
3465 |
v &= ~XHCI_PS_CLEAR; |
3451 |
|
3466 |
|
Lines 3531-3537
Link Here
|
3531 |
|
3546 |
|
3532 |
for (j = 1; j <= sc->sc_noport; j++) { |
3547 |
for (j = 1; j <= sc->sc_noport; j++) { |
3533 |
|
3548 |
|
3534 |
v = XREAD4(sc, oper, XHCI_PORTSC(j)); |
3549 |
v = xhci_read_portsc(sc, j); |
3535 |
if (v & XHCI_PS_DR) { |
3550 |
if (v & XHCI_PS_DR) { |
3536 |
sc->sc_hub_desc.hubd. |
3551 |
sc->sc_hub_desc.hubd. |
3537 |
DeviceRemovable[j / 8] |= 1U << (j % 8); |
3552 |
DeviceRemovable[j / 8] |= 1U << (j % 8); |
Lines 3554-3560
Link Here
|
3554 |
goto done; |
3569 |
goto done; |
3555 |
} |
3570 |
} |
3556 |
|
3571 |
|
3557 |
v = XREAD4(sc, oper, XHCI_PORTSC(index)); |
3572 |
v = xhci_read_portsc(sc, index); |
3558 |
|
3573 |
|
3559 |
DPRINTFN(9, "port status=0x%08x\n", v); |
3574 |
DPRINTFN(9, "port status=0x%08x\n", v); |
3560 |
|
3575 |
|
Lines 3631-3637
Link Here
|
3631 |
} |
3646 |
} |
3632 |
|
3647 |
|
3633 |
port = XHCI_PORTSC(index); |
3648 |
port = XHCI_PORTSC(index); |
3634 |
v = XREAD4(sc, oper, port) & ~XHCI_PS_CLEAR; |
3649 |
v = xhci_read_portsc(sc, index) & ~XHCI_PS_CLEAR; |
3635 |
|
3650 |
|
3636 |
switch (value) { |
3651 |
switch (value) { |
3637 |
case UHF_PORT_U1_TIMEOUT: |
3652 |
case UHF_PORT_U1_TIMEOUT: |