From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4BE3517557B; Wed, 3 Jul 2024 11:14:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720005245; cv=none; b=VO8jmZfEfNEuFWc/pZ/Puu/12bOul7ULrYhiaHAmnhIjmrzQXVjC/haPdmVOVqjtKM5qWtkiCO12UWKnFB6Z6Qf/mLv9Tur//jyD87MCgB4ZeJo4OnJmjKMr4QUE2AjePjPoo55980tCKnOwlCm3Vx65X2FzO4tg24SBoNCCU30= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720005245; c=relaxed/simple; bh=2BJ3p6lg3HWSdVQZsGD8iGSiSs40dHcNd7JsnSF2S4E=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=t1uPzUgikYtXrxzh7Upp7nEColK+3saLU7btMSWw0wzLUKQEq040QE1cNjKsPUXNX5DmNmTSo3vAOeFAv00zcsGTMv4Fz1KmxnFWDUFXyHnvy/YVmHy2Q2jAPuxBEaZkOal1e5UIVP1dBWIozi9vHRIScYOC1zrOWi6wi2uVw5E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YJNyIcVT; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="YJNyIcVT" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BC026C2BD10; Wed, 3 Jul 2024 11:14:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720005245; bh=2BJ3p6lg3HWSdVQZsGD8iGSiSs40dHcNd7JsnSF2S4E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YJNyIcVTtCjC89x1Qbvy0HlO0Io+xprxrVg/ppF7TRB1OVBnFeNPj6Pr27wE6uQTN HRB25qG4gtERQJ3eHhfTPrFNU01hwfi9t6JjdV68urmHSl7r6X0rbN+rrJuSdz63M5 x14feRjIkGRfWh/5dJOaODnRrtooeUHrjWOB6/Ck= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Lingbo Kong , Johannes Berg , Sasha Levin Subject: [PATCH 5.15 009/356] wifi: mac80211: correctly parse Spatial Reuse Parameter Set element Date: Wed, 3 Jul 2024 12:35:45 +0200 Message-ID: <20240703102913.453504973@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240703102913.093882413@linuxfoundation.org> References: <20240703102913.093882413@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Lingbo Kong [ Upstream commit a26d8dc5227f449a54518a8b40733a54c6600a8b ] Currently, the way of parsing Spatial Reuse Parameter Set element is incorrect and some members of struct ieee80211_he_obss_pd are not assigned. To address this issue, it must be parsed in the order of the elements of Spatial Reuse Parameter Set defined in the IEEE Std 802.11ax specification. The diagram of the Spatial Reuse Parameter Set element (IEEE Std 802.11ax -2021-9.4.2.252). ------------------------------------------------------------------------- | | | | |Non-SRG| SRG | SRG | SRG | SRG | |Element|Length| Element | SR |OBSS PD|OBSS PD|OBSS PD| BSS |Partial| | ID | | ID |Control| Max | Min | Max |Color | BSSID | | | |Extension| | Offset| Offset|Offset |Bitmap|Bitmap | ------------------------------------------------------------------------- Fixes: 1ced169cc1c2 ("mac80211: allow setting spatial reuse parameters from bss_conf") Signed-off-by: Lingbo Kong Link: https://msgid.link/20240516021854.5682-3-quic_lingbok@quicinc.com Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin --- net/mac80211/he.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/mac80211/he.c b/net/mac80211/he.c index c05af7018f79f..c730ce5132cbc 100644 --- a/net/mac80211/he.c +++ b/net/mac80211/he.c @@ -223,15 +223,21 @@ ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif, if (!he_spr_ie_elem) return; + + he_obss_pd->sr_ctrl = he_spr_ie_elem->he_sr_control; data = he_spr_ie_elem->optional; if (he_spr_ie_elem->he_sr_control & IEEE80211_HE_SPR_NON_SRG_OFFSET_PRESENT) - data++; + he_obss_pd->non_srg_max_offset = *data++; + if (he_spr_ie_elem->he_sr_control & IEEE80211_HE_SPR_SRG_INFORMATION_PRESENT) { - he_obss_pd->max_offset = *data++; he_obss_pd->min_offset = *data++; + he_obss_pd->max_offset = *data++; + memcpy(he_obss_pd->bss_color_bitmap, data, 8); + data += 8; + memcpy(he_obss_pd->partial_bssid_bitmap, data, 8); he_obss_pd->enable = true; } } -- 2.43.0