qcacld-3.0: Add a new ini item to control the INDOOR channels support

qcacld-2.0 to qcacld-3.0 propagation

Currently indoor channels are unconditionally set to
IEEE80211_CHAN_PASSIVE_SCAN in driver. Add logic to report INDOOR
channel as passive channel only when gindoor_channel_support is FALSE.

Change-Id: Iab55a394a28ff452c06c739f3fbd47506eda85eb
CRs-Fixed: 955272
diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h
index 8db4b79..0d5857f 100644
--- a/core/hdd/inc/wlan_hdd_cfg.h
+++ b/core/hdd/inc/wlan_hdd_cfg.h
@@ -3469,6 +3469,15 @@
  */
 #define CFG_RPS_RX_QUEUE_CPU_MAP_LIST_LEN 30
 
+/*
+ * Support to start sap in indoor channel
+ * Customer can config this item to enable/disable sap in indoor channel
+ * Default: Disable
+ */
+#define CFG_INDOOR_CHANNEL_SUPPORT_NAME     "gindoor_channel_support"
+#define CFG_INDOOR_CHANNEL_SUPPORT_MIN      (0)
+#define CFG_INDOOR_CHANNEL_SUPPORT_MAX      (1)
+#define CFG_INDOOR_CHANNEL_SUPPORT_DEFAULT  (0)
 
 /*---------------------------------------------------------------------------
    Type declarations
@@ -4129,6 +4138,7 @@
 #endif
 	uint32_t iface_change_wait_time;
 	enum cfg_sub_20_channel_width enable_sub_20_channel_width;
+	bool indoor_channel_support;
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))
diff --git a/core/hdd/src/wlan_hdd_cfg.c b/core/hdd/src/wlan_hdd_cfg.c
index 2b272e3..29fc5aa 100644
--- a/core/hdd/src/wlan_hdd_cfg.c
+++ b/core/hdd/src/wlan_hdd_cfg.c
@@ -3993,6 +3993,14 @@
 				 VAR_FLAGS_OPTIONAL,
 				 (void *)CFG_RPS_RX_QUEUE_CPU_MAP_LIST_DEFAULT),
 
+	REG_VARIABLE(CFG_INDOOR_CHANNEL_SUPPORT_NAME,
+		     WLAN_PARAM_Integer,
+		     struct hdd_config, indoor_channel_support,
+		     VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		     CFG_INDOOR_CHANNEL_SUPPORT_DEFAULT,
+		     CFG_INDOOR_CHANNEL_SUPPORT_MIN,
+		     CFG_INDOOR_CHANNEL_SUPPORT_MAX),
+
 	REG_VARIABLE(CFG_INTERFACE_CHANGE_WAIT_NAME, WLAN_PARAM_Integer,
 			struct hdd_config, iface_change_wait_time,
 			VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK,
diff --git a/core/hdd/src/wlan_hdd_regulatory.c b/core/hdd/src/wlan_hdd_regulatory.c
index 4a33cf8..c96f8ef 100644
--- a/core/hdd/src/wlan_hdd_regulatory.c
+++ b/core/hdd/src/wlan_hdd_regulatory.c
@@ -393,13 +393,17 @@
 
 			if (wiphy_chan->flags & IEEE80211_CHAN_DISABLED) {
 				cds_chan->state = CHANNEL_STATE_DISABLE;
-			} else if (wiphy_chan->flags &
-				   (IEEE80211_CHAN_RADAR |
-				    IEEE80211_CHAN_PASSIVE_SCAN |
-				    IEEE80211_CHAN_INDOOR_ONLY)) {
-
-				if (wiphy_chan->flags &
-				    IEEE80211_CHAN_INDOOR_ONLY)
+			} else if ((wiphy_chan->flags &
+				    (IEEE80211_CHAN_RADAR |
+				     IEEE80211_CHAN_PASSIVE_SCAN)) ||
+				   ((hdd_ctx->config->indoor_channel_support
+				     == false) &&
+				    (wiphy_chan->flags &
+				     IEEE80211_CHAN_INDOOR_ONLY))) {
+				if ((wiphy_chan->flags &
+				     IEEE80211_CHAN_INDOOR_ONLY) &&
+				    (false ==
+				     hdd_ctx->config->indoor_channel_support))
 					wiphy_chan->flags |=
 						IEEE80211_CHAN_PASSIVE_SCAN;
 				cds_chan->state = CHANNEL_STATE_DFS;