From owner-svn-src-stable-11@freebsd.org Sun Feb 25 00:32:43 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5E156F3062E; Sun, 25 Feb 2018 00:32:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D17F7F974; Sun, 25 Feb 2018 00:32:43 +0000 (UTC) (envelope-from markj@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 07E0D2CF2E; Sun, 25 Feb 2018 00:32:43 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1P0WgI6009797; Sun, 25 Feb 2018 00:32:42 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1P0WgMw009796; Sun, 25 Feb 2018 00:32:42 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201802250032.w1P0WgMw009796@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Sun, 25 Feb 2018 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: r329942 - stable/11/sys/x86/iommu X-SVN-Group: stable-11 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/11/sys/x86/iommu X-SVN-Commit-Revision: 329942 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.25 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, 25 Feb 2018 00:32:43 -0000 Author: markj Date: Sun Feb 25 00:32:42 2018 New Revision: 329942 URL: https://svnweb.freebsd.org/changeset/base/329942 Log: MFC r329521: Don't include DMAR map entry zone items in kernel dumps. Modified: stable/11/sys/x86/iommu/intel_gas.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/iommu/intel_gas.c ============================================================================== --- stable/11/sys/x86/iommu/intel_gas.c Sat Feb 24 22:34:56 2018 (r329941) +++ stable/11/sys/x86/iommu/intel_gas.c Sun Feb 25 00:32:42 2018 (r329942) @@ -79,7 +79,7 @@ intel_gas_init(void) dmar_map_entry_zone = uma_zcreate("DMAR_MAP_ENTRY", sizeof(struct dmar_map_entry), NULL, NULL, - NULL, NULL, UMA_ALIGN_PTR, 0); + NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NODUMP); } SYSINIT(intel_gas, SI_SUB_DRIVERS, SI_ORDER_FIRST, intel_gas_init, NULL); From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:18:50 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F6B9F269C6; Sun, 25 Feb 2018 10:18: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D85DE74C3C; Sun, 25 Feb 2018 10:18:49 +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 D370F38BB; Sun, 25 Feb 2018 10:18:49 +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 w1PAInsG007363; Sun, 25 Feb 2018 10:18:49 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAInj4007362; Sun, 25 Feb 2018 10:18:49 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251018.w1PAInj4007362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:18: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: r329954 - 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: 329954 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.25 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, 25 Feb 2018 10:18:50 -0000 Author: hselasky Date: Sun Feb 25 10:18:49 2018 New Revision: 329954 URL: https://svnweb.freebsd.org/changeset/base/329954 Log: MFC r329377: Implement memdup_user_nul() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/string.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/string.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/string.h Sun Feb 25 10:18:02 2018 (r329953) +++ stable/11/sys/compat/linuxkpi/common/include/linux/string.h Sun Feb 25 10:18:49 2018 (r329954) @@ -71,6 +71,22 @@ memdup_user(const void *ptr, size_t len) } static inline void * +memdup_user_nul(const void *ptr, size_t len) +{ + char *retval; + int error; + + retval = malloc(len + 1, M_KMALLOC, M_WAITOK); + error = linux_copyin(ptr, retval, len); + if (error != 0) { + free(retval, M_KMALLOC); + return (ERR_PTR(error)); + } + retval[len] = '\0'; + return (retval); +} + +static inline void * kmemdup(const void *src, size_t len, gfp_t gfp) { void *dst; From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:51:40 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8607AF2887A; Sun, 25 Feb 2018 10:51:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25D21775AF; Sun, 25 Feb 2018 10:51:40 +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 20E533ED9; Sun, 25 Feb 2018 10:51:40 +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 w1PApd4U025632; Sun, 25 Feb 2018 10:51:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PApdCQ025631; Sun, 25 Feb 2018 10:51:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251051.w1PApdCQ025631@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:51:39 +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: r329980 - 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: 329980 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.25 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, 25 Feb 2018 10:51:40 -0000 Author: hselasky Date: Sun Feb 25 10:51:39 2018 New Revision: 329980 URL: https://svnweb.freebsd.org/changeset/base/329980 Log: MFC r329471: Implement BUILD_BUG_ON_INVALID() function macro in the LinuxKPI. Submitted by: Johannes Lundberg 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 Sun Feb 25 10:48:52 2018 (r329979) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kernel.h Sun Feb 25 10:51:39 2018 (r329980) @@ -89,6 +89,7 @@ #define BUILD_BUG_ON(x) CTASSERT(!(x)) #define BUILD_BUG_ON_MSG(x, msg) BUILD_BUG_ON(x) #define BUILD_BUG_ON_NOT_POWER_OF_2(x) BUILD_BUG_ON(!powerof2(x)) +#define BUILD_BUG_ON_INVALID(expr) while (0) { (void)(expr); } #define BUG() panic("BUG at %s:%d", __FILE__, __LINE__) #define BUG_ON(cond) do { \ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:14:36 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E4580F2652D; Sun, 25 Feb 2018 10:14: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B76747FE; Sun, 25 Feb 2018 10:14: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 8B90338B8; Sun, 25 Feb 2018 10:14: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 w1PAEZhi007025; Sun, 25 Feb 2018 10:14:35 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAEZTa007024; Sun, 25 Feb 2018 10:14:35 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251014.w1PAEZTa007024@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:14: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: r329951 - 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: 329951 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.25 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, 25 Feb 2018 10:14:36 -0000 Author: hselasky Date: Sun Feb 25 10:14:35 2018 New Revision: 329951 URL: https://svnweb.freebsd.org/changeset/base/329951 Log: MFC r329371: Allow the cmpxchg() macro in the LinuxKPI to work on pointers without generating compiler warnings, -Wint-conversion . Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 08:56:44 2018 (r329950) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:14:35 2018 (r329951) @@ -159,36 +159,41 @@ atomic_cmpxchg(atomic_t *v, int old, int new) return (ret); } -#define cmpxchg(ptr, old, new) ({ \ - __typeof(*(ptr)) __ret; \ - \ - CTASSERT(sizeof(__ret) == 1 || sizeof(__ret) == 2 || \ - sizeof(__ret) == 4 || sizeof(__ret) == 8); \ - \ - __ret = (old); \ - switch (sizeof(__ret)) { \ - case 1: \ - while (!atomic_fcmpset_8((volatile int8_t *)(ptr), \ - (int8_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 2: \ - while (!atomic_fcmpset_16((volatile int16_t *)(ptr), \ - (int16_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 4: \ - while (!atomic_fcmpset_32((volatile int32_t *)(ptr), \ - (int32_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - case 8: \ - while (!atomic_fcmpset_64((volatile int64_t *)(ptr), \ - (int64_t *)&__ret, (new)) && __ret == (old)) \ - ; \ - break; \ - } \ - __ret; \ +#define cmpxchg(ptr, old, new) ({ \ + union { \ + __typeof(*(ptr)) val; \ + u8 u8[]; \ + u16 u16[]; \ + u32 u32[]; \ + u64 u64[]; \ + } __ret = { .val = (old) }, __new = { .val = (new) }; \ + \ + CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ + sizeof(__ret.val) == 4 || sizeof(__ret.val) == 8); \ + \ + switch (sizeof(__ret.val)) { \ + case 1: \ + while (!atomic_fcmpset_8((volatile u8 *)(ptr), \ + __ret.u8, __new.u8[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 2: \ + while (!atomic_fcmpset_16((volatile u16 *)(ptr), \ + __ret.u16, __new.u16[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 4: \ + while (!atomic_fcmpset_32((volatile u32 *)(ptr), \ + __ret.u32, __new.u32[0]) && __ret.val == (old)) \ + ; \ + break; \ + case 8: \ + while (!atomic_fcmpset_64((volatile u64 *)(ptr), \ + __ret.u64, __new.u64[0]) && __ret.val == (old)) \ + ; \ + break; \ + } \ + __ret.val; \ }) #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:28:07 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35DBBF27031; Sun, 25 Feb 2018 10:28:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D580A75741; Sun, 25 Feb 2018 10:28:06 +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 CDDB33B24; Sun, 25 Feb 2018 10:28:06 +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 w1PAS69P013206; Sun, 25 Feb 2018 10:28:06 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAS64v013205; Sun, 25 Feb 2018 10:28:06 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251028.w1PAS64v013205@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:28:06 +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: r329963 - 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: 329963 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.25 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, 25 Feb 2018 10:28:07 -0000 Author: hselasky Date: Sun Feb 25 10:28:06 2018 New Revision: 329963 URL: https://svnweb.freebsd.org/changeset/base/329963 Log: MFC r329475: Implement get_task_pid() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pid.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/pid.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/pid.h Sun Feb 25 10:26:44 2018 (r329962) +++ stable/11/sys/compat/linuxkpi/common/include/linux/pid.h Sun Feb 25 10:28:06 2018 (r329963) @@ -58,6 +58,11 @@ enum pid_type { __ts; \ }) +#define get_task_pid(task, type) ({ \ + CTASSERT((type) == PIDTYPE_PID); \ + (task)->task_thread->td_tid; \ +}) + struct task_struct; extern struct task_struct *linux_pid_task(pid_t); extern struct task_struct *linux_get_pid_task(pid_t); From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:37:07 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3976F27BA7; Sun, 25 Feb 2018 10:37:07 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6EE66765F6; Sun, 25 Feb 2018 10:37:07 +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 69C653CD3; Sun, 25 Feb 2018 10:37:07 +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 w1PAb7gr018506; Sun, 25 Feb 2018 10:37:07 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAb7Be018504; Sun, 25 Feb 2018 10:37:07 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251037.w1PAb7Be018504@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:37:07 +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: r329973 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329973 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.25 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, 25 Feb 2018 10:37:08 -0000 Author: hselasky Date: Sun Feb 25 10:37:07 2018 New Revision: 329973 URL: https://svnweb.freebsd.org/changeset/base/329973 Log: MFC r329519: Implement support for radix_tree_for_each_slot() and radix_tree_exception() in the LinuxKPI and use unsigned long type for the radix tree index. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h Sun Feb 25 10:35:28 2018 (r329972) +++ stable/11/sys/compat/linuxkpi/common/include/linux/radix-tree.h Sun Feb 25 10:37:07 2018 (r329973) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -34,11 +34,15 @@ #include #define RADIX_TREE_MAP_SHIFT 6 -#define RADIX_TREE_MAP_SIZE (1 << RADIX_TREE_MAP_SHIFT) -#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE - 1) -#define RADIX_TREE_MAX_HEIGHT \ - DIV_ROUND_UP((sizeof(long) * NBBY), RADIX_TREE_MAP_SHIFT) +#define RADIX_TREE_MAP_SIZE (1UL << RADIX_TREE_MAP_SHIFT) +#define RADIX_TREE_MAP_MASK (RADIX_TREE_MAP_SIZE - 1UL) +#define RADIX_TREE_MAX_HEIGHT \ + howmany(sizeof(long) * NBBY, RADIX_TREE_MAP_SHIFT) +#define RADIX_TREE_ENTRY_MASK 3UL +#define RADIX_TREE_EXCEPTIONAL_ENTRY 2UL +#define RADIX_TREE_EXCEPTIONAL_SHIFT 2 + struct radix_tree_node { void *slots[RADIX_TREE_MAP_SIZE]; int count; @@ -50,6 +54,10 @@ struct radix_tree_root { int height; }; +struct radix_tree_iter { + unsigned long index; +}; + #define RADIX_TREE_INIT(mask) \ { .rnode = NULL, .gfp_mask = mask, .height = 0 }; #define INIT_RADIX_TREE(root, mask) \ @@ -57,8 +65,19 @@ struct radix_tree_root { #define RADIX_TREE(name, mask) \ struct radix_tree_root name = RADIX_TREE_INIT(mask) +#define radix_tree_for_each_slot(slot, root, iter, start) \ + for ((iter)->index = (start); \ + radix_tree_iter_find(root, iter, &(slot)); (iter)->index++) + +static inline int +radix_tree_exception(void *arg) +{ + return ((uintptr_t)arg & RADIX_TREE_ENTRY_MASK); +} + void *radix_tree_lookup(struct radix_tree_root *, unsigned long); void *radix_tree_delete(struct radix_tree_root *, unsigned long); int radix_tree_insert(struct radix_tree_root *, unsigned long, void *); +bool radix_tree_iter_find(struct radix_tree_root *, struct radix_tree_iter *, void ***); #endif /* _LINUX_RADIX_TREE_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_radix.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Sun Feb 25 10:35:28 2018 (r329972) +++ stable/11/sys/compat/linuxkpi/common/src/linux_radix.c Sun Feb 25 10:37:07 2018 (r329973) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013, 2014 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -43,10 +43,10 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_RADIX, "radix", "Linux radix compat"); -static inline int +static inline unsigned long radix_max(struct radix_tree_root *root) { - return (1 << (root->height * RADIX_TREE_MAP_SHIFT)) - 1; + return ((1UL << (root->height * RADIX_TREE_MAP_SHIFT)) - 1UL); } static inline int @@ -74,6 +74,45 @@ radix_tree_lookup(struct radix_tree_root *root, unsign out: return (item); +} + +bool +radix_tree_iter_find(struct radix_tree_root *root, struct radix_tree_iter *iter, + void ***pppslot) +{ + struct radix_tree_node *node; + unsigned long index = iter->index; + int height; + +restart: + node = root->rnode; + if (node == NULL) + return (false); + height = root->height - 1; + if (height == -1 || index > radix_max(root)) + return (false); + do { + unsigned long mask = RADIX_TREE_MAP_MASK << (RADIX_TREE_MAP_SHIFT * height); + unsigned long step = 1UL << (RADIX_TREE_MAP_SHIFT * height); + int pos = radix_pos(index, height); + struct radix_tree_node *next; + + /* track last slot */ + *pppslot = node->slots + pos; + + next = node->slots[pos]; + if (next == NULL) { + index += step; + index &= -step; + if ((index & mask) == 0) + goto restart; + } else { + node = next; + height--; + } + } while (height != -1); + iter->index = index; + return (true); } void * From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:44:48 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3562CF28472; Sun, 25 Feb 2018 10:44:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC30177063; Sun, 25 Feb 2018 10:44:47 +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 D722B3E73; Sun, 25 Feb 2018 10:44:47 +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 w1PAil8D023597; Sun, 25 Feb 2018 10:44:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAilPj023595; Sun, 25 Feb 2018 10:44:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251044.w1PAilPj023595@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:44:47 +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: r329977 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329977 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.25 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, 25 Feb 2018 10:44:48 -0000 Author: hselasky Date: Sun Feb 25 10:44:47 2018 New Revision: 329977 URL: https://svnweb.freebsd.org/changeset/base/329977 Log: MFC r329509: Update the ktime type in the LinuxKPI to be a signed 64-bit integer similarly to Linux, to avoid compilation issues. Implement ktime_get_real_seconds(). Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Feb 25 10:40:41 2018 (r329976) +++ stable/11/sys/compat/linuxkpi/common/include/linux/ktime.h Sun Feb 25 10:44:47 2018 (r329977) @@ -1,5 +1,6 @@ /*- - * Copyright (c) 2014-2015 Mellanox Technologies, Ltd. + * Copyright (c) 2018 Limelight Networks, Inc. + * Copyright (c) 2014-2018 Mellanox Technologies, Ltd. * Copyright (c) 2015 François Tigeot * All rights reserved. * @@ -34,104 +35,96 @@ #include #include -#define ktime_get_ts(x) getnanouptime(x) +#define ktime_get_ts(x) getnanouptime(x) /* time values in nanoseconds */ -union ktime { - int64_t tv64; -}; +typedef s64 ktime_t; -typedef union ktime ktime_t; +#define KTIME_MAX ((s64)~((u64)1 << 63)) +#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) -#define KTIME_MAX ((s64)~((u64)1 << 63)) -#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) - static inline int64_t ktime_to_ns(ktime_t kt) { - return kt.tv64; + return (kt); } static inline ktime_t ns_to_ktime(uint64_t nsec) { - ktime_t kt; - - kt.tv64 = nsec; - return (kt); + return (nsec); } static inline int64_t ktime_divns(const ktime_t kt, int64_t div) { - return kt.tv64 / div; + return (kt / div); } static inline int64_t ktime_to_us(ktime_t kt) { - return ktime_divns(kt, NSEC_PER_USEC); + return (ktime_divns(kt, NSEC_PER_USEC)); } static inline int64_t ktime_to_ms(ktime_t kt) { - return ktime_divns(kt, NSEC_PER_MSEC); + return (ktime_divns(kt, NSEC_PER_MSEC)); } static inline struct timeval ktime_to_timeval(ktime_t kt) { - return ns_to_timeval(kt.tv64); + return (ns_to_timeval(kt)); } static inline ktime_t ktime_add_ns(ktime_t kt, int64_t ns) { - kt.tv64 += ns; - return kt; + return (kt + ns); } static inline ktime_t ktime_sub_ns(ktime_t kt, int64_t ns) { - kt.tv64 -= ns; - return kt; + return (kt - ns); } static inline ktime_t ktime_set(const long secs, const unsigned long nsecs) { - ktime_t retval = { (s64)secs * NSEC_PER_SEC + (s64)nsecs }; + ktime_t retval = {(s64) secs * NSEC_PER_SEC + (s64) nsecs}; + return (retval); } static inline ktime_t ktime_sub(ktime_t lhs, ktime_t rhs) { - lhs.tv64 -= rhs.tv64; - return (lhs); + return (lhs - rhs); } static inline int64_t ktime_us_delta(ktime_t later, ktime_t earlier) { - ktime_t diff = ktime_sub(later, earlier); - return ktime_to_us(diff); + ktime_t diff = ktime_sub(later, earlier); + + return (ktime_to_us(diff)); } static inline int64_t ktime_ms_delta(ktime_t later, ktime_t earlier) { - ktime_t diff = ktime_sub(later, earlier); - return ktime_to_ms(diff); + ktime_t diff = ktime_sub(later, earlier); + + return (ktime_to_ms(diff)); } static inline ktime_t ktime_add(ktime_t lhs, ktime_t rhs) { - lhs.tv64 += rhs.tv64; - return (lhs); + return (lhs + rhs); } static inline ktime_t @@ -146,23 +139,20 @@ timeval_to_ktime(struct timeval tv) return (ktime_set(tv.tv_sec, tv.tv_usec * NSEC_PER_USEC)); } -#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64) -#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64) -#define ktime_to_ns(kt) ((kt).tv64) +#define ktime_to_timespec(kt) ns_to_timespec(kt) +#define ktime_to_timeval(kt) ns_to_timeval(kt) +#define ktime_to_ns(kt) (kt) static inline int64_t ktime_get_ns(void) { struct timespec ts; - ktime_t kt; ktime_get_ts(&ts); - kt = timespec_to_ktime(ts); - return (ktime_to_ns(kt)); + + return (ktime_to_ns(timespec_to_ktime(ts))); } -#define ktime_get_raw_ns() ktime_get_ns() - static inline ktime_t ktime_get(void) { @@ -188,6 +178,24 @@ ktime_get_real(void) nanotime(&ts); return (timespec_to_ktime(ts)); +} + +static inline ktime_t +ktime_get_real_seconds(void) +{ + struct timespec ts; + + nanotime(&ts); + return (ts.tv_sec); +} + +static inline u64 +ktime_get_raw_ns(void) +{ + struct timespec ts; + + nanouptime(&ts); + return (ktime_to_ns(timespec_to_ktime(ts))); } #endif /* _LINUX_KTIME_H */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Sun Feb 25 10:40:41 2018 (r329976) +++ stable/11/sys/compat/linuxkpi/common/src/linux_hrtimer.c Sun Feb 25 10:44:47 2018 (r329977) @@ -98,7 +98,7 @@ linux_hrtimer_start_range_ns(struct hrtimer *hrtimer, { mtx_lock(&hrtimer->mtx); - callout_reset_sbt(&hrtimer->callout, nstosbt(time.tv64), nstosbt(nsec), + callout_reset_sbt(&hrtimer->callout, nstosbt(time), nstosbt(nsec), hrtimer_call_handler, hrtimer, 0); mtx_unlock(&hrtimer->mtx); } From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:29:44 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7185EF2721E; Sun, 25 Feb 2018 10:29:44 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 490D9759B2; Sun, 25 Feb 2018 10:29:44 +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 441AC3B26; Sun, 25 Feb 2018 10:29:44 +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 w1PATiXx013381; Sun, 25 Feb 2018 10:29:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PATia5013380; Sun, 25 Feb 2018 10:29:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251029.w1PATia5013380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:29:44 +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: r329965 - 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: 329965 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.25 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, 25 Feb 2018 10:29:44 -0000 Author: hselasky Date: Sun Feb 25 10:29:43 2018 New Revision: 329965 URL: https://svnweb.freebsd.org/changeset/base/329965 Log: MFC r329477: Implement spin_trylock_irq() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h Sun Feb 25 10:28:52 2018 (r329964) +++ stable/11/sys/compat/linuxkpi/common/include/linux/spinlock.h Sun Feb 25 10:29:43 2018 (r329965) @@ -98,6 +98,9 @@ typedef struct { __ret; \ }) +#define spin_trylock_irq(_l) \ + spin_trylock(_l) + #define spin_lock_nested(_l, _n) do { \ if (SPIN_SKIP()) \ break; \ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:32:27 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 390A7F275BB; Sun, 25 Feb 2018 10:32:27 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D431575F16; Sun, 25 Feb 2018 10:32:26 +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 CE81B3CBE; Sun, 25 Feb 2018 10:32:26 +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 w1PAWQAN017984; Sun, 25 Feb 2018 10:32:26 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAWQMe017958; Sun, 25 Feb 2018 10:32:26 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251032.w1PAWQMe017958@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:32:26 +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: r329968 - 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: 329968 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.25 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, 25 Feb 2018 10:32:27 -0000 Author: hselasky Date: Sun Feb 25 10:32:26 2018 New Revision: 329968 URL: https://svnweb.freebsd.org/changeset/base/329968 Log: MFC r329512: Implement __list_del_entry() helper functions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:31:27 2018 (r329967) +++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:32:26 2018 (r329968) @@ -117,6 +117,13 @@ __list_del(struct list_head *prev, struct list_head *n } static inline void +__list_del_entry(struct list_head *entry) +{ + + __list_del(entry->prev, entry->next); +} + +static inline void list_del(struct list_head *entry) { From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:33:13 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 31BA9F276DD; Sun, 25 Feb 2018 10:33: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCBA7760F2; Sun, 25 Feb 2018 10:33:12 +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 D74CB3CCE; Sun, 25 Feb 2018 10:33:12 +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 w1PAXCWk018125; Sun, 25 Feb 2018 10:33:12 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAXCnS018124; Sun, 25 Feb 2018 10:33:12 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251033.w1PAXCnS018124@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:33: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: r329969 - 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: 329969 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.25 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, 25 Feb 2018 10:33:13 -0000 Author: hselasky Date: Sun Feb 25 10:33:12 2018 New Revision: 329969 URL: https://svnweb.freebsd.org/changeset/base/329969 Log: MFC r329513: Implement __GFP_BITS_SHIFT and __GFP_BITS_MASK macros in the LinuxKPI. Add compile time asserts to catch conflicts with native defines. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Feb 25 10:32:26 2018 (r329968) +++ stable/11/sys/compat/linuxkpi/common/include/linux/gfp.h Sun Feb 25 10:33:12 2018 (r329969) @@ -54,6 +54,8 @@ #define __GFP_NO_KSWAPD 0 #define __GFP_WAIT M_WAITOK #define __GFP_DMA32 (1U << 24) /* LinuxKPI only */ +#define __GFP_BITS_SHIFT 25 +#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) #define GFP_NOWAIT M_NOWAIT #define GFP_ATOMIC (M_NOWAIT | M_USE_RESERVE) @@ -66,6 +68,9 @@ #define GFP_DMA32 __GFP_DMA32 #define GFP_TEMPORARY M_NOWAIT #define GFP_NATIVE_MASK (M_NOWAIT | M_WAITOK | M_USE_RESERVE | M_ZERO) + +CTASSERT((__GFP_DMA32 & GFP_NATIVE_MASK) == 0); +CTASSERT((__GFP_BITS_MASK & GFP_NATIVE_MASK) == GFP_NATIVE_MASK); /* * Resolve a page into a virtual address: From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:21:32 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87854F26C6E; Sun, 25 Feb 2018 10:21: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 34CD274FE0; Sun, 25 Feb 2018 10:21: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 2F2EF3925; Sun, 25 Feb 2018 10:21: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 w1PALVDV009956; Sun, 25 Feb 2018 10:21:31 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PALV5b009955; Sun, 25 Feb 2018 10:21:31 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251021.w1PALV5b009955@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:21:31 +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: r329956 - 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: 329956 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.25 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, 25 Feb 2018 10:21:32 -0000 Author: hselasky Date: Sun Feb 25 10:21:31 2018 New Revision: 329956 URL: https://svnweb.freebsd.org/changeset/base/329956 Log: MFC r329447: Compile in the LinuxKPI. Flexible array members are not allowed in a union. Use a zero length array instead. Reported by: jbeich@ Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:19:44 2018 (r329955) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:21:31 2018 (r329956) @@ -162,10 +162,10 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg(ptr, old, new) ({ \ union { \ __typeof(*(ptr)) val; \ - u8 u8[]; \ - u16 u16[]; \ - u32 u32[]; \ - u64 u64[]; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ } __ret = { .val = (old) }, __new = { .val = (new) }; \ \ CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:25:48 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9E1DFF26FB2; Sun, 25 Feb 2018 10:25:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 514EC75578; Sun, 25 Feb 2018 10:25:48 +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 4C2453B22; Sun, 25 Feb 2018 10:25:48 +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 w1PAPm5b013008; Sun, 25 Feb 2018 10:25:48 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAPmKK013007; Sun, 25 Feb 2018 10:25:48 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251025.w1PAPmKK013007@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:25:48 +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: r329961 - 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: 329961 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.25 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, 25 Feb 2018 10:25:48 -0000 Author: hselasky Date: Sun Feb 25 10:25:47 2018 New Revision: 329961 URL: https://svnweb.freebsd.org/changeset/base/329961 Log: MFC r329468: Add support for kref_read() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kref.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/kref.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/kref.h Sun Feb 25 10:24:59 2018 (r329960) +++ stable/11/sys/compat/linuxkpi/common/include/linux/kref.h Sun Feb 25 10:25:47 2018 (r329961) @@ -52,6 +52,13 @@ kref_init(struct kref *kref) refcount_init(&kref->refcount.counter, 1); } +static inline unsigned int +kref_read(const struct kref *kref) +{ + + return (atomic_read(&kref->refcount)); +} + static inline void kref_get(struct kref *kref) { From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:39:40 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 289F7F27D9C; Sun, 25 Feb 2018 10:39:40 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF50176842; Sun, 25 Feb 2018 10:39:39 +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 B60F13CD6; Sun, 25 Feb 2018 10:39:39 +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 w1PAddjk018710; Sun, 25 Feb 2018 10:39:39 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAddTp018709; Sun, 25 Feb 2018 10:39:39 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251039.w1PAddTp018709@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:39:39 +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: r329975 - 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: 329975 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.25 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, 25 Feb 2018 10:39:40 -0000 Author: hselasky Date: Sun Feb 25 10:39:39 2018 New Revision: 329975 URL: https://svnweb.freebsd.org/changeset/base/329975 Log: MFC r329584: Implement list_safe_reset_next() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/list.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:38:42 2018 (r329974) +++ stable/11/sys/compat/linuxkpi/common/include/linux/list.h Sun Feb 25 10:39:39 2018 (r329975) @@ -179,6 +179,9 @@ list_del_init(struct list_head *entry) #define list_next_entry(ptr, member) \ list_entry(((ptr)->member.next), typeof(*(ptr)), member) +#define list_safe_reset_next(ptr, n, member) \ + (n) = list_next_entry(ptr, member) + #define list_prev_entry(ptr, member) \ list_entry(((ptr)->member.prev), typeof(*(ptr)), member) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:48:52 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CFFA6F285D5; Sun, 25 Feb 2018 10:48: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C0B9773B2; Sun, 25 Feb 2018 10:48: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 706AB3E7C; Sun, 25 Feb 2018 10:48: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 w1PAmqNw024085; Sun, 25 Feb 2018 10:48:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAmqa0024084; Sun, 25 Feb 2018 10:48:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251048.w1PAmqa0024084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:48:52 +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: r329979 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 329979 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.25 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, 25 Feb 2018 10:48:53 -0000 Author: hselasky Date: Sun Feb 25 10:48:52 2018 New Revision: 329979 URL: https://svnweb.freebsd.org/changeset/base/329979 Log: MFC r329703: Allow LinuxKPI character devices to receive mmap() calls from the Linux binary mode user-space emulation layer. This is a regression issue after r328436, when LinuxKPI character devices started to use DTYPE_DEV in the "f_type" field of the associated file structure(s). Found by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linux/linux_mmap.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_mmap.c ============================================================================== --- stable/11/sys/compat/linux/linux_mmap.c Sun Feb 25 10:47:33 2018 (r329978) +++ stable/11/sys/compat/linux/linux_mmap.c Sun Feb 25 10:48:52 2018 (r329979) @@ -129,7 +129,7 @@ linux_mmap_common(struct thread *td, uintptr_t addr, s error = fget(td, fd, cap_rights_init(&rights, CAP_MMAP), &fp); if (error != 0) return (error); - if (fp->f_type != DTYPE_VNODE) { + if (fp->f_type != DTYPE_VNODE && fp->f_type != DTYPE_DEV) { fdrop(fp, td); return (EINVAL); } From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:18:03 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6B456F26944; Sun, 25 Feb 2018 10:18:03 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19C3274B4E; Sun, 25 Feb 2018 10:18:03 +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 107DB38BA; Sun, 25 Feb 2018 10:18:03 +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 w1PAI21h007282; Sun, 25 Feb 2018 10:18:02 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAI2e6007280; Sun, 25 Feb 2018 10:18:02 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251018.w1PAI2e6007280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:18:02 +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: r329953 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329953 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.25 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, 25 Feb 2018 10:18:03 -0000 Author: hselasky Date: Sun Feb 25 10:18:02 2018 New Revision: 329953 URL: https://svnweb.freebsd.org/changeset/base/329953 Log: MFC r329376: Implement tasklet_enable() and tasklet_disable() in the LinuxKPI. Requested by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:15:52 2018 (r329952) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:18:02 2018 (r329953) @@ -200,5 +200,7 @@ extern void tasklet_schedule(struct tasklet_struct *); extern void tasklet_kill(struct tasklet_struct *); extern void tasklet_init(struct tasklet_struct *, tasklet_func_t *, unsigned long data); +extern void tasklet_enable(struct tasklet_struct *); +extern void tasklet_disable(struct tasklet_struct *); #endif /* _LINUX_INTERRUPT_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c Sun Feb 25 10:15:52 2018 (r329952) +++ stable/11/sys/compat/linuxkpi/common/src/linux_tasklet.c Sun Feb 25 10:18:02 2018 (r329953) @@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$"); #define TASKLET_ST_BUSY 1 #define TASKLET_ST_EXEC 2 #define TASKLET_ST_LOOP 3 +#define TASKLET_ST_PAUSED 4 #define TASKLET_ST_CMPSET(ts, old, new) \ atomic_cmpset_ptr((volatile uintptr_t *)&(ts)->entry.tqe_prev, old, new) @@ -195,4 +196,22 @@ tasklet_kill(struct tasklet_struct *ts) /* wait until tasklet is no longer busy */ while (TASKLET_ST_GET(ts) != TASKLET_ST_IDLE) pause("W", 1); +} + +void +tasklet_enable(struct tasklet_struct *ts) +{ + (void) TASKLET_ST_CMPSET(ts, TASKLET_ST_PAUSED, TASKLET_ST_IDLE); +} + +void +tasklet_disable(struct tasklet_struct *ts) +{ + while (1) { + if (TASKLET_ST_GET(ts) == TASKLET_ST_PAUSED) + break; + if (TASKLET_ST_CMPSET(ts, TASKLET_ST_IDLE, TASKLET_ST_PAUSED)) + break; + pause("W", 1); + } } From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:23:24 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 47932F26E62; Sun, 25 Feb 2018 10:23:24 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EC1AF752A3; Sun, 25 Feb 2018 10:23: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 E5C9F3B1D; Sun, 25 Feb 2018 10:23:23 +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 w1PANNRt012749; Sun, 25 Feb 2018 10:23:23 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PANNs8012746; Sun, 25 Feb 2018 10:23:23 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251023.w1PANNs8012746@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:23:23 +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: r329958 - 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: 329958 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.25 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, 25 Feb 2018 10:23:24 -0000 Author: hselasky Date: Sun Feb 25 10:23:23 2018 New Revision: 329958 URL: https://svnweb.freebsd.org/changeset/base/329958 Log: MFC r329465: Move the IRQ_RETVAL() and irqreturn definitions to irqreturn.h in the LinuxKPI to be compatible with Linux. No functional change. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Added: stable/11/sys/compat/linuxkpi/common/include/linux/irqreturn.h - copied unchanged from r329465, head/sys/compat/linuxkpi/common/include/linux/irqreturn.h Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/device.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/device.h Sun Feb 25 10:22:27 2018 (r329957) +++ stable/11/sys/compat/linuxkpi/common/include/linux/device.h Sun Feb 25 10:23:23 2018 (r329958) @@ -46,9 +46,6 @@ #include -enum irqreturn { IRQ_NONE = 0, IRQ_HANDLED, IRQ_WAKE_THREAD, }; -typedef enum irqreturn irqreturn_t; - struct device; struct fwnode_handle; Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:22:27 2018 (r329957) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:23:23 2018 (r329958) @@ -33,13 +33,12 @@ #include #include +#include #include #include typedef irqreturn_t (*irq_handler_t)(int, void *); - -#define IRQ_RETVAL(x) ((x) != IRQ_NONE) #define IRQF_SHARED RF_SHAREABLE Copied: stable/11/sys/compat/linuxkpi/common/include/linux/irqreturn.h (from r329465, head/sys/compat/linuxkpi/common/include/linux/irqreturn.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/irqreturn.h Sun Feb 25 10:23:23 2018 (r329958, copy of r329465, head/sys/compat/linuxkpi/common/include/linux/irqreturn.h) @@ -0,0 +1,40 @@ +/*- + * Copyright (c) 2017 Limelight Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef _LINUX_IRQRETURN_H +#define _LINUX_IRQRETURN_H + +typedef enum irqreturn { + IRQ_NONE = 0, + IRQ_HANDLED = 1, + IRQ_WAKE_THREAD = 2 +} irqreturn_t; + +#define IRQ_RETVAL(x) ((x) ? IRQ_HANDLED : IRQ_NONE) + +#endif /* _LINUX_IRQRETURN_H */ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:24:09 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 87BD7F26ECA; Sun, 25 Feb 2018 10:24:09 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3924775387; Sun, 25 Feb 2018 10:24:09 +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 341973B1E; Sun, 25 Feb 2018 10:24:09 +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 w1PAO8L1012832; Sun, 25 Feb 2018 10:24:08 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAO8dB012831; Sun, 25 Feb 2018 10:24:08 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251024.w1PAO8dB012831@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:24:08 +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: r329959 - 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: 329959 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.25 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, 25 Feb 2018 10:24:09 -0000 Author: hselasky Date: Sun Feb 25 10:24:08 2018 New Revision: 329959 URL: https://svnweb.freebsd.org/changeset/base/329959 Log: MFC r329466: Add support for __percpu and __weak macros in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Feb 25 10:23:23 2018 (r329958) +++ stable/11/sys/compat/linuxkpi/common/include/linux/compiler.h Sun Feb 25 10:24:08 2018 (r329959) @@ -56,6 +56,8 @@ #define __devexit #define __exit #define __rcu +#define __percpu +#define __weak __weak_symbol #define __malloc #define ___stringify(...) #__VA_ARGS__ #define __stringify(...) ___stringify(__VA_ARGS__) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:25:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5258BF26F37; Sun, 25 Feb 2018 10:25:00 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 060AB75488; Sun, 25 Feb 2018 10:25:00 +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 00FE23B21; Sun, 25 Feb 2018 10:25:00 +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 w1PAOxwF012915; Sun, 25 Feb 2018 10:24:59 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAOxiO012914; Sun, 25 Feb 2018 10:24:59 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251024.w1PAOxiO012914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:24: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: r329960 - 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: 329960 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.25 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, 25 Feb 2018 10:25:00 -0000 Author: hselasky Date: Sun Feb 25 10:24:59 2018 New Revision: 329960 URL: https://svnweb.freebsd.org/changeset/base/329960 Log: MFC r329467: Add support for mmgrab() function in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Sun Feb 25 10:24:08 2018 (r329959) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mm_types.h Sun Feb 25 10:24:59 2018 (r329960) @@ -62,6 +62,12 @@ mmput(struct mm_struct *mm) mmdrop(mm); } +static inline void +mmgrab(struct mm_struct *mm) +{ + atomic_inc(&mm->mm_count); +} + extern struct mm_struct *linux_get_task_mm(struct task_struct *); #define get_task_mm(task) linux_get_task_mm(task) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:28:52 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D7950F27054; Sun, 25 Feb 2018 10:28: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 74B517581F; Sun, 25 Feb 2018 10:28: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 6AD503B25; Sun, 25 Feb 2018 10:28: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 w1PASqi4013289; Sun, 25 Feb 2018 10:28:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PASqrP013288; Sun, 25 Feb 2018 10:28:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251028.w1PASqrP013288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:28:52 +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: r329964 - 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: 329964 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.25 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, 25 Feb 2018 10:28:53 -0000 Author: hselasky Date: Sun Feb 25 10:28:52 2018 New Revision: 329964 URL: https://svnweb.freebsd.org/changeset/base/329964 Log: MFC r329476: Stub more lockdep function macros in the LinuxKPI. Submitted by: Johannes Lundberg 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 Sun Feb 25 10:28:06 2018 (r329963) +++ stable/11/sys/compat/linuxkpi/common/include/linux/lockdep.h Sun Feb 25 10:28:52 2018 (r329964) @@ -48,5 +48,10 @@ struct lock_class_key { #define lockdep_is_held(m) (sx_xholder(&(m)->sx) == curthread) #define might_lock(m) do { } while (0) +#define might_lock_read(m) do { } while (0) + +#define lock_acquire(...) do { } while (0) +#define lock_release(...) do { } while (0) +#define lock_acquire_shared_recursive(...) do { } while (0) #endif /* _LINUX_LOCKDEP_H_ */ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:40:42 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E3F6F27DFF; Sun, 25 Feb 2018 10:40:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C4DB876948; Sun, 25 Feb 2018 10:40: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 BFC7A3CE5; Sun, 25 Feb 2018 10:40: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 w1PAef8Y018847; Sun, 25 Feb 2018 10:40:41 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAefMb018839; Sun, 25 Feb 2018 10:40:41 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251040.w1PAefMb018839@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:40: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: r329976 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329976 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.25 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, 25 Feb 2018 10:40:42 -0000 Author: hselasky Date: Sun Feb 25 10:40:41 2018 New Revision: 329976 URL: https://svnweb.freebsd.org/changeset/base/329976 Log: MFC r329825: Return correct error code to user-space when a system call receives a signal in the LinuxKPI. The read(), write() and mmap() system calls can return either EINTR or ERESTART upon receiving a signal. Add code to figure out the correct return value by temporarily storing the return code from the relevant FreeBSD kernel APIs in the Linux task structure. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h stable/11/sys/compat/linuxkpi/common/include/linux/sched.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c stable/11/sys/compat/linuxkpi/common/src/linux_lock.c stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c 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 Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Sun Feb 25 10:40:41 2018 (r329976) @@ -63,7 +63,7 @@ typedef struct mutex { #define mutex_lock_interruptible(_m) ({ \ MUTEX_SKIP() ? 0 : \ - (sx_xlock_sig(&(_m)->sx) ? -EINTR : 0); \ + linux_mutex_lock_interruptible(_m); \ }) #define mutex_unlock(_m) do { \ @@ -142,5 +142,7 @@ linux_mutex_destroy(mutex_t *m) mutex_unlock(m); sx_destroy(&m->sx); } + +extern int linux_mutex_lock_interruptible(mutex_t *m); #endif /* _LINUX_MUTEX_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/include/linux/rwsem.h Sun Feb 25 10:40:41 2018 (r329976) @@ -47,7 +47,7 @@ struct rw_semaphore { #define up_read(_rw) sx_sunlock(&(_rw)->sx) #define down_read_trylock(_rw) !!sx_try_slock(&(_rw)->sx) #define down_write_trylock(_rw) !!sx_try_xlock(&(_rw)->sx) -#define down_write_killable(_rw) !!sx_xlock_sig(&(_rw)->sx) +#define down_write_killable(_rw) linux_down_write_killable(_rw) #define downgrade_write(_rw) sx_downgrade(&(_rw)->sx) #define down_read_nested(_rw, _sc) down_read(_rw) #define init_rwsem(_rw) linux_init_rwsem(_rw, rwsem_name("lnxrwsem")) @@ -78,5 +78,7 @@ linux_init_rwsem(struct rw_semaphore *rw, const char * memset(rw, 0, sizeof(*rw)); sx_init_flags(&rw->sx, name, SX_NOWITNESS); } + +extern int linux_down_write_killable(struct rw_semaphore *); #endif /* _LINUX_RWSEM_H_ */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/sched.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/include/linux/sched.h Sun Feb 25 10:40:41 2018 (r329976) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,7 @@ struct task_struct { struct completion exited; TAILQ_ENTRY(task_struct) rcu_entry; int rcu_recurse; + int bsd_interrupt_value; }; #define current ({ \ @@ -127,11 +128,25 @@ void linux_send_sig(int signo, struct task_struct *tas #define signal_pending_state(state, task) \ linux_signal_pending_state(state, task) #define send_sig(signo, task, priv) do { \ - CTASSERT(priv == 0); \ + CTASSERT((priv) == 0); \ linux_send_sig(signo, task); \ } while (0) int linux_schedule_timeout(int timeout); + +static inline void +linux_schedule_save_interrupt_value(struct task_struct *task, int value) +{ + task->bsd_interrupt_value = value; +} + +static inline int +linux_schedule_get_interrupt_value(struct task_struct *task) +{ + int value = task->bsd_interrupt_value; + task->bsd_interrupt_value = 0; + return (value); +} #define schedule() \ (void)linux_schedule_timeout(MAX_SCHEDULE_TIMEOUT) Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:40:41 2018 (r329976) @@ -2,7 +2,7 @@ * Copyright (c) 2010 Isilon Systems, Inc. * Copyright (c) 2010 iX Systems, Inc. * Copyright (c) 2010 Panasas, Inc. - * Copyright (c) 2013-2017 Mellanox Technologies, Ltd. + * Copyright (c) 2013-2018 Mellanox Technologies, Ltd. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -828,10 +828,27 @@ linux_access_ok(int rw, const void *uaddr, size_t len) (eaddr > saddr && eaddr <= VM_MAXUSER_ADDRESS)); } +/* + * This function should return either EINTR or ERESTART depending on + * the signal type sent to this thread: + */ static int +linux_get_error(struct task_struct *task, int error) +{ + /* check for signal type interrupt code */ + if (error == EINTR || error == ERESTARTSYS || error == ERESTART) { + error = -linux_schedule_get_interrupt_value(task); + if (error == 0) + error = EINTR; + } + return (error); +} + +static int linux_file_ioctl_sub(struct file *fp, struct linux_file *filp, u_long cmd, caddr_t data, struct thread *td) { + struct task_struct *task = current; unsigned size; int error; @@ -844,8 +861,8 @@ linux_file_ioctl_sub(struct file *fp, struct linux_fil * Background: Linux code expects a user-space address * while FreeBSD supplies a kernel-space address. */ - current->bsd_ioctl_data = data; - current->bsd_ioctl_len = size; + task->bsd_ioctl_data = data; + task->bsd_ioctl_len = size; data = (void *)LINUX_IOCTL_MIN_PTR; } else { /* fetch user-space pointer */ @@ -869,16 +886,17 @@ linux_file_ioctl_sub(struct file *fp, struct linux_fil else error = ENOTTY; if (size > 0) { - current->bsd_ioctl_data = NULL; - current->bsd_ioctl_len = 0; + task->bsd_ioctl_data = NULL; + task->bsd_ioctl_len = 0; } if (error == EWOULDBLOCK) { /* update kqfilter status, if any */ linux_file_kqfilter_poll(filp, LINUX_KQ_FLAG_HAS_READ | LINUX_KQ_FLAG_HAS_WRITE); - } else if (error == ERESTARTSYS) - error = ERESTART; + } else { + error = linux_get_error(task, error); + } return (error); } @@ -1111,6 +1129,7 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * vm_size_t size, struct vm_object **object, int nprot, struct thread *td) { + struct task_struct *task; struct vm_area_struct *vmap; struct mm_struct *mm; struct linux_file *filp; @@ -1132,7 +1151,8 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * * The atomic reference below makes sure the mm_struct is * available as long as the vmap is in the linux_vma_head. */ - mm = current->mm; + task = current; + mm = task->mm; if (atomic_inc_not_zero(&mm->mm_users) == 0) return (EINVAL); @@ -1147,11 +1167,10 @@ linux_file_mmap_single(struct file *fp, vm_ooffset_t * vmap->vm_mm = mm; if (unlikely(down_write_killable(&vmap->vm_mm->mmap_sem))) { - error = EINTR; + error = linux_get_error(task, EINTR); } else { error = -OPW(fp, td, filp->f_op->mmap(filp, vmap)); - if (error == ERESTARTSYS) - error = ERESTART; + error = linux_get_error(task, error); up_write(&vmap->vm_mm->mmap_sem); } @@ -1290,9 +1309,7 @@ linux_file_read(struct file *file, struct uio *uio, st uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; } else { - error = -bytes; - if (error == ERESTARTSYS) - error = ERESTART; + error = linux_get_error(current, -bytes); } } else error = ENXIO; @@ -1329,9 +1346,7 @@ linux_file_write(struct file *file, struct uio *uio, s uio->uio_iov->iov_len -= bytes; uio->uio_resid -= bytes; } else { - error = -bytes; - if (error == ERESTARTSYS) - error = ERESTART; + error = linux_get_error(current, -bytes); } } else error = ENXIO; @@ -1780,6 +1795,7 @@ linux_complete_common(struct completion *c, int all) int linux_wait_for_common(struct completion *c, int flags) { + struct task_struct *task; int error; if (SCHEDULER_STOPPED()) @@ -1787,6 +1803,8 @@ linux_wait_for_common(struct completion *c, int flags) DROP_GIANT(); + task = current; + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else @@ -1798,7 +1816,9 @@ linux_wait_for_common(struct completion *c, int flags) break; sleepq_add(c, NULL, "completion", flags, 0); if (flags & SLEEPQ_INTERRUPTIBLE) { - if (sleepq_wait_sig(c, 0) != 0) { + error = -sleepq_wait_sig(c, 0); + if (error != 0) { + linux_schedule_save_interrupt_value(task, error); error = -ERESTARTSYS; goto intr; } @@ -1820,22 +1840,22 @@ intr: int linux_wait_for_timeout_common(struct completion *c, int timeout, int flags) { + struct task_struct *task; int end = jiffies + timeout; int error; - int ret; if (SCHEDULER_STOPPED()) return (0); DROP_GIANT(); + task = current; + if (flags != 0) flags = SLEEPQ_INTERRUPTIBLE | SLEEPQ_SLEEP; else flags = SLEEPQ_SLEEP; - error = 0; - ret = 0; for (;;) { sleepq_lock(c); if (c->done) @@ -1843,26 +1863,30 @@ linux_wait_for_timeout_common(struct completion *c, in sleepq_add(c, NULL, "completion", flags, 0); sleepq_set_timeout(c, linux_timer_jiffies_until(end)); if (flags & SLEEPQ_INTERRUPTIBLE) - ret = sleepq_timedwait_sig(c, 0); + error = -sleepq_timedwait_sig(c, 0); else - ret = sleepq_timedwait(c, 0); - if (ret != 0) { - /* check for timeout or signal */ - if (ret == EWOULDBLOCK) - error = 0; - else + error = -sleepq_timedwait(c, 0); + if (error != 0) { + /* check for timeout */ + if (error == -EWOULDBLOCK) { + error = 0; /* timeout */ + } else { + /* signal happened */ + linux_schedule_save_interrupt_value(task, error); error = -ERESTARTSYS; - goto intr; + } + goto done; } } c->done--; sleepq_release(c); -intr: + /* return how many jiffies are left */ + error = linux_timer_jiffies_until(end); +done: PICKUP_GIANT(); - /* return how many jiffies are left */ - return (ret != 0 ? error : linux_timer_jiffies_until(end)); + return (error); } int Modified: stable/11/sys/compat/linuxkpi/common/src/linux_lock.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_lock.c Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/src/linux_lock.c Sun Feb 25 10:40:41 2018 (r329976) @@ -28,6 +28,7 @@ #include +#include #include struct ww_mutex_thread { @@ -72,10 +73,13 @@ linux_ww_unlock(void) int linux_ww_mutex_lock_sub(struct ww_mutex *lock, int catch_signal) { + struct task_struct *task; struct ww_mutex_thread entry; struct ww_mutex_thread *other; int retval = 0; + task = current; + linux_ww_lock(); if (unlikely(sx_try_xlock(&lock->base.sx) == 0)) { entry.thread = curthread; @@ -105,7 +109,9 @@ linux_ww_mutex_lock_sub(struct ww_mutex *lock, int cat } } if (catch_signal) { - if (cv_wait_sig(&lock->condvar, &ww_mutex_global) != 0) { + retval = -cv_wait_sig(&lock->condvar, &ww_mutex_global); + if (retval != 0) { + linux_schedule_save_interrupt_value(task, retval); retval = -EINTR; goto done; } @@ -133,4 +139,30 @@ linux_ww_mutex_unlock_sub(struct ww_mutex *lock) /* wakeup a lock waiter, if any */ cv_signal(&lock->condvar); linux_ww_unlock(); +} + +int +linux_mutex_lock_interruptible(mutex_t *m) +{ + int error; + + error = -sx_xlock_sig(&m->sx); + if (error != 0) { + linux_schedule_save_interrupt_value(current, error); + error = -EINTR; + } + return (error); +} + +int +linux_down_write_killable(struct rw_semaphore *rw) +{ + int error; + + error = -sx_xlock_sig(&rw->sx); + if (error != 0) { + linux_schedule_save_interrupt_value(current, error); + error = -EINTR; + } + return (error); } Modified: stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Sun Feb 25 10:39:39 2018 (r329975) +++ stable/11/sys/compat/linuxkpi/common/src/linux_schedule.c Sun Feb 25 10:40:41 2018 (r329976) @@ -41,7 +41,8 @@ __FBSDID("$FreeBSD$"); #include static int -linux_add_to_sleepqueue(void *wchan, const char *wmesg, int timeout, int state) +linux_add_to_sleepqueue(void *wchan, struct task_struct *task, + const char *wmesg, int timeout, int state) { int flags, ret; @@ -66,8 +67,10 @@ linux_add_to_sleepqueue(void *wchan, const char *wmesg ret = -sleepq_timedwait(wchan, 0); } /* filter return value */ - if (ret != 0 && ret != -EWOULDBLOCK) + if (ret != 0 && ret != -EWOULDBLOCK) { + linux_schedule_save_interrupt_value(task, ret); ret = -ERESTARTSYS; + } return (ret); } @@ -235,10 +238,10 @@ linux_wait_event_common(wait_queue_head_t *wqh, wait_q PHOLD(task->task_thread->td_proc); sleepq_lock(task); if (atomic_read(&task->state) != TASK_WAKING) { - ret = linux_add_to_sleepqueue(task, "wevent", timeout, state); + ret = linux_add_to_sleepqueue(task, task, "wevent", timeout, state); } else { sleepq_release(task); - ret = linux_signal_pending_state(state, task) ? -ERESTARTSYS : 0; + ret = 0; } PRELE(task->task_thread->td_proc); @@ -253,6 +256,7 @@ int linux_schedule_timeout(int timeout) { struct task_struct *task; + int ret; int state; int remainder; @@ -270,10 +274,12 @@ linux_schedule_timeout(int timeout) sleepq_lock(task); state = atomic_read(&task->state); - if (state != TASK_WAKING) - (void)linux_add_to_sleepqueue(task, "sched", timeout, state); - else + if (state != TASK_WAKING) { + ret = linux_add_to_sleepqueue(task, task, "sched", timeout, state); + } else { sleepq_release(task); + ret = 0; + } set_task_state(task, TASK_RUNNING); PICKUP_GIANT(); @@ -283,7 +289,11 @@ linux_schedule_timeout(int timeout) /* range check return value */ remainder -= ticks; - if (remainder < 0) + + /* range check return value */ + if (ret == -ERESTARTSYS && remainder < 1) + remainder = 1; + else if (remainder < 0) remainder = 0; else if (remainder > timeout) remainder = timeout; @@ -337,7 +347,7 @@ linux_wait_on_bit_timeout(unsigned long *word, int bit break; } set_task_state(task, state); - ret = linux_add_to_sleepqueue(wchan, "wbit", timeout, state); + ret = linux_add_to_sleepqueue(wchan, task, "wbit", timeout, state); if (ret != 0) break; } @@ -374,7 +384,7 @@ linux_wait_on_atomic_t(atomic_t *a, unsigned int state break; } set_task_state(task, state); - ret = linux_add_to_sleepqueue(wchan, "watomic", 0, state); + ret = linux_add_to_sleepqueue(wchan, task, "watomic", 0, state); if (ret != 0) break; } From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:30:37 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A804F272F7; Sun, 25 Feb 2018 10:30:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 152FB75AFB; Sun, 25 Feb 2018 10:30:37 +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 0F0E43C37; Sun, 25 Feb 2018 10:30:37 +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 w1PAUa00013501; Sun, 25 Feb 2018 10:30:36 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAUaG8013499; Sun, 25 Feb 2018 10:30:36 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251030.w1PAUaG8013499@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:30: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: r329966 - 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: 329966 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.25 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, 25 Feb 2018 10:30:37 -0000 Author: hselasky Date: Sun Feb 25 10:30:36 2018 New Revision: 329966 URL: https://svnweb.freebsd.org/changeset/base/329966 Log: MFC r329510: Refactor dentry structure into its own header file in the LinuxKPI similary to Linux. No functional change. Implement d_inode() helper function. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Added: stable/11/sys/compat/linuxkpi/common/include/linux/dcache.h - copied unchanged from r329510, head/sys/compat/linuxkpi/common/include/linux/dcache.h Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/compat/linuxkpi/common/include/linux/dcache.h (from r329510, head/sys/compat/linuxkpi/common/include/linux/dcache.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/compat/linuxkpi/common/include/linux/dcache.h Sun Feb 25 10:30:36 2018 (r329966, copy of r329510, head/sys/compat/linuxkpi/common/include/linux/dcache.h) @@ -0,0 +1,46 @@ +/*- + * Copyright (c) 2017 Limelight Networks, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice unmodified, this list of conditions, and the following + * disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LINUX_DCACHE_H +#define __LINUX_DCACHE_H + +struct vnode; +struct pfs_node; + +struct dentry { + struct vnode *d_inode; + struct pfs_node *d_pfs_node; /* FreeBSD specific field */ +}; + +static inline struct vnode * +d_inode(const struct dentry *dentry) +{ + return (dentry->d_inode); +} + +#endif /* __LINUX_DCACHE_H */ Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:29:43 2018 (r329965) +++ stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:30:36 2018 (r329966) @@ -42,6 +42,7 @@ #include #include #include +#include struct module; struct kiocb; @@ -64,11 +65,6 @@ struct pfs_node; typedef struct files_struct *fl_owner_t; - -struct dentry { - struct inode *d_inode; - struct pfs_node *d_pfs_node; -}; struct file_operations; From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:31:28 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A4F7F273A4; Sun, 25 Feb 2018 10:31:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1118A75C5D; Sun, 25 Feb 2018 10:31:28 +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 0C4013C70; Sun, 25 Feb 2018 10:31:28 +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 w1PAVR5T013587; Sun, 25 Feb 2018 10:31:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAVRCJ013586; Sun, 25 Feb 2018 10:31:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251031.w1PAVRCJ013586@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:31:27 +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: r329967 - 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: 329967 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.25 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, 25 Feb 2018 10:31:28 -0000 Author: hselasky Date: Sun Feb 25 10:31:27 2018 New Revision: 329967 URL: https://svnweb.freebsd.org/changeset/base/329967 Log: MFC r329511: Implement file_inode() and call_mmap() helper functions in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/fs.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:30:36 2018 (r329966) +++ stable/11/sys/compat/linuxkpi/common/include/linux/fs.h Sun Feb 25 10:31:27 2018 (r329967) @@ -284,6 +284,20 @@ noop_llseek(struct linux_file *file, loff_t offset, in return (file->_file->f_offset); } +static inline struct vnode * +file_inode(const struct linux_file *file) +{ + + return (file->f_vnode); +} + +static inline int +call_mmap(struct linux_file *file, struct vm_area_struct *vma) +{ + + return (file->f_op->mmap(file, vma)); +} + /* Shared memory support */ unsigned long linux_invalidate_mapping_pages(vm_object_t, pgoff_t, pgoff_t); struct page *linux_shmem_read_mapping_page_gfp(vm_object_t, int, gfp_t); From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:52:47 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EB5DBF28908; Sun, 25 Feb 2018 10:52:46 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9C97477857; Sun, 25 Feb 2018 10:52:46 +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 971524046; Sun, 25 Feb 2018 10:52:46 +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 w1PAqkdR028856; Sun, 25 Feb 2018 10:52:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAqkXT028855; Sun, 25 Feb 2018 10:52:46 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251052.w1PAqkXT028855@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:52: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: r329981 - stable/11/sys/sys X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: stable/11/sys/sys X-SVN-Commit-Revision: 329981 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.25 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, 25 Feb 2018 10:52:47 -0000 Author: hselasky Date: Sun Feb 25 10:52:46 2018 New Revision: 329981 URL: https://svnweb.freebsd.org/changeset/base/329981 Log: Bump the FreeBSD version to conclude the recent LinuxKPI related updates. This is a direct commit. Sponsored by: Mellanox Technologies Modified: stable/11/sys/sys/param.h Modified: stable/11/sys/sys/param.h ============================================================================== --- stable/11/sys/sys/param.h Sun Feb 25 10:51:39 2018 (r329980) +++ stable/11/sys/sys/param.h Sun Feb 25 10:52:46 2018 (r329981) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1101510 /* Master, propagated to newvers */ +#define __FreeBSD_version 1101511 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:26:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 33E65F26FE1; Sun, 25 Feb 2018 10:26:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CEC897564D; Sun, 25 Feb 2018 10:26:44 +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 C83313B23; Sun, 25 Feb 2018 10:26:44 +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 w1PAQiQE013102; Sun, 25 Feb 2018 10:26:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAQiOt013101; Sun, 25 Feb 2018 10:26:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251026.w1PAQiOt013101@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:26:44 +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: r329962 - 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: 329962 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.25 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, 25 Feb 2018 10:26:45 -0000 Author: hselasky Date: Sun Feb 25 10:26:44 2018 New Revision: 329962 URL: https://svnweb.freebsd.org/changeset/base/329962 Log: MFC r329470: Add support for printk_ratelimit() function macro and improve the existing printk_ratelimited() function macro to return a boolean stating if there was a printout, true, or not, false. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/printk.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/printk.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/printk.h Sun Feb 25 10:25:47 2018 (r329961) +++ stable/11/sys/compat/linuxkpi/common/include/linux/printk.h Sun Feb 25 10:26:44 2018 (r329962) @@ -106,10 +106,16 @@ print_hex_dump_bytes(const char *prefix_str, const int print_hex_dump(NULL, prefix_str, prefix_type, 16, 1, buf, len, 0); } -#define printk_ratelimited(...) do { \ +#define printk_ratelimit() ({ \ static linux_ratelimit_t __ratelimited; \ - if (linux_ratelimited(&__ratelimited)) \ + linux_ratelimited(&__ratelimited); \ +}) + +#define printk_ratelimited(...) ({ \ + bool __retval = printk_ratelimit(); \ + if (__retval) \ printk(__VA_ARGS__); \ -} while (0) + __retval; \ +}) #endif /* _LINUX_PRINTK_H_ */ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:47:34 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0F35DF2857E; Sun, 25 Feb 2018 10:47:34 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5701772BF; Sun, 25 Feb 2018 10:47:33 +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 ABDC13E7B; Sun, 25 Feb 2018 10:47:33 +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 w1PAlXkg023986; Sun, 25 Feb 2018 10:47:33 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAlXp0023985; Sun, 25 Feb 2018 10:47:33 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251047.w1PAlXp0023985@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:47:33 +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: r329978 - 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: 329978 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.25 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, 25 Feb 2018 10:47:34 -0000 Author: hselasky Date: Sun Feb 25 10:47:33 2018 New Revision: 329978 URL: https://svnweb.freebsd.org/changeset/base/329978 Log: MFC r329472: Allow the put_user() function macro to put constant values by using the existing __put_user() macro. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h Sun Feb 25 10:44:47 2018 (r329977) +++ stable/11/sys/compat/linuxkpi/common/include/linux/uaccess.h Sun Feb 25 10:47:33 2018 (r329978) @@ -58,7 +58,7 @@ linux_copyout(&(__x), (_p), sizeof(*(_p))); \ }) #define get_user(_x, _p) linux_copyin((_p), &(_x), sizeof(*(_p))) -#define put_user(_x, _p) linux_copyout(&(_x), (_p), sizeof(*(_p))) +#define put_user(_x, _p) __put_user(_x, _p) #define clear_user(...) linux_clear_user(__VA_ARGS__) #define access_ok(...) linux_access_ok(__VA_ARGS__) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:15:52 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8880F266F1; Sun, 25 Feb 2018 10:15: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6ADC774970; Sun, 25 Feb 2018 10:15: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 6507C38B9; Sun, 25 Feb 2018 10:15: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 w1PAFqUw007145; Sun, 25 Feb 2018 10:15:52 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAFqQG007144; Sun, 25 Feb 2018 10:15:52 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251015.w1PAFqQG007144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:15:52 +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: r329952 - 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: 329952 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.25 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, 25 Feb 2018 10:15:52 -0000 Author: hselasky Date: Sun Feb 25 10:15:52 2018 New Revision: 329952 URL: https://svnweb.freebsd.org/changeset/base/329952 Log: MFC r329372: Implement enable_irq() and disable_irq() in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:14:35 2018 (r329951) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:15:52 2018 (r329952) @@ -112,6 +112,38 @@ request_irq(unsigned int irq, irq_handler_t handler, u } static inline int +enable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return -EINVAL; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return -EINVAL; + return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, + NULL, linux_irq_handler, irqe, &irqe->tag); +} + +static inline void +disable_irq(unsigned int irq) +{ + struct irq_ent *irqe; + struct device *dev; + + dev = linux_pci_find_irq_dev(irq); + if (dev == NULL) + return; + irqe = linux_irq_ent(dev, irq); + if (irqe == NULL) + return; + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + irqe->tag = NULL; +} + +static inline int bind_irq_to_cpu(unsigned int irq, int cpu_id) { struct irq_ent *irqe; From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:19:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 168ADF26A45; Sun, 25 Feb 2018 10:19:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BAA5174D2C; Sun, 25 Feb 2018 10:19:44 +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 B598538BC; Sun, 25 Feb 2018 10:19:44 +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 w1PAJiXs007451; Sun, 25 Feb 2018 10:19:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAJi9g007450; Sun, 25 Feb 2018 10:19:44 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251019.w1PAJi9g007450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:19:44 +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: r329955 - 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: 329955 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.25 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, 25 Feb 2018 10:19:45 -0000 Author: hselasky Date: Sun Feb 25 10:19:44 2018 New Revision: 329955 URL: https://svnweb.freebsd.org/changeset/base/329955 Log: MFC r329378: Implement mutex_trylock_recursive() in the LinuxKPI. Submitted by: Johannes Lundberg 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 Sun Feb 25 10:18:49 2018 (r329954) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mutex.h Sun Feb 25 10:19:44 2018 (r329955) @@ -77,6 +77,21 @@ typedef struct mutex { !!sx_try_xlock(&(_m)->sx); \ }) +enum mutex_trylock_recursive_enum { + MUTEX_TRYLOCK_FAILED = 0, + MUTEX_TRYLOCK_SUCCESS = 1, + MUTEX_TRYLOCK_RECURSIVE = 2, +}; + +static inline __must_check enum mutex_trylock_recursive_enum +mutex_trylock_recursive(struct mutex *lock) +{ + if (unlikely(sx_xholder(&lock->sx) == curthread)) + return (MUTEX_TRYLOCK_RECURSIVE); + + return (mutex_trylock(lock)); +} + #define mutex_init(_m) \ linux_mutex_init(_m, mutex_name(#_m), SX_NOWITNESS) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:35:29 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA04F27A56; Sun, 25 Feb 2018 10:35:29 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4E1F6764D2; Sun, 25 Feb 2018 10:35:29 +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 492FE3CD1; Sun, 25 Feb 2018 10:35:29 +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 w1PAZTgo018393; Sun, 25 Feb 2018 10:35:29 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAZTxv018392; Sun, 25 Feb 2018 10:35:29 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251035.w1PAZTxv018392@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:35:29 +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: r329972 - 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: 329972 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.25 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, 25 Feb 2018 10:35:29 -0000 Author: hselasky Date: Sun Feb 25 10:35:28 2018 New Revision: 329972 URL: https://svnweb.freebsd.org/changeset/base/329972 Log: MFC r329516: Implement the KMEM_CACHE() function macro in the LinuxKPI. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/slab.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Sun Feb 25 10:34:47 2018 (r329971) +++ stable/11/sys/compat/linuxkpi/common/include/linux/slab.h Sun Feb 25 10:35:28 2018 (r329972) @@ -65,6 +65,10 @@ MALLOC_DECLARE(M_KMALLOC); #define kmem_cache_free(...) linux_kmem_cache_free(__VA_ARGS__) #define kmem_cache_destroy(...) linux_kmem_cache_destroy(__VA_ARGS__) +#define KMEM_CACHE(__struct, flags) \ + linux_kmem_cache_create(#__struct, sizeof(struct __struct), \ + __alignof(struct __struct), (flags), NULL) + typedef void linux_kmem_ctor_t (void *); struct linux_kmem_cache { From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:33:56 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34B45F27892; Sun, 25 Feb 2018 10:33: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D78AF76294; Sun, 25 Feb 2018 10:33: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 D28433CCF; Sun, 25 Feb 2018 10:33: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 w1PAXtiZ018204; Sun, 25 Feb 2018 10:33:55 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAXtur018203; Sun, 25 Feb 2018 10:33:55 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251033.w1PAXtur018203@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:33: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: r329970 - 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: 329970 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.25 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, 25 Feb 2018 10:33:56 -0000 Author: hselasky Date: Sun Feb 25 10:33:55 2018 New Revision: 329970 URL: https://svnweb.freebsd.org/changeset/base/329970 Log: MFC r329514: Implement the rcu_dereference_raw() function macro. Make sure all RCU dereferencing use the READ_ONCE() function macro. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h Sun Feb 25 10:33:12 2018 (r329969) +++ stable/11/sys/compat/linuxkpi/common/include/linux/rcupdate.h Sun Feb 25 10:33:55 2018 (r329970) @@ -74,13 +74,16 @@ } while (0) #define rcu_access_pointer(p) \ - ((__typeof(*p) *)(READ_ONCE(p))) + ((__typeof(*p) *)READ_ONCE(p)) #define rcu_dereference_protected(p, c) \ - ((__typeof(*p) *)(p)) + ((__typeof(*p) *)READ_ONCE(p)) #define rcu_dereference(p) \ rcu_dereference_protected(p, 0) + +#define rcu_dereference_raw(p) \ + ((__typeof(*p) *)READ_ONCE(p)) #define rcu_pointer_handoff(p) (p) From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:38:42 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BB3BAF27D2C; Sun, 25 Feb 2018 10:38:42 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6DE6076741; Sun, 25 Feb 2018 10:38:42 +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 68D2D3CD5; Sun, 25 Feb 2018 10:38:42 +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 w1PAcgNu018619; Sun, 25 Feb 2018 10:38:42 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAcgGY018618; Sun, 25 Feb 2018 10:38:42 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251038.w1PAcgGY018618@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:38: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: r329974 - 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: 329974 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.25 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, 25 Feb 2018 10:38:42 -0000 Author: hselasky Date: Sun Feb 25 10:38:42 2018 New Revision: 329974 URL: https://svnweb.freebsd.org/changeset/base/329974 Log: MFC r329523 and r329524: Fix implementation of xchg() function macro in the LinuxKPI. The exchange operation must be atomic. Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:37:07 2018 (r329973) +++ stable/11/sys/compat/linuxkpi/common/include/asm/atomic.h Sun Feb 25 10:38:42 2018 (r329974) @@ -198,12 +198,41 @@ atomic_cmpxchg(atomic_t *v, int old, int new) #define cmpxchg_relaxed(...) cmpxchg(__VA_ARGS__) -#define xchg(ptr, v) ({ \ - __typeof(*(ptr)) __ret; \ - \ - __ret = *(ptr); \ - *(ptr) = v; \ - __ret; \ +#define xchg(ptr, new) ({ \ + union { \ + __typeof(*(ptr)) val; \ + u8 u8[0]; \ + u16 u16[0]; \ + u32 u32[0]; \ + u64 u64[0]; \ + } __ret, __new = { .val = (new) }; \ + \ + CTASSERT(sizeof(__ret.val) == 1 || sizeof(__ret.val) == 2 || \ + sizeof(__ret.val) == 4 || sizeof(__ret.val) == 8); \ + \ + switch (sizeof(__ret.val)) { \ + case 1: \ + __ret.val = READ_ONCE(*ptr); \ + while (!atomic_fcmpset_8((volatile u8 *)(ptr), \ + __ret.u8, __new.u8[0])) \ + ; \ + break; \ + case 2: \ + __ret.val = READ_ONCE(*ptr); \ + while (!atomic_fcmpset_16((volatile u16 *)(ptr), \ + __ret.u16, __new.u16[0])) \ + ; \ + break; \ + case 4: \ + __ret.u32[0] = atomic_swap_32((volatile u32 *)(ptr), \ + __new.u32[0]); \ + break; \ + case 8: \ + __ret.u64[0] = atomic_swap_64((volatile u64 *)(ptr), \ + __new.u64[0]); \ + break; \ + } \ + __ret.val; \ }) #define LINUX_ATOMIC_OP(op, c_op) \ From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:22:28 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 38343F26D18; Sun, 25 Feb 2018 10:22:28 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DCB2675164; Sun, 25 Feb 2018 10:22:27 +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 D79C53B17; Sun, 25 Feb 2018 10:22:27 +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 w1PAMRTb012656; Sun, 25 Feb 2018 10:22:27 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAMREM012655; Sun, 25 Feb 2018 10:22:27 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251022.w1PAMREM012655@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:22:27 +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: r329957 - 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: 329957 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.25 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, 25 Feb 2018 10:22:28 -0000 Author: hselasky Date: Sun Feb 25 10:22:27 2018 New Revision: 329957 URL: https://svnweb.freebsd.org/changeset/base/329957 Log: MFC r329464: Add checks for valid IRQ tag before setting up or tearing down an interrupt handler in the LinuxKPI. This is needed when the interrupt handler is disabled before freeing the interrupt. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:21:31 2018 (r329956) +++ stable/11/sys/compat/linuxkpi/common/include/linux/interrupt.h Sun Feb 25 10:22:27 2018 (r329957) @@ -121,7 +121,7 @@ enable_irq(unsigned int irq) if (dev == NULL) return -EINVAL; irqe = linux_irq_ent(dev, irq); - if (irqe == NULL) + if (irqe == NULL || irqe->tag != NULL) return -EINVAL; return -bus_setup_intr(dev->bsddev, irqe->res, INTR_TYPE_NET | INTR_MPSAFE, NULL, linux_irq_handler, irqe, &irqe->tag); @@ -139,7 +139,8 @@ disable_irq(unsigned int irq) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); irqe->tag = NULL; } @@ -174,7 +175,8 @@ free_irq(unsigned int irq, void *device) irqe = linux_irq_ent(dev, irq); if (irqe == NULL) return; - bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); + if (irqe->tag != NULL) + bus_teardown_intr(dev->bsddev, irqe->res, irqe->tag); bus_release_resource(dev->bsddev, SYS_RES_IRQ, rid, irqe->res); list_del(&irqe->links); kfree(irqe); From owner-svn-src-stable-11@freebsd.org Sun Feb 25 10:34:48 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2E1D0F279D7; Sun, 25 Feb 2018 10:34:48 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CFAE9763C1; Sun, 25 Feb 2018 10:34:47 +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 CA9563CD0; Sun, 25 Feb 2018 10:34:47 +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 w1PAYl8U018298; Sun, 25 Feb 2018 10:34:47 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1PAYlWa018296; Sun, 25 Feb 2018 10:34:47 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802251034.w1PAYlWa018296@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sun, 25 Feb 2018 10:34:47 +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: r329971 - in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/compat/linuxkpi/common: include/linux src X-SVN-Commit-Revision: 329971 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.25 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, 25 Feb 2018 10:34:48 -0000 Author: hselasky Date: Sun Feb 25 10:34:47 2018 New Revision: 329971 URL: https://svnweb.freebsd.org/changeset/base/329971 Log: MFC r329515: Make the vm_fault structure in the LinuxKPI compatible with newer versions of the Linux kernel. No functional change. Submitted by: Johannes Lundberg Sponsored by: Mellanox Technologies Sponsored by: Limelight Networks Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linuxkpi/common/include/linux/mm.h ============================================================================== --- stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Sun Feb 25 10:33:55 2018 (r329970) +++ stable/11/sys/compat/linuxkpi/common/include/linux/mm.h Sun Feb 25 10:34:47 2018 (r329971) @@ -118,8 +118,13 @@ struct vm_area_struct { struct vm_fault { unsigned int flags; pgoff_t pgoff; - void *virtual_address; /* user-space address */ + union { + /* user-space address */ + void *virtual_address; + unsigned long address; + }; struct page *page; + struct vm_area_struct *vma; }; struct vm_operations_struct { Modified: stable/11/sys/compat/linuxkpi/common/src/linux_compat.c ============================================================================== --- stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:33:55 2018 (r329970) +++ stable/11/sys/compat/linuxkpi/common/src/linux_compat.c Sun Feb 25 10:34:47 2018 (r329971) @@ -538,6 +538,7 @@ linux_cdev_pager_populate(vm_object_t vm_obj, vm_pinde vmf.flags = (fault_type & VM_PROT_WRITE) ? FAULT_FLAG_WRITE : 0; vmf.pgoff = 0; vmf.page = NULL; + vmf.vma = vmap; vmap->vm_pfn_count = 0; vmap->vm_pfn_pcount = &vmap->vm_pfn_count; From owner-svn-src-stable-11@freebsd.org Mon Feb 26 02:12:10 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1EA41F11D54; Mon, 26 Feb 2018 02:12:10 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C29E17C2D8; Mon, 26 Feb 2018 02:12:09 +0000 (UTC) (envelope-from silby@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 BDA33153F5; Mon, 26 Feb 2018 02:12:09 +0000 (UTC) (envelope-from silby@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1Q2C9cU089571; Mon, 26 Feb 2018 02:12:09 GMT (envelope-from silby@FreeBSD.org) Received: (from silby@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q2C9wT089570; Mon, 26 Feb 2018 02:12:09 GMT (envelope-from silby@FreeBSD.org) Message-Id: <201802260212.w1Q2C9wT089570@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: silby set sender to silby@FreeBSD.org using -f From: Mike Silbersack Date: Mon, 26 Feb 2018 02:12: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: r329998 - stable/11/sbin/savecore X-SVN-Group: stable-11 X-SVN-Commit-Author: silby X-SVN-Commit-Paths: stable/11/sbin/savecore X-SVN-Commit-Revision: 329998 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.25 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, 26 Feb 2018 02:12:10 -0000 Author: silby Date: Mon Feb 26 02:12:09 2018 New Revision: 329998 URL: https://svnweb.freebsd.org/changeset/base/329998 Log: MFC r329362: Prevent savecore from reading bounds from the current directory. Modified: stable/11/sbin/savecore/savecore.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/savecore/savecore.c ============================================================================== --- stable/11/sbin/savecore/savecore.c Mon Feb 26 00:34:56 2018 (r329997) +++ stable/11/sbin/savecore/savecore.c Mon Feb 26 02:12:09 2018 (r329998) @@ -155,6 +155,13 @@ getbounds(void) char buf[6]; int ret; + /* + * If we are just checking, then we haven't done a chdir to the dump + * directory and we should not try to read a bounds file. + */ + if (checkfor) + return (0); + ret = 0; if ((fp = fopen("bounds", "r")) == NULL) { From owner-svn-src-stable-11@freebsd.org Mon Feb 26 07:57:12 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 16307F320EF; Mon, 26 Feb 2018 07:57:12 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B845A87F39; Mon, 26 Feb 2018 07:57: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 AEB4118AC0; Mon, 26 Feb 2018 07:57: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 w1Q7vBld061737; Mon, 26 Feb 2018 07:57:11 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q7vB0P061735; Mon, 26 Feb 2018 07:57:11 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802260757.w1Q7vB0P061735@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Feb 2018 07:57:11 +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: r330013 - in stable/11/sys/dev/usb: . quirk X-SVN-Group: stable-11 X-SVN-Commit-Author: hselasky X-SVN-Commit-Paths: in stable/11/sys/dev/usb: . quirk X-SVN-Commit-Revision: 330013 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.25 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, 26 Feb 2018 07:57:12 -0000 Author: hselasky Date: Mon Feb 26 07:57:11 2018 New Revision: 330013 URL: https://svnweb.freebsd.org/changeset/base/330013 Log: MFC r329195: Add new USB quirk. PR: 225844 Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c stable/11/sys/dev/usb/usbdevs Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/quirk/usb_quirk.c ============================================================================== --- stable/11/sys/dev/usb/quirk/usb_quirk.c Mon Feb 26 04:55:08 2018 (r330012) +++ stable/11/sys/dev/usb/quirk/usb_quirk.c Mon Feb 26 07:57:11 2018 (r330013) @@ -136,6 +136,8 @@ static struct usb_quirk_entry usb_quirks[USB_DEV_QUIRK USB_QUIRK(CORSAIR, K60, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair Vengeance K70 keyboard */ USB_QUIRK(CORSAIR, K70, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), + /* Quirk for Corsair K70 RGB keyboard */ + USB_QUIRK(CORSAIR, K70_RGB, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* Quirk for Corsair STRAFE Gaming keyboard */ USB_QUIRK(CORSAIR, STRAFE, 0x0000, 0xffff, UQ_KBD_BOOTPROTO), /* umodem(4) device quirks */ Modified: stable/11/sys/dev/usb/usbdevs ============================================================================== --- stable/11/sys/dev/usb/usbdevs Mon Feb 26 04:55:08 2018 (r330012) +++ stable/11/sys/dev/usb/usbdevs Mon Feb 26 07:57:11 2018 (r330013) @@ -1520,6 +1520,7 @@ product COREGA FETHER_USB_TXC 0x9601 FEther USB-TXC /* Corsair products */ product CORSAIR K60 0x0a60 Corsair Vengeance K60 keyboard product CORSAIR K70 0x1b09 Corsair Vengeance K70 keyboard +product CORSAIR K70_RGB 0x1b13 Corsair K70 RGB Keyboard product CORSAIR STRAFE 0x1b15 Cossair STRAFE Gaming keyboard /* Creative products */ From owner-svn-src-stable-11@freebsd.org Mon Feb 26 08:00:01 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1989F32546; Mon, 26 Feb 2018 08:00:01 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 83C54682D3; Mon, 26 Feb 2018 08:00:01 +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 7AA1418AC7; Mon, 26 Feb 2018 08:00:01 +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 w1Q801pC062055; Mon, 26 Feb 2018 08:00:01 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1Q801Zu062054; Mon, 26 Feb 2018 08:00:01 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201802260800.w1Q801Zu062054@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Mon, 26 Feb 2018 08:00: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: r330015 - 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: 330015 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.25 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, 26 Feb 2018 08:00:02 -0000 Author: hselasky Date: Mon Feb 26 08:00:01 2018 New Revision: 330015 URL: https://svnweb.freebsd.org/changeset/base/330015 Log: MFC r329198: Fix for incorrect PnP information used by devmatch(8). Sponsored by: Mellanox Technologies Modified: stable/11/sys/dev/usb/usbdi.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/usb/usbdi.h ============================================================================== --- stable/11/sys/dev/usb/usbdi.h Mon Feb 26 07:57:56 2018 (r330014) +++ stable/11/sys/dev/usb/usbdi.h Mon Feb 26 08:00:01 2018 (r330015) @@ -334,7 +334,7 @@ struct usb_device_id { unsigned long driver_info; } __aligned(32); -#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:product;G16:product;" \ +#define USB_STD_PNP_INFO "M16:mask;U16:vendor;U16:product;L16:release;G16:release;" \ "U8:devclass;U8:devsubclass;U8:devprotocol;" \ "U8:intclass;U8:intsubclass;U8:intprotocol;" #define USB_STD_PNP_HOST_INFO USB_STD_PNP_INFO "T:mode=host;" From owner-svn-src-stable-11@freebsd.org Mon Feb 26 12:01:44 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8A0FF40FFF; Mon, 26 Feb 2018 12:01:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7E76371956; Mon, 26 Feb 2018 12:01:43 +0000 (UTC) (envelope-from ae@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 611001B28F; Mon, 26 Feb 2018 12:01:43 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1QC1hpk093847; Mon, 26 Feb 2018 12:01:43 GMT (envelope-from ae@FreeBSD.org) Received: (from ae@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1QC1hhT093845; Mon, 26 Feb 2018 12:01:43 GMT (envelope-from ae@FreeBSD.org) Message-Id: <201802261201.w1QC1hhT093845@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: ae set sender to ae@FreeBSD.org using -f From: "Andrey V. Elsukov" Date: Mon, 26 Feb 2018 12:01: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: r330017 - stable/11/sys/netipsec X-SVN-Group: stable-11 X-SVN-Commit-Author: ae X-SVN-Commit-Paths: stable/11/sys/netipsec X-SVN-Commit-Revision: 330017 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.25 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, 26 Feb 2018 12:01:44 -0000 Author: ae Date: Mon Feb 26 12:01:42 2018 New Revision: 330017 URL: https://svnweb.freebsd.org/changeset/base/330017 Log: MFC r329563: Remove unused variables and sysctl declaration. Modified: stable/11/sys/netipsec/ipsec.c stable/11/sys/netipsec/ipsec.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netipsec/ipsec.c ============================================================================== --- stable/11/sys/netipsec/ipsec.c Mon Feb 26 08:45:38 2018 (r330016) +++ stable/11/sys/netipsec/ipsec.c Mon Feb 26 12:01:42 2018 (r330017) @@ -108,7 +108,6 @@ VNET_PCPUSTAT_SYSINIT(ipsec4stat); VNET_PCPUSTAT_SYSUNINIT(ipsec4stat); #endif /* VIMAGE */ -VNET_DEFINE(int, ip4_ah_offsetmask) = 0; /* maybe IP_DF? */ /* DF bit on encap. 0: clear 1: set 2: copy */ VNET_DEFINE(int, ip4_ipsec_dfbit) = 0; VNET_DEFINE(int, ip4_esp_trans_deflev) = IPSEC_LEVEL_USE; @@ -117,7 +116,6 @@ VNET_DEFINE(int, ip4_ah_trans_deflev) = IPSEC_LEVEL_US VNET_DEFINE(int, ip4_ah_net_deflev) = IPSEC_LEVEL_USE; /* ECN ignore(-1)/forbidden(0)/allowed(1) */ VNET_DEFINE(int, ip4_ipsec_ecn) = 0; -VNET_DEFINE(int, ip4_esp_randpad) = -1; static VNET_DEFINE(int, ip4_filtertunnel) = 0; #define V_ip4_filtertunnel VNET(ip4_filtertunnel) @@ -183,9 +181,6 @@ SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DEF_AH_NETLEV, ah SYSCTL_INT(_net_inet_ipsec, IPSECCTL_AH_CLEARTOS, ah_cleartos, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ah_cleartos), 0, "If set, clear type-of-service field when doing AH computation."); -SYSCTL_INT(_net_inet_ipsec, IPSECCTL_AH_OFFSETMASK, ah_offsetmask, - CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ah_offsetmask), 0, - "If not set, clear offset field mask when doing AH computation."); SYSCTL_INT(_net_inet_ipsec, IPSECCTL_DFBIT, dfbit, CTLFLAG_VNET | CTLFLAG_RW, &VNET_NAME(ip4_ipsec_dfbit), 0, "Do not fragment bit on encap."); Modified: stable/11/sys/netipsec/ipsec.h ============================================================================== --- stable/11/sys/netipsec/ipsec.h Mon Feb 26 08:45:38 2018 (r330016) +++ stable/11/sys/netipsec/ipsec.h Mon Feb 26 12:01:42 2018 (r330017) @@ -278,10 +278,8 @@ VNET_DECLARE(int, ip4_esp_trans_deflev); VNET_DECLARE(int, ip4_esp_net_deflev); VNET_DECLARE(int, ip4_ah_trans_deflev); VNET_DECLARE(int, ip4_ah_net_deflev); -VNET_DECLARE(int, ip4_ah_offsetmask); VNET_DECLARE(int, ip4_ipsec_dfbit); VNET_DECLARE(int, ip4_ipsec_ecn); -VNET_DECLARE(int, ip4_esp_randpad); VNET_DECLARE(int, crypto_support); VNET_DECLARE(int, natt_cksum_policy); @@ -291,10 +289,8 @@ VNET_DECLARE(int, natt_cksum_policy); #define V_ip4_esp_net_deflev VNET(ip4_esp_net_deflev) #define V_ip4_ah_trans_deflev VNET(ip4_ah_trans_deflev) #define V_ip4_ah_net_deflev VNET(ip4_ah_net_deflev) -#define V_ip4_ah_offsetmask VNET(ip4_ah_offsetmask) #define V_ip4_ipsec_dfbit VNET(ip4_ipsec_dfbit) #define V_ip4_ipsec_ecn VNET(ip4_ipsec_ecn) -#define V_ip4_esp_randpad VNET(ip4_esp_randpad) #define V_crypto_support VNET(crypto_support) #define V_natt_cksum_policy VNET(natt_cksum_policy) From owner-svn-src-stable-11@freebsd.org Tue Feb 27 00:31:50 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 73A8BF3085C; Tue, 27 Feb 2018 00:31:50 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2326F74F6F; Tue, 27 Feb 2018 00:31:50 +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 1DED122C22; Tue, 27 Feb 2018 00:31:50 +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 w1R0VnSq088503; Tue, 27 Feb 2018 00:31:49 GMT (envelope-from mav@FreeBSD.org) Received: (from mav@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R0VnZQ088502; Tue, 27 Feb 2018 00:31:49 GMT (envelope-from mav@FreeBSD.org) Message-Id: <201802270031.w1R0VnZQ088502@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mav set sender to mav@FreeBSD.org using -f From: Alexander Motin Date: Tue, 27 Feb 2018 00:31: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: r330046 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: mav X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 330046 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.25 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, 27 Feb 2018 00:31:50 -0000 Author: mav Date: Tue Feb 27 00:31:49 2018 New Revision: 330046 URL: https://svnweb.freebsd.org/changeset/base/330046 Log: MFC r328514: Assume Always Running APIC Timer for AMD CPU families >= 0x12. Fallback to HPET may cause locks congestions on many-core systems. This change replicates Linux behavior. Modified: stable/11/sys/x86/x86/local_apic.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/local_apic.c ============================================================================== --- stable/11/sys/x86/x86/local_apic.c Tue Feb 27 00:30:10 2018 (r330045) +++ stable/11/sys/x86/x86/local_apic.c Tue Feb 27 00:31:49 2018 (r330046) @@ -520,6 +520,9 @@ native_lapic_init(vm_paddr_t addr) do_cpuid(0x06, regs); if ((regs[0] & CPUTPM1_ARAT) != 0) arat = 1; + } else if (cpu_vendor_id == CPU_VENDOR_AMD && + CPUID_TO_FAMILY(cpu_id) >= 0x12) { + arat = 1; } bzero(&lapic_et, sizeof(lapic_et)); lapic_et.et_name = "LAPIC"; From owner-svn-src-stable-11@freebsd.org Tue Feb 27 01:28:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2704F34D70; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72C3A774EF; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@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 6D97D235FA; Tue, 27 Feb 2018 01:28:20 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1R1SK8v015039; Tue, 27 Feb 2018 01:28:20 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1R1SKAe015037; Tue, 27 Feb 2018 01:28:20 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802270128.w1R1SKAe015037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Tue, 27 Feb 2018 01:28:20 +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: r330047 - in stable: 10/sys/sys 10/usr.bin/vmstat 11/sys/sys 11/usr.bin/vmstat X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/sys 10/usr.bin/vmstat 11/sys/sys 11/usr.bin/vmstat X-SVN-Commit-Revision: 330047 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.25 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, 27 Feb 2018 01:28:21 -0000 Author: jhb Date: Tue Feb 27 01:28:19 2018 New Revision: 330047 URL: https://svnweb.freebsd.org/changeset/base/330047 Log: MFC 328134: Update various statements in vmstat(8) to match reality. - The process stats are actually thread counts rather than process counts. - Simplify various descriptions to remove mention of stats that are updated every 5 seconds (all VM related stats are now "instant", only the load average is updated every 5 seconds). - Don't make any mention of special treatment for processes that have been active in the last 20 seconds. We don't track that stat. - Rework the description of active virtual memory. Call it mapped virtual memory and explicitly point out it is not the same as the active page queue (which corresponds to "Active" in top(1)), and also hint at the possible bogusness of the value (e.g. if a process maps a single page out of a multiple GB file, the entire file's size is considered mapped). - Simplify a few descriptions that implied their output was a value per interval. All of the "rate" values are per-second rates scaled across the interval. - Update a few comments for 'struct vmtotal' along similar lines. Modified: stable/11/sys/sys/vmmeter.h stable/11/usr.bin/vmstat/vmstat.8 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/sys/vmmeter.h stable/10/usr.bin/vmstat/vmstat.8 Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/sys/vmmeter.h ============================================================================== --- stable/11/sys/sys/vmmeter.h Tue Feb 27 00:31:49 2018 (r330046) +++ stable/11/sys/sys/vmmeter.h Tue Feb 27 01:28:19 2018 (r330047) @@ -202,13 +202,12 @@ u_int vm_meter_cnt(size_t); #endif -/* systemwide totals computed every five seconds */ struct vmtotal { int16_t t_rq; /* length of the run queue */ - int16_t t_dw; /* jobs in ``disk wait'' (neg priority) */ - int16_t t_pw; /* jobs in page wait */ - int16_t t_sl; /* jobs sleeping in core */ - int16_t t_sw; /* swapped out runnable/short block jobs */ + int16_t t_dw; /* threads in ``disk wait'' (neg priority) */ + int16_t t_pw; /* threads in page wait */ + int16_t t_sl; /* threads sleeping in core */ + int16_t t_sw; /* swapped out runnable/short block threads */ int32_t t_vm; /* total virtual memory */ int32_t t_avm; /* active virtual memory */ int32_t t_rm; /* total real memory in use */ Modified: stable/11/usr.bin/vmstat/vmstat.8 ============================================================================== --- stable/11/usr.bin/vmstat/vmstat.8 Tue Feb 27 00:31:49 2018 (r330046) +++ stable/11/usr.bin/vmstat/vmstat.8 Tue Feb 27 01:28:19 2018 (r330047) @@ -28,7 +28,7 @@ .\" @(#)vmstat.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd November 19, 2015 +.Dd January 18, 2018 .Dt VMSTAT 8 .Os .Sh NAME @@ -248,31 +248,39 @@ By default, displays the following information: .Bl -tag -width indent .It procs -Information about the numbers of processes in various states. +Information about the number of threads in various states: .Pp .Bl -tag -width indent -compact .It r -in run queue +running or in run queue .It b blocked for resources (i/o, paging, etc.) .It w -runnable or short sleeper (< 20 secs) but swapped +swapped out .El .It memory Information about the usage of virtual and real memory. -Virtual pages (reported in units of 1024 bytes) are considered active if -they belong to processes which are running or have run in the last 20 -seconds. .Pp +Mapped virtual memory is a sum of all of the virtual pages belonging +to mapped virtual memory objects. +Note that the entire memory object's size is considered mapped even if +only a subset of the object's pages are currently mapped. +This statistic is not related to the active page queue which is used to track +real memory. +.Pp .Bl -tag -width indent -compact .It avm -active virtual pages +mapped virtual memory +.Po previously called active in +.Nm +output +.Pc .It fre size of the free list .El .It page Information about page faults and paging activity. -These are averaged each five seconds, and given in units per second. +These are given in units per second. .Pp .Bl -tag -width indent -compact .It flt @@ -286,11 +294,11 @@ pages paged in .It po pages paged out .It fr -pages freed per second +pages freed .\" .It de .\" anticipated short term memory shortfall .It sr -pages scanned by clock algorithm, per-second +pages scanned by page daemon .El .It disks Disk operations per second (this field is system dependent). @@ -319,15 +327,15 @@ matching pattern is specified (see above), will only display the given devices or the devices matching the pattern, and will not randomly select other devices in the system. .It faults -Trap/interrupt rate averages per second over last 5 seconds. +Trap/interrupt rates per second. .Pp .Bl -tag -width indent -compact .It in -device interrupts per interval (including clock interrupts) +device interrupts (including clock interrupts) .It sy -system calls per interval +system calls .It cs -cpu context switch rate (switches/interval) +cpu context switches .El .It cpu Breakdown of percentage usage of CPU time. @@ -336,7 +344,7 @@ Breakdown of percentage usage of CPU time. .It us user time for normal and low priority processes .It sy -system time +system and interrupt time .It id cpu idle .El @@ -352,10 +360,7 @@ default memory file The command: .Dl vmstat -w 5 will print what the system is doing every five -seconds; this is a good choice of printing interval since this is how often -some of the statistics are sampled in the system. -Others vary every second and running the output for a while will make it -apparent which are recomputed every second. +seconds. .Pp The command: .Dl vmstat -p da -p cd -w 1 From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:17:13 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9FC03F298B6; Tue, 27 Feb 2018 14:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 555D8792A0; Tue, 27 Feb 2018 14:17:13 +0000 (UTC) (envelope-from avg@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 4B7A239F2; Tue, 27 Feb 2018 14:17:13 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REHDnN001421; Tue, 27 Feb 2018 14:17:13 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REHD80001420; Tue, 27 Feb 2018 14:17:13 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271417.w1REHD80001420@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:17: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: r330058 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330058 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.25 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, 27 Feb 2018 14:17:13 -0000 Author: avg Date: Tue Feb 27 14:17:12 2018 New Revision: 330058 URL: https://svnweb.freebsd.org/changeset/base/330058 Log: MFC r328217: zfs: no need to check that size of zfs_cmd_t is not greater than IOCPARM_MAX Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Feb 27 14:08:54 2018 (r330057) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Tue Feb 27 14:17:12 2018 (r330058) @@ -203,7 +203,6 @@ #include "lua.h" #include "lauxlib.h" -CTASSERT(sizeof(zfs_cmd_t) < IOCPARM_MAX); static struct cdev *zfsdev; extern void zfs_init(void); From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:29:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD316F2A5B3; Tue, 27 Feb 2018 14:29:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7FBED79B2E; Tue, 27 Feb 2018 14:29:20 +0000 (UTC) (envelope-from avg@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 7428D3C29; Tue, 27 Feb 2018 14:29:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RETK93006409; Tue, 27 Feb 2018 14:29:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RETKsx006408; Tue, 27 Feb 2018 14:29:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271429.w1RETKsx006408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:29:20 +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: r330060 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330060 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.25 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, 27 Feb 2018 14:29:21 -0000 Author: avg Date: Tue Feb 27 14:29:20 2018 New Revision: 330060 URL: https://svnweb.freebsd.org/changeset/base/330060 Log: MFC r328626: zfs_rezget: drop cached pages before doing anything else Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Feb 27 14:23:43 2018 (r330059) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Tue Feb 27 14:29:20 2018 (r330060) @@ -1250,6 +1250,16 @@ zfs_rezget(znode_t *zp) int count = 0; uint64_t gen; + /* + * Remove cached pages before reloading the znode, so that they are not + * lingering after we run into any error. Ideally, we should vgone() + * the vnode in case of error, but currently we cannot do that + * because of the LOR between the vnode lock and z_teardown_lock. + * So, instead, we have to "doom" the znode in the illumos style. + */ + vp = ZTOV(zp); + vn_pages_remove(vp, 0, 0); + ZFS_OBJ_HOLD_ENTER(zfsvfs, obj_num); mutex_enter(&zp->z_acl_lock); @@ -1329,18 +1339,12 @@ zfs_rezget(znode_t *zp) * (e.g. via a look-up). The old vnode and znode will be * recycled when the last vnode reference is dropped. */ - vp = ZTOV(zp); if (vp->v_type != IFTOVT((mode_t)zp->z_mode)) { zfs_znode_dmu_fini(zp); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); - return (EIO); + return (SET_ERROR(EIO)); } - zp->z_blksz = doi.doi_data_block_size; - vn_pages_remove(vp, 0, 0); - if (zp->z_size != size) - vnode_pager_setsize(vp, zp->z_size); - /* * If the file has zero links, then it has been unlinked on the send * side and it must be in the received unlinked set. @@ -1351,8 +1355,15 @@ zfs_rezget(znode_t *zp) * when the unlinked set gets processed. */ zp->z_unlinked = (zp->z_links == 0); - if (zp->z_unlinked) + if (zp->z_unlinked) { zfs_znode_dmu_fini(zp); + ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); + return (0); + } + + zp->z_blksz = doi.doi_data_block_size; + if (zp->z_size != size) + vnode_pager_setsize(vp, zp->z_size); ZFS_OBJ_HOLD_EXIT(zfsvfs, obj_num); From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:32:34 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5DAF3F2AA9A; Tue, 27 Feb 2018 14:32:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BACB7A000; Tue, 27 Feb 2018 14:32:34 +0000 (UTC) (envelope-from avg@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 06C113DD8; Tue, 27 Feb 2018 14:32:34 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REWXaR011478; Tue, 27 Feb 2018 14:32:33 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REWX5b011477; Tue, 27 Feb 2018 14:32:33 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271432.w1REWX5b011477@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:32:33 +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: r330061 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330061 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.25 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, 27 Feb 2018 14:32:34 -0000 Author: avg Date: Tue Feb 27 14:32:33 2018 New Revision: 330061 URL: https://svnweb.freebsd.org/changeset/base/330061 Log: MFC r328776: ZFS ARC: restore illumos uses of 'needfree' that were removed in r325851 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 27 14:29:20 2018 (r330060) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Tue Feb 27 14:32:33 2018 (r330061) @@ -4237,6 +4237,7 @@ arc_available_memory(void) free_memory_reason_t r = FMR_UNKNOWN; #ifdef _KERNEL +#ifdef __FreeBSD__ /* * Cooperate with pagedaemon when it's time for it to scan * and reclaim some pages. @@ -4247,7 +4248,15 @@ arc_available_memory(void) r = FMR_LOTSFREE; } -#ifdef illumos +#else + if (needfree > 0) { + n = PAGESIZE * (-needfree); + if (n < lowest) { + lowest = n; + r = FMR_NEEDFREE; + } + } + /* * check that we're out of range of the pageout scanner. It starts to * schedule paging if freemem is less than lotsfree and needfree. @@ -4290,7 +4299,7 @@ arc_available_memory(void) r = FMR_PAGES_PP_MAXIMUM; } -#endif /* illumos */ +#endif /* __FreeBSD__ */ #if defined(__i386) || !defined(UMA_MD_SMALL_ALLOC) /* * If we're on an i386 platform, it's possible that we'll exhaust the @@ -4501,6 +4510,11 @@ arc_reclaim_thread(void *dummy __unused) int64_t to_free = (arc_c >> arc_shrink_shift) - free_memory; if (to_free > 0) { +#ifdef _KERNEL +#ifdef illumos + to_free = MAX(to_free, ptob(needfree)); +#endif +#endif arc_shrink(to_free); } } else if (free_memory < arc_c >> arc_no_grow_shift) { From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:39:36 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 662A4F2B15A; Tue, 27 Feb 2018 14:39:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 152527A30E; Tue, 27 Feb 2018 14:39:36 +0000 (UTC) (envelope-from avg@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 0B87D3DDB; Tue, 27 Feb 2018 14:39:36 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REdZb8012071; Tue, 27 Feb 2018 14:39:35 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REdZ4l012070; Tue, 27 Feb 2018 14:39:35 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271439.w1REdZ4l012070@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:39: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: r330062 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330062 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.25 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, 27 Feb 2018 14:39:36 -0000 Author: avg Date: Tue Feb 27 14:39:35 2018 New Revision: 330062 URL: https://svnweb.freebsd.org/changeset/base/330062 Log: MFC r328881: zfs: move a utility function, ioflags, closer to its consumers Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:32:33 2018 (r330061) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:39:35 2018 (r330062) @@ -4515,21 +4515,6 @@ zfs_setsecattr(vnode_t *vp, vsecattr_t *vsecp, int fla } static int -ioflags(int ioflags) -{ - int flags = 0; - - if (ioflags & IO_APPEND) - flags |= FAPPEND; - if (ioflags & IO_NDELAY) - flags |= FNONBLOCK; - if (ioflags & IO_SYNC) - flags |= (FSYNC | FDSYNC | FRSYNC); - - return (flags); -} - -static int zfs_getpages(struct vnode *vp, vm_page_t *m, int count, int *rbehind, int *rahead) { @@ -4849,6 +4834,21 @@ zfs_freebsd_ioctl(ap) return (zfs_ioctl(ap->a_vp, ap->a_command, (intptr_t)ap->a_data, ap->a_fflag, ap->a_cred, NULL, NULL)); +} + +static int +ioflags(int ioflags) +{ + int flags = 0; + + if (ioflags & IO_APPEND) + flags |= FAPPEND; + if (ioflags & IO_NDELAY) + flags |= FNONBLOCK; + if (ioflags & IO_SYNC) + flags |= (FSYNC | FDSYNC | FRSYNC); + + return (flags); } static int From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:42:41 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C0E6F2B789; Tue, 27 Feb 2018 14:42:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0D3A07A96E; Tue, 27 Feb 2018 14:42:41 +0000 (UTC) (envelope-from avg@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 0839E3F83; Tue, 27 Feb 2018 14:42:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REgeIi016951; Tue, 27 Feb 2018 14:42:40 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REgeFa016950; Tue, 27 Feb 2018 14:42:40 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271442.w1REgeFa016950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:42:40 +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: r330064 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330064 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.25 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, 27 Feb 2018 14:42:41 -0000 Author: avg Date: Tue Feb 27 14:42:40 2018 New Revision: 330064 URL: https://svnweb.freebsd.org/changeset/base/330064 Log: MFC r329016: remove a duplicate assignment Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:41:35 2018 (r330063) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Tue Feb 27 14:42:40 2018 (r330064) @@ -4701,7 +4701,6 @@ zfs_putpages(struct vnode *vp, vm_page_t *ma, size_t l } if (zp->z_blksz < PAGE_SIZE) { - i = 0; for (i = 0; len > 0; off += tocopy, len -= tocopy, i++) { tocopy = len > PAGE_SIZE ? PAGE_SIZE : len; va = zfs_map_page(ma[i], &sf); From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:45:11 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E266F2BB86; Tue, 27 Feb 2018 14:45:11 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7FED7ACD6; Tue, 27 Feb 2018 14:45:10 +0000 (UTC) (envelope-from avg@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 C2D623F86; Tue, 27 Feb 2018 14:45:10 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REjAFh017258; Tue, 27 Feb 2018 14:45:10 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REjA59017257; Tue, 27 Feb 2018 14:45:10 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271445.w1REjA59017257@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:45: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: r330066 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330066 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.25 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, 27 Feb 2018 14:45:11 -0000 Author: avg Date: Tue Feb 27 14:45:10 2018 New Revision: 330066 URL: https://svnweb.freebsd.org/changeset/base/330066 Log: MFC r328996: exec_map_first_page: fix an inverse condition introduced in r254138 Modified: stable/11/sys/kern/kern_exec.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/kern_exec.c ============================================================================== --- stable/11/sys/kern/kern_exec.c Tue Feb 27 14:43:19 2018 (r330065) +++ stable/11/sys/kern/kern_exec.c Tue Feb 27 14:45:10 2018 (r330066) @@ -1004,7 +1004,7 @@ exec_map_first_page(imgp) if ((ma[i] = vm_page_next(ma[i - 1])) != NULL) { if (ma[i]->valid) break; - if (vm_page_tryxbusy(ma[i])) + if (!vm_page_tryxbusy(ma[i])) break; } else { ma[i] = vm_page_alloc(object, i, From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:47:17 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A234F2BF03; Tue, 27 Feb 2018 14:47:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 702AF7B051; Tue, 27 Feb 2018 14:47:17 +0000 (UTC) (envelope-from avg@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 6B0E83F8A; Tue, 27 Feb 2018 14:47:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1RElHfu017512; Tue, 27 Feb 2018 14:47:17 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RElHPt017511; Tue, 27 Feb 2018 14:47:17 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271447.w1RElHPt017511@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:47: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: r330068 - stable/11/sys/amd64/vmm/amd X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/amd64/vmm/amd X-SVN-Commit-Revision: 330068 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.25 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, 27 Feb 2018 14:47:17 -0000 Author: avg Date: Tue Feb 27 14:47:17 2018 New Revision: 330068 URL: https://svnweb.freebsd.org/changeset/base/330068 Log: MFC r329364: move vintr_intercept_enabled under INVARIANTS Modified: stable/11/sys/amd64/vmm/amd/svm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/amd64/vmm/amd/svm.c ============================================================================== --- stable/11/sys/amd64/vmm/amd/svm.c Tue Feb 27 14:45:55 2018 (r330067) +++ stable/11/sys/amd64/vmm/amd/svm.c Tue Feb 27 14:47:17 2018 (r330068) @@ -964,6 +964,7 @@ svm_save_intinfo(struct svm_softc *svm_sc, int vcpu) vm_exit_intinfo(svm_sc->vm, vcpu, intinfo); } +#ifdef INVARIANTS static __inline int vintr_intercept_enabled(struct svm_softc *sc, int vcpu) { @@ -971,6 +972,7 @@ vintr_intercept_enabled(struct svm_softc *sc, int vcpu return (svm_get_intercept(sc, vcpu, VMCB_CTRL1_INTCPT, VMCB_INTCPT_VINTR)); } +#endif static __inline void enable_intr_window_exiting(struct svm_softc *sc, int vcpu) From owner-svn-src-stable-11@freebsd.org Tue Feb 27 14:50:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7CD59F2C2A7; Tue, 27 Feb 2018 14:50:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 319B57B36E; Tue, 27 Feb 2018 14:50:20 +0000 (UTC) (envelope-from avg@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 284E33F8F; Tue, 27 Feb 2018 14:50:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1REoKlx017866; Tue, 27 Feb 2018 14:50:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1REoJ03017865; Tue, 27 Feb 2018 14:50:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201802271450.w1REoJ03017865@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Tue, 27 Feb 2018 14:50: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: r330070 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330070 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.25 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, 27 Feb 2018 14:50:20 -0000 Author: avg Date: Tue Feb 27 14:50:19 2018 New Revision: 330070 URL: https://svnweb.freebsd.org/changeset/base/330070 Log: MFC r329556,r329820 remove an assert in zfsctl_snapdir_lookup to match r323578 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:47:56 2018 (r330069) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ctldir.c Tue Feb 27 14:50:19 2018 (r330070) @@ -886,13 +886,6 @@ zfsctl_snapdir_lookup(ap) break; /* - * The vnode must be referenced at least by this thread and - * the mount point or the thread doing the mounting. - * There can be more references from concurrent lookups. - */ - KASSERT(vrefcnt(*vpp) > 1, ("found unreferenced mountpoint")); - - /* * Check if a snapshot is already mounted on top of the vnode. */ err = zfsctl_mounted_here(vpp, lkflags); From owner-svn-src-stable-11@freebsd.org Tue Feb 27 19:24:06 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DF603F41CCE; Tue, 27 Feb 2018 19:24:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 87FFA6AB3A; Tue, 27 Feb 2018 19:24:06 +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 82FBA6F0F; Tue, 27 Feb 2018 19:24:06 +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 w1RJO6oD057409; Tue, 27 Feb 2018 19:24:06 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1RJO62A057408; Tue, 27 Feb 2018 19:24:06 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802271924.w1RJO62A057408@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Tue, 27 Feb 2018 19:24:06 +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: r330081 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 330081 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.25 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, 27 Feb 2018 19:24:07 -0000 Author: kevans Date: Tue Feb 27 19:24:06 2018 New Revision: 330081 URL: https://svnweb.freebsd.org/changeset/base/330081 Log: MFC r318304: getusershell: don't write paste end of buffer reading shells _local_initshells did not reset cp to the beginning of the line buffer for every iteration that it called fgets(3), leading to writing past the end of line with fairly long /etc/shells or excessively long line lengths. Correct this by properly resetting cp. PR: 192528 Modified: stable/11/lib/libc/gen/getusershell.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getusershell.c ============================================================================== --- stable/11/lib/libc/gen/getusershell.c Tue Feb 27 19:02:49 2018 (r330080) +++ stable/11/lib/libc/gen/getusershell.c Tue Feb 27 19:24:06 2018 (r330081) @@ -115,8 +115,8 @@ _local_initshells(void *rv, void *cb_data, va_list ap) if ((fp = fopen(_PATH_SHELLS, "re")) == NULL) return NS_UNAVAIL; - cp = line; - while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { + while (fgets(line, MAXPATHLEN + 1, fp) != NULL) { + cp = line; while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; if (*cp == '#' || *cp == '\0') @@ -124,7 +124,7 @@ _local_initshells(void *rv, void *cb_data, va_list ap) sp = cp; while (!isspace(*cp) && *cp != '#' && *cp != '\0') cp++; - *cp++ = '\0'; + *cp = '\0'; sl_add(sl, strdup(sp)); } (void)fclose(fp); From owner-svn-src-stable-11@freebsd.org Wed Feb 28 00:29:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 01311F3894B; Wed, 28 Feb 2018 00:29:53 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A8F0C79735; Wed, 28 Feb 2018 00:29:52 +0000 (UTC) (envelope-from rpokala@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 A3C5C12183; Wed, 28 Feb 2018 00:29:52 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S0TqKd022454; Wed, 28 Feb 2018 00:29:52 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S0TqCu022453; Wed, 28 Feb 2018 00:29:52 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802280029.w1S0TqCu022453@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 28 Feb 2018 00:29:52 +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: r330092 - stable/11/usr.sbin/mountd X-SVN-Group: stable-11 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: stable/11/usr.sbin/mountd X-SVN-Commit-Revision: 330092 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.25 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, 28 Feb 2018 00:29:53 -0000 Author: rpokala Date: Wed Feb 28 00:29:52 2018 New Revision: 330092 URL: https://svnweb.freebsd.org/changeset/base/330092 Log: MFC r329682: mountd: Return proper errno values in a few error paths When attempting to mount a non-directory which exists, return ENOTDIR instead of ENOENT. If stat() or statfs() failed, don't pass part of the invalid (struct statfs) to ex_search(). In that same case, preserve the value of "bad" rather than overwriting with EACCES. Modified: stable/11/usr.sbin/mountd/mountd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/mountd/mountd.c ============================================================================== --- stable/11/usr.sbin/mountd/mountd.c Wed Feb 28 00:17:08 2018 (r330091) +++ stable/11/usr.sbin/mountd/mountd.c Wed Feb 28 00:29:52 2018 (r330092) @@ -1051,8 +1051,6 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) */ if (realpath(rpcpath, dirpath) == NULL || stat(dirpath, &stb) < 0 || - (!S_ISDIR(stb.st_mode) && - (dir_only || !S_ISREG(stb.st_mode))) || statfs(dirpath, &fsb) < 0) { chdir("/"); /* Just in case realpath doesn't */ syslog(LOG_NOTICE, @@ -1062,10 +1060,23 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) warnx("stat failed on %s", dirpath); bad = ENOENT; /* We will send error reply later */ } + if (!bad && + !S_ISDIR(stb.st_mode) && + (dir_only || !S_ISREG(stb.st_mode))) { + syslog(LOG_NOTICE, + "mount request from %s for non-directory path %s", + numerichost, dirpath); + if (debug) + warnx("mounting non-directory %s", dirpath); + bad = ENOTDIR; /* We will send error reply later */ + } /* Check in the exports list */ sigprocmask(SIG_BLOCK, &sighup_mask, NULL); - ep = ex_search(&fsb.f_fsid); + if (bad) + ep = NULL; + else + ep = ex_search(&fsb.f_fsid); hostset = defset = 0; if (ep && (chk_host(ep->ex_defdir, saddr, &defset, &hostset, &numsecflavors, &secflavorsp) || @@ -1116,7 +1127,8 @@ mntsrv(struct svc_req *rqstp, SVCXPRT *transp) "mount request succeeded from %s for %s", numerichost, dirpath); } else { - bad = EACCES; + if (!bad) + bad = EACCES; syslog(LOG_NOTICE, "mount request denied from %s for %s", numerichost, dirpath); From owner-svn-src-stable-11@freebsd.org Wed Feb 28 02:37:59 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CBCFAF413DE; Wed, 28 Feb 2018 02:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6657A7E6F1; Wed, 28 Feb 2018 02:37:59 +0000 (UTC) (envelope-from pfg@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 5E9D3136D4; Wed, 28 Feb 2018 02:37:59 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S2bx1x087266; Wed, 28 Feb 2018 02:37:59 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S2bxff087265; Wed, 28 Feb 2018 02:37:59 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802280237.w1S2bxff087265@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Feb 2018 02:37: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: r330094 - stable/11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/libc/gen X-SVN-Commit-Revision: 330094 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.25 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, 28 Feb 2018 02:38:00 -0000 Author: pfg Date: Wed Feb 28 02:37:59 2018 New Revision: 330094 URL: https://svnweb.freebsd.org/changeset/base/330094 Log: MFC r329846: getpeereid(3): Fix behavior on failure to match documentation. According to the getpeereid(3) documentation, on failure the value -1 is returned and the global variable errno is set to indicate the error. We were returning the error instead. Obtained from: Apple's Libc-1244.30.3 Modified: stable/11/lib/libc/gen/getpeereid.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/gen/getpeereid.c ============================================================================== --- stable/11/lib/libc/gen/getpeereid.c Wed Feb 28 00:30:03 2018 (r330093) +++ stable/11/lib/libc/gen/getpeereid.c Wed Feb 28 02:37:59 2018 (r330094) @@ -48,8 +48,10 @@ getpeereid(int s, uid_t *euid, gid_t *egid) error = _getsockopt(s, 0, LOCAL_PEERCRED, &xuc, &xuclen); if (error != 0) return (error); - if (xuc.cr_version != XUCRED_VERSION) - return (EINVAL); + if (xuc.cr_version != XUCRED_VERSION) { + errno = EINVAL; + return (-1); + } *euid = xuc.cr_uid; *egid = xuc.cr_gid; return (0); From owner-svn-src-stable-11@freebsd.org Wed Feb 28 02:49:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DEB25F4208F; Wed, 28 Feb 2018 02:49:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 913C37EF86; Wed, 28 Feb 2018 02:49:00 +0000 (UTC) (envelope-from pfg@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 8C3871388C; Wed, 28 Feb 2018 02:49:00 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S2n0JN092173; Wed, 28 Feb 2018 02:49:00 GMT (envelope-from pfg@FreeBSD.org) Received: (from pfg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S2n00r092172; Wed, 28 Feb 2018 02:49:00 GMT (envelope-from pfg@FreeBSD.org) Message-Id: <201802280249.w1S2n00r092172@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org using -f From: "Pedro F. Giffuni" Date: Wed, 28 Feb 2018 02:49: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: r330096 - stable/11/lib/libc/stdio X-SVN-Group: stable-11 X-SVN-Commit-Author: pfg X-SVN-Commit-Paths: stable/11/lib/libc/stdio X-SVN-Commit-Revision: 330096 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.25 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, 28 Feb 2018 02:49:01 -0000 Author: pfg Date: Wed Feb 28 02:49:00 2018 New Revision: 330096 URL: https://svnweb.freebsd.org/changeset/base/330096 Log: MFC r329848: __printf_render_int(): small type change to match use. Variable l is consistently used as an int rather than a char. Sort names while here. Obtained from: Apple's Libc-1244.30.3 Modified: stable/11/lib/libc/stdio/xprintf_int.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/stdio/xprintf_int.c ============================================================================== --- stable/11/lib/libc/stdio/xprintf_int.c Wed Feb 28 02:39:38 2018 (r330095) +++ stable/11/lib/libc/stdio/xprintf_int.c Wed Feb 28 02:49:00 2018 (r330096) @@ -258,8 +258,8 @@ __printf_render_int(struct __printf_io *io, const stru const union arg *argp; char buf[BUF]; char *p, *pe; - char ns, l; - int rdx, sign, zext, ngrp; + char ns; + int l, ngrp, rdx, sign, zext; const char *nalt, *digit; char thousands_sep; /* locale specific thousands separator */ const char *grouping; /* locale specific numeric grouping rules */ From owner-svn-src-stable-11@freebsd.org Wed Feb 28 09:01:08 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D1851F35AD3; Wed, 28 Feb 2018 09:01:06 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2EDD96CB9D; Wed, 28 Feb 2018 09:01:06 +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 2982D17670; Wed, 28 Feb 2018 09:01:06 +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 w1S916cj081218; Wed, 28 Feb 2018 09:01:06 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S914Vp080488; Wed, 28 Feb 2018 09:01:04 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201802280901.w1S914Vp080488@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Wed, 28 Feb 2018 09:01:04 +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: r330106 - in stable/11: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/html/drivers contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel ... X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: in stable/11: contrib/ntp contrib/ntp/adjtimed contrib/ntp/clockstuff contrib/ntp/html contrib/ntp/html/drivers contrib/ntp/include contrib/ntp/include/isc contrib/ntp/kernel contrib/ntp/kernel/sys co... X-SVN-Commit-Revision: 330106 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.25 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, 28 Feb 2018 09:01:08 -0000 Author: delphij Date: Wed Feb 28 09:01:03 2018 New Revision: 330106 URL: https://svnweb.freebsd.org/changeset/base/330106 Log: MFC r330104: MFV r330102: ntp 4.2.8p11 Added: stable/11/contrib/ntp/sntp/m4/ntp_af_unspec.m4 - copied unchanged from r330104, head/contrib/ntp/sntp/m4/ntp_af_unspec.m4 stable/11/contrib/ntp/sntp/tests/testconf.yml - copied unchanged from r330104, head/contrib/ntp/sntp/tests/testconf.yml Modified: stable/11/contrib/ntp/ChangeLog stable/11/contrib/ntp/Makefile.am stable/11/contrib/ntp/Makefile.in stable/11/contrib/ntp/NEWS stable/11/contrib/ntp/aclocal.m4 stable/11/contrib/ntp/adjtimed/Makefile.in stable/11/contrib/ntp/clockstuff/Makefile.in stable/11/contrib/ntp/configure stable/11/contrib/ntp/configure.ac stable/11/contrib/ntp/html/access.html stable/11/contrib/ntp/html/accopt.html stable/11/contrib/ntp/html/authentic.html stable/11/contrib/ntp/html/drivers/driver18.html stable/11/contrib/ntp/html/drivers/driver40-ja.html stable/11/contrib/ntp/html/drivers/driver40.html stable/11/contrib/ntp/html/keygen.html stable/11/contrib/ntp/html/miscopt.html stable/11/contrib/ntp/html/monopt.html stable/11/contrib/ntp/html/ntpq.html stable/11/contrib/ntp/include/Makefile.in stable/11/contrib/ntp/include/isc/Makefile.in stable/11/contrib/ntp/include/ntp.h stable/11/contrib/ntp/include/ntp_calendar.h stable/11/contrib/ntp/include/ntp_config.h stable/11/contrib/ntp/include/ntp_fp.h stable/11/contrib/ntp/include/ntp_keyacc.h stable/11/contrib/ntp/include/ntp_request.h stable/11/contrib/ntp/include/ntp_stdlib.h stable/11/contrib/ntp/include/ntpd.h stable/11/contrib/ntp/include/recvbuff.h stable/11/contrib/ntp/include/ssl_applink.c stable/11/contrib/ntp/kernel/Makefile.in stable/11/contrib/ntp/kernel/sys/Makefile.in stable/11/contrib/ntp/libntp/Makefile.in stable/11/contrib/ntp/libntp/a_md5encrypt.c stable/11/contrib/ntp/libntp/adjtime.c stable/11/contrib/ntp/libntp/authkeys.c stable/11/contrib/ntp/libntp/authreadkeys.c stable/11/contrib/ntp/libntp/libssl_compat.c stable/11/contrib/ntp/libntp/ntp_calendar.c stable/11/contrib/ntp/libntp/ssl_init.c stable/11/contrib/ntp/libntp/statestr.c stable/11/contrib/ntp/libntp/systime.c stable/11/contrib/ntp/libntp/work_thread.c stable/11/contrib/ntp/libparse/Makefile.in stable/11/contrib/ntp/ntpd/Makefile.in stable/11/contrib/ntp/ntpd/complete.conf.in stable/11/contrib/ntp/ntpd/invoke-ntp.conf.texi stable/11/contrib/ntp/ntpd/invoke-ntp.keys.texi stable/11/contrib/ntp/ntpd/invoke-ntpd.texi stable/11/contrib/ntp/ntpd/keyword-gen-utd stable/11/contrib/ntp/ntpd/keyword-gen.c stable/11/contrib/ntp/ntpd/ntp.conf.5man stable/11/contrib/ntp/ntpd/ntp.conf.5mdoc stable/11/contrib/ntp/ntpd/ntp.conf.def stable/11/contrib/ntp/ntpd/ntp.conf.html stable/11/contrib/ntp/ntpd/ntp.conf.man.in stable/11/contrib/ntp/ntpd/ntp.conf.mdoc.in stable/11/contrib/ntp/ntpd/ntp.keys.5man stable/11/contrib/ntp/ntpd/ntp.keys.5mdoc stable/11/contrib/ntp/ntpd/ntp.keys.def stable/11/contrib/ntp/ntpd/ntp.keys.html stable/11/contrib/ntp/ntpd/ntp.keys.man.in stable/11/contrib/ntp/ntpd/ntp.keys.mdoc.in stable/11/contrib/ntp/ntpd/ntp_config.c stable/11/contrib/ntp/ntpd/ntp_control.c stable/11/contrib/ntp/ntpd/ntp_crypto.c stable/11/contrib/ntp/ntpd/ntp_io.c stable/11/contrib/ntp/ntpd/ntp_keyword.h stable/11/contrib/ntp/ntpd/ntp_leapsec.c stable/11/contrib/ntp/ntpd/ntp_parser.c stable/11/contrib/ntp/ntpd/ntp_parser.h stable/11/contrib/ntp/ntpd/ntp_peer.c stable/11/contrib/ntp/ntpd/ntp_proto.c stable/11/contrib/ntp/ntpd/ntp_refclock.c stable/11/contrib/ntp/ntpd/ntp_request.c stable/11/contrib/ntp/ntpd/ntp_restrict.c stable/11/contrib/ntp/ntpd/ntp_scanner.c stable/11/contrib/ntp/ntpd/ntp_util.c stable/11/contrib/ntp/ntpd/ntpd-opts.c stable/11/contrib/ntp/ntpd/ntpd-opts.h stable/11/contrib/ntp/ntpd/ntpd.1ntpdman stable/11/contrib/ntp/ntpd/ntpd.1ntpdmdoc stable/11/contrib/ntp/ntpd/ntpd.c stable/11/contrib/ntp/ntpd/ntpd.html stable/11/contrib/ntp/ntpd/ntpd.man.in stable/11/contrib/ntp/ntpd/ntpd.mdoc.in stable/11/contrib/ntp/ntpd/ntpsim.c stable/11/contrib/ntp/ntpd/refclock_gpsdjson.c stable/11/contrib/ntp/ntpd/refclock_jjy.c stable/11/contrib/ntp/ntpd/refclock_palisade.c stable/11/contrib/ntp/ntpd/refclock_parse.c stable/11/contrib/ntp/ntpdate/Makefile.in stable/11/contrib/ntp/ntpdc/Makefile.in stable/11/contrib/ntp/ntpdc/invoke-ntpdc.texi stable/11/contrib/ntp/ntpdc/layout.std stable/11/contrib/ntp/ntpdc/ntpdc-opts.c stable/11/contrib/ntp/ntpdc/ntpdc-opts.h stable/11/contrib/ntp/ntpdc/ntpdc.1ntpdcman stable/11/contrib/ntp/ntpdc/ntpdc.1ntpdcmdoc stable/11/contrib/ntp/ntpdc/ntpdc.c stable/11/contrib/ntp/ntpdc/ntpdc.html stable/11/contrib/ntp/ntpdc/ntpdc.man.in stable/11/contrib/ntp/ntpdc/ntpdc.mdoc.in stable/11/contrib/ntp/ntpdc/ntpdc_ops.c stable/11/contrib/ntp/ntpq/Makefile.am stable/11/contrib/ntp/ntpq/Makefile.in stable/11/contrib/ntp/ntpq/invoke-ntpq.texi stable/11/contrib/ntp/ntpq/ntpq-opts.c stable/11/contrib/ntp/ntpq/ntpq-opts.def stable/11/contrib/ntp/ntpq/ntpq-opts.h stable/11/contrib/ntp/ntpq/ntpq-subs.c stable/11/contrib/ntp/ntpq/ntpq.1ntpqman stable/11/contrib/ntp/ntpq/ntpq.1ntpqmdoc stable/11/contrib/ntp/ntpq/ntpq.c stable/11/contrib/ntp/ntpq/ntpq.html stable/11/contrib/ntp/ntpq/ntpq.man.in stable/11/contrib/ntp/ntpq/ntpq.mdoc.in stable/11/contrib/ntp/ntpq/ntpq.texi stable/11/contrib/ntp/ntpsnmpd/Makefile.in stable/11/contrib/ntp/ntpsnmpd/invoke-ntpsnmpd.texi stable/11/contrib/ntp/ntpsnmpd/netsnmp_daemonize.c stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.c stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd-opts.h stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdman stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.1ntpsnmpdmdoc stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.html stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.man.in stable/11/contrib/ntp/ntpsnmpd/ntpsnmpd.mdoc.in stable/11/contrib/ntp/packageinfo.sh stable/11/contrib/ntp/parseutil/Makefile.in stable/11/contrib/ntp/scripts/Makefile.in stable/11/contrib/ntp/scripts/build/Makefile.in stable/11/contrib/ntp/scripts/build/UpdatePoint stable/11/contrib/ntp/scripts/calc_tickadj/Makefile.in stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjman stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.1calc_tickadjmdoc stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.html stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.man.in stable/11/contrib/ntp/scripts/calc_tickadj/calc_tickadj.mdoc.in stable/11/contrib/ntp/scripts/calc_tickadj/invoke-calc_tickadj.texi stable/11/contrib/ntp/scripts/invoke-plot_summary.texi stable/11/contrib/ntp/scripts/invoke-summary.texi stable/11/contrib/ntp/scripts/lib/Makefile.in stable/11/contrib/ntp/scripts/ntp-wait/Makefile.in stable/11/contrib/ntp/scripts/ntp-wait/invoke-ntp-wait.texi stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait-opts stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitman stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.1ntp-waitmdoc stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.html stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.man.in stable/11/contrib/ntp/scripts/ntp-wait/ntp-wait.mdoc.in stable/11/contrib/ntp/scripts/ntpsweep/Makefile.in stable/11/contrib/ntp/scripts/ntpsweep/invoke-ntpsweep.texi stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep-opts stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepman stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.1ntpsweepmdoc stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.html stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.man.in stable/11/contrib/ntp/scripts/ntpsweep/ntpsweep.mdoc.in stable/11/contrib/ntp/scripts/ntptrace/Makefile.in stable/11/contrib/ntp/scripts/ntptrace/invoke-ntptrace.texi stable/11/contrib/ntp/scripts/ntptrace/ntptrace-opts stable/11/contrib/ntp/scripts/ntptrace/ntptrace.1ntptraceman stable/11/contrib/ntp/scripts/ntptrace/ntptrace.1ntptracemdoc stable/11/contrib/ntp/scripts/ntptrace/ntptrace.html stable/11/contrib/ntp/scripts/ntptrace/ntptrace.man.in stable/11/contrib/ntp/scripts/ntptrace/ntptrace.mdoc.in stable/11/contrib/ntp/scripts/plot_summary-opts stable/11/contrib/ntp/scripts/plot_summary.1plot_summaryman stable/11/contrib/ntp/scripts/plot_summary.1plot_summarymdoc stable/11/contrib/ntp/scripts/plot_summary.html stable/11/contrib/ntp/scripts/plot_summary.man.in stable/11/contrib/ntp/scripts/plot_summary.mdoc.in stable/11/contrib/ntp/scripts/summary-opts stable/11/contrib/ntp/scripts/summary.1summaryman stable/11/contrib/ntp/scripts/summary.1summarymdoc stable/11/contrib/ntp/scripts/summary.html stable/11/contrib/ntp/scripts/summary.man.in stable/11/contrib/ntp/scripts/summary.mdoc.in stable/11/contrib/ntp/scripts/update-leap/Makefile.in stable/11/contrib/ntp/scripts/update-leap/invoke-update-leap.texi stable/11/contrib/ntp/scripts/update-leap/update-leap-opts stable/11/contrib/ntp/scripts/update-leap/update-leap.1update-leapman stable/11/contrib/ntp/scripts/update-leap/update-leap.1update-leapmdoc stable/11/contrib/ntp/scripts/update-leap/update-leap.html stable/11/contrib/ntp/scripts/update-leap/update-leap.in stable/11/contrib/ntp/scripts/update-leap/update-leap.man.in stable/11/contrib/ntp/scripts/update-leap/update-leap.mdoc.in stable/11/contrib/ntp/sntp/Makefile.in stable/11/contrib/ntp/sntp/check-libntp.mf stable/11/contrib/ntp/sntp/configure stable/11/contrib/ntp/sntp/crypto.c stable/11/contrib/ntp/sntp/crypto.h stable/11/contrib/ntp/sntp/harden/linux stable/11/contrib/ntp/sntp/include/version.def stable/11/contrib/ntp/sntp/include/version.texi stable/11/contrib/ntp/sntp/invoke-sntp.texi stable/11/contrib/ntp/sntp/m4/ntp_harden.m4 stable/11/contrib/ntp/sntp/m4/ntp_libevent.m4 stable/11/contrib/ntp/sntp/m4/ntp_openssl.m4 stable/11/contrib/ntp/sntp/m4/version.m4 stable/11/contrib/ntp/sntp/main.c stable/11/contrib/ntp/sntp/networking.c stable/11/contrib/ntp/sntp/sntp-opts.c stable/11/contrib/ntp/sntp/sntp-opts.def stable/11/contrib/ntp/sntp/sntp-opts.h stable/11/contrib/ntp/sntp/sntp.1sntpman stable/11/contrib/ntp/sntp/sntp.1sntpmdoc stable/11/contrib/ntp/sntp/sntp.html stable/11/contrib/ntp/sntp/sntp.man.in stable/11/contrib/ntp/sntp/sntp.mdoc.in stable/11/contrib/ntp/sntp/tests/Makefile.am stable/11/contrib/ntp/sntp/tests/Makefile.in stable/11/contrib/ntp/sntp/tests/crypto.c stable/11/contrib/ntp/sntp/tests/keyFile.c stable/11/contrib/ntp/sntp/tests/packetHandling.c stable/11/contrib/ntp/sntp/tests/packetProcessing.c stable/11/contrib/ntp/sntp/tests/run-crypto.c stable/11/contrib/ntp/sntp/tests/run-keyFile.c stable/11/contrib/ntp/sntp/tests/run-kodDatabase.c stable/11/contrib/ntp/sntp/tests/run-kodFile.c stable/11/contrib/ntp/sntp/tests/run-networking.c stable/11/contrib/ntp/sntp/tests/run-packetHandling.c stable/11/contrib/ntp/sntp/tests/run-packetProcessing.c stable/11/contrib/ntp/sntp/tests/run-t-log.c stable/11/contrib/ntp/sntp/tests/run-utilities.c stable/11/contrib/ntp/sntp/unity/auto/generate_test_runner.rb stable/11/contrib/ntp/sntp/utilities.c stable/11/contrib/ntp/sntp/version.c stable/11/contrib/ntp/util/Makefile.in stable/11/contrib/ntp/util/invoke-ntp-keygen.texi stable/11/contrib/ntp/util/ntp-keygen-opts.c stable/11/contrib/ntp/util/ntp-keygen-opts.def stable/11/contrib/ntp/util/ntp-keygen-opts.h stable/11/contrib/ntp/util/ntp-keygen.1ntp-keygenman stable/11/contrib/ntp/util/ntp-keygen.1ntp-keygenmdoc stable/11/contrib/ntp/util/ntp-keygen.html stable/11/contrib/ntp/util/ntp-keygen.man.in stable/11/contrib/ntp/util/ntp-keygen.mdoc.in stable/11/usr.sbin/ntp/config.h stable/11/usr.sbin/ntp/doc/ntp-keygen.8 stable/11/usr.sbin/ntp/doc/ntp.conf.5 stable/11/usr.sbin/ntp/doc/ntp.keys.5 stable/11/usr.sbin/ntp/doc/ntpd.8 stable/11/usr.sbin/ntp/doc/ntpdc.8 stable/11/usr.sbin/ntp/doc/ntpq.8 stable/11/usr.sbin/ntp/doc/sntp.8 stable/11/usr.sbin/ntp/ntp-keygen/Makefile stable/11/usr.sbin/ntp/ntptime/Makefile stable/11/usr.sbin/ntp/scripts/mkver Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ntp/ChangeLog ============================================================================== --- stable/11/contrib/ntp/ChangeLog Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/ChangeLog Wed Feb 28 09:01:03 2018 (r330106) @@ -1,6 +1,107 @@ --- -(4.2.8p10-win-beta1) 2017/03/21 Released by Harlan Stenn -(4.2.8p10) + +* [Sec 3454] Unauthenticated packet can reset authenticated interleave + associations. HStenn. +* [Sec 3453] Interleaved symmetric mode cannot recover from bad state. HStenn. +* [Sec 3415] Permit blocking authenticated symmetric/passive associations. + Implement ippeerlimit. HStenn, JPerlinger. +* [Sec 3414] ntpq: decodearr() can write beyond its 'buf' limits + - initial patch by , extended by +* [Sec 3412] ctl_getitem(): Don't compare names past NUL. +* [Sec 3012] Sybil vulnerability: noepeer support. HStenn, JPerlinger. +* [Bug 3457] OpenSSL FIPS mode regression +* [Bug 3455] ntpd doesn't use scope id when binding multicast + - applied patch by Sean Haugh +* [Bug 3452] PARSE driver prints uninitialized memory. +* [Bug 3450] Dubious error messages from plausibility checks in get_systime() + - removed error log caused by rounding/slew, ensured postcondition +* [Bug 3447] AES-128-CMAC (fixes) + - refactoring the MAC code, too +* [Bug 3441] Validate the assumption that AF_UNSPEC is 0. stenn@ntp.org +* [Bug 3439] When running multiple commands / hosts in ntpq... + - applied patch by ggarvey +* [Bug 3438] Negative values and values > 999 days in... + - applied patch by ggarvey (with minor mods) +* [Bug 3437] ntpd tries to open socket with AF_UNSPEC domain + - applied patch (with mods) by Miroslav Lichvar +* [Bug 3435] anchor NTP era alignment +* [Bug 3433] sntp crashes when run with -a. +* [Bug 3430] ntpq dumps core (SIGSEGV) for "keytype md2" + - fixed several issues with hash algos in ntpd, sntp, ntpq, + ntpdc and the test suites +* [Bug 3424] Trimble Thunderbolt 1024 week millenium bug + - initial patch by Daniel Pouzzner +* [Bug 3423] QNX adjtime() implementation error checking is + wrong +* [Bug 3417] ntpq ifstats packet counters can be negative + made IFSTATS counter quantities unsigned +* [Bug 3411] problem about SIGN(6) packet handling for ntp-4.2.8p10 + - raised receive buffer size to 1200 +* [Bug 3408] refclock_jjy.c: Avoid a wrong report of the coverity static + analysis tool. +* [Bug 3405] update-leap.in: general cleanup, HTTPS support. Paul McMath. +* [Bug 3404] Fix openSSL DLL usage under Windows + - fix/drop assumptions on OpenSSL libs directory layout +* [Bug 3399] NTP: linker error in 4.2.8p10 during Linux cross-compilation + - initial patch by timeflies@mail2tor.com +* [Bug 3398] tests fail with core dump + - patch contributed by Alexander Bluhm +* [Bug 3397] ctl_putstr() asserts that data fits in its buffer + rework of formatting & data transfer stuff in 'ntp_control.c' + avoids unecessary buffers and size limitations. +* [Bug 3394] Leap second deletion does not work on ntpd clients + - fixed handling of dynamic deletion w/o leap file +* [Bug 3391] ntpd segfaults on startup due to small warmup thread stack size + - increased mimimum stack size to 32kB +* [Bug 3367] Faulty LinuxPPS NMEA clock support in 4.2.8 + - reverted handling of PPS kernel consumer to 4.2.6 behavior +* [Bug 3365] Updates driver40(-ja).html and miscopt.html +* [Bug 3358] Spurious KoD log messages in .INIT. phase. HStenn. +* [Bug 3016] wrong error position reported for bad ":config pool" + - fixed location counter & ntpq output +* [Bug 2900] libntp build order problem. HStenn. +* [Bug 2878] Tests are cluttering up syslog +* [Bug 2737] Wrong phone number listed for USNO. ntp-bugs@bodosom.net, + perlinger@ntp.org +* [Bug 2557] Fix Thunderbolt init. ntp-bugs@bodosom.net, perlinger@ntp. +* [Bug 948] Trustedkey config directive leaks memory. +* Use strlcpy() to copy strings, not memcpy(). HStenn. +* Typos. HStenn. +* test_ntp_scanner_LDADD needs ntpd/ntp_io.o. HStenn. +* refclock_jjy.c: Add missing "%s" to an msyslog() call. HStenn. +* Build ntpq and libntpq.a with NTP_HARD_*FLAGS. perlinger@ntp.org +* Fix trivial warnings from 'make check'. perlinger@ntp.org +* Fix bug in the override portion of the compiler hardening macro. HStenn. +* record_raw_stats(): Log entire packet. Log writes. HStenn. +* AES-128-CMAC support. BInglis, HStenn, JPerlinger. +* sntp: tweak key file logging. HStenn. +* sntp: pkt_output(): Improve debug output. HStenn. +* update-leap: updates from Paul McMath. +* When using pkg-config, report --modversion. HStenn. +* Clean up libevent configure checks. HStenn. +* sntp: show the IP of who sent us a crypto-NAK. HStenn. +* Allow .../N to specify subnet bits for IPs in ntp.keys. HStenn, JPerlinger. +* authistrustedip() - use it in more places. HStenn, JPerlinger. +* New sysstats: sys_lamport, sys_tsrounding. HStenn. +* Update ntp.keys .../N documentation. HStenn. +* Distribute testconf.yml. HStenn. +* Add DPRINTF(2,...) lines to receive() for packet drops. HStenn. +* Rename the configuration flag fifo variables. HStenn. +* Improve saveconfig output. HStenn. +* Decode restrict flags on receive() debug output. HStenn. +* Decode interface flags on receive() debug output. HStenn. +* Warn the user if deprecated "driftfile name WanderThreshold" is used. HStenn. +* Update the documentation in ntp.conf.def . HStenn. +* restrictions() must return restrict flags and ippeerlimit. HStenn. +* Update ntpq peer documentation to describe the 'p' type. HStenn. +* Rename restrict 'flags' to 'rflags. Use an enum for the values. HStenn. +* Provide dump_restricts() for debugging. HStenn. +* Use consistent 4th arg type for [gs]etsockopt. JPerlinger. +* Some tests might need LIBM. HStenn. +* update-leap: Allow -h/--help early. HStenn. + +--- +(4.2.8p10) 2017/03/21 Released by Harlan Stenn * [Sec 3389] NTP-01-016: Denial of Service via Malformed Config (Pentest report 01.2017) Modified: stable/11/contrib/ntp/Makefile.am ============================================================================== --- stable/11/contrib/ntp/Makefile.am Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/Makefile.am Wed Feb 28 09:01:03 2018 (r330106) @@ -5,10 +5,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: stable/11/contrib/ntp/Makefile.in ============================================================================== --- stable/11/contrib/ntp/Makefile.in Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/Makefile.in Wed Feb 28 09:01:03 2018 (r330106) @@ -99,6 +99,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/li $(top_srcdir)/sntp/m4/ltsugar.m4 \ $(top_srcdir)/sntp/m4/ltversion.m4 \ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ @@ -523,10 +524,10 @@ NULL = # moved sntp first to get libtool and libevent built. SUBDIRS = \ - sntp \ scripts \ include \ libntp \ + sntp \ libparse \ ntpd \ ntpdate \ Modified: stable/11/contrib/ntp/NEWS ============================================================================== --- stable/11/contrib/ntp/NEWS Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/NEWS Wed Feb 28 09:01:03 2018 (r330106) @@ -1,4 +1,331 @@ -- +NTP 4.2.8p11 (Harlan Stenn , 2018/02/27) + +NOTE: this NEWS file will be undergoing more revisions. + +Focus: Security, Bug fixes, enhancements. + +Severity: MEDIUM + +This release fixes 2 low-/medium-, 1 informational/medum-, and 2 low-severity +vulnerabilities in ntpd, one medium-severity vulernability in ntpq, and +provides 65 other non-security fixes and improvements: + +* NTP Bug 3454: Unauthenticated packet can reset authenticated interleaved + association (LOW/MED) + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3454 / CVE-2018-7185 / VU#961909 + Affects: ntp-4.2.6, up to but not including ntp-4.2.8p11. + CVSS2: MED 4.3 (AV:N/AC:M/Au:N/C:N/I:N/A:P) This could score between + 2.9 and 6.8. + CVSS3: LOW 3.1 CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L This could + score between 2.6 and 3.1 + Summary: + The NTP Protocol allows for both non-authenticated and + authenticated associations, in client/server, symmetric (peer), + and several broadcast modes. In addition to the basic NTP + operational modes, symmetric mode and broadcast servers can + support an interleaved mode of operation. In ntp-4.2.8p4 a bug + was inadvertently introduced into the protocol engine that + allows a non-authenticated zero-origin (reset) packet to reset + an authenticated interleaved peer association. If an attacker + can send a packet with a zero-origin timestamp and the source + IP address of the "other side" of an interleaved association, + the 'victim' ntpd will reset its association. The attacker must + continue sending these packets in order to maintain the + disruption of the association. In ntp-4.0.0 thru ntp-4.2.8p6, + interleave mode could be entered dynamically. As of ntp-4.2.8p7, + interleaved mode must be explicitly configured/enabled. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p11, or later, from the NTP Project Download Page + or the NTP Public Services Project Download Page. + If you are unable to upgrade to 4.2.8p11 or later and have + 'peer HOST xleave' lines in your ntp.conf file, remove the + 'xleave' option. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was discovered by Miroslav Lichvar of Red Hat. + +* NTP Bug 3453: Interleaved symmetric mode cannot recover from bad + state (LOW/MED) + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3453 / CVE-2018-7184 / VU#961909 + Affects: ntpd in ntp-4.2.8p4, up to but not including ntp-4.2.8p11. + CVSS2: MED 4.3 (AV:N/AC:M/Au:N/C:P/I:N/A:N) + Could score between 2.9 and 6.8. + CVSS3: LOW 3.1 - CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:L + Could score between 2.6 and 6.0. + Summary: + The fix for NtpBug2952 was incomplete, and while it fixed one + problem it created another. Specifically, it drops bad packets + before updating the "received" timestamp. This means a + third-party can inject a packet with a zero-origin timestamp, + meaning the sender wants to reset the association, and the + transmit timestamp in this bogus packet will be saved as the + most recent "received" timestamp. The real remote peer does + not know this value and this will disrupt the association until + the association resets. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Use authentication with 'peer' mode. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was discovered by Miroslav Lichvar of Red Hat. + +* NTP Bug 3415: Provide a way to prevent authenticated symmetric passive + peering (LOW) + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3415 / CVE-2018-7170 / VU#961909 + Sec 3012 / CVE-2016-1549 / VU#718152 + Affects: All ntp-4 releases up to, but not including 4.2.8p7, and + 4.3.0 up to, but not including 4.3.92. Resolved in 4.2.8p11. + CVSS2: LOW 3.5 - (AV:N/AC:M/Au:S/C:N/I:P/A:N) + CVSS3: LOW 3.1 - CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N + Summary: + ntpd can be vulnerable to Sybil attacks. If a system is set up to + use a trustedkey and if one is not using the feature introduced in + ntp-4.2.8p6 allowing an optional 4th field in the ntp.keys file to + specify which IPs can serve time, a malicious authenticated peer + -- i.e. one where the attacker knows the private symmetric key -- + can create arbitrarily-many ephemeral associations in order to win + the clock selection of ntpd and modify a victim's clock. Three + additional protections are offered in ntp-4.2.8p11. One is the + new 'noepeer' directive, which disables symmetric passive + ephemeral peering. Another is the new 'ippeerlimit' directive, + which limits the number of peers that can be created from an IP. + The third extends the functionality of the 4th field in the + ntp.keys file to include specifying a subnet range. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Use the 'noepeer' directive to prohibit symmetric passive + ephemeral associations. + Use the 'ippeerlimit' directive to limit the number of peers + that can be created from an IP. + Use the 4th argument in the ntp.keys file to limit the IPs and + subnets that can be time servers. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was reported as Bug 3012 by Matthew Van Gundy of + Cisco ASIG, and separately by Stefan Moser as Bug 3415. + +* ntpq Bug 3414: decodearr() can write beyond its 'buf' limits (Medium) + Date Resolved: 27 Feb 2018 + References: Sec 3414 / CVE-2018-7183 / VU#961909 + Affects: ntpq in ntp-4.2.8p6, up to but not including ntp-4.2.8p11. + CVSS2: MED 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P) + CVSS3: MED 5.0 CVSS:3.0/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L + Summary: + ntpq is a monitoring and control program for ntpd. decodearr() + is an internal function of ntpq that is used to -- wait for it -- + decode an array in a response string when formatted data is being + displayed. This is a problem in affected versions of ntpq if a + maliciously-altered ntpd returns an array result that will trip this + bug, or if a bad actor is able to read an ntpq request on its way to + a remote ntpd server and forge and send a response before the remote + ntpd sends its response. It's potentially possible that the + malicious data could become injectable/executable code. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Credit: + This weakness was discovered by Michael Macnair of Thales e-Security. + +* NTP Bug 3412: ctl_getitem(): buffer read overrun leads to undefined + behavior and information leak (Info/Medium) + Date Resolved: 27 Feb 2018 + References: Sec 3412 / CVE-2018-7182 / VU#961909 + Affects: ntp-4.2.8p6, up to but not including ntp-4.2.8p11. + CVSS2: INFO 0.0 - MED 5.0 (AV:N/AC:L/Au:N/C:P/I:N/A:N) 0.0 if C:N + CVSS3: NONE 0.0 - MED 5.3 CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N + 0.0 if C:N + Summary: + ctl_getitem() is used by ntpd to process incoming mode 6 packets. + A malicious mode 6 packet can be sent to an ntpd instance, and + if the ntpd instance is from 4.2.8p6 thru 4.2.8p10, that will + cause ctl_getitem() to read past the end of its buffer. + Mitigation: + Implement BCP-38. + Upgrade to ntp-4.2.8p11 or later from the NTP Project Download Page + or the NTP Public Services Project Download Page. + Have enough sources of time. + Properly monitor your ntpd instances. + If ntpd stops running, auto-restart it without -g . + Credit: + This weakness was discovered by Yihan Lian of Qihoo 360. + +* NTP Bug 3012: Sybil vulnerability: ephemeral association attack + Also see Bug 3415, above. + Date Mitigated: Stable (4.2.8p7) 26 Apr 2016; Dev (4.3.92) 26 Apr 2016 + Date Resolved: Stable (4.2.8p11) 27 Feb 2018 + References: Sec 3012 / CVE-2016-1549 / VU#718152 + Affects: All ntp-4 releases up to, but not including 4.2.8p7, and + 4.3.0 up to, but not including 4.3.92. Resolved in 4.2.8p11. + CVSS2: LOW 3.5 - (AV:N/AC:M/Au:S/C:N/I:P/A:N) + CVSS3: MED 5.3 - CVSS:3.0/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:H/A:N + Summary: + ntpd can be vulnerable to Sybil attacks. If a system is set up + to use a trustedkey and if one is not using the feature + introduced in ntp-4.2.8p6 allowing an optional 4th field in the + ntp.keys file to specify which IPs can serve time, a malicious + authenticated peer -- i.e. one where the attacker knows the + private symmetric key -- can create arbitrarily-many ephemeral + associations in order to win the clock selection of ntpd and + modify a victim's clock. Two additional protections are + offered in ntp-4.2.8p11. One is the 'noepeer' directive, which + disables symmetric passive ephemeral peering. The other extends + the functionality of the 4th field in the ntp.keys file to + include specifying a subnet range. + Mitigation: + Implement BCP-38. + Upgrade to 4.2.8p11, or later, from the NTP Project Download Page or + the NTP Public Services Project Download Page. + Use the 'noepeer' directive to prohibit symmetric passive + ephemeral associations. + Use the 'ippeerlimit' directive to limit the number of peer + associations from an IP. + Use the 4th argument in the ntp.keys file to limit the IPs + and subnets that can be time servers. + Properly monitor your ntpd instances. + Credit: + This weakness was discovered by Matthew Van Gundy of Cisco ASIG. + +* Bug fixes: + [Bug 3457] OpenSSL FIPS mode regression + [Bug 3455] ntpd doesn't use scope id when binding multicast + - applied patch by Sean Haugh + [Bug 3452] PARSE driver prints uninitialized memory. + [Bug 3450] Dubious error messages from plausibility checks in get_systime() + - removed error log caused by rounding/slew, ensured postcondition + [Bug 3447] AES-128-CMAC (fixes) + - refactoring the MAC code, too + [Bug 3441] Validate the assumption that AF_UNSPEC is 0. stenn@ntp.org + [Bug 3439] When running multiple commands / hosts in ntpq... + - applied patch by ggarvey + [Bug 3438] Negative values and values > 999 days in... + - applied patch by ggarvey (with minor mods) + [Bug 3437] ntpd tries to open socket with AF_UNSPEC domain + - applied patch (with mods) by Miroslav Lichvar + [Bug 3435] anchor NTP era alignment + [Bug 3433] sntp crashes when run with -a. + [Bug 3430] ntpq dumps core (SIGSEGV) for "keytype md2" + - fixed several issues with hash algos in ntpd, sntp, ntpq, + ntpdc and the test suites + [Bug 3424] Trimble Thunderbolt 1024 week millenium bug + - initial patch by Daniel Pouzzner + [Bug 3423] QNX adjtime() implementation error checking is + wrong + [Bug 3417] ntpq ifstats packet counters can be negative + made IFSTATS counter quantities unsigned + [Bug 3411] problem about SIGN(6) packet handling for ntp-4.2.8p10 + - raised receive buffer size to 1200 + [Bug 3408] refclock_jjy.c: Avoid a wrong report of the coverity static + analysis tool. + [Bug 3405] update-leap.in: general cleanup, HTTPS support. Paul McMath. + [Bug 3404] Fix openSSL DLL usage under Windows + - fix/drop assumptions on OpenSSL libs directory layout + [Bug 3399] NTP: linker error in 4.2.8p10 during Linux cross-compilation + - initial patch by timeflies@mail2tor.com + [Bug 3398] tests fail with core dump + - patch contributed by Alexander Bluhm + [Bug 3397] ctl_putstr() asserts that data fits in its buffer + rework of formatting & data transfer stuff in 'ntp_control.c' + avoids unecessary buffers and size limitations. + [Bug 3394] Leap second deletion does not work on ntpd clients + - fixed handling of dynamic deletion w/o leap file + [Bug 3391] ntpd segfaults on startup due to small warmup thread stack size + - increased mimimum stack size to 32kB + [Bug 3367] Faulty LinuxPPS NMEA clock support in 4.2.8 + - reverted handling of PPS kernel consumer to 4.2.6 behavior + [Bug 3365] Updates driver40(-ja).html and miscopt.html + [Bug 3358] Spurious KoD log messages in .INIT. phase. HStenn. + [Bug 3016] wrong error position reported for bad ":config pool" + - fixed location counter & ntpq output + [Bug 2900] libntp build order problem. HStenn. + [Bug 2878] Tests are cluttering up syslog + [Bug 2737] Wrong phone number listed for USNO. ntp-bugs@bodosom.net, + perlinger@ntp.org + [Bug 2557] Fix Thunderbolt init. ntp-bugs@bodosom.net, perlinger@ntp. + [Bug 948] Trustedkey config directive leaks memory. + Use strlcpy() to copy strings, not memcpy(). HStenn. + Typos. HStenn. + test_ntp_scanner_LDADD needs ntpd/ntp_io.o. HStenn. + refclock_jjy.c: Add missing "%s" to an msyslog() call. HStenn. + Build ntpq and libntpq.a with NTP_HARD_*FLAGS. perlinger@ntp.org + Fix trivial warnings from 'make check'. perlinger@ntp.org + Fix bug in the override portion of the compiler hardening macro. HStenn. + record_raw_stats(): Log entire packet. Log writes. HStenn. + AES-128-CMAC support. BInglis, HStenn, JPerlinger. + sntp: tweak key file logging. HStenn. + sntp: pkt_output(): Improve debug output. HStenn. + update-leap: updates from Paul McMath. + When using pkg-config, report --modversion. HStenn. + Clean up libevent configure checks. HStenn. + sntp: show the IP of who sent us a crypto-NAK. HStenn. + Allow .../N to specify subnet bits for IPs in ntp.keys. HStenn, JPerlinger. + authistrustedip() - use it in more places. HStenn, JPerlinger. + New sysstats: sys_lamport, sys_tsrounding. HStenn. + Update ntp.keys .../N documentation. HStenn. + Distribute testconf.yml. HStenn. + Add DPRINTF(2,...) lines to receive() for packet drops. HStenn. + Rename the configuration flag fifo variables. HStenn. + Improve saveconfig output. HStenn. + Decode restrict flags on receive() debug output. HStenn. + Decode interface flags on receive() debug output. HStenn. + Warn the user if deprecated "driftfile name WanderThreshold" is used. HStenn. + Update the documentation in ntp.conf.def . HStenn. + restrictions() must return restrict flags and ippeerlimit. HStenn. + Update ntpq peer documentation to describe the 'p' type. HStenn. + Rename restrict 'flags' to 'rflags. Use an enum for the values. HStenn. + Provide dump_restricts() for debugging. HStenn. + Use consistent 4th arg type for [gs]etsockopt. JPerlinger. + +* Other items: + +* update-leap needs the following perl modules: + Net::SSLeay + IO::Socket::SSL + +* New sysstats variables: sys_lamport, sys_tsrounding +See them with: ntpq -c "rv 0 ss_lamport,ss_tsrounding" +sys_lamport counts the number of observed Lamport violations, while +sys_tsrounding counts observed timestamp rounding events. + +* New ntp.conf items: + +- restrict ... noepeer +- restrict ... ippeerlimit N + +The 'noepeer' directive will disallow all ephemeral/passive peer +requests. + +The 'ippeerlimit' directive limits the number of time associations +for each IP in the designated set of addresses. This limit does not +apply to explicitly-configured associations. A value of -1, the current +default, means an unlimited number of associations may connect from a +single IP. 0 means "none", etc. Ordinarily the only way multiple +associations would come from the same IP would be if the remote side +was using a proxy. But a trusted machine might become compromised, +in which case an attacker might spin up multiple authenticated sessions +from different ports. This directive should be helpful in this case. + +* New ntp.keys feature: Each IP in the optional list of IPs in the 4th +field may contain a /subnetbits specification, which identifies the +scope of IPs that may use this key. This IP/subnet restriction can be +used to limit the IPs that may use the key in most all situations where +a key is used. +-- NTP 4.2.8p10 (Harlan Stenn , 2017/03/21) Focus: Security, Bug fixes, enhancements. @@ -960,7 +1287,7 @@ following 9 low- and medium-severity vulnerabilities: Implement BCP-38. Upgrade to 4.2.8p7, or later, from the NTP Project Download Page or the NTP Public Services Project Download Page - Properly monitor your =ntpd= instances + Properly monitor your ntpd instances Credit: This weakness was discovered by Stephen Gray and Matthew Van Gundy of Cisco ASIG. @@ -1029,7 +1356,7 @@ following 9 low- and medium-severity vulnerabilities: Implement BCP-38. Upgrade to 4.2.8p7, or later, from the NTP Project Download Page or the NTP Public Services Project Download Page - Properly monitor your =ntpd= instances + Properly monitor your ntpd instances Credit: This weakness was discovered by Yihan Lian of the Cloud Security Team, Qihoo 360. @@ -1266,7 +1593,7 @@ following 1 low- and 8 medium-severity vulnerabilities Configure 'ntpd' to get time from multiple sources. Upgrade to 4.2.8p6, or later, from the NTP Project Download Page or the NTP Public Services Project Download Page. - Monitor your 'ntpd= instances. + Monitor your 'ntpd' instances. Credit: This weakness was discovered by Matthey Van Gundy and Jonathan Gardner of Cisco ASIG. Modified: stable/11/contrib/ntp/aclocal.m4 ============================================================================== --- stable/11/contrib/ntp/aclocal.m4 Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/aclocal.m4 Wed Feb 28 09:01:03 2018 (r330106) @@ -1339,6 +1339,7 @@ m4_include([sntp/m4/ltoptions.m4]) m4_include([sntp/m4/ltsugar.m4]) m4_include([sntp/m4/ltversion.m4]) m4_include([sntp/m4/lt~obsolete.m4]) +m4_include([sntp/m4/ntp_af_unspec.m4]) m4_include([sntp/m4/ntp_cacheversion.m4]) m4_include([sntp/m4/ntp_compiler.m4]) m4_include([sntp/m4/ntp_crosscompile.m4]) Modified: stable/11/contrib/ntp/adjtimed/Makefile.in ============================================================================== --- stable/11/contrib/ntp/adjtimed/Makefile.in Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/adjtimed/Makefile.in Wed Feb 28 09:01:03 2018 (r330106) @@ -108,6 +108,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/li $(top_srcdir)/sntp/m4/ltsugar.m4 \ $(top_srcdir)/sntp/m4/ltversion.m4 \ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ @@ -952,7 +953,6 @@ install-exec-hook: # check-libntp: ../libntp/libntp.a - @echo stamp > $@ ../libntp/libntp.a: cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a Modified: stable/11/contrib/ntp/clockstuff/Makefile.in ============================================================================== --- stable/11/contrib/ntp/clockstuff/Makefile.in Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/clockstuff/Makefile.in Wed Feb 28 09:01:03 2018 (r330106) @@ -101,6 +101,7 @@ am__aclocal_m4_deps = $(top_srcdir)/sntp/libopts/m4/li $(top_srcdir)/sntp/m4/ltsugar.m4 \ $(top_srcdir)/sntp/m4/ltversion.m4 \ $(top_srcdir)/sntp/m4/lt~obsolete.m4 \ + $(top_srcdir)/sntp/m4/ntp_af_unspec.m4 \ $(top_srcdir)/sntp/m4/ntp_cacheversion.m4 \ $(top_srcdir)/sntp/m4/ntp_compiler.m4 \ $(top_srcdir)/sntp/m4/ntp_crosscompile.m4 \ @@ -793,7 +794,6 @@ uninstall-am: check-libntp: ../libntp/libntp.a - @echo stamp > $@ ../libntp/libntp.a: cd ../libntp && $(MAKE) $(AM_MAKEFLAGS) libntp.a Modified: stable/11/contrib/ntp/configure ============================================================================== --- stable/11/contrib/ntp/configure Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/configure Wed Feb 28 09:01:03 2018 (r330106) @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for ntp 4.2.8p10. +# Generated by GNU Autoconf 2.69 for ntp 4.2.8p11. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='ntp' PACKAGE_TARNAME='ntp' -PACKAGE_VERSION='4.2.8p10' -PACKAGE_STRING='ntp 4.2.8p10' +PACKAGE_VERSION='4.2.8p11' +PACKAGE_STRING='ntp 4.2.8p11' PACKAGE_BUGREPORT='http://bugs.ntp.org./' PACKAGE_URL='http://www.ntp.org./' @@ -944,6 +944,7 @@ ac_user_opts=' enable_option_checking enable_silent_rules enable_dependency_tracking +with_hardenfile with_locfile enable_shared enable_static @@ -1613,7 +1614,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures ntp 4.2.8p10 to adapt to many kinds of systems. +\`configure' configures ntp 4.2.8p11 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1683,7 +1684,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of ntp 4.2.8p10:";; + short | recursive ) echo "Configuration of ntp 4.2.8p11:";; esac cat <<\_ACEOF @@ -1699,6 +1700,7 @@ Optional Features and Packages: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build + --with-hardenfile=XXX os-specific or "/dev/null" --with-locfile=XXX os-specific or "legacy" --enable-shared[=PKGS] build shared libraries [default=no] --enable-static[=PKGS] build static libraries [default=yes] @@ -1921,7 +1923,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -ntp configure 4.2.8p10 +ntp configure 4.2.8p11 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2630,7 +2632,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by ntp $as_me 4.2.8p10, which was +It was created by ntp $as_me 4.2.8p11, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -3631,7 +3633,7 @@ fi # Define the identity of the package. PACKAGE='ntp' - VERSION='4.2.8p10' + VERSION='4.2.8p11' cat >>confdefs.h <<_ACEOF @@ -6581,11 +6583,11 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu $as_echo_n "checking for compile/link hardening flags... " >&6; } -# Check whether --with-locfile was given. -if test "${with_locfile+set}" = set; then : - withval=$with_locfile; +# Check whether --with-hardenfile was given. +if test "${with_hardenfile+set}" = set; then : + withval=$with_hardenfile; else - with_locfile=no + with_hardenfile=no fi @@ -6593,12 +6595,12 @@ fi ( \ SENTINEL_DIR="$PWD" && \ cd $srcdir/sntp && \ - case "$with_locfile" in \ + case "$with_hardenfile" in \ yes|no|'') \ scripts/genHardFlags -d "$SENTINEL_DIR" \ ;; \ *) \ - scripts/genHardFlags -d "$SENTINEL_DIR" -f "$with_locfile" \ + scripts/genHardFlags -d "$SENTINEL_DIR" -f "$with_hardenfile" \ ;; \ esac \ ) > genHardFlags.i 2> genHardFlags.err @@ -15937,8 +15939,13 @@ $as_echo_n "checking if libevent $ntp_libevent_min_ver if $PKG_CONFIG --atleast-version=$ntp_libevent_min_version libevent then ntp_use_local_libevent=no - { $as_echo "$as_me:${as_lineno-$LINENO}: Using the installed libevent" >&5 -$as_echo "$as_me: Using the installed libevent" >&6;} + ntp_libevent_version="`$PKG_CONFIG --modversion libevent`" + case "$ntp_libevent_version" in + *.*) ;; + *) ntp_libevent_version='(unknown)' ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_libevent_version" >&5 +$as_echo "yes, version $ntp_libevent_version" >&6; } CFLAGS_LIBEVENT=`$PKG_CONFIG --cflags libevent_pthreads` CPPFLAGS_LIBEVENT=`$PKG_CONFIG --cflags-only-I libevent` # HMS: I hope the following is accurate. @@ -15966,8 +15973,6 @@ $as_echo "$as_me: Using the installed libevent" >&6;} LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_pthreads" esac LDADD_LIBEVENT="$LDADD_LIBEVENT -levent_core" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } else ntp_use_local_libevent=yes # HMS: do we only need to do this if LIBISC_PTHREADS_NOTHREADS @@ -26468,6 +26473,36 @@ fi done + + +# We could do a cv check here, but is it worth it? + +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + #include + #ifndef AF_UNSPEC + #include "Bletch: AF_UNSPEC is undefined!" + #endif + #if AF_UNSPEC != 0 + #include "Bletch: AF_UNSPEC != 0" + #endif + +int +main () +{ +{ $as_echo "$as_me:${as_lineno-$LINENO}: AF_UNSPEC is zero, as expected." >&5 +$as_echo "$as_me: AF_UNSPEC is zero, as expected." >&6;} + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } if ${ac_cv_type_signal+:} false; then : @@ -30114,8 +30149,13 @@ $as_echo_n "checking pkg-config for $pkg... " >&6; } VER_SUFFIX=o ntp_openssl=yes ntp_openssl_from_pkg_config=yes - { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 -$as_echo "yes" >&6; } + ntp_openssl_version="`$PKG_CONFIG --modversion $pkg`" + case "$ntp_openssl_version" in + *.*) ;; + *) ntp_openssl_version='(unknown)' ;; + esac + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes, version $ntp_openssl_version" >&5 +$as_echo "yes, version $ntp_openssl_version" >&6; } break fi @@ -33924,7 +33964,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by ntp $as_me 4.2.8p10, which was +This file was extended by ntp $as_me 4.2.8p11, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -33991,7 +34031,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -ntp config.status 4.2.8p10 +ntp config.status 4.2.8p11 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Modified: stable/11/contrib/ntp/configure.ac ============================================================================== --- stable/11/contrib/ntp/configure.ac Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/configure.ac Wed Feb 28 09:01:03 2018 (r330106) @@ -528,6 +528,8 @@ AC_CHECK_HEADERS([sys/timex.h], [], [], [ #endif ]) +NTP_AF_UNSPEC + AC_TYPE_SIGNAL AC_TYPE_OFF_T AC_STRUCT_TM dnl defines TM_IN_SYS_TIME used by refclock_parse.c Modified: stable/11/contrib/ntp/html/access.html ============================================================================== --- stable/11/contrib/ntp/html/access.html Wed Feb 28 08:53:07 2018 (r330105) +++ stable/11/contrib/ntp/html/access.html Wed Feb 28 09:01:03 2018 (r330106) @@ -19,7 +19,7 @@ color: #FF0000;

giffrom Pogo, Walt Kelly

The skunk watches for intruders and sprays.

Last update: - 11-Sep-2010 05:53 + 26-Jul-2017 20:10 UTC


Related Links

@@ -32,7 +32,7 @@ color: #FF0000;

The ACL is specified as a list of restrict commands in the following format:

restrict address [mask mask] [flag][...]

The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in IPv4 or IPv6 numeric address form defaults to all mask bits on, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and address :: mask :: for IPv6) is always the first entry in the list. restrict default, with no mask option, modifies both IPv4 and IPv6 default entries. restrict source configures a template restriction automatically added at runtime for each association, whether configured, ephemeral, or preemptable, and removed when the association is demobilized.

-

Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server.

+

Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server.

An example may clarify how it works. Our campus has two class-B networks, 128.4 for the ECE and CIS departments and 128.175 for the rest of campus. Let's assume (not true!) that subnet 128.4.1 homes critical services like class rosters and spread sheets. A suitable ACL might look like this:

 restrict default nopeer					# deny new associations

Modified: stable/11/contrib/ntp/html/accopt.html
==============================================================================
--- stable/11/contrib/ntp/html/accopt.html	Wed Feb 28 08:53:07 2018	(r330105)
+++ stable/11/contrib/ntp/html/accopt.html	Wed Feb 28 09:01:03 2018	(r330106)
@@ -3,89 +3,185 @@
 
 
 
-Access Control Commands and Options
-
+Access Control Commands and Options 
 
 
 
 
 

Access Control Commands and Options

-giffrom Pogo, Walt Kelly +giffrom Pogo, +Walt Kelly

The skunk watches for intruders and sprays.

-

Last update: - 13-Nov-2014 03:00 - UTC

+

Last update: 7-Jan-2018 23:56 UTC


Related Links

- - + +

Commands and Options

-

Unless noted otherwise, further information about these ccommands is on the Access Control Support page.

+

Unless noted otherwise, further information about these ccommands is on +the Access Control Support page.

-
discard [ average avg ][ minimum min ] [ monitor prob ]
-
Set the parameters of the rate control facility which protects the server from client abuse. If the limited flag is present in the ACL, packets that violate these limits are discarded. If, in addition, the kod flag is present, a kiss-o'-death packet is returned. See the Rate Management page for further information. The options are: +
discard [ average avg ][ minimum min ] + [ monitor prob ]
+
Set the parameters of the rate control facility which protects the + server from client abuse. If the limited flag is present in the + ACL, packets that violate these limits are discarded. If, in addition, + the kod flag is present, a kiss-o'-death packet is + returned. See the Rate Management page for + further information. The options are:
average avg
-
Specify the minimum average interpacket spacing (minimum average headway - time) in log2 s with default 3.
+
Specify the minimum average interpacket spacing (minimum average + headway time) in log2 s with default 3.
minimum min
-
Specify the minimum interpacket spacing (guard time) in seconds with default 2.
+
Specify the minimum interpacket spacing (guard time) in seconds + with default 2.
monitor
-
Specify the probability of being recorded for packets that overflow the MRU list size limit set by mru maxmem or mru maxdepth. This is a performance optimization for servers with aggregate arrivals of 1000 packets per second or more.
+
Specify the probability of being recorded for packets that + overflow the MRU list size limit set by mru maxmem + or mru maxdepth. This is a performance optimization for + servers with aggregate arrivals of 1000 packets per second or + more.
-
restrict default [flag][...]
- restrict source [flag][...]
- restrict address [mask mask] [flag][...]
-
The address argument expressed in dotted-quad form is the address of a host or network. Alternatively, the address argument can be a valid host DNS name. The mask argument expressed in IPv4 or IPv6 numeric address form defaults to all mask bits on, meaning that the address is treated as the address of an individual host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and address :: mask :: for IPv6) is always the first entry in the list. restrict default, with no mask option, modifies both IPv4 and IPv6 default entries. restrict source configures a template restriction automatically added at runtime for each association, whether configured, ephemeral, or preemptible, and removed when the association is demobilized.
-
Some flags have the effect to deny service, some have the effect to enable service and some are conditioned by other flags. The flags. are not orthogonal, in that more restrictive flags will often make less restrictive ones redundant. The flags that deny service are classed in two categories, those that restrict time service and those that restrict informational queries and attempts to do run-time reconfiguration of the server. One or more of the following flags may be specified:
+
restrict [-4 | -6] default [ippeerlimit num] + [flag][...]
restrict source [ippeerlimit num] + [flag][...]
restrict address [mask mask] + [ippeerlimit num] [flag][...]
+
The address argument expressed in IPv4 or IPv6 numeric + address form is the address of a host or network. Alternatively, + the address argument can be a valid host DNS + name. The mask argument expressed in IPv4 or IPv6 + numeric address form defaults to all mask bits on, meaning that + the address is treated as the address of an individual + host. A default entry (address 0.0.0.0, mask 0.0.0.0 for IPv4 and + address :: mask :: for IPv6) is always the first entry in the + list. restrict default, with no mask option, modifies both IPv4 + and IPv6 default entries. restrict source configures a template + restriction automatically added at runtime for each association, whether + configured, ephemeral, or preemptible, and removed when the association + is demobilized.
+
The optional ippeerlimit takes a numeric argument that + indicates how many incoming (at present) peer requests will be permitted + for each IP, regardless of whether or not the request comes from an + authenticated source. A value of -1 means "unlimited", which is the + current default. A value of 0 means "none". Ordinarily one would + expect at most 1 of these sessions to exist per IP, however if the + remote side is operating thru a proxy there would be one association for + each remote peer at that IP.
+
Some flags have the effect to deny service, some have the effect to + enable service and some are conditioned by other flags. The flags are + not orthogonal, in that more restrictive flags will often make less + restrictive ones redundant. The flags that deny service are classed in + two categories, those that restrict time service and those that restrict + informational queries and attempts to do run-time reconfiguration of the + server. One or more of the following flags may be specified:
flake
-
Discard received NTP packets with probability 0.1; that is, on average drop one packet in ten. This is for testing and amusement. The name comes from Bob Braden's flakeway, which once did a similar thing for early Internet testing.
+
Discard received NTP packets with probability 0.1; that is, on + average drop one packet in ten. This is for testing and + amusement. The name comes from Bob Braden's flakeway, which + once did a similar thing for early Internet testing.
ignore
-
Deny packets of all kinds, including ntpq and ntpdc queries.
+
Deny packets of all kinds, including ntpq + and ntpdc queries.
kod
-
Send a kiss-o'-death (KoD) packet if the limited flag is present and a packet violates the rate limits established by the discard command. KoD packets are themselves rate limited for each source address separately. If the kod flag is used in a restriction which does not have the limited flag, no KoD responses will result.
+
Send a kiss-o'-death (KoD) packet if the limited flag is + present and a packet violates the rate limits established by + the discard command. KoD packets are themselves rate + limited for each source address separately. If the kod flag + is used in a restriction which does not have the limited + flag, no KoD responses will result.
limited
-
Deny time service if the packet violates the rate limits established by the discard command. This does not apply to ntpq and ntpdc queries.
+
Deny time service if the packet violates the rate limits + established by the discard command. This does not apply + to ntpq and ntpdc queries.
lowpriotrap
-
Declare traps set by matching hosts to be low priority. The number of traps a server can maintain is limited (the current limit is 3). Traps are usually assigned on a first come, first served basis, with later trap requestors being denied service. This flag modifies the assignment algorithm by allowing low priority traps to be overridden by later requests for normal priority traps.
+
Declare traps set by matching hosts to be low priority. The number + of traps a server can maintain is limited (the current limit is + 3). Traps are usually assigned on a first come, first served basis, + with later trap requestors being denied service. This flag modifies + the assignment algorithm by allowing low priority traps to be + overridden by later requests for normal priority traps.
mssntp
-
Enable Microsoft Windows MS-SNTP authentication using Active Directory services. Note: Potential users should be aware that these services involve a TCP connection to another process that could potentially block, denying services to other users. Therefore, this flag should be used only for a dedicated server with no clients other than MS-SNTP.
+
Enable Microsoft Windows MS-SNTP authentication using Active + Directory services. Note: Potential users + should be aware that these services involve a TCP connection to + another process that could potentially block, denying services to + other users. Therefore, this flag should be used only for a + dedicated server with no clients other than MS-SNTP.
+
noepeer
+
Deny packets that would mobilize an ephemeral peering association, + even if authenticated.
nomodify
-
Deny ntpq and ntpdc queries which attempt to modify the state of the server (i.e., run time reconfiguration). Queries which return information are permitted.
+
Deny ntpq and ntpdc queries which attempt to + modify the state of the server (i.e., run time + reconfiguration). Queries which return information are + permitted.
noquery
-
Deny ntpq and ntpdc queries. Time service is not affected.
+
Deny ntpq and ntpdc queries. Time service is not + affected.
nopeer
-
Deny packets that might mobilize an association unless authenticated. This includes broadcast, symmetric-active and manycast server packets when a configured association does not exist. It also includes pool associations, so if you want to use servers from a pool directive and also want to use nopeer by default, you'll want a "restrict source ..." line as well that does not include the nopeer directive. Note that this flag does not apply to packets that do not attempt to mobilize an association.
+
Deny packets that might mobilize an association unless + authenticated. This includes broadcast, symmetric-active and + manycast server packets when a configured association does not + exist. It also includes pool associations, so if you want + to use servers from a pool directive and also want to + use nopeer by default, you'll want a "restrict source + ..." line as well that does not include + the nopeer directive. Note that this flag does not apply + to packets that do not attempt to mobilize an association.
noserve
-
Deny all packets except ntpq and ntpdc queries.
+
Deny all packets except ntpq and ntpdc + queries.
notrap
-
Decline to provide mode 6 control message trap service to matching hosts. The trap service is a subsystem of the ntpdc control message protocol which is intended for use by remote event logging programs.
+
Decline to provide mode 6 control message trap service to matching + hosts. The trap service is a subsystem of the ntpdc control + message protocol which is intended for use by remote event logging + programs.
notrust
-
Deny packets that are not cryptographically authenticated. Note carefully how this flag interacts with the auth option of the enable and disable commands. If auth is enabled, which is the default, authentication is required for all packets that might mobilize an association. If auth is disabled, but the notrust flag is not present, an association can be mobilized whether or not authenticated. If auth is disabled, but the notrust flag is present, authentication is required only for the specified address/mask range.
+
Deny packets that are not cryptographically authenticated. Note + carefully how this flag interacts with the auth option of + the enable and disable commands. If auth + is enabled, which is the default, authentication is required for all + packets that might mobilize an association. If auth is + disabled, but the notrust flag is not present, an + association can be mobilized whether or not + authenticated. If auth is disabled, but + the notrust flag is present, authentication is required + only for the specified address/mask range.
ntpport
-
This is actually a match algorithm modifier, rather than a restriction - flag. Its presence causes the restriction entry to be matched only if the - source port in the packet is the standard NTP UDP port (123). A restrict line - containing ntpport is considered more specific than one with the *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Wed Feb 28 09:59:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C5417F399F4; Wed, 28 Feb 2018 09:59:45 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 756BD6EE6B; Wed, 28 Feb 2018 09:59:45 +0000 (UTC) (envelope-from rpokala@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 703E217F2D; Wed, 28 Feb 2018 09:59:45 +0000 (UTC) (envelope-from rpokala@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1S9xjh1009534; Wed, 28 Feb 2018 09:59:45 GMT (envelope-from rpokala@FreeBSD.org) Received: (from rpokala@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1S9xikg009529; Wed, 28 Feb 2018 09:59:44 GMT (envelope-from rpokala@FreeBSD.org) Message-Id: <201802280959.w1S9xikg009529@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: rpokala set sender to rpokala@FreeBSD.org using -f From: Ravi Pokala Date: Wed, 28 Feb 2018 09:59:44 +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: r330107 - in stable/11: share/man/man4 sys/conf sys/dev/jedec_dimm sys/modules/i2c sys/modules/i2c/jedec_dimm X-SVN-Group: stable-11 X-SVN-Commit-Author: rpokala X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/jedec_dimm sys/modules/i2c sys/modules/i2c/jedec_dimm X-SVN-Commit-Revision: 330107 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.25 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, 28 Feb 2018 09:59:46 -0000 Author: rpokala Date: Wed Feb 28 09:59:44 2018 New Revision: 330107 URL: https://svnweb.freebsd.org/changeset/base/330107 Log: MFC r329843: jedec_dimm(4): report asset info and temperatures for DDR3 and DDR4 DIMMs A super-set of the functionality of jedec_ts(4). jedec_dimm(4) reports asset information (Part Number, Serial Number) encoded in the "Serial Presence Detect" (SPD) data on JEDEC DDR3 and DDR4 DIMMs. It also calculates and reports the memory capacity of the DIMM, in megabytes. If the DIMM includes a "Thermal Sensor On DIMM" (TSOD), the temperature is also reported. Added: stable/11/share/man/man4/jedec_dimm.4 - copied unchanged from r329843, head/share/man/man4/jedec_dimm.4 stable/11/sys/dev/jedec_dimm/ - copied from r329843, head/sys/dev/jedec_dimm/ stable/11/sys/modules/i2c/jedec_dimm/ - copied from r329843, head/sys/modules/i2c/jedec_dimm/ Modified: stable/11/share/man/man4/Makefile stable/11/sys/conf/NOTES stable/11/sys/conf/files stable/11/sys/modules/i2c/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/Makefile ============================================================================== --- stable/11/share/man/man4/Makefile Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/share/man/man4/Makefile Wed Feb 28 09:59:44 2018 (r330107) @@ -245,6 +245,7 @@ MAN= aac.4 \ ixgbe.4 \ ixl.4 \ ixlv.4 \ + jedec_dimm.4 \ jedec_ts.4 \ jme.4 \ joy.4 \ Copied: stable/11/share/man/man4/jedec_dimm.4 (from r329843, head/share/man/man4/jedec_dimm.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/share/man/man4/jedec_dimm.4 Wed Feb 28 09:59:44 2018 (r330107, copy of r329843, head/share/man/man4/jedec_dimm.4) @@ -0,0 +1,240 @@ +.\" +.\" SPDX-License-Identifier: BSD-2-Clause-FreeBSD +.\" +.\" Copyright (c) 2016 Andriy Gapon +.\" Copyright (c) 2018 Ravi Pokala +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 22, 2018 +.Dt JEDEC_DIMM 4 +.Os +.Sh NAME +.Nm jedec_dimm +.Nd report asset information and temperatures for JEDEC DDR3 / DDR4 DIMMs +.Sh SYNOPSIS +.Bd -ragged -offset indent +.Cd "device jedec_dimm" +.Cd "device smbus" +.Ed +.Pp +Alternatively, to load the driver as a module at boot time, place the following +line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +jedec_dimm_load="YES" +.Ed +.Pp +Addressing information must be manually specified in +.Pa /boot/device.hints : +.Bd -literal -offset indent +.Cd hint.jedec_dimm.0.at="smbus0" +.Cd hint.jedec_dimm.0.addr="0xa0" +.Cd hint.jedec_dimm.0.slotid="Silkscreen" +.Ed +.Sh DESCRIPTION +The +.Nm +driver reports asset information (Part Number, Serial Number) encoded in the +.Dq Serial Presence Detect +(SPD) data on JEDEC DDR3 and DDR4 DIMMs. +It also calculates and reports the memory capacity of the DIMM, in megabytes. +If the DIMM includes a +.Dq Thermal Sensor On DIMM +(TSOD), the temperature is also reported. +.Pp +The +.Nm +driver accesses the SPD and TSOD over the +.Xr smbus 4 . +.Pp +The data is reported via a +.Xr sysctl 8 +interface; all values are read-only: +.Bl -tag -width "dev.jedec_dimm.X.capacity" +.It Va dev.jedec_dimm.X.%desc +a string description of the DIMM, including TSOD and slotid info if present. +.It Va dev.jedec_dimm.X.capacity +the DIMM's memory capacity, in megabytes +.It Va dev.jedec_dimm.X.part +the manufacturer's part number of the DIMM +.It Va dev.jedec_dimm.X.serial +the manufacturer's serial number of the DIMM +.It Va dev.jedec_dimm.X.slotid +a copy of the corresponding hint, if set +.It Va dev.jedec_dimm.X.temp +if a TSOD is present, the reported temperature +.It Va dev.jedec_dimm.X.type +the DIMM type (DDR3 or DDR4) +.El +.Pp +These values are configurable for +.Nm +via +.Xr device.hints 5 : +.Bl -tag -width "hint.jedec_dimm.X.slotid" +.It Va hint.jedec_dimm.X.at +the +.Xr smbus 4 +to which the DIMM is connected +.It Va hint.jedec_dimm.X.addr +the SMBus address of the SPD. +JEDEC specifies that the four most-significant bits of the address are the +.Dq Device Type Identifier +(DTI), and that the DTI of the SPD is 0xa. +Since the least-significant bit of an SMBus address is the read/write bit, and +is always written as 0, that means the four least-significant bits of the +address must be even. +.It Va hint.jedec_dimm.X.slotid +optional slot identifier. +If populated with the DIMM slot name silkscreened on the motherboard, this +provides a mapping between the DIMM slot name and the DIMM serial number. +That mapping is useful for detailed asset tracking, and makes it easier to +physically locate a specific DIMM when doing a replacement. +This is useful when assembling multiple identical systems, as might be done by +a system vendor. +The mapping between bus/address and DIMM slot must first be determined, either +through motherboard documentation or trial-and-error. +.El +.Pp +If the DIMMs are on an I2C bus behind an +.Xr iicbus 4 +controller, then the +.Xr iicsmb 4 +bridge driver can be used to attach the +.Xr smbus 4 . +.Sh EXAMPLES +Consider two DDR4 DIMMs with the following hints: +.Bd -literal -offset indent +hint.jedec_dimm.0.at="smbus0" +hint.jedec_dimm.0.addr="0xa0" +hint.jedec_dimm.0.slotid="A1" + +hint.jedec_dimm.6.at="smbus1" +hint.jedec_dimm.6.addr="0xa8" +.Ed +.Pp +Their +.Xr sysctl 8 +output (sorted): +.Bd -literal -offset indent +dev.jedec_dimm.0.%desc: DDR4 DIMM w/ Atmel TSOD (A1) +dev.jedec_dimm.0.%driver: jedec_dimm +dev.jedec_dimm.0.%location: addr=0xa0 +dev.jedec_dimm.0.%parent: smbus0 +dev.jedec_dimm.0.%pnpinfo: +dev.jedec_dimm.0.capacity: 16384 +dev.jedec_dimm.0.part: 36ASF2G72PZ-2G1A2 +dev.jedec_dimm.0.serial: 0ea815de +dev.jedec_dimm.0.slotid: A1 +dev.jedec_dimm.0.temp: 32.7C +dev.jedec_dimm.0.type: DDR4 + +dev.jedec_dimm.6.%desc: DDR4 DIMM w/ TSE2004av compliant TSOD +dev.jedec_dimm.6.%driver: jedec_dimm +dev.jedec_dimm.6.%location: addr=0xa8 +dev.jedec_dimm.6.%parent: smbus1 +dev.jedec_dimm.6.%pnpinfo: +dev.jedec_dimm.6.capacity: 8192 +dev.jedec_dimm.6.part: VRA9MR8B2H1603 +dev.jedec_dimm.6.serial: 0c4c46ad +dev.jedec_dimm.6.temp: 43.1C +dev.jedec_dimm.6.type: DDR4 +.Ed +.Sh COMPATIBILITY +Hints for +.Xr jedec_ts 4 +can be mechanically converted for use with +.Nm . +Two changes are required: +.Bl -enum +.It +In all +.Xr jedec_ts 4 +hints, replace +.Dq jedec_ts +with +.Dq jedec_dimm +.It +In +.Xr jedec_ts 4 +.Dq addr +hints, replace the TSOD DTI +.Dq 0x3 +with the SPD DTI +.Dq 0xa +.El +.Pp +The following +.Xr sed 1 +script will perform the necessary changes: +.Bd -literal -offset indent +sed -i ".old" -e 's/jedec_ts/jedec_dimm/' \\ + -e '/jedec_dimm/s/addr="0x3/addr="0xa/' /boot/device.hints +.Ed +.Sh SEE ALSO +.Xr iicbus 4 , +.Xr iicsmb 4 , +.Xr jedec_ts 4 , +.Xr smbus 4 , +.Xr sysctl 8 +.Sh STANDARDS +.Rs +(DDR3 SPD) +.%A JEDEC +.%T Standard 21-C, Annex K +.Re +.Pp +.Rs +(DDR3 TSOD) +.%A JEDEC +.%T Standard 21-C, TSE2002av +.Re +.Pp +.Rs +(DDR4 SPD) +.%A JEDEC +.%T Standard 21-C, Annex L +.Re +.Pp +.Rs +(DDR4 TSOD) +.%A JEDEC +.%T Standard 21-C, TSE2004av +.Re +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 12.0 . +.Sh AUTHORS +.An -nosplit +The +.Nm +driver and this manual page were written by +.An Ravi Pokala Aq Mt rpokala@freebsd.org . +They are both based in part on the +.Xr jedec_ts 4 +driver and manual page, written by +.An Andriy Gapon Aq Mt avg@FreeBSD.org . Modified: stable/11/sys/conf/NOTES ============================================================================== --- stable/11/sys/conf/NOTES Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/sys/conf/NOTES Wed Feb 28 09:59:44 2018 (r330107) @@ -2541,8 +2541,10 @@ device smb # SMBus peripheral devices # +# jedec_dimm Asset and temperature reporting for DDR3 and DDR4 DIMMs # jedec_ts Temperature Sensor compliant with JEDEC Standard 21-C # +device jedec_dimm device jedec_ts # I2C Bus Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/sys/conf/files Wed Feb 28 09:59:44 2018 (r330107) @@ -2161,6 +2161,7 @@ dev/ixgbe/ixgbe_dcb_82598.c optional ix inet | ixv ine compile-with "${NORMAL_C} -I$S/dev/ixgbe" dev/ixgbe/ixgbe_dcb_82599.c optional ix inet | ixv inet \ compile-with "${NORMAL_C} -I$S/dev/ixgbe" +dev/jedec_dimm/jedec_dimm.c optional jedec_dimm smbus dev/jedec_ts/jedec_ts.c optional jedec_ts smbus dev/jme/if_jme.c optional jme pci dev/joy/joy.c optional joy Modified: stable/11/sys/modules/i2c/Makefile ============================================================================== --- stable/11/sys/modules/i2c/Makefile Wed Feb 28 09:01:03 2018 (r330106) +++ stable/11/sys/modules/i2c/Makefile Wed Feb 28 09:59:44 2018 (r330107) @@ -14,6 +14,7 @@ SUBDIR = \ iicsmb \ isl \ isl12xx \ + jedec_dimm \ jedec_ts \ nxprtc \ s35390a \ From owner-svn-src-stable-11@freebsd.org Wed Feb 28 18:31:37 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06F44F3B523; Wed, 28 Feb 2018 18:31:37 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A311686760; Wed, 28 Feb 2018 18:31:36 +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 827011D2F8; Wed, 28 Feb 2018 18:31:36 +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 w1SIVaH3072726; Wed, 28 Feb 2018 18:31:36 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SIVZHF072718; Wed, 28 Feb 2018 18:31:35 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281831.w1SIVZHF072718@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 18:31: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: r330123 - in stable/11/stand: . arm efi i386 mips powerpc sparc64 X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand: . arm efi i386 mips powerpc sparc64 X-SVN-Commit-Revision: 330123 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.25 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, 28 Feb 2018 18:31:37 -0000 Author: kevans Date: Wed Feb 28 18:31:35 2018 New Revision: 330123 URL: https://svnweb.freebsd.org/changeset/base/330123 Log: MFC r330004: Add NO_OBJ to those directories that don't make anything. For directories that don't many anything, add NO_OBJ=t just before we include bsd.init.mk. This prevents them from creating an OBJ directory. In addition, prevent defs.mk from creating the machine related links in these cases. They aren't needed and break, at least on stable, the read-only src tree build. PR: 226074 Modified: stable/11/stand/Makefile.i386 stable/11/stand/arm/Makefile stable/11/stand/defs.mk stable/11/stand/efi/Makefile stable/11/stand/i386/Makefile stable/11/stand/mips/Makefile stable/11/stand/powerpc/Makefile stable/11/stand/sparc64/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/stand/Makefile.i386 ============================================================================== --- stable/11/stand/Makefile.i386 Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/Makefile.i386 Wed Feb 28 18:31:35 2018 (r330123) @@ -6,5 +6,3 @@ SUBDIR+= geli .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif - -SUBDIR+= efi Modified: stable/11/stand/arm/Makefile ============================================================================== --- stable/11/stand/arm/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/arm/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot .include Modified: stable/11/stand/defs.mk ============================================================================== --- stable/11/stand/defs.mk Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/defs.mk Wed Feb 28 18:31:35 2018 (r330123) @@ -149,6 +149,7 @@ CLEANFILES+=${_ILINKS} all: ${PROG} +.if !defined(NO_OBJ) beforedepend: ${_ILINKS} beforebuild: ${_ILINKS} @@ -176,5 +177,5 @@ ${_ILINKS}: path=`(cd $$path && /bin/pwd)` ; \ ${ECHO} ${.TARGET:T} "->" $$path ; \ ln -fhs $$path ${.TARGET:T} - +.endif .endif # __BOOT_DEFS_MK__ Modified: stable/11/stand/efi/Makefile ============================================================================== --- stable/11/stand/efi/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/efi/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include # In-tree GCC does not support __attribute__((ms_abi)), but gcc newer Modified: stable/11/stand/i386/Makefile ============================================================================== --- stable/11/stand/i386/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/i386/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= mbr pmbr boot0 boot0sio btx boot2 cdboot gptboot \ Modified: stable/11/stand/mips/Makefile ============================================================================== --- stable/11/stand/mips/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/mips/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + SUBDIR= uboot # Modified: stable/11/stand/powerpc/Makefile ============================================================================== --- stable/11/stand/powerpc/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/powerpc/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1.chrp ofw uboot Modified: stable/11/stand/sparc64/Makefile ============================================================================== --- stable/11/stand/sparc64/Makefile Wed Feb 28 17:20:10 2018 (r330122) +++ stable/11/stand/sparc64/Makefile Wed Feb 28 18:31:35 2018 (r330123) @@ -1,5 +1,7 @@ # $FreeBSD$ +NO_OBJ=t + .include SUBDIR= boot1 loader From owner-svn-src-stable-11@freebsd.org Wed Feb 28 18:34:23 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8DF40F3B98F; Wed, 28 Feb 2018 18:34:23 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D48886B68; Wed, 28 Feb 2018 18:34:23 +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 382081D345; Wed, 28 Feb 2018 18:34:23 +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 w1SIYN57074281; Wed, 28 Feb 2018 18:34:23 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SIYNVs074280; Wed, 28 Feb 2018 18:34:23 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201802281834.w1SIYNVs074280@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Wed, 28 Feb 2018 18:34:23 +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: r330124 - stable/11/stand X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: stable/11/stand X-SVN-Commit-Revision: 330124 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.25 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, 28 Feb 2018 18:34:23 -0000 Author: kevans Date: Wed Feb 28 18:34:22 2018 New Revision: 330124 URL: https://svnweb.freebsd.org/changeset/base/330124 Log: Revert part of r330123 The SUBDIR+= efi removal was part of local testing; revert that part. This is a direct commit to stable/11. Modified: stable/11/stand/Makefile.i386 Modified: stable/11/stand/Makefile.i386 ============================================================================== --- stable/11/stand/Makefile.i386 Wed Feb 28 18:31:35 2018 (r330123) +++ stable/11/stand/Makefile.i386 Wed Feb 28 18:34:22 2018 (r330124) @@ -6,3 +6,5 @@ SUBDIR+= geli .if ${MK_ZFS} != "no" SUBDIR+= zfs .endif + +SUBDIR+= efi From owner-svn-src-stable-11@freebsd.org Wed Feb 28 21:41:52 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF4D8F2550C; Wed, 28 Feb 2018 21:41:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 726DB8ECE0; Wed, 28 Feb 2018 21:41:52 +0000 (UTC) (envelope-from jhb@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 6D07F1F190; Wed, 28 Feb 2018 21:41:52 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SLfqoA078175; Wed, 28 Feb 2018 21:41:52 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SLfqme078174; Wed, 28 Feb 2018 21:41:52 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282141.w1SLfqme078174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 21:41:52 +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: r330129 - stable/11/sys/opencrypto X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/sys/opencrypto X-SVN-Commit-Revision: 330129 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.25 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, 28 Feb 2018 21:41:52 -0000 Author: jhb Date: Wed Feb 28 21:41:52 2018 New Revision: 330129 URL: https://svnweb.freebsd.org/changeset/base/330129 Log: MFC 327838: Axe tmp_iv from the cryptodev session structure. Just copyin the IV into the crypto descriptor directly. This avoids copying the IV twice for each operation. Sponsored by: Chelsio Communications Modified: stable/11/sys/opencrypto/cryptodev.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/opencrypto/cryptodev.c ============================================================================== --- stable/11/sys/opencrypto/cryptodev.c Wed Feb 28 20:51:21 2018 (r330128) +++ stable/11/sys/opencrypto/cryptodev.c Wed Feb 28 21:41:52 2018 (r330129) @@ -278,7 +278,6 @@ struct csession { caddr_t key; int keylen; - u_char tmp_iv[EALG_MAX_BLOCK_LEN]; caddr_t mackey; int mackeylen; @@ -818,12 +817,11 @@ cryptodev_op( error = EINVAL; goto bail; } - if ((error = copyin(cop->iv, cse->tmp_iv, + if ((error = copyin(cop->iv, crde->crd_iv, cse->txform->blocksize))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - bcopy(cse->tmp_iv, crde->crd_iv, cse->txform->blocksize); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; crde->crd_skip = 0; } else if (cse->cipher == CRYPTO_ARC4) { /* XXX use flag? */ @@ -987,17 +985,16 @@ cryptodev_aead( crp->crp_opaque = (void *)cse; if (caead->iv) { - if (caead->ivlen > sizeof cse->tmp_iv) { + if (caead->ivlen > sizeof(crde->crd_iv)) { error = EINVAL; SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - if ((error = copyin(caead->iv, cse->tmp_iv, caead->ivlen))) { + if ((error = copyin(caead->iv, crde->crd_iv, caead->ivlen))) { SDT_PROBE1(opencrypto, dev, ioctl, error, __LINE__); goto bail; } - bcopy(cse->tmp_iv, crde->crd_iv, caead->ivlen); crde->crd_flags |= CRD_F_IV_EXPLICIT | CRD_F_IV_PRESENT; } else { crde->crd_flags |= CRD_F_IV_PRESENT; From owner-svn-src-stable-11@freebsd.org Wed Feb 28 21:49:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E7A07F260CE; Wed, 28 Feb 2018 21:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 950128F39C; Wed, 28 Feb 2018 21:49:44 +0000 (UTC) (envelope-from jhb@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 7149D1F2B7; Wed, 28 Feb 2018 21:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SLniFu079515; Wed, 28 Feb 2018 21:49:44 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SLniN3079513; Wed, 28 Feb 2018 21:49:44 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282149.w1SLniN3079513@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 21:49:44 +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: r330130 - stable/11/bin/ps X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: stable/11/bin/ps X-SVN-Commit-Revision: 330130 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.25 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, 28 Feb 2018 21:49:45 -0000 Author: jhb Date: Wed Feb 28 21:49:44 2018 New Revision: 330130 URL: https://svnweb.freebsd.org/changeset/base/330130 Log: MFC 328306: Remove some KSE references from ps(1). - Simplify the description of -H to assume 1:1 threading. - Drop 'process' from description of 'lwp' field and the corresponding XO field name. - Do add an expansion of LWP in the description of 'lwp' and 'nlwps'. - Add 'tid' as an alias for the 'lwp' field. Modified: stable/11/bin/ps/keyword.c stable/11/bin/ps/ps.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/ps/keyword.c ============================================================================== --- stable/11/bin/ps/keyword.c Wed Feb 28 21:41:52 2018 (r330129) +++ stable/11/bin/ps/keyword.c Wed Feb 28 21:49:44 2018 (r330130) @@ -120,7 +120,7 @@ static VAR var[] = { {"logname", "", "login", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"lstart", "STARTED", NULL, "start-time", LJUST|USER, lstarted, 0, CHAR, NULL, 0}, - {"lwp", "LWP", NULL, "process-thread-id", 0, kvar, KOFF(ki_tid), UINT, + {"lwp", "LWP", NULL, "thread-id", 0, kvar, KOFF(ki_tid), UINT, LWPFMT, 0}, {"majflt", "MAJFLT", NULL, "major-faults", USER, rvar, ROFF(ru_majflt), LONG, "ld", 0}, @@ -202,6 +202,7 @@ static VAR var[] = { {"tdnam", "", "tdname", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"tdname", "TDNAME", NULL, "thread-name", LJUST, tdnam, 0, CHAR, NULL, 0}, + {"tid", "", "lwp", NULL, 0, NULL, 0, CHAR, NULL, 0}, {"time", "TIME", NULL, "cpu-time", USER, cputime, 0, CHAR, NULL, 0}, {"tpgid", "TPGID", NULL, "terminal-process-gid", 0, kvar, KOFF(ki_tpgid), UINT, PIDFMT, 0}, Modified: stable/11/bin/ps/ps.1 ============================================================================== --- stable/11/bin/ps/ps.1 Wed Feb 28 21:41:52 2018 (r330129) +++ stable/11/bin/ps/ps.1 Wed Feb 28 21:49:44 2018 (r330130) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd October 9, 2017 +.Dd January 23, 2018 .Dt PS 1 .Os .Sh NAME @@ -148,12 +148,7 @@ This option is honored only if the UID of the user is Display information about processes which are running with the specified real group IDs. .It Fl H -Show all of the -.Em kernel visible -threads associated with each process. -Depending on the threading package that -is in use, this may show only the process, only the kernel scheduled entities, -or all of the process threads. +Show all of the threads associated with each process. .It Fl h Repeat the information header as often as necessary to guarantee one header per page of information. @@ -588,7 +583,8 @@ login name of user who started the session .It Cm lstart time started .It Cm lwp -process thread-id +thread (light-weight process) ID (alias +.Cm tid ) .It Cm majflt total page faults .It Cm minflt @@ -605,7 +601,7 @@ nice value (alias .It Cm nivcsw total involuntary context switches .It Cm nlwp -number of threads tied to a process +number of threads (light-weight processes) tied to a process .It Cm nsigs total signals taken (alias .Cm nsignals ) From owner-svn-src-stable-11@freebsd.org Wed Feb 28 22:33:08 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8609F29210; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C24F694B1; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@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 56FEB1FAB1; Wed, 28 Feb 2018 22:33:08 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SMX83F010884; Wed, 28 Feb 2018 22:33:08 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SMX8kN010883; Wed, 28 Feb 2018 22:33:08 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282233.w1SMX8kN010883@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 22:33:08 +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: r330132 - in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/amd64/amd64 11/sys/amd64/amd64 X-SVN-Commit-Revision: 330132 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.25 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, 28 Feb 2018 22:33:08 -0000 Author: jhb Date: Wed Feb 28 22:33:07 2018 New Revision: 330132 URL: https://svnweb.freebsd.org/changeset/base/330132 Log: MFC 328610: Ensure 'name' is not NULL before passing to strcmp(). This avoids a nested page fault when obtaining a stack trace in DDB if the address from the first frame does not resolve to a known symbol. Modified: stable/11/sys/amd64/amd64/db_trace.c Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/amd64/amd64/db_trace.c Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/11/sys/amd64/amd64/db_trace.c Wed Feb 28 21:51:51 2018 (r330131) +++ stable/11/sys/amd64/amd64/db_trace.c Wed Feb 28 22:33:07 2018 (r330132) @@ -336,7 +336,8 @@ db_backtrace(struct thread *td, struct trapframe *tf, /* Probably an assembler symbol. */ actframe = (void *)(tf->tf_rsp - 8); } - } else if (strcmp(name, "fork_trampoline") == 0) { + } else if (name != NULL && + strcmp(name, "fork_trampoline") == 0) { /* * Don't try to walk back on a stack for a * process that hasn't actually been run yet. From owner-svn-src-stable-11@freebsd.org Wed Feb 28 22:39:48 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 255D7F297D5; Wed, 28 Feb 2018 22:39:48 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB01A69897; Wed, 28 Feb 2018 22:39:47 +0000 (UTC) (envelope-from jhb@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 C5E1A1FAB3; Wed, 28 Feb 2018 22:39:47 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w1SMdlZA012031; Wed, 28 Feb 2018 22:39:47 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w1SMdl5O012030; Wed, 28 Feb 2018 22:39:47 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201802282239.w1SMdl5O012030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 28 Feb 2018 22:39:47 +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: r330133 - in stable: 10/lib/libc/gen 11/lib/libc/gen X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/lib/libc/gen 11/lib/libc/gen X-SVN-Commit-Revision: 330133 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.25 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, 28 Feb 2018 22:39:48 -0000 Author: jhb Date: Wed Feb 28 22:39:47 2018 New Revision: 330133 URL: https://svnweb.freebsd.org/changeset/base/330133 Log: MFC 328630: Clarify that the additional arguments to makecontext() are of type int. Modified: stable/11/lib/libc/gen/makecontext.3 Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/lib/libc/gen/makecontext.3 Directory Properties: stable/10/ (props changed) Modified: stable/11/lib/libc/gen/makecontext.3 ============================================================================== --- stable/11/lib/libc/gen/makecontext.3 Wed Feb 28 22:33:07 2018 (r330132) +++ stable/11/lib/libc/gen/makecontext.3 Wed Feb 28 22:39:47 2018 (r330133) @@ -35,7 +35,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 10, 2002 +.Dd January 31, 2018 .Dt MAKECONTEXT 3 .Os .Sh NAME @@ -68,11 +68,16 @@ with the arguments provided. The .Fa argc argument -must be equal to the number of additional arguments provided to +must be equal to the number of additional arguments of type +.Vt int +provided to .Fn makecontext -and also equal to the number of arguments to -.Fn func , -or else the behavior is undefined. +and also equal to the number of arguments of type +.Vt int +to +.Fn func ; +otherwise , +the behavior is undefined. .Pp The .Fa "ucp->uc_link" From owner-svn-src-stable-11@freebsd.org Thu Mar 1 03:05:01 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 89BF2F3C565; Thu, 1 Mar 2018 03:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3CC2D751C5; Thu, 1 Mar 2018 03:05:01 +0000 (UTC) (envelope-from eadler@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 3792D22998; Thu, 1 Mar 2018 03:05:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21351F1050289; Thu, 1 Mar 2018 03:05:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21351rQ050288; Thu, 1 Mar 2018 03:05:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010305.w21351rQ050288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 03:05: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: r330140 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330140 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.25 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, 01 Mar 2018 03:05:01 -0000 Author: eadler Date: Thu Mar 1 03:05:00 2018 New Revision: 330140 URL: https://svnweb.freebsd.org/changeset/base/330140 Log: MFC r314073: [iwm] Remove OpenBSD-specific comment. Beautify pci cfg space accesses. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 02:31:28 2018 (r330139) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 03:05:00 2018 (r330140) @@ -3091,11 +3091,6 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, if (--ring->queued < IWM_TX_RING_LOMARK) { sc->qfullmsk &= ~(1 << ring->qid); if (sc->qfullmsk == 0) { - /* - * Well, we're in interrupt context, but then again - * I guess net80211 does all sorts of stunts in - * interrupt context, so maybe this is no biggie. - */ iwm_start(sc); } } @@ -5598,6 +5593,9 @@ iwm_dev_check(device_t dev) } } +/* PCI registers */ +#define PCI_CFG_RETRY_TIMEOUT 0x041 + static int iwm_pci_attach(device_t dev) { @@ -5607,9 +5605,9 @@ iwm_pci_attach(device_t dev) sc = device_get_softc(dev); - /* Clear device-specific "PCI retry timeout" register (41h). */ - reg = pci_read_config(dev, 0x40, sizeof(reg)); - pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); + /* We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); /* Enable bus-mastering and hardware bug workaround. */ pci_enable_busmaster(dev); @@ -6071,11 +6069,12 @@ iwm_resume(device_t dev) { struct iwm_softc *sc = device_get_softc(dev); int do_reinit = 0; - uint16_t reg; - /* Clear device-specific "PCI retry timeout" register (41h). */ - reg = pci_read_config(dev, 0x40, sizeof(reg)); - pci_write_config(dev, 0x40, reg & ~0xff00, sizeof(reg)); + /* + * We disable the RETRY_TIMEOUT register (0x41) to keep + * PCI Tx retries from interfering with C3 CPU state. + */ + pci_write_config(dev, PCI_CFG_RETRY_TIMEOUT, 0x00, 1); iwm_init_task(device_get_softc(dev)); IWM_LOCK(sc); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:21:19 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86985F42765; Thu, 1 Mar 2018 04:21:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 38E447871E; Thu, 1 Mar 2018 04:21:19 +0000 (UTC) (envelope-from eadler@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 33B17236D6; Thu, 1 Mar 2018 04:21:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214LIBL085407; Thu, 1 Mar 2018 04:21:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214LIYF085406; Thu, 1 Mar 2018 04:21:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010421.w214LIYF085406@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:21: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: r330142 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330142 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.25 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, 01 Mar 2018 04:21:19 -0000 Author: eadler Date: Thu Mar 1 04:21:18 2018 New Revision: 330142 URL: https://svnweb.freebsd.org/changeset/base/330142 Log: MFC r304880: iwm: add 'command accepted' debug notification (copied from wpi(4)). Now it should be easier to find out which command causes firmware panics when few commands are sent in a short period of time. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:06:49 2018 (r330141) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:21:18 2018 (r330142) @@ -3115,6 +3115,11 @@ iwm_cmd_done(struct iwm_softc *sc, struct iwm_rx_packe return; /* Not a command ack. */ } + /* XXX wide commands? */ + IWM_DPRINTF(sc, IWM_DEBUG_CMD, + "cmd notification type 0x%x qid %d idx %d\n", + pkt->hdr.code, pkt->hdr.qid, pkt->hdr.idx); + data = &ring->data[pkt->hdr.idx]; /* If the command was mapped in an mbuf, free it. */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:23:52 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1C573F42B96; Thu, 1 Mar 2018 04:23:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8181789F5; Thu, 1 Mar 2018 04:23:51 +0000 (UTC) (envelope-from eadler@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 B164C23740; Thu, 1 Mar 2018 04:23:51 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214NpOm090105; Thu, 1 Mar 2018 04:23:51 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214NpXP090104; Thu, 1 Mar 2018 04:23:51 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010423.w214NpXP090104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:23: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: r330143 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330143 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.25 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, 01 Mar 2018 04:23:52 -0000 Author: eadler Date: Thu Mar 1 04:23:51 2018 New Revision: 330143 URL: https://svnweb.freebsd.org/changeset/base/330143 Log: MFC r304891: iwm: fix few comment typos. Modified: stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:21:18 2018 (r330142) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:23:51 2018 (r330143) @@ -3219,7 +3219,7 @@ enum iwm_sf_scenario { #define IWM_SF_SINGLE_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ #define IWM_SF_AGG_UNICAST_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_AGG_UNICAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ -#define IWM_SF_MCAST_IDLE_TIMER_DEF 160 /* 150 mSec */ +#define IWM_SF_MCAST_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_MCAST_AGING_TIMER_DEF 400 /* 0.4 mSec */ #define IWM_SF_BA_IDLE_TIMER_DEF 160 /* 150 uSec */ #define IWM_SF_BA_AGING_TIMER_DEF 400 /* 0.4 mSec */ @@ -3244,7 +3244,7 @@ enum iwm_sf_scenario { /** * Smart Fifo configuration command. - * @state: smart fifo state, types listed in iwm_sf_sate. + * @state: smart fifo state, types listed in iwm_sf_state. * @watermark: Minimum allowed available free space in RXF for transient state. * @long_delay_timeouts: aging and idle timer values for each scenario * in long delay state. From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:26:34 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 92FA3F42E29; Thu, 1 Mar 2018 04:26:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 426C378BB8; Thu, 1 Mar 2018 04:26:34 +0000 (UTC) (envelope-from eadler@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 3C8C523744; Thu, 1 Mar 2018 04:26:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214QYNs090256; Thu, 1 Mar 2018 04:26:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214QYJ6090255; Thu, 1 Mar 2018 04:26:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010426.w214QYJ6090255@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:26: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: r330144 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330144 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.25 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, 01 Mar 2018 04:26:34 -0000 Author: eadler Date: Thu Mar 1 04:26:33 2018 New Revision: 330144 URL: https://svnweb.freebsd.org/changeset/base/330144 Log: MFC r305917: [iwm] fix up RSSI calculations for both scan results and normal RX operations. * hard code a noise floor of -96 for now. The noise floor update * code returns some "interesting" values that I can't map to anything useful right now. * Ensure a default noise floor is set - otherwise the initial * scan results have a noise floor of '0'. * Fix up the RSSI calculation to be correctly relative * to the noise floor. The RSSI routines return an absolute value in dBm - so fix this up. * Cap RSSI values appropriately. * Ensure we pass in a 1/2 dB unit value in to * net80211. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:23:51 2018 (r330143) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:26:33 2018 (r330144) @@ -312,7 +312,8 @@ static int iwm_mvm_get_signal_strength(struct iwm_soft static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_rx_data *); -static int iwm_get_noise(const struct iwm_mvm_statistics_rx_non_phy *); +static int iwm_get_noise(struct iwm_softc *sc, + const struct iwm_mvm_statistics_rx_non_phy *); static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_rx_data *); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, @@ -2871,21 +2872,34 @@ iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, * Retrieve the average noise (in dBm) among receivers. */ static int -iwm_get_noise(const struct iwm_mvm_statistics_rx_non_phy *stats) +iwm_get_noise(struct iwm_softc *sc, + const struct iwm_mvm_statistics_rx_non_phy *stats) { int i, total, nbant, noise; total = nbant = noise = 0; for (i = 0; i < 3; i++) { noise = le32toh(stats->beacon_silence_rssi[i]) & 0xff; + IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: i=%d, noise=%d\n", + __func__, + i, + noise); + if (noise) { total += noise; nbant++; } } + IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: nbant=%d, total=%d\n", + __func__, nbant, total); +#if 0 /* There should be at least one antenna but check anyway. */ return (nbant == 0) ? -127 : (total / nbant) - 107; +#else + /* For now, just hard-code it to -96 to be safe */ + return (-96); +#endif } /* @@ -2940,9 +2954,16 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, } else { rssi = iwm_mvm_calc_rssi(sc, phy_info); } - rssi = (0 - IWM_MIN_DBM) + rssi; /* normalize */ - rssi = MIN(rssi, sc->sc_max_rssi); /* clip to max. 100% */ + /* Note: RSSI is absolute (ie a -ve value) */ + if (rssi < IWM_MIN_DBM) + rssi = IWM_MIN_DBM; + else if (rssi > IWM_MAX_DBM) + rssi = IWM_MAX_DBM; + + /* Map it to relative value */ + rssi = rssi - sc->sc_noise; + /* replenish ring for the buffer we're going to feed to the sharks */ if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", @@ -2950,6 +2971,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, return; } + IWM_DPRINTF(sc, IWM_DEBUG_RECV, + "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); + ni = ieee80211_find_rxnode(ic, (struct ieee80211_frame_min *)wh); IWM_DPRINTF(sc, IWM_DEBUG_RECV, @@ -2970,7 +2994,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, } else { rxs.c_freq = ieee80211_ieee2mhz(rxs.c_ieee, IEEE80211_CHAN_5GHZ); } - rxs.rssi = rssi - sc->sc_noise; + + /* rssi is in 1/2db units */ + rxs.rssi = rssi * 2; rxs.nf = sc->sc_noise; if (ieee80211_radiotap_active_vap(vap)) { @@ -5167,7 +5193,7 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_notif_statistics *stats; SYNC_RESP_STRUCT(stats, pkt); memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); - sc->sc_noise = iwm_get_noise(&stats->rx.general); + sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); break; } case IWM_NVM_ACCESS_CMD: @@ -5821,8 +5847,12 @@ iwm_attach(device_t dev) sc->sc_phyctxt[i].channel = NULL; } + /* Default noise floor */ + sc->sc_noise = -96; + /* Max RSSI */ sc->sc_max_rssi = IWM_MAX_DBM - IWM_MIN_DBM; + sc->sc_preinit_hook.ich_func = iwm_preinit; sc->sc_preinit_hook.ich_arg = sc; if (config_intrhook_establish(&sc->sc_preinit_hook) != 0) { From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:28:55 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E2882F4306A; Thu, 1 Mar 2018 04:28:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 96A6F78D7E; Thu, 1 Mar 2018 04:28:54 +0000 (UTC) (envelope-from eadler@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 9191D23747; Thu, 1 Mar 2018 04:28:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214Ss9g090389; Thu, 1 Mar 2018 04:28:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214SsnC090388; Thu, 1 Mar 2018 04:28:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010428.w214SsnC090388@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:28: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: r330145 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330145 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.25 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, 01 Mar 2018 04:28:55 -0000 Author: eadler Date: Thu Mar 1 04:28:54 2018 New Revision: 330145 URL: https://svnweb.freebsd.org/changeset/base/330145 Log: MFC r305999: [iwm] Use htole16 for policy field in struct iwm_time_event_cmd_v2. The htole32 was working fine for little-endian machines, but would have been broken on big-endian. Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 04:26:33 2018 (r330144) +++ stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 04:28:54 2018 (r330145) @@ -266,7 +266,7 @@ iwm_mvm_protect_session(struct iwm_softc *sc, struct i time_cmd.duration = htole32(duration); time_cmd.repeat = 1; time_cmd.policy - = htole32(IWM_TE_V2_NOTIF_HOST_EVENT_START | + = htole16(IWM_TE_V2_NOTIF_HOST_EVENT_START | IWM_TE_V2_NOTIF_HOST_EVENT_END | IWM_T2_V2_START_IMMEDIATELY); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:43:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 404D4F440D1; Thu, 1 Mar 2018 04:43:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E370279A30; Thu, 1 Mar 2018 04:43:52 +0000 (UTC) (envelope-from eadler@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 DE61023A7B; Thu, 1 Mar 2018 04:43:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214hqT4000416; Thu, 1 Mar 2018 04:43:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214hq3F000414; Thu, 1 Mar 2018 04:43:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010443.w214hq3F000414@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:43:52 +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: r330146 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330146 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.25 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, 01 Mar 2018 04:43:53 -0000 Author: eadler Date: Thu Mar 1 04:43:52 2018 New Revision: 330146 URL: https://svnweb.freebsd.org/changeset/base/330146 Log: MFC r306000 [iwm] Remove unused field from iwm_rx_data. Use uint32_t instead of enum type. The wantresp field in struct iwm_rx_data has never been used for anything, so we can just delete it. Apparently struct iwm_sf_cfg_cmd was compiled correctly (using a 32bit value to represent the enum), but it still seems like a very bad idea to use an enum type in a __packed struct. Modified: stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:28:54 2018 (r330145) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:43:52 2018 (r330146) @@ -3251,7 +3251,7 @@ enum iwm_sf_scenario { * @full_on_timeouts: timer values for each scenario in full on state. */ struct iwm_sf_cfg_cmd { - enum iwm_sf_state state; + uint32_t state; uint32_t watermark[IWM_SF_TRANSIENT_STATES_NUMBER]; uint32_t long_delay_timeouts[IWM_SF_NUM_SCENARIO][IWM_SF_NUM_TIMEOUT_TYPES]; uint32_t full_on_timeouts[IWM_SF_NUM_SCENARIO][IWM_SF_NUM_TIMEOUT_TYPES]; Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:28:54 2018 (r330145) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:43:52 2018 (r330146) @@ -275,7 +275,6 @@ struct iwm_tx_ring { struct iwm_rx_data { struct mbuf *m; bus_dmamap_t map; - int wantresp; }; struct iwm_rx_ring { From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:46:59 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F269F444A1; Thu, 1 Mar 2018 04:46:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E65BC79D7B; Thu, 1 Mar 2018 04:46:58 +0000 (UTC) (envelope-from eadler@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 E0A0723A83; Thu, 1 Mar 2018 04:46:58 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214kw07000655; Thu, 1 Mar 2018 04:46:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214kwK9000654; Thu, 1 Mar 2018 04:46:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010446.w214kwK9000654@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:46:58 +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: r330148 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330148 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.25 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, 01 Mar 2018 04:46:59 -0000 Author: eadler Date: Thu Mar 1 04:46:58 2018 New Revision: 330148 URL: https://svnweb.freebsd.org/changeset/base/330148 Log: MFC r306001 [iwm] Fix off-by-one check in iwm_read_firmware(). This fixes a potential buffer overrun in the firmware parsing code. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:44:17 2018 (r330147) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:46:58 2018 (r330148) @@ -739,7 +739,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode } capa = (const struct iwm_ucode_capa *)tlv_data; idx = le32toh(capa->api_index); - if (idx > howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { + if (idx >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { device_printf(sc->sc_dev, "unsupported API index %d\n", idx); goto parse_out; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:49:43 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4BA73F4475D; Thu, 1 Mar 2018 04:49:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F36DD79F68; Thu, 1 Mar 2018 04:49:42 +0000 (UTC) (envelope-from eadler@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 EE74D23A8A; Thu, 1 Mar 2018 04:49:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214ngK2000806; Thu, 1 Mar 2018 04:49:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214ngvO000805; Thu, 1 Mar 2018 04:49:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010449.w214ngvO000805@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:49: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: r330149 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330149 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.25 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, 01 Mar 2018 04:49:43 -0000 Author: eadler Date: Thu Mar 1 04:49:42 2018 New Revision: 330149 URL: https://svnweb.freebsd.org/changeset/base/330149 Log: MFC r306002 [iwm] Fix iwm_poll_bit() error value check in iwm_attach(). The iwm(4) iwm_poll_bit() function returns 1 on success, and 0 on failure, whereas the iwl_poll_bit() in Linux iwlwifi returns < 0 on failure. So the (ret < 0) check ended up ignoring any error returned by iwm_poll_bit(). Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:46:58 2018 (r330148) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:49:42 2018 (r330149) @@ -5760,7 +5760,7 @@ iwm_attach(device_t dev) IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); - if (ret < 0) { + if (!ret) { device_printf(sc->sc_dev, "Failed to wake up the nic\n"); goto fail; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:50:43 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2F945F448AF; Thu, 1 Mar 2018 04:50:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D23017A0E0; Thu, 1 Mar 2018 04:50:42 +0000 (UTC) (envelope-from eadler@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 B418723A9B; Thu, 1 Mar 2018 04:50:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214ogQt000918; Thu, 1 Mar 2018 04:50:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214oglu000917; Thu, 1 Mar 2018 04:50:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010450.w214oglu000917@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:50: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: r330150 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330150 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.25 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, 01 Mar 2018 04:50:43 -0000 Author: eadler Date: Thu Mar 1 04:50:42 2018 New Revision: 330150 URL: https://svnweb.freebsd.org/changeset/base/330150 Log: MFC r30600 [iwm] Remove wrappers around iwm_dma_contig_free() calls. No functional changes. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:49:42 2018 (r330149) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:50:42 2018 (r330150) @@ -234,13 +234,9 @@ static int iwm_dma_contig_alloc(bus_dma_tag_t, struct bus_size_t, bus_size_t); static void iwm_dma_contig_free(struct iwm_dma_info *); static int iwm_alloc_fwmem(struct iwm_softc *); -static void iwm_free_fwmem(struct iwm_softc *); static int iwm_alloc_sched(struct iwm_softc *); -static void iwm_free_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); -static void iwm_free_kw(struct iwm_softc *); static int iwm_alloc_ict(struct iwm_softc *); -static void iwm_free_ict(struct iwm_softc *); static int iwm_alloc_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static void iwm_disable_rx_dma(struct iwm_softc *); static void iwm_reset_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); @@ -902,12 +898,6 @@ iwm_alloc_fwmem(struct iwm_softc *sc) sc->sc_fwdmasegsz, 16); } -static void -iwm_free_fwmem(struct iwm_softc *sc) -{ - iwm_dma_contig_free(&sc->fw_dma); -} - /* tx scheduler rings. not used? */ static int iwm_alloc_sched(struct iwm_softc *sc) @@ -917,12 +907,6 @@ iwm_alloc_sched(struct iwm_softc *sc) nitems(sc->txq) * sizeof(struct iwm_agn_scd_bc_tbl), 1024); } -static void -iwm_free_sched(struct iwm_softc *sc) -{ - iwm_dma_contig_free(&sc->sched_dma); -} - /* keep-warm page is used internally by the card. see iwl-fh.h for more info */ static int iwm_alloc_kw(struct iwm_softc *sc) @@ -930,12 +914,6 @@ iwm_alloc_kw(struct iwm_softc *sc) return iwm_dma_contig_alloc(sc->sc_dmat, &sc->kw_dma, 4096, 4096); } -static void -iwm_free_kw(struct iwm_softc *sc) -{ - iwm_dma_contig_free(&sc->kw_dma); -} - /* interrupt cause table */ static int iwm_alloc_ict(struct iwm_softc *sc) @@ -944,12 +922,6 @@ iwm_alloc_ict(struct iwm_softc *sc) IWM_ICT_SIZE, 1<ict_dma); -} - static int iwm_alloc_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) { @@ -6173,13 +6145,10 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 iwm_fw_info_free(fw); /* Free scheduler */ - iwm_free_sched(sc); - if (sc->ict_dma.vaddr != NULL) - iwm_free_ict(sc); - if (sc->kw_dma.vaddr != NULL) - iwm_free_kw(sc); - if (sc->fw_dma.vaddr != NULL) - iwm_free_fwmem(sc); + iwm_dma_contig_free(&sc->sched_dma); + iwm_dma_contig_free(&sc->ict_dma); + iwm_dma_contig_free(&sc->kw_dma); + iwm_dma_contig_free(&sc->fw_dma); /* Finished with the hardware - detach things */ iwm_pci_detach(dev); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:52:24 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B14E6F44BFD; Thu, 1 Mar 2018 04:52:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 637217A4B6; Thu, 1 Mar 2018 04:52:24 +0000 (UTC) (envelope-from eadler@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 5DC6E23C26; Thu, 1 Mar 2018 04:52:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214qOLQ005599; Thu, 1 Mar 2018 04:52:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214qOJN005597; Thu, 1 Mar 2018 04:52:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010452.w214qOJN005597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:52:24 +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: r330151 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330151 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.25 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, 01 Mar 2018 04:52:25 -0000 Author: eadler Date: Thu Mar 1 04:52:23 2018 New Revision: 330151 URL: https://svnweb.freebsd.org/changeset/base/330151 Log: MFC r306004: [iwm] Remove deprecated scan API definitions. * This removes deprecated scan API definitions, which have been unused since the upgrade to version 16 firmware in change r303327. * Part of this change matches the header-file changes in Linux git commit 1f9403863c080478ad78247c89b018e95bdfb027. * No functional change. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:50:42 2018 (r330150) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:52:23 2018 (r330151) @@ -5202,7 +5202,6 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_PHY_CONTEXT_CMD: case IWM_BINDING_CONTEXT_CMD: case IWM_TIME_EVENT_CMD: - case IWM_SCAN_REQUEST_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): case IWM_SCAN_OFFLOAD_REQUEST_CMD: Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:50:42 2018 (r330150) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:52:23 2018 (r330151) @@ -1839,11 +1839,9 @@ enum { IWM_REPLY_THERMAL_MNG_BACKOFF = 0x7e, /* Scanning */ - IWM_SCAN_REQUEST_CMD = 0x80, IWM_SCAN_ABORT_CMD = 0x81, IWM_SCAN_START_NOTIFICATION = 0x82, IWM_SCAN_RESULTS_NOTIFICATION = 0x83, - IWM_SCAN_COMPLETE_NOTIFICATION = 0x84, /* NVM */ IWM_NVM_ACCESS_CMD = 0x88, @@ -4767,53 +4765,11 @@ struct iwm_scd_txq_cfg_rsp { /* Masks for iwm_scan_channel.type flags */ #define IWM_SCAN_CHANNEL_TYPE_ACTIVE (1 << 0) #define IWM_SCAN_CHANNEL_NSSIDS(x) (((1 << (x)) - 1) << 1) -#define IWM_SCAN_CHANNEL_NARROW_BAND (1 << 22) /* Max number of IEs for direct SSID scans in a command */ #define IWM_PROBE_OPTION_MAX 20 /** - * struct iwm_scan_channel - entry in IWM_REPLY_SCAN_CMD channel table - * @channel: band is selected by iwm_scan_cmd "flags" field - * @tx_gain: gain for analog radio - * @dsp_atten: gain for DSP - * @active_dwell: dwell time for active scan in TU, typically 5-50 - * @passive_dwell: dwell time for passive scan in TU, typically 20-500 - * @type: type is broken down to these bits: - * bit 0: 0 = passive, 1 = active - * bits 1-20: SSID direct bit map. If any of these bits is set then - * the corresponding SSID IE is transmitted in probe request - * (bit i adds IE in position i to the probe request) - * bit 22: channel width, 0 = regular, 1 = TGj narrow channel - * - * @iteration_count: - * @iteration_interval: - * This struct is used once for each channel in the scan list. - * Each channel can independently select: - * 1) SSID for directed active scans - * 2) Txpower setting (for rate specified within Tx command) - * 3) How long to stay on-channel (behavior may be modified by quiet_time, - * quiet_plcp_th, good_CRC_th) - * - * To avoid uCode errors, make sure the following are true (see comments - * under struct iwm_scan_cmd about max_out_time and quiet_time): - * 1) If using passive_dwell (i.e. passive_dwell != 0): - * active_dwell <= passive_dwell (< max_out_time if max_out_time != 0) - * 2) quiet_time <= active_dwell - * 3) If restricting off-channel time (i.e. max_out_time !=0): - * passive_dwell < max_out_time - * active_dwell < max_out_time - */ -struct iwm_scan_channel { - uint32_t type; - uint16_t channel; - uint16_t iteration_count; - uint32_t iteration_interval; - uint16_t active_dwell; - uint16_t passive_dwell; -} __packed; /* IWM_SCAN_CHANNEL_CONTROL_API_S_VER_1 */ - -/** * struct iwm_ssid_ie - directed scan network information element * * Up to 20 of these may appear in IWM_REPLY_SCAN_CMD, @@ -4828,7 +4784,6 @@ struct iwm_ssid_ie { } __packed; /* IWM_SCAN_DIRECT_SSID_IE_API_S_VER_1 */ /* scan offload */ -#define IWM_MAX_SCAN_CHANNELS 40 #define IWM_SCAN_MAX_BLACKLIST_LEN 64 #define IWM_SCAN_SHORT_BLACKLIST_LEN 16 #define IWM_SCAN_MAX_PROFILES 11 @@ -4844,45 +4799,6 @@ struct iwm_ssid_ie { #define IWM_FAST_SCHED_SCAN_ITERATIONS 3 #define IWM_MAX_SCHED_SCAN_PLANS 2 -/** - * iwm_scan_flags - masks for scan command flags - *@IWM_SCAN_FLAGS_PERIODIC_SCAN: - *@IWM_SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX: - *@IWM_SCAN_FLAGS_DELAYED_SCAN_LOWBAND: - *@IWM_SCAN_FLAGS_DELAYED_SCAN_HIGHBAND: - *@IWM_SCAN_FLAGS_FRAGMENTED_SCAN: - *@IWM_SCAN_FLAGS_PASSIVE2ACTIVE: use active scan on channels that was active - * in the past hour, even if they are marked as passive. - */ -enum iwm_scan_flags { - IWM_SCAN_FLAGS_PERIODIC_SCAN = (1 << 0), - IWM_SCAN_FLAGS_P2P_PUBLIC_ACTION_FRAME_TX = (1 << 1), - IWM_SCAN_FLAGS_DELAYED_SCAN_LOWBAND = (1 << 2), - IWM_SCAN_FLAGS_DELAYED_SCAN_HIGHBAND = (1 << 3), - IWM_SCAN_FLAGS_FRAGMENTED_SCAN = (1 << 4), - IWM_SCAN_FLAGS_PASSIVE2ACTIVE = (1 << 5), -}; - -/** - * enum iwm_scan_type - Scan types for scan command - * @IWM_SCAN_TYPE_FORCED: - * @IWM_SCAN_TYPE_BACKGROUND: - * @IWM_SCAN_TYPE_OS: - * @IWM_SCAN_TYPE_ROAMING: - * @IWM_SCAN_TYPE_ACTION: - * @IWM_SCAN_TYPE_DISCOVERY: - * @IWM_SCAN_TYPE_DISCOVERY_FORCED: - */ -enum iwm_scan_type { - IWM_SCAN_TYPE_FORCED = 0, - IWM_SCAN_TYPE_BACKGROUND = 1, - IWM_SCAN_TYPE_OS = 2, - IWM_SCAN_TYPE_ROAMING = 3, - IWM_SCAN_TYPE_ACTION = 4, - IWM_SCAN_TYPE_DISCOVERY = 5, - IWM_SCAN_TYPE_DISCOVERY_FORCED = 6, -}; /* IWM_SCAN_ACTIVITY_TYPE_E_VER_1 */ - /* Maximal number of channels to scan */ #define IWM_MAX_NUM_SCAN_CHANNELS 0x24 @@ -5076,52 +4992,6 @@ struct iwm_periodic_scan_complete { uint32_t reserved; } __packed; -/* Response to scan request contains only status with one of these values */ -#define IWM_SCAN_RESPONSE_OK 0x1 -#define IWM_SCAN_RESPONSE_ERROR 0x2 - -/* - * IWM_SCAN_ABORT_CMD = 0x81 - * When scan abort is requested, the command has no fields except the common - * header. The response contains only a status with one of these values. - */ -#define IWM_SCAN_ABORT_POSSIBLE 0x1 -#define IWM_SCAN_ABORT_IGNORED 0x2 /* no pending scans */ - -/* TODO: complete documentation */ -#define IWM_SCAN_OWNER_STATUS 0x1 -#define IWM_MEASURE_OWNER_STATUS 0x2 - -/** - * struct iwm_scan_start_notif - notifies start of scan in the device - * ( IWM_SCAN_START_NOTIFICATION = 0x82 ) - * @tsf_low: TSF timer (lower half) in usecs - * @tsf_high: TSF timer (higher half) in usecs - * @beacon_timer: structured as follows: - * bits 0:19 - beacon interval in usecs - * bits 20:23 - reserved (0) - * bits 24:31 - number of beacons - * @channel: which channel is scanned - * @band: 0 for 5.2 GHz, 1 for 2.4 GHz - * @status: one of *_OWNER_STATUS - */ -struct iwm_scan_start_notif { - uint32_t tsf_low; - uint32_t tsf_high; - uint32_t beacon_timer; - uint8_t channel; - uint8_t band; - uint8_t reserved[2]; - uint32_t status; -} __packed; /* IWM_SCAN_START_NTF_API_S_VER_1 */ - -/* scan results probe_status first bit indicates success */ -#define IWM_SCAN_PROBE_STATUS_OK 0 -#define IWM_SCAN_PROBE_STATUS_TX_FAILED (1 << 0) -/* error statuses combined with TX_FAILED */ -#define IWM_SCAN_PROBE_STATUS_FAIL_TTL (1 << 1) -#define IWM_SCAN_PROBE_STATUS_FAIL_BT (1 << 2) - /* How many statistics are gathered for each channel */ #define IWM_SCAN_RESULTS_STATISTICS 1 @@ -5176,27 +5046,6 @@ struct iwm_scan_results_notif { uint32_t statistics[IWM_SCAN_RESULTS_STATISTICS]; } __packed; /* IWM_SCAN_RESULT_NTF_API_S_VER_2 */ -/** - * struct iwm_scan_complete_notif - notifies end of scanning (all channels) - * ( IWM_SCAN_COMPLETE_NOTIFICATION = 0x84 ) - * @scanned_channels: number of channels scanned (and number of valid results) - * @status: one of IWM_SCAN_COMP_STATUS_* - * @bt_status: BT on/off status - * @last_channel: last channel that was scanned - * @tsf_low: TSF timer (lower half) in usecs - * @tsf_high: TSF timer (higher half) in usecs - * @results: all scan results, only "scanned_channels" of them are valid - */ -struct iwm_scan_complete_notif { - uint8_t scanned_channels; - uint8_t status; - uint8_t bt_status; - uint8_t last_channel; - uint32_t tsf_low; - uint32_t tsf_high; - struct iwm_scan_results_notif results[IWM_MAX_NUM_SCAN_CHANNELS]; -} __packed; /* IWM_SCAN_COMPLETE_NTF_API_S_VER_2 */ - enum iwm_scan_framework_client { IWM_SCAN_CLIENT_SCHED_SCAN = (1 << 0), IWM_SCAN_CLIENT_NETDETECT = (1 << 1), @@ -5204,83 +5053,6 @@ enum iwm_scan_framework_client { }; /** - * struct iwm_scan_offload_cmd - IWM_SCAN_REQUEST_FIXED_PART_API_S_VER_6 - * @scan_flags: see enum iwm_scan_flags - * @channel_count: channels in channel list - * @quiet_time: dwell time, in milisiconds, on quiet channel - * @quiet_plcp_th: quiet channel num of packets threshold - * @good_CRC_th: passive to active promotion threshold - * @rx_chain: RXON rx chain. - * @max_out_time: max uSec to be out of assoceated channel - * @suspend_time: pause scan this long when returning to service channel - * @flags: RXON flags - * @filter_flags: RXONfilter - * @tx_cmd: tx command for active scan; for 2GHz and for 5GHz. - * @direct_scan: list of SSIDs for directed active scan - * @scan_type: see enum iwm_scan_type. - * @rep_count: repetition count for each scheduled scan iteration. - */ -struct iwm_scan_offload_cmd { - uint16_t len; - uint8_t scan_flags; - uint8_t channel_count; - uint16_t quiet_time; - uint16_t quiet_plcp_th; - uint16_t good_CRC_th; - uint16_t rx_chain; - uint32_t max_out_time; - uint32_t suspend_time; - /* IWM_RX_ON_FLAGS_API_S_VER_1 */ - uint32_t flags; - uint32_t filter_flags; - struct iwm_tx_cmd tx_cmd[2]; - /* IWM_SCAN_DIRECT_SSID_IE_API_S_VER_1 */ - struct iwm_ssid_ie direct_scan[IWM_PROBE_OPTION_MAX]; - uint32_t scan_type; - uint32_t rep_count; -} __packed; - -enum iwm_scan_offload_channel_flags { - IWM_SCAN_OFFLOAD_CHANNEL_ACTIVE = (1 << 0), - IWM_SCAN_OFFLOAD_CHANNEL_NARROW = (1 << 22), - IWM_SCAN_OFFLOAD_CHANNEL_FULL = (1 << 24), - IWM_SCAN_OFFLOAD_CHANNEL_PARTIAL = (1 << 25), -}; - -/** - * iwm_scan_channel_cfg - IWM_SCAN_CHANNEL_CFG_S - * @type: bitmap - see enum iwm_scan_offload_channel_flags. - * 0: passive (0) or active (1) scan. - * 1-20: directed scan to i'th ssid. - * 22: channel width configuation - 1 for narrow. - * 24: full scan. - * 25: partial scan. - * @channel_number: channel number 1-13 etc. - * @iter_count: repetition count for the channel. - * @iter_interval: interval between two innteration on one channel. - * @dwell_time: entry 0 - active scan, entry 1 - passive scan. - */ -struct iwm_scan_channel_cfg { - uint32_t type[IWM_MAX_SCAN_CHANNELS]; - uint16_t channel_number[IWM_MAX_SCAN_CHANNELS]; - uint16_t iter_count[IWM_MAX_SCAN_CHANNELS]; - uint32_t iter_interval[IWM_MAX_SCAN_CHANNELS]; - uint8_t dwell_time[IWM_MAX_SCAN_CHANNELS][2]; -} __packed; - -/** - * iwm_scan_offload_cfg - IWM_SCAN_OFFLOAD_CONFIG_API_S - * @scan_cmd: scan command fixed part - * @channel_cfg: scan channel configuration - * @data: probe request frames (one per band) - */ -struct iwm_scan_offload_cfg { - struct iwm_scan_offload_cmd scan_cmd; - struct iwm_scan_channel_cfg channel_cfg; - uint8_t data[0]; -} __packed; - -/** * iwm_scan_offload_blacklist - IWM_SCAN_OFFLOAD_BLACKLIST_S * @ssid: MAC address to filter out * @reported_rssi: AP rssi reported to the host @@ -5345,48 +5117,7 @@ struct iwm_scan_offload_profile_cfg { uint8_t reserved[2]; } __packed; -/** - * iwm_scan_offload_schedule - schedule of scan offload - * @delay: delay between iterations, in seconds. - * @iterations: num of scan iterations - * @full_scan_mul: number of partial scans before each full scan - */ -struct iwm_scan_offload_schedule { - uint16_t delay; - uint8_t iterations; - uint8_t full_scan_mul; -} __packed; - -/* - * iwm_scan_offload_flags - * - * IWM_SCAN_OFFLOAD_FLAG_PASS_ALL: pass all results - no filtering. - * IWM_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL: add cached channels to partial scan. - * IWM_SCAN_OFFLOAD_FLAG_ENERGY_SCAN: use energy based scan before partial scan - * on A band. - */ -enum iwm_scan_offload_flags { - IWM_SCAN_OFFLOAD_FLAG_PASS_ALL = (1 << 0), - IWM_SCAN_OFFLOAD_FLAG_CACHED_CHANNEL = (1 << 2), - IWM_SCAN_OFFLOAD_FLAG_ENERGY_SCAN = (1 << 3), -}; - -/** - * iwm_scan_offload_req - scan offload request command - * @flags: bitmap - enum iwm_scan_offload_flags. - * @watchdog: maximum scan duration in TU. - * @delay: delay in seconds before first iteration. - * @schedule_line: scan offload schedule, for fast and regular scan. - */ -struct iwm_scan_offload_req { - uint16_t flags; - uint16_t watchdog; - uint16_t delay; - uint16_t reserved; - struct iwm_scan_offload_schedule schedule_line[2]; -} __packed; - -enum iwm_scan_offload_compleate_status { +enum iwm_scan_offload_complete_status { IWM_SCAN_OFFLOAD_COMPLETED = 1, IWM_SCAN_OFFLOAD_ABORTED = 2, }; @@ -5412,30 +5143,6 @@ struct iwm_lmac_scan_complete_notif { struct iwm_scan_results_notif results[]; } __packed; - -/** - * iwm_scan_offload_complete - IWM_SCAN_OFFLOAD_COMPLETE_NTF_API_S_VER_1 - * @last_schedule_line: last schedule line executed (fast or regular) - * @last_schedule_iteration: last scan iteration executed before scan abort - * @status: enum iwm_scan_offload_compleate_status - */ -struct iwm_scan_offload_complete { - uint8_t last_schedule_line; - uint8_t last_schedule_iteration; - uint8_t status; - uint8_t reserved; -} __packed; - -/** - * iwm_sched_scan_results - IWM_SCAN_OFFLOAD_MATCH_FOUND_NTF_API_S_VER_1 - * @ssid_bitmap: SSIDs indexes found in this iteration - * @client_bitmap: clients that are active and wait for this notification - */ -struct iwm_sched_scan_results { - uint16_t ssid_bitmap; - uint8_t client_bitmap; - uint8_t reserved; -}; /* * END mvm/fw-api-scan.h From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:53:55 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6376EF44D8D; Thu, 1 Mar 2018 04:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 15B1D7A653; Thu, 1 Mar 2018 04:53:55 +0000 (UTC) (envelope-from eadler@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 0F47B23C35; Thu, 1 Mar 2018 04:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214rs9I005690; Thu, 1 Mar 2018 04:53:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214rsVa005688; Thu, 1 Mar 2018 04:53:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010453.w214rsVa005688@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:53: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: r330152 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330152 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.25 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, 01 Mar 2018 04:53:55 -0000 Author: eadler Date: Thu Mar 1 04:53:54 2018 New Revision: 330152 URL: https://svnweb.freebsd.org/changeset/base/330152 Log: MFC r306005: [iwm] Use IWM_DEFAULT_SCAN_CHANNELS define as default for sc_capa_n_scan_channels. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:52:23 2018 (r330151) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:53:54 2018 (r330152) @@ -442,6 +442,8 @@ iwm_firmware_store_section(struct iwm_softc *sc, return 0; } +#define IWM_DEFAULT_SCAN_CHANNELS 40 + /* iwlwifi: iwl-drv.c */ struct iwm_tlv_calib_data { uint32_t ucode_type; @@ -518,7 +520,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode /* (Re-)Initialize default values. */ sc->sc_capaflags = 0; - sc->sc_capa_n_scan_channels = IWM_MAX_NUM_SCAN_CHANNELS; + sc->sc_capa_n_scan_channels = IWM_DEFAULT_SCAN_CHANNELS; memset(sc->sc_enabled_capa, 0, sizeof(sc->sc_enabled_capa)); memset(sc->sc_fw_mcc, 0, sizeof(sc->sc_fw_mcc)); Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:52:23 2018 (r330151) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 04:53:54 2018 (r330152) @@ -4799,9 +4799,6 @@ struct iwm_ssid_ie { #define IWM_FAST_SCHED_SCAN_ITERATIONS 3 #define IWM_MAX_SCHED_SCAN_PLANS 2 -/* Maximal number of channels to scan */ -#define IWM_MAX_NUM_SCAN_CHANNELS 0x24 - /** * iwm_scan_schedule_lmac - schedule of scan offload * @delay: delay between iterations, in seconds. From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:55:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C7B95F44E95; Thu, 1 Mar 2018 04:55:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7D2587A79F; Thu, 1 Mar 2018 04:55:00 +0000 (UTC) (envelope-from eadler@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 780ED23C37; Thu, 1 Mar 2018 04:55:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214t0XO005811; Thu, 1 Mar 2018 04:55:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214t0e6005809; Thu, 1 Mar 2018 04:55:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010455.w214t0e6005809@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:55: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: r330153 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330153 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.25 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, 01 Mar 2018 04:55:01 -0000 Author: eadler Date: Thu Mar 1 04:55:00 2018 New Revision: 330153 URL: https://svnweb.freebsd.org/changeset/base/330153 Log: MFC r306005: [iwm] Remove dead fw_totlen from struct iwm_fw_sects; clean up struct iwm_nvm_data. * No functional change, none of these values were ever read. * The values removed from struct iwm_nvm_data are only used for old dvm devices in Linux iwlwifi, and irrelevant to iwm hence. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:53:54 2018 (r330152) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:55:00 2018 (r330153) @@ -437,7 +437,6 @@ iwm_firmware_store_section(struct iwm_softc *sc, fwone->fws_len = dlen - sizeof(uint32_t); fws->fw_count++; - fws->fw_totlen += fwone->fws_len; return 0; } @@ -2151,11 +2150,6 @@ iwm_parse_nvm_data(struct iwm_softc *sc, memcpy(data->nvm_ch_flags, ®ulatory[IWM_NVM_CHANNELS_8000], IWM_NUM_CHANNELS_8000 * sizeof(uint16_t)); } - data->calib_version = 255; /* TODO: - this value will prevent some checks from - failing, we need to check if this - field is still needed, and if it does, - where is it in the NVM */ return 0; } Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:53:54 2018 (r330152) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 04:55:00 2018 (r330153) @@ -170,7 +170,6 @@ struct iwm_fw_info { uint32_t fws_len; uint32_t fws_devoff; } fw_sect[IWM_UCODE_SECT_MAX]; - size_t fw_totlen; int fw_count; } fw_sects[IWM_UCODE_TYPE_MAX]; }; @@ -178,14 +177,6 @@ struct iwm_fw_info { struct iwm_nvm_data { int n_hw_addrs; uint8_t hw_addr[IEEE80211_ADDR_LEN]; - - uint8_t calib_version; - uint16_t calib_voltage; - - uint16_t raw_temperature; - uint16_t kelvin_temperature; - uint16_t kelvin_voltage; - uint16_t xtal_calib[2]; int sku_cap_band_24GHz_enable; int sku_cap_band_52GHz_enable; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:56:50 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D79B1F0E0D9; Thu, 1 Mar 2018 04:56:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 889217A948; Thu, 1 Mar 2018 04:56:49 +0000 (UTC) (envelope-from eadler@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 830EC23C3B; Thu, 1 Mar 2018 04:56:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214un9J005911; Thu, 1 Mar 2018 04:56:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214unx3005910; Thu, 1 Mar 2018 04:56:49 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010456.w214unx3005910@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:56: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: r330154 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330154 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.25 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, 01 Mar 2018 04:56:50 -0000 Author: eadler Date: Thu Mar 1 04:56:49 2018 New Revision: 330154 URL: https://svnweb.freebsd.org/changeset/base/330154 Log: MFC r306007: [iwm] Improve reliability of iwm_release on disassociation a bit. * We need to first call ivp->iv_newstate(), to enqueue the deauth/deassoc mgmt frame, then flush the tx queue, before actually calling iwm_release(). * cycling a wlan connection via wpa_cli frontend to wpa_supplicant, by issuing disconnect and reconnect commandos works quite well. (There is still an issue when disconnecting/reconnecting too quickly) * Reassociating or roaming via wpa_supplicant is still broken. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:55:00 2018 (r330153) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:56:49 2018 (r330154) @@ -329,6 +329,8 @@ static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); +static int iwm_mvm_flush_tx_path(struct iwm_softc *sc, + uint32_t tfd_msk, uint32_t flags); static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, struct iwm_mvm_add_sta_cmd_v7 *, int *); @@ -3512,7 +3514,6 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m * mvm/tx.c */ -#if 0 /* * Note that there are transports that buffer frames before they reach * the firmware. This means that after flush_tx_path is called, the @@ -3522,23 +3523,21 @@ iwm_raw_xmit(struct ieee80211_node *ni, struct mbuf *m * 3) wait for the transport queues to be empty */ int -iwm_mvm_flush_tx_path(struct iwm_softc *sc, int tfd_msk, int sync) +iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags) { + int ret; struct iwm_tx_path_flush_cmd flush_cmd = { .queues_ctl = htole32(tfd_msk), .flush_ctl = htole16(IWM_DUMP_TX_FIFO_FLUSH), }; - int ret; - ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, - sync ? IWM_CMD_SYNC : IWM_CMD_ASYNC, + ret = iwm_mvm_send_cmd_pdu(sc, IWM_TXPATH_FLUSH, flags, sizeof(flush_cmd), &flush_cmd); if (ret) device_printf(sc->sc_dev, "Flushing tx queue failed: %d\n", ret); return ret; } -#endif /* * BEGIN mvm/sta.c @@ -3894,6 +3893,8 @@ iwm_assoc(struct ieee80211vap *vap, struct iwm_softc * static int iwm_release(struct iwm_softc *sc, struct iwm_node *in) { + uint32_t tfd_msk; + /* * Ok, so *technically* the proper set of calls for going * from RUN back to SCAN is: @@ -3913,7 +3914,18 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * back to nothing anyway, we'll just do a complete device reset. * Up your's, device! */ - /* iwm_mvm_flush_tx_path(sc, 0xf, 1); */ + /* + * Just using 0xf for the queues mask is fine as long as we only + * get here from RUN state. + */ + tfd_msk = 0xf; + mbufq_drain(&sc->sc_snd); + iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); + /* + * We seem to get away with just synchronously sending the + * IWM_TXPATH_FLUSH command. + */ +// iwm_trans_wait_tx_queue_empty(sc, tfd_msk); iwm_stop_device(sc); iwm_init_hw(sc); if (in) @@ -4120,7 +4132,17 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ if (((in = IWM_NODE(vap->iv_bss)) != NULL)) in->in_assoc = 0; - iwm_release(sc, NULL); + if (nstate == IEEE80211_S_INIT) { + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + error = ivp->iv_newstate(vap, nstate, arg); + IEEE80211_UNLOCK(ic); + IWM_LOCK(sc); + iwm_release(sc, NULL); + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return error; + } /* * It's impossible to directly go RUN->SCAN. If we iwm_release() From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:58:01 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8CF3FF0E290; Thu, 1 Mar 2018 04:58:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 403837AABD; Thu, 1 Mar 2018 04:58:01 +0000 (UTC) (envelope-from eadler@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 3B26323C3C; Thu, 1 Mar 2018 04:58:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214w1HS005994; Thu, 1 Mar 2018 04:58:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214w1Jp005993; Thu, 1 Mar 2018 04:58:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010458.w214w1Jp005993@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:58: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: r330155 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330155 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.25 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, 01 Mar 2018 04:58:01 -0000 Author: eadler Date: Thu Mar 1 04:58:00 2018 New Revision: 330155 URL: https://svnweb.freebsd.org/changeset/base/330155 Log: MFC r306142: [iwm] use rate control info from the node txrates; use mgmtrate for EAPOL frames This changes the transmit rate control code to do a few things: * use fixed rates (mcast, ucast, mgmt) where required. * Don't use a hard-coded 11a or 11bg rate for non-data frames - use what net80211 says we should use. * use mgmtrate for EAPOL frames. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:56:49 2018 (r330154) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:58:00 2018 (r330155) @@ -324,7 +324,7 @@ static void iwm_update_sched(struct iwm_softc *, int, #endif static const struct iwm_rate * iwm_tx_fill_cmd(struct iwm_softc *, struct iwm_node *, - struct ieee80211_frame *, struct iwm_tx_cmd *); + struct mbuf *, struct iwm_tx_cmd *); static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, @@ -3192,24 +3192,36 @@ iwm_tx_rateidx_lookup(struct iwm_softc *sc, struct iwm */ static const struct iwm_rate * iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node *in, - struct ieee80211_frame *wh, struct iwm_tx_cmd *tx) + struct mbuf *m, struct iwm_tx_cmd *tx) { - struct ieee80211com *ic = &sc->sc_ic; struct ieee80211_node *ni = &in->in_ni; + struct ieee80211_frame *wh; + const struct ieee80211_txparam *tp = ni->ni_txparms; const struct iwm_rate *rinfo; - int type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; - int ridx, rate_flags; + int type; + int ridx, rate_flags, i; + wh = mtod(m, struct ieee80211_frame *); + type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; + tx->rts_retry_limit = IWM_RTS_DFAULT_RETRY_LIMIT; tx->data_retry_limit = IWM_DEFAULT_TX_RETRY; - /* - * XXX TODO: everything about the rate selection here is terrible! - */ - - if (type == IEEE80211_FC0_TYPE_DATA) { - int i; + if (type == IEEE80211_FC0_TYPE_MGT) { + i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); + ridx = in->in_ridx[i]; + } else if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { + i = iwm_tx_rateidx_lookup(sc, in, tp->mcastrate); + ridx = in->in_ridx[i]; + } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { + i = iwm_tx_rateidx_lookup(sc, in, tp->ucastrate); + ridx = in->in_ridx[i]; + } else if (m->m_flags & M_EAPOL) { + i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); + ridx = in->in_ridx[i]; + } else { /* for data frames, use RS table */ + /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); i = iwm_tx_rateidx_lookup(sc, in, ni->ni_txrate); ridx = in->in_ridx[i]; @@ -3220,28 +3232,6 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, "%s: start with i=%d, txrate %d\n", __func__, i, iwm_rates[ridx].rate); - } else { - /* - * For non-data, use the lowest supported rate for the given - * operational mode. - * - * Note: there may not be any rate control information available. - * This driver currently assumes if we're transmitting data - * frames, use the rate control table. Grr. - * - * XXX TODO: use the configured rate for the traffic type! - * XXX TODO: this should be per-vap, not curmode; as we later - * on we'll want to handle off-channel stuff (eg TDLS). - */ - if (ic->ic_curmode == IEEE80211_MODE_11A) { - /* - * XXX this assumes the mode is either 11a or not 11a; - * definitely won't work for 11n. - */ - ridx = IWM_RIDX_OFDM; - } else { - ridx = IWM_RIDX_CCK; - } } rinfo = &iwm_rates[ridx]; @@ -3303,7 +3293,7 @@ iwm_tx(struct iwm_softc *sc, struct mbuf *m, struct ie tx = (void *)cmd->data; memset(tx, 0, sizeof(*tx)); - rinfo = iwm_tx_fill_cmd(sc, in, wh, tx); + rinfo = iwm_tx_fill_cmd(sc, in, m, tx); /* Encrypt the frame if need be. */ if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) { From owner-svn-src-stable-11@freebsd.org Thu Mar 1 04:59:56 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9744EF0E4C1; Thu, 1 Mar 2018 04:59:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4857A7AC4B; Thu, 1 Mar 2018 04:59:56 +0000 (UTC) (envelope-from eadler@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 432F023C40; Thu, 1 Mar 2018 04:59:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w214xuI5006095; Thu, 1 Mar 2018 04:59:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w214xuoR006094; Thu, 1 Mar 2018 04:59:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010459.w214xuoR006094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 04:59: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: r330156 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330156 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.25 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, 01 Mar 2018 04:59:56 -0000 Author: eadler Date: Thu Mar 1 04:59:55 2018 New Revision: 330156 URL: https://svnweb.freebsd.org/changeset/base/330156 Log: MFC r306286: [iwm] fix default antenna selection a bit; fix 5GHz rate control handling. * Don't do the antenna switching when setting up the rate table - we don't take into account whether it's an active antenna or not (eg shared with BT.) I'll look into this a bit more later. * The default antenna is still 1, I'll look into that a bit more later. (So no, this doesn't fix it for Larry who needs ANT_B to be active, not ANT_A.) * My changes to the rate control setup used the wrong method for finding a suitable rate, which led to 1M CCK frames being queued for 11a operation. This is .. sub-optimal. Change the rate control lookup path to use the global table instead of the per-node table, which won't be setup until the node rate table is setup (which happens way too late in this game.) Tested: * Intel 7260, 2G and 5G operation. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:58:00 2018 (r330155) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:59:55 2018 (r330156) @@ -2672,6 +2672,15 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn if (error != 0) return error; + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "%s: phy_txant=0x%08x, nvm_valid_tx_ant=0x%02x, valid=0x%02x\n", + __func__, + ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) + >> IWM_FW_PHY_CFG_TX_CHAIN_POS), + sc->sc_nvm.valid_tx_ant, + iwm_fw_valid_tx_ant(sc)); + + /* Send TX valid antennas before triggering calibrations */ if ((error = iwm_send_tx_ant_cfg(sc, iwm_fw_valid_tx_ant(sc))) != 0) { device_printf(sc->sc_dev, @@ -3182,11 +3191,34 @@ iwm_tx_rateidx_lookup(struct iwm_softc *sc, struct iwm if (rate == r) return (i); } + + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, + "%s: couldn't find an entry for rate=%d\n", + __func__, + rate); + /* XXX Return the first */ /* XXX TODO: have it return the /lowest/ */ return (0); } +static int +iwm_tx_rateidx_global_lookup(struct iwm_softc *sc, uint8_t rate) +{ + int i; + + for (i = 0; i < nitems(iwm_rates); i++) { + if (iwm_rates[i].rate == rate) + return (i); + } + /* XXX error? */ + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, + "%s: couldn't find an entry for rate=%d\n", + __func__, + rate); + return (0); +} + /* * Fill in the rate related information for a transmit command. */ @@ -3199,7 +3231,7 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node const struct ieee80211_txparam *tp = ni->ni_txparms; const struct iwm_rate *rinfo; int type; - int ridx, rate_flags, i; + int ridx, rate_flags; wh = mtod(m, struct ieee80211_frame *); type = wh->i_fc[0] & IEEE80211_FC0_TYPE_MASK; @@ -3208,19 +3240,26 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node tx->data_retry_limit = IWM_DEFAULT_TX_RETRY; if (type == IEEE80211_FC0_TYPE_MGT) { - i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); - ridx = in->in_ridx[i]; + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mgmtrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: MGT (%d)\n", __func__, tp->mgmtrate); } else if (IEEE80211_IS_MULTICAST(wh->i_addr1)) { - i = iwm_tx_rateidx_lookup(sc, in, tp->mcastrate); - ridx = in->in_ridx[i]; + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mcastrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: MCAST (%d)\n", __func__, tp->mcastrate); } else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE) { - i = iwm_tx_rateidx_lookup(sc, in, tp->ucastrate); - ridx = in->in_ridx[i]; + ridx = iwm_tx_rateidx_global_lookup(sc, tp->ucastrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: FIXED_RATE (%d)\n", __func__, tp->ucastrate); } else if (m->m_flags & M_EAPOL) { - i = iwm_tx_rateidx_lookup(sc, in, tp->mgmtrate); - ridx = in->in_ridx[i]; - } else { + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mgmtrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, + "%s: EAPOL\n", __func__); + } else if (type == IEEE80211_FC0_TYPE_DATA) { + int i; + /* for data frames, use RS table */ + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DATA\n", __func__); /* XXX pass pktlen */ (void) ieee80211_ratectl_rate(ni, NULL, 0); i = iwm_tx_rateidx_lookup(sc, in, ni->ni_txrate); @@ -3229,11 +3268,20 @@ iwm_tx_fill_cmd(struct iwm_softc *sc, struct iwm_node /* This is the index into the programmed table */ tx->initial_rate_index = i; tx->tx_flags |= htole32(IWM_TX_CMD_FLG_STA_RATE); + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, "%s: start with i=%d, txrate %d\n", __func__, i, iwm_rates[ridx].rate); + } else { + ridx = iwm_tx_rateidx_global_lookup(sc, tp->mgmtrate); + IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: DEFAULT (%d)\n", + __func__, tp->mgmtrate); } + IWM_DPRINTF(sc, IWM_DEBUG_XMIT | IWM_DEBUG_TXRATE, + "%s: frame type=%d txrate %d\n", + __func__, type, iwm_rates[ridx].rate); + rinfo = &iwm_rates[ridx]; IWM_DPRINTF(sc, IWM_DEBUG_TXRATE, "%s: ridx=%d; rate=%d, CCK=%d\n", @@ -3965,7 +4013,7 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in struct iwm_lq_cmd *lq = &in->in_lq; int nrates = ni->ni_rates.rs_nrates; int i, ridx, tab = 0; - int txant = 0; +// int txant = 0; if (nrates > nitems(lq->rs_table)) { device_printf(sc->sc_dev, @@ -4047,11 +4095,14 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in for (i = 0; i < nrates; i++) { int nextant; +#if 0 if (txant == 0) txant = iwm_fw_valid_tx_ant(sc); nextant = 1<<(ffs(txant)-1); txant &= ~nextant; - +#else + nextant = iwm_fw_valid_tx_ant(sc); +#endif /* * Map the rate id into a rate index into * our hardware table containing the From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:01:56 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 781BBF49BD5; Thu, 1 Mar 2018 05:01:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB3C7B273; Thu, 1 Mar 2018 05:01:56 +0000 (UTC) (envelope-from eadler@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 25B9523DA5; Thu, 1 Mar 2018 05:01:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2151u5v009921; Thu, 1 Mar 2018 05:01:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2151ub4009920; Thu, 1 Mar 2018 05:01:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010501.w2151ub4009920@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:01: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: r330157 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330157 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.25 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, 01 Mar 2018 05:01:56 -0000 Author: eadler Date: Thu Mar 1 05:01:55 2018 New Revision: 330157 URL: https://svnweb.freebsd.org/changeset/base/330157 Log: MFC r306900: iwm: add missing 'Rx errors' counter incrementation. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 04:59:55 2018 (r330156) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:01:55 2018 (r330157) @@ -2918,14 +2918,14 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, device_printf(sc->sc_dev, "dsp size out of range [0,20]: %d\n", phy_info->cfg_phy_cnt); - return; + goto fail; } if (!(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_CRC_OK) || !(rx_pkt_status & IWM_RX_MPDU_RES_STATUS_OVERRUN_OK)) { IWM_DPRINTF(sc, IWM_DEBUG_RECV, "Bad CRC or FIFO: 0x%08X.\n", rx_pkt_status); - return; /* drop */ + goto fail; } if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_RX_ENERGY_API) { @@ -2947,7 +2947,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", __func__); - return; + goto fail; } IWM_DPRINTF(sc, IWM_DEBUG_RECV, @@ -3020,6 +3020,10 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, ieee80211_input_mimo_all(ic, m, &rxs); } IWM_LOCK(sc); + + return; + +fail: counter_u64_add(ic->ic_ierrors, 1); } static int From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:03:19 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDE86F4A5FF; Thu, 1 Mar 2018 05:03:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9191A7B62B; Thu, 1 Mar 2018 05:03:18 +0000 (UTC) (envelope-from eadler@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 8C37A23DDA; Thu, 1 Mar 2018 05:03:18 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2153IIw010705; Thu, 1 Mar 2018 05:03:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2153IYv010704; Thu, 1 Mar 2018 05:03:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010503.w2153IYv010704@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:03: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: r330158 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330158 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.25 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, 01 Mar 2018 05:03:19 -0000 Author: eadler Date: Thu Mar 1 05:03:18 2018 New Revision: 330158 URL: https://svnweb.freebsd.org/changeset/base/330158 Log: MFC r308183: [iwm] Get rid of SYNC_RESP_STRUCT and SYNC_RESP_PTR macros. * SYNC_RESP_STRUCT and SYNC_RESP_PTR originate from the OpenBSD version of iwm, and they weren't serving any real purpose in the FreeBSD port. * We just do a single bus_dmamap_sync for syncing the complete received frame, instead of explicitly bus_dmamap_sync-ing subranges of the frame like in the OpenBSD iwm code. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:01:55 2018 (r330157) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:03:18 2018 (r330158) @@ -5049,18 +5049,6 @@ iwm_nic_error(struct iwm_softc *sc) } #endif -#define SYNC_RESP_STRUCT(_var_, _pkt_) \ -do { \ - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);\ - _var_ = (void *)((_pkt_)+1); \ -} while (/*CONSTCOND*/0) - -#define SYNC_RESP_PTR(_ptr_, _len_, _pkt_) \ -do { \ - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD);\ - _ptr_ = (void *)((_pkt_)+1); \ -} while (/*CONSTCOND*/0) - #define ADVANCE_RXQ(sc) (sc->rxq.cur = (sc->rxq.cur + 1) % IWM_RX_RING_COUNT); /* @@ -5083,12 +5071,12 @@ iwm_notif_intr(struct iwm_softc *sc) */ while (sc->rxq.cur != hw) { struct iwm_rx_ring *ring = &sc->rxq; - struct iwm_rx_data *data = &sc->rxq.data[sc->rxq.cur]; + struct iwm_rx_data *data = &ring->data[ring->cur]; struct iwm_rx_packet *pkt; struct iwm_cmd_response *cresp; int qid, idx, code; - bus_dmamap_sync(sc->rxq.data_dmat, data->map, + bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); pkt = mtod(data->m, struct iwm_rx_packet *); @@ -5098,7 +5086,7 @@ iwm_notif_intr(struct iwm_softc *sc) code = IWM_WIDE_ID(pkt->hdr.flags, pkt->hdr.code); IWM_DPRINTF(sc, IWM_DEBUG_INTR, "rx packet qid=%d idx=%d type=%x %d %d\n", - pkt->hdr.qid & ~0x80, pkt->hdr.idx, code, sc->rxq.cur, hw); + pkt->hdr.qid & ~0x80, pkt->hdr.idx, code, ring->cur, hw); /* * randomly get these from the firmware, no idea why. @@ -5130,7 +5118,7 @@ iwm_notif_intr(struct iwm_softc *sc) /* XXX look at mac_id to determine interface ID */ struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); - SYNC_RESP_STRUCT(resp, pkt); + resp = (void *)pkt->data; missed = le32toh(resp->consec_missed_beacons); IWM_DPRINTF(sc, IWM_DEBUG_BEACON | IWM_DEBUG_STATE, @@ -5170,7 +5158,7 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_mvm_alive_resp_v3 *resp3; if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp1)) { - SYNC_RESP_STRUCT(resp1, pkt); + resp1 = (void *)pkt->data; sc->sc_uc.uc_error_event_table = le32toh(resp1->error_event_table_ptr); sc->sc_uc.uc_log_event_table @@ -5183,7 +5171,7 @@ iwm_notif_intr(struct iwm_softc *sc) } if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp2)) { - SYNC_RESP_STRUCT(resp2, pkt); + resp2 = (void *)pkt->data; sc->sc_uc.uc_error_event_table = le32toh(resp2->error_event_table_ptr); sc->sc_uc.uc_log_event_table @@ -5198,7 +5186,7 @@ iwm_notif_intr(struct iwm_softc *sc) } if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp3)) { - SYNC_RESP_STRUCT(resp3, pkt); + resp3 = (void *)pkt->data; sc->sc_uc.uc_error_event_table = le32toh(resp3->error_event_table_ptr); sc->sc_uc.uc_log_event_table @@ -5218,7 +5206,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_CALIB_RES_NOTIF_PHY_DB: { struct iwm_calib_res_notif_phy_db *phy_db_notif; - SYNC_RESP_STRUCT(phy_db_notif, pkt); + phy_db_notif = (void *)pkt->data; iwm_phy_db_set_section(sc, phy_db_notif); @@ -5226,7 +5214,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_STATISTICS_NOTIFICATION: { struct iwm_notif_statistics *stats; - SYNC_RESP_STRUCT(stats, pkt); + stats = (void *)pkt->data; memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); break; } @@ -5234,8 +5222,6 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: if (sc->sc_wantresp == ((qid << 16) | idx)) { - bus_dmamap_sync(sc->rxq.data_dmat, data->map, - BUS_DMASYNC_POSTREAD); memcpy(sc->sc_cmd_resp, pkt, sizeof(sc->sc_cmd_resp)); } @@ -5243,7 +5229,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_MCC_CHUB_UPDATE_CMD: { struct iwm_mcc_chub_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; sc->sc_fw_mcc[0] = (notif->mcc & 0xff00) >> 8; sc->sc_fw_mcc[1] = notif->mcc & 0xff; @@ -5276,7 +5262,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_LQ_CMD: case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: - SYNC_RESP_STRUCT(cresp, pkt); + cresp = (void *)pkt->data; if (sc->sc_wantresp == ((qid << 16) | idx)) { memcpy(sc->sc_cmd_resp, pkt, sizeof(*pkt)+sizeof(*cresp)); @@ -5294,20 +5280,20 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_OFFLOAD_COMPLETE: { struct iwm_periodic_scan_complete *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; break; } case IWM_SCAN_ITERATION_COMPLETE: { struct iwm_lmac_scan_complete_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; ieee80211_runtask(&sc->sc_ic, &sc->sc_es_task); break; } case IWM_SCAN_COMPLETE_UMAC: { struct iwm_umac_scan_complete *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan complete, status=0x%x\n", @@ -5320,7 +5306,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_ITERATION_COMPLETE_UMAC: { struct iwm_umac_scan_iter_complete_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan iteration " "complete, status=0x%x, %d channels scanned\n", @@ -5331,7 +5317,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_REPLY_ERROR: { struct iwm_error_resp *resp; - SYNC_RESP_STRUCT(resp, pkt); + resp = (void *)pkt->data; device_printf(sc->sc_dev, "firmware error 0x%x, cmd 0x%x\n", @@ -5342,7 +5328,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_TIME_EVENT_NOTIFICATION: { struct iwm_time_event_notif *notif; - SYNC_RESP_STRUCT(notif, pkt); + notif = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_INTR, "TE notif status = 0x%x action = 0x%x\n", @@ -5355,7 +5341,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCD_QUEUE_CFG: { struct iwm_scd_txq_cfg_rsp *rsp; - SYNC_RESP_STRUCT(rsp, pkt); + rsp = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_CMD, "queue cfg token=0x%x sta_id=%d " From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:05:09 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA3F5F4A8A4; Thu, 1 Mar 2018 05:05:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 68F1E7BA5F; Thu, 1 Mar 2018 05:05:09 +0000 (UTC) (envelope-from eadler@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 63E3E23DE0; Thu, 1 Mar 2018 05:05:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21559MZ010821; Thu, 1 Mar 2018 05:05:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21559tD010820; Thu, 1 Mar 2018 05:05:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010505.w21559tD010820@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:05: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: r330159 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330159 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.25 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, 01 Mar 2018 05:05:09 -0000 Author: eadler Date: Thu Mar 1 05:05:08 2018 New Revision: 330159 URL: https://svnweb.freebsd.org/changeset/base/330159 Log: MFC r308577: iwm: If firmware load fails during init via iwm_preinit() we bail out before calling ieee80211_ifattach() so the taskqueue hasn't been initialized. Don't try to drain it, we'll panic. Looks like this issue was introduced in r303326. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:03:18 2018 (r330158) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:05:08 2018 (r330159) @@ -6172,7 +6172,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 device_t dev = sc->sc_dev; int i; - ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); + if (do_net80211) + ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); callout_drain(&sc->sc_led_blink_to); callout_drain(&sc->sc_watchdog_to); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:06:17 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D146F4AA87; Thu, 1 Mar 2018 05:06:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 52B537BD34; Thu, 1 Mar 2018 05:06:17 +0000 (UTC) (envelope-from eadler@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 3382423DE6; Thu, 1 Mar 2018 05:06:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2156Hk4010908; Thu, 1 Mar 2018 05:06:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2156Hil010907; Thu, 1 Mar 2018 05:06:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010506.w2156Hil010907@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:06: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: r330160 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330160 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.25 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, 01 Mar 2018 05:06:17 -0000 Author: eadler Date: Thu Mar 1 05:06:16 2018 New Revision: 330160 URL: https://svnweb.freebsd.org/changeset/base/330160 Log: MFC r308777: [iwm] Sync iwm_nvm_read_chunk() function with Linux iwlwifi. This fixes an error handling detail in iwm_nvm_read_chunk(), where an error response from the firmware for an NVM read shouldn't be fatal if the offset was non-zero. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:05:08 2018 (r330159) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:06:16 2018 (r330160) @@ -1666,8 +1666,10 @@ const int nvm_to_read[] = { #define IWM_NVM_READ_OPCODE 0 /* load nvm chunk response */ -#define IWM_READ_NVM_CHUNK_SUCCEED 0 -#define IWM_READ_NVM_CHUNK_INVALID_ADDRESS 1 +enum { + IWM_READ_NVM_CHUNK_SUCCEED = 0, + IWM_READ_NVM_CHUNK_NOT_VALID_ADDRESS = 1 +}; static int iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t section, @@ -1684,12 +1686,10 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect struct iwm_rx_packet *pkt; struct iwm_host_cmd cmd = { .id = IWM_NVM_ACCESS_CMD, - .flags = IWM_CMD_SYNC | IWM_CMD_WANT_SKB | - IWM_CMD_SEND_IN_RFKILL, + .flags = IWM_CMD_WANT_SKB | IWM_CMD_SEND_IN_RFKILL, .data = { &nvm_access_cmd, }, }; - int ret, offset_read; - size_t bytes_read; + int ret, bytes_read, offset_read; uint8_t *resp_data; cmd.len[0] = sizeof(struct iwm_nvm_access_cmd); @@ -1718,9 +1718,26 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect offset_read = le16toh(nvm_resp->offset); resp_data = nvm_resp->data; if (ret) { - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "NVM access command failed with status %d\n", ret); - ret = EINVAL; + if ((offset != 0) && + (ret == IWM_READ_NVM_CHUNK_NOT_VALID_ADDRESS)) { + /* + * meaning of NOT_VALID_ADDRESS: + * driver try to read chunk from address that is + * multiple of 2K and got an error since addr is empty. + * meaning of (offset != 0): driver already + * read valid data from another chunk so this case + * is not an error. + */ + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "NVM access command failed on offset 0x%x since that section size is multiple 2K\n", + offset); + *len = 0; + ret = 0; + } else { + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "NVM access command failed with status %d\n", ret); + ret = EIO; + } goto exit; } @@ -1735,7 +1752,7 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect if (bytes_read > length) { device_printf(sc->sc_dev, "NVM ACCESS response with too much data " - "(%d bytes requested, %zd bytes received)\n", + "(%d bytes requested, %d bytes received)\n", length, bytes_read); ret = EINVAL; goto exit; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:08:27 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9DF7F4AD9E; Thu, 1 Mar 2018 05:08:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B2B27C29C; Thu, 1 Mar 2018 05:08:27 +0000 (UTC) (envelope-from eadler@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 6625D23DEC; Thu, 1 Mar 2018 05:08:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2158Rib011156; Thu, 1 Mar 2018 05:08:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2158R5e011155; Thu, 1 Mar 2018 05:08:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010508.w2158R5e011155@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:08:27 +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: r330161 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330161 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.25 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, 01 Mar 2018 05:08:27 -0000 Author: eadler Date: Thu Mar 1 05:08:27 2018 New Revision: 330161 URL: https://svnweb.freebsd.org/changeset/base/330161 Log: MFC r313307: [iwm] TODO for QOS support. Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 05:06:16 2018 (r330160) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 05:08:27 2018 (r330161) @@ -318,6 +318,11 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru = htole32((ic->ic_flags & IEEE80211_F_SHSLOT) ? IWM_MAC_FLG_SHORT_SLOT : 0); + /* + * XXX TODO: if we're doing QOS.. + * cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA) + */ + /* XXX TODO: set wme parameters; also handle getting updated wme parameters */ for (i = 0; i < IWM_AC_NUM+1; i++) { int txf = i; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:09:09 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 81F75F4AED9; Thu, 1 Mar 2018 05:09:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 361007C4AC; Thu, 1 Mar 2018 05:09:09 +0000 (UTC) (envelope-from eadler@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 30E6023DEF; Thu, 1 Mar 2018 05:09:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215985A011224; Thu, 1 Mar 2018 05:09:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21598PW011222; Thu, 1 Mar 2018 05:09:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010509.w21598PW011222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:09:08 +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: r330162 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330162 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.25 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, 01 Mar 2018 05:09:09 -0000 Author: eadler Date: Thu Mar 1 05:09:08 2018 New Revision: 330162 URL: https://svnweb.freebsd.org/changeset/base/330162 Log: MFC r313308: [iwm] The HW Revision stepping constants should be in if_iwmreg.h. Modified: stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:08:27 2018 (r330161) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:09:08 2018 (r330162) @@ -297,6 +297,16 @@ #define IWM_CSR_HW_REV_DASH(_val) (((_val) & 0x0000003) >> 0) #define IWM_CSR_HW_REV_STEP(_val) (((_val) & 0x000000C) >> 2) +/** + * hw_rev values + */ +enum { + IWM_SILICON_A_STEP = 0, + IWM_SILICON_B_STEP, + IWM_SILICON_C_STEP, +}; + + #define IWM_CSR_HW_REV_TYPE_MSK (0x000FFF0) #define IWM_CSR_HW_REV_TYPE_5300 (0x0000020) #define IWM_CSR_HW_REV_TYPE_5350 (0x0000030) Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:08:27 2018 (r330161) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:08 2018 (r330162) @@ -431,10 +431,6 @@ struct iwm_softc { int ict_cur; int sc_hw_rev; -#define IWM_SILICON_A_STEP 0 -#define IWM_SILICON_B_STEP 1 -#define IWM_SILICON_C_STEP 2 -#define IWM_SILICON_D_STEP 3 int sc_hw_id; int sc_device_family; #define IWM_DEVICE_FAMILY_7000 1 From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:09:50 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C3ED5F4AFB7; Thu, 1 Mar 2018 05:09:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 75EC47C6AE; Thu, 1 Mar 2018 05:09:50 +0000 (UTC) (envelope-from eadler@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 70BE923DF0; Thu, 1 Mar 2018 05:09:50 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2159ovh011300; Thu, 1 Mar 2018 05:09:50 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2159o1B011295; Thu, 1 Mar 2018 05:09:50 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010509.w2159o1B011295@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:09: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: r330163 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330163 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.25 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, 01 Mar 2018 05:09:51 -0000 Author: eadler Date: Thu Mar 1 05:09:49 2018 New Revision: 330163 URL: https://svnweb.freebsd.org/changeset/base/330163 Log: MFC r313309: [iwm] Sync if_iwm_phy_db code with Linux iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_db.c stable/11/sys/dev/iwm/if_iwm_phy_db.h stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:49 2018 (r330163) @@ -4593,11 +4593,9 @@ iwm_init_hw(struct iwm_softc *sc) goto error; } - /* Send phy db control command and then phy db calibration*/ - if ((error = iwm_send_phy_db_data(sc)) != 0) { - device_printf(sc->sc_dev, "phy_db_data failed\n"); + /* Send phy db control command and then phy db calibration */ + if ((error = iwm_send_phy_db_data(sc->sc_phy_db)) != 0) goto error; - } if ((error = iwm_send_phy_cfg_cmd(sc)) != 0) { device_printf(sc->sc_dev, "phy_cfg_cmd failed\n"); @@ -5225,7 +5223,7 @@ iwm_notif_intr(struct iwm_softc *sc) struct iwm_calib_res_notif_phy_db *phy_db_notif; phy_db_notif = (void *)pkt->data; - iwm_phy_db_set_section(sc, phy_db_notif); + iwm_phy_db_set_section(sc->sc_phy_db, phy_db_notif); break; } @@ -5751,6 +5749,13 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + /* Init phy db */ + sc->sc_phy_db = iwm_phy_db_init(sc); + if (!sc->sc_phy_db) { + device_printf(dev, "Cannot init phy_db\n"); + goto fail; + } + /* PCI attach */ error = iwm_pci_attach(dev); if (error != 0) @@ -6199,7 +6204,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 ieee80211_ifdetach(&sc->sc_ic); } - iwm_phy_db_free(sc); + iwm_phy_db_free(sc->sc_phy_db); + sc->sc_phy_db = NULL; /* Free descriptor rings */ iwm_free_rx_ring(sc, &sc->rxq); Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:09:49 2018 (r330163) @@ -150,26 +150,104 @@ __FBSDID("$FreeBSD$"); #include #include -#include -#include -#include -#include -#include +#include "if_iwmreg.h" +#include "if_iwmvar.h" +#include "if_iwm_debug.h" +#include "if_iwm_util.h" +#include "if_iwm_phy_db.h" +#define CHANNEL_NUM_SIZE 4 /* num of channels in calib_ch size */ + +struct iwm_phy_db_entry { + uint16_t size; + uint8_t *data; +}; + +/** + * struct iwm_phy_db - stores phy configuration and calibration data. + * + * @cfg: phy configuration. + * @calib_nch: non channel specific calibration data. + * @calib_ch: channel specific calibration data. + * @n_group_papd: number of entries in papd channel group. + * @calib_ch_group_papd: calibration data related to papd channel group. + * @n_group_txp: number of entries in tx power channel group. + * @calib_ch_group_txp: calibration data related to tx power chanel group. + */ +struct iwm_phy_db { + struct iwm_phy_db_entry cfg; + struct iwm_phy_db_entry calib_nch; + int n_group_papd; + struct iwm_phy_db_entry *calib_ch_group_papd; + int n_group_txp; + struct iwm_phy_db_entry *calib_ch_group_txp; + + struct iwm_softc *sc; +}; + +enum iwm_phy_db_section_type { + IWM_PHY_DB_CFG = 1, + IWM_PHY_DB_CALIB_NCH, + IWM_PHY_DB_UNUSED, + IWM_PHY_DB_CALIB_CHG_PAPD, + IWM_PHY_DB_CALIB_CHG_TXP, + IWM_PHY_DB_MAX +}; + +#define PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ + /* - * BEGIN iwl-phy-db.c + * phy db - configure operational ucode */ +struct iwm_phy_db_cmd { + uint16_t type; + uint16_t length; + uint8_t data[]; +} __packed; + +/* for parsing of tx power channel group data that comes from the firmware*/ +struct iwm_phy_db_chg_txp { + uint32_t space; + uint16_t max_channel_idx; +} __packed; + /* + * phy db - Receive phy db chunk after calibrations + */ +struct iwm_calib_res_notif_phy_db { + uint16_t type; + uint16_t length; + uint8_t data[]; +} __packed; + +struct iwm_phy_db * +iwm_phy_db_init(struct iwm_softc *sc) +{ + struct iwm_phy_db *phy_db = malloc(sizeof(struct iwm_phy_db), + M_DEVBUF, M_NOWAIT | M_ZERO); + + if (!phy_db) + return phy_db; + + phy_db->sc = sc; + + phy_db->n_group_txp = -1; + phy_db->n_group_papd = -1; + + /* TODO: add default values of the phy db. */ + return phy_db; +} + +/* * get phy db section: returns a pointer to a phy db section specified by * type and channel group id. */ static struct iwm_phy_db_entry * -iwm_phy_db_get_section(struct iwm_softc *sc, - enum iwm_phy_db_section_type type, uint16_t chg_id) +iwm_phy_db_get_section(struct iwm_phy_db *phy_db, + enum iwm_phy_db_section_type type, + uint16_t chg_id) { - struct iwm_phy_db *phy_db = &sc->sc_phy_db; - - if (type >= IWM_PHY_DB_MAX) + if (!phy_db || type >= IWM_PHY_DB_MAX) return NULL; switch (type) { @@ -178,11 +256,11 @@ iwm_phy_db_get_section(struct iwm_softc *sc, case IWM_PHY_DB_CALIB_NCH: return &phy_db->calib_nch; case IWM_PHY_DB_CALIB_CHG_PAPD: - if (chg_id >= IWM_NUM_PAPD_CH_GROUPS) + if (chg_id >= phy_db->n_group_papd) return NULL; return &phy_db->calib_ch_group_papd[chg_id]; case IWM_PHY_DB_CALIB_CHG_TXP: - if (chg_id >= IWM_NUM_TXP_CH_GROUPS) + if (chg_id >= phy_db->n_group_txp) return NULL; return &phy_db->calib_ch_group_txp[chg_id]; default: @@ -191,24 +269,92 @@ iwm_phy_db_get_section(struct iwm_softc *sc, return NULL; } +static void +iwm_phy_db_free_section(struct iwm_phy_db *phy_db, + enum iwm_phy_db_section_type type, uint16_t chg_id) +{ + struct iwm_phy_db_entry *entry = + iwm_phy_db_get_section(phy_db, type, chg_id); + if (!entry) + return; + + if (entry->data != NULL) + free(entry->data, M_DEVBUF); + entry->data = NULL; + entry->size = 0; +} + +void +iwm_phy_db_free(struct iwm_phy_db *phy_db) +{ + int i; + + if (!phy_db) + return; + + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CFG, 0); + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_NCH, 0); + + for (i = 0; i < phy_db->n_group_papd; i++) + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_PAPD, i); + if (phy_db->calib_ch_group_papd != NULL) + free(phy_db->calib_ch_group_papd, M_DEVBUF); + + for (i = 0; i < phy_db->n_group_txp; i++) + iwm_phy_db_free_section(phy_db, IWM_PHY_DB_CALIB_CHG_TXP, i); + if (phy_db->calib_ch_group_txp != NULL) + free(phy_db->calib_ch_group_txp, M_DEVBUF); + + free(phy_db, M_DEVBUF); +} + int -iwm_phy_db_set_section(struct iwm_softc *sc, - struct iwm_calib_res_notif_phy_db *phy_db_notif) +iwm_phy_db_set_section(struct iwm_phy_db *phy_db, + struct iwm_calib_res_notif_phy_db *phy_db_notif) { enum iwm_phy_db_section_type type = le16toh(phy_db_notif->type); - uint16_t size = le16toh(phy_db_notif->length); - struct iwm_phy_db_entry *entry; - uint16_t chg_id = 0; + uint16_t size = le16toh(phy_db_notif->length); + struct iwm_phy_db_entry *entry; + uint16_t chg_id = 0; - if (type == IWM_PHY_DB_CALIB_CHG_PAPD || - type == IWM_PHY_DB_CALIB_CHG_TXP) + if (!phy_db) + return EINVAL; + + if (type == IWM_PHY_DB_CALIB_CHG_PAPD) { chg_id = le16toh(*(uint16_t *)phy_db_notif->data); + if (phy_db && !phy_db->calib_ch_group_papd) { + /* + * Firmware sends the largest index first, so we can use + * it to know how much we should allocate. + */ + phy_db->calib_ch_group_papd = malloc( + (chg_id + 1) * sizeof(struct iwm_phy_db_entry), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!phy_db->calib_ch_group_papd) + return ENOMEM; + phy_db->n_group_papd = chg_id + 1; + } + } else if (type == IWM_PHY_DB_CALIB_CHG_TXP) { + chg_id = le16toh(*(uint16_t *)phy_db_notif->data); + if (phy_db && !phy_db->calib_ch_group_txp) { + /* + * Firmware sends the largest index first, so we can use + * it to know how much we should allocate. + */ + phy_db->calib_ch_group_txp = malloc( + (chg_id + 1) * sizeof(struct iwm_phy_db_entry), + M_DEVBUF, M_NOWAIT | M_ZERO); + if (!phy_db->calib_ch_group_txp) + return ENOMEM; + phy_db->n_group_txp = chg_id + 1; + } + } - entry = iwm_phy_db_get_section(sc, type, chg_id); + entry = iwm_phy_db_get_section(phy_db, type, chg_id); if (!entry) return EINVAL; - if (entry->data) + if (entry->data != NULL) free(entry->data, M_DEVBUF); entry->data = malloc(size, M_DEVBUF, M_NOWAIT); if (!entry->data) { @@ -216,17 +362,18 @@ iwm_phy_db_set_section(struct iwm_softc *sc, return ENOMEM; } memcpy(entry->data, phy_db_notif->data, size); + entry->size = size; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s(%d): [PHYDB]SET: Type %d , Size: %d, data: %p\n", - __func__, __LINE__, type, size, entry->data); + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, + "%s(%d): [PHYDB]SET: Type %d , Size: %d\n", + __func__, __LINE__, type, size); return 0; } static int -iwm_is_valid_channel(uint16_t ch_id) +is_valid_channel(uint16_t ch_id) { if (ch_id <= 14 || (36 <= ch_id && ch_id <= 64 && ch_id % 4 == 0) || @@ -237,10 +384,10 @@ iwm_is_valid_channel(uint16_t ch_id) } static uint8_t -iwm_ch_id_to_ch_index(uint16_t ch_id) +ch_id_to_ch_index(uint16_t ch_id) { - if (!iwm_is_valid_channel(ch_id)) - return 0xff; + if (!is_valid_channel(ch_id)) + return 0xff; if (ch_id <= 14) return ch_id - 1; @@ -253,9 +400,9 @@ iwm_ch_id_to_ch_index(uint16_t ch_id) static uint16_t -iwm_channel_id_to_papd(uint16_t ch_id) +channel_id_to_papd(uint16_t ch_id) { - if (!iwm_is_valid_channel(ch_id)) + if (!is_valid_channel(ch_id)) return 0xff; if (1 <= ch_id && ch_id <= 14) @@ -268,17 +415,15 @@ iwm_channel_id_to_papd(uint16_t ch_id) } static uint16_t -iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t ch_id) +channel_id_to_txp(struct iwm_phy_db *phy_db, uint16_t ch_id) { - struct iwm_phy_db *phy_db = &sc->sc_phy_db; struct iwm_phy_db_chg_txp *txp_chg; int i; - uint8_t ch_index = iwm_ch_id_to_ch_index(ch_id); - + uint8_t ch_index = ch_id_to_ch_index(ch_id); if (ch_index == 0xff) return 0xff; - for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) { + for (i = 0; i < phy_db->n_group_txp; i++) { txp_chg = (void *)phy_db->calib_ch_group_txp[i].data; if (!txp_chg) return 0xff; @@ -293,71 +438,79 @@ iwm_channel_id_to_txp(struct iwm_softc *sc, uint16_t c } static int -iwm_phy_db_get_section_data(struct iwm_softc *sc, - uint32_t type, uint8_t **data, uint16_t *size, uint16_t ch_id) +iwm_phy_db_get_section_data(struct iwm_phy_db *phy_db, + uint32_t type, uint8_t **data, uint16_t *size, + uint16_t ch_id) { struct iwm_phy_db_entry *entry; uint16_t ch_group_id = 0; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "->%s\n", __func__); + if (!phy_db) + return EINVAL; + /* find wanted channel group */ if (type == IWM_PHY_DB_CALIB_CHG_PAPD) - ch_group_id = iwm_channel_id_to_papd(ch_id); + ch_group_id = channel_id_to_papd(ch_id); else if (type == IWM_PHY_DB_CALIB_CHG_TXP) - ch_group_id = iwm_channel_id_to_txp(sc, ch_id); + ch_group_id = channel_id_to_txp(phy_db, ch_id); - entry = iwm_phy_db_get_section(sc, type, ch_group_id); + entry = iwm_phy_db_get_section(phy_db, type, ch_group_id); if (!entry) return EINVAL; *data = entry->data; *size = entry->size; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s(%d): [PHYDB] GET: Type %d , Size: %d\n", - __func__, __LINE__, type, *size); + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, + "%s(%d): [PHYDB] GET: Type %d , Size: %d\n", + __func__, __LINE__, type, *size); return 0; } static int -iwm_send_phy_db_cmd(struct iwm_softc *sc, uint16_t type, - uint16_t length, void *data) +iwm_send_phy_db_cmd(struct iwm_phy_db *phy_db, uint16_t type, + uint16_t length, void *data) { struct iwm_phy_db_cmd phy_db_cmd; struct iwm_host_cmd cmd = { - .id = IWM_PHY_DB_CMD, - .flags = IWM_CMD_SYNC, + .id = PHY_DB_CMD, }; - IWM_DPRINTF(sc, IWM_DEBUG_CMD, - "Sending PHY-DB hcmd of type %d, of length %d\n", - type, length); + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_RESET, + "Sending PHY-DB hcmd of type %d, of length %d\n", + type, length); /* Set phy db cmd variables */ - phy_db_cmd.type = le16toh(type); - phy_db_cmd.length = le16toh(length); + phy_db_cmd.type = htole16(type); + phy_db_cmd.length = htole16(length); /* Set hcmd variables */ cmd.data[0] = &phy_db_cmd; cmd.len[0] = sizeof(struct iwm_phy_db_cmd); cmd.data[1] = data; cmd.len[1] = length; +#ifdef notyet + cmd.dataflags[1] = IWM_HCMD_DFL_NOCOPY; +#endif - return iwm_send_cmd(sc, &cmd); + return iwm_send_cmd(phy_db->sc, &cmd); } static int -iwm_phy_db_send_all_channel_groups(struct iwm_softc *sc, - enum iwm_phy_db_section_type type, uint8_t max_ch_groups) +iwm_phy_db_send_all_channel_groups(struct iwm_phy_db *phy_db, + enum iwm_phy_db_section_type type, + uint8_t max_ch_groups) { uint16_t i; int err; struct iwm_phy_db_entry *entry; - /* Send all the channel-specific groups to operational fw */ + /* Send all the channel specific groups to operational fw */ for (i = 0; i < max_ch_groups; i++) { - entry = iwm_phy_db_get_section(sc, type, i); + entry = iwm_phy_db_get_section(phy_db, + type, + i); if (!entry) return EINVAL; @@ -365,16 +518,18 @@ iwm_phy_db_send_all_channel_groups(struct iwm_softc *s continue; /* Send the requested PHY DB section */ - err = iwm_send_phy_db_cmd(sc, type, entry->size, entry->data); + err = iwm_send_phy_db_cmd(phy_db, + type, + entry->size, + entry->data); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD, - "%s: Can't SEND phy_db section %d (%d), " - "err %d\n", __func__, type, i, err); + device_printf(phy_db->sc->sc_dev, + "Can't SEND phy_db section %d (%d), err %d\n", + type, i, err); return err; } - DELAY(1000); - IWM_DPRINTF(sc, IWM_DEBUG_CMD, + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD, "Sent PHY_DB HCMD, type = %d num = %d\n", type, i); } @@ -382,102 +537,73 @@ iwm_phy_db_send_all_channel_groups(struct iwm_softc *s } int -iwm_send_phy_db_data(struct iwm_softc *sc) +iwm_send_phy_db_data(struct iwm_phy_db *phy_db) { uint8_t *data = NULL; uint16_t size = 0; int err; - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "%s: Sending phy db data and configuration to runtime image\n", __func__); /* Send PHY DB CFG section */ - err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CFG, &data, &size, 0); + err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CFG, + &data, &size, 0); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot get Phy DB cfg section, %d\n", __func__, err); return err; } - err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CFG, size, data); + err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CFG, size, data); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send HCMD of Phy DB cfg section, %d\n", __func__, err); return err; } - err = iwm_phy_db_get_section_data(sc, IWM_PHY_DB_CALIB_NCH, + err = iwm_phy_db_get_section_data(phy_db, IWM_PHY_DB_CALIB_NCH, &data, &size, 0); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot get Phy DB non specific channel section, " "%d\n", __func__, err); return err; } - err = iwm_send_phy_db_cmd(sc, IWM_PHY_DB_CALIB_NCH, size, data); + err = iwm_send_phy_db_cmd(phy_db, IWM_PHY_DB_CALIB_NCH, size, data); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send HCMD of Phy DB non specific channel " "sect, %d\n", __func__, err); return err; } /* Send all the TXP channel specific data */ - err = iwm_phy_db_send_all_channel_groups(sc, - IWM_PHY_DB_CALIB_CHG_PAPD, IWM_NUM_PAPD_CH_GROUPS); + err = iwm_phy_db_send_all_channel_groups(phy_db, + IWM_PHY_DB_CALIB_CHG_PAPD, phy_db->n_group_papd); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send channel specific PAPD groups, %d\n", __func__, err); return err; } /* Send all the TXP channel specific data */ - err = iwm_phy_db_send_all_channel_groups(sc, - IWM_PHY_DB_CALIB_CHG_TXP, IWM_NUM_TXP_CH_GROUPS); + err = iwm_phy_db_send_all_channel_groups(phy_db, + IWM_PHY_DB_CALIB_CHG_TXP, phy_db->n_group_txp); if (err) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + device_printf(phy_db->sc->sc_dev, "%s: Cannot send channel specific TX power groups, " "%d\n", __func__, err); return err; } - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, + IWM_DPRINTF(phy_db->sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "%s: Finished sending phy db non channel data\n", __func__); return 0; -} - -static void -iwm_phy_db_free_section(struct iwm_softc *sc, - enum iwm_phy_db_section_type type, uint16_t chg_id) -{ - struct iwm_phy_db_entry *entry = - iwm_phy_db_get_section(sc, type, chg_id); - if (!entry) - return; - - if (entry->data != NULL) - free(entry->data, M_DEVBUF); - entry->data = NULL; - entry->size = 0; -} - -void -iwm_phy_db_free(struct iwm_softc *sc) -{ - int i; - - iwm_phy_db_free_section(sc, IWM_PHY_DB_CFG, 0); - iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_NCH, 0); - - for (i = 0; i < IWM_NUM_PAPD_CH_GROUPS; i++) - iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_PAPD, i); - - for (i = 0; i < IWM_NUM_TXP_CH_GROUPS; i++) - iwm_phy_db_free_section(sc, IWM_PHY_DB_CALIB_CHG_TXP, i); } Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:09:49 2018 (r330163) @@ -106,8 +106,12 @@ #ifndef __IF_IWM_PHY_DB_H__ #define __IF_IWM_PHY_DB_H__ -extern int iwm_phy_db_set_section(struct iwm_softc *sc, +struct iwm_calib_res_notif_phy_db; + +extern struct iwm_phy_db *iwm_phy_db_init(struct iwm_softc *sc); +extern void iwm_phy_db_free(struct iwm_phy_db *phy_db); +extern int iwm_phy_db_set_section(struct iwm_phy_db *phy_db, struct iwm_calib_res_notif_phy_db *phy_db_notif); -extern int iwm_send_phy_db_data(struct iwm_softc *sc); -extern void iwm_phy_db_free(struct iwm_softc *sc); +extern int iwm_send_phy_db_data(struct iwm_phy_db *phy_db); + #endif /* __IF_IWM_PHY_DB_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:09:49 2018 (r330163) @@ -2013,45 +2013,6 @@ struct iwm_phy_cfg_cmd { #define IWM_PHY_CFG_RX_CHAIN_B (1 << 13) #define IWM_PHY_CFG_RX_CHAIN_C (1 << 14) -/* - * PHY db - */ - -enum iwm_phy_db_section_type { - IWM_PHY_DB_CFG = 1, - IWM_PHY_DB_CALIB_NCH, - IWM_PHY_DB_UNUSED, - IWM_PHY_DB_CALIB_CHG_PAPD, - IWM_PHY_DB_CALIB_CHG_TXP, - IWM_PHY_DB_MAX -}; - -#define IWM_PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ - -/* - * phy db - configure operational ucode - */ -struct iwm_phy_db_cmd { - uint16_t type; - uint16_t length; - uint8_t data[]; -} __packed; - -/* for parsing of tx power channel group data that comes from the firmware */ -struct iwm_phy_db_chg_txp { - uint32_t space; - uint16_t max_channel_idx; -} __packed; - -/* - * phy db - Receive phy db chunk after calibrations - */ -struct iwm_calib_res_notif_phy_db { - uint16_t type; - uint16_t length; - uint8_t data[]; -} __packed; - /* Target of the IWM_NVM_ACCESS_CMD */ enum { Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:08 2018 (r330162) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:49 2018 (r330163) @@ -314,25 +314,6 @@ enum iwm_hcmd_dataflag { IWM_HCMD_DFL_DUP = (1 << 1), }; -/* - * iwlwifi/iwl-phy-db - */ - -#define IWM_NUM_PAPD_CH_GROUPS 9 -#define IWM_NUM_TXP_CH_GROUPS 9 - -struct iwm_phy_db_entry { - uint16_t size; - uint8_t *data; -}; - -struct iwm_phy_db { - struct iwm_phy_db_entry cfg; - struct iwm_phy_db_entry calib_nch; - struct iwm_phy_db_entry calib_ch_group_papd[IWM_NUM_PAPD_CH_GROUPS]; - struct iwm_phy_db_entry calib_ch_group_txp[IWM_NUM_TXP_CH_GROUPS]; -}; - struct iwm_int_sta { uint32_t sta_id; uint32_t tfd_queue_msk; @@ -473,7 +454,7 @@ struct iwm_softc { struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; struct iwm_nvm_data sc_nvm; - struct iwm_phy_db sc_phy_db; + struct iwm_phy_db *sc_phy_db; struct iwm_bf_data sc_bf; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:40:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C96F5F22DD6; Thu, 1 Mar 2018 05:40:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7BD0380C35; Thu, 1 Mar 2018 05:40:00 +0000 (UTC) (envelope-from eadler@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 76C5E2438D; Thu, 1 Mar 2018 05:40:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215e0Hu026558; Thu, 1 Mar 2018 05:40:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215e0qX026555; Thu, 1 Mar 2018 05:40:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010540.w215e0qX026555@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:40: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: r330164 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330164 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.25 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, 01 Mar 2018 05:40:01 -0000 Author: eadler Date: Thu Mar 1 05:40:00 2018 New Revision: 330164 URL: https://svnweb.freebsd.org/changeset/base/330164 Log: MFC r313310: [iwm] make sure we call iwm_detach_local() only once. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:09:49 2018 (r330163) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:40:00 2018 (r330164) @@ -5743,6 +5743,7 @@ iwm_attach(device_t dev) int txq_i, i; sc->sc_dev = dev; + sc->sc_attached = 1; IWM_LOCK_INIT(sc); mbufq_init(&sc->sc_snd, ifqmaxlen); callout_init_mtx(&sc->sc_watchdog_to, &sc->sc_mtx, 0); @@ -6193,6 +6194,10 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 struct iwm_fw_info *fw = &sc->sc_fw; device_t dev = sc->sc_dev; int i; + + if (!sc->sc_attached) + return 0; + sc->sc_attached = 0; if (do_net80211) ieee80211_draintask(&sc->sc_ic, &sc->sc_es_task); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:09:49 2018 (r330163) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:40:00 2018 (r330164) @@ -369,6 +369,7 @@ struct iwm_node { struct iwm_softc { device_t sc_dev; uint32_t sc_debug; + int sc_attached; struct mtx sc_mtx; struct mbufq sc_snd; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:42:01 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2D8FF232D6; Thu, 1 Mar 2018 05:42:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 64B89812B0; Thu, 1 Mar 2018 05:42:01 +0000 (UTC) (envelope-from eadler@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 46C64244F0; Thu, 1 Mar 2018 05:42:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215g1Te029525; Thu, 1 Mar 2018 05:42:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215g0DJ029520; Thu, 1 Mar 2018 05:42:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010542.w215g0DJ029520@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:42: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: r330165 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330165 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.25 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, 01 Mar 2018 05:42:02 -0000 Author: eadler Date: Thu Mar 1 05:42:00 2018 New Revision: 330165 URL: https://svnweb.freebsd.org/changeset/base/330165 Log: MFC r313311: [iwm] Sync nvm parsing code with Linux iwlwifi. * sc->sc_nvm becomes sc->nvm_data and is now a pointer instead of an inlined struct. * Add sc->eeprom_size and sc->nvm_hw_section_num configuration values to struct iwm_softc. * For now continue to avoid negative error return-values, and use pointer variables for some return values, as before. * Continue to omit LAR (location aware regulatory) related code as well. Tested: * Intel 7260, STA mode (2GHz) Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:42:00 2018 (r330165) @@ -260,20 +260,23 @@ static int iwm_post_alive(struct iwm_softc *); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *, - uint16_t *, size_t); + uint16_t *, uint32_t); static uint32_t iwm_eeprom_channel_flags(uint16_t); static void iwm_add_channel_band(struct iwm_softc *, struct ieee80211_channel[], int, int *, int, size_t, const uint8_t[]); static void iwm_init_channel_map(struct ieee80211com *, int, int *, struct ieee80211_channel[]); -static int iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *, - const uint16_t *, const uint16_t *, - const uint16_t *, const uint16_t *, - const uint16_t *); -static void iwm_set_hw_address_8000(struct iwm_softc *, - struct iwm_nvm_data *, - const uint16_t *, const uint16_t *); +static struct iwm_nvm_data * + iwm_parse_nvm_data(struct iwm_softc *, const uint16_t *, + const uint16_t *, const uint16_t *, + const uint16_t *, const uint16_t *, + const uint16_t *); +static void iwm_free_nvm_data(struct iwm_nvm_data *); +static void iwm_set_hw_address_family_8000(struct iwm_softc *, + struct iwm_nvm_data *, + const uint16_t *, + const uint16_t *); static int iwm_get_sku(const struct iwm_softc *, const uint16_t *, const uint16_t *); static int iwm_get_nvm_version(const struct iwm_softc *, const uint16_t *); @@ -283,8 +286,8 @@ static int iwm_get_n_hw_addrs(const struct iwm_softc * const uint16_t *); static void iwm_set_radio_cfg(const struct iwm_softc *, struct iwm_nvm_data *, uint32_t); -static int iwm_parse_nvm_sections(struct iwm_softc *, - struct iwm_nvm_section *); +static struct iwm_nvm_data * + iwm_parse_nvm_sections(struct iwm_softc *, struct iwm_nvm_section *); static int iwm_nvm_init(struct iwm_softc *); static int iwm_firmware_load_sect(struct iwm_softc *, uint32_t, const uint8_t *, uint32_t); @@ -1646,21 +1649,11 @@ iwm_post_alive(struct iwm_softc *sc) * iwlwifi/mvm/nvm.c */ -/* list of NVM sections we are allowed/need to read */ -const int nvm_to_read[] = { - IWM_NVM_SECTION_TYPE_HW, - IWM_NVM_SECTION_TYPE_SW, - IWM_NVM_SECTION_TYPE_REGULATORY, - IWM_NVM_SECTION_TYPE_CALIBRATION, - IWM_NVM_SECTION_TYPE_PRODUCTION, - IWM_NVM_SECTION_TYPE_HW_8000, - IWM_NVM_SECTION_TYPE_MAC_OVERRIDE, - IWM_NVM_SECTION_TYPE_PHY_SKU, -}; +#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 +#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 /* Default NVM size to read */ #define IWM_NVM_DEFAULT_CHUNK_SIZE (2*1024) -#define IWM_MAX_NVM_SECTION_SIZE 8192 #define IWM_NVM_WRITE_OPCODE 1 #define IWM_NVM_READ_OPCODE 0 @@ -1675,7 +1668,6 @@ static int iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t section, uint16_t offset, uint16_t length, uint8_t *data, uint16_t *len) { - offset = 0; struct iwm_nvm_access_cmd nvm_access_cmd = { .offset = htole16(offset), .length = htole16(length), @@ -1702,17 +1694,9 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect } pkt = cmd.resp_pkt; - if (pkt->hdr.flags & IWM_CMD_FAILED_MSK) { - device_printf(sc->sc_dev, - "Bad return from IWM_NVM_ACCES_COMMAND (0x%08X)\n", - pkt->hdr.flags); - ret = EIO; - goto exit; - } /* Extract NVM response */ nvm_resp = (void *)pkt->data; - ret = le16toh(nvm_resp->status); bytes_read = le16toh(nvm_resp->length); offset_read = le16toh(nvm_resp->offset); @@ -1758,6 +1742,7 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect goto exit; } + /* Write data to NVM */ memcpy(data + offset, resp_data, bytes_read); *len = bytes_read; @@ -1778,34 +1763,40 @@ iwm_nvm_read_chunk(struct iwm_softc *sc, uint16_t sect */ static int iwm_nvm_read_section(struct iwm_softc *sc, - uint16_t section, uint8_t *data, uint16_t *len, size_t max_len) + uint16_t section, uint8_t *data, uint16_t *len, uint32_t size_read) { - uint16_t chunklen, seglen; - int error = 0; + uint16_t seglen, length, offset = 0; + int ret; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "reading NVM section %d\n", section); + /* Set nvm section read length */ + length = IWM_NVM_DEFAULT_CHUNK_SIZE; - chunklen = seglen = IWM_NVM_DEFAULT_CHUNK_SIZE; - *len = 0; + seglen = length; - /* Read NVM chunks until exhausted (reading less than requested) */ - while (seglen == chunklen && *len < max_len) { - error = iwm_nvm_read_chunk(sc, - section, *len, chunklen, data, &seglen); - if (error) { - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "Cannot read from NVM section " - "%d at offset %d\n", section, *len); - return error; + /* Read the NVM until exhausted (reading less than requested) */ + while (seglen == length) { + /* Check no memory assumptions fail and cause an overflow */ + if ((size_read + offset + length) > + sc->eeprom_size) { + device_printf(sc->sc_dev, + "EEPROM size is too small for NVM\n"); + return ENOBUFS; } - *len += seglen; + + ret = iwm_nvm_read_chunk(sc, section, offset, length, data, &seglen); + if (ret) { + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "Cannot read NVM from section %d offset %d, length %d\n", + section, offset, length); + return ret; + } + offset += seglen; } - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "NVM section %d read completed (%d bytes, error=%d)\n", - section, *len, error); - return error; + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "NVM section %d read completed\n", section); + *len = offset; + return 0; } /* @@ -1889,7 +1880,7 @@ enum nvm_sku_bits { * @IWM_NVM_CHANNEL_IBSS: usable as an IBSS channel * @IWM_NVM_CHANNEL_ACTIVE: active scanning allowed * @IWM_NVM_CHANNEL_RADAR: radar detection required - * XXX cannot find this (DFS) flag in iwl-nvm-parse.c + * XXX cannot find this (DFS) flag in iwm-nvm-parse.c * @IWM_NVM_CHANNEL_DFS: dynamic freq selection candidate * @IWM_NVM_CHANNEL_WIDE: 20 MHz channel okay (?) * @IWM_NVM_CHANNEL_40MHZ: 40 MHz channel okay (?) @@ -1908,6 +1899,10 @@ enum iwm_nvm_channel_flags { IWM_NVM_CHANNEL_160MHZ = (1 << 11), }; +/* lower blocks contain EEPROM image and calibration data */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ + /* * Translate EEPROM flags to net80211. */ @@ -1935,7 +1930,7 @@ iwm_add_channel_band(struct iwm_softc *sc, struct ieee int maxchans, int *nchans, int ch_idx, size_t ch_num, const uint8_t bands[]) { - const uint16_t * const nvm_ch_flags = sc->sc_nvm.nvm_ch_flags; + const uint16_t * const nvm_ch_flags = sc->nvm_data->nvm_ch_flags; uint32_t nflags; uint16_t ch_flags; uint8_t ieee; @@ -1976,7 +1971,7 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxc struct ieee80211_channel chans[]) { struct iwm_softc *sc = ic->ic_softc; - struct iwm_nvm_data *data = &sc->sc_nvm; + struct iwm_nvm_data *data = sc->nvm_data; uint8_t bands[IEEE80211_MODE_BYTES]; size_t ch_num; @@ -2005,7 +2000,7 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxc } static void -iwm_set_hw_address_8000(struct iwm_softc *sc, struct iwm_nvm_data *data, +iwm_set_hw_address_family_8000(struct iwm_softc *sc, struct iwm_nvm_data *data, const uint16_t *mac_override, const uint16_t *nvm_hw) { const uint8_t *hw_addr; @@ -2128,15 +2123,57 @@ iwm_set_radio_cfg(const struct iwm_softc *sc, struct i } static int +iwm_set_hw_address(struct iwm_softc *sc, struct iwm_nvm_data *data, + const uint16_t *nvm_hw, const uint16_t *mac_override) +{ +#ifdef notyet /* for FAMILY 9000 */ + if (cfg->mac_addr_from_csr) { + iwm_set_hw_address_from_csr(sc, data); + } else +#endif + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + const uint8_t *hw_addr = (const uint8_t *)(nvm_hw + IWM_HW_ADDR); + + /* The byte order is little endian 16 bit, meaning 214365 */ + data->hw_addr[0] = hw_addr[1]; + data->hw_addr[1] = hw_addr[0]; + data->hw_addr[2] = hw_addr[3]; + data->hw_addr[3] = hw_addr[2]; + data->hw_addr[4] = hw_addr[5]; + data->hw_addr[5] = hw_addr[4]; + } else { + iwm_set_hw_address_family_8000(sc, data, mac_override, nvm_hw); + } + + if (!iwm_is_valid_ether_addr(data->hw_addr)) { + device_printf(sc->sc_dev, "no valid mac address was found\n"); + return EINVAL; + } + + return 0; +} + +static struct iwm_nvm_data * iwm_parse_nvm_data(struct iwm_softc *sc, const uint16_t *nvm_hw, const uint16_t *nvm_sw, const uint16_t *nvm_calib, const uint16_t *mac_override, const uint16_t *phy_sku, const uint16_t *regulatory) { - struct iwm_nvm_data *data = &sc->sc_nvm; - uint8_t hw_addr[IEEE80211_ADDR_LEN]; + struct iwm_nvm_data *data; uint32_t sku, radio_cfg; + if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + data = malloc(sizeof(*data) + + IWM_NUM_CHANNELS * sizeof(uint16_t), + M_DEVBUF, M_NOWAIT | M_ZERO); + } else { + data = malloc(sizeof(*data) + + IWM_NUM_CHANNELS_8000 * sizeof(uint16_t), + M_DEVBUF, M_NOWAIT | M_ZERO); + } + if (!data) + return NULL; + data->nvm_version = iwm_get_nvm_version(sc, nvm_sw); radio_cfg = iwm_get_radio_cfg(sc, nvm_sw, phy_sku); @@ -2149,17 +2186,10 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->n_hw_addrs = iwm_get_n_hw_addrs(sc, nvm_sw); - /* The byte order is little endian 16 bit, meaning 214365 */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { - IEEE80211_ADDR_COPY(hw_addr, nvm_hw + IWM_HW_ADDR); - data->hw_addr[0] = hw_addr[1]; - data->hw_addr[1] = hw_addr[0]; - data->hw_addr[2] = hw_addr[3]; - data->hw_addr[3] = hw_addr[2]; - data->hw_addr[4] = hw_addr[5]; - data->hw_addr[5] = hw_addr[4]; - } else { - iwm_set_hw_address_8000(sc, data, mac_override, nvm_hw); + /* If no valid mac address was found - bail out */ + if (iwm_set_hw_address(sc, data, nvm_hw, mac_override)) { + free(data, M_DEVBUF); + return NULL; } if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { @@ -2170,14 +2200,17 @@ iwm_parse_nvm_data(struct iwm_softc *sc, IWM_NUM_CHANNELS_8000 * sizeof(uint16_t)); } - return 0; + return data; } -/* - * END NVM PARSE - */ +static void +iwm_free_nvm_data(struct iwm_nvm_data *data) +{ + if (data != NULL) + free(data, M_DEVBUF); +} -static int +static struct iwm_nvm_data * iwm_parse_nvm_sections(struct iwm_softc *sc, struct iwm_nvm_section *sections) { const uint16_t *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; @@ -2185,42 +2218,38 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw /* Checking for required sections */ if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { if (!sections[IWM_NVM_SECTION_TYPE_SW].data || - !sections[IWM_NVM_SECTION_TYPE_HW].data) { + !sections[sc->nvm_hw_section_num].data) { device_printf(sc->sc_dev, "Can't parse empty OTP/NVM sections\n"); - return ENOENT; + return NULL; } - - hw = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_HW].data; } else if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { /* SW and REGULATORY sections are mandatory */ if (!sections[IWM_NVM_SECTION_TYPE_SW].data || !sections[IWM_NVM_SECTION_TYPE_REGULATORY].data) { device_printf(sc->sc_dev, "Can't parse empty OTP/NVM sections\n"); - return ENOENT; + return NULL; } /* MAC_OVERRIDE or at least HW section must exist */ - if (!sections[IWM_NVM_SECTION_TYPE_HW_8000].data && + if (!sections[sc->nvm_hw_section_num].data && !sections[IWM_NVM_SECTION_TYPE_MAC_OVERRIDE].data) { device_printf(sc->sc_dev, "Can't parse mac_address, empty sections\n"); - return ENOENT; + return NULL; } /* PHY_SKU section is mandatory in B0 */ if (!sections[IWM_NVM_SECTION_TYPE_PHY_SKU].data) { device_printf(sc->sc_dev, "Can't parse phy_sku in B0, empty sections\n"); - return ENOENT; + return NULL; } - - hw = (const uint16_t *) - sections[IWM_NVM_SECTION_TYPE_HW_8000].data; } else { panic("unknown device family %d\n", sc->sc_device_family); } + hw = (const uint16_t *) sections[sc->nvm_hw_section_num].data; sw = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_SW].data; calib = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_CALIBRATION].data; @@ -2237,46 +2266,57 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw static int iwm_nvm_init(struct iwm_softc *sc) { - struct iwm_nvm_section nvm_sections[IWM_NVM_NUM_OF_SECTIONS]; - int i, section, error; + struct iwm_nvm_section nvm_sections[IWM_NVM_MAX_NUM_SECTIONS]; + int i, ret, section; + uint32_t size_read = 0; + uint8_t *nvm_buffer, *temp; uint16_t len; - uint8_t *buf; - const size_t bufsz = IWM_MAX_NVM_SECTION_SIZE; - memset(nvm_sections, 0 , sizeof(nvm_sections)); + memset(nvm_sections, 0, sizeof(nvm_sections)); - buf = malloc(bufsz, M_DEVBUF, M_NOWAIT); - if (buf == NULL) - return ENOMEM; + if (sc->nvm_hw_section_num >= IWM_NVM_MAX_NUM_SECTIONS) + return EINVAL; - for (i = 0; i < nitems(nvm_to_read); i++) { - section = nvm_to_read[i]; - KASSERT(section <= nitems(nvm_sections), - ("too many sections")); + /* load NVM values from nic */ + /* Read From FW NVM */ + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, "Read from NVM\n"); - error = iwm_nvm_read_section(sc, section, buf, &len, bufsz); - if (error) { - error = 0; + nvm_buffer = malloc(sc->eeprom_size, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!nvm_buffer) + return ENOMEM; + for (section = 0; section < IWM_NVM_MAX_NUM_SECTIONS; section++) { + /* we override the constness for initial read */ + ret = iwm_nvm_read_section(sc, section, nvm_buffer, + &len, size_read); + if (ret) continue; - } - nvm_sections[section].data = malloc(len, M_DEVBUF, M_NOWAIT); - if (nvm_sections[section].data == NULL) { - error = ENOMEM; + size_read += len; + temp = malloc(len, M_DEVBUF, M_NOWAIT); + if (!temp) { + ret = ENOMEM; break; } - memcpy(nvm_sections[section].data, buf, len); + memcpy(temp, nvm_buffer, len); + + nvm_sections[section].data = temp; nvm_sections[section].length = len; } - free(buf, M_DEVBUF); - if (error == 0) - error = iwm_parse_nvm_sections(sc, nvm_sections); + if (!size_read) + device_printf(sc->sc_dev, "OTP is blank\n"); + free(nvm_buffer, M_DEVBUF); - for (i = 0; i < IWM_NVM_NUM_OF_SECTIONS; i++) { + sc->nvm_data = iwm_parse_nvm_sections(sc, nvm_sections); + if (!sc->nvm_data) + return EINVAL; + IWM_DPRINTF(sc, IWM_DEBUG_EEPROM | IWM_DEBUG_RESET, + "nvm version = %x\n", sc->nvm_data->nvm_version); + + for (i = 0; i < IWM_NVM_MAX_NUM_SECTIONS; i++) { if (nvm_sections[i].data != NULL) free(nvm_sections[i].data, M_DEVBUF); } - return error; + return 0; } /* @@ -2673,7 +2713,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn device_printf(sc->sc_dev, "failed to read nvm\n"); return error; } - IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->sc_nvm.hw_addr); + IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->nvm_data->hw_addr); return 0; } @@ -2694,7 +2734,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn __func__, ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) >> IWM_FW_PHY_CFG_TX_CHAIN_POS), - sc->sc_nvm.valid_tx_ant, + sc->nvm_data->valid_tx_ant, iwm_fw_valid_tx_ant(sc)); @@ -5622,6 +5662,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_3160_2: sc->sc_fwname = "iwm3160fw"; sc->host_interrupt_operation_mode = 1; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5629,6 +5671,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_3165_2: sc->sc_fwname = "iwm7265fw"; sc->host_interrupt_operation_mode = 0; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5636,6 +5680,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_7260_2: sc->sc_fwname = "iwm7260fw"; sc->host_interrupt_operation_mode = 1; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5643,6 +5689,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_7265_2: sc->sc_fwname = "iwm7265fw"; sc->host_interrupt_operation_mode = 0; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; sc->sc_device_family = IWM_DEVICE_FAMILY_7000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); @@ -5650,6 +5698,8 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_8260_2: sc->sc_fwname = "iwm8000Cfw"; sc->host_interrupt_operation_mode = 0; + sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000; + sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000; sc->sc_device_family = IWM_DEVICE_FAMILY_8000; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000; return (0); @@ -5968,10 +6018,10 @@ iwm_preinit(void *arg) device_printf(dev, "hw rev 0x%x, fw ver %s, address %s\n", sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK, - sc->sc_fwver, ether_sprintf(sc->sc_nvm.hw_addr)); + sc->sc_fwver, ether_sprintf(sc->nvm_data->hw_addr)); /* not all hardware can do 5GHz band */ - if (!sc->sc_nvm.sku_cap_band_52GHz_enable) + if (!sc->nvm_data->sku_cap_band_52GHz_enable) memset(&ic->ic_sup_rates[IEEE80211_MODE_11A], 0, sizeof(ic->ic_sup_rates[IEEE80211_MODE_11A])); IWM_UNLOCK(sc); @@ -6211,6 +6261,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 iwm_phy_db_free(sc->sc_phy_db); sc->sc_phy_db = NULL; + + iwm_free_nvm_data(sc->nvm_data); /* Free descriptor rings */ iwm_free_rx_ring(sc, &sc->rxq); Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:42:00 2018 (r330165) @@ -407,7 +407,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iw remain -= 3; } - if (sc->sc_nvm.sku_cap_band_52GHz_enable) { + if (sc->nvm_data->sku_cap_band_52GHz_enable) { /* Fill in 5GHz IEs. */ rs = &ic->ic_sup_rates[IEEE80211_MODE_11A]; if (rs->rs_nrates > IEEE80211_RATE_SIZE) { @@ -674,7 +674,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); req->flags = htole32(IWM_PHY_BAND_24); - if (sc->sc_nvm.sku_cap_band_52GHz_enable) + if (sc->nvm_data->sku_cap_band_52GHz_enable) req->flags |= htole32(IWM_PHY_BAND_5); req->filter_flags = htole32(IWM_MAC_FILTER_ACCEPT_GRP | IWM_MAC_FILTER_IN_BEACON); Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:42:00 2018 (r330165) @@ -437,8 +437,8 @@ iwm_fw_valid_tx_ant(struct iwm_softc *sc) tx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) >> IWM_FW_PHY_CFG_TX_CHAIN_POS); - if (sc->sc_nvm.valid_tx_ant) - tx_ant &= sc->sc_nvm.valid_tx_ant; + if (sc->nvm_data->valid_tx_ant) + tx_ant &= sc->nvm_data->valid_tx_ant; return tx_ant; } @@ -451,8 +451,8 @@ iwm_fw_valid_rx_ant(struct iwm_softc *sc) rx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RX_CHAIN) >> IWM_FW_PHY_CFG_RX_CHAIN_POS); - if (sc->sc_nvm.valid_rx_ant) - rx_ant &= sc->sc_nvm.valid_rx_ant; + if (sc->nvm_data->valid_rx_ant) + rx_ant &= sc->nvm_data->valid_rx_ant; return rx_ant; } Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:42:00 2018 (r330165) @@ -2023,18 +2023,13 @@ enum { /* Section types for IWM_NVM_ACCESS_CMD */ enum { - IWM_NVM_SECTION_TYPE_HW = 0, - IWM_NVM_SECTION_TYPE_SW, - IWM_NVM_SECTION_TYPE_PAPD, - IWM_NVM_SECTION_TYPE_REGULATORY, - IWM_NVM_SECTION_TYPE_CALIBRATION, - IWM_NVM_SECTION_TYPE_PRODUCTION, - IWM_NVM_SECTION_TYPE_POST_FCS_CALIB, - /* 7, 8, 9 unknown */ - IWM_NVM_SECTION_TYPE_HW_8000 = 10, - IWM_NVM_SECTION_TYPE_MAC_OVERRIDE, - IWM_NVM_SECTION_TYPE_PHY_SKU, - IWM_NVM_NUM_OF_SECTIONS, + IWM_NVM_SECTION_TYPE_SW = 1, + IWM_NVM_SECTION_TYPE_REGULATORY = 3, + IWM_NVM_SECTION_TYPE_CALIBRATION = 4, + IWM_NVM_SECTION_TYPE_PRODUCTION = 5, + IWM_NVM_SECTION_TYPE_MAC_OVERRIDE = 11, + IWM_NVM_SECTION_TYPE_PHY_SKU = 12, + IWM_NVM_MAX_NUM_SECTIONS = 13, }; /** Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:40:00 2018 (r330164) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:42:00 2018 (r330165) @@ -192,10 +192,10 @@ struct iwm_nvm_data { #define IWM_NUM_CHANNELS 39 #define IWM_NUM_CHANNELS_8000 51 - uint16_t nvm_ch_flags[IWM_NUM_CHANNELS_8000]; - uint16_t nvm_version; uint8_t max_tx_pwr_half_dbm; + + uint16_t nvm_ch_flags[]; }; /* max bufs per tfd the driver will use */ @@ -291,10 +291,6 @@ struct iwm_ucode_status { #define IWM_CMD_RESP_MAX PAGE_SIZE -/* lower blocks contain EEPROM image and calibration data */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 16384 -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 32768 - #define IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS 500 #define IWM_MVM_TE_SESSION_PROTECTION_MIN_TIME_MS 400 @@ -454,7 +450,7 @@ struct iwm_softc { int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; - struct iwm_nvm_data sc_nvm; + struct iwm_nvm_data *nvm_data; struct iwm_phy_db *sc_phy_db; struct iwm_bf_data sc_bf; @@ -492,6 +488,9 @@ struct iwm_softc { struct iwm_tx_radiotap_header sc_txtap; int sc_max_rssi; + + uint16_t eeprom_size; + uint8_t nvm_hw_section_num; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:43:11 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DD23DF234CB; Thu, 1 Mar 2018 05:43:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8826C815F8; Thu, 1 Mar 2018 05:43:10 +0000 (UTC) (envelope-from eadler@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 82DE12451F; Thu, 1 Mar 2018 05:43:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215hARc031191; Thu, 1 Mar 2018 05:43:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215hAa0031188; Thu, 1 Mar 2018 05:43:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010543.w215hAa0031188@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:43: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: r330166 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330166 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.25 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, 01 Mar 2018 05:43:11 -0000 Author: eadler Date: Thu Mar 1 05:43:10 2018 New Revision: 330166 URL: https://svnweb.freebsd.org/changeset/base/330166 Log: MFC r313312: [iwm] Use chipset configuration structs like iwlwifi does. * This makes it a bit easier to factor out common parts for e.g. the 7000 chipset family. * Add iwm7265d config, and recognize the 7265D chipset variant via the hardware revision. Tested: * 7260, STA mode (2ghz) Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:42:00 2018 (r330165) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:43:10 2018 (r330166) @@ -165,6 +165,67 @@ __FBSDID("$FreeBSD$"); #include #include +#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 +#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 + +/* lower blocks contain EEPROM image and calibration data */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ + +#define IWM7260_FW "iwm7260fw" +#define IWM3160_FW "iwm3160fw" +#define IWM7265_FW "iwm7265fw" +#define IWM7265D_FW "iwm7265Dfw" +#define IWM8000_FW "iwm8000Cfw" + +#define IWM_DEVICE_7000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_7000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000 + +const struct iwm_cfg iwm7260_cfg = { + .fw_name = IWM7260_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3160_cfg = { + .fw_name = IWM3160_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3165_cfg = { + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265_cfg = { + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265d_cfg = { + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +#define IWM_DEVICE_8000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_8000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000 + +const struct iwm_cfg iwm8260_cfg = { + .fw_name = IWM8000_FW, + IWM_DEVICE_8000_COMMON, + .host_interrupt_operation_mode = 0, +}; + const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, @@ -512,12 +573,12 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode * fw_fp will be set. */ IWM_UNLOCK(sc); - fwp = firmware_get(sc->sc_fwname); + fwp = firmware_get(sc->cfg->fw_name); IWM_LOCK(sc); if (fwp == NULL) { device_printf(sc->sc_dev, "could not read firmware %s (error %d)\n", - sc->sc_fwname, error); + sc->cfg->fw_name, error); goto out; } fw->fw_fp = fwp; @@ -536,7 +597,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode if (*(const uint32_t *)fw->fw_fp->data != 0 || le32toh(uhdr->magic) != IWM_TLV_UCODE_MAGIC) { device_printf(sc->sc_dev, "invalid firmware %s\n", - sc->sc_fwname); + sc->cfg->fw_name); error = EINVAL; goto out; } @@ -1370,7 +1431,7 @@ iwm_mvm_nic_config(struct iwm_softc *sc) * (PCIe power is lost before PERST# is asserted), causing ME FW * to lose ownership and not being able to obtain it back. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { iwm_set_bits_mask_prph(sc, IWM_APMG_PS_CTRL_REG, IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS, ~IWM_APMG_PS_CTRL_EARLY_PWR_OFF_RESET_DIS); @@ -1416,7 +1477,7 @@ iwm_nic_rx_init(struct iwm_softc *sc) IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF); /* W/A for interrupt coalescing bug in 7260 and 3160 */ - if (sc->host_interrupt_operation_mode) + if (sc->cfg->host_interrupt_operation_mode) IWM_SETBITS(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_OPER_MODE); /* @@ -1473,7 +1534,7 @@ iwm_nic_init(struct iwm_softc *sc) int error; iwm_apm_init(sc); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_set_pwr(sc); iwm_mvm_nic_config(sc); @@ -1633,7 +1694,7 @@ iwm_post_alive(struct iwm_softc *sc) IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); /* Enable L1-Active */ - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); } @@ -1649,9 +1710,6 @@ iwm_post_alive(struct iwm_softc *sc) * iwlwifi/mvm/nvm.c */ -#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 -#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 - /* Default NVM size to read */ #define IWM_NVM_DEFAULT_CHUNK_SIZE (2*1024) @@ -1777,7 +1835,7 @@ iwm_nvm_read_section(struct iwm_softc *sc, while (seglen == length) { /* Check no memory assumptions fail and cause an overflow */ if ((size_read + offset + length) > - sc->eeprom_size) { + sc->cfg->eeprom_size) { device_printf(sc->sc_dev, "EEPROM size is too small for NVM\n"); return ENOBUFS; @@ -1899,10 +1957,6 @@ enum iwm_nvm_channel_flags { IWM_NVM_CHANNEL_160MHZ = (1 << 11), }; -/* lower blocks contain EEPROM image and calibration data */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ - /* * Translate EEPROM flags to net80211. */ @@ -1938,7 +1992,7 @@ iwm_add_channel_band(struct iwm_softc *sc, struct ieee for (; ch_idx < ch_num; ch_idx++) { ch_flags = le16_to_cpup(nvm_ch_flags + ch_idx); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) ieee = iwm_nvm_channels[ch_idx]; else ieee = iwm_nvm_channels_8000[ch_idx]; @@ -1988,7 +2042,7 @@ iwm_init_channel_map(struct ieee80211com *ic, int maxc IWM_NUM_2GHZ_CHANNELS - 1, IWM_NUM_2GHZ_CHANNELS, bands); if (data->sku_cap_band_52GHz_enable) { - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) ch_num = nitems(iwm_nvm_channels); else ch_num = nitems(iwm_nvm_channels_8000); @@ -2062,7 +2116,7 @@ static int iwm_get_sku(const struct iwm_softc *sc, const uint16_t *nvm_sw, const uint16_t *phy_sku) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_SKU); return le32_to_cpup((const uint32_t *)(phy_sku + IWM_SKU_8000)); @@ -2071,7 +2125,7 @@ iwm_get_sku(const struct iwm_softc *sc, const uint16_t static int iwm_get_nvm_version(const struct iwm_softc *sc, const uint16_t *nvm_sw) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_NVM_VERSION); else return le32_to_cpup((const uint32_t *)(nvm_sw + @@ -2082,7 +2136,7 @@ static int iwm_get_radio_cfg(const struct iwm_softc *sc, const uint16_t *nvm_sw, const uint16_t *phy_sku) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_RADIO_CFG); return le32_to_cpup((const uint32_t *)(phy_sku + IWM_RADIO_CFG_8000)); @@ -2093,7 +2147,7 @@ iwm_get_n_hw_addrs(const struct iwm_softc *sc, const u { int n_hw_addr; - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) return le16_to_cpup(nvm_sw + IWM_N_HW_ADDRS); n_hw_addr = le32_to_cpup((const uint32_t *)(nvm_sw + IWM_N_HW_ADDRS_8000)); @@ -2105,7 +2159,7 @@ static void iwm_set_radio_cfg(const struct iwm_softc *sc, struct iwm_nvm_data *data, uint32_t radio_cfg) { - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { data->radio_cfg_type = IWM_NVM_RF_CFG_TYPE_MSK(radio_cfg); data->radio_cfg_step = IWM_NVM_RF_CFG_STEP_MSK(radio_cfg); data->radio_cfg_dash = IWM_NVM_RF_CFG_DASH_MSK(radio_cfg); @@ -2131,7 +2185,7 @@ iwm_set_hw_address(struct iwm_softc *sc, struct iwm_nv iwm_set_hw_address_from_csr(sc, data); } else #endif - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { const uint8_t *hw_addr = (const uint8_t *)(nvm_hw + IWM_HW_ADDR); /* The byte order is little endian 16 bit, meaning 214365 */ @@ -2162,7 +2216,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, struct iwm_nvm_data *data; uint32_t sku, radio_cfg; - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { data = malloc(sizeof(*data) + IWM_NUM_CHANNELS * sizeof(uint16_t), M_DEVBUF, M_NOWAIT | M_ZERO); @@ -2192,7 +2246,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, return NULL; } - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { memcpy(data->nvm_ch_flags, &nvm_sw[IWM_NVM_CHANNELS], IWM_NUM_CHANNELS * sizeof(uint16_t)); } else { @@ -2216,14 +2270,14 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw const uint16_t *hw, *sw, *calib, *regulatory, *mac_override, *phy_sku; /* Checking for required sections */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { if (!sections[IWM_NVM_SECTION_TYPE_SW].data || - !sections[sc->nvm_hw_section_num].data) { + !sections[sc->cfg->nvm_hw_section_num].data) { device_printf(sc->sc_dev, "Can't parse empty OTP/NVM sections\n"); return NULL; } - } else if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { + } else if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { /* SW and REGULATORY sections are mandatory */ if (!sections[IWM_NVM_SECTION_TYPE_SW].data || !sections[IWM_NVM_SECTION_TYPE_REGULATORY].data) { @@ -2232,7 +2286,7 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw return NULL; } /* MAC_OVERRIDE or at least HW section must exist */ - if (!sections[sc->nvm_hw_section_num].data && + if (!sections[sc->cfg->nvm_hw_section_num].data && !sections[IWM_NVM_SECTION_TYPE_MAC_OVERRIDE].data) { device_printf(sc->sc_dev, "Can't parse mac_address, empty sections\n"); @@ -2246,10 +2300,10 @@ iwm_parse_nvm_sections(struct iwm_softc *sc, struct iw return NULL; } } else { - panic("unknown device family %d\n", sc->sc_device_family); + panic("unknown device family %d\n", sc->cfg->device_family); } - hw = (const uint16_t *) sections[sc->nvm_hw_section_num].data; + hw = (const uint16_t *) sections[sc->cfg->nvm_hw_section_num].data; sw = (const uint16_t *)sections[IWM_NVM_SECTION_TYPE_SW].data; calib = (const uint16_t *) sections[IWM_NVM_SECTION_TYPE_CALIBRATION].data; @@ -2274,14 +2328,14 @@ iwm_nvm_init(struct iwm_softc *sc) memset(nvm_sections, 0, sizeof(nvm_sections)); - if (sc->nvm_hw_section_num >= IWM_NVM_MAX_NUM_SECTIONS) + if (sc->cfg->nvm_hw_section_num >= IWM_NVM_MAX_NUM_SECTIONS) return EINVAL; /* load NVM values from nic */ /* Read From FW NVM */ IWM_DPRINTF(sc, IWM_DEBUG_EEPROM, "Read from NVM\n"); - nvm_buffer = malloc(sc->eeprom_size, M_DEVBUF, M_NOWAIT | M_ZERO); + nvm_buffer = malloc(sc->cfg->eeprom_size, M_DEVBUF, M_NOWAIT | M_ZERO); if (!nvm_buffer) return ENOMEM; for (section = 0; section < IWM_NVM_MAX_NUM_SECTIONS; section++) { @@ -2562,7 +2616,7 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode { int error, w; - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) error = iwm_load_firmware_8000(sc, ucode_type); else error = iwm_load_firmware_7000(sc, ucode_type); @@ -2575,7 +2629,7 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode } if (error || !sc->sc_uc.uc_ok) { device_printf(sc->sc_dev, "could not load firmware\n"); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { device_printf(sc->sc_dev, "cpu1 status: 0x%x\n", iwm_read_prph(sc, IWM_SB_CPU_1_STATUS)); device_printf(sc->sc_dev, "cpu2 status: 0x%x\n", @@ -4472,7 +4526,7 @@ iwm_mvm_sf_config(struct iwm_softc *sc, enum iwm_sf_st }; int ret = 0; - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) sf_cmd.state |= htole32(IWM_SF_CFG_DUMMY_NOTIF_OFF); switch (new_state) { @@ -4660,7 +4714,7 @@ iwm_init_hw(struct iwm_softc *sc) } /* Initialize tx backoffs to the minimum. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) iwm_mvm_tt_tx_backoff(sc, 0); error = iwm_mvm_power_update_device(sc); @@ -5656,51 +5710,30 @@ iwm_dev_check(device_t dev) sc = device_get_softc(dev); - sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); switch (pci_get_device(dev)) { case PCI_PRODUCT_INTEL_WL_3160_1: case PCI_PRODUCT_INTEL_WL_3160_2: - sc->sc_fwname = "iwm3160fw"; - sc->host_interrupt_operation_mode = 1; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm3160_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_3165_1: case PCI_PRODUCT_INTEL_WL_3165_2: - sc->sc_fwname = "iwm7265fw"; - sc->host_interrupt_operation_mode = 0; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm3165_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7260_1: case PCI_PRODUCT_INTEL_WL_7260_2: - sc->sc_fwname = "iwm7260fw"; - sc->host_interrupt_operation_mode = 1; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm7260_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7265_1: case PCI_PRODUCT_INTEL_WL_7265_2: - sc->sc_fwname = "iwm7265fw"; - sc->host_interrupt_operation_mode = 0; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000; - sc->sc_device_family = IWM_DEVICE_FAMILY_7000; + sc->cfg = &iwm7265_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_8260_1: case PCI_PRODUCT_INTEL_WL_8260_2: - sc->sc_fwname = "iwm8000Cfw"; - sc->host_interrupt_operation_mode = 0; - sc->eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000; - sc->nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000; - sc->sc_device_family = IWM_DEVICE_FAMILY_8000; + sc->cfg = &iwm8260_cfg; sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000; return (0); default: @@ -5819,16 +5852,14 @@ iwm_attach(device_t dev) if (error != 0) goto fail; + sc->sc_hw_rev = IWM_READ(sc, IWM_CSR_HW_REV); /* - * We now start fiddling with the hardware - */ - /* * In the 8000 HW family the format of the 4 bytes of CSR_HW_REV have * changed, and now the revision step also includes bit 0-1 (no more * "dash" value). To keep hw_rev backwards compatible - we'll store it * in the old format. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) sc->sc_hw_rev = (sc->sc_hw_rev & 0xfff0) | (IWM_CSR_HW_REV_STEP(sc->sc_hw_rev << 2) << 2); @@ -5837,7 +5868,7 @@ iwm_attach(device_t dev) goto fail; } - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { int ret; uint32_t hw_step; @@ -5873,6 +5904,12 @@ iwm_attach(device_t dev) device_printf(sc->sc_dev, "Failed to lock the nic\n"); goto fail; } + } + + /* special-case 7265D, it has the same PCI IDs. */ + if (sc->cfg == &iwm7265_cfg && + (sc->sc_hw_rev & IWM_CSR_HW_REV_TYPE_MSK) == IWM_CSR_HW_REV_TYPE_7265D) { + sc->cfg = &iwm7265d_cfg; } /* Allocate DMA memory for firmware transfers. */ Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:42:00 2018 (r330165) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:43:10 2018 (r330166) @@ -256,7 +256,7 @@ iwm_nic_lock(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - if (sc->sc_device_family == IWM_DEVICE_FAMILY_8000) + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) DELAY(2); if (iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, @@ -425,7 +425,7 @@ iwm_apm_init(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_RESET, "iwm apm start\n"); /* Disable L0S exit timer (platform NMI Work/Around) */ - if (sc->sc_device_family != IWM_DEVICE_FAMILY_8000) { + if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { IWM_SETBITS(sc, IWM_CSR_GIO_CHICKEN_BITS, IWM_CSR_GIO_CHICKEN_BITS_REG_BIT_DIS_L0S_EXIT_TIMER); } @@ -476,7 +476,7 @@ iwm_apm_init(struct iwm_softc *sc) goto out; } - if (sc->host_interrupt_operation_mode) { + if (sc->cfg->host_interrupt_operation_mode) { /* * This is a bit of an abuse - This is needed for 7260 / 3160 * only check host_interrupt_operation_mode even if this is @@ -505,7 +505,7 @@ iwm_apm_init(struct iwm_softc *sc) * do not disable clocks. This preserves any hardware bits already * set by default in "CLK_CTRL_REG" after reset. */ - if (sc->sc_device_family == IWM_DEVICE_FAMILY_7000) { + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); DELAY(20); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:42:00 2018 (r330165) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:43:10 2018 (r330166) @@ -362,6 +362,27 @@ struct iwm_node { #define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) #define IWM_ICT_PADDR_SHIFT 12 +enum iwm_device_family { + IWM_DEVICE_FAMILY_UNDEFINED, + IWM_DEVICE_FAMILY_7000, + IWM_DEVICE_FAMILY_8000, +}; + +/** + * struct iwm_cfg + * @fw_name: Firmware filename. + * @host_interrupt_operation_mode: device needs host interrupt operation + * mode set + * @nvm_hw_section_num: the ID of the HW NVM section + */ +struct iwm_cfg { + const char *fw_name; + uint16_t eeprom_size; + enum iwm_device_family device_family; + int host_interrupt_operation_mode; + uint8_t nvm_hw_section_num; +}; + struct iwm_softc { device_t sc_dev; uint32_t sc_debug; @@ -410,9 +431,6 @@ struct iwm_softc { int sc_hw_rev; int sc_hw_id; - int sc_device_family; -#define IWM_DEVICE_FAMILY_7000 1 -#define IWM_DEVICE_FAMILY_8000 2 struct iwm_dma_info kw_dma; struct iwm_dma_info fw_dma; @@ -444,12 +462,12 @@ struct iwm_softc { */ int sc_generation; - const char *sc_fwname; bus_size_t sc_fwdmasegsz; struct iwm_fw_info sc_fw; int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; + const struct iwm_cfg *cfg; struct iwm_nvm_data *nvm_data; struct iwm_phy_db *sc_phy_db; @@ -480,17 +498,12 @@ struct iwm_softc { struct iwm_notif_statistics sc_stats; int sc_noise; - int host_interrupt_operation_mode; - caddr_t sc_drvbpf; struct iwm_rx_radiotap_header sc_rxtap; struct iwm_tx_radiotap_header sc_txtap; int sc_max_rssi; - - uint16_t eeprom_size; - uint8_t nvm_hw_section_num; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:44:17 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2077F23662; Thu, 1 Mar 2018 05:44:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 72B00818B2; Thu, 1 Mar 2018 05:44:17 +0000 (UTC) (envelope-from eadler@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 6D12A24521; Thu, 1 Mar 2018 05:44:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215iHbF031298; Thu, 1 Mar 2018 05:44:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215iGSi031292; Thu, 1 Mar 2018 05:44:16 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010544.w215iGSi031292@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:44:16 +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: r330167 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330167 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.25 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, 01 Mar 2018 05:44:18 -0000 Author: eadler Date: Thu Mar 1 05:44:16 2018 New Revision: 330167 URL: https://svnweb.freebsd.org/changeset/base/330167 Log: MFC r313314: [iwm] Sync valid_tx_ant and valid_rx_ant mask handling with iwlwifi. * This fixes the phy_cfg field sent in the iwm_send_phy_cfg_cmd() command, which wasn't taking into account the valid_rx_ant and valid_tx_ant masks from nvm_data before. Tested: * 7260, STA mode, 2G and 5G Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:44:16 2018 (r330167) @@ -771,8 +771,14 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode (int) tlv_len); goto parse_out; } - sc->sc_fw_phy_config = + sc->sc_fw.phy_config = le32toh(*(const uint32_t *)tlv_data); + sc->sc_fw.valid_tx_ant = (sc->sc_fw.phy_config & + IWM_FW_PHY_CFG_TX_CHAIN) >> + IWM_FW_PHY_CFG_TX_CHAIN_POS; + sc->sc_fw.valid_rx_ant = (sc->sc_fw.phy_config & + IWM_FW_PHY_CFG_RX_CHAIN) >> + IWM_FW_PHY_CFG_RX_CHAIN_POS; break; case IWM_UCODE_TLV_API_CHANGES_SET: { @@ -1401,12 +1407,13 @@ iwm_mvm_nic_config(struct iwm_softc *sc) { uint8_t radio_cfg_type, radio_cfg_step, radio_cfg_dash; uint32_t reg_val = 0; + uint32_t phy_config = iwm_mvm_get_phy_config(sc); - radio_cfg_type = (sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RADIO_TYPE) >> + radio_cfg_type = (phy_config & IWM_FW_PHY_CFG_RADIO_TYPE) >> IWM_FW_PHY_CFG_RADIO_TYPE_POS; - radio_cfg_step = (sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RADIO_STEP) >> + radio_cfg_step = (phy_config & IWM_FW_PHY_CFG_RADIO_STEP) >> IWM_FW_PHY_CFG_RADIO_STEP_POS; - radio_cfg_dash = (sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RADIO_DASH) >> + radio_cfg_dash = (phy_config & IWM_FW_PHY_CFG_RADIO_DASH) >> IWM_FW_PHY_CFG_RADIO_DASH_POS; /* SKU control */ @@ -2696,7 +2703,7 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) enum iwm_ucode_type ucode_type = sc->sc_uc_current; /* Set parameters */ - phy_cfg_cmd.phy_cfg = htole32(sc->sc_fw_phy_config); + phy_cfg_cmd.phy_cfg = htole32(iwm_mvm_get_phy_config(sc)); phy_cfg_cmd.calib_control.event_trigger = sc->sc_default_calib[ucode_type].event_trigger; phy_cfg_cmd.calib_control.flow_trigger = @@ -2783,6 +2790,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn if (error != 0) return error; +#if 0 IWM_DPRINTF(sc, IWM_DEBUG_RESET, "%s: phy_txant=0x%08x, nvm_valid_tx_ant=0x%02x, valid=0x%02x\n", __func__, @@ -2790,10 +2798,11 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn >> IWM_FW_PHY_CFG_TX_CHAIN_POS), sc->nvm_data->valid_tx_ant, iwm_fw_valid_tx_ant(sc)); +#endif - /* Send TX valid antennas before triggering calibrations */ - if ((error = iwm_send_tx_ant_cfg(sc, iwm_fw_valid_tx_ant(sc))) != 0) { + error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + if (error != 0) { device_printf(sc->sc_dev, "failed to send antennas before calibration: %d\n", error); return error; @@ -4212,11 +4221,11 @@ iwm_setrates(struct iwm_softc *sc, struct iwm_node *in #if 0 if (txant == 0) - txant = iwm_fw_valid_tx_ant(sc); + txant = iwm_mvm_get_valid_tx_ant(sc); nextant = 1<<(ffs(txant)-1); txant &= ~nextant; #else - nextant = iwm_fw_valid_tx_ant(sc); + nextant = iwm_mvm_get_valid_tx_ant(sc); #endif /* * Map the rate id into a rate index into @@ -4682,7 +4691,8 @@ iwm_init_hw(struct iwm_softc *sc) goto error; } - if ((error = iwm_send_tx_ant_cfg(sc, iwm_fw_valid_tx_ant(sc))) != 0) { + error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + if (error != 0) { device_printf(sc->sc_dev, "antenna config failed\n"); goto error; } Modified: stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 05:44:16 2018 (r330167) @@ -202,8 +202,8 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc, ieee80211_chan2ieee(ic, chan), chains_static, chains_dynamic, - iwm_fw_valid_rx_ant(sc), - iwm_fw_valid_tx_ant(sc)); + iwm_mvm_get_valid_rx_ant(sc), + iwm_mvm_get_valid_tx_ant(sc)); cmd->ci.band = IEEE80211_IS_CHAN_2GHZ(chan) ? @@ -217,13 +217,13 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc, idle_cnt = chains_static; active_cnt = chains_dynamic; - cmd->rxchain_info = htole32(iwm_fw_valid_rx_ant(sc) << + cmd->rxchain_info = htole32(iwm_mvm_get_valid_rx_ant(sc) << IWM_PHY_RX_CHAIN_VALID_POS); cmd->rxchain_info |= htole32(idle_cnt << IWM_PHY_RX_CHAIN_CNT_POS); cmd->rxchain_info |= htole32(active_cnt << IWM_PHY_RX_CHAIN_MIMO_CNT_POS); - cmd->txchain_info = htole32(iwm_fw_valid_tx_ant(sc)); + cmd->txchain_info = htole32(iwm_mvm_get_valid_tx_ant(sc)); } /* Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:44:16 2018 (r330167) @@ -172,7 +172,7 @@ iwm_mvm_scan_rx_chain(struct iwm_softc *sc) uint16_t rx_chain; uint8_t rx_ant; - rx_ant = iwm_fw_valid_rx_ant(sc); + rx_ant = iwm_mvm_get_valid_rx_ant(sc); rx_chain = rx_ant << IWM_PHY_RX_CHAIN_VALID_POS; rx_chain |= rx_ant << IWM_PHY_RX_CHAIN_FORCE_MIMO_SEL_POS; rx_chain |= rx_ant << IWM_PHY_RX_CHAIN_FORCE_SEL_POS; @@ -209,7 +209,7 @@ iwm_mvm_scan_rate_n_flags(struct iwm_softc *sc, int fl for (i = 0, ind = sc->sc_scan_last_antenna; i < IWM_RATE_MCS_ANT_NUM; i++) { ind = (ind + 1) % IWM_RATE_MCS_ANT_NUM; - if (iwm_fw_valid_tx_ant(sc) & (1 << ind)) { + if (iwm_mvm_get_valid_tx_ant(sc) & (1 << ind)) { sc->sc_scan_last_antenna = ind; break; } @@ -469,8 +469,8 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) if (scan_config == NULL) return ENOMEM; - scan_config->tx_chains = htole32(iwm_fw_valid_tx_ant(sc)); - scan_config->rx_chains = htole32(iwm_fw_valid_rx_ant(sc)); + scan_config->tx_chains = htole32(iwm_mvm_get_valid_tx_ant(sc)); + scan_config->rx_chains = htole32(iwm_mvm_get_valid_rx_ant(sc)); scan_config->legacy_rates = htole32(rates | IWM_SCAN_CONFIG_SUPPORTED_RATE(rates)); Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:44:16 2018 (r330167) @@ -428,31 +428,3 @@ iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cm sc->sc_wantresp = -1; wakeup(&sc->sc_wantresp); } - -uint8_t -iwm_fw_valid_tx_ant(struct iwm_softc *sc) -{ - uint8_t tx_ant; - - tx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) - >> IWM_FW_PHY_CFG_TX_CHAIN_POS); - - if (sc->nvm_data->valid_tx_ant) - tx_ant &= sc->nvm_data->valid_tx_ant; - - return tx_ant; -} - -uint8_t -iwm_fw_valid_rx_ant(struct iwm_softc *sc) -{ - uint8_t rx_ant; - - rx_ant = ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_RX_CHAIN) - >> IWM_FW_PHY_CFG_RX_CHAIN_POS); - - if (sc->nvm_data->valid_rx_ant) - rx_ant &= sc->nvm_data->valid_rx_ant; - - return rx_ant; -} Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 05:44:16 2018 (r330167) @@ -116,7 +116,34 @@ extern int iwm_mvm_send_cmd_pdu_status(struct iwm_soft uint16_t len, const void *data, uint32_t *status); extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); -extern uint8_t iwm_fw_valid_tx_ant(struct iwm_softc *sc); -extern uint8_t iwm_fw_valid_rx_ant(struct iwm_softc *sc); +static inline uint8_t +iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) +{ + return sc->nvm_data && sc->nvm_data->valid_tx_ant ? + sc->sc_fw.valid_tx_ant & sc->nvm_data->valid_tx_ant : + sc->sc_fw.valid_tx_ant; +} + +static inline uint8_t +iwm_mvm_get_valid_rx_ant(struct iwm_softc *sc) +{ + return sc->nvm_data && sc->nvm_data->valid_rx_ant ? + sc->sc_fw.valid_rx_ant & sc->nvm_data->valid_rx_ant : + sc->sc_fw.valid_rx_ant; +} + +static inline uint32_t +iwm_mvm_get_phy_config(struct iwm_softc *sc) +{ + uint32_t phy_config = ~(IWM_FW_PHY_CFG_TX_CHAIN | + IWM_FW_PHY_CFG_RX_CHAIN); + uint32_t valid_rx_ant = iwm_mvm_get_valid_rx_ant(sc); + uint32_t valid_tx_ant = iwm_mvm_get_valid_tx_ant(sc); + + phy_config |= valid_tx_ant << IWM_FW_PHY_CFG_TX_CHAIN_POS | + valid_rx_ant << IWM_FW_PHY_CFG_RX_CHAIN_POS; + + return sc->sc_fw.phy_config & phy_config; +} #endif /* __IF_IWM_UTIL_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:43:10 2018 (r330166) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:44:16 2018 (r330167) @@ -172,6 +172,10 @@ struct iwm_fw_info { } fw_sect[IWM_UCODE_SECT_MAX]; int fw_count; } fw_sects[IWM_UCODE_TYPE_MAX]; + + uint32_t phy_config; + uint8_t valid_tx_ant; + uint8_t valid_rx_ant; }; struct iwm_nvm_data { @@ -464,7 +468,6 @@ struct iwm_softc { bus_size_t sc_fwdmasegsz; struct iwm_fw_info sc_fw; - int sc_fw_phy_config; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; const struct iwm_cfg *cfg; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:45:23 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7725AF23815; Thu, 1 Mar 2018 05:45:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 25FAF81B6D; Thu, 1 Mar 2018 05:45:23 +0000 (UTC) (envelope-from eadler@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 20EB924525; Thu, 1 Mar 2018 05:45:23 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215jNf7031388; Thu, 1 Mar 2018 05:45:23 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215jMn0031385; Thu, 1 Mar 2018 05:45:22 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010545.w215jMn0031385@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:45: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: r330168 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330168 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.25 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, 01 Mar 2018 05:45:23 -0000 Author: eadler Date: Thu Mar 1 05:45:22 2018 New Revision: 330168 URL: https://svnweb.freebsd.org/changeset/base/330168 Log: MFC r313315,r313316: [iwm] Get rid of some gratuitous constant renaming wrt. Linux iwlwifi. * IWM_UCODE_SECT_MAX -> IWM_UCODE_SECTION_MAX * IWM_UCODE_TYPE_* -> IWM_UCODE_* (except for IWM_UCODE_TYPE_MAX which stays). [iwm] Store paging_mem_size field in firmware image information struct. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:44:16 2018 (r330167) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:45:22 2018 (r330168) @@ -490,7 +490,7 @@ iwm_firmware_store_section(struct iwm_softc *sc, return EINVAL; fws = &sc->sc_fw.fw_sects[type]; - if (fws->fw_count >= IWM_UCODE_SECT_MAX) + if (fws->fw_count >= IWM_UCODE_SECTION_MAX) return EINVAL; fwone = &fws->fw_sect[fws->fw_count]; @@ -554,11 +554,13 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; + uint32_t usniffer_img; + uint32_t paging_mem_size; int error = 0; size_t len; if (fw->fw_status == IWM_FW_STATUS_DONE && - ucode_type != IWM_UCODE_TYPE_INIT) + ucode_type != IWM_UCODE_INIT) return 0; while (fw->fw_status == IWM_FW_STATUS_INPROGRESS) @@ -716,9 +718,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode } case IWM_UCODE_TLV_SEC_RT: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_REGULAR, tlv_data, tlv_len)) != 0) { + IWM_UCODE_REGULAR, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TYPE_REGULAR: iwm_firmware_store_section() failed; %d\n", + "%s: IWM_UCODE_REGULAR: iwm_firmware_store_section() failed; %d\n", __func__, error); goto parse_out; @@ -726,9 +728,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode break; case IWM_UCODE_TLV_SEC_INIT: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_INIT, tlv_data, tlv_len)) != 0) { + IWM_UCODE_INIT, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TYPE_INIT: iwm_firmware_store_section() failed; %d\n", + "%s: IWM_UCODE_INIT: iwm_firmware_store_section() failed; %d\n", __func__, error); goto parse_out; @@ -736,9 +738,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode break; case IWM_UCODE_TLV_SEC_WOWLAN: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_WOW, tlv_data, tlv_len)) != 0) { + IWM_UCODE_WOWLAN, tlv_data, tlv_len)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TYPE_WOW: iwm_firmware_store_section() failed; %d\n", + "%s: IWM_UCODE_WOWLAN: iwm_firmware_store_section() failed; %d\n", __func__, error); goto parse_out; @@ -829,11 +831,43 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode case IWM_UCODE_TLV_SEC_RT_USNIFFER: if ((error = iwm_firmware_store_section(sc, - IWM_UCODE_TYPE_REGULAR_USNIFFER, tlv_data, + IWM_UCODE_REGULAR_USNIFFER, tlv_data, tlv_len)) != 0) goto parse_out; break; + case IWM_UCODE_TLV_PAGING: + if (tlv_len != sizeof(uint32_t)) { + error = EINVAL; + goto parse_out; + } + paging_mem_size = le32toh(*(const uint32_t *)tlv_data); + + IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, + "%s: Paging: paging enabled (size = %u bytes)\n", + __func__, paging_mem_size); + if (paging_mem_size > IWM_MAX_PAGING_IMAGE_SIZE) { + device_printf(sc->sc_dev, + "%s: Paging: driver supports up to %u bytes for paging image\n", + __func__, IWM_MAX_PAGING_IMAGE_SIZE); + error = EINVAL; + goto out; + } + if (paging_mem_size & (IWM_FW_PAGING_SIZE - 1)) { + device_printf(sc->sc_dev, + "%s: Paging: image isn't multiple %u\n", + __func__, IWM_FW_PAGING_SIZE); + error = EINVAL; + goto out; + } + + sc->sc_fw.fw_sects[IWM_UCODE_REGULAR].paging_mem_size = + paging_mem_size; + usniffer_img = IWM_UCODE_REGULAR_USNIFFER; + sc->sc_fw.fw_sects[usniffer_img].paging_mem_size = + paging_mem_size; + break; + case IWM_UCODE_TLV_N_SCAN_CHANNELS: if (tlv_len != sizeof(uint32_t)) { error = EINVAL; @@ -2492,7 +2526,7 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc (*first_ucode_section)++; } - for (i = *first_ucode_section; i < IWM_UCODE_SECT_MAX; i++) { + for (i = *first_ucode_section; i < IWM_UCODE_SECTION_MAX; i++) { last_read_idx = i; data = fws->fw_sect[i].fws_data; dlen = fws->fw_sect[i].fws_len; @@ -2764,7 +2798,7 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn sc->sc_init_complete = 0; if ((error = iwm_mvm_load_ucode_wait_alive(sc, - IWM_UCODE_TYPE_INIT)) != 0) { + IWM_UCODE_INIT)) != 0) { device_printf(sc->sc_dev, "failed to load init firmware\n"); return error; } @@ -4680,7 +4714,7 @@ iwm_init_hw(struct iwm_softc *sc) } /* omstart, this time with the regular firmware */ - error = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_TYPE_REGULAR); + error = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_REGULAR); if (error) { device_printf(sc->sc_dev, "could not load firmware\n"); goto error; Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:44:16 2018 (r330167) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:45:22 2018 (r330168) @@ -888,6 +888,28 @@ struct iwm_fw_cipher_scheme { uint8_t hw_cipher; } __packed; +/* + * Block paging calculations + */ +#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ +#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */ +#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3 +/* 8 pages per group */ +#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE) +/* don't change, support only 32KB size */ +#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE) +/* 32K == 2^15 */ +#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE) + +/* + * Image paging calculations + */ +#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5 +/* 2^5 == 32 blocks per image */ +#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE) +/* maximum image size 1024KB */ +#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE) + /** * struct iwm_fw_cscheme_list - a cipher scheme list * @size: a number of entries Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:44:16 2018 (r330167) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:45:22 2018 (r330168) @@ -137,7 +137,7 @@ struct iwm_tx_radiotap_header { (1 << IEEE80211_RADIOTAP_CHANNEL)) -#define IWM_UCODE_SECT_MAX 16 +#define IWM_UCODE_SECTION_MAX 16 #define IWM_FWDMASEGSZ (192*1024) #define IWM_FWDMASEGSZ_8000 (320*1024) /* sanity check value */ @@ -152,11 +152,21 @@ struct iwm_tx_radiotap_header { #define IWM_FW_STATUS_INPROGRESS 1 #define IWM_FW_STATUS_DONE 2 +/** + * enum iwm_ucode_type + * + * The type of ucode. + * + * @IWM_UCODE_REGULAR: Normal runtime ucode + * @IWM_UCODE_INIT: Initial ucode + * @IWM_UCODE_WOWLAN: Wake on Wireless enabled ucode + * @IWM_UCODE_REGULAR_USNIFFER: Normal runtime ucode when using usniffer image + */ enum iwm_ucode_type { - IWM_UCODE_TYPE_REGULAR, - IWM_UCODE_TYPE_INIT, - IWM_UCODE_TYPE_WOW, - IWM_UCODE_TYPE_REGULAR_USNIFFER, + IWM_UCODE_REGULAR, + IWM_UCODE_INIT, + IWM_UCODE_WOWLAN, + IWM_UCODE_REGULAR_USNIFFER, IWM_UCODE_TYPE_MAX }; @@ -169,8 +179,9 @@ struct iwm_fw_info { const void *fws_data; uint32_t fws_len; uint32_t fws_devoff; - } fw_sect[IWM_UCODE_SECT_MAX]; + } fw_sect[IWM_UCODE_SECTION_MAX]; int fw_count; + uint32_t paging_mem_size; } fw_sects[IWM_UCODE_TYPE_MAX]; uint32_t phy_config; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:46:12 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A84F6F2398E; Thu, 1 Mar 2018 05:46:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5C54781DAC; Thu, 1 Mar 2018 05:46:12 +0000 (UTC) (envelope-from eadler@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 575A524527; Thu, 1 Mar 2018 05:46:12 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215kCug031469; Thu, 1 Mar 2018 05:46:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215kC4J031466; Thu, 1 Mar 2018 05:46:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010546.w215kC4J031466@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:46: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: r330169 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330169 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.25 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, 01 Mar 2018 05:46:13 -0000 Author: eadler Date: Thu Mar 1 05:46:11 2018 New Revision: 330169 URL: https://svnweb.freebsd.org/changeset/base/330169 Log: MFC r313317: [iwm] Change 2nd arg of iwm_phy_db_set_section() to struct iwm_rx_packet. * This matches the function declaration in Linux's iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_db.c stable/11/sys/dev/iwm/if_iwm_phy_db.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:45:22 2018 (r330168) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:46:11 2018 (r330169) @@ -5357,13 +5357,9 @@ iwm_notif_intr(struct iwm_softc *sc) wakeup(&sc->sc_uc); break; } - case IWM_CALIB_RES_NOTIF_PHY_DB: { - struct iwm_calib_res_notif_phy_db *phy_db_notif; - phy_db_notif = (void *)pkt->data; - - iwm_phy_db_set_section(sc->sc_phy_db, phy_db_notif); - - break; } + case IWM_CALIB_RES_NOTIF_PHY_DB: + iwm_phy_db_set_section(sc->sc_phy_db, pkt); + break; case IWM_STATISTICS_NOTIFICATION: { struct iwm_notif_statistics *stats; Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:45:22 2018 (r330168) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 05:46:11 2018 (r330169) @@ -310,8 +310,10 @@ iwm_phy_db_free(struct iwm_phy_db *phy_db) int iwm_phy_db_set_section(struct iwm_phy_db *phy_db, - struct iwm_calib_res_notif_phy_db *phy_db_notif) + struct iwm_rx_packet *pkt) { + struct iwm_calib_res_notif_phy_db *phy_db_notif = + (struct iwm_calib_res_notif_phy_db *)pkt->data; enum iwm_phy_db_section_type type = le16toh(phy_db_notif->type); uint16_t size = le16toh(phy_db_notif->length); struct iwm_phy_db_entry *entry; Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:45:22 2018 (r330168) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.h Thu Mar 1 05:46:11 2018 (r330169) @@ -111,7 +111,7 @@ struct iwm_calib_res_notif_phy_db; extern struct iwm_phy_db *iwm_phy_db_init(struct iwm_softc *sc); extern void iwm_phy_db_free(struct iwm_phy_db *phy_db); extern int iwm_phy_db_set_section(struct iwm_phy_db *phy_db, - struct iwm_calib_res_notif_phy_db *phy_db_notif); + struct iwm_rx_packet *pkt); extern int iwm_send_phy_db_data(struct iwm_phy_db *phy_db); #endif /* __IF_IWM_PHY_DB_H__ */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:48:21 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 41411F23CD0; Thu, 1 Mar 2018 05:48:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EAB1D82249; Thu, 1 Mar 2018 05:48:20 +0000 (UTC) (envelope-from eadler@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 E576F2452D; Thu, 1 Mar 2018 05:48:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215mKnE031585; Thu, 1 Mar 2018 05:48:20 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215mK5o031578; Thu, 1 Mar 2018 05:48:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010548.w215mK5o031578@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:48:20 +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: r330170 - in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Commit-Revision: 330170 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.25 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, 01 Mar 2018 05:48:21 -0000 Author: eadler Date: Thu Mar 1 05:48:20 2018 New Revision: 330170 URL: https://svnweb.freebsd.org/changeset/base/330170 Log: MFC r313322,r313354: [iwm] Add implementation of the notification wait api from iwlwifi. Added: stable/11/sys/dev/iwm/if_iwm_notif_wait.c - copied unchanged from r313322, head/sys/dev/iwm/if_iwm_notif_wait.c stable/11/sys/dev/iwm/if_iwm_notif_wait.h - copied unchanged from r313322, head/sys/dev/iwm/if_iwm_notif_wait.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/conf/files Thu Mar 1 05:48:20 2018 (r330170) @@ -1872,6 +1872,7 @@ dev/iwm/if_iwm.c optional iwm dev/iwm/if_iwm_binding.c optional iwm dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm +dev/iwm/if_iwm_notif_wait.c optional iwm dev/iwm/if_iwm_pcie_trans.c optional iwm dev/iwm/if_iwm_phy_ctxt.c optional iwm dev/iwm/if_iwm_phy_db.c optional iwm Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:48:20 2018 (r330170) @@ -153,6 +153,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -5251,6 +5252,8 @@ iwm_notif_intr(struct iwm_softc *sc) continue; } + iwm_notification_wait_notify(sc->sc_notif_wait, code, pkt); + switch (code) { case IWM_REPLY_RX_PHY_CMD: iwm_mvm_rx_rx_phy_cmd(sc, pkt, data); @@ -5873,6 +5876,12 @@ iwm_attach(device_t dev) callout_init_mtx(&sc->sc_led_blink_to, &sc->sc_mtx, 0); TASK_INIT(&sc->sc_es_task, 0, iwm_endscan_cb, sc); + sc->sc_notif_wait = iwm_notification_wait_init(sc); + if (sc->sc_notif_wait == NULL) { + device_printf(dev, "failed to init notification wait struct\n"); + goto fail; + } + /* Init phy db */ sc->sc_phy_db = iwm_phy_db_init(sc); if (!sc->sc_phy_db) { @@ -6358,6 +6367,11 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 /* Finished with the hardware - detach things */ iwm_pci_detach(dev); + + if (sc->sc_notif_wait != NULL) { + iwm_notification_wait_free(sc->sc_notif_wait); + sc->sc_notif_wait = NULL; + } mbufq_drain(&sc->sc_snd); IWM_LOCK_DESTROY(sc); Copied: stable/11/sys/dev/iwm/if_iwm_notif_wait.c (from r313322, head/sys/dev/iwm/if_iwm_notif_wait.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_notif_wait.c Thu Mar 1 05:48:20 2018 (r330170, copy of r313322, head/sys/dev/iwm/if_iwm_notif_wait.c) @@ -0,0 +1,219 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include + +#include + +#define IWM_WAIT_LOCK_INIT(_n, _s) \ + mtx_init(&(_n)->lk_mtx, (_s), "iwm wait_notif", MTX_DEF); +#define IWM_WAIT_LOCK(_n) mtx_lock(&(_n)->lk_mtx) +#define IWM_WAIT_UNLOCK(_n) mtx_unlock(&(_n)->lk_mtx) +#define IWM_WAIT_LOCK_DESTROY(_n) mtx_destroy(&(_n)->lk_mtx) + +struct iwm_notif_wait_data { + struct mtx lk_mtx; + char lk_buf[32]; + STAILQ_HEAD(, iwm_notification_wait) list; + struct iwm_softc *sc; +}; + +struct iwm_notif_wait_data * +iwm_notification_wait_init(struct iwm_softc *sc) +{ + struct iwm_notif_wait_data *data; + + data = malloc(sizeof(*data), M_DEVBUF, M_NOWAIT | M_ZERO); + if (data != NULL) { + snprintf(data->lk_buf, 32, "iwm wait_notif"); + IWM_WAIT_LOCK_INIT(data, data->lk_buf); + STAILQ_INIT(&data->list); + data->sc = sc; + } + + return data; +} + +void +iwm_notification_wait_free(struct iwm_notif_wait_data *notif_data) +{ + KASSERT(STAILQ_EMPTY(¬if_data->list), ("notif list isn't empty")); + IWM_WAIT_LOCK_DESTROY(notif_data); + free(notif_data, M_DEVBUF); +} + +/* XXX Get rid of separate cmd argument, like in iwlwifi's code */ +void +iwm_notification_wait_notify(struct iwm_notif_wait_data *notif_data, + uint16_t cmd, struct iwm_rx_packet *pkt) +{ + struct iwm_notification_wait *wait_entry; + + IWM_WAIT_LOCK(notif_data); + STAILQ_FOREACH(wait_entry, ¬if_data->list, entry) { + int found = FALSE; + int i; + + /* + * If it already finished (triggered) or has been + * aborted then don't evaluate it again to avoid races, + * Otherwise the function could be called again even + * though it returned true before + */ + if (wait_entry->triggered || wait_entry->aborted) + continue; + + for (i = 0; i < wait_entry->n_cmds; i++) { + if (cmd == wait_entry->cmds[i]) { + found = TRUE; + break; + } + } + if (!found) + continue; + + if (!wait_entry->fn || + wait_entry->fn(notif_data->sc, pkt, wait_entry->fn_data)) { + wait_entry->triggered = 1; + wakeup(wait_entry); + } + } + IWM_WAIT_UNLOCK(notif_data); +} + +void +iwm_abort_notification_waits(struct iwm_notif_wait_data *notif_data) +{ + struct iwm_notification_wait *wait_entry; + + IWM_WAIT_LOCK(notif_data); + STAILQ_FOREACH(wait_entry, ¬if_data->list, entry) { + wait_entry->aborted = 1; + wakeup(wait_entry); + } + IWM_WAIT_UNLOCK(notif_data); +} + +void +iwm_init_notification_wait(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, const uint16_t *cmds, int n_cmds, + int (*fn)(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data), + void *fn_data) +{ + KASSERT(n_cmds <= IWM_MAX_NOTIF_CMDS, + ("n_cmds %d is too large", n_cmds)); + wait_entry->fn = fn; + wait_entry->fn_data = fn_data; + wait_entry->n_cmds = n_cmds; + memcpy(wait_entry->cmds, cmds, n_cmds * sizeof(uint16_t)); + wait_entry->triggered = 0; + wait_entry->aborted = 0; + + IWM_WAIT_LOCK(notif_data); + STAILQ_INSERT_TAIL(¬if_data->list, wait_entry, entry); + IWM_WAIT_UNLOCK(notif_data); +} + +int +iwm_wait_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, int timeout) +{ + int ret = 0; + + IWM_WAIT_LOCK(notif_data); + if (!wait_entry->triggered && !wait_entry->aborted) { + ret = msleep(wait_entry, ¬if_data->lk_mtx, 0, "iwm_notif", + timeout); + } + STAILQ_REMOVE(¬if_data->list, wait_entry, iwm_notification_wait, + entry); + IWM_WAIT_UNLOCK(notif_data); + + return ret; +} + +void +iwm_remove_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry) +{ + IWM_WAIT_LOCK(notif_data); + STAILQ_REMOVE(¬if_data->list, wait_entry, iwm_notification_wait, + entry); + IWM_WAIT_UNLOCK(notif_data); +} Copied: stable/11/sys/dev/iwm/if_iwm_notif_wait.h (from r313322, head/sys/dev/iwm/if_iwm_notif_wait.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_notif_wait.h Thu Mar 1 05:48:20 2018 (r330170, copy of r313322, head/sys/dev/iwm/if_iwm_notif_wait.h) @@ -0,0 +1,138 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* $FreeBSD$ */ + +#ifndef __IF_IWN_NOTIF_WAIT_H__ +#define __IF_IWN_NOTIF_WAIT_H__ + +#include + +#define IWM_MAX_NOTIF_CMDS 5 + +struct iwm_rx_packet; +struct iwm_softc; + +/** + * struct iwm_notification_wait - notification wait entry + * @entry: link for global list + * @fn: Function called with the notification. If the function + * returns true, the wait is over, if it returns false then + * the waiter stays blocked. If no function is given, any + * of the listed commands will unblock the waiter. + * @cmds: command IDs + * @n_cmds: number of command IDs + * @triggered: waiter should be woken up + * @aborted: wait was aborted + * + * This structure is not used directly, to wait for a + * notification declare it on the stack, and call + * iwm_init_notification_wait() with appropriate + * parameters. Then do whatever will cause the ucode + * to notify the driver, and to wait for that then + * call iwm_wait_notification(). + * + * Each notification is one-shot. If at some point we + * need to support multi-shot notifications (which + * can't be allocated on the stack) we need to modify + * the code for them. + */ +struct iwm_notification_wait { + STAILQ_ENTRY(iwm_notification_wait) entry; + + int (*fn)(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data); + void *fn_data; + + uint16_t cmds[IWM_MAX_NOTIF_CMDS]; + uint8_t n_cmds; + int triggered, aborted; +}; + +/* caller functions */ +extern struct iwm_notif_wait_data *iwm_notification_wait_init( + struct iwm_softc *sc); +extern void iwm_notification_wait_free(struct iwm_notif_wait_data *notif_data); +extern void iwm_notification_wait_notify( + struct iwm_notif_wait_data *notif_data, uint16_t cmd, + struct iwm_rx_packet *pkt); +extern void iwm_abort_notification_waits( + struct iwm_notif_wait_data *notif_data); + +/* user functions */ +extern void iwm_init_notification_wait(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, + const uint16_t *cmds, int n_cmds, + int (*fn)(struct iwm_softc *sc, + struct iwm_rx_packet *pkt, void *data), + void *fn_data); +extern int iwm_wait_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry, int timeout); +extern void iwm_remove_notification(struct iwm_notif_wait_data *notif_data, + struct iwm_notification_wait *wait_entry); + +#endif /* __IF_IWN_NOTIF_WAIT_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:48:20 2018 (r330170) @@ -518,6 +518,8 @@ struct iwm_softc { struct iwm_tx_radiotap_header sc_txtap; int sc_max_rssi; + + struct iwm_notif_wait_data *sc_notif_wait; }; #define IWM_LOCK_INIT(_sc) \ Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 05:46:11 2018 (r330169) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 05:48:20 2018 (r330170) @@ -6,7 +6,7 @@ KMOD= if_iwm # Main driver SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c -SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c +SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:49:33 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5BA16F23E73; Thu, 1 Mar 2018 05:49:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 085D48253C; Thu, 1 Mar 2018 05:49:33 +0000 (UTC) (envelope-from eadler@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 032B824530; Thu, 1 Mar 2018 05:49:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215nWfE031669; Thu, 1 Mar 2018 05:49:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215nWTi031667; Thu, 1 Mar 2018 05:49:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010549.w215nWTi031667@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:49: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: r330171 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330171 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.25 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, 01 Mar 2018 05:49:33 -0000 Author: eadler Date: Thu Mar 1 05:49:32 2018 New Revision: 330171 URL: https://svnweb.freebsd.org/changeset/base/330171 Log: MFC r313325: [iwm] Use notification wait API to wait for calibration to complete. Tested: * 7260, STA mode (2g, 5g) Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:48:20 2018 (r330170) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:49:32 2018 (r330171) @@ -284,6 +284,8 @@ struct iwm_nvm_section { uint8_t *data; }; +#define IWM_MVM_UCODE_CALIB_TIMEOUT (2*hz) + static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t); static int iwm_firmware_store_section(struct iwm_softc *, enum iwm_ucode_type, @@ -2751,6 +2753,28 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) } static int +iwm_wait_phy_db_entry(struct iwm_softc *sc, + struct iwm_rx_packet *pkt, void *data) +{ + struct iwm_phy_db *phy_db = data; + + if (pkt->hdr.code != IWM_CALIB_RES_NOTIF_PHY_DB) { + if(pkt->hdr.code != IWM_INIT_COMPLETE_NOTIF) { + device_printf(sc->sc_dev, "%s: Unexpected cmd: %d\n", + __func__, pkt->hdr.code); + } + return TRUE; + } + + if (iwm_phy_db_set_section(phy_db, pkt)) { + device_printf(sc->sc_dev, + "%s: iwm_phy_db_set_section failed\n", __func__); + } + + return FALSE; +} + +static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { @@ -2788,7 +2812,12 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, static int iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justnvm) { - int error; + struct iwm_notification_wait calib_wait; + static const uint16_t init_complete[] = { + IWM_INIT_COMPLETE_NOTIF, + IWM_CALIB_RES_NOTIF_PHY_DB + }; + int ret; /* do not operate with rfkill switch turned on */ if ((sc->sc_flags & IWM_FLAG_RFKILL) && !justnvm) { @@ -2797,81 +2826,80 @@ iwm_run_init_mvm_ucode(struct iwm_softc *sc, int justn return EPERM; } - sc->sc_init_complete = 0; - if ((error = iwm_mvm_load_ucode_wait_alive(sc, - IWM_UCODE_INIT)) != 0) { - device_printf(sc->sc_dev, "failed to load init firmware\n"); - return error; + iwm_init_notification_wait(sc->sc_notif_wait, + &calib_wait, + init_complete, + nitems(init_complete), + iwm_wait_phy_db_entry, + sc->sc_phy_db); + + /* Will also start the device */ + ret = iwm_mvm_load_ucode_wait_alive(sc, IWM_UCODE_INIT); + if (ret) { + device_printf(sc->sc_dev, "Failed to start INIT ucode: %d\n", + ret); + goto error; } if (justnvm) { - if ((error = iwm_nvm_init(sc)) != 0) { + /* Read nvm */ + ret = iwm_nvm_init(sc); + if (ret) { device_printf(sc->sc_dev, "failed to read nvm\n"); - return error; + goto error; } IEEE80211_ADDR_COPY(sc->sc_ic.ic_macaddr, sc->nvm_data->hw_addr); - - return 0; + goto error; } - if ((error = iwm_send_bt_init_conf(sc)) != 0) { + ret = iwm_send_bt_init_conf(sc); + if (ret) { device_printf(sc->sc_dev, - "failed to send bt coex configuration: %d\n", error); - return error; + "failed to send bt coex configuration: %d\n", ret); + goto error; } /* Init Smart FIFO. */ - error = iwm_mvm_sf_config(sc, IWM_SF_INIT_OFF); - if (error != 0) - return error; + ret = iwm_mvm_sf_config(sc, IWM_SF_INIT_OFF); + if (ret) + goto error; -#if 0 - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s: phy_txant=0x%08x, nvm_valid_tx_ant=0x%02x, valid=0x%02x\n", - __func__, - ((sc->sc_fw_phy_config & IWM_FW_PHY_CFG_TX_CHAIN) - >> IWM_FW_PHY_CFG_TX_CHAIN_POS), - sc->nvm_data->valid_tx_ant, - iwm_fw_valid_tx_ant(sc)); -#endif - /* Send TX valid antennas before triggering calibrations */ - error = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); - if (error != 0) { + ret = iwm_send_tx_ant_cfg(sc, iwm_mvm_get_valid_tx_ant(sc)); + if (ret) { device_printf(sc->sc_dev, - "failed to send antennas before calibration: %d\n", error); - return error; + "failed to send antennas before calibration: %d\n", ret); + goto error; } /* * Send phy configurations command to init uCode * to start the 16.0 uCode init image internal calibrations. */ - if ((error = iwm_send_phy_cfg_cmd(sc)) != 0 ) { + ret = iwm_send_phy_cfg_cmd(sc); + if (ret) { device_printf(sc->sc_dev, - "%s: failed to run internal calibration: %d\n", - __func__, error); - return error; + "%s: Failed to run INIT calibrations: %d\n", + __func__, ret); + goto error; } /* * Nothing to do but wait for the init complete notification - * from the firmware + * from the firmware. */ - while (!sc->sc_init_complete) { - error = msleep(&sc->sc_init_complete, &sc->sc_mtx, - 0, "iwminit", 2*hz); - if (error) { - device_printf(sc->sc_dev, "init complete failed: %d\n", - sc->sc_init_complete); - break; - } - } + IWM_UNLOCK(sc); + ret = iwm_wait_notification(sc->sc_notif_wait, &calib_wait, + IWM_MVM_UCODE_CALIB_TIMEOUT); + IWM_LOCK(sc); - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "init %scomplete\n", - sc->sc_init_complete ? "" : "not "); - return error; + goto out; + +error: + iwm_remove_notification(sc->sc_notif_wait, &calib_wait); +out: + return ret; } /* @@ -5361,7 +5389,6 @@ iwm_notif_intr(struct iwm_softc *sc) break; } case IWM_CALIB_RES_NOTIF_PHY_DB: - iwm_phy_db_set_section(sc->sc_phy_db, pkt); break; case IWM_STATISTICS_NOTIFICATION: { @@ -5426,8 +5453,6 @@ iwm_notif_intr(struct iwm_softc *sc) break; case IWM_INIT_COMPLETE_NOTIF: - sc->sc_init_complete = 1; - wakeup(&sc->sc_init_complete); break; case IWM_SCAN_OFFLOAD_COMPLETE: { Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:48:20 2018 (r330170) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:49:32 2018 (r330171) @@ -451,7 +451,6 @@ struct iwm_softc { struct iwm_dma_info fw_dma; int sc_fw_chunk_done; - int sc_init_complete; struct iwm_ucode_status sc_uc; enum iwm_ucode_type sc_uc_current; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:50:49 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BA21F24061; Thu, 1 Mar 2018 05:50:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 51D858286B; Thu, 1 Mar 2018 05:50:49 +0000 (UTC) (envelope-from eadler@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 4CD3024546; Thu, 1 Mar 2018 05:50:49 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215on2b031783; Thu, 1 Mar 2018 05:50:49 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215omcR031780; Thu, 1 Mar 2018 05:50:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010550.w215omcR031780@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:50:48 +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: r330172 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330172 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.25 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, 01 Mar 2018 05:50:49 -0000 Author: eadler Date: Thu Mar 1 05:50:48 2018 New Revision: 330172 URL: https://svnweb.freebsd.org/changeset/base/330172 Log: MFC r313412: [iwm] Get rid of iwm_disable_rx_dma, just use iwm_pcie_rx_stop directly. * This also fixes one of many small nic lock handling bugs, and matches iwlwifi's code. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:49:32 2018 (r330171) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:50:48 2018 (r330172) @@ -302,7 +302,6 @@ static int iwm_alloc_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); static int iwm_alloc_ict(struct iwm_softc *); static int iwm_alloc_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); -static void iwm_disable_rx_dma(struct iwm_softc *); static void iwm_reset_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static void iwm_free_rx_ring(struct iwm_softc *, struct iwm_rx_ring *); static int iwm_alloc_tx_ring(struct iwm_softc *, struct iwm_tx_ring *, @@ -1104,18 +1103,6 @@ fail: iwm_free_rx_ring(sc, ring); } static void -iwm_disable_rx_dma(struct iwm_softc *sc) -{ - /* XXX conditional nic locks are stupid */ - /* XXX print out if we can't lock the NIC? */ - if (iwm_nic_lock(sc)) { - /* XXX handle if RX stop doesn't finish? */ - (void) iwm_pcie_rx_stop(sc); - iwm_nic_unlock(sc); - } -} - -static void iwm_reset_rx_ring(struct iwm_softc *sc, struct iwm_rx_ring *ring) { /* Reset the ring state */ @@ -1401,7 +1388,7 @@ iwm_stop_device(struct iwm_softc *sc) } iwm_nic_unlock(sc); } - iwm_disable_rx_dma(sc); + iwm_pcie_rx_stop(sc); /* Stop RX ring. */ iwm_reset_rx_ring(sc, &sc->rxq); @@ -1485,16 +1472,18 @@ iwm_mvm_nic_config(struct iwm_softc *sc) static int iwm_nic_rx_init(struct iwm_softc *sc) { - if (!iwm_nic_lock(sc)) - return EBUSY; - /* * Initialize RX ring. This is from the iwn driver. */ memset(sc->rxq.stat, 0, sizeof(*sc->rxq.stat)); - /* stop DMA */ - iwm_disable_rx_dma(sc); + /* Stop Rx DMA */ + iwm_pcie_rx_stop(sc); + + if (!iwm_nic_lock(sc)) + return EBUSY; + + /* reset and flush pointers */ IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_RBDCB_WPTR, 0); IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_FLUSH_RB_REQ, 0); IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_RDPTR, 0); Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:49:32 2018 (r330171) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:50:48 2018 (r330172) @@ -572,10 +572,14 @@ iwm_set_pwr(struct iwm_softc *sc) int iwm_pcie_rx_stop(struct iwm_softc *sc) { - - IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); - return (iwm_poll_bit(sc, IWM_FH_MEM_RSSR_RX_STATUS_REG, - IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, - IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, - 1000)); + int ret = 0; + if (iwm_nic_lock(sc)) { + IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, 0); + ret = iwm_poll_bit(sc, IWM_FH_MEM_RSSR_RX_STATUS_REG, + IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, + IWM_FH_RSSR_CHNL0_RX_STATUS_CHNL_IDLE, + 1000); + iwm_nic_unlock(sc); + } + return ret; } From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:51:36 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 48A82F2416C; Thu, 1 Mar 2018 05:51:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDE9382B2F; Thu, 1 Mar 2018 05:51:35 +0000 (UTC) (envelope-from eadler@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 E8D4324676; Thu, 1 Mar 2018 05:51:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215pZbc035810; Thu, 1 Mar 2018 05:51:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215pZv9035806; Thu, 1 Mar 2018 05:51:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010551.w215pZv9035806@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:51: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: r330173 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330173 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.25 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, 01 Mar 2018 05:51:36 -0000 Author: eadler Date: Thu Mar 1 05:51:35 2018 New Revision: 330173 URL: https://svnweb.freebsd.org/changeset/base/330173 Log: MFC r313413: [iwm] Add scan abort functions, to properly cancel a running scan. * Uses the notification wait api to wait for the corresponding scan complete notification after sending the abort command. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwm_scan.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:50:48 2018 (r330172) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:51:35 2018 (r330173) @@ -5421,7 +5421,9 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_TIME_EVENT_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): + case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_ABORT_UMAC): case IWM_SCAN_OFFLOAD_REQUEST_CMD: + case IWM_SCAN_OFFLOAD_ABORT_CMD: case IWM_REPLY_BEACON_FILTERING_CMD: case IWM_MAC_PM_POWER_TABLE: case IWM_TIME_QUOTA_CMD: Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:50:48 2018 (r330172) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 05:51:35 2018 (r330173) @@ -153,6 +153,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -735,5 +736,88 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) "Scan request was sent successfully\n"); } free(req, M_DEVBUF); + return ret; +} + +static int +iwm_mvm_lmac_scan_abort(struct iwm_softc *sc) +{ + int ret; + struct iwm_host_cmd hcmd = { + .id = IWM_SCAN_OFFLOAD_ABORT_CMD, + .len = { 0, }, + .data = { NULL, }, + .flags = IWM_CMD_SYNC, + }; + uint32_t status; + + ret = iwm_mvm_send_cmd_status(sc, &hcmd, &status); + if (ret) + return ret; + + if (status != IWM_CAN_ABORT_STATUS) { + /* + * The scan abort will return 1 for success or + * 2 for "failure". A failure condition can be + * due to simply not being in an active scan which + * can occur if we send the scan abort before the + * microcode has notified us that a scan is completed. + */ + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, + "SCAN OFFLOAD ABORT ret %d.\n", status); + ret = ENOENT; + } + + return ret; +} + +static int +iwm_mvm_umac_scan_abort(struct iwm_softc *sc) +{ + struct iwm_umac_scan_abort cmd = {}; + int uid, ret; + + uid = 0; + cmd.uid = htole32(uid); + + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Sending scan abort, uid %u\n", uid); + + ret = iwm_mvm_send_cmd_pdu(sc, + iwm_cmd_id(IWM_SCAN_ABORT_UMAC, + IWM_ALWAYS_LONG_GROUP, 0), + 0, sizeof(cmd), &cmd); + + return ret; +} + +int +iwm_mvm_scan_stop_wait(struct iwm_softc *sc) +{ + struct iwm_notification_wait wait_scan_done; + static const uint16_t scan_done_notif[] = { IWM_SCAN_COMPLETE_UMAC, + IWM_SCAN_OFFLOAD_COMPLETE, }; + int ret; + + iwm_init_notification_wait(sc->sc_notif_wait, &wait_scan_done, + scan_done_notif, nitems(scan_done_notif), + NULL, NULL); + + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); + + if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + ret = iwm_mvm_umac_scan_abort(sc); + else + ret = iwm_mvm_lmac_scan_abort(sc); + + if (ret) { + IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "couldn't stop scan\n"); + iwm_remove_notification(sc->sc_notif_wait, &wait_scan_done); + return ret; + } + + IWM_UNLOCK(sc); + ret = iwm_wait_notification(sc->sc_notif_wait, &wait_scan_done, hz); + IWM_LOCK(sc); + return ret; } Modified: stable/11/sys/dev/iwm/if_iwm_scan.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.h Thu Mar 1 05:50:48 2018 (r330172) +++ stable/11/sys/dev/iwm/if_iwm_scan.h Thu Mar 1 05:51:35 2018 (r330173) @@ -109,5 +109,6 @@ extern int iwm_mvm_lmac_scan(struct iwm_softc *sc); extern int iwm_mvm_config_umac_scan(struct iwm_softc *); extern int iwm_mvm_umac_scan(struct iwm_softc *); +extern int iwm_mvm_scan_stop_wait(struct iwm_softc *sc); #endif /* __IF_IWN_SCAN_H__ */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:52:28 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D99DDF242EC; Thu, 1 Mar 2018 05:52:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8FFE482F45; Thu, 1 Mar 2018 05:52:27 +0000 (UTC) (envelope-from eadler@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 8AC69246BB; Thu, 1 Mar 2018 05:52:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215qR9t036667; Thu, 1 Mar 2018 05:52:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215qRx2036665; Thu, 1 Mar 2018 05:52:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010552.w215qRx2036665@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:52:27 +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: r330174 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330174 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.25 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, 01 Mar 2018 05:52:28 -0000 Author: eadler Date: Thu Mar 1 05:52:27 2018 New Revision: 330174 URL: https://svnweb.freebsd.org/changeset/base/330174 Log: MFC r313414: [iwm] Use iwm_mvm_scan_stop_wait to properly abort scans. * Add IWM_FLAG_SCAN_RUNNING to sc->sc_flags to track whether the firmware is currently running a scan, in order to decide wheter iwm_scan_end needs to abort a running scan. * In iwm_scan_end, if the scan is still running, we now abort it, in order to keep the firmware scanning state in sync. * Try to make things a bit simpler, by reacting on the IWM_SCAN_OFFLOAD_COMPLETE and IWM_SCAN_COMPLETE_UMAC notifications, instead of IWM_SCAN_ITERATION_COMPLETE and IWM_SCAN_ITERATION_COMPLETE_UMAC. This should be fine since we always only tell the firmware to do a single scan iteration anyway. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:51:35 2018 (r330173) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:52:27 2018 (r330174) @@ -4925,6 +4925,7 @@ iwm_stop(struct iwm_softc *sc) iwm_led_blink_stop(sc); sc->sc_tx_timer = 0; iwm_stop_device(sc); + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; } static void @@ -5449,6 +5450,10 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_SCAN_OFFLOAD_COMPLETE: { struct iwm_periodic_scan_complete *notif; notif = (void *)pkt->data; + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; + ieee80211_runtask(ic, &sc->sc_es_task); + } break; } @@ -5466,9 +5471,10 @@ iwm_notif_intr(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "UMAC scan complete, status=0x%x\n", notif->status); -#if 0 /* XXX This would be a duplicate scan end call */ - taskqueue_enqueue(sc->sc_tq, &sc->sc_es_task); -#endif + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; + ieee80211_runtask(ic, &sc->sc_es_task); + } break; } @@ -6229,15 +6235,21 @@ iwm_scan_start(struct ieee80211com *ic) int error; IWM_LOCK(sc); + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + /* This should not be possible */ + device_printf(sc->sc_dev, + "%s: Previous scan not completed yet\n", __func__); + } if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); if (error != 0) { - device_printf(sc->sc_dev, "could not initiate 2 GHz scan\n"); + device_printf(sc->sc_dev, "could not initiate scan\n"); IWM_UNLOCK(sc); ieee80211_cancel_scan(vap); } else { + sc->sc_flags |= IWM_FLAG_SCAN_RUNNING; iwm_led_blink_start(sc); IWM_UNLOCK(sc); } @@ -6253,7 +6265,23 @@ iwm_scan_end(struct ieee80211com *ic) iwm_led_blink_stop(sc); if (vap->iv_state == IEEE80211_S_RUN) iwm_mvm_led_enable(sc); + if (sc->sc_flags & IWM_FLAG_SCAN_RUNNING) { + /* + * Removing IWM_FLAG_SCAN_RUNNING now, is fine because + * both iwm_scan_end and iwm_scan_start run in the ic->ic_tq + * taskqueue. + */ + sc->sc_flags &= ~IWM_FLAG_SCAN_RUNNING; + iwm_mvm_scan_stop_wait(sc); + } IWM_UNLOCK(sc); + + /* + * Make sure we don't race, if sc_es_task is still enqueued here. + * This is to make sure that it won't call ieee80211_scan_done + * when we have already started the next scan. + */ + taskqueue_cancel(ic->ic_tq, &sc->sc_es_task, NULL); } static void Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:51:35 2018 (r330173) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:52:27 2018 (r330174) @@ -414,6 +414,7 @@ struct iwm_softc { #define IWM_FLAG_RFKILL (1 << 3) #define IWM_FLAG_BUSY (1 << 4) #define IWM_FLAG_SCANNING (1 << 5) +#define IWM_FLAG_SCAN_RUNNING (1 << 6) struct intr_config_hook sc_preinit_hook; struct callout sc_watchdog_to; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:53:14 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0003AF24657; Thu, 1 Mar 2018 05:53:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9DC9183224; Thu, 1 Mar 2018 05:53:13 +0000 (UTC) (envelope-from eadler@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 98A6C246F1; Thu, 1 Mar 2018 05:53:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215rDBK036743; Thu, 1 Mar 2018 05:53:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215rDT7036738; Thu, 1 Mar 2018 05:53:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010553.w215rDT7036738@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:53: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: r330175 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330175 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.25 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, 01 Mar 2018 05:53:14 -0000 Author: eadler Date: Thu Mar 1 05:53:12 2018 New Revision: 330175 URL: https://svnweb.freebsd.org/changeset/base/330175 Log: MFC r313415: [iwm] Implement apmg_wake_up_wa workaround properly for 7000 family. * Add iwm_pcie_set_cmd_in_flight() and iwm_pcie_clear_cmd_in_flight() helper methods. * Use ring->queued tracking in the command queue to set/clear the cmd_hold_nic_awake bit at the right points. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.h stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:12 2018 (r330175) @@ -182,7 +182,8 @@ __FBSDID("$FreeBSD$"); #define IWM_DEVICE_7000_COMMON \ .device_family = IWM_DEVICE_FAMILY_7000, \ .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ - .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000 + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000, \ + .apmg_wake_up_wa = 1 const struct iwm_cfg iwm7260_cfg = { .fw_name = IWM7260_FW, @@ -1251,6 +1252,9 @@ iwm_reset_tx_ring(struct iwm_softc *sc, struct iwm_tx_ sc->qfullmsk &= ~(1 << ring->qid); ring->queued = 0; ring->cur = 0; + + if (ring->qid == IWM_MVM_CMD_QUEUE && sc->cmd_hold_nic_awake) + iwm_pcie_clear_cmd_in_flight(sc); } static void @@ -3312,6 +3316,18 @@ iwm_cmd_done(struct iwm_softc *sc, struct iwm_rx_packe data->m = NULL; } wakeup(&ring->desc[pkt->hdr.idx]); + + if (((pkt->hdr.idx + ring->queued) % IWM_TX_RING_COUNT) != ring->cur) { + device_printf(sc->sc_dev, + "%s: Some HCMDs skipped?: idx=%d queued=%d cur=%d\n", + __func__, pkt->hdr.idx, ring->queued, ring->cur); + /* XXX call iwm_force_nmi() */ + } + + KASSERT(ring->queued > 0, ("ring->queued is empty?")); + ring->queued--; + if (ring->queued == 0) + iwm_pcie_clear_cmd_in_flight(sc); } #if 0 @@ -5553,9 +5569,6 @@ iwm_notif_intr(struct iwm_softc *sc) ADVANCE_RXQ(sc); } - - IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, - IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); /* * Tell the firmware what we have processed. Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 05:53:12 2018 (r330175) @@ -253,6 +253,9 @@ iwm_nic_lock(struct iwm_softc *sc) { int rv = 0; + if (sc->cmd_hold_nic_awake) + return 1; + IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); @@ -277,6 +280,9 @@ iwm_nic_lock(struct iwm_softc *sc) void iwm_nic_unlock(struct iwm_softc *sc) { + if (sc->cmd_hold_nic_awake) + return; + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); } @@ -582,4 +588,56 @@ iwm_pcie_rx_stop(struct iwm_softc *sc) iwm_nic_unlock(sc); } return ret; +} + +void +iwm_pcie_clear_cmd_in_flight(struct iwm_softc *sc) +{ + if (!sc->cfg->apmg_wake_up_wa) + return; + + if (!sc->cmd_hold_nic_awake) { + device_printf(sc->sc_dev, + "%s: cmd_hold_nic_awake not set\n", __func__); + return; + } + + sc->cmd_hold_nic_awake = 0; + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); +} + +int +iwm_pcie_set_cmd_in_flight(struct iwm_softc *sc) +{ + int ret; + + /* + * wake up the NIC to make sure that the firmware will see the host + * command - we will let the NIC sleep once all the host commands + * returned. This needs to be done only on NICs that have + * apmg_wake_up_wa set. + */ + if (sc->cfg->apmg_wake_up_wa && + !sc->cmd_hold_nic_awake) { + + IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); + + ret = iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, + (IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | + IWM_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), + 15000); + if (ret == 0) { + IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, + IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); + device_printf(sc->sc_dev, + "%s: Failed to wake NIC for hcmd\n", __func__); + return EIO; + } + sc->cmd_hold_nic_awake = 1; + } + + return 0; } Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.h Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.h Thu Mar 1 05:53:12 2018 (r330175) @@ -129,4 +129,7 @@ extern int iwm_start_hw(struct iwm_softc *sc); extern void iwm_set_pwr(struct iwm_softc *sc); extern int iwm_pcie_rx_stop(struct iwm_softc *sc); +extern int iwm_pcie_set_cmd_in_flight(struct iwm_softc *sc); +extern void iwm_pcie_clear_cmd_in_flight(struct iwm_softc *sc); + #endif Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 05:53:12 2018 (r330175) @@ -305,17 +305,10 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); - IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, - IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - if (!iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, - IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, - (IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | - IWM_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 15000)) { - device_printf(sc->sc_dev, - "%s: acquiring device failed\n", __func__); - error = EBUSY; + error = iwm_pcie_set_cmd_in_flight(sc); + if (error) goto out; - } + ring->queued++; #if 0 iwm_update_sched(sc, ring->qid, ring->cur, 0, 0); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:52:27 2018 (r330174) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 05:53:12 2018 (r330175) @@ -389,6 +389,8 @@ enum iwm_device_family { * @host_interrupt_operation_mode: device needs host interrupt operation * mode set * @nvm_hw_section_num: the ID of the HW NVM section + * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command + * is in flight. This is due to a HW bug in 7260, 3160 and 7265. */ struct iwm_cfg { const char *fw_name; @@ -396,6 +398,7 @@ struct iwm_cfg { enum iwm_device_family device_family; int host_interrupt_operation_mode; uint8_t nvm_hw_section_num; + int apmg_wake_up_wa; }; struct iwm_softc { @@ -520,6 +523,8 @@ struct iwm_softc { int sc_max_rssi; struct iwm_notif_wait_data *sc_notif_wait; + + int cmd_hold_nic_awake; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:53:55 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CB562F247AE; Thu, 1 Mar 2018 05:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6286E83422; Thu, 1 Mar 2018 05:53:55 +0000 (UTC) (envelope-from eadler@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 5D8CA246F4; Thu, 1 Mar 2018 05:53:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215rtB3036808; Thu, 1 Mar 2018 05:53:55 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215rtVX036807; Thu, 1 Mar 2018 05:53:55 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010553.w215rtVX036807@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:53: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: r330176 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330176 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.25 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, 01 Mar 2018 05:53:56 -0000 Author: eadler Date: Thu Mar 1 05:53:55 2018 New Revision: 330176 URL: https://svnweb.freebsd.org/changeset/base/330176 Log: MFC r313416: [iwm] Only for family 7000 power-down busmaster DMA clocks when stopping. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:12 2018 (r330175) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:55 2018 (r330176) @@ -1401,11 +1401,12 @@ iwm_stop_device(struct iwm_softc *sc) for (qid = 0; qid < nitems(sc->txq); qid++) iwm_reset_tx_ring(sc, &sc->txq[qid]); - /* - * Power-down device's busmaster DMA clocks - */ - iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); - DELAY(5); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { + /* Power-down device's busmaster DMA clocks */ + iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, + IWM_APMG_CLK_VAL_DMA_CLK_RQT); + DELAY(5); + } /* Make sure (redundant) we've released our request to stay awake */ IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:54:40 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 308F8F24907; Thu, 1 Mar 2018 05:54:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C389883632; Thu, 1 Mar 2018 05:54:39 +0000 (UTC) (envelope-from eadler@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 BDFA6246F6; Thu, 1 Mar 2018 05:54:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215sd56036878; Thu, 1 Mar 2018 05:54:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215sdQG036875; Thu, 1 Mar 2018 05:54:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010554.w215sdQG036875@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:54:39 +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: r330177 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330177 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.25 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, 01 Mar 2018 05:54:40 -0000 Author: eadler Date: Thu Mar 1 05:54:39 2018 New Revision: 330177 URL: https://svnweb.freebsd.org/changeset/base/330177 Log: MFC r313417: [iwm] Very basic DTS thermal sensor support (prints temp as debug msg). * Adds IWM_DEBUG_TEMP debug message type, for printing messages related to temperature sensors and thermal/TDP infos. * The firmware regularly sends us DTS measurement notifications, so just print the temperature value as a debugging message. (Adrian's addition): * Eventually this can be used by the driver to limit transmit rate / power to try and do some thermal throttling. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_debug.h stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:53:55 2018 (r330176) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:54:39 2018 (r330177) @@ -5425,8 +5425,20 @@ iwm_notif_intr(struct iwm_softc *sc) notif->source_id, sc->sc_fw_mcc); break; } - case IWM_DTS_MEASUREMENT_NOTIFICATION: + case IWM_DTS_MEASUREMENT_NOTIFICATION: { + struct iwm_dts_measurement_notif_v1 *notif; + + if (iwm_rx_packet_payload_len(pkt) < sizeof(*notif)) { + device_printf(sc->sc_dev, + "Invalid DTS_MEASUREMENT_NOTIFICATION\n"); + break; + } + notif = (void *)pkt->data; + IWM_DPRINTF(sc, IWM_DEBUG_TEMP, + "IWM_DTS_MEASUREMENT_NOTIFICATION - %d\n", + notif->temp); break; + } case IWM_PHY_CONFIGURATION_CMD: case IWM_TX_ANT_CONFIGURATION_CMD: Modified: stable/11/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 05:53:55 2018 (r330176) +++ stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 05:54:39 2018 (r330177) @@ -41,6 +41,7 @@ enum { IWM_DEBUG_FIRMWARE_TLV = 0x00020000, /* Firmware TLV parsing */ IWM_DEBUG_TRANS = 0x00040000, /* Transport layer (eg PCIe) */ IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ + IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:53:55 2018 (r330176) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:54:39 2018 (r330177) @@ -5978,6 +5978,30 @@ enum iwm_mcc_source { IWM_MCC_SOURCE_GETTING_MCC_TEST_MODE = 0x11, }; +/** + * struct iwm_dts_measurement_notif_v1 - measurements notification + * + * @temp: the measured temperature + * @voltage: the measured voltage + */ +struct iwm_dts_measurement_notif_v1 { + int32_t temp; + int32_t voltage; +} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_1*/ + +/** + * struct iwm_dts_measurement_notif_v2 - measurements notification + * + * @temp: the measured temperature + * @voltage: the measured voltage + * @threshold_idx: the trip index that was crossed + */ +struct iwm_dts_measurement_notif_v2 { + int32_t temp; + int32_t voltage; + int32_t threshold_idx; +} __packed; /* TEMPERATURE_MEASUREMENT_TRIGGER_NTFY_S_VER_2 */ + /* * Some cherry-picked definitions */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 05:58:54 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C750F24F39; Thu, 1 Mar 2018 05:58:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2458483EE4; Thu, 1 Mar 2018 05:58:54 +0000 (UTC) (envelope-from eadler@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 1F69624700; Thu, 1 Mar 2018 05:58:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215wsEe037096; Thu, 1 Mar 2018 05:58:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215wr0w037094; Thu, 1 Mar 2018 05:58:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010558.w215wr0w037094@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:58: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: r330178 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330178 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.25 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, 01 Mar 2018 05:58:54 -0000 Author: eadler Date: Thu Mar 1 05:58:53 2018 New Revision: 330178 URL: https://svnweb.freebsd.org/changeset/base/330178 Log: MFC r313418: [iwm] Recognize IWM_DTS_MEASUREMENT_NOTIF_WIDE notification. * Add the command groups enum, and the iwm_phy_ops_subcmd_ids enum to if_iwmreg.h definitions. * The IWM_DTS_MEASUREMENT_NOTIF_WIDE notification will be generated by version 17 firmware. Taken-From: Linux iwlwifi Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:54:39 2018 (r330177) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:58:53 2018 (r330178) @@ -5425,7 +5425,9 @@ iwm_notif_intr(struct iwm_softc *sc) notif->source_id, sc->sc_fw_mcc); break; } - case IWM_DTS_MEASUREMENT_NOTIFICATION: { + case IWM_DTS_MEASUREMENT_NOTIFICATION: + case IWM_WIDE_ID(IWM_PHY_OPS_GROUP, + IWM_DTS_MEASUREMENT_NOTIF_WIDE): { struct iwm_dts_measurement_notif_v1 *notif; if (iwm_rx_packet_payload_len(pkt) < sizeof(*notif)) { Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:54:39 2018 (r330177) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:58:53 2018 (r330178) @@ -1949,6 +1949,25 @@ enum { IWM_REPLY_MAX = 0xff, }; +enum iwm_phy_ops_subcmd_ids { + IWM_CMD_DTS_MEASUREMENT_TRIGGER_WIDE = 0x0, + IWM_CTDP_CONFIG_CMD = 0x03, + IWM_TEMP_REPORTING_THRESHOLDS_CMD = 0x04, + IWM_CT_KILL_NOTIFICATION = 0xFE, + IWM_DTS_MEASUREMENT_NOTIF_WIDE = 0xFF, +}; + +/* command groups */ +enum { + IWM_LEGACY_GROUP = 0x0, + IWM_LONG_GROUP = 0x1, + IWM_SYSTEM_GROUP = 0x2, + IWM_MAC_CONF_GROUP = 0x3, + IWM_PHY_OPS_GROUP = 0x4, + IWM_DATA_PATH_GROUP = 0x5, + IWM_PROT_OFFLOAD_GROUP = 0xb, +}; + /** * struct iwm_cmd_response - generic response struct for most commands * @status: status of the command asked, changes for each one From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:00:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C95C4F250EF; Thu, 1 Mar 2018 05:59:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0BA818419F; Thu, 1 Mar 2018 05:59:59 +0000 (UTC) (envelope-from eadler@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 06AEE24704; Thu, 1 Mar 2018 05:59:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w215xwF0037176; Thu, 1 Mar 2018 05:59:58 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w215xwYo037174; Thu, 1 Mar 2018 05:59:58 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010559.w215xwYo037174@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 05:59:58 +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: r330179 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330179 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.25 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, 01 Mar 2018 06:00:00 -0000 Author: eadler Date: Thu Mar 1 05:59:58 2018 New Revision: 330179 URL: https://svnweb.freebsd.org/changeset/base/330179 Log: MFC r313427: [iwm] Recognize the IWM_UCODE_TLV_FW_MEM_SEG firmware section type. * Will be needed for loading version 22 of 7265D firmware. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:58:53 2018 (r330178) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:59:58 2018 (r330179) @@ -892,6 +892,9 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode le32toh(((const uint32_t *)tlv_data)[2])); break; + case IWM_UCODE_TLV_FW_MEM_SEG: + break; + default: device_printf(sc->sc_dev, "%s: unknown firmware section %d, abort\n", Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:58:53 2018 (r330178) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 05:59:58 2018 (r330179) @@ -1006,6 +1006,7 @@ enum iwm_ucode_tlv_type { IWM_UCODE_TLV_FW_DBG_CONF = 39, IWM_UCODE_TLV_FW_DBG_TRIGGER = 40, IWM_UCODE_TLV_FW_GSCAN_CAPA = 50, + IWM_UCODE_TLV_FW_MEM_SEG = 51, }; struct iwm_ucode_tlv { From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:00:32 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F313BF251F4; Thu, 1 Mar 2018 06:00:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8652D8436A; Thu, 1 Mar 2018 06:00:31 +0000 (UTC) (envelope-from eadler@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 8130624708; Thu, 1 Mar 2018 06:00:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2160VD7037298; Thu, 1 Mar 2018 06:00:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2160VZr037297; Thu, 1 Mar 2018 06:00:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010600.w2160VZr037297@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:00:31 +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: r330180 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330180 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.25 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, 01 Mar 2018 06:00:32 -0000 Author: eadler Date: Thu Mar 1 06:00:31 2018 New Revision: 330180 URL: https://svnweb.freebsd.org/changeset/base/330180 Log: MFC r313429: [iwm] SCAN_ABORT_UMAC response doesn't use a wide id Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 05:59:58 2018 (r330179) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:31 2018 (r330180) @@ -5456,7 +5456,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_TIME_EVENT_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): - case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_ABORT_UMAC): + case IWM_SCAN_ABORT_UMAC: case IWM_SCAN_OFFLOAD_REQUEST_CMD: case IWM_SCAN_OFFLOAD_ABORT_CMD: case IWM_REPLY_BEACON_FILTERING_CMD: From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:01:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EBF71F252BD; Thu, 1 Mar 2018 06:00:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A241884557; Thu, 1 Mar 2018 06:00:59 +0000 (UTC) (envelope-from eadler@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 9D63A2472D; Thu, 1 Mar 2018 06:00:59 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2160xKb037359; Thu, 1 Mar 2018 06:00:59 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2160xXg037358; Thu, 1 Mar 2018 06:00:59 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010600.w2160xXg037358@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:00: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: r330181 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330181 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.25 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, 01 Mar 2018 06:01:00 -0000 Author: eadler Date: Thu Mar 1 06:00:59 2018 New Revision: 330181 URL: https://svnweb.freebsd.org/changeset/base/330181 Log: MFC r313430: [iwm] Remove 1s delay after fw loading. Can't reproduce issues on AC8260. The 1s delay was added in the update to version 16 fw, where Family 8000 support was added. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:31 2018 (r330180) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:59 2018 (r330181) @@ -2678,12 +2678,6 @@ iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode } } - /* - * Give the firmware some time to initialize. - * Accessing it too early causes errors. - */ - msleep(&w, &sc->sc_mtx, 0, "iwmfwinit", hz); - return error; } From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:01:34 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AAA3DF2536A; Thu, 1 Mar 2018 06:01:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A76D8476C; Thu, 1 Mar 2018 06:01:33 +0000 (UTC) (envelope-from eadler@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 5563624753; Thu, 1 Mar 2018 06:01:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2161XLY039599; Thu, 1 Mar 2018 06:01:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2161X2x039597; Thu, 1 Mar 2018 06:01:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010601.w2161X2x039597@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:01:33 +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: r330182 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330182 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.25 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, 01 Mar 2018 06:01:34 -0000 Author: eadler Date: Thu Mar 1 06:01:33 2018 New Revision: 330182 URL: https://svnweb.freebsd.org/changeset/base/330182 Log: MFC r314065: [iwm] Synchronize firmware loading code with Linux iwlwifi. * While there, rename some functions to match the names and functionality of the similarly named functions in Linux iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:00:59 2018 (r330181) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:01:33 2018 (r330182) @@ -353,15 +353,20 @@ static void iwm_set_radio_cfg(const struct iwm_softc * static struct iwm_nvm_data * iwm_parse_nvm_sections(struct iwm_softc *, struct iwm_nvm_section *); static int iwm_nvm_init(struct iwm_softc *); -static int iwm_firmware_load_sect(struct iwm_softc *, uint32_t, - const uint8_t *, uint32_t); -static int iwm_firmware_load_chunk(struct iwm_softc *, uint32_t, - const uint8_t *, uint32_t); -static int iwm_load_firmware_7000(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_load_cpu_sections_8000(struct iwm_softc *, - struct iwm_fw_sects *, int , int *); -static int iwm_load_firmware_8000(struct iwm_softc *, enum iwm_ucode_type); -static int iwm_load_firmware(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_pcie_load_section(struct iwm_softc *, uint8_t, + const struct iwm_fw_desc *); +static int iwm_pcie_load_firmware_chunk(struct iwm_softc *, uint32_t, + bus_addr_t, uint32_t); +static int iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, + const struct iwm_fw_sects *, + int, int *); +static int iwm_pcie_load_cpu_sections(struct iwm_softc *, + const struct iwm_fw_sects *, + int, int *); +static int iwm_pcie_load_given_ucode_8000(struct iwm_softc *, + const struct iwm_fw_sects *); +static int iwm_pcie_load_given_ucode(struct iwm_softc *, + const struct iwm_fw_sects *); static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); @@ -485,7 +490,7 @@ iwm_firmware_store_section(struct iwm_softc *sc, enum iwm_ucode_type type, const uint8_t *data, size_t dlen) { struct iwm_fw_sects *fws; - struct iwm_fw_onesect *fwone; + struct iwm_fw_desc *fwone; if (type >= IWM_UCODE_TYPE_MAX) return EINVAL; @@ -499,11 +504,11 @@ iwm_firmware_store_section(struct iwm_softc *sc, fwone = &fws->fw_sect[fws->fw_count]; /* first 32bit are device load offset */ - memcpy(&fwone->fws_devoff, data, sizeof(uint32_t)); + memcpy(&fwone->offset, data, sizeof(uint32_t)); /* rest is data */ - fwone->fws_data = data + sizeof(uint32_t); - fwone->fws_len = dlen - sizeof(uint32_t); + fwone->data = data + sizeof(uint32_t); + fwone->len = dlen - sizeof(uint32_t); fws->fw_count++; @@ -559,6 +564,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode const uint8_t *data; uint32_t usniffer_img; uint32_t paging_mem_size; + int num_of_cpus; int error = 0; size_t len; @@ -699,18 +705,24 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } break; - case IWM_UCODE_TLV_NUM_OF_CPU: { - uint32_t num_cpu; + case IWM_UCODE_TLV_NUM_OF_CPU: if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) < sizeof(uint32_t)\n", + "%s: IWM_UCODE_TLV_NUM_OF_CPU: tlv_len (%d) != sizeof(uint32_t)\n", __func__, (int) tlv_len); error = EINVAL; goto parse_out; } - num_cpu = le32toh(*(const uint32_t *)tlv_data); - if (num_cpu < 1 || num_cpu > 2) { + num_of_cpus = le32toh(*(const uint32_t *)tlv_data); + if (num_of_cpus == 2) { + fw->fw_sects[IWM_UCODE_REGULAR].is_dual_cpus = + TRUE; + fw->fw_sects[IWM_UCODE_INIT].is_dual_cpus = + TRUE; + fw->fw_sects[IWM_UCODE_WOWLAN].is_dual_cpus = + TRUE; + } else if ((num_of_cpus > 2) || (num_of_cpus < 1)) { device_printf(sc->sc_dev, "%s: Driver supports only 1 or 2 CPUs\n", __func__); @@ -718,7 +730,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } break; - } case IWM_UCODE_TLV_SEC_RT: if ((error = iwm_firmware_store_section(sc, IWM_UCODE_REGULAR, tlv_data, tlv_len)) != 0) { @@ -2414,53 +2425,68 @@ iwm_nvm_init(struct iwm_softc *sc) return 0; } -/* - * Firmware loading gunk. This is kind of a weird hybrid between the - * iwn driver and the Linux iwlwifi driver. - */ - static int -iwm_firmware_load_sect(struct iwm_softc *sc, uint32_t dst_addr, - const uint8_t *section, uint32_t byte_cnt) +iwm_pcie_load_section(struct iwm_softc *sc, uint8_t section_num, + const struct iwm_fw_desc *section) { - int error = EINVAL; - uint32_t chunk_sz, offset; + struct iwm_dma_info *dma = &sc->fw_dma; + uint8_t *v_addr; + bus_addr_t p_addr; + uint32_t offset, chunk_sz = MIN(IWM_FH_MEM_TB_MAX_LENGTH, section->len); + int ret = 0; - chunk_sz = MIN(IWM_FH_MEM_TB_MAX_LENGTH, byte_cnt); + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "%s: [%d] uCode section being loaded...\n", + __func__, section_num); - for (offset = 0; offset < byte_cnt; offset += chunk_sz) { - uint32_t addr, len; - const uint8_t *data; + v_addr = dma->vaddr; + p_addr = dma->paddr; - addr = dst_addr + offset; - len = MIN(chunk_sz, byte_cnt - offset); - data = section + offset; + for (offset = 0; offset < section->len; offset += chunk_sz) { + uint32_t copy_size, dst_addr; + int extended_addr = FALSE; - error = iwm_firmware_load_chunk(sc, addr, data, len); - if (error) + copy_size = MIN(chunk_sz, section->len - offset); + dst_addr = section->offset + offset; + + if (dst_addr >= IWM_FW_MEM_EXTENDED_START && + dst_addr <= IWM_FW_MEM_EXTENDED_END) + extended_addr = TRUE; + + if (extended_addr) + iwm_set_bits_prph(sc, IWM_LMPM_CHICK, + IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); + + memcpy(v_addr, (const uint8_t *)section->data + offset, + copy_size); + bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); + ret = iwm_pcie_load_firmware_chunk(sc, dst_addr, p_addr, + copy_size); + + if (extended_addr) + iwm_clear_bits_prph(sc, IWM_LMPM_CHICK, + IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); + + if (ret) { + device_printf(sc->sc_dev, + "%s: Could not load the [%d] uCode section\n", + __func__, section_num); break; + } } - return error; + return ret; } +/* + * ucode + */ static int -iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t dst_addr, - const uint8_t *chunk, uint32_t byte_cnt) +iwm_pcie_load_firmware_chunk(struct iwm_softc *sc, uint32_t dst_addr, + bus_addr_t phy_addr, uint32_t byte_cnt) { - struct iwm_dma_info *dma = &sc->fw_dma; - int error; + int ret; - /* Copy firmware chunk into pre-allocated DMA-safe memory. */ - memcpy(dma->vaddr, chunk, byte_cnt); - bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); - - if (dst_addr >= IWM_FW_MEM_EXTENDED_START && - dst_addr <= IWM_FW_MEM_EXTENDED_END) { - iwm_set_bits_prph(sc, IWM_LMPM_CHICK, - IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); - } - sc->sc_fw_chunk_done = 0; if (!iwm_nic_lock(sc)) @@ -2468,17 +2494,22 @@ iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_CONFIG_REG(IWM_FH_SRVC_CHNL), IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_PAUSE); + IWM_WRITE(sc, IWM_FH_SRVC_CHNL_SRAM_ADDR_REG(IWM_FH_SRVC_CHNL), dst_addr); + IWM_WRITE(sc, IWM_FH_TFDIB_CTRL0_REG(IWM_FH_SRVC_CHNL), - dma->paddr & IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); + phy_addr & IWM_FH_MEM_TFDIB_DRAM_ADDR_LSB_MSK); + IWM_WRITE(sc, IWM_FH_TFDIB_CTRL1_REG(IWM_FH_SRVC_CHNL), - (iwm_get_dma_hi_addr(dma->paddr) - << IWM_FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt); + (iwm_get_dma_hi_addr(phy_addr) + << IWM_FH_MEM_TFDIB_REG1_ADDR_BITSHIFT) | byte_cnt); + IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_BUF_STS_REG(IWM_FH_SRVC_CHNL), 1 << IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_NUM | 1 << IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_POS_TB_IDX | IWM_FH_TCSR_CHNL_TX_BUF_STS_REG_VAL_TFDB_VALID); + IWM_WRITE(sc, IWM_FH_TCSR_CHNL_TX_CONFIG_REG(IWM_FH_SRVC_CHNL), IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CHNL_ENABLE | IWM_FH_TCSR_TX_CONFIG_REG_VAL_DMA_CREDIT_DISABLE | @@ -2486,37 +2517,31 @@ iwm_firmware_load_chunk(struct iwm_softc *sc, uint32_t iwm_nic_unlock(sc); - /* wait 1s for this segment to load */ - while (!sc->sc_fw_chunk_done) - if ((error = msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz)) != 0) + /* wait up to 5s for this segment to load */ + ret = 0; + while (!sc->sc_fw_chunk_done) { + ret = msleep(&sc->sc_fw, &sc->sc_mtx, 0, "iwmfw", hz); + if (ret) break; + } - if (!sc->sc_fw_chunk_done) { + if (ret != 0) { device_printf(sc->sc_dev, "fw chunk addr 0x%x len %d failed to load\n", dst_addr, byte_cnt); + return ETIMEDOUT; } - if (dst_addr >= IWM_FW_MEM_EXTENDED_START && - dst_addr <= IWM_FW_MEM_EXTENDED_END && iwm_nic_lock(sc)) { - iwm_clear_bits_prph(sc, IWM_LMPM_CHICK, - IWM_LMPM_CHICK_EXTENDED_ADDR_SPACE); - iwm_nic_unlock(sc); - } - - return error; + return 0; } -int -iwm_load_cpu_sections_8000(struct iwm_softc *sc, struct iwm_fw_sects *fws, - int cpu, int *first_ucode_section) +static int +iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, + const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) { int shift_param; - int i, error = 0, sec_num = 0x1; + int i, ret = 0, sec_num = 0x1; uint32_t val, last_read_idx = 0; - const void *data; - uint32_t dlen; - uint32_t offset; if (cpu == 1) { shift_param = 0; @@ -2528,9 +2553,6 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc for (i = *first_ucode_section; i < IWM_UCODE_SECTION_MAX; i++) { last_read_idx = i; - data = fws->fw_sect[i].fws_data; - dlen = fws->fw_sect[i].fws_len; - offset = fws->fw_sect[i].fws_devoff; /* * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between @@ -2538,27 +2560,17 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc * PAGING_SEPARATOR_SECTION delimiter - separate between * CPU2 non paged to CPU2 paging sec. */ - if (!data || offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || - offset == IWM_PAGING_SEPARATOR_SECTION) - break; - - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "LOAD FIRMWARE chunk %d offset 0x%x len %d for cpu %d\n", - i, offset, dlen, cpu); - - if (dlen > sc->sc_fwdmasegsz) { + if (!image->fw_sect[i].data || + image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "chunk %d too large (%d bytes)\n", i, dlen); - error = EFBIG; - } else { - error = iwm_firmware_load_sect(sc, offset, data, dlen); + "Break since Data not valid or Empty section, sec = %d\n", + i); + break; } - if (error) { - device_printf(sc->sc_dev, - "could not load firmware chunk %d (error %d)\n", - i, error); - return error; - } + ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + if (ret) + return ret; /* Notify the ucode of the loaded section number and status */ if (iwm_nic_lock(sc)) { @@ -2588,63 +2600,85 @@ iwm_load_cpu_sections_8000(struct iwm_softc *sc, struc return 0; } -int -iwm_load_firmware_8000(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +static int +iwm_pcie_load_cpu_sections(struct iwm_softc *sc, + const struct iwm_fw_sects *image, int cpu, int *first_ucode_section) { - struct iwm_fw_sects *fws; - int error = 0; - int first_ucode_section; + int shift_param; + int i, ret = 0; + uint32_t last_read_idx = 0; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, "loading ucode type %d\n", - ucode_type); + if (cpu == 1) { + shift_param = 0; + *first_ucode_section = 0; + } else { + shift_param = 16; + (*first_ucode_section)++; + } - fws = &sc->sc_fw.fw_sects[ucode_type]; + for (i = *first_ucode_section; i < IWM_UCODE_SECTION_MAX; i++) { + last_read_idx = i; - /* configure the ucode to be ready to get the secured image */ - /* release CPU reset */ - iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + /* + * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between + * CPU1 to CPU2. + * PAGING_SEPARATOR_SECTION delimiter - separate between + * CPU2 non paged to CPU2 paging sec. + */ + if (!image->fw_sect[i].data || + image->fw_sect[i].offset == IWM_CPU1_CPU2_SEPARATOR_SECTION || + image->fw_sect[i].offset == IWM_PAGING_SEPARATOR_SECTION) { + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Break since Data not valid or Empty section, sec = %d\n", + i); + break; + } - /* load to FW the binary Secured sections of CPU1 */ - error = iwm_load_cpu_sections_8000(sc, fws, 1, &first_ucode_section); - if (error) - return error; + ret = iwm_pcie_load_section(sc, i, &image->fw_sect[i]); + if (ret) + return ret; + } - /* load to FW the binary sections of CPU2 */ - return iwm_load_cpu_sections_8000(sc, fws, 2, &first_ucode_section); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + iwm_set_bits_prph(sc, + IWM_CSR_UCODE_LOAD_STATUS_ADDR, + (IWM_LMPM_CPU_UCODE_LOADING_COMPLETED | + IWM_LMPM_CPU_HDRS_LOADING_COMPLETED | + IWM_LMPM_CPU_UCODE_LOADING_STARTED) << + shift_param); + + *first_ucode_section = last_read_idx; + + return 0; + } static int -iwm_load_firmware_7000(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +iwm_pcie_load_given_ucode(struct iwm_softc *sc, + const struct iwm_fw_sects *image) { - struct iwm_fw_sects *fws; - int error, i; - const void *data; - uint32_t dlen; - uint32_t offset; + int ret = 0; + int first_ucode_section; - sc->sc_uc.uc_intr = 0; + IWM_DPRINTF(sc, IWM_DEBUG_RESET, "working with %s CPU\n", + image->is_dual_cpus ? "Dual" : "Single"); - fws = &sc->sc_fw.fw_sects[ucode_type]; - for (i = 0; i < fws->fw_count; i++) { - data = fws->fw_sect[i].fws_data; - dlen = fws->fw_sect[i].fws_len; - offset = fws->fw_sect[i].fws_devoff; - IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, - "LOAD FIRMWARE type %d offset %u len %d\n", - ucode_type, offset, dlen); - if (dlen > sc->sc_fwdmasegsz) { - IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, - "chunk %d too large (%d bytes)\n", i, dlen); - error = EFBIG; - } else { - error = iwm_firmware_load_sect(sc, offset, data, dlen); - } - if (error) { - device_printf(sc->sc_dev, - "could not load firmware chunk %u of %u " - "(error=%d)\n", i, fws->fw_count, error); - return error; - } + /* load to FW the binary non secured sections of CPU1 */ + ret = iwm_pcie_load_cpu_sections(sc, image, 1, &first_ucode_section); + if (ret) + return ret; + + if (image->is_dual_cpus) { + /* set CPU2 header address */ + iwm_write_prph(sc, + IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, + IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + + /* load to FW the binary sections of CPU2 */ + ret = iwm_pcie_load_cpu_sections(sc, image, 2, + &first_ucode_section); + if (ret) + return ret; } IWM_WRITE(sc, IWM_CSR_RESET, 0); @@ -2652,15 +2686,43 @@ iwm_load_firmware_7000(struct iwm_softc *sc, enum iwm_ return 0; } +int +iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, + const struct iwm_fw_sects *image) +{ + int ret = 0; + int first_ucode_section; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, "working with %s CPU\n", + image->is_dual_cpus ? "Dual" : "Single"); + + /* configure the ucode to be ready to get the secured image */ + /* release CPU reset */ + iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + + /* load to FW the binary Secured sections of CPU1 */ + ret = iwm_pcie_load_cpu_sections_8000(sc, image, 1, + &first_ucode_section); + if (ret) + return ret; + + /* load to FW the binary sections of CPU2 */ + return iwm_pcie_load_cpu_sections_8000(sc, image, 2, + &first_ucode_section); +} + static int iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { int error, w; - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - error = iwm_load_firmware_8000(sc, ucode_type); - else - error = iwm_load_firmware_7000(sc, ucode_type); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + error = iwm_pcie_load_given_ucode_8000(sc, + &sc->sc_fw.fw_sects[ucode_type]); + } else { + error = iwm_pcie_load_given_ucode(sc, + &sc->sc_fw.fw_sects[ucode_type]); + } if (error) return error; Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:00:59 2018 (r330181) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:01:33 2018 (r330182) @@ -170,17 +170,21 @@ enum iwm_ucode_type { IWM_UCODE_TYPE_MAX }; +/* one for each uCode image (inst/data, init/runtime/wowlan) */ +struct iwm_fw_desc { + const void *data; /* vmalloc'ed data */ + uint32_t len; /* size in bytes */ + uint32_t offset; /* offset in the device */ +}; + struct iwm_fw_info { const struct firmware *fw_fp; int fw_status; struct iwm_fw_sects { - struct iwm_fw_onesect { - const void *fws_data; - uint32_t fws_len; - uint32_t fws_devoff; - } fw_sect[IWM_UCODE_SECTION_MAX]; + struct iwm_fw_desc fw_sect[IWM_UCODE_SECTION_MAX]; int fw_count; + int is_dual_cpus; uint32_t paging_mem_size; } fw_sects[IWM_UCODE_TYPE_MAX]; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:13:02 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A1C42F2674D; Thu, 1 Mar 2018 06:13:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D0DA86307; Thu, 1 Mar 2018 06:13:02 +0000 (UTC) (envelope-from eadler@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 474C724A69; Thu, 1 Mar 2018 06:13:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216D2A7046759; Thu, 1 Mar 2018 06:13:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216D1OZ046756; Thu, 1 Mar 2018 06:13:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010613.w216D1OZ046756@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:13: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: r330183 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330183 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.25 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, 01 Mar 2018 06:13:03 -0000 Author: eadler Date: Thu Mar 1 06:13:01 2018 New Revision: 330183 URL: https://svnweb.freebsd.org/changeset/base/330183 Log: MFC r314066: [iwm] Sync IWM_MVM_ALIVE waiting and start_fw handling with iwlwifi. * Use the notification wait API, like it's done in the Linux iwlwifi code, to wait for the IWM_MVM_ALIVE notification. * This also should fix some firmware load interrupt issues, and errors in the nic lock using. Tested: * (adrian) Intel 7260, STA mode Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:01:33 2018 (r330182) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:13:01 2018 (r330183) @@ -285,8 +285,14 @@ struct iwm_nvm_section { uint8_t *data; }; +#define IWM_MVM_UCODE_ALIVE_TIMEOUT hz #define IWM_MVM_UCODE_CALIB_TIMEOUT (2*hz) +struct iwm_mvm_alive_data { + int valid; + uint32_t scd_base_addr; +}; + static int iwm_store_cscheme(struct iwm_softc *, const uint8_t *, size_t); static int iwm_firmware_store_section(struct iwm_softc *, enum iwm_ucode_type, @@ -320,7 +326,7 @@ static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); static int iwm_enable_txq(struct iwm_softc *, int, int, int); -static int iwm_post_alive(struct iwm_softc *); +static int iwm_trans_pcie_fw_alive(struct iwm_softc *, uint32_t); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); static int iwm_nvm_read_section(struct iwm_softc *, uint16_t, uint8_t *, @@ -367,7 +373,7 @@ static int iwm_pcie_load_given_ucode_8000(struct iwm_s const struct iwm_fw_sects *); static int iwm_pcie_load_given_ucode(struct iwm_softc *, const struct iwm_fw_sects *); -static int iwm_start_fw(struct iwm_softc *, enum iwm_ucode_type); +static int iwm_start_fw(struct iwm_softc *, const struct iwm_fw_sects *); static int iwm_send_tx_ant_cfg(struct iwm_softc *, uint8_t); static int iwm_send_phy_cfg_cmd(struct iwm_softc *); static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *, @@ -1633,20 +1639,33 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q (0 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | (1 << IWM_SCD_QUEUE_STTS_REG_POS_SCD_ACT_EN)); + iwm_nic_unlock(sc); + iwm_clear_bits_prph(sc, IWM_SCD_AGGR_SEL, (1 << qid)); + if (!iwm_nic_lock(sc)) { + device_printf(sc->sc_dev, + "%s: cannot enable txq %d\n", __func__, qid); + return EBUSY; + } iwm_write_prph(sc, IWM_SCD_QUEUE_RDPTR(qid), 0); + iwm_nic_unlock(sc); - iwm_write_mem32(sc, sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); + iwm_write_mem32(sc, sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid), 0); /* Set scheduler window size and frame limit. */ iwm_write_mem32(sc, - sc->sched_base + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + + sc->scd_base_addr + IWM_SCD_CONTEXT_QUEUE_OFFSET(qid) + sizeof(uint32_t), ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_POS) & IWM_SCD_QUEUE_CTX_REG2_WIN_SIZE_MSK) | ((IWM_FRAME_LIMIT << IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_POS) & IWM_SCD_QUEUE_CTX_REG2_FRAME_LIMIT_MSK)); + if (!iwm_nic_lock(sc)) { + device_printf(sc->sc_dev, + "%s: cannot enable txq %d\n", __func__, qid); + return EBUSY; + } iwm_write_prph(sc, IWM_SCD_QUEUE_STATUS_BITS(qid), (1 << IWM_SCD_QUEUE_STTS_REG_POS_ACTIVE) | (fifo << IWM_SCD_QUEUE_STTS_REG_POS_TXF) | @@ -1690,34 +1709,38 @@ iwm_enable_txq(struct iwm_softc *sc, int sta_id, int q } static int -iwm_post_alive(struct iwm_softc *sc) +iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t scd_base_addr) { - int nwords; int error, chnl; - uint32_t base; + int clear_dwords = (IWM_SCD_TRANS_TBL_MEM_UPPER_BOUND - + IWM_SCD_CONTEXT_MEM_LOWER_BOUND) / sizeof(uint32_t); + if (!iwm_nic_lock(sc)) return EBUSY; - base = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); - if (sc->sched_base != base) { + iwm_ict_reset(sc); + + iwm_nic_unlock(sc); + + sc->scd_base_addr = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); + if (scd_base_addr != 0 && + scd_base_addr != sc->scd_base_addr) { device_printf(sc->sc_dev, "%s: sched addr mismatch: alive: 0x%x prph: 0x%x\n", - __func__, sc->sched_base, base); + __func__, sc->scd_base_addr, scd_base_addr); } - iwm_ict_reset(sc); - - /* Clear TX scheduler state in SRAM. */ - nwords = (IWM_SCD_TRANS_TBL_MEM_UPPER_BOUND - - IWM_SCD_CONTEXT_MEM_LOWER_BOUND) - / sizeof(uint32_t); + /* reset context data, TX status and translation data */ error = iwm_write_mem(sc, - sc->sched_base + IWM_SCD_CONTEXT_MEM_LOWER_BOUND, - NULL, nwords); + sc->scd_base_addr + IWM_SCD_CONTEXT_MEM_LOWER_BOUND, + NULL, clear_dwords); if (error) - goto out; + return EBUSY; + if (!iwm_nic_lock(sc)) + return EBUSY; + /* Set physical address of TX scheduler rings (1KB aligned). */ iwm_write_prph(sc, IWM_SCD_DRAM_BASE_ADDR, sc->sched_dma.paddr >> 10); @@ -1745,14 +1768,14 @@ iwm_post_alive(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_FH_TX_CHICKEN_BITS_REG, IWM_FH_TX_CHICKEN_BITS_SCD_AUTO_RETRY_EN); + iwm_nic_unlock(sc); + /* Enable L1-Active */ if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { iwm_clear_bits_prph(sc, IWM_APMG_PCIDEV_STT_REG, IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); } - out: - iwm_nic_unlock(sc); return error; } @@ -2589,6 +2612,8 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, *first_ucode_section = last_read_idx; + iwm_enable_interrupts(sc); + if (iwm_nic_lock(sc)) { if (cpu == 1) IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, 0xFFFF); @@ -2681,6 +2706,9 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, return ret; } + iwm_enable_interrupts(sc); + + /* release CPU reset */ IWM_WRITE(sc, IWM_CSR_RESET, 0); return 0; @@ -2711,67 +2739,72 @@ iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, &first_ucode_section); } -static int -iwm_load_firmware(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +/* XXX Get rid of this definition */ +static inline void +iwm_enable_fw_load_int(struct iwm_softc *sc) { - int error, w; - - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { - error = iwm_pcie_load_given_ucode_8000(sc, - &sc->sc_fw.fw_sects[ucode_type]); - } else { - error = iwm_pcie_load_given_ucode(sc, - &sc->sc_fw.fw_sects[ucode_type]); - } - if (error) - return error; - - /* wait for the firmware to load */ - for (w = 0; !sc->sc_uc.uc_intr && w < 10; w++) { - error = msleep(&sc->sc_uc, &sc->sc_mtx, 0, "iwmuc", hz/10); - } - if (error || !sc->sc_uc.uc_ok) { - device_printf(sc->sc_dev, "could not load firmware\n"); - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { - device_printf(sc->sc_dev, "cpu1 status: 0x%x\n", - iwm_read_prph(sc, IWM_SB_CPU_1_STATUS)); - device_printf(sc->sc_dev, "cpu2 status: 0x%x\n", - iwm_read_prph(sc, IWM_SB_CPU_2_STATUS)); - } - } - - return error; + IWM_DPRINTF(sc, IWM_DEBUG_INTR, "Enabling FW load interrupt\n"); + sc->sc_intmask = IWM_CSR_INT_BIT_FH_TX; + IWM_WRITE(sc, IWM_CSR_INT_MASK, sc->sc_intmask); } -/* iwlwifi: pcie/trans.c */ +/* XXX Add proper rfkill support code */ static int -iwm_start_fw(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) +iwm_start_fw(struct iwm_softc *sc, + const struct iwm_fw_sects *fw) { - int error; + int ret; - IWM_WRITE(sc, IWM_CSR_INT, ~0); - - if ((error = iwm_nic_init(sc)) != 0) { - device_printf(sc->sc_dev, "unable to init nic\n"); - return error; + /* This may fail if AMT took ownership of the device */ + if (iwm_prepare_card_hw(sc)) { + device_printf(sc->sc_dev, + "%s: Exit HW not ready\n", __func__); + ret = EIO; + goto out; } + IWM_WRITE(sc, IWM_CSR_INT, 0xFFFFFFFF); + + iwm_disable_interrupts(sc); + /* make sure rfkill handshake bits are cleared */ IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_DRV_GP1_BIT_CMD_BLOCKED); /* clear (again), then enable host interrupts */ - IWM_WRITE(sc, IWM_CSR_INT, ~0); - iwm_enable_interrupts(sc); + IWM_WRITE(sc, IWM_CSR_INT, 0xFFFFFFFF); + ret = iwm_nic_init(sc); + if (ret) { + device_printf(sc->sc_dev, "%s: Unable to init nic\n", __func__); + goto out; + } + + /* + * Now, we load the firmware and don't want to be interrupted, even + * by the RF-Kill interrupt (hence mask all the interrupt besides the + * FH_TX interrupt which is needed to load the firmware). If the + * RF-Kill switch is toggled, we will find out after having loaded + * the firmware and return the proper value to the caller. + */ + iwm_enable_fw_load_int(sc); + /* really make sure rfkill handshake bits are cleared */ /* maybe we should write a few times more? just to make sure */ IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); IWM_WRITE(sc, IWM_CSR_UCODE_DRV_GP1_CLR, IWM_CSR_UCODE_SW_BIT_RFKILL); /* Load the given image to the HW */ - return iwm_load_firmware(sc, ucode_type); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + ret = iwm_pcie_load_given_ucode_8000(sc, fw); + else + ret = iwm_pcie_load_given_ucode(sc, fw); + + /* XXX re-check RF-Kill state */ + +out: + return ret; } static int @@ -2790,7 +2823,7 @@ static int iwm_send_phy_cfg_cmd(struct iwm_softc *sc) { struct iwm_phy_cfg_cmd phy_cfg_cmd; - enum iwm_ucode_type ucode_type = sc->sc_uc_current; + enum iwm_ucode_type ucode_type = sc->cur_ucode; /* Set parameters */ phy_cfg_cmd.phy_cfg = htole32(iwm_mvm_get_phy_config(sc)); @@ -2806,6 +2839,83 @@ iwm_send_phy_cfg_cmd(struct iwm_softc *sc) } static int +iwm_alive_fn(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) +{ + struct iwm_mvm_alive_data *alive_data = data; + struct iwm_mvm_alive_resp_ver1 *palive1; + struct iwm_mvm_alive_resp_ver2 *palive2; + struct iwm_mvm_alive_resp *palive; + + if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive1)) { + palive1 = (void *)pkt->data; + + sc->support_umac_log = FALSE; + sc->error_event_table = + le32toh(palive1->error_event_table_ptr); + sc->log_event_table = + le32toh(palive1->log_event_table_ptr); + alive_data->scd_base_addr = le32toh(palive1->scd_base_ptr); + + alive_data->valid = le16toh(palive1->status) == + IWM_ALIVE_STATUS_OK; + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Alive VER1 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", + le16toh(palive1->status), palive1->ver_type, + palive1->ver_subtype, palive1->flags); + } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive2)) { + palive2 = (void *)pkt->data; + sc->error_event_table = + le32toh(palive2->error_event_table_ptr); + sc->log_event_table = + le32toh(palive2->log_event_table_ptr); + alive_data->scd_base_addr = le32toh(palive2->scd_base_ptr); + sc->umac_error_event_table = + le32toh(palive2->error_info_addr); + + alive_data->valid = le16toh(palive2->status) == + IWM_ALIVE_STATUS_OK; + if (sc->umac_error_event_table) + sc->support_umac_log = TRUE; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Alive VER2 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", + le16toh(palive2->status), palive2->ver_type, + palive2->ver_subtype, palive2->flags); + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "UMAC version: Major - 0x%x, Minor - 0x%x\n", + palive2->umac_major, palive2->umac_minor); + } else if (iwm_rx_packet_payload_len(pkt) == sizeof(*palive)) { + palive = (void *)pkt->data; + + sc->error_event_table = + le32toh(palive->error_event_table_ptr); + sc->log_event_table = + le32toh(palive->log_event_table_ptr); + alive_data->scd_base_addr = le32toh(palive->scd_base_ptr); + sc->umac_error_event_table = + le32toh(palive->error_info_addr); + + alive_data->valid = le16toh(palive->status) == + IWM_ALIVE_STATUS_OK; + if (sc->umac_error_event_table) + sc->support_umac_log = TRUE; + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "Alive VER3 ucode status 0x%04x revision 0x%01X 0x%01X flags 0x%01X\n", + le16toh(palive->status), palive->ver_type, + palive->ver_subtype, palive->flags); + + IWM_DPRINTF(sc, IWM_DEBUG_RESET, + "UMAC version: Major - 0x%x, Minor - 0x%x\n", + le32toh(palive->umac_major), + le32toh(palive->umac_minor)); + } + + return TRUE; +} + +static int iwm_wait_phy_db_entry(struct iwm_softc *sc, struct iwm_rx_packet *pkt, void *data) { @@ -2831,27 +2941,76 @@ static int iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, enum iwm_ucode_type ucode_type) { - enum iwm_ucode_type old_type = sc->sc_uc_current; + struct iwm_notification_wait alive_wait; + struct iwm_mvm_alive_data alive_data; + const struct iwm_fw_sects *fw; + enum iwm_ucode_type old_type = sc->cur_ucode; int error; + static const uint16_t alive_cmd[] = { IWM_MVM_ALIVE }; if ((error = iwm_read_firmware(sc, ucode_type)) != 0) { device_printf(sc->sc_dev, "iwm_read_firmware: failed %d\n", error); return error; } + fw = &sc->sc_fw.fw_sects[ucode_type]; + sc->cur_ucode = ucode_type; + sc->ucode_loaded = FALSE; - sc->sc_uc_current = ucode_type; - error = iwm_start_fw(sc, ucode_type); + memset(&alive_data, 0, sizeof(alive_data)); + iwm_init_notification_wait(sc->sc_notif_wait, &alive_wait, + alive_cmd, nitems(alive_cmd), + iwm_alive_fn, &alive_data); + + error = iwm_start_fw(sc, fw); if (error) { device_printf(sc->sc_dev, "iwm_start_fw: failed %d\n", error); - sc->sc_uc_current = old_type; + sc->cur_ucode = old_type; + iwm_remove_notification(sc->sc_notif_wait, &alive_wait); return error; } - error = iwm_post_alive(sc); + /* + * Some things may run in the background now, but we + * just wait for the ALIVE notification here. + */ + IWM_UNLOCK(sc); + error = iwm_wait_notification(sc->sc_notif_wait, &alive_wait, + IWM_MVM_UCODE_ALIVE_TIMEOUT); + IWM_LOCK(sc); if (error) { - device_printf(sc->sc_dev, "iwm_fw_alive: failed %d\n", error); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + device_printf(sc->sc_dev, + "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", + iwm_read_prph(sc, IWM_SB_CPU_1_STATUS), + iwm_read_prph(sc, IWM_SB_CPU_2_STATUS)); + } + sc->cur_ucode = old_type; + return error; } + + if (!alive_data.valid) { + device_printf(sc->sc_dev, "%s: Loaded ucode is not valid\n", + __func__); + sc->cur_ucode = old_type; + return EIO; + } + + iwm_trans_pcie_fw_alive(sc, alive_data.scd_base_addr); + + /* + * configure and operate fw paging mechanism. + * driver configures the paging flow only once, CPU2 paging image + * included in the IWM_UCODE_INIT image. + */ + if (fw->paging_mem_size) { + /* XXX implement FW paging */ + device_printf(sc->sc_dev, + "%s: XXX FW paging not implemented yet\n", __func__); + } + + if (!error) + sc->ucode_loaded = TRUE; return error; } @@ -5175,7 +5334,7 @@ iwm_nic_umac_error(struct iwm_softc *sc) struct iwm_umac_error_event_table table; uint32_t base; - base = sc->sc_uc.uc_umac_error_event_table; + base = sc->umac_error_event_table; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", @@ -5230,7 +5389,7 @@ iwm_nic_error(struct iwm_softc *sc) uint32_t base; device_printf(sc->sc_dev, "dumping device error log\n"); - base = sc->sc_uc.uc_error_event_table; + base = sc->umac_error_event_table; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", base); @@ -5292,7 +5451,7 @@ iwm_nic_error(struct iwm_softc *sc) device_printf(sc->sc_dev, "%08X | timestamp\n", table.u_timestamp); device_printf(sc->sc_dev, "%08X | flow_handler\n", table.flow_handler); - if (sc->sc_uc.uc_umac_error_event_table) + if (sc->umac_error_event_table) iwm_nic_umac_error(sc); } #endif @@ -5402,58 +5561,9 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_MFUART_LOAD_NOTIFICATION: break; - case IWM_MVM_ALIVE: { - struct iwm_mvm_alive_resp_v1 *resp1; - struct iwm_mvm_alive_resp_v2 *resp2; - struct iwm_mvm_alive_resp_v3 *resp3; + case IWM_MVM_ALIVE: + break; - if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp1)) { - resp1 = (void *)pkt->data; - sc->sc_uc.uc_error_event_table - = le32toh(resp1->error_event_table_ptr); - sc->sc_uc.uc_log_event_table - = le32toh(resp1->log_event_table_ptr); - sc->sched_base = le32toh(resp1->scd_base_ptr); - if (resp1->status == IWM_ALIVE_STATUS_OK) - sc->sc_uc.uc_ok = 1; - else - sc->sc_uc.uc_ok = 0; - } - - if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp2)) { - resp2 = (void *)pkt->data; - sc->sc_uc.uc_error_event_table - = le32toh(resp2->error_event_table_ptr); - sc->sc_uc.uc_log_event_table - = le32toh(resp2->log_event_table_ptr); - sc->sched_base = le32toh(resp2->scd_base_ptr); - sc->sc_uc.uc_umac_error_event_table - = le32toh(resp2->error_info_addr); - if (resp2->status == IWM_ALIVE_STATUS_OK) - sc->sc_uc.uc_ok = 1; - else - sc->sc_uc.uc_ok = 0; - } - - if (iwm_rx_packet_payload_len(pkt) == sizeof(*resp3)) { - resp3 = (void *)pkt->data; - sc->sc_uc.uc_error_event_table - = le32toh(resp3->error_event_table_ptr); - sc->sc_uc.uc_log_event_table - = le32toh(resp3->log_event_table_ptr); - sc->sched_base = le32toh(resp3->scd_base_ptr); - sc->sc_uc.uc_umac_error_event_table - = le32toh(resp3->error_info_addr); - if (resp3->status == IWM_ALIVE_STATUS_OK) - sc->sc_uc.uc_ok = 1; - else - sc->sc_uc.uc_ok = 0; - } - - sc->sc_uc.uc_intr = 1; - wakeup(&sc->sc_uc); - break; } - case IWM_CALIB_RES_NOTIF_PHY_DB: break; @@ -5704,8 +5814,8 @@ iwm_intr(void *arg) IWM_WRITE(sc, IWM_CSR_INT, r1 | ~sc->sc_intmask); - /* ignored */ - handled |= (r1 & (IWM_CSR_INT_BIT_ALIVE /*| IWM_CSR_INT_BIT_SCD*/)); + /* Safely ignore these bits for debug checks below */ + r1 &= ~(IWM_CSR_INT_BIT_ALIVE | IWM_CSR_INT_BIT_SCD); if (r1 & IWM_CSR_INT_BIT_SW_ERR) { int i; Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:01:33 2018 (r330182) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:13:01 2018 (r330183) @@ -2141,7 +2141,7 @@ enum { #define IWM_ALIVE_FLG_RFKILL (1 << 0) -struct iwm_mvm_alive_resp_v1 { +struct iwm_mvm_alive_resp_ver1 { uint16_t status; uint16_t flags; uint8_t ucode_minor; @@ -2163,7 +2163,7 @@ struct iwm_mvm_alive_resp_v1 { uint32_t scd_base_ptr; /* SRAM address for SCD */ } __packed; /* IWM_ALIVE_RES_API_S_VER_1 */ -struct iwm_mvm_alive_resp_v2 { +struct iwm_mvm_alive_resp_ver2 { uint16_t status; uint16_t flags; uint8_t ucode_minor; @@ -2185,14 +2185,14 @@ struct iwm_mvm_alive_resp_v2 { uint32_t scd_base_ptr; /* SRAM address for SCD */ uint32_t st_fwrd_addr; /* pointer to Store and forward */ uint32_t st_fwrd_size; - uint8_t umac_minor; /* UMAC version: minor */ - uint8_t umac_major; /* UMAC version: major */ - uint16_t umac_id; /* UMAC version: id */ - uint32_t error_info_addr; /* SRAM address for UMAC error log */ + uint8_t umac_minor; /* UMAC version: minor */ + uint8_t umac_major; /* UMAC version: major */ + uint16_t umac_id; /* UMAC version: id */ + uint32_t error_info_addr; /* SRAM address for UMAC error log */ uint32_t dbg_print_buff_addr; } __packed; /* ALIVE_RES_API_S_VER_2 */ -struct iwm_mvm_alive_resp_v3 { +struct iwm_mvm_alive_resp { uint16_t status; uint16_t flags; uint32_t ucode_minor; @@ -2212,7 +2212,7 @@ struct iwm_mvm_alive_resp_v3 { uint32_t st_fwrd_size; uint32_t umac_minor; /* UMAC version: minor */ uint32_t umac_major; /* UMAC version: major */ - uint32_t error_info_addr; /* SRAM address for UMAC error log */ + uint32_t error_info_addr; /* SRAM address for UMAC error log */ uint32_t dbg_print_buff_addr; } __packed; /* ALIVE_RES_API_S_VER_3 */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:01:33 2018 (r330182) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:13:01 2018 (r330183) @@ -299,15 +299,6 @@ struct iwm_rx_ring { int cur; }; -struct iwm_ucode_status { - uint32_t uc_error_event_table; - uint32_t uc_umac_error_event_table; - uint32_t uc_log_event_table; - - int uc_ok; - int uc_intr; -}; - #define IWM_CMD_RESP_MAX PAGE_SIZE #define IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS 500 @@ -439,7 +430,7 @@ struct iwm_softc { /* TX scheduler rings. */ struct iwm_dma_info sched_dma; - uint32_t sched_base; + uint32_t scd_base_addr; /* TX/RX rings. */ struct iwm_tx_ring txq[IWM_MVM_MAX_QUEUES]; @@ -460,8 +451,8 @@ struct iwm_softc { int sc_fw_chunk_done; - struct iwm_ucode_status sc_uc; - enum iwm_ucode_type sc_uc_current; + enum iwm_ucode_type cur_ucode; + int ucode_loaded; char sc_fwver[32]; int sc_capaflags; @@ -529,6 +520,12 @@ struct iwm_softc { struct iwm_notif_wait_data *sc_notif_wait; int cmd_hold_nic_awake; + + /* Firmware status */ + uint32_t error_event_table; + uint32_t log_event_table; + uint32_t umac_error_event_table; + int support_umac_log; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:14:10 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1E286F26933; Thu, 1 Mar 2018 06:14:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BF588865D2; Thu, 1 Mar 2018 06:14:09 +0000 (UTC) (envelope-from eadler@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 BA45E24A6C; Thu, 1 Mar 2018 06:14:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216E96B046842; Thu, 1 Mar 2018 06:14:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216E9Jt046841; Thu, 1 Mar 2018 06:14:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010614.w216E9Jt046841@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:14: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: r330184 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330184 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.25 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, 01 Mar 2018 06:14:10 -0000 Author: eadler Date: Thu Mar 1 06:14:09 2018 New Revision: 330184 URL: https://svnweb.freebsd.org/changeset/base/330184 Log: MFC r314067: [iwm] With the previous commits, this DELAY no longer seems to be needed. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:13:01 2018 (r330183) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:14:09 2018 (r330184) @@ -2602,11 +2602,6 @@ iwm_pcie_load_cpu_sections_8000(struct iwm_softc *sc, IWM_WRITE(sc, IWM_FH_UCODE_LOAD_STATUS, val); sec_num = (sec_num << 1) | 0x1; iwm_nic_unlock(sc); - - /* - * The firmware won't load correctly without this delay. - */ - DELAY(8000); } } From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:15:02 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F3E09F26ADA; Thu, 1 Mar 2018 06:15:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9E4328683A; Thu, 1 Mar 2018 06:15:01 +0000 (UTC) (envelope-from eadler@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 8015224A71; Thu, 1 Mar 2018 06:15:01 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216F1ha046928; Thu, 1 Mar 2018 06:15:01 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216F1qm046926; Thu, 1 Mar 2018 06:15:01 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010615.w216F1qm046926@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:15: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: r330185 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330185 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.25 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, 01 Mar 2018 06:15:02 -0000 Author: eadler Date: Thu Mar 1 06:15:01 2018 New Revision: 330185 URL: https://svnweb.freebsd.org/changeset/base/330185 Log: MFC r314069: [iwm] Get rid of unneeded IWM_FWDMASEGSZ and IWM_FWMAXSIZE constants * We only need IWM_FH_MEM_TB_MAX_LENGTH bytes for the fw_dma memory. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:14:09 2018 (r330184) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:15:01 2018 (r330185) @@ -1025,7 +1025,7 @@ iwm_alloc_fwmem(struct iwm_softc *sc) { /* Must be aligned on a 16-byte boundary. */ return iwm_dma_contig_alloc(sc->sc_dmat, &sc->fw_dma, - sc->sc_fwdmasegsz, 16); + IWM_FH_MEM_TB_MAX_LENGTH, 16); } /* tx scheduler rings. not used? */ @@ -5971,27 +5971,22 @@ iwm_dev_check(device_t dev) case PCI_PRODUCT_INTEL_WL_3160_1: case PCI_PRODUCT_INTEL_WL_3160_2: sc->cfg = &iwm3160_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_3165_1: case PCI_PRODUCT_INTEL_WL_3165_2: sc->cfg = &iwm3165_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7260_1: case PCI_PRODUCT_INTEL_WL_7260_2: sc->cfg = &iwm7260_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_7265_1: case PCI_PRODUCT_INTEL_WL_7265_2: sc->cfg = &iwm7265_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ; return (0); case PCI_PRODUCT_INTEL_WL_8260_1: case PCI_PRODUCT_INTEL_WL_8260_2: sc->cfg = &iwm8260_cfg; - sc->sc_fwdmasegsz = IWM_FWDMASEGSZ_8000; return (0); default: device_printf(dev, "unknown adapter type\n"); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:14:09 2018 (r330184) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:15:01 2018 (r330185) @@ -138,10 +138,6 @@ struct iwm_tx_radiotap_header { #define IWM_UCODE_SECTION_MAX 16 -#define IWM_FWDMASEGSZ (192*1024) -#define IWM_FWDMASEGSZ_8000 (320*1024) -/* sanity check value */ -#define IWM_FWMAXSIZE (2*1024*1024) /* * fw_status is used to determine if we've already parsed the firmware file @@ -475,7 +471,6 @@ struct iwm_softc { */ int sc_generation; - bus_size_t sc_fwdmasegsz; struct iwm_fw_info sc_fw; struct iwm_tlv_calib_ctrl sc_default_calib[IWM_UCODE_TYPE_MAX]; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:16:11 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DA52EF26C6E; Thu, 1 Mar 2018 06:16:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 725FA86B15; Thu, 1 Mar 2018 06:16:11 +0000 (UTC) (envelope-from eadler@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 6D59F24A75; Thu, 1 Mar 2018 06:16:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216GB7o047016; Thu, 1 Mar 2018 06:16:11 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216GBTE047015; Thu, 1 Mar 2018 06:16:11 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010616.w216GBTE047015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:16:11 +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: r330186 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330186 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.25 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, 01 Mar 2018 06:16:12 -0000 Author: eadler Date: Thu Mar 1 06:16:11 2018 New Revision: 330186 URL: https://svnweb.freebsd.org/changeset/base/330186 Log: MFC r314070: [iwm] Fix typo in commit a7697ea01c11fd493aec52260a02f31df680eb91. * The sc->sc_uc.uc_error_event_table value is now at sc->error_event_table, and not sc->umac_error_event_table. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:15:01 2018 (r330185) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:11 2018 (r330186) @@ -5384,7 +5384,7 @@ iwm_nic_error(struct iwm_softc *sc) uint32_t base; device_printf(sc->sc_dev, "dumping device error log\n"); - base = sc->umac_error_event_table; + base = sc->error_event_table; if (base < 0x800000) { device_printf(sc->sc_dev, "Invalid error log pointer 0x%08x\n", base); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:16:42 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C42F3F26DBD; Thu, 1 Mar 2018 06:16:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 297CA86D71; Thu, 1 Mar 2018 06:16:41 +0000 (UTC) (envelope-from eadler@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 2465724A7A; Thu, 1 Mar 2018 06:16:41 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216Gede047194; Thu, 1 Mar 2018 06:16:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216GeTh047193; Thu, 1 Mar 2018 06:16:40 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010616.w216GeTh047193@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:16:40 +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: r330187 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330187 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.25 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, 01 Mar 2018 06:16:42 -0000 Author: eadler Date: Thu Mar 1 06:16:40 2018 New Revision: 330187 URL: https://svnweb.freebsd.org/changeset/base/330187 Log: MFC r314074: [iwm] Simplify device id matching code a bit. * Just add the struct iwm_cfg pointers to the iwm_devices array, to get rid of the large switch clause. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:11 2018 (r330186) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:40 2018 (r330187) @@ -5929,19 +5929,30 @@ iwm_intr(void *arg) #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 static const struct iwm_devices { - uint16_t device; - const char *name; + uint16_t device; + const char *name; + const struct iwm_cfg *cfg; } iwm_devices[] = { - { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160" }, - { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160" }, - { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165" }, - { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165" }, - { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260" }, - { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260" }, - { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265" }, - { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265" }, - { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260" }, - { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260" }, + { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160", + &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160", + &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165", + &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165", + &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260", + &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260", + &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265", + &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265", + &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260", + &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260", + &iwm8260_cfg }, }; static int @@ -5964,34 +5975,20 @@ static int iwm_dev_check(device_t dev) { struct iwm_softc *sc; + uint16_t devid; + int i; sc = device_get_softc(dev); - switch (pci_get_device(dev)) { - case PCI_PRODUCT_INTEL_WL_3160_1: - case PCI_PRODUCT_INTEL_WL_3160_2: - sc->cfg = &iwm3160_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_3165_1: - case PCI_PRODUCT_INTEL_WL_3165_2: - sc->cfg = &iwm3165_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_7260_1: - case PCI_PRODUCT_INTEL_WL_7260_2: - sc->cfg = &iwm7260_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_7265_1: - case PCI_PRODUCT_INTEL_WL_7265_2: - sc->cfg = &iwm7265_cfg; - return (0); - case PCI_PRODUCT_INTEL_WL_8260_1: - case PCI_PRODUCT_INTEL_WL_8260_2: - sc->cfg = &iwm8260_cfg; - return (0); - default: - device_printf(dev, "unknown adapter type\n"); - return ENXIO; + devid = pci_get_device(dev); + for (i = 0; i < nitems(iwm_devices); i++) { + if (iwm_devices[i].device == devid) { + sc->cfg = iwm_devices[i].cfg; + return (0); + } } + device_printf(dev, "unknown adapter type\n"); + return ENXIO; } /* PCI registers */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:18:28 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 83F40F2709D; Thu, 1 Mar 2018 06:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E8018717A; Thu, 1 Mar 2018 06:18:28 +0000 (UTC) (envelope-from eadler@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 294AE24A82; Thu, 1 Mar 2018 06:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216ISJS047307; Thu, 1 Mar 2018 06:18:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216IROV047300; Thu, 1 Mar 2018 06:18:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010618.w216IROV047300@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:18:27 +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: r330188 - in stable/11/sys: conf dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm X-SVN-Commit-Revision: 330188 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.25 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, 01 Mar 2018 06:18:28 -0000 Author: eadler Date: Thu Mar 1 06:18:27 2018 New Revision: 330188 URL: https://svnweb.freebsd.org/changeset/base/330188 Log: MFC r314076: [iwm] Move struct iwm_cfg chipset configs to if_iwm_7000.c and _8000.c * This is more similar to how code/definitions are distributed in Linux's iwlwifi. * This should make recognizing new chipset variants, and adding additional flags from the Linux iwlwifi code easier, without blowing up if_iwm.c Added: stable/11/sys/dev/iwm/if_iwm_7000.c - copied unchanged from r314076, head/sys/dev/iwm/if_iwm_7000.c stable/11/sys/dev/iwm/if_iwm_8000.c - copied unchanged from r314076, head/sys/dev/iwm/if_iwm_8000.c stable/11/sys/dev/iwm/if_iwm_config.h - copied unchanged from r314076, head/sys/dev/iwm/if_iwm_config.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/conf/files Thu Mar 1 06:18:27 2018 (r330188) @@ -1869,6 +1869,8 @@ iwi_monitor.fw optional iwimonitorfw | iwifw \ no-obj no-implicit-rule \ clean "iwi_monitor.fw" dev/iwm/if_iwm.c optional iwm +dev/iwm/if_iwm_7000.c optional iwm +dev/iwm/if_iwm_8000.c optional iwm dev/iwm/if_iwm_binding.c optional iwm dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:18:27 2018 (r330188) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -166,68 +167,6 @@ __FBSDID("$FreeBSD$"); #include #include -#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 -#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 - -/* lower blocks contain EEPROM image and calibration data */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ -#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ - -#define IWM7260_FW "iwm7260fw" -#define IWM3160_FW "iwm3160fw" -#define IWM7265_FW "iwm7265fw" -#define IWM7265D_FW "iwm7265Dfw" -#define IWM8000_FW "iwm8000Cfw" - -#define IWM_DEVICE_7000_COMMON \ - .device_family = IWM_DEVICE_FAMILY_7000, \ - .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ - .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000, \ - .apmg_wake_up_wa = 1 - -const struct iwm_cfg iwm7260_cfg = { - .fw_name = IWM7260_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 1, -}; - -const struct iwm_cfg iwm3160_cfg = { - .fw_name = IWM3160_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 1, -}; - -const struct iwm_cfg iwm3165_cfg = { - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 0, -}; - -const struct iwm_cfg iwm7265_cfg = { - .fw_name = IWM7265_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 0, -}; - -const struct iwm_cfg iwm7265d_cfg = { - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, - IWM_DEVICE_7000_COMMON, - .host_interrupt_operation_mode = 0, -}; - -#define IWM_DEVICE_8000_COMMON \ - .device_family = IWM_DEVICE_FAMILY_8000, \ - .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000, \ - .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000 - -const struct iwm_cfg iwm8260_cfg = { - .fw_name = IWM8000_FW, - IWM_DEVICE_8000_COMMON, - .host_interrupt_operation_mode = 0, -}; - const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, @@ -5930,29 +5869,18 @@ iwm_intr(void *arg) static const struct iwm_devices { uint16_t device; - const char *name; const struct iwm_cfg *cfg; } iwm_devices[] = { - { PCI_PRODUCT_INTEL_WL_3160_1, "Intel Dual Band Wireless AC 3160", - &iwm3160_cfg }, - { PCI_PRODUCT_INTEL_WL_3160_2, "Intel Dual Band Wireless AC 3160", - &iwm3160_cfg }, - { PCI_PRODUCT_INTEL_WL_3165_1, "Intel Dual Band Wireless AC 3165", - &iwm3165_cfg }, - { PCI_PRODUCT_INTEL_WL_3165_2, "Intel Dual Band Wireless AC 3165", - &iwm3165_cfg }, - { PCI_PRODUCT_INTEL_WL_7260_1, "Intel Dual Band Wireless AC 7260", - &iwm7260_cfg }, - { PCI_PRODUCT_INTEL_WL_7260_2, "Intel Dual Band Wireless AC 7260", - &iwm7260_cfg }, - { PCI_PRODUCT_INTEL_WL_7265_1, "Intel Dual Band Wireless AC 7265", - &iwm7265_cfg }, - { PCI_PRODUCT_INTEL_WL_7265_2, "Intel Dual Band Wireless AC 7265", - &iwm7265_cfg }, - { PCI_PRODUCT_INTEL_WL_8260_1, "Intel Dual Band Wireless AC 8260", - &iwm8260_cfg }, - { PCI_PRODUCT_INTEL_WL_8260_2, "Intel Dual Band Wireless AC 8260", - &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_3160_1, &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3160_2, &iwm3160_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_1, &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_3165_2, &iwm3165_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_1, &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7260_2, &iwm7260_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_1, &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, }; static int @@ -5963,7 +5891,7 @@ iwm_probe(device_t dev) for (i = 0; i < nitems(iwm_devices); i++) { if (pci_get_vendor(dev) == PCI_VENDOR_INTEL && pci_get_device(dev) == iwm_devices[i].device) { - device_set_desc(dev, iwm_devices[i].name); + device_set_desc(dev, iwm_devices[i].cfg->name); return (BUS_PROBE_DEFAULT); } } Copied: stable/11/sys/dev/iwm/if_iwm_7000.c (from r314076, head/sys/dev/iwm/if_iwm_7000.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_7000.c Thu Mar 1 06:18:27 2018 (r330188, copy of r314076, head/sys/dev/iwm/if_iwm_7000.c) @@ -0,0 +1,128 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "if_iwm_config.h" + +#define IWM7260_FW "iwm7260fw" +#define IWM3160_FW "iwm3160fw" +#define IWM7265_FW "iwm7265fw" +#define IWM7265D_FW "iwm7265Dfw" + +#define IWM_NVM_HW_SECTION_NUM_FAMILY_7000 0 + +#define IWM_DEVICE_7000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_7000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_7000, \ + .apmg_wake_up_wa = 1 + +const struct iwm_cfg iwm7260_cfg = { + .name = "Intel(R) Dual Band Wireless AC 7260", + .fw_name = IWM7260_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3160_cfg = { + .name = "Intel(R) Dual Band Wireless AC 3160", + .fw_name = IWM3160_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 1, +}; + +const struct iwm_cfg iwm3165_cfg = { + .name = "Intel(R) Dual Band Wireless AC 3165", + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265_cfg = { + .name = "Intel(R) Dual Band Wireless AC 7265", + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm7265d_cfg = { + .name = "Intel(R) Dual Band Wireless AC 7265", + /* XXX IWM7265D_FW doesn't seem to work properly yet */ + .fw_name = IWM7265_FW, + IWM_DEVICE_7000_COMMON, + .host_interrupt_operation_mode = 0, +}; + Copied: stable/11/sys/dev/iwm/if_iwm_8000.c (from r314076, head/sys/dev/iwm/if_iwm_8000.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_8000.c Thu Mar 1 06:18:27 2018 (r330188, copy of r314076, head/sys/dev/iwm/if_iwm_8000.c) @@ -0,0 +1,92 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2014 - 2015 Intel Mobile Communications GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include + +#include "if_iwm_config.h" + +#define IWM8000_FW "iwm8000Cfw" + +#define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 + +#define IWM_DEVICE_8000_COMMON \ + .device_family = IWM_DEVICE_FAMILY_8000, \ + .eeprom_size = IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000, \ + .nvm_hw_section_num = IWM_NVM_HW_SECTION_NUM_FAMILY_8000 + +const struct iwm_cfg iwm8260_cfg = { + .name = "Intel(R) Dual Band Wireless AC 8260", + .fw_name = IWM8000_FW, + IWM_DEVICE_8000_COMMON, + .host_interrupt_operation_mode = 0, +}; Copied: stable/11/sys/dev/iwm/if_iwm_config.h (from r314076, head/sys/dev/iwm/if_iwm_config.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_config.h Thu Mar 1 06:18:27 2018 (r330188, copy of r314076, head/sys/dev/iwm/if_iwm_config.h) @@ -0,0 +1,135 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2007 - 2014 Intel Corporation. All rights reserved. + * Copyright (C) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * Copyright (C) 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* + * $FreeBSD$ + */ + +#ifndef __IWM_CONFIG_H__ +#define __IWM_CONFIG_H__ + +enum iwm_device_family { + IWM_DEVICE_FAMILY_UNDEFINED, + IWM_DEVICE_FAMILY_7000, + IWM_DEVICE_FAMILY_8000, +}; + +/* Antenna presence definitions */ +#define IWM_ANT_NONE 0x0 +#define IWM_ANT_A (1 << 0) +#define IWM_ANT_B (1 << 1) +#define IWM_ANT_C (1 << 2) +#define IWM_ANT_AB (IWM_ANT_A | IWM_ANT_B) +#define IWM_ANT_AC (IWM_ANT_A | IWM_ANT_C) +#define IWM_ANT_BC (IWM_ANT_B | IWM_ANT_C) +#define IWM_ANT_ABC (IWM_ANT_A | IWM_ANT_B | IWM_ANT_C) + +static inline uint8_t num_of_ant(uint8_t mask) +{ + return !!((mask) & IWM_ANT_A) + + !!((mask) & IWM_ANT_B) + + !!((mask) & IWM_ANT_C); +} + +/* lower blocks contain EEPROM image and calibration data */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_7000 (16 * 512 * sizeof(uint16_t)) /* 16 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 (32 * 512 * sizeof(uint16_t)) /* 32 KB */ +#define IWM_OTP_LOW_IMAGE_SIZE_FAMILY_9000 IWM_OTP_LOW_IMAGE_SIZE_FAMILY_8000 + +/** + * struct iwm_cfg + * @name: Official name of the device + * @fw_name: Firmware filename. + * @host_interrupt_operation_mode: device needs host interrupt operation + * mode set + * @nvm_hw_section_num: the ID of the HW NVM section + * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command + * is in flight. This is due to a HW bug in 7260, 3160 and 7265. + */ +struct iwm_cfg { + const char *name; + const char *fw_name; + uint16_t eeprom_size; + enum iwm_device_family device_family; + int host_interrupt_operation_mode; + uint8_t nvm_hw_section_num; + int apmg_wake_up_wa; +}; + +/* + * This list declares the config structures for all devices. + */ +extern const struct iwm_cfg iwm7260_cfg; +extern const struct iwm_cfg iwm3160_cfg; +extern const struct iwm_cfg iwm3165_cfg; +extern const struct iwm_cfg iwm7265_cfg; +extern const struct iwm_cfg iwm7265d_cfg; +extern const struct iwm_cfg iwm8260_cfg; + +#endif /* __IWM_CONFIG_H__ */ Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:18:27 2018 (r330188) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:16:40 2018 (r330187) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:18:27 2018 (r330188) @@ -368,29 +368,7 @@ struct iwm_node { #define IWM_ICT_COUNT (IWM_ICT_SIZE / sizeof (uint32_t)) #define IWM_ICT_PADDR_SHIFT 12 -enum iwm_device_family { - IWM_DEVICE_FAMILY_UNDEFINED, - IWM_DEVICE_FAMILY_7000, - IWM_DEVICE_FAMILY_8000, -}; - -/** - * struct iwm_cfg - * @fw_name: Firmware filename. - * @host_interrupt_operation_mode: device needs host interrupt operation - * mode set - * @nvm_hw_section_num: the ID of the HW NVM section - * @apmg_wake_up_wa: should the MAC access REQ be asserted when a command - * is in flight. This is due to a HW bug in 7260, 3160 and 7265. - */ -struct iwm_cfg { - const char *fw_name; - uint16_t eeprom_size; - enum iwm_device_family device_family; - int host_interrupt_operation_mode; - uint8_t nvm_hw_section_num; - int apmg_wake_up_wa; -}; +struct iwm_cfg; struct iwm_softc { device_t sc_dev; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:19:54 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1A700F27315; Thu, 1 Mar 2018 06:19:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id BDE1E875A8; Thu, 1 Mar 2018 06:19:53 +0000 (UTC) (envelope-from eadler@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 B8E8C24A8F; Thu, 1 Mar 2018 06:19:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216Jrfl047460; Thu, 1 Mar 2018 06:19:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216JrPO047459; Thu, 1 Mar 2018 06:19:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010619.w216JrPO047459@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:19: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: r330190 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330190 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.25 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, 01 Mar 2018 06:19:54 -0000 Author: eadler Date: Thu Mar 1 06:19:53 2018 New Revision: 330190 URL: https://svnweb.freebsd.org/changeset/base/330190 Log: MFC r314081: [iwm] Switch 7265D and 3165 devices to 7265D firmware. Modified: stable/11/sys/dev/iwm/if_iwm_7000.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_7000.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_7000.c Thu Mar 1 06:19:12 2018 (r330189) +++ stable/11/sys/dev/iwm/if_iwm_7000.c Thu Mar 1 06:19:53 2018 (r330190) @@ -105,8 +105,7 @@ const struct iwm_cfg iwm3160_cfg = { const struct iwm_cfg iwm3165_cfg = { .name = "Intel(R) Dual Band Wireless AC 3165", - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, + .fw_name = IWM7265D_FW, IWM_DEVICE_7000_COMMON, .host_interrupt_operation_mode = 0, }; @@ -120,8 +119,7 @@ const struct iwm_cfg iwm7265_cfg = { const struct iwm_cfg iwm7265d_cfg = { .name = "Intel(R) Dual Band Wireless AC 7265", - /* XXX IWM7265D_FW doesn't seem to work properly yet */ - .fw_name = IWM7265_FW, + .fw_name = IWM7265D_FW, IWM_DEVICE_7000_COMMON, .host_interrupt_operation_mode = 0, }; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:19:13 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6AFDEF27205; Thu, 1 Mar 2018 06:19:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 17D4E873A5; Thu, 1 Mar 2018 06:19:13 +0000 (UTC) (envelope-from eadler@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 12DAE24A8B; Thu, 1 Mar 2018 06:19:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216JC6L047381; Thu, 1 Mar 2018 06:19:12 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216JCWa047380; Thu, 1 Mar 2018 06:19:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010619.w216JCWa047380@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:19: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: r330189 - stable/11/sys/modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/modules/iwm X-SVN-Commit-Revision: 330189 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.25 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, 01 Mar 2018 06:19:13 -0000 Author: eadler Date: Thu Mar 1 06:19:12 2018 New Revision: 330189 URL: https://svnweb.freebsd.org/changeset/base/330189 Log: MFC 314151: Unbreak if_iwm.ko after r314076 Add if_iwm_7000.c/if_iwm_8000.c to SRCS to match similar additions made to sys/conf/files after refactoring done in the commit noted. PR: 217308 Pointyhat to: adrian Submitted by: Andreas Nilsson Reported by: Jakob Alvermark , Juan Ramómon Molina Menor Modified: stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:18:27 2018 (r330188) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:19:12 2018 (r330189) @@ -7,6 +7,7 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c +SRCS+= if_iwm_7000.c if_iwm_8000.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:20:17 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B5D70F27457; Thu, 1 Mar 2018 06:20:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 8890A87738; Thu, 1 Mar 2018 06:20:17 +0000 (UTC) (envelope-from eadler@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 8390424A95; Thu, 1 Mar 2018 06:20:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216KHLr047556; Thu, 1 Mar 2018 06:20:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216KHf1047553; Thu, 1 Mar 2018 06:20:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010620.w216KHf1047553@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:20: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: r330191 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330191 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.25 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, 01 Mar 2018 06:20:18 -0000 Author: eadler Date: Thu Mar 1 06:20:16 2018 New Revision: 330191 URL: https://svnweb.freebsd.org/changeset/base/330191 Log: MFC r314082: [iwm] Move iwm_dma_contig_alloc/_free functions to if_iwm_util.c. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:19:53 2018 (r330190) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:20:16 2018 (r330191) @@ -239,10 +239,6 @@ static int iwm_firmware_store_section(struct iwm_softc static int iwm_set_default_calib(struct iwm_softc *, const void *); static void iwm_fw_info_free(struct iwm_fw_info *); static int iwm_read_firmware(struct iwm_softc *, enum iwm_ucode_type); -static void iwm_dma_map_addr(void *, bus_dma_segment_t *, int, int); -static int iwm_dma_contig_alloc(bus_dma_tag_t, struct iwm_dma_info *, - bus_size_t, bus_size_t); -static void iwm_dma_contig_free(struct iwm_dma_info *); static int iwm_alloc_fwmem(struct iwm_softc *); static int iwm_alloc_sched(struct iwm_softc *); static int iwm_alloc_kw(struct iwm_softc *); @@ -892,71 +888,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode /* * DMA resource routines */ - -static void -iwm_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) -{ - if (error != 0) - return; - KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs)); - *(bus_addr_t *)arg = segs[0].ds_addr; -} - -static int -iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma, - bus_size_t size, bus_size_t alignment) -{ - int error; - - dma->tag = NULL; - dma->map = NULL; - dma->size = size; - dma->vaddr = NULL; - - error = bus_dma_tag_create(tag, alignment, - 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, - 1, size, 0, NULL, NULL, &dma->tag); - if (error != 0) - goto fail; - - error = bus_dmamem_alloc(dma->tag, (void **)&dma->vaddr, - BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &dma->map); - if (error != 0) - goto fail; - - error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, - iwm_dma_map_addr, &dma->paddr, BUS_DMA_NOWAIT); - if (error != 0) { - bus_dmamem_free(dma->tag, dma->vaddr, dma->map); - dma->vaddr = NULL; - goto fail; - } - - bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); - - return 0; - -fail: - iwm_dma_contig_free(dma); - - return error; -} - -static void -iwm_dma_contig_free(struct iwm_dma_info *dma) -{ - if (dma->vaddr != NULL) { - bus_dmamap_sync(dma->tag, dma->map, - BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); - bus_dmamap_unload(dma->tag, dma->map); - bus_dmamem_free(dma->tag, dma->vaddr, dma->map); - dma->vaddr = NULL; - } - if (dma->tag != NULL) { - bus_dma_tag_destroy(dma->tag); - dma->tag = NULL; - } -} /* fwmem is used to load firmware onto the card */ static int Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:19:53 2018 (r330190) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:20:16 2018 (r330191) @@ -421,3 +421,68 @@ iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cm sc->sc_wantresp = -1; wakeup(&sc->sc_wantresp); } + +static void +iwm_dma_map_addr(void *arg, bus_dma_segment_t *segs, int nsegs, int error) +{ + if (error != 0) + return; + KASSERT(nsegs == 1, ("too many DMA segments, %d should be 1", nsegs)); + *(bus_addr_t *)arg = segs[0].ds_addr; +} + +int +iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma, + bus_size_t size, bus_size_t alignment) +{ + int error; + + dma->tag = NULL; + dma->map = NULL; + dma->size = size; + dma->vaddr = NULL; + + error = bus_dma_tag_create(tag, alignment, + 0, BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL, size, + 1, size, 0, NULL, NULL, &dma->tag); + if (error != 0) + goto fail; + + error = bus_dmamem_alloc(dma->tag, (void **)&dma->vaddr, + BUS_DMA_NOWAIT | BUS_DMA_ZERO | BUS_DMA_COHERENT, &dma->map); + if (error != 0) + goto fail; + + error = bus_dmamap_load(dma->tag, dma->map, dma->vaddr, size, + iwm_dma_map_addr, &dma->paddr, BUS_DMA_NOWAIT); + if (error != 0) { + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; + goto fail; + } + + bus_dmamap_sync(dma->tag, dma->map, BUS_DMASYNC_PREWRITE); + + return 0; + +fail: + iwm_dma_contig_free(dma); + + return error; +} + +void +iwm_dma_contig_free(struct iwm_dma_info *dma) +{ + if (dma->vaddr != NULL) { + bus_dmamap_sync(dma->tag, dma->map, + BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE); + bus_dmamap_unload(dma->tag, dma->map); + bus_dmamem_free(dma->tag, dma->vaddr, dma->map); + dma->vaddr = NULL; + } + if (dma->tag != NULL) { + bus_dma_tag_destroy(dma->tag); + dma->tag = NULL; + } +} Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:19:53 2018 (r330190) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:20:16 2018 (r330191) @@ -116,6 +116,10 @@ extern int iwm_mvm_send_cmd_pdu_status(struct iwm_soft uint16_t len, const void *data, uint32_t *status); extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); +extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, struct iwm_dma_info *dma, + bus_size_t size, bus_size_t alignment); +extern void iwm_dma_contig_free(struct iwm_dma_info *); + static inline uint8_t iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) { From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:22:16 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F2E7F27904; Thu, 1 Mar 2018 06:22:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C5A5487DC0; Thu, 1 Mar 2018 06:22:15 +0000 (UTC) (envelope-from eadler@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 C06D524C0B; Thu, 1 Mar 2018 06:22:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216MFPE049272; Thu, 1 Mar 2018 06:22:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216MFEn049264; Thu, 1 Mar 2018 06:22:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010622.w216MFEn049264@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:22: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: r330192 - in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Commit-Revision: 330192 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.25 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, 01 Mar 2018 06:22:16 -0000 Author: eadler Date: Thu Mar 1 06:22:14 2018 New Revision: 330192 URL: https://svnweb.freebsd.org/changeset/base/330192 Log: MFC r314192,r314209: [iwm] Add support for Firmware paging, needed for newer 8000C firmware. * Uses the IWM_FW_PAGING_BLOCK_CMD firmware command to tell the firmware what memory ranges to use for paging. Added: stable/11/sys/dev/iwm/if_iwm_fw.c - copied unchanged from r314209, head/sys/dev/iwm/if_iwm_fw.c stable/11/sys/dev/iwm/if_iwm_fw.h - copied unchanged from r314209, head/sys/dev/iwm/if_iwm_fw.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_debug.h stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/conf/files Thu Mar 1 06:22:14 2018 (r330192) @@ -1872,6 +1872,7 @@ dev/iwm/if_iwm.c optional iwm dev/iwm/if_iwm_7000.c optional iwm dev/iwm/if_iwm_8000.c optional iwm dev/iwm/if_iwm_binding.c optional iwm +dev/iwm/if_iwm_fw.c optional iwm dev/iwm/if_iwm_led.c optional iwm dev/iwm/if_iwm_mac_ctxt.c optional iwm dev/iwm/if_iwm_notif_wait.c optional iwm Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:22:14 2018 (r330192) @@ -166,6 +166,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ @@ -2869,9 +2870,21 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, * included in the IWM_UCODE_INIT image. */ if (fw->paging_mem_size) { - /* XXX implement FW paging */ - device_printf(sc->sc_dev, - "%s: XXX FW paging not implemented yet\n", __func__); + error = iwm_save_fw_paging(sc, fw); + if (error) { + device_printf(sc->sc_dev, + "%s: failed to save the FW paging image\n", + __func__); + return error; + } + + error = iwm_send_paging_cmd(sc, fw); + if (error) { + device_printf(sc->sc_dev, + "%s: failed to send the paging cmd\n", __func__); + iwm_free_fw_paging(sc); + return error; + } } if (!error) @@ -5496,6 +5509,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_REMOVE_STA: case IWM_TXPATH_FLUSH: case IWM_LQ_CMD: + case IWM_FW_PAGING_BLOCK_CMD: case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: cresp = (void *)pkt->data; @@ -6451,6 +6465,8 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 iwm_dma_contig_free(&sc->ict_dma); iwm_dma_contig_free(&sc->kw_dma); iwm_dma_contig_free(&sc->fw_dma); + + iwm_free_fw_paging(sc); /* Finished with the hardware - detach things */ iwm_pci_detach(dev); Modified: stable/11/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:22:14 2018 (r330192) @@ -42,6 +42,7 @@ enum { IWM_DEBUG_TRANS = 0x00040000, /* Transport layer (eg PCIe) */ IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ + IWM_DEBUG_FW = 0x00200000, /* Firmware management */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Copied: stable/11/sys/dev/iwm/if_iwm_fw.c (from r314209, head/sys/dev/iwm/if_iwm_fw.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_fw.c Thu Mar 1 06:22:14 2018 (r330192, copy of r314209, head/sys/dev/iwm/if_iwm_fw.c) @@ -0,0 +1,341 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +void +iwm_free_fw_paging(struct iwm_softc *sc) +{ + int i; + + if (sc->fw_paging_db[0].fw_paging_block.vaddr == NULL) + return; + + for (i = 0; i < IWM_NUM_OF_FW_PAGING_BLOCKS; i++) { + iwm_dma_contig_free(&sc->fw_paging_db[i].fw_paging_block); + } + + memset(sc->fw_paging_db, 0, sizeof(sc->fw_paging_db)); +} + +static int +iwm_fill_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +{ + int sec_idx, idx; + uint32_t offset = 0; + + /* + * find where is the paging image start point: + * if CPU2 exist and it's in paging format, then the image looks like: + * CPU1 sections (2 or more) + * CPU1_CPU2_SEPARATOR_SECTION delimiter - separate between CPU1 to CPU2 + * CPU2 sections (not paged) + * PAGING_SEPARATOR_SECTION delimiter - separate between CPU2 + * non paged to CPU2 paging sec + * CPU2 paging CSS + * CPU2 paging image (including instruction and data) + */ + for (sec_idx = 0; sec_idx < IWM_UCODE_SECTION_MAX; sec_idx++) { + if (image->fw_sect[sec_idx].offset == IWM_PAGING_SEPARATOR_SECTION) { + sec_idx++; + break; + } + } + + /* + * If paging is enabled there should be at least 2 more sections left + * (one for CSS and one for Paging data) + */ + if (sec_idx >= nitems(image->fw_sect) - 1) { + device_printf(sc->sc_dev, + "Paging: Missing CSS and/or paging sections\n"); + iwm_free_fw_paging(sc); + return EINVAL; + } + + /* copy the CSS block to the dram */ + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: load paging CSS to FW, sec = %d\n", + sec_idx); + + memcpy(sc->fw_paging_db[0].fw_paging_block.vaddr, + image->fw_sect[sec_idx].data, + sc->fw_paging_db[0].fw_paging_size); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: copied %d CSS bytes to first block\n", + sc->fw_paging_db[0].fw_paging_size); + + sec_idx++; + + /* + * copy the paging blocks to the dram + * loop index start from 1 since that CSS block already copied to dram + * and CSS index is 0. + * loop stop at num_of_paging_blk since that last block is not full. + */ + for (idx = 1; idx < sc->num_of_paging_blk; idx++) { + memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, + (const char *)image->fw_sect[sec_idx].data + offset, + sc->fw_paging_db[idx].fw_paging_size); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: copied %d paging bytes to block %d\n", + sc->fw_paging_db[idx].fw_paging_size, + idx); + + offset += sc->fw_paging_db[idx].fw_paging_size; + } + + /* copy the last paging block */ + if (sc->num_of_pages_in_last_blk > 0) { + memcpy(sc->fw_paging_db[idx].fw_paging_block.vaddr, + (const char *)image->fw_sect[sec_idx].data + offset, + IWM_FW_PAGING_SIZE * sc->num_of_pages_in_last_blk); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: copied %d pages in the last block %d\n", + sc->num_of_pages_in_last_blk, idx); + } + + return 0; +} + +static int +iwm_alloc_fw_paging_mem(struct iwm_softc *sc, const struct iwm_fw_sects *image) +{ + int blk_idx = 0; + int error, num_of_pages; + + if (sc->fw_paging_db[0].fw_paging_block.vaddr != NULL) { + int i; + /* Device got reset, and we setup firmware paging again */ + for (i = 0; i < sc->num_of_paging_blk + 1; i++) { + bus_dmamap_sync(sc->sc_dmat, + sc->fw_paging_db[i].fw_paging_block.map, + BUS_DMASYNC_POSTWRITE | BUS_DMASYNC_POSTREAD); + } + return 0; + } + + /* ensure IWM_BLOCK_2_EXP_SIZE is power of 2 of IWM_PAGING_BLOCK_SIZE */ + _Static_assert((1 << IWM_BLOCK_2_EXP_SIZE) == IWM_PAGING_BLOCK_SIZE, + "IWM_BLOCK_2_EXP_SIZE must be power of 2 of IWM_PAGING_BLOCK_SIZE"); + + num_of_pages = image->paging_mem_size / IWM_FW_PAGING_SIZE; + sc->num_of_paging_blk = ((num_of_pages - 1) / + IWM_NUM_OF_PAGE_PER_GROUP) + 1; + + sc->num_of_pages_in_last_blk = + num_of_pages - + IWM_NUM_OF_PAGE_PER_GROUP * (sc->num_of_paging_blk - 1); + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: allocating mem for %d paging blocks, each block holds 8 pages, last block holds %d pages\n", + sc->num_of_paging_blk, + sc->num_of_pages_in_last_blk); + + /* allocate block of 4Kbytes for paging CSS */ + error = iwm_dma_contig_alloc(sc->sc_dmat, + &sc->fw_paging_db[blk_idx].fw_paging_block, IWM_FW_PAGING_SIZE, + 4096); + if (error) { + /* free all the previous pages since we failed */ + iwm_free_fw_paging(sc); + return ENOMEM; + } + + sc->fw_paging_db[blk_idx].fw_paging_size = IWM_FW_PAGING_SIZE; + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: allocated 4K(CSS) bytes for firmware paging.\n"); + + /* + * allocate blocks in dram. + * since that CSS allocated in fw_paging_db[0] loop start from index 1 + */ + for (blk_idx = 1; blk_idx < sc->num_of_paging_blk + 1; blk_idx++) { + /* allocate block of IWM_PAGING_BLOCK_SIZE (32K) */ + /* XXX Use iwm_dma_contig_alloc for allocating */ + error = iwm_dma_contig_alloc(sc->sc_dmat, + &sc->fw_paging_db[blk_idx].fw_paging_block, + IWM_PAGING_BLOCK_SIZE, 4096); + if (error) { + /* free all the previous pages since we failed */ + iwm_free_fw_paging(sc); + return ENOMEM; + } + + sc->fw_paging_db[blk_idx].fw_paging_size = IWM_PAGING_BLOCK_SIZE; + + IWM_DPRINTF(sc, IWM_DEBUG_FW, + "Paging: allocated 32K bytes for firmware paging.\n"); + } + + return 0; +} + +int +iwm_save_fw_paging(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +{ + int ret; + + ret = iwm_alloc_fw_paging_mem(sc, fw); + if (ret) + return ret; + + return iwm_fill_paging_mem(sc, fw); +} + +/* send paging cmd to FW in case CPU2 has paging image */ +int +iwm_send_paging_cmd(struct iwm_softc *sc, const struct iwm_fw_sects *fw) +{ + int blk_idx; + uint32_t dev_phy_addr; + struct iwm_fw_paging_cmd fw_paging_cmd = { + .flags = + htole32(IWM_PAGING_CMD_IS_SECURED | + IWM_PAGING_CMD_IS_ENABLED | + (sc->num_of_pages_in_last_blk << + IWM_PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS)), + .block_size = htole32(IWM_BLOCK_2_EXP_SIZE), + .block_num = htole32(sc->num_of_paging_blk), + }; + + /* loop for for all paging blocks + CSS block */ + for (blk_idx = 0; blk_idx < sc->num_of_paging_blk + 1; blk_idx++) { + dev_phy_addr = htole32( + sc->fw_paging_db[blk_idx].fw_paging_block.paddr >> + IWM_PAGE_2_EXP_SIZE); + fw_paging_cmd.device_phy_addr[blk_idx] = dev_phy_addr; + bus_dmamap_sync(sc->sc_dmat, + sc->fw_paging_db[blk_idx].fw_paging_block.map, + BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD); + } + + return iwm_mvm_send_cmd_pdu(sc, iwm_cmd_id(IWM_FW_PAGING_BLOCK_CMD, + IWM_ALWAYS_LONG_GROUP, 0), + 0, sizeof(fw_paging_cmd), &fw_paging_cmd); +} Copied: stable/11/sys/dev/iwm/if_iwm_fw.h (from r314209, head/sys/dev/iwm/if_iwm_fw.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_fw.h Thu Mar 1 06:22:14 2018 (r330192, copy of r314209, head/sys/dev/iwm/if_iwm_fw.h) @@ -0,0 +1,113 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2008 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2005 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +/* + * $FreeBSD$ + */ +#ifndef __IF_IWM_FW_H__ +#define __IF_IWM_FW_H__ + +/* + * Block paging calculations + */ +#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ +#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */ +#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3 +/* 8 pages per group */ +#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE) +/* don't change, support only 32KB size */ +#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE) +/* 32K == 2^15 */ +#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE) + +/* + * Image paging calculations + */ +#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5 +/* 2^5 == 32 blocks per image */ +#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE) +/* maximum image size 1024KB */ +#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE) + +/* Virtual address signature */ +#define IWM_PAGING_ADDR_SIG 0xAA000000 + +#define IWM_PAGING_CMD_IS_SECURED (1 << 9) +#define IWM_PAGING_CMD_IS_ENABLED (1 << 8) +#define IWM_PAGING_CMD_NUM_OF_PAGES_IN_LAST_GRP_POS 0 +#define IWM_PAGING_TLV_SECURE_MASK 1 + +extern void iwm_free_fw_paging(struct iwm_softc *); +extern int iwm_save_fw_paging(struct iwm_softc *, const struct iwm_fw_sects *); +extern int iwm_send_paging_cmd(struct iwm_softc *, const struct iwm_fw_sects *); + +#endif /* __IF_IWM_FW_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:22:14 2018 (r330192) @@ -888,28 +888,6 @@ struct iwm_fw_cipher_scheme { uint8_t hw_cipher; } __packed; -/* - * Block paging calculations - */ -#define IWM_PAGE_2_EXP_SIZE 12 /* 4K == 2^12 */ -#define IWM_FW_PAGING_SIZE (1 << IWM_PAGE_2_EXP_SIZE) /* page size is 4KB */ -#define IWM_PAGE_PER_GROUP_2_EXP_SIZE 3 -/* 8 pages per group */ -#define IWM_NUM_OF_PAGE_PER_GROUP (1 << IWM_PAGE_PER_GROUP_2_EXP_SIZE) -/* don't change, support only 32KB size */ -#define IWM_PAGING_BLOCK_SIZE (IWM_NUM_OF_PAGE_PER_GROUP * IWM_FW_PAGING_SIZE) -/* 32K == 2^15 */ -#define IWM_BLOCK_2_EXP_SIZE (IWM_PAGE_2_EXP_SIZE + IWM_PAGE_PER_GROUP_2_EXP_SIZE) - -/* - * Image paging calculations - */ -#define IWM_BLOCK_PER_IMAGE_2_EXP_SIZE 5 -/* 2^5 == 32 blocks per image */ -#define IWM_NUM_OF_BLOCK_PER_IMAGE (1 << IWM_BLOCK_PER_IMAGE_2_EXP_SIZE) -/* maximum image size 1024KB */ -#define IWM_MAX_PAGING_IMAGE_SIZE (IWM_NUM_OF_BLOCK_PER_IMAGE * IWM_PAGING_BLOCK_SIZE) - /** * struct iwm_fw_cscheme_list - a cipher scheme list * @size: a number of entries @@ -1842,12 +1820,8 @@ enum { IWM_LQ_CMD = 0x4e, - /* Calibration */ - IWM_TEMPERATURE_NOTIFICATION = 0x62, - IWM_CALIBRATION_CFG_CMD = 0x65, - IWM_CALIBRATION_RES_NOTIFICATION = 0x66, - IWM_CALIBRATION_COMPLETE_NOTIFICATION = 0x67, - IWM_RADIO_VERSION_NOTIFICATION = 0x68, + /* paging block to FW cpu2 */ + IWM_FW_PAGING_BLOCK_CMD = 0x4f, /* Scan offload */ IWM_SCAN_OFFLOAD_REQUEST_CMD = 0x51, @@ -2091,6 +2065,44 @@ struct iwm_nvm_access_cmd { uint16_t length; uint8_t data[]; } __packed; /* IWM_NVM_ACCESS_CMD_API_S_VER_2 */ + +#define IWM_NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */ + +/* + * struct iwm_fw_paging_cmd - paging layout + * + * (IWM_FW_PAGING_BLOCK_CMD = 0x4f) + * + * Send to FW the paging layout in the driver. + * + * @flags: various flags for the command + * @block_size: the block size in powers of 2 + * @block_num: number of blocks specified in the command. + * @device_phy_addr: virtual addresses from device side +*/ +struct iwm_fw_paging_cmd { + uint32_t flags; + uint32_t block_size; + uint32_t block_num; + uint32_t device_phy_addr[IWM_NUM_OF_FW_PAGING_BLOCKS]; +} __packed; /* IWM_FW_PAGING_BLOCK_CMD_API_S_VER_1 */ + +/* + * Fw items ID's + * + * @IWM_FW_ITEM_ID_PAGING: Address of the pages that the FW will upload + * download + */ +enum iwm_fw_item_id { + IWM_FW_ITEM_ID_PAGING = 3, +}; + +/* + * struct iwm_fw_get_item_cmd - get an item from the fw + */ +struct iwm_fw_get_item_cmd { + uint32_t item_id; +} __packed; /* IWM_FW_GET_ITEM_CMD_API_S_VER_1 */ /** * struct iwm_nvm_access_resp_ver2 - response to IWM_NVM_ACCESS_CMD Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:22:14 2018 (r330192) @@ -246,6 +246,16 @@ struct iwm_dma_info { bus_size_t size; }; +/** + * struct iwm_fw_paging + * @fw_paging_block: dma memory info + * @fw_paging_size: page size + */ +struct iwm_fw_paging { + struct iwm_dma_info fw_paging_block; + uint32_t fw_paging_size; +}; + #define IWM_TX_RING_COUNT 256 #define IWM_TX_RING_LOMARK 192 #define IWM_TX_RING_HIMARK 224 @@ -499,6 +509,14 @@ struct iwm_softc { uint32_t log_event_table; uint32_t umac_error_event_table; int support_umac_log; + + /* + * Paging parameters - All of the parameters should be set by the + * opmode when paging is enabled + */ + struct iwm_fw_paging fw_paging_db[IWM_NUM_OF_FW_PAGING_BLOCKS]; + uint16_t num_of_paging_blk; + uint16_t num_of_pages_in_last_blk; }; #define IWM_LOCK_INIT(_sc) \ Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:20:16 2018 (r330191) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:22:14 2018 (r330192) @@ -7,7 +7,7 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c -SRCS+= if_iwm_7000.c if_iwm_8000.c +SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c # bus layer SRCS+= if_iwm_pcie_trans.c SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:24:04 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 04C04F27CBD; Thu, 1 Mar 2018 06:24:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A4162682E9; Thu, 1 Mar 2018 06:24:03 +0000 (UTC) (envelope-from eadler@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 9EECC24C36; Thu, 1 Mar 2018 06:24:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216O38G052862; Thu, 1 Mar 2018 06:24:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216O3RP052861; Thu, 1 Mar 2018 06:24:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010624.w216O3RP052861@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:24: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: r330193 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330193 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.25 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, 01 Mar 2018 06:24:04 -0000 Author: eadler Date: Thu Mar 1 06:24:03 2018 New Revision: 330193 URL: https://svnweb.freebsd.org/changeset/base/330193 Log: MFC r315777: [iwm] Get rid of struct iwm_rx_data argument for iwm_mvm_rx_rx_mpdu. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:22:14 2018 (r330192) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:24:03 2018 (r330193) @@ -324,8 +324,7 @@ static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_data *); static int iwm_get_noise(struct iwm_softc *sc, const struct iwm_mvm_statistics_rx_non_phy *); -static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct iwm_rx_packet *, - struct iwm_rx_data *); +static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); @@ -3160,30 +3159,26 @@ iwm_get_noise(struct iwm_softc *sc, * Handles the actual data of the Rx packet from the fw */ static void -iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, - struct iwm_rx_packet *pkt, struct iwm_rx_data *data) +iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_frame *wh; struct ieee80211_node *ni; struct ieee80211_rx_stats rxs; - struct mbuf *m; struct iwm_rx_phy_info *phy_info; struct iwm_rx_mpdu_res_start *rx_res; + struct iwm_rx_packet *pkt = mtod(m, struct iwm_rx_packet *); uint32_t len; uint32_t rx_pkt_status; int rssi; - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); - phy_info = &sc->sc_last_phy_info; rx_res = (struct iwm_rx_mpdu_res_start *)pkt->data; wh = (struct ieee80211_frame *)(pkt->data + sizeof(*rx_res)); len = le16toh(rx_res->byte_count); rx_pkt_status = le32toh(*(uint32_t *)(pkt->data + sizeof(*rx_res) + len)); - m = data->m; m->m_data = pkt->data + sizeof(*rx_res); m->m_pkthdr.len = m->m_len = len; @@ -5391,7 +5386,7 @@ iwm_notif_intr(struct iwm_softc *sc) break; case IWM_REPLY_RX_MPDU_CMD: - iwm_mvm_rx_rx_mpdu(sc, pkt, data); + iwm_mvm_rx_rx_mpdu(sc, data->m); break; case IWM_TX_CMD: @@ -5434,7 +5429,8 @@ iwm_notif_intr(struct iwm_softc *sc) } } - break; } + break; + } case IWM_MFUART_LOAD_NOTIFICATION: break; @@ -5450,7 +5446,8 @@ iwm_notif_intr(struct iwm_softc *sc) stats = (void *)pkt->data; memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); - break; } + break; + } case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: @@ -5470,7 +5467,8 @@ iwm_notif_intr(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_RESET, "fw source %d sent CC '%s'\n", notif->source_id, sc->sc_fw_mcc); - break; } + break; + } case IWM_DTS_MEASUREMENT_NOTIFICATION: case IWM_WIDE_ID(IWM_PHY_OPS_GROUP, From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:25:03 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C1195F27E25; Thu, 1 Mar 2018 06:25:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 656E868585; Thu, 1 Mar 2018 06:25:03 +0000 (UTC) (envelope-from eadler@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 606AD24C3C; Thu, 1 Mar 2018 06:25:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216P3U6052946; Thu, 1 Mar 2018 06:25:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216P3vU052945; Thu, 1 Mar 2018 06:25:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010625.w216P3vU052945@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:25: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: r330194 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330194 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.25 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, 01 Mar 2018 06:25:04 -0000 Author: eadler Date: Thu Mar 1 06:25:03 2018 New Revision: 330194 URL: https://svnweb.freebsd.org/changeset/base/330194 Log: MFC r315778: [iwm] Move mbuf hacks after sanity checks in iwm_mvm_rx_rx_mpdu(). * This avoids leaving the mbuf in a weird state, when dropping a packet. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:24:03 2018 (r330193) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:25:03 2018 (r330194) @@ -3179,9 +3179,6 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * len = le16toh(rx_res->byte_count); rx_pkt_status = le32toh(*(uint32_t *)(pkt->data + sizeof(*rx_res) + len)); - m->m_data = pkt->data + sizeof(*rx_res); - m->m_pkthdr.len = m->m_len = len; - if (__predict_false(phy_info->cfg_phy_cnt > 20)) { device_printf(sc->sc_dev, "dsp size out of range [0,20]: %d\n", @@ -3217,6 +3214,9 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * __func__); goto fail; } + + m->m_data = pkt->data + sizeof(*rx_res); + m->m_pkthdr.len = m->m_len = len; IWM_DPRINTF(sc, IWM_DEBUG_RECV, "%s: rssi=%d, noise=%d\n", __func__, rssi, sc->sc_noise); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:27:11 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 35029F28158; Thu, 1 Mar 2018 06:27:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D4C6268A40; Thu, 1 Mar 2018 06:27:10 +0000 (UTC) (envelope-from eadler@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 CF74A24C44; Thu, 1 Mar 2018 06:27:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216RAuH053073; Thu, 1 Mar 2018 06:27:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216RAtN053069; Thu, 1 Mar 2018 06:27:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010627.w216RAtN053069@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:27: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: r330195 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330195 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.25 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, 01 Mar 2018 06:27:11 -0000 Author: eadler Date: Thu Mar 1 06:27:10 2018 New Revision: 330195 URL: https://svnweb.freebsd.org/changeset/base/330195 Log: MFC r315780: [iwm] Remove a couple of unneeded IWM_UCODE_TLV_FLAGS_* flags. * All the supported firmwares have these flags set. * This removes the following flags: IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT, IWM_UCODE_TLV_FLAGS_NEWBT_COEX, IWM_UCODE_TLV_FLAGS_BF_UPDATED, IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API, IWM_UCODE_TLV_FLAGS_STA_KEY_CMD, IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD, IWM_UCODE_TLV_FLAGS_SCHED_SCAN, IWM_UCODE_TLV_FLAGS_RX_ENERGY_API, IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2 * Also remove definitions and code for dealing with the v1 time-event api. * Remove unneeded calc_rssi() function. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_power.c stable/11/sys/dev/iwm/if_iwm_time_event.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:10 2018 (r330195) @@ -316,7 +316,6 @@ static int iwm_mvm_load_ucode_wait_alive(struct iwm_so enum iwm_ucode_type); static int iwm_run_init_mvm_ucode(struct iwm_softc *, int); static int iwm_rx_addbuf(struct iwm_softc *, int, int); -static int iwm_mvm_calc_rssi(struct iwm_softc *, struct iwm_rx_phy_info *); static int iwm_mvm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, @@ -345,7 +344,7 @@ static int iwm_raw_xmit(struct ieee80211_node *, struc static int iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, uint32_t flags); static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, - struct iwm_mvm_add_sta_cmd_v7 *, + struct iwm_mvm_add_sta_cmd *, int *); static int iwm_mvm_sta_send_to_fw(struct iwm_softc *, struct iwm_node *, int); @@ -867,12 +866,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode "section type %d\n", error, tlv_type); } - if (!(sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT)) { - device_printf(sc->sc_dev, - "device uses unsupported power ops\n"); - error = ENOTSUP; - } - out: if (error) { fw->fw_status = IWM_FW_STATUS_NONE; @@ -3043,38 +3036,6 @@ fail: } /* iwlwifi: mvm/rx.c */ -#define IWM_RSSI_OFFSET 50 -static int -iwm_mvm_calc_rssi(struct iwm_softc *sc, struct iwm_rx_phy_info *phy_info) -{ - int rssi_a, rssi_b, rssi_a_dbm, rssi_b_dbm, max_rssi_dbm; - uint32_t agc_a, agc_b; - uint32_t val; - - val = le32toh(phy_info->non_cfg_phy[IWM_RX_INFO_AGC_IDX]); - agc_a = (val & IWM_OFDM_AGC_A_MSK) >> IWM_OFDM_AGC_A_POS; - agc_b = (val & IWM_OFDM_AGC_B_MSK) >> IWM_OFDM_AGC_B_POS; - - val = le32toh(phy_info->non_cfg_phy[IWM_RX_INFO_RSSI_AB_IDX]); - rssi_a = (val & IWM_OFDM_RSSI_INBAND_A_MSK) >> IWM_OFDM_RSSI_A_POS; - rssi_b = (val & IWM_OFDM_RSSI_INBAND_B_MSK) >> IWM_OFDM_RSSI_B_POS; - - /* - * dBm = rssi dB - agc dB - constant. - * Higher AGC (higher radio gain) means lower signal. - */ - rssi_a_dbm = rssi_a - IWM_RSSI_OFFSET - agc_a; - rssi_b_dbm = rssi_b - IWM_RSSI_OFFSET - agc_b; - max_rssi_dbm = MAX(rssi_a_dbm, rssi_b_dbm); - - IWM_DPRINTF(sc, IWM_DEBUG_RECV, - "Rssi In A %d B %d Max %d AGCA %d AGCB %d\n", - rssi_a_dbm, rssi_b_dbm, max_rssi_dbm, agc_a, agc_b); - - return max_rssi_dbm; -} - -/* iwlwifi: mvm/rx.c */ /* * iwm_mvm_get_signal_strength - use new rx PHY INFO API * values are reported by the fw as positive values - need to negate @@ -3193,18 +3154,8 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * goto fail; } - if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_RX_ENERGY_API) { - rssi = iwm_mvm_get_signal_strength(sc, phy_info); - } else { - rssi = iwm_mvm_calc_rssi(sc, phy_info); - } + rssi = iwm_mvm_get_signal_strength(sc, phy_info); - /* Note: RSSI is absolute (ie a -ve value) */ - if (rssi < IWM_MIN_DBM) - rssi = IWM_MIN_DBM; - else if (rssi > IWM_MAX_DBM) - rssi = IWM_MAX_DBM; - /* Map it to relative value */ rssi = rssi - sc->sc_noise; @@ -3867,7 +3818,7 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, - struct iwm_mvm_add_sta_cmd_v7 *cmd, int *status) + struct iwm_mvm_add_sta_cmd *cmd, int *status) { return iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(*cmd), cmd, status); @@ -3877,7 +3828,7 @@ iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, static int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update) { - struct iwm_mvm_add_sta_cmd_v7 add_sta_cmd; + struct iwm_mvm_add_sta_cmd add_sta_cmd; int ret; uint32_t status; @@ -3935,7 +3886,7 @@ static int iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, const uint8_t *addr, uint16_t mac_id, uint16_t color) { - struct iwm_mvm_add_sta_cmd_v7 cmd; + struct iwm_mvm_add_sta_cmd cmd; int ret; uint32_t status; Modified: stable/11/sys/dev/iwm/if_iwm_power.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:27:10 2018 (r330195) @@ -290,9 +290,6 @@ iwm_mvm_power_update_device(struct iwm_softc *sc) .flags = htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK), }; - if (!(sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD)) - return 0; - cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_CAM_MSK); IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, "Sending device power command with flags = 0x%X\n", cmd.flags); @@ -322,12 +319,8 @@ iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, str int iwm_mvm_disable_beacon_filter(struct iwm_softc *sc) { - struct iwm_beacon_filter_cmd cmd; + struct iwm_beacon_filter_cmd cmd = {}; int ret; - - memset(&cmd, 0, sizeof(cmd)); - if ((sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_BF_UPDATED) == 0) - return 0; ret = iwm_mvm_beacon_filter_send_cmd(sc, &cmd); if (ret == 0) Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:27:10 2018 (r330195) @@ -164,77 +164,17 @@ __FBSDID("$FreeBSD$"); #define IWM_MVM_ROC_TE_TYPE_NORMAL IWM_TE_P2P_DEVICE_DISCOVERABLE #define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC -/* used to convert from time event API v2 to v1 */ -#define IWM_TE_V2_DEP_POLICY_MSK (IWM_TE_V2_DEP_OTHER | IWM_TE_V2_DEP_TSF |\ - IWM_TE_V2_EVENT_SOCIOPATHIC) -static inline uint16_t -iwm_te_v2_get_notify(uint16_t policy) -{ - return le16toh(policy) & IWM_TE_V2_NOTIF_MSK; -} - -static inline uint16_t -iwm_te_v2_get_dep_policy(uint16_t policy) -{ - return (le16toh(policy) & IWM_TE_V2_DEP_POLICY_MSK) >> - IWM_TE_V2_PLACEMENT_POS; -} - -static inline uint16_t -iwm_te_v2_get_absence(uint16_t policy) -{ - return (le16toh(policy) & IWM_TE_V2_ABSENCE) >> IWM_TE_V2_ABSENCE_POS; -} - -static void -iwm_mvm_te_v2_to_v1(const struct iwm_time_event_cmd_v2 *cmd_v2, - struct iwm_time_event_cmd_v1 *cmd_v1) -{ - cmd_v1->id_and_color = cmd_v2->id_and_color; - cmd_v1->action = cmd_v2->action; - cmd_v1->id = cmd_v2->id; - cmd_v1->apply_time = cmd_v2->apply_time; - cmd_v1->max_delay = cmd_v2->max_delay; - cmd_v1->depends_on = cmd_v2->depends_on; - cmd_v1->interval = cmd_v2->interval; - cmd_v1->duration = cmd_v2->duration; - if (cmd_v2->repeat == IWM_TE_V2_REPEAT_ENDLESS) - cmd_v1->repeat = htole32(IWM_TE_V1_REPEAT_ENDLESS); - else - cmd_v1->repeat = htole32(cmd_v2->repeat); - cmd_v1->max_frags = htole32(cmd_v2->max_frags); - cmd_v1->interval_reciprocal = 0; /* unused */ - - cmd_v1->dep_policy = htole32(iwm_te_v2_get_dep_policy(cmd_v2->policy)); - cmd_v1->is_present = htole32(!iwm_te_v2_get_absence(cmd_v2->policy)); - cmd_v1->notify = htole32(iwm_te_v2_get_notify(cmd_v2->policy)); -} - static int -iwm_mvm_send_time_event_cmd(struct iwm_softc *sc, - const struct iwm_time_event_cmd_v2 *cmd) -{ - struct iwm_time_event_cmd_v1 cmd_v1; - - if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2) - return iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, - IWM_CMD_SYNC, sizeof(*cmd), cmd); - - iwm_mvm_te_v2_to_v1(cmd, &cmd_v1); - return iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, IWM_CMD_SYNC, - sizeof(cmd_v1), &cmd_v1); -} - -static int iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_node *in, - void *te_data, struct iwm_time_event_cmd_v2 *te_cmd) + void *te_data, struct iwm_time_event_cmd *te_cmd) { int ret; IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "Add new TE, duration %d TU\n", le32toh(te_cmd->duration)); - ret = iwm_mvm_send_time_event_cmd(sc, te_cmd); + ret = iwm_mvm_send_cmd_pdu(sc, IWM_TIME_EVENT_CMD, IWM_CMD_SYNC, + sizeof(*te_cmd), te_cmd); if (ret) { IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, "%s: Couldn't send IWM_TIME_EVENT_CMD: %d\n", @@ -248,9 +188,7 @@ void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, uint32_t duration, uint32_t max_delay) { - struct iwm_time_event_cmd_v2 time_cmd; - - memset(&time_cmd, 0, sizeof(time_cmd)); + struct iwm_time_event_cmd time_cmd = {}; time_cmd.action = htole32(IWM_FW_CTXT_ACTION_ADD); time_cmd.id_and_color = Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:25:03 2018 (r330194) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:27:10 2018 (r330195) @@ -611,21 +611,12 @@ enum iwm_dtd_diode_reg { * @IWM_UCODE_TLV_FLAGS_UAPSD: This uCode image supports uAPSD * @IWM_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan * offload profile config command. - * @IWM_UCODE_TLV_FLAGS_RX_ENERGY_API: supports rx signal strength api - * @IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2: using the new time event API. * @IWM_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS: D3 image supports up to six * (rather than two) IPv6 addresses - * @IWM_UCODE_TLV_FLAGS_BF_UPDATED: new beacon filtering API * @IWM_UCODE_TLV_FLAGS_NO_BASIC_SSID: not sending a probe with the SSID element * from the probe request template. - * @IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API: modified D3 API to allow keeping - * connection when going back to D0 * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version) * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version) - * @IWM_UCODE_TLV_FLAGS_SCHED_SCAN: this uCode image supports scheduled scan. - * @IWM_UCODE_TLV_FLAGS_STA_KEY_CMD: new ADD_STA and ADD_STA_KEY command API - * @IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD: support device wide power command - * containing CAM (Continuous Active Mode) indication. * @IWM_UCODE_TLV_FLAGS_P2P_PS: P2P client power save is supported (only on a * single bound interface). * @IWM_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD @@ -641,20 +632,11 @@ enum iwm_ucode_tlv_flag { IWM_UCODE_TLV_FLAGS_MFP = (1 << 2), IWM_UCODE_TLV_FLAGS_P2P = (1 << 3), IWM_UCODE_TLV_FLAGS_DW_BC_TABLE = (1 << 4), - IWM_UCODE_TLV_FLAGS_NEWBT_COEX = (1 << 5), - IWM_UCODE_TLV_FLAGS_PM_CMD_SUPPORT = (1 << 6), IWM_UCODE_TLV_FLAGS_SHORT_BL = (1 << 7), - IWM_UCODE_TLV_FLAGS_RX_ENERGY_API = (1 << 8), - IWM_UCODE_TLV_FLAGS_TIME_EVENT_API_V2 = (1 << 9), IWM_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = (1 << 10), - IWM_UCODE_TLV_FLAGS_BF_UPDATED = (1 << 11), IWM_UCODE_TLV_FLAGS_NO_BASIC_SSID = (1 << 12), - IWM_UCODE_TLV_FLAGS_D3_CONTINUITY_API = (1 << 14), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = (1 << 15), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = (1 << 16), - IWM_UCODE_TLV_FLAGS_SCHED_SCAN = (1 << 17), - IWM_UCODE_TLV_FLAGS_STA_KEY_CMD = (1 << 19), - IWM_UCODE_TLV_FLAGS_DEVICE_PS_CMD = (1 << 20), IWM_UCODE_TLV_FLAGS_P2P_PS = (1 << 21), IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM = (1 << 22), IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM = (1 << 23), @@ -2390,53 +2372,8 @@ enum { IWM_T2_V2_START_IMMEDIATELY = (1 << 11), }; /* IWM_MAC_EVENT_ACTION_API_E_VER_2 */ +/* Time event - defines for command API */ -/** - * struct iwm_time_event_cmd_api_v1 - configuring Time Events - * with struct IWM_MAC_TIME_EVENT_DATA_API_S_VER_1 (see also - * with version 2. determined by IWM_UCODE_TLV_FLAGS) - * ( IWM_TIME_EVENT_CMD = 0x29 ) - * @id_and_color: ID and color of the relevant MAC - * @action: action to perform, one of IWM_FW_CTXT_ACTION_* - * @id: this field has two meanings, depending on the action: - * If the action is ADD, then it means the type of event to add. - * For all other actions it is the unique event ID assigned when the - * event was added by the FW. - * @apply_time: When to start the Time Event (in GP2) - * @max_delay: maximum delay to event's start (apply time), in TU - * @depends_on: the unique ID of the event we depend on (if any) - * @interval: interval between repetitions, in TU - * @interval_reciprocal: 2^32 / interval - * @duration: duration of event in TU - * @repeat: how many repetitions to do, can be IWM_TE_REPEAT_ENDLESS - * @dep_policy: one of IWM_TE_V1_INDEPENDENT, IWM_TE_V1_DEP_OTHER, IWM_TE_V1_DEP_TSF - * and IWM_TE_V1_EVENT_SOCIOPATHIC - * @is_present: 0 or 1, are we present or absent during the Time Event - * @max_frags: maximal number of fragments the Time Event can be divided to - * @notify: notifications using IWM_TE_V1_NOTIF_* (whom to notify when) - */ -struct iwm_time_event_cmd_v1 { - /* COMMON_INDEX_HDR_API_S_VER_1 */ - uint32_t id_and_color; - uint32_t action; - uint32_t id; - /* IWM_MAC_TIME_EVENT_DATA_API_S_VER_1 */ - uint32_t apply_time; - uint32_t max_delay; - uint32_t dep_policy; - uint32_t depends_on; - uint32_t is_present; - uint32_t max_frags; - uint32_t interval; - uint32_t interval_reciprocal; - uint32_t duration; - uint32_t repeat; - uint32_t notify; -} __packed; /* IWM_MAC_TIME_EVENT_CMD_API_S_VER_1 */ - - -/* Time event - defines for command API v2 */ - /* * @IWM_TE_V2_FRAG_NONE: fragmentation of the time event is NOT allowed. * @IWM_TE_V2_FRAG_SINGLE: fragmentation of the time event is allowed, but only @@ -2466,7 +2403,7 @@ enum { #define IWM_TE_V2_PLACEMENT_POS 12 #define IWM_TE_V2_ABSENCE_POS 15 -/* Time event policy values (for time event cmd api v2) +/* Time event policy values * A notification (both event and fragment) includes a status indicating weather * the FW was able to schedule the event or not. For fragment start/end * notification the status is always success. There is no start/end fragment @@ -2512,7 +2449,7 @@ enum { }; /** - * struct iwm_time_event_cmd_api_v2 - configuring Time Events + * struct iwm_time_event_cmd_api - configuring Time Events * with struct IWM_MAC_TIME_EVENT_DATA_API_S_VER_2 (see also * with version 1. determined by IWM_UCODE_TLV_FLAGS) * ( IWM_TIME_EVENT_CMD = 0x29 ) @@ -2535,7 +2472,7 @@ enum { * IWM_TE_EVENT_SOCIOPATHIC * using IWM_TE_ABSENCE and using IWM_TE_NOTIF_* */ -struct iwm_time_event_cmd_v2 { +struct iwm_time_event_cmd { /* COMMON_INDEX_HDR_API_S_VER_1 */ uint32_t id_and_color; uint32_t action; @@ -5690,7 +5627,7 @@ struct iwm_mvm_keyinfo { #define IWM_ADD_STA_BAID_SHIFT 8 /** - * struct iwm_mvm_add_sta_cmd_v7 - Add/modify a station in the fw's sta table. + * struct iwm_mvm_add_sta_cmd - Add/modify a station in the fw's sta table. * ( REPLY_ADD_STA = 0x18 ) * @add_modify: 1: modify existing, 0: add new station * @awake_acs: @@ -5726,7 +5663,7 @@ struct iwm_mvm_keyinfo { * ADD_STA sets up the table entry for one station, either creating a new * entry, or modifying a pre-existing one. */ -struct iwm_mvm_add_sta_cmd_v7 { +struct iwm_mvm_add_sta_cmd { uint8_t add_modify; uint8_t awake_acs; uint16_t tid_disable_tx; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:27:41 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A8F6EF28240; Thu, 1 Mar 2018 06:27:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BD8568BE8; Thu, 1 Mar 2018 06:27:40 +0000 (UTC) (envelope-from eadler@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 36BD724C48; Thu, 1 Mar 2018 06:27:40 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216Reu9053136; Thu, 1 Mar 2018 06:27:40 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216RdmF053133; Thu, 1 Mar 2018 06:27:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010627.w216RdmF053133@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:27:39 +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: r330196 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330196 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.25 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, 01 Mar 2018 06:27:41 -0000 Author: eadler Date: Thu Mar 1 06:27:39 2018 New Revision: 330196 URL: https://svnweb.freebsd.org/changeset/base/330196 Log: MFC r315784: [iwm] Make ucode capabilities and api flags handling more like iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_scan.c stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:10 2018 (r330195) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:39 2018 (r330196) @@ -484,6 +484,56 @@ iwm_set_default_calib(struct iwm_softc *sc, const void return 0; } +static int +iwm_set_ucode_api_flags(struct iwm_softc *sc, const uint8_t *data, + struct iwm_ucode_capabilities *capa) +{ + const struct iwm_ucode_api *ucode_api = (const void *)data; + uint32_t api_index = le32toh(ucode_api->api_index); + uint32_t api_flags = le32toh(ucode_api->api_flags); + int i; + + if (api_index >= howmany(IWM_NUM_UCODE_TLV_API, 32)) { + device_printf(sc->sc_dev, + "api flags index %d larger than supported by driver\n", + api_index); + /* don't return an error so we can load FW that has more bits */ + return 0; + } + + for (i = 0; i < 32; i++) { + if (api_flags & (1U << i)) + setbit(capa->enabled_api, i + 32 * api_index); + } + + return 0; +} + +static int +iwm_set_ucode_capabilities(struct iwm_softc *sc, const uint8_t *data, + struct iwm_ucode_capabilities *capa) +{ + const struct iwm_ucode_capa *ucode_capa = (const void *)data; + uint32_t api_index = le32toh(ucode_capa->api_index); + uint32_t api_flags = le32toh(ucode_capa->api_capa); + int i; + + if (api_index >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { + device_printf(sc->sc_dev, + "capa flags index %d larger than supported by driver\n", + api_index); + /* don't return an error so we can load FW that has more bits */ + return 0; + } + + for (i = 0; i < 32; i++) { + if (api_flags & (1U << i)) + setbit(capa->enabled_capa, i + 32 * api_index); + } + + return 0; +} + static void iwm_fw_info_free(struct iwm_fw_info *fw) { @@ -499,6 +549,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; struct iwm_ucode_tlv tlv; + struct iwm_ucode_capabilities *capa = &sc->ucode_capa; enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; @@ -535,9 +586,11 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode fw->fw_fp = fwp; /* (Re-)Initialize default values. */ - sc->sc_capaflags = 0; - sc->sc_capa_n_scan_channels = IWM_DEFAULT_SCAN_CHANNELS; - memset(sc->sc_enabled_capa, 0, sizeof(sc->sc_enabled_capa)); + capa->flags = 0; + capa->max_probe_length = IWM_DEFAULT_MAX_PROBE_LENGTH; + capa->n_scan_channels = IWM_DEFAULT_SCAN_CHANNELS; + memset(capa->enabled_capa, 0, sizeof(capa->enabled_capa)); + memset(capa->enabled_api, 0, sizeof(capa->enabled_api)); memset(sc->sc_fw_mcc, 0, sizeof(sc->sc_fw_mcc)); /* @@ -590,10 +643,10 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - sc->sc_capa_max_probe_len - = le32toh(*(const uint32_t *)tlv_data); + capa->max_probe_length = + le32toh(*(const uint32_t *)tlv_data); /* limit it to something sensible */ - if (sc->sc_capa_max_probe_len > + if (capa->max_probe_length > IWM_SCAN_OFFLOAD_PROBE_REQ_SIZE) { IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, "%s: IWM_UCODE_TLV_PROBE_MAX_LEN " @@ -611,7 +664,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - sc->sc_capaflags |= IWM_UCODE_TLV_FLAGS_PAN; + capa->flags |= IWM_UCODE_TLV_FLAGS_PAN; break; case IWM_UCODE_TLV_FLAGS: if (tlv_len < sizeof(uint32_t)) { @@ -633,7 +686,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode * 2) TLV_FLAGS contains TLV_FLAGS_PAN * ==> this resets TLV_PAN to itself... hnnnk */ - sc->sc_capaflags = le32toh(*(const uint32_t *)tlv_data); + capa->flags = le32toh(*(const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_CSCHEME: if ((error = iwm_store_cscheme(sc, @@ -738,42 +791,26 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode break; case IWM_UCODE_TLV_API_CHANGES_SET: { - const struct iwm_ucode_api *api; - if (tlv_len != sizeof(*api)) { + if (tlv_len != sizeof(struct iwm_ucode_api)) { error = EINVAL; goto parse_out; } - api = (const struct iwm_ucode_api *)tlv_data; - /* Flags may exceed 32 bits in future firmware. */ - if (le32toh(api->api_index) > 0) { - device_printf(sc->sc_dev, - "unsupported API index %d\n", - le32toh(api->api_index)); + if (iwm_set_ucode_api_flags(sc, tlv_data, capa)) { + error = EINVAL; goto parse_out; } - sc->sc_ucode_api = le32toh(api->api_flags); break; } case IWM_UCODE_TLV_ENABLED_CAPABILITIES: { - const struct iwm_ucode_capa *capa; - int idx, i; - if (tlv_len != sizeof(*capa)) { + if (tlv_len != sizeof(struct iwm_ucode_capa)) { error = EINVAL; goto parse_out; } - capa = (const struct iwm_ucode_capa *)tlv_data; - idx = le32toh(capa->api_index); - if (idx >= howmany(IWM_NUM_UCODE_TLV_CAPA, 32)) { - device_printf(sc->sc_dev, - "unsupported API index %d\n", idx); + if (iwm_set_ucode_capabilities(sc, tlv_data, capa)) { + error = EINVAL; goto parse_out; } - for (i = 0; i < 32; i++) { - if ((le32toh(capa->api_capa) & (1U << i)) == 0) - continue; - setbit(sc->sc_enabled_capa, i + (32 * idx)); - } break; } @@ -827,8 +864,8 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - sc->sc_capa_n_scan_channels = - le32toh(*(const uint32_t *)tlv_data); + capa->n_scan_channels = + le32toh(*(const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_FW_VERSION: @@ -4698,13 +4735,13 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int n_channels; uint16_t mcc; #endif - int resp_v2 = isset(sc->sc_enabled_capa, + int resp_v2 = fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); memset(&mcc_cmd, 0, sizeof(mcc_cmd)); mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]); - if ((sc->sc_ucode_api & IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC)) + if (fw_has_api(&sc->ucode_capa, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || + fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC)) mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT; else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; @@ -4842,12 +4879,12 @@ iwm_init_hw(struct iwm_softc *sc) if (error) goto error; - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT)) { + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT)) { if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) goto error; } - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) goto error; } @@ -6246,7 +6283,7 @@ iwm_scan_start(struct ieee80211com *ic) device_printf(sc->sc_dev, "%s: Previous scan not completed yet\n", __func__); } - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) error = iwm_mvm_umac_scan(sc); else error = iwm_mvm_lmac_scan(sc); Modified: stable/11/sys/dev/iwm/if_iwm_scan.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 06:27:10 2018 (r330195) +++ stable/11/sys/dev/iwm/if_iwm_scan.c Thu Mar 1 06:27:39 2018 (r330196) @@ -272,7 +272,7 @@ iwm_mvm_lmac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->sc_capa_n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -316,7 +316,7 @@ iwm_mvm_umac_scan_fill_channels(struct iwm_softc *sc, int j; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->sc_capa_n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -398,7 +398,7 @@ iwm_mvm_fill_probe_req(struct iwm_softc *sc, struct iw preq->band_data[0].len = htole16(frm - pos); remain -= frm - pos; - if (isset(sc->sc_enabled_capa, + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) { if (remain < 3) return ENOBUFS; @@ -464,7 +464,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_SCAN_CONFIG_RATE_36M | IWM_SCAN_CONFIG_RATE_48M | IWM_SCAN_CONFIG_RATE_54M); - cmd_size = sizeof(*scan_config) + sc->sc_capa_n_scan_channels; + cmd_size = sizeof(*scan_config) + sc->ucode_capa.n_scan_channels; scan_config = malloc(cmd_size, M_DEVBUF, M_NOWAIT | M_ZERO); if (scan_config == NULL) @@ -492,7 +492,7 @@ iwm_mvm_config_umac_scan(struct iwm_softc *sc) IWM_CHANNEL_FLAG_PRE_SCAN_PASSIVE2ACTIVE; for (nchan = j = 0; - j < ic->ic_nchans && nchan < sc->sc_capa_n_scan_channels; j++) { + j < ic->ic_nchans && nchan < sc->ucode_capa.n_scan_channels; j++) { c = &ic->ic_channels[j]; /* For 2GHz, only populate 11b channels */ /* For 5GHz, only populate 11a channels */ @@ -550,7 +550,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_umac) + (sizeof(struct iwm_scan_channel_cfg_umac) * - sc->sc_capa_n_scan_channels) + + sc->ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_req_umac_tail); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; @@ -584,7 +584,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) tail = (void *)((char *)&req->data + sizeof(struct iwm_scan_channel_cfg_umac) * - sc->sc_capa_n_scan_channels); + sc->ucode_capa.n_scan_channels); /* Check if we're doing an active directed scan. */ for (i = 0; i < nssid; i++) { @@ -601,7 +601,7 @@ iwm_mvm_umac_scan(struct iwm_softc *sc) } else req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_PASSIVE); - if (isset(sc->sc_enabled_capa, + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) req->general_flags |= htole32(IWM_UMAC_SCAN_GEN_FLAGS_RRM_ENABLED); @@ -644,7 +644,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req_len = sizeof(struct iwm_scan_req_lmac) + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->sc_capa_n_scan_channels) + sizeof(struct iwm_scan_probe_req); + sc->ucode_capa.n_scan_channels) + sizeof(struct iwm_scan_probe_req); if (req_len > IWM_MAX_CMD_PAYLOAD_SIZE) return ENOMEM; req = malloc(req_len, M_DEVBUF, M_NOWAIT | M_ZERO); @@ -670,7 +670,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) req->scan_flags = htole32(IWM_MVM_LMAC_SCAN_FLAG_PASS_ALL | IWM_MVM_LMAC_SCAN_FLAG_ITER_COMPLETE | IWM_MVM_LMAC_SCAN_FLAG_EXTENDED_DWELL); - if (isset(sc->sc_enabled_capa, + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_DS_PARAM_SET_IE_SUPPORT)) req->scan_flags |= htole32(IWM_MVM_LMAC_SCAN_FLAGS_RRM_ENABLED); @@ -716,7 +716,7 @@ iwm_mvm_lmac_scan(struct iwm_softc *sc) ret = iwm_mvm_fill_probe_req(sc, (struct iwm_scan_probe_req *)(req->data + (sizeof(struct iwm_scan_channel_cfg_lmac) * - sc->sc_capa_n_scan_channels))); + sc->ucode_capa.n_scan_channels))); if (ret) { free(req, M_DEVBUF); return ret; @@ -804,7 +804,7 @@ iwm_mvm_scan_stop_wait(struct iwm_softc *sc) IWM_DPRINTF(sc, IWM_DEBUG_SCAN, "Preparing to stop scan\n"); - if (isset(sc->sc_enabled_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) + if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) ret = iwm_mvm_umac_scan_abort(sc); else ret = iwm_mvm_lmac_scan_abort(sc); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:27:10 2018 (r330195) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:27:39 2018 (r330196) @@ -166,6 +166,28 @@ enum iwm_ucode_type { IWM_UCODE_TYPE_MAX }; +struct iwm_ucode_capabilities { + uint32_t max_probe_length; + uint32_t n_scan_channels; + uint32_t flags; + uint8_t enabled_api[howmany(IWM_NUM_UCODE_TLV_API, NBBY)]; + uint8_t enabled_capa[howmany(IWM_NUM_UCODE_TLV_CAPA, NBBY)]; +}; + +static inline int +fw_has_api(const struct iwm_ucode_capabilities *capabilities, + unsigned int api) +{ + return isset(capabilities->enabled_api, api); +} + +static inline int +fw_has_capa(const struct iwm_ucode_capabilities *capabilities, + unsigned int capa) +{ + return isset(capabilities->enabled_capa, capa); +} + /* one for each uCode image (inst/data, init/runtime/wowlan) */ struct iwm_fw_desc { const void *data; /* vmalloc'ed data */ @@ -439,12 +461,8 @@ struct iwm_softc { int ucode_loaded; char sc_fwver[32]; - int sc_capaflags; - int sc_capa_max_probe_len; - int sc_capa_n_scan_channels; - uint32_t sc_ucode_api; - uint8_t sc_enabled_capa[howmany(IWM_NUM_UCODE_TLV_CAPA, NBBY)]; - char sc_fw_mcc[3]; + struct iwm_ucode_capabilities ucode_capa; + char sc_fw_mcc[3]; int sc_intmask; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:29:02 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2F83F28458; Thu, 1 Mar 2018 06:29:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7660C68F6C; Thu, 1 Mar 2018 06:29:02 +0000 (UTC) (envelope-from eadler@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 713A524C4C; Thu, 1 Mar 2018 06:29:02 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216T27j053224; Thu, 1 Mar 2018 06:29:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216T2FX053223; Thu, 1 Mar 2018 06:29:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010629.w216T2FX053223@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:29:02 +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: r330197 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330197 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.25 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, 01 Mar 2018 06:29:03 -0000 Author: eadler Date: Thu Mar 1 06:29:02 2018 New Revision: 330197 URL: https://svnweb.freebsd.org/changeset/base/330197 Log: MFC r315923: [iwm] Tiny cleanup in iwm_rx_addbuf(). Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:27:39 2018 (r330196) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:29:02 2018 (r330197) @@ -3032,7 +3032,7 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) struct iwm_rx_ring *ring = &sc->rxq; struct iwm_rx_data *data = &ring->data[idx]; struct mbuf *m; - bus_dmamap_t dmamap = NULL; + bus_dmamap_t dmamap; bus_dma_segment_t seg; int nsegs, error; @@ -3046,7 +3046,8 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) if (error != 0) { device_printf(sc->sc_dev, "%s: can't map mbuf, error %d\n", __func__, error); - goto fail; + m_freem(m); + return error; } if (data->m != NULL) @@ -3067,9 +3068,6 @@ iwm_rx_addbuf(struct iwm_softc *sc, int size, int idx) BUS_DMASYNC_PREWRITE); return 0; -fail: - m_freem(m); - return error; } /* iwlwifi: mvm/rx.c */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:31:08 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25E40F288FC; Thu, 1 Mar 2018 06:31:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C6090694A1; Thu, 1 Mar 2018 06:31:07 +0000 (UTC) (envelope-from eadler@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 C103F24D74; Thu, 1 Mar 2018 06:31:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216V76D053377; Thu, 1 Mar 2018 06:31:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216V75i053374; Thu, 1 Mar 2018 06:31:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010631.w216V75i053374@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:31:07 +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: r330198 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330198 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.25 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, 01 Mar 2018 06:31:08 -0000 Author: eadler Date: Thu Mar 1 06:31:07 2018 New Revision: 330198 URL: https://svnweb.freebsd.org/changeset/base/330198 Log: MFC r315926: [iwm] Add the BSS's basic rates to iwm's LQ command, not all the rates. Makes the firmware use appropriate Tx rates for ACKs. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:29:02 2018 (r330197) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:31:07 2018 (r330198) @@ -4276,6 +4276,21 @@ iwm_node_alloc(struct ieee80211vap *vap, const uint8_t M_NOWAIT | M_ZERO); } +uint8_t +iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx) +{ + int i; + uint8_t rval; + + for (i = 0; i < rs->rs_nrates; i++) { + rval = (rs->rs_rates[i] & IEEE80211_RATE_VAL); + if (rval == iwm_rates[ridx].rate) + return rs->rs_rates[i]; + } + + return 0; +} + static void iwm_setrates(struct iwm_softc *sc, struct iwm_node *in) { Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:29:02 2018 (r330197) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:31:07 2018 (r330198) @@ -162,24 +162,28 @@ __FBSDID("$FreeBSD$"); static void iwm_mvm_ack_rates(struct iwm_softc *sc, int is2ghz, - int *cck_rates, int *ofdm_rates) + int *cck_rates, int *ofdm_rates, struct iwm_node *in) { int lowest_present_ofdm = 100; int lowest_present_cck = 100; uint8_t cck = 0; uint8_t ofdm = 0; int i; + struct ieee80211_rateset *rs = &in->in_ni.ni_rates; if (is2ghz) { - for (i = 0; i <= IWM_LAST_CCK_RATE; i++) { + for (i = IWM_FIRST_CCK_RATE; i <= IWM_LAST_CCK_RATE; i++) { + if ((iwm_ridx2rate(rs, i) & IEEE80211_RATE_BASIC) == 0) + continue; cck |= (1 << i); if (lowest_present_cck > i) lowest_present_cck = i; } } for (i = IWM_FIRST_OFDM_RATE; i <= IWM_LAST_NON_HT_RATE; i++) { - int adj = i - IWM_FIRST_OFDM_RATE; - ofdm |= (1 << adj); + if ((iwm_ridx2rate(rs, i) & IEEE80211_RATE_BASIC) == 0) + continue; + ofdm |= (1 << (i - IWM_FIRST_OFDM_RATE)); if (lowest_present_ofdm > i) lowest_present_ofdm = i; } @@ -307,7 +311,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru } else { is2ghz = 1; } - iwm_mvm_ack_rates(sc, is2ghz, &cck_ack_rates, &ofdm_ack_rates); + iwm_mvm_ack_rates(sc, is2ghz, &cck_ack_rates, &ofdm_ack_rates, in); cmd->cck_rates = htole32(cck_ack_rates); cmd->ofdm_rates = htole32(ofdm_ack_rates); @@ -446,12 +450,10 @@ iwm_mvm_mac_ctxt_cmd_station(struct iwm_softc *sc, str { struct ieee80211_node *ni = vap->iv_bss; struct iwm_node *in = IWM_NODE(ni); - struct iwm_mac_ctx_cmd cmd; + struct iwm_mac_ctx_cmd cmd = {}; IWM_DPRINTF(sc, IWM_DEBUG_RESET, "%s: called; action=%d\n", __func__, action); - - memset(&cmd, 0, sizeof(cmd)); /* Fill the common data for all mac context types */ iwm_mvm_mac_ctxt_cmd_common(sc, in, &cmd, action); Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:29:02 2018 (r330197) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:31:07 2018 (r330198) @@ -120,6 +120,8 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); + static inline uint8_t iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) { From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:32:47 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7B40EF28BDA; Thu, 1 Mar 2018 06:32:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2D6EF69A94; Thu, 1 Mar 2018 06:32:47 +0000 (UTC) (envelope-from eadler@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 2860024DE8; Thu, 1 Mar 2018 06:32:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216Wl4e057824; Thu, 1 Mar 2018 06:32:47 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216WkCj057822; Thu, 1 Mar 2018 06:32:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010632.w216WkCj057822@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:32: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: r330199 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330199 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.25 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, 01 Mar 2018 06:32:47 -0000 Author: eadler Date: Thu Mar 1 06:32:46 2018 New Revision: 330199 URL: https://svnweb.freebsd.org/changeset/base/330199 Log: MFC r318002: [iwm] iwm_{read,write}_prph() don't grab the nic lock in iwm themselves. * Fix a couple of cases where the nic lock ended up not being grabbed during an iwm_read_prph() or iwm_write_prph(). Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:31:07 2018 (r330198) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:32:46 2018 (r330199) @@ -1293,9 +1293,9 @@ iwm_stop_device(struct iwm_softc *sc) /* stop tx and rx. tx and rx bits, as usual, are from if_iwn */ - iwm_write_prph(sc, IWM_SCD_TXFACT, 0); - if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_SCD_TXFACT, 0); + /* Stop each Tx DMA channel */ for (chnl = 0; chnl < IWM_FH_TCSR_CHNL_NUM; chnl++) { IWM_WRITE(sc, @@ -1323,8 +1323,10 @@ iwm_stop_device(struct iwm_softc *sc) if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { /* Power-down device's busmaster DMA clocks */ - iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, - IWM_APMG_CLK_VAL_DMA_CLK_RQT); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, + IWM_APMG_CLK_VAL_DMA_CLK_RQT); + } DELAY(5); } @@ -1621,8 +1623,6 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t iwm_ict_reset(sc); - iwm_nic_unlock(sc); - sc->scd_base_addr = iwm_read_prph(sc, IWM_SCD_SRAM_BASE_ADDR); if (scd_base_addr != 0 && scd_base_addr != sc->scd_base_addr) { @@ -1631,6 +1631,8 @@ iwm_trans_pcie_fw_alive(struct iwm_softc *sc, uint32_t __func__, sc->scd_base_addr, scd_base_addr); } + iwm_nic_unlock(sc); + /* reset context data, TX status and translation data */ error = iwm_write_mem(sc, sc->scd_base_addr + IWM_SCD_CONTEXT_MEM_LOWER_BOUND, @@ -2590,9 +2592,11 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, if (image->is_dual_cpus) { /* set CPU2 header address */ - iwm_write_prph(sc, - IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, - IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, + IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, + IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + } /* load to FW the binary sections of CPU2 */ ret = iwm_pcie_load_cpu_sections(sc, image, 2, @@ -2621,7 +2625,10 @@ iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, /* configure the ucode to be ready to get the secured image */ /* release CPU reset */ - iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, + IWM_RELEASE_CPU_RESET_BIT); + } /* load to FW the binary Secured sections of CPU1 */ ret = iwm_pcie_load_cpu_sections_8000(sc, image, 1, @@ -2875,10 +2882,14 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, IWM_LOCK(sc); if (error) { if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + uint32_t a = 0x5a5a5a5a, b = 0x5a5a5a5a; + if (iwm_nic_lock(sc)) { + a = iwm_read_prph(sc, IWM_SB_CPU_1_STATUS); + b = iwm_read_prph(sc, IWM_SB_CPU_2_STATUS); + } device_printf(sc->sc_dev, "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", - iwm_read_prph(sc, IWM_SB_CPU_1_STATUS), - iwm_read_prph(sc, IWM_SB_CPU_2_STATUS)); + a, b); } sc->cur_ucode = old_type; return error; Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:31:07 2018 (r330198) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:32:46 2018 (r330199) @@ -498,11 +498,15 @@ iwm_apm_init(struct iwm_softc *sc) * just to discard the value. But that's the way the hardware * seems to like it. */ - iwm_read_prph(sc, IWM_OSC_CLK); - iwm_read_prph(sc, IWM_OSC_CLK); + if (iwm_nic_lock(sc)) { + iwm_read_prph(sc, IWM_OSC_CLK); + iwm_read_prph(sc, IWM_OSC_CLK); + } iwm_set_bits_prph(sc, IWM_OSC_CLK, IWM_OSC_CLK_FORCE_CONTROL); - iwm_read_prph(sc, IWM_OSC_CLK); - iwm_read_prph(sc, IWM_OSC_CLK); + if (iwm_nic_lock(sc)) { + iwm_read_prph(sc, IWM_OSC_CLK); + iwm_read_prph(sc, IWM_OSC_CLK); + } } /* @@ -513,8 +517,10 @@ iwm_apm_init(struct iwm_softc *sc) * set by default in "CLK_CTRL_REG" after reset. */ if (sc->cfg->device_family == IWM_DEVICE_FAMILY_7000) { - iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, - IWM_APMG_CLK_VAL_DMA_CLK_RQT); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, + IWM_APMG_CLK_VAL_DMA_CLK_RQT); + } DELAY(20); /* Disable L1-Active */ @@ -522,8 +528,10 @@ iwm_apm_init(struct iwm_softc *sc) IWM_APMG_PCIDEV_STT_VAL_L1_ACT_DIS); /* Clear the interrupt in APMG if the NIC is in RFKILL */ - iwm_write_prph(sc, IWM_APMG_RTC_INT_STT_REG, - IWM_APMG_RTC_INT_STT_RFKILL); + if (iwm_nic_lock(sc)) { + iwm_write_prph(sc, IWM_APMG_RTC_INT_STT_REG, + IWM_APMG_RTC_INT_STT_RFKILL); + } } out: if (error) @@ -625,12 +633,12 @@ iwm_pcie_set_cmd_in_flight(struct iwm_softc *sc) IWM_SETBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); - ret = iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, + ret = iwm_poll_bit(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_VAL_MAC_ACCESS_EN, (IWM_CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY | IWM_CSR_GP_CNTRL_REG_FLAG_GOING_TO_SLEEP), 15000); - if (ret == 0) { + if (ret == 0) { IWM_CLRBITS(sc, IWM_CSR_GP_CNTRL, IWM_CSR_GP_CNTRL_REG_FLAG_MAC_ACCESS_REQ); device_printf(sc->sc_dev, From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:33:28 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0740BF28CCD; Thu, 1 Mar 2018 06:33:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B198269C90; Thu, 1 Mar 2018 06:33:27 +0000 (UTC) (envelope-from eadler@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 93DD924DEA; Thu, 1 Mar 2018 06:33:27 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216XRvB057917; Thu, 1 Mar 2018 06:33:27 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216XREG057915; Thu, 1 Mar 2018 06:33:27 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010633.w216XREG057915@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:33:27 +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: r330200 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330200 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.25 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, 01 Mar 2018 06:33:28 -0000 Author: eadler Date: Thu Mar 1 06:33:27 2018 New Revision: 330200 URL: https://svnweb.freebsd.org/changeset/base/330200 Log: MFC r318003: [iwm] Add iwm_nic_unlock() calls missing from previous commit. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:32:46 2018 (r330199) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:33:27 2018 (r330200) @@ -1326,6 +1326,7 @@ iwm_stop_device(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_APMG_CLK_DIS_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); + iwm_nic_unlock(sc); } DELAY(5); } @@ -2596,6 +2597,7 @@ iwm_pcie_load_given_ucode(struct iwm_softc *sc, iwm_write_prph(sc, IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR, IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE); + iwm_nic_unlock(sc); } /* load to FW the binary sections of CPU2 */ @@ -2628,6 +2630,7 @@ iwm_pcie_load_given_ucode_8000(struct iwm_softc *sc, if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_RELEASE_CPU_RESET, IWM_RELEASE_CPU_RESET_BIT); + iwm_nic_unlock(sc); } /* load to FW the binary Secured sections of CPU1 */ @@ -2886,6 +2889,7 @@ iwm_mvm_load_ucode_wait_alive(struct iwm_softc *sc, if (iwm_nic_lock(sc)) { a = iwm_read_prph(sc, IWM_SB_CPU_1_STATUS); b = iwm_read_prph(sc, IWM_SB_CPU_2_STATUS); + iwm_nic_unlock(sc); } device_printf(sc->sc_dev, "SecBoot CPU1 Status: 0x%x, CPU2 Status: 0x%x\n", Modified: stable/11/sys/dev/iwm/if_iwm_pcie_trans.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:32:46 2018 (r330199) +++ stable/11/sys/dev/iwm/if_iwm_pcie_trans.c Thu Mar 1 06:33:27 2018 (r330200) @@ -501,11 +501,13 @@ iwm_apm_init(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_read_prph(sc, IWM_OSC_CLK); iwm_read_prph(sc, IWM_OSC_CLK); + iwm_nic_unlock(sc); } iwm_set_bits_prph(sc, IWM_OSC_CLK, IWM_OSC_CLK_FORCE_CONTROL); if (iwm_nic_lock(sc)) { iwm_read_prph(sc, IWM_OSC_CLK); iwm_read_prph(sc, IWM_OSC_CLK); + iwm_nic_unlock(sc); } } @@ -520,6 +522,7 @@ iwm_apm_init(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_APMG_CLK_EN_REG, IWM_APMG_CLK_VAL_DMA_CLK_RQT); + iwm_nic_unlock(sc); } DELAY(20); @@ -531,6 +534,7 @@ iwm_apm_init(struct iwm_softc *sc) if (iwm_nic_lock(sc)) { iwm_write_prph(sc, IWM_APMG_RTC_INT_STT_REG, IWM_APMG_RTC_INT_STT_RFKILL); + iwm_nic_unlock(sc); } } out: From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:34:22 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7750BF28EFC; Thu, 1 Mar 2018 06:34:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2A82669F11; Thu, 1 Mar 2018 06:34:22 +0000 (UTC) (envelope-from eadler@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 254AF24DEE; Thu, 1 Mar 2018 06:34:22 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216YMM9058007; Thu, 1 Mar 2018 06:34:22 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216YLBk058001; Thu, 1 Mar 2018 06:34:21 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010634.w216YLBk058001@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:34:21 +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: r330201 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330201 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.25 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, 01 Mar 2018 06:34:22 -0000 Author: eadler Date: Thu Mar 1 06:34:21 2018 New Revision: 330201 URL: https://svnweb.freebsd.org/changeset/base/330201 Log: MFC r318005: [iwm] Add basic powermanagement support via ifconfig wlan0 powersave. * The DEVICE_POWER_FLAGS_CAM_MSK flag was removed in the upstream iwlwifi in Linux commit ceef91c89480dd18bb3ac51e91280a233d0ca41f. * Add sc_ps_disabled flag to struct iwm_softc, which corresponds to mvm->ps_disabled in struct iwl_mvm in Linux iwlwifi. * Adds a hw.iwm.power_scheme tunable which corresponds to the power_scheme module parameter in Linux iwlwifi. Set this to 1 for completely disabling power management, 2 (default) for balanced powermanagement, and 3 for lowerpower mode (which does dtim period skipping). * Imports the constants.h file from iwlwifi as if_iwm_constants.h. * This doesn't allow changing the powermanagement setting while connected, also one can only choose between enabled and disabled powersaving with ifconfig (so switching between balanced and low-power mode requires rebooting to change the tunable). * After any changes to powermanagement (i.e. "ifconfig wlan0 powersave" to enable powermanagement, or "ifconfig wlan0 -powersave" for disabling powermanagement), one has to disconnect and reconnect to the accespoint for the change to take effect. Added: stable/11/sys/dev/iwm/if_iwm_constants.h - copied unchanged from r318005, head/sys/dev/iwm/if_iwm_constants.h Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_power.c stable/11/sys/dev/iwm/if_iwm_power.h stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:34:21 2018 (r330201) @@ -4155,6 +4155,12 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed to add MAC\n", __func__); goto out; } + if ((error = iwm_mvm_power_update_mac(sc)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to update power management\n", + __func__); + goto out; + } if ((error = iwm_mvm_phy_ctxt_changed(sc, &sc->sc_phyctxt[0], in->in_ni.ni_chan, 1, 1)) != 0) { device_printf(sc->sc_dev, @@ -4561,8 +4567,8 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ } in = IWM_NODE(vap->iv_bss); - iwm_mvm_power_mac_update_mode(sc, in); iwm_mvm_enable_beacon_filter(sc, in); + iwm_mvm_power_update_mac(sc); iwm_mvm_update_quotas(sc, in); iwm_setrates(sc, in); @@ -4850,6 +4856,7 @@ iwm_init_hw(struct iwm_softc *sc) * image just loaded */ iwm_stop_device(sc); + sc->sc_ps_disabled = FALSE; if ((error = iwm_start_hw(sc)) != 0) { device_printf(sc->sc_dev, "could not initialize hardware\n"); return error; @@ -6108,6 +6115,7 @@ iwm_attach(device_t dev) IEEE80211_C_STA | IEEE80211_C_WPA | /* WPA/RSN */ IEEE80211_C_WME | + IEEE80211_C_PMGT | IEEE80211_C_SHSLOT | /* short slot time supported */ IEEE80211_C_SHPREAMBLE /* short preamble supported */ // IEEE80211_C_BGSCAN /* capable of bg scanning */ Copied: stable/11/sys/dev/iwm/if_iwm_constants.h (from r318005, head/sys/dev/iwm/if_iwm_constants.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_constants.h Thu Mar 1 06:34:21 2018 (r330201, copy of r318005, head/sys/dev/iwm/if_iwm_constants.h) @@ -0,0 +1,154 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + ****************************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2013 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2015 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* $FreeBSD$ */ + +#ifndef __IF_IWM_CONSTANTS_H +#define __IF_IWM_CONSTANTS_H + +/* */ + +#define IWM_MVM_DEFAULT_PS_TX_DATA_TIMEOUT (100 * 1000) +#define IWM_MVM_DEFAULT_PS_RX_DATA_TIMEOUT (100 * 1000) +#define IWM_MVM_WOWLAN_PS_TX_DATA_TIMEOUT (10 * 1000) +#define IWM_MVM_WOWLAN_PS_RX_DATA_TIMEOUT (10 * 1000) +#define IWM_MVM_SHORT_PS_TX_DATA_TIMEOUT (2 * 1024) /* defined in TU */ +#define IWM_MVM_SHORT_PS_RX_DATA_TIMEOUT (40 * 1024) /* defined in TU */ +#define IWM_MVM_P2P_LOWLATENCY_PS_ENABLE 0 +#define IWM_MVM_UAPSD_RX_DATA_TIMEOUT (50 * 1000) +#define IWM_MVM_UAPSD_TX_DATA_TIMEOUT (50 * 1000) +#ifdef notyet +/* XXX Find corresponding values from net80211 */ +#define IWM_MVM_UAPSD_QUEUES (IEEE80211_WMM_IE_STA_QOSINFO_AC_VO |\ + IEEE80211_WMM_IE_STA_QOSINFO_AC_VI |\ + IEEE80211_WMM_IE_STA_QOSINFO_AC_BK |\ + IEEE80211_WMM_IE_STA_QOSINFO_AC_BE) +#endif +#define IWM_MVM_PS_HEAVY_TX_THLD_PACKETS 20 +#define IWM_MVM_PS_HEAVY_RX_THLD_PACKETS 8 +#define IWM_MVM_PS_SNOOZE_HEAVY_TX_THLD_PACKETS 30 +#define IWM_MVM_PS_SNOOZE_HEAVY_RX_THLD_PACKETS 20 +#define IWM_MVM_PS_HEAVY_TX_THLD_PERCENT 50 +#define IWM_MVM_PS_HEAVY_RX_THLD_PERCENT 50 +#define IWM_MVM_PS_SNOOZE_INTERVAL 25 +#define IWM_MVM_PS_SNOOZE_WINDOW 50 +#define IWM_MVM_WOWLAN_PS_SNOOZE_WINDOW 25 +#define IWM_MVM_LOWLAT_QUOTA_MIN_PERCENT 64 +#define IWM_MVM_BT_COEX_EN_RED_TXP_THRESH 62 +#define IWM_MVM_BT_COEX_DIS_RED_TXP_THRESH 65 +#define IWM_MVM_BT_COEX_SYNC2SCO 1 +#define IWM_MVM_BT_COEX_CORUNNING 0 +#define IWM_MVM_BT_COEX_MPLUT 1 +#define IWM_MVM_BT_COEX_RRC 1 +#define IWM_MVM_BT_COEX_TTC 1 +#define IWM_MVM_BT_COEX_MPLUT_REG0 0x22002200 +#define IWM_MVM_BT_COEX_MPLUT_REG1 0x11118451 +#define IWM_MVM_BT_COEX_ANTENNA_COUPLING_THRS 30 +#define IWM_MVM_FW_MCAST_FILTER_PASS_ALL 0 +#define IWM_MVM_FW_BCAST_FILTER_PASS_ALL 0 +#define IWM_MVM_QUOTA_THRESHOLD 4 +#define IWM_MVM_RS_RSSI_BASED_INIT_RATE 0 +#define IWM_MVM_RS_80_20_FAR_RANGE_TWEAK 1 +#define IWM_MVM_TOF_IS_RESPONDER 0 +#define IWM_MVM_SW_TX_CSUM_OFFLOAD 0 +#define IWM_MVM_HW_CSUM_DISABLE 0 +#define IWM_MVM_COLLECT_FW_ERR_DUMP 1 +#define IWM_MVM_RS_NUM_TRY_BEFORE_ANT_TOGGLE 1 +#define IWM_MVM_RS_HT_VHT_RETRIES_PER_RATE 2 +#define IWM_MVM_RS_HT_VHT_RETRIES_PER_RATE_TW 1 +#define IWM_MVM_RS_INITIAL_MIMO_NUM_RATES 3 +#define IWM_MVM_RS_INITIAL_SISO_NUM_RATES 3 +#define IWM_MVM_RS_INITIAL_LEGACY_NUM_RATES 2 +#define IWM_MVM_RS_INITIAL_LEGACY_RETRIES 2 +#define IWM_MVM_RS_SECONDARY_LEGACY_RETRIES 1 +#define IWM_MVM_RS_SECONDARY_LEGACY_NUM_RATES 16 +#define IWM_MVM_RS_SECONDARY_SISO_NUM_RATES 3 +#define IWM_MVM_RS_SECONDARY_SISO_RETRIES 1 +#define IWM_MVM_RS_RATE_MIN_FAILURE_TH 3 +#define IWM_MVM_RS_RATE_MIN_SUCCESS_TH 8 +#define IWM_MVM_RS_STAY_IN_COLUMN_TIMEOUT 5 /* Seconds */ +#define IWM_MVM_RS_IDLE_TIMEOUT 5 /* Seconds */ +#define IWM_MVM_RS_MISSED_RATE_MAX 15 +#define IWM_MVM_RS_LEGACY_FAILURE_LIMIT 160 +#define IWM_MVM_RS_LEGACY_SUCCESS_LIMIT 480 +#define IWM_MVM_RS_LEGACY_TABLE_COUNT 160 +#define IWM_MVM_RS_NON_LEGACY_FAILURE_LIMIT 400 +#define IWM_MVM_RS_NON_LEGACY_SUCCESS_LIMIT 4500 +#define IWM_MVM_RS_NON_LEGACY_TABLE_COUNT 1500 +#define IWM_MVM_RS_SR_FORCE_DECREASE 15 /* percent */ +#define IWM_MVM_RS_SR_NO_DECREASE 85 /* percent */ +#define IWM_MVM_RS_AGG_TIME_LIMIT 4000 /* 4 msecs. valid 100-8000 */ +#define IWM_MVM_RS_AGG_DISABLE_START 3 +#define IWM_MVM_RS_TPC_SR_FORCE_INCREASE 75 /* percent */ +#define IWM_MVM_RS_TPC_SR_NO_INCREASE 85 /* percent */ +#define IWM_MVM_RS_TPC_TX_POWER_STEP 3 + +#endif /* __IF_IWM_CONSTANTS_H */ Modified: stable/11/sys/dev/iwm/if_iwm_power.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:34:21 2018 (r330201) @@ -137,9 +137,14 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include +static int iwm_power_scheme = IWM_POWER_SCHEME_BPS; + +TUNABLE_INT("hw.iwm.power_scheme", &iwm_power_scheme); + /* * BEGIN mvm/power.c */ @@ -153,7 +158,7 @@ iwm_mvm_beacon_filter_send_cmd(struct iwm_softc *sc, int ret; ret = iwm_mvm_send_cmd_pdu(sc, IWM_REPLY_BEACON_FILTERING_CMD, - IWM_CMD_SYNC, sizeof(struct iwm_beacon_filter_cmd), cmd); + 0, sizeof(struct iwm_beacon_filter_cmd), cmd); if (!ret) { IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, @@ -200,24 +205,6 @@ iwm_mvm_beacon_filter_set_cqm_params(struct iwm_softc cmd->ba_enable_beacon_abort = htole32(sc->sc_bf.ba_enabled); } -static int -iwm_mvm_update_beacon_abort(struct iwm_softc *sc, struct iwm_node *in, - int enable) -{ - struct iwm_beacon_filter_cmd cmd = { - IWM_BF_CMD_CONFIG_DEFAULTS, - .bf_enable_beacon_filter = htole32(1), - .ba_enable_beacon_abort = htole32(enable), - }; - - if (!sc->sc_bf.bf_enabled) - return 0; - - sc->sc_bf.ba_enabled = enable; - iwm_mvm_beacon_filter_set_cqm_params(sc, in, &cmd); - return iwm_mvm_beacon_filter_send_cmd(sc, &cmd); -} - static void iwm_mvm_power_log(struct iwm_softc *sc, struct iwm_mac_power_cmd *cmd) { @@ -233,9 +220,63 @@ iwm_mvm_power_log(struct iwm_softc *sc, struct iwm_mac "Disable power management\n"); return; } + + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "Rx timeout = %u usec\n", le32toh(cmd->rx_data_timeout)); + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "Tx timeout = %u usec\n", le32toh(cmd->tx_data_timeout)); + if (cmd->flags & htole16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK)) + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "DTIM periods to skip = %u\n", cmd->skip_dtim_periods); } +static boolean_t +iwm_mvm_power_is_radar(struct iwm_softc *sc) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211_channel *chan; + boolean_t radar_detect = FALSE; + + chan = ic->ic_bsschan; + if (chan == IEEE80211_CHAN_ANYC || + (chan->ic_flags & IEEE80211_CHAN_DFS) != 0) { + radar_detect = TRUE; + } + + return radar_detect; +} + static void +iwm_mvm_power_config_skip_dtim(struct iwm_softc *sc, + struct iwm_mac_power_cmd *cmd) +{ + struct ieee80211com *ic = &sc->sc_ic; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + int dtimper = vap->iv_dtim_period ?: 1; + int skip; + + /* disable, in case we're supposed to override */ + cmd->skip_dtim_periods = 0; + cmd->flags &= ~htole16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK); + + if (iwm_mvm_power_is_radar(sc)) + return; + + if (dtimper >= 10) + return; + + /* TODO: check that multicast wake lock is off */ + + if (iwm_power_scheme != IWM_POWER_SCHEME_LP) + return; + skip = 2; + + /* the firmware really expects "look at every X DTIMs", so add 1 */ + cmd->skip_dtim_periods = 1 + skip; + cmd->flags |= htole16(IWM_POWER_FLAGS_SKIP_OVER_DTIM_MSK); +} + +static void iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct iwm_node *in, struct iwm_mac_power_cmd *cmd) { @@ -257,45 +298,49 @@ iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct i */ dtimper_msec = dtimper * ni->ni_intval; keep_alive - = MAX(3 * dtimper_msec, 1000 * IWM_POWER_KEEP_ALIVE_PERIOD_SEC); + = imax(3 * dtimper_msec, 1000 * IWM_POWER_KEEP_ALIVE_PERIOD_SEC); keep_alive = roundup(keep_alive, 1000) / 1000; cmd->keep_alive_seconds = htole16(keep_alive); + + if (sc->sc_ps_disabled) + return; + + cmd->flags |= htole16(IWM_POWER_FLAGS_POWER_SAVE_ENA_MSK); + cmd->flags |= htole16(IWM_POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK); + + iwm_mvm_power_config_skip_dtim(sc, cmd); + + cmd->rx_data_timeout = + htole32(IWM_MVM_DEFAULT_PS_RX_DATA_TIMEOUT); + cmd->tx_data_timeout = + htole32(IWM_MVM_DEFAULT_PS_TX_DATA_TIMEOUT); } -int -iwm_mvm_power_mac_update_mode(struct iwm_softc *sc, struct iwm_node *in) +static int +iwm_mvm_power_send_cmd(struct iwm_softc *sc, struct iwm_node *in) { - int ret; - int ba_enable; - struct iwm_mac_power_cmd cmd; + struct iwm_mac_power_cmd cmd = {}; - memset(&cmd, 0, sizeof(cmd)); - iwm_mvm_power_build_cmd(sc, in, &cmd); iwm_mvm_power_log(sc, &cmd); - if ((ret = iwm_mvm_send_cmd_pdu(sc, IWM_MAC_PM_POWER_TABLE, - IWM_CMD_SYNC, sizeof(cmd), &cmd)) != 0) - return ret; - - ba_enable = !!(cmd.flags & - htole16(IWM_POWER_FLAGS_POWER_MANAGEMENT_ENA_MSK)); - return iwm_mvm_update_beacon_abort(sc, in, ba_enable); + return iwm_mvm_send_cmd_pdu(sc, IWM_MAC_PM_POWER_TABLE, 0, + sizeof(cmd), &cmd); } -int -iwm_mvm_power_update_device(struct iwm_softc *sc) +static int +_iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_node *in, + struct iwm_beacon_filter_cmd *cmd) { - struct iwm_device_power_cmd cmd = { - .flags = htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK), - }; + int ret; - cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_CAM_MSK); - IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, - "Sending device power command with flags = 0x%X\n", cmd.flags); + iwm_mvm_beacon_filter_set_cqm_params(sc, in, cmd); + ret = iwm_mvm_beacon_filter_send_cmd(sc, cmd); - return iwm_mvm_send_cmd_pdu(sc, - IWM_POWER_TABLE_CMD, IWM_CMD_SYNC, sizeof(cmd), &cmd); + if (!ret) + sc->sc_bf.bf_enabled = 1; + + return ret; } int @@ -305,15 +350,8 @@ iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, str IWM_BF_CMD_CONFIG_DEFAULTS, .bf_enable_beacon_filter = htole32(1), }; - int ret; - iwm_mvm_beacon_filter_set_cqm_params(sc, in, &cmd); - ret = iwm_mvm_beacon_filter_send_cmd(sc, &cmd); - - if (ret == 0) - sc->sc_bf.bf_enabled = 1; - - return ret; + return _iwm_mvm_enable_beacon_filter(sc, in, &cmd); } int @@ -327,4 +365,106 @@ iwm_mvm_disable_beacon_filter(struct iwm_softc *sc) sc->sc_bf.bf_enabled = 0; return ret; +} + +static int +iwm_mvm_power_set_ps(struct iwm_softc *sc) +{ + struct ieee80211vap *vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); + boolean_t disable_ps; + int ret; + + /* disable PS if CAM */ + disable_ps = (iwm_power_scheme == IWM_POWER_SCHEME_CAM); + /* ...or if any of the vifs require PS to be off */ + if (vap != NULL && (vap->iv_flags & IEEE80211_F_PMGTON) == 0) + disable_ps = TRUE; + + /* update device power state if it has changed */ + if (sc->sc_ps_disabled != disable_ps) { + boolean_t old_ps_disabled = sc->sc_ps_disabled; + + sc->sc_ps_disabled = disable_ps; + ret = iwm_mvm_power_update_device(sc); + if (ret) { + sc->sc_ps_disabled = old_ps_disabled; + return ret; + } + } + + return 0; +} + +static int +iwm_mvm_power_set_ba(struct iwm_softc *sc, struct iwm_node *in) +{ + struct iwm_beacon_filter_cmd cmd = { + IWM_BF_CMD_CONFIG_DEFAULTS, + .bf_enable_beacon_filter = htole32(1), + }; + + if (!sc->sc_bf.bf_enabled) + return 0; + + sc->sc_bf.ba_enabled = !sc->sc_ps_disabled; + + return _iwm_mvm_enable_beacon_filter(sc, in, &cmd); +} + +int +iwm_mvm_power_update_ps(struct iwm_softc *sc) +{ + struct ieee80211vap *vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); + int ret; + + ret = iwm_mvm_power_set_ps(sc); + if (ret) + return ret; + + if (vap != NULL) + return iwm_mvm_power_set_ba(sc, IWM_NODE(vap->iv_bss)); + + return 0; +} + +int +iwm_mvm_power_update_mac(struct iwm_softc *sc) +{ + struct ieee80211vap *vap = TAILQ_FIRST(&sc->sc_ic.ic_vaps); + int ret; + + ret = iwm_mvm_power_set_ps(sc); + if (ret) + return ret; + + if (vap != NULL) { + ret = iwm_mvm_power_send_cmd(sc, IWM_NODE(vap->iv_bss)); + if (ret) + return ret; + } + + if (vap != NULL) + return iwm_mvm_power_set_ba(sc, IWM_NODE(vap->iv_bss)); + + return 0; +} + +int +iwm_mvm_power_update_device(struct iwm_softc *sc) +{ + struct iwm_device_power_cmd cmd = { + .flags = 0, + }; + + if (iwm_power_scheme == IWM_POWER_SCHEME_CAM) + sc->sc_ps_disabled = TRUE; + + if (!sc->sc_ps_disabled) + cmd.flags |= htole16(IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK); + + IWM_DPRINTF(sc, IWM_DEBUG_PWRSAVE | IWM_DEBUG_CMD, + "Sending device power command with flags = 0x%X\n", cmd.flags); + + return iwm_mvm_send_cmd_pdu(sc, + IWM_POWER_TABLE_CMD, 0, sizeof(cmd), &cmd); } Modified: stable/11/sys/dev/iwm/if_iwm_power.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.h Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwm_power.h Thu Mar 1 06:34:21 2018 (r330201) @@ -90,9 +90,9 @@ #ifndef __IF_IWM_POWER_H__ #define __IF_IWM_POWER_H__ -extern int iwm_mvm_power_mac_update_mode(struct iwm_softc *sc, - struct iwm_node *in); extern int iwm_mvm_power_update_device(struct iwm_softc *sc); +extern int iwm_mvm_power_update_mac(struct iwm_softc *sc); +extern int iwm_mvm_power_update_ps(struct iwm_softc *sc); extern int iwm_mvm_enable_beacon_filter(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_disable_beacon_filter(struct iwm_softc *sc); Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:34:21 2018 (r330201) @@ -3620,17 +3620,11 @@ struct iwm_powertable_cmd { /** * enum iwm_device_power_flags - masks for device power command flags - * @DEVIC_POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off - * receiver and transmitter. '0' - does not allow. This flag should be - * always set to '1' unless one need to disable actual power down for debug - * purposes. - * @IWM_DEVICE_POWER_FLAGS_CAM_MSK: '1' CAM (Continuous Active Mode) is set, meaning - * that power management is disabled. '0' Power management is enabled, one - * of power schemes is applied. -*/ + * @IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK: '1' Allow to save power by turning off + * receiver and transmitter. '0' - does not allow. + */ enum iwm_device_power_flags { IWM_DEVICE_POWER_FLAGS_POWER_SAVE_ENA_MSK = (1 << 0), - IWM_DEVICE_POWER_FLAGS_CAM_MSK = (1 << 13), }; /** @@ -6036,6 +6030,12 @@ struct iwm_cmd_header_wide { uint8_t version; } __packed; +/** + * enum iwm_power_scheme + * @IWM_POWER_LEVEL_CAM - Continuously Active Mode + * @IWM_POWER_LEVEL_BPS - Balanced Power Save (default) + * @IWM_POWER_LEVEL_LP - Low Power + */ enum iwm_power_scheme { IWM_POWER_SCHEME_CAM = 1, IWM_POWER_SCHEME_BPS, Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:33:27 2018 (r330200) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:34:21 2018 (r330201) @@ -535,6 +535,9 @@ struct iwm_softc { struct iwm_fw_paging fw_paging_db[IWM_NUM_OF_FW_PAGING_BLOCKS]; uint16_t num_of_paging_blk; uint16_t num_of_pages_in_last_blk; + + /* Indicate if device power save is allowed */ + boolean_t sc_ps_disabled; }; #define IWM_LOCK_INIT(_sc) \ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:34:49 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id F10CBF28FCC; Thu, 1 Mar 2018 06:34:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A79A26A09A; Thu, 1 Mar 2018 06:34:48 +0000 (UTC) (envelope-from eadler@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 A2A1F24DEF; Thu, 1 Mar 2018 06:34:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216YmJe058067; Thu, 1 Mar 2018 06:34:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216YmmP058064; Thu, 1 Mar 2018 06:34:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010634.w216YmmP058064@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:34:48 +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: r330202 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330202 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.25 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, 01 Mar 2018 06:34:49 -0000 Author: eadler Date: Thu Mar 1 06:34:48 2018 New Revision: 330202 URL: https://svnweb.freebsd.org/changeset/base/330202 Log: MFC r318012: [iwm] Allow listening on both chains/atennas to get diversity. This might improve throughput slightly when far from the accesspoint, apparently by allowing the firmware to listen on either of the two antennas (if there are two, i.e. on 7260/7265/8260), whichever has a better reception. Modified: stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 06:34:21 2018 (r330201) +++ stable/11/sys/dev/iwm/if_iwm_phy_ctxt.c Thu Mar 1 06:34:48 2018 (r330202) @@ -217,6 +217,18 @@ iwm_mvm_phy_ctxt_cmd_data(struct iwm_softc *sc, idle_cnt = chains_static; active_cnt = chains_dynamic; + /* In scenarios where we only ever use a single-stream rates, + * i.e. legacy 11b/g/a associations, single-stream APs or even + * static SMPS, enable both chains to get diversity, improving + * the case where we're far enough from the AP that attenuation + * between the two antennas is sufficiently different to impact + * performance. + */ + if (active_cnt == 1 && iwm_mvm_rx_diversity_allowed(sc)) { + idle_cnt = 2; + active_cnt = 2; + } + cmd->rxchain_info = htole32(iwm_mvm_get_valid_rx_ant(sc) << IWM_PHY_RX_CHAIN_VALID_POS); cmd->rxchain_info |= htole32(idle_cnt << IWM_PHY_RX_CHAIN_CNT_POS); Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:34:21 2018 (r330201) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:34:48 2018 (r330202) @@ -152,6 +152,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -485,4 +486,18 @@ iwm_dma_contig_free(struct iwm_dma_info *dma) bus_dma_tag_destroy(dma->tag); dma->tag = NULL; } +} + +boolean_t +iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc) +{ + if (num_of_ant(iwm_mvm_get_valid_rx_ant(sc)) == 1) + return FALSE; + + /* + * XXX Also return FALSE when SMPS (Spatial Multiplexing Powersave) + * is used on any vap (in the future). + */ + + return TRUE; } Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:34:21 2018 (r330201) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:34:48 2018 (r330202) @@ -120,6 +120,8 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); + extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); static inline uint8_t From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:35:14 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5D72AF2906B; Thu, 1 Mar 2018 06:35:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 339CB6A225; Thu, 1 Mar 2018 06:35:14 +0000 (UTC) (envelope-from eadler@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 2E7A924DF0; Thu, 1 Mar 2018 06:35:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216ZEAI058144; Thu, 1 Mar 2018 06:35:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216ZDYc058140; Thu, 1 Mar 2018 06:35:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010635.w216ZDYc058140@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:35: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: r330203 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330203 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.25 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, 01 Mar 2018 06:35:14 -0000 Author: eadler Date: Thu Mar 1 06:35:13 2018 New Revision: 330203 URL: https://svnweb.freebsd.org/changeset/base/330203 Log: MFC r318013: [iwm] Move in_phyctxt from struct iwm_node to phy_ctxt in struct iwm_vap. * This better matches how things are organized in Linux's iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_binding.c stable/11/sys/dev/iwm/if_iwm_binding.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:35:13 2018 (r330203) @@ -354,7 +354,7 @@ static int iwm_mvm_add_int_sta_common(struct iwm_softc struct iwm_int_sta *, const uint8_t *, uint16_t, uint16_t); static int iwm_mvm_add_aux_sta(struct iwm_softc *); -static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_node *); +static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static int iwm_assoc(struct ieee80211vap *, struct iwm_softc *); static int iwm_release(struct iwm_softc *, struct iwm_node *); @@ -1285,6 +1285,7 @@ iwm_stop_device(struct iwm_softc *sc) */ if (vap) { struct iwm_vap *iv = IWM_VAP(vap); + iv->phy_ctxt = NULL; iv->is_uploaded = 0; } @@ -3998,7 +3999,7 @@ iwm_mvm_add_aux_sta(struct iwm_softc *sc) */ static int -iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm_vap *ivp) { struct iwm_time_quota_cmd cmd; int i, idx, ret, num_active_macs, quota, quota_rem; @@ -4009,10 +4010,10 @@ iwm_mvm_update_quotas(struct iwm_softc *sc, struct iwm memset(&cmd, 0, sizeof(cmd)); /* currently, PHY ID == binding ID */ - if (in) { - id = in->in_phyctxt->id; + if (ivp) { + id = ivp->phy_ctxt->id; KASSERT(id < IWM_MAX_BINDINGS, ("invalid id")); - colors[id] = in->in_phyctxt->color; + colors[id] = ivp->phy_ctxt->color; if (1) n_ifs[id] = 1; @@ -4137,9 +4138,9 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s "%s: failed update phy ctxt\n", __func__); goto out; } - in->in_phyctxt = &sc->sc_phyctxt[0]; + iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_update(sc, in)) != 0) { + if ((error = iwm_mvm_binding_update(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4168,9 +4169,9 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s error = ETIMEDOUT; goto out; } - in->in_phyctxt = &sc->sc_phyctxt[0]; + iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_add_vif(sc, in)) != 0) { + if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding add cmd\n", __func__); goto out; @@ -4569,7 +4570,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ in = IWM_NODE(vap->iv_bss); iwm_mvm_enable_beacon_filter(sc, in); iwm_mvm_power_update_mac(sc); - iwm_mvm_update_quotas(sc, in); + iwm_mvm_update_quotas(sc, ivp); iwm_setrates(sc, in); cmd.data[0] = &in->in_lq; @@ -5750,7 +5751,6 @@ iwm_intr(void *arg) device_printf(sc->sc_dev, "%s: controller panicked, iv_state = %d; " "restarting\n", __func__, vap->iv_state); - /* XXX TODO: turn this into a callout/taskqueue */ ieee80211_restart_all(ic); return; } Modified: stable/11/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:35:13 2018 (r330203) @@ -161,10 +161,10 @@ __FBSDID("$FreeBSD$"); */ int -iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, uint32_t action) +iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action) { struct iwm_binding_cmd cmd; - struct iwm_mvm_phy_ctxt *phyctxt = in->in_phyctxt; + struct iwm_mvm_phy_ctxt *phyctxt = ivp->phy_ctxt; int i, ret; uint32_t status; @@ -203,13 +203,13 @@ iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_n } int -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_MODIFY); + return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_MODIFY); } int -iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in) +iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, in, IWM_FW_CTXT_ACTION_ADD); + return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_ADD); } Modified: stable/11/sys/dev/iwm/if_iwm_binding.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:35:13 2018 (r330203) @@ -105,9 +105,9 @@ #ifndef __IF_IWM_BINDING_H__ #define __IF_IWM_BINDING_H__ -extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_node *in, +extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action); -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_node *in); -extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp); +extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp); #endif /* __IF_IWM_BINDING_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:34:48 2018 (r330202) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:35:13 2018 (r330203) @@ -373,12 +373,13 @@ struct iwm_vap { int (*iv_newstate)(struct ieee80211vap *, enum ieee80211_state, int); + + struct iwm_mvm_phy_ctxt *phy_ctxt; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) struct iwm_node { struct ieee80211_node in_ni; - struct iwm_mvm_phy_ctxt *in_phyctxt; /* status "bits" */ int in_assoc; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:36:42 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A372DF29265; Thu, 1 Mar 2018 06:36:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 58DF86A59E; Thu, 1 Mar 2018 06:36:42 +0000 (UTC) (envelope-from eadler@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 53BBB24DF3; Thu, 1 Mar 2018 06:36:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216agSd058246; Thu, 1 Mar 2018 06:36:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216af0m058238; Thu, 1 Mar 2018 06:36:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010636.w216af0m058238@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:36: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: r330204 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330204 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.25 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, 01 Mar 2018 06:36:43 -0000 Author: eadler Date: Thu Mar 1 06:36:41 2018 New Revision: 330204 URL: https://svnweb.freebsd.org/changeset/base/330204 Log: MFC r318214: [iwm] Sanity check channel for IEEE80211_CHAN_ANYC in if_iwm_mac_ctxt.c. * This avoids panicing in some broken vap state handling cases. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_binding.c stable/11/sys/dev/iwm/if_iwm_binding.h stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c stable/11/sys/dev/iwm/if_iwm_power.c stable/11/sys/dev/iwm/if_iwm_time_event.c stable/11/sys/dev/iwm/if_iwm_time_event.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:36:41 2018 (r330204) @@ -3879,6 +3879,7 @@ iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, static int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update) { + struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); struct iwm_mvm_add_sta_cmd add_sta_cmd; int ret; uint32_t status; @@ -3887,8 +3888,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iw add_sta_cmd.sta_id = IWM_STATION_ID; add_sta_cmd.mac_id_n_color - = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); + = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); if (!update) { int ac; for (ac = 0; ac < WME_NUM_AC; ac++) { @@ -4140,7 +4140,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s } iv->phy_ctxt = &sc->sc_phyctxt[0]; - if ((error = iwm_mvm_binding_update(sc, iv)) != 0) { + if ((error = iwm_mvm_binding_add_vif(sc, iv)) != 0) { device_printf(sc->sc_dev, "%s: binding update cmd\n", __func__); goto out; @@ -4189,7 +4189,7 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s */ /* XXX duration is in units of TU, not MS */ duration = IWM_MVM_TE_SESSION_PROTECTION_MAX_TIME_MS; - iwm_mvm_protect_session(sc, in, duration, 500 /* XXX magic number */); + iwm_mvm_protect_session(sc, iv, duration, 500 /* XXX magic number */); DELAY(100); error = 0; @@ -4234,7 +4234,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * iwm_mvm_rm_sta(sc, in); * iwm_mvm_update_quotas(sc, NULL); * iwm_mvm_mac_ctxt_changed(sc, in); - * iwm_mvm_binding_remove_vif(sc, in); + * iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); * iwm_mvm_mac_ctxt_remove(sc, in); * * However, that freezes the device not matter which permutations @@ -4283,7 +4283,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error); return error; } - iwm_mvm_binding_remove_vif(sc, in); + iwm_mvm_binding_remove_vif(sc, IWM_VAP(in->in_ni.ni_vap)); iwm_mvm_mac_ctxt_remove(sc, in); @@ -6286,6 +6286,9 @@ iwm_vap_create(struct ieee80211com *ic, const char nam /* Override with driver methods. */ ivp->iv_newstate = vap->iv_newstate; vap->iv_newstate = iwm_newstate; + + ivp->id = IWM_DEFAULT_MACID; + ivp->color = IWM_DEFAULT_COLOR; ieee80211_ratectl_init(vap); /* Complete setup. */ Modified: stable/11/sys/dev/iwm/if_iwm_binding.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_binding.c Thu Mar 1 06:36:41 2018 (r330204) @@ -31,7 +31,7 @@ * * GPL LICENSE SUMMARY * - * Copyright(c) 2007 - 2013 Intel Corporation. All rights reserved. + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of version 2 of the GNU General Public License as @@ -51,13 +51,12 @@ * in the file called COPYING. * * Contact Information: - * Intel Linux Wireless + * Intel Linux Wireless * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 * - * * BSD LICENSE * - * Copyright(c) 2005 - 2013 Intel Corporation. All rights reserved. + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -87,21 +86,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -/*- - * Copyright (c) 2007-2010 Damien Bergamini - * - * Permission to use, copy, modify, and distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ #include __FBSDID("$FreeBSD$"); @@ -160,11 +144,21 @@ __FBSDID("$FreeBSD$"); * BEGIN iwlwifi/mvm/binding.c */ -int -iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t action) +struct iwm_mvm_iface_iterator_data { + int idx; + + struct iwm_mvm_phy_ctxt *phyctxt; + + uint16_t ids[IWM_MAX_MACS_IN_BINDING]; + int16_t colors[IWM_MAX_MACS_IN_BINDING]; +}; + +static int +iwm_mvm_binding_cmd(struct iwm_softc *sc, uint32_t action, + struct iwm_mvm_iface_iterator_data *data) { struct iwm_binding_cmd cmd; - struct iwm_mvm_phy_ctxt *phyctxt = ivp->phy_ctxt; + struct iwm_mvm_phy_ctxt *phyctxt = data->phyctxt; int i, ret; uint32_t status; @@ -175,41 +169,88 @@ iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_v cmd.action = htole32(action); cmd.phy = htole32(IWM_FW_CMD_ID_AND_COLOR(phyctxt->id, phyctxt->color)); - cmd.macs[0] = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); - /* We use MACID 0 here.. */ - for (i = 1; i < IWM_MAX_MACS_IN_BINDING; i++) + for (i = 0; i < IWM_MAX_MACS_IN_BINDING; i++) cmd.macs[i] = htole32(IWM_FW_CTXT_INVALID); + for (i = 0; i < data->idx; i++) + cmd.macs[i] = htole32(IWM_FW_CMD_ID_AND_COLOR(data->ids[i], + data->colors[i])); status = 0; ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_BINDING_CONTEXT_CMD, sizeof(cmd), &cmd, &status); if (ret) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, - "%s: Failed to send binding (action:%d): %d\n", - __func__, action, ret); + device_printf(sc->sc_dev, + "Failed to send binding (action:%d): %d\n", action, ret); return ret; } if (status) { - IWM_DPRINTF(sc, IWM_DEBUG_CMD | IWM_DEBUG_RESET, - "%s: Binding command failed: %u\n", - __func__, - status); + device_printf(sc->sc_dev, + "Binding command failed: %u\n", status); ret = EIO; } return ret; } -int -iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp) +static int +iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp, + struct iwm_mvm_phy_ctxt *phyctxt, boolean_t add) { - return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_MODIFY); + struct iwm_mvm_iface_iterator_data data = { + .phyctxt = phyctxt, + }; + uint32_t action; + + if (add) + action = IWM_FW_CTXT_ACTION_ADD; + else + action = IWM_FW_CTXT_ACTION_REMOVE; + + if (add) { + data.ids[0] = ivp->id; + data.colors[0] = ivp->color; + data.idx++; + } + + return iwm_mvm_binding_cmd(sc, action, &data); } int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp) { - return iwm_mvm_binding_cmd(sc, ivp, IWM_FW_CTXT_ACTION_ADD); + if (!ivp->phy_ctxt) + return EINVAL; + +#ifdef notyet + /* + * Update SF - Disable if needed. if this fails, SF might still be on + * while many macs are bound, which is forbidden - so fail the binding. + */ + if (iwm_mvm_sf_update(sc, ivp, FALSE)) + return EINVAL; +#endif + + return iwm_mvm_binding_update(sc, ivp, ivp->phy_ctxt, TRUE); +} + +int +iwm_mvm_binding_remove_vif(struct iwm_softc *sc, struct iwm_vap *ivp) +{ + int ret; + + if (!ivp->phy_ctxt) + return EINVAL; + + ret = iwm_mvm_binding_update(sc, ivp, ivp->phy_ctxt, FALSE); + +#ifdef notyet + if (!ret) { + if (iwm_mvm_sf_update(sc, ivp, TRUE)) + device_printf(sc->sc_dev, + "Failed to update SF state\n"); + } +#endif + + return ret; } Modified: stable/11/sys/dev/iwm/if_iwm_binding.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_binding.h Thu Mar 1 06:36:41 2018 (r330204) @@ -105,9 +105,7 @@ #ifndef __IF_IWM_BINDING_H__ #define __IF_IWM_BINDING_H__ -extern int iwm_mvm_binding_cmd(struct iwm_softc *sc, struct iwm_vap *ivp, - uint32_t action); -extern int iwm_mvm_binding_update(struct iwm_softc *sc, struct iwm_vap *ivp); extern int iwm_mvm_binding_add_vif(struct iwm_softc *sc, struct iwm_vap *ivp); +extern int iwm_mvm_binding_remove_vif(struct iwm_softc *sc, struct iwm_vap *ivp); #endif /* __IF_IWM_BINDING_H__ */ Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:36:41 2018 (r330204) @@ -251,6 +251,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); struct ieee80211_node *ni = vap->iv_bss; + struct iwm_vap *ivp = IWM_VAP(vap); int cck_ack_rates, ofdm_ack_rates; int i; int is2ghz; @@ -262,8 +263,8 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru * These are both functions of the vap, not of the node. * So, for now, hard-code both to 0 (default). */ - cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); + cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, + ivp->color)); cmd->action = htole32(action); cmd->mac_type = htole32(IWM_FW_MAC_TYPE_BSS_STA); @@ -306,7 +307,7 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru /* * Default to 2ghz if no node information is given. */ - if (in) { + if (in && in->in_ni.ni_chan != IEEE80211_CHAN_ANYC) { is2ghz = !! IEEE80211_IS_CHAN_2GHZ(in->in_ni.ni_chan); } else { is2ghz = 1; Modified: stable/11/sys/dev/iwm/if_iwm_power.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_power.c Thu Mar 1 06:36:41 2018 (r330204) @@ -285,9 +285,10 @@ iwm_mvm_power_build_cmd(struct iwm_softc *sc, struct i int keep_alive; struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct iwm_vap *ivp = IWM_VAP(vap); - cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, - IWM_DEFAULT_COLOR)); + cmd->id_and_color = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, + ivp->color)); dtimper = vap->iv_dtim_period ?: 1; /* Modified: stable/11/sys/dev/iwm/if_iwm_time_event.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_time_event.c Thu Mar 1 06:36:41 2018 (r330204) @@ -165,7 +165,7 @@ __FBSDID("$FreeBSD$"); #define IWM_MVM_ROC_TE_TYPE_MGMT_TX IWM_TE_P2P_CLIENT_ASSOC static int -iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_node *in, +iwm_mvm_time_event_send_add(struct iwm_softc *sc, struct iwm_vap *ivp, void *te_data, struct iwm_time_event_cmd *te_cmd) { int ret; @@ -185,14 +185,14 @@ iwm_mvm_time_event_send_add(struct iwm_softc *sc, stru } void -iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, +iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay) { struct iwm_time_event_cmd time_cmd = {}; time_cmd.action = htole32(IWM_FW_CTXT_ACTION_ADD); time_cmd.id_and_color = - htole32(IWM_FW_CMD_ID_AND_COLOR(IWM_DEFAULT_MACID, IWM_DEFAULT_COLOR)); + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); time_cmd.id = htole32(IWM_TE_BSS_STA_AGGRESSIVE_ASSOC); time_cmd.apply_time = htole32(0); @@ -208,5 +208,5 @@ iwm_mvm_protect_session(struct iwm_softc *sc, struct i IWM_TE_V2_NOTIF_HOST_EVENT_END | IWM_T2_V2_START_IMMEDIATELY); - iwm_mvm_time_event_send_add(sc, in, /*te_data*/NULL, &time_cmd); + iwm_mvm_time_event_send_add(sc, ivp, /*te_data*/NULL, &time_cmd); } Modified: stable/11/sys/dev/iwm/if_iwm_time_event.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_time_event.h Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwm_time_event.h Thu Mar 1 06:36:41 2018 (r330204) @@ -107,7 +107,7 @@ #ifndef __IF_IWM_TIME_EVENT_H__ #define __IF_IWM_TIME_EVENT_H__ -extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_node *in, +extern void iwm_mvm_protect_session(struct iwm_softc *sc, struct iwm_vap *ivp, uint32_t duration, uint32_t max_delay); #endif /* __IF_IWM_TIME_EVENT_H__ */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:35:13 2018 (r330203) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:36:41 2018 (r330204) @@ -375,6 +375,9 @@ struct iwm_vap { enum ieee80211_state, int); struct iwm_mvm_phy_ctxt *phy_ctxt; + + uint16_t id; + uint16_t color; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:38:07 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 85FE9F2946D; Thu, 1 Mar 2018 06:38:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3BE506A913; Thu, 1 Mar 2018 06:38:07 +0000 (UTC) (envelope-from eadler@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 36F1424DF6; Thu, 1 Mar 2018 06:38:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216c7rc058343; Thu, 1 Mar 2018 06:38:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216c7Xr058342; Thu, 1 Mar 2018 06:38:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010638.w216c7Xr058342@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:38:07 +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: r330205 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330205 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.25 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, 01 Mar 2018 06:38:07 -0000 Author: eadler Date: Thu Mar 1 06:38:06 2018 New Revision: 330205 URL: https://svnweb.freebsd.org/changeset/base/330205 Log: MFC r318215: [iwm] change the check for ADD_STA status, use IWM_ADD_STA_STATUS_MASK. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:36:41 2018 (r330204) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:38:06 2018 (r330205) @@ -3909,7 +3909,7 @@ iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iw if (ret) return ret; - switch (status) { + switch (status & IWM_ADD_STA_STATUS_MASK) { case IWM_ADD_STA_SUCCESS: break; default: @@ -3955,7 +3955,7 @@ iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struc if (ret) return ret; - switch (status) { + switch (status & IWM_ADD_STA_STATUS_MASK) { case IWM_ADD_STA_SUCCESS: IWM_DPRINTF(sc, IWM_DEBUG_RESET, "%s: Internal station added.\n", __func__); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:38:30 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B9EFEF294EE for ; Thu, 1 Mar 2018 06:38:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-yw0-x232.google.com (mail-yw0-x232.google.com [IPv6:2607:f8b0:4002:c05::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3D0006AA84 for ; Thu, 1 Mar 2018 06:38:30 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: by mail-yw0-x232.google.com with SMTP id f2so1744608ywa.1 for ; Wed, 28 Feb 2018 22:38:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to; bh=gMmxkGmB/Obn04kDLrXb7jMaz0qaUj3u2sv8CLxfinQ=; b=ogmRQENHvQGcHhe5X9QOXANS/UPvFup+SRCogvgIZ+btA7twSR4xC9CHHO9DU3s6Xu LfOgp+Bt3dStEoHVdrt6h0Vjh4uI8si+6uJn1u6JMMxt1dZrhin2pZXYnaaD+TcLo6+4 0FM5AlckDUwf4BWLp0G1nrTfoR+iVEziMEGIM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to; bh=gMmxkGmB/Obn04kDLrXb7jMaz0qaUj3u2sv8CLxfinQ=; b=jO2HnDyl138JiSNBdolkI+tZC/StxHf0cMyQ0DBZYjyyeqDOfjXW1SFdGYRVo0mbOa d/27T08fDLd101zbkn+sfa4yrn5mfhKZgG+s80XkCaIR5eci4dIBGP89zci5+Ap3VOu2 BtNM8RCvj02+Te0goIea+AgE+73ptA9T7sJFgvP8ylbs1RtsNgs0+c9XURhCloZRvgPA fT+cZE0SfKKCqkl/pNuPuIWPU8v8KLVEitL8P9yRsdYtoRZxoFYoJ9GyWYqKUMogg60L 7qc7e87F24VnVpsh6NqT5atiFNqBRnwO94ApQgLea1zOCK5Au9mCCm1Pm5JZ3IFIcbcB M8vA== X-Gm-Message-State: APf1xPDNfrtWQtORtr3JI1Fm8/SP9HreKXwmO3Fve21AuIuh525Fo3ps n/f63JiPEo4Uz8khDBm6+iguX6ie3eOyyeXRQxi9Sg== X-Google-Smtp-Source: AG47ELujHZ4hv97o9XrhAC//VXhc8xtODtIN/CpkMqlqk+cnYI2bEllmnJrikgnMbU9NsWloz8Ia4R8fo2/lNWxp1oE= X-Received: by 10.13.219.79 with SMTP id d76mr398813ywe.182.1519886309325; Wed, 28 Feb 2018 22:38:29 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 2002:a25:c68c:0:0:0:0:0 with HTTP; Wed, 28 Feb 2018 22:37:58 -0800 (PST) In-Reply-To: <201803010636.w216af0m058238@repo.freebsd.org> References: <201803010636.w216af0m058238@repo.freebsd.org> From: Eitan Adler Date: Wed, 28 Feb 2018 22:37:58 -0800 X-Google-Sender-Auth: kIS91hhZXkuroyO3Ilf2D7leO80 Message-ID: Subject: Re: svn commit: r330204 - stable/11/sys/dev/iwm To: src-committers , svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-stable-11@freebsd.org X-Mailman-Version: 2.1.25 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, 01 Mar 2018 06:38:30 -0000 On 28 February 2018 at 22:36, Eitan Adler wrote: > Author: eadler > Date: Thu Mar 1 06:36:41 2018 > New Revision: 330204 > URL: https://svnweb.freebsd.org/changeset/base/330204 > > Log: > MFC r318214: This one is actually r318213, r318214, r318215 accidently. -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:38:43 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1BE21F29561; Thu, 1 Mar 2018 06:38:43 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E68016ABA1; Thu, 1 Mar 2018 06:38:42 +0000 (UTC) (envelope-from eadler@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 E152624DF7; Thu, 1 Mar 2018 06:38:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216cgVq058406; Thu, 1 Mar 2018 06:38:42 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216cgcb058405; Thu, 1 Mar 2018 06:38:42 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010638.w216cgcb058405@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:38: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: r330206 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330206 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.25 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, 01 Mar 2018 06:38:43 -0000 Author: eadler Date: Thu Mar 1 06:38:42 2018 New Revision: 330206 URL: https://svnweb.freebsd.org/changeset/base/330206 Log: MFC r318216: [iwm] Sync iwm_read_firmware()'s loop to iwlwifi's code. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:38:06 2018 (r330205) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:38:42 2018 (r330206) @@ -548,12 +548,14 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode { struct iwm_fw_info *fw = &sc->sc_fw; const struct iwm_tlv_ucode_header *uhdr; - struct iwm_ucode_tlv tlv; + const struct iwm_ucode_tlv *tlv; struct iwm_ucode_capabilities *capa = &sc->ucode_capa; enum iwm_ucode_tlv_type tlv_type; const struct firmware *fwp; const uint8_t *data; + uint32_t tlv_len; uint32_t usniffer_img; + const uint8_t *tlv_data; uint32_t paging_mem_size; int num_of_cpus; int error = 0; @@ -606,25 +608,21 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto out; } - snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%d.%d (API ver %d)", + snprintf(sc->sc_fwver, sizeof(sc->sc_fwver), "%u.%u (API ver %u)", IWM_UCODE_MAJOR(le32toh(uhdr->ver)), IWM_UCODE_MINOR(le32toh(uhdr->ver)), IWM_UCODE_API(le32toh(uhdr->ver))); data = uhdr->data; len = fw->fw_fp->datasize - sizeof(*uhdr); - while (len >= sizeof(tlv)) { - size_t tlv_len; - const void *tlv_data; + while (len >= sizeof(*tlv)) { + len -= sizeof(*tlv); + tlv = (const void *)data; - memcpy(&tlv, data, sizeof(tlv)); - tlv_len = le32toh(tlv.length); - tlv_type = le32toh(tlv.type); + tlv_len = le32toh(tlv->length); + tlv_type = le32toh(tlv->type); + tlv_data = tlv->data; - len -= sizeof(tlv); - data += sizeof(tlv); - tlv_data = data; - if (len < tlv_len) { device_printf(sc->sc_dev, "firmware too short: %zu bytes\n", @@ -632,19 +630,21 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } + len -= roundup2(tlv_len, 4); + data += sizeof(tlv) + roundup2(tlv_len, 4); switch ((int)tlv_type) { case IWM_UCODE_TLV_PROBE_MAX_LEN: - if (tlv_len < sizeof(uint32_t)) { + if (tlv_len != sizeof(uint32_t)) { device_printf(sc->sc_dev, - "%s: PROBE_MAX_LEN (%d) < sizeof(uint32_t)\n", + "%s: PROBE_MAX_LEN (%d) != sizeof(uint32_t)\n", __func__, (int) tlv_len); error = EINVAL; goto parse_out; } capa->max_probe_length = - le32toh(*(const uint32_t *)tlv_data); + le32_to_cpup((const uint32_t *)tlv_data); /* limit it to something sensible */ if (capa->max_probe_length > IWM_SCAN_OFFLOAD_PROBE_REQ_SIZE) { @@ -675,6 +675,14 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } + if (tlv_len % sizeof(uint32_t)) { + device_printf(sc->sc_dev, + "%s: IWM_UCODE_TLV_FLAGS: tlv_len (%d) %% sizeof(uint32_t)\n", + __func__, + (int) tlv_len); + error = EINVAL; + goto parse_out; + } /* * Apparently there can be many flags, but Linux driver * parses only the first one, and so do we. @@ -686,7 +694,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode * 2) TLV_FLAGS contains TLV_FLAGS_PAN * ==> this resets TLV_PAN to itself... hnnnk */ - capa->flags = le32toh(*(const uint32_t *)tlv_data); + capa->flags = le32_to_cpup((const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_CSCHEME: if ((error = iwm_store_cscheme(sc, @@ -707,7 +715,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - num_of_cpus = le32toh(*(const uint32_t *)tlv_data); + num_of_cpus = le32_to_cpup((const uint32_t *)tlv_data); if (num_of_cpus == 2) { fw->fw_sects[IWM_UCODE_REGULAR].is_dual_cpus = TRUE; @@ -781,7 +789,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } sc->sc_fw.phy_config = - le32toh(*(const uint32_t *)tlv_data); + le32_to_cpup((const uint32_t *)tlv_data); sc->sc_fw.valid_tx_ant = (sc->sc_fw.phy_config & IWM_FW_PHY_CFG_TX_CHAIN) >> IWM_FW_PHY_CFG_TX_CHAIN_POS; @@ -832,7 +840,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - paging_mem_size = le32toh(*(const uint32_t *)tlv_data); + paging_mem_size = le32_to_cpup((const uint32_t *)tlv_data); IWM_DPRINTF(sc, IWM_DEBUG_FIRMWARE_TLV, "%s: Paging: paging enabled (size = %u bytes)\n", @@ -865,7 +873,7 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode goto parse_out; } capa->n_scan_channels = - le32toh(*(const uint32_t *)tlv_data); + le32_to_cpup((const uint32_t *)tlv_data); break; case IWM_UCODE_TLV_FW_VERSION: @@ -890,9 +898,6 @@ iwm_read_firmware(struct iwm_softc *sc, enum iwm_ucode error = EINVAL; goto parse_out; } - - len -= roundup(tlv_len, 4); - data += roundup(tlv_len, 4); } KASSERT(error == 0, ("unhandled error")); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:39:15 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 824CAF29651; Thu, 1 Mar 2018 06:39:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 31B9E6AD62; Thu, 1 Mar 2018 06:39:15 +0000 (UTC) (envelope-from eadler@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 2CC0D24DFA; Thu, 1 Mar 2018 06:39:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216dFLD058474; Thu, 1 Mar 2018 06:39:15 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216dF2a058473; Thu, 1 Mar 2018 06:39:15 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010639.w216dF2a058473@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:39: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: r330207 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330207 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.25 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, 01 Mar 2018 06:39:15 -0000 Author: eadler Date: Thu Mar 1 06:39:14 2018 New Revision: 330207 URL: https://svnweb.freebsd.org/changeset/base/330207 Log: MFC r318217: [iwm] Change UCODE_TLV_API #define-s from bitmasks to indexes. * Fixes oversight from commit 757eecf0e6c92745aa2eee95811e573c8300850e. fw_has_api now uses the isset macro instead of a simple logical-and. Modified: stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:38:42 2018 (r330206) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:39:14 2018 (r330207) @@ -669,12 +669,12 @@ P2P_PS_SCM\31UAPSD_SUPPORT\32EBS\33P2P_PS_UAPSD\36BCAS * @IWM_NUM_UCODE_TLV_API: number of bits used */ enum iwm_ucode_tlv_api { - IWM_UCODE_TLV_API_FRAGMENTED_SCAN = (1 << 8), - IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = (1 << 9), - IWM_UCODE_TLV_API_WIDE_CMD_HDR = (1 << 14), - IWM_UCODE_TLV_API_LQ_SS_PARAMS = (1 << 18), - IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = (1 << 24), - IWM_UCODE_TLV_API_TX_POWER_CHAIN = (1 << 27), + IWM_UCODE_TLV_API_FRAGMENTED_SCAN = 8, + IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = 9, + IWM_UCODE_TLV_API_WIDE_CMD_HDR = 14, + IWM_UCODE_TLV_API_LQ_SS_PARAMS = 18, + IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = 24, + IWM_UCODE_TLV_API_TX_POWER_CHAIN = 27, IWM_NUM_UCODE_TLV_API = 32 }; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:39:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 18FF2F296E8; Thu, 1 Mar 2018 06:39:45 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C06E66AF08; Thu, 1 Mar 2018 06:39:44 +0000 (UTC) (envelope-from eadler@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 BB49524DFC; Thu, 1 Mar 2018 06:39:44 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216dinc058538; Thu, 1 Mar 2018 06:39:44 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216dik6058535; Thu, 1 Mar 2018 06:39:44 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010639.w216dik6058535@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:39:44 +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: r330208 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330208 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.25 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, 01 Mar 2018 06:39:45 -0000 Author: eadler Date: Thu Mar 1 06:39:44 2018 New Revision: 330208 URL: https://svnweb.freebsd.org/changeset/base/330208 Log: MFC r318218: [iwm] Process multiple frames per RX buffer. * Factor out iwm_handle_rxb() function from iwm_notif_intr(). * Removing the IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK flag allows the device to put multiple frames (both command responses and 80211 frames) into a single RX buffer. * Uses m_copym() to split up the receive buffers when multiple 80211 frames are received in one RX buffer. The effect is basically the same as when using m_split(), but we want to keep the original mbuf around when calling iwm_mvm_rx_rx_mpdu() to make error handling a bit easier for now. * Contains a small optimization to avoid the m_copym() when only a single 80211 frame is received in one RX buffer (i.e. matching the existing behaviour). Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:39:14 2018 (r330207) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:39:44 2018 (r330208) @@ -168,6 +168,9 @@ __FBSDID("$FreeBSD$"); #include #include +/* From DragonflyBSD */ +#define mtodoff(m, t, off) ((t)((m)->m_data + (off))) + const uint8_t iwm_nvm_channels[] = { /* 2.4 GHz */ 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, @@ -319,16 +322,15 @@ static int iwm_rx_addbuf(struct iwm_softc *, int, int) static int iwm_mvm_get_signal_strength(struct iwm_softc *, struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, - struct iwm_rx_packet *, - struct iwm_rx_data *); + struct iwm_rx_packet *); static int iwm_get_noise(struct iwm_softc *sc, const struct iwm_mvm_statistics_rx_non_phy *); -static void iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *); +static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *, + uint32_t, boolean_t); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, struct iwm_rx_packet *, struct iwm_node *); -static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *, - struct iwm_rx_data *); +static void iwm_mvm_rx_tx_cmd(struct iwm_softc *, struct iwm_rx_packet *); static void iwm_cmd_done(struct iwm_softc *, struct iwm_rx_packet *); #if 0 static void iwm_update_sched(struct iwm_softc *, int, int, uint8_t, @@ -384,6 +386,7 @@ static const char * static void iwm_nic_error(struct iwm_softc *); static void iwm_nic_umac_error(struct iwm_softc *); #endif +static void iwm_handle_rxb(struct iwm_softc *, struct mbuf *); static void iwm_notif_intr(struct iwm_softc *); static void iwm_intr(void *); static int iwm_attach(device_t); @@ -1431,14 +1434,21 @@ iwm_nic_rx_init(struct iwm_softc *sc) IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_STTS_WPTR_REG, sc->rxq.stat_dma.paddr >> 4); - /* Enable RX. */ + /* Enable Rx DMA + * XXX 5000 HW isn't supported by the iwm(4) driver. + * IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY is set because of HW bug in + * the credit mechanism in 5000 HW RX FIFO + * Direct rx interrupts to hosts + * Rx buffer size 4 or 8k or 12k + * RB timeout 0x10 + * 256 RBDs + */ IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL | IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY | /* HW bug */ IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | - IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK | - (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K | + (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | IWM_RX_QUEUE_SIZE_LOG << IWM_FH_RCSR_RX_CONFIG_RBDCB_SIZE_POS); IWM_WRITE_1(sc, IWM_CSR_INT_COALESCING, IWM_HOST_INT_TIMEOUT_DEF); @@ -3125,13 +3135,11 @@ iwm_mvm_get_signal_strength(struct iwm_softc *sc, stru } static void -iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, - struct iwm_rx_packet *pkt, struct iwm_rx_data *data) +iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_rx_phy_info *phy_info = (void *)pkt->data; IWM_DPRINTF(sc, IWM_DEBUG_RECV, "received PHY stats\n"); - bus_dmamap_sync(sc->rxq.data_dmat, data->map, BUS_DMASYNC_POSTREAD); memcpy(&sc->sc_last_phy_info, phy_info, sizeof(sc->sc_last_phy_info)); } @@ -3175,8 +3183,9 @@ iwm_get_noise(struct iwm_softc *sc, * * Handles the actual data of the Rx packet from the fw */ -static void -iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m) +static boolean_t +iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf *m, uint32_t offset, + boolean_t stolen) { struct ieee80211com *ic = &sc->sc_ic; struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -3185,7 +3194,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * struct ieee80211_rx_stats rxs; struct iwm_rx_phy_info *phy_info; struct iwm_rx_mpdu_res_start *rx_res; - struct iwm_rx_packet *pkt = mtod(m, struct iwm_rx_packet *); + struct iwm_rx_packet *pkt = mtodoff(m, struct iwm_rx_packet *, offset); uint32_t len; uint32_t rx_pkt_status; int rssi; @@ -3216,7 +3225,7 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * rssi = rssi - sc->sc_noise; /* replenish ring for the buffer we're going to feed to the sharks */ - if (iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { + if (!stolen && iwm_rx_addbuf(sc, IWM_RBUF_SIZE, sc->rxq.cur) != 0) { device_printf(sc->sc_dev, "%s: unable to add more buffers\n", __func__); goto fail; @@ -3296,9 +3305,10 @@ iwm_mvm_rx_rx_mpdu(struct iwm_softc *sc, struct mbuf * } IWM_LOCK(sc); - return; + return TRUE; fail: counter_u64_add(ic->ic_ierrors, 1); + return FALSE; } static int @@ -3338,8 +3348,7 @@ iwm_mvm_rx_tx_cmd_single(struct iwm_softc *sc, struct } static void -iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, - struct iwm_rx_packet *pkt, struct iwm_rx_data *data) +iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, struct iwm_rx_packet *pkt) { struct iwm_cmd_header *cmd_hdr = &pkt->hdr; int idx = cmd_hdr->idx; @@ -3354,8 +3363,6 @@ iwm_mvm_rx_tx_cmd(struct iwm_softc *sc, KASSERT(txd->in != NULL, ("txd without node")); KASSERT(txd->m != NULL, ("txd without mbuf")); - bus_dmamap_sync(ring->data_dmat, data->map, BUS_DMASYNC_POSTREAD); - sc->sc_tx_timer = 0; status = iwm_mvm_rx_tx_cmd_single(sc, pkt, in); @@ -5358,68 +5365,95 @@ iwm_nic_error(struct iwm_softc *sc) } #endif -#define ADVANCE_RXQ(sc) (sc->rxq.cur = (sc->rxq.cur + 1) % IWM_RX_RING_COUNT); - -/* - * Process an IWM_CSR_INT_BIT_FH_RX or IWM_CSR_INT_BIT_SW_RX interrupt. - * Basic structure from if_iwn - */ static void -iwm_notif_intr(struct iwm_softc *sc) +iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) { struct ieee80211com *ic = &sc->sc_ic; - uint16_t hw; + struct iwm_cmd_response *cresp; + struct mbuf *m1; + uint32_t offset = 0; + uint32_t maxoff = IWM_RBUF_SIZE; + uint32_t nextoff; + boolean_t stolen = FALSE; - bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map, - BUS_DMASYNC_POSTREAD); +#define HAVEROOM(a) \ + ((a) + sizeof(uint32_t) + sizeof(struct iwm_cmd_header) < maxoff) - hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff; + while (HAVEROOM(offset)) { + struct iwm_rx_packet *pkt = mtodoff(m, struct iwm_rx_packet *, + offset); + int qid, idx, code, len; - /* - * Process responses - */ - while (sc->rxq.cur != hw) { - struct iwm_rx_ring *ring = &sc->rxq; - struct iwm_rx_data *data = &ring->data[ring->cur]; - struct iwm_rx_packet *pkt; - struct iwm_cmd_response *cresp; - int qid, idx, code; - - bus_dmamap_sync(ring->data_dmat, data->map, - BUS_DMASYNC_POSTREAD); - pkt = mtod(data->m, struct iwm_rx_packet *); - - qid = pkt->hdr.qid & ~0x80; + qid = pkt->hdr.qid; idx = pkt->hdr.idx; code = IWM_WIDE_ID(pkt->hdr.flags, pkt->hdr.code); - IWM_DPRINTF(sc, IWM_DEBUG_INTR, - "rx packet qid=%d idx=%d type=%x %d %d\n", - pkt->hdr.qid & ~0x80, pkt->hdr.idx, code, ring->cur, hw); /* * randomly get these from the firmware, no idea why. * they at least seem harmless, so just ignore them for now */ - if (__predict_false((pkt->hdr.code == 0 && qid == 0 && idx == 0) - || pkt->len_n_flags == htole32(0x55550000))) { - ADVANCE_RXQ(sc); - continue; + if ((pkt->hdr.code == 0 && (qid & ~0x80) == 0 && idx == 0) || + pkt->len_n_flags == htole32(IWM_FH_RSCSR_FRAME_INVALID)) { + break; } + IWM_DPRINTF(sc, IWM_DEBUG_INTR, + "rx packet qid=%d idx=%d type=%x\n", + qid & ~0x80, pkt->hdr.idx, code); + + len = le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK; + len += sizeof(uint32_t); /* account for status word */ + nextoff = offset + roundup2(len, IWM_FH_RSCSR_FRAME_ALIGN); + iwm_notification_wait_notify(sc->sc_notif_wait, code, pkt); switch (code) { case IWM_REPLY_RX_PHY_CMD: - iwm_mvm_rx_rx_phy_cmd(sc, pkt, data); + iwm_mvm_rx_rx_phy_cmd(sc, pkt); break; - case IWM_REPLY_RX_MPDU_CMD: - iwm_mvm_rx_rx_mpdu(sc, data->m); + case IWM_REPLY_RX_MPDU_CMD: { + /* + * If this is the last frame in the RX buffer, we + * can directly feed the mbuf to the sharks here. + */ + struct iwm_rx_packet *nextpkt = mtodoff(m, + struct iwm_rx_packet *, nextoff); + if (!HAVEROOM(nextoff) || + (nextpkt->hdr.code == 0 && + (nextpkt->hdr.qid & ~0x80) == 0 && + nextpkt->hdr.idx == 0) || + (nextpkt->len_n_flags == + htole32(IWM_FH_RSCSR_FRAME_INVALID))) { + if (iwm_mvm_rx_rx_mpdu(sc, m, offset, stolen)) { + stolen = FALSE; + /* Make sure we abort the loop */ + nextoff = maxoff; + } + break; + } + + /* + * Use m_copym instead of m_split, because that + * makes it easier to keep a valid rx buffer in + * the ring, when iwm_mvm_rx_rx_mpdu() fails. + * + * We need to start m_copym() at offset 0, to get the + * M_PKTHDR flag preserved. + */ + m1 = m_copym(m, 0, M_COPYALL, M_NOWAIT); + if (m1) { + if (iwm_mvm_rx_rx_mpdu(sc, m1, offset, stolen)) + stolen = TRUE; + else + m_freem(m1); + } break; + } case IWM_TX_CMD: - iwm_mvm_rx_tx_cmd(sc, pkt, data); + iwm_mvm_rx_tx_cmd(sc, pkt); break; case IWM_MISSED_BEACONS_NOTIFICATION: { @@ -5480,7 +5514,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: - if (sc->sc_wantresp == ((qid << 16) | idx)) { + if (sc->sc_wantresp == (((qid & ~0x80) << 16) | idx)) { memcpy(sc->sc_cmd_resp, pkt, sizeof(sc->sc_cmd_resp)); } @@ -5540,7 +5574,7 @@ iwm_notif_intr(struct iwm_softc *sc) case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: cresp = (void *)pkt->data; - if (sc->sc_wantresp == ((qid << 16) | idx)) { + if (sc->sc_wantresp == (((qid & ~0x80) << 16) | idx)) { memcpy(sc->sc_cmd_resp, pkt, sizeof(*pkt)+sizeof(*cresp)); } @@ -5634,7 +5668,7 @@ iwm_notif_intr(struct iwm_softc *sc) default: device_printf(sc->sc_dev, "frame %d/%d %x UNHANDLED (this should " - "not happen)\n", qid, idx, + "not happen)\n", qid & ~0x80, idx, pkt->len_n_flags); break; } @@ -5653,20 +5687,55 @@ iwm_notif_intr(struct iwm_softc *sc) * uses a slightly different format for pkt->hdr, and "qid" * is actually the upper byte of a two-byte field. */ - if (!(pkt->hdr.qid & (1 << 7))) { + if (!(qid & (1 << 7))) iwm_cmd_done(sc, pkt); - } - ADVANCE_RXQ(sc); + offset = nextoff; } + if (stolen) + m_freem(m); +#undef HAVEROOM +} +/* + * Process an IWM_CSR_INT_BIT_FH_RX or IWM_CSR_INT_BIT_SW_RX interrupt. + * Basic structure from if_iwn + */ +static void +iwm_notif_intr(struct iwm_softc *sc) +{ + uint16_t hw; + + bus_dmamap_sync(sc->rxq.stat_dma.tag, sc->rxq.stat_dma.map, + BUS_DMASYNC_POSTREAD); + + hw = le16toh(sc->rxq.stat->closed_rb_num) & 0xfff; + /* - * Tell the firmware what we have processed. + * Process responses + */ + while (sc->rxq.cur != hw) { + struct iwm_rx_ring *ring = &sc->rxq; + struct iwm_rx_data *data = &ring->data[ring->cur]; + + bus_dmamap_sync(ring->data_dmat, data->map, + BUS_DMASYNC_POSTREAD); + + IWM_DPRINTF(sc, IWM_DEBUG_INTR, + "%s: hw = %d cur = %d\n", __func__, hw, ring->cur); + iwm_handle_rxb(sc, data->m); + + ring->cur = (ring->cur + 1) % IWM_RX_RING_COUNT; + } + + /* + * Tell the firmware that it can reuse the ring entries that + * we have just processed. * Seems like the hardware gets upset unless we align * the write by 8?? */ hw = (hw == 0) ? IWM_RX_RING_COUNT - 1 : hw - 1; - IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, hw & ~7); + IWM_WRITE(sc, IWM_FH_RSCSR_CHNL0_WPTR, rounddown2(hw, 8)); } static void Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:39:14 2018 (r330207) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:39:44 2018 (r330208) @@ -5972,16 +5972,9 @@ struct iwm_dts_measurement_notif_v2 { #define IWM_FRAME_LIMIT 64 /* - * From Linux commit ab02165ccec4c78162501acedeef1a768acdb811: - * As the firmware is slowly running out of command IDs and grouping of - * commands is desirable anyway, the firmware is extending the command - * header from 4 bytes to 8 bytes to introduce a group (in place of the - * former flags field, since that's always 0 on commands and thus can - * be easily used to distinguish between the two). - * * These functions retrieve specific information from the id field in * the iwm_host_cmd struct which contains the command id, the group id, - * and the version of the command. + * and the version of the command and vice versa. */ static inline uint8_t iwm_cmd_opcode(uint32_t cmdid) @@ -5992,7 +5985,7 @@ iwm_cmd_opcode(uint32_t cmdid) static inline uint8_t iwm_cmd_groupid(uint32_t cmdid) { - return ((cmdid & 0Xff00) >> 8); + return ((cmdid & 0xff00) >> 8); } static inline uint8_t @@ -6085,6 +6078,8 @@ struct iwm_rx_packet { } __packed; #define IWM_FH_RSCSR_FRAME_SIZE_MSK 0x00003fff +#define IWM_FH_RSCSR_FRAME_INVALID 0x55550000 +#define IWM_FH_RSCSR_FRAME_ALIGN 0x40 static inline uint32_t iwm_rx_packet_len(const struct iwm_rx_packet *pkt) Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:39:14 2018 (r330207) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:39:44 2018 (r330208) @@ -304,7 +304,6 @@ struct iwm_tx_ring { }; #define IWM_RX_RING_COUNT 256 -#define IWM_RBUF_COUNT (IWM_RX_RING_COUNT + 32) /* Linux driver optionally uses 8k buffer */ #define IWM_RBUF_SIZE 4096 From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:40:09 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 02F99F297DB; Thu, 1 Mar 2018 06:40:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A3F216B09C; Thu, 1 Mar 2018 06:40:08 +0000 (UTC) (envelope-from eadler@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 9E79A24E05; Thu, 1 Mar 2018 06:40:08 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216e8Nu058636; Thu, 1 Mar 2018 06:40:08 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216e81c058632; Thu, 1 Mar 2018 06:40:08 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010640.w216e81c058632@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:40:08 +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: r330209 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330209 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.25 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, 01 Mar 2018 06:40:09 -0000 Author: eadler Date: Thu Mar 1 06:40:08 2018 New Revision: 330209 URL: https://svnweb.freebsd.org/changeset/base/330209 Log: MFC r318219: [iwm] Properly implement iwm_wme_update callback function. * Inspired by iwn(4) and Linux iwlwifi. * Read wme parameters into a buffer within struct iwm_vap in iwm_wme_update(). * If we aren't associated yet, the new settings will soon be sent by iwm_mvm_mac_ctxt_changed() during association. * If we are already associated, explicitly call iwm_mvm_mac_ctxt_changed() from iwm_wme_update() to send the new settings to the firmware. * Change iwm_mvm_ac_to_tx_fifo mapping, to fit the freebsd net80211 WME stream class numbering, instead of Linux's enum ieee80211_ac_numbers. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:40:08 2018 (r330209) @@ -1532,13 +1532,6 @@ iwm_nic_init(struct iwm_softc *sc) return 0; } -const uint8_t iwm_mvm_ac_to_tx_fifo[] = { - IWM_MVM_TX_FIFO_VO, - IWM_MVM_TX_FIFO_VI, - IWM_MVM_TX_FIFO_BE, - IWM_MVM_TX_FIFO_BK, -}; - static int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo) { @@ -4242,7 +4235,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * from RUN back to SCAN is: * * iwm_mvm_power_mac_disable(sc, in); - * iwm_mvm_mac_ctxt_changed(sc, in); + * iwm_mvm_mac_ctxt_changed(sc, vap); * iwm_mvm_rm_sta(sc, in); * iwm_mvm_update_quotas(sc, NULL); * iwm_mvm_mac_ctxt_changed(sc, in); @@ -4279,7 +4272,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) iwm_mvm_power_mac_disable(sc, in); - if ((error = iwm_mvm_mac_ctxt_changed(sc, in)) != 0) { + if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "mac ctxt change fail 1 %d\n", error); return error; } @@ -4291,7 +4284,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) error = iwm_mvm_rm_sta(sc, in); in->in_assoc = 0; iwm_mvm_update_quotas(sc, NULL); - if ((error = iwm_mvm_mac_ctxt_changed(sc, in)) != 0) { + if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { device_printf(sc->sc_dev, "mac ctxt change fail 2 %d\n", error); return error; } @@ -6244,12 +6237,47 @@ iwm_is_valid_ether_addr(uint8_t *addr) } static int -iwm_update_edca(struct ieee80211com *ic) +iwm_wme_update(struct ieee80211com *ic) { +#define IWM_EXP2(x) ((1 << (x)) - 1) /* CWmin = 2^ECWmin - 1 */ struct iwm_softc *sc = ic->ic_softc; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); + struct iwm_vap *ivp = IWM_VAP(vap); + struct iwm_node *in; + struct wmeParams tmp[WME_NUM_AC]; + int aci, error; - device_printf(sc->sc_dev, "%s: called\n", __func__); + if (vap == NULL) + return (0); + + IEEE80211_LOCK(ic); + for (aci = 0; aci < WME_NUM_AC; aci++) + tmp[aci] = ic->ic_wme.wme_chanParams.cap_wmeParams[aci]; + IEEE80211_UNLOCK(ic); + + IWM_LOCK(sc); + for (aci = 0; aci < WME_NUM_AC; aci++) { + const struct wmeParams *ac = &tmp[aci]; + ivp->queue_params[aci].aifsn = ac->wmep_aifsn; + ivp->queue_params[aci].cw_min = IWM_EXP2(ac->wmep_logcwmin); + ivp->queue_params[aci].cw_max = IWM_EXP2(ac->wmep_logcwmax); + ivp->queue_params[aci].edca_txop = + IEEE80211_TXOP_TO_US(ac->wmep_txopLimit); + } + ivp->have_wme = TRUE; + if (ivp->is_uploaded && vap->iv_bss != NULL) { + in = IWM_NODE(vap->iv_bss); + if (in->in_assoc) { + if ((error = iwm_mvm_mac_ctxt_changed(sc, vap)) != 0) { + device_printf(sc->sc_dev, + "%s: failed to update MAC\n", __func__); + } + } + } + IWM_UNLOCK(sc); + return (0); +#undef IWM_EXP2 } static void @@ -6306,7 +6334,7 @@ iwm_preinit(void *arg) ic->ic_set_channel = iwm_set_channel; ic->ic_scan_curchan = iwm_scan_curchan; ic->ic_scan_mindwell = iwm_scan_mindwell; - ic->ic_wme.wme_update = iwm_update_edca; + ic->ic_wme.wme_update = iwm_wme_update; ic->ic_parent = iwm_parent; ic->ic_transmit = iwm_transmit; iwm_radiotap_attach(sc); @@ -6363,6 +6391,8 @@ iwm_vap_create(struct ieee80211com *ic, const char nam ivp->id = IWM_DEFAULT_MACID; ivp->color = IWM_DEFAULT_COLOR; + + ivp->have_wme = FALSE; ieee80211_ratectl_init(vap); /* Complete setup. */ Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.c Thu Mar 1 06:40:08 2018 (r330209) @@ -160,6 +160,13 @@ __FBSDID("$FreeBSD$"); * BEGIN mvm/mac-ctxt.c */ +const uint8_t iwm_mvm_ac_to_tx_fifo[] = { + IWM_MVM_TX_FIFO_BE, + IWM_MVM_TX_FIFO_BK, + IWM_MVM_TX_FIFO_VI, + IWM_MVM_TX_FIFO_VO, +}; + static void iwm_mvm_ack_rates(struct iwm_softc *sc, int is2ghz, int *cck_rates, int *ofdm_rates, struct iwm_node *in) @@ -328,16 +335,19 @@ iwm_mvm_mac_ctxt_cmd_common(struct iwm_softc *sc, stru * cmd->qos_flags |= cpu_to_le32(MAC_QOS_FLG_UPDATE_EDCA) */ - /* XXX TODO: set wme parameters; also handle getting updated wme parameters */ - for (i = 0; i < IWM_AC_NUM+1; i++) { - int txf = i; + for (i = 0; i < WME_NUM_AC; i++) { + uint8_t txf = iwm_mvm_ac_to_tx_fifo[i]; - cmd->ac[txf].cw_min = htole16(0x0f); - cmd->ac[txf].cw_max = htole16(0x3f); - cmd->ac[txf].aifsn = 1; + cmd->ac[txf].cw_min = htole16(ivp->queue_params[i].cw_min); + cmd->ac[txf].cw_max = htole16(ivp->queue_params[i].cw_max); + cmd->ac[txf].edca_txop = + htole16(ivp->queue_params[i].edca_txop); + cmd->ac[txf].aifsn = ivp->queue_params[i].aifsn; cmd->ac[txf].fifos_mask = (1 << txf); - cmd->ac[txf].edca_txop = 0; } + + if (ivp->have_wme) + cmd->qos_flags |= htole32(IWM_MAC_QOS_FLG_UPDATE_EDCA); if (ic->ic_flags & IEEE80211_F_USEPROT) cmd->protection_flags |= htole32(IWM_MAC_PROT_FLG_TGG_PROTECT); Modified: stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwm_mac_ctxt.h Thu Mar 1 06:40:08 2018 (r330209) @@ -106,6 +106,8 @@ #ifndef __IF_IWM_MAC_CTXT_H__ #define __IF_IWM_MAC_CTXT_H__ +extern const uint8_t iwm_mvm_ac_to_tx_fifo[]; + extern int iwm_mvm_mac_ctxt_add(struct iwm_softc *sc, struct ieee80211vap *vap); extern int iwm_mvm_mac_ctxt_changed(struct iwm_softc *sc, struct ieee80211vap *vap); extern int iwm_mvm_mac_ctxt_remove(struct iwm_softc *sc, struct ieee80211vap *vap); Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:39:44 2018 (r330208) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:40:08 2018 (r330209) @@ -377,6 +377,19 @@ struct iwm_vap { uint16_t id; uint16_t color; + + boolean_t have_wme; + /* + * QoS data from net80211, need to store this here + * as net80211 has a separate callback but we need + * to have the data for the MAC context + */ + struct { + uint16_t cw_min; + uint16_t cw_max; + uint16_t edca_txop; + uint8_t aifsn; + } queue_params[WME_NUM_AC]; }; #define IWM_VAP(_vap) ((struct iwm_vap *)(_vap)) From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:41:36 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A0F7F29AF9; Thu, 1 Mar 2018 06:41:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1648C6B5C6; Thu, 1 Mar 2018 06:41:36 +0000 (UTC) (envelope-from eadler@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 10F0624E58; Thu, 1 Mar 2018 06:41:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216fa4n059433; Thu, 1 Mar 2018 06:41:36 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216fZAX059427; Thu, 1 Mar 2018 06:41:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010641.w216fZAX059427@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:41: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: r330210 - in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf dev/iwm modules/iwm X-SVN-Commit-Revision: 330210 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.25 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, 01 Mar 2018 06:41:36 -0000 Author: eadler Date: Thu Mar 1 06:41:35 2018 New Revision: 330210 URL: https://svnweb.freebsd.org/changeset/base/330210 Log: MFC r318222: [iwm] Factor out firmware station handling into if_iwm_sta.c. * This adds iwm_mvm_rm_sta(), which will be used to tear down firmware state for better/cleaner iwm_newstate() handling. * Makes iwm_enable_txq() and iwm_mvm_flush_tx_path() non-static, add the declarations to if_iwm_util.h for now. Added: stable/11/sys/dev/iwm/if_iwm_sta.c - copied unchanged from r318222, head/sys/dev/iwm/if_iwm_sta.c stable/11/sys/dev/iwm/if_iwm_sta.h - copied unchanged from r318222, head/sys/dev/iwm/if_iwm_sta.h Modified: stable/11/sys/conf/files stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_util.h stable/11/sys/modules/iwm/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/conf/files Thu Mar 1 06:41:35 2018 (r330210) @@ -1881,6 +1881,7 @@ dev/iwm/if_iwm_phy_ctxt.c optional iwm dev/iwm/if_iwm_phy_db.c optional iwm dev/iwm/if_iwm_power.c optional iwm dev/iwm/if_iwm_scan.c optional iwm +dev/iwm/if_iwm_sta.c optional iwm dev/iwm/if_iwm_time_event.c optional iwm dev/iwm/if_iwm_util.c optional iwm iwm3160fw.c optional iwm3160fw | iwmfw \ Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:41:35 2018 (r330210) @@ -163,6 +163,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -264,7 +265,6 @@ static void iwm_mvm_nic_config(struct iwm_softc *); static int iwm_nic_rx_init(struct iwm_softc *); static int iwm_nic_tx_init(struct iwm_softc *); static int iwm_nic_init(struct iwm_softc *); -static int iwm_enable_txq(struct iwm_softc *, int, int, int); static int iwm_trans_pcie_fw_alive(struct iwm_softc *, uint32_t); static int iwm_nvm_read_chunk(struct iwm_softc *, uint16_t, uint16_t, uint16_t, uint8_t *, uint16_t *); @@ -343,19 +343,6 @@ static int iwm_tx(struct iwm_softc *, struct mbuf *, struct ieee80211_node *, int); static int iwm_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); -static int iwm_mvm_flush_tx_path(struct iwm_softc *sc, - uint32_t tfd_msk, uint32_t flags); -static int iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *, - struct iwm_mvm_add_sta_cmd *, - int *); -static int iwm_mvm_sta_send_to_fw(struct iwm_softc *, struct iwm_node *, - int); -static int iwm_mvm_add_sta(struct iwm_softc *, struct iwm_node *); -static int iwm_mvm_update_sta(struct iwm_softc *, struct iwm_node *); -static int iwm_mvm_add_int_sta_common(struct iwm_softc *, - struct iwm_int_sta *, - const uint8_t *, uint16_t, uint16_t); -static int iwm_mvm_add_aux_sta(struct iwm_softc *); static int iwm_mvm_update_quotas(struct iwm_softc *, struct iwm_vap *); static int iwm_auth(struct ieee80211vap *, struct iwm_softc *); static int iwm_assoc(struct ieee80211vap *, struct iwm_softc *); @@ -1532,7 +1519,7 @@ iwm_nic_init(struct iwm_softc *sc) return 0; } -static int +int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo) { if (!iwm_nic_lock(sc)) { @@ -3867,137 +3854,6 @@ iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t t "Flushing tx queue failed: %d\n", ret); return ret; } - -/* - * BEGIN mvm/sta.c - */ - -static int -iwm_mvm_send_add_sta_cmd_status(struct iwm_softc *sc, - struct iwm_mvm_add_sta_cmd *cmd, int *status) -{ - return iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, sizeof(*cmd), - cmd, status); -} - -/* send station add/update command to firmware */ -static int -iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, int update) -{ - struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); - struct iwm_mvm_add_sta_cmd add_sta_cmd; - int ret; - uint32_t status; - - memset(&add_sta_cmd, 0, sizeof(add_sta_cmd)); - - add_sta_cmd.sta_id = IWM_STATION_ID; - add_sta_cmd.mac_id_n_color - = htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); - if (!update) { - int ac; - for (ac = 0; ac < WME_NUM_AC; ac++) { - add_sta_cmd.tfd_queue_msk |= - htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); - } - IEEE80211_ADDR_COPY(&add_sta_cmd.addr, in->in_ni.ni_bssid); - } - add_sta_cmd.add_modify = update ? 1 : 0; - add_sta_cmd.station_flags_msk - |= htole32(IWM_STA_FLG_FAT_EN_MSK | IWM_STA_FLG_MIMO_EN_MSK); - add_sta_cmd.tid_disable_tx = htole16(0xffff); - if (update) - add_sta_cmd.modify_mask |= (IWM_STA_MODIFY_TID_DISABLE_TX); - - status = IWM_ADD_STA_SUCCESS; - ret = iwm_mvm_send_add_sta_cmd_status(sc, &add_sta_cmd, &status); - if (ret) - return ret; - - switch (status & IWM_ADD_STA_STATUS_MASK) { - case IWM_ADD_STA_SUCCESS: - break; - default: - ret = EIO; - device_printf(sc->sc_dev, "IWM_ADD_STA failed\n"); - break; - } - - return ret; -} - -static int -iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in) -{ - return iwm_mvm_sta_send_to_fw(sc, in, 0); -} - -static int -iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in) -{ - return iwm_mvm_sta_send_to_fw(sc, in, 1); -} - -static int -iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, - const uint8_t *addr, uint16_t mac_id, uint16_t color) -{ - struct iwm_mvm_add_sta_cmd cmd; - int ret; - uint32_t status; - - memset(&cmd, 0, sizeof(cmd)); - cmd.sta_id = sta->sta_id; - cmd.mac_id_n_color = htole32(IWM_FW_CMD_ID_AND_COLOR(mac_id, color)); - - cmd.tfd_queue_msk = htole32(sta->tfd_queue_msk); - cmd.tid_disable_tx = htole16(0xffff); - - if (addr) - IEEE80211_ADDR_COPY(cmd.addr, addr); - - ret = iwm_mvm_send_add_sta_cmd_status(sc, &cmd, &status); - if (ret) - return ret; - - switch (status & IWM_ADD_STA_STATUS_MASK) { - case IWM_ADD_STA_SUCCESS: - IWM_DPRINTF(sc, IWM_DEBUG_RESET, - "%s: Internal station added.\n", __func__); - return 0; - default: - device_printf(sc->sc_dev, - "%s: Add internal station failed, status=0x%x\n", - __func__, status); - ret = EIO; - break; - } - return ret; -} - -static int -iwm_mvm_add_aux_sta(struct iwm_softc *sc) -{ - int ret; - - sc->sc_aux_sta.sta_id = IWM_AUX_STA_ID; - sc->sc_aux_sta.tfd_queue_msk = (1 << IWM_MVM_AUX_QUEUE); - - ret = iwm_enable_txq(sc, 0, IWM_MVM_AUX_QUEUE, IWM_MVM_TX_FIFO_MCAST); - if (ret) - return ret; - - ret = iwm_mvm_add_int_sta_common(sc, - &sc->sc_aux_sta, NULL, IWM_MAC_INDEX_AUX, 0); - - if (ret) - memset(&sc->sc_aux_sta, 0, sizeof(sc->sc_aux_sta)); - return ret; -} - -/* - * END mvm/sta.c - */ /* * BEGIN mvm/quota.c Copied: stable/11/sys/dev/iwm/if_iwm_sta.c (from r318222, head/sys/dev/iwm/if_iwm_sta.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:41:35 2018 (r330210, copy of r318222, head/sys/dev/iwm/if_iwm_sta.c) @@ -0,0 +1,378 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2015 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH + * Copyright(c) 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +#include +__FBSDID("$FreeBSD$"); + +#include "opt_wlan.h" +#include "opt_iwm.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +#include + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +/* + * New version of ADD_STA_sta command added new fields at the end of the + * structure, so sending the size of the relevant API's structure is enough to + * support both API versions. + */ +static inline int +iwm_mvm_add_sta_cmd_size(struct iwm_softc *sc) +{ +#ifdef notyet + return iwm_mvm_has_new_rx_api(mvm) ? + sizeof(struct iwm_mvm_add_sta_cmd) : + sizeof(struct iwm_mvm_add_sta_cmd_v7); +#else + return sizeof(struct iwm_mvm_add_sta_cmd); +#endif +} + +/* send station add/update command to firmware */ +int +iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, + boolean_t update) +{ + struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); + struct iwm_mvm_add_sta_cmd add_sta_cmd = { + .sta_id = IWM_STATION_ID, + .mac_id_n_color = + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)), + .add_modify = update ? 1 : 0, + .station_flags_msk = htole32(IWM_STA_FLG_FAT_EN_MSK | + IWM_STA_FLG_MIMO_EN_MSK), + .tid_disable_tx = htole16(0xffff), + }; + int ret; + uint32_t status; + uint32_t agg_size = 0, mpdu_dens = 0; + + if (!update) { + int ac; + for (ac = 0; ac < WME_NUM_AC; ac++) { + add_sta_cmd.tfd_queue_msk |= + htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); + } + IEEE80211_ADDR_COPY(&add_sta_cmd.addr, in->in_ni.ni_bssid); + } + + add_sta_cmd.station_flags |= + htole32(agg_size << IWM_STA_FLG_MAX_AGG_SIZE_SHIFT); + add_sta_cmd.station_flags |= + htole32(mpdu_dens << IWM_STA_FLG_AGG_MPDU_DENS_SHIFT); + + status = IWM_ADD_STA_SUCCESS; + ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, + iwm_mvm_add_sta_cmd_size(sc), + &add_sta_cmd, &status); + if (ret) + return ret; + + switch (status & IWM_ADD_STA_STATUS_MASK) { + case IWM_ADD_STA_SUCCESS: + IWM_DPRINTF(sc, IWM_DEBUG_NODE, "IWM_ADD_STA PASSED\n"); + break; + default: + ret = EIO; + device_printf(sc->sc_dev, "IWM_ADD_STA failed\n"); + break; + } + + return ret; +} + +int +iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in) +{ + return iwm_mvm_sta_send_to_fw(sc, in, FALSE); +} + +int +iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in) +{ + return iwm_mvm_sta_send_to_fw(sc, in, TRUE); +} + +int +iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, boolean_t drain) +{ + struct iwm_mvm_add_sta_cmd cmd = {}; + struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); + int ret; + uint32_t status; + + cmd.mac_id_n_color = + htole32(IWM_FW_CMD_ID_AND_COLOR(ivp->id, ivp->color)); + cmd.sta_id = IWM_STATION_ID; + cmd.add_modify = IWM_STA_MODE_MODIFY; + cmd.station_flags = drain ? htole32(IWM_STA_FLG_DRAIN_FLOW) : 0; + cmd.station_flags_msk = htole32(IWM_STA_FLG_DRAIN_FLOW); + + status = IWM_ADD_STA_SUCCESS; + ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, + iwm_mvm_add_sta_cmd_size(sc), + &cmd, &status); + if (ret) + return ret; + + switch (status & IWM_ADD_STA_STATUS_MASK) { + case IWM_ADD_STA_SUCCESS: + IWM_DPRINTF(sc, IWM_DEBUG_NODE, + "Frames for staid %d will drained in fw\n", IWM_STATION_ID); + break; + default: + ret = EIO; + device_printf(sc->sc_dev, + "Couldn't drain frames for staid %d\n", IWM_STATION_ID); + break; + } + + return ret; +} + +/* + * Remove a station from the FW table. Before sending the command to remove + * the station validate that the station is indeed known to the driver (sanity + * only). + */ +static int +iwm_mvm_rm_sta_common(struct iwm_softc *sc) +{ + struct iwm_mvm_rm_sta_cmd rm_sta_cmd = { + .sta_id = IWM_STATION_ID, + }; + int ret; + + ret = iwm_mvm_send_cmd_pdu(sc, IWM_REMOVE_STA, 0, + sizeof(rm_sta_cmd), &rm_sta_cmd); + if (ret) { + device_printf(sc->sc_dev, + "Failed to remove station. Id=%d\n", IWM_STATION_ID); + return ret; + } + + return 0; +} + +int +iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, + struct iwm_node *in) +{ + uint32_t tfd_queue_msk = 0; + int ret; + int ac; + + ret = iwm_mvm_drain_sta(sc, in, TRUE); + if (ret) + return ret; + mbufq_drain(&sc->sc_snd); /* XXX needed ? */ + for (ac = 0; ac < WME_NUM_AC; ac++) { + tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); + } + ret = iwm_mvm_flush_tx_path(sc, tfd_queue_msk, 0); + if (ret) + return ret; +#ifdef notyet /* function not yet implemented */ + ret = iwl_trans_wait_tx_queue_empty(mvm->trans, + mvm_sta->tfd_queue_msk); + if (ret) + return ret; +#endif + ret = iwm_mvm_drain_sta(sc, in, FALSE); + +#if 0 + /* if we are associated - we can't remove the AP STA now */ + if (sta->assoc) + return ret; +#endif + /* XXX wait until STA is drained */ + + ret = iwm_mvm_rm_sta_common(sc); + + return ret; +} + +static int +iwm_mvm_add_int_sta_common(struct iwm_softc *sc, struct iwm_int_sta *sta, + const uint8_t *addr, uint16_t mac_id, uint16_t color) +{ + struct iwm_mvm_add_sta_cmd cmd; + int ret; + uint32_t status; + + memset(&cmd, 0, sizeof(cmd)); + cmd.sta_id = sta->sta_id; + cmd.mac_id_n_color = htole32(IWM_FW_CMD_ID_AND_COLOR(mac_id, color)); + + cmd.tfd_queue_msk = htole32(sta->tfd_queue_msk); + cmd.tid_disable_tx = htole16(0xffff); + + if (addr) + IEEE80211_ADDR_COPY(cmd.addr, addr); + + ret = iwm_mvm_send_cmd_pdu_status(sc, IWM_ADD_STA, + iwm_mvm_add_sta_cmd_size(sc), + &cmd, &status); + if (ret) + return ret; + + switch (status & IWM_ADD_STA_STATUS_MASK) { + case IWM_ADD_STA_SUCCESS: + IWM_DPRINTF(sc, IWM_DEBUG_NODE, "Internal station added.\n"); + return 0; + default: + ret = EIO; + device_printf(sc->sc_dev, + "Add internal station failed, status=0x%x\n", status); + break; + } + return ret; +} + +int +iwm_mvm_add_aux_sta(struct iwm_softc *sc) +{ + int ret; + + sc->sc_aux_sta.sta_id = IWM_AUX_STA_ID; + sc->sc_aux_sta.tfd_queue_msk = (1 << IWM_MVM_AUX_QUEUE); + + /* Map Aux queue to fifo - needs to happen before adding Aux station */ + ret = iwm_enable_txq(sc, 0, IWM_MVM_AUX_QUEUE, IWM_MVM_TX_FIFO_MCAST); + if (ret) + return ret; + + ret = iwm_mvm_add_int_sta_common(sc, &sc->sc_aux_sta, NULL, + IWM_MAC_INDEX_AUX, 0); + + if (ret) { + memset(&sc->sc_aux_sta, 0, sizeof(sc->sc_aux_sta)); + sc->sc_aux_sta.sta_id = IWM_MVM_STATION_COUNT; + } + return ret; +} + +void iwm_mvm_del_aux_sta(struct iwm_softc *sc) +{ + memset(&sc->sc_aux_sta, 0, sizeof(sc->sc_aux_sta)); + sc->sc_aux_sta.sta_id = IWM_MVM_STATION_COUNT; +} Copied: stable/11/sys/dev/iwm/if_iwm_sta.h (from r318222, head/sys/dev/iwm/if_iwm_sta.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:41:35 2018 (r330210, copy of r318222, head/sys/dev/iwm/if_iwm_sta.h) @@ -0,0 +1,222 @@ +/*- + * Based on BSD-licensed source modules in the Linux iwlwifi driver, + * which were used as the reference documentation for this implementation. + * + * Driver version we are currently based off of is + * Linux 4.7.3 (tag id d7f6728f57e3ecbb7ef34eb7d9f564d514775d75) + * + *********************************************************************** + * + * + * This file is provided under a dual BSD/GPLv2 license. When using or + * redistributing this file, you may do so under either license. + * + * GPL LICENSE SUMMARY + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2016 Intel Deutschland GmbH + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, + * USA + * + * The full GNU General Public License is included in this distribution + * in the file called COPYING. + * + * Contact Information: + * Intel Linux Wireless + * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497 + * + * BSD LICENSE + * + * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. + * Copyright(c) 2013 - 2014 Intel Mobile Communications GmbH + * Copyright(c) 2015 - 2016 Intel Deutschland GmbH + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * * Neither the name Intel Corporation nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + *****************************************************************************/ + +/* $FreeBSD$ */ + +#ifndef __IF_IWM_STA_H__ +#define __IF_IWM_STA_H__ + +/** + * DOC: station table - introduction + * + * The station table is a list of data structure that reprensent the stations. + * In STA/P2P client mode, the driver will hold one station for the AP/ GO. + * In GO/AP mode, the driver will have as many stations as associated clients. + * All these stations are reflected in the fw's station table. The driver + * keeps the fw's station table up to date with the ADD_STA command. Stations + * can be removed by the REMOVE_STA command. + * + * All the data related to a station is held in the structure %iwl_mvm_sta + * which is embed in the mac80211's %ieee80211_sta (in the drv_priv) area. + * This data includes the index of the station in the fw, per tid information + * (sequence numbers, Block-ack state machine, etc...). The stations are + * created and deleted by the %sta_state callback from %ieee80211_ops. + * + * The driver holds a map: %fw_id_to_mac_id that allows to fetch a + * %ieee80211_sta (and the %iwl_mvm_sta embedded into it) based on a fw + * station index. That way, the driver is able to get the tid related data in + * O(1) in time sensitive paths (Tx / Tx response / BA notification). These + * paths are triggered by the fw, and the driver needs to get a pointer to the + * %ieee80211 structure. This map helps to get that pointer quickly. + */ + +/** + * DOC: station table - locking + * + * As stated before, the station is created / deleted by mac80211's %sta_state + * callback from %ieee80211_ops which can sleep. The next paragraph explains + * the locking of a single stations, the next ones relates to the station + * table. + * + * The station holds the sequence number per tid. So this data needs to be + * accessed in the Tx path (which is softIRQ). It also holds the Block-Ack + * information (the state machine / and the logic that checks if the queues + * were drained), so it also needs to be accessible from the Tx response flow. + * In short, the station needs to be access from sleepable context as well as + * from tasklets, so the station itself needs a spinlock. + * + * The writers of %fw_id_to_mac_id map are serialized by the global mutex of + * the mvm op_mode. This is possible since %sta_state can sleep. + * The pointers in this map are RCU protected, hence we won't replace the + * station while we have Tx / Tx response / BA notification running. + * + * If a station is deleted while it still has packets in its A-MPDU queues, + * then the reclaim flow will notice that there is no station in the map for + * sta_id and it will dump the responses. + */ + +/** + * DOC: station table - internal stations + * + * The FW needs a few internal stations that are not reflected in + * mac80211, such as broadcast station in AP / GO mode, or AUX sta for + * scanning and P2P device (during the GO negotiation). + * For these kind of stations we have %iwl_mvm_int_sta struct which holds the + * data relevant for them from both %iwl_mvm_sta and %ieee80211_sta. + * Usually the data for these stations is static, so no locking is required, + * and no TID data as this is also not needed. + * One thing to note, is that these stations have an ID in the fw, but not + * in mac80211. In order to "reserve" them a sta_id in %fw_id_to_mac_id + * we fill ERR_PTR(EINVAL) in this mapping and all other dereferencing of + * pointers from this mapping need to check that the value is not error + * or NULL. + * + * Currently there is only one auxiliary station for scanning, initialized + * on init. + */ + +/** + * DOC: station table - AP Station in STA mode + * + * %iwl_mvm_vif includes the index of the AP station in the fw's STA table: + * %ap_sta_id. To get the point to the corresponding %ieee80211_sta, + * &fw_id_to_mac_id can be used. Due to the way the fw works, we must not remove + * the AP station from the fw before setting the MAC context as unassociated. + * Hence, %fw_id_to_mac_id[%ap_sta_id] will be NULLed when the AP station is + * removed by mac80211, but the station won't be removed in the fw until the + * VIF is set as unassociated. Then, %ap_sta_id will be invalidated. + */ + +/** + * DOC: station table - Drain vs. Flush + * + * Flush means that all the frames in the SCD queue are dumped regardless the + * station to which they were sent. We do that when we disassociate and before + * we remove the STA of the AP. The flush can be done synchronously against the + * fw. + * Drain means that the fw will drop all the frames sent to a specific station. + * This is useful when a client (if we are IBSS / GO or AP) disassociates. In + * that case, we need to drain all the frames for that client from the AC queues + * that are shared with the other clients. Only then, we can remove the STA in + * the fw. In order to do so, we track the non-AMPDU packets for each station. + * If mac80211 removes a STA and if it still has non-AMPDU packets pending in + * the queues, we mark this station as %EBUSY in %fw_id_to_mac_id, and drop all + * the frames for this STA (%iwl_mvm_rm_sta). When the last frame is dropped + * (we know about it with its Tx response), we remove the station in fw and set + * it as %NULL in %fw_id_to_mac_id: this is the purpose of + * %iwl_mvm_sta_drained_wk. + */ + +/** + * DOC: station table - fw restart + * + * When the fw asserts, or we have any other issue that requires to reset the + * driver, we require mac80211 to reconfigure the driver. Since the private + * data of the stations is embed in mac80211's %ieee80211_sta, that data will + * not be zeroed and needs to be reinitialized manually. + * %IWL_MVM_STATUS_IN_HW_RESTART is set during restart and that will hint us + * that we must not allocate a new sta_id but reuse the previous one. This + * means that the stations being re-added after the reset will have the same + * place in the fw as before the reset. We do need to zero the %fw_id_to_mac_id + * map, since the stations aren't in the fw any more. Internal stations that + * are not added by mac80211 will be re-added in the init flow that is called + * after the restart: mac80211 call's %iwl_mvm_mac_start which calls to + * %iwl_mvm_up. + */ + +/** + * Send the STA info to the FW. + * + * @sc: the iwm_softc* to use + * @sta: the STA + * @update: this is true if the FW is being updated about a STA it already knows + * about. Otherwise (if this is a new STA), this should be false. + * @flags: if update==true, this marks what is being changed via ORs of values + * from enum iwm_sta_modify_flag. Otherwise, this is ignored. + */ +extern int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc, struct iwm_node *in, + boolean_t update); +extern int iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in); +extern int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, + struct iwm_node *in); + +extern int iwm_mvm_add_aux_sta(struct iwm_softc *sc); +extern void iwm_mvm_del_aux_sta(struct iwm_softc *sc); + +extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, + boolean_t drain); + +#endif /* __IF_IWM_STA_H__ */ Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:41:35 2018 (r330210) @@ -123,6 +123,9 @@ extern void iwm_dma_contig_free(struct iwm_dma_info *) extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); +extern int iwm_enable_txq(struct iwm_softc *sc, int sta_id, int qid, int fifo); +extern int iwm_mvm_flush_tx_path(struct iwm_softc *sc, uint32_t tfd_msk, + uint32_t flags); static inline uint8_t iwm_mvm_get_valid_tx_ant(struct iwm_softc *sc) Modified: stable/11/sys/modules/iwm/Makefile ============================================================================== --- stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:40:08 2018 (r330209) +++ stable/11/sys/modules/iwm/Makefile Thu Mar 1 06:41:35 2018 (r330210) @@ -7,10 +7,10 @@ KMOD= if_iwm SRCS= if_iwm.c if_iwm_binding.c if_iwm_util.c if_iwm_phy_db.c SRCS+= if_iwm_mac_ctxt.c if_iwm_phy_ctxt.c if_iwm_time_event.c SRCS+= if_iwm_power.c if_iwm_scan.c if_iwm_led.c if_iwm_notif_wait.c -SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c +SRCS+= if_iwm_7000.c if_iwm_8000.c if_iwm_fw.c if_iwm_sta.c # bus layer SRCS+= if_iwm_pcie_trans.c -SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h +SRCS+= device_if.h bus_if.h pci_if.h opt_wlan.h opt_iwm.h CFLAGS+= -DIWM_DEBUG From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:42:19 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFCEEF29C53; Thu, 1 Mar 2018 06:42:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 621EB6B91A; Thu, 1 Mar 2018 06:42:19 +0000 (UTC) (envelope-from eadler@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 5D28524F9C; Thu, 1 Mar 2018 06:42:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216gJiT063501; Thu, 1 Mar 2018 06:42:19 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216gJNJ063500; Thu, 1 Mar 2018 06:42:19 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010642.w216gJNJ063500@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:42: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: r330211 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330211 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.25 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, 01 Mar 2018 06:42:19 -0000 Author: eadler Date: Thu Mar 1 06:42:19 2018 New Revision: 330211 URL: https://svnweb.freebsd.org/changeset/base/330211 Log: MFC r318223: [iwm] Handle AUTH->SCAN/INIT and ASSOC->SCAN/INIT better * Tear down the relevant firmware state (i.e. the station, the vif binding) in these transition cases. * Before this case would leave the firmware state lying around, resulting in errors and firmware panics in the subsequent association attempts. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:41:35 2018 (r330210) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:19 2018 (r330211) @@ -4389,6 +4389,39 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ switch (nstate) { case IEEE80211_S_INIT: + case IEEE80211_S_SCAN: + if (vap->iv_state == IEEE80211_S_AUTH || + vap->iv_state == IEEE80211_S_ASSOC) { + int myerr; + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + myerr = ivp->iv_newstate(vap, nstate, arg); + IEEE80211_UNLOCK(ic); + IWM_LOCK(sc); + in = IWM_NODE(vap->iv_bss); + error = iwm_mvm_rm_sta(sc, vap, in); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove station: %d\n", + __func__, error); + } + error = iwm_mvm_mac_ctxt_changed(sc, vap); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to change mac context: %d\n", + __func__, error); + } + error = iwm_mvm_binding_remove_vif(sc, ivp); + if (error) { + device_printf(sc->sc_dev, + "%s: Failed to remove channel ctx: %d\n", + __func__, error); + } + ivp->phy_ctxt = NULL; + IWM_UNLOCK(sc); + IEEE80211_LOCK(ic); + return myerr; + } break; case IEEE80211_S_AUTH: From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:42:48 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 555D9F29DDE; Thu, 1 Mar 2018 06:42:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2BF506BADF; Thu, 1 Mar 2018 06:42:48 +0000 (UTC) (envelope-from eadler@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 2696D24FAF; Thu, 1 Mar 2018 06:42:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216gm2n063559; Thu, 1 Mar 2018 06:42:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216gmgs063558; Thu, 1 Mar 2018 06:42:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010642.w216gmgs063558@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:42:48 +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: r330212 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330212 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.25 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, 01 Mar 2018 06:42:48 -0000 Author: eadler Date: Thu Mar 1 06:42:47 2018 New Revision: 330212 URL: https://svnweb.freebsd.org/changeset/base/330212 Log: MFC r318224: [iwm] Refuse connection to APs with beacon interval < 16. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:19 2018 (r330211) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:47 2018 (r330212) @@ -3961,6 +3961,21 @@ iwm_auth(struct ieee80211vap *vap, struct iwm_softc *s in->in_assoc = 0; + /* + * Firmware bug - it'll crash if the beacon interval is less + * than 16. We can't avoid connecting at all, so refuse the + * station state change, this will cause net80211 to abandon + * attempts to connect to this AP, and eventually wpa_s will + * blacklist the AP... + */ + if (ni->ni_intval < 16) { + device_printf(sc->sc_dev, + "AP %s beacon interval is %d, refusing due to firmware bug!\n", + ether_sprintf(ni->ni_bssid), ni->ni_intval); + error = EINVAL; + goto out; + } + error = iwm_mvm_sf_config(sc, IWM_SF_FULL_ON); if (error != 0) return error; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:44:33 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2C247F2A2FF; Thu, 1 Mar 2018 06:44:33 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D29836BEE2; Thu, 1 Mar 2018 06:44:32 +0000 (UTC) (envelope-from eadler@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 CD90524FB4; Thu, 1 Mar 2018 06:44:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216iWGi063702; Thu, 1 Mar 2018 06:44:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216iWh5063699; Thu, 1 Mar 2018 06:44:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010644.w216iWh5063699@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:44: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: r330213 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330213 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.25 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, 01 Mar 2018 06:44:33 -0000 Author: eadler Date: Thu Mar 1 06:44:32 2018 New Revision: 330213 URL: https://svnweb.freebsd.org/changeset/base/330213 Log: MFC r318229: [iwm] Adjust if_iwm_sta.h prototypes, don't pass iwm_node to rm_sta(). * Since a RUN -> INIT/SCAN transition seems to immediately destroy the ieee80211_node for the AP, we can't read the in_assoc value from there. Instead just directly pass that information via a boolean_t argument. * Adds iwm_mvm_rm_sta_id() function, which just unconditionally removes the station from the firmware. * The iwm_mvm_rm_sta() function shouldn't actually remove the station from firmware when we are still associated (i.e. during a RUN -> INIT/SCAN transition). * So when disassociating we will first call iwm_mvm_rm_sta() to drain the queues/fifos. Later during disassociation we will then use iwm_mvm_rm_sta_id() to actually remove the station. Inspired-By: Linux iwlwifi Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_sta.c stable/11/sys/dev/iwm/if_iwm_sta.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:42:47 2018 (r330212) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:44:32 2018 (r330213) @@ -4413,8 +4413,7 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ myerr = ivp->iv_newstate(vap, nstate, arg); IEEE80211_UNLOCK(ic); IWM_LOCK(sc); - in = IWM_NODE(vap->iv_bss); - error = iwm_mvm_rm_sta(sc, vap, in); + error = iwm_mvm_rm_sta(sc, vap, FALSE); if (error) { device_printf(sc->sc_dev, "%s: Failed to remove station: %d\n", Modified: stable/11/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:42:47 2018 (r330212) +++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:44:32 2018 (r330213) @@ -213,10 +213,9 @@ iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_no } int -iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, boolean_t drain) +iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_vap *ivp, boolean_t drain) { struct iwm_mvm_add_sta_cmd cmd = {}; - struct iwm_vap *ivp = IWM_VAP(in->in_ni.ni_vap); int ret; uint32_t status; @@ -275,13 +274,13 @@ iwm_mvm_rm_sta_common(struct iwm_softc *sc) int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, - struct iwm_node *in) + boolean_t is_assoc) { uint32_t tfd_queue_msk = 0; int ret; int ac; - ret = iwm_mvm_drain_sta(sc, in, TRUE); + ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE); if (ret) return ret; mbufq_drain(&sc->sc_snd); /* XXX needed ? */ @@ -297,18 +296,25 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v if (ret) return ret; #endif - ret = iwm_mvm_drain_sta(sc, in, FALSE); + ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), FALSE); -#if 0 /* if we are associated - we can't remove the AP STA now */ - if (sta->assoc) + if (is_assoc) return ret; -#endif + /* XXX wait until STA is drained */ ret = iwm_mvm_rm_sta_common(sc); return ret; +} + +int +iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee80211vap *vap) +{ + /* XXX wait until STA is drained */ + + return iwm_mvm_rm_sta_common(sc); } static int Modified: stable/11/sys/dev/iwm/if_iwm_sta.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:42:47 2018 (r330212) +++ stable/11/sys/dev/iwm/if_iwm_sta.h Thu Mar 1 06:44:32 2018 (r330213) @@ -211,12 +211,13 @@ extern int iwm_mvm_sta_send_to_fw(struct iwm_softc *sc extern int iwm_mvm_add_sta(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_update_sta(struct iwm_softc *sc, struct iwm_node *in); extern int iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211vap *vap, - struct iwm_node *in); + boolean_t is_assoc); +extern int iwm_mvm_rm_sta_id(struct iwm_softc *sc, struct ieee80211vap *vap); extern int iwm_mvm_add_aux_sta(struct iwm_softc *sc); extern void iwm_mvm_del_aux_sta(struct iwm_softc *sc); -extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_node *in, +extern int iwm_mvm_drain_sta(struct iwm_softc *sc, struct iwm_vap *ivp, boolean_t drain); #endif /* __IF_IWM_STA_H__ */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:46:32 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4444BF2A992; Thu, 1 Mar 2018 06:46:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E68AA6C393; Thu, 1 Mar 2018 06:46:31 +0000 (UTC) (envelope-from eadler@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 E178C24FBC; Thu, 1 Mar 2018 06:46:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216kVia063862; Thu, 1 Mar 2018 06:46:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216kVpx063860; Thu, 1 Mar 2018 06:46:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010646.w216kVpx063860@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:46:31 +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: r330215 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330215 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.25 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, 01 Mar 2018 06:46:32 -0000 Author: eadler Date: Thu Mar 1 06:46:31 2018 New Revision: 330215 URL: https://svnweb.freebsd.org/changeset/base/330215 Log: MFC r318230: [iwm] Fix iwm_mvm_send_cmd_pdu(_status) declarations. Make id a uint32_t. * This fixes cases where the group id of wide commands got lost, e.g. this happened to the IWM_SCAN_ABORT_UMAC command. Modified: stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:45:24 2018 (r330214) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:46:31 2018 (r330215) @@ -345,7 +345,7 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd /* iwlwifi: mvm/utils.c */ int -iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint8_t id, +iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint32_t id, uint32_t flags, uint16_t len, const void *data) { struct iwm_host_cmd cmd = { @@ -401,7 +401,7 @@ iwm_mvm_send_cmd_status(struct iwm_softc *sc, /* iwlwifi/mvm/utils.c */ int -iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint8_t id, +iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint32_t id, uint16_t len, const void *data, uint32_t *status) { struct iwm_host_cmd cmd = { Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:45:24 2018 (r330214) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:46:31 2018 (r330215) @@ -107,12 +107,12 @@ #define __IF_IWM_UTIL_H__ extern int iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); -extern int iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint8_t id, +extern int iwm_mvm_send_cmd_pdu(struct iwm_softc *sc, uint32_t id, uint32_t flags, uint16_t len, const void *data); extern int iwm_mvm_send_cmd_status(struct iwm_softc *sc, struct iwm_host_cmd *cmd, uint32_t *status); -extern int iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint8_t id, +extern int iwm_mvm_send_cmd_pdu_status(struct iwm_softc *sc, uint32_t id, uint16_t len, const void *data, uint32_t *status); extern void iwm_free_resp(struct iwm_softc *sc, struct iwm_host_cmd *hcmd); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:45:24 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BA5D9F2A611; Thu, 1 Mar 2018 06:45:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 90B376C0FA; Thu, 1 Mar 2018 06:45:24 +0000 (UTC) (envelope-from eadler@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 8BA3124FB6; Thu, 1 Mar 2018 06:45:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216jORv063782; Thu, 1 Mar 2018 06:45:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216jOb2063781; Thu, 1 Mar 2018 06:45:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010645.w216jOb2063781@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:45:24 +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: r330214 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330214 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.25 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, 01 Mar 2018 06:45:24 -0000 Author: eadler Date: Thu Mar 1 06:45:24 2018 New Revision: 330214 URL: https://svnweb.freebsd.org/changeset/base/330214 Log: MFC r318231: [iwm] Revert "if_iwm - SCAN_ABORT_UMAC response doesn't use a wide id" This reverts commit cef47a9cbb0a3ce5f18369fed9403d2764884bc2. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:44:32 2018 (r330213) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:45:24 2018 (r330214) @@ -5457,7 +5457,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_TIME_EVENT_CMD: case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_CFG_CMD): case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_REQ_UMAC): - case IWM_SCAN_ABORT_UMAC: + case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, IWM_SCAN_ABORT_UMAC): case IWM_SCAN_OFFLOAD_REQUEST_CMD: case IWM_SCAN_OFFLOAD_ABORT_CMD: case IWM_REPLY_BEACON_FILTERING_CMD: From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:48:19 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3488EF2B072; Thu, 1 Mar 2018 06:48:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0B6026C8DA; Thu, 1 Mar 2018 06:48:19 +0000 (UTC) (envelope-from eadler@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 0643D24FC7; Thu, 1 Mar 2018 06:48:19 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216mInU064065; Thu, 1 Mar 2018 06:48:18 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216mIDd064063; Thu, 1 Mar 2018 06:48:18 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010648.w216mIDd064063@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:48: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: r330218 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330218 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.25 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, 01 Mar 2018 06:48:19 -0000 Author: eadler Date: Thu Mar 1 06:48:18 2018 New Revision: 330218 URL: https://svnweb.freebsd.org/changeset/base/330218 Log: MFC r319579: [iwm] Remove dead code from iwm_pcie_load_cpu_sections(). * If device family is 8000 then iwm_pcie_load_cpu_sections() won't be called at all (iwm_pcie_load_cpu_sections_8000() is called in that case) so this piece of code never gets called. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:47:52 2018 (r330217) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:48:18 2018 (r330218) @@ -2574,14 +2574,6 @@ iwm_pcie_load_cpu_sections(struct iwm_softc *sc, return ret; } - if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) - iwm_set_bits_prph(sc, - IWM_CSR_UCODE_LOAD_STATUS_ADDR, - (IWM_LMPM_CPU_UCODE_LOADING_COMPLETED | - IWM_LMPM_CPU_HDRS_LOADING_COMPLETED | - IWM_LMPM_CPU_UCODE_LOADING_STARTED) << - shift_param); - *first_ucode_section = last_read_idx; return 0; Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:47:52 2018 (r330217) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:48:18 2018 (r330218) @@ -439,23 +439,11 @@ enum iwm_secure_boot_status_reg { }; #define IWM_FH_UCODE_LOAD_STATUS 0x1af0 -#define IWM_CSR_UCODE_LOAD_STATUS_ADDR 0x1e70 -enum iwm_secure_load_status_reg { - IWM_LMPM_CPU_UCODE_LOADING_STARTED = 0x00000001, - IWM_LMPM_CPU_HDRS_LOADING_COMPLETED = 0x00000003, - IWM_LMPM_CPU_UCODE_LOADING_COMPLETED = 0x00000007, - IWM_LMPM_CPU_STATUS_NUM_OF_LAST_COMPLETED = 0x000000F8, - IWM_LMPM_CPU_STATUS_NUM_OF_LAST_LOADED_BLOCK = 0x0000FF00, -}; #define IWM_FH_MEM_TB_MAX_LENGTH 0x20000 -#define IWM_LMPM_SECURE_INSPECTOR_CODE_ADDR 0x1e38 -#define IWM_LMPM_SECURE_INSPECTOR_DATA_ADDR 0x1e3c #define IWM_LMPM_SECURE_UCODE_LOAD_CPU1_HDR_ADDR 0x1e78 #define IWM_LMPM_SECURE_UCODE_LOAD_CPU2_HDR_ADDR 0x1e7c -#define IWM_LMPM_SECURE_INSPECTOR_CODE_MEM_SPACE 0x400000 -#define IWM_LMPM_SECURE_INSPECTOR_DATA_MEM_SPACE 0x402000 #define IWM_LMPM_SECURE_CPU1_HDR_MEM_SPACE 0x420000 #define IWM_LMPM_SECURE_CPU2_HDR_MEM_SPACE 0x420400 From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:46:56 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C0AD1F2AAE4; Thu, 1 Mar 2018 06:46:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6F8996C4F7; Thu, 1 Mar 2018 06:46:56 +0000 (UTC) (envelope-from eadler@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 6A55D24FC0; Thu, 1 Mar 2018 06:46:56 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216kucb063922; Thu, 1 Mar 2018 06:46:56 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216kuAj063921; Thu, 1 Mar 2018 06:46:56 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010646.w216kuAj063921@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:46: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: r330216 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330216 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.25 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, 01 Mar 2018 06:46:56 -0000 Author: eadler Date: Thu Mar 1 06:46:56 2018 New Revision: 330216 URL: https://svnweb.freebsd.org/changeset/base/330216 Log: MFC r318232: [iwm] Recognize IWM_FW_PAGING_BLOCK_CMD wide cmd response correctly. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:46:31 2018 (r330215) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:46:56 2018 (r330216) @@ -5466,7 +5466,8 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_REMOVE_STA: case IWM_TXPATH_FLUSH: case IWM_LQ_CMD: - case IWM_FW_PAGING_BLOCK_CMD: + case IWM_WIDE_ID(IWM_ALWAYS_LONG_GROUP, + IWM_FW_PAGING_BLOCK_CMD): case IWM_BT_CONFIG: case IWM_REPLY_THERMAL_MNG_BACKOFF: cresp = (void *)pkt->data; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:47:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 28FF7F2AE2F; Thu, 1 Mar 2018 06:47:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0013A6C73E; Thu, 1 Mar 2018 06:47:52 +0000 (UTC) (envelope-from eadler@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 EF12724FC5; Thu, 1 Mar 2018 06:47:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216lqd3064003; Thu, 1 Mar 2018 06:47:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216lqrx064000; Thu, 1 Mar 2018 06:47:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010647.w216lqrx064000@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:47:52 +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: r330217 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330217 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.25 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, 01 Mar 2018 06:47:53 -0000 Author: eadler Date: Thu Mar 1 06:47:52 2018 New Revision: 330217 URL: https://svnweb.freebsd.org/changeset/base/330217 Log: MFC r319578: [iwm] Check for lar_disable tunable, and lar_enabled flag from NVM. * LAR can be disabled with the hw.iwm.lar.disable tunable now. * On Family 8000 devices we need to check the lar_enabled flag from nvm_data in addition to the TLV_CAPA_LAR_SUPPORT flag from the firmware. * Add a separate IWM_DEBUG_LAR debugging flag. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_debug.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:46:56 2018 (r330216) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:47:52 2018 (r330217) @@ -359,6 +359,8 @@ static void iwm_mvm_fill_sf_command(struct iwm_softc * struct ieee80211_node *); static int iwm_mvm_sf_config(struct iwm_softc *, enum iwm_sf_state); static int iwm_send_bt_init_conf(struct iwm_softc *); +static boolean_t iwm_mvm_is_lar_supported(struct iwm_softc *); +static boolean_t iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *); static int iwm_send_update_mcc_cmd(struct iwm_softc *, const char *); static void iwm_mvm_tt_tx_backoff(struct iwm_softc *, uint32_t); static int iwm_init_hw(struct iwm_softc *); @@ -397,6 +399,9 @@ static void iwm_scan_curchan(struct ieee80211_scan_sta static void iwm_scan_mindwell(struct ieee80211_scan_state *); static int iwm_detach(device_t); +static int iwm_lar_disable = 0; +TUNABLE_INT("hw.iwm.lar.disable", &iwm_lar_disable); + /* * Firmware parser. */ @@ -2189,6 +2194,7 @@ iwm_parse_nvm_data(struct iwm_softc *sc, { struct iwm_nvm_data *data; uint32_t sku, radio_cfg; + uint16_t lar_config; if (sc->cfg->device_family != IWM_DEVICE_FAMILY_8000) { data = malloc(sizeof(*data) + @@ -2214,6 +2220,16 @@ iwm_parse_nvm_data(struct iwm_softc *sc, data->n_hw_addrs = iwm_get_n_hw_addrs(sc, nvm_sw); + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) { + uint16_t lar_offset = data->nvm_version < 0xE39 ? + IWM_NVM_LAR_OFFSET_8000_OLD : + IWM_NVM_LAR_OFFSET_8000; + + lar_config = le16_to_cpup(regulatory + lar_offset); + data->lar_enabled = !!(lar_config & + IWM_NVM_LAR_ENABLED_8000); + } + /* If no valid mac address was found - bail out */ if (iwm_set_hw_address(sc, data, nvm_hw, mac_override)) { free(data, M_DEVBUF); @@ -4661,6 +4677,35 @@ iwm_send_bt_init_conf(struct iwm_softc *sc) &bt_cmd); } +static boolean_t +iwm_mvm_is_lar_supported(struct iwm_softc *sc) +{ + boolean_t nvm_lar = sc->nvm_data->lar_enabled; + boolean_t tlv_lar = fw_has_capa(&sc->ucode_capa, + IWM_UCODE_TLV_CAPA_LAR_SUPPORT); + + if (iwm_lar_disable) + return FALSE; + + /* + * Enable LAR only if it is supported by the FW (TLV) && + * enabled in the NVM + */ + if (sc->cfg->device_family == IWM_DEVICE_FAMILY_8000) + return nvm_lar && tlv_lar; + else + return tlv_lar; +} + +static boolean_t +iwm_mvm_is_wifi_mcc_supported(struct iwm_softc *sc) +{ + return fw_has_api(&sc->ucode_capa, + IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || + fw_has_capa(&sc->ucode_capa, + IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC); +} + static int iwm_send_update_mcc_cmd(struct iwm_softc *sc, const char *alpha2) { @@ -4681,10 +4726,15 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch int resp_v2 = fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT_V2); + if (!iwm_mvm_is_lar_supported(sc)) { + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "%s: no LAR support\n", + __func__); + return 0; + } + memset(&mcc_cmd, 0, sizeof(mcc_cmd)); mcc_cmd.mcc = htole16(alpha2[0] << 8 | alpha2[1]); - if (fw_has_api(&sc->ucode_capa, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE) || - fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_MULTI_MCC)) + if (iwm_mvm_is_wifi_mcc_supported(sc)) mcc_cmd.source_id = IWM_MCC_SOURCE_GET_CURRENT; else mcc_cmd.source_id = IWM_MCC_SOURCE_OLD_FW; @@ -4694,7 +4744,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch else hcmd.len[0] = sizeof(struct iwm_mcc_update_cmd_v1); - IWM_DPRINTF(sc, IWM_DEBUG_NODE, + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "send MCC update to FW with '%c%c' src = %d\n", alpha2[0], alpha2[1], mcc_cmd.source_id); @@ -4720,7 +4770,7 @@ iwm_send_update_mcc_cmd(struct iwm_softc *sc, const ch if (mcc == 0) mcc = 0x3030; /* "00" - world */ - IWM_DPRINTF(sc, IWM_DEBUG_NODE, + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "regulatory domain '%c%c' (%d channels available)\n", mcc >> 8, mcc & 0xff, n_channels); #endif @@ -4823,10 +4873,8 @@ iwm_init_hw(struct iwm_softc *sc) if (error) goto error; - if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_LAR_SUPPORT)) { - if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) - goto error; - } + if ((error = iwm_send_update_mcc_cmd(sc, "ZZ")) != 0) + goto error; if (fw_has_capa(&sc->ucode_capa, IWM_UCODE_TLV_CAPA_UMAC_SCAN)) { if ((error = iwm_mvm_config_umac_scan(sc)) != 0) @@ -5423,7 +5471,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) sc->sc_fw_mcc[0] = (notif->mcc & 0xff00) >> 8; sc->sc_fw_mcc[1] = notif->mcc & 0xff; sc->sc_fw_mcc[2] = '\0'; - IWM_DPRINTF(sc, IWM_DEBUG_RESET, + IWM_DPRINTF(sc, IWM_DEBUG_LAR, "fw source %d sent CC '%s'\n", notif->source_id, sc->sc_fw_mcc); break; Modified: stable/11/sys/dev/iwm/if_iwm_debug.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:46:56 2018 (r330216) +++ stable/11/sys/dev/iwm/if_iwm_debug.h Thu Mar 1 06:47:52 2018 (r330217) @@ -43,6 +43,7 @@ enum { IWM_DEBUG_EEPROM = 0x00080000, /* EEPROM/channel information */ IWM_DEBUG_TEMP = 0x00100000, /* Thermal Sensor handling */ IWM_DEBUG_FW = 0x00200000, /* Firmware management */ + IWM_DEBUG_LAR = 0x00400000, /* Location Aware Regulatory */ IWM_DEBUG_REGISTER = 0x20000000, /* print chipset register */ IWM_DEBUG_TRACE = 0x40000000, /* Print begin and start driver function */ IWM_DEBUG_FATAL = 0x80000000, /* fatal errors */ Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:46:56 2018 (r330216) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:47:52 2018 (r330217) @@ -232,6 +232,7 @@ struct iwm_nvm_data { uint16_t nvm_version; uint8_t max_tx_pwr_half_dbm; + boolean_t lar_enabled; uint16_t nvm_ch_flags[]; }; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:50:35 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4A2BAF2B9BF; Thu, 1 Mar 2018 06:50:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 208BF6CF00; Thu, 1 Mar 2018 06:50:35 +0000 (UTC) (envelope-from eadler@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 1B63524FDA; Thu, 1 Mar 2018 06:50:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216oYvk064363; Thu, 1 Mar 2018 06:50:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216oYOJ064362; Thu, 1 Mar 2018 06:50:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010650.w216oYOJ064362@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:50: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: r330220 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330220 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.25 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, 01 Mar 2018 06:50:35 -0000 Author: eadler Date: Thu Mar 1 06:50:34 2018 New Revision: 330220 URL: https://svnweb.freebsd.org/changeset/base/330220 Log: MFC r319582: [iwm] Ignore IWM_DEBUG_LOG_MSG notifications. * Firmware versions 21 and 22 generate some IWM_DEBUG_LOG_MSG notifications, which seem to be harmless. Avoid spamming the system log with "frame ... UNHANDLED (this should not happen)" messages. Modified: stable/11/sys/dev/iwm/if_iwm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:05 2018 (r330219) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:34 2018 (r330220) @@ -5338,7 +5338,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) "rx packet qid=%d idx=%d type=%x\n", qid & ~0x80, pkt->hdr.idx, code); - len = le32toh(pkt->len_n_flags) & IWM_FH_RSCSR_FRAME_SIZE_MSK; + len = iwm_rx_packet_len(pkt); len += sizeof(uint32_t); /* account for status word */ nextoff = offset + roundup2(len, IWM_FH_RSCSR_FRAME_ALIGN); @@ -5586,6 +5586,13 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) notif->status, notif->action); break; } + + /* + * Firmware versions 21 and 22 generate some DEBUG_LOG_MSG + * messages. Just ignore them for now. + */ + case IWM_DEBUG_LOG_MSG: + break; case IWM_MCAST_FILTER_CMD: break; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:50:06 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D0677F2B7EA; Thu, 1 Mar 2018 06:50:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 802216CD6A; Thu, 1 Mar 2018 06:50:06 +0000 (UTC) (envelope-from eadler@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 77A0624FD4; Thu, 1 Mar 2018 06:50:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216o6Wi064301; Thu, 1 Mar 2018 06:50:06 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216o69u064298; Thu, 1 Mar 2018 06:50:06 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010650.w216o69u064298@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:50:06 +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: r330219 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330219 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.25 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, 01 Mar 2018 06:50:07 -0000 Author: eadler Date: Thu Mar 1 06:50:05 2018 New Revision: 330219 URL: https://svnweb.freebsd.org/changeset/base/330219 Log: MFC r319581: [iwm] Set command code for PHY_DB as well. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_phy_db.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:48:18 2018 (r330218) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:05 2018 (r330219) @@ -5518,7 +5518,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) break; /* ignore */ - case 0x6c: /* IWM_PHY_DB_CMD, no idea why it's not in fw-api.h */ + case IWM_PHY_DB_CMD: break; case IWM_INIT_COMPLETE_NOTIF: Modified: stable/11/sys/dev/iwm/if_iwm_phy_db.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 06:48:18 2018 (r330218) +++ stable/11/sys/dev/iwm/if_iwm_phy_db.c Thu Mar 1 06:50:05 2018 (r330219) @@ -194,7 +194,7 @@ enum iwm_phy_db_section_type { IWM_PHY_DB_MAX }; -#define PHY_DB_CMD 0x6c /* TEMP API - The actual is 0x8c */ +#define PHY_DB_CMD 0x6c /* * phy db - configure operational ucode Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:48:18 2018 (r330218) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:50:05 2018 (r330219) @@ -1806,7 +1806,7 @@ enum { /* Phy */ IWM_PHY_CONFIGURATION_CMD = 0x6a, IWM_CALIB_RES_NOTIF_PHY_DB = 0x6b, - /* IWM_PHY_DB_CMD = 0x6c, */ + IWM_PHY_DB_CMD = 0x6c, /* Power - legacy power table command */ IWM_POWER_TABLE_CMD = 0x77, From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:56:35 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9BE21F2D430; Thu, 1 Mar 2018 06:56:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 707AB6DF0D; Thu, 1 Mar 2018 06:56:35 +0000 (UTC) (envelope-from eadler@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 6AF9E25178; Thu, 1 Mar 2018 06:56:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216uZlH069286; Thu, 1 Mar 2018 06:56:35 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216uZ56069283; Thu, 1 Mar 2018 06:56:35 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010656.w216uZ56069283@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:56: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: r330225 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330225 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.25 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, 01 Mar 2018 06:56:35 -0000 Author: eadler Date: Thu Mar 1 06:56:34 2018 New Revision: 330225 URL: https://svnweb.freebsd.org/changeset/base/330225 Log: MFC r321510: [iwm] Add iwm_mvm_send_lq_cmd() from Linux iwlwifi to if_iwm_util.c. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_util.c stable/11/sys/dev/iwm/if_iwm_util.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:10 2018 (r330224) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:34 2018 (r330225) @@ -4476,13 +4476,6 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ break; case IEEE80211_S_RUN: - { - struct iwm_host_cmd cmd = { - .id = IWM_LQ_CMD, - .len = { sizeof(in->in_lq), }, - .flags = IWM_CMD_SYNC, - }; - /* Update the association state, now we have it all */ /* (eg associd comes in at this point */ error = iwm_assoc(vap, sc); @@ -4500,15 +4493,13 @@ iwm_newstate(struct ieee80211vap *vap, enum ieee80211_ iwm_mvm_update_quotas(sc, ivp); iwm_setrates(sc, in); - cmd.data[0] = &in->in_lq; - if ((error = iwm_send_cmd(sc, &cmd)) != 0) { + if ((error = iwm_mvm_send_lq_cmd(sc, &in->in_lq, TRUE)) != 0) { device_printf(sc->sc_dev, - "%s: IWM_LQ_CMD failed\n", __func__); + "%s: IWM_LQ_CMD failed: %d\n", __func__, error); } iwm_mvm_led_enable(sc); break; - } default: break; Modified: stable/11/sys/dev/iwm/if_iwm_util.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:56:10 2018 (r330224) +++ stable/11/sys/dev/iwm/if_iwm_util.c Thu Mar 1 06:56:34 2018 (r330225) @@ -488,6 +488,32 @@ iwm_dma_contig_free(struct iwm_dma_info *dma) } } +/** + * iwm_mvm_send_lq_cmd() - Send link quality command + * @init: This command is sent as part of station initialization right + * after station has been added. + * + * The link quality command is sent as the last step of station creation. + * This is the special case in which init is set and we call a callback in + * this case to clear the state indicating that station creation is in + * progress. + */ +int +iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, boolean_t init) +{ + struct iwm_host_cmd cmd = { + .id = IWM_LQ_CMD, + .len = { sizeof(struct iwm_lq_cmd), }, + .flags = init ? 0 : IWM_CMD_ASYNC, + .data = { lq, }, + }; + + if (lq->sta_id == IWM_MVM_STATION_COUNT) + return EINVAL; + + return iwm_send_cmd(sc, &cmd); +} + boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc) { Modified: stable/11/sys/dev/iwm/if_iwm_util.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:56:10 2018 (r330224) +++ stable/11/sys/dev/iwm/if_iwm_util.h Thu Mar 1 06:56:34 2018 (r330225) @@ -120,6 +120,9 @@ extern int iwm_dma_contig_alloc(bus_dma_tag_t tag, str bus_size_t size, bus_size_t alignment); extern void iwm_dma_contig_free(struct iwm_dma_info *); +extern int iwm_mvm_send_lq_cmd(struct iwm_softc *sc, struct iwm_lq_cmd *lq, + boolean_t init); + extern boolean_t iwm_mvm_rx_diversity_allowed(struct iwm_softc *sc); extern uint8_t iwm_ridx2rate(struct ieee80211_rateset *rs, int ridx); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:53:38 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 43022F2C86C; Thu, 1 Mar 2018 06:53:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 19F956D73A; Thu, 1 Mar 2018 06:53:38 +0000 (UTC) (envelope-from eadler@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 14A2F2516B; Thu, 1 Mar 2018 06:53:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216rbT1068950; Thu, 1 Mar 2018 06:53:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216rbsi068948; Thu, 1 Mar 2018 06:53:37 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010653.w216rbsi068948@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:53:37 +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: r330221 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330221 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.25 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, 01 Mar 2018 06:53:38 -0000 Author: eadler Date: Thu Mar 1 06:53:37 2018 New Revision: 330221 URL: https://svnweb.freebsd.org/changeset/base/330221 Log: MFC r319589: [iwm] Remove support for fw older than -17 and -22 * iwm(4) didn't use any of these definitions yet, anyway. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:50:34 2018 (r330220) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:53:37 2018 (r330221) @@ -3438,8 +3438,7 @@ iwm_update_sched(struct iwm_softc *sc, int qid, int id scd_bc_tbl = sc->sched_dma.vaddr; len += 8; /* magic numbers came naturally from paris */ - if (sc->sc_capaflags & IWM_UCODE_TLV_FLAGS_DW_BC_TABLE) - len = roundup(len, 4) / 4; + len = roundup(len, 4) / 4; w_val = htole16(sta_id << 12 | len); Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:50:34 2018 (r330220) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:53:37 2018 (r330221) @@ -594,8 +594,6 @@ enum iwm_dtd_diode_reg { * @IWM_UCODE_TLV_FLAGS_NEWSCAN: new uCode scan behaviour on hidden SSID, * treats good CRC threshold as a boolean * @IWM_UCODE_TLV_FLAGS_MFP: This uCode image supports MFP (802.11w). - * @IWM_UCODE_TLV_FLAGS_P2P: This uCode image supports P2P. - * @IWM_UCODE_TLV_FLAGS_DW_BC_TABLE: The SCD byte count table is in DWORDS * @IWM_UCODE_TLV_FLAGS_UAPSD: This uCode image supports uAPSD * @IWM_UCODE_TLV_FLAGS_SHORT_BL: 16 entries of black list instead of 64 in scan * offload profile config command. @@ -605,35 +603,24 @@ enum iwm_dtd_diode_reg { * from the probe request template. * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL: new NS offload (small version) * @IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE: new NS offload (large version) - * @IWM_UCODE_TLV_FLAGS_P2P_PS: P2P client power save is supported (only on a - * single bound interface). * @IWM_UCODE_TLV_FLAGS_UAPSD_SUPPORT: General support for uAPSD * @IWM_UCODE_TLV_FLAGS_EBS_SUPPORT: this uCode image supports EBS. * @IWM_UCODE_TLV_FLAGS_P2P_PS_UAPSD: P2P client supports uAPSD power save * @IWM_UCODE_TLV_FLAGS_BCAST_FILTERING: uCode supports broadcast filtering. - * @IWM_UCODE_TLV_FLAGS_GO_UAPSD: AP/GO interfaces support uAPSD clients - * */ enum iwm_ucode_tlv_flag { IWM_UCODE_TLV_FLAGS_PAN = (1 << 0), IWM_UCODE_TLV_FLAGS_NEWSCAN = (1 << 1), IWM_UCODE_TLV_FLAGS_MFP = (1 << 2), - IWM_UCODE_TLV_FLAGS_P2P = (1 << 3), - IWM_UCODE_TLV_FLAGS_DW_BC_TABLE = (1 << 4), IWM_UCODE_TLV_FLAGS_SHORT_BL = (1 << 7), IWM_UCODE_TLV_FLAGS_D3_6_IPV6_ADDRS = (1 << 10), IWM_UCODE_TLV_FLAGS_NO_BASIC_SSID = (1 << 12), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_SMALL = (1 << 15), IWM_UCODE_TLV_FLAGS_NEW_NSOFFL_LARGE = (1 << 16), - IWM_UCODE_TLV_FLAGS_P2P_PS = (1 << 21), - IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_DCM = (1 << 22), - IWM_UCODE_TLV_FLAGS_BSS_P2P_PS_SCM = (1 << 23), IWM_UCODE_TLV_FLAGS_UAPSD_SUPPORT = (1 << 24), IWM_UCODE_TLV_FLAGS_EBS_SUPPORT = (1 << 25), IWM_UCODE_TLV_FLAGS_P2P_PS_UAPSD = (1 << 26), IWM_UCODE_TLV_FLAGS_BCAST_FILTERING = (1 << 29), - IWM_UCODE_TLV_FLAGS_GO_UAPSD = (1 << 30), - IWM_UCODE_TLV_FLAGS_LTE_COEX = (1 << 31), }; #define IWM_UCODE_TLV_FLAG_BITS \ @@ -647,22 +634,14 @@ P2P_PS_SCM\31UAPSD_SUPPORT\32EBS\33P2P_PS_UAPSD\36BCAS * @IWM_UCODE_TLV_API_FRAGMENTED_SCAN: This ucode supports active dwell time * longer than the passive one, which is essential for fragmented scan. * @IWM_UCODE_TLV_API_WIFI_MCC_UPDATE: ucode supports MCC updates with source. - * @IWM_UCODE_TLV_API_WIDE_CMD_HDR: ucode supports wide command header * @IWM_UCODE_TLV_API_LQ_SS_PARAMS: Configure STBC/BFER via LQ CMD ss_params - * @IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY: scan APIs use 8-level priority - * instead of 3. - * @IWM_UCODE_TLV_API_TX_POWER_CHAIN: TX power API has larger command size - * (command version 3) that supports per-chain limits * * @IWM_NUM_UCODE_TLV_API: number of bits used */ enum iwm_ucode_tlv_api { IWM_UCODE_TLV_API_FRAGMENTED_SCAN = 8, IWM_UCODE_TLV_API_WIFI_MCC_UPDATE = 9, - IWM_UCODE_TLV_API_WIDE_CMD_HDR = 14, IWM_UCODE_TLV_API_LQ_SS_PARAMS = 18, - IWM_UCODE_TLV_API_EXT_SCAN_PRIORITY = 24, - IWM_UCODE_TLV_API_TX_POWER_CHAIN = 27, IWM_NUM_UCODE_TLV_API = 32 }; @@ -4144,7 +4123,6 @@ struct iwm_lq_cmd { * @IWM_TX_CMD_FLG_MH_PAD: driver inserted 2 byte padding after MAC header. * Should be set for 26/30 length MAC headers * @IWM_TX_CMD_FLG_RESP_TO_DRV: zero this if the response should go only to FW - * @IWM_TX_CMD_FLG_CCMP_AGG: this frame uses CCMP for aggregation acceleration * @IWM_TX_CMD_FLG_TKIP_MIC_DONE: FW already performed TKIP MIC calculation * @IWM_TX_CMD_FLG_DUR: disable duration overwriting used in PS-Poll Assoc-id * @IWM_TX_CMD_FLG_FW_DROP: FW should mark frame to be dropped @@ -4172,7 +4150,6 @@ enum iwm_tx_flags { IWM_TX_CMD_FLG_AGG_START = (1 << 19), IWM_TX_CMD_FLG_MH_PAD = (1 << 20), IWM_TX_CMD_FLG_RESP_TO_DRV = (1 << 21), - IWM_TX_CMD_FLG_CCMP_AGG = (1 << 22), IWM_TX_CMD_FLG_TKIP_MIC_DONE = (1 << 23), IWM_TX_CMD_FLG_DUR = (1 << 25), IWM_TX_CMD_FLG_FW_DROP = (1 << 26), From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:55:47 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 91B98F2D0F3; Thu, 1 Mar 2018 06:55:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3A0066DC57; Thu, 1 Mar 2018 06:55:47 +0000 (UTC) (envelope-from eadler@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 18F1325173; Thu, 1 Mar 2018 06:55:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216tkb5069161; Thu, 1 Mar 2018 06:55:46 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216tkLu069159; Thu, 1 Mar 2018 06:55:46 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010655.w216tkLu069159@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:55: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: r330223 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330223 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.25 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, 01 Mar 2018 06:55:47 -0000 Author: eadler Date: Thu Mar 1 06:55:46 2018 New Revision: 330223 URL: https://svnweb.freebsd.org/changeset/base/330223 Log: MFC r321508: [iwm] Cleanup mbufq draining. Add iwm_xmit_queue_drain() like in iwn(4). * iwm_xmit_queue_drain() calls ieee80211_free_node(), removing a possible memory leak, compared to using just mbufq_drain(). * Remove duplicate mbufq_drain() from iwm_mvm_rm_sta(), this should be handled in the caller. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_sta.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:54:03 2018 (r330222) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:55:46 2018 (r330223) @@ -391,6 +391,7 @@ static struct ieee80211vap * const uint8_t [IEEE80211_ADDR_LEN], const uint8_t [IEEE80211_ADDR_LEN]); static void iwm_vap_delete(struct ieee80211vap *); +static void iwm_xmit_queue_drain(struct iwm_softc *); static void iwm_scan_start(struct ieee80211com *); static void iwm_scan_end(struct ieee80211com *); static void iwm_update_mcast(struct ieee80211com *); @@ -4132,7 +4133,7 @@ iwm_release(struct iwm_softc *sc, struct iwm_node *in) * get here from RUN state. */ tfd_msk = 0xf; - mbufq_drain(&sc->sc_snd); + iwm_xmit_queue_drain(sc); iwm_mvm_flush_tx_path(sc, tfd_msk, IWM_CMD_SYNC); /* * We seem to get away with just synchronously sending the @@ -6364,6 +6365,19 @@ iwm_vap_delete(struct ieee80211vap *vap) } static void +iwm_xmit_queue_drain(struct iwm_softc *sc) +{ + struct mbuf *m; + struct ieee80211_node *ni; + + while ((m = mbufq_dequeue(&sc->sc_snd)) != NULL) { + ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; + ieee80211_free_node(ni); + m_freem(m); + } +} + +static void iwm_scan_start(struct ieee80211com *ic) { struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); @@ -6522,6 +6536,9 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 callout_drain(&sc->sc_watchdog_to); iwm_stop_device(sc); if (do_net80211) { + IWM_LOCK(sc); + iwm_xmit_queue_drain(sc); + IWM_UNLOCK(sc); ieee80211_ifdetach(&sc->sc_ic); } @@ -6555,7 +6572,6 @@ iwm_detach_local(struct iwm_softc *sc, int do_net80211 sc->sc_notif_wait = NULL; } - mbufq_drain(&sc->sc_snd); IWM_LOCK_DESTROY(sc); return (0); Modified: stable/11/sys/dev/iwm/if_iwm_sta.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:54:03 2018 (r330222) +++ stable/11/sys/dev/iwm/if_iwm_sta.c Thu Mar 1 06:55:46 2018 (r330223) @@ -283,7 +283,6 @@ iwm_mvm_rm_sta(struct iwm_softc *sc, struct ieee80211v ret = iwm_mvm_drain_sta(sc, IWM_VAP(vap), TRUE); if (ret) return ret; - mbufq_drain(&sc->sc_snd); /* XXX needed ? */ for (ac = 0; ac < WME_NUM_AC; ac++) { tfd_queue_msk |= htole32(1 << iwm_mvm_ac_to_tx_fifo[ac]); } From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:56:11 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 68A2FF2D250; Thu, 1 Mar 2018 06:56:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E3956DDBD; Thu, 1 Mar 2018 06:56:11 +0000 (UTC) (envelope-from eadler@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 18F5B25177; Thu, 1 Mar 2018 06:56:11 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216uAL6069225; Thu, 1 Mar 2018 06:56:10 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216uApJ069222; Thu, 1 Mar 2018 06:56:10 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010656.w216uApJ069222@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:56: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: r330224 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330224 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.25 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, 01 Mar 2018 06:56:11 -0000 Author: eadler Date: Thu Mar 1 06:56:10 2018 New Revision: 330224 URL: https://svnweb.freebsd.org/changeset/base/330224 Log: MFC r321509: [iwm] Sync statistics API definitions with Linux iwlwifi. Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwmreg.h stable/11/sys/dev/iwm/if_iwmvar.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:55:46 2018 (r330223) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:56:10 2018 (r330224) @@ -323,8 +323,10 @@ static int iwm_mvm_get_signal_strength(struct iwm_soft struct iwm_rx_phy_info *); static void iwm_mvm_rx_rx_phy_cmd(struct iwm_softc *, struct iwm_rx_packet *); -static int iwm_get_noise(struct iwm_softc *sc, +static int iwm_get_noise(struct iwm_softc *, const struct iwm_mvm_statistics_rx_non_phy *); +static void iwm_mvm_handle_rx_statistics(struct iwm_softc *, + struct iwm_rx_packet *); static boolean_t iwm_mvm_rx_rx_mpdu(struct iwm_softc *, struct mbuf *, uint32_t, boolean_t); static int iwm_mvm_rx_tx_cmd_single(struct iwm_softc *, @@ -3167,6 +3169,15 @@ iwm_get_noise(struct iwm_softc *sc, #endif } +static void +iwm_mvm_handle_rx_statistics(struct iwm_softc *sc, struct iwm_rx_packet *pkt) +{ + struct iwm_notif_statistics_v10 *stats = (void *)&pkt->data; + + memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); + sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); +} + /* * iwm_mvm_rx_rx_mpdu - IWM_REPLY_RX_MPDU_CMD handler * @@ -5440,13 +5451,9 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) case IWM_CALIB_RES_NOTIF_PHY_DB: break; - case IWM_STATISTICS_NOTIFICATION: { - struct iwm_notif_statistics *stats; - stats = (void *)pkt->data; - memcpy(&sc->sc_stats, stats, sizeof(sc->sc_stats)); - sc->sc_noise = iwm_get_noise(sc, &stats->rx.general); + case IWM_STATISTICS_NOTIFICATION: + iwm_mvm_handle_rx_statistics(sc, pkt); break; - } case IWM_NVM_ACCESS_CMD: case IWM_MCC_UPDATE_CMD: Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:55:46 2018 (r330223) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:56:10 2018 (r330224) @@ -2898,6 +2898,18 @@ struct iwm_mcast_filter_cmd { uint8_t addr_list[0]; } __packed; /* IWM_MCAST_FILTERING_CMD_API_S_VER_1 */ +/* + * The first MAC indices (starting from 0) + * are available to the driver, AUX follows + */ +#define IWM_MAC_INDEX_AUX 4 +#define IWM_MAC_INDEX_MIN_DRIVER 0 +#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX +#define IWM_NUM_MAC_INDEX (IWM_MAC_INDEX_AUX + 1) + +/*********************************** + * Statistics API + ***********************************/ struct iwm_mvm_statistics_dbg { uint32_t burst_check; uint32_t burst_count; @@ -2914,24 +2926,6 @@ struct iwm_mvm_statistics_div { uint32_t reserved2; } __packed; /* IWM_STATISTICS_SLOW_DIV_API_S_VER_2 */ -struct iwm_mvm_statistics_general_common { - uint32_t temperature; /* radio temperature */ - uint32_t temperature_m; /* radio voltage */ - struct iwm_mvm_statistics_dbg dbg; - uint32_t sleep_time; - uint32_t slots_out; - uint32_t slots_idle; - uint32_t ttl_timestamp; - struct iwm_mvm_statistics_div div; - uint32_t rx_enable_counter; - /* - * num_of_sos_states: - * count the number of times we have to re-tune - * in order to get out of bad PHY status - */ - uint32_t num_of_sos_states; -} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */ - struct iwm_mvm_statistics_rx_non_phy { uint32_t bogus_cts; /* CTS received when not expecting CTS */ uint32_t bogus_ack; /* ACK received when not expecting ACK */ @@ -3002,6 +2996,23 @@ struct iwm_mvm_statistics_rx_ht_phy { uint32_t unsupport_mcs; } __packed; /* IWM_STATISTICS_HT_RX_PHY_API_S_VER_1 */ +struct iwm_mvm_statistics_tx_non_phy { + uint32_t preamble_cnt; + uint32_t rx_detected_cnt; + uint32_t bt_prio_defer_cnt; + uint32_t bt_prio_kill_cnt; + uint32_t few_bytes_cnt; + uint32_t cts_timeout; + uint32_t ack_timeout; + uint32_t expected_ack_cnt; + uint32_t actual_ack_cnt; + uint32_t dump_msdu_cnt; + uint32_t burst_abort_next_frame_mismatch_cnt; + uint32_t burst_abort_missing_next_frame_cnt; + uint32_t cts_timeout_collision; + uint32_t ack_or_ba_timeout_collision; +} __packed; /* IWM_STATISTICS_TX_NON_PHY_API_S_VER_3 */ + #define IWM_MAX_CHAINS 3 struct iwm_mvm_statistics_tx_non_phy_agg { @@ -3032,20 +3043,7 @@ struct iwm_mvm_statistics_tx_channel_width { }; /* IWM_STATISTICS_TX_CHANNEL_WIDTH_API_S_VER_1 */ struct iwm_mvm_statistics_tx { - uint32_t preamble_cnt; - uint32_t rx_detected_cnt; - uint32_t bt_prio_defer_cnt; - uint32_t bt_prio_kill_cnt; - uint32_t few_bytes_cnt; - uint32_t cts_timeout; - uint32_t ack_timeout; - uint32_t expected_ack_cnt; - uint32_t actual_ack_cnt; - uint32_t dump_msdu_cnt; - uint32_t burst_abort_next_frame_mismatch_cnt; - uint32_t burst_abort_missing_next_frame_cnt; - uint32_t cts_timeout_collision; - uint32_t ack_or_ba_timeout_collision; + struct iwm_mvm_statistics_tx_non_phy general; struct iwm_mvm_statistics_tx_non_phy_agg agg; struct iwm_mvm_statistics_tx_channel_width channel_width; } __packed; /* IWM_STATISTICS_TX_API_S_VER_4 */ @@ -3062,17 +3060,38 @@ struct iwm_mvm_statistics_bt_activity { uint32_t lo_priority_rx_denied_cnt; } __packed; /* IWM_STATISTICS_BT_ACTIVITY_API_S_VER_1 */ -struct iwm_mvm_statistics_general { - struct iwm_mvm_statistics_general_common common; +struct iwm_mvm_statistics_general_v8 { + uint32_t radio_temperature; + uint32_t radio_voltage; + struct iwm_mvm_statistics_dbg dbg; + uint32_t sleep_time; + uint32_t slots_out; + uint32_t slots_idle; + uint32_t ttl_timestamp; + struct iwm_mvm_statistics_div slow_div; + uint32_t rx_enable_counter; + /* + * num_of_sos_states: + * count the number of times we have to re-tune + * in order to get out of bad PHY status + */ + uint32_t num_of_sos_states; uint32_t beacon_filtered; uint32_t missed_beacons; - int8_t beacon_filter_average_energy; - int8_t beacon_filter_reason; - int8_t beacon_filter_current_energy; - int8_t beacon_filter_reserved; + uint8_t beacon_filter_average_energy; + uint8_t beacon_filter_reason; + uint8_t beacon_filter_current_energy; + uint8_t beacon_filter_reserved; uint32_t beacon_filter_delta_time; struct iwm_mvm_statistics_bt_activity bt_activity; -} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_5 */ + uint64_t rx_time; + uint64_t on_time_rf; + uint64_t on_time_scan; + uint64_t tx_time; + uint32_t beacon_counter[IWM_NUM_MAC_INDEX]; + uint8_t beacon_average_energy[IWM_NUM_MAC_INDEX]; + uint8_t reserved[4 - (IWM_NUM_MAC_INDEX % 4)]; +} __packed; /* IWM_STATISTICS_GENERAL_API_S_VER_8 */ struct iwm_mvm_statistics_rx { struct iwm_mvm_statistics_rx_phy ofdm; @@ -3086,24 +3105,23 @@ struct iwm_mvm_statistics_rx { * * By default, uCode issues this notification after receiving a beacon * while associated. To disable this behavior, set DISABLE_NOTIF flag in the - * IWM_REPLY_STATISTICS_CMD 0x9c, above. - * - * Statistics counters continue to increment beacon after beacon, but are - * cleared when changing channels or when driver issues IWM_REPLY_STATISTICS_CMD - * 0x9c with CLEAR_STATS bit set (see above). - * - * uCode also issues this notification during scans. uCode clears statistics - * appropriately so that each notification contains statistics for only the - * one channel that has just been scanned. + * IWM_STATISTICS_CMD (0x9c), below. */ -struct iwm_notif_statistics { /* IWM_STATISTICS_NTFY_API_S_VER_8 */ +struct iwm_notif_statistics_v10 { uint32_t flag; struct iwm_mvm_statistics_rx rx; struct iwm_mvm_statistics_tx tx; - struct iwm_mvm_statistics_general general; -} __packed; + struct iwm_mvm_statistics_general_v8 general; +} __packed; /* IWM_STATISTICS_NTFY_API_S_VER_10 */ +#define IWM_STATISTICS_FLG_CLEAR 0x1 +#define IWM_STATISTICS_FLG_DISABLE_NOTIF 0x2 + +struct iwm_statistics_cmd { + uint32_t flags; +} __packed; /* IWM_STATISTICS_CMD_API_S_VER_1 */ + /*********************************** * Smart Fifo API ***********************************/ @@ -3186,14 +3204,6 @@ struct iwm_sf_cfg_cmd { /* * BEGIN mvm/fw-api-mac.h */ - -/* - * The first MAC indices (starting from 0) - * are available to the driver, AUX follows - */ -#define IWM_MAC_INDEX_AUX 4 -#define IWM_MAC_INDEX_MIN_DRIVER 0 -#define IWM_NUM_MAC_INDEX_DRIVER IWM_MAC_INDEX_AUX enum iwm_ac { IWM_AC_BK, Modified: stable/11/sys/dev/iwm/if_iwmvar.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:55:46 2018 (r330223) +++ stable/11/sys/dev/iwm/if_iwmvar.h Thu Mar 1 06:56:10 2018 (r330224) @@ -525,7 +525,7 @@ struct iwm_softc { /* phy contexts. we only use the first one */ struct iwm_mvm_phy_ctxt sc_phyctxt[IWM_NUM_PHY_CTX]; - struct iwm_notif_statistics sc_stats; + struct iwm_notif_statistics_v10 sc_stats; int sc_noise; caddr_t sc_drvbpf; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:54:04 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 25787F2CA2E; Thu, 1 Mar 2018 06:54:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C7F606D89F; Thu, 1 Mar 2018 06:54:03 +0000 (UTC) (envelope-from eadler@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 C28052516D; Thu, 1 Mar 2018 06:54:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216s3rt069018; Thu, 1 Mar 2018 06:54:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216s3Db069017; Thu, 1 Mar 2018 06:54:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010654.w216s3Db069017@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:54: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: r330222 - stable/11/tests/sys/aio X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/tests/sys/aio X-SVN-Commit-Revision: 330222 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.25 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, 01 Mar 2018 06:54:04 -0000 Author: eadler Date: Thu Mar 1 06:54:03 2018 New Revision: 330222 URL: https://svnweb.freebsd.org/changeset/base/330222 Log: MFC r319590: Modified: stable/11/tests/sys/aio/aio_test.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tests/sys/aio/aio_test.c ============================================================================== --- stable/11/tests/sys/aio/aio_test.c Thu Mar 1 06:53:37 2018 (r330221) +++ stable/11/tests/sys/aio/aio_test.c Thu Mar 1 06:54:03 2018 (r330222) @@ -336,7 +336,7 @@ aio_file_test(completion comp, struct sigevent *sev) ATF_REQUIRE_KERNEL_MODULE("aio"); ATF_REQUIRE_UNSAFE_AIO(); - fd = open(FILE_PATHNAME, O_RDWR | O_CREAT); + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); aio_context_init(&ac, fd, fd, FILE_LEN); @@ -806,7 +806,7 @@ ATF_TC_BODY(aio_large_read_test, tc) len = INT_MAX; #endif - fd = open(FILE_PATHNAME, O_RDWR | O_CREAT); + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); unlink(FILE_PATHNAME); @@ -1060,7 +1060,7 @@ ATF_TC_BODY(aio_fsync_test, tc) ATF_REQUIRE_KERNEL_MODULE("aio"); ATF_REQUIRE_UNSAFE_AIO(); - fd = open(FILE_PATHNAME, O_RDWR | O_CREAT); + fd = open(FILE_PATHNAME, O_RDWR | O_CREAT, 0600); ATF_REQUIRE_MSG(fd != -1, "open failed: %s", strerror(errno)); unlink(FILE_PATHNAME); From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:57:39 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9DCB5F2D87A; Thu, 1 Mar 2018 06:57:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6D58F6E261; Thu, 1 Mar 2018 06:57:39 +0000 (UTC) (envelope-from eadler@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 667302517D; Thu, 1 Mar 2018 06:57:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216vdII069418; Thu, 1 Mar 2018 06:57:39 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216vdMU069415; Thu, 1 Mar 2018 06:57:39 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010657.w216vdMU069415@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:57:39 +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: r330227 - in stable/11/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: dev/iwm modules/iwmfw/iwm8265fw X-SVN-Commit-Revision: 330227 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.25 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, 01 Mar 2018 06:57:39 -0000 Author: eadler Date: Thu Mar 1 06:57:38 2018 New Revision: 330227 URL: https://svnweb.freebsd.org/changeset/base/330227 Log: MFC r324434: Add support for Intel 8265 WiFi Obtained from: OpenBSD Added: stable/11/sys/modules/iwmfw/iwm8265fw/ - copied from r324434, head/sys/modules/iwmfw/iwm8265fw/ Modified: stable/11/sys/dev/iwm/if_iwm.c stable/11/sys/dev/iwm/if_iwm_8000.c stable/11/sys/dev/iwm/if_iwm_config.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwm.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:57:02 2018 (r330226) +++ stable/11/sys/dev/iwm/if_iwm.c Thu Mar 1 06:57:38 2018 (r330227) @@ -1,4 +1,4 @@ -/* $OpenBSD: if_iwm.c,v 1.42 2015/05/30 02:49:23 deraadt Exp $ */ +/* $OpenBSD: if_iwm.c,v 1.167 2017/04/04 00:40:52 claudio Exp $ */ /* * Copyright (c) 2014 genua mbh @@ -5848,6 +5848,7 @@ iwm_intr(void *arg) #define PCI_PRODUCT_INTEL_WL_7265_2 0x095b #define PCI_PRODUCT_INTEL_WL_8260_1 0x24f3 #define PCI_PRODUCT_INTEL_WL_8260_2 0x24f4 +#define PCI_PRODUCT_INTEL_WL_8265_1 0x24fd static const struct iwm_devices { uint16_t device; @@ -5863,6 +5864,7 @@ static const struct iwm_devices { { PCI_PRODUCT_INTEL_WL_7265_2, &iwm7265_cfg }, { PCI_PRODUCT_INTEL_WL_8260_1, &iwm8260_cfg }, { PCI_PRODUCT_INTEL_WL_8260_2, &iwm8260_cfg }, + { PCI_PRODUCT_INTEL_WL_8265_1, &iwm8265_cfg }, }; static int Modified: stable/11/sys/dev/iwm/if_iwm_8000.c ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_8000.c Thu Mar 1 06:57:02 2018 (r330226) +++ stable/11/sys/dev/iwm/if_iwm_8000.c Thu Mar 1 06:57:38 2018 (r330227) @@ -76,6 +76,7 @@ __FBSDID("$FreeBSD$"); #include "if_iwm_config.h" #define IWM8000_FW "iwm8000Cfw" +#define IWM8265_FW "iwm8265fw" #define IWM_NVM_HW_SECTION_NUM_FAMILY_8000 10 @@ -87,6 +88,13 @@ __FBSDID("$FreeBSD$"); const struct iwm_cfg iwm8260_cfg = { .name = "Intel(R) Dual Band Wireless AC 8260", .fw_name = IWM8000_FW, + IWM_DEVICE_8000_COMMON, + .host_interrupt_operation_mode = 0, +}; + +const struct iwm_cfg iwm8265_cfg = { + .name = "Intel(R) Dual Band Wireless AC 8265", + .fw_name = IWM8265_FW, IWM_DEVICE_8000_COMMON, .host_interrupt_operation_mode = 0, }; Modified: stable/11/sys/dev/iwm/if_iwm_config.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwm_config.h Thu Mar 1 06:57:02 2018 (r330226) +++ stable/11/sys/dev/iwm/if_iwm_config.h Thu Mar 1 06:57:38 2018 (r330227) @@ -131,5 +131,6 @@ extern const struct iwm_cfg iwm3165_cfg; extern const struct iwm_cfg iwm7265_cfg; extern const struct iwm_cfg iwm7265d_cfg; extern const struct iwm_cfg iwm8260_cfg; +extern const struct iwm_cfg iwm8265_cfg; #endif /* __IWM_CONFIG_H__ */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 06:57:03 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 862CFF2D63B; Thu, 1 Mar 2018 06:57:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1FC016E08C; Thu, 1 Mar 2018 06:57:03 +0000 (UTC) (envelope-from eadler@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 1ABEB2517A; Thu, 1 Mar 2018 06:57:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w216v2fj069349; Thu, 1 Mar 2018 06:57:02 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w216v21j069348; Thu, 1 Mar 2018 06:57:02 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010657.w216v21j069348@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 06:57:02 +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: r330226 - stable/11/sys/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/dev/iwm X-SVN-Commit-Revision: 330226 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.25 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, 01 Mar 2018 06:57:03 -0000 Author: eadler Date: Thu Mar 1 06:57:02 2018 New Revision: 330226 URL: https://svnweb.freebsd.org/changeset/base/330226 Log: MFC r321511: [iwm] Sync rs (rate-selection) API definitions from Linux iwlwifi. * While there clean up alignments and line wrapping in existing definitions for rs API in if_iwmreg.h Modified: stable/11/sys/dev/iwm/if_iwmreg.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/iwm/if_iwmreg.h ============================================================================== --- stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:56:34 2018 (r330225) +++ stable/11/sys/dev/iwm/if_iwmreg.h Thu Mar 1 06:57:02 2018 (r330226) @@ -3981,12 +3981,12 @@ enum { * Bit 11-12: (0) 20MHz, (1) 40MHz, (2) 80MHz, (3) 160MHz * 0 and 1 are valid for HT and VHT, 2 and 3 only for VHT */ -#define IWM_RATE_MCS_CHAN_WIDTH_POS 11 -#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS) -#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_POS 11 +#define IWM_RATE_MCS_CHAN_WIDTH_MSK (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_20 (0 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_40 (1 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_80 (2 << IWM_RATE_MCS_CHAN_WIDTH_POS) +#define IWM_RATE_MCS_CHAN_WIDTH_160 (3 << IWM_RATE_MCS_CHAN_WIDTH_POS) /* Bit 13: (1) Short guard interval (0.4 usec), (0) normal GI (0.8 usec) */ #define IWM_RATE_MCS_SGI_POS 13 @@ -3999,7 +3999,7 @@ enum { #define IWM_RATE_MCS_ANT_C_MSK (4 << IWM_RATE_MCS_ANT_POS) #define IWM_RATE_MCS_ANT_AB_MSK (IWM_RATE_MCS_ANT_A_MSK | \ IWM_RATE_MCS_ANT_B_MSK) -#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \ +#define IWM_RATE_MCS_ANT_ABC_MSK (IWM_RATE_MCS_ANT_AB_MSK | \ IWM_RATE_MCS_ANT_C_MSK) #define IWM_RATE_MCS_ANT_MSK IWM_RATE_MCS_ANT_ABC_MSK #define IWM_RATE_MCS_ANT_NUM 3 @@ -4009,8 +4009,8 @@ enum { #define IWM_RATE_MCS_STBC_MSK (1 << IWM_RATE_MCS_STBC_POS) /* Bit 19: (0) Beamforming is off, (1) Beamforming is on */ -#define IWM_RATE_MCS_BF_POS 19 -#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS) +#define IWM_RATE_MCS_BF_POS 19 +#define IWM_RATE_MCS_BF_MSK (1 << IWM_RATE_MCS_BF_POS) /* Bit 20: (0) ZLF is off, (1) ZLF is on */ #define IWM_RATE_MCS_ZLF_POS 20 @@ -4033,29 +4033,65 @@ enum { /* Link quality command flags bit fields */ /* Bit 0: (0) Don't use RTS (1) Use RTS */ -#define IWM_LQ_FLAG_USE_RTS_POS 0 -#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS) +#define IWM_LQ_FLAG_USE_RTS_POS 0 +#define IWM_LQ_FLAG_USE_RTS_MSK (1 << IWM_LQ_FLAG_USE_RTS_POS) /* Bit 1-3: LQ command color. Used to match responses to LQ commands */ -#define IWM_LQ_FLAG_COLOR_POS 1 -#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS) +#define IWM_LQ_FLAG_COLOR_POS 1 +#define IWM_LQ_FLAG_COLOR_MSK (7 << IWM_LQ_FLAG_COLOR_POS) /* Bit 4-5: Tx RTS BW Signalling * (0) No RTS BW signalling * (1) Static BW signalling * (2) Dynamic BW signalling */ -#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4 -#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS) -#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS) -#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_POS 4 +#define IWM_LQ_FLAG_RTS_BW_SIG_NONE (0 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_STATIC (1 << IWM_LQ_FLAG_RTS_BW_SIG_POS) +#define IWM_LQ_FLAG_RTS_BW_SIG_DYNAMIC (2 << IWM_LQ_FLAG_RTS_BW_SIG_POS) /* Bit 6: (0) No dynamic BW selection (1) Allow dynamic BW selection * Dyanmic BW selection allows Tx with narrower BW then requested in rates */ -#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6 -#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS) +#define IWM_LQ_FLAG_DYNAMIC_BW_POS 6 +#define IWM_LQ_FLAG_DYNAMIC_BW_MSK (1 << IWM_LQ_FLAG_DYNAMIC_BW_POS) +/* Single Stream Tx Parameters (lq_cmd->ss_params) + * Flags to control a smart FW decision about whether BFER/STBC/SISO will be + * used for single stream Tx. + */ + +/* Bit 0-1: Max STBC streams allowed. Can be 0-3. + * (0) - No STBC allowed + * (1) - 2x1 STBC allowed (HT/VHT) + * (2) - 4x2 STBC allowed (HT/VHT) + * (3) - 3x2 STBC allowed (HT only) + * All our chips are at most 2 antennas so only (1) is valid for now. + */ +#define IWM_LQ_SS_STBC_ALLOWED_POS 0 +#define IWM_LQ_SS_STBC_ALLOWED_MSK (3 << IWM_LQ_SS_STBC_ALLOWED_MSK) + +/* 2x1 STBC is allowed */ +#define IWM_LQ_SS_STBC_1SS_ALLOWED (1 << IWM_LQ_SS_STBC_ALLOWED_POS) + +/* Bit 2: Beamformer (VHT only) is allowed */ +#define IWM_LQ_SS_BFER_ALLOWED_POS 2 +#define IWM_LQ_SS_BFER_ALLOWED (1 << IWM_LQ_SS_BFER_ALLOWED_POS) + +/* Bit 3: Force BFER or STBC for testing + * If this is set: + * If BFER is allowed then force the ucode to choose BFER else + * If STBC is allowed then force the ucode to choose STBC over SISO + */ +#define IWM_LQ_SS_FORCE_POS 3 +#define IWM_LQ_SS_FORCE (1 << IWM_LQ_SS_FORCE_POS) + +/* Bit 31: ss_params field is valid. Used for FW backward compatibility + * with other drivers which don't support the ss_params API yet + */ +#define IWM_LQ_SS_PARAMS_VALID_POS 31 +#define IWM_LQ_SS_PARAMS_VALID (1 << IWM_LQ_SS_PARAMS_VALID_POS) + /** * struct iwm_lq_cmd - link quality command * @sta_id: station to update @@ -4078,11 +4114,11 @@ enum { * 2 - 0x3f: maximal number of frames (up to 3f == 63) * @rs_table: array of rates for each TX try, each is rate_n_flags, * meaning it is a combination of IWM_RATE_MCS_* and IWM_RATE_*_PLCP - * @bf_params: beam forming params, currently not used + * @ss_params: single stream features. declare whether STBC or BFER are allowed. */ struct iwm_lq_cmd { uint8_t sta_id; - uint8_t reserved1; + uint8_t reduced_tpc; uint16_t control; /* LINK_QUAL_GENERAL_PARAMS_API_S_VER_1 */ uint8_t flags; @@ -4096,7 +4132,7 @@ struct iwm_lq_cmd { uint8_t agg_frame_cnt_limit; uint32_t reserved2; uint32_t rs_table[IWM_LQ_MAX_RETRY_NUM]; - uint32_t bf_params; + uint32_t ss_params; }; /* LINK_QUALITY_CMD_API_S_VER_1 */ /* @@ -4533,7 +4569,8 @@ struct iwm_mvm_tx_resp { uint8_t pa_integ_res_b[3]; uint8_t pa_integ_res_c[3]; uint16_t measurement_req_id; - uint16_t reserved; + uint8_t reduced_tpc; + uint8_t reserved; uint32_t tfd_info; uint16_t seq_ctl; From owner-svn-src-stable-11@freebsd.org Thu Mar 1 07:18:29 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A2DF32308; Thu, 1 Mar 2018 07:18:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EDB5C70AD7; Thu, 1 Mar 2018 07:18:28 +0000 (UTC) (envelope-from eadler@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 E8847254D9; Thu, 1 Mar 2018 07:18:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217ISQl079507; Thu, 1 Mar 2018 07:18:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217ISqw079506; Thu, 1 Mar 2018 07:18:28 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010718.w217ISqw079506@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 07:18: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: r330228 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 330228 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.25 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, 01 Mar 2018 07:18:29 -0000 Author: eadler Date: Thu Mar 1 07:18:28 2018 New Revision: 330228 URL: https://svnweb.freebsd.org/changeset/base/330228 Log: MFC r325123: Reference iwm8265fw support in iwm(4) as well This documentation update is similar to what was done in iwmfw(4) in r325121. Modified: stable/11/share/man/man4/iwm.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/iwm.4 ============================================================================== --- stable/11/share/man/man4/iwm.4 Thu Mar 1 06:57:38 2018 (r330227) +++ stable/11/share/man/man4/iwm.4 Thu Mar 1 07:18:28 2018 (r330228) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 26, 2016 +.Dd October 29, 2017 .Dt IWM 4 .Os .Sh NAME @@ -49,6 +49,7 @@ Choose one from: .Cd "device iwm7260fw" .Cd "device iwm7265fw" .Cd "device iwm8000Cfw" +.Cd "device iwm8265fw" .Ed .Pp Or you can use @@ -67,6 +68,7 @@ iwm3160fw_load="YES" iwm7260fw_load="YES" iwm7265fw_load="YES" iwm8000Cfw_load="YES" +iwm8265fw_load="YES" .Ed .Sh DESCRIPTION The From owner-svn-src-stable-11@freebsd.org Thu Mar 1 07:22:54 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 53C6EF3312D; Thu, 1 Mar 2018 07:22:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 296B9714F3; Thu, 1 Mar 2018 07:22:54 +0000 (UTC) (envelope-from eadler@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 2460E25693; Thu, 1 Mar 2018 07:22:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217MrjA084278; Thu, 1 Mar 2018 07:22:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217Mrdk084277; Thu, 1 Mar 2018 07:22:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010722.w217Mrdk084277@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 07:22: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: r330229 - stable/11/sys/conf X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/conf X-SVN-Commit-Revision: 330229 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.25 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, 01 Mar 2018 07:22:54 -0000 Author: eadler Date: Thu Mar 1 07:22:53 2018 New Revision: 330229 URL: https://svnweb.freebsd.org/changeset/base/330229 Log: MFC r325122,r325124,r325125: Fill in the blanks for iwm8265fw(4) rules, missed in r324434 Now using "device iwmfw" or "device iwm8265fw" in one's kernel configuration will potentially result in a working IWM8265 series wireless SoC. This is an alternative to the fix that was made in r324470 for `sys/modules/iwmfw`. Modified: stable/11/sys/conf/files Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 07:18:28 2018 (r330228) +++ stable/11/sys/conf/files Thu Mar 1 07:22:53 2018 (r330229) @@ -1940,6 +1940,20 @@ iwm8000C.fw optional iwm8000Cfw | iwmfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm8000C.fw" +iwm8265.fw optional iwm8265fw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-8265-22.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm8265.fw" +iwm8265fw.c optional iwm8265fw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm8265.fw:iwm8265fw -miwm8265fw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm8265fw.c" +iwm8265fw.fwo optional iwm8265fw | iwmfw \ + dependency "iwm8265.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm8265fw.fwo" dev/iwn/if_iwn.c optional iwn iwn1000fw.c optional iwn1000fw | iwnfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwn1000.fw:iwn1000fw -miwn1000fw -c${.TARGET}" \ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 07:42:21 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 6A261F37BE8; Thu, 1 Mar 2018 07:42:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1D82472F24; Thu, 1 Mar 2018 07:42:21 +0000 (UTC) (envelope-from eadler@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 181C1259C5; Thu, 1 Mar 2018 07:42:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217gLZq093564; Thu, 1 Mar 2018 07:42:21 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217gKY4093543; Thu, 1 Mar 2018 07:42:20 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010742.w217gKY4093543@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 07:42:20 +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: r330230 - in stable/11/sys: conf contrib/dev/iwm modules/iwmfw modules/iwmfw/iwm3160fw modules/iwmfw/iwm7260fw modules/iwmfw/iwm7265Dfw modules/iwmfw/iwm7265fw modules/iwmfw/iwm8000Cfw X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/sys: conf contrib/dev/iwm modules/iwmfw modules/iwmfw/iwm3160fw modules/iwmfw/iwm7260fw modules/iwmfw/iwm7265Dfw modules/iwmfw/iwm7265fw modules/iwmfw/iwm8000Cfw X-SVN-Commit-Revision: 330230 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.25 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, 01 Mar 2018 07:42:21 -0000 Author: eadler Date: Thu Mar 1 07:42:20 2018 New Revision: 330230 URL: https://svnweb.freebsd.org/changeset/base/330230 Log: MFC r313419,r313420,r313421,r313423,r313426,r313428,r314078,r314079,r319584,r319586,r319588,r324469,r324470,r324435,r325122: [iwmfw] add version 17 firmware. [iwmfw] add version 17 firmware. [iwmfw] add version 17 firmware. [iwmfw] add this 3 megabyte firmware image. [iwmfw] bump firmware to version 17. [iwmfw] back this out to version 16 for now. [iwmfw] add 7265D firmware. [iwmfw] add 7265D firmware. [iwmfw] add 7265D-22 firmware [iwmfw] 8000C ver 22 firmware. [iwmfw] bump built firmware now to version 22 for 7265D and 8000C. [iwmfw] Add missing SUBDIR needed for iwmfw to load after ^/head@r324434 [iwmfw] Add the firmware for the Intel 8265 WiFi device. Added: stable/11/sys/contrib/dev/iwm/iwm-3160-17.fw.uu - copied unchanged from r313419, head/sys/contrib/dev/iwm/iwm-3160-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-7260-17.fw.uu - copied unchanged from r313420, head/sys/contrib/dev/iwm/iwm-7260-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-7265-17.fw.uu - copied unchanged from r313421, head/sys/contrib/dev/iwm/iwm-7265-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-7265D-22.fw.uu - copied unchanged from r319584, head/sys/contrib/dev/iwm/iwm-7265D-22.fw.uu stable/11/sys/contrib/dev/iwm/iwm-8000C-17.fw.uu - copied unchanged from r313423, head/sys/contrib/dev/iwm/iwm-8000C-17.fw.uu stable/11/sys/contrib/dev/iwm/iwm-8000C-22.fw.uu - copied unchanged from r319586, head/sys/contrib/dev/iwm/iwm-8000C-22.fw.uu stable/11/sys/contrib/dev/iwm/iwm-8265-22.fw.uu - copied unchanged from r324435, head/sys/contrib/dev/iwm/iwm-8265-22.fw.uu stable/11/sys/modules/iwmfw/iwm7265Dfw/ - copied from r314079, head/sys/modules/iwmfw/iwm7265Dfw/ Modified: stable/11/sys/conf/files stable/11/sys/modules/iwmfw/Makefile stable/11/sys/modules/iwmfw/iwm3160fw/Makefile stable/11/sys/modules/iwmfw/iwm7260fw/Makefile stable/11/sys/modules/iwmfw/iwm7265Dfw/Makefile stable/11/sys/modules/iwmfw/iwm7265fw/Makefile stable/11/sys/modules/iwmfw/iwm8000Cfw/Makefile Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Thu Mar 1 07:22:53 2018 (r330229) +++ stable/11/sys/conf/files Thu Mar 1 07:42:20 2018 (r330230) @@ -1926,6 +1926,20 @@ iwm7265.fw optional iwm7265fw | iwmfw \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "iwm7265.fw" +iwm7265Dfw.c optional iwm7265Dfw | iwmfw \ + compile-with "${AWK} -f $S/tools/fw_stub.awk iwm7265D.fw:iwm7265Dfw -miwm7265Dfw -c${.TARGET}" \ + no-implicit-rule before-depend local \ + clean "iwm7265Dfw.c" +iwm7265Dfw.fwo optional iwm7265Dfw | iwmfw \ + dependency "iwm7265D.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "iwm7265Dfw.fwo" +iwm7265D.fw optional iwm7265Dfw | iwmfw \ + dependency "$S/contrib/dev/iwm/iwm-7265D-17.fw.uu" \ + compile-with "${NORMAL_FW}" \ + no-obj no-implicit-rule \ + clean "iwm7265D.fw" iwm8000Cfw.c optional iwm8000Cfw | iwmfw \ compile-with "${AWK} -f $S/tools/fw_stub.awk iwm8000C.fw:iwm8000Cfw -miwm8000Cfw -c${.TARGET}" \ no-implicit-rule before-depend local \ Copied: stable/11/sys/contrib/dev/iwm/iwm-3160-17.fw.uu (from r313419, head/sys/contrib/dev/iwm/iwm-3160-17.fw.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/contrib/dev/iwm/iwm-3160-17.fw.uu Thu Mar 1 07:42:20 2018 (r330230, copy of r313419, head/sys/contrib/dev/iwm/iwm-3160-17.fw.uu) @@ -0,0 +1,20409 @@ +begin 644 iwm-3160-17.fw +M`````$E73`IS=')E86TZ3&EN=7A?0V]R94-Y8VQE,31?````"`````(`````````'````!`````````` +M````````````````&P````0````!````$P````0``0```(```````!$```#B +M804```$```````"$?(``,"B``(RF@`#,F8``Z!.``(";@``````````````` +M``````````````````!L(,`0#QL)(MP=P!`*`!M`(``;;@0``&$0`!MN`0`` +M810``&$/``!A```;)"``&R7D'<`1W`3`$@$`&W`(``!A#QP=(@0`'2;H'<`0 +M`0`;,.@=P!&"!!LD"``;)00HP!'I#P!A```;)0`!&R1<',`1````8=P=P!`` +M`!TD````(0$`6#$/10`B`%P`.?0EP!`!`1,R`0$3,P$`$V+O_P`R!```8@-@ +M`&(``%@X`@!8,6,``&'D!,`2Z!W`$0$`4B2T'\`0`@`3<`,``&$(`%@P"`!D +M,0<``&$/$U(B@@03)`@`$R4!`%)N`0``80$``&$```!A"`!8;NL/`&$``!,E +M```3)"00P!$`@!,D```3)3@!,B!`#* +M$0```20```$E"0``84``$R4&`1,D!"C`$0]V$R(L2,<1#W@3(@``QA$#``$D +M```!)0]%`"(`7``Y[_\`,AD``&0`@!,D`0`3)3@P'P!($*,`1\`?`$LA)QQ$/@=P!`/$P'AX>'AL7 +M%!(*'AX>'AX>'AL7%!(*'AX>'AX>'AL7%!(*'AX````````````````8M@$` +M!0```@0```!#AY.(@< +MB1R*'(L)P```L```!TH@$`#````/3_`0`- +M````6%("``X```"@"6`+X`4````"!.```````````````` +M```$`````0`````````!`````0```!X```````````````$!#@X````````R +M"`(/`P`!``````````$!#@X````````C!`(*`````````````/0!```````` +M````````````````.%"````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````0`````)`!```` +MH``0)P``Z`,``.@#```0(X``$".``/R$@`#XA(``^(2``/"$@`#\A(``^(2` +M`/B$@`#PA(``\(2``/R$@`#\A(``\(2``/R$@`#TA(```````/__```!`0`` +M``````````$`````L!T!`+`=`0"P'0$`!/\``+`=`0"P'0$`.`$!`+`=`0`` +M]```P/T``+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`= +M`0"P'0$`L!T!`+`=`0!D&`$`7!4!`+P8`0"P'0$`L!T!`+`=`0#`#@$`/!T! +M`%`1`0`$$@$`"!$!`+@%`0`(!0$`;`H!`)@4`0#0'0$`L!T!``3R``"<]``` +ML!T!`)CX``#@]@``>`8!`!`"`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P +M'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!``#_ +M``#\_@``^/X``+`=`0"P'0$`L!T!`+`=`0"P'0$`\`$!`+`=`0"P'0$`L!T! +M`+`=`0"P'0$`P!H!`+`=`0"P'0$`-`X!`,`-`0"P'0$`L!T!`+`=`0``#@$` +ML!T!`+`=`0"P'0$`L!T!`+`=`0#(_```W/L``+`=`0"P'0$`L!T!`'0(`0#L +M'P$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`$@4`0"P'0$`%`D!`+`= +M`0#H#0$`L!T!``C_``"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0!L_@``L!T! +M`+`=`0"P'0$`L!T!`+`=`0"P'0$`'!H!`/0,`0"P'0$`L!T!`+`=`0"8_0`` +ML!T!`/C\``!T!@$`L!T!`-@&`0"P'0$`L!T!`+`=`0!X_0``L!T!`+`=`0`T +M_P``L!T!`(P:`0!P`@$`L!T!`+`=`0#<``$`Z!\!`+`=`0`\&@$`L!T!``@, +M`0`H_```G!D!`+`=`0"P'0$`@`P!`+`=`0"P'0$`L!T!`%P&`0"P'0$`L!T! +M`+`=`0"P'0$`L!T!`#P#`0"P'0$`L!T!`+`=`0"P'0$`L!T!`/@3`0"P'0$` +ML!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P +M'0$`L!T!`#0(`0#P'P$`L!T!`+`=`0"P'0$`L!T!`+`=`0"P'0$`//8``+`= +M`0"P'0$`L!T!`*0?`0"``P$`L!T!`+`=`0"P'0$`L!T!`,P#`0`$%0$`2/8` +M`+`=`0"P'0$`L!T!`+`=`0"P'0$`Y!\!`+`=`0#```````````````````````````````````````#T*@$`!0```@0` +M``!`8```#_!P!8 +M!P```/\@``P0$``$`1`.$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0#Q`)$!`% +M"A`+$!`0$`(0$`T0$!`0$!`0$!`0$`8#$!`0$!`0$!`0$!`0$!`($!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0!Q`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!``````!(6` +M```````````````````````````````````````````````````````````` +M`````/\```#__________________________P`````````````````````` +M`````````````````````````````````````````````````````````"BP +M`0`@-@$`"+8!`"`V`0#0;@(`(#8!`#PC`0!,3@(`D%8!`"`V`0`@-@$`7%(" +M`%Q2`@!<4@(`7%("`%Q2`@!<4@(`7%("`"`V`0`@-@$`(#8!`"`V`0`HD@`` +M(#8!`"`V`0`@-@$`(#8!`"`V`0!@5@$`2%8!`"`V`0`@-@$````````````` +M`````````````````````````````````````0````$````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````$````"`````P````````#_````_P```/\```#_```` +M````````````````````````````````_P```(@3```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````#_____```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````"``````````````````````````/____\````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````(``````````````````````````_____P`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````@`````````````````````````#_____```````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````"``````````````````````````/____\` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````(`````````````````````````` +M``````````````````````````#_```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````_____P````#_____`````/____\`````_____P``````````#P`_ +M``$````/`#\``0````\`/P`!````#P`_``$````/`#\``0`````````/`#\` +M`0````\`/P`!````#P`_``$````/`#\``0````\`/P`!``````````\`/P`! +M````#P`_``$````/`#\``0````\`/P`!````#P`_``$`````````#P`_``$` +M```/`#\``0````\`/P`!````#P`_``$````/`#\``0`````````/`#\``0`` +M``\`/P`!````#P`_``$````/`#\``0````\`/P`!``````````````"K```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``#J"J(*7@H="N`)I0EM"3<)!`G3"*0(=PA+""((^@?3!ZX'B@<````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````!42````@````0```!#C($&QY?#C(%(!Y@ +M#C(&)1YB#C('*AYC#C((+QYD#C()-!YE#C(*.1YG#C(+/AYH#C(,0QYI#C(- +M2!YJ#C(.31YL#C(B4$`-(``D8$`/(#$F<$`2(#0H`$$4(#$J$$$7(#$L($$9 +M(#$N,$$<(#,P0$$>(#$R4$$A(#$T8$$C(#$V<$$F(#,X`$(H(#$Z$$(K(#$\ +M($(M(#$^,$(P(#-`0$(R(#%D8$1?(C!F<$1B(C)H`$5D(B]J$$5G(B]L($5I +M(B]N,$5L(C)P0$5N(B]R4$5Q(B]T8$5S(B]V<$5V(C)X`$9X(B]Z$$9[(B]\ +M($9](B]^,$:`(C&`0$:"(B^"4$:%(@"$8$:'(BZ&<$:*(C&(`$>,(BZ*$$>/ +M(BZ,($>1(BZ.,$>4(C"00$>6(BV12$>8(@"5:$>=(BV7>$>?(C"9"$BB)"V; +M&$BD)"V=*$BG)"V?.$BI)#"A2$BL)"VE:$BQ)"T````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````/``\`#P`/ +M``\`#P`/``\````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````0`!``````#``)``T``````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````#QB```*````!````%Q^@``````````````````````````````` +M````````````````````````_____Z#%@````````````$!"#P!`0@\`0$(/ +M`$!"#P!`0@\`0$(/`$!"#P!`0@\`0$(/`$!"#P#@!P``0`$``.`'``!``0`` +M("<``.`'``#@!P``0`$``.`'``!``0```@`````````"```````````````` +M`````````````````````````````````````````-1M@`!\XX``&``````` +M``````````````````#_____```````````````````````````````````` +M`````````````````````````````````````````````````.`3`@`$%`(` +M%!0"`.P3`@#<$P(`&!0"`,03`@```````%`````P```````````````````` +M``````````!```"`,0``@`X``````````````````````````````"X````R +M````(``````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````"0'@(`[!H"`(`>`@!T'0(`8!X"`."H`0`8'@(`'!L" +M`*`<`@#0&@(`U!H"```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`(````````````````````"`````@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("` +M@("`@("`@("`@("`@(```@```````````````````````````````(`````` +M`/\```````````(```````````````````````````````"```````#_```` +M```````"````````````````````````````````@```````_P`````````` +M`@```````````````````````````````(```````/\```````````(````` +M``````````````````````````"```````#_```````````"```````````` +M````````````````````@```````_P```````````@`````````````````` +M`````````````(```````/\```````````(````````````````````````` +M``````"```````#_```````````"```````````````````````````````` +M@```````_P```````````@```````````````````````````````(`````` +M`/\```````````(```````````````````````````````"```````#_```` +M```````"````````````````````````````````@```````_P`````````` +M`@```````````````````````````````(```````/\```````````(````` +M``````````````````````````"```````#_```````````"```````````` +M````````````````````@```````_P```````````@`````````````````` +M`````````````(```````/\``````````````````($`````````@@`````` +M``"#`````````(0`````````A0````````"&`````````(<`````````B``` +M``````")`````````(H`````````BP````````",`````````(T````````` +MC@````````"/`````````,`!```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`,!G``"09P``%&@``*AG```8:```B&<``,1G``#_````_P```/\```#_```` +M_P```/\```#_````_P```/\```#_````_P```/\```#_````_P```/\```#_ +M````_P```/\```#_````_P```/\```#_````_P```/\```#_````_P```/\` +M``#_````_P```/\```#_```````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````&""@`!P@H``H(*``+""@`#@@H``@ +M(*``)""@`#`@H``T(*``/""@`$`AH`!$(:``:"&@`&PAH`!X(:``2"&@`$PA +MH`!P(:``="&@`'PAH```````_P`````````````````````````````````` +M```````````````````````T+0(`!0```@0```!6]Y:7E]=W9W;W=I=WUU=G5O=6EU?7-VR5T +M)8HC@B-[(W0CBB&"(7LA="&/!8<%?P5X!8\#AP-_`W@#?7EV>6]Y:7E]=W9W +M;W=I=WUU=G5O=6EU?7-V4%R06Q!9D%Z)7,E;25G)7HCB%S +M(6TA9R%]!78%;P5I!7T#=@-O`VD#?7EV>6]Y:7E]=W9W;W=I=WUU=G5O=6EU +M?7-V7)Y;'F`=WEW75R=6QU@'-Y6]R;VQO@&UY;7)M;&V`:WEK6ER:6QI@&=Y9W)G;&>` +M97EE6-R8VQC@&%Y87)A;&%_17A%<45K17]#>$-Q0VM#?T%X07%! +M:T&$)7TE=B5O)80C?2-V(V\CA"%](78A;R&'!7\%>`5R!8<#?P-X`W(#```` +M``````#^````T-"ZN;>WN+>X`````````````````````````.^^K=[OOJW> +M[[ZMWN^^K=X``````````````````````````%1Q```*````!````%Q^@``` +M````S/X``+`=`0"\!`$``````/\````$````````````````````__\``(0U +M``"8-0``K#4``#@U```P-0``0#4``*PT``"D-```<.(``'S>``"$WP``X-\` +M``3?``!DWP``O-\``+CB``#,Z```%.D``,3I```.D``+#I```4Z@`` +M3-\``##?``!PW@`````````````"`@7_`@,```(!`0$#`P#_`P$!`0,``@(# +M`@4&```"_P````,```$#``$$!``#`P4``@4&`0$!_P$``@(!`P`%`0(%!@`` +M```````````````````8+0(`!@````0```!W]\$W@```P4'"0L5 +M#0\1$P```P`&!@8&!@8```````````,-+XF)-T.)B8F)B7.)66$`58)K38F) +MB8F)0TT"T`````!A04%`04%!0"%!04``````0&``8$!@8& +M!@8&!@8&!@8&!@(&!``````+!P,`.S____'____R#___\A____ +M_R+___\C____)/___R7___\F`````````````````````````````,`L```` +M````P"P``````````````@````(````L@0$`Z((````````````````````` +M```````````````````/`#\``@````\`/P`"````#P`_``(````/`#\``@`` +M``\`/P`"(`````````$```"JJJJJJJJJJJJJJNZJJJJJ*/\`S*JJ``"JJ@#, +MJJH```!``,``0`#``%``\`!0`/`````````````````````````````````` +M``````````````````````````````"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJ +MJJJJJJJJJJJJJ@``````````````````````;&UN;W!Q0GMH +M+Z$]FA\6*;27T!XXCN,X',=Q'+V$]A*.XS@.',=Q'([C.`Y>0GL)QW$8!'`*(`M`"=0#J`%\!U`&^`J@#'022!'P%&`;J`-0! +MO@*H`WP%4`=BM>9-FNQ%CYT?0(F'^A7O +MZ[+)C@O[[$%GL_U?ZD6_(_=3EN1;F\)U'.&N/6I,6FQ!?@+U3X-<:/11--$( +M^9/B5/%NW%AM>:56:4$<^*$.D&!('^\*!$>+HE +MXTOSHOY=P("*!:T_O"%(<`3QWV/!=W6O8T(P(!KE#OUMOTR!%!@U)B_#X;ZB +M-JS(Y[HK,I7FH,"8&=&>?Z-F1'Y4JSN#"\J,*:?BO!T6=JT[VU9D3G0>%-N2"@QL2.2X79]NO>]#IL2H.:0Q-].+\C+50XM9 +M;K?:C`%DL=*RWO\J-9M.BP``0($!`8&"`@````1```````````````` +M````9````!````#_``P@"````!(````````````````````L`0``$````/\` +M#"`"````$P```````````````````"P!```0````_P`,(`<````4```````` +M`$`&`````````0```!`````!``Q`!````!4`````````0`8````````!```` +M$`````$`#$`#````%@````````!`!@````````$````0`````0`,0`,````7 +M`````````````````````0```!````#_``0`!````!@`````````0`8````` +M```R````,@````$!S$`#````&0````````````````````$````!`````0$` +M@`$````:`````````````````````0````$```#__P"@!0```!L````````` +M$``````````!````$`````$"!``&````'``````````$``````````$````! +M`````0`,``$````=``````````0``````````0````$````!``P``0```!X` +M````````!``````````!`````0````$``(`!````'P`````````````````` +M``$````(````_P`,(`8````@`````````````````````0````@```#_``P@ +M`@```"$````````````````````!`````0```/\`#*`#````(@`````````` +M``````````$````!`````0(,@`$````C`````````````````````0````$` +M``#_``"@!@```"0````````````````````!`````0````$"1``"````)0`` +M``````````````````$````0````_P`,(`,````F`````````-@````````` +M`0```&0````!``@``@```"<`````````+`$````````!`````0````$`#$`$ +M````*``````````L`0````````$````!````_P`,0`0````I`````````"P! +M`````````0````$````!``Q`!````"H`````````+`$````````!`````0`` +M``$`#$`#````*P`````````L`0````````$````!`````0`,0`4````L```` +M``````(``````````0````$````!``0`!0```"T`````````!``````````! +M`````0````$`#$`!````+@`````````L`0````````$```!I`````0`,0`,` +M```O``````````````````````(``!(```#_``Q@`@```#``````````,@`` +M``````!D````$````/\`#&`&````,0`````````L`0````````$```!N```` +M`0`,0`0````$#`P(%!0$!$````"```````$````"````!````$```$````!` +M````_T%5514`````@(B("`````$``!S_____`!````0!`!C^__]_``@```0" +M`1C_____`!````$!`1C_____`!````,``!S\_U+550T```(``!S\_Z?JJPX` +M``4"`1C\_U+550T```(!`1C\_Z?JJPX```,!`1C\_U+550T```4!`!C\_ZEJ +MJP8```!````7````>*X``!0``````````0```(1\`0``````>-,```,```!` +MLP``!`````C.```(````N,L```P```"LO@``$0`````````3````!*\``!8` +M```\<`(``````##3```$````4&X"``4```"LN0``"````+S+```,````8,$` +M``T`````````$0```````````````````-#2``` Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DDB15F39CBA; Thu, 1 Mar 2018 07:55:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 863837379F; Thu, 1 Mar 2018 07:55:48 +0000 (UTC) (envelope-from eadler@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 7D16625B94; Thu, 1 Mar 2018 07:55:48 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217tmYm099332; Thu, 1 Mar 2018 07:55:48 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217tmNF099331; Thu, 1 Mar 2018 07:55:48 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010755.w217tmNF099331@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 07:55:48 +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: r330231 - stable/11/share/man/man4 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/man/man4 X-SVN-Commit-Revision: 330231 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.25 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, 01 Mar 2018 07:55:49 -0000 Author: eadler Date: Thu Mar 1 07:55:48 2018 New Revision: 330231 URL: https://svnweb.freebsd.org/changeset/base/330231 Log: MFC r314080: Modified: stable/11/share/man/man4/iwmfw.4 Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/iwmfw.4 ============================================================================== --- stable/11/share/man/man4/iwmfw.4 Thu Mar 1 07:42:20 2018 (r330230) +++ stable/11/share/man/man4/iwmfw.4 Thu Mar 1 07:55:48 2018 (r330231) @@ -55,6 +55,7 @@ module at boot time, place the following line in iwm3160fw_load="YES" iwm7260fw_load="YES" iwm7265fw_load="YES" +iwm7265Dfw_load="YES" iwm8000Cfw_load="YES" .Ed .Sh DESCRIPTION From owner-svn-src-stable-11@freebsd.org Thu Mar 1 08:05:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A7CA3F3B518; Thu, 1 Mar 2018 08:05:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5A5CA740BA; Thu, 1 Mar 2018 08:05:53 +0000 (UTC) (envelope-from eadler@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 5412625D59; Thu, 1 Mar 2018 08:05:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w2185rbP004642; Thu, 1 Mar 2018 08:05:53 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w2185r4A004640; Thu, 1 Mar 2018 08:05:53 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010805.w2185r4A004640@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 08:05: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: r330233 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330233 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.25 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, 01 Mar 2018 08:05:54 -0000 Author: eadler Date: Thu Mar 1 08:05:52 2018 New Revision: 330233 URL: https://svnweb.freebsd.org/changeset/base/330233 Log: MFC r324570,r324580: [net80211] begin handling multiple hardware decap'ed A-MSDU in the RX path. The duplicate detection code currently expects A-MSDU frames to be encaped - they're decap'ed /after/ duplicate detection. However for ath10k (and iwm hardware later on) the firmware supports doing A-MSDU decap in hardware - which shows up as multiple frames with the same sequence number and IV. This is the first part of decap handling - if we see a stretch of A-MSDU frames from the driver with the MORE bit set, then don't treat them as duplicates. This isn't 100% complete as crypto sequence number handling and "A-MSDU in A-MPDU" needs handling, but it's a start. This should be a glorified no-op for everyone. Please tell me if it isn't. Modified: stable/11/sys/net80211/ieee80211_input.h stable/11/sys/net80211/ieee80211_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_input.h ============================================================================== --- stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 07:59:14 2018 (r330232) +++ stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 08:05:52 2018 (r330233) @@ -131,7 +131,39 @@ ishtinfooui(const uint8_t *frm) return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } +static __inline int +ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) +{ + + return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); +} + /* + * Return 1 if the rxseq check should increment the sequence + * number. Return 0 if it's part of an AMSDU batch and it isn't + * the final frame in the decap'ed burst. + */ +static __inline int +ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) +{ + /* No state? ok */ + if (rxs == NULL) + return (1); + + /* State but no AMSDU set? ok */ + if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0) + return (1); + + /* State, AMSDU set, then _MORE means "don't inc yet" */ + if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) { + return (0); + } + + /* Both are set, so return ok */ + return (1); +} + +/* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. * @@ -225,7 +257,20 @@ ieee80211_check_rxseq(struct ieee80211_node *ni, struc goto fail; ok: - ni->ni_rxseqs[tid] = rxseq; + /* + * Only bump the sequence number if it's the last frame + * in a batch. That way frames in the rest of the batch + * get included, and the last frame in the batch kicks + * it next. + */ + if (ieee80211_check_rxseq_amsdu_more(rxs)) { + ni->ni_rxseqs[tid] = rxseq; + if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) + IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); + } else { + /* .. still waiting */ + IEEE80211_NODE_STAT(ni, rx_amsdu_more); + } return 1; Modified: stable/11/sys/net80211/ieee80211_ioctl.h ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 07:59:14 2018 (r330232) +++ stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 08:05:52 2018 (r330233) @@ -84,7 +84,11 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ - uint32_t ns_spare[8]; + + /* Hardware A-MSDU decode */ + uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */ + uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */ + uint32_t ns_spare[6]; }; /* From owner-svn-src-stable-11@freebsd.org Thu Mar 1 07:59:15 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 169DFF3A4ED; Thu, 1 Mar 2018 07:59:15 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B5FF573AE6; Thu, 1 Mar 2018 07:59:14 +0000 (UTC) (envelope-from eadler@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 95A6C25BA4; Thu, 1 Mar 2018 07:59:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w217xE6D099521; Thu, 1 Mar 2018 07:59:14 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w217xEfO099517; Thu, 1 Mar 2018 07:59:14 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803010759.w217xEfO099517@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 07:59: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: r330232 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330232 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.25 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, 01 Mar 2018 07:59:15 -0000 Author: eadler Date: Thu Mar 1 07:59:14 2018 New Revision: 330232 URL: https://svnweb.freebsd.org/changeset/base/330232 Log: MFC r307602: [net80211] Initial full-offload scan support. This is a very simple addition to the net80211 scan support. It doesn't implement a replacement scan interface - it just disables the pieces that we should disable to make this lifecycle a bit more managable. There's more work to come before full scan offload support is available but it should be good enough for driver work. * add a flag to say "full offload" * don't do probe requests when scanning full-offload - firmware can do that * don't do powersave transitions and buffering - firmware can do that tested: * iwm(4) - STA mode * ath10k port (local, not in freebsd-head yet) Modified: stable/11/sys/net80211/ieee80211_scan_sw.c stable/11/sys/net80211/ieee80211_var.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_scan_sw.c ============================================================================== --- stable/11/sys/net80211/ieee80211_scan_sw.c Thu Mar 1 07:55:48 2018 (r330231) +++ stable/11/sys/net80211/ieee80211_scan_sw.c Thu Mar 1 07:59:14 2018 (r330232) @@ -410,6 +410,12 @@ ieee80211_swscan_bg_scan(const struct ieee80211_scanne return (ic->ic_flags & IEEE80211_F_SCAN); } +/* + * Taskqueue work to cancel a scan. + * + * Note: for offload scan devices, we may want to call into the + * driver to try and cancel scanning, however it may not be cancelable. + */ static void cancel_scan(struct ieee80211vap *vap, int any, const char *func) { @@ -506,6 +512,12 @@ ieee80211_swscan_probe_curchan(struct ieee80211vap *va int i; /* + * Full-offload scan devices don't require this. + */ + if (vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) + return; + + /* * Send directed probe requests followed by any * broadcast probe request. * XXX remove dependence on ic/vap->iv_bss @@ -611,7 +623,14 @@ scan_start(void *arg, int pending) return; } - if (vap->iv_opmode == IEEE80211_M_STA && + /* + * Put the station into power save mode. + * + * This is only required if we're not a full-offload devices; + * those devices manage scan/traffic differently. + */ + if (((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) && + vap->iv_opmode == IEEE80211_M_STA && vap->iv_state == IEEE80211_S_RUN) { if ((vap->iv_bss->ni_flags & IEEE80211_NODE_PWR_MGT) == 0) { /* Enable station power save mode */ @@ -864,7 +883,12 @@ scan_done(struct ieee80211_scan_state *ss, int scandon * waiting for us. */ if (scandone) { - vap->iv_sta_ps(vap, 0); + /* + * If we're not a scan offload device, come back out of + * station powersave. Offload devices handle this themselves. + */ + if ((vap->iv_flags_ext & IEEE80211_FEXT_SCAN_OFFLOAD) == 0) + vap->iv_sta_ps(vap, 0); if (ss->ss_next >= ss->ss_last) ic->ic_flags_ext &= ~IEEE80211_FEXT_BGSCAN; Modified: stable/11/sys/net80211/ieee80211_var.h ============================================================================== --- stable/11/sys/net80211/ieee80211_var.h Thu Mar 1 07:55:48 2018 (r330231) +++ stable/11/sys/net80211/ieee80211_var.h Thu Mar 1 07:59:14 2018 (r330232) @@ -601,11 +601,12 @@ MALLOC_DECLARE(M_80211_VAP); #define IEEE80211_FEXT_WDSLEGACY 0x00010000 /* CONF: legacy WDS operation */ #define IEEE80211_FEXT_PROBECHAN 0x00020000 /* CONF: probe passive channel*/ #define IEEE80211_FEXT_UNIQMAC 0x00040000 /* CONF: user or computed mac */ +#define IEEE80211_FEXT_SCAN_OFFLOAD 0x00080000 /* CONF: scan is fully offloaded */ #define IEEE80211_FEXT_BITS \ "\20\2INACT\3SCANWAIT\4BGSCAN\5WPS\6TSN\7SCANREQ\10RESUME" \ "\0114ADDR\12NONEPR_PR\13SWBMISS\14DFS\15DOTD\16STATEWAIT\17REINIT" \ - "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC" + "\20BPF\21WDSLEGACY\22PROBECHAN\23UNIQMAC\24SCAN_OFFLOAD" /* ic_flags_ht/iv_flags_ht */ #define IEEE80211_FHT_NONHT_PR 0x00000001 /* STATUS: non-HT sta present */ From owner-svn-src-stable-11@freebsd.org Thu Mar 1 08:33:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B8F7DF3F6FB; Thu, 1 Mar 2018 08:33:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 67B1F7532E; Thu, 1 Mar 2018 08:33:20 +0000 (UTC) (envelope-from avg@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 62A9126260; Thu, 1 Mar 2018 08:33:20 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w218XKjw019290; Thu, 1 Mar 2018 08:33:20 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w218XKWW019289; Thu, 1 Mar 2018 08:33:20 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803010833.w218XKWW019289@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 1 Mar 2018 08:33:20 +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: r330235 - stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Commit-Revision: 330235 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.25 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, 01 Mar 2018 08:33:20 -0000 Author: avg Date: Thu Mar 1 08:33:20 2018 New Revision: 330235 URL: https://svnweb.freebsd.org/changeset/base/330235 Log: MFC r329711: MFV r329710: 8966 use after end of the lifetime of a local variable PR: 225162 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Mar 1 08:30:08 2018 (r330234) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_acl.c Thu Mar 1 08:33:20 2018 (r330235) @@ -1171,6 +1171,7 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t sa_bulk_attr_t bulk[5]; uint64_t ctime[2]; int count = 0; + zfs_acl_phys_t acl_phys; mode = zp->z_mode; @@ -1217,7 +1218,6 @@ zfs_aclset_common(znode_t *zp, zfs_acl_t *aclp, cred_t } else { /* Painful legacy way */ zfs_acl_node_t *aclnode; uint64_t off = 0; - zfs_acl_phys_t acl_phys; uint64_t aoid; if ((error = sa_lookup(zp->z_sa_hdl, SA_ZPL_ZNODE_ACL(zfsvfs), From owner-svn-src-stable-11@freebsd.org Thu Mar 1 10:35:06 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2EC88F34E01; Thu, 1 Mar 2018 10:35:06 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B3BD27AF69; Thu, 1 Mar 2018 10:35:05 +0000 (UTC) (envelope-from avg@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 AE81A27655; Thu, 1 Mar 2018 10:35:05 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21AZ5pV079725; Thu, 1 Mar 2018 10:35:05 GMT (envelope-from avg@FreeBSD.org) Received: (from avg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21AZ5eC079723; Thu, 1 Mar 2018 10:35:05 GMT (envelope-from avg@FreeBSD.org) Message-Id: <201803011035.w21AZ5eC079723@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: avg set sender to avg@FreeBSD.org using -f From: Andriy Gapon Date: Thu, 1 Mar 2018 10:35:05 +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: r330237 - in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Group: stable-11 X-SVN-Commit-Author: avg X-SVN-Commit-Paths: in stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs: . sys X-SVN-Commit-Revision: 330237 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.25 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, 01 Mar 2018 10:35:06 -0000 Author: avg Date: Thu Mar 1 10:35:05 2018 New Revision: 330237 URL: https://svnweb.freebsd.org/changeset/base/330237 Log: MFC r329314: MFV r329313: 8857 zio_remove_child() panic due to already destroyed parent zio PR: 223803 Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Mar 1 10:31:51 2018 (r330236) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Thu Mar 1 10:35:05 2018 (r330237) @@ -200,6 +200,9 @@ enum zio_flag { (((zio)->io_flags & ZIO_FLAG_VDEV_INHERIT) | \ ZIO_FLAG_CANFAIL) +#define ZIO_CHILD_BIT(x) (1 << (x)) +#define ZIO_CHILD_BIT_IS_SET(val, x) ((val) & (1 << (x))) + enum zio_child { ZIO_CHILD_VDEV = 0, ZIO_CHILD_GANG, @@ -207,6 +210,14 @@ enum zio_child { ZIO_CHILD_LOGICAL, ZIO_CHILD_TYPES }; + +#define ZIO_CHILD_VDEV_BIT ZIO_CHILD_BIT(ZIO_CHILD_VDEV) +#define ZIO_CHILD_GANG_BIT ZIO_CHILD_BIT(ZIO_CHILD_GANG) +#define ZIO_CHILD_DDT_BIT ZIO_CHILD_BIT(ZIO_CHILD_DDT) +#define ZIO_CHILD_LOGICAL_BIT ZIO_CHILD_BIT(ZIO_CHILD_LOGICAL) +#define ZIO_CHILD_ALL_BITS \ + (ZIO_CHILD_VDEV_BIT | ZIO_CHILD_GANG_BIT | \ + ZIO_CHILD_DDT_BIT | ZIO_CHILD_LOGICAL_BIT) enum zio_wait_type { ZIO_WAIT_READY = 0, Modified: stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c ============================================================================== --- stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Mar 1 10:31:51 2018 (r330236) +++ stable/11/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Thu Mar 1 10:35:05 2018 (r330237) @@ -512,21 +512,26 @@ zio_remove_child(zio_t *pio, zio_t *cio, zio_link_t *z } static boolean_t -zio_wait_for_children(zio_t *zio, enum zio_child child, enum zio_wait_type wait) +zio_wait_for_children(zio_t *zio, uint8_t childbits, enum zio_wait_type wait) { - uint64_t *countp = &zio->io_children[child][wait]; boolean_t waiting = B_FALSE; mutex_enter(&zio->io_lock); ASSERT(zio->io_stall == NULL); - if (*countp != 0) { - zio->io_stage >>= 1; - ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); - zio->io_stall = countp; - waiting = B_TRUE; + for (int c = 0; c < ZIO_CHILD_TYPES; c++) { + if (!(ZIO_CHILD_BIT_IS_SET(childbits, c))) + continue; + + uint64_t *countp = &zio->io_children[c][wait]; + if (*countp != 0) { + zio->io_stage >>= 1; + ASSERT3U(zio->io_stage, !=, ZIO_STAGE_OPEN); + zio->io_stall = countp; + waiting = B_TRUE; + break; + } } mutex_exit(&zio->io_lock); - return (waiting); } @@ -1330,9 +1335,10 @@ zio_write_compress(zio_t *zio) * If our children haven't all reached the ready stage, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_LOGICAL_BIT | + ZIO_CHILD_GANG_BIT, ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (!IO_IS_ALLOCATING(zio)) return (ZIO_PIPELINE_CONTINUE); @@ -2180,8 +2186,9 @@ zio_gang_issue(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_IS_GANG(bp) && zio->io_gang_leader == zio); ASSERT(zio->io_child_type > ZIO_CHILD_GANG); @@ -2502,8 +2509,9 @@ zio_ddt_read_done(zio_t *zio) { blkptr_t *bp = zio->io_bp; - if (zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_DDT_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(BP_GET_DEDUP(bp)); ASSERT(BP_GET_PSIZE(bp) == zio->io_size); @@ -3235,8 +3243,9 @@ zio_vdev_io_done(zio_t *zio) vdev_ops_t *ops = vd ? vd->vdev_ops : &vdev_mirror_ops; boolean_t unexpected_error = B_FALSE; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } ASSERT(zio->io_type == ZIO_TYPE_READ || zio->io_type == ZIO_TYPE_WRITE || zio->io_type == ZIO_TYPE_FREE); @@ -3312,8 +3321,9 @@ zio_vdev_io_assess(zio_t *zio) { vdev_t *vd = zio->io_vd; - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_VDEV_BIT, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } if (vd == NULL && !(zio->io_flags & ZIO_FLAG_CONFIG_WRITER)) spa_config_exit(zio->io_spa, SCL_ZIO, zio); @@ -3544,9 +3554,10 @@ zio_ready(zio_t *zio) zio_t *pio, *pio_next; zio_link_t *zl = NULL; - if (zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_READY) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_READY)) + if (zio_wait_for_children(zio, ZIO_CHILD_GANG_BIT | ZIO_CHILD_DDT_BIT, + ZIO_WAIT_READY)) { return (ZIO_PIPELINE_STOP); + } if (zio->io_ready) { ASSERT(IO_IS_ALLOCATING(zio)); @@ -3686,11 +3697,9 @@ zio_done(zio_t *zio) * If our children haven't all completed, * wait for them and then repeat this pipeline stage. */ - if (zio_wait_for_children(zio, ZIO_CHILD_VDEV, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_GANG, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_DDT, ZIO_WAIT_DONE) || - zio_wait_for_children(zio, ZIO_CHILD_LOGICAL, ZIO_WAIT_DONE)) + if (zio_wait_for_children(zio, ZIO_CHILD_ALL_BITS, ZIO_WAIT_DONE)) { return (ZIO_PIPELINE_STOP); + } /* * If the allocation throttle is enabled, then update the accounting. From owner-svn-src-stable-11@freebsd.org Thu Mar 1 15:21:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 03C8AF34600; Thu, 1 Mar 2018 15:21:53 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AA83D6BF59; Thu, 1 Mar 2018 15:21:52 +0000 (UTC) (envelope-from eadler@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 8B52D270C; Thu, 1 Mar 2018 15:21:52 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21FLqbe027086; Thu, 1 Mar 2018 15:21:52 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21FLqOl027084; Thu, 1 Mar 2018 15:21:52 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803011521.w21FLqOl027084@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 15:21:52 +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: r330241 - stable/11/sys/net80211 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/net80211 X-SVN-Commit-Revision: 330241 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.25 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, 01 Mar 2018 15:21:53 -0000 Author: eadler Date: Thu Mar 1 15:21:52 2018 New Revision: 330241 URL: https://svnweb.freebsd.org/changeset/base/330241 Log: Revert MFC of r330233 This was an additional commit that I did not intend to MFC... and also broke the build Pointy Hat To: me Modified: stable/11/sys/net80211/ieee80211_input.h stable/11/sys/net80211/ieee80211_ioctl.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net80211/ieee80211_input.h ============================================================================== --- stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 14:11:07 2018 (r330240) +++ stable/11/sys/net80211/ieee80211_input.h Thu Mar 1 15:21:52 2018 (r330241) @@ -131,39 +131,7 @@ ishtinfooui(const uint8_t *frm) return frm[1] > 3 && le32dec(frm+2) == ((BCM_OUI_HTINFO<<24)|BCM_OUI); } -static __inline int -ieee80211_check_rxseq_amsdu(const struct ieee80211_rx_stats *rxs) -{ - - return (!! (rxs->c_pktflags & IEEE80211_RX_F_AMSDU)); -} - /* - * Return 1 if the rxseq check should increment the sequence - * number. Return 0 if it's part of an AMSDU batch and it isn't - * the final frame in the decap'ed burst. - */ -static __inline int -ieee80211_check_rxseq_amsdu_more(const struct ieee80211_rx_stats *rxs) -{ - /* No state? ok */ - if (rxs == NULL) - return (1); - - /* State but no AMSDU set? ok */ - if ((rxs->c_pktflags & IEEE80211_RX_F_AMSDU) == 0) - return (1); - - /* State, AMSDU set, then _MORE means "don't inc yet" */ - if (rxs->c_pktflags & IEEE80211_RX_F_AMSDU_MORE) { - return (0); - } - - /* Both are set, so return ok */ - return (1); -} - -/* * Check the current frame sequence number against the current TID * state and return whether it's in sequence or should be dropped. * @@ -257,20 +225,7 @@ ieee80211_check_rxseq(struct ieee80211_node *ni, struc goto fail; ok: - /* - * Only bump the sequence number if it's the last frame - * in a batch. That way frames in the rest of the batch - * get included, and the last frame in the batch kicks - * it next. - */ - if (ieee80211_check_rxseq_amsdu_more(rxs)) { - ni->ni_rxseqs[tid] = rxseq; - if ((rxs != NULL) && ieee80211_check_rxseq_amsdu(rxs)) - IEEE80211_NODE_STAT(ni, rx_amsdu_more_end); - } else { - /* .. still waiting */ - IEEE80211_NODE_STAT(ni, rx_amsdu_more); - } + ni->ni_rxseqs[tid] = rxseq; return 1; Modified: stable/11/sys/net80211/ieee80211_ioctl.h ============================================================================== --- stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 14:11:07 2018 (r330240) +++ stable/11/sys/net80211/ieee80211_ioctl.h Thu Mar 1 15:21:52 2018 (r330241) @@ -84,11 +84,7 @@ struct ieee80211_nodestats { uint32_t ns_tx_deauth_code; /* last deauth reason */ uint32_t ns_tx_disassoc; /* disassociations */ uint32_t ns_tx_disassoc_code; /* last disassociation reason */ - - /* Hardware A-MSDU decode */ - uint32_t ns_rx_amsdu_more; /* RX decap A-MSDU, more coming from A-MSDU */ - uint32_t ns_rx_amsdu_more_end; /* RX decap A-MSDU (or any other frame), no more coming */ - uint32_t ns_spare[6]; + uint32_t ns_spare[8]; }; /* From owner-svn-src-stable-11@freebsd.org Thu Mar 1 16:03:14 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B0D2FF37C0C; Thu, 1 Mar 2018 16:03:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5E1616DE62; Thu, 1 Mar 2018 16:03:13 +0000 (UTC) (envelope-from eadler@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 58BF52DD5; Thu, 1 Mar 2018 16:03:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21G3DFj049162; Thu, 1 Mar 2018 16:03:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21G3Dqb049161; Thu, 1 Mar 2018 16:03:13 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803011603.w21G3Dqb049161@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Thu, 1 Mar 2018 16:03: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: r330242 - stable/11/sys/contrib/dev/iwm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/contrib/dev/iwm X-SVN-Commit-Revision: 330242 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.25 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, 01 Mar 2018 16:03:14 -0000 Author: eadler Date: Thu Mar 1 16:03:13 2018 New Revision: 330242 URL: https://svnweb.freebsd.org/changeset/base/330242 Log: MFC r314077: Add 7265D firmware. Added: stable/11/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu - copied unchanged from r314077, head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu Modified: Directory Properties: stable/11/ (props changed) Copied: stable/11/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu (from r314077, head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/11/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu Thu Mar 1 16:03:13 2018 (r330242, copy of r314077, head/sys/contrib/dev/iwm/iwm-7265D-17.fw.uu) @@ -0,0 +1,30750 @@ +begin 644 iwm-7265D-17.fw +M`````$E73`IS=')E86TZ3&EN=7A?0V]R94-Y8VQE,31?````"`````(`````````'````!`````````` +M````````````````&P````0````!````$P````2``0```(```````!$```#B +M804```$```````"`O8``5#2``"ST@`#DY(``"!Z```#G@``````````````` +M``````````````````!L(,`0#QL)(MP=P!`*`!M`(``;;@H``&&``!MN/``` +M80`!&VX]``!A``(;;CX``&$0`!MN`0``84P``&%'``!A```;)"``&R7D'<`1 +MB`;A&!\`"&(``!LE`0`;)```!24!``4D``@%.0$`!6*((,`1`@`%)``(!3D! +M``5BC"#`$00`!20`"`4Y`0`%8I`@P!$(``4D``@%.0$`!6*4(,`1$``%)``( +M!3D!``5BF"#`$2``!20`"`4Y`0`%8IP@P!%```4D``@%.0$`!6*@(,`1```( +M)0``""2(!N$9A`;A&4`&P!(!`!MP"```80\<'2($`!TFZ!W`$`$`&S#H'<`1 +M@@0;)`@`&R4$*,`1O@\`80``&R2``!LEY!W`$0``&R0``1LEY!W`$0``&R0` +M`ALEY!W`$0@`7W`$``!AV!W`$/_^&S+8'<`1KP\`8=@=P!```1LPV!W`$:L/ +M`&$``!LE``$;)%P!,B``#&$0,` +M`20```$E#T4`(@!<`#GO_P`R'```9`"`$R0!`!,E.!S`$0]W$R+@',`1`@`! +M8@\!$R($",`1!P`3)0<.$R0$*,`1C`G`$@0HP!&0"<`2R$G'$0]P$R(!`!,P +M!"C`$9@)P!(8*,`1#Q,#(@@`6#$#`!,D```3)00(P!$``!,D.$7`$04``&$` +M`%@X!`!8,0``$R0!`!,E.!S`$0``%20````AZ!W`$`\3!R(/9`$B"@`!0`@` +M`7`>``!A"`!8;@D``&$(``=P!0``80`"7#$!``@D```()80&X1D"``!A`"!8 +M,````&$!0A,D```3)00HP!&"!!,D&``3)00HP!'H'<`0YO\3,O__$S/H'<`1 +M```!)`@``24/`6,B`0!2)`@`!VX"``!A```5)````"$4``!A0`;`$N@=P!$! +M`%(DM!_`$`(`$W`"``!A"`!D,>,/`&$/$U(B#Q-2(@$`4FX$``!A@@03)`@` +M$R4$*,`1!```88($$R08`!,E!"C`$0```&$L-H"!``#`%@(!$V1"`1,D!"C` +M$>C"@($``,`6!@$38@0(P!`$`!-D#UP`(@H``$``!@!P&@``80``$R0``!,E +M``#`%R``6#'((,`0<$7`$!`(P!```!,E`P`3)!P(P!$<",`1```3)`0(P!$/ +M%!4B!``5)@\P("+[_S`R`P`3)!@(P!$/%!4B`@`5)@\@,"(``!,D$$7`$1@( +MP!$0`%@Q#P`3(@$`$S`$*,`1#WP3(@@`S!$``!,E```3)#1(QQ$/>Q,B`0`3 +M,`0HP!$/%!4B`@`5)@]-$R($$,41`@`3)/``#H!@L`>`!@!P\`%``<#1$`&`!,"A(` +MI`$``!,`#`!`#10``P!,#14`!`!0#0`````````````````````````````` +M`````````````````````````!X````>B!Z(6@```%8```!6B%:(`@$``*H` +M``"JB*J(_@$``(P*``!4C%2,I!\```````````````#^```!`/\``@'_`0#_ +M`0$`_@(!`P+_`0$`_P$!`?\"`/\#`@#^!`(#`O\"`@#_`@(!_P,`_P4#`/X& +M`P`#_P,#`/\#`P'_````````````````V#````H````$````=+^````````` +M`````````#@Q```%````!````'2_@``````````````````````````````` +M```!````Y,D``'C+``!(RP``<,L``)3)``",R0``U'4$`$AV!`"4=@0````` +M``````````````$+_P``!0,```0"```&_P```/\```S_```'_P``"/\```G_ +M```*_P```O\!`/\``0(`$0$!`@$!`0/_`0$$`@$!!0,!`08$`0$'!0$!"`8! +M`0D/`0$*$`$`#/\!`/[_`@#_!P(!`?\"`@((`@(#"0("!`H"`@4+`@(&#`(" +M!PT"`@@.`@()#@(""@T"``S_`@#^_P```````````````````````/\'```` +M_P``!_\``0D(```*_P$"```!`P'_`0,"_P$#`_\!`03_`0(%``$!"_\!`@S_ +M`00&!@$!!_\!``C_`0`*_P("`/\"`P'_`@,"_P(#`_\"`00!`@(%``(!"P$" +M`@P!`@0&!@("!P`"``@!`@`*`0,`_P(#`P#_`P,!_P,#`O\#`P,$`P$$!0," +M!0`#`0L%`P(,!0,$!@8#`P?_`P`(!0,`"@4#`/X#!`0`_P0$`?\$!`+_!`0# +M_P0$!/\$!`7_!`0+_P0$#/\$!`8&!`0'!@0`"/\$``K_`````````````/\` +M```!`P`"`@(``P`"```%_P``!O\```3_```'!```"/\!`/\!`0$``P$"`0(! +M`@("`0`$_P$!!P0!``C_`@,`!@("`@8"``7_`@`&_P(`!/\"``<'`@`(!P,# +M``8#``$%`P("!@,!!?\#``;_`P`$!P,`!P<#``@'```````!`/\!`/\``0`! +M_P$"`O\"`/\!`@`!_P(!`_\"`P3_`@(*_P(""?\"`@C_`P`!_P,!`PH#!04* +M`P0&_P,&"@@#`PG_!`#_`P0``?\$`0,+!`('"P0""`0$`P3_!`(*"00$"?\$ +M!`;_!0#_`@4$!O\%`0,&!0`!_P4%"O\%!0D%!@#__P8$!O\&`0,&!@`!_P8# +M!/\&!@D'!@8*_P```````````````````````````````'"V@``!``-LMH`` +M`0`#"!Z```$``52Y@``!``-8N8```0`#<`8!``(`!````````%52``!'10`` +M3$D``$Y#``!$20``4U4``%I:``!:6@``6EH``%I:``!:6@``6EH``%I:``!: +M6@``6EH``%I:``````````@$#`(*!@X!"04-`PL'#P&1```!/P```I$``#X] +M```#D0``/3T```21```_`P``!9$```D0```&D0``%AP```>1```?'P``")$` +M`!P6```)D0``$`D```J1```#/P``"Y$``#T]```,D0``/3X```V1```_`0`` +M$1`^2$@`X!`$````#2`$````81`B````($,Y`````."$`0``X1`!`````A"7 +MRP4`,&`+````#]($````&-+\__\?`7,0````">")AH2$"N"$A```"^"F5=<@ +M#.`BBRPR#>"JB8>^PQ%^"2C(N*&."*B@``&>!^2><@&N`BBRPR&^"3 +M3;>^PQ)&`"`````G,`````$2`4A0$`&1`&````$=(#````,>#_MW8` +M,N#D)3\`,^`B4@X`-.`N````->``````-N`V-C8V-^`V-@``"1!N7P``&A`` +M````,1"&`0``,A"0`0``,Q#(````-!!0````-1"`````.A!I````.Q#````` +MP1``````)(``/```*N#YY>`>>^PQ*."+BXF)*>") +MB0``#&"#)0``.!!2````.1"6````08`!`````D;@<[G2X'.1P.![?;S08V +MFZT&-1KM!KO?\`C,Y7()2F4R"4@D\@C'X_$(1J.Q"$4BD0A$(G$(P^%0"$)A +M,`C!8#`(P6`0"$#@[P>_W^\'O]_O!S^?SP<^G\\'/I_/!SZ?KP>]7J\'O9[/ +M!SZ?KP>]7J\'O9[/!SZ?SP<^G\\'/I_/![_?[P>_W^\'O]\/"$!@,`C!8#`( +MP6!0"$+A<`C#(9$(1"*1",6BT0C&X_$(QR,2"YG$X'N]V.!SQ>KP>^WP\(0&`P"$*B,0WI=#H-S6:S"_G\\'O]_O![\?$`A`8#`(P6`P",%@$`A`(/`'/Y_/ +M![T>CP>\W6X'NYU.!SJ=;@>[W6X'/!ZO!SV?SP>_'Q`(0&`P",%@,`C!8!`( +M0"#P![_?[P<_G^\'O]\/",!@4`A#HO$(R66S"XFZT&M)E,!K%8#`8T'`\(1"*Q",5BT0A&H_$(Q^/Q +M",?CT0A&8[$(12)Q",.A4`C!8#`(0"`0"$`@$`C`8#`(0:%P",,AD0C%8M$( +M1N/Q",?C\0C'H]$(1F.Q",4BD0A`'HX&,%@L!C&9;`:TFNT&.-UN![O=;@>U +M6JT&-=IL!C)9+`8Q&HX'P*+1",;C$0G(9%()2N5R"'1L:&AHB(B`?'AT;&AH:(B(B +M(B`?'AT;&AH:(B(@'QX=&QH:&B(B(B(@'QX=&QH:&B(B(!\>'1L:&AHB(B(B +M(1\>'1L:%Q +M'AX<&A@5$AX>'AX>'!H8%1(B(B(B(1\>'1P:&!@B(B$?'AT<&A@8(B(B(B$? +M'AT<&A@4(B(A'QX='!H8%B(B("`@'QX<&Q@6$AX>'AX>'!L8%A0B(B(B(1\> +M'1P9%Q'AX>'!L7%1(B(B(B(B`?'1L:&AHB(B(@'QT;&AH:(B(B(B(@'QT; +M&AH:(B(B(!\=&QH:&B(B(B(B(!\=&QH:&B(B(B`?'1L:&AHB(B(B(B$@'AP9 +M%Q'!D6$B`@("`@'AP9%A0B(B$A(2$>'1P9%Q"2@`'PDH`"`)*``A"2@ +M`%`0H`!()J``8!"@`$PFH`!D$*``:!"@`%@0H``P$*``/!"@`#00H``L#*`` +M`(&D``&!I``#@:0`B"2@`(PDH`"0)*``E"2@`)@DH`"<)*``H"2@`*0DH``` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````O@`9R``&R0`& +MR@`!S``%S0`%RP`$S@`#SP`*T``*T0`"T@`"TP`*U``*U0`"U@`"UP`*V``* +MVP"(W`"(W0"JW@#=WP``XP`(Y``(Y0`*Y@`*Z```ZP`([``([0`*[@`,,0`D +M,@`F=P$P.`(P!`!,.```Y0%SY@$*I@)SIP(*^P#_CP$@5@(@@P$`1`(`C@$/ +M50(/D`$`3@(`D0%]D@%]DP%]3P)]4`)]40)]6@!56P!5_0`!Z@$$_@`3_P`& +M;@`*>0`-=0`!?P`/AP`.F0#%F0#-?`$-@`$-/0(-00(-?0'_/@+_?P'_0`+_ +M)P`<*``8*0`<*@`@('>P(0S@$#CP(#D0(`O0$)?@()QP$,B`(, +MO@$)?P()R`$&B0(&I`$0J@$2I0$0JP$290(0:P(29@(0;`(2WP$!UP$`H`(! +MF`(`>@$!.P(!```T`0`V`0`^`5<_`69``7=!`9A"`0=?`:I@`:IQ`7D?`@`I +M`O\J`O\R`GFA`%NB`!NC`#"D`!*E`""F``>G`!NH`!*I``>J``"L``FM``:N +M``RO``FP``:Q``RR``>S``2T``JU``:X`%Z^`!G(``;)``;*``',``7-``7+ +M``3.``//``K0``K1``+2``+3``K4``K5``+6``+7``K8``K;`(C<`(C=`*K> +M`-W?``#C``CD``CE``KF``KH``#K``CL``CM``KN``PQ`"0R`"9W`3`X`C`$ +M`$PX``#E`7/F`0JF`G.G`@K[`/^/`2!6`B"#`0!$`@".`0]5`@^0`0!.`@"1 +M`7V2`7V3`7U/`GU0`GU1`GU:`%5;`%7]``'J`03^`!/_``9N``IY``UU``%_ +M``^'``Z9`,69`,U\`0V``0T]`@U!`@U]`?\^`O]_`?]``O\G`!PH`!@I`!PJ +M`!RY`0>Z`1!Z`@=[`A#.`0./`@.1`@"]`0E^`@G'`0R(`@R^`0E_`@G(`0:) +M`@:D`1"J`1*E`1"K`1)E`A!K`A)F`A!L`A+?`0'7`0"@`@&8`@!Z`0$[`@%B +M`<]D`<]F`<\L`L\N`L\P`L\0``0`"P````,![`$%`!``!``1`!(``P`*``L` +M-`$=`C4!'@(V`1\")0````H`"P`$``\``P'L`1``.`#D`:4"2``2`",````- +M$2(##!R``.@;@``\'(``X!N```,![`$"`>L!!0`$`!``"@`+``8`"`!\`8`! +M/0)!`G,!=P$T`C@"EP%8`ID!6@*6`9@!5P)9`MP!G0(E`)H!6P*<`5T"```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````8````````````````````!```` +M`@`````````N$2\7,!`Q*#(1,_(V(C@1.1#AY.(@````'/6```$`````````.O6```````#_ +M````_____P`````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````$P>`0`P'@$`,!X!```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````M'X```4```($````=+^````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````(`````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````K"L```````#PP````0```&0G`0`"````;#8$``,```!4-@0`!````"QD +M!``%````]/0$``8```"X>@0`!P```#`H`@`(````+"@"``D````0=`0`"@`` +M`$P1!``+````=&T!``P```"`@@0`#0`````/`@`.````'&`!``\```#@"6`+X`4````"!.```````````````````$`````@`````````!`````0`` +M`!X```````````````$!#@X````````R"`(/`P`!``````````$!#@X````` +M```C!`(*`````````````/0!````````````````````````*'>````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````/____\````````````` +M`````````````````````````````````````````````!``````D`$```"@ +M`!`G``#H`P``Z`,``'PN@`!\+H``M,R``+#,@`"PS(``J,R``+3,@`"PS(`` +ML,R``*C,@`"HS(``M,R``+3,@`"HS(``M,R``*S,@```````__\```$!```` +M`````````0````#H)00`Z"4$`.@E!`#<)00`Z"4$`.@E!`#@)00`Z"4$`*C+ +M``"``+3%@`!``/3*@`#\R(``I,F``$S*@``````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````````````````````$````` +M``````````````"0!@```/\#`(@'````_P4`"`<```#_+0#D!@```/\]`#@& +M````_P0`7`8```#_)0"P!@```/\\`"0A`0``_]T`,`<```#_3`"$!P```/\B +M`"P'````_R8`@`<```#_*``T(`$``"```&P?`0``_S``>`8```#_!P!8!P`` +M`/\@``P0$``$`1`.$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0#Q`)$!`%"A`+ +M$!`0$`(0$`T0$!`0$!`0$!`0$`8#$!`0$!`0$!`0$!`0$!`($!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0 +M!Q`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!`0$!``````O,R````` +M```````````````````````````````````````````````````````````` +M`/\```#4+8``N!.!`!H``````````0``````````````V"V``/`3@0`8```` +M``````$``````````````/____________________________________\` +M```````````````````````````````````````````````````````````` +M``````````````````"`"AT*X`FE"6T)-PD$"=,(I`AW"$L((@CZ!],' +MK@>*!P`````````````````````````````````````````````````````` +M`````````````````````````````````````````!PT```"````!````'2_ +M@`````````````````!X-```!0````0```!TOX``````````````!0``<@$` +M`*@"```#"0,)!0D,$0``````````````````````````;+P$``H````$```` +M=+^```````````````#_```!`/\``/X!`0#_`@$!`/\!``'_`0$"`P$!`P0! +M`00%`0(&_P$#!_\!`0C_`0#^!@(`_P<"`0#_`@`!_P("`@@"`@,)`@($"@(! +M!?\"`P?_`@$(_P(`_@L#`/\,`P$`_P,``?\#`P(-`P,##@,#!`\#`07_`P(& +M_P,!"/\#`/X0`````````````````````.2]!``*````!````'2_@`!TO`0` +MH+P$`+R\!`#,O`0`T+P$`.R\!`#(O`0`,+T$`#B]!``\O00`9+T$`#2]!`"L +MO00`M+T$`+B]!`#@````````!Z````?P```'H` +M``!_````>@```'\```!Z````?P```'H```!_````>@```'\```!Z````?P`` +M`'H```!_````>@```'\```!Z`````````'H````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````9F8.``````!F9@H`9F8&`&9F!@!F9@(`9F8"`&9F +M/@!F9CX`9F8Z`&9F.@``````9F8V``````!F9C(``````&9F#@`````````` +M`&9F!@`````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````0`!`0$!`0$!`0$``0`!````````_P`` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````!,"*``2`B@`&P'@``````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`/LUC``SL0``````````,P`````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````'AX> +M'AX>'AX>'AX>'@`9'!X>'AX>'AX>'AX>`!X>'AX>'AX>'@`>'AX>'AX>'AX` +M`08"!`("```$!`8$"`,`````&1X>'AX>'A@9'AX>'AX>&!@>'AX>'AX>'@`5 +M'AX8%1X>&!@>'AX#"``````&````````````_P4````````8&!@8&!T!!@8& +M!@`&```>`!X`'@`8``8&!@$!`0']!@8````````&`0$``!X````````````` +M``$`````````````````%1@8&!@8&!@8&!48&````````````````````/[^ +M_O[^`!06&!@4$A`8&````````````````````````````````````!48&!@8 +M&!@4%1@8&!@8&!02&!@8&!@8&!@```````$````!````$1@8%!$8&!04&!@8 +M``````#[%!04%!08&!@8&!@8&!@8&!@8&``8&!@8&!@8&!@8&!@8`!@8&!@8 +M&!@8&``8&!@8&!@8&!@`&!@8&!@8&!@8&!@8&!@8&!@8&!@8&!@8&``8&!@8 +M&!@8&!@8&!@8&!@8&!@!`0$!`0$````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````5E0``'L````````` +M6E0``#L`````````6E0``'L`````````"B```#L`````````6E0``$,````` +M````"@````$````P,`````````````````````````$````_```````````` +M````````!P````````("`````````````````0`"`@`!```"`@$``0(``@(` +M`````0`!``("`0`````````!`````````@(```$```$```$``````@`"`@`` +M```"```````"`````0`````````````"```!``(`!````````````````@`" +M``````````````````(``@`!``````(````````````"``$"``("`@`````` +M``(``@```0````````````````````$```$````"``$"```````````#`@`` +M`````````@`````"`@````````````````````````$``@(````````````` +M``````(``@$````````````"``````(``@(``@````````(````````````` +M`@("``````(``@("`@`!```"``````$"``("`@`"`0(````"`````@`!```" +M```"`0````````````(````````````````"``````````````````$````! +M`@$"```"`@```````0`"```!``$``@`````````````````````````````` +M`````````@````````````(````"``0``@````(````"`````@`"``("```` +M`````````@`````"``````(```````4````"``$```$```$"```````````` +M```````````!```````!``(````!``(``0`````"```````````````````` +M`````````````````````0`````````````````````````````````````` +M```````````````````````````````"`````````@`````````````````` +M``````````(``````"DI_____P`````````````````````````````````` +M````````````````````````'@$``"P+```````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````!`@,$!08'"`D*"PP-#@\0*BHK+"TN+TI+3$U.3U!K +M;&UN<'&+C(V.CY&LK:ZOL+',S,S-SL_0T=+3T]/3T]/3T]/3T]/3T]/3TP!! +M```````````!`@,$!08'"`D*"PP-#@\0*BHK+"TN+TI+3$U.3U!J:VUN;W"* +MBXR-CH^JJZRMKJ_*R\S-SL_0T-#0T-#0T-#0T-#0T-#0T-#0T``^`0(#!`0% +M!@<("0H+#`T.*BLL+2XO2DM,34Y/4&IJ:VQM;F^*BXR-CH^0JJNLK:ZOL+#* +MRLO,S<[/T-'2T]35UM?8V=K:VMK:VMK:VMK:VMK:V@!#`@(#!`4&!@<("0H+ +M#`T.*BLL+2XO2DM,34Y/4%!J:VQM;F^*BXR-CH^0JJNLK:ZOL+#*RLO,S<[/ +MT-'2T]35UM?7U]?7U]?7U]?7U]?7U]?7UP!``@,#!`4&!P@)"@L,#0XJ*RPM +M+B]*2TQ-3D]/4&IK;&UN;XJ+C(V.CY"JJZRMKJ^PL,K*R\S-SL_0T=+3U-34 +MU-34U-34U-34U-34U-34U-34U``\```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````/]_ +M_W__?_]__W\`````````````````````_W__?_]__W__?_]__W__?_]__W\` +M````````````````````JJH``/\```#_````_P```/\```#_````_P```/\` +M``#_````_P```/\```#_````_P```/\```#_````_P```/\```#_````_P`` +M`/\```#_````_P```/\```#_````_P```/\```#_````_P```/\```#_```` +M_P```````0````$````!`````0````$````!`````0````$````!`````0`` +M``$````!`````0````$````!`````0````$````!`````0````$````!```` +M`0````$````!`````0````$````!`````0````$````!```````````````` +M```````````````````````````````````````````````````````````` +M````````````````?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_ +M?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_?W]_```` +M````````````O@```+X````!``````````$```!?````7P````(````````` +M`@```"\````O`````P`````````#````&````!@````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````*```````` +M````````````_P#_``````````````````````#_`/\``````#0````````` +M``````````#_`/\``````````````````````/\`_P``````<``````````` +M`````````/\`_P``````````````````````_P#_``````"9```````````` +M````````_P#_``````````````````````#_`/\````````````````````` +M``$````!``````````$````!``````````$````!```````````````````` +M`0````$``````````0````$``````````0````$````````````````````` +M`````````(P*```````````````````````````````````,`P@````````` +M``#_``````````````````````````````````````````````#_```````` +M``````````````````````````````````````#_```````````````````` +M``````````````````````````#_```````````````````````````````` +M``````````````#_```````````````````````````````````````````` +M``#_``````````````````````````````````````````````#_```````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````0````````#@$H$````````` +M````````````````````````!%4```H````$````=+^````````````````` +M`````````````````````````````0P>M@XR`A$>N0XR`Q8>NPXR!!L>O@XR +M!2`>P`XR!B4>PPXR!RH>Q0XR""\>R`XR"30>R@XR"CD>S0XR"SX>SPXR#$,> +MT@XR#4@>U`XR#DT>UPXR(E!`&2``)&!`'B`V)G!`(R`R*`!!*"`V*A!!+2`U +M+"!!,B`V+C!!-R`Q,$!!/"`V,E!!02``-&!!1B`V-G!!2R`Q.`!"4"`V.A!" +M52`U/"!"6B`U/C!"7R`Q0$!"9"`U9&!$OB(T9G!$PR(P:`!%R"(T:A!%S2(T +M;"!%TB(T;C!%UR(P<$!%W"(T`!&\"(T>A!& +M]2(T?"!&^B(T?C!&_R(P@$!&!"(T@E!&"2(`A&!&#B(TAG!&$R(PB`!'&"(S +MBA!''2(SC"!'(B(TCC!')R(OD$!'+"(SD4A'+R(`E6A'.2(SEWA'/B(OF0A( +M0R0SFQA(2"0RG2A(320SGSA(4B0OH4A(5R0RI6A(820R```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````````#P`/ +M``\`#P`/``\`#P`/```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````$``0``````P`"0`-`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````!@E`0`"@````0```!TOX`````````````````````````` +M``````````````````````````````````````````````````#_____N!2! +M````````````````````````````E%4```H````$````=+^``$!"#P!`0@\` +M0$(/`$!"#P!`0@\`0$(/`$!"#P!`0@\`0$(/`$!"#P#@!P``0`$``.`'``!` +M`0``("<``.`'``#@!P``0`$``.`'``!``0```@`````````"```````````` +M`````````````````````````````````````````````'RJ@``8-($`&``` +M``````````````````````#_____```````````````````````````````` +M````````````````````````````````````````````````-@$``*H````$ +M`0``@@````````!HSP$`C,\!`)S/`0!TSP$`9,\!`*#/`0!,SP$```````#@ +M````@`````````````````````````````"`]```@$L```!````````````` +M``````````````````#D````7````$`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````Q)X$`("@!`"!`"PF@0`[)T$`$";!`"TH`0`#)T$`(RA!``````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Thu Mar 1 16:41:38 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9353FF3AB02; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44E9C6F682; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@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 3FBBE33EA; Thu, 1 Mar 2018 16:41:38 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w21Gfc8e065076; Thu, 1 Mar 2018 16:41:38 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w21GfcXs065075; Thu, 1 Mar 2018 16:41:38 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201803011641.w21GfcXs065075@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Thu, 1 Mar 2018 16:41: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: r330243 - in stable: 10/release 11/release X-SVN-Group: stable-11 X-SVN-Commit-Author: gjb X-SVN-Commit-Paths: in stable: 10/release 11/release X-SVN-Commit-Revision: 330243 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.25 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, 01 Mar 2018 16:41:38 -0000 Author: gjb Date: Thu Mar 1 16:41:37 2018 New Revision: 330243 URL: https://svnweb.freebsd.org/changeset/base/330243 Log: MFC r330033: Bump the size of virtual machine disk images from 20G to 30G, providing more space for a local buildworld to succeed without attaching separate disks for /usr/src and /usr/obj. Sponsored by: The FreeBSD Foundation Modified: stable/11/release/Makefile.vm Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/release/Makefile.vm Directory Properties: stable/10/ (props changed) Modified: stable/11/release/Makefile.vm ============================================================================== --- stable/11/release/Makefile.vm Thu Mar 1 16:03:13 2018 (r330242) +++ stable/11/release/Makefile.vm Thu Mar 1 16:41:37 2018 (r330243) @@ -7,7 +7,7 @@ VMTARGETS= vm-image VMFORMATS?= vhd vmdk qcow2 raw -VMSIZE?= 20G +VMSIZE?= 30G SWAPSIZE?= 1G VMBASE?= vm From owner-svn-src-stable-11@freebsd.org Fri Mar 2 04:41:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C8B9FF47F52; Fri, 2 Mar 2018 04:41:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 62A8B6B60D; Fri, 2 Mar 2018 04:41:53 +0000 (UTC) (envelope-from mckusick@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 5D90012C9B; Fri, 2 Mar 2018 04:41:53 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w224fr7d025230; Fri, 2 Mar 2018 04:41:53 GMT (envelope-from mckusick@FreeBSD.org) Received: (from mckusick@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w224fr5K025213; Fri, 2 Mar 2018 04:41:53 GMT (envelope-from mckusick@FreeBSD.org) Message-Id: <201803020441.w224fr5K025213@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mckusick set sender to mckusick@FreeBSD.org using -f From: Kirk McKusick Date: Fri, 2 Mar 2018 04:41: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: r330265 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: mckusick X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330265 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.25 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, 02 Mar 2018 04:41:54 -0000 Author: mckusick Date: Fri Mar 2 04:41:52 2018 New Revision: 330265 URL: https://svnweb.freebsd.org/changeset/base/330265 Log: MFC of 329880. Add error number to "fsync: giving up on dirty" message. Modified: stable/11/sys/kern/vfs_default.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_default.c ============================================================================== --- stable/11/sys/kern/vfs_default.c Fri Mar 2 04:34:53 2018 (r330264) +++ stable/11/sys/kern/vfs_default.c Fri Mar 2 04:41:52 2018 (r330265) @@ -712,12 +712,13 @@ loop2: if ((mp != NULL && mp->mnt_secondary_writes > 0) || (error == 0 && --maxretry >= 0)) goto loop1; - error = EAGAIN; + if (error == 0) + error = EAGAIN; } } BO_UNLOCK(bo); - if (error == EAGAIN) - vn_printf(vp, "fsync: giving up on dirty "); + if (error != 0) + vn_printf(vp, "fsync: giving up on dirty (error = %d) ", error); return (error); } From owner-svn-src-stable-11@freebsd.org Fri Mar 2 10:57:47 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1F47DF3A36D; Fri, 2 Mar 2018 10:57: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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C08257A64F; Fri, 2 Mar 2018 10:57:46 +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 B5F65168EF; Fri, 2 Mar 2018 10:57:46 +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 w22Avkhd013948; Fri, 2 Mar 2018 10:57:46 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22Avk3U013947; Fri, 2 Mar 2018 10:57:46 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803021057.w22Avk3U013947@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Fri, 2 Mar 2018 10:57: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: r330275 - stable/11/sys/x86/x86 X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/x86/x86 X-SVN-Commit-Revision: 330275 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.25 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, 02 Mar 2018 10:57:47 -0000 Author: kib Date: Fri Mar 2 10:57:46 2018 New Revision: 330275 URL: https://svnweb.freebsd.org/changeset/base/330275 Log: MFC r329864: Do not return out of bound pointers from intr_lookup_source(). Modified: stable/11/sys/x86/x86/intr_machdep.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/x86/x86/intr_machdep.c ============================================================================== --- stable/11/sys/x86/x86/intr_machdep.c Fri Mar 2 08:59:53 2018 (r330274) +++ stable/11/sys/x86/x86/intr_machdep.c Fri Mar 2 10:57:46 2018 (r330275) @@ -167,6 +167,8 @@ struct intsrc * intr_lookup_source(int vector) { + if (vector < 0 || vector >= nitems(interrupt_sources)) + return (NULL); return (interrupt_sources[vector]); } From owner-svn-src-stable-11@freebsd.org Fri Mar 2 15:17:44 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id ECACCF2BEC3; Fri, 2 Mar 2018 15:17:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 9BD7085BB9; Fri, 2 Mar 2018 15:17:43 +0000 (UTC) (envelope-from manu@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 902EC19254; Fri, 2 Mar 2018 15:17:43 +0000 (UTC) (envelope-from manu@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w22FHhXj046418; Fri, 2 Mar 2018 15:17:43 GMT (envelope-from manu@FreeBSD.org) Received: (from manu@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w22FHhSH046413; Fri, 2 Mar 2018 15:17:43 GMT (envelope-from manu@FreeBSD.org) Message-Id: <201803021517.w22FHhSH046413@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: manu set sender to manu@FreeBSD.org using -f From: Emmanuel Vadot Date: Fri, 2 Mar 2018 15:17: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: r330280 - in stable/11: etc/defaults etc/rc.d share/man/man5 X-SVN-Group: stable-11 X-SVN-Commit-Author: manu X-SVN-Commit-Paths: in stable/11: etc/defaults etc/rc.d share/man/man5 X-SVN-Commit-Revision: 330280 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.25 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, 02 Mar 2018 15:17:44 -0000 Author: manu Date: Fri Mar 2 15:17:42 2018 New Revision: 330280 URL: https://svnweb.freebsd.org/changeset/base/330280 Log: MFC r320943-r320944, r321008, r321072, r321128 r320943: Add ipfw_status command to etc/rc.d/ipfw This is helpful when using service/conf management tools. Sonsored-By: Gandi.net r320944: Add an rc.d script to setup a netflow export via ng_netflow The default is to export netflow data on localhost on the netflow port. ngtee is used to have the lowest overhead possible. The ipfw ng hook is the netflow port (it can only be numeric) Default is netflow version 5. Sponsored-By: Gandi.net Reviewed by: bapt (earlier version), olivier (earlier version) r321008: etc/rc.d: Only install ipfw_netflow is MK_IPFW and MK_NETGRAPH is defined While here only install ipfw rc script if MK_IPFW is defined. Reported by: ngie r321072: ipfw_netflow: add +ipfw_netflow_enable="NO" to defaults/rc.conf and document usage in rc.conf(5) Reported by: markj Sponsored by: Gandi.net r321128: ipfw_netflow: Add support for FIB If ipfw_netflow_fib, the ipfw rule will only match packets in that FIB. While here correct some value in rc.conf(5) to be int and not str. Sponsored by: Gandi.net Added: stable/11/etc/rc.d/ipfw_netflow - copied, changed from r320944, head/etc/rc.d/ipfw_netflow Modified: stable/11/etc/defaults/rc.conf stable/11/etc/rc.d/Makefile stable/11/etc/rc.d/ipfw stable/11/share/man/man5/rc.conf.5 Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/defaults/rc.conf ============================================================================== --- stable/11/etc/defaults/rc.conf Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/defaults/rc.conf Fri Mar 2 15:17:42 2018 (r330280) @@ -167,6 +167,7 @@ firewall_nat_enable="NO" # Enable kernel NAT (if firew firewall_nat_interface="" # Public interface or IPaddress to use firewall_nat_flags="" # Additional configuration parameters dummynet_enable="NO" # Load the dummynet(4) module +ipfw_netflow_enable="NO" # Enable netflow logging via ng_netflow ip_portrange_first="NO" # Set first dynamically allocated port ip_portrange_last="NO" # Set last dynamically allocated port ike_enable="NO" # Enable IKE daemon (usually racoon or isakmpd) Modified: stable/11/etc/rc.d/Makefile ============================================================================== --- stable/11/etc/rc.d/Makefile Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/rc.d/Makefile Fri Mar 2 15:17:42 2018 (r330280) @@ -47,7 +47,6 @@ FILES= DAEMON \ ip6addrctl \ ipfilter \ ipfs \ - ipfw \ ipmon \ ipnat \ ipsec \ @@ -212,6 +211,13 @@ HASTPACKAGE= hast .if ${MK_INETD} != "no" FILES+= inetd +.endif + +.if ${MK_IPFW} != "no" +FILES+= ipfw +.if ${MK_NETGRAPH} != "no" +FILES+= ipfw_netflow +.endif .endif .if ${MK_ISCSI} != "no" Modified: stable/11/etc/rc.d/ipfw ============================================================================== --- stable/11/etc/rc.d/ipfw Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/etc/rc.d/ipfw Fri Mar 2 15:17:42 2018 (r330280) @@ -17,7 +17,9 @@ start_cmd="ipfw_start" start_precmd="ipfw_prestart" start_postcmd="ipfw_poststart" stop_cmd="ipfw_stop" +status_cmd="ipfw_status" required_modules="ipfw" +extra_commands="status" set_rcvar_obsolete ipv6_firewall_enable @@ -107,6 +109,18 @@ ipfw_stop() ${_coscript} quietstop fi done +} + +ipfw_status() +{ + status=$(sysctl -n net.inet.ip.fw.enable) + if [ ${status} -eq 0 ]; then + echo "ipfw is not enabled" + exit 1 + else + echo "ipfw is enabled" + exit 0 + fi } load_rc_config $name Copied and modified: stable/11/etc/rc.d/ipfw_netflow (from r320944, head/etc/rc.d/ipfw_netflow) ============================================================================== --- head/etc/rc.d/ipfw_netflow Thu Jul 13 13:40:18 2017 (r320944, copy source) +++ stable/11/etc/rc.d/ipfw_netflow Fri Mar 2 15:17:42 2018 (r330280) @@ -54,7 +54,7 @@ ipfw_netflow_status() ipfw_netflow_start() { ipfw_netflow_is_running && err 1 "ipfw_netflow is already active" - ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any + ipfw add ${ipfw_netflow_rule} ngtee ${ipfw_netflow_hook} ip from any to any ${ipfw_netflow_fib:+fib ${ipfw_netflow_fib}} ngctl -f - <<-EOF mkpeer ipfw: netflow ${ipfw_netflow_hook} iface0 name ipfw:${ipfw_netflow_hook} netflow Modified: stable/11/share/man/man5/rc.conf.5 ============================================================================== --- stable/11/share/man/man5/rc.conf.5 Fri Mar 2 15:12:18 2018 (r330279) +++ stable/11/share/man/man5/rc.conf.5 Fri Mar 2 15:17:42 2018 (r330280) @@ -594,6 +594,44 @@ module if is also set to .Dq Li YES . .\" ------------------------------------------------------------------- +.It Va ipfw_netflow_enable +.Pq Vt bool +Setting this to +.Dq Li YES +will enable netflow logging via +.Xr ng_netflow 4 +.Pp +By default a ipfw rule is inserted and all packets are duplicated with +the ngtee command and netflow packets are sent to 127.0.0.1 on the netflow +port using protocol version 5. +.It Va ipfw_netflow_hook +.Pq Vt int +netflow hook name, must be numerical +(default +.Pa 9995 ) . +.It Va ipfw_netflow_rule +.Pq Vt int +ipfw rule number +(default +.Pa 1000 ) . +.It Va ipfw_netflow_ip +.Pq Vt str +Destination server ip for receiving netflow data +(default +.Pa 127.0.0.1 ) . +.It Va ipfw_netflow_port +.Pq Vt int +Destination server port for receiving netflow data +(default +.Pa 9995 ) . +.It Va ipfw_netflow_version +.Pq Vt int +Do not set for using version 5 of the netflow protocol, set it to 9 for using version 9. +.It Va ipfw_netflow_fib +.Pq Vt int +Only match packet in FIB +.Pa ipfw_netflow_fib +(default is undefined meaning all FIBs). .It Va natd_program .Pq Vt str Path to From owner-svn-src-stable-11@freebsd.org Sat Mar 3 00:10:38 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C982F2F7A2; Sat, 3 Mar 2018 00:10:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2B57381038; Sat, 3 Mar 2018 00:10:38 +0000 (UTC) (envelope-from np@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 25BEF1E869; Sat, 3 Mar 2018 00:10:38 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230AcSF015289; Sat, 3 Mar 2018 00:10:38 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230AcMa015288; Sat, 3 Mar 2018 00:10:38 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030010.w230AcMa015288@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 00:10: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: r330301 - stable/11/sys/net X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/net X-SVN-Commit-Revision: 330301 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.25 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, 03 Mar 2018 00:10:38 -0000 Author: np Date: Sat Mar 3 00:10:37 2018 New Revision: 330301 URL: https://svnweb.freebsd.org/changeset/base/330301 Log: MFC r323221: Make LACP based lagg work with interfaces (like 100Gbps and 25Gbps) that report extended media types. lacp_aggregator_bandwidth() uses the media to determine the speed of the interface and returns 0 for IFM_OTHER without the bits in the extended range. Reported by: kbowling@ Reviewed by: eugen_grosbein.net, mjoras@ Sponsored by: Chelsio Communications Differential Revision: https://reviews.freebsd.org/D12188 Modified: stable/11/sys/net/ieee8023ad_lacp.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/net/ieee8023ad_lacp.c ============================================================================== --- stable/11/sys/net/ieee8023ad_lacp.c Fri Mar 2 23:31:55 2018 (r330300) +++ stable/11/sys/net/ieee8023ad_lacp.c Sat Mar 3 00:10:37 2018 (r330301) @@ -461,7 +461,11 @@ lacp_linkstate(struct lagg_port *lgp) uint16_t old_key; bzero((char *)&ifmr, sizeof(ifmr)); - error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + error = (*ifp->if_ioctl)(ifp, SIOCGIFXMEDIA, (caddr_t)&ifmr); + if (error != 0) { + bzero((char *)&ifmr, sizeof(ifmr)); + error = (*ifp->if_ioctl)(ifp, SIOCGIFMEDIA, (caddr_t)&ifmr); + } if (error != 0) return; From owner-svn-src-stable-11@freebsd.org Sat Mar 3 00:22:33 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E427DF309EF; Sat, 3 Mar 2018 00:22:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 99EBD81CB1; Sat, 3 Mar 2018 00:22:32 +0000 (UTC) (envelope-from np@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 9488F1EBB6; Sat, 3 Mar 2018 00:22:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230MWdC024864; Sat, 3 Mar 2018 00:22:32 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230MW8G024862; Sat, 3 Mar 2018 00:22:32 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030022.w230MW8G024862@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 00:22: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: r330302 - in stable/11/sys: netinet netinet6 X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11/sys: netinet netinet6 X-SVN-Commit-Revision: 330302 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.25 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, 03 Mar 2018 00:22:33 -0000 Author: np Date: Sat Mar 3 00:22:32 2018 New Revision: 330302 URL: https://svnweb.freebsd.org/changeset/base/330302 Log: MFC r328314: Do not generate illegal mbuf chains during IP fragment reassembly. Only the first mbuf of the reassembled datagram should have a pkthdr. Modified: stable/11/sys/netinet/ip_reass.c stable/11/sys/netinet6/frag6.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/ip_reass.c ============================================================================== --- stable/11/sys/netinet/ip_reass.c Sat Mar 3 00:10:37 2018 (r330301) +++ stable/11/sys/netinet/ip_reass.c Sat Mar 3 00:22:32 2018 (r330302) @@ -377,6 +377,7 @@ ip_reass(struct mbuf *m) q->m_nextpkt = NULL; m->m_pkthdr.csum_flags &= q->m_pkthdr.csum_flags; m->m_pkthdr.csum_data += q->m_pkthdr.csum_data; + m_demote_pkthdr(q); m_cat(m, q); } /* Modified: stable/11/sys/netinet6/frag6.c ============================================================================== --- stable/11/sys/netinet6/frag6.c Sat Mar 3 00:10:37 2018 (r330301) +++ stable/11/sys/netinet6/frag6.c Sat Mar 3 00:22:32 2018 (r330302) @@ -539,6 +539,7 @@ insert: while (t->m_next) t = t->m_next; m_adj(IP6_REASS_MBUF(af6), af6->ip6af_offset); + m_demote_pkthdr(IP6_REASS_MBUF(af6)); m_cat(t, IP6_REASS_MBUF(af6)); free(af6, M_FTABLE); af6 = af6dwn; From owner-svn-src-stable-11@freebsd.org Sat Mar 3 00:54:14 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id EE09DF32B88; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id A186083536; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@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 9C7B71F091; Sat, 3 Mar 2018 00:54:13 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w230sDWi040108; Sat, 3 Mar 2018 00:54:13 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w230sDP7040104; Sat, 3 Mar 2018 00:54:13 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201803030054.w230sDP7040104@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Sat, 3 Mar 2018 00:54: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: r330303 - in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: jhb X-SVN-Commit-Paths: in stable: 10/sys/dev/cxgb/ulp/tom 10/sys/dev/cxgbe/tom 10/sys/netinet 11/sys/dev/cxgb/ulp/tom 11/sys/dev/cxgbe/tom 11/sys/netinet X-SVN-Commit-Revision: 330303 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.25 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, 03 Mar 2018 00:54:14 -0000 Author: jhb Date: Sat Mar 3 00:54:12 2018 New Revision: 330303 URL: https://svnweb.freebsd.org/changeset/base/330303 Log: MFC 328608: Export tcp_always_keepalive for use by the Chelsio TOM module. This used to work by accident with ld.bfd even though always_keepalive was marked as static. LLD honors static more correctly, so export this variable properly (including moving it into the tcp_* namespace). Relative to HEAD the MFC includes two additional changes: - The t3_tom module used for cxgb(4) is also patched. - A strong reference from the new name (tcp_always_keepalive) to the old name (always_keepalive) has been added to preserve the KBI for existing modules. Suggested by: kib (strong reference) Sponsored by: Chelsio Communications Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/netinet/tcp_timer.c stable/11/sys/netinet/tcp_timer.h Directory Properties: stable/11/ (props changed) Changes in other areas also in this revision: Modified: stable/10/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c stable/10/sys/dev/cxgbe/tom/t4_tom.c stable/10/sys/netinet/tcp_timer.c stable/10/sys/netinet/tcp_timer.h Directory Properties: stable/10/ (props changed) Modified: stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c ============================================================================== --- stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c Sat Mar 3 00:54:12 2018 (r330303) @@ -87,7 +87,6 @@ VNET_DECLARE(int, tcp_autorcvbuf_inc); #define V_tcp_autorcvbuf_inc VNET(tcp_autorcvbuf_inc) VNET_DECLARE(int, tcp_autorcvbuf_max); #define V_tcp_autorcvbuf_max VNET(tcp_autorcvbuf_max) -extern int always_keepalive; /* * For ULP connections HW may add headers, e.g., for digests, that aren't part @@ -840,7 +839,7 @@ calc_opt0h(struct socket *so, int mtu_idx, int rscale, if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0h |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/dev/cxgbe/tom/t4_tom.c ============================================================================== --- stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/dev/cxgbe/tom/t4_tom.c Sat Mar 3 00:54:12 2018 (r330303) @@ -56,6 +56,7 @@ __FBSDID("$FreeBSD$"); #include #define TCPSTATES #include +#include #include #include @@ -535,8 +536,6 @@ select_rcv_wscale(void) return (wscale); } -extern int always_keepalive; - /* * socket so could be a listening socket too. */ @@ -555,7 +554,7 @@ calc_opt0(struct socket *so, struct vi_info *vi, struc if (so != NULL) { struct inpcb *inp = sotoinpcb(so); struct tcpcb *tp = intotcpcb(inp); - int keepalive = always_keepalive || + int keepalive = tcp_always_keepalive || so_options_get(so) & SO_KEEPALIVE; opt0 |= V_NAGLE((tp->t_flags & TF_NODELAY) == 0); Modified: stable/11/sys/netinet/tcp_timer.c ============================================================================== --- stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.c Sat Mar 3 00:54:12 2018 (r330303) @@ -116,9 +116,10 @@ SYSCTL_PROC(_net_inet_tcp, OID_AUTO, rexmit_slop, CTLT &tcp_rexmit_slop, 0, sysctl_msec_to_ticks, "I", "Retransmission Timer Slop"); -static int always_keepalive = 1; +int tcp_always_keepalive = 1; SYSCTL_INT(_net_inet_tcp, OID_AUTO, always_keepalive, CTLFLAG_RW, - &always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); + &tcp_always_keepalive , 0, "Assume SO_KEEPALIVE on all TCP connections"); +__strong_reference(tcp_always_keepalive, always_keepalive); int tcp_fast_finwait2_recycle = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, fast_finwait2_recycle, CTLFLAG_RW, @@ -428,7 +429,8 @@ tcp_timer_keep(void *xtp) TCPSTAT_INC(tcps_keeptimeo); if (tp->t_state < TCPS_ESTABLISHED) goto dropit; - if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && + if ((tcp_always_keepalive || + inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; Modified: stable/11/sys/netinet/tcp_timer.h ============================================================================== --- stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:22:32 2018 (r330302) +++ stable/11/sys/netinet/tcp_timer.h Sat Mar 3 00:54:12 2018 (r330303) @@ -188,6 +188,7 @@ extern int tcp_ttl; /* time to live for TCP segs */ extern int tcp_backoff[]; extern int tcp_syn_backoff[]; +extern int tcp_always_keepalive; extern int tcp_finwait2_timeout; extern int tcp_fast_finwait2_recycle; From owner-svn-src-stable-11@freebsd.org Sat Mar 3 02:39:54 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CC989F38DD3; Sat, 3 Mar 2018 02:39:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7F8FE87D09; Sat, 3 Mar 2018 02:39:54 +0000 (UTC) (envelope-from np@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 7A8B82025B; Sat, 3 Mar 2018 02:39:54 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w232dsbM090145; Sat, 3 Mar 2018 02:39:54 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w232dss0090144; Sat, 3 Mar 2018 02:39:54 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030239.w232dss0090144@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 02:39: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: r330308 - stable/11/sys/dev/cxgb X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/sys/dev/cxgb X-SVN-Commit-Revision: 330308 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.25 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, 03 Mar 2018 02:39:55 -0000 Author: np Date: Sat Mar 3 02:39:54 2018 New Revision: 330308 URL: https://svnweb.freebsd.org/changeset/base/330308 Log: MFC r328315: cxgb(4): Validate offset/len in the GET_EEPROM ioctl. Modified: stable/11/sys/dev/cxgb/cxgb_main.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/dev/cxgb/cxgb_main.c ============================================================================== --- stable/11/sys/dev/cxgb/cxgb_main.c Sat Mar 3 02:30:52 2018 (r330307) +++ stable/11/sys/dev/cxgb/cxgb_main.c Sat Mar 3 02:39:54 2018 (r330308) @@ -2958,8 +2958,14 @@ cxgb_extension_ioctl(struct cdev *dev, unsigned long c case CHELSIO_GET_EEPROM: { int i; struct ch_eeprom *e = (struct ch_eeprom *)data; - uint8_t *buf = malloc(EEPROMSIZE, M_DEVBUF, M_NOWAIT); + uint8_t *buf; + if (e->offset & 3 || e->offset >= EEPROMSIZE || + e->len > EEPROMSIZE || e->offset + e->len > EEPROMSIZE) { + return (EINVAL); + } + + buf = malloc(EEPROMSIZE, M_DEVBUF, M_NOWAIT); if (buf == NULL) { return (ENOMEM); } From owner-svn-src-stable-11@freebsd.org Sat Mar 3 02:30:53 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 97ECEF384C3; Sat, 3 Mar 2018 02:30:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 470D187653; Sat, 3 Mar 2018 02:30:53 +0000 (UTC) (envelope-from np@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 41B11200C0; Sat, 3 Mar 2018 02:30:53 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w232Urjb085995; Sat, 3 Mar 2018 02:30:53 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w232UqcG085987; Sat, 3 Mar 2018 02:30:52 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030230.w232UqcG085987@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 02:30:52 +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: r330307 - in stable/11: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/dev/cxgbe/firmware sys/dev/cxgbe/iw_cxgbe sys/dev/cxgbe/tom sys/modules/cxgbe/... X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: in stable/11: share/man/man4 sys/conf sys/dev/cxgbe sys/dev/cxgbe/common sys/dev/cxgbe/cudbg sys/dev/cxgbe/firmware sys/dev/cxgbe/iw_cxgbe sys/dev/cxgbe/tom sys/modules/cxgbe/if_cxgbe sys/modules/cxgb... X-SVN-Commit-Revision: 330307 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.25 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, 03 Mar 2018 02:30:54 -0000 Author: np Date: Sat Mar 3 02:30:52 2018 New Revision: 330307 URL: https://svnweb.freebsd.org/changeset/base/330307 Log: MFC r319506, r319872, r321063, r321103, r321179, r321390, r321435, r321582, r321671, r322014, r322034, r322055, r322123, r322167, r322425, r322549, r322914, r322960, r322962, r322964, r322985, r322990, r323006, r323026, r323041, r323069, r323078, r323343, r323514, r323520, r324296, r324379, r324386, r324443, r324945, r325596, r325680, r325880, r325883-r325884, r325961, r326026, r326042, r327062, r327093, r327332, r327528, r328420, and r328423. r319506: cxgbe(4): Update the statistics for compound tx work requests once per work request, not once per frame. r319872: cxgbe(4): Do not request an FEC setting that the port does not support. r321063: cxgbe(4): Various link/media related improvements. - Deal with changes to port_type, and not just port_mod when a transceiver is changed. This fixes hot swapping of transceivers of different types (QSFP+ or QSA or QSFP28 in a QSFP28 port, SFP+ or SFP28 in a SFP28 port, etc.). - Always refresh media information for ifconfig if the port is down. The firmware does not generate tranceiver-change interrupts unless at least one VI is enabled on the physical port. Before this change ifconfig diplayed potentially stale information for ports that were administratively down. - Always recalculate and reapply L1 config on a transceiver change. - Display PAUSE settings in ifconfig. The driver sysctls for this continue to work as well. r321103: cxgbe(4): New ioctls to flash bootrom and boot config to the card. r321179: cxgbe/t4_tom: Log more details about the newly ESTABLISHED tid to the trace buffer. r321390: cxgbe(4): Install the firmware bundled with the driver to the card if it doesn't seem to have one. This lets the driver recover automatically from incomplete firmware upgrades (panic, reboot, power loss, etc. in the middle of an upgrade). r321435: cxgbe(4): Display some more TOE parameters related to retransmission and keepalive in the sysctl MIB. Provide tunables to change some of these parameters. These are supposed to be setup by the firmware so these tunables are for experimentation only. r321582: cxgbe(4): Some updates to the common code. - Updated register ranges. - Helper routines for access to TP registers. - Updated routine to read flash parameters. r321671: cxgbe/iw_cxgbe: Log the end point's history and flags to the trace buffer just before it's freed. r322014: cxgbe(4): Initial import of the "collect" component of Chelsio unified debug (cudbg) code, hooked up to the main driver via an ioctl. The ioctl can be used to collect the chip's internal state in a compressed dump file. These dumps can be decoded with the "view" component of cudbg. r322034: cxgbe(4): Always use the first and not the last virtual interface associated with a port in begin_synchronized_op. r322055: cxgbe(4): Allow the TOE timer tunables to be set with microsecond precision. These timers are already displayed in microseconds in the sysctl MIB. Add variables to track these tunables while here. r322123: cxgbe(4): Avoid a NULL dereference that would occur during module unload if there were problems earlier during attach. r322167: cxgbe(4): Add the T6 and T5 Unified Wire configuration files to the kernel, just like for T4, when the driver is compiled into the kernel. r322425: cxgbe(4): Save the last reported link parameters and compare them with the current state to determine whether to generate a link-state change notification. This fixes a bug introduced in r321063 that caused the driver to sometimes skip these notifications. r322549: cxgbe/t4_tom: Use correct name for the ISS-valid bit in options2. r322914: cxgbe(4): Dump the mailbox contents in the same format as CH_DUMP_MBOX. r322960: cxgbe(4): Verify that the driver accesses the firmware mailbox in a thread-safe manner. r322962: cxgbe(4): Remove write only variable from t4_port_init. r322964: cxgbe(4): vi_mac_funcs should include the base Ethernet function. It is already used in the driver as if it does. r322985: cxgbe(4): Maintain one ifmedia per physical port instead of one per Virtual Interface (VI). All autonomous VIs that share a port share the same media. r322990: cxgbe(4): Do not access the mailbox without appropriate locks while creating hardware VIs. This fixes a bad race on systems with hw.cxgbe.num_vis > 1. r323006: cxgbe(4): Update T6/T5/T4 firmwares to 1.16.59.0. r323026: cxgbe(4): Zero out the memory allocated for the debug dump. cudbg_collect seems to expect it this way. r323041: cxgbe(4): Add two new debug flags -- one to allow manual firmware install after full initialization, and another to disable the TCB cache (T6+). The latter works as a tunable only. Note that debug_flags are for debugging only and should not be set normally. r323069: cxgbe/t4_tom: Add a knob to select the congestion control algorigthm used by the TOE hardware for fully offloaded connections. The knob affects new connections only. r323078: cxgbe/t4_tom: There may not be a tid to update if the connection isn't established. r323343: cxgbe(4): Fix a couple of problems in the sge_wrq data path. - start_wrq_wr must not drain the wr_list if there are incomplete_wrs pending. This can happen when a t4_wrq_tx runs between two start_wrq_wr. - commit_wrq_wr must examine the cookie's pidx and ndesc with the queue's lock held. Otherwise there is a bad race when incomplete WRs are being completed and commit_wrq_wr for the WR that is ahead in the queue updates the next incomplete WR's cookie's pidx/ndesc but the commit_wrq_wr for the second one is using stale values that it read without the lock. r323514: cxgbetool(8): mode must be specified when creating the dump file. r323520: cxgbe(4): Ignore capabilities that depend on TOE when the firmware reports TOE is not available. r324296: cxgbe(4): Provide knobs to set the holdoff parameters of TOE rx queues separately from NIC rx queues instead of using the same parameters for both types of queues. r324379: cxgbetool(8): Do not create a large file devoid of useful content when the dumpstate ioctl fails. Make the file world-readable while here. r324386: cxgbe(4): Update T6, T5, and T4 firmwares to 1.16.63.0. r324443: cxgbetool(8): Do not close uninitialized fd on malloc failure. r324945: cxgbe(4): Read the MPS buffer group map from the firmware as it could be different from hardware defaults. The congestion channel map, which is still fixed, needs to be tracked separately now. Change the congestion setting for TOE rx queues to match the drivers on other OSes while here. r325596: cxgbe(4): Do not request settings not supported by the port. r325680: cxgbe(4): Excluce mdi from the check against port capabilities. r325880: cxgbe(4): Combine all _10g and _1g tunables and drop the suffix from their names. The finer-grained knobs weren't practically useful. r325883: cxgbe(4): Sanitize t4_num_vis during MOD_LOAD like all other t4_* tunables. Add num_vis to the intrs_and_queues structure as it affects the number of interrupts requested and queues created. In future cfg_itype_and_nqueues might lower it incrementally instead of going straight to 1 when enough interrupts aren't available. r325884: cxgbe(4): Remove rsrv_noflowq from intrs_and_queues structure as it does not influence or get affected by the number of interrupts or queues. r325961: cxgbe(4): Add core Vdd to the sysctl MIB. r326026: cxgbe(4): Add a custom board to the device id list. r326042: cxgbe(4): Fix unsafe mailbox access in cudbg. r327062: cxgbe(4): Read the MFG diags version from the VPD and make it available in the sysctl MIB. r327093: cxgbe(4): Do not forward interrupts to queues with freelists. This leaves the firmware event queue (fwq) as the only queue that can take interrupts for others. This simplifies cfg_itype_and_nqueues and queue allocation in the driver at the cost of a little (never?) used configuration. It also allows service_iq to be split into two specialized variants in the future. r327332: cxgbe(4): Reduce duplication by consolidating minor variations of the same code into a single routine. r327528: cxgbe(4): Add a knob to enable/disable PCIe relaxed ordering. Disable it by default when running on Intel CPUs. r328420: cxgbe(4): Do not display harmless warning in non-debug builds. r328423: cxgbe(4): Accept old names of a couple of tunables. Sponsored by: Chelsio Communications Added: stable/11/sys/dev/cxgbe/cudbg/ - copied from r322014, head/sys/dev/cxgbe/cudbg/ stable/11/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu - copied unchanged from r324386, head/sys/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu - copied unchanged from r324386, head/sys/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu - copied unchanged from r324386, head/sys/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu Deleted: stable/11/sys/dev/cxgbe/firmware/t4fw-1.16.45.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t5fw-1.16.45.0.bin.uu stable/11/sys/dev/cxgbe/firmware/t6fw-1.16.45.0.bin.uu Modified: stable/11/share/man/man4/cxgbe.4 stable/11/share/man/man4/cxgbev.4 stable/11/sys/conf/files stable/11/sys/dev/cxgbe/adapter.h stable/11/sys/dev/cxgbe/common/common.h stable/11/sys/dev/cxgbe/common/t4_hw.c stable/11/sys/dev/cxgbe/common/t4_hw.h stable/11/sys/dev/cxgbe/cudbg/cudbg_lib.c stable/11/sys/dev/cxgbe/firmware/t4fw_interface.h stable/11/sys/dev/cxgbe/firmware/t6fw_cfg.txt stable/11/sys/dev/cxgbe/firmware/t6fw_cfg_uwire.txt stable/11/sys/dev/cxgbe/iw_cxgbe/cm.c stable/11/sys/dev/cxgbe/iw_cxgbe/qp.c stable/11/sys/dev/cxgbe/offload.h stable/11/sys/dev/cxgbe/t4_ioctl.h stable/11/sys/dev/cxgbe/t4_main.c stable/11/sys/dev/cxgbe/t4_netmap.c stable/11/sys/dev/cxgbe/t4_sched.c stable/11/sys/dev/cxgbe/t4_sge.c stable/11/sys/dev/cxgbe/t4_vf.c stable/11/sys/dev/cxgbe/tom/t4_connect.c stable/11/sys/dev/cxgbe/tom/t4_cpl_io.c stable/11/sys/dev/cxgbe/tom/t4_listen.c stable/11/sys/dev/cxgbe/tom/t4_tom.c stable/11/sys/modules/cxgbe/if_cxgbe/Makefile stable/11/sys/modules/cxgbe/t4_firmware/Makefile stable/11/sys/modules/cxgbe/t5_firmware/Makefile stable/11/sys/modules/cxgbe/t6_firmware/Makefile stable/11/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/share/man/man4/cxgbe.4 ============================================================================== --- stable/11/share/man/man4/cxgbe.4 Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/share/man/man4/cxgbe.4 Sat Mar 3 02:30:52 2018 (r330307) @@ -172,37 +172,22 @@ types. A negative value for such a tunable instructs the driver to create up to that many queues if there are enough CPU cores available. .Bl -tag -width indent -.It Va hw.cxgbe.ntxq10g -Number of tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.ntxq +Number of NIC tx queues used for a port. The default is 16 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq10g -Number of rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nrxq +Number of NIC rx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.ntxq1g -Number of tx queues used for a 1Gb port. -The default is 4 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq1g -Number of rx queues used for a 1Gb port. -The default is 2 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldtxq10g -Number of TOE tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nofldtxq +Number of TOE tx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldrxq10g -Number of TOE rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nofldrxq +Number of TOE rx queues used for a port. The default is 2 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldtxq1g -Number of TOE tx queues used for a 1Gb port. -The default is 2 or the -number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nofldrxq1g -Number of TOE rx queues used for a 1Gb port. -The default is 1. .It Va hw.cxgbe.num_vis Number of virtual interfaces (VIs) created for each port. Each virtual interface creates a separate network interface. @@ -213,25 +198,27 @@ name from the table above. Additional virtual interfaces use a single pair of queues for rx and tx as well an additional pair of queues for TOE rx and tx. The default is 1. -.It Va hw.cxgbe.holdoff_timer_idx_10G -.It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx +.It Va hw.cxgbe.holdoff_timer_idx_ofld Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a value from this list. +holdoff_timer_idx_ofld applies to queues used for TOE rx. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the -dev..X.holdoff_tmr_idx sysctl. -.It Va hw.cxgbe.holdoff_pktc_idx_10G -.It Va hw.cxgbe.holdoff_pktc_idx_1G +dev..X.holdoff_tmr_idx and dev..X.holdoff_tmr_idx_ofld sysctls. +.It Va hw.cxgbe.holdoff_pktc_idx +.It Va hw.cxgbe.holdoff_pktc_idx_ofld Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. +holdoff_pktc_idx_ofld applies to queues used for TOE rx. The default value is -1 which means packet counting is disabled and interrupts are generated based solely on the holdoff timer value. Different interfaces can be assigned different values via the -dev..X.holdoff_pktc_idx sysctl. -This sysctl works only when the interface has never been marked up (as done by +dev..X.holdoff_pktc_idx and dev..X.holdoff_pktc_idx_ofld sysctls. +These sysctls work only when the interface has never been marked up (as done by ifconfig up). .It Va hw.cxgbe.qsize_txq Number of entries in a transmit queue's descriptor ring. @@ -256,6 +243,13 @@ Permitted interrupt types. Bit 0 represents INTx (line interrupts), bit 1 MSI, and bit 2 MSI-X. The default is 7 (all allowed). The driver selects the best possible type out of the allowed types. +.It Va hw.cxgbe.pcie_relaxed_ordering +PCIe Relaxed Ordering. +-1 indicates the driver should determine whether to enable or disable PCIe RO. +0 disables PCIe RO. +1 enables PCIe RO. +2 indicates the driver should not modify the PCIe RO setting. +The default is -1. .It Va hw.cxgbe.fw_install 0 prohibits the driver from installing a firmware on the card. 1 allows the driver to install a new firmware if internal driver Modified: stable/11/share/man/man4/cxgbev.4 ============================================================================== --- stable/11/share/man/man4/cxgbev.4 Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/share/man/man4/cxgbev.4 Sat Mar 3 02:30:52 2018 (r330307) @@ -172,24 +172,15 @@ Tunables can be set at the prompt before booting the kernel or stored in .Xr loader.conf 5 . .Bl -tag -width indent -.It Va hw.cxgbe.ntxq10g -Number of tx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.ntxq +Number of tx queues used for a port. The default is 16 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq10g -Number of rx queues used for a 10Gb or higher-speed port. +.It Va hw.cxgbe.nrxq +Number of rx queues used for a port. The default is 8 or the number of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.ntxq1g -Number of tx queues used for a 1Gb port. -The default is 4 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.nrxq1g -Number of rx queues used for a 1Gb port. -The default is 2 or the number -of CPU cores in the system, whichever is less. -.It Va hw.cxgbe.holdoff_timer_idx_10G -.It Va hw.cxgbe.holdoff_timer_idx_1G +.It Va hw.cxgbe.holdoff_timer_idx Timer index value used to delay interrupts. The holdoff timer list has the values 1, 5, 10, 50, 100, and 200 by default (all values are in microseconds) and the index selects a @@ -197,8 +188,7 @@ value from this list. The default value is 1 which means the timer value is 5us. Different interfaces can be assigned different values at any time via the dev..X.holdoff_tmr_idx sysctl. -.It Va hw.cxgbe.holdoff_pktc_idx_10G -.It Va hw.cxgbe.holdoff_pktc_idx_1G +.It Va hw.cxgbe.holdoff_pktc_idx Packet-count index value used to delay interrupts. The packet-count list has the values 1, 8, 16, and 32 by default, and the index selects a value from this list. Modified: stable/11/sys/conf/files ============================================================================== --- stable/11/sys/conf/files Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/conf/files Sat Mar 3 02:30:52 2018 (r330307) @@ -1331,6 +1331,18 @@ dev/cxgbe/common/t4_hw.c optional cxgbe pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" dev/cxgbe/common/t4vf_hw.c optional cxgbev pci \ compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_common.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_flash_utils.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_lib.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/cudbg_wtp.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" +dev/cxgbe/cudbg/fastlz_api.c optional cxgbe \ + compile-with "${NORMAL_C} -I$S/dev/cxgbe" t4fw_cfg.c optional cxgbe \ compile-with "${AWK} -f $S/tools/fw_stub.awk t4fw_cfg.fw:t4fw_cfg t4fw_cfg_uwire.fw:t4fw_cfg_uwire t4fw.fw:t4fw -mt4fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ @@ -1361,12 +1373,12 @@ t4fw.fwo optional cxgbe \ no-implicit-rule \ clean "t4fw.fwo" t4fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t4fw-1.16.45.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t4fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t4fw.fw" t5fw_cfg.c optional cxgbe \ - compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw.fw:t5fw -mt5fw_cfg -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t5fw_cfg.fw:t5fw_cfg t5fw_cfg_uwire.fw:t5fw_cfg_uwire t4fw.fw:t4fw -mt5fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "t5fw_cfg.c" t5fw_cfg.fwo optional cxgbe \ @@ -1379,18 +1391,28 @@ t5fw_cfg.fw optional cxgbe \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t5fw_cfg.fw" +t5fw_cfg_uwire.fwo optional cxgbe \ + dependency "t5fw_cfg_uwire.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t5fw_cfg_uwire.fwo" +t5fw_cfg_uwire.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t5fw_cfg_uwire.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t5fw_cfg_uwire.fw" t5fw.fwo optional cxgbe \ dependency "t5fw.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "t5fw.fwo" t5fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t5fw-1.16.45.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t5fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t5fw.fw" t6fw_cfg.c optional cxgbe \ - compile-with "${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \ + compile-with "${AWK} -f $S/tools/fw_stub.awk t6fw_cfg.fw:t6fw_cfg t6fw_cfg_uwire.fw:t6fw_cfg_uwire t6fw.fw:t6fw -mt6fw_cfg -c${.TARGET}" \ no-implicit-rule before-depend local \ clean "t6fw_cfg.c" t6fw_cfg.fwo optional cxgbe \ @@ -1403,13 +1425,23 @@ t6fw_cfg.fw optional cxgbe \ compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ no-obj no-implicit-rule \ clean "t6fw_cfg.fw" +t6fw_cfg_uwire.fwo optional cxgbe \ + dependency "t6fw_cfg_uwire.fw" \ + compile-with "${NORMAL_FWO}" \ + no-implicit-rule \ + clean "t6fw_cfg_uwire.fwo" +t6fw_cfg_uwire.fw optional cxgbe \ + dependency "$S/dev/cxgbe/firmware/t6fw_cfg_uwire.txt" \ + compile-with "${CP} ${.ALLSRC} ${.TARGET}" \ + no-obj no-implicit-rule \ + clean "t6fw_cfg_uwire.fw" t6fw.fwo optional cxgbe \ dependency "t6fw.fw" \ compile-with "${NORMAL_FWO}" \ no-implicit-rule \ clean "t6fw.fwo" t6fw.fw optional cxgbe \ - dependency "$S/dev/cxgbe/firmware/t6fw-1.16.45.0.bin.uu" \ + dependency "$S/dev/cxgbe/firmware/t6fw-1.16.63.0.bin.uu" \ compile-with "${NORMAL_FW}" \ no-obj no-implicit-rule \ clean "t6fw.fw" Modified: stable/11/sys/dev/cxgbe/adapter.h ============================================================================== --- stable/11/sys/dev/cxgbe/adapter.h Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/dev/cxgbe/adapter.h Sat Mar 3 02:30:52 2018 (r330307) @@ -151,7 +151,7 @@ enum { /* adapter flags */ FULL_INIT_DONE = (1 << 0), FW_OK = (1 << 1), - /* INTR_DIRECT = (1 << 2), No longer used. */ + CHK_MBOX_ACCESS = (1 << 2), MASTER_PF = (1 << 3), ADAP_SYSCTL_CTX = (1 << 4), /* TOM_INIT_DONE= (1 << 5), No longer used */ @@ -167,12 +167,11 @@ enum { DOOMED = (1 << 0), VI_INIT_DONE = (1 << 1), VI_SYSCTL_CTX = (1 << 2), - INTR_RXQ = (1 << 4), /* All NIC rxq's take interrupts */ - INTR_OFLD_RXQ = (1 << 5), /* All TOE rxq's take interrupts */ - INTR_ALL = (INTR_RXQ | INTR_OFLD_RXQ), /* adapter debug_flags */ - DF_DUMP_MBOX = (1 << 0), + DF_DUMP_MBOX = (1 << 0), /* Log all mbox cmd/rpl. */ + DF_LOAD_FW_ANYTIME = (1 << 1), /* Allow LOAD_FW after init */ + DF_DISABLE_TCB_CACHE = (1 << 2), /* Disable TCB cache (T6+) */ }; #define IS_DOOMED(vi) ((vi)->flags & DOOMED) @@ -186,7 +185,6 @@ struct vi_info { struct port_info *pi; struct ifnet *ifp; - struct ifmedia media; unsigned long flags; int if_flags; @@ -218,7 +216,9 @@ struct vi_info { int nnmrxq; int first_nm_rxq; int tmr_idx; + int ofld_tmr_idx; int pktc_idx; + int ofld_pktc_idx; int qsize_rxq; int qsize_txq; @@ -284,9 +284,12 @@ struct port_info { uint8_t mod_type; uint8_t port_id; uint8_t tx_chan; - uint8_t rx_chan_map; /* rx MPS channel bitmap */ + uint8_t mps_bg_map; /* rx MPS buffer group bitmap */ + uint8_t rx_e_chan_map; /* rx TP e-channel bitmap */ struct link_config link_cfg; + struct link_config old_link_cfg; + struct ifmedia media; struct timeval last_refreshed; struct port_stats stats; @@ -341,7 +344,7 @@ enum { /* iq flags */ IQ_ALLOCATED = (1 << 0), /* firmware resources allocated */ IQ_HAS_FL = (1 << 1), /* iq associated with a freelist */ - IQ_INTR = (1 << 2), /* iq takes direct interrupt */ + /* 1 << 2 Used to be IQ_INTR */ IQ_LRO_ENABLED = (1 << 3), /* iq is an eth rxq with LRO enabled */ IQ_ADJ_CREDIT = (1 << 4), /* hw is off by 1 credit for this iq */ @@ -790,7 +793,7 @@ struct adapter { struct taskqueue *tq[MAX_NCHAN]; /* General purpose taskqueues */ struct port_info *port[MAX_NPORTS]; - uint8_t chan_map[MAX_NCHAN]; + uint8_t chan_map[MAX_NCHAN]; /* channel -> port */ void *tom_softc; /* (struct tom_data *) */ struct tom_tunables tt; @@ -945,6 +948,13 @@ struct adapter { /* One for firmware events */ #define T4VF_EXTRA_INTR 1 +static inline int +forwarding_intr_to_fwq(struct adapter *sc) +{ + + return (sc->intr_count == 1); +} + static inline uint32_t t4_read_reg(struct adapter *sc, uint32_t reg) { @@ -1034,10 +1044,10 @@ adap2pinfo(struct adapter *sc, int idx) } static inline void -t4_os_set_hw_addr(struct adapter *sc, int idx, uint8_t hw_addr[]) +t4_os_set_hw_addr(struct port_info *pi, uint8_t hw_addr[]) { - bcopy(hw_addr, sc->port[idx]->vi[0].hw_addr, ETHER_ADDR_LEN); + bcopy(hw_addr, pi->vi[0].hw_addr, ETHER_ADDR_LEN); } static inline bool @@ -1087,24 +1097,6 @@ port_top_speed(const struct port_info *pi) } static inline int -port_top_speed_raw(const struct port_info *pi) -{ - - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_100G) - return (FW_PORT_CAP_SPEED_100G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_40G) - return (FW_PORT_CAP_SPEED_40G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_25G) - return (FW_PORT_CAP_SPEED_25G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_10G) - return (FW_PORT_CAP_SPEED_10G); - if (pi->link_cfg.supported & FW_PORT_CAP_SPEED_1G) - return (FW_PORT_CAP_SPEED_1G); - - return (0); -} - -static inline int tx_resume_threshold(struct sge_eq *eq) { @@ -1124,15 +1116,11 @@ t4_use_ldst(struct adapter *sc) } /* t4_main.c */ -extern int t4_ntxq10g; -extern int t4_nrxq10g; -extern int t4_ntxq1g; -extern int t4_nrxq1g; +extern int t4_ntxq; +extern int t4_nrxq; extern int t4_intr_types; -extern int t4_tmr_idx_10g; -extern int t4_pktc_idx_10g; -extern int t4_tmr_idx_1g; -extern int t4_pktc_idx_1g; +extern int t4_tmr_idx; +extern int t4_pktc_idx; extern unsigned int t4_qsize_rxq; extern unsigned int t4_qsize_txq; extern device_method_t cxgbe_methods[]; @@ -1140,8 +1128,8 @@ extern device_method_t cxgbe_methods[]; int t4_os_find_pci_capability(struct adapter *, int); int t4_os_pci_save_state(struct adapter *); int t4_os_pci_restore_state(struct adapter *); -void t4_os_portmod_changed(const struct adapter *, int); -void t4_os_link_changed(struct adapter *, int, int); +void t4_os_portmod_changed(struct port_info *); +void t4_os_link_changed(struct port_info *); void t4_iterate(void (*)(struct adapter *, void *), void *); void t4_init_devnames(struct adapter *); void t4_add_adapter(struct adapter *); Modified: stable/11/sys/dev/cxgbe/common/common.h ============================================================================== --- stable/11/sys/dev/cxgbe/common/common.h Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/dev/cxgbe/common/common.h Sat Mar 3 02:30:52 2018 (r330307) @@ -42,6 +42,7 @@ enum { EC_LEN = 16, /* E/C length */ ID_LEN = 16, /* ID length */ PN_LEN = 16, /* Part Number length */ + MD_LEN = 16, /* MFG diags version length */ MACADDR_LEN = 12, /* MAC Address length */ }; @@ -254,6 +255,7 @@ struct vpd_params { u8 id[ID_LEN + 1]; u8 pn[PN_LEN + 1]; u8 na[MACADDR_LEN + 1]; + u8 md[MD_LEN + 1]; }; struct pci_params { @@ -332,6 +334,7 @@ struct adapter_params { struct devlog_params devlog; /* PF-only */ struct rss_params rss; /* VF-only */ struct vf_resources vfres; /* VF-only */ + unsigned int core_vdd; unsigned int sf_size; /* serial flash size in bytes */ unsigned int sf_nsec; /* # of flash sectors */ @@ -369,6 +372,8 @@ struct adapter_params { unsigned int max_ordird_qp; unsigned int max_ird_adapter; + + uint32_t mps_bg_map; /* rx buffer group map for all ports (upto 4) */ }; #define CHELSIO_T4 0x4 @@ -399,16 +404,18 @@ struct trace_params { }; struct link_config { + /* OS-specific code owns all the requested_* fields */ + unsigned char requested_aneg; /* link aneg user has requested */ + unsigned char requested_fc; /* flow control user has requested */ + unsigned char requested_fec; /* FEC user has requested */ + unsigned int requested_speed; /* speed user has requested */ + unsigned short supported; /* link capabilities */ unsigned short advertising; /* advertised capabilities */ unsigned short lp_advertising; /* peer advertised capabilities */ - unsigned int requested_speed; /* speed user has requested */ unsigned int speed; /* actual link speed */ - unsigned char requested_fc; /* flow control user has requested */ unsigned char fc; /* actual link flow control */ - unsigned char requested_fec; /* FEC user has requested */ unsigned char fec; /* actual FEC */ - unsigned char autoneg; /* autonegotiating? */ unsigned char link_ok; /* link up? */ unsigned char link_down_rc; /* link down reason */ }; @@ -499,6 +506,12 @@ static inline unsigned int dack_ticks_to_usec(const st return (ticks << adap->params.tp.dack_re) / core_ticks_per_usec(adap); } +static inline u_int us_to_tcp_ticks(const struct adapter *adap, u_long us) +{ + + return (us * adap->params.vpd.cclk / 1000 >> adap->params.tp.tre); +} + void t4_set_reg_field(struct adapter *adap, unsigned int addr, u32 mask, u32 val); int t4_wr_mbox_meat_timeout(struct adapter *adap, int mbox, const void *cmd, @@ -572,11 +585,11 @@ int t4_get_vpd_version(struct adapter *adapter, u32 *v int t4_get_version_info(struct adapter *adapter); int t4_init_hw(struct adapter *adapter, u32 fw_params); const struct chip_params *t4_get_chip_params(int chipid); -int t4_prep_adapter(struct adapter *adapter, u8 *buf); +int t4_prep_adapter(struct adapter *adapter, u32 *buf); int t4_shutdown_adapter(struct adapter *adapter); int t4_init_devlog_params(struct adapter *adapter, int fw_attach); int t4_init_sge_params(struct adapter *adapter); -int t4_init_tp_params(struct adapter *adap); +int t4_init_tp_params(struct adapter *adap, bool sleep_ok); int t4_filter_field_shift(const struct adapter *adap, int filter_sel); int t4_port_init(struct adapter *adap, int mbox, int pf, int vf, int port_id); void t4_fatal_err(struct adapter *adapter); @@ -594,20 +607,21 @@ int t4_config_vi_rss(struct adapter *adapter, int mbox unsigned int flags, unsigned int defq, unsigned int skeyidx, unsigned int skey); int t4_read_rss(struct adapter *adapter, u16 *entries); -void t4_fw_tp_pio_rw(struct adapter *adap, u32 *vals, unsigned int nregs, - unsigned int start_index, unsigned int rw); -void t4_read_rss_key(struct adapter *adapter, u32 *key); -void t4_write_rss_key(struct adapter *adap, u32 *key, int idx); -void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, u32 *valp); -void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, u32 val); +void t4_read_rss_key(struct adapter *adapter, u32 *key, bool sleep_ok); +void t4_write_rss_key(struct adapter *adap, const u32 *key, int idx, + bool sleep_ok); +void t4_read_rss_pf_config(struct adapter *adapter, unsigned int index, + u32 *valp, bool sleep_ok); +void t4_write_rss_pf_config(struct adapter *adapter, unsigned int index, + u32 val, bool sleep_ok); void t4_read_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 *vfl, u32 *vfh); + u32 *vfl, u32 *vfh, bool sleep_ok); void t4_write_rss_vf_config(struct adapter *adapter, unsigned int index, - u32 vfl, u32 vfh); -u32 t4_read_rss_pf_map(struct adapter *adapter); -void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap); -u32 t4_read_rss_pf_mask(struct adapter *adapter); -void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask); + u32 vfl, u32 vfh, bool sleep_ok); +u32 t4_read_rss_pf_map(struct adapter *adapter, bool sleep_ok); +void t4_write_rss_pf_map(struct adapter *adapter, u32 pfmap, bool sleep_ok); +u32 t4_read_rss_pf_mask(struct adapter *adapter, bool sleep_ok); +void t4_write_rss_pf_mask(struct adapter *adapter, u32 pfmask, bool sleep_ok); int t4_mps_set_active_ports(struct adapter *adap, unsigned int port_mask); void t4_pmtx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); void t4_pmrx_get_stats(struct adapter *adap, u32 cnt[], u64 cycles[]); @@ -653,19 +667,24 @@ void t4_read_mtu_tbl(struct adapter *adap, u16 *mtus, void t4_read_cong_tbl(struct adapter *adap, u16 incr[NMTUS][NCCTRL_WIN]); void t4_read_pace_tbl(struct adapter *adap, unsigned int pace_vals[NTX_SCHED]); void t4_get_tx_sched(struct adapter *adap, unsigned int sched, unsigned int *kbps, - unsigned int *ipg); + unsigned int *ipg, bool sleep_ok); void t4_tp_wr_bits_indirect(struct adapter *adap, unsigned int addr, unsigned int mask, unsigned int val); void t4_tp_read_la(struct adapter *adap, u64 *la_buf, unsigned int *wrptr); -void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st); -void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st); -void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st); -void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st); -void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st); +void t4_tp_get_err_stats(struct adapter *adap, struct tp_err_stats *st, + bool sleep_ok); +void t4_tp_get_proxy_stats(struct adapter *adap, struct tp_proxy_stats *st, + bool sleep_ok); +void t4_tp_get_cpl_stats(struct adapter *adap, struct tp_cpl_stats *st, + bool sleep_ok); +void t4_tp_get_rdma_stats(struct adapter *adap, struct tp_rdma_stats *st, + bool sleep_ok); +void t4_get_usm_stats(struct adapter *adap, struct tp_usm_stats *st, + bool sleep_ok); void t4_tp_get_tcp_stats(struct adapter *adap, struct tp_tcp_stats *v4, - struct tp_tcp_stats *v6); + struct tp_tcp_stats *v6, bool sleep_ok); void t4_get_fcoe_stats(struct adapter *adap, unsigned int idx, - struct tp_fcoe_stats *st); + struct tp_fcoe_stats *st, bool sleep_ok); void t4_load_mtus(struct adapter *adap, const unsigned short *mtus, const unsigned short *alpha, const unsigned short *beta); @@ -676,7 +695,8 @@ int t4_set_sched_ipg(struct adapter *adap, int sched, int t4_set_pace_tbl(struct adapter *adap, const unsigned int *pace_vals, unsigned int start, unsigned int n); void t4_get_chan_txrate(struct adapter *adap, u64 *nic_rate, u64 *ofld_rate); -int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map); +int t4_set_filter_mode(struct adapter *adap, unsigned int mode_map, + bool sleep_ok); void t4_mk_filtdelwr(unsigned int ftid, struct fw_filter_wr *wr, int qid); void t4_wol_magic_enable(struct adapter *adap, unsigned int port, const u8 *addr); @@ -691,6 +711,8 @@ int t4_fw_halt(struct adapter *adap, unsigned int mbox int t4_fw_restart(struct adapter *adap, unsigned int mbox, int reset); int t4_fw_upgrade(struct adapter *adap, unsigned int mbox, const u8 *fw_data, unsigned int size, int force); +int t4_fw_forceinstall(struct adapter *adap, const u8 *fw_data, + unsigned int size); int t4_fw_initialize(struct adapter *adap, unsigned int mbox); int t4_query_params(struct adapter *adap, unsigned int mbox, unsigned int pf, unsigned int vf, unsigned int nparams, const u32 *params, @@ -766,6 +788,7 @@ int t4_sge_ctxt_rd_bd(struct adapter *adap, unsigned i u32 *data); int t4_sge_ctxt_flush(struct adapter *adap, unsigned int mbox); const char *t4_link_down_rc_str(unsigned char link_down_rc); +int t4_update_port_info(struct port_info *pi); int t4_handle_fw_rpl(struct adapter *adap, const __be64 *rpl); int t4_fwaddrspace_write(struct adapter *adap, unsigned int mbox, u32 addr, u32 val); int t4_sched_config(struct adapter *adapter, int type, int minmaxen, @@ -787,6 +810,15 @@ int t4_config_watchdog(struct adapter *adapter, unsign int t4_get_devlog_level(struct adapter *adapter, unsigned int *level); int t4_set_devlog_level(struct adapter *adapter, unsigned int level); void t4_sge_decode_idma_state(struct adapter *adapter, int state); + +void t4_tp_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_pio_write(struct adapter *adap, const u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_tm_pio_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); +void t4_tp_mib_read(struct adapter *adap, u32 *buff, u32 nregs, + u32 start_index, bool sleep_ok); static inline int t4vf_query_params(struct adapter *adapter, unsigned int nparams, const u32 *params, Modified: stable/11/sys/dev/cxgbe/common/t4_hw.c ============================================================================== --- stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Mar 3 02:06:48 2018 (r330306) +++ stable/11/sys/dev/cxgbe/common/t4_hw.c Sat Mar 3 02:30:52 2018 (r330307) @@ -286,6 +286,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int __be64 cmd_rpl[MBOX_LEN/8]; u32 pcie_fw; + if (adap->flags & CHK_MBOX_ACCESS) + ASSERT_SYNCHRONIZED_OP(adap); + if ((size & 15) || size > MBOX_LEN) return -EINVAL; @@ -333,9 +336,9 @@ int t4_wr_mbox_meat_timeout(struct adapter *adap, int * presaged the firmware crashing ... */ if (ctl & F_MBMSGVALID) { - CH_ERR(adap, "found VALID command in mbox %u: " - "%llx %llx %llx %llx %llx %llx %llx %llx\n", mbox, - (unsigned long long)t4_read_reg64(adap, data_reg), + CH_ERR(adap, "found VALID command in mbox %u: %016llx %016llx " + "%016llx %016llx %016llx %016llx %016llx %016llx\n", + mbox, (unsigned long long)t4_read_reg64(adap, data_reg), (unsigned long long)t4_read_reg64(adap, data_reg + 8), (unsigned long long)t4_read_reg64(adap, data_reg + 16), (unsigned long long)t4_read_reg64(adap, data_reg + 24), @@ -469,7 +472,7 @@ static int t4_edc_err_read(struct adapter *adap, int i CH_WARN(adap, "%s: T4 NOT supported.\n", __func__); return 0; } - if (idx != 0 && idx != 1) { + if (idx != MEM_EDC0 && idx != MEM_EDC1) { CH_WARN(adap, "%s: idx %d NOT supported.\n", __func__, idx); return 0; } @@ -886,7 +889,8 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0xd010, 0xd03c, 0xdfc0, 0xdfe0, 0xe000, 0xea7c, - 0xf000, 0x11190, + 0xf000, 0x11110, + 0x11118, 0x11190, 0x19040, 0x1906c, 0x19078, 0x19080, 0x1908c, 0x190e4, @@ -1424,8 +1428,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1ff00, 0x1ff84, 0x1ffc0, 0x1ffc8, 0x30000, 0x30030, - 0x30038, 0x30038, - 0x30040, 0x30040, 0x30100, 0x30144, 0x30190, 0x301a0, 0x301a8, 0x301b8, @@ -1536,8 +1538,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x33c3c, 0x33c50, 0x33cf0, 0x33cfc, 0x34000, 0x34030, - 0x34038, 0x34038, - 0x34040, 0x34040, 0x34100, 0x34144, 0x34190, 0x341a0, 0x341a8, 0x341b8, @@ -1648,8 +1648,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x37c3c, 0x37c50, 0x37cf0, 0x37cfc, 0x38000, 0x38030, - 0x38038, 0x38038, - 0x38040, 0x38040, 0x38100, 0x38144, 0x38190, 0x381a0, 0x381a8, 0x381b8, @@ -1760,8 +1758,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x3bc3c, 0x3bc50, 0x3bcf0, 0x3bcfc, 0x3c000, 0x3c030, - 0x3c038, 0x3c038, - 0x3c040, 0x3c040, 0x3c100, 0x3c144, 0x3c190, 0x3c1a0, 0x3c1a8, 0x3c1b8, @@ -2254,13 +2250,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x1ff00, 0x1ff84, 0x1ffc0, 0x1ffc8, 0x30000, 0x30030, - 0x30038, 0x30038, - 0x30040, 0x30040, - 0x30048, 0x30048, - 0x30050, 0x30050, - 0x3005c, 0x30060, - 0x30068, 0x30068, - 0x30070, 0x30070, 0x30100, 0x30168, 0x30190, 0x301a0, 0x301a8, 0x301b8, @@ -2323,13 +2312,12 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x326a8, 0x326a8, 0x326ec, 0x326ec, 0x32a00, 0x32abc, - 0x32b00, 0x32b38, + 0x32b00, 0x32b18, + 0x32b20, 0x32b38, 0x32b40, 0x32b58, 0x32b60, 0x32b78, 0x32c00, 0x32c00, 0x32c08, 0x32c3c, - 0x32e00, 0x32e2c, - 0x32f00, 0x32f2c, 0x33000, 0x3302c, 0x33034, 0x33050, 0x33058, 0x33058, @@ -2394,13 +2382,6 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x33c38, 0x33c50, 0x33cf0, 0x33cfc, 0x34000, 0x34030, - 0x34038, 0x34038, - 0x34040, 0x34040, - 0x34048, 0x34048, - 0x34050, 0x34050, - 0x3405c, 0x34060, - 0x34068, 0x34068, - 0x34070, 0x34070, 0x34100, 0x34168, 0x34190, 0x341a0, 0x341a8, 0x341b8, @@ -2463,13 +2444,12 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t 0x366a8, 0x366a8, 0x366ec, 0x366ec, 0x36a00, 0x36abc, - 0x36b00, 0x36b38, + 0x36b00, 0x36b18, + 0x36b20, 0x36b38, 0x36b40, 0x36b58, 0x36b60, 0x36b78, 0x36c00, 0x36c00, 0x36c08, 0x36c3c, - 0x36e00, 0x36e2c, - 0x36f00, 0x36f2c, 0x37000, 0x3702c, 0x37034, 0x37050, 0x37058, 0x37058, @@ -2682,13 +2662,16 @@ void t4_get_regs(struct adapter *adap, u8 *buf, size_t } /* - * Partial EEPROM Vital Product Data structure. Includes only the ID and - * VPD-R sections. + * Partial EEPROM Vital Product Data structure. The VPD starts with one ID + * header followed by one or more VPD-R sections, each with its own header. */ struct t4_vpd_hdr { u8 id_tag; u8 id_len[2]; u8 id_data[ID_LEN]; +}; + +struct t4_vpdr_hdr { u8 vpdr_tag; u8 vpdr_len[2]; }; @@ -2700,6 +2683,7 @@ struct t4_vpd_hdr { #define EEPROM_MAX_POLL 5000 /* x 5000 == 50ms */ #define EEPROM_STAT_ADDR 0x7bfc +#define VPD_SIZE 0x800 #define VPD_BASE 0x400 #define VPD_BASE_OLD 0 #define VPD_LEN 1024 @@ -2922,32 +2906,43 @@ int t4_seeprom_wp(struct adapter *adapter, int enable) /** * get_vpd_keyword_val - Locates an information field keyword in the VPD - * @v: Pointer to buffered vpd data structure + * @vpd: Pointer to buffered vpd data structure * @kw: The keyword to search for + * @region: VPD region to search (starting from 0) * * Returns the value of the information field keyword or * -ENOENT otherwise. */ -static int get_vpd_keyword_val(const struct t4_vpd_hdr *v, const char *kw) +static int get_vpd_keyword_val(const u8 *vpd, const char *kw, int region) { - int i; - unsigned int offset , len; - const u8 *buf = (const u8 *)v; - const u8 *vpdr_len = &v->vpdr_len[0]; + int i, tag; + unsigned int offset, len; + const struct t4_vpdr_hdr *vpdr; + offset = sizeof(struct t4_vpd_hdr); - len = (u16)vpdr_len[0] + ((u16)vpdr_len[1] << 8); + vpdr = (const void *)(vpd + offset); + tag = vpdr->vpdr_tag; + len = (u16)vpdr->vpdr_len[0] + ((u16)vpdr->vpdr_len[1] << 8); + while (region--) { + offset += sizeof(struct t4_vpdr_hdr) + len; + vpdr = (const void *)(vpd + offset); + if (++tag != vpdr->vpdr_tag) + return -ENOENT; + len = (u16)vpdr->vpdr_len[0] + ((u16)vpdr->vpdr_len[1] << 8); + } + offset += sizeof(struct t4_vpdr_hdr); - if (len + sizeof(struct t4_vpd_hdr) > VPD_LEN) { + if (offset + len > VPD_LEN) { return -ENOENT; } for (i = offset; i + VPD_INFO_FLD_HDR_SIZE <= offset + len;) { - if(memcmp(buf + i , kw , 2) == 0){ + if (memcmp(vpd + i , kw , 2) == 0){ i += VPD_INFO_FLD_HDR_SIZE; return i; } - i += VPD_INFO_FLD_HDR_SIZE + buf[i+2]; + i += VPD_INFO_FLD_HDR_SIZE + vpd[i+2]; } return -ENOENT; @@ -2963,18 +2958,18 @@ static int get_vpd_keyword_val(const struct t4_vpd_hdr * Reads card parameters stored in VPD EEPROM. */ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p, - u8 *vpd) + u32 *buf) { int i, ret, addr; - int ec, sn, pn, na; + int ec, sn, pn, na, md; u8 csum; - const struct t4_vpd_hdr *v; + const u8 *vpd = (const u8 *)buf; /* * Card information normally starts at VPD_BASE but early cards had * it at 0. */ - ret = t4_seeprom_read(adapter, VPD_BASE, (u32 *)(vpd)); + ret = t4_seeprom_read(adapter, VPD_BASE, buf); if (ret) return (ret); @@ -2988,14 +2983,13 @@ static int get_vpd_params(struct adapter *adapter, str addr = *vpd == CHELSIO_VPD_UNIQUE_ID ? VPD_BASE : VPD_BASE_OLD; for (i = 0; i < VPD_LEN; i += 4) { - ret = t4_seeprom_read(adapter, addr + i, (u32 *)(vpd + i)); + ret = t4_seeprom_read(adapter, addr + i, buf++); if (ret) return ret; } - v = (const struct t4_vpd_hdr *)vpd; #define FIND_VPD_KW(var,name) do { \ - var = get_vpd_keyword_val(v , name); \ + var = get_vpd_keyword_val(vpd, name, 0); \ if (var < 0) { \ CH_ERR(adapter, "missing VPD keyword " name "\n"); \ return -EINVAL; \ @@ -3018,7 +3012,7 @@ static int get_vpd_params(struct adapter *adapter, str FIND_VPD_KW(na, "NA"); #undef FIND_VPD_KW - memcpy(p->id, v->id_data, ID_LEN); + memcpy(p->id, vpd + offsetof(struct t4_vpd_hdr, id_data), ID_LEN); strstrip(p->id); memcpy(p->ec, vpd + ec, EC_LEN); strstrip(p->ec); @@ -3032,6 +3026,14 @@ static int get_vpd_params(struct adapter *adapter, str memcpy(p->na, vpd + na, min(i, MACADDR_LEN)); strstrip((char *)p->na); + md = get_vpd_keyword_val(vpd, "VF", 1); + if (md < 0) { + snprintf(p->md, sizeof(p->md), "unknown"); + } else { + i = vpd[md - VPD_INFO_FLD_HDR_SIZE + 2]; + memcpy(p->md, vpd + md, min(i, MD_LEN)); + } + return 0; } @@ -3040,13 +3042,13 @@ enum { SF_ATTEMPTS = 10, /* max retries for SF operations */ /* flash command opcodes */ - SF_PROG_PAGE = 2, /* program page */ + SF_PROG_PAGE = 2, /* program 256B page */ SF_WR_DISABLE = 4, /* disable writes */ SF_RD_STATUS = 5, /* read status register */ SF_WR_ENABLE = 6, /* enable writes */ SF_RD_DATA_FAST = 0xb, /* read flash */ SF_RD_ID = 0x9f, /* read ID */ - SF_ERASE_SECTOR = 0xd8, /* erase sector */ + SF_ERASE_SECTOR = 0xd8, /* erase 64KB sector */ }; /** @@ -3683,9 +3685,6 @@ void t4_ulprx_read_la(struct adapter *adap, u32 *la_bu } } -#define ADVERT_MASK (V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED) | \ - FW_PORT_CAP_ANEG) - /** * t4_link_l1cfg - apply link configuration to MAC/PHY * @phy: the PHY to setup @@ -3704,7 +3703,7 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m { struct fw_port_cmd c; unsigned int mdi = V_FW_PORT_CAP_MDI(FW_PORT_CAP_MDI_AUTO); - unsigned int fc, fec; + unsigned int aneg, fc, fec, speed, rcap; fc = 0; if (lc->requested_fc & PAUSE_RX) @@ -3714,12 +3713,51 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m fec = 0; if (lc->requested_fec & FEC_RS) - fec |= FW_PORT_CAP_FEC_RS; - if (lc->requested_fec & FEC_BASER_RS) - fec |= FW_PORT_CAP_FEC_BASER_RS; - if (lc->requested_fec & FEC_RESERVED) - fec |= FW_PORT_CAP_FEC_RESERVED; + fec = FW_PORT_CAP_FEC_RS; + else if (lc->requested_fec & FEC_BASER_RS) + fec = FW_PORT_CAP_FEC_BASER_RS; + else if (lc->requested_fec & FEC_RESERVED) + fec = FW_PORT_CAP_FEC_RESERVED; + if (!(lc->supported & FW_PORT_CAP_ANEG) || + lc->requested_aneg == AUTONEG_DISABLE) { + aneg = 0; + switch (lc->requested_speed) { + case 100: + speed = FW_PORT_CAP_SPEED_100G; + break; + case 40: + speed = FW_PORT_CAP_SPEED_40G; + break; + case 25: + speed = FW_PORT_CAP_SPEED_25G; + break; + case 10: + speed = FW_PORT_CAP_SPEED_10G; + break; + case 1: + speed = FW_PORT_CAP_SPEED_1G; + break; + default: + return -EINVAL; + break; + } + } else { + aneg = FW_PORT_CAP_ANEG; + speed = lc->supported & + V_FW_PORT_CAP_SPEED(M_FW_PORT_CAP_SPEED); + } + + rcap = aneg | speed | fc | fec; + if ((rcap | lc->supported) != lc->supported) { +#ifdef INVARIANTS + CH_WARN(adap, "rcap 0x%08x, pcap 0x%08x\n", rcap, + lc->supported); +#endif + rcap &= lc->supported; + } + rcap |= mdi; + memset(&c, 0, sizeof(c)); c.op_to_portid = cpu_to_be32(V_FW_CMD_OP(FW_PORT_CMD) | F_FW_CMD_REQUEST | F_FW_CMD_EXEC | @@ -3727,21 +3765,9 @@ int t4_link_l1cfg(struct adapter *adap, unsigned int m c.action_to_len16 = cpu_to_be32(V_FW_PORT_CMD_ACTION(FW_PORT_ACTION_L1_CFG) | FW_LEN16(c)); + c.u.l1cfg.rcap = cpu_to_be32(rcap); - if (!(lc->supported & FW_PORT_CAP_ANEG)) { - c.u.l1cfg.rcap = cpu_to_be32((lc->supported & ADVERT_MASK) | - fc | fec); - lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; - lc->fec = lc->requested_fec; - } else if (lc->autoneg == AUTONEG_DISABLE) { - c.u.l1cfg.rcap = cpu_to_be32(lc->requested_speed | - fc | fec | mdi); - lc->fc = lc->requested_fc & ~PAUSE_AUTONEG; - lc->fec = lc->requested_fec; - } else - c.u.l1cfg.rcap = cpu_to_be32(lc->advertising | fc | fec | mdi); - - return t4_wr_mbox(adap, mbox, &c, sizeof(c), NULL); + return t4_wr_mbox_ns(adap, mbox, &c, sizeof(c), NULL); } /** @@ -3980,6 +4006,9 @@ static void sge_intr_handler(struct adapter *adapter) "SGE too many priority ingress contexts", -1, 0 }, { F_INGRESS_SIZE_ERR, "SGE illegal ingress QID", -1, 0 }, { F_EGRESS_SIZE_ERR, "SGE illegal egress QID", -1, 0 }, + { F_ERR_PCIE_ERROR0 | F_ERR_PCIE_ERROR1 | + F_ERR_PCIE_ERROR2 | F_ERR_PCIE_ERROR3, + "SGE PCIe error for a DBP thread", -1, 0 }, { 0 } }; @@ -3995,8 +4024,6 @@ static void sge_intr_handler(struct adapter *adapter) * For now, treat below interrupts as fatal so that we disable SGE and * get better debug */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-11@freebsd.org Sat Mar 3 03:12:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44A37F3A650; Sat, 3 Mar 2018 03:12:20 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF74569688; Sat, 3 Mar 2018 03:12:19 +0000 (UTC) (envelope-from np@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 EA654208FD; Sat, 3 Mar 2018 03:12:19 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w233CJxc009309; Sat, 3 Mar 2018 03:12:19 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w233CJHf009308; Sat, 3 Mar 2018 03:12:19 GMT (envelope-from np@FreeBSD.org) Message-Id: <201803030312.w233CJHf009308@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Sat, 3 Mar 2018 03:12: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: r330310 - stable/11/usr.sbin/cxgbetool X-SVN-Group: stable-11 X-SVN-Commit-Author: np X-SVN-Commit-Paths: stable/11/usr.sbin/cxgbetool X-SVN-Commit-Revision: 330310 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.25 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, 03 Mar 2018 03:12:20 -0000 Author: np Date: Sat Mar 3 03:12:19 2018 New Revision: 330310 URL: https://svnweb.freebsd.org/changeset/base/330310 Log: MFC r321105: cxgbetool(8): Add loadboot and loadboot-cfg subcommands to install or remove bootrom and boot config. Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/cxgbetool/cxgbetool.c ============================================================================== --- stable/11/usr.sbin/cxgbetool/cxgbetool.c Sat Mar 3 02:49:49 2018 (r330309) +++ stable/11/usr.sbin/cxgbetool/cxgbetool.c Sat Mar 3 03:12:19 2018 (r330310) @@ -96,6 +96,10 @@ usage(FILE *fp) "\tfilter list list all filters\n" "\tfilter mode [] ... get/set global filter mode\n" "\ti2c [] read from i2c device\n" + "\tloadboot [pf|offset ] install boot image\n" + "\tloadboot clear [pf|offset ] remove boot image\n" + "\tloadboot-cfg install boot config\n" + "\tloadboot-cfg clear remove boot config\n" "\tloadcfg install configuration file\n" "\tloadcfg clear remove configuration file\n" "\tloadfw install firmware\n" @@ -1944,6 +1948,107 @@ done: return (rc); } +static int +loadboot(int argc, const char *argv[]) +{ + int rc, fd; + long l; + char *p; + struct t4_bootrom br = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc == 1) { + br.pf_offset = 0; + br.pfidx_addr = 0; + } else if (argc == 3) { + if (!strcmp(argv[1], "pf")) + br.pf_offset = 0; + else if (!strcmp(argv[1], "offset")) + br.pf_offset = 1; + else + return (EINVAL); + + p = str_to_number(argv[2], &l, NULL); + if (*p) + return (EINVAL); + br.pfidx_addr = l; + } else { + warnx("loadboot: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOT, &br)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + br.len = st.st_size; + br.data = mmap(0, br.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (br.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOT, &br); + munmap(br.data, br.len); + close(fd); + return (rc); +} + +static int +loadbootcfg(int argc, const char *argv[]) +{ + int rc, fd; + struct t4_data bc = {0}; + const char *fname = argv[0]; + struct stat st = {0}; + + if (argc != 1) { + warnx("loadbootcfg: incorrect number of arguments."); + return (EINVAL); + } + + if (strcmp(fname, "clear") == 0) + return (doit(CHELSIO_T4_LOAD_BOOTCFG, &bc)); + + fd = open(fname, O_RDONLY); + if (fd < 0) { + warn("open(%s)", fname); + return (errno); + } + + if (fstat(fd, &st) < 0) { + warn("fstat"); + close(fd); + return (errno); + } + + bc.len = st.st_size; + bc.data = mmap(0, bc.len, PROT_READ, MAP_PRIVATE, fd, 0); + if (bc.data == MAP_FAILED) { + warn("mmap"); + close(fd); + return (errno); + } + + rc = doit(CHELSIO_T4_LOAD_BOOTCFG, &bc); + munmap(bc.data, bc.len); + close(fd); + return (rc); +} + /* * Display memory as list of 'n' 4-byte values per line. */ @@ -2818,6 +2923,10 @@ run_cmd(int argc, const char *argv[]) rc = sched_queue(argc, argv); else if (!strcmp(cmd, "loadcfg")) rc = loadcfg(argc, argv); + else if (!strcmp(cmd, "loadboot")) + rc = loadboot(argc, argv); + else if (!strcmp(cmd, "loadboot-cfg")) + rc = loadbootcfg(argc, argv); else if (!strcmp(cmd, "dumpstate")) rc = dumpstate(argc, argv); else { From owner-svn-src-stable-11@freebsd.org Sat Mar 3 06:37:55 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B2FA6F44914; Sat, 3 Mar 2018 06:37:55 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5480F70BDB; Sat, 3 Mar 2018 06:37:55 +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 49B5422AF5; Sat, 3 Mar 2018 06:37:55 +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 w236btv7009044; Sat, 3 Mar 2018 06:37:55 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w236brKR009030; Sat, 3 Mar 2018 06:37:53 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803030637.w236brKR009030@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 06:37: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: r330311 - in stable/11/stand/pc98: . boot0 boot0.5 boot2 btx/btx btx/btxldr btx/lib cdboot kgzldr libpc98 loader pc98boot X-SVN-Group: stable-11 X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: in stable/11/stand/pc98: . boot0 boot0.5 boot2 btx/btx btx/btxldr btx/lib cdboot kgzldr libpc98 loader pc98boot X-SVN-Commit-Revision: 330311 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.25 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, 03 Mar 2018 06:37:56 -0000 Author: kevans Date: Sat Mar 3 06:37:53 2018 New Revision: 330311 URL: https://svnweb.freebsd.org/changeset/base/330311 Log: stand: Make pc98 build This is a direct commit to stable/11 due to pc98 removal from head. Several improvements in head that were MFC'd left the pc98 build broken in stable/11. Massage the pc98 bits to get it to at least build. Deleted: stable/11/stand/pc98/libpc98/time.c Modified: stable/11/stand/pc98/Makefile stable/11/stand/pc98/Makefile.inc stable/11/stand/pc98/boot0.5/Makefile stable/11/stand/pc98/boot0/Makefile stable/11/stand/pc98/boot2/Makefile stable/11/stand/pc98/btx/btx/Makefile stable/11/stand/pc98/btx/btxldr/Makefile stable/11/stand/pc98/btx/lib/Makefile stable/11/stand/pc98/cdboot/Makefile stable/11/stand/pc98/kgzldr/Makefile stable/11/stand/pc98/libpc98/Makefile stable/11/stand/pc98/loader/Makefile stable/11/stand/pc98/loader/main.c stable/11/stand/pc98/pc98boot/Makefile Modified: stable/11/stand/pc98/Makefile ============================================================================== --- stable/11/stand/pc98/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,5 +1,9 @@ # $FreeBSD$ +NO_OBJ=t + +.include + SUBDIR= boot0 boot0.5 pc98boot btx boot2 cdboot kgzldr libpc98 loader .include Modified: stable/11/stand/pc98/Makefile.inc ============================================================================== --- stable/11/stand/pc98/Makefile.inc Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/Makefile.inc Sat Mar 3 06:37:53 2018 (r330311) @@ -2,28 +2,24 @@ # # $FreeBSD$ -BINDIR?= /boot - LOADER_ADDRESS?=0x200000 -CFLAGS+= -march=i386 -ffreestanding -CFLAGS.gcc+= -mpreferred-stack-boundary=2 -CFLAGS+= ${CFLAGS_NO_SIMD} -msoft-float -CFLAGS+= -Os -DPC98 LDFLAGS+= -nostdlib # BTX components -.if exists(${.OBJDIR}/../btx) -BTXDIR= ${.OBJDIR}/../btx -.else -BTXDIR= ${.CURDIR}/../btx -.endif +BTXDIR= ${BOOTOBJ}/pc98/btx BTXLDR= ${BTXDIR}/btxldr/btxldr BTXKERN= ${BTXDIR}/btx/btx + +BTXSRC= ${BOOTSRC}/pc98/btx BTXCRT= ${BTXDIR}/lib/crt0.o # compact binary with no padding between text, data, bss -LDSCRIPT= ${SRCTOP}/stand/i386/boot.ldscript -LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary -LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections +LDSCRIPT= ${BOOTSRC}/i386/boot.ldscript +#LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-T,${LDSCRIPT},-S,--oformat,binary +LDFLAGS_BIN=-e start -Ttext ${ORG} -Wl,-N,-S,--oformat,binary +#LD_FLAGS_BIN=-static -T ${LDSCRIPT} --gc-sections +LD_FLAGS_BIN=-static -N --gc-sections + +WARNS?= 0 .include "../Makefile.inc" Modified: stable/11/stand/pc98/boot0.5/Makefile ============================================================================== --- stable/11/stand/pc98/boot0.5/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot0.5/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -3,10 +3,9 @@ PROG= ${BOOT}.out INTERNALPROG= FILES= ${BOOT} -MAN= SRCS= start.s boot.s boot0.5.s disk.s selector.s support.s syscons.s \ putssjis.s -CLEANFILES= ${BOOT} ${BOOT}.bin +CLEANFILES+= ${BOOT} ${BOOT}.bin BOOT= boot0.5 @@ -14,7 +13,7 @@ BOOT= boot0.5 # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x0000 -LDFLAGS=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript +LDFLAGS+=-e start -Ttext ${BOOT_BOOT0_ORG} -Wl,-N,-T,${.CURDIR}/ldscript # The size of boot0.5 must be 7168 bytes ${BOOT}: ${BOOT}.bin Modified: stable/11/stand/pc98/boot0/Makefile ============================================================================== --- stable/11/stand/pc98/boot0/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot0/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -3,9 +3,8 @@ PROG= ${BOOT} INTERNALPROG= FILES= ${BOOT} -MAN= SRCS= ${BOOT}.s -CLEANFILES= ${BOOT} +CLEANFILES+= ${BOOT} BOOT= boot0 @@ -14,6 +13,6 @@ BOOT= boot0 BOOT_BOOT0_ORG?= 0x0000 ORG=${BOOT_BOOT0_ORG} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/boot2/Makefile ============================================================================== --- stable/11/stand/pc98/boot2/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/boot2/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -27,10 +27,11 @@ CFLAGS= -fomit-frame-pointer \ -DSIOPRT=${BOOT_COMCONSOLE_PORT} \ -DSIOFMT=${B2SIOFMT} \ -DSIOSPD=${BOOT_COMCONSOLE_SPEED} \ - -I${.CURDIR}/../../.. \ - -I${.CURDIR}/../../i386/boot2 \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib -I. \ + -I${LDRSRC} \ + -I${SYSDIR} \ + -I${BOOTSRC}/i386/boot2 \ + -I${BOOTSRC}/common \ + -I${BOOTSRC}/pc98/btx/lib \ -Wall -Waggregate-return -Wbad-function-cast -Wcast-align \ -Wmissing-declarations -Wmissing-prototypes -Wnested-externs \ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ @@ -52,14 +53,14 @@ CFLAGS.gcc+= -mno-align-long-strings CFLAGS.clang+= -Oz ${CLANG_OPT_SMALL} -LD_FLAGS=${LD_FLAGS_BIN} +LD_FLAGS+=${LD_FLAGS_BIN} # Pick up ../Makefile.inc early. .include -.PATH: ${.CURDIR}/../../i386/boot2 +.PATH: ${BOOTSRC}/i386/boot2 -CLEANFILES= boot +CLEANFILES+= boot boot: boot1 boot2 cat boot1 boot2 > boot @@ -98,7 +99,7 @@ boot2.o: boot2.s SRCS= boot2.c boot2.h -boot2.s: boot2.c boot2.h ${.CURDIR}/../../common/ufsread.c +boot2.s: boot2.c boot2.h ${CC} ${CFLAGS} -S -o boot2.s.tmp ${.CURDIR}/boot2.c sed -e '/align/d' -e '/nop/d' < boot2.s.tmp > boot2.s rm -f boot2.s.tmp Modified: stable/11/stand/pc98/btx/btx/Makefile ============================================================================== --- stable/11/stand/pc98/btx/btx/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/btx/btx/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,8 +1,9 @@ # $FreeBSD$ +.include + PROG= btx INTERNALPROG= -MAN= SRCS= btx.S .if defined(BOOT_BTX_NOHANG) @@ -12,7 +13,7 @@ BOOT_BTX_FLAGS=0x0 .endif CFLAGS+=-DBTX_FLAGS=${BOOT_BTX_FLAGS} -CFLAGS+=-I${.CURDIR}/../../../i386/common +CFLAGS+=-I${BOOTSRC}/i386/common .if defined(BTX_SERIAL) BOOT_COMCONSOLE_PORT?= 0x238 @@ -25,7 +26,7 @@ CFLAGS+=-DBTX_SERIAL -DSIOPRT=${BOOT_COMCONSOLE_PORT} ORG= 0x9000 -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/btx/btxldr/Makefile ============================================================================== --- stable/11/stand/pc98/btx/btxldr/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/btx/btxldr/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,19 +1,20 @@ # $FreeBSD$ +.include + PROG= btxldr INTERNALPROG= -MAN= SRCS= btxldr.S CFLAGS+=-DLOADER_ADDRESS=${LOADER_ADDRESS} -CFLAGS+=-I${.CURDIR}/../../../i386/common +CFLAGS+=-I${BOOTSRC}/i386/common .if defined(BTXLDR_VERBOSE) CFLAGS+=-DBTXLDR_VERBOSE .endif ORG=${LOADER_ADDRESS} -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/btx/lib/Makefile ============================================================================== --- stable/11/stand/pc98/btx/lib/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/btx/lib/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,10 +1,11 @@ # $FreeBSD$ +.include + PROG= crt0.o INTERNALPROG= -MAN= SRCS= btxcsu.S btxsys.s btxv86.s -CFLAGS+=-I${.CURDIR}/../../../i386/common -LDFLAGS=-Wl,-r +CFLAGS+=-I${BOOTSRC}/i386/common +LDFLAGS+=-Wl,-r .include Modified: stable/11/stand/pc98/cdboot/Makefile ============================================================================== --- stable/11/stand/pc98/cdboot/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/cdboot/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,16 +1,18 @@ # $FreeBSD$ +.include + PROG= cdboot STRIP= BINMODE=${NOBINMODE} MAN= SRCS= ${PROG}.S -CFLAGS+=-I${.CURDIR}/../../i386/common +CFLAGS+=-I${BOOTSRC}/i386/common ORG= 0x0000 -LDFLAGS=${LDFLAGS_BIN} +LDFLAGS+=${LDFLAGS_BIN} .include Modified: stable/11/stand/pc98/kgzldr/Makefile ============================================================================== --- stable/11/stand/pc98/kgzldr/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/kgzldr/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,18 +1,19 @@ # $FreeBSD$ +.include + PROG= kgzldr.o STRIP= BINMODE=${LIBMODE} BINDIR= ${LIBDIR} -MAN= SRCS= start.s boot.c inflate.c lib.c crt.s sio.s CFLAGS= -Os CFLAGS+=-DKZIP NO_SHARED= -LDFLAGS=-Wl,-r -.PATH: ${.CURDIR}/../../../kern -.PATH: ${.CURDIR}/../../i386/kgzldr +LDFLAGS+=-Wl,-r +.PATH: ${SYSDIR}/kern +.PATH: ${BOOTSRC}/i386/kgzldr BOOT_COMCONSOLE_PORT?= 0x238 AFLAGS+=--defsym SIO_PRT=${BOOT_COMCONSOLE_PORT} Modified: stable/11/stand/pc98/libpc98/Makefile ============================================================================== --- stable/11/stand/pc98/libpc98/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/libpc98/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,25 +1,20 @@ # $FreeBSD$ # + +.include + LIB= pc98 -INTERNALLIB= -.PATH: ${.CURDIR}/../../i386/libi386 +.PATH: ${BOOTSRC}/i386/libi386 SRCS= bioscd.c biosdisk.c biosmem.c biospnp.c \ biospci.c biossmap.c bootinfo.c bootinfo32.c \ comconsole.c devicename.c elf32_freebsd.c \ i386_copy.c i386_module.c nullconsole.c pc98_sys.c pxe.c pxetramp.s \ time.c vidconsole.c -.PATH: ${.CURDIR}/../../zfs +.PATH: ${BOOTSRC}/zfs SRCS+= devicename_stubs.c -# Enable PXE TFTP or NFS support, not both. -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -.else -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif - BOOT_COMCONSOLE_PORT?= 0x238 CFLAGS+= -DCOMPORT=${BOOT_COMCONSOLE_PORT} @@ -37,13 +32,11 @@ CFLAGS+= -DTERM_EMU # XXX: make alloca() useable CFLAGS+= -Dalloca=__builtin_alloca -CFLAGS+= -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 \ - -I${.CURDIR}/../../common \ - -I${.CURDIR}/../btx/lib \ - -I${.CURDIR}/../../i386/libi386 \ - -I${.CURDIR}/../../.. -I. -# the location of libstand -CFLAGS+= -I${.CURDIR}/../../../../lib/libstand/ +CFLAGS+= -I${BOOTSRC}/ficl -I${BOOTSRC}/ficl/i386 \ + -I${LDRSRC} -I${BOOTSRC}/common \ + -I${BOOTSRC}/pc98/btx/lib \ + -I${BOOTSRC}/i386/libi386 \ + -I${SYSDIR} # Handle FreeBSD specific %b and %D printf format specifiers CFLAGS+= ${FORMAT_EXTENSIONS} Modified: stable/11/stand/pc98/loader/Makefile ============================================================================== --- stable/11/stand/pc98/loader/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/loader/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,26 +1,18 @@ # $FreeBSD$ -.include -MK_SSP= no -MAN= - LOADER?= loader PROG= ${LOADER}.sym -INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 -VERSION_FILE= ${.CURDIR}/../../i386/loader/version +VERSION_FILE= ${BOOTSRC}/i386/loader/version +LOADER_NET_SUPPORT= yes + +.include + # architecture-specific loader code SRCS= main.c conf.c vers.c -.PATH: ${.CURDIR}/../../i386/loader +.PATH: ${BOOTSRC}/i386/loader -# Enable PXE TFTP or NFS support, not both. -.if defined(LOADER_TFTP_SUPPORT) -CFLAGS+= -DLOADER_TFTP_SUPPORT -.else -CFLAGS+= -DLOADER_NFS_SUPPORT -.endif - # Include bcache code. HAVE_BCACHE= yes @@ -28,38 +20,19 @@ HAVE_BCACHE= yes HAVE_PNP= yes HAVE_ISABUS= yes -.if ${MK_FORTH} != "no" -# Enable BootForth -BOOT_FORTH= yes -CFLAGS+= -DBOOT_FORTH -I${.CURDIR}/../../ficl -I${.CURDIR}/../../ficl/i386 -LIBFICL= ${.OBJDIR}/../../ficl/libficl.a -.endif - -.if defined(LOADER_BZIP2_SUPPORT) -CFLAGS+= -DLOADER_BZIP2_SUPPORT -.endif -.if !defined(LOADER_NO_GZIP_SUPPORT) -CFLAGS+= -DLOADER_GZIP_SUPPORT -.endif - # Always add MI sources -.PATH: ${.CURDIR}/../../common -.include "${.CURDIR}/../../common/Makefile.inc" -CFLAGS+= -I${.CURDIR}/../../common -CFLAGS+= -I${.CURDIR}/../../i386 -CFLAGS+= -I. +.include "${BOOTSRC}/loader.mk" -CLEANFILES= ${LOADER} ${LOADER}.bin loader.help +CLEANFILES+= ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall -LDFLAGS= -static -Ttext 0x0 +LDFLAGS+= -static -Ttext 0x0 +CFLAGS+= -I${BOOTSRC} -I${BOOTSRC}/i386 # pc98 standalone support library -LIBPC98= ${.OBJDIR}/../libpc98/libpc98.a -CFLAGS+= -I${.CURDIR}/.. +LIBPC98= ${BOOTOBJ}/pc98/libpc98/libpc98.a +CFLAGS+= -I${BOOTSRC}/pc98 -LIBSTAND= ${.OBJDIR}/../../libstand32/libstand.a - # BTX components CFLAGS+= -I${.CURDIR}/../btx/lib @@ -67,9 +40,6 @@ CFLAGS+= -I${.CURDIR}/../btx/lib #CFLAGS+= -g #LDFLAGS+= -g -# Pick up ../Makefile.inc early. -.include - ${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ -b ${BTXKERN} ${LOADER}.bin @@ -79,21 +49,16 @@ ${LOADER}.bin: ${LOADER}.sym strip -R .comment -R .note ${.TARGET} loader.help: help.common help.pc98 - cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} + cat ${.ALLSRC} | awk -f ${BOOTSRC}/common/merge_help.awk > ${.TARGET} FILES= ${LOADER} # XXX INSTALLFLAGS_loader= -b FILESMODE_${LOADER}= ${BINMODE} -b -.PATH: ${.CURDIR}/../../forth -.include "${.CURDIR}/../../forth/Makefile.inc" - -FILES+= ${.CURDIR}/../../i386/loader/loader.rc menu.rc - # XXX crt0.o needs to be first for pxeboot(8) to work OBJS= ${BTXCRT} -DPADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} -LDADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} +DPADD= ${LDR_INTERP} ${LIBPC98} ${LIBSA} +LDADD= ${LDR_INTERP} ${LIBPC98} ${LIBSA} .include Modified: stable/11/stand/pc98/loader/main.c ============================================================================== --- stable/11/stand/pc98/loader/main.c Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/loader/main.c Sat Mar 3 06:37:53 2018 (r330311) @@ -191,7 +191,7 @@ main(void) extract_currdev(); /* set $currdev and $loaddev */ setenv("LINES", "24", 1); /* optional */ - interact(NULL); /* doesn't return */ + interact(); /* doesn't return */ /* if we ever get here, it is an error */ return (1); Modified: stable/11/stand/pc98/pc98boot/Makefile ============================================================================== --- stable/11/stand/pc98/pc98boot/Makefile Sat Mar 3 03:12:19 2018 (r330310) +++ stable/11/stand/pc98/pc98boot/Makefile Sat Mar 3 06:37:53 2018 (r330311) @@ -1,19 +1,21 @@ # $FreeBSD$ +.include + FILES= ${BOOT} -CLEANFILES= ${BOOT} ${BOOT}.part +CLEANFILES+= ${BOOT} ${BOOT}.part BOOT= pc98boot -.if exists(${.OBJDIR}/../boot0) -BOOT0= ${.OBJDIR}/../boot0/boot0 +.if exists(${BOOTOBJ}/pc98/boot0) +BOOT0= ${BOOTOBJ}/pc98/boot0/boot0 .else -BOOT0= ${.CURDIR}/../boot0/boot0 +BOOT0= ${BOOTSRC}/pc98/boot0/boot0 .endif -.if exists(${.OBJDIR}/../boot0.5) -BOOT05= ${.OBJDIR}/../boot0.5/boot0.5 +.if exists(${BOOTOBJ}/pc98/boot0.5) +BOOT05= ${BOOTOBJ}/pc98/boot0.5/boot0.5 .else -BOOT05= ${.CURDIR}/../boot0.5/boot0.5 +BOOT05= ${BOOTSRC}/pc98/boot0.5/boot0.5 .endif ${BOOT}: ${BOOT0} ${BOOT05} ${BOOT}.part From owner-svn-src-stable-11@freebsd.org Sat Mar 3 08:45:57 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7A6ADF26DD5; Sat, 3 Mar 2018 08:45:57 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2E6AD752AF; Sat, 3 Mar 2018 08:45:57 +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 2507B2402C; Sat, 3 Mar 2018 08:45:57 +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 w238juin074466; Sat, 3 Mar 2018 08:45:56 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w238juXd074464; Sat, 3 Mar 2018 08:45:56 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <201803030845.w238juXd074464@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Sat, 3 Mar 2018 08:45: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: r330312 - stable/11/release/doc/share/xml X-SVN-Group: stable-11 X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: stable/11/release/doc/share/xml X-SVN-Commit-Revision: 330312 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.25 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, 03 Mar 2018 08:45:57 -0000 Author: delphij Date: Sat Mar 3 08:45:56 2018 New Revision: 330312 URL: https://svnweb.freebsd.org/changeset/base/330312 Log: Document SA-17:12 and correct EN-17:09 link [1] Reported by: eadler [1] Modified: stable/11/release/doc/share/xml/errata.xml stable/11/release/doc/share/xml/security.xml Modified: stable/11/release/doc/share/xml/errata.xml ============================================================================== --- stable/11/release/doc/share/xml/errata.xml Sat Mar 3 06:37:53 2018 (r330311) +++ stable/11/release/doc/share/xml/errata.xml Sat Mar 3 08:45:56 2018 (r330312) @@ -36,7 +36,7 @@ FreeBSD-EN-17:10.tzdata + xlink:href="&security.url;/FreeBSD-EN-17:09.tzdata.asc">FreeBSD-EN-17:09.tzdata 2 November 2017 Timezone database information update Modified: stable/11/release/doc/share/xml/security.xml ============================================================================== --- stable/11/release/doc/share/xml/security.xml Sat Mar 3 06:37:53 2018 (r330311) +++ stable/11/release/doc/share/xml/security.xml Sat Mar 3 08:45:56 2018 (r330312) @@ -53,6 +53,13 @@ 29 November 2017 Multiple vulnerabilities + + + FreeBSD-SA-17:12.openssl + 09 December 2017 + Multiple vulnerabilities + From owner-svn-src-stable-11@freebsd.org Sat Mar 3 09:59:05 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7AC18F2C3CD; Sat, 3 Mar 2018 09:59:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2AB4778338; Sat, 3 Mar 2018 09:59:05 +0000 (UTC) (envelope-from eadler@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 1F2B824BE7; Sat, 3 Mar 2018 09:59:05 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w239x4kC010914; Sat, 3 Mar 2018 09:59:04 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w239x4Zm010913; Sat, 3 Mar 2018 09:59:04 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803030959.w239x4Zm010913@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 09:59:04 +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: r330314 - stable/11/usr.bin/units X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/units X-SVN-Commit-Revision: 330314 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.25 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, 03 Mar 2018 09:59:05 -0000 Author: eadler Date: Sat Mar 3 09:59:04 2018 New Revision: 330314 URL: https://svnweb.freebsd.org/changeset/base/330314 Log: MFC r322424: Correct the -H longopt equivillant PR: 209876 Modified: stable/11/usr.bin/units/units.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/units/units.1 ============================================================================== --- stable/11/usr.bin/units/units.1 Sat Mar 3 08:52:02 2018 (r330313) +++ stable/11/usr.bin/units/units.1 Sat Mar 3 09:59:04 2018 (r330314) @@ -1,5 +1,5 @@ .\" $FreeBSD$ -.Dd July 4, 2014 +.Dd August 12, 2017 .Dt UNITS 1 .Os .Sh NAME @@ -18,7 +18,7 @@ The following options are available: Show an overview of options .It Fl f Ar filename \&No , Fl -file Ar filename Specify the name of the units data file to load. -.It Fl H Ar filename \&No , Fl -historyfile Ar filename +.It Fl H Ar filename \&No , Fl -history Ar filename Ignored, for compatibility with GNU units. .It Fl e , Fl -exponential Behave as if -o '%6e' was typed. From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:01:14 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 21BFAF2C70C; Sat, 3 Mar 2018 10:01:14 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id C519D7854A; Sat, 3 Mar 2018 10:01:13 +0000 (UTC) (envelope-from eadler@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 C009E24D10; Sat, 3 Mar 2018 10:01:13 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23A1DDm011794; Sat, 3 Mar 2018 10:01:13 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23A1CkO011786; Sat, 3 Mar 2018 10:01:12 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031001.w23A1CkO011786@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:01: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: r330315 - in stable/11/usr.bin: calendar calendar/calendars/pt_BR.UTF-8 fortune/datfiles mkcsmapper unifdef units X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/usr.bin: calendar calendar/calendars/pt_BR.UTF-8 fortune/datfiles mkcsmapper unifdef units X-SVN-Commit-Revision: 330315 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.25 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, 03 Mar 2018 10:01:14 -0000 Author: eadler Date: Sat Mar 3 10:01:12 2018 New Revision: 330315 URL: https://svnweb.freebsd.org/changeset/base/330315 Log: MFC r325095: Update URLs in usr.bin - http -> https - contents have moved locations - removal of URL if I could not find new location Modified: stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative stable/11/usr.bin/calendar/sunpos.c stable/11/usr.bin/fortune/datfiles/fortunes stable/11/usr.bin/mkcsmapper/mkcsmapper.1 stable/11/usr.bin/unifdef/unifdef.1 stable/11/usr.bin/unifdef/unifdef.c stable/11/usr.bin/units/definitions.units Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative ============================================================================== --- stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/calendar/calendars/pt_BR.UTF-8/calendar.commemorative Sat Mar 3 10:01:12 2018 (r330315) @@ -4,8 +4,6 @@ * Originally submitted by Renato Tambellini * * Brazilian commemorative days - * - * http://www.ibge.gov.br/ibgeteen/datas/home.html */ #ifndef _pt_BR_UTF_8_commemorative_ Modified: stable/11/usr.bin/calendar/sunpos.c ============================================================================== --- stable/11/usr.bin/calendar/sunpos.c Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/calendar/sunpos.c Sat Mar 3 10:01:12 2018 (r330315) @@ -31,7 +31,7 @@ __FBSDID("$FreeBSD$"); /* * This code is created to match the formulas available at: * Formula and examples obtained from "How to Calculate alt/az: SAAO" at - * http://www.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/ + * http://old.saao.ac.za/public-info/sun-moon-stars/sun-index/how-to-calculate-altaz/ */ #include Modified: stable/11/usr.bin/fortune/datfiles/fortunes ============================================================================== --- stable/11/usr.bin/fortune/datfiles/fortunes Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/fortune/datfiles/fortunes Sat Mar 3 10:01:12 2018 (r330315) @@ -46260,7 +46260,7 @@ error: The operation completed successfully. For more information, see Help and Support Center at -http://go.microsoft.com/fwlink/events.asp. +https://go.microsoft.com/fwlink/events.asp. % The minute a man is convinced that he is interesting, he isn't. % Modified: stable/11/usr.bin/mkcsmapper/mkcsmapper.1 ============================================================================== --- stable/11/usr.bin/mkcsmapper/mkcsmapper.1 Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/mkcsmapper/mkcsmapper.1 Sat Mar 3 10:01:12 2018 (r330315) @@ -29,8 +29,8 @@ .\" Electrical and Electronics Engineers, Inc and The Open Group. In the .\" event of any discrepancy between this version and the original IEEE and .\" The Open Group Standard, the original IEEE and The Open Group Standard is -.\" the referee document. The original Standard can be obtained online at -.\" http://www.opengroup.org/unix/online.html. +.\" the referee document. The original Standard can be obtained at +.\" http://www.opengroup.org/standards/unix. .\" .\" $FreeBSD$ .\" Modified: stable/11/usr.bin/unifdef/unifdef.1 ============================================================================== --- stable/11/usr.bin/unifdef/unifdef.1 Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/unifdef/unifdef.1 Sat Mar 3 10:01:12 2018 (r330315) @@ -477,7 +477,7 @@ Unterminated char or string literal .Xr diff 1 .Pp The unifdef home page is -.Pa http://dotat.at/prog/unifdef +.Pa https://dotat.at/prog/unifdef .Sh HISTORY The .Nm Modified: stable/11/usr.bin/unifdef/unifdef.c ============================================================================== --- stable/11/usr.bin/unifdef/unifdef.c Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/unifdef/unifdef.c Sat Mar 3 10:01:12 2018 (r330315) @@ -49,7 +49,7 @@ static const char copyright[] = "@(#) $Version: unifdef-2.11 $\n" "@(#) $FreeBSD$\n" "@(#) $Author: Tony Finch (dot@dotat.at) $\n" - "@(#) $URL: http://dotat.at/prog/unifdef $\n" + "@(#) $URL: https://dotat.at/prog/unifdef $\n" ; /* types of input lines: */ Modified: stable/11/usr.bin/units/definitions.units ============================================================================== --- stable/11/usr.bin/units/definitions.units Sat Mar 3 09:59:04 2018 (r330314) +++ stable/11/usr.bin/units/definitions.units Sat Mar 3 10:01:12 2018 (r330315) @@ -332,7 +332,7 @@ lumen cd sr lux cd sr/m2 # EMU currencies have constant exchange rate against Euro since 1.1.1999. -# See http://en.wikipedia.org/wiki/Euro for details. +# See https://en.wikipedia.org/wiki/Euro for details. austriaschilling 1|13.7603 euro belgiumfranc 1|40.3399 euro finlandmarkka 1|5.94573 euro @@ -351,7 +351,7 @@ malteselira 1|0.429300 euro slovakkoruna 1|30.1260 euro # These ones are pegged to the Euro -# See http://en.wikipedia.org/wiki/Euro for details. +# See https://en.wikipedia.org/wiki/Euro for details. bosniaherzegovinamark 1|1.95583 euro bulgarianlev 1|1.95583 euro capeverdeanescudo 1|110.265 euro @@ -528,7 +528,7 @@ ZMW zambiakwacha ZWL zimbabwedollar # These ones are pegged on the US Dollar -# See http://en.wikipedia.org/wiki/USD for details. +# See https://en.wikipedia.org/wiki/USD for details. dollar usdollar arubanflorin 1|1.75 usdollar bahamiandollar 1|1 usdollar From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:15:37 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E095DF2D769; Sat, 3 Mar 2018 10:15:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 907B978E32; Sat, 3 Mar 2018 10:15:37 +0000 (UTC) (envelope-from eadler@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 8A6DC24F0E; Sat, 3 Mar 2018 10:15:37 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AFb57020684; Sat, 3 Mar 2018 10:15:37 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AFb0N020683; Sat, 3 Mar 2018 10:15:37 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031015.w23AFb0N020683@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:15:37 +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: r330316 - stable/11/etc X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/etc X-SVN-Commit-Revision: 330316 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.25 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, 03 Mar 2018 10:15:38 -0000 Author: eadler Date: Sat Mar 3 10:15:37 2018 New Revision: 330316 URL: https://svnweb.freebsd.org/changeset/base/330316 Log: MFC r313276: Use kldload -n when loading if_deqna This fixes if_deqna from being loaded by accident twice if it's already loaded in the kernel. Modified: stable/11/etc/devd.conf Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/devd.conf ============================================================================== --- stable/11/etc/devd.conf Sat Mar 3 10:01:12 2018 (r330315) +++ stable/11/etc/devd.conf Sat Mar 3 10:15:37 2018 (r330316) @@ -272,7 +272,7 @@ nomatch 10 { match "bus" "pccard[0-9]+"; match "manufacturer" "0x1234"; match "product" "0x2323"; - action "kldload if_deqna"; + action "kldload -n if_deqna"; }; attach 10 { device-name "deqna[0-9]+"; From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:18:32 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CD3A7F2DA86; Sat, 3 Mar 2018 10:18:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7B7D178FFB; Sat, 3 Mar 2018 10:18:32 +0000 (UTC) (envelope-from eadler@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 7621724F10; Sat, 3 Mar 2018 10:18:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AIWb7020829; Sat, 3 Mar 2018 10:18:32 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AIWMV020827; Sat, 3 Mar 2018 10:18:32 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031018.w23AIWMV020827@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:18: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: r330317 - stable/11/usr.bin/dc X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/dc X-SVN-Commit-Revision: 330317 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.25 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, 03 Mar 2018 10:18:33 -0000 Author: eadler Date: Sat Mar 3 10:18:32 2018 New Revision: 330317 URL: https://svnweb.freebsd.org/changeset/base/330317 Log: MFC r314409: dc(1): Introduce e command, equivalent to p, but writes to stderr Obtained from: OpenBSD MFC after: 2 weeks Modified: stable/11/usr.bin/dc/bcode.c stable/11/usr.bin/dc/dc.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/dc/bcode.c ============================================================================== --- stable/11/usr.bin/dc/bcode.c Sat Mar 3 10:15:37 2018 (r330316) +++ stable/11/usr.bin/dc/bcode.c Sat Mar 3 10:18:32 2018 (r330317) @@ -69,6 +69,7 @@ static __inline struct number *pop_number(void); static __inline char *pop_string(void); static __inline void clear_stack(void); static __inline void print_tos(void); +static void print_err(void); static void pop_print(void); static void pop_printn(void); static __inline void print_stack(void); @@ -198,6 +199,7 @@ static const struct jump_entry jump_table_data[] = { { 'a', to_ascii }, { 'c', clear_stack }, { 'd', dup }, + { 'e', print_err }, { 'f', print_stack }, { 'i', set_ibase }, { 'k', set_scale }, @@ -502,6 +504,18 @@ print_tos(void) if (value != NULL) { print_value(stdout, value, "", bmachine.obase); putchar('\n'); + } + else + warnx("stack empty"); +} + +static void +print_err(void) +{ + struct value *value = tos(); + if (value != NULL) { + print_value(stderr, value, "", bmachine.obase); + (void)putc('\n', stderr); } else warnx("stack empty"); Modified: stable/11/usr.bin/dc/dc.1 ============================================================================== --- stable/11/usr.bin/dc/dc.1 Sat Mar 3 10:15:37 2018 (r330316) +++ stable/11/usr.bin/dc/dc.1 Sat Mar 3 10:18:32 2018 (r330317) @@ -35,7 +35,7 @@ .\" .\" @(#)dc.1 8.1 (Berkeley) 6/6/93 .\" -.Dd April 16, 2014 +.Dd February 27, 2017 .Dt DC 1 .Os .Sh NAME @@ -196,6 +196,10 @@ operator is a non-portable extension. All values on the stack are popped. .It Ic d The top value on the stack is duplicated. +.It Ic e +Equivalent to +.Ic p , +except that the output is written to the standard error stream. .It Ic f All values on the stack are printed, separated by newlines. .It Ic G From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:27:34 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 96F57F2E56A; Sat, 3 Mar 2018 10:27:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4879D796F3; Sat, 3 Mar 2018 10:27:34 +0000 (UTC) (envelope-from eadler@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 268C6250A0; Sat, 3 Mar 2018 10:27:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23ARXIC026014; Sat, 3 Mar 2018 10:27:33 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ARXMw026012; Sat, 3 Mar 2018 10:27:33 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031027.w23ARXMw026012@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:27:33 +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: r330318 - in stable/11/usr.sbin/bsdconfig: console share X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: in stable/11/usr.sbin/bsdconfig: console share X-SVN-Commit-Revision: 330318 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.25 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, 03 Mar 2018 10:27:34 -0000 Author: eadler Date: Sat Mar 3 10:27:33 2018 New Revision: 330318 URL: https://svnweb.freebsd.org/changeset/base/330318 Log: MFC r318891: Fix long standing issue in bsdconfig's keymap selection Since the translation to vt as terminal emulator, the keymaps files path has changed and this change does not get followed in bsdconfig. This implicates boot time warnings about a wrong keymap file, what is very confusing for the new users and for me too, so initialize the default keymaps search path depending on terminal type. Modified: stable/11/usr.sbin/bsdconfig/console/keymap stable/11/usr.sbin/bsdconfig/share/keymap.subr Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.sbin/bsdconfig/console/keymap ============================================================================== --- stable/11/usr.sbin/bsdconfig/console/keymap Sat Mar 3 10:18:32 2018 (r330317) +++ stable/11/usr.sbin/bsdconfig/console/keymap Sat Mar 3 10:27:33 2018 (r330318) @@ -172,6 +172,7 @@ dialog_menu_main() uk.iso) defaultitem="$msg_uk_iso" ;; ua.koi8-u) defaultitem="$msg_ukrainian_koi8_u" ;; ua.koi8-u.shift.alt) defaultitem="$msg_ukrainian_koi8_u_koi8_r" ;; + us.ctrl) defaultitem="$msg_usa_capslock_ctrl" ;; us.pc-ctrl) defaultitem="$msg_usa_capslock_ctrl" ;; us.dvorak) defaultitem="$msg_usa_dvorak" ;; us.dvorakl) defaultitem="$msg_usa_dvorak_left" ;; @@ -307,7 +308,12 @@ while :; do uk_iso) keymap_to_set="uk.iso" ;; ukrainian_koi8_u) keymap_to_set="ua.koi8-u" ;; ukrainian_koi8_u_koi8_r) keymap_to_set="ua.koi8-u.shift.alt" ;; - usa_capslock_ctrl) keymap_to_set="us.pc-ctrl" ;; + usa_capslock_ctrl) + case "$( sysctl -n kern.vty )" in + vt) keymap_to_set="us.ctrl" ;; + *) keymap_to_set="us.pc-ctrl" ;; + esac + ;; usa_dvorak) keymap_to_set="us.dvorak" ;; usa_dvorak_left) keymap_to_set="us.dvorakl" ;; usa_dvorak_right) keymap_to_set="us.dvorakr" ;; Modified: stable/11/usr.sbin/bsdconfig/share/keymap.subr ============================================================================== --- stable/11/usr.sbin/bsdconfig/share/keymap.subr Sat Mar 3 10:18:32 2018 (r330317) +++ stable/11/usr.sbin/bsdconfig/share/keymap.subr Sat Mar 3 10:27:33 2018 (r330318) @@ -39,7 +39,10 @@ f_include $BSDCFG_SHARE/struct.subr # Defaults taken from usr.sbin/kbdmap/kbdmap.h # : ${DEFAULT_LANG:=en} -: ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} +case "$( sysctl -n kern.vty )" in +vt) : ${DEFAULT_KEYMAP_DIR:=/usr/share/vt/keymaps} ;; +*) : ${DEFAULT_KEYMAP_DIR:=/usr/share/syscons/keymaps} ;; +esac ############################################################ GLOBALS From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:29:29 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AEE95F2E74F; Sat, 3 Mar 2018 10:29:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 63FF67986D; Sat, 3 Mar 2018 10:29:29 +0000 (UTC) (envelope-from eadler@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 5EEC6250A2; Sat, 3 Mar 2018 10:29:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23ATTqG026131; Sat, 3 Mar 2018 10:29:29 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23ATTVo026130; Sat, 3 Mar 2018 10:29:29 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031029.w23ATTVo026130@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:29:29 +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: r330319 - stable/11/bin/pkill X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/pkill X-SVN-Commit-Revision: 330319 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.25 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, 03 Mar 2018 10:29:29 -0000 Author: eadler Date: Sat Mar 3 10:29:29 2018 New Revision: 330319 URL: https://svnweb.freebsd.org/changeset/base/330319 Log: MFC r319602: Clarify -q is only for pgrep. Modified: stable/11/bin/pkill/pkill.1 Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pkill/pkill.1 ============================================================================== --- stable/11/bin/pkill/pkill.1 Sat Mar 3 10:27:33 2018 (r330318) +++ stable/11/bin/pkill/pkill.1 Sat Mar 3 10:29:29 2018 (r330319) @@ -29,7 +29,7 @@ .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE .\" POSSIBILITY OF SUCH DAMAGE. .\" -.Dd August 21, 2015 +.Dd June 5, 2017 .Dt PKILL 1 .Os .Sh NAME @@ -176,6 +176,8 @@ Select only the newest (most recently started) of the .It Fl o Select only the oldest (least recently started) of the matching processes. .It Fl q +For +.Nm pgrep , Do not write anything to standard output. .It Fl s Ar sid Restrict matches to processes with a session ID in the comma-separated From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:30:55 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 61EC4F2E931; Sat, 3 Mar 2018 10:30:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 12DBD79A1D; Sat, 3 Mar 2018 10:30:55 +0000 (UTC) (envelope-from eadler@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 0DDC6250BF; Sat, 3 Mar 2018 10:30:55 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AUs1S026257; Sat, 3 Mar 2018 10:30:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AUsqm026256; Sat, 3 Mar 2018 10:30:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031030.w23AUsqm026256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:30: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: r330320 - stable/11/sys/compat/linux X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/compat/linux X-SVN-Commit-Revision: 330320 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.25 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, 03 Mar 2018 10:30:55 -0000 Author: eadler Date: Sat Mar 3 10:30:54 2018 New Revision: 330320 URL: https://svnweb.freebsd.org/changeset/base/330320 Log: MFC 319851: Remove the outdated definition. Modified: stable/11/sys/compat/linux/linux_file.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/compat/linux/linux_file.c ============================================================================== --- stable/11/sys/compat/linux/linux_file.c Sat Mar 3 10:29:29 2018 (r330319) +++ stable/11/sys/compat/linux/linux_file.c Sat Mar 3 10:30:54 2018 (r330320) @@ -307,8 +307,6 @@ struct l_dirent64 { roundup(offsetof(struct l_dirent64, d_name) + (namlen) + 1, \ sizeof(uint64_t)) -#define LINUX_DIRBLKSIZ 512 - /* * Linux l_dirent is bigger than FreeBSD dirent, thus the buffer size * passed to kern_getdirentries() must be smaller than the one passed From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:32:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4DB7F2EA73; Sat, 3 Mar 2018 10:32:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 611A379D23; Sat, 3 Mar 2018 10:32:00 +0000 (UTC) (envelope-from eadler@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 5BFDC25220; Sat, 3 Mar 2018 10:32:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AW0oO029991; Sat, 3 Mar 2018 10:32:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AW0Kk029990; Sat, 3 Mar 2018 10:32:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031032.w23AW0Kk029990@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:32: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: r330321 - stable/11/etc/rc.d X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/etc/rc.d X-SVN-Commit-Revision: 330321 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.25 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, 03 Mar 2018 10:32:00 -0000 Author: eadler Date: Sat Mar 3 10:32:00 2018 New Revision: 330321 URL: https://svnweb.freebsd.org/changeset/base/330321 Log: MFC r319843: Fix 'restart' action: rc.subr only expects to restart one service, not two. PR: 217393 Modified: stable/11/etc/rc.d/sendmail Directory Properties: stable/11/ (props changed) Modified: stable/11/etc/rc.d/sendmail ============================================================================== --- stable/11/etc/rc.d/sendmail Sat Mar 3 10:30:54 2018 (r330320) +++ stable/11/etc/rc.d/sendmail Sat Mar 3 10:32:00 2018 (r330321) @@ -206,12 +206,14 @@ required_files= if checkyesno sendmail_submit_enable; then name="sendmail_submit" rcvar="sendmail_submit_enable" + _rc_restart_done=false run_rc_command "$1" fi if checkyesno sendmail_outbound_enable; then name="sendmail_outbound" rcvar="sendmail_outbound_enable" + _rc_restart_done=false run_rc_command "$1" fi @@ -219,4 +221,5 @@ name="sendmail_msp_queue" rcvar="sendmail_msp_queue_enable" pidfile="${sendmail_msp_queue_pidfile:-/var/spool/clientmqueue/sm-client.pid}" required_files="/etc/mail/submit.cf" +_rc_restart_done=false run_rc_command "$1" From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:35:00 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CCF94F2EF0D; Sat, 3 Mar 2018 10:35:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 7C51879F60; Sat, 3 Mar 2018 10:35:00 +0000 (UTC) (envelope-from eadler@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 734012524B; Sat, 3 Mar 2018 10:35:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AZ0kU030872; Sat, 3 Mar 2018 10:35:00 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AZ089030871; Sat, 3 Mar 2018 10:35:00 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031035.w23AZ089030871@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:35: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: r330322 - stable/11/libexec/rshd X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/libexec/rshd X-SVN-Commit-Revision: 330322 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.25 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, 03 Mar 2018 10:35:01 -0000 Author: eadler Date: Sat Mar 3 10:35:00 2018 New Revision: 330322 URL: https://svnweb.freebsd.org/changeset/base/330322 Log: MFC r320406: A little tweak for performance Modified: stable/11/libexec/rshd/rshd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/libexec/rshd/rshd.c ============================================================================== --- stable/11/libexec/rshd/rshd.c Sat Mar 3 10:32:00 2018 (r330321) +++ stable/11/libexec/rshd/rshd.c Sat Mar 3 10:35:00 2018 (r330322) @@ -191,7 +191,7 @@ doit(struct sockaddr *fromp) struct passwd *pwd; u_short port; fd_set ready, readfrom; - int cc, fd, nfd, pv[2], pid, s; + int cc, nfd, pv[2], pid, s; int one = 1; const char *cp, *errorstr; char sig, buf[BUFSIZ]; @@ -493,8 +493,7 @@ doit(struct sockaddr *fromp) #ifdef USE_BLACKLIST blacklist(0, STDIN_FILENO, "success"); #endif - for (fd = getdtablesize(); fd > 2; fd--) - (void) close(fd); + closefrom(3); if (setsid() == -1) syslog(LOG_ERR, "setsid() failed: %m"); if (setlogin(pwd->pw_name) < 0) From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:37:54 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 7C4FBF2F2B2; Sat, 3 Mar 2018 10:37:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 2CF0F7A12C; Sat, 3 Mar 2018 10:37:54 +0000 (UTC) (envelope-from eadler@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 27BFB2524D; Sat, 3 Mar 2018 10:37:54 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23Absi9031016; Sat, 3 Mar 2018 10:37:54 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23Abss3031015; Sat, 3 Mar 2018 10:37:54 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031037.w23Abss3031015@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:37: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: r330323 - stable/11/share/mk X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/share/mk X-SVN-Commit-Revision: 330323 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.25 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, 03 Mar 2018 10:37:54 -0000 Author: eadler Date: Sat Mar 3 10:37:53 2018 New Revision: 330323 URL: https://svnweb.freebsd.org/changeset/base/330323 Log: MFC r321426: cleanobj: Unhide removal of directory. Modified: stable/11/share/mk/bsd.obj.mk Directory Properties: stable/11/ (props changed) Modified: stable/11/share/mk/bsd.obj.mk ============================================================================== --- stable/11/share/mk/bsd.obj.mk Sat Mar 3 10:35:00 2018 (r330322) +++ stable/11/share/mk/bsd.obj.mk Sat Mar 3 10:37:53 2018 (r330323) @@ -159,7 +159,7 @@ whereobj: .if ${CANONICALOBJDIR} != ${.CURDIR} && exists(${CANONICALOBJDIR}/) cleanobj: - @-rm -rf ${CANONICALOBJDIR} + -rm -rf ${CANONICALOBJDIR} .else cleanobj: clean cleandepend .endif From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:43:42 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 62B4BF2F980; Sat, 3 Mar 2018 10:43:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1382B7A5E2; Sat, 3 Mar 2018 10:43:42 +0000 (UTC) (envelope-from eadler@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 0E737253E4; Sat, 3 Mar 2018 10:43:42 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AhfaR035733; Sat, 3 Mar 2018 10:43:41 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23Ahf1F035732; Sat, 3 Mar 2018 10:43:41 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031043.w23Ahf1F035732@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:43: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: r330324 - stable/11/bin/pkill X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/pkill X-SVN-Commit-Revision: 330324 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.25 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, 03 Mar 2018 10:43:42 -0000 Author: eadler Date: Sat Mar 3 10:43:41 2018 New Revision: 330324 URL: https://svnweb.freebsd.org/changeset/base/330324 Log: MFC r322210,r322613,r322831: pgrep naively appends the delimiter to all PIDs including the last e.g. "pgrep -d, getty" outputs "1399,1386,1309,1308,1307,1306,1305,1302," Ensure the list is correctly delimited by suppressing the emission of the delimiter after the final PID. The r322210 change to pgrep's PID delimiting behaviour causes pgrep's default output to not include a trailing new line, which is a potential POLA violation for existing consumers. Change pgrep to always emit a trailing new line on completion of its output, regardless of the delimeter in use (which technically is also a potential POLA violation for existing consumers that rely on the pre-r322210 buggy behaviour, but a line has to be drawn somewhere). Only emit the trailing new line added in r322613 when not operating in quiet mode. PR: 221534 (r322613) Modified: stable/11/bin/pkill/pkill.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pkill/pkill.c ============================================================================== --- stable/11/bin/pkill/pkill.c Sat Mar 3 10:37:53 2018 (r330323) +++ stable/11/bin/pkill/pkill.c Sat Mar 3 10:43:41 2018 (r330324) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -567,6 +568,8 @@ main(int argc, char **argv) continue; rv |= (*action)(kp); } + if (rv && pgrep && !quiet) + putchar('\n'); if (!did_action && !pgrep && longfmt) fprintf(stderr, "No matching processes belonging to you were found\n"); @@ -656,10 +659,12 @@ killact(const struct kinfo_proc *kp) static int grepact(const struct kinfo_proc *kp) { + static bool first = true; - show_process(kp); - if (!quiet) + if (!quiet && !first) printf("%s", delim); + show_process(kp); + first = false; return (1); } From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:45:20 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 553C2F2FAFA; Sat, 3 Mar 2018 10:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 079087A771; Sat, 3 Mar 2018 10:45:20 +0000 (UTC) (envelope-from eadler@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 02778253E7; Sat, 3 Mar 2018 10:45:20 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AjJQD035888; Sat, 3 Mar 2018 10:45:19 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AjJa7035887; Sat, 3 Mar 2018 10:45:19 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031045.w23AjJa7035887@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:45: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: r330325 - stable/11/usr.bin/mkesdb X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/usr.bin/mkesdb X-SVN-Commit-Revision: 330325 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.25 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, 03 Mar 2018 10:45:20 -0000 Author: eadler Date: Sat Mar 3 10:45:19 2018 New Revision: 330325 URL: https://svnweb.freebsd.org/changeset/base/330325 Log: MFC r322428: Set usage() to show -d flag mkesdb supports the -d flag for enabling debug mode, as documented in the manual. PR: 209865 Submitted by: Maya Rashish Reviewed by: imp Approved by: bcr (mentor) Obtained from: NetBSD MFC after: 7 days Differential Revision: https://reviews.freebsd.org/D11987 Modified: stable/11/usr.bin/mkesdb/yacc.y Directory Properties: stable/11/ (props changed) Modified: stable/11/usr.bin/mkesdb/yacc.y ============================================================================== --- stable/11/usr.bin/mkesdb/yacc.y Sat Mar 3 10:43:41 2018 (r330324) +++ stable/11/usr.bin/mkesdb/yacc.y Sat Mar 3 10:45:19 2018 (r330325) @@ -278,8 +278,8 @@ usage(void) { errx(EXIT_FAILURE, "usage:\n" - "\t%s [-o outfile] [infile]\n" - "\t%s -m [-o outfile] [infile]", + "\t%s [-d] [-o outfile] [infile]\n" + "\t%s -m [-d] [-o outfile] [infile]", getprogname(), getprogname()); } From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:47:31 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9D9D6F2FE12; Sat, 3 Mar 2018 10:47:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5035A7AA05; Sat, 3 Mar 2018 10:47:31 +0000 (UTC) (envelope-from eadler@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 4697B253E9; Sat, 3 Mar 2018 10:47:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AlVON036038; Sat, 3 Mar 2018 10:47:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AlVNG036037; Sat, 3 Mar 2018 10:47:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031047.w23AlVNG036037@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:47:31 +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: r330326 - stable/11/contrib/mdocml X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/contrib/mdocml X-SVN-Commit-Revision: 330326 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.25 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, 03 Mar 2018 10:47:31 -0000 Author: eadler Date: Sat Mar 3 10:47:30 2018 New Revision: 330326 URL: https://svnweb.freebsd.org/changeset/base/330326 Log: MFC r322657: typo PR: 211160 Modified: stable/11/contrib/mdocml/lib.in Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/mdocml/lib.in ============================================================================== --- stable/11/contrib/mdocml/lib.in Sat Mar 3 10:45:19 2018 (r330325) +++ stable/11/contrib/mdocml/lib.in Sat Mar 3 10:47:30 2018 (r330326) @@ -34,7 +34,7 @@ LINE("libc", "Standard C\\~Library (libc, \\-lc)") LINE("libc_r", "Reentrant C\\~Library (libc_r, \\-lc_r)") LINE("libcalendar", "Calendar Arithmetic Library (libcalendar, \\-lcalendar)") LINE("libcam", "Common Access Method User Library (libcam, \\-lcam)") -LINE("libcasper", "Casper Library (libcasper, \\-lcapser)") +LINE("libcasper", "Casper Library (libcasper, \\-lcasper)") LINE("libcdk", "Curses Development Kit Library (libcdk, \\-lcdk)") LINE("libcipher", "FreeSec Crypt Library (libcipher, \\-lcipher)") LINE("libcompat", "Compatibility Library (libcompat, \\-lcompat)") From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:48:24 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id A6D7FF2FF01; Sat, 3 Mar 2018 10:48:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5330F7AB48; Sat, 3 Mar 2018 10:48:24 +0000 (UTC) (envelope-from eadler@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 34696253EB; Sat, 3 Mar 2018 10:48:24 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AmO27036132; Sat, 3 Mar 2018 10:48:24 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AmO14036131; Sat, 3 Mar 2018 10:48:24 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031048.w23AmO14036131@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:48:24 +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: r330327 - stable/11 X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11 X-SVN-Commit-Revision: 330327 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.25 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, 03 Mar 2018 10:48:24 -0000 Author: eadler Date: Sat Mar 3 10:48:23 2018 New Revision: 330327 URL: https://svnweb.freebsd.org/changeset/base/330327 Log: MFC r322804 (record only) Correct typo in usage string. Modified: Directory Properties: stable/11/ (props changed) From owner-svn-src-stable-11@freebsd.org Sat Mar 3 10:50:17 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 9A612F300D3; Sat, 3 Mar 2018 10:50:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B7BB7ACF5; Sat, 3 Mar 2018 10:50:17 +0000 (UTC) (envelope-from eadler@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 412A5253EF; Sat, 3 Mar 2018 10:50:17 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23AoH64036274; Sat, 3 Mar 2018 10:50:17 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23AoHb6036273; Sat, 3 Mar 2018 10:50:17 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031050.w23AoHb6036273@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 10:50:16 +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: r330328 - stable/11/sbin/sysctl X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sbin/sysctl X-SVN-Commit-Revision: 330328 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.25 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, 03 Mar 2018 10:50:17 -0000 Author: eadler Date: Sat Mar 3 10:50:16 2018 New Revision: 330328 URL: https://svnweb.freebsd.org/changeset/base/330328 Log: MFC r323645: kern.osreldate is an integer, not a string PR: 217501 Modified: stable/11/sbin/sysctl/sysctl.8 Directory Properties: stable/11/ (props changed) Modified: stable/11/sbin/sysctl/sysctl.8 ============================================================================== --- stable/11/sbin/sysctl/sysctl.8 Sat Mar 3 10:48:23 2018 (r330327) +++ stable/11/sbin/sysctl/sysctl.8 Sat Mar 3 10:50:16 2018 (r330328) @@ -214,7 +214,7 @@ String and integer values can be set using .It "kern.filedelay integer yes" .It "kern.dirdelay integer yes" .It "kern.metadelay integer yes" -.It "kern.osreldate string no" +.It "kern.osreldate integer no" .It "kern.bootfile string yes" .It "kern.corefile string yes" .It "kern.logsigexit integer yes" From owner-svn-src-stable-11@freebsd.org Sat Mar 3 11:02:35 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E5448F30F56; Sat, 3 Mar 2018 11:02:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 939CB7B5A1; Sat, 3 Mar 2018 11:02:34 +0000 (UTC) (envelope-from eadler@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 8E79525727; Sat, 3 Mar 2018 11:02:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23B2YaK046161; Sat, 3 Mar 2018 11:02:34 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23B2YDh046160; Sat, 3 Mar 2018 11:02:34 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031102.w23B2YDh046160@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 11:02: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: r330329 - stable/11/bin/uuidgen X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/uuidgen X-SVN-Commit-Revision: 330329 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.25 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, 03 Mar 2018 11:02:35 -0000 Author: eadler Date: Sat Mar 3 11:02:34 2018 New Revision: 330329 URL: https://svnweb.freebsd.org/changeset/base/330329 Log: MFC r303727: uuid_to_string(3) is allocating memory and can fail on that. Check if any error accrued. Modified: stable/11/bin/uuidgen/uuidgen.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/uuidgen/uuidgen.c ============================================================================== --- stable/11/bin/uuidgen/uuidgen.c Sat Mar 3 10:50:16 2018 (r330328) +++ stable/11/bin/uuidgen/uuidgen.c Sat Mar 3 11:02:34 2018 (r330329) @@ -47,7 +47,7 @@ main(int argc, char *argv[]) FILE *fp; uuid_t *store, *uuid; char *p; - int ch, count, i, iterate; + int ch, count, i, iterate, status; count = -1; /* no count yet */ fp = stdout; /* default output file */ @@ -101,7 +101,9 @@ main(int argc, char *argv[]) uuid = store; while (count--) { - uuid_to_string(uuid++, &p, NULL); + uuid_to_string(uuid++, &p, &status); + if (status != uuid_s_ok) + err(1, "cannot stringify a UUID"); fprintf(fp, "%s\n", p); free(p); } From owner-svn-src-stable-11@freebsd.org Sat Mar 3 11:11:07 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id DAF17F316C0; Sat, 3 Mar 2018 11:11:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 885747B8B7; Sat, 3 Mar 2018 11:11:07 +0000 (UTC) (envelope-from eadler@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 8351425850; Sat, 3 Mar 2018 11:11:07 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23BB7Z6047247; Sat, 3 Mar 2018 11:11:07 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BB7Hs047246; Sat, 3 Mar 2018 11:11:07 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031111.w23BB7Hs047246@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 11:11:07 +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: r330330 - stable/11/tools/tools/syscall_timing X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/tools/tools/syscall_timing X-SVN-Commit-Revision: 330330 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.25 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, 03 Mar 2018 11:11:08 -0000 Author: eadler Date: Sat Mar 3 11:11:07 2018 New Revision: 330330 URL: https://svnweb.freebsd.org/changeset/base/330330 Log: MFC r325319: Remove artificial limit for -i. Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c Directory Properties: stable/11/ (props changed) Modified: stable/11/tools/tools/syscall_timing/syscall_timing.c ============================================================================== --- stable/11/tools/tools/syscall_timing/syscall_timing.c Sat Mar 3 11:02:34 2018 (r330329) +++ stable/11/tools/tools/syscall_timing/syscall_timing.c Sat Mar 3 11:11:07 2018 (r330330) @@ -706,7 +706,7 @@ main(int argc, char *argv[]) switch (ch) { case 'i': ll = strtol(optarg, &endp, 10); - if (*endp != 0 || ll < 1 || ll > 100000) + if (*endp != 0 || ll < 1) usage(); iterations = ll; break; From owner-svn-src-stable-11@freebsd.org Sat Mar 3 11:12:10 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0B612F317F6; Sat, 3 Mar 2018 11:12:10 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AD0D77BBBA; Sat, 3 Mar 2018 11:12:09 +0000 (UTC) (envelope-from eadler@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 A8061258A4; Sat, 3 Mar 2018 11:12:09 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23BC9er050981; Sat, 3 Mar 2018 11:12:09 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BC9ki050980; Sat, 3 Mar 2018 11:12:09 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031112.w23BC9ki050980@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 11:12: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: r330331 - stable/11/bin/rm X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/rm X-SVN-Commit-Revision: 330331 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.25 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, 03 Mar 2018 11:12:10 -0000 Author: eadler Date: Sat Mar 3 11:12:09 2018 New Revision: 330331 URL: https://svnweb.freebsd.org/changeset/base/330331 Log: MFC r325450: Fix cosmetic nit when printing out "override $mode" and "$owner/$group ..." The wrong index was being checked for == ' ' in the resulting stringified mode from strmode(3) -- it should have been the 11th value, not the 10th. PR: 76711 Modified: stable/11/bin/rm/rm.c Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/rm/rm.c ============================================================================== --- stable/11/bin/rm/rm.c Sat Mar 3 11:11:07 2018 (r330330) +++ stable/11/bin/rm/rm.c Sat Mar 3 11:12:09 2018 (r330331) @@ -515,7 +515,7 @@ check(const char *path, const char *name, struct stat "%s: -P was specified, but file is not writable", path); (void)fprintf(stderr, "override %s%s%s/%s %s%sfor %s? ", - modep + 1, modep[9] == ' ' ? "" : " ", + modep + 1, modep[10] == ' ' ? "" : " ", user_from_uid(sp->st_uid, 0), group_from_gid(sp->st_gid, 0), *flagsp ? flagsp : "", *flagsp ? " " : "", From owner-svn-src-stable-11@freebsd.org Sat Mar 3 11:17:06 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 904FEF31F9C; Sat, 3 Mar 2018 11:17:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 3E79B7BE69; Sat, 3 Mar 2018 11:17:06 +0000 (UTC) (envelope-from eadler@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 3505F258C4; Sat, 3 Mar 2018 11:17:06 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23BH5lY051222; Sat, 3 Mar 2018 11:17:05 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BH5Na051220; Sat, 3 Mar 2018 11:17:05 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031117.w23BH5Na051220@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 11:17:05 +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: r330332 - stable/11/bin/pkill/tests X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/pkill/tests X-SVN-Commit-Revision: 330332 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.25 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, 03 Mar 2018 11:17:06 -0000 Author: eadler Date: Sat Mar 3 11:17:05 2018 New Revision: 330332 URL: https://svnweb.freebsd.org/changeset/base/330332 Log: MFC r307519,r307629: Increase timeout so low-end platforms have a chance to complete test procedures. This fixes operation in QEMU/MIPS64. Modified: stable/11/bin/pkill/tests/pgrep-j_test.sh stable/11/bin/pkill/tests/pkill-j_test.sh Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/pkill/tests/pgrep-j_test.sh ============================================================================== --- stable/11/bin/pkill/tests/pgrep-j_test.sh Sat Mar 3 11:12:09 2018 (r330331) +++ stable/11/bin/pkill/tests/pgrep-j_test.sh Sat Mar 3 11:17:05 2018 (r330332) @@ -20,12 +20,13 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pgrep -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_1_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_2.pid $sleep $sleep_amount & +sleep 0.5 for i in `seq 1 10`; do jid1=$(jail_name_to_jid ${base}_1_1) @@ -53,7 +54,7 @@ fi wait name="pgrep -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -74,7 +75,7 @@ fi wait name="pgrep -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount & jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -91,7 +92,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pgrep -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & Modified: stable/11/bin/pkill/tests/pkill-j_test.sh ============================================================================== --- stable/11/bin/pkill/tests/pkill-j_test.sh Sat Mar 3 11:12:09 2018 (r330331) +++ stable/11/bin/pkill/tests/pkill-j_test.sh Sat Mar 3 11:17:05 2018 (r330332) @@ -20,7 +20,7 @@ sleep=$(pwd)/sleep.txt ln -sf /bin/sleep $sleep name="pkill -j " -sleep_amount=5 +sleep_amount=15 jail -c path=/ name=${base}_1_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_1_1.pid $sleep $sleep_amount & @@ -54,7 +54,7 @@ fi 2>/dev/null wait name="pkill -j any" -sleep_amount=6 +sleep_amount=16 jail -c path=/ name=${base}_2_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_2_1.pid $sleep $sleep_amount & @@ -76,7 +76,7 @@ fi 2>/dev/null wait name="pkill -j none" -sleep_amount=7 +sleep_amount=17 daemon -p ${PWD}/${base}_3_1.pid $sleep $sleep_amount jail -c path=/ name=${base}_3_2 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_3_2.pid $sleep $sleep_amount & @@ -94,7 +94,7 @@ wait # test 4 is like test 1 except with jname instead of jid. name="pkill -j " -sleep_amount=8 +sleep_amount=18 jail -c path=/ name=${base}_4_1 ip4.addr=127.0.0.1 \ command=daemon -p ${PWD}/${base}_4_1.pid $sleep $sleep_amount & From owner-svn-src-stable-11@freebsd.org Sat Mar 3 11:18:39 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D56B3F321C8; Sat, 3 Mar 2018 11:18:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 808CB7C018; Sat, 3 Mar 2018 11:18:38 +0000 (UTC) (envelope-from eadler@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 7A6BE258C5; Sat, 3 Mar 2018 11:18:38 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23BIcG7051321; Sat, 3 Mar 2018 11:18:38 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BIcpw051319; Sat, 3 Mar 2018 11:18:38 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031118.w23BIcpw051319@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 11:18: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: r330333 - stable/11/bin/freebsd-version X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/bin/freebsd-version X-SVN-Commit-Revision: 330333 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.25 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, 03 Mar 2018 11:18:39 -0000 Author: eadler Date: Sat Mar 3 11:18:38 2018 New Revision: 330333 URL: https://svnweb.freebsd.org/changeset/base/330333 Log: MFC r325800: Add a -r option to print the running kernel version. Modified: stable/11/bin/freebsd-version/freebsd-version.1 stable/11/bin/freebsd-version/freebsd-version.sh.in Directory Properties: stable/11/ (props changed) Modified: stable/11/bin/freebsd-version/freebsd-version.1 ============================================================================== --- stable/11/bin/freebsd-version/freebsd-version.1 Sat Mar 3 11:17:05 2018 (r330332) +++ stable/11/bin/freebsd-version/freebsd-version.1 Sat Mar 3 11:18:38 2018 (r330333) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 5, 2013 +.Dd November 14, 2017 .Dt FREEBSD-VERSION 1 .Os .Sh NAME @@ -33,7 +33,7 @@ .Nd print the version and patch level of the installed system .Sh SYNOPSIS .Nm -.Op Fl ku +.Op Fl kru .Sh DESCRIPTION The .Nm @@ -50,6 +50,11 @@ if a new kernel has been installed but the system has rebooted, .Nm will print the version and patch level of the new kernel. +.It Fl r +Print the version and patch level of the running kernel. +Unlike +.Xr uname 1 , +this is unaffected by environment variables. .It Fl u Print the version and patch level of the installed userland. These are hardcoded into @@ -57,14 +62,10 @@ These are hardcoded into during the build. .El .Pp -If both -.Fl k -and -.Fl u -are specified, +If several of the above options are specified, .Nm -will print the kernel version first, then the userland version, on -separate lines. +will print the installed kernel version first, then the running kernel +version, and finally the userland version, on separate lines. If neither is specified, it will print the userland version only. .Sh IMPLEMENTATION NOTES The Modified: stable/11/bin/freebsd-version/freebsd-version.sh.in ============================================================================== --- stable/11/bin/freebsd-version/freebsd-version.sh.in Sat Mar 3 11:17:05 2018 (r330332) +++ stable/11/bin/freebsd-version/freebsd-version.sh.in Sat Mar 3 11:18:38 2018 (r330333) @@ -38,7 +38,7 @@ LOADER_RE1='^\([A-Z_a-z][0-9A-Z_a-z]*=[-./0-9A-Z_a-z]\ LOADER_RE2='^\([A-Z_a-z][0-9A-Z_a-z]*="[-./0-9A-Z_a-z]\{1,\}"\).*$' KERNEL_RE='^@@TYPE@@ \([-.0-9A-Za-z]\{1,\}\) .*$' -progname=$(basename $0) +progname=${0##*/} # # Print an error message and exit. @@ -71,6 +71,13 @@ kernel_version() { } # +# Print the version of the currently running kernel. +# +running_version() { + sysctl -n kern.osrelease +} + +# # Print the hardcoded userland version. # userland_version() { @@ -81,7 +88,7 @@ userland_version() { # Print a usage string and exit. # usage() { - echo "usage: $progname [-ku]" >&2 + echo "usage: $progname [-kru]" >&2 exit 1 } @@ -90,11 +97,14 @@ usage() { # main() { # parse command-line arguments - while getopts "ku" option ; do + while getopts "kru" option ; do case $option in k) opt_k=1 ;; + r) + opt_r=1 + ;; u) opt_u=1 ;; @@ -108,13 +118,18 @@ main() { fi # default is -u - if [ $((opt_k + opt_u)) -eq 0 ] ; then + if [ $((opt_k + opt_r + opt_u)) -eq 0 ] ; then opt_u=1 fi - # print kernel version + # print installed kernel version if [ $opt_k ] ; then kernel_version + fi + + # print running kernel version + if [ $opt_r ] ; then + running_version fi # print userland version From owner-svn-src-stable-11@freebsd.org Sat Mar 3 11:53:45 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 69DCDF348CD; Sat, 3 Mar 2018 11:53:45 +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.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0ED2D7D74F; Sat, 3 Mar 2018 11:53:45 +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 0687825F1C; Sat, 3 Mar 2018 11:53:45 +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 w23BrisL071254; Sat, 3 Mar 2018 11:53:44 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23BriKZ071253; Sat, 3 Mar 2018 11:53:44 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201803031153.w23BriKZ071253@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sat, 3 Mar 2018 11:53:44 +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: r330334 - stable/11/sys/vm X-SVN-Group: stable-11 X-SVN-Commit-Author: kib X-SVN-Commit-Paths: stable/11/sys/vm X-SVN-Commit-Revision: 330334 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.25 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, 03 Mar 2018 11:53:45 -0000 Author: kib Date: Sat Mar 3 11:53:44 2018 New Revision: 330334 URL: https://svnweb.freebsd.org/changeset/base/330334 Log: MFC r329905: Hide all vm/vm_pageout.h content under #ifdef _KERNEL. Modified: stable/11/sys/vm/vm_pageout.h Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/vm/vm_pageout.h ============================================================================== --- stable/11/sys/vm/vm_pageout.h Sat Mar 3 11:18:38 2018 (r330333) +++ stable/11/sys/vm/vm_pageout.h Sat Mar 3 11:53:44 2018 (r330334) @@ -63,6 +63,8 @@ #ifndef _VM_VM_PAGEOUT_H_ #define _VM_VM_PAGEOUT_H_ +#ifdef _KERNEL + /* * Header file for pageout daemon. */ @@ -101,11 +103,10 @@ void pagedaemon_wakeup(void); void vm_wait(void); void vm_waitpfault(void); -#ifdef _KERNEL int vm_pageout_flush(vm_page_t *, int, int, int, int *, boolean_t *); void vm_pageout_oom(int shortage); void vm_swapout_run(void); void vm_swapout_run_idle(void); -#endif +#endif /* _KERNEL */ #endif /* _VM_VM_PAGEOUT_H_ */ From owner-svn-src-stable-11@freebsd.org Sat Mar 3 18:11:03 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BE8D6F2E9D1; Sat, 3 Mar 2018 18:11:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6B0946E20C; Sat, 3 Mar 2018 18:11:03 +0000 (UTC) (envelope-from eadler@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 655E71B2D; Sat, 3 Mar 2018 18:11:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IB3GZ064426; Sat, 3 Mar 2018 18:11:03 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IB3gQ064425; Sat, 3 Mar 2018 18:11:03 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803031811.w23IB3gQ064425@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 18:11: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: r330343 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330343 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.25 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, 03 Mar 2018 18:11:03 -0000 Author: eadler Date: Sat Mar 3 18:11:02 2018 New Revision: 330343 URL: https://svnweb.freebsd.org/changeset/base/330343 Log: MFC r302519: Audit the file-descriptor number argument for openat(2). Remove a comment about the desirability of auditing the number, as it was in fact in the wrong place (in the common path for open(2) and openat(2), and only the latter accepts a file-descriptor argument). Where other ABIs support openat(2), it may be necessary to do additional argument auditing as it is not performed in kern_openat(9). MFC after: 3 days Modified: stable/11/sys/kern/vfs_syscalls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/vfs_syscalls.c ============================================================================== --- stable/11/sys/kern/vfs_syscalls.c Sat Mar 3 17:38:25 2018 (r330342) +++ stable/11/sys/kern/vfs_syscalls.c Sat Mar 3 18:11:02 2018 (r330343) @@ -959,6 +959,7 @@ int sys_openat(struct thread *td, struct openat_args *uap) { + AUDIT_ARG_FD(uap->fd); return (kern_openat(td, uap->fd, uap->path, UIO_USERSPACE, uap->flag, uap->mode)); } @@ -979,7 +980,6 @@ kern_openat(struct thread *td, int fd, char *path, enu AUDIT_ARG_FFLAGS(flags); AUDIT_ARG_MODE(mode); - /* XXX: audit dirfd */ cap_rights_init(&rights, CAP_LOOKUP); flags_to_rights(flags, &rights); /* From owner-svn-src-stable-11@freebsd.org Sat Mar 3 21:05:29 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5F423F3C4C9; Sat, 3 Mar 2018 21:05:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F38F6767FE; Sat, 3 Mar 2018 21:05:28 +0000 (UTC) (envelope-from eadler@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 ED4D33CAC; Sat, 3 Mar 2018 21:05:28 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23L5SLW053019; Sat, 3 Mar 2018 21:05:28 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23L5SfD053018; Sat, 3 Mar 2018 21:05:28 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032105.w23L5SfD053018@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 21:05: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: r330355 - stable/11/sys/kern X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/kern X-SVN-Commit-Revision: 330355 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.25 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, 03 Mar 2018 21:05:29 -0000 Author: eadler Date: Sat Mar 3 21:05:28 2018 New Revision: 330355 URL: https://svnweb.freebsd.org/changeset/base/330355 Log: MFC r305137: Eliminate unnecessary loop in _cap_check() Calling cap_rights_contains() several times with the same inputs is not going to produce a different output. The variable being iterated, i, is never used inside the for loop. The loop is actually done in cap_rights_contains() Modified: stable/11/sys/kern/sys_capability.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/kern/sys_capability.c ============================================================================== --- stable/11/sys/kern/sys_capability.c Sat Mar 3 20:42:39 2018 (r330354) +++ stable/11/sys/kern/sys_capability.c Sat Mar 3 21:05:28 2018 (r330355) @@ -154,16 +154,13 @@ static inline int _cap_check(const cap_rights_t *havep, const cap_rights_t *needp, enum ktr_cap_fail_type type) { - int i; - for (i = 0; i < nitems(havep->cr_rights); i++) { - if (!cap_rights_contains(havep, needp)) { + if (!cap_rights_contains(havep, needp)) { #ifdef KTRACE - if (KTRPOINT(curthread, KTR_CAPFAIL)) - ktrcapfail(type, needp, havep); + if (KTRPOINT(curthread, KTR_CAPFAIL)) + ktrcapfail(type, needp, havep); #endif - return (ENOTCAPABLE); - } + return (ENOTCAPABLE); } return (0); } From owner-svn-src-stable-11@freebsd.org Sat Mar 3 21:23:32 2018 Return-Path: Delivered-To: svn-src-stable-11@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 303A3F3D9B3; Sat, 3 Mar 2018 21:23:32 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id D2866775AB; Sat, 3 Mar 2018 21:23:31 +0000 (UTC) (envelope-from eadler@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 CD6E9403C; Sat, 3 Mar 2018 21:23:31 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23LNVWu062951; Sat, 3 Mar 2018 21:23:31 GMT (envelope-from eadler@FreeBSD.org) Received: (from eadler@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23LNVWD062950; Sat, 3 Mar 2018 21:23:31 GMT (envelope-from eadler@FreeBSD.org) Message-Id: <201803032123.w23LNVWD062950@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: eadler set sender to eadler@FreeBSD.org using -f From: Eitan Adler Date: Sat, 3 Mar 2018 21:23:31 +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: r330357 - stable/11/sys/netinet X-SVN-Group: stable-11 X-SVN-Commit-Author: eadler X-SVN-Commit-Paths: stable/11/sys/netinet X-SVN-Commit-Revision: 330357 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.25 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, 03 Mar 2018 21:23:32 -0000 Author: eadler Date: Sat Mar 3 21:23:31 2018 New Revision: 330357 URL: https://svnweb.freebsd.org/changeset/base/330357 Log: MFC r306767: Correctly calculate snd_max in persist case. In the persist case, take the SYN and FIN flags into account when updating the sequence space sent. Modified: stable/11/sys/netinet/tcp_output.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/netinet/tcp_output.c ============================================================================== --- stable/11/sys/netinet/tcp_output.c Sat Mar 3 21:14:55 2018 (r330356) +++ stable/11/sys/netinet/tcp_output.c Sat Mar 3 21:23:31 2018 (r330357) @@ -1545,7 +1545,7 @@ timer: tp->t_flags |= TF_SENTFIN; } if (SEQ_GT(tp->snd_nxt + xlen, tp->snd_max)) - tp->snd_max = tp->snd_nxt + len; + tp->snd_max = tp->snd_nxt + xlen; } if (error) {