Эх сурвалжийг харах

qcacmn: Separate MEC, DA and WDS Enable Flags

Add new flags for MEC and DA enable/disable
and keep it independent of WDS enable flag

Change-Id: Idb49c45ebb34a38f876dbdb293806c4e96d49b5d
CRs-Fixed: 2336332
phadiman 6 жил өмнө
parent
commit
4213e9ca61

+ 3 - 0
dp/inc/cdp_txrx_cmn_struct.h

@@ -776,6 +776,7 @@ enum cdp_pdev_bpr_param {
  * @CDP_ENABLE_NAWDS: set nawds enable/disable
  * @CDP_ENABLE_MCAST_EN: enable/disable multicast enhancement
  * @CDP_ENABLE_WDS: wds sta
+ * @CDP_ENABLE_MEC: MEC enable flags
  * @CDP_ENABLE_PROXYSTA: proxy sta
  * @CDP_UPDATE_TDLS_FLAGS: tdls link flags
  * @CDP_ENABLE_AP_BRIDGE: set ap_bridging enable/disable
@@ -786,6 +787,8 @@ enum cdp_vdev_param_type {
 	CDP_ENABLE_NAWDS,
 	CDP_ENABLE_MCAST_EN,
 	CDP_ENABLE_WDS,
+	CDP_ENABLE_MEC,
+	CDP_ENABLE_DA_WAR,
 	CDP_ENABLE_PROXYSTA,
 	CDP_UPDATE_TDLS_FLAGS,
 	CDP_CFG_WDS_AGING_TIMER,

+ 21 - 0
dp/inc/cdp_txrx_ctrl.h

@@ -408,6 +408,27 @@ static inline void cdp_tx_flush_buffers
 	soc->ops->ctrl_ops->tx_flush_buffers(vdev);
 }
 
+static inline uint32_t cdp_txrx_get_vdev_param(ol_txrx_soc_handle soc,
+					       struct cdp_vdev *vdev,
+					       enum cdp_vdev_param_type type)
+{
+	if (!soc || !soc->ops) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: Invalid Instance:", __func__);
+		QDF_BUG(0);
+		return -1;
+	}
+
+	if (!soc->ops->ctrl_ops ||
+	    !soc->ops->ctrl_ops->txrx_get_vdev_param) {
+		QDF_TRACE(QDF_MODULE_ID_CDP, QDF_TRACE_LEVEL_DEBUG,
+			  "%s: callback not registered:", __func__);
+		return -1;
+	}
+
+	return soc->ops->ctrl_ops->txrx_get_vdev_param(vdev, type);
+}
+
 static inline void cdp_txrx_set_vdev_param(ol_txrx_soc_handle soc,
 		struct cdp_vdev *vdev, enum cdp_vdev_param_type type,
 		uint32_t val)

+ 3 - 0
dp/inc/cdp_txrx_ops.h

@@ -554,6 +554,9 @@ struct cdp_ctrl_ops {
 #endif
 	void (*set_key)(struct cdp_peer *peer_handle,
 			bool is_unicast, uint32_t *key);
+
+	uint32_t (*txrx_get_vdev_param)(struct cdp_vdev *vdev,
+					enum cdp_vdev_param_type param);
 };
 
 struct cdp_me_ops {

+ 46 - 0
dp/wifi3.0/dp_main.c

@@ -7280,6 +7280,39 @@ static void dp_set_pdev_param(struct cdp_pdev *pdev_handle,
 	}
 }
 
+/*
+ * dp_get_vdev_param: function to get parameters from vdev
+ * @param: parameter type to get value
+ *
+ * return: void
+ */
+static uint32_t dp_get_vdev_param(struct cdp_vdev *vdev_handle,
+				  enum cdp_vdev_param_type param)
+{
+	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
+	uint32_t val;
+
+	switch (param) {
+	case CDP_ENABLE_WDS:
+		val = vdev->wds_enabled;
+		break;
+	case CDP_ENABLE_MEC:
+		val = vdev->mec_enabled;
+		break;
+	case CDP_ENABLE_DA_WAR:
+		val = vdev->da_war_enabled;
+		break;
+	default:
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
+			  "param value %d is wrong\n",
+			  param);
+		val = -1;
+		break;
+	}
+
+	return val;
+}
+
 /*
  * dp_set_vdev_param: function to set parameters in vdev
  * @param: parameter type to be set
@@ -7298,6 +7331,18 @@ static void dp_set_vdev_param(struct cdp_vdev *vdev_handle,
 			  val, vdev, vdev->vdev_id);
 		vdev->wds_enabled = val;
 		break;
+	case CDP_ENABLE_MEC:
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
+			  "mec_enable %d for vdev(%p) id(%d)\n",
+			  val, vdev, vdev->vdev_id);
+		vdev->mec_enabled = val;
+		break;
+	case CDP_ENABLE_DA_WAR:
+		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
+			  "da_war_enable %d for vdev(%p) id(%d)\n",
+			  val, vdev, vdev->vdev_id);
+		vdev->da_war_enabled = val;
+		break;
 	case CDP_ENABLE_NAWDS:
 		vdev->nawds_enabled = val;
 		break;
@@ -8421,6 +8466,7 @@ static struct cdp_ctrl_ops dp_ops_ctrl = {
 	.txrx_vdev_get_neighbour_rssi = dp_vdev_get_neighbour_rssi,
 #endif
 	.set_key = dp_set_michael_key,
+	.txrx_get_vdev_param = dp_get_vdev_param,
 };
 
 static struct cdp_me_ops dp_ops_me = {

+ 5 - 3
dp/wifi3.0/dp_rx.c

@@ -1713,12 +1713,14 @@ done:
 		if (qdf_likely(vdev->rx_decap_type ==
 			       htt_cmn_pkt_type_ethernet) &&
 		    qdf_likely(!vdev->mesh_vdev)) {
-			/* WDS Source Port Learning */
-			if (vdev->wds_enabled) {
+			/* WDS Destination Address Learning */
+			if (vdev->da_war_enabled)
 				dp_rx_da_learn(soc, rx_tlv_hdr, peer, nbuf);
+
+			/* WDS Source Port Learning */
+			if (vdev->wds_enabled)
 				dp_rx_wds_srcport_learn(soc, rx_tlv_hdr,
 							peer, nbuf);
-			}
 
 			/* Intrabss-fwd */
 			if (dp_rx_check_ap_bridge(vdev))

+ 1 - 1
dp/wifi3.0/dp_tx.c

@@ -2480,7 +2480,7 @@ void dp_tx_mec_handler(struct dp_vdev *vdev, uint8_t *status)
 	struct dp_peer *peer;
 	uint8_t mac_addr[DP_MAC_ADDR_LEN], i;
 
-	if (!vdev->wds_enabled)
+	if (!vdev->mec_enabled)
 		return;
 
 	/* MEC required only in STA mode */

+ 6 - 0
dp/wifi3.0/dp_types.h

@@ -1391,6 +1391,12 @@ struct dp_vdev {
 	/* WDS enabled */
 	bool wds_enabled;
 
+	/* MEC enabled */
+	bool mec_enabled;
+
+	/* DA WAR enable flag */
+	bool da_war_enabled;
+
 	/* WDS Aging timer period */
 	uint32_t wds_aging_timer_val;