ソースを参照

qcacld-3.0: Fix nan data interface create

1) In function wma_update_hdd_cfg update tgt_cfg before calling hdd callback
   function.
2) In function hdd_init_nan_data_mode correct check for status returned from
   sme_open_session

Change-Id: Ibf86c348f95c6f5589c2089600dbe176b1fda5fe
CRs-Fixed: 962367
(cherry picked from commit c6e52d750fee0675efdbe08d7e6f0c274887cb65)
Naveen Rawat 8 年 前
コミット
cb186cf882

+ 1 - 1
core/hdd/src/wlan_hdd_nan_datapath.c

@@ -1869,7 +1869,7 @@ int hdd_init_nan_data_mode(struct hdd_adapter_s *adapter)
 	status = sme_open_session(hdd_ctx->hHal, hdd_sme_roam_callback,
 			adapter, (uint8_t *)&adapter->macAddressCurrent,
 			&adapter->sessionId, type, sub_type);
-	if (QDF_STATUS_SUCCESS == status) {
+	if (QDF_STATUS_SUCCESS != status) {
 		hdd_err("sme_open_session() failed with status code %d",
 			status);
 		ret_val = -EAGAIN;

+ 2 - 1
core/mac/src/pe/lim/lim_assoc_utils.c

@@ -2131,7 +2131,8 @@ lim_add_sta(tpAniSirGlobal mac_ctx,
 	}
 	qdf_mem_set((uint8_t *) add_sta_params, sizeof(tAddStaParams), 0);
 
-	if (LIM_IS_AP_ROLE(session_entry) || LIM_IS_IBSS_ROLE(session_entry))
+	if (LIM_IS_AP_ROLE(session_entry) || LIM_IS_IBSS_ROLE(session_entry) ||
+		LIM_IS_NDI_ROLE(session_entry))
 		sta_Addr = &sta_ds->staAddr;
 #ifdef FEATURE_WLAN_TDLS
 	/* SystemRole shouldn't be matter if staType is TDLS peer */

+ 5 - 9
core/mac/src/pe/nan/nan_datapath.c

@@ -128,7 +128,7 @@ static QDF_STATUS lim_add_ndi_peer(tpAniSirGlobal mac_ctx,
 static QDF_STATUS lim_handle_ndp_indication_event(tpAniSirGlobal mac_ctx,
 					struct ndp_indication_event *ndp_ind)
 {
-	QDF_STATUS status;
+	QDF_STATUS status = QDF_STATUS_SUCCESS;
 
 	lim_log(mac_ctx, LOG1,
 		FL("role: %d, vdev: %d, peer_mac_addr "MAC_ADDRESS_STR),
@@ -138,10 +138,6 @@ static QDF_STATUS lim_handle_ndp_indication_event(tpAniSirGlobal mac_ctx,
 	if ((ndp_ind->role == NDP_ROLE_INITIATOR) ||
 	   ((NDP_ROLE_RESPONDER == ndp_ind->role) &&
 	   (NDP_ACCEPT_POLICY_ALL == ndp_ind->policy))) {
-		/* Free config only for INITIATOR role */
-		qdf_mem_free(ndp_ind->ndp_config.ndp_cfg);
-		qdf_mem_free(ndp_ind->ndp_info.ndp_app_info);
-
 		status = lim_add_ndi_peer(mac_ctx, ndp_ind->vdev_id,
 				ndp_ind->peer_mac_addr);
 		if (QDF_STATUS_SUCCESS != status) {
@@ -168,10 +164,12 @@ ndp_indication_failed:
 	 * As for success responder case this info is sent till HDD
 	 * and will be freed in sme.
 	 */
-	if ((status != QDF_STATUS_SUCCESS) ||
-			(NDP_ROLE_INITIATOR == ndp_ind->role)) {
+	if (status != QDF_STATUS_SUCCESS ||
+			NDP_ROLE_INITIATOR == ndp_ind->role) {
 		qdf_mem_free(ndp_ind->ndp_config.ndp_cfg);
 		qdf_mem_free(ndp_ind->ndp_info.ndp_app_info);
+		ndp_ind->ndp_config.ndp_cfg = NULL;
+		ndp_ind->ndp_info.ndp_app_info = NULL;
 	}
 	return status;
 }
@@ -496,8 +494,6 @@ QDF_STATUS lim_handle_ndp_event_message(tpAniSirGlobal mac_ctx, cds_msg_t *msg)
 	case SIR_HAL_NDP_INDICATION: {
 		struct ndp_indication_event *ndp_ind = msg->bodyptr;
 		status = lim_handle_ndp_indication_event(mac_ctx, ndp_ind);
-		qdf_mem_free(ndp_ind->ndp_config.ndp_cfg);
-		qdf_mem_free(ndp_ind->ndp_info.ndp_app_info);
 		break;
 	}
 	case SIR_HAL_NDP_RESPONDER_RSP:

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

@@ -6342,18 +6342,19 @@ static void csr_roam_process_start_bss_success(tpAniSirGlobal mac_ctx,
 		roam_info.u.pConnectedProfile = &session->connectedProfile;
 		qdf_mem_copy(&roam_info.bssid, &bss_desc->bssId,
 			    sizeof(struct qdf_mac_addr));
-	}
-	csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED,
-			session_id);
-	if (!QDF_IS_STATUS_SUCCESS
-		(csr_get_parsed_bss_description_ies(mac_ctx, bss_desc,
-						    &ies_ptr))) {
-		sms_log(mac_ctx, LOGW, FL("cannot parse IBSS IEs"));
-		roam_info.pBssDesc = bss_desc;
-		csr_roam_call_callback(mac_ctx, session_id, &roam_info,
-			cmd->u.roamCmd.roamId, eCSR_ROAM_IBSS_IND,
-			eCSR_ROAM_RESULT_IBSS_START_FAILED);
-		return;
+	} else {
+		csr_roam_state_change(mac_ctx, eCSR_ROAMING_STATE_JOINED,
+				session_id);
+		if (!QDF_IS_STATUS_SUCCESS
+			(csr_get_parsed_bss_description_ies(mac_ctx, bss_desc,
+							    &ies_ptr))) {
+			sms_log(mac_ctx, LOGW, FL("cannot parse IBSS IEs"));
+			roam_info.pBssDesc = bss_desc;
+			csr_roam_call_callback(mac_ctx, session_id, &roam_info,
+				cmd->u.roamCmd.roamId, eCSR_ROAM_IBSS_IND,
+				eCSR_ROAM_RESULT_IBSS_START_FAILED);
+			return;
+		}
 	}
 	if (!CSR_IS_INFRA_AP(profile)) {
 		scan_res =

+ 1 - 1
core/wma/src/wma_main.c

@@ -3965,8 +3965,8 @@ static void wma_update_hdd_cfg(tp_wma_handle wma_handle)
 		wma_handle->fine_time_measurement_cap;
 	wma_setup_egap_support(&tgt_cfg, wma_handle);
 
-	wma_handle->tgt_cfg_update_cb(hdd_ctx, &tgt_cfg);
 	wma_update_hdd_cfg_ndp(wma_handle, &tgt_cfg);
+	wma_handle->tgt_cfg_update_cb(hdd_ctx, &tgt_cfg);
 }
 
 /**

+ 1 - 1
core/wma/src/wma_nan_datapath.c

@@ -967,7 +967,7 @@ void wma_add_bss_ndi_mode(tp_wma_handle wma, tpAddBssParams add_bss)
 	}
 	pdev = cds_get_context(QDF_MODULE_ID_TXRX);
 
-	if (pdev) {
+	if (!pdev) {
 		WMA_LOGE("%s: Failed to get pdev", __func__);
 		goto send_fail_resp;
 	}