diff --git a/ipa/core/inc/wlan_ipa_core.h b/ipa/core/inc/wlan_ipa_core.h index f3cbd5b619..535f8f6cba 100644 --- a/ipa/core/inc/wlan_ipa_core.h +++ b/ipa/core/inc/wlan_ipa_core.h @@ -642,5 +642,13 @@ QDF_STATUS wlan_ipa_uc_disconnect_ap(struct wlan_ipa_priv *ipa_ctx, */ void wlan_ipa_cleanup_dev_iface(struct wlan_ipa_priv *ipa_ctx, qdf_netdev_t net_dev); + +/** + * wlan_ipa_uc_ssr_cleanup() - handle IPA UC clean up during SSR + * @ipa_ctx: IPA context + * + * Return: None + */ +void wlan_ipa_uc_ssr_cleanup(struct wlan_ipa_priv *ipa_ctx); #endif /* IPA_OFFLOAD */ #endif /* _WLAN_IPA_CORE_H_ */ diff --git a/ipa/core/inc/wlan_ipa_main.h b/ipa/core/inc/wlan_ipa_main.h index 0ef98d58fe..596e69ae12 100644 --- a/ipa/core/inc/wlan_ipa_main.h +++ b/ipa/core/inc/wlan_ipa_main.h @@ -401,10 +401,17 @@ QDF_STATUS ipa_uc_disconnect_ap(struct wlan_objmgr_pdev *pdev, * @pdev: pdev obj * @net_dev: Interface net device * - * * Return: None */ void ipa_cleanup_dev_iface(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev); + +/** + * ipa_uc_ssr_cleanup() - handle IPA UC cleanup during SSR + * @pdev: pdev obj + * + * Return: None + */ +void ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev *pdev); #endif /* IPA_OFFLOAD */ #endif /* end of _WLAN_IPA_MAIN_H_ */ diff --git a/ipa/core/src/wlan_ipa_core.c b/ipa/core/src/wlan_ipa_core.c index 542c70cef3..9f9bc1ceed 100644 --- a/ipa/core/src/wlan_ipa_core.c +++ b/ipa/core/src/wlan_ipa_core.c @@ -2981,3 +2981,26 @@ void wlan_ipa_cleanup_dev_iface(struct wlan_ipa_priv *ipa_ctx, if (iface_ctx) wlan_ipa_cleanup_iface(iface_ctx); } + +void wlan_ipa_uc_ssr_cleanup(struct wlan_ipa_priv *ipa_ctx) +{ + struct wlan_ipa_iface_context *iface; + int i; + + ipa_info("enter"); + + for (i = 0; i < WLAN_IPA_MAX_IFACE; i++) { + iface = &ipa_ctx->iface_context[i]; + if (iface->dev) { + if (iface->device_mode == QDF_SAP_MODE) + wlan_ipa_uc_send_evt(iface->dev, + QDF_IPA_AP_DISCONNECT, + iface->dev->dev_addr); + else if (iface->device_mode == QDF_STA_MODE) + wlan_ipa_uc_send_evt(iface->dev, + QDF_IPA_STA_DISCONNECT, + iface->dev->dev_addr); + wlan_ipa_cleanup_iface(iface); + } + } +} diff --git a/ipa/core/src/wlan_ipa_main.c b/ipa/core/src/wlan_ipa_main.c index d242e7c74a..31a2080684 100644 --- a/ipa/core/src/wlan_ipa_main.c +++ b/ipa/core/src/wlan_ipa_main.c @@ -576,3 +576,16 @@ void ipa_cleanup_dev_iface(struct wlan_objmgr_pdev *pdev, return wlan_ipa_cleanup_dev_iface(ipa_obj, net_dev); } + +void ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev *pdev) +{ + struct wlan_ipa_priv *ipa_obj; + + ipa_obj = ipa_pdev_get_priv_obj(pdev); + if (!ipa_obj) { + ipa_err("IPA object is NULL"); + return; + } + + return wlan_ipa_uc_ssr_cleanup(ipa_obj); +} diff --git a/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h b/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h index 84b874c937..b9a041c526 100644 --- a/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h +++ b/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h @@ -312,6 +312,17 @@ QDF_STATUS ucfg_ipa_uc_disconnect_ap(struct wlan_objmgr_pdev *pdev, */ void ucfg_ipa_cleanup_dev_iface(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev); + +/** + * ucfg_ipa_uc_ssr_cleanup() - Handle IPA cleanup for SSR + * @pdev: pdev obj + * + * From hostside do cleanup such as deregister IPA interafces + * and send disconnect events so that it will be sync after SSR + * + * Return: None + */ +void ucfg_ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev *pdev); #else static inline bool ucfg_ipa_is_present(void) @@ -487,5 +498,10 @@ void ucfg_ipa_cleanup_dev_iface(struct wlan_objmgr_pdev *pdev, qdf_netdev_t net_dev) { } + +static inline +void ucfg_ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev *pdev) +{ +} #endif /* IPA_OFFLOAD */ #endif /* _WLAN_IPA_UCFG_API_H_ */ diff --git a/ipa/dispatcher/src/wlan_ipa_ucfg_api.c b/ipa/dispatcher/src/wlan_ipa_ucfg_api.c index 2df81efba4..7bca1ec617 100644 --- a/ipa/dispatcher/src/wlan_ipa_ucfg_api.c +++ b/ipa/dispatcher/src/wlan_ipa_ucfg_api.c @@ -186,3 +186,8 @@ void ucfg_ipa_cleanup_dev_iface(struct wlan_objmgr_pdev *pdev, { return ipa_cleanup_dev_iface(pdev, net_dev); } + +void ucfg_ipa_uc_ssr_cleanup(struct wlan_objmgr_pdev *pdev) +{ + return ipa_uc_ssr_cleanup(pdev); +}