From nobody Mon Feb 10 14:53:04 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Ys6yC27MLz5mHKv; Mon, 10 Feb 2025 14:53:07 +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 4Ys6y84PPsz4Lwj; Mon, 10 Feb 2025 14:53:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739199184; 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=D8UzjCisAd8MGIX+tFDvcyhsnERfp6zVOT6OgcONw9g=; b=S5q2w/1+EGT/jelYvAkkGd8cTdIoXvTsdaZUEXjwBxBM5/byzUk0haE7UoGMabClZ+7KL8 SrKOz8U/4jmcF+ahe0bzlpUe31RpA70/nVURaAH9pWFMpCJXfPA7x4ea9S9/QNVHii7mzU M2jcCyhaDqcJsLx4Knkg65aLw7l0sYI0u5J1VtnQjX5ODXMnj+tClyQ7RZxCyvNF05iAAk MHXb+WMfkp8s5J2kpt9Zu5CkrXMRA2mEGFZTKHLUgbnOQJhDgB3ov3dtxIHCyoAIW5C0yq boDcb9th0zjdYGaQeSX5voJhZbssuDfh9qxpmQO9LgKFsN+VzonKrrxWmv6xvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1739199184; 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=D8UzjCisAd8MGIX+tFDvcyhsnERfp6zVOT6OgcONw9g=; b=YxyaDZMAYmoerPS0udf+qK+1w6TcImyLN+I4gpxl3GABJwH1L3+5FI2YLVqOzePQuWXdhV bN4PM/NZ5ihaQtodNEmGeBE8Wqo+gRC0LDAF6DQFDi9CQ329ZH7WlZhuh/Nrm+2xiI9NK+ QdylQmXQjZhO4tBXV4mZvMVfUiCWzHp3TlJZwmIvWqHvG+RuOoPh9NCHChndWXZyEYlNGd PYZEf2P7+Xk+jHLPGhPhrsyo+bl8FrSgWWElzywXxWvA7e+qH+SB/QRmxrHdfPuJR70zWW HOIicn3oHSOFu0p7ElK/O4s2TRDoShELiFycvAULstwSuU9ewxWodwumhPcJUw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1739199184; a=rsa-sha256; cv=none; b=DeIKz6ykJJEgG2LnSKWy8NCtR3mIBgon8ynNCESBXTal8J4u5qMVLmZYNy9q5Do/iQE7o0 vHKwT8xunEs8D3D/JM+fS4t04JzZ5QMInHSOwm4203BnNqPF1lLx4GPR4DNuaJaTJtjCb/ S8KVNsMswl88DRoWZ29ALtslHerzzGRyO8twWY6Jrow9+yXP9BKysOoFsa2spl6tekMEiY j2g23LYQu9LcaMPtIbAudHgRjJKS11XQwr3Rs8Smz9pKOdN7BEcDUY0S9UpreHtH+hLRup 9uR/bTpgcbGicP656dS/sDfam7QBnKMFPDszbYhFhjC3+wdnTO2PKEm6mf8Tmw== 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 4Ys6y82f34zWgX; Mon, 10 Feb 2025 14:53:04 +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 51AEr41r028713; Mon, 10 Feb 2025 14:53:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 51AEr4fV028710; Mon, 10 Feb 2025 14:53:04 GMT (envelope-from git) Date: Mon, 10 Feb 2025 14:53:04 GMT Message-Id: <202502101453.51AEr4fV028710@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Bjoern A. Zeeb" Subject: git: 4f9bec61d85a - stable/14 - ifconfig: make -vht work List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 4f9bec61d85a8092f2256808557f3df62072876e Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=4f9bec61d85a8092f2256808557f3df62072876e commit 4f9bec61d85a8092f2256808557f3df62072876e Author: Bjoern A. Zeeb AuthorDate: 2025-01-04 16:58:49 +0000 Commit: Bjoern A. Zeeb CommitDate: 2025-02-10 14:52:12 +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 Reviewed by: adrian, emaste Differential Revision: https://reviews.freebsd.org/D48326 (cherry picked from commit 42410c6d682c4e00ce6147f99b51a55f6f3fe075) --- 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),