diff --git a/qdf/inc/qdf_ipa.h b/qdf/inc/qdf_ipa.h index 3dd9b601b7..7bce4391e1 100644 --- a/qdf/inc/qdf_ipa.h +++ b/qdf/inc/qdf_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019, 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 above @@ -213,6 +213,16 @@ typedef __qdf_ipa_gsi_ep_config_t qdf_ipa_gsi_ep_config_t; */ typedef __qdf_ipa_dp_evt_type_t qdf_ipa_dp_evt_type_t; +#ifdef WDI3_STATS_UPDATE +/** + * qdf_ipa_wdi_tx_info_t - WLAN embedded TX bytes information + * + * WLAN host fills this structure to update IPA driver about + * embedded TX information. + */ +typedef __qdf_ipa_wdi_tx_info_t qdf_ipa_wdi_tx_info_t; +#endif + typedef __qdf_ipa_hdr_add_t qdf_ipa_hdr_add_t; typedef __qdf_ipa_hdr_del_t qdf_ipa_hdr_del_t; typedef __qdf_ipa_ioc_add_hdr_t qdf_ipa_ioc_add_hdr_t; diff --git a/qdf/inc/qdf_ipa_wdi3.h b/qdf/inc/qdf_ipa_wdi3.h index 004f8e7d7e..0416b249a3 100644 --- a/qdf/inc/qdf_ipa_wdi3.h +++ b/qdf/inc/qdf_ipa_wdi3.h @@ -398,5 +398,19 @@ static inline int qdf_ipa_wdi_release_smmu_mapping(uint32_t num_buffers, return __qdf_ipa_wdi_release_smmu_mapping(num_buffers, info); } +#ifdef WDI3_STATS_UPDATE +/** + * qdf_ipa_wdi_wlan_stats() - Client should call this function to + * send Tx byte counts to IPA driver + * @tx_count: number of Tx bytes + * + * Returns: 0 on success, negative on failure + */ +static inline int qdf_ipa_wdi_wlan_stats(qdf_ipa_wdi_tx_info_t *tx_stats) +{ + return __qdf_ipa_wdi_wlan_stats(tx_stats); +} +#endif + #endif /* IPA_OFFLOAD */ #endif /* _QDF_IPA_WDI3_H */ diff --git a/qdf/linux/src/i_qdf_ipa.h b/qdf/linux/src/i_qdf_ipa.h index 09be8ff9b4..e84e61e163 100644 --- a/qdf/linux/src/i_qdf_ipa.h +++ b/qdf/linux/src/i_qdf_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2019, 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 above @@ -377,6 +377,18 @@ typedef struct ipa_wdi_buffer_info __qdf_ipa_wdi_buffer_info_t; */ typedef struct ipa_gsi_ep_config __qdf_ipa_gsi_ep_config_t; +#ifdef WDI3_STATS_UPDATE +/** + * __qdf_ipa_wdi_tx_info_t - WLAN embedded TX information + */ +typedef struct ipa_wdi_tx_info __qdf_ipa_wdi_tx_info_t; + +#define QDF_IPA_WDI_TX_INFO_STA_TX_BYTES(stats_info) \ + (((struct ipa_wdi_tx_info *)stats_info)->sta_tx) +#define QDF_IPA_WDI_TX_INFO_SAP_TX_BYTES(stats_info) \ + (((struct ipa_wdi_tx_info *)stats_info)->ap_tx) +#endif + /** * __qdf_ipa_dp_evt_type_t - type of event client callback is * invoked for on data path diff --git a/qdf/linux/src/i_qdf_ipa_wdi3.h b/qdf/linux/src/i_qdf_ipa_wdi3.h index fa3758aa2a..b05467a998 100644 --- a/qdf/linux/src/i_qdf_ipa_wdi3.h +++ b/qdf/linux/src/i_qdf_ipa_wdi3.h @@ -386,6 +386,20 @@ static inline int __qdf_ipa_wdi_release_smmu_mapping(u32 num_buffers, return ipa_wdi_release_smmu_mapping(num_buffers, info); } +#ifdef WDI3_STATS_UPDATE +/** + * __qdf_ipa_wdi_wlan_stats() - Client should call this function to + * send Tx byte counts to IPA driver + * @tx_stats: number of Tx bytes on STA and SAP + * + * Returns: 0 on success, negative on failure + */ +static inline int __qdf_ipa_wdi_wlan_stats(struct ipa_wdi_tx_info *tx_stats) +{ + return ipa_wdi_sw_stats(tx_stats); +} +#endif + #else /* CONFIG_IPA_WDI_UNIFIED_API */ /**