summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/hdd/src/wlan_hdd_cfg80211.c44
1 files changed, 44 insertions, 0 deletions
diff --git a/core/hdd/src/wlan_hdd_cfg80211.c b/core/hdd/src/wlan_hdd_cfg80211.c
index 8cbb47b3ec6a..6cfbc3d2c828 100644
--- a/core/hdd/src/wlan_hdd_cfg80211.c
+++ b/core/hdd/src/wlan_hdd_cfg80211.c
@@ -4915,6 +4915,40 @@ hdd_cfg80211_get_station_cmd(struct wiphy *wiphy,
#undef REMOTE_PAD
#endif
+/**
+ * hdd_get_roam_reason() - convert wmi roam reason to
+ * enum qca_roam_reason
+ * @roam_scan_trigger: wmi roam scan trigger ID
+ *
+ * Return: Meaningful qca_roam_reason from enum WMI_ROAM_TRIGGER_REASON_ID
+ */
+static enum qca_roam_reason hdd_get_roam_reason(uint32_t roam_scan_trigger)
+{
+ switch (roam_scan_trigger) {
+ case WMI_ROAM_TRIGGER_REASON_PER:
+ return QCA_ROAM_REASON_PER;
+ case WMI_ROAM_TRIGGER_REASON_BMISS:
+ return QCA_ROAM_REASON_BEACON_MISS;
+ case WMI_ROAM_TRIGGER_REASON_LOW_RSSI:
+ case WMI_ROAM_TRIGGER_REASON_BACKGROUND:
+ return QCA_ROAM_REASON_POOR_RSSI;
+ case WMI_ROAM_TRIGGER_REASON_HIGH_RSSI:
+ return QCA_ROAM_REASON_BETTER_RSSI;
+ case WMI_ROAM_TRIGGER_REASON_DENSE:
+ return QCA_ROAM_REASON_CONGESTION;
+ case WMI_ROAM_TRIGGER_REASON_FORCED:
+ return QCA_ROAM_REASON_USER_TRIGGER;
+ case WMI_ROAM_TRIGGER_REASON_BTM:
+ return QCA_ROAM_REASON_BTM;
+ case WMI_ROAM_TRIGGER_REASON_BSS_LOAD:
+ return QCA_ROAM_REASON_BSS_LOAD;
+ default:
+ return QCA_ROAM_REASON_UNKNOWN;
+ }
+
+ return QCA_ROAM_REASON_UNKNOWN;
+}
+
#ifdef WLAN_FEATURE_ROAM_OFFLOAD
/**
* __wlan_hdd_cfg80211_keymgmt_set_key() - Store the Keys in the driver session
@@ -5376,6 +5410,7 @@ int wlan_hdd_send_roam_auth_event(hdd_adapter_t *adapter, uint8_t *bssid,
eCsrAuthType auth_type;
uint32_t fils_params_len;
int status;
+ enum qca_roam_reason hdd_roam_reason;
ENTER();
@@ -5454,6 +5489,15 @@ int wlan_hdd_send_roam_auth_event(hdd_adapter_t *adapter, uint8_t *bssid,
goto nla_put_failure;
}
+ hdd_roam_reason =
+ hdd_get_roam_reason(roam_info_ptr->roam_reason);
+
+ if (nla_put_u8(skb, QCA_WLAN_VENDOR_ATTR_ROAM_AUTH_REASON,
+ hdd_roam_reason)) {
+ hdd_err("roam reason send failure");
+ goto nla_put_failure;
+ }
+
status = wlan_hdd_add_fils_params_roam_auth_event(skb,
roam_info_ptr);
if (status)