diff mbox series

[1/2] wifi: mac80211: track obss color bitmap

Message ID 774ab129159408a3f3e04b7e662cb559cf087c48.1680553706.git.yi-chia.hsieh@mediatek.com (mailing list archive)
State Changes Requested
Delegated to: Johannes Berg
Headers show
Series [1/2] wifi: mac80211: track obss color bitmap | expand

Commit Message

Yi-Chia Hsieh April 3, 2023, 9:04 p.m. UTC
Track OBSS BSS colors on checking OBSS Beacons and report used color bitmap to
hostapd when collide.

Signed-off-by: Yi-Chia Hsieh <yi-chia.hsieh@mediatek.com>
---
 include/net/mac80211.h | 1 +
 net/mac80211/rx.c      | 4 +++-
 2 files changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 219fd15893b0..f003e0dbc7c4 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -749,6 +749,7 @@  struct ieee80211_bss_conf {
 
 	bool color_change_active;
 	u8 color_change_color;
+	u64 used_color_bitmap;
 
 	bool vht_su_beamformer;
 	bool vht_su_beamformee;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index f7fdfe710951..e4a60992e4eb 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -3264,9 +3264,11 @@  ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx)
 
 		color = le32_get_bits(he_oper->he_oper_params,
 				      IEEE80211_HE_OPERATION_BSS_COLOR_MASK);
+		bss_conf->used_color_bitmap |= BIT_ULL(color);
+
 		if (color == bss_conf->he_bss_color.color)
 			ieee80211_obss_color_collision_notify(&rx->sdata->vif,
-							      BIT_ULL(color),
+							      bss_conf->used_color_bitmap,
 							      GFP_ATOMIC);
 	}
 }