Browse Source

qcacld-3.0: Update wifi pos on peer create only for I-STA

PASN authentication M1 should be initiated by I-STA.
Driver requests for the initiation of PASN auth from
wpa supplicant only for I-STA mode. For R-STA mode, M1
will be received from peer I-STA.

So update wifi pos module after peer create only for I-STA mode
and skip that for R-STA mode.

Change-Id: I09ac53bcd50cb012ad8cd5d351b91e6fb017c77d
CRs-Fixed: 3170770
Pragaspathi Thilagaraj 3 years ago
parent
commit
825238634e
1 changed files with 22 additions and 0 deletions
  1. 22 0
      core/wma/src/wma_pasn_peer_api.c

+ 22 - 0
core/wma/src/wma_pasn_peer_api.c

@@ -184,11 +184,33 @@ wma_pasn_handle_peer_create_conf(tp_wma_handle wma,
 				 QDF_STATUS status, uint8_t vdev_id)
 {
 	struct wlan_lmac_if_wifi_pos_rx_ops *rx_ops;
+	struct wlan_objmgr_vdev *vdev;
+	enum QDF_OPMODE mode;
 
 	if (status)
 		wma_pasn_peer_remove(wma->psoc, peer_mac, vdev_id,
 				     QDF_IS_STATUS_ERROR(status));
 
+	vdev = wlan_objmgr_get_vdev_by_id_from_psoc(wma->psoc, vdev_id,
+						    WLAN_LEGACY_WMA_ID);
+	if (!vdev) {
+		wma_err("Vdev is NULL");
+		return QDF_STATUS_E_NULL_VALUE;
+	}
+
+	mode = wlan_vdev_mlme_get_opmode(vdev);
+	wlan_objmgr_vdev_release_ref(vdev, WLAN_LEGACY_WMA_ID);
+
+	/*
+	 * Only in I-sta case update the wifi pos module to
+	 * track the peer to initiate PASN authentication.
+	 * For R-STA, return from here.
+	 */
+	if (mode != QDF_STA_MODE) {
+		wma_debug("PASN opmode:%d is not sta", mode);
+		return QDF_STATUS_SUCCESS;
+	}
+
 	rx_ops = wifi_pos_get_rx_ops(wma->psoc);
 	if (!rx_ops || !rx_ops->wifi_pos_ranging_peer_create_rsp_cb) {
 		wma_err("%s is null",