From nobody Wed May 04 07:27:16 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 EFE7811DBBF9; Wed, 4 May 2022 07:27:16 +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 4KtT1J6N0Wz3lSn; Wed, 4 May 2022 07:27:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651649236; 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=BoEgBLB1s6s++5Dcs1j/a1xVVF+HQ6B3o6G8OQAMqbQ=; b=MOuX2H1oIrgoH+h0UpWMpWgC7wBzMHKlFxgdYLWosmg9stpUU5xiwflI1H80DzrcrKKLhM NSFKO/J9gT9gUzBZ0HPfo1mIPCY8DowZwzhxGLY0vUCaTDhk4EbnVfHuTtWFw8i49trMvx xgJU77AkckAVQj3re4WeMa0cRI5rdAQ85B5EM61+KtjT5Lb86WI6a+FdOpReqdc1WjUEFA NCPhGjAO3g7l23i4tWz6apAfG5U1Kc5zWr6isPjfuuiO6nNMwCNNcxnK77zAd/8TlBd7s+ DhX6/0/JsBkoB52XINPO+BiayXD+Y923hRwAaFBBX7upqwzve9TRma6MBsUMzg== 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 B6A06667A; Wed, 4 May 2022 07:27:16 +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 2447RGPC084514; Wed, 4 May 2022 07:27:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2447RGLk084513; Wed, 4 May 2022 07:27:16 GMT (envelope-from git) Date: Wed, 4 May 2022 07:27:16 GMT Message-Id: <202205040727.2447RGLk084513@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Hans Petter Selasky Subject: git: d730333c80fe - main - 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/main X-Git-Reftype: branch X-Git-Commit: d730333c80fe8bc60770d093cbf12f473a065ca4 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651649236; 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=BoEgBLB1s6s++5Dcs1j/a1xVVF+HQ6B3o6G8OQAMqbQ=; b=t2QFrFc+pUQlWbBCd5b+XdDCyE407q46tbRBfJrGmRhDdWQ3+AbaWyVLnXkY1Ee1hv05iy pDuN7jsEPKl5zUbprGt18CtkP37l6+AobeX97R50sKPCZWFiVHM6/OmAWvjW6JB6i6Pcvi /ZPNY6m0KaCEet5yYPEL/KI8mDnupeLkRsWob78px/FIepS1CaV/ArBz22JyUWxgUZKzO7 k4uvLP53ovrZwwlM+hqCsr0pLaULSuF0FaNYS/WYHULsoCYsKcwMpFmatb+lgIbZkBGi13 lgLucvgVerHy0foABDlhkGy371r4WfZzVn1yT2mU8gvDV7SVLQ3zFhbl90V1Mw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651649236; a=rsa-sha256; cv=none; b=SuqIdaAKKRKmKROfJNAKiusMsfsQJbROAUBADkkP79KhfbLAWjnzEhdJLvltXgIlG8Rn1s h8oc2R05TAnExLT53ja6MLdJfdupOcEf6LnOgrbeeCCWQ2LtWdr/oLoCpYYPEmxbwZ2Iqc pjGRdtWzOGpuJJ2Kktfp+tcUXPGWdy5WtJu9KCbL15rhsc5/PRydMrVFfrrKV2bDrmwk8w iIb7B/Hg4GJOZbOn0x3rfXEiDzqBl0EA7X6WJruYXSJ/C1bsAsq9dhWJNoMvwTVmG6m02U cCdIe5MwGvLJMUHluNBvLFc4XFvWdoLaRwuoYjeERPHUjIQLhqdmuEUUX4O+yA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by hselasky: URL: https://cgit.FreeBSD.org/src/commit/?id=d730333c80fe8bc60770d093cbf12f473a065ca4 commit d730333c80fe8bc60770d093cbf12f473a065ca4 Author: Hans Petter Selasky AuthorDate: 2022-05-03 20:19:35 +0000 Commit: Hans Petter Selasky CommitDate: 2022-05-04 07:26:38 +0000 xhci(4): Properly define all basic USB port speeds. MFC after: 1 week Sponsored by: NVIDIA Networking --- 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 933a459170d1..2ad72a48293d 100644 --- a/sys/dev/usb/controller/xhci.c +++ b/sys/dev/usb/controller/xhci.c @@ -3479,13 +3479,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: @@ -3586,7 +3586,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 */