summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/cds/inc/cds_concurrency.h12
-rw-r--r--core/cds/src/cds_concurrency.c48
2 files changed, 60 insertions, 0 deletions
diff --git a/core/cds/inc/cds_concurrency.h b/core/cds/inc/cds_concurrency.h
index f105654eb0d9..b6361ed00013 100644
--- a/core/cds/inc/cds_concurrency.h
+++ b/core/cds/inc/cds_concurrency.h
@@ -1061,4 +1061,16 @@ uint32_t cds_get_connection_info(struct connection_info *info);
* Return: None
*/
void cds_trim_acs_channel_list(tsap_Config_t *sap_cfg);
+
+/**
+ * cds_allow_multi_sap_go_concurrency() - check whether multiple SAP/GO
+ * interfaces are allowed
+ * @cds_con_mode: operating mode of the new interface
+ * @channel: operating channel of the new interface
+ * This function checks whether second SAP/GO interface is allowed on the same
+ * MAC.
+ *
+ * Return: true or false
+ */
+bool cds_allow_sap_go_concurrency(enum cds_con_mode mode, uint8_t channel);
#endif /* __CDS_CONCURRENCY_H */
diff --git a/core/cds/src/cds_concurrency.c b/core/cds/src/cds_concurrency.c
index 63ba0fd576ac..3d72e2bb57a1 100644
--- a/core/cds/src/cds_concurrency.c
+++ b/core/cds/src/cds_concurrency.c
@@ -5918,6 +5918,49 @@ static bool cds_is_5g_channel_allowed(uint8_t channel, uint32_t *list,
}
+bool cds_allow_sap_go_concurrency(enum cds_con_mode mode, uint8_t channel)
+{
+ uint32_t sap_cnt;
+ uint32_t go_cnt;
+ enum cds_con_mode con_mode;
+ uint8_t con_chan;
+ int id;
+
+ sap_cnt = cds_mode_specific_connection_count(CDS_SAP_MODE, NULL);
+ go_cnt = cds_mode_specific_connection_count(CDS_P2P_GO_MODE, NULL);
+
+ if ((mode == CDS_SAP_MODE || mode == CDS_P2P_GO_MODE) && (sap_cnt ||
+ go_cnt)) {
+ if (!wma_is_dbs_enable()) {
+ /* Don't allow second SAP/GO interface if DBS is not
+ * supported */
+ cds_debug("DBS is not supported, don't allow second SAP interface");
+ return false;
+ }
+
+ /* If DBS is supported then allow second SAP/GO session only if
+ * the freq band of the second SAP/GO interface is different
+ * than the first SAP/GO interface.
+ */
+ for (id = 0; id < MAX_NUMBER_OF_CONC_CONNECTIONS; id++) {
+ if (conc_connection_list[id].in_use) {
+ con_mode = conc_connection_list[id].mode;
+ con_chan = conc_connection_list[id].chan;
+ if (((con_mode == CDS_SAP_MODE) ||
+ (con_mode == CDS_P2P_GO_MODE)) &&
+ (CDS_IS_SAME_BAND_CHANNELS(channel,
+ con_chan))) {
+ cds_debug("DBS is supported, but first SAP and second SAP are on same band, So don't allow second SAP interface");
+ return false;
+ }
+ }
+ }
+ }
+
+ /* Don't block the second interface */
+ return true;
+}
+
/**
* cds_allow_concurrency() - Check for allowed concurrency
* combination
@@ -6122,6 +6165,11 @@ bool cds_allow_concurrency(enum cds_con_mode mode,
qdf_mutex_release(&cds_ctx->qdf_conc_list_lock);
}
+ if (!cds_allow_sap_go_concurrency(mode, channel)) {
+ hdd_err("This concurrency combination is not allowed");
+ goto done;
+ }
+
status = true;
done: