diff --git a/dp/inc/cdp_txrx_ipa.h b/dp/inc/cdp_txrx_ipa.h index 5a71020a56..2e33008c67 100644 --- a/dp/inc/cdp_txrx_ipa.h +++ b/dp/inc/cdp_txrx_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 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 @@ -24,7 +24,8 @@ #define _CDP_TXRX_IPA_H_ #ifdef IPA_OFFLOAD -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) #include #else #include @@ -359,7 +360,9 @@ cdp_ipa_disable_autonomy(ol_txrx_soc_handle soc, uint8_t pdev_id) return QDF_STATUS_SUCCESS; } -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) + /** * cdp_ipa_setup() - Setup and connect IPA pipes * @soc: data path soc handle diff --git a/dp/inc/cdp_txrx_ops.h b/dp/inc/cdp_txrx_ops.h index b0961ee22a..5e15af092c 100644 --- a/dp/inc/cdp_txrx_ops.h +++ b/dp/inc/cdp_txrx_ops.h @@ -33,7 +33,8 @@ #include #ifdef IPA_OFFLOAD -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) #include #else #include @@ -1586,7 +1587,9 @@ struct cdp_ipa_ops { uint8_t pdev_id); QDF_STATUS (*ipa_disable_autonomy)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); -#ifdef CONFIG_IPA_WDI_UNIFIED_API + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) QDF_STATUS (*ipa_setup)(struct cdp_soc_t *soc_hdl, uint8_t pdev_id, void *ipa_i2w_cb, void *ipa_w2i_cb, void *ipa_wdi_meter_notifier_cb, diff --git a/dp/wifi3.0/dp_ipa.c b/dp/wifi3.0/dp_ipa.c index 432ce6b8ad..a32c31ceb8 100644 --- a/dp/wifi3.0/dp_ipa.c +++ b/dp/wifi3.0/dp_ipa.c @@ -1759,7 +1759,8 @@ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id) /* This should be configurable per H/W configuration enable status */ #define L3_HEADER_PADDING 2 -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) #ifndef QCA_LL_TX_FLOW_CONTROL_V2 static inline void dp_setup_mcc_sys_pipes( diff --git a/dp/wifi3.0/dp_ipa.h b/dp/wifi3.0/dp_ipa.h index d909899b27..df484de4dd 100644 --- a/dp/wifi3.0/dp_ipa.h +++ b/dp/wifi3.0/dp_ipa.h @@ -159,7 +159,8 @@ QDF_STATUS dp_ipa_enable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); */ QDF_STATUS dp_ipa_disable_autonomy(struct cdp_soc_t *soc_hdl, uint8_t pdev_id); -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) /** * dp_ipa_setup() - Setup and connect IPA pipes * @soc_hdl - data path soc handle diff --git a/qdf/inc/qdf_ipa.h b/qdf/inc/qdf_ipa.h index e869f02d7d..18ed73bef6 100644 --- a/qdf/inc/qdf_ipa.h +++ b/qdf/inc/qdf_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, 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 @@ -286,6 +286,8 @@ typedef void (*qdf_ipa_ready_cb)(void *user_data); /* * Resume / Suspend */ + +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) static inline int qdf_ipa_reset_endpoint(u32 clnt_hdl) { return __qdf_ipa_reset_endpoint(clnt_hdl); @@ -332,15 +334,6 @@ static inline int qdf_ipa_copy_hdr(qdf_ipa_ioc_copy_hdr_t *copy) return __qdf_ipa_copy_hdr(copy); } -/* - * Messaging - */ -static inline int qdf_ipa_send_msg(qdf_ipa_msg_meta_t *meta, void *buff, - ipa_msg_free_fn callback) -{ - return __qdf_ipa_send_msg(meta, buff, callback); -} - static inline int qdf_ipa_register_pull_msg(qdf_ipa_msg_meta_t *meta, qdf_ipa_msg_pull_fn callback) { @@ -394,11 +387,6 @@ static inline int qdf_ipa_tx_dp_mul( return __qdf_ipa_tx_dp_mul(dst, data_desc); } -static inline void qdf_ipa_free_skb(qdf_ipa_rx_data_t *rx_in) -{ - return __qdf_ipa_free_skb(rx_in);; -} - /* * System pipes */ @@ -407,17 +395,6 @@ static inline u16 qdf_ipa_get_smem_restr_bytes(void) return __qdf_ipa_get_smem_restr_bytes(); } -static inline int qdf_ipa_setup_sys_pipe(qdf_ipa_sys_connect_params_t *sys_in, - u32 *clnt_hdl) -{ - return __qdf_ipa_setup_sys_pipe(sys_in, clnt_hdl); -} - -static inline int qdf_ipa_teardown_sys_pipe(u32 clnt_hdl) -{ - return __qdf_ipa_teardown_sys_pipe(clnt_hdl); -} - static inline int qdf_ipa_connect_wdi_pipe(qdf_ipa_wdi_in_params_t *in, qdf_ipa_wdi_out_params_t *out) { @@ -455,17 +432,6 @@ static inline int qdf_ipa_uc_wdi_get_dbpa( return __qdf_ipa_uc_wdi_get_dbpa(out); } -static inline int qdf_ipa_uc_reg_rdyCB( - qdf_ipa_wdi_uc_ready_params_t *param) -{ - return __qdf_ipa_uc_reg_rdyCB(param); -} - -static inline int qdf_ipa_uc_dereg_rdyCB(void) -{ - return __qdf_ipa_uc_dereg_rdyCB(); -} - /* * Resource manager @@ -573,21 +539,11 @@ static inline void qdf_ipa_bam_reg_dump(void) return __qdf_ipa_bam_reg_dump(); } -static inline int qdf_ipa_get_wdi_stats(qdf_ipa_hw_stats_wdi_info_data_t *stats) -{ - return __qdf_ipa_get_wdi_stats(stats); -} - static inline int qdf_ipa_get_ep_mapping(qdf_ipa_client_type_t client) { return __qdf_ipa_get_ep_mapping(client); } -static inline bool qdf_ipa_is_ready(void) -{ - return __qdf_ipa_is_ready(); -} - static inline void qdf_ipa_proxy_clk_vote(void) { return __qdf_ipa_proxy_clk_vote(); @@ -647,6 +603,28 @@ static inline int qdf_ipa_stop_gsi_channel(u32 clnt_hdl) return __qdf_ipa_stop_gsi_channel(clnt_hdl); } +#endif +static inline void qdf_ipa_free_skb(qdf_ipa_rx_data_t *rx_in) +{ + return __qdf_ipa_free_skb(rx_in); +} + +static inline int qdf_ipa_uc_reg_rdyCB( + qdf_ipa_wdi_uc_ready_params_t *param) +{ + return __qdf_ipa_uc_reg_rdyCB(param); +} + +static inline int qdf_ipa_uc_dereg_rdyCB(void) +{ + return __qdf_ipa_uc_dereg_rdyCB(); +} + +static inline int qdf_ipa_get_wdi_stats(qdf_ipa_hw_stats_wdi_info_data_t *stats) +{ + return __qdf_ipa_get_wdi_stats(stats); +} + static inline int qdf_ipa_register_ipa_ready_cb( void (*qdf_ipa_ready_cb)(void *user_data), void *user_data) @@ -654,6 +632,31 @@ static inline int qdf_ipa_register_ipa_ready_cb( return __qdf_ipa_register_ipa_ready_cb(qdf_ipa_ready_cb, user_data); } +static inline int qdf_ipa_setup_sys_pipe(qdf_ipa_sys_connect_params_t *sys_in, + u32 *clnt_hdl) +{ + return __qdf_ipa_setup_sys_pipe(sys_in, clnt_hdl); +} + +static inline int qdf_ipa_teardown_sys_pipe(u32 clnt_hdl) +{ + return __qdf_ipa_teardown_sys_pipe(clnt_hdl); +} + +/* + * Messaging + */ +static inline int qdf_ipa_send_msg(qdf_ipa_msg_meta_t *meta, void *buff, + ipa_msg_free_fn callback) +{ + return __qdf_ipa_send_msg(meta, buff, callback); +} + +static inline bool qdf_ipa_is_ready(void) +{ + return __qdf_ipa_is_ready(); +} + #ifdef FEATURE_METERING static inline int qdf_ipa_broadcast_wdi_quota_reach_ind(uint32_t index, uint64_t quota_bytes) diff --git a/qdf/inc/qdf_ipa_wdi3.h b/qdf/inc/qdf_ipa_wdi3.h index cf926ca8df..d37f1f1753 100644 --- a/qdf/inc/qdf_ipa_wdi3.h +++ b/qdf/inc/qdf_ipa_wdi3.h @@ -27,7 +27,9 @@ #include #include -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) + /** * qdf_ipa_wdi_version_t - IPA WDI version */ diff --git a/qdf/linux/src/i_qdf_ipa.h b/qdf/linux/src/i_qdf_ipa.h index ba906b2386..9faf9356ee 100644 --- a/qdf/linux/src/i_qdf_ipa.h +++ b/qdf/linux/src/i_qdf_ipa.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021, 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 @@ -560,6 +560,7 @@ typedef struct ipa_wlan_hdr_attrib_val __qdf_ipa_wlan_hdr_attrib_val_t; #define IPA_LAN_RX_NAPI_SUPPORT #endif +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 10, 0)) /* * Resume / Suspend */ @@ -609,15 +610,6 @@ static inline int __qdf_ipa_copy_hdr(struct ipa_ioc_copy_hdr *copy) return ipa_copy_hdr(copy); } -/* - * Messaging - */ -static inline int __qdf_ipa_send_msg(struct ipa_msg_meta *meta, void *buff, - ipa_msg_free_fn callback) -{ - return ipa_send_msg(meta, buff, callback); -} - static inline int __qdf_ipa_register_pull_msg(struct ipa_msg_meta *meta, ipa_msg_pull_fn callback) { @@ -671,11 +663,6 @@ static inline int __qdf_ipa_tx_dp_mul( return ipa_tx_dp_mul(dst, data_desc); } -static inline void __qdf_ipa_free_skb(struct ipa_rx_data *rx_in) -{ - return ipa_free_skb(rx_in);; -} - /* * System pipes */ @@ -684,17 +671,6 @@ static inline u16 __qdf_ipa_get_smem_restr_bytes(void) return ipa_get_smem_restr_bytes(); } -static inline int __qdf_ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, - u32 *clnt_hdl) -{ - return ipa_setup_sys_pipe(sys_in, clnt_hdl); -} - -static inline int __qdf_ipa_teardown_sys_pipe(u32 clnt_hdl) -{ - return ipa_teardown_sys_pipe(clnt_hdl); -} - static inline int __qdf_ipa_connect_wdi_pipe(struct ipa_wdi_in_params *in, struct ipa_wdi_out_params *out) { @@ -732,18 +708,6 @@ static inline int __qdf_ipa_uc_wdi_get_dbpa( return ipa_uc_wdi_get_dbpa(out); } -static inline int __qdf_ipa_uc_reg_rdyCB( - struct ipa_wdi_uc_ready_params *param) -{ - return ipa_uc_reg_rdyCB(param); -} - -static inline int __qdf_ipa_uc_dereg_rdyCB(void) -{ - return ipa_uc_dereg_rdyCB(); -} - - /* * Resource manager */ @@ -850,21 +814,11 @@ static inline void __qdf_ipa_bam_reg_dump(void) return ipa_bam_reg_dump(); } -static inline int __qdf_ipa_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats) -{ - return ipa_get_wdi_stats(stats); -} - static inline int __qdf_ipa_get_ep_mapping(enum ipa_client_type client) { return ipa_get_ep_mapping(client); } -static inline bool __qdf_ipa_is_ready(void) -{ - return ipa_is_ready(); -} - static inline void __qdf_ipa_proxy_clk_vote(void) { return ipa_proxy_clk_vote(); @@ -938,6 +892,27 @@ static inline int __qdf_ipa_stop_gsi_channel(u32 clnt_hdl) return ipa_stop_gsi_channel(clnt_hdl); } +#endif +static inline void __qdf_ipa_free_skb(struct ipa_rx_data *rx_in) +{ + return ipa_free_skb(rx_in); +} + +static inline int __qdf_ipa_get_wdi_stats(struct IpaHwStatsWDIInfoData_t *stats) +{ + return ipa_get_wdi_stats(stats); +} + +static inline int __qdf_ipa_uc_reg_rdyCB(struct ipa_wdi_uc_ready_params *param) +{ + return ipa_uc_reg_rdyCB(param); +} + +static inline int __qdf_ipa_uc_dereg_rdyCB(void) +{ + return ipa_uc_dereg_rdyCB(); +} + static inline int __qdf_ipa_register_ipa_ready_cb( void (*ipa_ready_cb)(void *user_data), void *user_data) @@ -945,6 +920,32 @@ static inline int __qdf_ipa_register_ipa_ready_cb( return ipa_register_ipa_ready_cb(ipa_ready_cb, user_data); } +static inline +int __qdf_ipa_setup_sys_pipe(struct ipa_sys_connect_params *sys_in, + u32 *clnt_hdl) +{ + return ipa_setup_sys_pipe(sys_in, clnt_hdl); +} + +static inline int __qdf_ipa_teardown_sys_pipe(u32 clnt_hdl) +{ + return ipa_teardown_sys_pipe(clnt_hdl); +} + +/* + * Messaging + */ +static inline int __qdf_ipa_send_msg(struct ipa_msg_meta *meta, void *buff, + ipa_msg_free_fn callback) +{ + return ipa_send_msg(meta, buff, callback); +} + +static inline bool __qdf_ipa_is_ready(void) +{ + return ipa_is_ready(); +} + #ifdef FEATURE_METERING static inline int __qdf_ipa_broadcast_wdi_quota_reach_ind(uint32_t index, uint64_t quota_bytes) diff --git a/qdf/linux/src/i_qdf_ipa_wdi3.h b/qdf/linux/src/i_qdf_ipa_wdi3.h index dbe5645e12..4df75021ac 100644 --- a/qdf/linux/src/i_qdf_ipa_wdi3.h +++ b/qdf/linux/src/i_qdf_ipa_wdi3.h @@ -27,7 +27,8 @@ #include /* QDF_STATUS */ #include -#ifdef CONFIG_IPA_WDI_UNIFIED_API +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) || \ + defined(CONFIG_IPA_WDI_UNIFIED_API) /** * __qdf_ipa_wdi_version_t - IPA WDI version