浏览代码

Merge "qcacmn: Handle roam stats event with neighbor report tlv alone"

Linux Build Service Account 5 年之前
父节点
当前提交
9468889cdf
共有 2 个文件被更改,包括 23 次插入10 次删除
  1. 10 1
      wmi/inc/wmi_unified_param.h
  2. 13 9
      wmi/src/wmi_unified_tlv.c

+ 10 - 1
wmi/inc/wmi_unified_param.h

@@ -7500,8 +7500,9 @@ struct wmi_roam_scan_stats_res {
 	struct wmi_roam_scan_stats_params roam_scan[0];
 };
 
-#define MAX_ROAM_CANDIDATE_AP      8
+#define MAX_ROAM_CANDIDATE_AP      9
 #define MAX_ROAM_SCAN_CHAN         38
+#define MAX_ROAM_SCAN_STATS_TLV    5
 
 /**
  * struct wmi_roam_btm_trigger_data - BTM roam trigger related information
@@ -7576,6 +7577,7 @@ struct wmi_roam_candidate_info {
 
 /**
  * struct wmi_roam_scan_data - Roam scan event details
+ * @present:            Flag to check if the roam scan tlv is present
  * @type:      0 - Partial roam scan; 1 - Full roam scan
  * @num_ap:    Number of candidate APs.
  * @num_chan:  Number of channels.
@@ -7584,6 +7586,7 @@ struct wmi_roam_candidate_info {
  * @ap: List of candidate AP info
  */
 struct wmi_roam_scan_data {
+	bool present;
 	uint16_t type;
 	uint16_t num_ap;
 	uint16_t num_chan;
@@ -7594,11 +7597,13 @@ struct wmi_roam_scan_data {
 
 /**
  * struct wmi_roam_result - Roam result related info.
+ * @present:            Flag to check if the roam result tlv is present
  * @timestamp:          Host timestamp in millisecs
  * @status:             0 - Roaming is success ; 1 - Roaming failed
  * @fail_reason:        One of WMI_ROAM_FAIL_REASON_ID
  */
 struct wmi_roam_result {
+	bool present;
 	uint32_t timestamp;
 	bool status;
 	uint32_t fail_reason;
@@ -7607,6 +7612,7 @@ struct wmi_roam_result {
 /**
  *  struct wmi_neighbor_report_data - Neighbor report/BTM request related
  *  data.
+ *  @present:    Flag to check if the roam 11kv tlv is present
  *  @timestamp:  Host timestamp in millisecs
  *  @req_type:   1 - BTM query ; 2 - 11K neighbor report request
  *  @req_time:   Request timestamp in ms
@@ -7614,6 +7620,7 @@ struct wmi_roam_result {
  *  @freq:       Channel frequency in Mhz
  */
 struct wmi_neighbor_report_data {
+	bool present;
 	uint32_t timestamp;
 	uint8_t req_type;
 	uint32_t req_time;
@@ -7624,6 +7631,7 @@ struct wmi_neighbor_report_data {
 
 /**
  * struct wmi_roam_trigger_info() - Roam trigger related details
+ * @present:            Flag to check if the roam_trigger_info tlv is present
  * @trigger_reason:     Roam trigger reason(enum WMI_ROAM_TRIGGER_REASON_ID)
  * @trigger_sub_reason: Sub reason for roam trigger if multiple roam scans
  * @current_rssi:       Connected AP RSSI
@@ -7634,6 +7642,7 @@ struct wmi_neighbor_report_data {
  * @deauth_trig_data:   Deauth roam trigger related info
  */
 struct wmi_roam_trigger_info {
+	bool present;
 	uint32_t trigger_reason;
 	uint32_t trigger_sub_reason;
 	uint32_t current_rssi;

+ 13 - 9
wmi/src/wmi_unified_tlv.c

@@ -12731,11 +12731,12 @@ extract_roam_trigger_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 	wmi_roam_trigger_reason *src_data = NULL;
 
 	param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf;
-	if (!param_buf)
+	if (!param_buf || !param_buf->roam_trigger_reason)
 		return QDF_STATUS_E_FAILURE;
 
 	src_data = &param_buf->roam_trigger_reason[idx];
 
+	trig->present = true;
 	trig->trigger_reason = src_data->trigger_reason;
 	trig->trigger_sub_reason = src_data->trigger_sub_reason;
 	trig->current_rssi = src_data->current_rssi;
@@ -12811,9 +12812,6 @@ extract_roam_scan_ap_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 
 	src = &param_buf->roam_ap_info[ap_idx];
 
-	if (num_cand > MAX_ROAM_CANDIDATE_AP)
-		num_cand = MAX_ROAM_CANDIDATE_AP;
-
 	for (i = 0; i < num_cand; i++) {
 		WMI_MAC_ADDR_TO_CHAR_ARRAY(&src->bssid, dst->bssid.bytes);
 		dst->type = src->candidate_type;
@@ -12855,13 +12853,13 @@ extract_roam_scan_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 	uint8_t i;
 
 	param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf;
-	if (!param_buf)
+	if (!param_buf || !param_buf->roam_scan_info)
 		return QDF_STATUS_E_FAILURE;
 
 	src_data = &param_buf->roam_scan_info[idx];
 
+	dst->present = true;
 	dst->type = src_data->roam_scan_type;
-	dst->num_ap = src_data->roam_ap_count;
 	dst->num_chan = src_data->roam_scan_channel_count;
 	dst->next_rssi_threshold = src_data->next_rssi_trigger_threshold;
 
@@ -12877,9 +12875,13 @@ extract_roam_scan_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 		}
 	}
 
-	if (!dst->num_ap)
+	if (!src_data->roam_ap_count)
 		return QDF_STATUS_SUCCESS;
 
+	dst->num_ap = src_data->roam_ap_count;
+	if (dst->num_ap > MAX_ROAM_CANDIDATE_AP)
+		dst->num_ap = MAX_ROAM_CANDIDATE_AP;
+
 	status = extract_roam_scan_ap_stats_tlv(wmi_handle, evt_buf, dst->ap,
 						ap_idx, dst->num_ap);
 	if (QDF_IS_STATUS_ERROR(status)) {
@@ -12906,11 +12908,12 @@ extract_roam_result_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 	wmi_roam_result *src_data = NULL;
 
 	param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf;
-	if (!param_buf)
+	if (!param_buf || !param_buf->roam_result)
 		return QDF_STATUS_E_FAILURE;
 
 	src_data = &param_buf->roam_result[idx];
 
+	dst->present = true;
 	dst->status = src_data->roam_status ? false : true;
 	dst->timestamp = src_data->timestamp;
 	dst->fail_reason = src_data->roam_fail_reason;
@@ -12938,11 +12941,12 @@ extract_roam_11kv_stats_tlv(wmi_unified_t wmi_handle, void *evt_buf,
 	uint8_t i;
 
 	param_buf = (WMI_ROAM_STATS_EVENTID_param_tlvs *)evt_buf;
-	if (!param_buf)
+	if (!param_buf || !param_buf->roam_neighbor_report_info)
 		return QDF_STATUS_E_FAILURE;
 
 	src_data = &param_buf->roam_neighbor_report_info[idx];
 
+	dst->present = true;
 	dst->req_type = src_data->request_type;
 	dst->num_freq = src_data->neighbor_report_channel_count;
 	dst->req_time = src_data->neighbor_report_request_timestamp;