diff --git a/core/sap/src/sap_fsm.c b/core/sap/src/sap_fsm.c index cdeec824fa..5858e2634c 100644 --- a/core/sap/src/sap_fsm.c +++ b/core/sap/src/sap_fsm.c @@ -2483,6 +2483,43 @@ static QDF_STATUS sap_fsm_handle_start_failure(struct sap_context *sap_ctx, return qdf_status; } +/** + * sap_propagate_cac_events() - Indicate CAC START/END event + * @sap_ctx: SAP context + * + * This function is to indicate CAC START/END event if CAC process + * is skipped. + * + * Return: void + */ +static void sap_propagate_cac_events(struct sap_context *sap_ctx) +{ + QDF_STATUS qdf_status; + + qdf_status = sap_signal_hdd_event(sap_ctx, NULL, + eSAP_DFS_CAC_START, + (void *) + eSAP_STATUS_SUCCESS); + if (qdf_status != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_SAP, + QDF_TRACE_LEVEL_DEBUG, + "failed to indicate CAC START vdev %d", + sap_ctx->sessionId); + return; + } + + qdf_status = sap_signal_hdd_event(sap_ctx, NULL, + eSAP_DFS_CAC_END, + (void *) + eSAP_STATUS_SUCCESS); + if (qdf_status != QDF_STATUS_SUCCESS) { + QDF_TRACE(QDF_MODULE_ID_SAP, + QDF_TRACE_LEVEL_DEBUG, + "failed to indicate CAC End vdev %d", + sap_ctx->sessionId); + } +} + /** * sap_fsm_state_starting() - utility function called from sap fsm * @sap_ctx: SAP context @@ -2588,6 +2625,16 @@ static QDF_STATUS sap_fsm_state_starting(struct sap_context *sap_ctx, QDF_TRACE(QDF_MODULE_ID_SAP, QDF_TRACE_LEVEL_INFO_HIGH, FL("skip cac timer")); + /* + * If hostapd starts AP on dfs channel, + * hostapd will wait for CAC START/CAC END + * event and finish AP start process. + * If we skip CAC timer, we will need to + * indicate the CAC event even though driver + * doesn't perform CAC. + */ + sap_propagate_cac_events(sap_ctx); + wlansap_start_beacon_req(sap_ctx); } }