Forráskód Böngészése

qcacmn: Handle roam stats event with neighbor report tlv alone

Currently, the driver rejects the roam stats event if any of the
roam trigger or roam scan or roam results tlv is not present.
Now the firmware will send neighbor report immediately after the
neighbor report response is received from AP instead of buffering
it as done before.

So do not parse the roam trigger, roam scan, roam result tlv if
the tlv is not present. Add new flag in the tlv parsing structure
if the TLV is not present.

Change-Id: I366d8853f7f45dcdac6d4aa5c3a8a12a8b602a4f
CRs-Fixed: 2610377
Pragaspathi Thilagaraj 5 éve
szülő
commit
778e4b7163
2 módosított fájl, 23 hozzáadás és 10 törlés
  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

@@ -7498,8 +7498,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
@@ -7574,6 +7575,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.
@@ -7582,6 +7584,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;
@@ -7592,11 +7595,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;
@@ -7605,6 +7610,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
@@ -7612,6 +7618,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;
@@ -7622,6 +7629,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
@@ -7632,6 +7640,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

@@ -12729,11 +12729,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;
@@ -12809,9 +12810,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;
@@ -12853,13 +12851,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;
 
@@ -12875,9 +12873,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)) {
@@ -12904,11 +12906,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;
@@ -12936,11 +12939,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;