Ver código fonte

qcacld-3.0: Add config for the MCC restriction on Adrastea emulation

On M2M emulation platform we have a fixed mapping between macs, hence
vdev transition & MCC support is not possible on this platform. But MPR
platform doesn't have these limitations. This config allows at runtime
enable/disable vdev transition & MCC support depending on the platform
it is running on.

Change-Id: I17a92dce695ee30f7994f040d4bc612a38680f3e
CRs-fixed: 922181
Tushnim Bhattacharyya 9 anos atrás
pai
commit
58e12dc35a

+ 25 - 5
core/cds/src/cds_concurrency.c

@@ -3568,7 +3568,15 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
 	uint32_t conn_index;
 	enum cds_conc_next_action upgrade = CDS_NOP;
 	uint8_t mac = 0;
+#ifdef QCA_WIFI_3_0_EMU
+	hdd_context_t *hdd_ctx;
 
+	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
+	if (!hdd_ctx) {
+		cds_err("HDD context is NULL");
+		return upgrade;
+	}
+#endif
 	if (wma_is_hw_dbs_capable() == false) {
 		cds_err("driver isn't dbs capable, no further action needed");
 		return upgrade;
@@ -3590,8 +3598,9 @@ enum cds_conc_next_action cds_need_opportunistic_upgrade(void)
 		}
 	}
 #ifdef QCA_WIFI_3_0_EMU
-	/* For emulation only: if we have a connection on 2.4, stay in DBS */
-	if (CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan))
+	/* For M2M emulation only: if we have a connection on 2.4, stay in DBS */
+	if (hdd_ctx->config->enable_m2m_limitation &&
+		CDS_IS_CHANNEL_24GHZ(conc_connection_list[0].chan))
 		goto done;
 #endif
 	/* Let's request for single MAC mode */
@@ -4683,6 +4692,15 @@ bool cds_disallow_mcc(uint8_t channel)
 bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections)
 {
 	bool status = true;
+#ifdef QCA_WIFI_3_0_EMU
+	hdd_context_t *hdd_ctx;
+
+	hdd_ctx = cds_get_context(CDF_MODULE_ID_HDD);
+	if (!hdd_ctx) {
+		cds_err("HDD context is NULL");
+		return false;
+	}
+#endif
 
 	if ((num_connections == 2) &&
 		(conc_connection_list[0].chan != conc_connection_list[1].chan)
@@ -4712,7 +4730,8 @@ bool cds_allow_new_home_channel(uint8_t channel, uint32_t num_connections)
 #ifndef QCA_WIFI_3_0_EMU
 	}
 #else
-	} else if ((num_connections == 1) &&
+	} else if (hdd_ctx->config->enable_m2m_limitation &&
+		(num_connections == 1) &&
 		(conc_connection_list[0].chan != channel)) {
 		if (((CDS_IS_CHANNEL_24GHZ(channel)) &&
 			(CDS_IS_CHANNEL_24GHZ
@@ -5487,10 +5506,11 @@ CDF_STATUS cds_current_connections_update(uint32_t session_id,
 	case 0:
 		next_action = CDS_NOP;
 #ifdef QCA_WIFI_3_0_EMU
-		/* For emulation only: if it is a connection on 2.4,
+		/* For M2M emulation only: if it is a connection on 2.4,
 		 * request DBS
 		 */
-		if (CDS_IS_CHANNEL_24GHZ(channel))
+		if (hdd_ctx->config->enable_m2m_limitation &&
+			CDS_IS_CHANNEL_24GHZ(channel))
 			next_action = CDS_DBS;
 #endif
 		break;

+ 17 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -2861,6 +2861,20 @@ enum dot11p_mode {
 #define CFG_INFORM_BSS_RSSI_RAW_MAX                (1)
 #define CFG_INFORM_BSS_RSSI_RAW_DEFAULT            (1)
 
+#ifdef QCA_WIFI_3_0_EMU
+/*
+ * On M2M emulation platform we have a fixed mapping between macs, hence
+ * vdev transition & MCC support is not possible on this platform. But MPR
+ * platform doesn't have these limitations. This config allows at runtime
+ * enable/disable vdev transition & MCC support depending on the platform
+ * it is running on
+ */
+#define CFG_ENABLE_M2M_LIMITATION              "gEnableM2MLimitation"
+#define CFG_ENABLE_M2M_LIMITATION_MIN          (0)
+#define CFG_ENABLE_M2M_LIMITATION_MAX          (1)
+#define CFG_ENABLE_M2M_LIMITATION_DEFAULT      (1)
+#endif /* QCA_WIFI_3_0_EMU */
+
 /*---------------------------------------------------------------------------
    Type declarations
    -------------------------------------------------------------------------*/
@@ -3448,6 +3462,9 @@ struct hdd_config {
 	bool enable_lfr_subnet_detection;
 #endif
 	uint8_t inform_bss_rssi_raw;
+#ifdef QCA_WIFI_3_0_EMU
+	bool enable_m2m_limitation;
+#endif
 };
 
 #define VAR_OFFSET(_Struct, _Var) (offsetof(_Struct, _Var))

+ 10 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -3666,6 +3666,16 @@ REG_TABLE_ENTRY g_registry_table[] = {
 		CFG_INFORM_BSS_RSSI_RAW_DEFAULT,
 		CFG_INFORM_BSS_RSSI_RAW_MIN,
 		CFG_INFORM_BSS_RSSI_RAW_MAX),
+
+#ifdef QCA_WIFI_3_0_EMU
+	REG_VARIABLE(CFG_ENABLE_M2M_LIMITATION, WLAN_PARAM_Integer,
+		struct hdd_config, enable_m2m_limitation,
+		VAR_FLAGS_OPTIONAL | VAR_FLAGS_RANGE_CHECK_ASSUME_DEFAULT,
+		CFG_ENABLE_LFR_SUBNET_DEFAULT,
+		CFG_ENABLE_LFR_SUBNET_MIN,
+		CFG_ENABLE_LFR_SUBNET_MAX),
+#endif
+
 };