From cdc3b574d1293f6a762789039df94fa75568d365 Mon Sep 17 00:00:00 2001 From: gaurank kathpalia Date: Tue, 30 Jul 2019 16:47:13 +0530 Subject: [PATCH] qcacld-3.0: Modify NUD tracking ini for disconnect/roam Modify the nud tracking ini so that the driver does a disconnection/roaming after NUD failure is detected. According to the ini specified, the driver would either disconnect or do roaming. Change-Id: I6af1c819322a702605d92ada735298a124127533 CRs-Fixed: 2497153 --- core/hdd/inc/hdd_dp_cfg.h | 25 +++++++++++++++++++------ core/hdd/inc/wlan_hdd_cfg.h | 2 +- core/hdd/src/wlan_hdd_nud_tracking.c | 21 ++++++++++++++++++++- 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/core/hdd/inc/hdd_dp_cfg.h b/core/hdd/inc/hdd_dp_cfg.h index 46697ce734b5..06862ca2383f 100644 --- a/core/hdd/inc/hdd_dp_cfg.h +++ b/core/hdd/inc/hdd_dp_cfg.h @@ -1130,14 +1130,21 @@ #define CFG_DP_CONFIG_DP_TRACE_ALL #endif +#ifdef WLAN_NUD_TRACKING /* * * gEnableNUDTracking - Will enable or disable NUD tracking within driver * @Min: 0 - * @Max: 1 - * @Default: 1 + * @Max: 2 + * @Default: 2 * - * This ini is used to enable or disable NUD tracking within driver + * This ini is used to specify the behaviour of the driver for NUD tracking. + * If the ini value is:- + * 0: Driver will not track the NUD failures, and ignore the same. + * 1: Driver will track the NUD failures and if honoured will disconnect from + * the connected BSSID. + * 2: Driver will track the NUD failures and if honoured will roam away from + * the connected BSSID to a new BSSID to retain the data connectivity. * * Related: None * @@ -1147,10 +1154,16 @@ * * */ -#ifdef WLAN_NUD_TRACKING +#define CFG_DP_ROAM_AFTER_NUD_FAIL 2 +#define CFG_DP_DISCONNECT_AFTER_NUD_FAIL 1 +#define CFG_DP_DISABLE_NUD_TRACKING 0 + #define CFG_DP_ENABLE_NUD_TRACKING \ - CFG_INI_BOOL("gEnableNUDTracking", \ - true, "Ctrl to enable nud tracking") + CFG_INI_UINT("gEnableNUDTracking", \ + CFG_DP_DISABLE_NUD_TRACKING, \ + CFG_DP_ROAM_AFTER_NUD_FAIL, \ + CFG_DP_ROAM_AFTER_NUD_FAIL, \ + CFG_VALUE_OR_DEFAULT, "Driver NUD tracking behaviour") #define CFG_DP_ENABLE_NUD_TRACKING_ALL \ CFG(CFG_DP_ENABLE_NUD_TRACKING) diff --git a/core/hdd/inc/wlan_hdd_cfg.h b/core/hdd/inc/wlan_hdd_cfg.h index d7c4bdb875d8..1e0208f4c2da 100644 --- a/core/hdd/inc/wlan_hdd_cfg.h +++ b/core/hdd/inc/wlan_hdd_cfg.h @@ -203,7 +203,7 @@ struct hdd_config { uint8_t dp_trace_config[DP_TRACE_CONFIG_STRING_LENGTH]; #endif #ifdef WLAN_NUD_TRACKING - bool enable_nud_tracking; + uint8_t enable_nud_tracking; #endif uint8_t operating_channel; uint8_t num_vdevs; diff --git a/core/hdd/src/wlan_hdd_nud_tracking.c b/core/hdd/src/wlan_hdd_nud_tracking.c index ee05e36da311..817d2cf04daa 100644 --- a/core/hdd/src/wlan_hdd_nud_tracking.c +++ b/core/hdd/src/wlan_hdd_nud_tracking.c @@ -23,6 +23,7 @@ #include "osif_sync.h" #include "wlan_hdd_main.h" #include "wlan_blm_ucfg_api.h" +#include "hdd_dp_cfg.h" void hdd_nud_set_gateway_addr(struct hdd_adapter *adapter, struct qdf_mac_addr gw_mac_addr) @@ -277,6 +278,23 @@ hdd_handle_nud_fail_non_sta(struct hdd_adapter *adapter) } } +#ifdef WLAN_NUD_TRACKING +static bool +hdd_is_roam_after_nud_enabled(struct hdd_config *config) +{ + if (config->enable_nud_tracking == CFG_DP_ROAM_AFTER_NUD_FAIL) + return true; + + return false; +} +#else +static bool +hdd_is_roam_after_nud_enabled(struct hdd_config *config) +{ + return false; +} +#endif + /** * __hdd_nud_failure_work() - work for nud event * @adapter: Pointer to hdd_adapter @@ -312,7 +330,8 @@ static void __hdd_nud_failure_work(struct hdd_adapter *adapter) return; } - if (adapter->device_mode == QDF_STA_MODE) { + if (adapter->device_mode == QDF_STA_MODE && + hdd_is_roam_after_nud_enabled(hdd_ctx->config)) { hdd_handle_nud_fail_sta(hdd_ctx, adapter); return; }