From owner-svn-src-stable-11@freebsd.org Sun May 17 02:40:50 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1F30B13A465; Sun, 17 May 2020 02:40:50 +0000 (UTC) (envelope-from asomers@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Pmbk02hjz3XyT; Sun, 17 May 2020 02:40:50 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EFD2D94C7; Sun, 17 May 2020 02:40:49 +0000 (UTC) (envelope-from asomers@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04H2enQV008131; Sun, 17 May 2020 02:40:49 GMT (envelope-from asomers@FreeBSD.org) Received: (from asomers@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04H2enQP008130; Sun, 17 May 2020 02:40:49 GMT (envelope-from asomers@FreeBSD.org) Message-Id: <202005170240.04H2enQP008130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: asomers set sender to asomers@FreeBSD.org using -f From: Alan Somers Date: Sun, 17 May 2020 02:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361128 - stable/11/tests/sys/geom/class/gate X-SVN-Group: stable-11 X-SVN-Commit-Author: asomers X-SVN-Commit-Paths: stable/11/tests/sys/geom/class/gate X-SVN-Commit-Revision: 361128 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 02:40:50 -0000 Author: asomers Date: Sun May 17 02:40:49 2020 New Revision: 361128 URL: https://svnweb.freebsd.org/changeset/base/361128 Log: MFC r360613: Fix intermittent cleanup failures in the ggated test Modified: stable/11/tests/sys/geom/class/gate/ggate_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/geom/class/gate/ggate_test.sh ============================================================================== --- stable/11/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:36:42 2020 (r361127) +++ stable/11/tests/sys/geom/class/gate/ggate_test.sh Sun May 17 02:40:49 2020 (r361128) @@ -194,7 +194,11 @@ common_cleanup() if [ -f "md.devs" ]; then while read test_md; do - mdconfig -d -u $test_md 2>/dev/null + # ggatec destroy doesn't release the provider + # synchronously, so we may need to retry destroying it. + while ! mdconfig -d -u $test_md; do + sleep 0.1 + done done < md.devs rm md.devs fi From owner-svn-src-stable-11@freebsd.org Sun May 17 11:13:13 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 65EC52CD5FB; Sun, 17 May 2020 11:13:13 +0000 (UTC) (envelope-from grehan@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Pzyx24x7z4Fx0; Sun, 17 May 2020 11:13:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 401A7F4F2; Sun, 17 May 2020 11:13:13 +0000 (UTC) (envelope-from grehan@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04HBDDAb028671; Sun, 17 May 2020 11:13:13 GMT (envelope-from grehan@FreeBSD.org) Received: (from grehan@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04HBDC3q028669; Sun, 17 May 2020 11:13:12 GMT (envelope-from grehan@FreeBSD.org) Message-Id: <202005171113.04HBDC3q028669@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: grehan set sender to grehan@FreeBSD.org using -f From: Peter Grehan Date: Sun, 17 May 2020 11:13:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361132 - stable/11/sys/amd64/vmm X-SVN-Group: stable-11 X-SVN-Commit-Author: grehan X-SVN-Commit-Paths: stable/11/sys/amd64/vmm X-SVN-Commit-Revision: 361132 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 May 2020 11:13:13 -0000 Author: grehan Date: Sun May 17 11:13:12 2020 New Revision: 361132 URL: https://svnweb.freebsd.org/changeset/base/361132 Log: MFC r361064 Hide host CPUID 0x15 TSC/Crystal ratio/freq info from guest In recent Linux (5.3+) and OpenBSD (6.6+) kernels, and with hosts that support CPUID 0x15, the local APIC frequency is determined directly from the reported crystal clock to avoid calibration against the 8254 timer. However, the local APIC frequency implemented by bhyve is 128MHz, where most h/w systems report frequencies around 25MHz. This shows up on OpenBSD guests as repeated keystrokes on the emulated PS2 keyboard when using VNC, since the kernel's timers are now much shorter. Fix by reporting all-zeroes for CPUID 0x15. This allows guests to fall back to using the 8254 to calibrate the local APIC frequency. Future work could be to compute values returned for 0x15 that would match the host TSC and bhyve local APIC frequency, though all dependencies on this would need to be examined (for example, Linux will start using 0x16 for some hosts). PR: 246321 Reported by: Jason Tubnor (and tested) Approved by: bz (mentor) Modified: stable/11/sys/amd64/vmm/x86.c stable/11/sys/amd64/vmm/x86.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/x86.c ============================================================================== --- stable/11/sys/amd64/vmm/x86.c Sun May 17 11:09:38 2020 (r361131) +++ stable/11/sys/amd64/vmm/x86.c Sun May 17 11:13:12 2020 (r361132) @@ -554,6 +554,18 @@ x86_emulate_cpuid(struct vm *vm, int vcpu_id, } break; + case CPUID_0000_0015: + /* + * Don't report CPU TSC/Crystal ratio and clock + * values since guests may use these to derive the + * local APIC frequency.. + */ + regs[0] = 0; + regs[1] = 0; + regs[2] = 0; + regs[3] = 0; + break; + case 0x40000000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, ®s[1], 4); Modified: stable/11/sys/amd64/vmm/x86.h ============================================================================== --- stable/11/sys/amd64/vmm/x86.h Sun May 17 11:09:38 2020 (r361131) +++ stable/11/sys/amd64/vmm/x86.h Sun May 17 11:13:12 2020 (r361132) @@ -39,6 +39,7 @@ #define CPUID_0000_000A (0xA) #define CPUID_0000_000B (0xB) #define CPUID_0000_000D (0xD) +#define CPUID_0000_0015 (0x15) #define CPUID_8000_0000 (0x80000000) #define CPUID_8000_0001 (0x80000001) #define CPUID_8000_0002 (0x80000002) From owner-svn-src-stable-11@freebsd.org Mon May 18 00:32:42 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id ED1F82FA540; Mon, 18 May 2020 00:32:42 +0000 (UTC) (envelope-from freqlabs@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QKjQ5x8Bz3g4C; Mon, 18 May 2020 00:32:42 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C6C6C19269; Mon, 18 May 2020 00:32:42 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I0WgQS034013; Mon, 18 May 2020 00:32:42 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I0WgdE034012; Mon, 18 May 2020 00:32:42 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005180032.04I0WgdE034012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Mon, 18 May 2020 00:32:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361147 - in stable: 11/sys/kern 12/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/kern 12/sys/kern X-SVN-Commit-Revision: 361147 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 00:32:43 -0000 Author: freqlabs Date: Mon May 18 00:32:42 2020 New Revision: 361147 URL: https://svnweb.freebsd.org/changeset/base/361147 Log: MFC r360900: vfs_exports: Tighten bounds and assert consistency of numsecflavors We know the value must be greater than 0 and less than MAXSECFLAVORS. Reject values outside this range in the initial check in vfs_export and add KASSERTs in the later consumers. Also check that we are called with one of either MNT_DELEXPORT or MNT_EXPORTED set. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24753 Modified: stable/11/sys/kern/vfs_export.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/kern/vfs_export.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/kern/vfs_export.c ============================================================================== --- stable/11/sys/kern/vfs_export.c Mon May 18 00:07:45 2020 (r361146) +++ stable/11/sys/kern/vfs_export.c Mon May 18 00:32:42 2020 (r361147) @@ -108,6 +108,11 @@ vfs_hang_addrlist(struct mount *mp, struct netexport * #endif int error; + KASSERT(argp->ex_numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(argp->ex_numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + /* * XXX: This routine converts from a `struct xucred' * (argp->ex_anon) to a `struct ucred' (np->netc_anon). This @@ -294,10 +299,14 @@ vfs_export(struct mount *mp, struct export_args *argp) struct netexport *nep; int error; - if (argp->ex_numsecflavors < 0 - || argp->ex_numsecflavors >= MAXSECFLAVORS) + if ((argp->ex_flags & (MNT_DELEXPORT | MNT_EXPORTED)) == 0) return (EINVAL); + if ((argp->ex_flags & MNT_EXPORTED) != 0 && + (argp->ex_numsecflavors <= 0 + || argp->ex_numsecflavors >= MAXSECFLAVORS)) + return (EINVAL); + error = 0; lockmgr(&mp->mnt_explock, LK_EXCLUSIVE, NULL); nep = mp->mnt_export; @@ -510,8 +519,13 @@ vfs_stdcheckexp(struct mount *mp, struct sockaddr *nam *extflagsp = np->netc_exflags; if ((*credanonp = np->netc_anon) != NULL) crhold(*credanonp); - if (numsecflavors) + if (numsecflavors) { *numsecflavors = np->netc_numsecflavors; + KASSERT(*numsecflavors > 0, + ("%s: numsecflavors <= 0", __func__)); + KASSERT(*numsecflavors < MAXSECFLAVORS, + ("%s: numsecflavors >= MAXSECFLAVORS", __func__)); + } if (secflavors) *secflavors = np->netc_secflavors; lockmgr(&mp->mnt_explock, LK_RELEASE, NULL); From owner-svn-src-stable-11@freebsd.org Mon May 18 08:42:11 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 789E513A370; Mon, 18 May 2020 08:42:11 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXZC2h7mz4Ntt; Mon, 18 May 2020 08:42:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 576351ED1E; Mon, 18 May 2020 08:42:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8gBPI035501; Mon, 18 May 2020 08:42:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8gAN4035495; Mon, 18 May 2020 08:42:10 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180842.04I8gAN4035495@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361153 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361153 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:42:11 -0000 Author: hselasky Date: Mon May 18 08:42:10 2020 New Revision: 361153 URL: https://svnweb.freebsd.org/changeset/base/361153 Log: MFC r360070: Add missing feature descriptions to hci_features2str(). The list of possible features in hccontrol/features2str() is incomplete. Refer to "Bluetooth Core Specification 5.2 Vol. 2 Part C. 3.3 Feature Mask Definition". Submitted by: Marc Veldman PR: 245354 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/info.c stable/11/usr.sbin/bluetooth/hccontrol/link_control.c stable/11/usr.sbin/bluetooth/hccontrol/node.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 08:42:10 2020 (r361153) @@ -78,7 +78,7 @@ hci_read_local_supported_features(int s, int argc, cha { ng_hci_read_local_features_rp rp; int n; - char buffer[1024]; + char buffer[2048]; n = sizeof(rp); if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, Modified: stable/11/usr.sbin/bluetooth/hccontrol/link_control.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/link_control.c Mon May 18 08:42:10 2020 (r361153) @@ -612,7 +612,7 @@ hci_read_remote_supported_features(int s, int argc, ch char b[512]; ng_hci_read_remote_features_cp cp; ng_hci_event_pkt_t *e = (ng_hci_event_pkt_t *) b; - char buffer[1024]; + char buffer[2048]; /* parse command parameters */ switch (argc) { Modified: stable/11/usr.sbin/bluetooth/hccontrol/node.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/node.c Mon May 18 08:42:10 2020 (r361153) @@ -153,7 +153,7 @@ hci_read_node_features(int s, int argc, char **argv) { struct ng_btsocket_hci_raw_node_features r; int n; - char buffer[1024]; + char buffer[2048]; memset(&r, 0, sizeof(r)); if (ioctl(s, SIOC_HCI_RAW_NODE_GET_FEATURES, &r, sizeof(r)) < 0) Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:40:39 2020 (r361152) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:42:10 2020 (r361153) @@ -289,7 +289,57 @@ hci_features2str(uint8_t *features, char *buffer, int /* 4 */ " ", /* 5 */ " ", /* 6 */ " ", - /* 7 */ " " + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ "
", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR ACL packets> " + }, + { /* byte 5 */ + /* 0 */ "<5-Slot EDR ACL packets> ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ "<3-Slot EDR eSCO packets> " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " }}; if (buffer != NULL && size > 0) { From owner-svn-src-stable-11@freebsd.org Mon May 18 08:44:50 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7EB3813AD95; Mon, 18 May 2020 08:44:50 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXdG2mP1z4P9C; Mon, 18 May 2020 08:44:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 5A1CC1EABF; Mon, 18 May 2020 08:44:50 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8io9m037456; Mon, 18 May 2020 08:44:50 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8io3e037453; Mon, 18 May 2020 08:44:50 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180844.04I8io3e037453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:44:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361156 - in stable/11: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: sys/netgraph/bluetooth/hci usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361156 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:44:50 -0000 Author: hselasky Date: Mon May 18 08:44:49 2020 New Revision: 361156 URL: https://svnweb.freebsd.org/changeset/base/361156 Log: MFC r360092: Bring HCI error messages up-to-date. See Bluetooth v5.6 core specification Vol.1 Part F: Controller error codes. Submitted by: Marc Veldman PR: 245737 Sponsored by: Mellanox Technologies Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c ============================================================================== --- stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:44:16 2020 (r361155) +++ stable/11/sys/netgraph/bluetooth/hci/ng_hci_misc.c Mon May 18 08:44:49 2020 (r361156) @@ -489,7 +489,35 @@ ng_hci_str_error(u_int16_t code) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Paring with unit key not supported", + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long", /* SHOULD ALWAYS BE LAST */ "Unknown error" }; Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:44:16 2020 (r361155) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:44:49 2020 (r361156) @@ -439,7 +439,35 @@ hci_status2str(int status) /* 0x26 */ "Unit key used", /* 0x27 */ "QoS is not supported", /* 0x28 */ "Instant passed", - /* 0x29 */ "Pairing with unit key not supported" + /* 0x29 */ "Pairing with unit key not supported", + /* 0x2a */ "Different Transaction Collision", + /* 0x2b */ "Unknown error (Reserved for future use)", + /* 0x2c */ "QoS Unacceptable Parameter", + /* 0x2d */ "QoS Rejected", + /* 0x2e */ "Channel Classification Not Supported", + /* 0x2f */ "Insufficient Security", + /* 0x30 */ "Parameter Out Of Mandatory Range", + /* 0x31 */ "Unknown error (Reserved for future use)", + /* 0x32 */ "Role Switch Pending", + /* 0x33 */ "Unknown error (Reserved for future use)", + /* 0x34 */ "Reserved Slot Violation", + /* 0x35 */ "Role Switch Failed", + /* 0x36 */ "Extended Inquiry Response Too Large", + /* 0x37 */ "Secure Simple Pairing Not Supported By Host", + /* 0x38 */ "Host Busy - Pairing", + /* 0x39 */ "Connection Rejected due to No Suitable Channel Found", + /* 0x3a */ "Controller Busy", + /* 0x3b */ "Unacceptable Connection Parameters", + /* 0x3c */ "Advertising Timeout", + /* 0x3d */ "Connection Terminated due to MIC Failure", + /* 0x3e */ "Connection Failed to be Established / Synchronization Timeout", + /* 0x3f */ "MAC Connection Failed", + /* 0x40 */ "Coarse Clock Adjustment Rejected but Will Try to Adjust Using Clock Dragging", + /* 0x41 */ "Type0 Submap Not Defined", + /* 0x42 */ "Unknown Advertising Identifier", + /* 0x43 */ "Limit Reached", + /* 0x44 */ "Operation Cancelled by Host", + /* 0x45 */ "Packet Too Long" }; return (status >= SIZE(t)? "Unknown error" : t[status]); From owner-svn-src-stable-11@freebsd.org Mon May 18 08:46:54 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1C03A13AF02; Mon, 18 May 2020 08:46:54 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXgd73VJz4Pjs; Mon, 18 May 2020 08:46:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id ED6F41ED23; Mon, 18 May 2020 08:46:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8krsh037779; Mon, 18 May 2020 08:46:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8krGF037776; Mon, 18 May 2020 08:46:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180846.04I8krGF037776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:46:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361159 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361159 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:46:54 -0000 Author: hselasky Date: Mon May 18 08:46:53 2020 New Revision: 361159 URL: https://svnweb.freebsd.org/changeset/base/361159 Log: MFC r360094: Improve printing of le features in hccontrol(8). Submitted by: Marc Veldman PR: 245739 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h stable/11/usr.sbin/bluetooth/hccontrol/le.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:46:17 2020 (r361158) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 08:46:53 2020 (r361159) @@ -73,6 +73,7 @@ char const * hci_ver2str (int); char const * hci_lmpver2str (int); char const * hci_manufacturer2str(int); char const * hci_features2str (uint8_t *, char *, int); +char const * hci_le_features2str (uint8_t *, char *, int); char const * hci_cc2str (int); char const * hci_con_state2str (int); char const * hci_status2str (int); Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:46:17 2020 (r361158) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:46:53 2020 (r361159) @@ -225,18 +225,37 @@ static int le_read_local_supported_features(int s, int argc ,char *argv[]) { ng_hci_le_read_local_supported_features_rp rp; - int e; int n = sizeof(rp); - e = hci_simple_request(s, + union { + uint64_t raw; + uint8_t octets[8]; + } le_features; + + char buffer[2048]; + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_READ_LOCAL_SUPPORTED_FEATURES), - (void *)&rp, &n); + (void *)&rp, &n) == ERROR) + return (ERROR); - printf("LOCAL SUPPORTED: %d %d %jx\n", e, rp.status, - (uintmax_t) rp.le_features); + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return 0; + le_features.raw = rp.le_features; + + fprintf(stdout, "LE Features: "); + for(int i = 0; i < 8; i++) + fprintf(stdout, " %#02x", le_features.octets[i]); + fprintf(stdout, "\n%s\n", hci_le_features2str(le_features.octets, + buffer, sizeof(buffer))); + fprintf(stdout, "\n"); + + return OK; } static int Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:46:17 2020 (r361158) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:46:53 2020 (r361159) @@ -371,6 +371,119 @@ done: } /* hci_features2str */ char const * +hci_le_features2str(uint8_t *features, char *buffer, int size) +{ + static char const * const t[][8] = { + { /* byte 0 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 1 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 2 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 5 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }}; + + if (buffer != NULL && size > 0) { + int n, i, len0, len1; + + memset(buffer, 0, size); + len1 = 0; + + for (n = 0; n < SIZE(t); n++) { + for (i = 0; i < SIZE(t[n]); i++) { + len0 = strlen(buffer); + if (len0 >= size) + goto done; + + if (features[n] & (1 << i)) { + if (len1 + strlen(t[n][i]) > 60) { + len1 = 0; + buffer[len0 - 1] = '\n'; + } + + len1 += strlen(t[n][i]); + strncat(buffer, t[n][i], size - len0); + } + } + } + } +done: + return (buffer); +} + +char const * hci_cc2str(int cc) { static char const * const t[] = { From owner-svn-src-stable-11@freebsd.org Mon May 18 08:52:41 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 6A7F613AFAC; Mon, 18 May 2020 08:52:41 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXpK2DmVz4Q9y; Mon, 18 May 2020 08:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 47EE81ECEB; Mon, 18 May 2020 08:52:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8qfdD043769; Mon, 18 May 2020 08:52:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8qfNq043768; Mon, 18 May 2020 08:52:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180852.04I8qfNq043768@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361161 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361161 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:52:41 -0000 Author: hselasky Date: Mon May 18 08:52:40 2020 New Revision: 361161 URL: https://svnweb.freebsd.org/changeset/base/361161 Log: MFC r360095: Fix cut and paste off-by-one error in hccontrol(8). Make sure strncpy() doesn't write beyond its given buffer. PR: 245739 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:52:06 2020 (r361160) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:52:40 2020 (r361161) @@ -134,6 +134,7 @@ hci_hmode2str(int mode, char *buffer, int size) int n; memset(buffer, 0, size); + size--; for (n = 0; n < SIZE(t); n++) { int len = strlen(buffer); @@ -347,6 +348,7 @@ hci_features2str(uint8_t *features, char *buffer, int memset(buffer, 0, size); len1 = 0; + size--; for (n = 0; n < SIZE(t); n++) { for (i = 0; i < SIZE(t[n]); i++) { @@ -460,6 +462,7 @@ hci_le_features2str(uint8_t *features, char *buffer, i memset(buffer, 0, size); len1 = 0; + size--; for (n = 0; n < SIZE(t); n++) { for (i = 0; i < SIZE(t[n]); i++) { From owner-svn-src-stable-11@freebsd.org Mon May 18 08:56:23 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1FEC813B4B2; Mon, 18 May 2020 08:56:23 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXtb04l8z4QmB; Mon, 18 May 2020 08:56:23 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F20BE1ED62; Mon, 18 May 2020 08:56:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8uMte044140; Mon, 18 May 2020 08:56:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8uMou044139; Mon, 18 May 2020 08:56:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180856.04I8uMou044139@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:56:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361163 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361163 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:56:23 -0000 Author: hselasky Date: Mon May 18 08:56:22 2020 New Revision: 361163 URL: https://svnweb.freebsd.org/changeset/base/361163 Log: MFC r360115: Allow the ERR_CAST() function in the LinuxKPI to take a const void pointer. No functional change. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/err.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/err.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/err.h Mon May 18 08:55:49 2020 (r361162) +++ stable/11/sys/compat/linuxkpi/common/include/linux/err.h Mon May 18 08:56:22 2020 (r361163) @@ -31,6 +31,8 @@ #ifndef _LINUX_ERR_H_ #define _LINUX_ERR_H_ +#include + #include #define MAX_ERRNO 4095 @@ -62,9 +64,9 @@ IS_ERR_OR_NULL(const void *ptr) } static inline void * -ERR_CAST(void *ptr) +ERR_CAST(const void *ptr) { - return (void *)ptr; + return __DECONST(void *, ptr); } static inline int From owner-svn-src-stable-11@freebsd.org Mon May 18 08:57:56 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17D1313B2FF; Mon, 18 May 2020 08:57:56 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXwM6YCSz4Qxk; Mon, 18 May 2020 08:57:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DC12F1F10C; Mon, 18 May 2020 08:57:55 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8vt0t044341; Mon, 18 May 2020 08:57:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8vtWA044339; Mon, 18 May 2020 08:57:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180857.04I8vtWA044339@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:57:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361165 - in stable/11: sys/netgraph/bluetooth/hci sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11: sys/netgraph/bluetooth/hci sys/netgraph/bluetooth/include usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361165 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:57:56 -0000 Author: hselasky Date: Mon May 18 08:57:55 2020 New Revision: 361165 URL: https://svnweb.freebsd.org/changeset/base/361165 Log: MFC r360116: Substitute le_read_supported_status with le_read_supported_states. Refer to bluetooth core v5.2 specifications Vol4. Part E. 7.8.27. PR: 245763 Submitted by: Marc Veldman Sponsored by: Mellanox Technologies Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c stable/11/sys/netgraph/bluetooth/include/ng_hci.h stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c ============================================================================== --- stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Mon May 18 08:57:21 2020 (r361164) +++ stable/11/sys/netgraph/bluetooth/hci/ng_hci_cmds.c Mon May 18 08:57:55 2020 (r361165) @@ -840,7 +840,7 @@ process_le_params(ng_hci_unit_p unit, u_int16_t ocf, case NG_HCI_OCF_LE_RAND: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_REPLY: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY: - case NG_HCI_OCF_LE_READ_SUPPORTED_STATUS: + case NG_HCI_OCF_LE_READ_SUPPORTED_STATES: case NG_HCI_OCF_LE_RECEIVER_TEST: case NG_HCI_OCF_LE_TRANSMITTER_TEST: case NG_HCI_OCF_LE_TEST_END: @@ -911,7 +911,7 @@ process_le_status(ng_hci_unit_p unit,ng_hci_command_st case NG_HCI_OCF_LE_RAND: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_REPLY: case NG_HCI_OCF_LE_LONG_TERM_KEY_REQUEST_NEGATIVE_REPLY: - case NG_HCI_OCF_LE_READ_SUPPORTED_STATUS: + case NG_HCI_OCF_LE_READ_SUPPORTED_STATES: case NG_HCI_OCF_LE_RECEIVER_TEST: case NG_HCI_OCF_LE_TRANSMITTER_TEST: case NG_HCI_OCF_LE_TEST_END: Modified: stable/11/sys/netgraph/bluetooth/include/ng_hci.h ============================================================================== --- stable/11/sys/netgraph/bluetooth/include/ng_hci.h Mon May 18 08:57:21 2020 (r361164) +++ stable/11/sys/netgraph/bluetooth/include/ng_hci.h Mon May 18 08:57:55 2020 (r361165) @@ -1667,12 +1667,12 @@ typedef struct { }__attribute__ ((packed)) ng_hci_le_long_term_key_request_negative_reply_rp; -#define NG_HCI_OCF_LE_READ_SUPPORTED_STATUS 0x001c +#define NG_HCI_OCF_LE_READ_SUPPORTED_STATES 0x001c /*No command parameter*/ typedef struct { u_int8_t status; - u_int64_t le_status; -}__attribute__ ((packed)) ng_hci_le_read_supported_status_rp; + u_int64_t le_states; +}__attribute__ ((packed)) ng_hci_le_read_supported_states_rp; #define NG_HCI_OCF_LE_RECEIVER_TEST 0x001d typedef struct{ Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:57:21 2020 (r361164) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 08:57:55 2020 (r361165) @@ -52,7 +52,7 @@ static int le_set_scan_param(int s, int argc, char *ar static int le_set_scan_enable(int s, int argc, char *argv[]); static int parse_param(int argc, char *argv[], char *buf, int *len); static int le_set_scan_response(int s, int argc, char *argv[]); -static int le_read_supported_status(int s, int argc, char *argv[]); +static int le_read_supported_states(int s, int argc, char *argv[]); static int le_read_local_supported_features(int s, int argc ,char *argv[]); static int set_le_event_mask(int s, uint64_t mask); static int set_event_mask(int s, uint64_t mask); @@ -259,20 +259,26 @@ le_read_local_supported_features(int s, int argc ,char } static int -le_read_supported_status(int s, int argc, char *argv[]) +le_read_supported_states(int s, int argc, char *argv[]) { - ng_hci_le_read_supported_status_rp rp; - int e; + ng_hci_le_read_supported_states_rp rp; int n = sizeof(rp); - e = hci_simple_request(s, NG_HCI_OPCODE( + if (hci_simple_request(s, NG_HCI_OPCODE( NG_HCI_OGF_LE, - NG_HCI_OCF_LE_READ_SUPPORTED_STATUS), - (void *)&rp, &n); + NG_HCI_OCF_LE_READ_SUPPORTED_STATES), + (void *)&rp, &n) == ERROR) + return (ERROR); - printf("LE_STATUS: %d %d %jx\n", e, rp.status, (uintmax_t)rp.le_status); + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } - return 0; + fprintf(stdout, "LE States: %jx\n", rp.le_states); + + return (OK); } static int @@ -347,11 +353,11 @@ struct hci_command le_commands[] = { &le_read_local_supported_features, }, { - "le_read_supported_status", - "le_read_supported_status\n" + "le_read_supported_states", + "le_read_supported_states\n" "read supported status" , - &le_read_supported_status, + &le_read_supported_states, }, { "le_set_scan_response", From owner-svn-src-stable-11@freebsd.org Mon May 18 08:59:15 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 95BD313B73F; Mon, 18 May 2020 08:59:15 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QXxv29Pjz4RFt; Mon, 18 May 2020 08:59:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2B4151F094; Mon, 18 May 2020 08:59:15 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I8xFau044544; Mon, 18 May 2020 08:59:15 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I8xFtV044543; Mon, 18 May 2020 08:59:15 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180859.04I8xFtV044543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 08:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361167 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361167 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 08:59:15 -0000 Author: hselasky Date: Mon May 18 08:59:14 2020 New Revision: 361167 URL: https://svnweb.freebsd.org/changeset/base/361167 Log: MFC r360172: Update string tables in hccontrol(8). Submitted by: Marc Veldman PR: 245796 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:58:41 2020 (r361166) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 08:59:14 2020 (r361167) @@ -160,7 +160,10 @@ hci_ver2str(int ver) /* 0x05 */ "Bluetooth HCI Specification 3.0", /* 0x06 */ "Bluetooth HCI Specification 4.0", /* 0x07 */ "Bluetooth HCI Specification 4.1", - /* 0x08 */ "Bluetooth HCI Specification 4.2" + /* 0x08 */ "Bluetooth HCI Specification 4.2", + /* 0x09 */ "Bluetooth HCI Specification 5.0", + /* 0x0a */ "Bluetooth HCI Specification 5.1", + /* 0x0b */ "Bluetooth HCI Specification 5.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -175,10 +178,13 @@ hci_lmpver2str(int ver) /* 0x02 */ "Bluetooth LMP 1.2", /* 0x03 */ "Bluetooth LMP 2.0", /* 0x04 */ "Bluetooth LMP 2.1", - /* 0x04 */ "Bluetooth LMP 3.0", - /* 0x04 */ "Bluetooth LMP 4.0", - /* 0x04 */ "Bluetooth LMP 4.1", - /* 0x04 */ "Bluetooth LMP 4.2" + /* 0x05 */ "Bluetooth LMP 3.0", + /* 0x06 */ "Bluetooth LMP 4.0", + /* 0x07 */ "Bluetooth LMP 4.1", + /* 0x08 */ "Bluetooth LMP 4.2", + /* 0x09 */ "Bluetooth LMP 5.0", + /* 0x0a */ "Bluetooth LMP 5.1", + /* 0x0b */ "Bluetooth LMP 5.2" }; return (ver >= SIZE(t)? "?" : t[ver]); @@ -198,7 +204,7 @@ hci_manufacturer2str(int m) /* 0007 */ "Lucent", /* 0008 */ "Motorola", /* 0009 */ "Infineon Technologies AG", - /* 0010 */ "Cambridge Silicon Radio", + /* 0010 */ "Qualcomm Technologies International, Ltd. (QTIL)", /* 0011 */ "Silicon Wave", /* 0012 */ "Digianswer A/S", /* 0013 */ "Texas Instruments Inc.", @@ -213,7 +219,7 @@ hci_manufacturer2str(int m) /* 0022 */ "KC Technology Inc.", /* 0023 */ "Newlogic", /* 0024 */ "Transilica, Inc.", - /* 0025 */ "Rohde & Schwartz GmbH & Co. KG", + /* 0025 */ "Rohde & Schwarz GmbH & Co. KG", /* 0026 */ "TTPCom Limited", /* 0027 */ "Signia Technologies, Inc.", /* 0028 */ "Conexant Systems Inc.", @@ -225,7 +231,7 @@ hci_manufacturer2str(int m) /* 0034 */ "NEC Corporation", /* 0035 */ "WavePlus Technology Co., Ltd.", /* 0036 */ "Alcatel", - /* 0037 */ "Philips Semiconductors", + /* 0037 */ "NXP Semiconductors (formerly Philips Semiconductors)", /* 0038 */ "C Technologies", /* 0039 */ "Open Interface", /* 0040 */ "R F Micro Devices", @@ -237,22 +243,2187 @@ hci_manufacturer2str(int m) /* 0046 */ "Norwood Systems", /* 0047 */ "MewTel Technology Inc.", /* 0048 */ "ST Microelectronics", - /* 0049 */ "Synopsys", + /* 0049 */ "Synopsys, Inc.", /* 0050 */ "Red-M (Communications) Ltd", /* 0051 */ "Commil Ltd", /* 0052 */ "Computer Access Technology Corporation (CATC)", /* 0053 */ "Eclipse (HQ Espana) S.L.", - /* 0054 */ "Renesas Technology Corp.", + /* 0054 */ "Renesas Electronics Corporation", /* 0055 */ "Mobilian Corporation", - /* 0056 */ "Terax", + /* 0056 */ "Syntronix Corporation", /* 0057 */ "Integrated System Solution Corp.", - /* 0058 */ "Matsushita Electric Industrial Co., Ltd.", + /* 0058 */ "Panasonic Corporation (formerly Matsushita Electric Industrial Co., Ltd.)", /* 0059 */ "Gennum Corporation", - /* 0060 */ "Research In Motion", + /* 0060 */ "BlackBerry Limited (formerly Research In Motion)", /* 0061 */ "IPextreme, Inc.", /* 0062 */ "Systems and Chips, Inc", /* 0063 */ "Bluetooth SIG, Inc", - /* 0064 */ "Seiko Epson Corporation" + /* 0064 */ "Seiko Epson Corporation", + /* 0065 */ "Integrated Silicon Solution Taiwan, Inc.", + /* 0066 */ "CONWISE Technology Corporation Ltd", + /* 0067 */ "PARROT AUTOMOTIVE SAS", + /* 0068 */ "Socket Mobile", + /* 0069 */ "Atheros Communications, Inc.", + /* 0070 */ "MediaTek, Inc.", + /* 0071 */ "Bluegiga", + /* 0072 */ "Marvell Technology Group Ltd.", + /* 0073 */ "3DSP Corporation", + /* 0074 */ "Accel Semiconductor Ltd.", + /* 0075 */ "Continental Automotive Systems", + /* 0076 */ "Apple, Inc.", + /* 0077 */ "Staccato Communications, Inc.", + /* 0078 */ "Avago Technologies", + /* 0079 */ "APT Ltd.", + /* 0080 */ "SiRF Technology, Inc.", + /* 0081 */ "Tzero Technologies, Inc.", + /* 0082 */ "J&M Corporation", + /* 0083 */ "Free2move AB", + /* 0084 */ "3DiJoy Corporation", + /* 0085 */ "Plantronics, Inc.", + /* 0086 */ "Sony Ericsson Mobile Communications", + /* 0087 */ "Harman International Industries, Inc.", + /* 0088 */ "Vizio, Inc.", + /* 0089 */ "Nordic Semiconductor ASA", + /* 0090 */ "EM Microelectronic-Marin SA", + /* 0091 */ "Ralink Technology Corporation", + /* 0092 */ "Belkin International, Inc.", + /* 0093 */ "Realtek Semiconductor Corporation", + /* 0094 */ "Stonestreet One, LLC", + /* 0095 */ "Wicentric, Inc.", + /* 0096 */ "RivieraWaves S.A.S", + /* 0097 */ "RDA Microelectronics", + /* 0098 */ "Gibson Guitars", + /* 0099 */ "MiCommand Inc.", + /* 0100 */ "Band XI International, LLC", + /* 0101 */ "Hewlett-Packard Company", + /* 0102 */ "9Solutions Oy", + /* 0103 */ "GN Netcom A/S", + /* 0104 */ "General Motors", + /* 0105 */ "A&D Engineering, Inc.", + /* 0106 */ "MindTree Ltd.", + /* 0107 */ "Polar Electro OY", + /* 0108 */ "Beautiful Enterprise Co., Ltd.", + /* 0109 */ "BriarTek, Inc", + /* 0110 */ "Summit Data Communications, Inc.", + /* 0111 */ "Sound ID", + /* 0112 */ "Monster, LLC", + /* 0113 */ "connectBlue AB", + /* 0114 */ "ShangHai Super Smart Electronics Co. Ltd.", + /* 0115 */ "Group Sense Ltd.", + /* 0116 */ "Zomm, LLC", + /* 0117 */ "Samsung Electronics Co. Ltd.", + /* 0118 */ "Creative Technology Ltd.", + /* 0119 */ "Laird Technologies", + /* 0120 */ "Nike, Inc.", + /* 0121 */ "lesswire AG", + /* 0122 */ "MStar Semiconductor, Inc.", + /* 0123 */ "Hanlynn Technologies", + /* 0124 */ "A & R Cambridge", + /* 0125 */ "Seers Technology Co., Ltd.", + /* 0126 */ "Sports Tracking Technologies Ltd.", + /* 0127 */ "Autonet Mobile", + /* 0128 */ "DeLorme Publishing Company, Inc.", + /* 0129 */ "WuXi Vimicro", + /* 0130 */ "Sennheiser Communications A/S", + /* 0131 */ "TimeKeeping Systems, Inc.", + /* 0132 */ "Ludus Helsinki Ltd.", + /* 0133 */ "BlueRadios, Inc.", + /* 0134 */ "Equinux AG", + /* 0135 */ "Garmin International, Inc.", + /* 0136 */ "Ecotest", + /* 0137 */ "GN ReSound A/S", + /* 0138 */ "Jawbone", + /* 0139 */ "Topcon Positioning Systems, LLC", + /* 0140 */ "Gimbal Inc. (formerly Qualcomm Labs, Inc. and Qualcomm Retail Solutions, Inc.)", + /* 0141 */ "Zscan Software", + /* 0142 */ "Quintic Corp", + /* 0143 */ "Telit Wireless Solutions GmbH (formerly Stollmann E+V GmbH)", + /* 0144 */ "Funai Electric Co., Ltd.", + /* 0145 */ "Advanced PANMOBIL systems GmbH & Co. KG", + /* 0146 */ "ThinkOptics, Inc.", + /* 0147 */ "Universal Electronics, Inc.", + /* 0148 */ "Airoha Technology Corp.", + /* 0149 */ "NEC Lighting, Ltd.", + /* 0150 */ "ODM Technology, Inc.", + /* 0151 */ "ConnecteDevice Ltd.", + /* 0152 */ "zero1.tv GmbH", + /* 0153 */ "i.Tech Dynamic Global Distribution Ltd.", + /* 0154 */ "Alpwise", + /* 0155 */ "Jiangsu Toppower Automotive Electronics Co., Ltd.", + /* 0156 */ "Colorfy, Inc.", + /* 0157 */ "Geoforce Inc.", + /* 0158 */ "Bose Corporation", + /* 0159 */ "Suunto Oy", + /* 0160 */ "Kensington Computer Products Group", + /* 0161 */ "SR-Medizinelektronik", + /* 0162 */ "Vertu Corporation Limited", + /* 0163 */ "Meta Watch Ltd.", + /* 0164 */ "LINAK A/S", + /* 0165 */ "OTL Dynamics LLC", + /* 0166 */ "Panda Ocean Inc.", + /* 0167 */ "Visteon Corporation", + /* 0168 */ "ARP Devices Limited", + /* 0169 */ "MARELLI EUROPE S.P.A. (formerly Magneti Marelli S.p.A.)", + /* 0170 */ "CAEN RFID srl", + /* 0171 */ "Ingenieur-Systemgruppe Zahn GmbH", + /* 0172 */ "Green Throttle Games", + /* 0173 */ "Peter Systemtechnik GmbH", + /* 0174 */ "Omegawave Oy", + /* 0175 */ "Cinetix", + /* 0176 */ "Passif Semiconductor Corp", + /* 0177 */ "Saris Cycling Group, Inc", + /* 0178 */ "Bekey A/S", + /* 0179 */ "Clarinox Technologies Pty. Ltd.", + /* 0180 */ "BDE Technology Co., Ltd.", + /* 0181 */ "Swirl Networks", + /* 0182 */ "Meso international", + /* 0183 */ "TreLab Ltd", + /* 0184 */ "Qualcomm Innovation Center, Inc. (QuIC)", + /* 0185 */ "Johnson Controls, Inc.", + /* 0186 */ "Starkey Laboratories Inc.", + /* 0187 */ "S-Power Electronics Limited", + /* 0188 */ "Ace Sensor Inc", + /* 0189 */ "Aplix Corporation", + /* 0190 */ "AAMP of America", + /* 0191 */ "Stalmart Technology Limited", + /* 0192 */ "AMICCOM Electronics Corporation", + /* 0193 */ "Shenzhen Excelsecu Data Technology Co.,Ltd", + /* 0194 */ "Geneq Inc.", + /* 0195 */ "adidas AG", + /* 0196 */ "LG Electronics", + /* 0197 */ "Onset Computer Corporation", + /* 0198 */ "Selfly BV", + /* 0199 */ "Quuppa Oy.", + /* 0200 */ "GeLo Inc", + /* 0201 */ "Evluma", + /* 0202 */ "MC10", + /* 0203 */ "Binauric SE", + /* 0204 */ "Beats Electronics", + /* 0205 */ "Microchip Technology Inc.", + /* 0206 */ "Elgato Systems GmbH", + /* 0207 */ "ARCHOS SA", + /* 0208 */ "Dexcom, Inc.", + /* 0209 */ "Polar Electro Europe B.V.", + /* 0210 */ "Dialog Semiconductor B.V.", + /* 0211 */ "Taixingbang Technology (HK) Co,. LTD.", + /* 0212 */ "Kawantech", + /* 0213 */ "Austco Communication Systems", + /* 0214 */ "Timex Group USA, Inc.", + /* 0215 */ "Qualcomm Technologies, Inc.", + /* 0216 */ "Qualcomm Connected Experiences, Inc.", + /* 0217 */ "Voyetra Turtle Beach", + /* 0218 */ "txtr GmbH", + /* 0219 */ "Biosentronics", + /* 0220 */ "Procter & Gamble", + /* 0221 */ "Hosiden Corporation", + /* 0222 */ "Muzik LLC", + /* 0223 */ "Misfit Wearables Corp", + /* 0224 */ "Google", + /* 0225 */ "Danlers Ltd", + /* 0226 */ "Semilink Inc", + /* 0227 */ "inMusic Brands, Inc", + /* 0228 */ "L.S. Research Inc.", + /* 0229 */ "Eden Software Consultants Ltd.", + /* 0230 */ "Freshtemp", + /* 0231 */ "KS Technologies", + /* 0232 */ "ACTS Technologies", + /* 0233 */ "Vtrack Systems", + /* 0234 */ "Nielsen-Kellerman Company", + /* 0235 */ "Server Technology Inc.", + /* 0236 */ "BioResearch Associates", + /* 0237 */ "Jolly Logic, LLC", + /* 0238 */ "Above Average Outcomes, Inc.", + /* 0239 */ "Bitsplitters GmbH", + /* 0240 */ "PayPal, Inc.", + /* 0241 */ "Witron Technology Limited", + /* 0242 */ "Morse Project Inc.", + /* 0243 */ "Kent Displays Inc.", + /* 0244 */ "Nautilus Inc.", + /* 0245 */ "Smartifier Oy", + /* 0246 */ "Elcometer Limited", + /* 0247 */ "VSN Technologies, Inc.", + /* 0248 */ "AceUni Corp., Ltd.", + /* 0249 */ "StickNFind", + /* 0250 */ "Crystal Code AB", + /* 0251 */ "KOUKAAM a.s.", + /* 0252 */ "Delphi Corporation", + /* 0253 */ "ValenceTech Limited", + /* 0254 */ "Stanley Black and Decker", + /* 0255 */ "Typo Products, LLC", + /* 0256 */ "TomTom International BV", + /* 0257 */ "Fugoo, Inc.", + /* 0258 */ "Keiser Corporation", + /* 0259 */ "Bang & Olufsen A/S", + /* 0260 */ "PLUS Location Systems Pty Ltd", + /* 0261 */ "Ubiquitous Computing Technology Corporation", + /* 0262 */ "Innovative Yachtter Solutions", + /* 0263 */ "William Demant Holding A/S", + /* 0264 */ "Chicony Electronics Co., Ltd.", + /* 0265 */ "Atus BV", + /* 0266 */ "Codegate Ltd", + /* 0267 */ "ERi, Inc", + /* 0268 */ "Transducers Direct, LLC", + /* 0269 */ "DENSO TEN LIMITED (formerly Fujitsu Ten LImited)", + /* 0270 */ "Audi AG", + /* 0271 */ "HiSilicon Technologies CO., LIMITED", + /* 0272 */ "Nippon Seiki Co., Ltd.", + /* 0273 */ "Steelseries ApS", + /* 0274 */ "Visybl Inc.", + /* 0275 */ "Openbrain Technologies, Co., Ltd.", + /* 0276 */ "Xensr", + /* 0277 */ "e.solutions", + /* 0278 */ "10AK Technologies", + /* 0279 */ "Wimoto Technologies Inc", + /* 0280 */ "Radius Networks, Inc.", + /* 0281 */ "Wize Technology Co., Ltd.", + /* 0282 */ "Qualcomm Labs, Inc.", + /* 0283 */ "Hewlett Packard Enterprise", + /* 0284 */ "Baidu", + /* 0285 */ "Arendi AG", + /* 0286 */ "Skoda Auto a.s.", + /* 0287 */ "Volkswagen AG", + /* 0288 */ "Porsche AG", + /* 0289 */ "Sino Wealth Electronic Ltd.", + /* 0290 */ "AirTurn, Inc.", + /* 0291 */ "Kinsa, Inc", + /* 0292 */ "HID Global", + /* 0293 */ "SEAT es", + /* 0294 */ "Promethean Ltd.", + /* 0295 */ "Salutica Allied Solutions", + /* 0296 */ "GPSI Group Pty Ltd", + /* 0297 */ "Nimble Devices Oy", + /* 0298 */ "Changzhou Yongse Infotech Co., Ltd.", + /* 0299 */ "SportIQ", + /* 0300 */ "TEMEC Instruments B.V.", + /* 0301 */ "Sony Corporation", + /* 0302 */ "ASSA ABLOY", + /* 0303 */ "Clarion Co. Inc.", + /* 0304 */ "Warehouse Innovations", + /* 0305 */ "Cypress Semiconductor", + /* 0306 */ "MADS Inc", + /* 0307 */ "Blue Maestro Limited", + /* 0308 */ "Resolution Products, Ltd.", + /* 0309 */ "Aireware LLC", + /* 0310 */ "Silvair, Inc.", + /* 0311 */ "Prestigio Plaza Ltd.", + /* 0312 */ "NTEO Inc.", + /* 0313 */ "Focus Systems Corporation", + /* 0314 */ "Tencent Holdings Ltd.", + /* 0315 */ "Allegion", + /* 0316 */ "Murata Manufacturing Co., Ltd.", + /* 0317 */ "WirelessWERX", + /* 0318 */ "Nod, Inc.", + /* 0319 */ "B&B Manufacturing Company", + /* 0320 */ "Alpine Electronics (China) Co., Ltd", + /* 0321 */ "FedEx Services", + /* 0322 */ "Grape Systems Inc.", + /* 0323 */ "Bkon Connect", + /* 0324 */ "Lintech GmbH", + /* 0325 */ "Novatel Wireless", + /* 0326 */ "Ciright", + /* 0327 */ "Mighty Cast, Inc.", + /* 0328 */ "Ambimat Electronics", + /* 0329 */ "Perytons Ltd.", + /* 0330 */ "Tivoli Audio, LLC", + /* 0331 */ "Master Lock", + /* 0332 */ "Mesh-Net Ltd", + /* 0333 */ "HUIZHOU DESAY SV AUTOMOTIVE CO., LTD.", + /* 0334 */ "Tangerine, Inc.", + /* 0335 */ "B&W Group Ltd.", + /* 0336 */ "Pioneer Corporation", + /* 0337 */ "OnBeep", + /* 0338 */ "Vernier Software & Technology", + /* 0339 */ "ROL Ergo", + /* 0340 */ "Pebble Technology", + /* 0341 */ "NETATMO", + /* 0342 */ "Accumulate AB", + /* 0343 */ "Anhui Huami Information Technology Co., Ltd.", + /* 0344 */ "Inmite s.r.o.", + /* 0345 */ "ChefSteps, Inc.", + /* 0346 */ "micas AG", + /* 0347 */ "Biomedical Research Ltd.", + /* 0348 */ "Pitius Tec S.L.", + /* 0349 */ "Estimote, Inc.", + /* 0350 */ "Unikey Technologies, Inc.", + /* 0351 */ "Timer Cap Co.", + /* 0352 */ "AwoX", + /* 0353 */ "yikes", + /* 0354 */ "MADSGlobalNZ Ltd.", + /* 0355 */ "PCH International", + /* 0356 */ "Qingdao Yeelink Information Technology Co., Ltd.", + /* 0357 */ "Milwaukee Tool (Formally Milwaukee Electric Tools)", + /* 0358 */ "MISHIK Pte Ltd", + /* 0359 */ "Ascensia Diabetes Care US Inc.", + /* 0360 */ "Spicebox LLC", + /* 0361 */ "emberlight", + /* 0362 */ "Cooper-Atkins Corporation", + /* 0363 */ "Qblinks", + /* 0364 */ "MYSPHERA", + /* 0365 */ "LifeScan Inc", + /* 0366 */ "Volantic AB", + /* 0367 */ "Podo Labs, Inc", + /* 0368 */ "Roche Diabetes Care AG", + /* 0369 */ "Amazon.com Services, LLC (formerly Amazon Fulfillment Service)", + /* 0370 */ "Connovate Technology Private Limited", + /* 0371 */ "Kocomojo, LLC", + /* 0372 */ "Everykey Inc.", + /* 0373 */ "Dynamic Controls", + /* 0374 */ "SentriLock", + /* 0375 */ "I-SYST inc.", + /* 0376 */ "CASIO COMPUTER CO., LTD.", + /* 0377 */ "LAPIS Semiconductor Co., Ltd.", + /* 0378 */ "Telemonitor, Inc.", + /* 0379 */ "taskit GmbH", + /* 0380 */ "Daimler AG", + /* 0381 */ "BatAndCat", + /* 0382 */ "BluDotz Ltd", + /* 0383 */ "XTel Wireless ApS", + /* 0384 */ "Gigaset Communications GmbH", + /* 0385 */ "Gecko Health Innovations, Inc.", + /* 0386 */ "HOP Ubiquitous", + /* 0387 */ "Walt Disney", + /* 0388 */ "Nectar", + /* 0389 */ "bel'apps LLC", + /* 0390 */ "CORE Lighting Ltd", + /* 0391 */ "Seraphim Sense Ltd", + /* 0392 */ "Unico RBC", + /* 0393 */ "Physical Enterprises Inc.", + /* 0394 */ "Able Trend Technology Limited", + /* 0395 */ "Konica Minolta, Inc.", + /* 0396 */ "Wilo SE", + /* 0397 */ "Extron Design Services", + /* 0398 */ "Fitbit, Inc.", + /* 0399 */ "Fireflies Systems", + /* 0400 */ "Intelletto Technologies Inc.", + /* 0401 */ "FDK CORPORATION", + /* 0402 */ "Cloudleaf, Inc", + /* 0403 */ "Maveric Automation LLC", + /* 0404 */ "Acoustic Stream Corporation", + /* 0405 */ "Zuli", + /* 0406 */ "Paxton Access Ltd", + /* 0407 */ "WiSilica Inc.", + /* 0408 */ "VENGIT Korlatolt Felelossegu Tarsasag", + /* 0409 */ "SALTO SYSTEMS S.L.", + /* 0410 */ "TRON Forum (formerly T-Engine Forum)", + /* 0411 */ "CUBETECH s.r.o.", + /* 0412 */ "Cokiya Incorporated", + /* 0413 */ "CVS Health", + /* 0414 */ "Ceruus", + /* 0415 */ "Strainstall Ltd", + /* 0416 */ "Channel Enterprises (HK) Ltd.", + /* 0417 */ "FIAMM", + /* 0418 */ "GIGALANE.CO.,LTD", + /* 0419 */ "EROAD", + /* 0420 */ "Mine Safety Appliances", + /* 0421 */ "Icon Health and Fitness", + /* 0422 */ "Wille Engineering (formely as Asandoo GmbH)", + /* 0423 */ "ENERGOUS CORPORATION", + /* 0424 */ "Taobao", + /* 0425 */ "Canon Inc.", + /* 0426 */ "Geophysical Technology Inc.", + /* 0427 */ "Facebook, Inc.", + /* 0428 */ "Trividia Health, Inc.", + /* 0429 */ "FlightSafety International", + /* 0430 */ "Earlens Corporation", + /* 0431 */ "Sunrise Micro Devices, Inc.", + /* 0432 */ "Star Micronics Co., Ltd.", + /* 0433 */ "Netizens Sp. z o.o.", + /* 0434 */ "Nymi Inc.", + /* 0435 */ "Nytec, Inc.", + /* 0436 */ "Trineo Sp. z o.o.", + /* 0437 */ "Nest Labs Inc.", + /* 0438 */ "LM Technologies Ltd", + /* 0439 */ "General Electric Company", + /* 0440 */ "i+D3 S.L.", + /* 0441 */ "HANA Micron", + /* 0442 */ "Stages Cycling LLC", + /* 0443 */ "Cochlear Bone Anchored Solutions AB", + /* 0444 */ "SenionLab AB", + /* 0445 */ "Syszone Co., Ltd", + /* 0446 */ "Pulsate Mobile Ltd.", + /* 0447 */ "Hong Kong HunterSun Electronic Limited", + /* 0448 */ "pironex GmbH", + /* 0449 */ "BRADATECH Corp.", + /* 0450 */ "Transenergooil AG", + /* 0451 */ "Bunch", + /* 0452 */ "DME Microelectronics", + /* 0453 */ "Bitcraze AB", + /* 0454 */ "HASWARE Inc.", + /* 0455 */ "Abiogenix Inc.", + /* 0456 */ "Poly-Control ApS", + /* 0457 */ "Avi-on", + /* 0458 */ "Laerdal Medical AS", + /* 0459 */ "Fetch My Pet", + /* 0460 */ "Sam Labs Ltd.", + /* 0461 */ "Chengdu Synwing Technology Ltd", + /* 0462 */ "HOUWA SYSTEM DESIGN, k.k.", + /* 0463 */ "BSH", + /* 0464 */ "Primus Inter Pares Ltd", + /* 0465 */ "August Home, Inc", + /* 0466 */ "Gill Electronics", + /* 0467 */ "Sky Wave Design", + /* 0468 */ "Newlab S.r.l.", + /* 0469 */ "ELAD srl", + /* 0470 */ "G-wearables inc.", + /* 0471 */ "Squadrone Systems Inc.", + /* 0472 */ "Code Corporation", + /* 0473 */ "Savant Systems LLC", + /* 0474 */ "Logitech International SA", + /* 0475 */ "Innblue Consulting", + /* 0476 */ "iParking Ltd.", + /* 0477 */ "Koninklijke Philips Electronics N.V.", + /* 0478 */ "Minelab Electronics Pty Limited", + /* 0479 */ "Bison Group Ltd.", + /* 0480 */ "Widex A/S", + /* 0481 */ "Jolla Ltd", + /* 0482 */ "Lectronix, Inc.", + /* 0483 */ "Caterpillar Inc", + /* 0484 */ "Freedom Innovations", + /* 0485 */ "Dynamic Devices Ltd", + /* 0486 */ "Technology Solutions (UK) Ltd", + /* 0487 */ "IPS Group Inc.", + /* 0488 */ "STIR", + /* 0489 */ "Sano, Inc.", + /* 0490 */ "Advanced Application Design, Inc.", + /* 0491 */ "AutoMap LLC", + /* 0492 */ "Spreadtrum Communications Shanghai Ltd", + /* 0493 */ "CuteCircuit LTD", + /* 0494 */ "Valeo Service", + /* 0495 */ "Fullpower Technologies, Inc.", + /* 0496 */ "KloudNation", + /* 0497 */ "Zebra Technologies Corporation", + /* 0498 */ "Itron, Inc.", + /* 0499 */ "The University of Tokyo", + /* 0500 */ "UTC Fire and Security", + /* 0501 */ "Cool Webthings Limited", + /* 0502 */ "DJO Global", + /* 0503 */ "Gelliner Limited", + /* 0504 */ "Anyka (Guangzhou) Microelectronics Technology Co, LTD", + /* 0505 */ "Medtronic Inc.", + /* 0506 */ "Gozio Inc.", + /* 0507 */ "Form Lifting, LLC", + /* 0508 */ "Wahoo Fitness, LLC", + /* 0509 */ "Kontakt Micro-Location Sp. z o.o.", + /* 0510 */ "Radio Systems Corporation", + /* 0511 */ "Freescale Semiconductor, Inc.", + /* 0512 */ "Verifone Systems Pte Ltd. Taiwan Branch", + /* 0513 */ "AR Timing", + /* 0514 */ "Rigado LLC", + /* 0515 */ "Kemppi Oy", + /* 0516 */ "Tapcentive Inc.", + /* 0517 */ "Smartbotics Inc.", + /* 0518 */ "Otter Products, LLC", + /* 0519 */ "STEMP Inc.", + /* 0520 */ "LumiGeek LLC", + /* 0521 */ "InvisionHeart Inc.", + /* 0522 */ "Macnica Inc.", + /* 0523 */ "Jaguar Land Rover Limited", + /* 0524 */ "CoroWare Technologies, Inc", + /* 0525 */ "Simplo Technology Co., LTD", + /* 0526 */ "Omron Healthcare Co., LTD", + /* 0527 */ "Comodule GMBH", + /* 0528 */ "ikeGPS", + /* 0529 */ "Telink Semiconductor Co. Ltd", + /* 0530 */ "Interplan Co., Ltd", + /* 0531 */ "Wyler AG", + /* 0532 */ "IK Multimedia Production srl", + /* 0533 */ "Lukoton Experience Oy", + /* 0534 */ "MTI Ltd", + /* 0535 */ "Tech4home, Lda", + /* 0536 */ "Hiotech AB", + /* 0537 */ "DOTT Limited", + /* 0538 */ "Blue Speck Labs, LLC", + /* 0539 */ "Cisco Systems, Inc", + /* 0540 */ "Mobicomm Inc", + /* 0541 */ "Edamic", + /* 0542 */ "Goodnet, Ltd", + /* 0543 */ "Luster Leaf Products Inc", + /* 0544 */ "Manus Machina BV", + /* 0545 */ "Mobiquity Networks Inc", + /* 0546 */ "Praxis Dynamics", + /* 0547 */ "Philip Morris Products S.A.", + /* 0548 */ "Comarch SA", + /* 0549 */ "Nestlé Nespresso S.A.", + /* 0550 */ "Merlinia A/S", + /* 0551 */ "LifeBEAM Technologies", + /* 0552 */ "Twocanoes Labs, LLC", + /* 0553 */ "Muoverti Limited", + /* 0554 */ "Stamer Musikanlagen GMBH", + /* 0555 */ "Tesla Motors", + /* 0556 */ "Pharynks Corporation", + /* 0557 */ "Lupine", + /* 0558 */ "Siemens AG", + /* 0559 */ "Huami (Shanghai) Culture Communication CO., LTD", + /* 0560 */ "Foster Electric Company, Ltd", + /* 0561 */ "ETA SA", + /* 0562 */ "x-Senso Solutions Kft", + /* 0563 */ "Shenzhen SuLong Communication Ltd", + /* 0564 */ "FengFan (BeiJing) Technology Co, Ltd", + /* 0565 */ "Qrio Inc", + /* 0566 */ "Pitpatpet Ltd", + /* 0567 */ "MSHeli s.r.l.", + /* 0568 */ "Trakm8 Ltd", + /* 0569 */ "JIN CO, Ltd", + /* 0570 */ "Alatech Tehnology", + /* 0571 */ "Beijing CarePulse Electronic Technology Co, Ltd", + /* 0572 */ "Awarepoint", + /* 0573 */ "ViCentra B.V.", + /* 0574 */ "Raven Industries", + /* 0575 */ "WaveWare Technologies Inc.", + /* 0576 */ "Argenox Technologies", + /* 0577 */ "Bragi GmbH", + /* 0578 */ "16Lab Inc", + /* 0579 */ "Masimo Corp", + /* 0580 */ "Iotera Inc", + /* 0581 */ "Endress+Hauser", + /* 0582 */ "ACKme Networks, Inc.", + /* 0583 */ "FiftyThree Inc.", + /* 0584 */ "Parker Hannifin Corp", + /* 0585 */ "Transcranial Ltd", + /* 0586 */ "Uwatec AG", + /* 0587 */ "Orlan LLC", + /* 0588 */ "Blue Clover Devices", + /* 0589 */ "M-Way Solutions GmbH", + /* 0590 */ "Microtronics Engineering GmbH", + /* 0591 */ "Schneider Schreibgeräte GmbH", + /* 0592 */ "Sapphire Circuits LLC", + /* 0593 */ "Lumo Bodytech Inc.", + /* 0594 */ "UKC Technosolution", + /* 0595 */ "Xicato Inc.", + /* 0596 */ "Playbrush", + /* 0597 */ "Dai Nippon Printing Co., Ltd.", + /* 0598 */ "G24 Power Limited", + /* 0599 */ "AdBabble Local Commerce Inc.", + /* 0600 */ "Devialet SA", + /* 0601 */ "ALTYOR", + /* 0602 */ "University of Applied Sciences Valais/Haute Ecole Valaisanne", + /* 0603 */ "Five Interactive, LLC dba Zendo", + /* 0604 */ "NetEase (Hangzhou) Network co.Ltd.", + /* 0605 */ "Lexmark International Inc.", + /* 0606 */ "Fluke Corporation", + /* 0607 */ "Yardarm Technologies", + /* 0608 */ "SensaRx", + /* 0609 */ "SECVRE GmbH", + /* 0610 */ "Glacial Ridge Technologies", + /* 0611 */ "Identiv, Inc.", + /* 0612 */ "DDS, Inc.", + /* 0613 */ "SMK Corporation", + /* 0614 */ "Schawbel Technologies LLC", + /* 0615 */ "XMI Systems SA", + /* 0616 */ "Cerevo", + /* 0617 */ "Torrox GmbH & Co KG", + /* 0618 */ "Gemalto", + /* 0619 */ "DEKA Research & Development Corp.", + /* 0620 */ "Domster Tadeusz Szydlowski", + /* 0621 */ "Technogym SPA", + /* 0622 */ "FLEURBAEY BVBA", + /* 0623 */ "Aptcode Solutions", + /* 0624 */ "LSI ADL Technology", + /* 0625 */ "Animas Corp", + /* 0626 */ "Alps Electric Co., Ltd.", + /* 0627 */ "OCEASOFT", + /* 0628 */ "Motsai Research", + /* 0629 */ "Geotab", + /* 0630 */ "E.G.O. Elektro-Geraetebau GmbH", + /* 0631 */ "bewhere inc", + /* 0632 */ "Johnson Outdoors Inc", + /* 0633 */ "steute Schaltgerate GmbH & Co. KG", + /* 0634 */ "Ekomini inc.", + /* 0635 */ "DEFA AS", + /* 0636 */ "Aseptika Ltd", + /* 0637 */ "HUAWEI Technologies Co., Ltd.", + /* 0638 */ "HabitAware, LLC", + /* 0639 */ "ruwido austria gmbh", + /* 0640 */ "ITEC corporation", + /* 0641 */ "StoneL", + /* 0642 */ "Sonova AG", + /* 0643 */ "Maven Machines, Inc.", + /* 0644 */ "Synapse Electronics", + /* 0645 */ "Standard Innovation Inc.", + /* 0646 */ "RF Code, Inc.", + /* 0647 */ "Wally Ventures S.L.", + /* 0648 */ "Willowbank Electronics Ltd", + /* 0649 */ "SK Telecom", + /* 0650 */ "Jetro AS", + /* 0651 */ "Code Gears LTD", + /* 0652 */ "NANOLINK APS", + /* 0653 */ "IF, LLC", + /* 0654 */ "RF Digital Corp", + /* 0655 */ "Church & Dwight Co., Inc", + /* 0656 */ "Multibit Oy", + /* 0657 */ "CliniCloud Inc", + /* 0658 */ "SwiftSensors", + /* 0659 */ "Blue Bite", + /* 0660 */ "ELIAS GmbH", + /* 0661 */ "Sivantos GmbH", + /* 0662 */ "Petzl", + /* 0663 */ "storm power ltd", + /* 0664 */ "EISST Ltd", + /* 0665 */ "Inexess Technology Simma KG", + /* 0666 */ "Currant, Inc.", + /* 0667 */ "C2 Development, Inc.", + /* 0668 */ "Blue Sky Scientific, LLC", + /* 0669 */ "ALOTTAZS LABS, LLC", + /* 0670 */ "Kupson spol. s r.o.", + /* 0671 */ "Areus Engineering GmbH", + /* 0672 */ "Impossible Camera GmbH", + /* 0673 */ "InventureTrack Systems", + /* 0674 */ "LockedUp", + /* 0675 */ "Itude", + /* 0676 */ "Pacific Lock Company", + /* 0677 */ "Tendyron Corporation", + /* 0678 */ "Robert Bosch GmbH", + /* 0679 */ "Illuxtron international B.V.", + /* 0680 */ "miSport Ltd.", + /* 0681 */ "Chargelib", + /* 0682 */ "Doppler Lab", + /* 0683 */ "BBPOS Limited", + /* 0684 */ "RTB Elektronik GmbH & Co. KG", + /* 0685 */ "Rx Networks, Inc.", + /* 0686 */ "WeatherFlow, Inc.", + /* 0687 */ "Technicolor USA Inc.", + /* 0688 */ "Bestechnic(Shanghai),Ltd", + /* 0689 */ "Raden Inc", + /* 0690 */ "JouZen Oy", + /* 0691 */ "CLABER S.P.A.", + /* 0692 */ "Hyginex, Inc.", + /* 0693 */ "HANSHIN ELECTRIC RAILWAY CO.,LTD.", + /* 0694 */ "Schneider Electric", + /* 0695 */ "Oort Technologies LLC", + /* 0696 */ "Chrono Therapeutics", + /* 0697 */ "Rinnai Corporation", + /* 0698 */ "Swissprime Technologies AG", + /* 0699 */ "Koha.,Co.Ltd", + /* 0700 */ "Genevac Ltd", + /* 0701 */ "Chemtronics", + /* 0702 */ "Seguro Technology Sp. z o.o.", + /* 0703 */ "Redbird Flight Simulations", + /* 0704 */ "Dash Robotics", + /* 0705 */ "LINE Corporation", + /* 0706 */ "Guillemot Corporation", + /* 0707 */ "Techtronic Power Tools Technology Limited", + /* 0708 */ "Wilson Sporting Goods", + /* 0709 */ "Lenovo (Singapore) Pte Ltd.", + /* 0710 */ "Ayatan Sensors", + /* 0711 */ "Electronics Tomorrow Limited", + /* 0712 */ "VASCO Data Security International, Inc.", + /* 0713 */ "PayRange Inc.", + /* 0714 */ "ABOV Semiconductor", + /* 0715 */ "AINA-Wireless Inc.", + /* 0716 */ "Eijkelkamp Soil & Water", + /* 0717 */ "BMA ergonomics b.v.", + /* 0718 */ "Teva Branded Pharmaceutical Products R&D, Inc.", + /* 0719 */ "Anima", + /* 0720 */ "3M", + /* 0721 */ "Empatica Srl", + /* 0722 */ "Afero, Inc.", + /* 0723 */ "Powercast Corporation", + /* 0724 */ "Secuyou ApS", + /* 0725 */ "OMRON Corporation", + /* 0726 */ "Send Solutions", + /* 0727 */ "NIPPON SYSTEMWARE CO.,LTD.", + /* 0728 */ "Neosfar", + /* 0729 */ "Fliegl Agrartechnik GmbH", + /* 0730 */ "Gilvader", + /* 0731 */ "Digi International Inc (R)", + /* 0732 */ "DeWalch Technologies, Inc.", + /* 0733 */ "Flint Rehabilitation Devices, LLC", + /* 0734 */ "Samsung SDS Co., Ltd.", + /* 0735 */ "Blur Product Development", + /* 0736 */ "University of Michigan", + /* 0737 */ "Victron Energy BV", + /* 0738 */ "NTT docomo", + /* 0739 */ "Carmanah Technologies Corp.", + /* 0740 */ "Bytestorm Ltd.", + /* 0741 */ "Espressif Incorporated", + /* 0742 */ "Unwire", + /* 0743 */ "Connected Yard, Inc.", + /* 0744 */ "American Music Environments", + /* 0745 */ "Sensogram Technologies, Inc.", + /* 0746 */ "Fujitsu Limited", + /* 0747 */ "Ardic Technology", + /* 0748 */ "Delta Systems, Inc", + /* 0749 */ "HTC Corporation", + /* 0750 */ "Citizen Holdings Co., Ltd.", + /* 0751 */ "SMART-INNOVATION.inc", + /* 0752 */ "Blackrat Software", + /* 0753 */ "The Idea Cave, LLC", + /* 0754 */ "GoPro, Inc.", + /* 0755 */ "AuthAir, Inc", + /* 0756 */ "Vensi, Inc.", + /* 0757 */ "Indagem Tech LLC", + /* 0758 */ "Intemo Technologies", + /* 0759 */ "DreamVisions co., Ltd.", + /* 0760 */ "Runteq Oy Ltd", + /* 0761 */ "IMAGINATION TECHNOLOGIES LTD", + /* 0762 */ "CoSTAR TEchnologies", + /* 0763 */ "Clarius Mobile Health Corp.", + /* 0764 */ "Shanghai Frequen Microelectronics Co., Ltd.", + /* 0765 */ "Uwanna, Inc.", + /* 0766 */ "Lierda Science & Technology Group Co., Ltd.", + /* 0767 */ "Silicon Laboratories", + /* 0768 */ "World Moto Inc.", + /* 0769 */ "Giatec Scientific Inc.", + /* 0770 */ "Loop Devices, Inc", + /* 0771 */ "IACA electronique", + /* 0772 */ "Proxy Technologies, Inc.", + /* 0773 */ "Swipp ApS", + /* 0774 */ "Life Laboratory Inc.", + /* 0775 */ "FUJI INDUSTRIAL CO.,LTD.", + /* 0776 */ "Surefire, LLC", + /* 0777 */ "Dolby Labs", + /* 0778 */ "Ellisys", + /* 0779 */ "Magnitude Lighting Converters", + /* 0780 */ "Hilti AG", + /* 0781 */ "Devdata S.r.l.", + /* 0782 */ "Deviceworx", + /* 0783 */ "Shortcut Labs", + /* 0784 */ "SGL Italia S.r.l.", + /* 0785 */ "PEEQ DATA", + /* 0786 */ "Ducere Technologies Pvt Ltd", + /* 0787 */ "DiveNav, Inc.", + /* 0788 */ "RIIG AI Sp. z o.o.", + /* 0789 */ "Thermo Fisher Scientific", + /* 0790 */ "AG Measurematics Pvt. Ltd.", + /* 0791 */ "CHUO Electronics CO., LTD.", + /* 0792 */ "Aspenta International", + /* 0793 */ "Eugster Frismag AG", + /* 0794 */ "Amber wireless GmbH", + /* 0795 */ "HQ Inc", + /* 0796 */ "Lab Sensor Solutions", + /* 0797 */ "Enterlab ApS", + /* 0798 */ "Eyefi, Inc.", + /* 0799 */ "MetaSystem S.p.A.", + /* 0800 */ "SONO ELECTRONICS. CO., LTD", + /* 0801 */ "Jewelbots", + /* 0802 */ "Compumedics Limited", + /* 0803 */ "Rotor Bike Components", + /* 0804 */ "Astro, Inc.", + /* 0805 */ "Amotus Solutions", + /* 0806 */ "Healthwear Technologies (Changzhou)Ltd", + /* 0807 */ "Essex Electronics", + /* 0808 */ "Grundfos A/S", + /* 0809 */ "Eargo, Inc.", + /* 0810 */ "Electronic Design Lab", + /* 0811 */ "ESYLUX", + /* 0812 */ "NIPPON SMT.CO.,Ltd", + /* 0813 */ "BM innovations GmbH", + /* 0814 */ "indoormap", + /* 0815 */ "OttoQ Inc", + /* 0816 */ "North Pole Engineering", + /* 0817 */ "3flares Technologies Inc.", + /* 0818 */ "Electrocompaniet A.S.", + /* 0819 */ "Mul-T-Lock", + /* 0820 */ "Corentium AS", + /* 0821 */ "Enlighted Inc", + /* 0822 */ "GISTIC", + /* 0823 */ "AJP2 Holdings, LLC", + /* 0824 */ "COBI GmbH", + /* 0825 */ "Blue Sky Scientific, LLC", + /* 0826 */ "Appception, Inc.", + /* 0827 */ "Courtney Thorne Limited", + /* 0828 */ "Virtuosys", + /* 0829 */ "TPV Technology Limited", + /* 0830 */ "Monitra SA", + /* 0831 */ "Automation Components, Inc.", + /* 0832 */ "Letsense s.r.l.", + /* 0833 */ "Etesian Technologies LLC", + /* 0834 */ "GERTEC BRASIL LTDA.", + /* 0835 */ "Drekker Development Pty. Ltd.", + /* 0836 */ "Whirl Inc", + /* 0837 */ "Locus Positioning", + /* 0838 */ "Acuity Brands Lighting, Inc", + /* 0839 */ "Prevent Biometrics", + /* 0840 */ "Arioneo", + /* 0841 */ "VersaMe", + /* 0842 */ "Vaddio", + /* 0843 */ "Libratone A/S", + /* 0844 */ "HM Electronics, Inc.", + /* 0845 */ "TASER International, Inc.", + /* 0846 */ "SafeTrust Inc.", + /* 0847 */ "Heartland Payment Systems", + /* 0848 */ "Bitstrata Systems Inc.", + /* 0849 */ "Pieps GmbH", + /* 0850 */ "iRiding(Xiamen)Technology Co.,Ltd.", + /* 0851 */ "Alpha Audiotronics, Inc.", + /* 0852 */ "TOPPAN FORMS CO.,LTD.", + /* 0853 */ "Sigma Designs, Inc.", + /* 0854 */ "Spectrum Brands, Inc.", + /* 0855 */ "Polymap Wireless", + /* 0856 */ "MagniWare Ltd.", + /* 0857 */ "Novotec Medical GmbH", + /* 0858 */ "Medicom Innovation Partner a/s", + /* 0859 */ "Matrix Inc.", + /* 0860 */ "Eaton Corporation", + /* 0861 */ "KYS", + /* 0862 */ "Naya Health, Inc.", + /* 0863 */ "Acromag", + /* 0864 */ "Insulet Corporation", + /* 0865 */ "Wellinks Inc.", + /* 0866 */ "ON Semiconductor", + /* 0867 */ "FREELAP SA", + /* 0868 */ "Favero Electronics Srl", + /* 0869 */ "BioMech Sensor LLC", + /* 0870 */ "BOLTT Sports technologies Private limited", + /* 0871 */ "Saphe International", + /* 0872 */ "Metormote AB", + /* 0873 */ "littleBits", + /* 0874 */ "SetPoint Medical", + /* 0875 */ "BRControls Products BV", + /* 0876 */ "Zipcar", + /* 0877 */ "AirBolt Pty Ltd", + /* 0878 */ "KeepTruckin Inc", + /* 0879 */ "Motiv, Inc.", + /* 0880 */ "Wazombi Labs OU", + /* 0881 */ "ORBCOMM", + /* 0882 */ "Nixie Labs, Inc.", + /* 0883 */ "AppNearMe Ltd", + /* 0884 */ "Holman Industries", + /* 0885 */ "Expain AS", + /* 0886 */ "Electronic Temperature Instruments Ltd", + /* 0887 */ "Plejd AB", + /* 0888 */ "Propeller Health", + /* 0889 */ "Shenzhen iMCO Electronic Technology Co.,Ltd", + /* 0890 */ "Algoria", + /* 0891 */ "Apption Labs Inc.", + /* 0892 */ "Cronologics Corporation", + /* 0893 */ "MICRODIA Ltd.", + /* 0894 */ "lulabytes S.L.", + /* 0895 */ "Societe des Produits Nestle S.A. (formerly Nestec S.A.)", + /* 0896 */ "LLC \"MEGA-F service\"", + /* 0897 */ "Sharp Corporation", + /* 0898 */ "Precision Outcomes Ltd", + /* 0899 */ "Kronos Incorporated", + /* 0900 */ "OCOSMOS Co., Ltd.", + /* 0901 */ "Embedded Electronic Solutions Ltd. dba e2Solutions", + /* 0902 */ "Aterica Inc.", + /* 0903 */ "BluStor PMC, Inc.", + /* 0904 */ "Kapsch TrafficCom AB", + /* 0905 */ "ActiveBlu Corporation", + /* 0906 */ "Kohler Mira Limited", + /* 0907 */ "Noke", + /* 0908 */ "Appion Inc.", + /* 0909 */ "Resmed Ltd", + /* 0910 */ "Crownstone B.V.", + /* 0911 */ "Xiaomi Inc.", + /* 0912 */ "INFOTECH s.r.o.", + /* 0913 */ "Thingsquare AB", + /* 0914 */ "T&D", + /* 0915 */ "LAVAZZA S.p.A.", + /* 0916 */ "Netclearance Systems, Inc.", + /* 0917 */ "SDATAWAY", + /* 0918 */ "BLOKS GmbH", + /* 0919 */ "LEGO System A/S", + /* 0920 */ "Thetatronics Ltd", + /* 0921 */ "Nikon Corporation", + /* 0922 */ "NeST", + /* 0923 */ "South Silicon Valley Microelectronics", + /* 0924 */ "ALE International", + /* 0925 */ "CareView Communications, Inc.", + /* 0926 */ "SchoolBoard Limited", + /* 0927 */ "Molex Corporation", + /* 0928 */ "IVT Wireless Limited", + /* 0929 */ "Alpine Labs LLC", + /* 0930 */ "Candura Instruments", + /* 0931 */ "SmartMovt Technology Co., Ltd", + /* 0932 */ "Token Zero Ltd", + /* 0933 */ "ACE CAD Enterprise Co., Ltd. (ACECAD)", + /* 0934 */ "Medela, Inc", + /* 0935 */ "AeroScout", + /* 0936 */ "Esrille Inc.", + /* 0937 */ "THINKERLY SRL", + /* 0938 */ "Exon Sp. z o.o.", + /* 0939 */ "Meizu Technology Co., Ltd.", + /* 0940 */ "Smablo LTD", + /* 0941 */ "XiQ", + /* 0942 */ "Allswell Inc.", + /* 0943 */ "Comm-N-Sense Corp DBA Verigo", + /* 0944 */ "VIBRADORM GmbH", + /* 0945 */ "Otodata Wireless Network Inc.", + /* 0946 */ "Propagation Systems Limited", + /* 0947 */ "Midwest Instruments & Controls", + /* 0948 */ "Alpha Nodus, inc.", + /* 0949 */ "petPOMM, Inc", + /* 0950 */ "Mattel", + /* 0951 */ "Airbly Inc.", + /* 0952 */ "A-Safe Limited", + /* 0953 */ "FREDERIQUE CONSTANT SA", + /* 0954 */ "Maxscend Microelectronics Company Limited", + /* 0955 */ "Abbott", + /* 0956 */ "ASB Bank Ltd", + /* 0957 */ "amadas", + /* 0958 */ "Applied Science, Inc.", + /* 0959 */ "iLumi Solutions Inc.", + /* 0960 */ "Arch Systems Inc.", + /* 0961 */ "Ember Technologies, Inc.", + /* 0962 */ "Snapchat Inc", + /* 0963 */ "Casambi Technologies Oy", + /* 0964 */ "Pico Technology Inc.", + /* 0965 */ "St. Jude Medical, Inc.", + /* 0966 */ "Intricon", + /* 0967 */ "Structural Health Systems, Inc.", + /* 0968 */ "Avvel International", + /* 0969 */ "Gallagher Group", + /* 0970 */ "In2things Automation Pvt. Ltd.", + /* 0971 */ "SYSDEV Srl", + /* 0972 */ "Vonkil Technologies Ltd", + /* 0973 */ "Wynd Technologies, Inc.", + /* 0974 */ "CONTRINEX S.A.", + /* 0975 */ "MIRA, Inc.", + /* 0976 */ "Watteam Ltd", + /* 0977 */ "Density Inc.", + /* 0978 */ "IOT Pot India Private Limited", + /* 0979 */ "Sigma Connectivity AB", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Mon May 18 09:01:19 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id DA0BC13BD5B; Mon, 18 May 2020 09:01:19 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY0H5sdKz4RQk; Mon, 18 May 2020 09:01:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C49BC1ED76; Mon, 18 May 2020 09:01:19 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I91JQ9049615; Mon, 18 May 2020 09:01:19 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I91JjZ048783; Mon, 18 May 2020 09:01:19 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180901.04I91JjZ048783@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361169 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361169 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:01:19 -0000 Author: hselasky Date: Mon May 18 09:01:18 2020 New Revision: 361169 URL: https://svnweb.freebsd.org/changeset/base/361169 Log: MFC r360197: Add support for Read_Local_Supported_Commands command to hccontrol(8). Submitted by: Marc Veldman PR: 245811 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h stable/11/usr.sbin/bluetooth/hccontrol/info.c stable/11/usr.sbin/bluetooth/hccontrol/util.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:01:18 2020 (r361169) @@ -134,6 +134,7 @@ are: .It Cm Read_Page_Scan_Mode .It Cm Write_Page_Scan_Mode .It Cm Read_Local_Version_Information +.It Cm Read_Local_Supported_Commands .It Cm Read_Local_Supported_Features .It Cm Read_Buffer_Size .It Cm Read_Country_Code Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.h Mon May 18 09:01:18 2020 (r361169) @@ -72,6 +72,7 @@ char const * hci_hmode2str (int, char *, int); char const * hci_ver2str (int); char const * hci_lmpver2str (int); char const * hci_manufacturer2str(int); +char const * hci_commands2str (uint8_t *, char *, int); char const * hci_features2str (uint8_t *, char *, int); char const * hci_le_features2str (uint8_t *, char *, int); char const * hci_cc2str (int); Modified: stable/11/usr.sbin/bluetooth/hccontrol/info.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/info.c Mon May 18 09:01:18 2020 (r361169) @@ -72,6 +72,38 @@ hci_read_local_version_information(int s, int argc, ch return (OK); } /* hci_read_local_version_information */ +/* Send Read_Local_Supported_Commands command to the unit */ +static int +hci_read_local_supported_commands(int s, int argc, char **argv) +{ + ng_hci_read_local_commands_rp rp; + int n; + char buffer[16384]; + + n = sizeof(rp); + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_INFO, + NG_HCI_OCF_READ_LOCAL_COMMANDS), + (char *) &rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Supported commands:"); + for (n = 0; n < sizeof(rp.features); n++) { + if (n % 8 == 0) + fprintf(stdout, "\n"); + fprintf(stdout, "%#02x ", rp.features[n]); + } + fprintf(stdout, "\n%s\n", hci_commands2str(rp.features, + buffer, sizeof(buffer))); + + return (OK); +} /* hci_read_local_supported_commands */ + /* Send Read_Local_Supported_Features command to the unit */ static int hci_read_local_supported_features(int s, int argc, char **argv) @@ -186,6 +218,11 @@ struct hci_command info_commands[] = { "\nThis command will read the values for the version information for the\n" \ "local Bluetooth unit.", &hci_read_local_version_information +}, +{ +"read_local_supported_commands", +"\nThis command will read the commands the local Bluetooth unit supports.\n", +&hci_read_local_supported_commands }, { "read_local_supported_features", Modified: stable/11/usr.sbin/bluetooth/hccontrol/util.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 09:00:45 2020 (r361168) +++ stable/11/usr.sbin/bluetooth/hccontrol/util.c Mon May 18 09:01:18 2020 (r361169) @@ -2430,6 +2430,501 @@ hci_manufacturer2str(int m) } /* hci_manufacturer2str */ char const * +hci_commands2str(uint8_t *commands, char *buffer, int size) +{ + static char const * const t[][8] = { + { /* byte 0 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 1 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 2 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 3 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 4 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 5 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 6 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 7 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 8 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 9 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 10 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 11 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 12 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 13 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 14 */ + /* 0 */ " ", + /* 1 */ "", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 15 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 16 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 17 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 18 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 19 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 20 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 21 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 22 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 23 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 24 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 25 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 26 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 27 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 28 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 29 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 30 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 31 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 32 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 33 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 34 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 35 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 36 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 37 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 38 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 39 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 40 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 41 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 42 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 43 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 44 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }, + { /* byte 45 */ + /* 0 */ " ", + /* 1 */ " ", + /* 2 */ " ", + /* 3 */ " ", + /* 4 */ " ", + /* 5 */ " ", + /* 6 */ " ", + /* 7 */ " " + }}; + + if (buffer != NULL && size > 0) { + int n, i, len0, len1; + + memset(buffer, 0, size); + size--; + + + for (n = 0; n < SIZE(t); n++) { + for (i = 0; i < SIZE(t[n]); i++) { + len0 = strlen(buffer); + if (len0 >= size) + goto done; + + if (commands[n] & (1 << i)) { + if (len1 + strlen(t[n][i]) > 60) { + len1 = 0; + buffer[len0 - 1] = '\n'; + } + + len1 += strlen(t[n][i]); + strncat(buffer, t[n][i], size - len0); + } + + } + } + } +done: + return (buffer); +} /* hci_commands2str */ + +char const * hci_features2str(uint8_t *features, char *buffer, int size) { static char const * const t[][8] = { From owner-svn-src-stable-11@freebsd.org Mon May 18 09:04:25 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F1C5613BB42; Mon, 18 May 2020 09:04:25 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY3s66TXz4S7g; Mon, 18 May 2020 09:04:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id CCF631F237; Mon, 18 May 2020 09:04:25 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I94PLn050704; Mon, 18 May 2020 09:04:25 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I94P7U050701; Mon, 18 May 2020 09:04:25 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180904.04I94P7U050701@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:04:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361171 - in stable/11/sys/dev/mlx5: . mlx5_en X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_en X-SVN-Commit-Revision: 361171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:04:26 -0000 Author: hselasky Date: Mon May 18 09:04:24 2020 New Revision: 361171 URL: https://svnweb.freebsd.org/changeset/base/361171 Log: MFC r360377: Add support for reading temperature in mlx5en(4). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c stable/11/sys/dev/mlx5/mlx5_ifc.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/mlx5_en/en.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/en.h Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_en/en.h Mon May 18 09:04:24 2020 (r361171) @@ -723,6 +723,8 @@ struct mlx5e_params_ethtool { u8 fec_avail_10x_25x[MLX5E_MAX_FEC_10X_25X]; u16 fec_avail_50x[MLX5E_MAX_FEC_50X]; u32 fec_mode_active; + s32 hw_val_temp[MLX5_MAX_TEMPERATURE]; + u32 hw_num_temp; }; struct mlx5e_cq { @@ -1123,5 +1125,6 @@ void mlx5e_update_sq_inline(struct mlx5e_sq *sq); void mlx5e_refresh_sq_inline(struct mlx5e_priv *priv); int mlx5e_update_buf_lossy(struct mlx5e_priv *priv); int mlx5e_fec_update(struct mlx5e_priv *priv); +int mlx5e_hw_temperature_update(struct mlx5e_priv *priv); #endif /* _MLX5_EN_H_ */ Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_ethtool.c Mon May 18 09:04:24 2020 (r361171) @@ -801,6 +801,65 @@ mlx5e_cable_length_handler(SYSCTL_HANDLER_ARGS) return (error); } +static int +mlx5e_hw_temperature_handler(SYSCTL_HANDLER_ARGS) +{ + struct mlx5e_priv *priv = arg1; + int err; + + PRIV_LOCK(priv); + err = SYSCTL_OUT(req, priv->params_ethtool.hw_val_temp, + sizeof(priv->params_ethtool.hw_val_temp[0]) * + priv->params_ethtool.hw_num_temp); + if (err == 0 && req->newptr != NULL) + err = EOPNOTSUPP; + PRIV_UNLOCK(priv); + return (err); +} + +int +mlx5e_hw_temperature_update(struct mlx5e_priv *priv) +{ + int err; + u32 x; + + if (priv->params_ethtool.hw_num_temp == 0) { + u32 out_cap[MLX5_ST_SZ_DW(mtcap)] = {}; + const int sz_cap = MLX5_ST_SZ_BYTES(mtcap); + u32 value; + + err = -mlx5_core_access_reg(priv->mdev, NULL, 0, out_cap, sz_cap, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTCAP, 0, 0); + if (err) + goto done; + value = MLX5_GET(mtcap, out_cap, sensor_count); + if (value == 0) + return (0); + if (value > MLX5_MAX_TEMPERATURE) + value = MLX5_MAX_TEMPERATURE; + /* update number of temperature sensors */ + priv->params_ethtool.hw_num_temp = value; + } + + for (x = 0; x != priv->params_ethtool.hw_num_temp; x++) { + u32 out_sensor[MLX5_ST_SZ_DW(mtmp_reg)] = {}; + const int sz_sensor = MLX5_ST_SZ_BYTES(mtmp_reg); + + MLX5_SET(mtmp_reg, out_sensor, sensor_index, x); + + err = -mlx5_core_access_reg(priv->mdev, out_sensor, sz_sensor, + out_sensor, sz_sensor, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTMP, 0, 0); + if (err) + goto done; + /* convert from 0.125 celcius to millicelcius */ + priv->params_ethtool.hw_val_temp[x] = + (s16)MLX5_GET(mtmp_reg, out_sensor, temperature) * 125; + } +done: + return (err); +} + #define MLX5_PARAM_OFFSET(n) \ __offsetof(struct mlx5e_priv, params_ethtool.n) @@ -1540,5 +1599,13 @@ mlx5e_create_ethtool(struct mlx5e_priv *priv) CTLTYPE_UINT | CTLFLAG_RWTUN | CTLFLAG_MPSAFE, priv, 0, mlx5e_cable_length_handler, "IU", "Set cable length in meters for xoff threshold calculation"); + } + + if (mlx5e_hw_temperature_update(priv) == 0) { + SYSCTL_ADD_PROC(&priv->sysctl_ctx, SYSCTL_CHILDREN(priv->sysctl_ifnet), + OID_AUTO, "hw_temperature", + CTLTYPE_S32 | CTLFLAG_RD | CTLFLAG_MPSAFE, + priv, 0, mlx5e_hw_temperature_handler, "I", + "HW temperature in millicelcius"); } } Modified: stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_en/mlx5_en_main.c Mon May 18 09:04:24 2020 (r361171) @@ -1027,6 +1027,15 @@ free_out: mlx5_en_err(priv->ifp, "Updating FEC failed: %d\n", error); } + + /* Update temperature, if any */ + if (priv->params_ethtool.hw_num_temp != 0) { + error = mlx5e_hw_temperature_update(priv); + if (error != 0 && error != EOPNOTSUPP) { + mlx5_en_err(priv->ifp, + "Updating temperature failed: %d\n", error); + } + } } static void Modified: stable/11/sys/dev/mlx5/mlx5_ifc.h ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_ifc.h Mon May 18 09:03:12 2020 (r361170) +++ stable/11/sys/dev/mlx5/mlx5_ifc.h Mon May 18 09:04:24 2020 (r361171) @@ -10452,4 +10452,163 @@ struct mlx5_ifc_mfrl_reg_bits { u8 reset_level[0x8]; }; +enum { + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTCAP = 0x9009, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTECR = 0x9109, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTMP = 0x900a, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTWE = 0x900b, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTBR = 0x900f, + MLX5_ACCESS_REG_SUMMARY_CTRL_ID_MTEWE = 0x910b, + MLX5_MAX_TEMPERATURE = 16, +}; + +struct mlx5_ifc_mtbr_temp_record_bits { + u8 max_temperature[0x10]; + u8 temperature[0x10]; +}; + +struct mlx5_ifc_mtbr_reg_bits { + u8 reserved_at_0[0x14]; + u8 base_sensor_index[0xc]; + + u8 reserved_at_20[0x18]; + u8 num_rec[0x8]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_mtbr_temp_record_bits temperature_record[MLX5_MAX_TEMPERATURE]; +}; + +struct mlx5_ifc_mtbr_reg_ext_bits { + u8 reserved_at_0[0x14]; + u8 base_sensor_index[0xc]; + + u8 reserved_at_20[0x18]; + u8 num_rec[0x8]; + + u8 reserved_at_40[0x40]; + + struct mlx5_ifc_mtbr_temp_record_bits temperature_record[MLX5_MAX_TEMPERATURE]; +}; + +struct mlx5_ifc_mtcap_bits { + u8 reserved_at_0[0x19]; + u8 sensor_count[0x7]; + + u8 reserved_at_20[0x19]; + u8 internal_sensor_count[0x7]; + + u8 sensor_map[0x40]; +}; + +struct mlx5_ifc_mtcap_ext_bits { + u8 reserved_at_0[0x19]; + u8 sensor_count[0x7]; + + u8 reserved_at_20[0x20]; + + u8 sensor_map[0x40]; +}; + +struct mlx5_ifc_mtecr_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 reserved_at_20[0x19]; + u8 internal_sensor_count[0x7]; + + u8 sensor_map_0[0x20]; + + u8 reserved_at_60[0x2a0]; +}; + +struct mlx5_ifc_mtecr_ext_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 reserved_at_20[0x20]; + + u8 sensor_map_0[0x20]; + + u8 reserved_at_60[0x2a0]; +}; + +struct mlx5_ifc_mtewe_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 sensor_warning_0[0x20]; + + u8 reserved_at_40[0x2a0]; +}; + +struct mlx5_ifc_mtewe_ext_bits { + u8 reserved_at_0[0x4]; + u8 last_sensor[0xc]; + u8 reserved_at_10[0x4]; + u8 sensor_count[0xc]; + + u8 sensor_warning_0[0x20]; + + u8 reserved_at_40[0x2a0]; +}; + +struct mlx5_ifc_mtmp_bits { + u8 reserved_at_0[0x14]; + u8 sensor_index[0xc]; + + u8 reserved_at_20[0x10]; + u8 temperature[0x10]; + + u8 mte[0x1]; + u8 mtr[0x1]; + u8 reserved_at_42[0xe]; + u8 max_temperature[0x10]; + + u8 tee[0x2]; + u8 reserved_at_62[0xe]; + u8 temperature_threshold_hi[0x10]; + + u8 reserved_at_80[0x10]; + u8 temperature_threshold_lo[0x10]; + + u8 reserved_at_a0[0x20]; + + u8 sensor_name_hi[0x20]; + + u8 sensor_name_lo[0x20]; +}; + +struct mlx5_ifc_mtmp_ext_bits { + u8 reserved_at_0[0x14]; + u8 sensor_index[0xc]; + + u8 reserved_at_20[0x10]; + u8 temperature[0x10]; + + u8 mte[0x1]; + u8 mtr[0x1]; + u8 reserved_at_42[0xe]; + u8 max_temperature[0x10]; + + u8 tee[0x2]; + u8 reserved_at_62[0xe]; + u8 temperature_threshold_hi[0x10]; + + u8 reserved_at_80[0x10]; + u8 temperature_threshold_lo[0x10]; + + u8 reserved_at_a0[0x20]; + + u8 sensor_name_hi[0x20]; + + u8 sensor_name_lo[0x20]; +}; + #endif /* MLX5_IFC_H */ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:06:10 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 4083A13BFA3; Mon, 18 May 2020 09:06:10 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY5t0yhmz4SKZ; Mon, 18 May 2020 09:06:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1C2151EB6A; Mon, 18 May 2020 09:06:10 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I969lG050911; Mon, 18 May 2020 09:06:09 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I969aI050910; Mon, 18 May 2020 09:06:09 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180906.04I969aI050910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:06:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361173 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361173 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:06:10 -0000 Author: hselasky Date: Mon May 18 09:06:09 2020 New Revision: 361173 URL: https://svnweb.freebsd.org/changeset/base/361173 Log: MFC r360528: Implement kstrtou64() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:05:29 2020 (r361172) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Mon May 18 09:06:09 2020 (r361173) @@ -385,6 +385,21 @@ kstrtou32(const char *cp, unsigned int base, u32 *res) } static inline int +kstrtou64(const char *cp, unsigned int base, u64 *res) +{ + char *end; + + *res = strtouq(cp, &end, base); + + /* skip newline character, if any */ + if (*end == '\n') + end++; + if (*cp == 0 || *end != 0) + return (-EINVAL); + return (0); +} + +static inline int kstrtobool(const char *s, bool *res) { int len; From owner-svn-src-stable-11@freebsd.org Mon May 18 09:07:51 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E7E8D13BF4A; Mon, 18 May 2020 09:07:51 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY7q5vhkz4SZc; Mon, 18 May 2020 09:07:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C5E691F0E8; Mon, 18 May 2020 09:07:51 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I97p8b051120; Mon, 18 May 2020 09:07:51 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I97pnj051119; Mon, 18 May 2020 09:07:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180907.04I97pnj051119@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:07:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361175 - stable/11/sys/dev/sound/pcm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/sound/pcm X-SVN-Commit-Revision: 361175 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:07:52 -0000 Author: hselasky Date: Mon May 18 09:07:51 2020 New Revision: 361175 URL: https://svnweb.freebsd.org/changeset/base/361175 Log: MFC r360790: Set PCM_CAP_VIRTUAL for virtual DSP devices. Submitted by: Kevin Zheng PR: 246206 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/sound/pcm/dsp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/sound/pcm/dsp.c ============================================================================== --- stable/11/sys/dev/sound/pcm/dsp.c Mon May 18 09:07:14 2020 (r361174) +++ stable/11/sys/dev/sound/pcm/dsp.c Mon May 18 09:07:51 2020 (r361175) @@ -1701,6 +1701,10 @@ dsp_ioctl(struct cdev *i_dev, u_long cmd, caddr_t arg, *arg_i = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER; if (rdch && wrch && !(dsp_get_flags(i_dev) & SD_F_SIMPLEX)) *arg_i |= PCM_CAP_DUPLEX; + if (rdch && (rdch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; + if (wrch && (wrch->flags & CHN_F_VIRTUAL) != 0) + *arg_i |= PCM_CAP_VIRTUAL; PCM_UNLOCK(d); break; @@ -2648,6 +2652,7 @@ dsp_oss_audioinfo(struct cdev *i_dev, oss_audioinfo *a * these in pcmchan::caps? */ ai->caps = PCM_CAP_REALTIME | PCM_CAP_MMAP | PCM_CAP_TRIGGER | + ((ch->flags & CHN_F_VIRTUAL) ? PCM_CAP_VIRTUAL : 0) | ((ch->direction == PCMDIR_PLAY) ? PCM_CAP_OUTPUT : PCM_CAP_INPUT); /* From owner-svn-src-stable-11@freebsd.org Mon May 18 09:09:35 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7555013C31F; Mon, 18 May 2020 09:09:35 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QY9q2TM9z4SWT; Mon, 18 May 2020 09:09:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 501811EB6D; Mon, 18 May 2020 09:09:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I99Zvb051497; Mon, 18 May 2020 09:09:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I99ZAe051496; Mon, 18 May 2020 09:09:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180909.04I99ZAe051496@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:09:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361177 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361177 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:09:35 -0000 Author: hselasky Date: Mon May 18 09:09:34 2020 New Revision: 361177 URL: https://svnweb.freebsd.org/changeset/base/361177 Log: MFC r360118: Allow test_bit() in the LinuxKPI to accept a const pointer. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 18 09:09:03 2020 (r361176) +++ stable/11/sys/compat/linuxkpi/common/include/linux/bitops.h Mon May 18 09:09:34 2020 (r361177) @@ -273,7 +273,7 @@ find_next_zero_bit(const unsigned long *addr, unsigned atomic_clear_long(&((volatile unsigned long *)(a))[BIT_WORD(i)], BIT_MASK(i)) #define test_bit(i, a) \ - !!(READ_ONCE(((volatile unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) + !!(READ_ONCE(((volatile const unsigned long *)(a))[BIT_WORD(i)]) & BIT_MASK(i)) static inline int test_and_clear_bit(long bit, volatile unsigned long *var) From owner-svn-src-stable-11@freebsd.org Mon May 18 09:10:53 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5914313C2BC; Mon, 18 May 2020 09:10:53 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYCK1nQsz4SrL; Mon, 18 May 2020 09:10:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 38ABF1EF64; Mon, 18 May 2020 09:10:53 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9ArY1051712; Mon, 18 May 2020 09:10:53 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9ArkM051711; Mon, 18 May 2020 09:10:53 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180910.04I9ArkM051711@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:10:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361179 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361179 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:10:53 -0000 Author: hselasky Date: Mon May 18 09:10:52 2020 New Revision: 361179 URL: https://svnweb.freebsd.org/changeset/base/361179 Log: MFC r360119: Implement aligned LinuxKPI types for u16, u32 and u64. Makes a difference for 32-bit platforms mostly. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/types.h Mon May 18 09:10:21 2020 (r361178) +++ stable/11/sys/compat/linuxkpi/common/include/linux/types.h Mon May 18 09:10:52 2020 (r361179) @@ -53,6 +53,10 @@ typedef uint32_t __be32; typedef uint64_t __le64; typedef uint64_t __be64; +typedef uint16_t __aligned_u16 __aligned(sizeof(uint16_t)); +typedef uint32_t __aligned_u32 __aligned(sizeof(uint32_t)); +typedef uint64_t __aligned_u64 __aligned(sizeof(uint64_t)); + typedef unsigned short ushort; typedef unsigned int uint; typedef unsigned long ulong; From owner-svn-src-stable-11@freebsd.org Mon May 18 09:12:14 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B001E13C60E; Mon, 18 May 2020 09:12:14 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYDt4Gfdz4THG; Mon, 18 May 2020 09:12:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7586D1F2C7; Mon, 18 May 2020 09:12:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9CEFX056884; Mon, 18 May 2020 09:12:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9CDIH056880; Mon, 18 May 2020 09:12:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180912.04I9CDIH056880@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:12:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361181 - stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/asm X-SVN-Commit-Revision: 361181 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:12:14 -0000 Author: hselasky Date: Mon May 18 09:12:13 2020 New Revision: 361181 URL: https://svnweb.freebsd.org/changeset/base/361181 Log: MFC r360127: Implement the atomic fetch add unless functions for the LinuxKPI. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 18 09:11:41 2020 (r361180) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic-long.h Mon May 18 09:12:13 2020 (r361181) @@ -118,6 +118,20 @@ atomic_long_add_unless(atomic_long_t *v, long a, long } static inline long +atomic_long_fetch_add_unless(atomic_long_t *v, long a, long u) +{ + long c = atomic_long_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_long(&v->counter, &c, c + a))) + break; + } + return (c); +} + +static inline long atomic_long_dec_and_test(atomic_long_t *v) { long i = atomic_long_add(-1, v); Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Mon May 18 09:11:41 2020 (r361180) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Mon May 18 09:12:13 2020 (r361181) @@ -119,6 +119,20 @@ atomic_add_unless(atomic_t *v, int a, int u) return (c != u); } +static inline int +atomic_fetch_add_unless(atomic_t *v, int a, int u) +{ + int c = atomic_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_int(&v->counter, &c, c + a))) + break; + } + return (c); +} + static inline void atomic_clear_mask(unsigned int mask, atomic_t *v) { Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon May 18 09:11:41 2020 (r361180) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic64.h Mon May 18 09:12:13 2020 (r361181) @@ -104,6 +104,20 @@ atomic64_add_unless(atomic64_t *v, int64_t a, int64_t } static inline int64_t +atomic64_fetch_add_unless(atomic64_t *v, int64_t a, int64_t u) +{ + int64_t c = atomic64_read(v); + + for (;;) { + if (unlikely(c == u)) + break; + if (likely(atomic_fcmpset_64(&v->counter, &c, c + a))) + break; + } + return (c); +} + +static inline int64_t atomic64_xchg(atomic64_t *v, int64_t i) { #if defined(__i386__) || defined(__amd64__) || \ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:13:35 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5E42713C1A8; Mon, 18 May 2020 09:13:35 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYGR1rZpz4Tm6; Mon, 18 May 2020 09:13:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3A8291F53D; Mon, 18 May 2020 09:13:35 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9DZGT057745; Mon, 18 May 2020 09:13:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9DYWj057744; Mon, 18 May 2020 09:13:34 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180913.04I9DYWj057744@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:13:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361183 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361183 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:13:35 -0000 Author: hselasky Date: Mon May 18 09:13:34 2020 New Revision: 361183 URL: https://svnweb.freebsd.org/changeset/base/361183 Log: MFC r360243: Add support for LE advertising to hccontrol(8). Submitted by: Marc Veldman PR: 245848 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:13:03 2020 (r361182) +++ stable/11/usr.sbin/bluetooth/hccontrol/hccontrol.8 Mon May 18 09:13:34 2020 (r361183) @@ -25,7 +25,7 @@ .\" $Id: hccontrol.8,v 1.6 2003/08/06 21:26:38 max Exp $ .\" $FreeBSD$ .\" -.Dd February 7, 2015 +.Dd April 24, 2020 .Dt HCCONTROL 8 .Os .Sh NAME @@ -133,6 +133,8 @@ are: .It Cm Write_Page_Scan_Period_Mode .It Cm Read_Page_Scan_Mode .It Cm Write_Page_Scan_Mode +.It Cm Read_LE_Host_Support +.It Cm Write_LE_Host_Support .It Cm Read_Local_Version_Information .It Cm Read_Local_Supported_Commands .It Cm Read_Local_Supported_Features @@ -143,6 +145,15 @@ are: .It Cm Reset_Failed_Contact_Counter .It Cm Get_Link_Quality .It Cm Read_RSSI +.It Cm LE_Read_Local_Supported_Features +.It Cm LE_Set_Advertising_Parameters +.It Cm LE_Read_Advertising_Physical_Channel_Tx_Power +.It Cm LE_Set_Advertising_Data +.It Cm LE_Set_Scan_Response_Data +.It Cm LE_Set_Advertising_Enable +.It Cm LE_Set_Scan_Parameters +.It Cm LE_Set_Scan_Enable +.It Cm LE_Read_Supported_States .El .Pp The currently supported node commands in @@ -170,6 +181,18 @@ are: .It Cm Write_Node_Role_Switch .It Cm Read_Node_List .El +.Sh EXAMPLES +Make the blutooth LE host, ubt0hci, scannable through +.Xr hccontrol 8 commands: +.Pp +.Bd -literal -offset indent +hccontrol -n ubt0hci le_set_advertising_enable disable +hccontrol -n ubt0hci le_set_advertising_param +hccontrol -n ubt0hci le_read_advertising_channel_tx_power +hccontrol -n ubt0hci le_set_advertising_data +hccontrol -n ubt0hci le_set_scan_response -n FBSD_Host +hccontrol -n ubt0hci le_set_advertising_enable enable +.Ed .Sh EXIT STATUS .Ex -std .Sh SEE ALSO Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:13:03 2020 (r361182) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:13:34 2020 (r361183) @@ -57,6 +57,9 @@ static int le_read_local_supported_features(int s, int static int set_le_event_mask(int s, uint64_t mask); static int set_event_mask(int s, uint64_t mask); static int le_enable(int s, int argc, char *argv[]); +static int le_set_advertising_enable(int s, int argc, char *argv[]); +static int le_set_advertising_param(int s, int argc, char *argv[]); +static int le_read_advertising_channel_tx_power(int s, int argc, char *argv[]); static int le_set_scan_param(int s, int argc, char *argv[]) @@ -339,6 +342,170 @@ int le_enable(int s, int argc, char *argv[]) return OK; } +static int +le_set_advertising_enable(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertise_enable_cp cp; + ng_hci_le_set_advertise_enable_rp rp; + int n, enable = 0; + + if (argc != 1) + return USAGE; + + if (strcmp(argv[0], "enable") == 0) + enable = 1; + else if (strcmp(argv[0], "disable") != 0) + return USAGE; + + n = sizeof(rp); + cp.advertising_enable = enable; + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISE_ENABLE), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + fprintf(stdout, "LE Advertising %s\n", (enable ? "enabled" : "disabled")); + + return (OK); +} + +static int +le_set_advertising_param(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertising_parameters_cp cp; + ng_hci_le_set_advertising_parameters_rp rp; + + int n, ch; + + cp.advertising_interval_min = 0x800; + cp.advertising_interval_max = 0x800; + cp.advertising_type = 0; + cp.own_address_type = 0; + cp.direct_address_type = 0; + + cp.advertising_channel_map = 7; + cp.advertising_filter_policy = 0; + + optreset = 1; + optind = 0; + while ((ch = getopt(argc, argv , "m:M:t:o:p:a:c:f:")) != -1) { + switch(ch) { + case 'm': + cp.advertising_interval_min = + (uint16_t)(strtod(optarg, NULL)/0.625); + break; + case 'M': + cp.advertising_interval_max = + (uint16_t)(strtod(optarg, NULL)/0.625); + break; + case 't': + cp.advertising_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'o': + cp.own_address_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'p': + cp.direct_address_type = + (uint8_t)strtod(optarg, NULL); + break; + case 'a': + if (!bt_aton(optarg, &cp.direct_address)) { + struct hostent *he = NULL; + + if ((he = bt_gethostbyname(optarg)) == NULL) + return (USAGE); + + memcpy(&cp.direct_address, he->h_addr, sizeof(cp.direct_address)); + } + break; + case 'c': + cp.advertising_channel_map = + (uint8_t)strtod(optarg, NULL); + break; + case 'f': + cp.advertising_filter_policy = + (uint8_t)strtod(optarg, NULL); + break; + } + } + + n = sizeof(rp); + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISING_PARAMETERS), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + +static int +le_read_advertising_channel_tx_power(int s, int argc, char *argv[]) +{ + ng_hci_le_read_advertising_channel_tx_power_rp rp; + int n; + + n = sizeof(rp); + + if (hci_simple_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_READ_ADVERTISING_CHANNEL_TX_POWER), + (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + fprintf(stdout, "Advertising transmit power level: %d dBm\n", + (int8_t)rp.transmit_power_level); + + return (OK); +} + +static int +le_set_advertising_data(int s, int argc, char *argv[]) +{ + ng_hci_le_set_advertising_data_cp cp; + ng_hci_le_set_advertising_data_rp rp; + int n, len; + + n = sizeof(rp); + + char buf[NG_HCI_ADVERTISING_DATA_SIZE]; + + len = sizeof(buf); + parse_param(argc, argv, buf, &len); + memset(cp.advertising_data, 0, sizeof(cp.advertising_data)); + cp.advertising_data_length = len; + + if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, + NG_HCI_OCF_LE_SET_ADVERTISING_DATA), + (void *)&cp, sizeof(cp), (void *)&rp, &n) == ERROR) + return (ERROR); + + if (rp.status != 0x00) { + fprintf(stdout, "Status: %s [%#02x]\n", + hci_status2str(rp.status), rp.status); + return (FAILED); + } + + return (OK); +} + struct hci_command le_commands[] = { { "le_enable", @@ -377,5 +544,32 @@ struct hci_command le_commands[] = { "le_set_scan_param [active|passive] interval(ms) window(ms) [public|random] [all|whitelist] \n" "set LE device scan parameter", &le_set_scan_param + }, + { + "le_set_advertising_enable", + "le_set_advertising_enable [enable|disable] \n" + "start or stop advertising", + &le_set_advertising_enable + }, + { + "le_read_advertising_channel_tx_power", + "le_read_advertising_channel_tx_power\n" + "read host advertising transmit poser level (dBm)", + &le_read_advertising_channel_tx_power + }, + { + "le_set_advertising_param", + "le_set_advertising_param [-m min_interval(ms)] [-M max_interval(ms)]\n" + "[-t advertising_type] [-o own_address_type] [-p peer_address_type]\n" + "[-c advertising_channel_map] [-f advertising_filter_policy]\n" + "[-a peer_address]\n" + "set LE device advertising parameters", + &le_set_advertising_param + }, + { + "le_set_advertising_data", + "le_set_advertising_data -n $name -f $flag -u $uuid16,$uuid16 \n" + "set LE device advertising packed data", + &le_set_advertising_data }, }; From owner-svn-src-stable-11@freebsd.org Mon May 18 09:14:59 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5FDAB13C6EC; Mon, 18 May 2020 09:14:59 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYJ31wpRz4Tsp; Mon, 18 May 2020 09:14:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 3D7321F330; Mon, 18 May 2020 09:14:59 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9ExjV057957; Mon, 18 May 2020 09:14:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Exas057956; Mon, 18 May 2020 09:14:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180914.04I9Exas057956@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:14:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361185 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361185 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:14:59 -0000 Author: hselasky Date: Mon May 18 09:14:58 2020 New Revision: 361185 URL: https://svnweb.freebsd.org/changeset/base/361185 Log: MFC r360263: Rename two commands to match the Bluetooth specification in hccontrol(8). Fix some bad spelling while at it. Submitted by: Marc Veldman PR: 245868 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Mon May 18 09:14:24 2020 (r361184) +++ stable/11/usr.sbin/bluetooth/hccontrol/host_controller_baseband.c Mon May 18 09:14:58 2020 (r361185) @@ -1491,7 +1491,7 @@ hci_write_page_scan_mode(int s, int argc, char **argv) } /* hci_write_page_scan_mode */ static int -hci_read_le_host_supported_command(int s, int argc, char **argv) +hci_read_le_host_support(int s, int argc, char **argv) { ng_hci_read_le_host_supported_rp rp; int n; @@ -1508,13 +1508,13 @@ hci_read_le_host_supported_command(int s, int argc, ch } fprintf(stdout, "LE Host support: %#02x\n", rp.le_supported_host); - fprintf(stdout, "Simulateneouse LE Host : %#02x\n", rp.simultaneous_le_host); + fprintf(stdout, "Simultaneous LE Host : %#02x\n", rp.simultaneous_le_host); return (OK); } static int -hci_write_le_host_supported_command(int s, int argc, char **argv) +hci_write_le_host_support(int s, int argc, char **argv) { ng_hci_write_le_host_supported_cp cp; ng_hci_write_le_host_supported_rp rp; @@ -1948,14 +1948,14 @@ struct hci_command host_controller_baseband_commands[] &hci_write_page_scan_mode }, { -"read_le_host_supported_command", \ -"Read if this host is in le supported mode and stimulatenouse le supported mode", -&hci_read_le_host_supported_command, +"read_le_host_support", \ +"Read if this host is in LE supported mode and simultaneous LE supported mode", +&hci_read_le_host_support, }, { -"write_le_host_supported_command", \ -"write_le_host_supported_command le_host[0|1] stimultajeous_le[0|1]", -&hci_write_le_host_supported_command, +"write_le_host_support", \ +"write_le_host_support le_host[0|1] simultaneous_le[0|1]", +&hci_write_le_host_support, }, { NULL, } From owner-svn-src-stable-11@freebsd.org Mon May 18 09:16:18 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8D04F13C760; Mon, 18 May 2020 09:16:18 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYKZ3Gcnz4VLn; Mon, 18 May 2020 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6BA7C1F332; Mon, 18 May 2020 09:16:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9GImJ058175; Mon, 18 May 2020 09:16:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9GIL5058174; Mon, 18 May 2020 09:16:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180916.04I9GIL5058174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361187 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361187 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:16:18 -0000 Author: hselasky Date: Mon May 18 09:16:17 2020 New Revision: 361187 URL: https://svnweb.freebsd.org/changeset/base/361187 Log: MFC r360288: Put advertising data in correct place. Submitted by: Marc Veldman PR: 245848 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:15:45 2020 (r361186) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:16:17 2020 (r361187) @@ -491,6 +491,7 @@ le_set_advertising_data(int s, int argc, char *argv[]) parse_param(argc, argv, buf, &len); memset(cp.advertising_data, 0, sizeof(cp.advertising_data)); cp.advertising_data_length = len; + memcpy(cp.advertising_data, buf, len); if (hci_request(s, NG_HCI_OPCODE(NG_HCI_OGF_LE, NG_HCI_OCF_LE_SET_ADVERTISING_DATA), From owner-svn-src-stable-11@freebsd.org Mon May 18 09:17:39 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 08F3413C93E; Mon, 18 May 2020 09:17:39 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYM66W10z4VPg; Mon, 18 May 2020 09:17:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id DA99A1F14B; Mon, 18 May 2020 09:17:38 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9HcQ6058378; Mon, 18 May 2020 09:17:38 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9HcA4058377; Mon, 18 May 2020 09:17:38 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180917.04I9HcA4058377@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:17:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361189 - stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/usr.sbin/bluetooth/hccontrol X-SVN-Commit-Revision: 361189 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:17:39 -0000 Author: hselasky Date: Mon May 18 09:17:38 2020 New Revision: 361189 URL: https://svnweb.freebsd.org/changeset/base/361189 Log: MFC r360329: Properly update AD field length in hccontrol(8). While at it use strtol() instead of atoi() to support hexadecimal numbers aswell as 10-base numbers. Submitted by: Marc Veldman PR: 245899 Sponsored by: Mellanox Technologies Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bluetooth/hccontrol/le.c ============================================================================== --- stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:17:05 2020 (r361188) +++ stable/11/usr.sbin/bluetooth/hccontrol/le.c Mon May 18 09:17:38 2020 (r361189) @@ -172,13 +172,13 @@ parse_param(int argc, char *argv[], char *buf, int *le goto done; curbuf[0] = 2; curbuf[1] = 1; - curbuf[2] = atoi(optarg); + curbuf[2] = (uint8_t)strtol(optarg, NULL, 16); curbuf += 3; break; case 'u': - lenpos = buf; if ((buf+2) >= buflast) goto done; + lenpos = curbuf; curbuf[1] = 2; *lenpos = 1; curbuf += 2; @@ -189,6 +189,7 @@ parse_param(int argc, char *argv[], char *buf, int *le curbuf[0] = value &0xff; curbuf[1] = (value>>8)&0xff; curbuf += 2; + *lenpos += 2; } } From owner-svn-src-stable-11@freebsd.org Mon May 18 09:22:18 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 17A2013CA26; Mon, 18 May 2020 09:22:18 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYST6yhwz4W2s; Mon, 18 May 2020 09:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA4961F15C; Mon, 18 May 2020 09:22:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9MHN1064402; Mon, 18 May 2020 09:22:17 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9MHd2064401; Mon, 18 May 2020 09:22:17 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180922.04I9MHd2064401@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:22:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361191 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361191 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:22:18 -0000 Author: hselasky Date: Mon May 18 09:22:17 2020 New Revision: 361191 URL: https://svnweb.freebsd.org/changeset/base/361191 Log: MFC r351003: Fix build with DRM and INVARIANTS enabled. The DRM drivers use the lockdep assertion macros with spinlock_t locks which are backed by mutexes, not sx locks. This causes compile failures since you can't use sx_assert with a mutex. Instead, change the lockdep macros to use lock_class methods. This works by assuming that each LinuxKPI locking primitive embeds a FreeBSD lock as its first structure and uses a cast to get to the underlying 'struct lock_object'. Reviewed by: hselasky Differential Revision: https://reviews.freebsd.org/D20992 Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:21:45 2020 (r361190) +++ stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:22:17 2020 (r361191) @@ -40,13 +40,34 @@ struct lock_class_key { #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) -#define lockdep_assert_held(m) \ - sx_assert(&(m)->sx, SA_XLOCKED) +#ifdef INVARIANTS +#define lockdep_assert_held(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED); \ +} while (0) -#define lockdep_assert_held_once(m) \ - sx_assert(&(m)->sx, SA_XLOCKED | SA_NOTRECURSED) +#define lockdep_assert_held_once(m) do { \ + struct lock_object *__lock = (struct lock_object *)(m); \ + LOCK_CLASS(__lock)->lc_assert(__lock, LA_LOCKED | LA_NOTRECURSED); \ +} while (0) -#define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) +static __inline bool +lockdep_is_held(void *__m) +{ + struct lock_object *__lock; + struct thread *__td; + + __lock = __m; + return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); +} + +#else +#define lockdep_assert_held(m) do { } while (0) + +#define lockdep_assert_held_once(m) do { } while (0) + +#define lockdep_is_held(m) 1 +#endif #define might_lock(m) do { } while (0) #define might_lock_read(m) do { } while (0) From owner-svn-src-stable-11@freebsd.org Mon May 18 09:23:18 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 9D48813CD3D; Mon, 18 May 2020 09:23:18 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYTf3fZHz4Vyr; Mon, 18 May 2020 09:23:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 788E71F7B0; Mon, 18 May 2020 09:23:18 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9NI2O064566; Mon, 18 May 2020 09:23:18 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9NIRI064565; Mon, 18 May 2020 09:23:18 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180923.04I9NIRI064565@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:23:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361193 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361193 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:23:18 -0000 Author: hselasky Date: Mon May 18 09:23:18 2020 New Revision: 361193 URL: https://svnweb.freebsd.org/changeset/base/361193 Log: MFC r360529: Implement more lockdep macros in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:22:47 2020 (r361192) +++ stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Mon May 18 09:23:18 2020 (r361193) @@ -36,6 +36,7 @@ struct lock_class_key { }; #define lockdep_set_class(lock, key) +#define lockdep_set_subclass(lock, sub) #define lockdep_set_class_and_name(lock, key, name) #define lockdep_set_current_reclaim_state(g) do { } while (0) #define lockdep_clear_current_reclaim_state() do { } while (0) @@ -60,6 +61,7 @@ lockdep_is_held(void *__m) __lock = __m; return (LOCK_CLASS(__lock)->lc_owner(__lock, &__td) != 0); } +#define lockdep_is_held_type(_m, _t) lockdep_is_held(_m) #else #define lockdep_assert_held(m) do { } while (0) @@ -67,6 +69,7 @@ lockdep_is_held(void *__m) #define lockdep_assert_held_once(m) do { } while (0) #define lockdep_is_held(m) 1 +#define lockdep_is_held_type(_m, _t) 1 #endif #define might_lock(m) do { } while (0) @@ -75,5 +78,8 @@ lockdep_is_held(void *__m) #define lock_acquire(...) do { } while (0) #define lock_release(...) do { } while (0) #define lock_acquire_shared_recursive(...) do { } while (0) + +#define mutex_acquire(...) do { } while (0) +#define mutex_release(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:24:36 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AEC3113CE46; Mon, 18 May 2020 09:24:36 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYW84Dt9z4WRQ; Mon, 18 May 2020 09:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8C9581F634; Mon, 18 May 2020 09:24:36 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9OaeY064739; Mon, 18 May 2020 09:24:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Oas3064738; Mon, 18 May 2020 09:24:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180924.04I9Oas3064738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:24:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361195 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361195 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:24:36 -0000 Author: hselasky Date: Mon May 18 09:24:36 2020 New Revision: 361195 URL: https://svnweb.freebsd.org/changeset/base/361195 Log: MFC r360530: Implement DIV64_U64_ROUND_UP() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/math64.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:24:05 2020 (r361194) +++ stable/11/sys/compat/linuxkpi/common/include/linux/math64.h Mon May 18 09:24:36 2020 (r361195) @@ -91,4 +91,13 @@ mul_u32_u32(uint32_t a, uint32_t b) return ((uint64_t)a * b); } +static inline uint64_t +div64_u64_round_up(uint64_t dividend, uint64_t divisor) +{ + return ((dividend + divisor - 1) / divisor); +} + +#define DIV64_U64_ROUND_UP(...) \ + div64_u64_round_up(__VA_ARGS__) + #endif /* _LINUX_MATH64_H */ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:25:56 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 502F413CF17; Mon, 18 May 2020 09:25:56 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYXh1SGTz4WmQ; Mon, 18 May 2020 09:25:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2D4171F7B2; Mon, 18 May 2020 09:25:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9PugO064929; Mon, 18 May 2020 09:25:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Pul4064928; Mon, 18 May 2020 09:25:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180925.04I9Pul4064928@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:25:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361197 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361197 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:25:56 -0000 Author: hselasky Date: Mon May 18 09:25:55 2020 New Revision: 361197 URL: https://svnweb.freebsd.org/changeset/base/361197 Log: MFC r360531: Implement mutex_lock_killable() in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:25:23 2020 (r361196) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Mon May 18 09:25:55 2020 (r361197) @@ -66,6 +66,18 @@ typedef struct mutex { linux_mutex_lock_interruptible(_m); \ }) +/* + * Reuse the interruptable method since the SX + * lock handles both signals and interrupts: + */ +#define mutex_lock_killable(_m) ({ \ + MUTEX_SKIP() ? 0 : \ + linux_mutex_lock_interruptible(_m); \ +}) + +#define mutex_lock_killable_nested(_m, _sub) \ + mutex_lock_killable(_m) + #define mutex_unlock(_m) do { \ if (MUTEX_SKIP()) \ break; \ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:32:57 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1EC3C13CFDC; Mon, 18 May 2020 09:32:57 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYhn03VFz4X7s; Mon, 18 May 2020 09:32:57 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F162D1F65E; Mon, 18 May 2020 09:32:56 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9WuLs071046; Mon, 18 May 2020 09:32:56 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9Wucb071045; Mon, 18 May 2020 09:32:56 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180932.04I9Wucb071045@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:32:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361199 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361199 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:32:57 -0000 Author: hselasky Date: Mon May 18 09:32:56 2020 New Revision: 361199 URL: https://svnweb.freebsd.org/changeset/base/361199 Log: MFC r345103: Implement more PCI speed related functions and macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Limelight Networks Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:26:42 2020 (r361198) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:32:56 2020 (r361199) @@ -141,10 +141,13 @@ struct pci_device_id { #define PCI_EXP_TYPE_RC_EC PCIEM_TYPE_ROOT_EC /* Root Complex Event Collector */ #define PCI_EXP_LNKCAP_SLS_2_5GB 0x01 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP_SLS_5_0GB 0x02 /* Supported Link Speed 5.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_8_0GB 0x04 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP_SLS_16_0GB 0x08 /* Supported Link Speed 16.0GT/s */ #define PCI_EXP_LNKCAP_MLW 0x03f0 /* Maximum Link Width */ #define PCI_EXP_LNKCAP2_SLS_2_5GB 0x02 /* Supported Link Speed 2.5GT/s */ #define PCI_EXP_LNKCAP2_SLS_5_0GB 0x04 /* Supported Link Speed 5.0GT/s */ #define PCI_EXP_LNKCAP2_SLS_8_0GB 0x08 /* Supported Link Speed 8.0GT/s */ +#define PCI_EXP_LNKCAP2_SLS_16_0GB 0x10 /* Supported Link Speed 16.0GT/s */ #define PCI_EXP_LNKCTL_HAWD PCIEM_LINK_CTL_HAWD #define PCI_EXP_LNKCAP_CLKPM 0x00040000 @@ -159,10 +162,19 @@ enum pci_bus_speed { PCIE_SPEED_2_5GT, PCIE_SPEED_5_0GT, PCIE_SPEED_8_0GT, + PCIE_SPEED_16_0GT, }; enum pcie_link_width { - PCIE_LNK_WIDTH_UNKNOWN = 0xFF, + PCIE_LNK_WIDTH_RESRV = 0x00, + PCIE_LNK_X1 = 0x01, + PCIE_LNK_X2 = 0x02, + PCIE_LNK_X4 = 0x04, + PCIE_LNK_X8 = 0x08, + PCIE_LNK_X12 = 0x0c, + PCIE_LNK_X16 = 0x10, + PCIE_LNK_X32 = 0x20, + PCIE_LNK_WIDTH_UNKNOWN = 0xff, }; typedef int pci_power_t; @@ -895,6 +907,67 @@ static inline int pci_num_vf(struct pci_dev *dev) { return (0); +} + +static inline enum pci_bus_speed +pcie_get_speed_cap(struct pci_dev *dev) +{ + device_t root; + uint32_t lnkcap, lnkcap2; + int error, pos; + + root = device_get_parent(dev->dev.bsddev); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + root = device_get_parent(root); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + root = device_get_parent(root); + if (root == NULL) + return (PCI_SPEED_UNKNOWN); + + if (pci_get_vendor(root) == PCI_VENDOR_ID_VIA || + pci_get_vendor(root) == PCI_VENDOR_ID_SERVERWORKS) + return (PCI_SPEED_UNKNOWN); + + if ((error = pci_find_cap(root, PCIY_EXPRESS, &pos)) != 0) + return (PCI_SPEED_UNKNOWN); + + lnkcap2 = pci_read_config(root, pos + PCIER_LINK_CAP2, 4); + + if (lnkcap2) { /* PCIe r3.0-compliant */ + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_2_5GB) + return (PCIE_SPEED_2_5GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_5_0GB) + return (PCIE_SPEED_5_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_8_0GB) + return (PCIE_SPEED_8_0GT); + if (lnkcap2 & PCI_EXP_LNKCAP2_SLS_16_0GB) + return (PCIE_SPEED_16_0GT); + } else { /* pre-r3.0 */ + lnkcap = pci_read_config(root, pos + PCIER_LINK_CAP, 4); + if (lnkcap & PCI_EXP_LNKCAP_SLS_2_5GB) + return (PCIE_SPEED_2_5GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_5_0GB) + return (PCIE_SPEED_5_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_8_0GB) + return (PCIE_SPEED_8_0GT); + if (lnkcap & PCI_EXP_LNKCAP_SLS_16_0GB) + return (PCIE_SPEED_16_0GT); + } + return (PCI_SPEED_UNKNOWN); +} + +static inline enum pcie_link_width +pcie_get_width_cap(struct pci_dev *dev) +{ + uint32_t lnkcap; + + pcie_capability_read_dword(dev, PCI_EXP_LNKCAP, &lnkcap); + if (lnkcap) + return ((lnkcap & PCI_EXP_LNKCAP_MLW) >> 4); + + return (PCIE_LNK_WIDTH_UNKNOWN); } #endif /* _LINUX_PCI_H_ */ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:34:41 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D215913D41A; Mon, 18 May 2020 09:34:41 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYkn58Wgz4X8b; Mon, 18 May 2020 09:34:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AC0C11F7CB; Mon, 18 May 2020 09:34:41 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9Yfqj071210; Mon, 18 May 2020 09:34:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9YfgG071209; Mon, 18 May 2020 09:34:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180934.04I9YfgG071209@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:34:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361200 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361200 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:34:41 -0000 Author: hselasky Date: Mon May 18 09:34:41 2020 New Revision: 361200 URL: https://svnweb.freebsd.org/changeset/base/361200 Log: MFC r360532: Implement more PCI-express bandwidth functions in the LinuxKPI. Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pci.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:32:56 2020 (r361199) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pci.h Mon May 18 09:34:41 2020 (r361200) @@ -970,4 +970,45 @@ pcie_get_width_cap(struct pci_dev *dev) return (PCIE_LNK_WIDTH_UNKNOWN); } +static inline int +pcie_get_mps(struct pci_dev *dev) +{ + return (pci_get_max_payload(dev->dev.bsddev)); +} + +static inline uint32_t +PCIE_SPEED2MBS_ENC(enum pci_bus_speed spd) +{ + + switch(spd) { + case PCIE_SPEED_16_0GT: + return (16000 * 128 / 130); + case PCIE_SPEED_8_0GT: + return (8000 * 128 / 130); + case PCIE_SPEED_5_0GT: + return (5000 * 8 / 10); + case PCIE_SPEED_2_5GT: + return (2500 * 8 / 10); + default: + return (0); + } +} + +static inline uint32_t +pcie_bandwidth_available(struct pci_dev *pdev, + struct pci_dev **limiting, + enum pci_bus_speed *speed, + enum pcie_link_width *width) +{ + enum pci_bus_speed nspeed = pcie_get_speed_cap(pdev); + enum pcie_link_width nwidth = pcie_get_width_cap(pdev); + + if (speed) + *speed = nspeed; + if (width) + *width = nwidth; + + return (nwidth * PCIE_SPEED2MBS_ENC(nspeed)); +} + #endif /* _LINUX_PCI_H_ */ From owner-svn-src-stable-11@freebsd.org Mon May 18 09:36:15 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 0322413D44D; Mon, 18 May 2020 09:36:15 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYmZ6Jcdz4XPY; Mon, 18 May 2020 09:36:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id D3BA71F5A8; Mon, 18 May 2020 09:36:14 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9aE42071413; Mon, 18 May 2020 09:36:14 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9aESX071412; Mon, 18 May 2020 09:36:14 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180936.04I9aESX071412@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:36:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361202 - stable/11/sys/compat/linuxkpi/common/src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/src X-SVN-Commit-Revision: 361202 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:36:15 -0000 Author: hselasky Date: Mon May 18 09:36:14 2020 New Revision: 361202 URL: https://svnweb.freebsd.org/changeset/base/361202 Log: MFC r360621: Fix warning about sleeping with non-sleepable lock when allocating "current" from linux_cdev_pager_populate() in the LinuxKPI: Backtrace: witness_debugger() witness_warn() uma_zalloc_arg() malloc() linux_alloc_current() linux_cdev_pager_populate() vm_fault() vm_fault_trap() trap_pfault() trap() calltrap() Suggested by: avg@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 18 09:35:42 2020 (r361201) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Mon May 18 09:36:14 2020 (r361202) @@ -528,14 +528,14 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde struct vm_area_struct *vmap; int err; - linux_set_current(curthread); - /* get VM area structure */ vmap = linux_cdev_handle_find(vm_obj->handle); MPASS(vmap != NULL); MPASS(vmap->vm_private_data == vm_obj->handle); VM_OBJECT_WUNLOCK(vm_obj); + + linux_set_current(curthread); down_write(&vmap->vm_mm->mmap_sem); if (unlikely(vmap->vm_ops == NULL)) { From owner-svn-src-stable-11@freebsd.org Mon May 18 09:43:32 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id BA8E613D809; Mon, 18 May 2020 09:43:32 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYx04WQ7z4YFp; Mon, 18 May 2020 09:43:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7BB901F67F; Mon, 18 May 2020 09:43:32 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9hWCb077205; Mon, 18 May 2020 09:43:32 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9hWNU077204; Mon, 18 May 2020 09:43:32 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180943.04I9hWNU077204@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:43:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361204 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361204 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:43:32 -0000 Author: hselasky Date: Mon May 18 09:43:31 2020 New Revision: 361204 URL: https://svnweb.freebsd.org/changeset/base/361204 Log: MFC r360622: Implement more scatter and gather functions in the LinuxKPI. Differential Revision: https://reviews.freebsd.org/D24611 Submitted by: ashafer_badland.io (Austin Shafer) Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:37:02 2020 (r361203) +++ stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:43:31 2020 (r361204) @@ -64,6 +64,10 @@ struct sg_page_iter { } internal; }; +struct sg_dma_page_iter { + struct sg_page_iter base; +}; + #define SCATTERLIST_MAX_SEGMENT (-1U & ~(PAGE_SIZE - 1)) #define SG_MAX_SINGLE_ALLOC (PAGE_SIZE / sizeof(struct scatterlist)) @@ -83,6 +87,8 @@ struct sg_page_iter { #define for_each_sg_page(sgl, iter, nents, pgoffset) \ for (_sg_iter_init(sgl, iter, nents, pgoffset); \ (iter)->sg; _sg_iter_next(iter)) +#define for_each_sg_dma_page(sgl, iter, nents, pgoffset) \ + for_each_sg_page(sgl, &(iter)->base, nents, pgoffset) #define for_each_sg(sglist, sg, sgmax, iter) \ for (iter = 0, sg = (sglist); iter < (sgmax); iter++, sg = sg_next(sg)) @@ -402,6 +408,8 @@ sg_page_count(struct scatterlist *sg) { return (PAGE_ALIGN(sg->offset + sg->length) >> PAGE_SHIFT); } +#define sg_dma_page_count(sg) \ + sg_page_count(sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) @@ -424,6 +432,8 @@ __sg_page_iter_next(struct sg_page_iter *piter) } return (1); } +#define __sg_page_iter_dma_next(itr) \ + __sg_page_iter_next(&(itr)->base) static inline void _sg_iter_init(struct scatterlist *sgl, struct sg_page_iter *iter, @@ -441,11 +451,20 @@ _sg_iter_init(struct scatterlist *sgl, struct sg_page_ } } -static inline dma_addr_t -sg_page_iter_dma_address(struct sg_page_iter *spi) -{ - return (spi->sg->address + (spi->sg_pgoffset << PAGE_SHIFT)); -} +/* + * sg_page_iter_dma_address() is implemented as a macro because it + * needs to accept two different and identical structure types. This + * allows both old and new code to co-exist. The compile time assert + * adds some safety, that the structure sizes match. + */ +#define sg_page_iter_dma_address(spi) ({ \ + struct sg_page_iter *__spi = (void *)(spi); \ + dma_addr_t __dma_address; \ + CTASSERT(sizeof(*(spi)) == sizeof(*__spi)); \ + __dma_address = __spi->sg->address + \ + (__spi->sg_pgoffset << PAGE_SHIFT); \ + __dma_address; \ +}) static inline struct page * sg_page_iter_page(struct sg_page_iter *piter) From owner-svn-src-stable-11@freebsd.org Mon May 18 09:45:13 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E453713D5C4; Mon, 18 May 2020 09:45:13 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QYyx5kB6z4Yb6; Mon, 18 May 2020 09:45:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id BFA4C1FB00; Mon, 18 May 2020 09:45:13 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9jDRl077436; Mon, 18 May 2020 09:45:13 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9jDno077435; Mon, 18 May 2020 09:45:13 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180945.04I9jDno077435@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:45:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361206 - stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linuxkpi/common/include/linux X-SVN-Commit-Revision: 361206 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:45:14 -0000 Author: hselasky Date: Mon May 18 09:45:13 2020 New Revision: 361206 URL: https://svnweb.freebsd.org/changeset/base/361206 Log: MFC r360623: Optimise use of sg_page_count() in __sg_page_iter_next() in the LinuxKPI. No need to compute value twice. No functional change intended. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:44:26 2020 (r361205) +++ stable/11/sys/compat/linuxkpi/common/include/linux/scatterlist.h Mon May 18 09:45:13 2020 (r361206) @@ -414,6 +414,8 @@ sg_page_count(struct scatterlist *sg) static inline bool __sg_page_iter_next(struct sg_page_iter *piter) { + unsigned int pgcount; + if (piter->internal.nents == 0) return (0); if (piter->sg == NULL) @@ -422,8 +424,11 @@ __sg_page_iter_next(struct sg_page_iter *piter) piter->sg_pgoffset += piter->internal.pg_advance; piter->internal.pg_advance = 1; - while (piter->sg_pgoffset >= sg_page_count(piter->sg)) { - piter->sg_pgoffset -= sg_page_count(piter->sg); + while (1) { + pgcount = sg_page_count(piter->sg); + if (likely(piter->sg_pgoffset < pgcount)) + break; + piter->sg_pgoffset -= pgcount; piter->sg = sg_next(piter->sg); if (--piter->internal.nents == 0) return (0); From owner-svn-src-stable-11@freebsd.org Mon May 18 09:46:52 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 522CF13DB00; Mon, 18 May 2020 09:46:52 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QZ0r1Rsxz4YhW; Mon, 18 May 2020 09:46:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 2CA391F6BD; Mon, 18 May 2020 09:46:52 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04I9kqiX077639; Mon, 18 May 2020 09:46:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04I9kpsT077636; Mon, 18 May 2020 09:46:51 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005180946.04I9kpsT077636@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 18 May 2020 09:46:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361208 - stable/11/sys/dev/usb X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/dev/usb X-SVN-Commit-Revision: 361208 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 09:46:52 -0000 Author: hselasky Date: Mon May 18 09:46:51 2020 New Revision: 361208 URL: https://svnweb.freebsd.org/changeset/base/361208 Log: MFC r360925: Refresh the USB device strings when a USB device is re-enumerated. Submitted by: Horse Ma Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usb_device.c stable/11/sys/dev/usb/usb_device.h stable/11/sys/dev/usb/usb_hub.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usb_device.c ============================================================================== --- stable/11/sys/dev/usb/usb_device.c Mon May 18 09:45:59 2020 (r361207) +++ stable/11/sys/dev/usb/usb_device.c Mon May 18 09:46:51 2020 (r361208) @@ -101,7 +101,6 @@ static void usb_suspend_resume_sub(struct usb_device * uint8_t); static usb_proc_callback_t usbd_clear_stall_proc; static usb_error_t usb_config_parse(struct usb_device *, uint8_t, uint8_t); -static void usbd_set_device_strings(struct usb_device *); #if USB_HAVE_DEVCTL static void usb_notify_addq(const char *type, struct usb_device *); #endif @@ -1650,6 +1649,85 @@ usbd_clear_stall_proc(struct usb_proc_msg *_pm) } /*------------------------------------------------------------------------* + * usb_get_langid + * + * This function tries to figure out the USB string language to use. + *------------------------------------------------------------------------*/ +void +usb_get_langid(struct usb_device *udev) +{ + uint8_t *scratch_ptr; + uint8_t do_unlock; + int err; + + /* + * Workaround for buggy USB devices. + * + * It appears that some string-less USB chips will crash and + * disappear if any attempts are made to read any string + * descriptors. + * + * Try to detect such chips by checking the strings in the USB + * device descriptor. If no strings are present there we + * simply disable all USB strings. + */ + + /* Protect scratch area */ + do_unlock = usbd_ctrl_lock(udev); + + scratch_ptr = udev->scratch.data; + + if (udev->flags.no_strings) { + err = USB_ERR_INVAL; + } else if (udev->ddesc.iManufacturer || + udev->ddesc.iProduct || + udev->ddesc.iSerialNumber) { + /* read out the language ID string */ + err = usbd_req_get_string_desc(udev, NULL, + (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); + } else { + err = USB_ERR_INVAL; + } + + if (err || (scratch_ptr[0] < 4)) { + udev->flags.no_strings = 1; + } else { + uint16_t langid; + uint16_t pref; + uint16_t mask; + uint8_t x; + + /* load preferred value and mask */ + pref = usb_lang_id; + mask = usb_lang_mask; + + /* align length correctly */ + scratch_ptr[0] &= ~1U; + + /* fix compiler warning */ + langid = 0; + + /* search for preferred language */ + for (x = 2; x < scratch_ptr[0]; x += 2) { + langid = UGETW(scratch_ptr + x); + if ((langid & mask) == pref) + break; + } + if (x >= scratch_ptr[0]) { + /* pick the first language as the default */ + DPRINTFN(1, "Using first language\n"); + langid = UGETW(scratch_ptr + 2); + } + + DPRINTFN(1, "Language selected: 0x%04x\n", langid); + udev->langid = langid; + } + + if (do_unlock) + usbd_ctrl_unlock(udev); +} + +/*------------------------------------------------------------------------* * usb_alloc_device * * This function allocates a new USB device. This function is called @@ -1670,13 +1748,11 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * struct usb_device *udev; struct usb_device *adev; struct usb_device *hub; - uint8_t *scratch_ptr; usb_error_t err; uint8_t device_index; uint8_t config_index; uint8_t config_quirk; uint8_t set_config_failed; - uint8_t do_unlock; DPRINTF("parent_dev=%p, bus=%p, parent_hub=%p, depth=%u, " "port_index=%u, port_no=%u, speed=%u, usb_mode=%u\n", @@ -1886,76 +1962,13 @@ usb_alloc_device(device_t parent_dev, struct usb_bus * if (usb_test_quirk(&uaa, UQ_NO_STRINGS)) { udev->flags.no_strings = 1; } - /* - * Workaround for buggy USB devices. - * - * It appears that some string-less USB chips will crash and - * disappear if any attempts are made to read any string - * descriptors. - * - * Try to detect such chips by checking the strings in the USB - * device descriptor. If no strings are present there we - * simply disable all USB strings. - */ - /* Protect scratch area */ - do_unlock = usbd_ctrl_lock(udev); + usb_get_langid(udev); - scratch_ptr = udev->scratch.data; - - if (udev->flags.no_strings) { - err = USB_ERR_INVAL; - } else if (udev->ddesc.iManufacturer || - udev->ddesc.iProduct || - udev->ddesc.iSerialNumber) { - /* read out the language ID string */ - err = usbd_req_get_string_desc(udev, NULL, - (char *)scratch_ptr, 4, 0, USB_LANGUAGE_TABLE); - } else { - err = USB_ERR_INVAL; - } - - if (err || (scratch_ptr[0] < 4)) { - udev->flags.no_strings = 1; - } else { - uint16_t langid; - uint16_t pref; - uint16_t mask; - uint8_t x; - - /* load preferred value and mask */ - pref = usb_lang_id; - mask = usb_lang_mask; - - /* align length correctly */ - scratch_ptr[0] &= ~1U; - - /* fix compiler warning */ - langid = 0; - - /* search for preferred language */ - for (x = 2; (x < scratch_ptr[0]); x += 2) { - langid = UGETW(scratch_ptr + x); - if ((langid & mask) == pref) - break; - } - if (x >= scratch_ptr[0]) { - /* pick the first language as the default */ - DPRINTFN(1, "Using first language\n"); - langid = UGETW(scratch_ptr + 2); - } - - DPRINTFN(1, "Language selected: 0x%04x\n", langid); - udev->langid = langid; - } - - if (do_unlock) - usbd_ctrl_unlock(udev); - /* assume 100mA bus powered for now. Changed when configured. */ udev->power = USB_MIN_POWER; /* fetch the vendor and product strings from the device */ - usbd_set_device_strings(udev); + usb_set_device_strings(udev); if (udev->flags.usb_mode == USB_MODE_DEVICE) { /* USB device mode setup is complete */ @@ -2475,8 +2488,8 @@ struct usb_knowndev { #include "usbdevs_data.h" #endif /* USB_VERBOSE */ -static void -usbd_set_device_strings(struct usb_device *udev) +void +usb_set_device_strings(struct usb_device *udev) { struct usb_device_descriptor *udd = &udev->ddesc; #ifdef USB_VERBOSE @@ -2496,6 +2509,16 @@ usbd_set_device_strings(struct usb_device *udev) vendor_id = UGETW(udd->idVendor); product_id = UGETW(udd->idProduct); + + /* cleanup old strings, if any */ + free(udev->serial, M_USB); + free(udev->manufacturer, M_USB); + free(udev->product, M_USB); + + /* zero the string pointers */ + udev->serial = NULL; + udev->manufacturer = NULL; + udev->product = NULL; /* get serial number string */ usbd_req_get_string_any(udev, NULL, temp_ptr, temp_size, Modified: stable/11/sys/dev/usb/usb_device.h ============================================================================== --- stable/11/sys/dev/usb/usb_device.h Mon May 18 09:45:59 2020 (r361207) +++ stable/11/sys/dev/usb/usb_device.h Mon May 18 09:46:51 2020 (r361208) @@ -326,6 +326,9 @@ struct usb_endpoint *usb_endpoint_foreach(struct usb_d void usb_set_device_state(struct usb_device *, enum usb_dev_state); enum usb_dev_state usb_get_device_state(struct usb_device *); +void usb_set_device_strings(struct usb_device *); +void usb_get_langid(struct usb_device *); + uint8_t usbd_enum_lock(struct usb_device *); #if USB_HAVE_UGEN uint8_t usbd_enum_lock_sig(struct usb_device *); Modified: stable/11/sys/dev/usb/usb_hub.c ============================================================================== --- stable/11/sys/dev/usb/usb_hub.c Mon May 18 09:45:59 2020 (r361207) +++ stable/11/sys/dev/usb/usb_hub.c Mon May 18 09:46:51 2020 (r361208) @@ -470,8 +470,14 @@ uhub_explore_handle_re_enumerate(struct usb_device *ch } else { err = usbd_req_re_enumerate(child, NULL); } - if (err == 0) + if (err == 0) { + /* refresh device strings */ + usb_get_langid(child); + usb_set_device_strings(child); + + /* set default configuration */ err = usbd_set_config_index(child, 0); + } if (err == 0) { err = usb_probe_and_attach(child, USB_IFACE_INDEX_ANY); @@ -1724,6 +1730,7 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch struct usb_hub *hub; struct usb_interface *iface; struct hub_result res; + uint8_t do_unlock; if (!device_is_attached(parent)) { if (buflen) @@ -1745,6 +1752,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch } iface = usbd_get_iface(res.udev, res.iface_index); if (iface && iface->idesc) { + /* Make sure device information is not changed during the print. */ + do_unlock = usbd_ctrl_lock(res.udev); + snprintf(buf, buflen, "vendor=0x%04x product=0x%04x " "devclass=0x%02x devsubclass=0x%02x " "devproto=0x%02x " @@ -1766,6 +1776,9 @@ uhub_child_pnpinfo_string(device_t parent, device_t ch iface->idesc->bInterfaceProtocol, iface->pnpinfo ? " " : "", iface->pnpinfo ? iface->pnpinfo : ""); + + if (do_unlock) + usbd_ctrl_unlock(res.udev); } else { if (buflen) { buf[0] = '\0'; From owner-svn-src-stable-11@freebsd.org Mon May 18 14:38:28 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5C3242CC3D4; Mon, 18 May 2020 14:38:28 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QhTJ1nJhz3b7w; Mon, 18 May 2020 14:38:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 382A022FAB; Mon, 18 May 2020 14:38:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04IEcS1F054761; Mon, 18 May 2020 14:38:28 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04IEcSXK054760; Mon, 18 May 2020 14:38:28 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005181438.04IEcSXK054760@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Mon, 18 May 2020 14:38:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361212 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 361212 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 May 2020 14:38:28 -0000 Author: kib Date: Mon May 18 14:38:27 2020 New Revision: 361212 URL: https://svnweb.freebsd.org/changeset/base/361212 Log: MFC r361077, r361078, r361079: Improve comment for compat32 handling of sysctl hw.pagesizes. Modified: stable/11/sys/kern/kern_mib.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_mib.c ============================================================================== --- stable/11/sys/kern/kern_mib.c Mon May 18 14:37:10 2020 (r361211) +++ stable/11/sys/kern/kern_mib.c Mon May 18 14:38:27 2020 (r361212) @@ -235,8 +235,9 @@ sysctl_hw_pagesizes(SYSCTL_HANDLER_ARGS) if (req->flags & SCTL_MASK32) { /* - * Recreate the "pagesizes" array with 32-bit elements. Truncate - * any page size greater than UINT32_MAX to zero. + * Recreate the "pagesizes" array with 32-bit elements. + * Truncate any page size greater than UINT32_MAX to zero, + * which assumes that page sizes are powers of two. */ for (i = 0; i < MAXPAGESIZES; i++) pagesizes32[i] = (uint32_t)pagesizes[i]; From owner-svn-src-stable-11@freebsd.org Tue May 19 01:43:02 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CCF172F40F8; Tue, 19 May 2020 01:43:02 +0000 (UTC) (envelope-from freqlabs@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49QzD65G4rz3SGg; Tue, 19 May 2020 01:43:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9577A2AFA1; Tue, 19 May 2020 01:43:02 +0000 (UTC) (envelope-from freqlabs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04J1h2Ze070557; Tue, 19 May 2020 01:43:02 GMT (envelope-from freqlabs@FreeBSD.org) Received: (from freqlabs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04J1h13M070549; Tue, 19 May 2020 01:43:01 GMT (envelope-from freqlabs@FreeBSD.org) Message-Id: <202005190143.04J1h13M070549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: freqlabs set sender to freqlabs@FreeBSD.org using -f From: Ryan Moeller Date: Tue, 19 May 2020 01:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361236 - in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Group: stable-11 X-SVN-Commit-Author: freqlabs X-SVN-Commit-Paths: in stable: 11/sys/fs/nfs 11/sys/fs/nfsclient 11/sys/fs/nfsserver 12/sys/fs/nfs 12/sys/fs/nfsclient 12/sys/fs/nfsserver X-SVN-Commit-Revision: 361236 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 01:43:02 -0000 Author: freqlabs Date: Tue May 19 01:43:00 2020 New Revision: 361236 URL: https://svnweb.freebsd.org/changeset/base/361236 Log: MFC r360960: nfs: Remove APPLESTATIC macro It is no longer useful. Reviewed by: rmacklem Approved by: mav (mentor) Sponsored by: iXsystems, Inc. Differential Revision: https://reviews.freebsd.org/D24811 Modified: stable/11/sys/fs/nfs/nfs_commonacl.c stable/11/sys/fs/nfs/nfs_commonsubs.c stable/11/sys/fs/nfs/nfsport.h stable/11/sys/fs/nfsclient/nfs_clcomsubs.c stable/11/sys/fs/nfsclient/nfs_clport.c stable/11/sys/fs/nfsclient/nfs_clrpcops.c stable/11/sys/fs/nfsclient/nfs_clstate.c stable/11/sys/fs/nfsserver/nfs_nfsdcache.c stable/11/sys/fs/nfsserver/nfs_nfsdserv.c stable/11/sys/fs/nfsserver/nfs_nfsdsocket.c stable/11/sys/fs/nfsserver/nfs_nfsdstate.c stable/11/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/sys/fs/nfs/nfs_commonacl.c stable/12/sys/fs/nfs/nfs_commonsubs.c stable/12/sys/fs/nfs/nfsport.h stable/12/sys/fs/nfsclient/nfs_clcomsubs.c stable/12/sys/fs/nfsclient/nfs_clport.c stable/12/sys/fs/nfsclient/nfs_clrpcops.c stable/12/sys/fs/nfsclient/nfs_clstate.c stable/12/sys/fs/nfsserver/nfs_nfsdcache.c stable/12/sys/fs/nfsserver/nfs_nfsdserv.c stable/12/sys/fs/nfsserver/nfs_nfsdsocket.c stable/12/sys/fs/nfsserver/nfs_nfsdstate.c stable/12/sys/fs/nfsserver/nfs_nfsdsubs.c Directory Properties: stable/12/ (props changed) Modified: stable/11/sys/fs/nfs/nfs_commonacl.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonacl.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfs/nfs_commonacl.c Tue May 19 01:43:00 2020 (r361236) @@ -38,7 +38,7 @@ static int nfsrv_acemasktoperm(u_int32_t acetype, u_in /* * Handle xdr for an ace. */ -APPLESTATIC int +int nfsrv_dissectace(struct nfsrv_descript *nd, struct acl_entry *acep, int *aceerrp, int *acesizep, NFSPROC_T *p) { @@ -386,7 +386,7 @@ nfsrv_buildace(struct nfsrv_descript *nd, u_char *name /* * Build an NFSv4 ACL. */ -APPLESTATIC int +int nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *aclp, enum vtype type, NFSPROC_T *p) { @@ -448,7 +448,7 @@ nfsrv_buildacl(struct nfsrv_descript *nd, NFSACL_T *ac /* * Set an NFSv4 acl. */ -APPLESTATIC int +int nfsrv_setacl(vnode_t vp, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p) { @@ -479,7 +479,7 @@ out: * Compare two NFSv4 acls. * Return 0 if they are the same, 1 if not the same. */ -APPLESTATIC int +int nfsrv_compareacl(NFSACL_T *aclp1, NFSACL_T *aclp2) { int i; Modified: stable/11/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/11/sys/fs/nfs/nfs_commonsubs.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfs/nfs_commonsubs.c Tue May 19 01:43:00 2020 (r361236) @@ -286,7 +286,7 @@ out: * This is used by the macro NFSM_DISSECT for tough * cases. */ -APPLESTATIC void * +void * nfsm_dissct(struct nfsrv_descript *nd, int siz, int how) { mbuf_t mp2; @@ -352,7 +352,7 @@ nfsm_dissct(struct nfsrv_descript *nd, int siz, int ho * here than check for offs > 0 for all calls to nfsm_advance. * If left == -1, it should be calculated here. */ -APPLESTATIC int +int nfsm_advance(struct nfsrv_descript *nd, int offs, int left) { int error = 0; @@ -400,7 +400,7 @@ out: * Copy a string into mbuf(s). * Return the number of bytes output, including XDR overheads. */ -APPLESTATIC int +int nfsm_strtom(struct nfsrv_descript *nd, const char *cp, int siz) { mbuf_t m2; @@ -457,7 +457,7 @@ nfsm_strtom(struct nfsrv_descript *nd, const char *cp, /* * Called once to initialize data structures... */ -APPLESTATIC void +void newnfs_init(void) { static int nfs_inited = 0; @@ -487,7 +487,7 @@ newnfs_init(void) * set_true == 1 if there should be an newnfs_true prepended on the file handle. * Return the number of bytes output, including XDR overhead. */ -APPLESTATIC int +int nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, int size, int set_true) { u_int32_t *tl; @@ -530,7 +530,7 @@ nfsm_fhtom(struct nfsrv_descript *nd, u_int8_t *fhp, i * The AF_INET family is handled as a special case so that address mbufs * don't need to be saved to store "struct in_addr", which is only 4 bytes. */ -APPLESTATIC int +int nfsaddr_match(int family, union nethostaddr *haddr, NFSSOCKADDR_T nam) { struct sockaddr_in *inetaddr; @@ -563,7 +563,7 @@ nfsaddr_match(int family, union nethostaddr *haddr, NF /* * Similar to the above, but takes to NFSSOCKADDR_T args. */ -APPLESTATIC int +int nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) { struct sockaddr_in *addr1, *addr2; @@ -601,7 +601,7 @@ nfsaddr2_match(NFSSOCKADDR_T nam1, NFSSOCKADDR_T nam2) /* * Trim the stuff already dissected off the mbuf list. */ -APPLESTATIC void +void newnfs_trimleading(nd) struct nfsrv_descript *nd; { @@ -647,7 +647,7 @@ newnfs_trimleading(nd) /* * Trim trailing data off the mbuf list being built. */ -APPLESTATIC void +void newnfs_trimtrailing(nd, mb, bpos) struct nfsrv_descript *nd; mbuf_t mb; @@ -666,7 +666,7 @@ newnfs_trimtrailing(nd, mb, bpos) /* * Dissect a file handle on the client. */ -APPLESTATIC int +int nfsm_getfh(struct nfsrv_descript *nd, struct nfsfh **nfhpp) { u_int32_t *tl; @@ -701,7 +701,7 @@ nfsmout: * Break down the nfsv4 acl. * If the aclp == NULL or won't fit in an acl, just discard the acl info. */ -APPLESTATIC int +int nfsrv_dissectacl(struct nfsrv_descript *nd, NFSACL_T *aclp, int *aclerrp, int *aclsizep, __unused NFSPROC_T *p) { @@ -767,7 +767,7 @@ nfsmout: * Returns EBADRPC for a parsing error, 0 otherwise. * If the clearinvalid flag is set, clear the bits not supported. */ -APPLESTATIC int +int nfsrv_getattrbits(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp, int *cntp, int *retnotsupp) { @@ -813,7 +813,7 @@ nfsmout: * and 0 otherwise. * Returns EBADRPC if it can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsv4_loadattr(struct nfsrv_descript *nd, vnode_t vp, struct nfsvattr *nap, struct nfsfh **nfhpp, fhandle_t *fhp, int fhsize, struct nfsv3_pathconf *pc, struct statfs *sbp, struct nfsstatfs *sfp, @@ -1851,7 +1851,7 @@ nfsmout: * and the mp argument indicates to check for a forced dismount, iff not * NULL. */ -APPLESTATIC int +int nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *isleptp, void *mutex, struct mount *mp) { @@ -1898,7 +1898,7 @@ nfsv4_lock(struct nfsv4lock *lp, int iwantlock, int *i * The second argument is set to 1 to indicate the nfslock_usecnt should be * incremented, as well. */ -APPLESTATIC void +void nfsv4_unlock(struct nfsv4lock *lp, int incref) { @@ -1911,7 +1911,7 @@ nfsv4_unlock(struct nfsv4lock *lp, int incref) /* * Release a reference cnt. */ -APPLESTATIC void +void nfsv4_relref(struct nfsv4lock *lp) { @@ -1931,7 +1931,7 @@ nfsv4_relref(struct nfsv4lock *lp) * If the mp argument is not NULL, check for NFSCL_FORCEDISM() being set and * return without getting a refcnt for that case. */ -APPLESTATIC void +void nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void *mutex, struct mount *mp) { @@ -1961,7 +1961,7 @@ nfsv4_getref(struct nfsv4lock *lp, int *isleptp, void * Get a reference as above, but return failure instead of sleeping if * an exclusive lock is held. */ -APPLESTATIC int +int nfsv4_getref_nonblock(struct nfsv4lock *lp) { @@ -1975,7 +1975,7 @@ nfsv4_getref_nonblock(struct nfsv4lock *lp) /* * Test for a lock. Return 1 if locked, 0 otherwise. */ -APPLESTATIC int +int nfsv4_testlock(struct nfsv4lock *lp) { @@ -2003,7 +2003,7 @@ nfsv4_wanted(struct nfsv4lock *lp) * Return EBADRPC if there is an mbuf error, * 0 otherwise. */ -APPLESTATIC int +int nfsrv_mtostr(struct nfsrv_descript *nd, char *str, int siz) { char *cp; @@ -2054,7 +2054,7 @@ out: /* * Fill in the attributes as marked by the bitmap (V4). */ -APPLESTATIC int +int nfsv4_fillattr(struct nfsrv_descript *nd, struct mount *mp, vnode_t vp, NFSACL_T *saclp, struct vattr *vap, fhandle_t *fhp, int rderror, nfsattrbit_t *attrbitp, struct ucred *cred, NFSPROC_T *p, int isdgram, @@ -2564,7 +2564,7 @@ nfsv4_fillattr(struct nfsrv_descript *nd, struct mount * Put the attribute bits onto an mbuf list. * Return the number of bytes of output generated. */ -APPLESTATIC int +int nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit_t *attrbitp) { u_int32_t *tl; @@ -2589,7 +2589,7 @@ nfsrv_putattrbit(struct nfsrv_descript *nd, nfsattrbit * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_uidtostr(uid_t uid, u_char **cpp, int *retlenp, NFSPROC_T *p) { int i; @@ -2748,7 +2748,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtouid(struct nfsrv_descript *nd, u_char *str, int len, uid_t *uidp, NFSPROC_T *p) { @@ -2851,7 +2851,7 @@ out: * (malloc a larger one, as required) * retlenp - pointer to length to be returned */ -APPLESTATIC void +void nfsv4_gidtostr(gid_t gid, u_char **cpp, int *retlenp, NFSPROC_T *p) { int i; @@ -2964,7 +2964,7 @@ tryagain: * string is made up entirely of digits, just convert the string to * a number. */ -APPLESTATIC int +int nfsv4_strtogid(struct nfsrv_descript *nd, u_char *str, int len, gid_t *gidp, NFSPROC_T *p) { @@ -3090,7 +3090,7 @@ nfsrv_cmpmixedcase(u_char *cp, u_char *cp2, int len) /* * Set the port for the nfsuserd. */ -APPLESTATIC int +int nfsrv_nfsuserdport(struct nfsuserd_args *nargs, NFSPROC_T *p) { struct nfssockreq *rp; @@ -3173,7 +3173,7 @@ out: /* * Delete the nfsuserd port. */ -APPLESTATIC void +void nfsrv_nfsuserddelport(void) { @@ -3260,7 +3260,7 @@ out: * This function is called from the nfssvc(2) system call, to update the * kernel user/group name list(s) for the V4 owner and ownergroup attributes. */ -APPLESTATIC int +int nfssvc_idname(struct nfsd_idargs *nidp) { struct nfsusrgrp *nusrp, *usrp, *newusrp; @@ -3654,7 +3654,7 @@ nfsrv_removeuser(struct nfsusrgrp *usrp, int isuser) * running, since it doesn't do any locking. * This function is meant to be used when the nfscommon module is unloaded. */ -APPLESTATIC void +void nfsrv_cleanusergroup(void) { struct nfsrv_lughash *hp, *hp2; @@ -3701,7 +3701,7 @@ nfsrv_cleanusergroup(void) * This function scans a byte string and checks for UTF-8 compliance. * It returns 0 if it conforms and NFSERR_INVAL if not. */ -APPLESTATIC int +int nfsrv_checkutf8(u_int8_t *cp, int len) { u_int32_t val = 0x0; @@ -3954,7 +3954,7 @@ nfsrv_refstrbigenough(int siz, u_char **cpp, u_char ** /* * Initialize the reply header data structures. */ -APPLESTATIC void +void nfsrvd_rephead(struct nfsrv_descript *nd) { mbuf_t mreq; @@ -4019,7 +4019,7 @@ newnfs_sndunlock(int *flagp) NFSUNLOCKSOCK(); } -APPLESTATIC int +int nfsv4_getipaddr(struct nfsrv_descript *nd, struct sockaddr_storage *sa, int *isudp) { @@ -4201,7 +4201,7 @@ nfsv4_seqsess_cacherep(uint32_t slotid, struct nfsslot /* * Generate the xdr for an NFSv4.1 Sequence Operation. */ -APPLESTATIC void +void nfsv4_setsequence(struct nfsmount *nmp, struct nfsrv_descript *nd, struct nfsclsession *sep, int dont_replycache) { @@ -4305,7 +4305,7 @@ nfsv4_sequencelookup(struct nfsmount *nmp, struct nfsc /* * Free a session slot. */ -APPLESTATIC void +void nfsv4_freeslot(struct nfsclsession *sep, int slot) { uint64_t bitval; Modified: stable/11/sys/fs/nfs/nfsport.h ============================================================================== --- stable/11/sys/fs/nfs/nfsport.h Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfs/nfsport.h Tue May 19 01:43:00 2020 (r361236) @@ -101,11 +101,6 @@ #include #include -/* - * For Darwin, these functions should be "static" when built in a kext. - * (This is always defined as nil otherwise.) - */ -#define APPLESTATIC #include #include #include Modified: stable/11/sys/fs/nfsclient/nfs_clcomsubs.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clcomsubs.c Tue May 19 01:43:00 2020 (r361236) @@ -127,7 +127,7 @@ static int nfs_bigrequest[NFSV41_NPROCS] = { * Start building a request. Mostly just put the first file handle in * place. */ -APPLESTATIC void +void nfscl_reqstart(struct nfsrv_descript *nd, int procnum, struct nfsmount *nmp, u_int8_t *nfhp, int fhlen, u_int32_t **opcntpp, struct nfsclsession *sep) { @@ -253,7 +253,7 @@ nfscl_reqstart(struct nfsrv_descript *nd, int procnum, * copies a uio scatter/gather list to an mbuf chain. * NOTE: can ony handle iovcnt == 1 */ -APPLESTATIC void +void nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *uiop, int siz) { char *uiocp; @@ -336,7 +336,7 @@ nfsm_uiombuf(struct nfsrv_descript *nd, struct uio *ui * Load vnode attributes from the xdr file attributes. * Returns EBADRPC if they can't be parsed, 0 otherwise. */ -APPLESTATIC int +int nfsm_loadattr(struct nfsrv_descript *nd, struct nfsvattr *nap) { struct nfs_fattr *fp; @@ -402,7 +402,7 @@ nfsmout: * This function finds the directory cookie that corresponds to the * logical byte offset given. */ -APPLESTATIC nfsuint64 * +nfsuint64 * nfscl_getcookie(struct nfsnode *np, off_t off, int add) { struct nfsdmap *dp, *dp2; @@ -454,7 +454,7 @@ nfscl_getcookie(struct nfsnode *np, off_t off, int add * the file handle and the file's attributes. * For V4, it assumes that Getfh and Getattr Op's results are here. */ -APPLESTATIC int +int nfscl_mtofh(struct nfsrv_descript *nd, struct nfsfh **nfhpp, struct nfsvattr *nap, int *attrflagp) { @@ -515,7 +515,7 @@ nfsmout: /* * Put a state Id in the mbuf list. */ -APPLESTATIC void +void nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4stateid_t *stateidp, int flag) { nfsv4stateid_t *st; @@ -547,7 +547,7 @@ nfsm_stateidtom(struct nfsrv_descript *nd, nfsv4statei /* * Initialize the owner/delegation sleep lock. */ -APPLESTATIC void +void nfscl_lockinit(struct nfsv4lock *lckp) { @@ -559,7 +559,7 @@ nfscl_lockinit(struct nfsv4lock *lckp) * Get an exclusive lock. (Not needed for OpenBSD4, since there is only one * thread for each posix process in the kernel.) */ -APPLESTATIC void +void nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) { int igotlock; @@ -572,7 +572,7 @@ nfscl_lockexcl(struct nfsv4lock *lckp, void *mutex) /* * Release an exclusive lock. */ -APPLESTATIC void +void nfscl_lockunlock(struct nfsv4lock *lckp) { @@ -582,7 +582,7 @@ nfscl_lockunlock(struct nfsv4lock *lckp) /* * Called to derefernce a lock on a stateid (delegation or open owner). */ -APPLESTATIC void +void nfscl_lockderef(struct nfsv4lock *lckp) { Modified: stable/11/sys/fs/nfsclient/nfs_clport.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clport.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clport.c Tue May 19 01:43:00 2020 (r361236) @@ -1196,7 +1196,7 @@ nfscl_checksattr(struct vattr *vap, struct nfsvattr *n * error should only be returned for the Open, Create and Setattr Ops. * As such, most calls can just pass in 0 for those arguments. */ -APPLESTATIC int +int nfscl_maperr(struct thread *td, int error, uid_t uid, gid_t gid) { struct proc *p; Modified: stable/11/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clrpcops.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clrpcops.c Tue May 19 01:43:00 2020 (r361236) @@ -151,7 +151,7 @@ static int nfsrpc_layoutgetres(struct nfsmount *, vnod /* * nfs null call from vfs. */ -APPLESTATIC int +int nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T *p) { int error; @@ -170,7 +170,7 @@ nfsrpc_null(vnode_t vp, struct ucred *cred, NFSPROC_T * For nfs version 3 and 4, use the access rpc to check accessibility. If file * modes are changed on the server, accesses might still fail later. */ -APPLESTATIC int +int nfsrpc_access(vnode_t vp, int acmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp) { @@ -213,7 +213,7 @@ nfsrpc_access(vnode_t vp, int acmode, struct ucred *cr /* * The actual rpc, separated out for Darwin. */ -APPLESTATIC int +int nfsrpc_accessrpc(vnode_t vp, u_int32_t mode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, u_int32_t *rmodep, void *stuff) @@ -274,7 +274,7 @@ nfsmout: /* * nfs open rpc */ -APPLESTATIC int +int nfsrpc_open(vnode_t vp, int amode, struct ucred *cred, NFSPROC_T *p) { struct nfsclopen *op; @@ -406,7 +406,7 @@ else printf(" fhl=0\n"); /* * the actual open rpc */ -APPLESTATIC int +int nfsrpc_openrpc(struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, u_int8_t *newfhp, int newfhlen, u_int32_t mode, struct nfsclopen *op, u_int8_t *name, int namelen, struct nfscldeleg **dpp, @@ -609,7 +609,7 @@ nfsmout: /* * open downgrade rpc */ -APPLESTATIC int +int nfsrpc_opendowngrade(vnode_t vp, u_int32_t mode, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -652,7 +652,7 @@ nfsmout: /* * V4 Close operation. */ -APPLESTATIC int +int nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) { struct nfsclclient *clp; @@ -674,7 +674,7 @@ nfsrpc_close(vnode_t vp, int doclose, NFSPROC_T *p) /* * Close the open. */ -APPLESTATIC void +void nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen *op, NFSPROC_T *p) { struct nfsrv_descript nfsd, *nd = &nfsd; @@ -771,7 +771,7 @@ nfsrpc_doclose(struct nfsmount *nmp, struct nfsclopen /* * The actual Close RPC. */ -APPLESTATIC int +int nfsrpc_closerpc(struct nfsrv_descript *nd, struct nfsmount *nmp, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p, int syscred) @@ -810,7 +810,7 @@ nfsmout: /* * V4 Open Confirm RPC. */ -APPLESTATIC int +int nfsrpc_openconfirm(vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfsclopen *op, struct ucred *cred, NFSPROC_T *p) { @@ -852,7 +852,7 @@ nfsmout: * Do the setclientid and setclientid confirm RPCs. Called from nfs_statfs() * when a mount has just occurred and when the server replies NFSERR_EXPIRED. */ -APPLESTATIC int +int nfsrpc_setclient(struct nfsmount *nmp, struct nfsclclient *clp, int reclaim, struct ucred *cred, NFSPROC_T *p) { @@ -1052,7 +1052,7 @@ nfsmout: /* * nfs getattr call. */ -APPLESTATIC int +int nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, void *stuff) { @@ -1079,7 +1079,7 @@ nfsrpc_getattr(vnode_t vp, struct ucred *cred, NFSPROC /* * nfs getattr call with non-vnode arguemnts. */ -APPLESTATIC int +int nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp, int fhlen, int syscred, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, u_int64_t *xidp, uint32_t *leasep) @@ -1119,7 +1119,7 @@ nfsrpc_getattrnovp(struct nfsmount *nmp, u_int8_t *fhp /* * Do an nfs setattr operation. */ -APPLESTATIC int +int nfsrpc_setattr(vnode_t vp, struct vattr *vap, NFSACL_T *aclp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *rnap, int *attrflagp, void *stuff) @@ -1246,7 +1246,7 @@ nfsrpc_setattrrpc(vnode_t vp, struct vattr *vap, /* * nfs lookup rpc */ -APPLESTATIC int +int nfsrpc_lookup(vnode_t dvp, char *name, int len, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, struct nfsfh **nfhpp, int *attrflagp, int *dattrflagp, void *stuff) @@ -1349,7 +1349,7 @@ nfsmout: /* * Do a readlink rpc. */ -APPLESTATIC int +int nfsrpc_readlink(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1405,7 +1405,7 @@ nfsmout: /* * Read operation. */ -APPLESTATIC int +int nfsrpc_read(vnode_t vp, struct uio *uiop, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -1563,7 +1563,7 @@ nfsmout: * the recovery thread could get stuck waiting for the buffer and recovery * will then deadlock. */ -APPLESTATIC int +int nfsrpc_write(vnode_t vp, struct uio *uiop, int *iomode, int *must_commit, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff, int called_from_strategy) @@ -1825,7 +1825,7 @@ nfsmout: * For NFS v2 this is a kludge. Use a create rpc but with the IFMT bits of the * mode set to specify the file type and the size field for rdev. */ -APPLESTATIC int +int nfsrpc_mknod(vnode_t dvp, char *name, int namelen, struct vattr *vap, u_int32_t rdev, enum vtype vtyp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -1905,7 +1905,7 @@ nfsmout: * Mostly just call the approriate routine. (I separated out v4, so that * error recovery wouldn't be as difficult.) */ -APPLESTATIC int +int nfsrpc_create(vnode_t dvp, char *name, int namelen, struct vattr *vap, nfsquad_t cverf, int fmode, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, @@ -2272,7 +2272,7 @@ nfsmout: /* * Nfs remove rpc */ -APPLESTATIC int +int nfsrpc_remove(vnode_t dvp, char *name, int namelen, vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) @@ -2349,7 +2349,7 @@ nfsmout: /* * Do an nfs rename rpc. */ -APPLESTATIC int +int nfsrpc_rename(vnode_t fdvp, vnode_t fvp, char *fnameptr, int fnamelen, vnode_t tdvp, vnode_t tvp, char *tnameptr, int tnamelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *fnap, struct nfsvattr *tnap, @@ -2507,7 +2507,7 @@ nfsmout: /* * nfs hard link create rpc */ -APPLESTATIC int +int nfsrpc_link(vnode_t dvp, vnode_t vp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nap, int *attrflagp, int *dattrflagp, void *dstuff) @@ -2570,7 +2570,7 @@ nfsmout: /* * nfs symbolic link create rpc */ -APPLESTATIC int +int nfsrpc_symlink(vnode_t dvp, char *name, int namelen, char *target, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2631,7 +2631,7 @@ nfsrpc_symlink(vnode_t dvp, char *name, int namelen, c /* * nfs make dir rpc */ -APPLESTATIC int +int nfsrpc_mkdir(vnode_t dvp, char *name, int namelen, struct vattr *vap, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, struct nfsvattr *nnap, struct nfsfh **nfhpp, int *attrflagp, @@ -2713,7 +2713,7 @@ nfsmout: /* * nfs remove directory call */ -APPLESTATIC int +int nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *dnap, int *dattrflagp, void *dstuff) { @@ -2769,7 +2769,7 @@ nfsrpc_rmdir(vnode_t dvp, char *name, int namelen, str * and returns the one for the next entry after this directory block in * there, as well. */ -APPLESTATIC int +int nfsrpc_readdir(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3201,7 +3201,7 @@ nfsmout: * (Also used for NFS V4 when mount flag set.) * (ditto above w.r.t. multiple of DIRBLKSIZ, etc.) */ -APPLESTATIC int +int nfsrpc_readdirplus(vnode_t vp, struct uio *uiop, nfsuint64 *cookiep, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, int *eofp, void *stuff) @@ -3692,7 +3692,7 @@ nfsmout: /* * Nfs commit rpc */ -APPLESTATIC int +int nfsrpc_commit(vnode_t vp, u_quad_t offset, int cnt, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -3743,7 +3743,7 @@ nfsmout: * NFS byte range lock rpc. * (Mostly just calls one of the three lower level RPC routines.) */ -APPLESTATIC int +int nfsrpc_advlock(vnode_t vp, off_t size, int op, struct flock *fl, int reclaim, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -3910,7 +3910,7 @@ nfsrpc_advlock(vnode_t vp, off_t size, int op, struct /* * The lower level routine for the LockT case. */ -APPLESTATIC int +int nfsrpc_lockt(struct nfsrv_descript *nd, vnode_t vp, struct nfsclclient *clp, u_int64_t off, u_int64_t len, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) @@ -4035,7 +4035,7 @@ nfsmout: /* * The actual Lock RPC. */ -APPLESTATIC int +int nfsrpc_lock(struct nfsrv_descript *nd, struct nfsmount *nmp, vnode_t vp, u_int8_t *nfhp, int fhlen, struct nfscllockowner *lp, int newone, int reclaim, u_int64_t off, u_int64_t len, short type, struct ucred *cred, @@ -4124,7 +4124,7 @@ nfsmout: * nfs statfs rpc * (always called with the vp for the mount point) */ -APPLESTATIC int +int nfsrpc_statfs(vnode_t vp, struct nfsstatfs *sbp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4203,7 +4203,7 @@ nfsmout: /* * nfs pathconf rpc */ -APPLESTATIC int +int nfsrpc_pathconf(vnode_t vp, struct nfsv3_pathconf *pc, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) @@ -4264,7 +4264,7 @@ nfsmout: /* * nfs version 3 fsinfo rpc call */ -APPLESTATIC int +int nfsrpc_fsinfo(vnode_t vp, struct nfsfsinfo *fsp, struct ucred *cred, NFSPROC_T *p, struct nfsvattr *nap, int *attrflagp, void *stuff) { @@ -4303,7 +4303,7 @@ nfsmout: /* * This function performs the Renew RPC. */ -APPLESTATIC int +int nfsrpc_renew(struct nfsclclient *clp, struct nfsclds *dsp, struct ucred *cred, NFSPROC_T *p) { @@ -4353,7 +4353,7 @@ nfsrpc_renew(struct nfsclclient *clp, struct nfsclds * /* * This function performs the Releaselockowner RPC. */ -APPLESTATIC int +int nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllockowner *lp, uint8_t *fh, int fhlen, struct ucred *cred, NFSPROC_T *p) { @@ -4392,7 +4392,7 @@ nfsrpc_rellockown(struct nfsmount *nmp, struct nfscllo /* * This function performs the Compound to get the mount pt FH. */ -APPLESTATIC int +int nfsrpc_getdirpath(struct nfsmount *nmp, u_char *dirpath, struct ucred *cred, NFSPROC_T *p) { @@ -4460,7 +4460,7 @@ nfsmout: /* * This function performs the Delegreturn RPC. */ -APPLESTATIC int +int nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred *cred, struct nfsmount *nmp, NFSPROC_T *p, int syscred) { @@ -4493,7 +4493,7 @@ nfsrpc_delegreturn(struct nfscldeleg *dp, struct ucred /* * nfs getacl call. */ -APPLESTATIC int +int nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { @@ -4523,7 +4523,7 @@ nfsrpc_getacl(vnode_t vp, struct ucred *cred, NFSPROC_ /* * nfs setacl call. */ -APPLESTATIC int +int nfsrpc_setacl(vnode_t vp, struct ucred *cred, NFSPROC_T *p, struct acl *aclp, void *stuff) { Modified: stable/11/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- stable/11/sys/fs/nfsclient/nfs_clstate.c Tue May 19 01:40:45 2020 (r361235) +++ stable/11/sys/fs/nfsclient/nfs_clstate.c Tue May 19 01:43:00 2020 (r361236) @@ -206,7 +206,7 @@ static short *nfscl_cberrmap[] = { * Called for an open operation. * If the nfhp argument is NULL, just get an openowner. */ -APPLESTATIC int +int nfscl_open(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t amode, int usedeleg, struct ucred *cred, NFSPROC_T *p, struct nfsclowner **owpp, struct nfsclopen **opp, int *newonep, int *retp, int lockit) @@ -422,7 +422,7 @@ nfscl_newopen(struct nfsclclient *clp, struct nfscldel /* * Called to find/add a delegation to a client. */ -APPLESTATIC int +int nfscl_deleg(mount_t mp, struct nfsclclient *clp, u_int8_t *nfhp, int fhlen, struct ucred *cred, NFSPROC_T *p, struct nfscldeleg **dpp) { @@ -493,7 +493,7 @@ nfscl_finddeleg(struct nfsclclient *clp, u_int8_t *fhp * found, return either a lockowner stateid or the open stateid. * If no Open is found, just return error and the special stateid of all zeros. */ -APPLESTATIC int +int nfscl_getstateid(vnode_t vp, u_int8_t *nfhp, int fhlen, u_int32_t mode, int fords, struct ucred *cred, NFSPROC_T *p, nfsv4stateid_t *stateidp, void **lckpp) @@ -717,7 +717,7 @@ nfscl_getopen(struct nfsclownerhead *ohp, u_int8_t *nf * Release use of an open owner. Called when open operations are done * with the open owner. */ -APPLESTATIC void +void nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclowner *owp, __unused int error, __unused int candelete, int unlocked) { @@ -738,7 +738,7 @@ nfscl_ownerrelease(struct nfsmount *nmp, struct nfsclo /* * Release use of an open structure under an open owner. */ -APPLESTATIC void +void nfscl_openrelease(struct nfsmount *nmp, struct nfsclopen *op, int error, int candelete) { @@ -772,7 +772,7 @@ nfscl_openrelease(struct nfsmount *nmp, struct nfsclop * thread if this creates a new clp. * It always clpp with a reference count on it, unless returning an error. */ -APPLESTATIC int +int nfscl_getcl(struct mount *mp, struct ucred *cred, NFSPROC_T *p, int start_renewthread, struct nfsclclient **clpp) { @@ -935,7 +935,7 @@ nfscl_getcl(struct mount *mp, struct ucred *cred, NFSP /* * Get a reference to a clientid and return it, if valid. */ -APPLESTATIC struct nfsclclient * +struct nfsclclient * nfscl_findcl(struct nfsmount *nmp) { struct nfsclclient *clp; @@ -962,7 +962,7 @@ nfscl_clrelease(struct nfsclclient *clp) /* * External call for nfscl_clrelease. */ -APPLESTATIC void +void nfscl_clientrelease(struct nfsclclient *clp) { @@ -977,7 +977,7 @@ nfscl_clientrelease(struct nfsclclient *clp) /* * Called when wanting to lock a byte region. */ -APPLESTATIC int +int nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t len, short type, struct ucred *cred, NFSPROC_T *p, struct nfsclclient *rclp, int recovery, void *id, int flags, u_int8_t *rownp, u_int8_t *ropenownp, @@ -1177,7 +1177,7 @@ nfscl_getbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Called to unlock a byte range, for LockU. */ -APPLESTATIC int +int nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t len, __unused struct ucred *cred, NFSPROC_T *p, int callcnt, struct nfsclclient *clp, void *id, int flags, @@ -1289,7 +1289,7 @@ nfscl_relbytelock(vnode_t vp, u_int64_t off, u_int64_t /* * Release all lockowners marked in progess for this process and file. */ -APPLESTATIC void +void nfscl_releasealllocks(struct nfsclclient *clp, vnode_t vp, NFSPROC_T *p, void *id, int flags) { @@ -1327,7 +1327,7 @@ nfscl_releasealllocks(struct nfsclclient *clp, vnode_t * is required before a LockU. * If in doubt, return 1, so the flush will occur. */ -APPLESTATIC int +int nfscl_checkwritelocked(vnode_t vp, struct flock *fl, struct ucred *cred, NFSPROC_T *p, void *id, int flags) { @@ -1433,7 +1433,7 @@ nfscl_checkwritelocked(vnode_t vp, struct flock *fl, /* * Release a byte range lock owner structure. */ -APPLESTATIC void +void nfscl_lockrelease(struct nfscllockowner *lp, int error, int candelete) { struct nfsclclient *clp; @@ -1454,7 +1454,7 @@ nfscl_lockrelease(struct nfscllockowner *lp, int error /* * Free up an open structure and any associated byte range lock structures. */ -APPLESTATIC void +void nfscl_freeopen(struct nfsclopen *op, int local) { @@ -1551,7 +1551,7 @@ nfscl_freeopenowner(struct nfsclowner *owp, int local) /* * Free up a byte range lock owner structure. */ -APPLESTATIC void +void nfscl_freelockowner(struct nfscllockowner *lp, int local) { struct nfscllock *lop, *nlop; @@ -1570,7 +1570,7 @@ nfscl_freelockowner(struct nfscllockowner *lp, int loc /* * Free up a byte range lock structure. */ -APPLESTATIC void +void nfscl_freelock(struct nfscllock *lop, int local) { @@ -1871,7 +1871,7 @@ static int fake_global; /* Used to force visibility of /* * Called from nfs umount to free up the clientid. */ -APPLESTATIC void +void nfscl_umount(struct nfsmount *nmp, NFSPROC_T *p) { struct nfsclclient *clp; @@ -2281,7 +2281,7 @@ nfscl_recover(struct nfsclclient *clp, struct ucred *c * XXX Someday it should post a signal to the process(es) that hold the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Tue May 19 14:42:11 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 63B042DA0D7; Tue, 19 May 2020 14:42:11 +0000 (UTC) (envelope-from mav@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49RJW716bLz4cqw; Tue, 19 May 2020 14:42:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 21308C3C6; Tue, 19 May 2020 14:42:11 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04JEgB6X051918; Tue, 19 May 2020 14:42:11 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04JEgAZ2051912; Tue, 19 May 2020 14:42:10 GMT (envelope-from mav@FreeBSD.org) Message-Id: <202005191442.04JEgAZ2051912@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 19 May 2020 14:42:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361256 - stable/11/sys/cam/ctl X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/cam/ctl X-SVN-Commit-Revision: 361256 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2020 14:42:11 -0000 Author: mav Date: Tue May 19 14:42:09 2020 New Revision: 361256 URL: https://svnweb.freebsd.org/changeset/base/361256 Log: MFC r360564: Cleanup LUN addition/removal. - Make ctl_add_lun() synchronous. Asynchronous addition was used by Copan's proprietary code long ago and never for upstream FreeBSD. - Move LUN enable/disable calls from backends to CTL core. - Serialize LUN modification and partially removal to avoid double frees. - Slightly unify backends code. Modified: stable/11/sys/cam/ctl/ctl.c stable/11/sys/cam/ctl/ctl_backend.c stable/11/sys/cam/ctl/ctl_backend.h stable/11/sys/cam/ctl/ctl_backend_block.c stable/11/sys/cam/ctl/ctl_backend_ramdisk.c stable/11/sys/cam/ctl/ctl_private.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cam/ctl/ctl.c ============================================================================== --- stable/11/sys/cam/ctl/ctl.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl.c Tue May 19 14:42:09 2020 (r361256) @@ -461,10 +461,9 @@ static void ctl_ioctl_fill_ooa(struct ctl_lun *lun, ui struct ctl_ooa_entry *kern_entries); static int ctl_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td); -static int ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *lun, - struct ctl_be_lun *be_lun); +static int ctl_enable_lun(struct ctl_lun *lun); +static int ctl_disable_lun(struct ctl_lun *lun); static int ctl_free_lun(struct ctl_lun *lun); -static void ctl_create_lun(struct ctl_be_lun *be_lun); static int ctl_do_mode_select(union ctl_io *io); static int ctl_pro_preempt(struct ctl_softc *softc, struct ctl_lun *lun, @@ -538,7 +537,6 @@ static int ctl_datamove_remote_xfer(union ctl_io *io, static void ctl_datamove_remote_read(union ctl_io *io); static void ctl_datamove_remote(union ctl_io *io); static void ctl_process_done(union ctl_io *io); -static void ctl_lun_thread(void *arg); static void ctl_thresh_thread(void *arg); static void ctl_work_thread(void *arg); static void ctl_enqueue_incoming(union ctl_io *io); @@ -1935,7 +1933,6 @@ ctl_init(void) "HA link state (0 - offline, 1 - unknown, 2 - online)"); STAILQ_INIT(&softc->lun_list); - STAILQ_INIT(&softc->pending_lun_queue); STAILQ_INIT(&softc->fe_list); STAILQ_INIT(&softc->port_list); STAILQ_INIT(&softc->be_list); @@ -1963,12 +1960,6 @@ ctl_init(void) return (error); } } - error = kproc_kthread_add(ctl_lun_thread, softc, - &softc->ctl_proc, &softc->lun_thread, 0, 0, "ctl", "lun"); - if (error != 0) { - printf("error creating CTL lun thread!\n"); - return (error); - } error = kproc_kthread_add(ctl_thresh_thread, softc, &softc->ctl_proc, &softc->thresh_thread, 0, 0, "ctl", "thresh"); if (error != 0) { @@ -2009,11 +2000,6 @@ ctl_shutdown(void) } mtx_destroy(&thr->queue_lock); } - while (softc->lun_thread != NULL) { - wakeup(&softc->pending_lun_queue); - if (softc->lun_thread != NULL) - pause("CTL thr shutdown", 1); - } while (softc->thresh_thread != NULL) { wakeup(softc->thresh_thread); if (softc->thresh_thread != NULL) @@ -4512,32 +4498,23 @@ hex2bin(const char *str, uint8_t *buf, int buf_size) } /* - * LUN allocation. + * Add LUN. * - * Requirements: - * - caller allocates and zeros LUN storage, or passes in a NULL LUN if he - * wants us to allocate the LUN and he can block. - * - ctl_softc is always set - * - be_lun is set if the LUN has a backend (needed for disk LUNs) - * * Returns 0 for success, non-zero (errno) for failure. */ -static int -ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_lun *ctl_lun, - struct ctl_be_lun *const be_lun) +int +ctl_add_lun(struct ctl_be_lun *be_lun) { + struct ctl_softc *ctl_softc = control_softc; struct ctl_lun *nlun, *lun; struct scsi_vpd_id_descriptor *desc; struct scsi_vpd_id_t10 *t10id; const char *eui, *naa, *scsiname, *uuid, *vendor, *value; - int lun_number, lun_malloced; + int lun_number; int devidlen, idlen1, idlen2 = 0, len; - if (be_lun == NULL) - return (EINVAL); - /* - * We currently only support Direct Access or Processor LUN types. + * We support only Direct Access, CD-ROM or Processor LUN types. */ switch (be_lun->lun_type) { case T_DIRECT: @@ -4547,22 +4524,10 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ case T_SEQUENTIAL: case T_CHANGER: default: - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); - break; + return (EINVAL); } - if (ctl_lun == NULL) { - lun = malloc(sizeof(*lun), M_CTL, M_WAITOK); - lun_malloced = 1; - } else { - lun_malloced = 0; - lun = ctl_lun; - } + lun = malloc(sizeof(*lun), M_CTL, M_WAITOK | M_ZERO); - memset(lun, 0, sizeof(*lun)); - if (lun_malloced) - lun->flags = CTL_LUN_MALLOCED; - lun->pending_sense = malloc(sizeof(struct scsi_sense_data *) * ctl_max_ports, M_DEVBUF, M_WAITOK | M_ZERO); lun->pending_ua = malloc(sizeof(ctl_ua_type *) * ctl_max_ports, @@ -4673,10 +4638,7 @@ ctl_alloc_lun(struct ctl_softc *ctl_softc, struct ctl_ } fail: free(lun->lun_devid, M_CTL); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); - be_lun->lun_config_status(be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); + free(lun, M_CTL); return (ENOSPC); } lun_number = be_lun->req_lun_id; @@ -4702,7 +4664,6 @@ fail: lun->backend = be_lun->be; be_lun->ctl_lun = lun; be_lun->lun_id = lun_number; - atomic_add_int(&be_lun->be->num_luns, 1); if (be_lun->flags & CTL_LUN_FLAG_EJECTED) lun->flags |= CTL_LUN_EJECTED; if (be_lun->flags & CTL_LUN_FLAG_NO_MEDIA) @@ -4769,15 +4730,27 @@ fail: ctl_softc->num_luns++; mtx_unlock(&ctl_softc->ctl_lock); - lun->be_lun->lun_config_status(lun->be_lun->be_lun, CTL_LUN_CONFIG_OK); + /* + * We successfully added the LUN, attempt to enable it. + */ + if (ctl_enable_lun(lun) != 0) { + printf("%s: ctl_enable_lun() failed!\n", __func__); + mtx_lock(&ctl_softc->ctl_lock); + STAILQ_REMOVE(&ctl_softc->lun_list, lun, ctl_lun, links); + ctl_clear_mask(ctl_softc->ctl_lun_mask, lun_number); + ctl_softc->ctl_luns[lun_number] = NULL; + ctl_softc->num_luns--; + mtx_unlock(&ctl_softc->ctl_lock); + free(lun->lun_devid, M_CTL); + free(lun, M_CTL); + return (EIO); + } + return (0); } /* - * Delete a LUN. - * Assumptions: - * - LUN has already been marked invalid and any pending I/O has been taken - * care of. + * Free LUN that has no active requests. */ static int ctl_free_lun(struct ctl_lun *lun) @@ -4804,7 +4777,6 @@ ctl_free_lun(struct ctl_lun *lun) /* * Tell the backend to free resources, if this LUN has a backend. */ - atomic_subtract_int(&lun->be_lun->be->num_luns, 1); lun->be_lun->lun_shutdown(lun->be_lun->be_lun); lun->ie_reportcnt = UINT32_MAX; @@ -4820,57 +4792,24 @@ ctl_free_lun(struct ctl_lun *lun) free(lun->pr_keys, M_DEVBUF); free(lun->write_buffer, M_CTL); free(lun->prevent, M_CTL); - if (lun->flags & CTL_LUN_MALLOCED) - free(lun, M_CTL); + free(lun, M_CTL); return (0); } -static void -ctl_create_lun(struct ctl_be_lun *be_lun) +static int +ctl_enable_lun(struct ctl_lun *lun) { - - /* - * ctl_alloc_lun() should handle all potential failure cases. - */ - ctl_alloc_lun(control_softc, NULL, be_lun); -} - -int -ctl_add_lun(struct ctl_be_lun *be_lun) -{ - struct ctl_softc *softc = control_softc; - - mtx_lock(&softc->ctl_lock); - STAILQ_INSERT_TAIL(&softc->pending_lun_queue, be_lun, links); - mtx_unlock(&softc->ctl_lock); - wakeup(&softc->pending_lun_queue); - - return (0); -} - -int -ctl_enable_lun(struct ctl_be_lun *be_lun) -{ struct ctl_softc *softc; struct ctl_port *port, *nport; - struct ctl_lun *lun; int retval; - lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); - if ((lun->flags & CTL_LUN_DISABLED) == 0) { - /* - * eh? Why did we get called if the LUN is already - * enabled? - */ - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (0); - } + KASSERT((lun->flags & CTL_LUN_DISABLED) != 0, + ("%s: LUN not disabled", __func__)); lun->flags &= ~CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); @@ -4901,24 +4840,19 @@ ctl_enable_lun(struct ctl_be_lun *be_lun) return (0); } -int -ctl_disable_lun(struct ctl_be_lun *be_lun) +static int +ctl_disable_lun(struct ctl_lun *lun) { struct ctl_softc *softc; struct ctl_port *port; - struct ctl_lun *lun; int retval; - lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; mtx_lock(&softc->ctl_lock); mtx_lock(&lun->lun_lock); - if (lun->flags & CTL_LUN_DISABLED) { - mtx_unlock(&lun->lun_lock); - mtx_unlock(&softc->ctl_lock); - return (0); - } + KASSERT((lun->flags & CTL_LUN_DISABLED) == 0, + ("%s: LUN not enabled", __func__)); lun->flags |= CTL_LUN_DISABLED; mtx_unlock(&lun->lun_lock); @@ -5049,8 +4983,14 @@ ctl_lun_secondary(struct ctl_be_lun *be_lun) return (0); } +/* + * Remove LUN. If there are active requests, wait for completion. + * + * Returns 0 for success, non-zero (errno) for failure. + * Completion is reported to backed via the lun_shutdown() method. + */ int -ctl_invalidate_lun(struct ctl_be_lun *be_lun) +ctl_remove_lun(struct ctl_be_lun *be_lun) { struct ctl_softc *softc; struct ctl_lun *lun; @@ -5058,18 +4998,9 @@ ctl_invalidate_lun(struct ctl_be_lun *be_lun) lun = (struct ctl_lun *)be_lun->ctl_lun; softc = lun->ctl_softc; - mtx_lock(&lun->lun_lock); + ctl_disable_lun(lun); - /* - * The LUN needs to be disabled before it can be marked invalid. - */ - if ((lun->flags & CTL_LUN_DISABLED) == 0) { - mtx_unlock(&lun->lun_lock); - return (-1); - } - /* - * Mark the LUN invalid. - */ + mtx_lock(&lun->lun_lock); lun->flags |= CTL_LUN_INVALID; /* @@ -13296,35 +13227,6 @@ ctl_work_thread(void *arg) mtx_sleep(thr, &thr->queue_lock, PDROP, "-", 0); } thr->thread = NULL; - kthread_exit(); -} - -static void -ctl_lun_thread(void *arg) -{ - struct ctl_softc *softc = (struct ctl_softc *)arg; - struct ctl_be_lun *be_lun; - - CTL_DEBUG_PRINT(("ctl_lun_thread starting\n")); - thread_lock(curthread); - sched_prio(curthread, PUSER - 1); - thread_unlock(curthread); - - while (!softc->shutdown) { - mtx_lock(&softc->ctl_lock); - be_lun = STAILQ_FIRST(&softc->pending_lun_queue); - if (be_lun != NULL) { - STAILQ_REMOVE_HEAD(&softc->pending_lun_queue, links); - mtx_unlock(&softc->ctl_lock); - ctl_create_lun(be_lun); - continue; - } - - /* Sleep until we have something to do. */ - mtx_sleep(&softc->pending_lun_queue, &softc->ctl_lock, - PDROP, "-", 0); - } - softc->lun_thread = NULL; kthread_exit(); } Modified: stable/11/sys/cam/ctl/ctl_backend.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend.c Tue May 19 14:42:09 2020 (r361256) @@ -81,7 +81,6 @@ ctl_backend_register(struct ctl_backend_driver *be) #ifdef CS_BE_CONFIG_MOVE_DONE_IS_NOT_USED be->config_move_done = ctl_config_move_done; #endif - be->num_luns = 0; /* Call the backend's initialization routine. */ if (be->init != NULL) { Modified: stable/11/sys/cam/ctl/ctl_backend.h ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend.h Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend.h Tue May 19 14:42:09 2020 (r361256) @@ -77,14 +77,7 @@ typedef enum { MODULE_DEPEND(name, cam, 1, 1, 1) -typedef enum { - CTL_LUN_CONFIG_OK, - CTL_LUN_CONFIG_FAILURE -} ctl_lun_config_status; - typedef void (*be_callback_t)(void *be_lun); -typedef void (*be_lun_config_t)(void *be_lun, - ctl_lun_config_status status); /* * The lun_type field is the SCSI device type of this particular LUN. In @@ -133,16 +126,11 @@ typedef void (*be_lun_config_t)(void *be_lun, * should be padded with ASCII spaces. This field should NOT be NULL * terminated. * - * The lun_shutdown() method is the callback for the ctl_invalidate_lun() + * The lun_shutdown() method is the callback for the ctl_remove_lun() * call. It is called when all outstanding I/O for that LUN has been * completed and CTL has deleted the resources for that LUN. When the CTL * backend gets this call, it can safely free its per-LUN resources. * - * The lun_config_status() method is the callback for the ctl_add_lun() - * call. It is called when the LUN is successfully added, or when LUN - * addition fails. If the LUN is successfully added, the backend may call - * the ctl_enable_lun() method to enable the LUN. - * * The be field is a pointer to the ctl_backend_driver structure, which * contains the backend methods to be called by CTL. * @@ -170,7 +158,6 @@ struct ctl_be_lun { uint8_t serial_num[CTL_SN_LEN]; /* passed to CTL */ uint8_t device_id[CTL_DEVID_LEN];/* passed to CTL */ be_callback_t lun_shutdown; /* passed to CTL */ - be_lun_config_t lun_config_status; /* passed to CTL */ struct ctl_backend_driver *be; /* passed to CTL */ void *ctl_lun; /* used by CTL */ ctl_options_t options; /* passed to CTL */ @@ -209,7 +196,6 @@ struct ctl_backend_driver { #if 0 be_vfunc_t config_write_done; /* passed to backend */ #endif - u_int num_luns; /* used by CTL */ STAILQ_ENTRY(ctl_backend_driver) links; /* used by CTL */ }; @@ -218,22 +204,16 @@ int ctl_backend_deregister(struct ctl_backend_driver * struct ctl_backend_driver *ctl_backend_find(char *backend_name); /* - * To add a LUN, first call ctl_add_lun(). You will get the lun_config_status() - * callback when the LUN addition has either succeeded or failed. - * - * Once you get that callback, you can then call ctl_enable_lun() to enable - * the LUN. + * To add a LUN, call ctl_add_lun(). */ int ctl_add_lun(struct ctl_be_lun *be_lun); -int ctl_enable_lun(struct ctl_be_lun *be_lun); /* - * To delete a LUN, first call ctl_disable_lun(), then - * ctl_invalidate_lun(). You will get the lun_shutdown() callback when all + * To remove a LUN, first call ctl_remove_lun(). + * You will get the lun_shutdown() callback when all * I/O to the LUN has completed and the LUN has been deleted. */ -int ctl_disable_lun(struct ctl_be_lun *be_lun); -int ctl_invalidate_lun(struct ctl_be_lun *be_lun); +int ctl_remove_lun(struct ctl_be_lun *be_lun); /* * To start a LUN (transition from powered off to powered on state) call Modified: stable/11/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend_block.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend_block.c Tue May 19 14:42:09 2020 (r361256) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include @@ -117,7 +118,6 @@ SDT_PROVIDER_DEFINE(cbb); typedef enum { CTL_BE_BLOCK_LUN_UNCONFIGURED = 0x01, - CTL_BE_BLOCK_LUN_CONFIG_ERR = 0x02, CTL_BE_BLOCK_LUN_WAITING = 0x04, } ctl_be_block_lun_flags; @@ -149,7 +149,6 @@ typedef uint64_t (*cbb_getattr_t)(struct ctl_be_block_ */ struct ctl_be_block_lun { struct ctl_lun_create_params params; - char lunname[32]; char *dev_path; ctl_be_block_type dev_type; struct vnode *vn; @@ -165,7 +164,7 @@ struct ctl_be_block_lun { struct ctl_be_block_softc *softc; struct devstat *disk_stats; ctl_be_block_lun_flags flags; - STAILQ_ENTRY(ctl_be_block_lun) links; + SLIST_ENTRY(ctl_be_block_lun) links; struct ctl_be_lun cbe_lun; struct taskqueue *io_taskqueue; struct task io_task; @@ -182,10 +181,11 @@ struct ctl_be_block_lun { * Overall softc structure for the block backend module. */ struct ctl_be_block_softc { + struct sx modify_lock; struct mtx lock; uma_zone_t beio_zone; int num_luns; - STAILQ_HEAD(, ctl_be_block_lun) lun_list; + SLIST_HEAD(, ctl_be_block_lun) lun_list; }; static struct ctl_be_block_softc backend_block_softc; @@ -268,8 +268,6 @@ static int ctl_be_block_rm(struct ctl_be_block_softc * static int ctl_be_block_modify(struct ctl_be_block_softc *softc, struct ctl_lun_req *req); static void ctl_be_block_lun_shutdown(void *be_lun); -static void ctl_be_block_lun_config_status(void *be_lun, - ctl_lun_config_status status); static int ctl_be_block_config_write(union ctl_io *io); static int ctl_be_block_config_read(union ctl_io *io); static int ctl_be_block_lun_info(void *be_lun, struct sbuf *sb); @@ -292,7 +290,7 @@ static struct ctl_backend_driver ctl_be_block_driver = .lun_attr = ctl_be_block_lun_attr }; -MALLOC_DEFINE(M_CTLBLK, "ctlblk", "Memory used for CTL block backend"); +MALLOC_DEFINE(M_CTLBLK, "ctlblock", "Memory used for CTL block backend"); CTL_BACKEND_DECLARE(cbb, ctl_be_block_driver); static struct ctl_be_block_io * @@ -1769,13 +1767,10 @@ static int ctl_be_block_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *td) { - struct ctl_be_block_softc *softc; + struct ctl_be_block_softc *softc = &backend_block_softc; int error; - softc = &backend_block_softc; - error = 0; - switch (cmd) { case CTL_LUN_REQ: { struct ctl_lun_req *lun_req; @@ -2238,12 +2233,11 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, STAILQ_INIT(&be_lun->config_read_queue); STAILQ_INIT(&be_lun->config_write_queue); STAILQ_INIT(&be_lun->datamove_queue); - sprintf(be_lun->lunname, "cblk%d", softc->num_luns); - mtx_init(&be_lun->io_lock, "cblk io lock", NULL, MTX_DEF); - mtx_init(&be_lun->queue_lock, "cblk queue lock", NULL, MTX_DEF); + mtx_init(&be_lun->io_lock, "ctlblock io", NULL, MTX_DEF); + mtx_init(&be_lun->queue_lock, "ctlblock queue", NULL, MTX_DEF); ctl_init_opts(&cbe_lun->options, req->num_be_args, req->kern_be_args); - be_lun->lun_zone = uma_zcreate(be_lun->lunname, CTLBLK_MAX_SEG, + be_lun->lun_zone = uma_zcreate("ctlblock", CTLBLK_MAX_SEG, NULL, NULL, NULL, NULL, /*align*/ 0, /*flags*/0); if (be_lun->lun_zone == NULL) { snprintf(req->error_str, sizeof(req->error_str), @@ -2255,7 +2249,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, cbe_lun->lun_type = params->device_type; else cbe_lun->lun_type = T_DIRECT; - be_lun->flags = CTL_BE_BLOCK_LUN_UNCONFIGURED; + be_lun->flags = 0; cbe_lun->flags = 0; value = ctl_get_opt(&cbe_lun->options, "ha_role"); if (value != NULL) { @@ -2320,7 +2314,6 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, cbe_lun->req_lun_id = 0; cbe_lun->lun_shutdown = ctl_be_block_lun_shutdown; - cbe_lun->lun_config_status = ctl_be_block_lun_config_status; cbe_lun->be = &ctl_be_block_driver; if ((params->flags & CTL_LUN_FLAG_SERIAL_NUM) == 0) { @@ -2353,7 +2346,7 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, TASK_INIT(&be_lun->io_task, /*priority*/0, ctl_be_block_worker, be_lun); - be_lun->io_taskqueue = taskqueue_create(be_lun->lunname, M_WAITOK, + be_lun->io_taskqueue = taskqueue_create("ctlblocktq", M_WAITOK, taskqueue_thread_enqueue, /*context*/&be_lun->io_taskqueue); if (be_lun->io_taskqueue == NULL) { @@ -2379,27 +2372,15 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, retval = taskqueue_start_threads(&be_lun->io_taskqueue, /*num threads*/num_threads, /*priority*/PUSER, - /*thread name*/ - "%s taskq", be_lun->lunname); + /*thread name*/"block"); if (retval != 0) goto bailout_error; be_lun->num_threads = num_threads; - mtx_lock(&softc->lock); - softc->num_luns++; - STAILQ_INSERT_TAIL(&softc->lun_list, be_lun, links); - - mtx_unlock(&softc->lock); - retval = ctl_add_lun(&be_lun->cbe_lun); if (retval != 0) { - mtx_lock(&softc->lock); - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, - links); - softc->num_luns--; - mtx_unlock(&softc->lock); snprintf(req->error_str, sizeof(req->error_str), "ctl_add_lun() returned error %d, see dmesg for " "details", retval); @@ -2407,42 +2388,20 @@ ctl_be_block_create(struct ctl_be_block_softc *softc, goto bailout_error; } - mtx_lock(&softc->lock); - - /* - * Tell the config_status routine that we're waiting so it won't - * clean up the LUN in the event of an error. - */ - be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; - - while (be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) { - retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblk", 0); - if (retval == EINTR) - break; - } - be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; - - if (be_lun->flags & CTL_BE_BLOCK_LUN_CONFIG_ERR) { - snprintf(req->error_str, sizeof(req->error_str), - "LUN configuration error, see dmesg for details"); - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, - links); - softc->num_luns--; - mtx_unlock(&softc->lock); - goto bailout_error; - } else { - params->req_lun_id = cbe_lun->lun_id; - } - - mtx_unlock(&softc->lock); - - be_lun->disk_stats = devstat_new_entry("cbb", params->req_lun_id, + be_lun->disk_stats = devstat_new_entry("cbb", cbe_lun->lun_id, cbe_lun->blocksize, DEVSTAT_ALL_SUPPORTED, cbe_lun->lun_type | DEVSTAT_TYPE_IF_OTHER, DEVSTAT_PRIORITY_OTHER); + mtx_lock(&softc->lock); + softc->num_luns++; + SLIST_INSERT_HEAD(&softc->lun_list, be_lun, links); + mtx_unlock(&softc->lock); + + params->req_lun_id = cbe_lun->lun_id; + return (retval); bailout_error: @@ -2473,12 +2432,18 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru params = &req->reqdata.rm; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { - if (be_lun->cbe_lun.lun_id == params->lun_id) + SLIST_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->cbe_lun.lun_id == params->lun_id) { + SLIST_REMOVE(&softc->lun_list, be_lun, + ctl_be_block_lun, links); + softc->num_luns--; break; + } } mtx_unlock(&softc->lock); + sx_xunlock(&softc->modify_lock); if (be_lun == NULL) { snprintf(req->error_str, sizeof(req->error_str), "LUN %u is not managed by the block backend", @@ -2487,14 +2452,6 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru } cbe_lun = &be_lun->cbe_lun; - retval = ctl_disable_lun(cbe_lun); - if (retval != 0) { - snprintf(req->error_str, sizeof(req->error_str), - "error %d returned from ctl_disable_lun() for " - "LUN %d", retval, params->lun_id); - goto bailout_error; - } - if (be_lun->vn != NULL) { cbe_lun->flags |= CTL_LUN_FLAG_NO_MEDIA; ctl_lun_no_media(cbe_lun); @@ -2502,49 +2459,36 @@ ctl_be_block_rm(struct ctl_be_block_softc *softc, stru ctl_be_block_close(be_lun); } - retval = ctl_invalidate_lun(cbe_lun); + mtx_lock(&softc->lock); + be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; + mtx_unlock(&softc->lock); + + retval = ctl_remove_lun(cbe_lun); if (retval != 0) { snprintf(req->error_str, sizeof(req->error_str), - "error %d returned from ctl_invalidate_lun() for " + "error %d returned from ctl_remove_lun() for " "LUN %d", retval, params->lun_id); + mtx_lock(&softc->lock); + be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; + mtx_unlock(&softc->lock); goto bailout_error; } mtx_lock(&softc->lock); - be_lun->flags |= CTL_BE_BLOCK_LUN_WAITING; while ((be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) == 0) { - retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblk", 0); - if (retval == EINTR) - break; - } + retval = msleep(be_lun, &softc->lock, PCATCH, "ctlblockrm", 0); + if (retval == EINTR) + break; + } be_lun->flags &= ~CTL_BE_BLOCK_LUN_WAITING; - - if ((be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) == 0) { - snprintf(req->error_str, sizeof(req->error_str), - "interrupted waiting for LUN to be freed"); + if (be_lun->flags & CTL_BE_BLOCK_LUN_UNCONFIGURED) { mtx_unlock(&softc->lock); - goto bailout_error; + free(be_lun, M_CTLBLK); + } else { + mtx_unlock(&softc->lock); + return (EINTR); } - STAILQ_REMOVE(&softc->lun_list, be_lun, ctl_be_block_lun, links); - - softc->num_luns--; - mtx_unlock(&softc->lock); - - taskqueue_drain_all(be_lun->io_taskqueue); - taskqueue_free(be_lun->io_taskqueue); - - if (be_lun->disk_stats != NULL) - devstat_remove_entry(be_lun->disk_stats); - - uma_zdestroy(be_lun->lun_zone); - - ctl_free_opts(&cbe_lun->options); - free(be_lun->dev_path, M_CTLBLK); - mtx_destroy(&be_lun->queue_lock); - mtx_destroy(&be_lun->io_lock); - free(be_lun, M_CTLBLK); - req->status = CTL_LUN_OK; return (0); @@ -2565,8 +2509,9 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, params = &req->reqdata.modify; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { + SLIST_FOREACH(be_lun, &softc->lun_list, links) { if (be_lun->cbe_lun.lun_id == params->lun_id) break; } @@ -2639,66 +2584,41 @@ ctl_be_block_modify(struct ctl_be_block_softc *softc, /* Tell the user the exact size we ended up using */ params->lun_size_bytes = be_lun->size_bytes; + sx_xunlock(&softc->modify_lock); req->status = error ? CTL_LUN_WARNING : CTL_LUN_OK; return (0); bailout_error: + sx_xunlock(&softc->modify_lock); req->status = CTL_LUN_ERROR; return (0); } static void -ctl_be_block_lun_shutdown(void *be_lun) +ctl_be_block_lun_shutdown(void *lun) { - struct ctl_be_block_lun *lun = be_lun; - struct ctl_be_block_softc *softc = lun->softc; + struct ctl_be_block_lun *be_lun = lun; + struct ctl_be_block_softc *softc = be_lun->softc; - mtx_lock(&softc->lock); - lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED; - if (lun->flags & CTL_BE_BLOCK_LUN_WAITING) - wakeup(lun); - mtx_unlock(&softc->lock); -} + taskqueue_drain_all(be_lun->io_taskqueue); + taskqueue_free(be_lun->io_taskqueue); + if (be_lun->disk_stats != NULL) + devstat_remove_entry(be_lun->disk_stats); + uma_zdestroy(be_lun->lun_zone); + ctl_free_opts(&be_lun->cbe_lun.options); + free(be_lun->dev_path, M_CTLBLK); + mtx_destroy(&be_lun->queue_lock); + mtx_destroy(&be_lun->io_lock); -static void -ctl_be_block_lun_config_status(void *be_lun, ctl_lun_config_status status) -{ - struct ctl_be_block_lun *lun; - struct ctl_be_block_softc *softc; - - lun = (struct ctl_be_block_lun *)be_lun; - softc = lun->softc; - - if (status == CTL_LUN_CONFIG_OK) { - mtx_lock(&softc->lock); - lun->flags &= ~CTL_BE_BLOCK_LUN_UNCONFIGURED; - if (lun->flags & CTL_BE_BLOCK_LUN_WAITING) - wakeup(lun); - mtx_unlock(&softc->lock); - - /* - * We successfully added the LUN, attempt to enable it. - */ - if (ctl_enable_lun(&lun->cbe_lun) != 0) { - printf("%s: ctl_enable_lun() failed!\n", __func__); - if (ctl_invalidate_lun(&lun->cbe_lun) != 0) { - printf("%s: ctl_invalidate_lun() failed!\n", - __func__); - } - } - - return; - } - - mtx_lock(&softc->lock); - lun->flags &= ~CTL_BE_BLOCK_LUN_UNCONFIGURED; - lun->flags |= CTL_BE_BLOCK_LUN_CONFIG_ERR; - wakeup(lun); + be_lun->flags |= CTL_BE_BLOCK_LUN_UNCONFIGURED; + if (be_lun->flags & CTL_BE_BLOCK_LUN_WAITING) + wakeup(be_lun); + else + free(be_lun, M_CTLBLK); mtx_unlock(&softc->lock); } - static int ctl_be_block_config_write(union ctl_io *io) { @@ -2862,10 +2782,11 @@ ctl_be_block_init(void) { struct ctl_be_block_softc *softc = &backend_block_softc; + sx_init(&softc->modify_lock, "ctlblock modify"); mtx_init(&softc->lock, "ctlblock", NULL, MTX_DEF); softc->beio_zone = uma_zcreate("beio", sizeof(struct ctl_be_block_io), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0); - STAILQ_INIT(&softc->lun_list); + SLIST_INIT(&softc->lun_list); return (0); } @@ -2874,23 +2795,24 @@ static int ctl_be_block_shutdown(void) { struct ctl_be_block_softc *softc = &backend_block_softc; - struct ctl_be_block_lun *lun, *next_lun; + struct ctl_be_block_lun *lun; mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + while ((lun = SLIST_FIRST(&softc->lun_list)) != NULL) { + SLIST_REMOVE_HEAD(&softc->lun_list, links); + softc->num_luns--; /* - * Drop our lock here. Since ctl_invalidate_lun() can call + * Drop our lock here. Since ctl_remove_lun() can call * back into us, this could potentially lead to a recursive * lock of the same mutex, which would cause a hang. */ mtx_unlock(&softc->lock); - ctl_disable_lun(&lun->cbe_lun); - ctl_invalidate_lun(&lun->cbe_lun); + ctl_remove_lun(&lun->cbe_lun); mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); - uma_zdestroy(softc->beio_zone); mtx_destroy(&softc->lock); + sx_destroy(&softc->modify_lock); return (0); } Modified: stable/11/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 14:31:47 2020 (r361255) +++ stable/11/sys/cam/ctl/ctl_backend_ramdisk.c Tue May 19 14:42:09 2020 (r361256) @@ -98,13 +98,11 @@ typedef enum { typedef enum { CTL_BE_RAMDISK_LUN_UNCONFIGURED = 0x01, - CTL_BE_RAMDISK_LUN_CONFIG_ERR = 0x02, CTL_BE_RAMDISK_LUN_WAITING = 0x04 } ctl_be_ramdisk_lun_flags; struct ctl_be_ramdisk_lun { struct ctl_lun_create_params params; - char lunname[32]; int indir; uint8_t **pages; uint8_t *zero_page; @@ -117,7 +115,7 @@ struct ctl_be_ramdisk_lun { uint64_t cap_used; struct ctl_be_ramdisk_softc *softc; ctl_be_ramdisk_lun_flags flags; - STAILQ_ENTRY(ctl_be_ramdisk_lun) links; + SLIST_ENTRY(ctl_be_ramdisk_lun) links; struct ctl_be_lun cbe_lun; struct taskqueue *io_taskqueue; struct task io_task; @@ -126,9 +124,10 @@ struct ctl_be_ramdisk_lun { }; struct ctl_be_ramdisk_softc { + struct sx modify_lock; struct mtx lock; int num_luns; - STAILQ_HEAD(, ctl_be_ramdisk_lun) lun_list; + SLIST_HEAD(, ctl_be_ramdisk_lun) lun_list; }; static struct ctl_be_ramdisk_softc rd_softc; @@ -153,8 +152,6 @@ static int ctl_backend_ramdisk_create(struct ctl_be_ra static int ctl_backend_ramdisk_modify(struct ctl_be_ramdisk_softc *softc, struct ctl_lun_req *req); static void ctl_backend_ramdisk_lun_shutdown(void *be_lun); -static void ctl_backend_ramdisk_lun_config_status(void *be_lun, - ctl_lun_config_status status); static struct ctl_backend_driver ctl_be_ramdisk_driver = { @@ -170,7 +167,7 @@ static struct ctl_backend_driver ctl_be_ramdisk_driver .lun_attr = ctl_backend_ramdisk_lun_attr, }; -MALLOC_DEFINE(M_RAMDISK, "ramdisk", "Memory used for CTL RAMdisk"); +MALLOC_DEFINE(M_RAMDISK, "ctlramdisk", "Memory used for CTL RAMdisk"); CTL_BACKEND_DECLARE(cbr, ctl_be_ramdisk_driver); static int @@ -179,8 +176,9 @@ ctl_backend_ramdisk_init(void) struct ctl_be_ramdisk_softc *softc = &rd_softc; memset(softc, 0, sizeof(*softc)); - mtx_init(&softc->lock, "ctlramdisk", NULL, MTX_DEF); - STAILQ_INIT(&softc->lun_list); + sx_init(&softc->modify_lock, "ctlrammod"); + mtx_init(&softc->lock, "ctlram", NULL, MTX_DEF); + SLIST_INIT(&softc->lun_list); return (0); } @@ -188,22 +186,24 @@ static int ctl_backend_ramdisk_shutdown(void) { struct ctl_be_ramdisk_softc *softc = &rd_softc; - struct ctl_be_ramdisk_lun *lun, *next_lun; + struct ctl_be_ramdisk_lun *lun; mtx_lock(&softc->lock); - STAILQ_FOREACH_SAFE(lun, &softc->lun_list, links, next_lun) { + while ((lun = SLIST_FIRST(&softc->lun_list)) != NULL) { + SLIST_REMOVE_HEAD(&softc->lun_list, links); + softc->num_luns--; /* - * Drop our lock here. Since ctl_invalidate_lun() can call + * Drop our lock here. Since ctl_remove_lun() can call * back into us, this could potentially lead to a recursive * lock of the same mutex, which would cause a hang. */ mtx_unlock(&softc->lock); - ctl_disable_lun(&lun->cbe_lun); - ctl_invalidate_lun(&lun->cbe_lun); + ctl_remove_lun(&lun->cbe_lun); mtx_lock(&softc->lock); } mtx_unlock(&softc->lock); mtx_destroy(&softc->lock); + sx_destroy(&softc->modify_lock); return (0); } @@ -885,12 +885,18 @@ ctl_backend_ramdisk_rm(struct ctl_be_ramdisk_softc *so int retval; params = &req->reqdata.rm; + sx_xlock(&softc->modify_lock); mtx_lock(&softc->lock); - STAILQ_FOREACH(be_lun, &softc->lun_list, links) { - if (be_lun->cbe_lun.lun_id == params->lun_id) + SLIST_FOREACH(be_lun, &softc->lun_list, links) { + if (be_lun->cbe_lun.lun_id == params->lun_id) { + SLIST_REMOVE(&softc->lun_list, be_lun, + ctl_be_ramdisk_lun, links); + softc->num_luns--; break; + } } mtx_unlock(&softc->lock); + sx_xunlock(&softc->modify_lock); if (be_lun == NULL) { snprintf(req->error_str, sizeof(req->error_str), "%s: LUN %u is not managed by the ramdisk backend", *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Wed May 20 22:20:54 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 623CE2F6E83; Wed, 20 May 2020 22:20:54 +0000 (UTC) (envelope-from dteske@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49S6dy22M5z3dp1; Wed, 20 May 2020 22:20:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 40F3922E6F; Wed, 20 May 2020 22:20:54 +0000 (UTC) (envelope-from dteske@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04KMKswX028742; Wed, 20 May 2020 22:20:54 GMT (envelope-from dteske@FreeBSD.org) Received: (from dteske@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04KMKsdj028741; Wed, 20 May 2020 22:20:54 GMT (envelope-from dteske@FreeBSD.org) Message-Id: <202005202220.04KMKsdj028741@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: dteske set sender to dteske@FreeBSD.org using -f From: Devin Teske Date: Wed, 20 May 2020 22:20:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361305 - stable/11/usr.sbin/bsdinstall/scripts X-SVN-Group: stable-11 X-SVN-Commit-Author: dteske X-SVN-Commit-Paths: stable/11/usr.sbin/bsdinstall/scripts X-SVN-Commit-Revision: 361305 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 May 2020 22:20:54 -0000 Author: dteske Date: Wed May 20 22:20:53 2020 New Revision: 361305 URL: https://svnweb.freebsd.org/changeset/base/361305 Log: MFC r361300: Fix indentation in bsdinstall-created wpa_supplicant.conf PR: base/221982 Reported by: emaste Reviewed by: emaste, allanjude Differential Revision: https://reviews.freebsd.org/D23641 Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdinstall/scripts/wlanconfig ============================================================================== --- stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 22:19:43 2020 (r361304) +++ stable/11/usr.sbin/bsdinstall/scripts/wlanconfig Wed May 20 22:20:53 2020 (r361305) @@ -1,7 +1,7 @@ #!/bin/sh #- # Copyright (c) 2011 Nathan Whitehorn -# Copyright (c) 2013-2016 Devin Teske +# Copyright (c) 2013-2020 Devin Teske # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -60,8 +60,7 @@ country_set() 'wpa_supplicant -B -i "%s" -c "%s/wpa_supplicant.conf"' \ "$WLAN_IFACE" "$BSDINSTALL_TMPETC" if [ "$error_str" ]; then - $DIALOG \ - --title "$msg_error" \ + $DIALOG --title "$msg_error" \ --backtitle "$DIALOG_BACKTITLE" \ --yes-label Change \ --no-label Ignore \ @@ -70,8 +69,7 @@ country_set() 0 0 || return $SUCCESS # Skip return $FAILURE # Restart else - awk 'sub(/^\t\t/,"")||1' \ - > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF + cat > "$BSDINSTALL_TMPETC/rc.conf.net.wlan" <<-EOF create_args_$WLAN_IFACE="$ifconfig_args" EOF fi @@ -101,7 +99,8 @@ dialog_country_select() sub(/Country codes:/, ""), sub(/Regulatory.*/, "") { while (match($0, /[[:upper:]][[:upper:][:digit:]] /)) { country = substr($0, RSTART) - sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", country) + sub(/ [[:upper:]][[:upper:][:digit:]].*/, "", + country) code = substr(country, 1, 2) desc = substr(country, 4) sub(/[[:space:]]*$/, "", desc) @@ -153,7 +152,7 @@ dialog_country_select() : > "$BSDINSTALL_TMPETC/wpa_supplicant.conf" chmod 0600 "$BSDINSTALL_TMPETC/wpa_supplicant.conf" -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ psk="$PASS" + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q EAP; then USERPASS=$( $DIALOG \ --title "WPA-Enterprise Setup" \ @@ -300,19 +299,19 @@ elif echo "$ENCRYPTION" | grep -q EAP; then "Password" 3 0 "" 3 12 25 63 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=WPA-EAP$( + echo "$USERPASS" | awk ' + NR == 1 { printf "\n\tidentity=\"%s\"", $1 } + NR == 2 { printf "\n\tpassword=\"%s\"", $1 } + ' ) + \ priority=5 + } + EOF elif echo "$ENCRYPTION" | grep -q WEP; then WEPKEY=$( $DIALOG \ --title "WEP Setup" \ @@ -324,31 +323,31 @@ elif echo "$ENCRYPTION" | grep -q WEP; then "WEP Key 0" 2 0 "" 2 12 15 0 1 \ 2>&1 >&$DIALOG_TERMINAL_PASSTHRU_FD ) || exec "$0" "$@" - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ wep_key0="$WEPKEY" + \ wep_tx_keyidx=0 + \ priority=5 + } + EOF else # Open - awk 'sub(/^\t/,"")||1' \ - >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" <<-EOF + network={ + \ ssid="$NETWORK" + \ scan_ssid=$SCANSSID + \ key_mgmt=NONE + \ priority=5 + } + EOF fi # Connect to any open networks policy -cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" << EOF +cat >> "$BSDINSTALL_TMPETC/wpa_supplicant.conf" < Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 890792FAB42; Thu, 21 May 2020 01:24:00 +0000 (UTC) (envelope-from kevans@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SBjD36mYz45Y2; Thu, 21 May 2020 01:24:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 664ED254CA; Thu, 21 May 2020 01:24:00 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L1O05o042785; Thu, 21 May 2020 01:24:00 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1O00j042784; Thu, 21 May 2020 01:24:00 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210124.04L1O00j042784@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:24:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361310 - in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/certctl 12/usr.sbin/certctl X-SVN-Commit-Revision: 361310 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 01:24:00 -0000 Author: kevans Date: Thu May 21 01:23:59 2020 New Revision: 361310 URL: https://svnweb.freebsd.org/changeset/base/361310 Log: MFC r361022-r361023, r361148: certctl(8) fixes r361022: certctl(8): don't completely nuke $CERTDESTDIR It's been reported/noted that a well-timed `certctl rehash` will completely obliterate $CERTDESTDIR, which may get used by ports or system administrators. While we can't guarantee the certctl semantics when other non-certctl-controlled bits live here, we should make some amount of effort to play nice. Pruning all existing links, which we'll subsequently rebuild as needed, is sufficient for our needs. This can still be destructive, but it's perhaps less likely to cause issues. I also note that we should probably be pruning /etc/ssl/blacklisted upon rehash as well. r361023: certctl: follow-up to r361022, prune blacklist as well Otherwise, removals from the blacklist may not get processed as they should. While we're here, restructure these to not bother with mkdir(1) if we've already tested them to exist. r361148: certctl: don't fall over flat with relative DESTDIR Up until now, all of our DESTDIR use has been with absolute paths. It turned out that the cd in/out dance we do here breaks us down later on, as the relative path no longer resolves. Convert EXTENSIONS to an ERE that we'll use to grep ls -1 of the dir we're inspecting, rather than cd'ing into it and globbing it up. Modified: stable/11/usr.sbin/certctl/certctl.sh Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/certctl/certctl.sh Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/certctl/certctl.sh ============================================================================== --- stable/11/usr.sbin/certctl/certctl.sh Wed May 20 23:27:01 2020 (r361309) +++ stable/11/usr.sbin/certctl/certctl.sh Thu May 21 01:23:59 2020 (r361310) @@ -34,7 +34,7 @@ : ${BLACKLISTPATH:=${DESTDIR}/usr/share/certs/blacklisted:${DESTDIR}/usr/local/etc/ssl/blacklisted} : ${CERTDESTDIR:=${DESTDIR}/etc/ssl/certs} : ${BLACKLISTDESTDIR:=${DESTDIR}/etc/ssl/blacklisted} -: ${EXTENSIONS:="*.pem *.crt *.cer *.crl *.0"} +: ${FILEPAT:="\.pem$|\.crt$|\.cer$|\.crl$|\.0$"} : ${VERBOSE:=0} ############################################################ GLOBALS @@ -104,13 +104,11 @@ do_scan() for CPATH in "$@"; do [ -d "$CPATH" ] || continue echo "Scanning $CPATH for certificates..." - cd "$CPATH" - for CFILE in $EXTENSIONS; do - [ -e "$CFILE" ] || continue + for CFILE in $(ls -1 "${CPATH}" | grep -Ee "${FILEPAT}"); do + [ -e "$CPATH/$CFILE" ] || continue [ $VERBOSE -gt 0 ] && echo "Reading $CFILE" "$CFUNC" "$CPATH/$CFILE" done - cd - done } @@ -142,9 +140,18 @@ do_list() cmd_rehash() { - [ $NOOP -eq 0 ] && rm -rf "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$CERTDESTDIR" - [ $NOOP -eq 0 ] && mkdir -p "$BLACKLISTDESTDIR" + if [ $NOOP -eq 0 ]; then + if [ -e "$CERTDESTDIR" ]; then + find "$CERTDESTDIR" -type link -delete + else + mkdir -p "$CERTDESTDIR" + fi + if [ -e "$BLACKLISTDESTDIR" ]; then + find "$BLACKLISTDESTDIR" -type link -delete + else + mkdir -p "$BLACKLISTDESTDIR" + fi + fi do_scan create_blacklisted "$BLACKLISTPATH" do_scan create_trusted_link "$TRUSTPATH" From owner-svn-src-stable-11@freebsd.org Thu May 21 01:53:04 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 2D5962FBDF9; Thu, 21 May 2020 01:53:04 +0000 (UTC) (envelope-from kevans@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SCLm0Pw8z47pD; Thu, 21 May 2020 01:53:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 095D425C6C; Thu, 21 May 2020 01:53:04 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04L1r3gZ061757; Thu, 21 May 2020 01:53:03 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04L1r3cw061756; Thu, 21 May 2020 01:53:03 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <202005210153.04L1r3cw061756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Thu, 21 May 2020 01:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361311 - in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable: 11/usr.sbin/inetd 12/usr.sbin/inetd X-SVN-Commit-Revision: 361311 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 01:53:04 -0000 Author: kevans Date: Thu May 21 01:53:03 2020 New Revision: 361311 URL: https://svnweb.freebsd.org/changeset/base/361311 Log: MFC r361000, r361036: improve inetd(8) examples r361000: inetd(8): Provide HTTP proxy example using netcat One of the fortunes that are included in freebsd-tips talks about how the superserver can be used to proxy connections with netcat, but there are no examples provided. This commit adds an example with comment explaining what it does. r361036: inetd(8): Add comments to all examples Modified: stable/11/usr.sbin/inetd/inetd.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/12/usr.sbin/inetd/inetd.8 Directory Properties: stable/12/ (props changed) Modified: stable/11/usr.sbin/inetd/inetd.8 ============================================================================== --- stable/11/usr.sbin/inetd/inetd.8 Thu May 21 01:23:59 2020 (r361310) +++ stable/11/usr.sbin/inetd/inetd.8 Thu May 21 01:53:03 2020 (r361311) @@ -28,7 +28,7 @@ .\" from: @(#)inetd.8 8.3 (Berkeley) 4/13/94 .\" $FreeBSD$ .\" -.Dd January 12, 2008 +.Dd May 14, 2020 .Dt INETD 8 .Os .Sh NAME @@ -793,14 +793,30 @@ the pid of the currently running .Sh "EXAMPLES" Here are several example service entries for the various types of services: .Bd -literal +# The first four launch the relevant daemon when a connection on a port +# as defined by /etc/services is opened. ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l ntalk dgram udp wait root /usr/libexec/ntalkd ntalkd telnet stream tcp6 nowait root /usr/libexec/telnetd telnetd shell stream tcp46 nowait root /usr/libexec/rshd rshd + +# Let the system respond to date requests via tcpmux tcpmux/+date stream tcp nowait guest /bin/date date + +# Let people access the system phonebook via tcpmux tcpmux/phonebook stream tcp nowait guest /usr/local/bin/phonebook phonebook + +# Make kernel statistics accessible rstatd/1-3 dgram rpc/udp wait root /usr/libexec/rpc.rstatd rpc.rstatd -/var/run/echo stream unix nowait root internal + +# Use netcat as a one-shot HTTP proxy with nc (from freebsd-tips fortune) +http stream tcp nowait nobody /usr/bin/nc nc -N dest-ip 80 + +# Set up a unix socket at /var/run/echo that echo's back whatever is written +# to it. +/var/run/echo stream unix nowait root internal + +# Run chargen for IPsec Authentication Headers #@ ipsec ah/require chargen stream tcp nowait root internal #@ @@ -914,6 +930,7 @@ in the database. .El .Sh SEE ALSO +.Xr nc 1 , .Xr ipsec_set_policy 3 , .Xr hosts_access 5 , .Xr hosts_options 5 , From owner-svn-src-stable-11@freebsd.org Thu May 21 11:14:14 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 26AF32CA351; Thu, 21 May 2020 11:14:14 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49SRpG05v5z4nfG; Thu, 21 May 2020 11:14:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F2CA9C4CD; Thu, 21 May 2020 11:14:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04LBEDRh012488; Thu, 21 May 2020 11:14:13 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04LBEDEf012487; Thu, 21 May 2020 11:14:13 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005211114.04LBEDEf012487@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Thu, 21 May 2020 11:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361328 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 361328 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 21 May 2020 11:14:14 -0000 Author: kib Date: Thu May 21 11:14:13 2020 New Revision: 361328 URL: https://svnweb.freebsd.org/changeset/base/361328 Log: MFC r361037, r361056: Fix spurious ENOTCONN from closed unix domain socket other' side. Modified: stable/11/sys/kern/uipc_socket.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/uipc_socket.c ============================================================================== --- stable/11/sys/kern/uipc_socket.c Thu May 21 11:12:27 2020 (r361327) +++ stable/11/sys/kern/uipc_socket.c Thu May 21 11:14:13 2020 (r361328) @@ -1565,8 +1565,9 @@ restart: m = so->so_rcv.sb_mb; goto dontblock; } - if ((so->so_state & (SS_ISCONNECTED|SS_ISCONNECTING)) == 0 && - (so->so_proto->pr_flags & PR_CONNREQUIRED)) { + if ((so->so_state & (SS_ISCONNECTING | SS_ISCONNECTED | + SS_ISDISCONNECTING | SS_ISDISCONNECTED)) == 0 && + (so->so_proto->pr_flags & PR_CONNREQUIRED) != 0) { SOCKBUF_UNLOCK(&so->so_rcv); error = ENOTCONN; goto release; @@ -3516,8 +3517,17 @@ soisdisconnected(struct socket *so) * SOCKBUF_LOCK(&so->so_rcv) are the same. */ SOCKBUF_LOCK(&so->so_rcv); - so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); + + /* + * There is at least one reader of so_state that does not + * acquire socket lock, namely soreceive_generic(). Ensure + * that it never sees all flags that track connection status + * cleared, by ordering the update with a barrier semantic of + * our release thread fence. + */ so->so_state |= SS_ISDISCONNECTED; + atomic_thread_fence_rel(); + so->so_state &= ~(SS_ISCONNECTING|SS_ISCONNECTED|SS_ISDISCONNECTING); socantrcvmore_locked(so); SOCKBUF_LOCK(&so->so_snd); sbdrop_locked(&so->so_snd, sbused(&so->so_snd)); From owner-svn-src-stable-11@freebsd.org Fri May 22 03:11:34 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 796CC2FC46D; Fri, 22 May 2020 03:11:34 +0000 (UTC) (envelope-from delphij@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Ss2t2hYVz3S71; Fri, 22 May 2020 03:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 57AD918039; Fri, 22 May 2020 03:11:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M3BYxh006004; Fri, 22 May 2020 03:11:34 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M3BYfU006003; Fri, 22 May 2020 03:11:34 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202005220311.04M3BYfU006003@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Fri, 22 May 2020 03:11:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361354 - stable/11/etc/ntp X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/etc/ntp X-SVN-Commit-Revision: 361354 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 03:11:34 -0000 Author: delphij Date: Fri May 22 03:11:33 2020 New Revision: 361354 URL: https://svnweb.freebsd.org/changeset/base/361354 Log: MFC r361260: Update leap-seconds to leap-seconds.3676924800. Modified: stable/11/etc/ntp/leap-seconds Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/ntp/leap-seconds ============================================================================== --- stable/11/etc/ntp/leap-seconds Fri May 22 02:06:56 2020 (r361353) +++ stable/11/etc/ntp/leap-seconds Fri May 22 03:11:33 2020 (r361354) @@ -204,10 +204,10 @@ # current -- the update time stamp, the data and the name of the file # will not change. # -# Updated through IERS Bulletin C58 -# File expires on: 28 June 2020 +# Updated through IERS Bulletin C59 +# File expires on: 28 December 2020 # -#@ 3802291200 +#@ 3818102400 # 2272060800 10 # 1 Jan 1972 2287785600 11 # 1 Jul 1972 @@ -252,4 +252,4 @@ # the hash line is also ignored in the # computation. # -#h f28827d2 f263b6c3 ec0f19eb a3e0dbf0 97f3fa30 +#h a1c168ae 27c79a7d 9dddcfc3 bcfe616b 2e2c44ea From owner-svn-src-stable-11@freebsd.org Fri May 22 09:00:22 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B294032AC3C; Fri, 22 May 2020 09:00:22 +0000 (UTC) (envelope-from hselasky@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T0nL4Gb8z42BB; Fri, 22 May 2020 09:00:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8DCA81C294; Fri, 22 May 2020 09:00:22 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04M90MZp016492; Fri, 22 May 2020 09:00:22 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04M90Me5016491; Fri, 22 May 2020 09:00:22 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <202005220900.04M90Me5016491@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Fri, 22 May 2020 09:00:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361357 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 361357 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 09:00:22 -0000 Author: hselasky Date: Fri May 22 09:00:22 2020 New Revision: 361357 URL: https://svnweb.freebsd.org/changeset/base/361357 Log: MFC r361075: Assign process group of the TTY under the "proctree_lock". This fixes a race where concurrent calls to doenterpgrp() and leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp changing value so that tty_rel_pgrp() misses clearing it to NULL. For more details refer to the use of pgdelete() in the kernel. No functional change intended. Panic backtrace: __mtx_lock_sleep() # page fault due to using destroyed mutex tty_signal_pgrp() tty_ioctl() ptsdev_ioctl() kern_ioctl() sys_ioctl() amd64_syscall() Sponsored by: Mellanox Technologies Modified: stable/11/sys/kern/tty.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/tty.c ============================================================================== --- stable/11/sys/kern/tty.c Fri May 22 08:59:12 2020 (r361356) +++ stable/11/sys/kern/tty.c Fri May 22 09:00:22 2020 (r361357) @@ -1807,7 +1807,6 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da tp->t_session = p->p_session; tp->t_session->s_ttyp = tp; tp->t_sessioncnt++; - sx_xunlock(&proctree_lock); /* Assign foreground process group. */ tp->t_pgrp = p->p_pgrp; @@ -1815,6 +1814,7 @@ tty_generic_ioctl(struct tty *tp, u_long cmd, void *da p->p_flag |= P_CONTROLT; PROC_UNLOCK(p); + sx_xunlock(&proctree_lock); return (0); } case TIOCSPGRP: { From owner-svn-src-stable-11@freebsd.org Fri May 22 13:17:58 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77DEC2C8672; Fri, 22 May 2020 13:17:58 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T6VZ2dnmz4JRV; Fri, 22 May 2020 13:17:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 386391F0D2; Fri, 22 May 2020 13:17:58 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MDHvFd077866; Fri, 22 May 2020 13:17:57 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDHvjS077865; Fri, 22 May 2020 13:17:57 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221317.04MDHvjS077865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 13:17:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361381 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 361381 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 13:17:58 -0000 Author: kib Date: Fri May 22 13:17:57 2020 New Revision: 361381 URL: https://svnweb.freebsd.org/changeset/base/361381 Log: MFC r342743 (by romain): Add man page for dlvsym(3). Modified: stable/11/lib/libc/gen/Makefile.inc stable/11/lib/libc/gen/dlopen.3 Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/Makefile.inc ============================================================================== --- stable/11/lib/libc/gen/Makefile.inc Fri May 22 13:14:21 2020 (r361380) +++ stable/11/lib/libc/gen/Makefile.inc Fri May 22 13:17:57 2020 (r361381) @@ -321,7 +321,8 @@ MLINKS+=dlopen.3 fdlopen.3 \ dlopen.3 dlclose.3 \ dlopen.3 dlerror.3 \ dlopen.3 dlfunc.3 \ - dlopen.3 dlsym.3 + dlopen.3 dlsym.3 \ + dlopen.3 dlvsym.3 MLINKS+=err.3 err_set_exit.3 \ err.3 err_set_file.3 \ err.3 errc.3 \ Modified: stable/11/lib/libc/gen/dlopen.3 ============================================================================== --- stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:14:21 2020 (r361380) +++ stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:17:57 2020 (r361381) @@ -32,13 +32,14 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd July 7, 2017 +.Dd January 2, 2019 .Dt DLOPEN 3 .Os .Sh NAME .Nm dlopen , .Nm fdlopen , .Nm dlsym , +.Nm dlvsym , .Nm dlfunc , .Nm dlerror , .Nm dlclose @@ -53,6 +54,8 @@ .Fn fdlopen "int fd" "int mode" .Ft void * .Fn dlsym "void * restrict handle" "const char * restrict symbol" +.Ft void * +.Fn dlvsym "void * restrict handle" "const char * restrict symbol" "const char * restrict version" .Ft dlfunc_t .Fn dlfunc "void * restrict handle" "const char * restrict symbol" .Ft char * @@ -74,7 +77,8 @@ provides access to the shared object in .Fa path , returning a descriptor that can be used for later references to the object in calls to -.Fn dlsym +.Fn dlsym , +.Fn dlvsym and .Fn dlclose . If @@ -300,6 +304,16 @@ condition which may be queried with .Fn dlerror . .Pp The +.Fn dlvsym +function behaves like +.Fn dlsym , +but takes an extra argument +.Fa version : +a null-terminated character string which is used to request a specific version +of +.Fa symbol . +.Pp +The .Fn dlfunc function implements all of the behavior of @@ -328,6 +342,7 @@ occurred during a call to .Fn dladdr , .Fn dlinfo , .Fn dlsym , +.Fn dlvsym , .Fn dlfunc , or .Fn dlclose . @@ -375,7 +390,10 @@ using the option to .Xr ld 1 for symbols defined in the executable to become visible to -.Fn dlsym . +.Fn dlsym , +.Fn dlvsym +or +.Fn dlfunc .Pp Other ELF platforms require linking with .Lb libdl @@ -397,6 +415,7 @@ The .Fn dlopen , .Fn fdlopen , .Fn dlsym , +.Fn dlvsym , and .Fn dlfunc functions From owner-svn-src-stable-11@freebsd.org Fri May 22 13:18:44 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B516A2C8BB2; Fri, 22 May 2020 13:18:44 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49T6WS4MTgz4JX9; Fri, 22 May 2020 13:18:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 90FB01F293; Fri, 22 May 2020 13:18:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04MDIiSo077958; Fri, 22 May 2020 13:18:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04MDIhi7077954; Fri, 22 May 2020 13:18:43 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005221318.04MDIhi7077954@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 22 May 2020 13:18:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361382 - in stable/11: include lib/libc/gen libexec/rtld-elf X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11: include lib/libc/gen libexec/rtld-elf X-SVN-Commit-Revision: 361382 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 22 May 2020 13:18:44 -0000 Author: kib Date: Fri May 22 13:18:43 2020 New Revision: 361382 URL: https://svnweb.freebsd.org/changeset/base/361382 Log: MFC r361073: Implement RTLD_DEEPBIND. PR: 246462 Modified: stable/11/include/dlfcn.h stable/11/lib/libc/gen/dlopen.3 stable/11/libexec/rtld-elf/rtld.c stable/11/libexec/rtld-elf/rtld.h Directory Properties: stable/11/ (props changed) Modified: stable/11/include/dlfcn.h ============================================================================== --- stable/11/include/dlfcn.h Fri May 22 13:17:57 2020 (r361381) +++ stable/11/include/dlfcn.h Fri May 22 13:18:43 2020 (r361382) @@ -45,6 +45,8 @@ #define RTLD_TRACE 0x200 /* Trace loaded objects and exit. */ #define RTLD_NODELETE 0x01000 /* Do not remove members. */ #define RTLD_NOLOAD 0x02000 /* Do not load if not already loaded. */ +#define RTLD_DEEPBIND 0x04000 /* Put symbols from the dso ahead of + the global list */ /* * Request arguments for dlinfo(). Modified: stable/11/lib/libc/gen/dlopen.3 ============================================================================== --- stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:17:57 2020 (r361381) +++ stable/11/lib/libc/gen/dlopen.3 Fri May 22 13:18:43 2020 (r361382) @@ -32,7 +32,7 @@ .\" @(#) dlopen.3 1.6 90/01/31 SMI .\" $FreeBSD$ .\" -.Dd January 2, 2019 +.Dd May 14, 2020 .Dt DLOPEN 3 .Os .Sh NAME @@ -162,6 +162,9 @@ the process address space, otherwise is returned. Other mode flags may be specified, which will be applied for promotion for the found object. +.It Dv RTLD_DEEPBIND +Symbols from the loaded library are put before global symbols when +resolving symbolic references originated from the library. .El .Pp If Modified: stable/11/libexec/rtld-elf/rtld.c ============================================================================== --- stable/11/libexec/rtld-elf/rtld.c Fri May 22 13:17:57 2020 (r361381) +++ stable/11/libexec/rtld-elf/rtld.c Fri May 22 13:18:43 2020 (r361382) @@ -3300,6 +3300,8 @@ rtld_dlopen(const char *name, int fd, int mode) lo_flags |= RTLD_LO_NODELETE; if (mode & RTLD_NOLOAD) lo_flags |= RTLD_LO_NOLOAD; + if (mode & RTLD_DEEPBIND) + lo_flags |= RTLD_LO_DEEPBIND; if (ld_tracing != NULL) lo_flags |= RTLD_LO_TRACE; @@ -3351,6 +3353,8 @@ dlopen_object(const char *name, int fd, Obj_Entry *ref if (globallist_next(old_obj_tail) != NULL) { /* We loaded something new. */ assert(globallist_next(old_obj_tail) == obj); + if ((lo_flags & RTLD_LO_DEEPBIND) != 0) + obj->symbolic = true; result = 0; if ((lo_flags & RTLD_LO_EARLY) == 0 && obj->static_tls && !allocate_tls_offset(obj)) { Modified: stable/11/libexec/rtld-elf/rtld.h ============================================================================== --- stable/11/libexec/rtld-elf/rtld.h Fri May 22 13:17:57 2020 (r361381) +++ stable/11/libexec/rtld-elf/rtld.h Fri May 22 13:18:43 2020 (r361382) @@ -303,6 +303,7 @@ TAILQ_HEAD(obj_entry_q, Struct_Obj_Entry); #define RTLD_LO_FILTEES 0x10 /* Loading filtee. */ #define RTLD_LO_EARLY 0x20 /* Do not call ctors, postpone it to the initialization during the image start. */ +#define RTLD_LO_DEEPBIND 0x80 /* Force symbolic for this object */ /* * Symbol cache entry used during relocation to avoid multiple lookups From owner-svn-src-stable-11@freebsd.org Sat May 23 11:59:37 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8C17B2C8E7F; Sat, 23 May 2020 11:59:37 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Thjj37lxz3c2S; Sat, 23 May 2020 11:59:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4D447F804; Sat, 23 May 2020 11:59:37 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NBxb1W023811; Sat, 23 May 2020 11:59:37 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NBxa7X023808; Sat, 23 May 2020 11:59:36 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231159.04NBxa7X023808@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 11:59:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361413 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361413 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 11:59:37 -0000 Author: kib Date: Sat May 23 11:59:36 2020 New Revision: 361413 URL: https://svnweb.freebsd.org/changeset/base/361413 Log: MFC r361276: mlx5_core: add "PMD type not enabled" port module event type. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Sat May 23 11:56:42 2020 (r361412) +++ stable/11/sys/dev/mlx5/device.h Sat May 23 11:59:36 2020 (r361413) @@ -551,6 +551,7 @@ enum { MLX5_MODULE_EVENT_ERROR_UNSUPPORTED_CABLE = 0x5, MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, + MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:56:42 2020 (r361412) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:59:36 2020 (r361413) @@ -659,6 +659,8 @@ static const char *mlx5_port_module_event_error_type_t return "High Temperature"; case MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED: return "Bad or shorted cable/module"; + case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: + return "PMD type is not enabled"; default: return "Unknown error type"; } Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:56:42 2020 (r361412) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:59:36 2020 (r361413) @@ -1284,7 +1284,8 @@ m(+1, u64, no_eeprom, "no_eeprom", "No EEPROM/retry ti m(+1, u64, enforce_part_number, "enforce_part_number", "Module Enforce part number list") \ m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ -m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") +m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC) From owner-svn-src-stable-11@freebsd.org Sat May 23 12:00:47 2020 Return-Path: Delivered-To: svn-src-stable-11@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 856432C97DF; Sat, 23 May 2020 12:00:47 +0000 (UTC) (envelope-from kib@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 "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 49Thl331YRz3cSx; Sat, 23 May 2020 12:00:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 62E5AF155; Sat, 23 May 2020 12:00:47 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 04NC0lXh024731; Sat, 23 May 2020 12:00:47 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 04NC0kWX024728; Sat, 23 May 2020 12:00:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <202005231200.04NC0kWX024728@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 23 May 2020 12:00:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r361414 - in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: in stable/11/sys/dev/mlx5: . mlx5_core X-SVN-Commit-Revision: 361414 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for only the 11-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 12:00:47 -0000 Author: kib Date: Sat May 23 12:00:46 2020 New Revision: 361414 URL: https://svnweb.freebsd.org/changeset/base/361414 Log: MFC r361277: mlx5_core: add more port module event types to decode. Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/mlx5/device.h stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/mlx5/device.h ============================================================================== --- stable/11/sys/dev/mlx5/device.h Sat May 23 11:59:36 2020 (r361413) +++ stable/11/sys/dev/mlx5/device.h Sat May 23 12:00:46 2020 (r361414) @@ -552,6 +552,12 @@ enum { MLX5_MODULE_EVENT_ERROR_HIGH_TEMPERATURE = 0x6, MLX5_MODULE_EVENT_ERROR_CABLE_IS_SHORTED = 0x7, MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED = 0x8, + MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE = 0x9, + MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT = 0xa, + MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE = 0xb, + MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED = 0xc, + MLX5_MODULE_EVENT_ERROR_HIGH_POWER = 0xd, + MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT = 0xe, MLX5_MODULE_EVENT_ERROR_NUM , }; Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 11:59:36 2020 (r361413) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_eq.c Sat May 23 12:00:46 2020 (r361414) @@ -661,6 +661,18 @@ static const char *mlx5_port_module_event_error_type_t return "Bad or shorted cable/module"; case MLX5_MODULE_EVENT_ERROR_PMD_TYPE_NOT_ENABLED: return "PMD type is not enabled"; + case MLX5_MODULE_EVENT_ERROR_LASTER_TEC_FAILURE: + return "Laster_TEC_failure"; + case MLX5_MODULE_EVENT_ERROR_HIGH_CURRENT: + return "High_current"; + case MLX5_MODULE_EVENT_ERROR_HIGH_VOLTAGE: + return "High_voltage"; + case MLX5_MODULE_EVENT_ERROR_PCIE_SYS_POWER_SLOT_EXCEEDED: + return "pcie_system_power_slot_Exceeded"; + case MLX5_MODULE_EVENT_ERROR_HIGH_POWER: + return "High_power"; + case MLX5_MODULE_EVENT_ERROR_MODULE_STATE_MACHINE_FAULT: + return "Module_state_machine_fault"; default: return "Unknown error type"; } Modified: stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c ============================================================================== --- stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 11:59:36 2020 (r361413) +++ stable/11/sys/dev/mlx5/mlx5_core/mlx5_main.c Sat May 23 12:00:46 2020 (r361414) @@ -1285,7 +1285,13 @@ m(+1, u64, enforce_part_number, "enforce_part_number", m(+1, u64, unknown_id, "unknown_id", "Module Unknown identifier") \ m(+1, u64, high_temp, "high_temp", "Module High Temperature") \ m(+1, u64, cable_shorted, "cable_shorted", "Module Cable is shorted") \ -m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") +m(+1, u64, pmd_type_not_enabled, "pmd_type_not_enabled", "PMD type is not enabled") \ +m(+1, u64, laster_tec_failure, "laster_tec_failure", "Laster TEC failure") \ +m(+1, u64, high_current, "high_current", "High current") \ +m(+1, u64, high_voltage, "high_voltage", "High voltage") \ +m(+1, u64, pcie_sys_power_slot_exceeded, "pcie_sys_power_slot_exceeded", "PCIe system power slot Exceeded") \ +m(+1, u64, high_power, "high_power", "High power") \ +m(+1, u64, module_state_machine_fault, "module_state_machine_fault", "Module State Machine fault") static const char *mlx5_pme_err_desc[] = { MLX5_PORT_MODULE_ERROR_STATS(MLX5_STATS_DESC)