From nobody Tue Jan 31 23:05:00 2023 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 4P60xm4lNzz3cp5W; Tue, 31 Jan 2023 23:05:00 +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 4P60xm4FyLz40Pt; Tue, 31 Jan 2023 23:05:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675206300; 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=sZvYvDnJLZPFqOgSicibOEklHCZuumFu4SVLuRn/yjk=; b=eF2n3mg44Q1vSXi3w9qeViOFjebwhX3/cmcdqIHDrdovTO85cJujIeupXz+PT7DgO1LNTk 8FIKf+xWDeLGVt6jqYgyM5avMQep8vMU6VF8dg3dZSzC4eBjfLZd0u/2UgTjul1x/Aomjd rJvIlccBGEkXU0rEUKDHoCwhgFYCQftHFKUPMvm2cgep6pxPTwcM+NHqxl+H0+7ua/ED3I ZHvYO5SfczP1/p5D5DhF0LOmB2t1WJFFZ/61EubTYMFPvROag2NuXwx+qBD94CVRBeTs97 Hh1g1vEo2SVwqR2zlIMl9wdURaZeZFSqVoXQcWTydg/71TFUaSLcogFafs1tmQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675206300; 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=sZvYvDnJLZPFqOgSicibOEklHCZuumFu4SVLuRn/yjk=; b=eeDWqFOrhlXoNqLMr56fe+9KQ+E9cEjnLwXKKCFwJVns7abvh1Th69OkDN9Ml3jdij6bEL gnzC44nLltgexsbNwujs/rb3B6pQkrz67qoxFu8bbxDDI7AF6FxnXrIta9+IAn1Wbh2Q8f 8UzefNkQlFSp3HZsSKE/qIuFxxklhtkmz2qtDZRjF388Unxwmx3eRhfUUJiOUxWO0OaEG1 XYzuyxl6QO1oRIbUDEDLlUVQn4gv6qVESiYkR/+HwMqmuJL9rHhDL6qt2LHvNc8Fog4c3F lTRcU37Tr/tig8Co0Yi1byrRO98xbkdWzf530V9/dmURcfzYTs4X7u+FKqJGEg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675206300; a=rsa-sha256; cv=none; b=rmrdYVPMgUiLTR2diVLPtjjPavEE23btGTHrqEUuF438nCrTz+1fR3UNs7nr+8fOvTW2iR HnBBaLCrpgBC1zRRJyi1eOw9Mp45RqJvDQoPoJb2QIVZzyUgW3I1YZ+OFKpp046eOQqEOa hjKnvt1v641ud2Gxn7nGbCGtA50Q+XGbLQTd9by29fFPhtoR3bNb0Ntyy3Gp16r10DChuw Tv0Ymka6OAbd9WuD+WWQnrZ3f3o5VNQEp5HW75CAnJkO63eCiaUnJ45a8l6Q68kWGaA61i RhjnCB5PMfpWmPsx0uL3KjzsXTwkGhllnNbbOcxTj0uT63II7241BtwXcHO+Mw== 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 4P60xm3JMHz16Ls; Tue, 31 Jan 2023 23:05:00 +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 30VN50c0081097; Tue, 31 Jan 2023 23:05:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30VN50Rc081096; Tue, 31 Jan 2023 23:05:00 GMT (envelope-from git) Date: Tue, 31 Jan 2023 23:05:00 GMT Message-Id: <202301312305.30VN50Rc081096@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: 3dd980267f4e - main - LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: 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/main X-Git-Reftype: branch X-Git-Commit: 3dd980267f4e53df259eb6d322e7332a8bc5bb0a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=3dd980267f4e53df259eb6d322e7332a8bc5bb0a commit 3dd980267f4e53df259eb6d322e7332a8bc5bb0a Author: Bjoern A. Zeeb AuthorDate: 2023-01-31 23:00:28 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-01-31 23:00:28 +0000 LinuxKPI: 802.11: enhance lkpi_scan_ies_add() for HT and VHT Add code (currently disabled by #ifdef) for HT and VHT to lkpi_scan_ies_add(). Switch to a local variable for ic given the new code also needs the value. Sponsored by: The FreeBSD Foundation MFC after: 3 days --- sys/compat/linuxkpi/common/src/linux_80211.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index cf0c1755c499..491002cd6df5 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -2484,11 +2484,13 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, { struct ieee80211_supported_band *supband; struct linuxkpi_ieee80211_channel *channels; + struct ieee80211com *ic; const struct ieee80211_channel *chan; const struct ieee80211_rateset *rs; uint8_t *pb; int band, i; + ic = vap->iv_ic; for (band = 0; band < NUM_NL80211_BANDS; band++) { if ((band_mask & (1 << band)) == 0) continue; @@ -2509,7 +2511,7 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, if (channels[i].flags & IEEE80211_CHAN_DISABLED) continue; - chan = ieee80211_find_channel(vap->iv_ic, + chan = ieee80211_find_channel(ic, channels[i].center_freq, 0); if (chan != NULL) break; @@ -2520,10 +2522,31 @@ lkpi_scan_ies_add(uint8_t *p, struct ieee80211_scan_ies *scan_ies, continue; pb = p; - rs = ieee80211_get_suprates(vap->iv_ic, chan); /* calls chan2mode */ + rs = ieee80211_get_suprates(ic, chan); /* calls chan2mode */ p = ieee80211_add_rates(p, rs); p = ieee80211_add_xrates(p, rs); +#if defined(LKPI_80211_HT) + if ((vap->iv_flags_ht & IEEE80211_FHT_HT) != 0) { + struct ieee80211_channel *c; + + c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, + vap->iv_flags_ht); + p = ieee80211_add_htcap_ch(p, vap, c); + } +#endif +#if defined(LKPI_80211_VHT) + if ((vap->iv_vht_flags & IEEE80211_FVHT_VHT) != 0) { + struct ieee80211_channel *c; + + c = ieee80211_ht_adjust_channel(ic, ic->ic_curchan, + vap->iv_flags_ht); + c = ieee80211_vht_adjust_channel(ic, c, + vap->iv_vht_flags); + p = ieee80211_add_vhtcap_ch(p, vap, c); + } +#endif + scan_ies->ies[band] = pb; scan_ies->len[band] = p - pb; }