summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_assoc.c7
-rw-r--r--core/hdd/src/wlan_hdd_power.c6
-rw-r--r--core/hdd/src/wlan_hdd_scan.c33
-rw-r--r--core/hdd/src/wlan_hdd_scan.h20
4 files changed, 58 insertions, 8 deletions
diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c
index fc669066af40..6c918ea58792 100644
--- a/core/hdd/src/wlan_hdd_assoc.c
+++ b/core/hdd/src/wlan_hdd_assoc.c
@@ -53,6 +53,7 @@
#include "wlan_hdd_napi.h"
#include <wlan_logging_sock_svc.h>
#include "wlan_hdd_tsf.h"
+#include "wlan_hdd_scan.h"
/* These are needed to recognize WPA and RSN suite types */
#define HDD_WPA_OUI_SIZE 4
@@ -2613,6 +2614,12 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
}
/*
+ * reset scan reject params if connection is success or we received
+ * final failure from CSR after trying with all APs.
+ */
+ hdd_reset_scan_reject_params(pHddCtx, roamStatus, roamResult);
+
+ /*
* Enable roaming on other STA iface except this one.
* Firmware dosent support connection on one STA iface while
* roaming on other STA iface
diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c
index a5e65d914813..1e320ab2c4e3 100644
--- a/core/hdd/src/wlan_hdd_power.c
+++ b/core/hdd/src/wlan_hdd_power.c
@@ -1665,10 +1665,8 @@ QDF_STATUS hdd_wlan_re_init(void)
/* Restart all adapters */
hdd_start_all_adapters(pHddCtx);
- pHddCtx->last_scan_reject_session_id = 0xFF;
- pHddCtx->last_scan_reject_reason = 0;
- pHddCtx->last_scan_reject_timestamp = 0;
- pHddCtx->scan_reject_cnt = 0;
+ /* init the scan reject params */
+ hdd_init_scan_reject_params(pHddCtx);
hdd_set_roaming_in_progress(false);
complete(&pAdapter->roaming_comp_var);
diff --git a/core/hdd/src/wlan_hdd_scan.c b/core/hdd/src/wlan_hdd_scan.c
index d98686b83a21..ecc78d864f5c 100644
--- a/core/hdd/src/wlan_hdd_scan.c
+++ b/core/hdd/src/wlan_hdd_scan.c
@@ -428,6 +428,32 @@ static int hdd_add_scan_event_from_ies(struct hdd_scan_info *scanInfo,
return 0;
}
+void hdd_init_scan_reject_params(hdd_context_t *hdd_ctx)
+{
+ if (hdd_ctx) {
+ hdd_ctx->last_scan_reject_timestamp = 0;
+ hdd_ctx->last_scan_reject_session_id = 0xFF;
+ hdd_ctx->last_scan_reject_reason = 0;
+ hdd_ctx->scan_reject_cnt = 0;
+ }
+
+ return;
+}
+
+void hdd_reset_scan_reject_params(hdd_context_t *hdd_ctx,
+ eRoamCmdStatus roam_status,
+ eCsrRoamResult roam_result)
+{
+
+ if ((roam_status == eCSR_ROAM_ASSOCIATION_FAILURE) ||
+ (roam_status == eCSR_ROAM_CANCELLED) ||
+ (roam_result == eCSR_ROAM_RESULT_ASSOCIATED)) {
+ hdd_debug("Reset scan reject params");
+ hdd_init_scan_reject_params(hdd_ctx);
+ }
+
+ return;
+}
/**
* hdd_indicate_scan_result() - indicate scan results
@@ -2198,10 +2224,9 @@ static int __wlan_hdd_cfg80211_scan(struct wiphy *wiphy,
}
return -EBUSY;
}
- pHddCtx->last_scan_reject_timestamp = 0;
- pHddCtx->last_scan_reject_session_id = 0xFF;
- pHddCtx->last_scan_reject_reason = 0;
- pHddCtx->scan_reject_cnt = 0;
+
+ /* reinit the scan reject params */
+ hdd_init_scan_reject_params(pHddCtx);
/* Check whether SAP scan can be skipped or not */
if (pAdapter->device_mode == QDF_SAP_MODE &&
diff --git a/core/hdd/src/wlan_hdd_scan.h b/core/hdd/src/wlan_hdd_scan.h
index 4f20fdf17c8a..157f579d0c20 100644
--- a/core/hdd/src/wlan_hdd_scan.h
+++ b/core/hdd/src/wlan_hdd_scan.h
@@ -162,6 +162,26 @@ void wlan_hdd_fill_whitelist_ie_attrs(bool *ie_whitelist,
hdd_context_t *hdd_ctx);
/**
+ * hdd_init_scan_reject_params() - init scan reject params
+ * @hdd_ctx: hdd contxt
+ *
+ * Return: None
+ */
+void hdd_init_scan_reject_params(hdd_context_t *hdd_ctx);
+
+/**
+ * hdd_reset_scan_reject_params() - reset scan reject params per roam stats
+ * @hdd_ctx: hdd contxt
+ * @roam_status: roam status
+ * @roam_result: roam result
+ *
+ * Return: None
+ */
+void hdd_reset_scan_reject_params(hdd_context_t *hdd_ctx,
+ eRoamCmdStatus roam_status,
+ eCsrRoamResult roam_result);
+
+/**
* wlan_hdd_cfg80211_scan_block_cb() - scan block work handler
* @work: Pointer to work
*