Browse Source

qcacld-3.0: Add ini parm to control SAP restart on channel avoid indication

Restart SAP(P2P_GO) only if ini parameter, sap_restart_on_ch_avoid,
is set. By default its enabled.

Change-Id: I0aee79ba2d5e0cfa8a7b0c7b1901c61614944338
CRs-Fixed: 2023854
Hanumanth Reddy Pothula 8 years ago
parent
commit
9c161dd8a7
3 changed files with 44 additions and 5 deletions
  1. 24 0
      core/hdd/inc/wlan_hdd_cfg.h
  2. 10 0
      core/hdd/src/wlan_hdd_cfg.c
  3. 10 5
      core/hdd/src/wlan_hdd_main.c

+ 24 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -8743,6 +8743,29 @@ enum dot11p_mode {
 #define CFG_SAP_INTERNAL_RESTART_MAX     (1)
 #define CFG_SAP_INTERNAL_RESTART_DEFAULT (1)
 
+/*
+ * <ini>
+ * sap_restart_on_ch_avoid - control SAP restart on channel avoidance
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to control SAP restart on channel avoidance
+ * sap_restart_on_ch_avoid=0: Don't restart SAP on channel avoidance indication
+ * sap_restart_on_ch_avoid=1: restart SAP on channel avoidance indication
+ *
+ * Related: None
+ *
+ * Supported Feature: channel avoidance
+ *
+ * Usage: Internal/External
+ *
+ * </ini>
+ */
+#define CFG_SAP_RESTART_ON_CH_AVOID_NAME    "sap_restart_on_ch_avoid"
+#define CFG_SAP_RESTART_ON_CH_AVOID_MIN     (0)
+#define CFG_SAP_RESTART_ON_CH_AVOID_MAX     (1)
+#define CFG_SAP_RESTART_ON_CH_AVOID_DEFAULT (1)
 /*
  * This parameter will avoid updating ap_sta_inactivity from hostapd.conf
  * file. If a station does not send anything in ap_max_inactivity seconds, an
@@ -11057,6 +11080,7 @@ struct hdd_config {
 	enum hdd_wext_control standard_wext_control;
 	enum hdd_wext_control private_wext_control;
 	bool sap_internal_restart;
+	bool sap_restart_on_ch_avoid;
 	uint8_t is_per_roam_enabled;
 	uint32_t per_roam_high_rate_threshold;
 	uint32_t per_roam_low_rate_threshold;

+ 10 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -4223,6 +4223,13 @@ struct reg_table_entry g_registry_table[] = {
 		CFG_SAP_INTERNAL_RESTART_MIN,
 		CFG_SAP_INTERNAL_RESTART_MAX),
 
+	REG_VARIABLE(CFG_SAP_RESTART_ON_CH_AVOID_NAME, WLAN_PARAM_Integer,
+		struct hdd_config, sap_restart_on_ch_avoid,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_SAP_RESTART_ON_CH_AVOID_DEFAULT,
+		CFG_SAP_RESTART_ON_CH_AVOID_MIN,
+		CFG_SAP_RESTART_ON_CH_AVOID_MAX),
+
 	REG_VARIABLE(CFG_PER_ROAM_ENABLE_NAME, WLAN_PARAM_Integer,
 		struct hdd_config, is_per_roam_enabled,
 		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
@@ -5940,6 +5947,9 @@ void hdd_cfg_print(hdd_context_t *pHddCtx)
 	hdd_debug("Name = [%s] Value = [%u]",
 		CFG_AUTO_DETECT_POWER_FAIL_MODE_NAME,
 		pHddCtx->config->auto_pwr_save_fail_mode);
+	hdd_debug("Name = [%s] Value = [%d]",
+		CFG_SAP_RESTART_ON_CH_AVOID_NAME,
+		pHddCtx->config->sap_restart_on_ch_avoid);
 
 	hdd_per_roam_print_ini_config(pHddCtx);
 	hdd_he_print_ini_config(pHddCtx);

+ 10 - 5
core/hdd/src/wlan_hdd_main.c

@@ -7097,13 +7097,18 @@ void hdd_ch_avoid_cb(void *hdd_context, void *indi_param)
 	 * first update the unsafe channel list to the platform driver and
 	 * send the avoid freq event to the application
 	 */
-	wlan_hdd_send_avoid_freq_event(hdd_ctxt, &hdd_avoid_freq_list);
+	if (hdd_ctxt->config->sap_restart_on_ch_avoid) {
+		wlan_hdd_send_avoid_freq_event(hdd_ctxt, &hdd_avoid_freq_list);
 
-	if (!hdd_ctxt->unsafe_channel_count) {
-		hdd_debug("no unsafe channels - not restarting SAP");
-		return;
+		if (!hdd_ctxt->unsafe_channel_count) {
+			hdd_info("no unsafe channels - not restarting SAP");
+			return;
+		}
+
+		hdd_unsafe_channel_restart_sap(hdd_ctxt);
 	}
-	hdd_unsafe_channel_restart_sap(hdd_ctxt);
+
+	return;
 }
 
 /**