diff --git a/core/hdd/src/wlan_hdd_hostapd.c b/core/hdd/src/wlan_hdd_hostapd.c index 5774b87c85..682314f9d6 100644 --- a/core/hdd/src/wlan_hdd_hostapd.c +++ b/core/hdd/src/wlan_hdd_hostapd.c @@ -1581,24 +1581,7 @@ static void hdd_fill_station_info(struct hdd_adapter *adapter, stainfo->tx_mcs_map); } -/** - * hdd_stop_sap_due_to_invalid_channel() - to stop sap in case of invalid chnl - * @work: pointer to work structure - * - * Let's say SAP detected RADAR and trying to select the new channel and if no - * valid channel is found due to none of the channels are available or - * regulatory restriction then SAP needs to be stopped. so SAP state-machine - * will create a work to stop the bss - * - * stop bss has to happen through worker thread because radar indication comes - * from FW through mc thread or main host thread and if same thread is used to - * do stopbss then waiting for stopbss to finish operation will halt mc thread - * to freeze which will trigger stopbss timeout. Instead worker thread can do - * the stopbss operation while mc thread waits for stopbss to finish. - * - * Return: none - */ -static void hdd_stop_sap_due_to_invalid_channel(struct work_struct *work) +void hdd_stop_sap_due_to_invalid_channel(struct work_struct *work) { struct hdd_adapter *sap_adapter = container_of(work, struct hdd_adapter, sap_stop_bss_work); @@ -2632,8 +2615,6 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event, case eSAP_STOP_BSS_DUE_TO_NO_CHNL: hdd_debug("Stop sap session[%d]", adapter->vdev_id); - INIT_WORK(&adapter->sap_stop_bss_work, - hdd_stop_sap_due_to_invalid_channel); schedule_work(&adapter->sap_stop_bss_work); return QDF_STATUS_SUCCESS; diff --git a/core/hdd/src/wlan_hdd_hostapd.h b/core/hdd/src/wlan_hdd_hostapd.h index e4c435fd7f..beee7edb86 100644 --- a/core/hdd/src/wlan_hdd_hostapd.h +++ b/core/hdd/src/wlan_hdd_hostapd.h @@ -263,4 +263,23 @@ int wlan_hdd_disable_channels(struct hdd_context *hdd_ctx); void hdd_check_and_disconnect_sta_on_invalid_channel( struct hdd_context *hdd_ctx); +/** + * hdd_stop_sap_due_to_invalid_channel() - to stop sap in case of invalid chnl + * @work: pointer to work structure + * + * Let's say SAP detected RADAR and trying to select the new channel and if no + * valid channel is found due to none of the channels are available or + * regulatory restriction then SAP needs to be stopped. so SAP state-machine + * will create a work to stop the bss + * + * stop bss has to happen through worker thread because radar indication comes + * from FW through mc thread or main host thread and if same thread is used to + * do stopbss then waiting for stopbss to finish operation will halt mc thread + * to freeze which will trigger stopbss timeout. Instead worker thread can do + * the stopbss operation while mc thread waits for stopbss to finish. + * + * Return: none + */ +void hdd_stop_sap_due_to_invalid_channel(struct work_struct *work); + #endif /* end #if !defined(WLAN_HDD_HOSTAPD_H) */ diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index fe49809cbf..782a36e4f9 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -5582,6 +5582,8 @@ struct hdd_adapter *hdd_open_adapter(struct hdd_context *hdd_ctx, uint8_t sessio hdd_init_completion(adapter); INIT_WORK(&adapter->scan_block_work, wlan_hdd_cfg80211_scan_block_cb); + INIT_WORK(&adapter->sap_stop_bss_work, + hdd_stop_sap_due_to_invalid_channel); qdf_list_create(&adapter->blocked_scan_request_q, WLAN_MAX_SCAN_COUNT); qdf_mutex_create(&adapter->blocked_scan_request_q_lock); qdf_event_create(&adapter->acs_complete_event);