From 6162ab3b6727c25e68899bcd79a2b4e80f1e29e6 Mon Sep 17 00:00:00 2001 From: Ananya Gupta Date: Thu, 15 Oct 2020 15:59:23 +0530 Subject: [PATCH] qcacld-3.0: handle multiple sap if NAPI is enabled for IPA Disable IPA when second SAP is turned on only if NAPI support is enabled for IPA path. Change-Id: Id30714156a959ed940d0480cb0e0d8db467c821f CRs-Fixed: 2807158 --- components/ipa/core/inc/wlan_ipa_core.h | 20 ++++++++++++++++++ components/ipa/core/src/wlan_ipa_core.c | 28 ++++++++++--------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/components/ipa/core/inc/wlan_ipa_core.h b/components/ipa/core/inc/wlan_ipa_core.h index 84b091e57179..c0a66ae9e817 100644 --- a/components/ipa/core/inc/wlan_ipa_core.h +++ b/components/ipa/core/inc/wlan_ipa_core.h @@ -595,6 +595,19 @@ void ipa_set_rps_per_vdev(struct wlan_ipa_priv *ipa_ctx, uint8_t vdev_id, ipa_ctx->rps_enable(vdev_id, enable); } +/** + * wlan_ipa_handle_multiple_sap_evt() - Handle multiple SAP connect/disconnect + * @ipa_ctx: IPA global context + * @type: IPA event type. + * + * This function is used to disable pipes when multiple SAP are connected and + * enable pipes back when only one SAP is connected. + * + * Return: None + */ +void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx, + qdf_ipa_wlan_event type); + #else static inline void ipa_set_rps(struct wlan_ipa_priv *ipa_ctx, enum QDF_OPMODE mode, @@ -607,6 +620,13 @@ void ipa_set_rps_per_vdev(struct wlan_ipa_priv *ipa_ctx, uint8_t vdev_id, bool enable) { } + +static inline +void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx, + qdf_ipa_wlan_event type) +{ +} + #endif /** diff --git a/components/ipa/core/src/wlan_ipa_core.c b/components/ipa/core/src/wlan_ipa_core.c index 54b02b529808..2826ae88ce16 100644 --- a/components/ipa/core/src/wlan_ipa_core.c +++ b/components/ipa/core/src/wlan_ipa_core.c @@ -1622,7 +1622,7 @@ static QDF_STATUS wlan_ipa_uc_handle_first_con(struct wlan_ipa_priv *ipa_ctx) { ipa_debug("enter"); - if (ipa_ctx->num_sap_connected > 1) { + if (qdf_ipa_get_lan_rx_napi() && (ipa_ctx->num_sap_connected > 1)) { ipa_debug("Multiple SAP connected. Not enabling pipes. Exit"); return QDF_STATUS_E_PERM; } @@ -1939,17 +1939,7 @@ static QDF_STATUS wlan_ipa_send_msg(qdf_netdev_t net_dev, return QDF_STATUS_SUCCESS; } -/** - * wlan_ipa_handle_multiple_sap_evt() - Handle multiple SAP connect/disconnect - * @ipa_ctx: IPA global context - * @type: IPA event type. - * - * This function is used to disable pipes when multiple SAP are connected and - * enable pipes back when only one SAP is connected. - * - * Return: None - */ -static inline +#ifdef IPA_LAN_RX_NAPI_SUPPORT void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx, qdf_ipa_wlan_event type) { @@ -1991,6 +1981,7 @@ void wlan_ipa_handle_multiple_sap_evt(struct wlan_ipa_priv *ipa_ctx, wlan_ipa_uc_disable_pipes(ipa_ctx, true); } } +#endif /** * __wlan_ipa_wlan_evt() - IPA event handler @@ -2141,7 +2132,8 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, } } - if (ipa_ctx->num_sap_connected == 1) { + if (qdf_ipa_get_lan_rx_napi() && + ipa_ctx->num_sap_connected == 1) { wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type); } @@ -2262,12 +2254,13 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, if (wlan_ipa_uc_is_enabled(ipa_ctx->config)) { qdf_mutex_release(&ipa_ctx->event_lock); - if (ipa_ctx->num_sap_connected == 1) { + if (qdf_ipa_get_lan_rx_napi() && + (ipa_ctx->num_sap_connected > 1)) { + wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type); + } else { wlan_ipa_uc_offload_enable_disable(ipa_ctx, SIR_AP_RX_DATA_OFFLOAD, session_id, true); - } else { - wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type); } qdf_mutex_acquire(&ipa_ctx->event_lock); } @@ -2408,7 +2401,8 @@ static QDF_STATUS __wlan_ipa_wlan_evt(qdf_netdev_t net_dev, uint8_t device_mode, } } - if (ipa_ctx->num_sap_connected == 1) + if (qdf_ipa_get_lan_rx_napi() && + (ipa_ctx->num_sap_connected == 1)) wlan_ipa_handle_multiple_sap_evt(ipa_ctx, type); qdf_mutex_release(&ipa_ctx->event_lock);