From ee8c401bdfa08c6b98fb5b016841db5603ba4059 Mon Sep 17 00:00:00 2001
From: Lavanya Suresh <lavaks@codeaurora.org>
Date: Wed, 23 Sep 2020 21:54:34 +0530
Subject: [PATCH] ath11k: add support to enable/disable bss color collision
 detection

Added module param to enable or disable bss color collision detection.
By default, it is disabled. This config should be changed before VAP
bringup only.


Signed-off-by: Lavanya Suresh <lavaks@codeaurora.org>
---
 drivers/net/wireless/ath/ath11k/mac.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

--- a/drivers/net/wireless/ath/ath11k/mac.c
+++ b/drivers/net/wireless/ath/ath11k/mac.c
@@ -48,6 +48,10 @@ extern unsigned int ath11k_frame_mode;
 	.max_power              = 30, \
 }
 
+unsigned int color_collision_enable = 0;
+module_param_named(color_collision_detect, color_collision_enable, uint, 0644);
+MODULE_PARM_DESC(color_collision_detect, "BSS color collision detecion: 0-disable 1-enable");
+
 static const struct ieee80211_channel ath11k_2ghz_channels[] = {
 	CHAN2G(1, 2412, 0),
 	CHAN2G(2, 2417, 0),
@@ -3138,7 +3142,8 @@ static void ath11k_mac_op_bss_info_chang
 				ar, arvif->vdev_id, info->he_bss_color.color,
 				ATH11K_BSS_COLOR_COLLISION_DETECTION_AP_PERIOD_MS,
 				!arvif->vif->multiple_bssid.non_transmitted ?
-					info->he_bss_color.enabled : 0);
+				(info->he_bss_color.enabled & color_collision_enable) : 0);
+
 			if (ret)
 				ath11k_warn(ar->ab, "failed to set bss color collision on vdev %i: %d\n",
 					    arvif->vdev_id,  ret);
