From owner-dev-commits-src-branches@freebsd.org Tue Apr 27 17:35:42 2021 Return-Path: Delivered-To: dev-commits-src-branches@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id AAA175F909E; Tue, 27 Apr 2021 17:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4FV8724SP3z4gbS; Tue, 27 Apr 2021 17:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 8B9681EDE2; Tue, 27 Apr 2021 17:35:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13RHZgRo092048; Tue, 27 Apr 2021 17:35:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13RHZgQd092047; Tue, 27 Apr 2021 17:35:42 GMT (envelope-from git) Date: Tue, 27 Apr 2021 17:35:42 GMT Message-Id: <202104271735.13RHZgQd092047@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Sofian Brabez Subject: git: d61f10a8780e - stable/13 - iwnstats: fix build with clang and allow install under /usr/local/sbin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sbz X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d61f10a8780ef94f82e384248ce40d24fc27ad2b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-branches@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commits to the stable branches of the FreeBSD src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 17:35:42 -0000 The branch stable/13 has been updated by sbz (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=d61f10a8780ef94f82e384248ce40d24fc27ad2b commit d61f10a8780ef94f82e384248ce40d24fc27ad2b Author: Sofian Brabez AuthorDate: 2021-04-20 17:58:46 +0000 Commit: Sofian Brabez CommitDate: 2021-04-27 17:31:12 +0000 iwnstats: fix build with clang and allow install under /usr/local/sbin iwnstats was not compiling because of some issues raised by the clang compiler due to -Werror. As a tool it is not connected to world build. Add missing field "barker_mrc" initialization in struct iwn_sensitivity_limits for -Wmissing-field-initializers, remove unused pointer *is on iwn_stats_*_print functions and unused variables for -Wunused-parameter and -Wunused-variable. The value for field "barker_mrc" of struct iwn2030_sensitivity_limits was obtained from linux 3.2 wireless/iwlwifi driver code (iwl-2000.c:115 .barker_corr_th_min_mrc = 390). Also set BINDIR in Makefile to make it possible to install under /usr/local/sbin/iwnstats as it require super user. Reviewed by: adrian MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D29800 (cherry picked from commit 561d34d70596b455c6a513431f8ad007076f90c5) --- sys/dev/iwn/if_iwnreg.h | 3 ++- tools/tools/iwn/iwnstats/Makefile | 2 ++ tools/tools/iwn/iwnstats/main.c | 26 +++++++++++--------------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/sys/dev/iwn/if_iwnreg.h b/sys/dev/iwn/if_iwnreg.h index e53343cfbf4a..54945f63df16 100644 --- a/sys/dev/iwn/if_iwnreg.h +++ b/sys/dev/iwn/if_iwnreg.h @@ -2267,7 +2267,8 @@ static const struct iwn_sensitivity_limits iwn2030_sensitivity_limits = { 160,310, 97, 97, - 110 + 110, + 390 }; /* Map TID to TX scheduler's FIFO. */ diff --git a/tools/tools/iwn/iwnstats/Makefile b/tools/tools/iwn/iwnstats/Makefile index b35530c324b0..685e40759fb2 100644 --- a/tools/tools/iwn/iwnstats/Makefile +++ b/tools/tools/iwn/iwnstats/Makefile @@ -15,6 +15,8 @@ PROG= iwnstats # to not compile, use gcc for now. #CC= gcc +BINDIR?=/usr/local/sbin + SRCS= main.c iwn_ioctl.c # CFLAGS.clang+= -fbracket-depth=512 diff --git a/tools/tools/iwn/iwnstats/main.c b/tools/tools/iwn/iwnstats/main.c index b047e11ce6b8..8717bc48f824 100644 --- a/tools/tools/iwn/iwnstats/main.c +++ b/tools/tools/iwn/iwnstats/main.c @@ -72,8 +72,7 @@ iwnstats_new(const char *ifname) } static void -iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, - const char *prefix) +iwn_stats_phy_print(struct iwn_rx_phy_stats *rxphy, const char *prefix) { printf("%s: %s: ina=%d, fina=%d, bad_plcp=%d, bad_crc32=%d, overrun=%d, eoverrun=%d\n", @@ -108,7 +107,7 @@ iwn_stats_phy_print(struct iwnstats *is, struct iwn_rx_phy_stats *rxphy, } static void -iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) +iwn_stats_rx_general_print(struct iwn_rx_general_stats *g) { printf("%s: bad_cts=%d, bad_ack=%d, not_bss=%d, filtered=%d, bad_chan=%d, beacons=%d\n", @@ -147,7 +146,7 @@ iwn_stats_rx_general_print(struct iwnstats *is, struct iwn_rx_general_stats *g) } static void -iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) +iwn_stats_tx_print(struct iwn_tx_stats *tx) { printf("%s: preamble=%d, rx_detected=%d, bt_defer=%d, bt_kill=%d, short_len=%d\n", @@ -191,7 +190,7 @@ iwn_stats_tx_print(struct iwnstats *is, struct iwn_tx_stats *tx) } static void -iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) +iwn_stats_ht_phy_print(struct iwn_rx_ht_phy_stats *ht) { printf("%s: bad_plcp=%d, overrun=%d, eoverrun=%d, good_crc32=%d, bad_crc32=%d\n", @@ -212,7 +211,7 @@ iwn_stats_ht_phy_print(struct iwnstats *is, struct iwn_rx_ht_phy_stats *ht) static void -iwn_stats_general_print(struct iwnstats *is, struct iwn_stats *stats) +iwn_stats_general_print(struct iwn_stats *stats) { /* General */ @@ -249,16 +248,16 @@ iwn_print(struct iwnstats *is) gettimeofday(&tv, NULL); printf("time=%ld.%.6ld\n", (long)tv.tv_sec, (long)tv.tv_usec); - iwn_stats_general_print(is, s); + iwn_stats_general_print(s); /* RX */ - iwn_stats_phy_print(is, &s->rx.ofdm, "ofdm"); - iwn_stats_phy_print(is, &s->rx.cck, "cck"); - iwn_stats_ht_phy_print(is, &s->rx.ht); - iwn_stats_rx_general_print(is, &s->rx.general); + iwn_stats_phy_print(&s->rx.ofdm, "ofdm"); + iwn_stats_phy_print(&s->rx.cck, "cck"); + iwn_stats_ht_phy_print(&s->rx.ht); + iwn_stats_rx_general_print(&s->rx.general); /* TX */ - iwn_stats_tx_print(is, &s->tx); + iwn_stats_tx_print(&s->tx); printf("--\n"); } @@ -278,9 +277,6 @@ main(int argc, char *argv[]) int ch; char *ifname; bool first; - char *sysctlname; - size_t len; - int ret; ifname = strdup(IWN_DEFAULT_IF);