From nobody Fri Nov 03 21:08:24 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 4SMYHr3pRRz50NVQ; Fri, 3 Nov 2023 21:08:24 +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 4SMYHr3LWbz3MtD; Fri, 3 Nov 2023 21:08:24 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699045704; 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=fad37BNzTjkFBfreIsrot4WxMDS0DODz809ocRVfQX0=; b=Aj3yTua03SN6QYd0c6HzH9h5CUQeMzHnjveE8tFoSlwjr/RACeSk/k7o7ZS1alkd278lSl LyikDPROfYNcy5Al3Hc3bgWH/ope4V3ksUd9ycwYCCMxCunNflPCbVfFJj2z9PEvaeeplZ ZtiXjf9xH2BHjTpjCuYm3fYOUXc1QnkhWfGJ5WxM+Cu9ALCwV3nG41A3K294vXADLsr8Im y4qOE8FRhSSMt7E26m0EfcwjkOQVp0R3in9veyiXRuV/TLTz3PeidN1SoNNrdm2NioX676 +uSJa8HO4/r0cnxG8TmjbwGzF1xUOGnQp8aIIoZ4lQPtbE5mKWfeF2aN0JE7SQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1699045704; 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=fad37BNzTjkFBfreIsrot4WxMDS0DODz809ocRVfQX0=; b=vD4ba0s6zrUizbaJxTjoBfVPWTE/bx1pOL4f38DeMEL1uQkfPgWoSeQ2uxZoXav1tyELor JHsr0ZiC1hMlYj0uZx2Ha7e7qOGbMqEFpp8CzOwRsZak8gwP2YZaxnQc/aim/1ekk8IQxD DCDSKtnofTTCOdNvcOgPQIVYDYDhhAVSgzWyTZ4hfGr73OMwKQjMF5Ul5EpH0pCUcvbkwy xqnLjzRj4GPJ2tLru7CW4ewbcNYPP5o0uMxjC1oiZJi9Kutjl8HbnWbyU5q4ywk/2kn3uv m6sYsmHLwhPN2cfTpRfU4OaxBkJo6NNHZZR/JvI6YWVj6QcJIPhqdbKIFyw7Gw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1699045704; a=rsa-sha256; cv=none; b=wE7v++FKACO62iH5P/7dzH1apL+FpAWQJP5s6MM3nFD/T36HqYxBXjzqEDYJu1XMjwox6F wXIfjn1RakvWXnkoDuMa2MZeKI1t452WeMU02SsFuBLszNgC9EabKH85JzRE1iCMxxV0AA yAeKbAFx+OGCw3Kmy+Pc/dYpgJLprXYkCFiMzZ6byooZUIhsT8RTg92gGudmazqJCWYIDe LfpLEEmTtts+DVnGkOEreOAQxBCRa5yKU/Z0ptyTH8lkNk7KyTtxsCxFGrSD8bXQ6ZNY/f q5CK1gZ0qBygC6U72L6HnW6X3NdcJ/610gvXN+KNgbs9ajVH2Sw7po/RLwfF0A== 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 4SMYHr2QypzWLs; Fri, 3 Nov 2023 21:08:24 +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 3A3L8ONF081175; Fri, 3 Nov 2023 21:08:24 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3A3L8OvQ081172; Fri, 3 Nov 2023 21:08:24 GMT (envelope-from git) Date: Fri, 3 Nov 2023 21:08:24 GMT Message-Id: <202311032108.3A3L8OvQ081172@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: 78ca45df3105 - main - 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/main X-Git-Reftype: branch X-Git-Commit: 78ca45df310563ca46448a124674e0542aab2e31 Auto-Submitted: auto-generated The branch main has been updated by bz: URL: https://cgit.FreeBSD.org/src/commit/?id=78ca45df310563ca46448a124674e0542aab2e31 commit 78ca45df310563ca46448a124674e0542aab2e31 Author: Bjoern A. Zeeb AuthorDate: 2023-10-27 20:41:43 +0000 Commit: Bjoern A. Zeeb CommitDate: 2023-11-03 21:08:03 +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 MFC after: 3 days Reviewed by: cc Differential Revision: https://reviews.freebsd.org/D42425 --- 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