浏览代码

qca-wifi: Add check for FW generated action frames in tx capture

Extend the current check for action frames in tx capture
to include more types of FW generated action frames.
This change adds a generic function to check where action
frames are generated that is easily extended to account
for more types in the future.

Change-Id: I23bb37c5a81b02d2c095060bac909298d1b2283f
CRs-Fixed: 2807802
Christopher Chopp 4 年之前
父节点
当前提交
ea10246813
共有 1 个文件被更改,包括 123 次插入2 次删除
  1. 123 2
      dp/wifi3.0/dp_tx_capture.c

+ 123 - 2
dp/wifi3.0/dp_tx_capture.c

@@ -797,6 +797,127 @@ void dp_peer_update_80211_hdr(struct dp_vdev *vdev, struct dp_peer *peer)
 		     QDF_MAC_ADDR_SIZE);
 }
 
+/*
+ * dp_action_frame_is_hostgen
+ * @category: action category code number
+ * @action: action code number
+ *
+ * return: true if action frame is host generated, else false
+ */
+bool dp_action_frame_is_hostgen(int category, int action)
+{
+	bool retval = true;
+
+	switch (category) {
+	case IEEE80211_ACTION_CAT_BA:
+		switch (action) {
+		case IEEE80211_ACTION_BA_ADDBA_REQUEST:
+		case IEEE80211_ACTION_BA_ADDBA_RESPONSE:
+		case IEEE80211_ACTION_BA_DELBA:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_PUBLIC:
+		switch (action) {
+		case IEEE80211_ACTION_PUBLIC_FINE_TMR:
+		case IEEE80211_ACTION_PUBLIC_FINE_TM:
+		case IEEE80211_ACTION_PUBLIC_FILS_DISC:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_RADIO:
+		switch (action) {
+		case IEEE80211_ACTION_RADIO_MGMT_NEIGH_REPT_REQ:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_HT:
+		switch (action) {
+		case IEEE80211_ACTION_HT_SMPOWERSAVE:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_SA_QUERY:
+		switch (action) {
+		case IEEE80211_ACTION_SA_QUERY_REQUEST:
+		case IEEE80211_ACTION_SA_QUERY_RESPONSE:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_WNM:
+		switch (action) {
+		case IEEE80211_ACTION_EVENT_REPORT:
+		case IEEE80211_ACTION_BSTM_QUERY:
+		case IEEE80211_ACTION_BSTM_RESP:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_TDLS:
+		switch (action) {
+		case IEEE80211_ACTION_TDLS_PEER_TRAFFIC_IND:
+		case IEEE80211_ACTION_TDLS_CHAN_SWITCH_REQ:
+		case IEEE80211_ACTION_TDLS_CHAN_SWITCH_RESP:
+		case IEEE80211_ACTION_TDLS_PEER_TRAFFIC_RESP:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_VHT:
+		switch (action) {
+		case IEEE80211_ACTION_VHT_OPMODE:
+		case IEEE80211_ACTION_VHT_GROUP_ID:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	case IEEE80211_ACTION_CAT_S1G:
+		switch (action) {
+		case IEEE80211_ACTION_TWT_SETUP:
+		case IEEE80211_ACTION_TWT_TEARDOWN:
+		case IEEE80211_ACTION_TWT_INFORMATION:
+			retval = false;
+			break;
+		default:
+			break;
+		}
+	break;
+
+	default:
+		break;
+	}
+	return retval;
+}
+
 /*
  * dp_deliver_mgmt_frm: Process
  * @pdev: DP PDEV handle
@@ -855,8 +976,8 @@ void dp_deliver_mgmt_frm(struct dp_pdev *pdev, qdf_nbuf_t nbuf)
 			frm = (u_int8_t *)&wh[1];
 			ia = (struct ieee80211_action *)frm;
 
-			if ((ia->ia_category == IEEE80211_ACTION_CAT_S1G) &&
-			    (ia->ia_action == IEEE80211_ACTION_TWT_SETUP)) {
+			if (!dp_action_frame_is_hostgen(ia->ia_category,
+							ia->ia_action)) {
 				ptr_mgmt_hdr->is_sgen_pkt = false;
 			}
 		}