Browse Source

qcacmn: Change peer unref delete API parameters

Pass vdev mac-addr and vdev-mode, instead of vdev-id.
The vdev-id that was passed earlier, was used to get
the mac-addr and vdev-mode from the vdev structure.
But there are cases when this vdev structure may be
freed, when this API is called.
So pass the mac-addr and vdev-mode from the dp structures.

Change-Id: I2148e7ecef433f4363385eeaec2e18f3ec131ab8
CRs-Fixed: 2356315
Vinay Adella 6 years ago
parent
commit
9420115f04
2 changed files with 7 additions and 5 deletions
  1. 2 2
      dp/inc/cdp_txrx_ops.h
  2. 5 3
      dp/wifi3.0/dp_main.c

+ 2 - 2
dp/inc/cdp_txrx_ops.h

@@ -856,8 +856,8 @@ struct ol_if_ops {
 	(*peer_rx_reorder_queue_remove)(struct cdp_ctrl_objmgr_pdev *ctrl_pdev,
 					uint8_t vdev_id, uint8_t *peer_macaddr,
 					uint32_t tid_mask);
-	int (*peer_unref_delete)(void *scn_handle, uint8_t vdev_id,
-			uint8_t *peer_macaddr);
+	int (*peer_unref_delete)(void *scn_handle, uint8_t *peer_mac,
+				 uint8_t *vdev_mac, enum wlan_op_mode opmode);
 	bool (*is_hw_dbs_2x2_capable)(struct wlan_objmgr_psoc *psoc);
 	int (*peer_add_wds_entry)(void *vdev_handle,
 				  struct cdp_peer *peer_handle,

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

@@ -4507,7 +4507,8 @@ static void *dp_peer_create_wifi3(struct cdp_vdev *vdev_handle,
 		*/
 		if (soc->cdp_soc.ol_ops->peer_unref_delete) {
 			soc->cdp_soc.ol_ops->peer_unref_delete(pdev->ctrl_pdev,
-				vdev->vdev_id, peer->mac_addr.raw);
+				peer->mac_addr.raw, vdev->mac_addr.raw,
+				vdev->opmode);
 		}
 		peer->ctrl_peer = ctrl_peer;
 
@@ -5002,8 +5003,9 @@ static void dp_reset_and_release_peer_mem(struct dp_soc *soc,
 		    vdev->vap_bss_peer = NULL;
 		m_addr = peer->mac_addr.raw;
 		if (soc->cdp_soc.ol_ops->peer_unref_delete)
-		    soc->cdp_soc.ol_ops->peer_unref_delete(pdev->ctrl_pdev,
-							   vdev_id, m_addr);
+			soc->cdp_soc.ol_ops->peer_unref_delete(pdev->ctrl_pdev,
+				m_addr, vdev->mac_addr.raw, vdev->opmode);
+
 		if (vdev && vdev->vap_bss_peer) {
 		    bss_peer = vdev->vap_bss_peer;
 		    DP_UPDATE_STATS(vdev, peer);