diff --git a/init_deinit/dispatcher/inc/dispatcher_init_deinit.h b/init_deinit/dispatcher/inc/dispatcher_init_deinit.h index c0a73e424ca4..46067810bb9c 100644 --- a/init_deinit/dispatcher/inc/dispatcher_init_deinit.h +++ b/init_deinit/dispatcher/inc/dispatcher_init_deinit.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2018 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -155,4 +155,26 @@ QDF_STATUS dispatcher_psoc_enable(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc); +/** + * dispatcher_pdev_open(): API to trigger PDEV open for all new components + * @pdev: pdev context + * + * This API calls all new components PDEV OPEN APIs. This is invoked from + * during PDEV object is created. + * + * Return: none + */ +QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev); + +/** + * dispatcher_pdev_close(): API to trigger PDEV close for all new components + * @pdev: pdev context + * + * This API calls all new components PDEV CLOSE APIs. This is invoked from + * during driver unload sequence. + * + * Return: none + */ +QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev); + #endif /* End of !defined(__DISPATCHER_INIT_H) */ diff --git a/init_deinit/dispatcher/src/dispatcher_init_deinit.c b/init_deinit/dispatcher/src/dispatcher_init_deinit.c index 38cffaa77bdf..8e9ce6100d0b 100644 --- a/init_deinit/dispatcher/src/dispatcher_init_deinit.c +++ b/init_deinit/dispatcher/src/dispatcher_init_deinit.c @@ -274,6 +274,18 @@ static QDF_STATUS dispatcher_regulatory_psoc_close(struct wlan_objmgr_psoc return regulatory_psoc_close(psoc); } +static QDF_STATUS dispatcher_regulatory_pdev_open(struct wlan_objmgr_pdev + *pdev) +{ + return regulatory_pdev_open(pdev); +} + +static QDF_STATUS dispatcher_regulatory_pdev_close(struct wlan_objmgr_pdev + *pdev) +{ + return regulatory_pdev_close(pdev); +} + #ifdef WLAN_POLICY_MGR_ENABLE static QDF_STATUS dispatcher_policy_mgr_init(void) { @@ -1127,3 +1139,27 @@ QDF_STATUS dispatcher_psoc_disable(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } EXPORT_SYMBOL(dispatcher_psoc_disable); + +QDF_STATUS dispatcher_pdev_open(struct wlan_objmgr_pdev *pdev) +{ + if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_open(pdev)) + goto out; + + return QDF_STATUS_SUCCESS; + +out: + return QDF_STATUS_E_FAILURE; +} +EXPORT_SYMBOL(dispatcher_pdev_open); + +QDF_STATUS dispatcher_pdev_close(struct wlan_objmgr_pdev *pdev) +{ + if (QDF_STATUS_SUCCESS != dispatcher_regulatory_pdev_close(pdev)) + goto out; + + return QDF_STATUS_SUCCESS; + +out: + return QDF_STATUS_E_FAILURE; +} +EXPORT_SYMBOL(dispatcher_pdev_close); diff --git a/umac/regulatory/core/src/reg_services.c b/umac/regulatory/core/src/reg_services.c index 1e94c5bc51ca..b9358c318d6b 100644 --- a/umac/regulatory/core/src/reg_services.c +++ b/umac/regulatory/core/src/reg_services.c @@ -2341,7 +2341,7 @@ static QDF_STATUS reg_sched_chan_change_cbks_nb(struct scheduler_msg *msg) return QDF_STATUS_SUCCESS; } -static QDF_STATUS reg_send_scheduler_msg_sb(struct wlan_objmgr_psoc *psoc, +QDF_STATUS reg_send_scheduler_msg_sb(struct wlan_objmgr_psoc *psoc, struct wlan_objmgr_pdev *pdev) { struct scheduler_msg msg = {0}; @@ -3032,14 +3032,6 @@ QDF_STATUS wlan_regulatory_pdev_obj_created_notification( reg_compute_pdev_current_chan_list(pdev_priv_obj); - status = reg_send_scheduler_msg_sb(parent_psoc, pdev); - - if (QDF_IS_STATUS_ERROR(status)) { - qdf_mem_free(pdev_priv_obj); - reg_err("scheduler send msg failed"); - return status; - } - status = wlan_objmgr_pdev_component_obj_attach(pdev, WLAN_UMAC_COMP_REGULATORY, pdev_priv_obj, diff --git a/umac/regulatory/core/src/reg_services.h b/umac/regulatory/core/src/reg_services.h index 7cc1ce7821eb..dee793215b51 100644 --- a/umac/regulatory/core/src/reg_services.h +++ b/umac/regulatory/core/src/reg_services.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -414,4 +414,15 @@ bool reg_get_en_chan_144(struct wlan_objmgr_pdev *pdev); */ QDF_STATUS reg_process_ch_avoid_event(struct wlan_objmgr_psoc *psoc, struct ch_avoid_ind_type *ch_avoid_event); + +/** + * reg_send_scheduler_msg_sb() - Start scheduler to call list of callbacks + * registered whenever current chan list changes. + * @psoc: Pointer to PSOC structure. + * @pdev: Pointer to PDEV structure. + * + * Return: QDF_STATUS + */ +QDF_STATUS reg_send_scheduler_msg_sb(struct wlan_objmgr_psoc *psoc, + struct wlan_objmgr_pdev *pdev); #endif diff --git a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h index ce73b50ec446..aa64e1445b3f 100644 --- a/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h +++ b/umac/regulatory/dispatcher/inc/wlan_reg_services_api.h @@ -285,6 +285,22 @@ QDF_STATUS regulatory_psoc_open(struct wlan_objmgr_psoc *psoc); */ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc); +/** + * regulatory_pdev_open() - Open regulatory component + * @pdev: Pointer to pdev structure. + * + * Return: Success or Failure + */ +QDF_STATUS regulatory_pdev_open(struct wlan_objmgr_pdev *pdev); + +/** + * regulatory_pdev_close() - Close regulatory component + * @pdev: Pointer to pdev structure. + * + * Return: Success or Failure + */ +QDF_STATUS regulatory_pdev_close(struct wlan_objmgr_pdev *pdev); + /** * wlan_reg_update_nol_ch () - set nol channel * @pdev: pdev ptr diff --git a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c index a5e648a0d953..71389155713f 100644 --- a/umac/regulatory/dispatcher/src/wlan_reg_services_api.c +++ b/umac/regulatory/dispatcher/src/wlan_reg_services_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2018 The Linux Foundation. All rights reserved. * * * Permission to use, copy, modify, and/or distribute this software for @@ -380,6 +380,26 @@ QDF_STATUS regulatory_psoc_close(struct wlan_objmgr_psoc *psoc) return QDF_STATUS_SUCCESS; } +QDF_STATUS regulatory_pdev_open(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_objmgr_psoc *parent_psoc; + QDF_STATUS status; + + parent_psoc = wlan_pdev_get_psoc(pdev); + + status = reg_send_scheduler_msg_sb(parent_psoc, pdev); + + if (QDF_IS_STATUS_ERROR(status)) + reg_err("scheduler send msg failed"); + + return status; +} + +QDF_STATUS regulatory_pdev_close(struct wlan_objmgr_pdev *pdev) +{ + return QDF_STATUS_SUCCESS; +} + void wlan_reg_update_nol_ch(struct wlan_objmgr_pdev *pdev, uint8_t *ch_list, uint8_t num_ch, bool nol_ch) {