Browse Source

qcacmn: Use new APIs to get dp handles

SON and DP modules use new APIs to get dp handles,

Change-Id: I1639b946f1660fcaa21b76688909451dcc0f94cc
CRs-Fixed: 2177109
Srinivas Pitla 7 years ago
parent
commit
f6b4bc8f02
3 changed files with 33 additions and 17 deletions
  1. 5 3
      dp/inc/cdp_txrx_ctrl_def.h
  2. 27 12
      target_if/son/src/target_if_son.c
  3. 1 2
      utils/pktlog/linux_ac.c

+ 5 - 3
dp/inc/cdp_txrx_ctrl_def.h

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2011-2016 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2016,2018 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -72,8 +72,10 @@ void ol_ll_pdev_tx_unlock(void *);
 	qdf_spin_unlock_bh(&((_x)->peer_lock[_id]))
 
 #else
-#define OSIF_VAP_TX_LOCK(_x)  ol_ll_pdev_tx_lock((_x)->iv_txrx_handle)
-#define OSIF_VAP_TX_UNLOCK(_x) ol_ll_pdev_tx_unlock((_x)->iv_txrx_handle)
+#define OSIF_VAP_TX_LOCK(_x)  ol_ll_pdev_tx_lock( \
+			wlan_vdev_get_dp_handle((_x)->os_if_vdev))
+#define OSIF_VAP_TX_UNLOCK(_x) ol_ll_pdev_tx_unlock( \
+			wlan_vdev_get_dp_handle((_x)->os_if_vdev))
 
 #define OL_TX_FLOW_CTRL_LOCK(_x)
 #define OL_TX_FLOW_CTRL_UNLOCK(_x)

+ 27 - 12
target_if/son/src/target_if_son.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
  *
  *
  * Permission to use, copy, modify, and/or distribute this software for
@@ -27,15 +27,19 @@
 
 bool son_ol_is_peer_inact(struct wlan_objmgr_peer *peer)
 {
-	struct wlan_objmgr_pdev *pdev = NULL;
-	struct wlan_objmgr_vdev *vdev = NULL;
+	struct wlan_objmgr_vdev *vdev;
+	struct wlan_objmgr_psoc *psoc;
 
 	vdev = wlan_peer_get_vdev(peer);
+	if (!vdev)
+		return false;
 
-	pdev = wlan_vdev_get_pdev(vdev);
+	psoc = wlan_vdev_get_psoc(vdev);
+	if (!psoc)
+		return false;
 
-	return cdp_peer_is_inact(ol_if_pdev_get_soc_txhandle(pdev),
-				 (void *)(ol_if_peer_get_txrx_handle(peer)));
+	return cdp_peer_is_inact(wlan_psoc_get_dp_handle(psoc),
+				 (void *)(wlan_peer_get_dp_handle(peer)));
 }
 
 u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
@@ -46,17 +50,26 @@ u_int32_t son_ol_get_peer_rate(struct wlan_objmgr_peer *peer, u_int8_t type)
 
 bool son_ol_enable(struct wlan_objmgr_pdev *pdev, bool enable)
 {
+	struct wlan_objmgr_psoc *psoc;
 
-	return cdp_start_inact_timer(ol_if_pdev_get_soc_txhandle(pdev),
-				(void *)(ol_if_pdev_get_soc_pdev_handle(pdev)),
+	psoc = wlan_pdev_get_psoc(pdev);
+	if (!psoc)
+		return false;
+
+	return cdp_start_inact_timer(wlan_psoc_get_dp_handle(psoc),
+				(void *)(wlan_pdev_get_dp_handle(pdev)),
 				enable);
 }
 
 /* Function pointer to set overload status */
 void son_ol_set_overload(struct wlan_objmgr_pdev *pdev, bool overload)
 {
-	return cdp_set_overload(ol_if_pdev_get_soc_txhandle(pdev),
-				(void *)(ol_if_pdev_get_soc_pdev_handle(pdev)),
+	struct wlan_objmgr_psoc *psoc;
+
+	psoc = wlan_pdev_get_psoc(pdev);
+
+	return cdp_set_overload(wlan_psoc_get_dp_handle(psoc),
+				(void *)(wlan_pdev_get_dp_handle(pdev)),
 				overload);
 }
 /* Function pointer to set band steering parameters */
@@ -65,9 +78,11 @@ bool son_ol_set_params(struct wlan_objmgr_pdev *pdev,
 			    u_int32_t inactivity_threshold_normal,
 			    u_int32_t inactivity_threshold_overload)
 {
+	struct wlan_objmgr_psoc *psoc;
 
-	return cdp_set_inact_params(ol_if_pdev_get_soc_txhandle(pdev),
-				(void *)ol_if_pdev_get_soc_pdev_handle(pdev),
+	psoc = wlan_pdev_get_psoc(pdev);
+	return cdp_set_inact_params(wlan_psoc_get_dp_handle(psoc),
+				(void *)wlan_pdev_get_dp_handle(pdev),
 				inactivity_check_period,
 				inactivity_threshold_normal,
 				inactivity_threshold_overload);

+ 1 - 2
utils/pktlog/linux_ac.c

@@ -110,8 +110,7 @@ int pktlog_alloc_buf(struct hif_opaque_softc *scn)
 
 	if (!pl_dev) {
 		printk(PKTLOG_TAG
-		       "%s: Unable to allocate buffer "
-		       "scn or scn->pdev_txrx_handle->pl_dev is null\n",
+		       "%s: Unable to allocate buffer pdev_txrx_handle or pdev_txrx_handle->pl_dev is null\n",
 		       __func__);
 		return -EINVAL;
 	}