From 78f7f09a57cb6623df6407756e5047faef7634a3 Mon Sep 17 00:00:00 2001 From: Vevek Venkatesan Date: Thu, 23 May 2019 17:16:28 +0530 Subject: [PATCH] qcacld-3.0: fix CFI failure by abstracting the callback Abstract the callback hdd_softap_ipa_start_xmit by hdd_softap_ipa_start_xmit, to match the return type of wlan_ipa_softap_xmit pointer, to fix a CFI failure. Change-Id: If1cb1a80801558d5c7831ec89ad5281b0bbe36f3 --- components/ipa/core/inc/wlan_ipa_core.h | 5 +++-- components/ipa/core/inc/wlan_ipa_main.h | 9 +++++++-- components/ipa/core/inc/wlan_ipa_priv.h | 2 +- components/ipa/core/src/wlan_ipa_main.c | 4 ++-- components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h | 8 +++++--- components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c | 5 +++-- core/hdd/inc/wlan_hdd_softap_tx_rx.h | 14 +++++++++++++- core/hdd/src/wlan_hdd_main.c | 2 +- core/hdd/src/wlan_hdd_softap_tx_rx.c | 10 ++++++++++ 9 files changed, 45 insertions(+), 14 deletions(-) diff --git a/components/ipa/core/inc/wlan_ipa_core.h b/components/ipa/core/inc/wlan_ipa_core.h index 985cdc454bbf..d4c17d85ad73 100644 --- a/components/ipa/core/inc/wlan_ipa_core.h +++ b/components/ipa/core/inc/wlan_ipa_core.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2013-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 @@ -478,7 +478,8 @@ void wlan_ipa_uc_rt_debug_init(struct wlan_ipa_priv *ipa_ctx); * Return: None */ static inline -void wlan_ipa_reg_sap_xmit_cb(struct wlan_ipa_priv *ipa_ctx, void *cb) +void wlan_ipa_reg_sap_xmit_cb(struct wlan_ipa_priv *ipa_ctx, + wlan_ipa_softap_xmit cb) { ipa_ctx->softap_xmit = cb; } diff --git a/components/ipa/core/inc/wlan_ipa_main.h b/components/ipa/core/inc/wlan_ipa_main.h index 19c24922b1d2..2d586fe157d6 100644 --- a/components/ipa/core/inc/wlan_ipa_main.h +++ b/components/ipa/core/inc/wlan_ipa_main.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-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 @@ -243,7 +243,8 @@ void ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev, * * Return: None */ -void ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb); +void ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, + wlan_ipa_softap_xmit cb); /** * ipa_reg_send_to_nw_cb() - Register cb to send IPA Rx packet to network @@ -429,5 +430,9 @@ void ipa_component_config_update(struct wlan_objmgr_psoc *psoc); */ uint32_t ipa_get_tx_buf_count(void); + +#else /* Not IPA_OFFLOAD */ +typedef QDF_STATUS (*wlan_ipa_softap_xmit)(qdf_nbuf_t nbuf, qdf_netdev_t dev); + #endif /* IPA_OFFLOAD */ #endif /* end of _WLAN_IPA_MAIN_H_ */ diff --git a/components/ipa/core/inc/wlan_ipa_priv.h b/components/ipa/core/inc/wlan_ipa_priv.h index 7cec583dbc9c..c8c8cee7d4d9 100644 --- a/components/ipa/core/inc/wlan_ipa_priv.h +++ b/components/ipa/core/inc/wlan_ipa_priv.h @@ -566,7 +566,7 @@ struct wlan_ipa_tx_desc { qdf_ipa_rx_data_t *ipa_tx_desc_ptr; }; -typedef int (*wlan_ipa_softap_xmit)(qdf_nbuf_t skb, qdf_netdev_t dev); +typedef QDF_STATUS (*wlan_ipa_softap_xmit)(qdf_nbuf_t nbuf, qdf_netdev_t dev); typedef void (*wlan_ipa_send_to_nw)(qdf_nbuf_t skb, qdf_netdev_t dev); /* IPA private context structure definition */ diff --git a/components/ipa/core/src/wlan_ipa_main.c b/components/ipa/core/src/wlan_ipa_main.c index fd110582b8c0..72f7ebff3563 100644 --- a/components/ipa/core/src/wlan_ipa_main.c +++ b/components/ipa/core/src/wlan_ipa_main.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-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 @@ -282,7 +282,7 @@ void ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev, return wlan_ipa_uc_stat_query(ipa_obj, ipa_tx_diff, ipa_rx_diff); } -void ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb) +void ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, wlan_ipa_softap_xmit cb) { struct wlan_ipa_priv *ipa_obj; diff --git a/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h b/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h index 6a2de015142f..ea425b3a007a 100644 --- a/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h +++ b/components/ipa/dispatcher/inc/wlan_ipa_ucfg_api.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-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 @@ -151,7 +151,8 @@ void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev, * * Return: None */ -void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb); +void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, + wlan_ipa_softap_xmit cb); /** * ucfg_ipa_reg_send_to_nw_cb() - Register cb to send IPA Rx packet to network @@ -416,7 +417,8 @@ void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev, } static inline -void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb) +void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, + wlan_ipa_softap_xmit cb) { } diff --git a/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c b/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c index fd1802b1dafc..a6478b30738f 100644 --- a/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c +++ b/components/ipa/dispatcher/src/wlan_ipa_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2018-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 @@ -89,7 +89,8 @@ void ucfg_ipa_uc_stat_query(struct wlan_objmgr_pdev *pdev, return ipa_uc_stat_query(pdev, ipa_tx_diff, ipa_rx_diff); } -void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, void *cb) +void ucfg_ipa_reg_sap_xmit_cb(struct wlan_objmgr_pdev *pdev, + wlan_ipa_softap_xmit cb) { return ipa_reg_sap_xmit_cb(pdev, cb); } diff --git a/core/hdd/inc/wlan_hdd_softap_tx_rx.h b/core/hdd/inc/wlan_hdd_softap_tx_rx.h index fa968bdc857c..b4914be8e71d 100644 --- a/core/hdd/inc/wlan_hdd_softap_tx_rx.h +++ b/core/hdd/inc/wlan_hdd_softap_tx_rx.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved. + * Copyright (c) 2014-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 @@ -42,6 +42,18 @@ netdev_tx_t hdd_softap_hard_start_xmit(struct sk_buff *skb, struct net_device *dev); +/** + * hdd_softap_ipa_start_xmit() - Transmit a frame, request from IPA + * @nbuf: pointer to buffer/packet + * @dev: pointer to net_device structure + * + * Function registered as a xmit callback in SAP mode, + * called by IPA if any packet needs to be transmitted. + * + * Return: Status of the transmission + */ +QDF_STATUS hdd_softap_ipa_start_xmit(qdf_nbuf_t nbuf, qdf_netdev_t dev); + /** * hdd_softap_tx_timeout() - TX timeout handler * @dev: pointer to network device diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index 88cf27bae2ec..fb8b6cc2850f 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -1824,7 +1824,7 @@ int hdd_update_tgt_cfg(hdd_handle_t hdd_handle, struct wma_tgt_cfg *cfg) ucfg_ipa_set_txrx_handle(hdd_ctx->psoc, cds_get_context(QDF_MODULE_ID_TXRX)); ucfg_ipa_reg_sap_xmit_cb(hdd_ctx->pdev, - hdd_softap_hard_start_xmit); + hdd_softap_ipa_start_xmit); ucfg_ipa_reg_send_to_nw_cb(hdd_ctx->pdev, hdd_ipa_send_skb_to_network); diff --git a/core/hdd/src/wlan_hdd_softap_tx_rx.c b/core/hdd/src/wlan_hdd_softap_tx_rx.c index a0d857db0a23..102873213771 100644 --- a/core/hdd/src/wlan_hdd_softap_tx_rx.c +++ b/core/hdd/src/wlan_hdd_softap_tx_rx.c @@ -663,6 +663,16 @@ netdev_tx_t hdd_softap_hard_start_xmit(struct sk_buff *skb, return NETDEV_TX_OK; } +QDF_STATUS hdd_softap_ipa_start_xmit(qdf_nbuf_t nbuf, qdf_netdev_t dev) +{ + if (NETDEV_TX_OK == hdd_softap_hard_start_xmit( + (struct sk_buff *)nbuf, + (struct net_device *)dev)) + return QDF_STATUS_SUCCESS; + else + return QDF_STATUS_E_FAILURE; +} + static void __hdd_softap_tx_timeout(struct net_device *dev) { struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);