Procházet zdrojové kódy

qcacld-3.0: filter the unexpected event data

Since driver is setting the same flag WMI_REQUEST_PEER_STAT to
firmware when it tries to fetch TYPE_CONNECTION_TX_POWER and
TYPE_CONGESTION_STATS. When the fw reports the event, it needs
to filter the last event if they come back too close.

Change-Id: I7b054470c3986b7b363f6948fbd3d73e1e8c718d
CRs-Fixed: 2930365
Paul Zhang před 4 roky
rodič
revize
1ecf455cf9
1 změnil soubory, kde provedl 13 přidání a 0 odebrání
  1. 13 0
      core/hdd/src/wlan_hdd_medium_assess.c

+ 13 - 0
core/hdd/src/wlan_hdd_medium_assess.c

@@ -66,6 +66,7 @@
 #define REPORT_ENABLE 1
 
 #define MAX_CONGESTION_THRESHOLD 100
+#define CYCLE_THRESHOLD 6400000 /* 40000us * 160M */
 
 #define MEDIUM_ASSESS_TIMER_INTERVAL 1000 /* 1000ms */
 static qdf_mc_timer_t hdd_medium_assess_timer;
@@ -261,6 +262,7 @@ static void hdd_congestion_notification_cb(uint8_t vdev_id,
 {
 	struct hdd_medium_assess_info *mdata;
 	uint8_t i;
+	int32_t index;
 
 	/* the cb should not be delay more than 40 ms or drop it */
 	if (qdf_system_time_after(jiffies, stime)) {
@@ -270,6 +272,17 @@ static void hdd_congestion_notification_cb(uint8_t vdev_id,
 
 	for (i = 0; i < WLAN_UMAC_MAX_RP_PID; i++) {
 		mdata = &medium_assess_info[i];
+
+		index = mdata->index - 1;
+		if (index < 0)
+			index = MEDIUM_ASSESS_NUM - 1;
+
+		if (data[i].part1_valid && mdata->data[index].part1_valid) {
+			if (CYCLE_THRESHOLD > (data[i].cycle_count -
+			    mdata->data[index].cycle_count))
+				continue;
+		}
+
 		if (data[i].part1_valid) {
 			mdata->data[mdata->index].part1_valid = 1;
 			mdata->data[mdata->index].cycle_count =