From nobody Tue Jan 07 18:09:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4YSJx32dQdz5kw2Q; Tue, 07 Jan 2025 18:09:59 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YSJx31VCQz4hqW; Tue, 7 Jan 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37HzmFBV9qu8c9db9/A3RWMB5rlZf/Tj5Zz9Om8lyRI=; b=gH+dBbgE69AeXUNRDDp9yn2ipMR57AsKK512PeodHAeAtU+ZqS6InEUUFgjpHH6DHQK+lm enMTB/TkzpN+qqX3yq8FMmAtwU+vrKAlCmVBxeZ23VSm5H3s2W96JRIHc0i/EB57Ta3Pta dJaJvdFzki8cgBssgdgNApKS1rDGqDsLIEbpFG0Fpkiq+SV+ImniQATnKjRA2lDuGDBCOz qUkQBFvyZRXFl7pr4QdrusbhJpSgyH6GG7cYj4ViCm5IeJHAZLl1wCGcXAygnW4VNqZljx 0rEyD8Fnj4bzpSzLebAh8rlLbRt+VOWZ6eK+rQk5XHRcCp5v722jobiaDQuVQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1736273399; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=37HzmFBV9qu8c9db9/A3RWMB5rlZf/Tj5Zz9Om8lyRI=; b=Ma14atu4paosySIhC9Ly3A6EhwSxFSZhqWI6jvxzgbQqNGKvxxwdg51w3c2L5we+duBbBS FYQD11laHOzW08tSRuT1e4zW+br46N26ObQ7eao8CDis4PgAg7+IMwNYbfiZuL5UZztJ6G t6h4pmxmFvMr9ivaOvAG9/G3IlzbWaukMboGDOxAB4zgZlf+EcpdfCTJSik2N/+69alW3Q xLL70j/ajYRNT7DkhViNcI0hUBO0GWRUqtjqp4fwj6xCCR0f7hlfB2EZ/4sv4XkqnbtYFn WsJUmjyvDEPYeSgii86wB7LYMyhrNyhqJDpWEkvccmDUV2NA2RZnQ5J3e+vBNw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1736273399; a=rsa-sha256; cv=none; b=olZ3/BWyqtrZyrQiXB2wcJxrSPzKtSff5s62K0RbIPdL8oXnFJQw2oxWvbyKZr8stLL2xL FNJy8GZni4ne1jLGQUPj959szoKyrccDxV0P4dSsOR9cLg+hA8bZ+tiuHmxLiZSrSkWl1g hvO3UKrlxqJudAnS5g90r5iFRllG6HKaWsVkr+puGEHAi/PNpd8rymyRnlBrVsK4V6FrSN SgyKY6l9MnVn6bRZam1CbE11eCzSAjJa7IiHOsj4AM0GQ4gYni0wb05ZSTtShMhNQVNpY8 Cx2W8zomSDIGAg+r7LNoUUK+GYmNH0jelItuEpUgcOzD9mxcXhFcnJPYD3xD8Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none 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 4YSJx30Sywz5QC; Tue, 07 Jan 2025 18:09:59 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 507I9wiK012548; Tue, 7 Jan 2025 18:09:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 507I9whj012545; Tue, 7 Jan 2025 18:09:58 GMT (envelope-from git) Date: Tue, 7 Jan 2025 18:09:58 GMT Message-Id: <202501071809.507I9whj012545@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 42410c6d682c - main - ifconfig: make -vht work List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bz X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 42410c6d682c4e00ce6147f99b51a55f6f3fe075 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=42410c6d682c4e00ce6147f99b51a55f6f3fe075 commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075 Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 16:58:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-01-07 18:09:00 +0000 ifconfig: make -vht work Also hide the other vht options on -vht and only show vht40/80/160/80p80 when vht is enabled. While here fix some whitespace and comments. Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: adrian, emaste Differential Revision: https://reviews.freebsd.org/D48326 --- sbin/ifconfig/ifieee80211.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/sbin/ifconfig/ifieee80211.c b/sbin/ifconfig/ifieee80211.c index 77f7bdabb0b2..d4dcfdf63254 100644 --- a/sbin/ifconfig/ifieee80211.c +++ b/sbin/ifconfig/ifieee80211.c @@ -198,8 +198,10 @@ static int gottxparams = 0; static struct ieee80211_channel curchan; static int gotcurchan = 0; static struct ifmediareq *global_ifmr; + +/* HT */ static int htconf = 0; -static int gothtconf = 0; +static int gothtconf = 0; static void gethtconf(if_ctx *ctx) @@ -213,7 +215,7 @@ gethtconf(if_ctx *ctx) /* VHT */ static int vhtconf = 0; -static int gotvhtconf = 0; +static int gotvhtconf = 0; static void getvhtconf(if_ctx *ctx) @@ -5416,26 +5418,27 @@ end: if (IEEE80211_IS_CHAN_VHT(c) || verbose) { getvhtconf(ctx); - if (vhtconf & IEEE80211_FVHT_VHT) + if (vhtconf & IEEE80211_FVHT_VHT) { LINE_CHECK("vht"); - else + + if (vhtconf & IEEE80211_FVHT_USEVHT40) + LINE_CHECK("vht40"); + else + LINE_CHECK("-vht40"); + if (vhtconf & IEEE80211_FVHT_USEVHT80) + LINE_CHECK("vht80"); + else + LINE_CHECK("-vht80"); + if (vhtconf & IEEE80211_FVHT_USEVHT160) + LINE_CHECK("vht160"); + else + LINE_CHECK("-vht160"); + if (vhtconf & IEEE80211_FVHT_USEVHT80P80) + LINE_CHECK("vht80p80"); + else + LINE_CHECK("-vht80p80"); + } else if (verbose) LINE_CHECK("-vht"); - if (vhtconf & IEEE80211_FVHT_USEVHT40) - LINE_CHECK("vht40"); - else - LINE_CHECK("-vht40"); - if (vhtconf & IEEE80211_FVHT_USEVHT80) - LINE_CHECK("vht80"); - else - LINE_CHECK("-vht80"); - if (vhtconf & IEEE80211_FVHT_USEVHT160) - LINE_CHECK("vht160"); - else - LINE_CHECK("-vht160"); - if (vhtconf & IEEE80211_FVHT_USEVHT80P80) - LINE_CHECK("vht80p80"); - else - LINE_CHECK("-vht80p80"); } if (get80211val(ctx, IEEE80211_IOC_WME, &wme) != -1) { @@ -6029,7 +6032,7 @@ static struct cmd ieee80211_cmds[] = { DEF_CMD("ht", 3, set80211htconf), /* NB: 20+40 */ DEF_CMD("-ht", 0, set80211htconf), DEF_CMD("vht", IEEE80211_FVHT_VHT, set80211vhtconf), - DEF_CMD("-vht", 0, set80211vhtconf), + DEF_CMD("-vht", -IEEE80211_FVHT_VHT, set80211vhtconf), DEF_CMD("vht40", IEEE80211_FVHT_USEVHT40, set80211vhtconf), DEF_CMD("-vht40", -IEEE80211_FVHT_USEVHT40, set80211vhtconf), DEF_CMD("vht80", IEEE80211_FVHT_USEVHT80, set80211vhtconf),