xref: /wlan-driver/qcacld-3.0/core/hdd/inc/wlan_hdd_ipa.h (revision 5113495b16420b49004c444715d2daae2066e7dc)
1 /*
2  * Copyright (c) 2013-2019 The Linux Foundation. All rights reserved.
3  * Copyright (c) 2022-2023 Qualcomm Innovation Center, Inc. All rights reserved.
4  *
5  * Permission to use, copy, modify, and/or distribute this software for
6  * any purpose with or without fee is hereby granted, provided that the
7  * above copyright notice and this permission notice appear in all
8  * copies.
9  *
10  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
14  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
15  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
16  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17  * PERFORMANCE OF THIS SOFTWARE.
18  */
19 
20 #ifndef HDD_IPA_H__
21 #define HDD_IPA_H__
22 
23 /**
24  * DOC: wlan_hdd_ipa.h
25  *
26  * WLAN IPA interface module headers
27  */
28 
29 #include <qdf_nbuf.h>
30 
31 #ifdef IPA_OFFLOAD
32 
33 /**
34  * hdd_ipa_send_nbuf_to_network() - Send network buffer to kernel
35  * @nbuf: network buffer
36  * @dev: network adapter
37  *
38  * Called when a network buffer is received which should not be routed
39  * to the IPA module.
40  *
41  * Return: None
42  */
43 void hdd_ipa_send_nbuf_to_network(qdf_nbuf_t nbuf, qdf_netdev_t dev);
44 
45 /**
46  * hdd_ipa_set_mcc_mode() - To set mcc mode if IPA is enabled
47  * @mcc_mode: mcc mode
48  *
49  * This routine is called to set mcc mode if IPA is enabled
50  *
51  * Return: None
52  */
53 void hdd_ipa_set_mcc_mode(bool mcc_mode);
54 
55 /**
56  * hdd_ipa_get_tx_pipe() - Get tx pipe for the new connection
57  * @hdd_ctx: pointer to hdd_context
58  * @link: pointer to struct wlan_hdd_link_info
59  * @tx_pipe: boolean output param to store which pipe to use for @link.
60  *	     false is the primary tx pipe and true is the alternate tx pipe.
61  *
62  * Return: QDF_STATUS_SUCCESS for success, and otherwise for failure scenarios.
63  *
64  */
65 QDF_STATUS hdd_ipa_get_tx_pipe(struct hdd_context *hdd_ctx,
66 			       struct wlan_hdd_link_info *link,
67 			       bool *tx_pipe);
68 
69 /*
70  * hdd_ipa_set_perf_level_bw() - Set ipa perf level based on BW
71  * @bw: enum hw_mode_bandwidth
72  *
73  * This routine is called to set IPA perf level based on max BW configured
74  * among in-use STA and SAP vdevs.
75  *
76  * Return: None
77  */
78 void hdd_ipa_set_perf_level_bw(enum hw_mode_bandwidth bw);
79 
80 #else
81 static inline
hdd_ipa_send_nbuf_to_network(qdf_nbuf_t skb,qdf_netdev_t dev)82 void hdd_ipa_send_nbuf_to_network(qdf_nbuf_t skb, qdf_netdev_t dev)
83 {
84 }
85 
hdd_ipa_set_mcc_mode(bool mcc_mode)86 static inline void hdd_ipa_set_mcc_mode(bool mcc_mode)
87 {
88 }
89 
90 static inline QDF_STATUS
hdd_ipa_get_tx_pipe(struct hdd_context * hdd_ctx,struct wlan_hdd_link_info * link,bool * tx_pipe)91 hdd_ipa_get_tx_pipe(struct hdd_context *hdd_ctx,
92 		    struct wlan_hdd_link_info *link,
93 		    bool *tx_pipe)
94 {
95 	return QDF_STATUS_SUCCESS;
96 }
97 
hdd_ipa_set_perf_level_bw(enum hw_mode_bandwidth bw)98 static inline void hdd_ipa_set_perf_level_bw(enum hw_mode_bandwidth bw)
99 {
100 }
101 
102 #endif
103 #endif /* HDD_IPA_H__ */
104