Browse Source

qcacmn: cdp: Convergence of cdp_misc_ops

Currently the cdp apis are given pdev/vdev/peer
handle as its arguments, which is directly
accessed in those APIs. This can cause a
race-condition in access of the respective
handles, if it has been deleted in parallel.

Hence as a part of cdp convergence, pass only
the pdev/vdev id or peer mac address, which will be
used to get the respective handles, and hence
avoiding the unwanted access of the handles, if
it has been deleted.

Converged misc_ops
- tx_non_std
- get_opmode
- get_tx_ack_stats
- set_ibss_vdev_heart_beat_timer
- hl_tdls_flag_reset
- set_wisa_mode
- txrx_post_data_stall_event
- update_mac_id
- pkt_log_init
- pkt_log_con_service
- get_num_rx_contexts
- set_wmm_param
- flush_rx_frames
- bad_peer_txctl_set_setting
- bad_peer_txctl_update_threshold
- txrx_data_stall_cb_register
- txrx_data_stall_cb_deregister
- vdev_set_driver_del_ack_enable
- get_intra_bss_fwd_pkts_count
- mark_first_wakeup_packet
- register_pktdump_cb
- unregister_pktdump_cb
- pdev_reset_driver_del_ack
- runtime_suspend
- runtime_resume

CRs-Fixed: 2539811
Change-Id: I3080df033d6411d7078a322224b914bda2fddc0e
Rakesh Pillai 5 years ago
parent
commit
d295d1e81d

+ 5 - 4
dp/inc/cdp_txrx_cmn_struct.h

@@ -766,10 +766,11 @@ typedef void (*ol_txrx_stats_callback)(void *ctxt,
  * ol_txrx_pktdump_cb - callback for packet dump feature
  */
 typedef void (*ol_txrx_pktdump_cb)(ol_txrx_soc_handle soc,
-				struct cdp_vdev *vdev,
-				qdf_nbuf_t netbuf,
-				uint8_t status,
-				uint8_t type);
+				   uint8_t pdev_id,
+				   uint8_t vdev_id,
+				   qdf_nbuf_t netbuf,
+				   uint8_t status,
+				   uint8_t type);
 
 /**
  * ol_txrx_ops - (pointers to) the functions used for tx and rx

+ 11 - 6
dp/inc/cdp_txrx_flow_ctrl_legacy.h

@@ -30,13 +30,17 @@
 
 /**
  * cdp_hl_fc_register() - Register HL flow control callback.
- * @soc - data path soc handle
- * @flowcontrol - callback function pointer to stop/start OS netdev queues
+ * @soc: data path soc handle
+ * @pdev_id: datapath pdev identifier
+ * @flowcontrol: callback function pointer to stop/start OS netdev queues
+ *
  * Register flow control callback.
- * return 0 success
+ *
+ * Returns: 0 for success
  */
 static inline int
-cdp_hl_fc_register(ol_txrx_soc_handle soc, tx_pause_callback flowcontrol)
+cdp_hl_fc_register(ol_txrx_soc_handle soc, uint8_t pdev_id,
+		   tx_pause_callback flowcontrol)
 {
 	if (!soc || !soc->ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
@@ -49,7 +53,7 @@ cdp_hl_fc_register(ol_txrx_soc_handle soc, tx_pause_callback flowcontrol)
 	    !soc->ops->l_flowctl_ops->register_tx_flow_control)
 		return -EINVAL;
 
-	return soc->ops->l_flowctl_ops->register_tx_flow_control(soc,
+	return soc->ops->l_flowctl_ops->register_tx_flow_control(soc, pdev_id,
 								 flowcontrol);
 }
 
@@ -76,7 +80,8 @@ static inline int cdp_hl_fc_set_os_queue_status(ol_txrx_soc_handle soc,
 }
 #else
 static inline int
-cdp_hl_fc_register(ol_txrx_soc_handle soc, tx_pause_callback flowcontrol)
+cdp_hl_fc_register(ol_txrx_soc_handle soc, uint8_t pdev_id,
+		   tx_pause_callback flowcontrol)
 {
 	return 0;
 }

+ 119 - 101
dp/inc/cdp_txrx_misc.h

@@ -27,11 +27,10 @@
 #include "cdp_txrx_handle.h"
 /**
  * cdp_tx_non_std() - Allow the control-path SW to send data frames
- *
- * @soc - data path soc handle
- * @data_vdev - which vdev should transmit the tx data frames
- * @tx_spec - what non-standard handling to apply to the tx data frames
- * @msdu_list - NULL-terminated list of tx MSDUs
+ * @soc: data path soc handle
+ * @vdev_id: id of vdev
+ * @tx_spec: what non-standard handling to apply to the tx data frames
+ * @msdu_list: NULL-terminated list of tx MSDUs
  *
  * Generally, all tx data frames come from the OS shim into the txrx layer.
  * However, there are rare cases such as TDLS messaging where the UMAC
@@ -49,8 +48,8 @@
  *  Return: null - success, skb - failure
  */
 static inline qdf_nbuf_t
-cdp_tx_non_std(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
-		enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
+cdp_tx_non_std(ol_txrx_soc_handle soc, uint8_t vdev_id,
+	       enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_DEBUG,
@@ -59,23 +58,23 @@ cdp_tx_non_std(ol_txrx_soc_handle soc, struct cdp_vdev *vdev,
 	}
 
 	if (soc->ops->misc_ops->tx_non_std)
-		return soc->ops->misc_ops->tx_non_std(
-			vdev, tx_spec, msdu_list);
+		return soc->ops->misc_ops->tx_non_std(soc, vdev_id, tx_spec,
+						      msdu_list);
 	return NULL;
 }
 
 /**
  * cdp_set_ibss_vdev_heart_beat_timer() - Update ibss vdev heart
  * beat timer
- * @soc - data path soc handle
- * @vdev - vdev handle
- * @timer_value_sec - new heart beat timer value
+ * @soc: data path soc handle
+ * @vdev_id: id of vdev
+ * @timer_value_sec: new heart beat timer value
  *
  * Return: Old timer value set in vdev.
  */
 static inline uint16_t
 cdp_set_ibss_vdev_heart_beat_timer(ol_txrx_soc_handle soc,
-		struct cdp_vdev *vdev, uint16_t timer_value_sec)
+				   uint8_t vdev_id, uint16_t timer_value_sec)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -85,21 +84,21 @@ cdp_set_ibss_vdev_heart_beat_timer(ol_txrx_soc_handle soc,
 
 	if (soc->ops->misc_ops->set_ibss_vdev_heart_beat_timer)
 		return soc->ops->misc_ops->set_ibss_vdev_heart_beat_timer(
-			vdev, timer_value_sec);
+			soc, vdev_id, timer_value_sec);
 
 	return 0;
 }
 
 /**
  * cdp_set_wisa_mode() - set wisa mode
- * @soc - data path soc handle
- * @vdev - vdev handle
- * @enable - enable or disable
+ * @soc: data path soc handle
+ * @vdev_id: vdev_id
+ * @enable: enable or disable
  *
  * Return: QDF_STATUS_SUCCESS mode enable success
  */
 static inline QDF_STATUS
-cdp_set_wisa_mode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool enable)
+cdp_set_wisa_mode(ol_txrx_soc_handle soc, uint8_t vdev_id, bool enable)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -108,18 +107,20 @@ cdp_set_wisa_mode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool enable)
 	}
 
 	if (soc->ops->misc_ops->set_wisa_mode)
-		return soc->ops->misc_ops->set_wisa_mode(vdev, enable);
+		return soc->ops->misc_ops->set_wisa_mode(soc, vdev_id, enable);
 	return QDF_STATUS_SUCCESS;
 }
 
 /**
  * cdp_data_stall_cb_register() - register data stall callback
- * @soc - data path soc handle
- * @cb - callback function
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
+ * @cb: callback function
  *
  * Return: QDF_STATUS_SUCCESS register success
  */
 static inline QDF_STATUS cdp_data_stall_cb_register(ol_txrx_soc_handle soc,
+						    uint8_t pdev_id,
 						    data_stall_detect_cb cb)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
@@ -129,18 +130,21 @@ static inline QDF_STATUS cdp_data_stall_cb_register(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->txrx_data_stall_cb_register)
-		return soc->ops->misc_ops->txrx_data_stall_cb_register(cb);
+		return soc->ops->misc_ops->txrx_data_stall_cb_register(
+							soc, pdev_id, cb);
 	return QDF_STATUS_SUCCESS;
 }
 
 /**
  * cdp_data_stall_cb_deregister() - de-register data stall callback
- * @soc - data path soc handle
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
  * @cb - callback function
  *
  * Return: QDF_STATUS_SUCCESS de-register success
  */
 static inline QDF_STATUS cdp_data_stall_cb_deregister(ol_txrx_soc_handle soc,
+						      uint8_t pdev_id,
 						      data_stall_detect_cb cb)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
@@ -150,13 +154,14 @@ static inline QDF_STATUS cdp_data_stall_cb_deregister(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->txrx_data_stall_cb_deregister)
-		return soc->ops->misc_ops->txrx_data_stall_cb_deregister(cb);
+		return soc->ops->misc_ops->txrx_data_stall_cb_deregister(
+							soc, pdev_id, cb);
 	return QDF_STATUS_SUCCESS;
 }
 
 /**
  * cdp_post_data_stall_event() - post data stall event
- * @soc - data path soc handle
+ * @soc: data path soc handle
  * @indicator: Module triggering data stall
  * @data_stall_type: data stall event type
  * @pdev_id: pdev id
@@ -184,21 +189,21 @@ cdp_post_data_stall_event(ol_txrx_soc_handle soc,
 		return;
 
 	soc->ops->misc_ops->txrx_post_data_stall_event(
-				indicator, data_stall_type, pdev_id,
+				soc, indicator, data_stall_type, pdev_id,
 				vdev_id_bitmap, recovery_type);
 }
 
 /**
  * cdp_set_wmm_param() - set wmm parameter
- * @soc - data path soc handle
- * @pdev - device instance pointer
- * @wmm_param - wmm parameter
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
+ * @wmm_param: wmm parameter
  *
  * Return: none
  */
 static inline void
-cdp_set_wmm_param(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
-		      struct ol_tx_wmm_param_t wmm_param)
+cdp_set_wmm_param(ol_txrx_soc_handle soc, uint8_t pdev_id,
+		  struct ol_tx_wmm_param_t wmm_param)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -207,21 +212,21 @@ cdp_set_wmm_param(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	}
 
 	if (soc->ops->misc_ops->set_wmm_param)
-		return soc->ops->misc_ops->set_wmm_param(
-			pdev, wmm_param);
+		return soc->ops->misc_ops->set_wmm_param(soc, pdev_id,
+							 wmm_param);
 
 	return;
 }
 
 /**
  * cdp_runtime_suspend() - suspend
- * @soc - data path soc handle
- * @pdev - device instance pointer
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
  *
  * Return: QDF_STATUS_SUCCESS suspend success
  */
 static inline QDF_STATUS cdp_runtime_suspend(ol_txrx_soc_handle soc,
-		struct cdp_pdev *pdev)
+					     uint8_t pdev_id)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -230,20 +235,20 @@ static inline QDF_STATUS cdp_runtime_suspend(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->runtime_suspend)
-		return soc->ops->misc_ops->runtime_suspend(pdev);
+		return soc->ops->misc_ops->runtime_suspend(soc, pdev_id);
 
 	return QDF_STATUS_SUCCESS;
 }
 
 /**
  * cdp_runtime_resume() - resume
- * @soc - data path soc handle
- * @pdev - device instance pointer
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
  *
  * Return: QDF_STATUS_SUCCESS suspend success
  */
 static inline QDF_STATUS cdp_runtime_resume(ol_txrx_soc_handle soc,
-		struct cdp_pdev *pdev)
+					    uint8_t pdev_id)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -252,21 +257,21 @@ static inline QDF_STATUS cdp_runtime_resume(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->runtime_resume)
-		return soc->ops->misc_ops->runtime_resume(pdev);
+		return soc->ops->misc_ops->runtime_resume(soc, pdev_id);
 
 	return QDF_STATUS_SUCCESS;
 }
 
 /**
  * cdp_hl_tdls_flag_reset() - tdls flag reset
- * @soc - data path soc handle
- * @vdev - virtual interface handle pointer
- * @flag
+ * @soc: data path soc handle
+ * @vdev_id: id of vdev
+ * @flag: flag indicating to set/reset tdls
  *
  * Return: none
  */
 static inline void
-cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool flag)
+cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, uint8_t vdev_id, bool flag)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -275,15 +280,16 @@ cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool flag)
 	}
 
 	if (soc->ops->misc_ops->hl_tdls_flag_reset)
-		return soc->ops->misc_ops->hl_tdls_flag_reset(vdev, flag);
+		return soc->ops->misc_ops->hl_tdls_flag_reset(soc, vdev_id,
+							      flag);
 
 	return;
 }
 
 /**
  * cdp_get_opmode() - get vdev operation mode
- * @soc - data path soc handle
- * @vdev - virtual interface instance
+ * @soc: data path soc handle
+ * @vdev_id: id of vdev
  *
  * Return virtual device operational mode
  *      op_mode_ap,
@@ -296,7 +302,7 @@ cdp_hl_tdls_flag_reset(ol_txrx_soc_handle soc, struct cdp_vdev *vdev, bool flag)
  *        0 unknown interface
  */
 static inline int
-cdp_get_opmode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
+cdp_get_opmode(ol_txrx_soc_handle soc, uint8_t vdev_id)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -305,7 +311,8 @@ cdp_get_opmode(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 	}
 
 	if (soc->ops->misc_ops->get_opmode)
-		return soc->ops->misc_ops->get_opmode(vdev);
+		return soc->ops->misc_ops->get_opmode(soc, vdev_id);
+
 	return 0;
 }
 
@@ -336,15 +343,13 @@ cdp_get_vdev_id(ol_txrx_soc_handle soc, struct cdp_vdev *vdev)
 /**
  * cdp_get_tx_ack_stats() - get tx ack count for vdev
  * @soc - data path soc handle
- * @pdev - data path device instance
  * @vdev_id - vdev id
  *
  * return tx ack count
  *          0 invalid count
  */
 static inline uint32_t
-cdp_get_tx_ack_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
-		     uint8_t vdev_id)
+cdp_get_tx_ack_stats(ol_txrx_soc_handle soc, uint8_t vdev_id)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -353,26 +358,24 @@ cdp_get_tx_ack_stats(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	}
 
 	if (soc->ops->misc_ops->get_tx_ack_stats)
-		return soc->ops->misc_ops->get_tx_ack_stats(pdev, vdev_id);
+		return soc->ops->misc_ops->get_tx_ack_stats(soc, vdev_id);
 
 	return 0;
 }
 
 /**
- * cdp_bad_peer_txctl_set_setting() - TBD
- * @soc - data path soc handle
- * @pdev - data path device instance
- * @enable -
- * @period -
- * @txq_limit -
- *
- * TBD
+ * cdp_bad_peer_txctl_set_setting() - Set peer timer balance parameters
+ * @soc: data path soc handle
+ * @pdev_id: id of datapath pdev handle
+ * @enable: enable/disable peer balance state
+ * @period: balance timer period for peer
+ * @txq_limit: txp limit for peer
  *
  * Return: none
  */
 static inline void
-cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
-		int enable, int period, int txq_limit)
+cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, uint8_t pdev_id,
+			       int enable, int period, int txq_limit)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -381,18 +384,19 @@ cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
 	}
 
 	if (soc->ops->misc_ops->bad_peer_txctl_set_setting)
-		return soc->ops->misc_ops->bad_peer_txctl_set_setting(pdev,
-			enable, period, txq_limit);
+		return soc->ops->misc_ops->bad_peer_txctl_set_setting(
+					soc, pdev_id, enable, period,
+					txq_limit);
 	return;
 }
 
 /**
  * cdp_bad_peer_txctl_update_threshold() - TBD
- * @soc - data path soc handle
- * @pdev - data path device instance
- * @level -
- * @tput_thresh -
- * @tx_limit -
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
+ * @level: index of the threshold configuration
+ * @tput_thresh: peer balance throughput threshold
+ * @tx_limit: peer balance tx limit threshold
  *
  * TBD
  *
@@ -400,8 +404,8 @@ cdp_bad_peer_txctl_set_setting(ol_txrx_soc_handle soc, struct cdp_pdev *pdev,
  */
 static inline void
 cdp_bad_peer_txctl_update_threshold(ol_txrx_soc_handle soc,
-		struct cdp_pdev *pdev,
-		int level, int tput_thresh, int tx_limit)
+				    uint8_t pdev_id, int level,
+				    int tput_thresh, int tx_limit)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -411,20 +415,21 @@ cdp_bad_peer_txctl_update_threshold(ol_txrx_soc_handle soc,
 
 	if (soc->ops->misc_ops->bad_peer_txctl_update_threshold)
 		return soc->ops->misc_ops->bad_peer_txctl_update_threshold(
-			pdev, level, tput_thresh, tx_limit);
+			soc, pdev_id, level, tput_thresh, tx_limit);
 	return;
 }
 
 /**
  * cdp_mark_first_wakeup_packet() - set flag to indicate that
  *    fw is compatible for marking first packet after wow wakeup
- * @soc - data path soc handle
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
  * @value: 1 for enabled/ 0 for disabled
  *
  * Return: None
  */
 static inline void cdp_mark_first_wakeup_packet(ol_txrx_soc_handle soc,
-		uint8_t value)
+						uint8_t pdev_id, uint8_t value)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -433,21 +438,22 @@ static inline void cdp_mark_first_wakeup_packet(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->mark_first_wakeup_packet)
-		return soc->ops->misc_ops->mark_first_wakeup_packet(value);
+		return soc->ops->misc_ops->mark_first_wakeup_packet(
+							soc, pdev_id, value);
 	return;
 }
 
 
 /**
  * cds_update_mac_id() - update mac_id for vdev
- * @soc - data path soc handle
+ * @psoc: data path soc handle
  * @vdev_id: vdev id
  * @mac_id: mac id
  *
  * Return: none
  */
 static inline void cdp_update_mac_id(void *psoc, uint8_t vdev_id,
-		uint8_t mac_id)
+				     uint8_t mac_id)
 {
 	ol_txrx_soc_handle soc = psoc;
 
@@ -458,20 +464,21 @@ static inline void cdp_update_mac_id(void *psoc, uint8_t vdev_id,
 	}
 
 	if (soc->ops->misc_ops->update_mac_id)
-		return soc->ops->misc_ops->update_mac_id(vdev_id, mac_id);
+		return soc->ops->misc_ops->update_mac_id(soc, vdev_id, mac_id);
 	return;
 }
 
 /**
  * cdp_flush_rx_frames() - flush cached rx frames
- * @soc - data path soc handle
- * @peer: peer
+ * @soc: data path soc handle
+ * @pdev_id: datapath pdev identifier
+ * @peer_mac: peer mac address
  * @drop: set flag to drop frames
  *
  * Return: None
  */
-static inline void cdp_flush_rx_frames(ol_txrx_soc_handle soc, void *peer,
-		bool drop)
+static inline void cdp_flush_rx_frames(ol_txrx_soc_handle soc, uint8_t pdev_id,
+				       uint8_t *peer_mac, bool drop)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -480,13 +487,15 @@ static inline void cdp_flush_rx_frames(ol_txrx_soc_handle soc, void *peer,
 	}
 
 	if (soc->ops->misc_ops->flush_rx_frames)
-		return soc->ops->misc_ops->flush_rx_frames(peer, drop);
+		return soc->ops->misc_ops->flush_rx_frames(soc, pdev_id,
+							   peer_mac, drop);
 	return;
 }
 
 /*
  * cdp_get_intra_bss_fwd_pkts_count() - to get the total tx and rx packets
  *   that has been forwarded from txrx layer without going to upper layers.
+ * @soc: Datapath soc handle
  * @vdev_id: vdev id
  * @fwd_tx_packets: pointer to forwarded tx packets count parameter
  * @fwd_rx_packets: pointer to forwarded rx packets count parameter
@@ -505,20 +514,21 @@ static inline A_STATUS cdp_get_intra_bss_fwd_pkts_count(
 
 	if (soc->ops->misc_ops->get_intra_bss_fwd_pkts_count)
 		return soc->ops->misc_ops->get_intra_bss_fwd_pkts_count(
-			vdev_id, fwd_tx_packets, fwd_rx_packets);
+			soc, vdev_id, fwd_tx_packets, fwd_rx_packets);
 
 	return 0;
 }
 
 /**
  * cdp_pkt_log_init() - API to initialize packet log
- * @handle: pdev handle
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
  * @scn: HIF context
  *
  * Return: void
  */
 static inline void cdp_pkt_log_init(ol_txrx_soc_handle soc,
-		struct cdp_pdev *pdev, void *scn)
+				    uint8_t pdev_id, void *scn)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -527,20 +537,21 @@ static inline void cdp_pkt_log_init(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->pkt_log_init)
-		return soc->ops->misc_ops->pkt_log_init(pdev, scn);
+		return soc->ops->misc_ops->pkt_log_init(soc, pdev_id, scn);
 
 	return;
 }
 
 /**
  * cdp_pkt_log_con_service() - API to connect packet log service
- * @handle: pdev handle
+ * @soc: data path soc handle
+ * @pdev_id: id of data path pdev handle
  * @scn: HIF context
  *
  * Return: void
  */
 static inline void cdp_pkt_log_con_service(ol_txrx_soc_handle soc,
-		struct cdp_pdev *pdev, void *scn)
+					   uint8_t pdev_id, void *scn)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -549,7 +560,8 @@ static inline void cdp_pkt_log_con_service(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->pkt_log_con_service)
-		return soc->ops->misc_ops->pkt_log_con_service(pdev, scn);
+		return soc->ops->misc_ops->pkt_log_con_service(
+						soc, pdev_id, scn);
 
 	return;
 }
@@ -581,12 +593,14 @@ static inline int cdp_get_num_rx_contexts(ol_txrx_soc_handle soc)
  * stats will be passed to user-space by @tx_cb/@rx_cb.
  *
  * @soc: soc handle
+ * @pdev_id: id of data path pdev handle
  * @tx_cb: tx packet callback
  * @rx_cb: rx packet callback
  *
  * Return: void
  */
 static inline void cdp_register_packetdump_cb(ol_txrx_soc_handle soc,
+					      uint8_t pdev_id,
 					      ol_txrx_pktdump_cb tx_cb,
 					      ol_txrx_pktdump_cb rx_cb)
 {
@@ -597,7 +611,8 @@ static inline void cdp_register_packetdump_cb(ol_txrx_soc_handle soc,
 	}
 
 	if (soc->ops->misc_ops->register_pktdump_cb)
-		return soc->ops->misc_ops->register_pktdump_cb(tx_cb, rx_cb);
+		return soc->ops->misc_ops->register_pktdump_cb(
+						soc, pdev_id, tx_cb, rx_cb);
 }
 
 /**
@@ -606,10 +621,12 @@ static inline void cdp_register_packetdump_cb(ol_txrx_soc_handle soc,
  * Deregister callback for TX/RX data packets.
  *
  * @soc: soc handle
+ * @pdev_id: id of data path pdev handle
  *
  * Return: void
  */
-static inline void cdp_deregister_packetdump_cb(ol_txrx_soc_handle soc)
+static inline void cdp_deregister_packetdump_cb(ol_txrx_soc_handle soc,
+						uint8_t pdev_id)
 {
 	if (!soc || !soc->ops || !soc->ops->misc_ops) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_FATAL,
@@ -618,7 +635,7 @@ static inline void cdp_deregister_packetdump_cb(ol_txrx_soc_handle soc)
 	}
 
 	if (soc->ops->misc_ops->unregister_pktdump_cb)
-		return soc->ops->misc_ops->unregister_pktdump_cb();
+		return soc->ops->misc_ops->unregister_pktdump_cb(soc, pdev_id);
 }
 
 typedef void (*rx_mic_error_callback)(void *scn_handle,
@@ -648,13 +665,13 @@ cdp_register_rx_mic_error_ind_handler(ol_txrx_soc_handle soc,
 
 /**
  * cdp_pdev_reset_driver_del_ack() - reset driver TCP delayed ack flag
- * @soc - data path soc handle
- * @pdev - data path device instance
+ * @soc: data path soc handle
+ * @pdev_id: pdev id
  *
  * Return: none
  */
 static inline void cdp_pdev_reset_driver_del_ack(void *psoc,
-						 struct cdp_pdev *pdev)
+						 uint8_t pdev_id)
 {
 	ol_txrx_soc_handle soc = psoc;
 
@@ -665,12 +682,13 @@ static inline void cdp_pdev_reset_driver_del_ack(void *psoc,
 	}
 
 	if (soc->ops->misc_ops->pdev_reset_driver_del_ack)
-		return soc->ops->misc_ops->pdev_reset_driver_del_ack(pdev);
+		return soc->ops->misc_ops->pdev_reset_driver_del_ack(soc,
+								     pdev_id);
 }
 
 /*
  * cdp_vdev_set_driver_del_ack_enable() - set driver delayed ack enabled flag
- * @soc - data path soc handle
+ * @soc: data path soc handle
  * @vdev_id: vdev id
  * @rx_packets: number of rx packets
  * @time_in_ms: time in ms
@@ -694,6 +712,6 @@ static inline void cdp_vdev_set_driver_del_ack_enable(ol_txrx_soc_handle soc,
 
 	if (soc->ops->misc_ops->vdev_set_driver_del_ack_enable)
 		return soc->ops->misc_ops->vdev_set_driver_del_ack_enable(
-			vdev_id, rx_packets, time_in_ms, high_th, low_th);
+			soc, vdev_id, rx_packets, time_in_ms, high_th, low_th);
 }
 #endif /* _CDP_TXRX_MISC_H_ */

+ 86 - 46
dp/inc/cdp_txrx_ops.h

@@ -1016,61 +1016,100 @@ struct ol_if_ops {
 #ifdef DP_PEER_EXTENDED_API
 /**
  * struct cdp_misc_ops - mcl ops not classified
- * @set_ibss_vdev_heart_beat_timer:
- * @bad_peer_txctl_set_setting:
- * @bad_peer_txctl_update_threshold:
- * @hl_tdls_flag_reset:
- * @tx_non_std:
- * @get_vdev_id:
- * @set_wisa_mode:
- * @txrx_data_stall_cb_register:
- * @txrx_data_stall_cb_deregister:
- * @txrx_post_data_stall_event
- * @runtime_suspend:
- * @runtime_resume:
- * @register_packetdump_cb:
- * @unregister_packetdump_cb:
- * @pdev_reset_driver_del_ack:
- * @vdev_set_driver_del_ack_enable:
+ * @set_ibss_vdev_heart_beat_timer: Update ibss vdev heart beat timer
+ * @set_wmm_param: set wmm parameters
+ * @bad_peer_txctl_set_setting: configure bad peer tx limit setting
+ * @bad_peer_txctl_update_threshold: configure bad peer tx threshold limit
+ * @hl_tdls_flag_reset: reset tdls flag for vdev
+ * @tx_non_std: Allow the control-path SW to send data frames
+ * @get_vdev_id: get vdev id
+ * @set_wisa_mode: set wisa mode for a vdev
+ * @txrx_data_stall_cb_register: register data stall callback
+ * @txrx_data_stall_cb_deregister: deregister data stall callback
+ * @txrx_post_data_stall_event: post data stall event
+ * @runtime_suspend: ensure TXRX is ready to runtime suspend
+ * @runtime_resume: ensure TXRX is ready to runtime resume
+ * @get_opmode: get operation mode of vdev
+ * @mark_first_wakeup_packet: set flag to indicate that fw is compatible for
+			      marking first packet after wow wakeup
+ * @update_mac_id: update mac_id for vdev
+ * @flush_rx_frames: flush rx frames on the queue
+ * @get_intra_bss_fwd_pkts_count: to get the total tx and rx packets that
+				  has been forwarded from txrx layer
+				  without going to upper layers
+ * @pkt_log_init: handler to initialize packet log
+ * @pkt_log_con_service: handler to connect packet log service
+ * @get_num_rx_contexts: handler to get number of RX contexts
+ * @register_packetdump_cb: register callback for different pktlog
+ * @unregister_packetdump_cb: unregister callback for different pktlog
+ * @pdev_reset_driver_del_ack: reset driver delayed ack enabled flag
+ * @vdev_set_driver_del_ack_enable: set driver delayed ack enabled flag
+ *
+ * Function pointers for miscellaneous soc/pdev/vdev related operations.
  */
 struct cdp_misc_ops {
-	uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_vdev *vdev,
-			uint16_t timer_value_sec);
-	void (*set_wmm_param)(struct cdp_pdev *cfg_pdev,
-			struct ol_tx_wmm_param_t wmm_param);
-	void (*bad_peer_txctl_set_setting)(struct cdp_pdev *pdev, int enable,
-			int period, int txq_limit);
-	void (*bad_peer_txctl_update_threshold)(struct cdp_pdev *pdev,
-		int level, int tput_thresh, int tx_limit);
-	void (*hl_tdls_flag_reset)(struct cdp_vdev *vdev, bool flag);
-	qdf_nbuf_t (*tx_non_std)(struct cdp_vdev *vdev,
-		enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
+	uint16_t (*set_ibss_vdev_heart_beat_timer)(struct cdp_soc_t *soc_hdl,
+						   uint8_t vdev_id,
+						   uint16_t timer_value_sec);
+	void (*set_wmm_param)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
+			      struct ol_tx_wmm_param_t wmm_param);
+	void (*bad_peer_txctl_set_setting)(struct cdp_soc_t *soc_hdl,
+					   uint8_t pdev_id, int enable,
+					   int period, int txq_limit);
+	void (*bad_peer_txctl_update_threshold)(struct cdp_soc_t *soc_hdl,
+						uint8_t pdev_id,
+						int level, int tput_thresh,
+						int tx_limit);
+	void (*hl_tdls_flag_reset)(struct cdp_soc_t *soc_hdl,
+				   uint8_t vdev_id, bool flag);
+	qdf_nbuf_t (*tx_non_std)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
+				 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
 	uint16_t (*get_vdev_id)(struct cdp_vdev *vdev);
-	uint32_t (*get_tx_ack_stats)(struct cdp_pdev *pdev, uint8_t vdev_id);
-	QDF_STATUS (*set_wisa_mode)(struct cdp_vdev *vdev, bool enable);
-	QDF_STATUS (*txrx_data_stall_cb_register)(data_stall_detect_cb cb);
-	QDF_STATUS (*txrx_data_stall_cb_deregister)(data_stall_detect_cb cb);
+	uint32_t (*get_tx_ack_stats)(struct cdp_soc_t *soc_hdl,
+				     uint8_t vdev_id);
+	QDF_STATUS (*set_wisa_mode)(struct cdp_soc_t *soc_hdl,
+				    uint8_t vdev_id, bool enable);
+	QDF_STATUS (*txrx_data_stall_cb_register)(struct cdp_soc_t *soc_hdl,
+						  uint8_t pdev_id,
+						  data_stall_detect_cb cb);
+	QDF_STATUS (*txrx_data_stall_cb_deregister)(struct cdp_soc_t *soc_hdl,
+						    uint8_t pdev_id,
+						    data_stall_detect_cb cb);
 	void (*txrx_post_data_stall_event)(
+			struct cdp_soc_t *soc_hdl,
 			enum data_stall_log_event_indicator indicator,
 			enum data_stall_log_event_type data_stall_type,
 			uint32_t pdev_id, uint32_t vdev_id_bitmap,
 			enum data_stall_log_recovery_type recovery_type);
-	QDF_STATUS (*runtime_suspend)(struct cdp_pdev *pdev);
-	QDF_STATUS (*runtime_resume)(struct cdp_pdev *pdev);
-	int (*get_opmode)(struct cdp_vdev *vdev);
-	void (*mark_first_wakeup_packet)(uint8_t value);
-	void (*update_mac_id)(uint8_t vdev_id, uint8_t mac_id);
-	void (*flush_rx_frames)(void *peer, bool drop);
-	A_STATUS (*get_intra_bss_fwd_pkts_count)(uint8_t vdev_id,
-		uint64_t *fwd_tx_packets, uint64_t *fwd_rx_packets);
-	void (*pkt_log_init)(struct cdp_pdev *handle, void *scn);
-	void (*pkt_log_con_service)(struct cdp_pdev *pdev, void *scn);
-	int (*get_num_rx_contexts)(struct cdp_soc_t *soc);
-	void (*register_pktdump_cb)(ol_txrx_pktdump_cb tx_cb,
+	QDF_STATUS (*runtime_suspend)(struct cdp_soc_t *soc_hdl,
+				      uint8_t pdev_id);
+	QDF_STATUS (*runtime_resume)(struct cdp_soc_t *soc_hdl,
+				     uint8_t pdev_id);
+	int (*get_opmode)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id);
+	void (*mark_first_wakeup_packet)(struct cdp_soc_t *soc_hdl,
+					 uint8_t pdev_id, uint8_t value);
+	void (*update_mac_id)(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
+			      uint8_t mac_id);
+	void (*flush_rx_frames)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
+				void *peer, bool drop);
+	A_STATUS(*get_intra_bss_fwd_pkts_count)(struct cdp_soc_t *soc_hdl,
+						uint8_t vdev_id,
+						uint64_t *fwd_tx_packets,
+						uint64_t *fwd_rx_packets);
+	void (*pkt_log_init)(struct cdp_soc_t *soc_hdl, uint8_t pdev,
+			     void *scn);
+	void (*pkt_log_con_service)(struct cdp_soc_t *soc_hdl,
+				    uint8_t pdev_id, void *scn);
+	int (*get_num_rx_contexts)(struct cdp_soc_t *soc_hdl);
+	void (*register_pktdump_cb)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id,
+				    ol_txrx_pktdump_cb tx_cb,
 				    ol_txrx_pktdump_cb rx_cb);
-	void (*unregister_pktdump_cb)(void);
-	void (*pdev_reset_driver_del_ack)(struct cdp_pdev *ppdev);
-	void (*vdev_set_driver_del_ack_enable)(uint8_t vdev_id,
+	void (*unregister_pktdump_cb)(struct cdp_soc_t *soc_hdl,
+				      uint8_t pdev_id);
+	void (*pdev_reset_driver_del_ack)(struct cdp_soc_t *soc_hdl,
+					  uint8_t pdev_id);
+	void (*vdev_set_driver_del_ack_enable)(struct cdp_soc_t *soc_hdl,
+					       uint8_t vdev_id,
 					       unsigned long rx_packets,
 					       uint32_t time_in_ms,
 					       uint32_t high_th,
@@ -1279,6 +1318,7 @@ struct cdp_flowctl_ops {
 struct cdp_lflowctl_ops {
 #ifdef QCA_HL_NETDEV_FLOW_CONTROL
 	int (*register_tx_flow_control)(struct cdp_soc_t *soc_hdl,
+					uint8_t pdev_id,
 					tx_pause_callback flowcontrol);
 	int (*set_vdev_tx_desc_limit)(struct cdp_soc_t *soc_hdl,
 				      uint8_t vdev_id, uint8_t chan);

+ 1 - 1
dp/wifi3.0/dp_internal.h

@@ -1261,7 +1261,7 @@ int dp_wdi_event_detach(struct dp_pdev *txrx_pdev);
 int dp_set_pktlog_wifi3(struct dp_pdev *pdev, uint32_t event,
 	bool enable);
 void *dp_get_pldev(struct cdp_pdev *txrx_pdev);
-void dp_pkt_log_init(struct cdp_pdev *ppdev, void *scn);
+void dp_pkt_log_init(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *scn);
 
 static inline void
 dp_hif_update_pipe_callback(struct dp_soc *dp_soc,

+ 44 - 23
dp/wifi3.0/dp_main.c

@@ -355,14 +355,22 @@ static void dp_service_mon_rings(void *arg)
 #ifndef REMOVE_PKT_LOG
 /**
  * dp_pkt_log_init() - API to initialize packet log
- * @ppdev: physical device handle
+ * @soc_hdl: Datapath soc handle
+ * @pdev_id: id of data path pdev handle
  * @scn: HIF context
  *
  * Return: none
  */
-void dp_pkt_log_init(struct cdp_pdev *ppdev, void *scn)
+void dp_pkt_log_init(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *scn)
 {
-	struct dp_pdev *handle = (struct dp_pdev *)ppdev;
+	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
+	struct dp_pdev *handle =
+		dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
+
+	if (!handle) {
+		dp_err("pdev handle is NULL");
+		return;
+	}
 
 	if (handle->pkt_log_init) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_ERROR,
@@ -384,16 +392,16 @@ void dp_pkt_log_init(struct cdp_pdev *ppdev, void *scn)
 
 /**
  * dp_pkt_log_con_service() - connect packet log service
- * @ppdev: physical device handle
+ * @soc_hdl: Datapath soc handle
+ * @pdev_id: id of data path pdev handle
  * @scn: device context
  *
  * Return: none
  */
-static void dp_pkt_log_con_service(struct cdp_pdev *ppdev, void *scn)
+static void dp_pkt_log_con_service(struct cdp_soc_t *soc_hdl,
+				   uint8_t pdev_id, void *scn)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)ppdev;
-
-	dp_pkt_log_init((struct cdp_pdev *)pdev, scn);
+	dp_pkt_log_init(soc_hdl, pdev_id, scn);
 	pktlog_htc_attach();
 }
 
@@ -6166,9 +6174,15 @@ static struct cdp_vdev *dp_get_mon_vdev_from_pdev_wifi3(struct cdp_pdev *dev)
 	return (struct cdp_vdev *)pdev->monitor_vdev;
 }
 
-static int dp_get_opmode(struct cdp_vdev *vdev_handle)
+static int dp_get_opmode(struct cdp_soc_t *soc_hdl, uint8_t vdev_id)
 {
-	struct dp_vdev *vdev = (struct dp_vdev *)vdev_handle;
+	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
+	struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3(soc, vdev_id);
+
+	if (!vdev) {
+		dp_err("vdev for id %d is NULL", vdev_id);
+		return -EINVAL;
+	}
 
 	return vdev->opmode;
 }
@@ -9391,19 +9405,26 @@ static struct cdp_pflow_ops dp_ops_pflow = {
 #ifdef FEATURE_RUNTIME_PM
 /**
  * dp_runtime_suspend() - ensure DP is ready to runtime suspend
- * @opaque_pdev: DP pdev context
+ * @soc_hdl: Datapath soc handle
+ * @pdev_id: id of data path pdev handle
  *
  * DP is ready to runtime suspend if there are no pending TX packets.
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS dp_runtime_suspend(struct cdp_pdev *opaque_pdev)
+static QDF_STATUS dp_runtime_suspend(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)opaque_pdev;
-	struct dp_soc *soc = pdev->soc;
+	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
+	struct dp_pdev *pdev;
+
+	pdev = dp_get_pdev_from_soc_pdev_id_wifi3(soc, pdev_id);
+	if (!pdev) {
+		dp_err("pdev is NULL");
+		return QDF_STATUS_E_INVAL;
+	}
 
 	/* Abort if there are any pending TX packets */
-	if (dp_get_tx_pending(opaque_pdev) > 0) {
+	if (dp_get_tx_pending(dp_pdev_to_cdp_pdev(pdev)) > 0) {
 		QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO,
 			  FL("Abort suspend due to pending TX packets"));
 		return QDF_STATUS_E_AGAIN;
@@ -9439,16 +9460,16 @@ void dp_flush_ring_hptp(struct dp_soc *soc, hal_ring_handle_t hal_srng)
 
 /**
  * dp_runtime_resume() - ensure DP is ready to runtime resume
- * @opaque_pdev: DP pdev context
+ * @soc_hdl: Datapath soc handle
+ * @pdev_id: id of data path pdev handle
  *
  * Resume DP for runtime PM.
  *
  * Return: QDF_STATUS
  */
-static QDF_STATUS dp_runtime_resume(struct cdp_pdev *opaque_pdev)
+static QDF_STATUS dp_runtime_resume(struct cdp_soc_t *soc_hdl, uint8_t pdev_id)
 {
-	struct dp_pdev *pdev = (struct dp_pdev *)opaque_pdev;
-	struct dp_soc *soc = pdev->soc;
+	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
 	int i;
 
 	if (soc->intr_mode == DP_INTR_POLL)
@@ -9466,18 +9487,18 @@ static QDF_STATUS dp_runtime_resume(struct cdp_pdev *opaque_pdev)
 
 /**
  * dp_tx_get_success_ack_stats() - get tx success completion count
- * @opaque_pdev: dp pdev context
+ * @soc_hdl: Datapath soc handle
  * @vdevid: vdev identifier
  *
  * Return: tx success ack count
  */
-static uint32_t dp_tx_get_success_ack_stats(struct cdp_pdev *pdev,
+static uint32_t dp_tx_get_success_ack_stats(struct cdp_soc_t *soc_hdl,
 					    uint8_t vdev_id)
 {
-	struct dp_soc *soc = ((struct dp_pdev *)pdev)->soc;
+	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
 	struct dp_vdev *vdev =
 		(struct dp_vdev *)dp_get_vdev_from_soc_vdev_id_wifi3(soc,
-								 vdev_id);
+								     vdev_id);
 	struct cdp_vdev_stats *vdev_stats = NULL;
 	uint32_t tx_success;
 

+ 11 - 14
dp/wifi3.0/dp_tx.c

@@ -3645,24 +3645,21 @@ more_data:
 }
 
 #ifdef FEATURE_WLAN_TDLS
-/**
- * dp_tx_non_std() - Allow the control-path SW to send data frames
- *
- * @data_vdev - which vdev should transmit the tx data frames
- * @tx_spec - what non-standard handling to apply to the tx data frames
- * @msdu_list - NULL-terminated list of tx MSDUs
- *
- * Return: NULL on success,
- *         nbuf when it fails to send
- */
-qdf_nbuf_t dp_tx_non_std(struct cdp_vdev *vdev_handle,
-			enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
+qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
+			 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list)
 {
-	struct dp_vdev *vdev = (struct dp_vdev *) vdev_handle;
+	struct dp_soc *soc = cdp_soc_t_to_dp_soc(soc_hdl);
+	struct dp_vdev *vdev = dp_get_vdev_from_soc_vdev_id_wifi3(soc, vdev_id);
+
+	if (!vdev) {
+		dp_err("vdev handle for id %d is NULL", vdev_id);
+		return NULL;
+	}
 
 	if (tx_spec & OL_TX_SPEC_NO_FREE)
 		vdev->is_tdls_frame = true;
-	return dp_tx_send(vdev_handle, msdu_list);
+
+	return dp_tx_send(dp_vdev_to_cdp_vdev(vdev), msdu_list);
 }
 #endif
 

+ 12 - 2
dp/wifi3.0/dp_tx.h

@@ -203,8 +203,18 @@ qdf_nbuf_t dp_tx_send_msdu_multiple(struct dp_vdev *vdev, qdf_nbuf_t nbuf,
 				    struct dp_tx_msdu_info_s *msdu_info);
 #endif
 #ifdef FEATURE_WLAN_TDLS
-qdf_nbuf_t dp_tx_non_std(struct cdp_vdev *vdev_handle,
-		enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
+/**
+ * dp_tx_non_std() - Allow the control-path SW to send data frames
+ * @soc_hdl: Datapath soc handle
+ * @vdev_id: id of vdev
+ * @tx_spec: what non-standard handling to apply to the tx data frames
+ * @msdu_list: NULL-terminated list of tx MSDUs
+ *
+ * Return: NULL on success,
+ *         nbuf when it fails to send
+ */
+qdf_nbuf_t dp_tx_non_std(struct cdp_soc_t *soc_hdl, uint8_t vdev_id,
+			 enum ol_tx_spec tx_spec, qdf_nbuf_t msdu_list);
 #endif
 
 /**

+ 27 - 4
utils/logging/inc/wlan_logging_sock_svc.h

@@ -62,11 +62,34 @@ static inline void wlan_logging_set_log_to_console(bool log_to_console) {}
 
 #if defined(WLAN_LOGGING_SOCK_SVC_ENABLE) && \
 	defined(FEATURE_PKTLOG) && !defined(REMOVE_PKT_LOG)
-void wlan_deregister_txrx_packetdump(void);
-void wlan_register_txrx_packetdump(void);
+/**
+ * wlan_deregister_txrx_packetdump() - tx/rx packet dump
+ *  deregistration
+ * @pdev_id: id of the datapath pdev handle
+ *
+ * This function is used to deregister tx/rx packet dump callbacks
+ * with ol, pe and htt layers
+ *
+ * Return: None
+ *
+ */
+void wlan_deregister_txrx_packetdump(uint8_t pdev_id);
+
+/**
+ * wlan_register_txrx_packetdump() - tx/rx packet dump
+ * registration
+ * @pdev_id: id of the datapath pdev handle
+ *
+ * This function is used to register tx/rx packet dump callbacks
+ * with ol, pe and htt layers
+ *
+ * Return: None
+ *
+ */
+void wlan_register_txrx_packetdump(uint8_t pdev_id);
 #else
-static inline void wlan_deregister_txrx_packetdump(void) {}
-static inline void wlan_register_txrx_packetdump(void) {}
+static inline void wlan_deregister_txrx_packetdump(uint8_t pdev_id) {}
+static inline void wlan_register_txrx_packetdump(uint8_t pdev_id) {}
 #endif
 
 #if defined(WLAN_LOGGING_SOCK_SVC_ENABLE) && defined(FEATURE_WLAN_DIAG_SUPPORT)

+ 25 - 40
utils/logging/src/wlan_logging_sock_svc.c

@@ -1313,7 +1313,7 @@ static void driver_hal_status_map(uint8_t *status)
 /*
  * send_packetdump() - send packet dump
  * @soc: soc handle
- * @vdev: vdev handle
+ * @vdev_id: ID of the virtual device handle
  * @netbuf: netbuf
  * @status: status of tx packet
  * @type: type of packet
@@ -1325,7 +1325,7 @@ static void driver_hal_status_map(uint8_t *status)
  *
  */
 static void send_packetdump(ol_txrx_soc_handle soc,
-			    struct cdp_vdev *vdev, qdf_nbuf_t netbuf,
+			    uint8_t vdev_id, qdf_nbuf_t netbuf,
 			    uint8_t status, uint8_t type)
 {
 	struct ath_pktlog_hdr pktlog_hdr = {0};
@@ -1337,7 +1337,7 @@ static void send_packetdump(ol_txrx_soc_handle soc,
 	}
 
 	/* Send packet dump only for STA interface */
-	if (wlan_op_mode_sta != cdp_get_opmode(soc, vdev))
+	if (wlan_op_mode_sta != cdp_get_opmode(soc, vdev_id))
 		return;
 
 #if defined(HELIUMPLUS)
@@ -1390,17 +1390,7 @@ static void send_packetdump_monitor(uint8_t type)
 	wlan_pkt_stats_to_logger_thread(&pktlog_hdr, &pd_hdr, NULL);
 }
 
-/**
- * wlan_deregister_txrx_packetdump() - tx/rx packet dump
- *  deregistration
- *
- * This function is used to deregister tx/rx packet dump callbacks
- * with ol, pe and htt layers
- *
- * Return: None
- *
- */
-void wlan_deregister_txrx_packetdump(void)
+void wlan_deregister_txrx_packetdump(uint8_t pdev_id)
 {
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
@@ -1408,7 +1398,7 @@ void wlan_deregister_txrx_packetdump(void)
 		return;
 
 	if (gtx_count || grx_count) {
-		cdp_deregister_packetdump_cb(soc);
+		cdp_deregister_packetdump_cb(soc, pdev_id);
 		wma_deregister_packetdump_callback();
 		send_packetdump_monitor(STOP_MONITOR);
 		csr_packetdump_timer_stop();
@@ -1423,6 +1413,7 @@ void wlan_deregister_txrx_packetdump(void)
 /*
  * check_txrx_packetdump_count() - function to check
  * tx/rx packet dump global counts
+ * @pdev_id: datapath pdev identifier
  *
  * This function is used to check global counts of tx/rx
  * packet dump functionality.
@@ -1431,14 +1422,14 @@ void wlan_deregister_txrx_packetdump(void)
  *             0 otherwise
  *
  */
-static bool check_txrx_packetdump_count(void)
+static bool check_txrx_packetdump_count(uint8_t pdev_id)
 {
 	if (gtx_count == MAX_NUM_PKT_LOG ||
 		grx_count == MAX_NUM_PKT_LOG) {
 		LOGGING_TRACE(QDF_TRACE_LEVEL_DEBUG,
 			"%s gtx_count: %d grx_count: %d deregister packetdump",
 			__func__, gtx_count, grx_count);
-		wlan_deregister_txrx_packetdump();
+		wlan_deregister_txrx_packetdump(pdev_id);
 		return 1;
 	}
 	return 0;
@@ -1447,7 +1438,8 @@ static bool check_txrx_packetdump_count(void)
 /*
  * tx_packetdump_cb() - tx packet dump callback
  * @soc: soc handle
- * @vdev: vdev handle
+ * @pdev_id: datapath pdev id
+ * @vdev_id: vdev id
  * @netbuf: netbuf
  * @status: status of tx packet
  * @type: packet type
@@ -1459,27 +1451,29 @@ static bool check_txrx_packetdump_count(void)
  *
  */
 static void tx_packetdump_cb(ol_txrx_soc_handle soc,
-			     struct cdp_vdev *vdev, qdf_nbuf_t netbuf,
+			     uint8_t pdev_id, uint8_t vdev_id,
+			     qdf_nbuf_t netbuf,
 			     uint8_t status, uint8_t type)
 {
 	bool temp;
 
-	if (!soc || !vdev)
+	if (!soc)
 		return;
 
-	temp = check_txrx_packetdump_count();
+	temp = check_txrx_packetdump_count(pdev_id);
 	if (temp)
 		return;
 
 	driver_hal_status_map(&status);
-	send_packetdump(soc, vdev, netbuf, status, type);
+	send_packetdump(soc, vdev_id, netbuf, status, type);
 }
 
 
 /*
  * rx_packetdump_cb() - rx packet dump callback
  * @soc: soc handle
- * @vdev: vdev handle
+ * @pdev_id: datapath pdev id
+ * @vdev_id: vdev id
  * @netbuf: netbuf
  * @status: status of rx packet
  * @type: packet type
@@ -1491,40 +1485,31 @@ static void tx_packetdump_cb(ol_txrx_soc_handle soc,
  *
  */
 static void rx_packetdump_cb(ol_txrx_soc_handle soc,
-			     struct cdp_vdev *vdev, qdf_nbuf_t netbuf,
+			     uint8_t pdev_id, uint8_t vdev_id,
+			     qdf_nbuf_t netbuf,
 			     uint8_t status, uint8_t type)
 {
 	bool temp;
 
-	if (!soc || !vdev)
+	if (!soc)
 		return;
 
-	temp = check_txrx_packetdump_count();
+	temp = check_txrx_packetdump_count(pdev_id);
 	if (temp)
 		return;
 
-	send_packetdump(soc, vdev, netbuf, status, type);
+	send_packetdump(soc, vdev_id, netbuf, status, type);
 }
 
-
-/**
- * wlan_register_txrx_packetdump() - tx/rx packet dump
- * registration
- *
- * This function is used to register tx/rx packet dump callbacks
- * with ol, pe and htt layers
- *
- * Return: None
- *
- */
-void wlan_register_txrx_packetdump(void)
+void wlan_register_txrx_packetdump(uint8_t pdev_id)
 {
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	if (!soc)
 		return;
 
-	cdp_register_packetdump_cb(soc, tx_packetdump_cb, rx_packetdump_cb);
+	cdp_register_packetdump_cb(soc, pdev_id,
+				   tx_packetdump_cb, rx_packetdump_cb);
 	wma_register_packetdump_callback(tx_packetdump_cb,
 			rx_packetdump_cb);
 	send_packetdump_monitor(START_MONITOR);