Procházet zdrojové kódy

qcacld-3.0: Store all the txrx ops in dp_intf

Currently the txrx_ops are not saved in the
non-converged datapath.

Store all the txrx_ops in DP component, when
they are registered with the vdev. This can be
used in the DP component to get and use these
ops.

Change-Id: I30bfc69a32e0a9f0ab16f902a94a8c28ef4af8a6
CRs-Fixed: 3505719
Rakesh Pillai před 1 rokem
rodič
revize
296c68c255

+ 2 - 2
components/dp/core/inc/wlan_dp_priv.h

@@ -341,6 +341,7 @@ struct direct_link_info {
  * @vdev: object manager vdev context
  * @vdev_lock: vdev spin lock
  * @dev: netdev reference
+ * @txrx_ops: Interface tx-rx ops
  * @dp_stats: Device TX/RX statistics
  * @is_sta_periodic_stats_enabled: Indicate whether to display sta periodic
  * stats
@@ -393,6 +394,7 @@ struct wlan_dp_intf {
 	struct wlan_objmgr_vdev *vdev;
 	qdf_spinlock_t vdev_lock;
 	qdf_netdev_t dev;
+	struct ol_txrx_ops txrx_ops;
 	struct dp_stats dp_stats;
 #ifdef WLAN_FEATURE_PERIODIC_STA_STATS
 	bool is_sta_periodic_stats_enabled;
@@ -428,8 +430,6 @@ struct wlan_dp_intf {
 	uint8_t gro_flushed[DP_MAX_RX_THREADS];
 
 	bool runtime_disable_rx_thread;
-	ol_txrx_rx_fp rx_stack;
-	ol_txrx_tx_fp tx_fn;
 	struct wlan_dp_conn_info conn_info;
 
 	enum bss_intf_state bss_state;

+ 1 - 1
components/dp/core/src/wlan_dp_main.c

@@ -993,7 +993,7 @@ dp_vdev_obj_destroy_notification(struct wlan_objmgr_vdev *vdev, void *arg)
 			dp_err("eap frm done event destroy failed!!");
 			return status;
 		}
-		dp_intf->tx_fn = NULL;
+		dp_intf->txrx_ops.tx.tx = NULL;
 		dp_intf->sap_tx_block_mask |= DP_TX_FN_CLR;
 	}
 	qdf_mem_zero(&dp_intf->conn_info, sizeof(struct wlan_dp_conn_info));

+ 1 - 1
components/dp/core/src/wlan_dp_softap_txrx.c

@@ -680,7 +680,7 @@ QDF_STATUS dp_softap_start_xmit(qdf_nbuf_t nbuf, struct wlan_dp_intf *dp_intf)
 		goto drop_pkt_and_release_skb;
 	}
 
-	if (dp_intf->tx_fn(soc, dp_intf->intf_id, nbuf)) {
+	if (dp_intf->txrx_ops.tx.tx(soc, dp_intf->intf_id, nbuf)) {
 		dp_debug("Failed to send packet to txrx for sta: "
 			 QDF_MAC_ADDR_FMT,
 			 QDF_MAC_ADDR_REF(dest_mac_addr->bytes));

+ 4 - 4
components/dp/core/src/wlan_dp_txrx.c

@@ -679,14 +679,14 @@ dp_start_xmit(struct wlan_dp_intf *dp_intf, qdf_nbuf_t nbuf)
 	/*
 	 * If a transmit function is not registered, drop packet
 	 */
-	if (!dp_intf->tx_fn) {
+	if (!dp_intf->txrx_ops.tx.tx) {
 		dp_err("TX function not registered by the data path");
 		goto drop_pkt_and_release_nbuf;
 	}
 
 	dp_fix_broadcast_eapol(dp_intf, nbuf);
 
-	if (dp_intf->tx_fn(soc, dp_intf->intf_id, nbuf)) {
+	if (dp_intf->txrx_ops.tx.tx(soc, dp_intf->intf_id, nbuf)) {
 		dp_debug_rl("Failed to send packet from adapter %u",
 			    dp_intf->intf_id);
 		goto drop_pkt_and_release_nbuf;
@@ -1357,8 +1357,8 @@ QDF_STATUS dp_rx_pkt_thread_enqueue_cbk(void *intf_ctx,
 		return QDF_STATUS_E_FAILURE;
 
 	if (dp_intf->runtime_disable_rx_thread &&
-	    dp_intf->rx_stack)
-		return dp_intf->rx_stack(dp_intf, nbuf_list);
+	    dp_intf->txrx_ops.rx.rx_stack)
+		return dp_intf->txrx_ops.rx.rx_stack(dp_intf, nbuf_list);
 
 	intf_id = dp_intf->intf_id;
 

+ 6 - 7
components/dp/dispatcher/src/wlan_dp_ucfg_api.c

@@ -991,7 +991,6 @@ QDF_STATUS ucfg_dp_sta_register_txrx_ops(struct wlan_objmgr_vdev *vdev)
 		txrx_ops.rx.rx_stack = dp_rx_packet_cbk;
 		txrx_ops.rx.rx_flush = dp_rx_flush_packet_cbk;
 		txrx_ops.rx.rx_gro_flush = dp_rx_thread_gro_flush_ind_cbk;
-		dp_intf->rx_stack = dp_rx_packet_cbk;
 	} else {
 		txrx_ops.rx.rx = dp_rx_packet_cbk;
 		txrx_ops.rx.rx_stack = NULL;
@@ -1016,7 +1015,7 @@ QDF_STATUS ucfg_dp_sta_register_txrx_ops(struct wlan_objmgr_vdev *vdev)
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dp_intf->tx_fn = txrx_ops.tx.tx;
+	dp_intf->txrx_ops = txrx_ops;
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1041,7 +1040,6 @@ QDF_STATUS ucfg_dp_tdlsta_register_txrx_ops(struct wlan_objmgr_vdev *vdev)
 		txrx_ops.rx.rx_stack = dp_rx_packet_cbk;
 		txrx_ops.rx.rx_flush = dp_rx_flush_packet_cbk;
 		txrx_ops.rx.rx_gro_flush = dp_rx_thread_gro_flush_ind_cbk;
-		dp_intf->rx_stack = dp_rx_packet_cbk;
 	} else {
 		txrx_ops.rx.rx = dp_rx_packet_cbk;
 		txrx_ops.rx.rx_stack = NULL;
@@ -1066,7 +1064,7 @@ QDF_STATUS ucfg_dp_tdlsta_register_txrx_ops(struct wlan_objmgr_vdev *vdev)
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dp_intf->tx_fn = txrx_ops.tx.tx;
+	dp_intf->txrx_ops = txrx_ops;
 
 	return QDF_STATUS_SUCCESS;
 }
@@ -1096,7 +1094,7 @@ QDF_STATUS ucfg_dp_ocb_register_txrx_ops(struct wlan_objmgr_vdev *vdev)
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dp_intf->tx_fn = txrx_ops.tx.tx;
+	dp_intf->txrx_ops = txrx_ops;
 
 	qdf_copy_macaddr(&dp_intf->conn_info.peer_macaddr,
 			 &dp_intf->mac_addr);
@@ -1124,6 +1122,8 @@ QDF_STATUS ucfg_dp_mon_register_txrx_ops(struct wlan_objmgr_vdev *vdev)
 			  (ol_osif_vdev_handle)dp_intf,
 			  &txrx_ops);
 
+	dp_intf->txrx_ops = txrx_ops;
+
 	return QDF_STATUS_SUCCESS;
 }
 #endif
@@ -1148,7 +1148,6 @@ QDF_STATUS ucfg_dp_softap_register_txrx_ops(struct wlan_objmgr_vdev *vdev,
 		txrx_ops->rx.rx_stack = dp_softap_rx_packet_cbk;
 		txrx_ops->rx.rx_flush = dp_rx_flush_packet_cbk;
 		txrx_ops->rx.rx_gro_flush = dp_rx_thread_gro_flush_ind_cbk;
-		dp_intf->rx_stack = dp_softap_rx_packet_cbk;
 	} else {
 		txrx_ops->rx.rx = dp_softap_rx_packet_cbk;
 		txrx_ops->rx.rx_stack = NULL;
@@ -1165,7 +1164,7 @@ QDF_STATUS ucfg_dp_softap_register_txrx_ops(struct wlan_objmgr_vdev *vdev,
 		return QDF_STATUS_E_FAILURE;
 	}
 
-	dp_intf->tx_fn = txrx_ops->tx.tx;
+	dp_intf->txrx_ops = *txrx_ops;
 	dp_intf->sap_tx_block_mask &= ~DP_TX_FN_CLR;
 
 	return QDF_STATUS_SUCCESS;