Browse Source

qcacld-3.0: Refactor six LFR INI cfg

Based on new cfg component, refactor below LFR INI cfg and remove
unused legacy codes.
 - CFG_ENABLE_LFR_SUBNET_DETECTION
 - CFG_ROAM_HO_DELAY_FOR_RX_NAME
 - CFG_MIN_DELAY_BTW_ROAM_SCAN_NAME
 - CFG_ROAM_SCAN_TRIGGER_REASON_BITMASK_NAME
 - CFG_ROAM_FT_OPEN_ENABLE_NAME
 - CFG_ROAM_FORCE_RSSI_TRIGGER_NAME

Change-Id: Iaa738c6416dffe8159b49d59fc9a514da2fbb7ff
CRs-Fixed: 2376637
Wu Gao 6 năm trước cách đây
mục cha
commit
7b0d92da77

+ 25 - 2
mlme/core/src/wlan_mlme_main.c

@@ -1345,6 +1345,20 @@ static void mlme_init_ese_cfg(struct wlan_objmgr_psoc *psoc,
 }
 #endif
 
+#ifdef FEATURE_LFR_SUBNET_DETECTION
+static void mlme_init_subnet_detection(struct wlan_objmgr_psoc *psoc,
+				       struct wlan_mlme_lfr_cfg *lfr)
+{
+	lfr->enable_lfr_subnet_detection =
+		cfg_get(psoc, CFG_LFR3_ENABLE_SUBNET_DETECTION);
+}
+#else
+static void mlme_init_subnet_detection(struct wlan_objmgr_psoc *psoc,
+				       struct wlan_mlme_lfr_cfg *lfr)
+{
+}
+#endif
+
 static void
 mlme_init_bss_load_trigger_params(struct wlan_objmgr_psoc *psoc,
 				  struct bss_load_trigger *bss_load_trig)
@@ -1366,8 +1380,6 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
 		cfg_get(psoc, CFG_LFR_ENABLE_FAST_ROAM_IN_CONCURRENCY);
 	lfr->early_stop_scan_enable =
 		cfg_get(psoc, CFG_LFR_EARLY_STOP_SCAN_ENABLE);
-	lfr->lfr3_enable_subnet_detection =
-		cfg_get(psoc, CFG_LFR3_ENABLE_SUBNET_DETECTION);
 	lfr->enable_5g_band_pref =
 		cfg_get(psoc, CFG_LFR_ENABLE_5G_BAND_PREF);
 	lfr->lfr_enabled = cfg_get(psoc, CFG_LFR_FEATURE_ENABLED);
@@ -1502,9 +1514,20 @@ static void mlme_init_lfr_cfg(struct wlan_objmgr_psoc *psoc,
 			      &neighbor_scan_chan_list_num);
 	lfr->neighbor_scan_channel_list_num =
 				(uint8_t)neighbor_scan_chan_list_num;
+	lfr->ho_delay_for_rx =
+		cfg_get(psoc, CFG_LFR3_ROAM_HO_DELAY_FOR_RX);
+	lfr->min_delay_btw_roam_scans =
+		cfg_get(psoc, CFG_LFR_MIN_DELAY_BTW_ROAM_SCAN);
+	lfr->roam_trigger_reason_bitmask =
+		cfg_get(psoc, CFG_LFR_ROAM_SCAN_TRIGGER_REASON_BITMASK);
+	lfr->enable_ftopen =
+		cfg_get(psoc, CFG_LFR_ROAM_FT_OPEN_ENABLE);
+	lfr->roam_force_rssi_trigger =
+		cfg_get(psoc, CFG_LFR_ROAM_FORCE_RSSI_TRIGGER);
 	mlme_init_roam_offload_cfg(psoc, lfr);
 	mlme_init_ese_cfg(psoc, lfr);
 	mlme_init_bss_load_trigger_params(psoc, &lfr->bss_load_trig);
+	mlme_init_subnet_detection(psoc, lfr);
 }
 
 static uint32_t

+ 186 - 30
mlme/dispatcher/inc/cfg_mlme_lfr.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -350,33 +350,6 @@
 	CFG_VALUE_OR_DEFAULT, \
 	"Set first scan bucket")
 
-/*
- * <ini>
- * gLFRSubnetDetectionEnable - Enable LFR3 subnet detection
- * @Min: 0
- * @Max: 1
- * @Default: 1
- *
- * Enable IP subnet detection during legacy fast roming version 3. Legacy fast
- * roaming could roam across IP subnets without host processors' knowledge.
- * This feature enables firmware to wake up the host processor if it
- * successfully determines change in the IP subnet. Change in IP subnet could
- * potentially cause disruption in IP connnectivity if IP address is not
- * refreshed.
- *
- * Related: None
- *
- * Supported Feature: Roaming
- *
- * Usage: External
- *
- * </ini>
- */
-#define CFG_LFR3_ENABLE_SUBNET_DETECTION CFG_INI_BOOL( \
-	"gLFRSubnetDetectionEnable", \
-	1, \
-	"Set early stop scan")
-
 /*
  * <ini>
  * gtraffic_threshold - Dense traffic threshold
@@ -1920,6 +1893,151 @@
 			CFG_VALUE_OR_DEFAULT, \
 			"bss load sampling time")
 
+/*
+ * <ini>
+ * ho_delay_for_rx - Delay hand-off (in msec) by this duration to receive
+ * pending rx frames from current BSS
+ * @Min: 0
+ * @Max: 200
+ * @Default: 0
+ *
+ * For LFR 3.0 roaming scenario, once roam candidate is found, firmware
+ * waits for minimum this much duration to receive pending rx frames from
+ * current BSS before switching to new channel for handoff to new AP.
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_LFR3_ROAM_HO_DELAY_FOR_RX CFG_INI_UINT( \
+	"ho_delay_for_rx", \
+	0, \
+	200, \
+	0, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Delay Hand-off by this duration to receive")
+
+/*
+ * <ini>
+ * min_delay_btw_roam_scans - Min duration (in sec) allowed btw two
+ * consecutive roam scans
+ * @Min: 0
+ * @Max: 60
+ * @Default: 10
+ *
+ * Roam scan is not allowed if duration between two consecutive
+ * roam scans is less than this time.
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_LFR_MIN_DELAY_BTW_ROAM_SCAN CFG_INI_UINT( \
+	"min_delay_btw_roam_scans", \
+	0, \
+	60, \
+	10, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Min duration")
+
+/*
+ * <ini>
+ * roam_trigger_reason_bitmask - Contains roam_trigger_reasons
+ * @Min: 0
+ * @Max: 0xFFFFFFFF
+ * @Default: 0x10DA
+ *
+ * Bitmask containing roam_trigger_reasons for which
+ * min_delay_btw_roam_scans constraint should be applied.
+ * Currently supported bit positions are as follows:
+ * Bit 0 is reserved in the firmware.
+ * WMI_ROAM_TRIGGER_REASON_PER - 1
+ * WMI_ROAM_TRIGGER_REASON_BMISS - 2
+ * WMI_ROAM_TRIGGER_REASON_LOW_RSSI - 3
+ * WMI_ROAM_TRIGGER_REASON_HIGH_RSSI - 4
+ * WMI_ROAM_TRIGGER_REASON_PERIODIC - 5
+ * WMI_ROAM_TRIGGER_REASON_MAWC - 6
+ * WMI_ROAM_TRIGGER_REASON_DENSE - 7
+ * WMI_ROAM_TRIGGER_REASON_BACKGROUND - 8
+ * WMI_ROAM_TRIGGER_REASON_FORCED - 9
+ * WMI_ROAM_TRIGGER_REASON_BTM - 10
+ * WMI_ROAM_TRIGGER_REASON_UNIT_TEST - 11
+ * WMI_ROAM_TRIGGER_REASON_BSS_LOAD - 12
+ * WMI_ROAM_TRIGGER_REASON_MAX - 13
+ *
+ * For Ex: 0xDA (PER, LOW_RSSI, HIGH_RSSI, MAWC, DENSE)
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_LFR_ROAM_SCAN_TRIGGER_REASON_BITMASK CFG_INI_UINT( \
+	"roam_trigger_reason_bitmask", \
+	0, \
+	0xFFFFFFFF, \
+	0x10DA, \
+	CFG_VALUE_OR_DEFAULT, \
+	"Contains roam_trigger_reasons")
+
+/*
+ * <ini>
+ * enable_ftopen - enable/disable FT open feature
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This INI is used to enable/disable FT open feature
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_LFR_ROAM_FT_OPEN_ENABLE CFG_INI_BOOL( \
+	"enable_ftopen", \
+	1, \
+	"enable/disable FT open feature")
+
+/*
+ * <ini>
+ * roam_force_rssi_trigger - To force RSSI trigger
+ * irrespective of channel list type
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * This ini is used to set roam scan mode
+ * WMI_ROAM_SCAN_MODE_RSSI_CHANGE, irrespective of whether
+ * channel list type is CHANNEL_LIST_STATIC or not
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_LFR_ROAM_FORCE_RSSI_TRIGGER CFG_INI_BOOL( \
+	"roam_force_rssi_trigger", \
+	1, \
+	"To force RSSI trigger")
+
 #ifdef WLAN_FEATURE_ROAM_OFFLOAD
 /*
  * <ini>
@@ -1975,6 +2093,39 @@
 #define LFR_ESE_ALL
 #endif
 
+#ifdef FEATURE_LFR_SUBNET_DETECTION
+/*
+ * <ini>
+ * gLFRSubnetDetectionEnable - Enable LFR3 subnet detection
+ * @Min: 0
+ * @Max: 1
+ * @Default: 1
+ *
+ * Enable IP subnet detection during legacy fast roming version 3. Legacy fast
+ * roaming could roam across IP subnets without host processors' knowledge.
+ * This feature enables firmware to wake up the host processor if it
+ * successfully determines change in the IP subnet. Change in IP subnet could
+ * potentially cause disruption in IP connnectivity if IP address is not
+ * refreshed.
+ *
+ * Related: None
+ *
+ * Supported Feature: Roaming
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_LFR3_ENABLE_SUBNET_DETECTION CFG_INI_BOOL( \
+	"gLFRSubnetDetectionEnable", \
+	1, \
+	"Enable LFR3 subnet detection")
+
+#define LFR_SUBNET_DETECTION_ALL CFG(CFG_LFR3_ENABLE_SUBNET_DETECTION)
+#else
+#define LFR_SUBNET_DETECTION_ALL
+#endif
+
 #define CFG_LFR_ALL \
 	CFG(CFG_LFR_MAWC_ROAM_ENABLED) \
 	CFG(CFG_LFR_MAWC_ROAM_TRAFFIC_THRESHOLD) \
@@ -1988,7 +2139,6 @@
 	CFG(CFG_LFR_EARLY_STOP_SCAN_MIN_THRESHOLD) \
 	CFG(CFG_LFR_EARLY_STOP_SCAN_MAX_THRESHOLD) \
 	CFG(CFG_LFR_FIRST_SCAN_BUCKET_THRESHOLD) \
-	CFG(CFG_LFR3_ENABLE_SUBNET_DETECTION) \
 	CFG(CFG_LFR_ROAM_DENSE_TRAFFIC_THRESHOLD) \
 	CFG(CFG_LFR_ROAM_DENSE_RSSI_THRE_OFFSET) \
 	CFG(CFG_LFR_ROAM_DENSE_MIN_APS) \
@@ -2048,7 +2198,13 @@
 	CFG(CFG_ENABLE_BSS_LOAD_TRIGGERED_ROAM) \
 	CFG(CFG_BSS_LOAD_THRESHOLD) \
 	CFG(CFG_BSS_LOAD_SAMPLE_TIME) \
+	CFG(CFG_LFR3_ROAM_HO_DELAY_FOR_RX) \
+	CFG(CFG_LFR_MIN_DELAY_BTW_ROAM_SCAN) \
+	CFG(CFG_LFR_ROAM_SCAN_TRIGGER_REASON_BITMASK) \
+	CFG(CFG_LFR_ROAM_FT_OPEN_ENABLE) \
+	CFG(CFG_LFR_ROAM_FORCE_RSSI_TRIGGER) \
 	ROAM_OFFLOAD_ALL \
-	LFR_ESE_ALL
+	LFR_ESE_ALL \
+	LFR_SUBNET_DETECTION_ALL
 
 #endif /* CFG_MLME_LFR_H__ */

+ 14 - 2
mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -1221,7 +1221,6 @@ struct bss_load_trigger {
  * @enable_fast_roam_in_concurrency:Enable LFR roaming on STA during concurrency
  * @lfr3_roaming_offload:           Enable/disable roam offload feature
  * @early_stop_scan_enable:         Set early stop scan
- * @lfr3_enable_subnet_detection:   Enable LFR3 subnet detection
  * @enable_5g_band_pref:            Enable preference for 5G from INI
  * @ese_enabled:                    Enable ESE feature
  * @lfr_enabled:                    Enable fast roaming
@@ -1289,6 +1288,12 @@ struct bss_load_trigger {
  * @delay_before_vdev_stop:Wait time for tx complete before vdev stop
  * @neighbor_scan_channel_list:     Neighbor scan channel list
  * @neighbor_scan_channel_list_num: Neighbor scan channel list number
+ * @enable_lfr_subnet_detection:    Enable LFR3 subnet detection
+ * @ho_delay_for_rx:                Delay hand-off by this duration to receive
+ * @min_delay_btw_roam_scans:       Min duration
+ * @roam_trigger_reason_bitmask:    Contains roam_trigger_reasons
+ * @enable_ftopen:                  Enable/disable FT open feature
+ * @roam_force_rssi_trigger:        Force RSSI trigger or not
  */
 struct wlan_mlme_lfr_cfg {
 	bool mawc_roam_enabled;
@@ -1297,7 +1302,6 @@ struct wlan_mlme_lfr_cfg {
 	bool lfr3_roaming_offload;
 #endif
 	bool early_stop_scan_enable;
-	bool lfr3_enable_subnet_detection;
 	bool enable_5g_band_pref;
 #ifdef FEATURE_WLAN_ESE
 	bool ese_enabled;
@@ -1367,6 +1371,14 @@ struct wlan_mlme_lfr_cfg {
 	uint8_t delay_before_vdev_stop;
 	uint8_t neighbor_scan_channel_list[CFG_VALID_CHANNEL_LIST_LEN];
 	uint8_t neighbor_scan_channel_list_num;
+#ifdef FEATURE_LFR_SUBNET_DETECTION
+	bool enable_lfr_subnet_detection;
+#endif
+	uint8_t ho_delay_for_rx;
+	uint8_t min_delay_btw_roam_scans;
+	uint32_t roam_trigger_reason_bitmask;
+	bool enable_ftopen;
+	bool roam_force_rssi_trigger;
 	struct bss_load_trigger bss_load_trig;
 };
 

+ 23 - 1
mlme/dispatcher/inc/wlan_mlme_ucfg_api.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -3482,4 +3482,26 @@ QDF_STATUS
 ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
 				uint32_t *value);
 
+#ifdef FEATURE_LFR_SUBNET_DETECTION
+/**
+ * ucfg_mlme_is_subnet_detection_enabled() - check if sub net detection is
+ * enabled/disabled
+ * @psoc: pointer to psoc object
+ * @value: value that is requested by the caller
+ *
+ * Inline UCFG API to be used by HDD/OSIF callers
+ *
+ * Return: QDF_STATUS_SUCCESS - in case of success
+ */
+QDF_STATUS
+ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val);
+#else
+static QDF_STATUS
+ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
+{
+	*val = false;
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif /* FEATURE_LFR_SUBNET_DETECTION */
 #endif /* _WLAN_MLME_UCFG_API_H_ */

+ 18 - 1
mlme/dispatcher/src/wlan_mlme_ucfg_api.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1455,3 +1455,20 @@ ucfg_mlme_get_scan_11d_interval(struct wlan_objmgr_psoc *psoc,
 	*value = mlme_obj->cfg.reg.scan_11d_interval;
 	return QDF_STATUS_SUCCESS;
 }
+
+#ifdef FEATURE_LFR_SUBNET_DETECTION
+QDF_STATUS
+ucfg_mlme_is_subnet_detection_enabled(struct wlan_objmgr_psoc *psoc, bool *val)
+{
+	struct wlan_mlme_psoc_obj *mlme_obj;
+
+	mlme_obj = mlme_get_psoc_obj(psoc);
+	if (!mlme_obj) {
+		*val = cfg_default(CFG_LFR3_ENABLE_SUBNET_DETECTION);
+		return QDF_STATUS_E_INVAL;
+	}
+	*val = mlme_obj->cfg.lfr.enable_lfr_subnet_detection;
+
+	return QDF_STATUS_SUCCESS;
+}
+#endif