Browse Source

qcacld-3.0: Enable FEATURE_WLAN_MCC_TO_SCC_SWITCH flag in the driver

Enable feature flag FEATURE_WLAN_MCC_TO_SCC_SWITCH in the Kbuild to
make use of the MCC to SCC switch feature. The resulting errors in
compilation are fixed along with some enhancement in the debug logs
in this feature path

Change-Id: I0ddb2f371c28ade6d8fc9ea12ba104a99394827f
CRs-Fixed: 986079
Chandrasekaran Manishekar 9 years ago
parent
commit
068e25eeb8

+ 7 - 0
Kbuild

@@ -135,6 +135,9 @@ ifeq ($(KERNEL_BUILD), 0)
 
 	# Flag to enable LFR Subnet Detection
 	CONFIG_LFR_SUBNET_DETECTION := y
+
+	# Flag to enable MCC to SCC switch feature
+	CONFIG_MCC_TO_SCC_SWITCH := y
 endif
 
 # If not set, assume, Common driver is with in the build tree
@@ -1363,6 +1366,10 @@ ifeq ($(CONFIG_LFR_SUBNET_DETECTION), y)
 CDEFINES += -DFEATURE_LFR_SUBNET_DETECTION
 endif
 
+ifeq ($(CONFIG_MCC_TO_SCC_SWITCH), y)
+CDEFINES += -DFEATURE_WLAN_MCC_TO_SCC_SWITCH
+endif
+
 KBUILD_CPPFLAGS += $(CDEFINES)
 
 # Currently, for versions of gcc which support it, the kernel Makefile

+ 11 - 2
core/cds/src/cds_concurrency.c

@@ -6605,6 +6605,9 @@ static void cds_check_sta_ap_concurrent_ch_intf(void *data)
 	hdd_ap_ctx_t *hdd_ap_ctx;
 	uint16_t intf_ch = 0;
 
+	cds_info("cds_concurrent_open_sessions_running: %d",
+		cds_concurrent_open_sessions_running());
+
 	if ((hdd_ctx->config->WlanMccToSccSwitchMode ==
 				QDF_MCC_TO_SCC_SWITCH_DISABLE)
 			|| !(cds_concurrent_open_sessions_running()
@@ -6626,6 +6629,7 @@ static void cds_check_sta_ap_concurrent_ch_intf(void *data)
 		return;
 
 	intf_ch = wlansap_check_cc_intf(hdd_ap_ctx->sapContext);
+	cds_info("intf_ch:%d", intf_ch);
 
 	if (intf_ch == 0)
 		return;
@@ -6658,6 +6662,12 @@ void cds_check_concurrent_intf_and_restart_sap(hdd_station_ctx_t *hdd_sta_ctx,
 		return;
 	}
 
+	cds_info("mode:%d rule1:%d rule2:%d chan:%d",
+		hdd_ctx->config->WlanMccToSccSwitchMode,
+		hdd_ctx->config->conc_custom_rule1,
+		hdd_ctx->config->conc_custom_rule2,
+		hdd_sta_ctx->conn_info.operationChannel);
+
 	if ((hdd_ctx->config->WlanMccToSccSwitchMode
 				!= QDF_MCC_TO_SCC_SWITCH_DISABLE) &&
 			((0 == hdd_ctx->config->conc_custom_rule1) &&
@@ -7176,13 +7186,12 @@ void cds_restart_sap(hdd_adapter_t *ap_adapter)
 	hdd_ap_ctx_t *hdd_ap_ctx;
 	hdd_hostapd_state_t *hostapd_state;
 	QDF_STATUS qdf_status;
-	QDF_STATUS qdf_status;
 	hdd_context_t *hdd_ctx = WLAN_HDD_GET_CTX(ap_adapter);
 	tsap_Config_t *sap_config;
 	void *sap_ctx;
 
 	hdd_ap_ctx = WLAN_HDD_GET_AP_CTX_PTR(ap_adapter);
-	sap_config = &hdd_ap_ctx.sapConfig;
+	sap_config = &hdd_ap_ctx->sapConfig;
 	sap_ctx = hdd_ap_ctx->sapContext;
 
 	mutex_lock(&hdd_ctx->sap_lock);

+ 1 - 0
core/hdd/src/wlan_hdd_assoc.c

@@ -1839,6 +1839,7 @@ static QDF_STATUS hdd_association_completion_handler(hdd_adapter_t *pAdapter,
 		wlan_hdd_auto_shutdown_enable(pHddCtx, false);
 #endif
 
+		hdd_info("check for SAP restart");
 		cds_check_concurrent_intf_and_restart_sap(pHddStaCtx,
 							  pAdapter);
 

+ 17 - 14
core/mac/src/pe/lim/lim_api.c

@@ -1804,25 +1804,28 @@ void lim_fill_join_rsp_ht_caps(tpPESession session, tpSirSmeJoinRsp join_rsp)
 {
 	tSirSmeHTProfile *ht_profile;
 	if (session == NULL) {
-		lim_log(mac_ctx, LOGE, FL("Invalid Session"));
+		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
+			"Invalid Session");
 		return;
 	}
 	if (join_rsp == NULL) {
-		lim_log(mac_ctx, LOGE, FL("Invalid Join Response"));
+		QDF_TRACE(QDF_MODULE_ID_PE, QDF_TRACE_LEVEL_ERROR,
+			"Invalid Join Response");
 		return;
 	}
-	if (session->cc_switch_mode !=
-			QDF_MCC_TO_SCC_SWITCH_DISABLE) {
-		ht_profile = &join_rsp->HTProfile;
-		ht_profile->htSupportedChannelWidthSet =
-			session->htSupportedChannelWidthSet;
-		ht_profile->htRecommendedTxWidthSet =
-			session->htRecommendedTxWidthSet;
-		ht_profile->htSecondaryChannelOffset =
-			session->htSecondaryChannelOffset;
-		ht_profile->dot11mode = session->dot11mode;
-		ht_profile->htCapability = session->htCapability;
-	}
+
+	if (session->cc_switch_mode == QDF_MCC_TO_SCC_SWITCH_DISABLE)
+		return;
+
+	ht_profile = &join_rsp->HTProfile;
+	ht_profile->htSupportedChannelWidthSet =
+		session->htSupportedChannelWidthSet;
+	ht_profile->htRecommendedTxWidthSet =
+		session->htRecommendedTxWidthSet;
+	ht_profile->htSecondaryChannelOffset =
+		session->htSecondaryChannelOffset;
+	ht_profile->dot11mode = session->dot11mode;
+	ht_profile->htCapability = session->htCapability;
 	ht_profile->vhtCapability = session->vhtCapability;
 	ht_profile->vhtTxChannelWidthSet =
 		session->vhtTxChannelWidthSet;

+ 4 - 0
core/sap/src/sap_fsm.c

@@ -2146,6 +2146,10 @@ QDF_STATUS sap_goto_channel_sel(ptSapContext sap_context,
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
 		if (sap_context->cc_switch_mode !=
 						QDF_MCC_TO_SCC_SWITCH_DISABLE) {
+			QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO,
+				FL("check for overlap: chan:%d mode:%d"),
+				sap_context->channel,
+				sap_context->csr_roamProfile.phyMode);
 			con_ch = sme_check_concurrent_channel_overlap(h_hal,
 					sap_context->channel,
 					sap_context->csr_roamProfile.phyMode,

+ 4 - 0
core/sme/src/csr/csr_api_roam.c

@@ -19041,6 +19041,10 @@ void csr_roam_synch_callback(tpAniSirGlobal mac_ctx,
 	struct qdf_mac_addr bcast_mac = QDF_MAC_ADDR_BROADCAST_INITIALIZER;
 	tpAddBssParams add_bss_params;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
+#ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH
+	tSirSmeHTProfile *src_profile = NULL;
+	tCsrRoamHTProfile *dst_profile = NULL;
+#endif
 
 	status = sme_acquire_global_lock(&mac_ctx->sme);
 	if (!QDF_IS_STATUS_SUCCESS(status)) {

+ 20 - 1
core/sme/src/csr/csr_util.c

@@ -693,7 +693,10 @@ uint16_t csr_check_concurrent_channel_overlap(tpAniSirGlobal mac_ctx,
 	uint8_t i = 0, chb = PHY_SINGLE_CHANNEL_CENTERED;
 	uint16_t intf_ch = 0, sap_hbw = 0, intf_hbw = 0, intf_cfreq = 0;
 	uint16_t sap_cfreq = 0;
-	uint16_t sap_lfreq, sap_hfreq, intf_lfreq, intf_hfreq, sap_cch;
+	uint16_t sap_lfreq, sap_hfreq, intf_lfreq, intf_hfreq, sap_cch = 0;
+
+	sms_log(mac_ctx, LOG1, FL("sap_ch:%d sap_phymode:%d"),
+		sap_ch, sap_phymode);
 
 	if (mac_ctx->roam.configParam.cc_switch_mode ==
 			QDF_MCC_TO_SCC_SWITCH_DISABLE)
@@ -714,6 +717,10 @@ uint16_t csr_check_concurrent_channel_overlap(tpAniSirGlobal mac_ctx,
 		sap_cfreq = cds_chan_to_freq(sap_cch);
 	}
 
+	sms_log(mac_ctx, LOG1,
+		FL("sap_ch:%d sap_phymode:%d sap_cch:%d sap_hbw:%d chb:%d"),
+		sap_ch, sap_phymode, sap_cch, sap_hbw, chb);
+
 	for (i = 0; i < CSR_ROAM_SESSION_MAX; i++) {
 		if (!CSR_IS_SESSION_VALID(mac_ctx, i))
 			continue;
@@ -730,6 +737,9 @@ uint16_t csr_check_concurrent_channel_overlap(tpAniSirGlobal mac_ctx,
 			csr_get_ch_from_ht_profile(mac_ctx,
 				&session->connectedProfile.HTProfile,
 				intf_ch, &intf_cfreq, &intf_hbw);
+			sms_log(mac_ctx, LOG1,
+				FL("%d: intf_ch:%d intf_cfreq:%d intf_hbw:%d"),
+				i, intf_ch, intf_cfreq, intf_hbw);
 		} else if (((session->pCurRoamProfile->csrPersona ==
 					QDF_P2P_GO_MODE) ||
 				(session->pCurRoamProfile->csrPersona ==
@@ -742,9 +752,18 @@ uint16_t csr_check_concurrent_channel_overlap(tpAniSirGlobal mac_ctx,
 				csr_handle_conc_chnl_overlap_for_sap_go(mac_ctx,
 					session, &sap_ch, &sap_hbw, &sap_cfreq,
 					&intf_ch, &intf_hbw, &intf_cfreq);
+
+				sms_log(mac_ctx, LOG1,
+					FL("%d: sap_ch:%d sap_hbw:%d sap_cfreq:%d intf_ch:%d intf_hbw:%d, intf_cfreq:%d"),
+					i, sap_ch, sap_hbw, sap_cfreq,
+					intf_ch, intf_hbw, intf_cfreq);
 		}
 	}
 
+	sms_log(mac_ctx, LOG1,
+		FL("intf_ch:%d sap_ch:%d intf_ch:%d"),
+		intf_ch, sap_ch, intf_ch);
+
 	if (intf_ch && sap_ch != intf_ch &&
 			cc_switch_mode != QDF_MCC_TO_SCC_SWITCH_FORCE) {
 		sap_lfreq = sap_cfreq - sap_hbw;