From nobody Wed Nov 29 16:38:53 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 4SgQ4s6YgDz52ww6; Wed, 29 Nov 2023 16:38:53 +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 4SgQ4s4Bhtz3Kwm; Wed, 29 Nov 2023 16:38:53 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275933; 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=VuOEM46VV+TAKzt2eoUOXkCBf/mnCeCYarnYR0Eg5zw=; b=OYhU2KJ63Q82ktXUu6Ce5Ie7bobdbV/OSRlJO5kiuR5iN8kQ57KAl08mHZ/3LAmGpjMtto Ns3OXOU7k3hnhnkT/oX3krxUSeM4U+kZzFDahnxM1bvSN8WMp+a5A1bZh6+Daa67gWjCpV TAqz/Skw9uf3Q9L4efhqB+I3aAJpKQGdbM/dl/OmsE7Nj7CWbUVdnqR6cae7F+OYVfodfx C2juIH8i26X15BqEG5FO7oF40i8mWuJRnAeaKakO2JuO/jod+Md4q0xN2bx4FOrv+G9+K+ yTBHWSFLnnBlU+NsPnlyxS4+g/hjhWLnCkdoLy8l8ixjbjaps7vxT5tZNqpzbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1701275933; 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=VuOEM46VV+TAKzt2eoUOXkCBf/mnCeCYarnYR0Eg5zw=; b=TyF80F3c3K50WHfLtYCQyfJDk+w6EkutMXs0sC2yNaTRil1SXBoFI/8OadaKgbbh8vmMf2 oI4Wlz5yyMXm5j0g7CRgf7prujWpR7JYxYR/YLs3PmIdXSA2gvidL9fib91e42o5vxkwS6 2GZMXr7QjWXVhNHiyL4kK453LfEBo7/LFeY2RgyzjezKj+I1ELvKSKr2RQb+0FcgiS4akO 3AwCMcPn3EG1W1yDYxVEkgjdrUBLbkQFAZ9iQpOf0D+uQNxsJNMzxlQ8x9RxXV5UWJ4N/X A6LddVjzpnJd1ukAwZZJHZ0sofm80XHHNmVFjr9Bu0x1ogk1G8SECyE2yLpLVg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1701275933; a=rsa-sha256; cv=none; b=pv/Z0IMtyg5apeAJjwEZ72DDVwZSRb/JEHDvW2mTEspOJrzR6zZArKSzySSpFXO4Osj6Ip qZPwbDWjPqAp7f5Ag5E0EZOPm/1L+PH48kpzPX3qGTn31uf7n2f5U0YQTj/AKJ8Lkq5OJ3 c/Z9gffqKvBWVMV28qrXUSVZvjYO1Mcjn78uawg0AT42zjm0KPgqCyRKdfeV+cA4IHJ9uj 9UrRzVxzvcQq+9eyy2txqcRd8wCfR9BA3ZNjUNvBIyPYuK15trpWRuGVIokDRO2ahExWeQ jXLhVncC212UN8S2j/pfAY5/vjg40GtaADrpFCsVKScnWZca2IJYU8ZcVWLcdA== 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 4SgQ4s3HDTz1Cd7; Wed, 29 Nov 2023 16:38:53 +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 3ATGcrTn047039; Wed, 29 Nov 2023 16:38:53 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3ATGcr6S047036; Wed, 29 Nov 2023 16:38:53 GMT (envelope-from git) Date: Wed, 29 Nov 2023 16:38:53 GMT Message-Id: <202311291638.3ATGcr6S047036@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: d78164c83a67 - stable/13 - 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/13 X-Git-Reftype: branch X-Git-Commit: d78164c83a672c000b01f5f5a5a45b782284fea6 Auto-Submitted: auto-generated The branch stable/13 has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=d78164c83a672c000b01f5f5a5a45b782284fea6 commit d78164c83a672c000b01f5f5a5a45b782284fea6 Author: Bjoern A. Zeeb AuthorDate: 2023-10-27 20:41:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-29 16:36:11 +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 (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 2292339ef9ba..b605cb36ad88 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