diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_tdls.h | 32 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_p2p.c | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_tdls.c | 31 |
3 files changed, 41 insertions, 26 deletions
diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index e8808b5eaa73..0bad4a40c9b4 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -51,6 +51,16 @@ typedef enum { eTDLS_SUPPORT_EXTERNAL_CONTROL, } eTDLSSupportMode; +/** + * enum tdls_concerned_external_events - External events that affect TDLS + * @P2P_ROC_START: P2P remain on channel starts + * @P2P_ROC_END: P2P remain on channel ends + */ +enum tdls_concerned_external_events { + P2P_ROC_START, + P2P_ROC_END, +}; + #ifdef FEATURE_WLAN_TDLS /* @@ -750,8 +760,22 @@ void wlan_hdd_tdls_notify_connect(hdd_adapter_t *adapter, */ void wlan_hdd_tdls_notify_disconnect(hdd_adapter_t *adapter, bool lfr_roam); void wlan_hdd_change_tdls_mode(void *hdd_ctx); -void hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx, - eTDLSSupportMode tdls_mode); + +/** + * hdd_tdls_notify_p2p_roc() - Notify p2p roc event to TDLS + * @hdd_ctx: ptr to hdd context. + * @event: P2P roc event that affect TDLS + * + * P2P roc events notified to TDLS to avoid overlap between P2P listen + * and TDLS operation. + * Based on P2P remain on channel event, TDLS mode will be + * updated and TDLS source timer started with timer period + * equivalent to P2P ROC interval to revert the TDLS mode. + * + * Return: None + */ +void hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx, + enum tdls_concerned_external_events event); /** * wlan_hdd_cfg80211_configure_tdls_mode() - configure tdls mode @@ -822,8 +846,8 @@ static inline void wlan_hdd_change_tdls_mode(void *hdd_ctx) { } static inline void -hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx, - eTDLSSupportMode tdls_mode) +hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx, + enum tdls_concerned_external_events event) { } #endif /* End of FEATURE_WLAN_TDLS */ diff --git a/core/hdd/src/wlan_hdd_p2p.c b/core/hdd/src/wlan_hdd_p2p.c index 8cd190effb3f..863872605a73 100644 --- a/core/hdd/src/wlan_hdd_p2p.c +++ b/core/hdd/src/wlan_hdd_p2p.c @@ -535,7 +535,7 @@ static void wlan_hdd_remain_on_chan_timeout(void *data) roc_scan_id); } - hdd_restart_tdls_source_timer(hdd_ctx, hdd_ctx->tdls_mode_last); + hdd_tdls_notify_p2p_roc(hdd_ctx, P2P_ROC_END); qdf_runtime_pm_allow_suspend(&hdd_ctx->runtime_context.roc); hdd_allow_suspend(WIFI_POWER_EVENT_WAKELOCK_ROC); @@ -698,7 +698,7 @@ static int wlan_hdd_execute_remain_on_channel(hdd_adapter_t *pAdapter, } } - hdd_restart_tdls_source_timer(pHddCtx, eTDLS_SUPPORT_DISABLED); + hdd_tdls_notify_p2p_roc(pHddCtx, P2P_ROC_START); return 0; } diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index c4813c6e689a..2abbe0129382 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -6045,31 +6045,22 @@ void wlan_hdd_change_tdls_mode(void *data) HDD_SET_TDLS_MODE_SOURCE_P2P); } -/** - * hdd_restart_tdls_source_timer - Restart TDLS source timer - * @pHddCtx: ptr to hdd context. - * @tdls_mode: value for TDLS support mode. - * - * This timer is the handler for avoiding overlapping for P2P listen - * and TDLS operation. This handler will start the source timer for - * the duration of tdls_enable_defer_time after P2P listen ends and - * before enabling TDLS again. - * - * Return: None - */ -void hdd_restart_tdls_source_timer(hdd_context_t *pHddCtx, - eTDLSSupportMode tdls_mode) +void hdd_tdls_notify_p2p_roc(hdd_context_t *hdd_ctx, + enum tdls_concerned_external_events event) { - qdf_mc_timer_stop(&pHddCtx->tdls_source_timer); + eTDLSSupportMode tdls_mode; + + qdf_mc_timer_stop(&hdd_ctx->tdls_source_timer); - if (tdls_mode == eTDLS_SUPPORT_DISABLED) { - wlan_hdd_tdls_set_mode(pHddCtx, tdls_mode, false, + if (event == P2P_ROC_START) { + tdls_mode = eTDLS_SUPPORT_DISABLED; + wlan_hdd_tdls_set_mode(hdd_ctx, tdls_mode, false, HDD_SET_TDLS_MODE_SOURCE_P2P); - wlan_hdd_tdls_disable_offchan_and_teardown_links(pHddCtx); + wlan_hdd_tdls_disable_offchan_and_teardown_links(hdd_ctx); } - qdf_mc_timer_start(&pHddCtx->tdls_source_timer, - pHddCtx->config->tdls_enable_defer_time); + qdf_mc_timer_start(&hdd_ctx->tdls_source_timer, + hdd_ctx->config->tdls_enable_defer_time); return; } |
