From nobody Tue May 10 08:08:08 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 922091ADA212; Tue, 10 May 2022 08:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Ky9dh2jsWz4T21; Tue, 10 May 2022 08:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652170088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ZNh0EgdsFuEIHJZWR3cKD5frdqWiWwOTrw8mZkr4M8=; b=G2qgXQFz82MaEWjp3iYK6uhf5ep0gEKmKf3tEpvqeER4LhfZE2WwyOzSlYZsNduG3m1351 DmamShnB7zBDIm/M/IkN7GoGHXAitR4vmxiZdZs437K0HkQIPPDNf7CMt7E+YinXesqLvd GW+58S6DGy8QX9VqABwPc3puZcjWJ+o6TpICiyWr+fG9CUjDlfqGTzvUlkiBEaW6OHX6ns jbJ2ULS9pBNWtX1sEOLMlHamlYZiBn58IQWq6BfImosXKnn68MDLbhjvRJX9meH6fSy5ub FjrSDZVTh5v7at41NMyVbiED8YKvgQdJALzs1eT19K0qioAHHn2CkUzDpdEcXA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3E832215BB; Tue, 10 May 2022 08:08:08 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 24A888KF029655; Tue, 10 May 2022 08:08:08 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24A888Pp029654; Tue, 10 May 2022 08:08:08 GMT (envelope-from git) Date: Tue, 10 May 2022 08:08:08 GMT Message-Id: <202205100808.24A888Pp029654@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Hans Petter Selasky Subject: git: 7aedfebd77d1 - stable/12 - xhci(4): Properly define all basic USB port speeds. List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: hselasky X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: 7aedfebd77d1fc69dd6d779de4d357c5f71df8b5 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1652170088; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3ZNh0EgdsFuEIHJZWR3cKD5frdqWiWwOTrw8mZkr4M8=; b=twwB3KO2ENyKmCcUo4QX9cdl+MC5WuldUeOkTblXLdnB2Tn+YCZ6NKQXo49UB7d6MqkijN +h6NUOdk0pVVqAWypVnaEepThoQ+CzTKi74WmQEM/tnfh8knkKGCJBozxIeUse47d/imud UTX3C+/inwVo7a0NPAD69MsUxc7erv5lB2y0NvpuMtY3Y9NcFj9az5woN5Yr5bT7JNIgmG f7QHcdjgmKyz/GpTd2lpbGen7m4Q4/T0Whel7x3IZARrERtRdliz7Qvba3euot4UBJVtT5 c8X7lksIWK6YuW42k2w8Ilk4gmWJH7LCV/mDf6/rJi0zwZTCxYvnM4uBJ3Br3Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1652170088; a=rsa-sha256; cv=none; b=ZifZKqxQqQId0Ew61QU/y4oOsacsxL0Yf/2k/lj9zyGy0jQ/utVlOCVCbCfnLp+0lnYbR1 n1+gOUUUN355hkd5u3IVKLrkFX8ys3AP/qxkC/Y/LPDgepwPzAtnKBDYWUJqe8tygKgGW0 TPdkOa0WI/0sgJnLzbXbGic56Ji9oCkYQAjK+jQCCZsmPIDl2BgVBWddWxj36Cll7fbb7+ PEBpBlNLJm2x3uxzPrgUi2IiLug3JavrsUeypD407pkwBV0pcHusbSlxD1iUTx6h9gxx8r BIV7akqokJwnl79o/fqtTel2qm/RmeJaJezGm76eGpv4EGrFuRtmfjGJmovhXw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=7aedfebd77d1fc69dd6d779de4d357c5f71df8b5 commit 7aedfebd77d1fc69dd6d779de4d357c5f71df8b5 Author: Hans Petter Selasky AuthorDate: 2022-05-03 20:19:35 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-10 08:06:59 +0000 xhci(4): Properly define all basic USB port speeds. MFC after: 1 week Sponsored by: NVIDIA Networking (cherry picked from commit d730333c80fe8bc60770d093cbf12f473a065ca4) --- sys/dev/usb/controller/xhci.c | 8 ++++---- sys/dev/usb/controller/xhcireg.h | 4 ++++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/usb/controller/xhci.c b/sys/dev/usb/controller/xhci.c index 1d335fa6ee8d..5da51efd9dca 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3564,13 +3564,13 @@ xhci_roothub_exec(struct usb_device *udev, i = UPS_PORT_LINK_STATE_SET(XHCI_PS_PLS_GET(v)); switch (XHCI_PS_SPEED_GET(v)) { - case 3: + case XHCI_PS_SPEED_HIGH: i |= UPS_HIGH_SPEED; break; - case 2: + case XHCI_PS_SPEED_LOW: i |= UPS_LOW_SPEED; break; - case 1: + case XHCI_PS_SPEED_FULL: /* FULL speed */ break; default: @@ -3671,7 +3671,7 @@ xhci_roothub_exec(struct usb_device *udev, case UHF_PORT_SUSPEND: DPRINTFN(6, "suspend port %u (LPM=%u)\n", index, i); j = XHCI_PS_SPEED_GET(v); - if ((j < 1) || (j > 3)) { + if (j == 0 || j >= XHCI_PS_SPEED_SS) { /* non-supported speed */ err = USB_ERR_IOERROR; goto done; diff --git a/sys/dev/usb/controller/xhcireg.h b/sys/dev/usb/controller/xhcireg.h index b49bc09a8e7a..38acffaca050 100644 --- a/sys/dev/usb/controller/xhcireg.h +++ b/sys/dev/usb/controller/xhcireg.h @@ -124,6 +124,10 @@ #define XHCI_PS_PLS_SET(x) (((x) & 0xF) << 5) /* RW - port link state */ #define XHCI_PS_PP 0x00000200 /* RW - port power */ #define XHCI_PS_SPEED_GET(x) (((x) >> 10) & 0xF) /* RO - port speed */ +#define XHCI_PS_SPEED_FULL 0x1 /* Full Speed USB */ +#define XHCI_PS_SPEED_LOW 0x2 /* Low Speed USB */ +#define XHCI_PS_SPEED_HIGH 0x3 /* High Speed USB */ +#define XHCI_PS_SPEED_SS 0x4 /* Super Speed USB */ #define XHCI_PS_PIC_GET(x) (((x) >> 14) & 0x3) /* RW - port indicator */ #define XHCI_PS_PIC_SET(x) (((x) & 0x3) << 14) /* RW - port indicator */ #define XHCI_PS_LWS 0x00010000 /* RW - port link state write strobe */