Fix pullup #1302 by adapting the changes to this branch

(there was a misunderstanding in the ticket handling)
This commit is contained in:
martin 2021-06-22 05:10:50 +00:00
parent dca452291c
commit 497a40430a
3 changed files with 32 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $ */
/* $NetBSD: xhci.c,v 1.107.2.9 2021/06/22 05:10:50 martin Exp $ */
/*
* Copyright (c) 2013 Jonathan A. Kollasch
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.8 2021/06/21 17:11:46 martin Exp $");
__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.107.2.9 2021/06/22 05:10:50 martin Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@ -724,7 +724,7 @@ xhci_suspend(device_t self, const pmf_qual_t *qual)
if (xs->xs_idx == 0)
continue;
for (dci = XHCI_DCI_SLOT; dci <= XHCI_MAX_DCI; dci++) {
for (dci = 0; dci < 32; dci++) {
/* Skip if the endpoint is not Running. */
/* XXX What about Busy? */
if (xhci_get_epstate(sc, xs, dci) !=
@ -951,7 +951,7 @@ xhci_resume(device_t self, const pmf_qual_t *qual)
*
* XXX Hope just zeroing it is good enough!
*/
xhci_host_dequeue(sc->sc_cr);
xhci_host_dequeue(&sc->sc_cr);
/*
* `7. Write the CRCR with the address and RCS value of the
@ -959,8 +959,8 @@ xhci_resume(device_t self, const pmf_qual_t *qual)
* cause the Command Ring to restart at the address
* specified by the CRCR.'
*/
xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(sc->sc_cr, 0) |
sc->sc_cr->xr_cs);
xhci_op_write_8(sc, XHCI_CRCR, xhci_ring_trbp(&sc->sc_cr, 0) |
sc->sc_cr.xr_cs);
/*
* `8. Enable the controller by setting Run/Stop (R/S) =
@ -1049,7 +1049,7 @@ xhci_resume(device_t self, const pmf_qual_t *qual)
if (xs->xs_idx == 0)
continue;
for (dci = XHCI_DCI_SLOT; dci <= XHCI_MAX_DCI; dci++) {
for (dci = 0; dci < 32; dci++) {
/* Skip if the endpoint is not Running. */
if (xhci_get_epstate(sc, xs, dci) !=
XHCI_EPSTATE_RUNNING)

View File

@ -1,4 +1,4 @@
/* $NetBSD: xhcireg.h,v 1.13.2.1 2021/06/21 17:11:46 martin Exp $ */
/* $NetBSD: xhcireg.h,v 1.13.2.2 2021/06/22 05:10:50 martin Exp $ */
/*-
* Copyright (c) 2010 Hans Petter Selasky. All rights reserved.
@ -162,8 +162,31 @@
#define XHCI_PS_PED 0x00000002 /* RW - port enabled / disabled */
#define XHCI_PS_OCA 0x00000008 /* RO - over current active */
#define XHCI_PS_PR 0x00000010 /* RW - port reset */
#define XHCI_PS_PLS_MASK __BITS(8, 5)
#define XHCI_PS_PLS_GET(x) (((x) >> 5) & 0xF) /* RW - port link state */
#define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */
#define XHCI_PS_PLS_SETU0 0
#define XHCI_PS_PLS_SETU2 2
#define XHCI_PS_PLS_SETU3 3
#define XHCI_PS_PLS_SETDISC 5
#define XHCI_PS_PLS_SETCOMP 10
#define XHCI_PS_PLS_SETRESUME 15
#define XHCI_PS_PLS_U0 0
#define XHCI_PS_PLS_U1 1
#define XHCI_PS_PLS_U2 2
#define XHCI_PS_PLS_U3 3
#define XHCI_PS_PLS_DISABLED 4
#define XHCI_PS_PLS_RXDETECT 5
#define XHCI_PS_PLS_INACTIVE 6
#define XHCI_PS_PLS_POLLING 7
#define XHCI_PS_PLS_RECOVERY 8
#define XHCI_PS_PLS_HOTRESET 9
#define XHCI_PS_PLS_COMPLIANCE 10
#define XHCI_PS_PLS_TEST 11
#define XHCI_PS_PLS_RESUME 15
#define XHCI_PS_PP 0x00000200 /* RW - port power */
#define XHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */
#define XHCI_PS_SPEED_FS 1

View File

@ -1,4 +1,4 @@
/* $NetBSD: xhcivar.h,v 1.11.4.1 2021/06/21 17:11:46 martin Exp $ */
/* $NetBSD: xhcivar.h,v 1.11.4.2 2021/06/22 05:10:50 martin Exp $ */
/*
* Copyright (c) 2013 Jonathan A. Kollasch