From nobody Thu Nov 30 00:38:19 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 4Sgck33HNkz52VFN; Thu, 30 Nov 2023 00:38:19 +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 4Sgck32jkFz3MsK; Thu, 30 Nov 2023 00:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701304699; 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=3DIwwxr30V83yHegGsJk0+dwipTwFGZbM8XjxptSDkk=; b=ferMeVsF1DSvUOg0lWmTukJVYuh8cl6pHutWS96nZJGFc4YEmi4DxoxPh3QTvqFFc9ySV0 y9iQ+Ekoybv32ZWKKDdJ5ZJPlQSn4nuUyrN1KBckI95G9+C50OpbiNHPAA/H+HFXom6pCT i4Pgju5Kial7YyIKYTz2qHiWZ0/Vx/BcWB1kHgT13sNE9Lj4mSUnl2Js4ArYOIIhU+RL2j /lo0iASLURtVMaMzPTaOj3/V/dFELcqKlFFXD/LwCX2notZCtTrobE7TYIyig2DSny1+BR 2YfgQUTnL53ybsF9UW+hCOa6+oBOV47vCFBAP6+ZnbVLdn33tyC5jSuPPygK9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701304699; 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=3DIwwxr30V83yHegGsJk0+dwipTwFGZbM8XjxptSDkk=; b=IEMhcl0WCXFGMtUxzYrRMkche4tjiRH3al8ZGpLk3MzT5TZu2q18j1tz/iMKGNZyiNadO7 oPMNxUD8pGc4xnKf62BxJQ+lsYaMZpxI6VqoWETPw2IuaLAYAIZekiMoZlKUw1j9kQU8oJ XyndlAiz+b/JAjaxsLbszf+YwIsCWd/kaszHU10borleSezwbDqc41jugXMKQ0Tu0svnDi mS0zqR26a+6kcOZ+d5kGGFSVNgmLId7wlggmLoEslOclKSn1yGvk6VdmFlT+RHQPYyRJ8R pV/gAmfbu2TyCSJMKJl4ONpaAf5PlRx5AmwqGi7U0KysIhwG1EG07U8PDtWMtQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701304699; a=rsa-sha256; cv=none; b=HaRLkwxnrPZ8ZDo3/MDC6wGX4OWblyEEX8fYP3M4LFmJGEGqRrSYAhZdQ7l5IbVygRZDRk NIYw1xsqUedfPYjCAJmp4VW/76oLAq2JCOFv8uEpsIFatfUwGcr74Jg3VgmjGSzpdlT1+h FppDK3LusSd7JoNMm+Ebf08AOkSP2hKIAg4ckmAUeBTDGGe3VLWwDu/dKvsTPT0O/Heiup IFxfYD0xrNS0ShNvKOKcBThxkfzvg3yfogAWZEIhVyg9IQ1oFjumVgCZWIw7M9tdVFD9xI t5FYMznrjcKEHYR0Z1Ku4Had2g2NjWHpvSf3Mluo7KrpZN717SXxqX1gdtP4rA== 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 4Sgck31pMNzD6M; Thu, 30 Nov 2023 00:38:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3AU0cJei052079; Thu, 30 Nov 2023 00:38:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3AU0cJRr052076; Thu, 30 Nov 2023 00:38:19 GMT (envelope-from git) Date: Thu, 30 Nov 2023 00:38:19 GMT Message-Id: <202311300038.3AU0cJRr052076@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: 861bf0606a5b - stable/14 - LinuxKPI: 802.11: deal with scan_ie_len 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/stable/14 X-Git-Reftype: branch X-Git-Commit: 861bf0606a5b13ecc796c278c57b5e51830d68ba Auto-Submitted: auto-generated The branch stable/14 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=861bf0606a5b13ecc796c278c57b5e51830d68ba commit 861bf0606a5b13ecc796c278c57b5e51830d68ba Author: Bjoern A. Zeeb AuthorDate: 2023-10-27 20:41:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-30 00:36:57 +0000 LinuxKPI: 802.11: deal with scan_ie_len We only need to reserve the extra space for DSSS if NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES is set, so add the conditional. Also add checks in case scan_ie_len will grow beyond the maximum. Given this is currently unlikely, leave the cleanup for later as some other restructuring should be done first. Sponsored by: The FreeBSD Foundation Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D42425 (cherry picked from commit 78ca45df310563ca46448a124674e0542aab2e31) --- sys/compat/linuxkpi/common/src/linux_80211.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c index aba7e0e961a6..ffda3c5693cd 100644 --- a/sys/compat/linuxkpi/common/src/linux_80211.c +++ b/sys/compat/linuxkpi/common/src/linux_80211.c @@ -3919,20 +3919,30 @@ linuxkpi_ieee80211_ifattach(struct ieee80211_hw *hw) lhw->scan_ie_len = 2 + IEEE80211_RATE_SIZE; if (lhw->max_rates > IEEE80211_RATE_SIZE) lhw->scan_ie_len += 2 + (lhw->max_rates - IEEE80211_RATE_SIZE); - /* - * net80211 does not seem to support the DSSS Parameter Set but some of - * the drivers insert it so calculate the extra fixed space in. - */ - lhw->scan_ie_len += 2 + 1; + + if (hw->wiphy->features & NL80211_FEATURE_DS_PARAM_SET_IE_IN_PROBES) { + /* + * net80211 does not seem to support the DSSS Parameter Set but + * some of the drivers insert it so calculate the extra fixed + * space in. + */ + lhw->scan_ie_len += 2 + 1; + } /* Reduce the max_scan_ie_len "left" by the amount we consume already. */ - if (hw->wiphy->max_scan_ie_len > 0) + if (hw->wiphy->max_scan_ie_len > 0) { + if (lhw->scan_ie_len > hw->wiphy->max_scan_ie_len) + goto err; hw->wiphy->max_scan_ie_len -= lhw->scan_ie_len; + } if (bootverbose) ieee80211_announce(ic); return (0); +err: + IMPROVE("TODO FIXME CLEANUP"); + return (-EAGAIN); } void