Browse Source

qcacld-3.0: Clear WMM access category stats on disconnect

qcacld-2.0 to qcacld-3.0 propagation
WMM access category stats of old BSS getting added to stats of new BSS
on network switch.
To mitigate this issue, clear WMM access category stats on disconnect.

Change-Id: Icd1ce4ae0595098f95d5534b4b752c5692264fb8
CRs-Fixed: 999832
Mahesh A Saptasagar 8 years ago
parent
commit
6dda2028c5

+ 1 - 0
core/hdd/src/wlan_hdd_assoc.c

@@ -1674,6 +1674,7 @@ static QDF_STATUS hdd_dis_connect_handler(hdd_adapter_t *pAdapter,
 				(pAdapter),
 				pAdapter->sessionId);
 	}
+	wlan_hdd_clear_link_layer_stats(pAdapter);
 	/* Unblock anyone waiting for disconnect to complete */
 	complete(&pAdapter->disconnect_comp_var);
 	hdd_print_bss_info(pHddStaCtx);

+ 21 - 0
core/hdd/src/wlan_hdd_cfg80211.c

@@ -14992,6 +14992,27 @@ static int wlan_hdd_cfg80211_set_mon_ch(struct wiphy *wiphy,
 	return ret;
 }
 
+/**
+ * wlan_hdd_clear_link_layer_stats() - clear link layer stats
+ * @adapter: pointer to adapter
+ *
+ * Wrapper function to clear link layer stats.
+ * return - void
+ */
+void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter)
+{
+	tSirLLStatsClearReq link_layer_stats_clear_req;
+	tHalHandle hal = WLAN_HDD_GET_HAL_CTX(adapter);
+
+	link_layer_stats_clear_req.statsClearReqMask = WIFI_STATS_IFACE_AC;
+	link_layer_stats_clear_req.stopReq = 0;
+	link_layer_stats_clear_req.reqId = 1;
+	link_layer_stats_clear_req.staId = adapter->sessionId;
+	sme_ll_stats_clear_req(hal, &link_layer_stats_clear_req);
+
+	return;
+}
+
 /**
  * struct cfg80211_ops - cfg80211_ops
  *

+ 6 - 0
core/hdd/src/wlan_hdd_cfg80211.h

@@ -124,6 +124,12 @@ typedef struct {
 #if !defined (TDLS_MGMT_VERSION2)
 #define TDLS_MGMT_VERSION2 0
 #endif
+#ifdef WLAN_FEATURE_LINK_LAYER_STATS
+void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter);
+#else
+static inline void wlan_hdd_clear_link_layer_stats(hdd_adapter_t *adapter) {}
+#endif
+
 #endif
 
 #define MAX_CHANNEL (NUM_24GHZ_CHANNELS + NUM_5GHZ_CHANNELS)