소스 검색

qcacld-3.0: Retrieve information from the object manager vdev

sme_session_params has duplicate information which can be retrived
from the vdev object directly, hence remove the duplicate values
and get information directly from the vdev.

Change-Id: I151dbefcfedc20673fbf072b9c308dc9a6243bb1
CRs-Fixed: 2555909
Arun Kumar Khandavalli 5 년 전
부모
커밋
c13afcd9da
4개의 변경된 파일25개의 추가작업 그리고 24개의 파일을 삭제
  1. 0 2
      core/hdd/src/wlan_hdd_main.c
  2. 0 4
      core/sme/inc/sme_api.h
  3. 9 5
      core/sme/src/common/sme_api.c
  4. 16 13
      core/sme/src/csr/csr_api_roam.c

+ 0 - 2
core/hdd/src/wlan_hdd_main.c

@@ -4487,8 +4487,6 @@ static int hdd_set_sme_session_param(struct hdd_adapter *adapter,
 			csr_roam_complete_cb callback,
 			void *callback_ctx)
 {
-	session_param->vdev_id = adapter->vdev_id;
-	session_param->self_mac_addr = (uint8_t *)&adapter->mac_addr;
 	session_param->session_close_cb = hdd_sme_close_session_callback;
 	session_param->callback = callback;
 	session_param->callback_ctx = callback_ctx;

+ 0 - 4
core/sme/inc/sme_api.h

@@ -215,8 +215,6 @@ struct sme_5g_band_pref_params {
  * @callback: callback to be invoked for roaming events
  * @vdev: pointer to vdev object
  * @callback_ctx: user-supplied context to be passed back on roaming events
- * @self_mac_addr: Self mac address
- * @vdev_id: vdev id
  */
 struct sme_session_params {
 	csr_session_open_cb  session_open_cb;
@@ -224,8 +222,6 @@ struct sme_session_params {
 	csr_roam_complete_cb callback;
 	struct wlan_objmgr_vdev *vdev;
 	void *callback_ctx;
-	uint8_t *self_mac_addr;
-	uint8_t vdev_id;
 };
 
 #define MAX_CANDIDATE_INFO 10

+ 9 - 5
core/sme/src/common/sme_api.c

@@ -4514,11 +4514,14 @@ QDF_STATUS sme_create_vdev(mac_handle_t mac_handle,
 	struct mac_context *mac_ctx = MAC_CONTEXT(mac_handle);
 	struct cdp_pdev *pdev;
 	ol_txrx_peer_handle peer;
-	uint8_t peer_id;
+	u8 peer_id, vdev_id;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
+	u8 *mac_addr;
 
-	sme_debug("vdev_id %d addr:%pM", params->vdev_id,
-		  params->self_mac_addr);
+	vdev_id = wlan_vdev_get_id(params->vdev);
+	mac_addr = wlan_vdev_mlme_get_macaddr(params->vdev);
+
+	sme_debug("vdev_id %d addr:%pM", vdev_id, mac_addr);
 
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
@@ -4531,7 +4534,8 @@ QDF_STATUS sme_create_vdev(mac_handle_t mac_handle,
 	if (QDF_IS_STATUS_ERROR(status))
 		return status;
 
-	peer = cdp_peer_find_by_addr(soc, pdev, params->self_mac_addr,
+	peer = cdp_peer_find_by_addr(soc, pdev,
+				     mac_addr,
 				     &peer_id);
 	if (peer) {
 		sme_err("Peer=%d exist with same MAC", peer_id);
@@ -4544,7 +4548,7 @@ QDF_STATUS sme_create_vdev(mac_handle_t mac_handle,
 	sme_release_global_lock(&mac_ctx->sme);
 
 	MTRACE(qdf_trace(QDF_MODULE_ID_SME, TRACE_CODE_SME_RX_HDD_OPEN_SESSION,
-			 params->vdev_id, 0));
+			 vdev_id, 0));
 
 	return status;
 }

+ 16 - 13
core/sme/src/csr/csr_api_roam.c

@@ -17194,6 +17194,8 @@ QDF_STATUS csr_create_vdev(struct mac_context *mac_ctx,
 	struct mlme_vht_capabilities_info *vht_cap_info;
 	struct vdev_mlme_obj *vdev_mlme;
 	enum QDF_OPMODE op_mode;
+	u8 vdev_id;
+	struct qdf_mac_addr *mac_addr;
 
 	if (!(mac_ctx->mlme_cfg)) {
 		sme_err("invalid mlme cfg");
@@ -17207,6 +17209,10 @@ QDF_STATUS csr_create_vdev(struct mac_context *mac_ctx,
 		return QDF_STATUS_E_FAILURE;
 	}
 
+	vdev_id = wlan_vdev_get_id(session_param->vdev);
+	mac_addr = (struct qdf_mac_addr *)
+		   wlan_vdev_mlme_get_macaddr(session_param->vdev);
+
 	op_mode = wlan_vdev_mlme_get_opmode(vdev);
 	csr_get_vdev_type_nss(mac_ctx, op_mode,
 			      &vdev_mlme->proto.generic.nss_2g,
@@ -17221,33 +17227,30 @@ QDF_STATUS csr_create_vdev(struct mac_context *mac_ctx,
 	}
 
 	/* check to see if the mac address already belongs to a session */
-	status = csr_roam_get_session_id_from_bssid(mac_ctx,
-			(struct qdf_mac_addr *)session_param->self_mac_addr,
-			&existing_session_id);
+	status = csr_roam_get_session_id_from_bssid(mac_ctx, mac_addr,
+						    &existing_session_id);
 	if (QDF_IS_STATUS_SUCCESS(status)) {
-		sme_err("Session %d exists with mac address " QDF_MAC_ADDR_STR,
+		sme_err("Session %d exists with mac address %pM",
 			existing_session_id,
-			QDF_MAC_ADDR_ARRAY(session_param->self_mac_addr));
+			mac_addr);
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	/* attempt to retrieve session for Id */
-	session = CSR_GET_SESSION(mac_ctx, session_param->vdev_id);
+	session = CSR_GET_SESSION(mac_ctx, vdev_id);
 	if (!session) {
-		sme_err("Session does not exist for interface %d",
-			session_param->vdev_id);
+		sme_err("Session does not exist for interface %d", vdev_id);
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	/* check to see if the session is already active */
 	if (session->sessionActive) {
-		sme_err("Cannot re-open active session with Id %d",
-			session_param->vdev_id);
+		sme_err("Cannot re-open active session with Id %d", vdev_id);
 		return QDF_STATUS_E_FAILURE;
 	}
 
 	session->sessionActive = true;
-	session->sessionId = session_param->vdev_id;
+	session->sessionId = vdev_id;
 
 	/* Initialize FT related data structures only in STA mode */
 	sme_ft_open(MAC_HANDLE(mac_ctx), session->sessionId);
@@ -17256,7 +17259,7 @@ QDF_STATUS csr_create_vdev(struct mac_context *mac_ctx,
 	session->callback = session_param->callback;
 	session->pContext = session_param->callback_ctx;
 
-	qdf_mem_copy(&session->self_mac_addr, session_param->self_mac_addr,
+	qdf_mem_copy(&session->self_mac_addr, mac_addr,
 		     sizeof(struct qdf_mac_addr));
 	status = qdf_mc_timer_init(&session->hTimerRoaming,
 				   QDF_TIMER_TYPE_SW,
@@ -17318,7 +17321,7 @@ QDF_STATUS csr_create_vdev(struct mac_context *mac_ctx,
 	status = mlme_vdev_create_send(vdev);
 
 	if (QDF_IS_STATUS_ERROR(status)) {
-		csr_cleanup_session(mac_ctx, wlan_vdev_get_id(vdev));
+		csr_cleanup_session(mac_ctx, vdev_id);
 		return status;
 	}