blob: a7cabccedfb6ee931b4c709d1cdfd52dce7061ca [file] [log] [blame]
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08001/*
Houston Hoffman43d47fa2016-02-24 16:34:30 -08002 * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved.
Prakash Dhavali7090c5f2015-11-02 17:55:19 -08003 *
4 * Previously licensed under the ISC license by Qualcomm Atheros, Inc.
5 *
6 *
7 * Permission to use, copy, modify, and/or distribute this software for
8 * any purpose with or without fee is hereby granted, provided that the
9 * above copyright notice and this permission notice appear in all
10 * copies.
11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
13 * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
15 * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
16 * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
17 * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
18 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19 * PERFORMANCE OF THIS SOFTWARE.
20 */
21
22/*
23 * This file was originally distributed by Qualcomm Atheros, Inc.
24 * under proprietary terms before Copyright ownership was assigned
25 * to the Linux Foundation.
26 */
27
28#ifndef HDD_IPA_H__
29#define HDD_IPA_H__
30
31/**
32 * DOC: wlan_hdd_ipa.h
33 *
34 * WLAN IPA interface module headers
35 * Originally written by Qualcomm Atheros, Inc
36 */
37
38#include <linux/ipa.h>
39
40#ifdef IPA_OFFLOAD
41/* Include files */
Houston Hoffman43d47fa2016-02-24 16:34:30 -080042#include <wlan_hdd_assoc.h> /* hdd_context_t */
43
44/**
45 * FIXME: Temporary hack - until IPA functionality gets restored
46 *
47 */
48typedef void (*hdd_ipa_nbuf_cb_fn)(cdf_nbuf_t);
49void hdd_ipa_nbuf_cb(cdf_nbuf_t skb); /* Fwd declare */
50static inline hdd_ipa_nbuf_cb_fn wlan_hdd_stub_ipa_fn(void)
51{
52 return hdd_ipa_nbuf_cb;
53};
54
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053055QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx);
56QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx);
57QDF_STATUS hdd_ipa_process_rxt(void *cds_context, cdf_nbuf_t rxBuf,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080058 uint8_t sta_id);
59int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
60 enum ipa_wlan_event type, uint8_t *mac_addr);
61int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets,
62 uint64_t rx_packets);
63int hdd_ipa_suspend(hdd_context_t *hdd_ctx);
64int hdd_ipa_resume(hdd_context_t *hdd_ctx);
65void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx, uint32_t *ipa_tx_diff,
66 uint32_t *ipa_rx_diff);
67void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx);
68void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason);
69bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx);
70bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx);
71int hdd_ipa_send_mcc_scc_msg(hdd_context_t *pHddCtx, bool mcc_mode);
Leo Change3e49442015-10-26 20:07:13 -070072int hdd_ipa_uc_ssr_reinit(void);
73int hdd_ipa_uc_ssr_deinit(void);
74void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx);
Leo Chang3bc8fed2015-11-13 10:59:47 -080075struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
76 struct sk_buff *skb, uint8_t session_id);
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080077#else
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053078static inline QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080079{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053080 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080081}
82
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053083static inline QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080084{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053085 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080086}
87
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053088static inline QDF_STATUS hdd_ipa_process_rxt(void *cds_context,
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080089 cdf_nbuf_t rxBuf, uint8_t sta_id)
90{
Anurag Chouhanfb54ab02016-02-18 18:00:46 +053091 return QDF_STATUS_SUCCESS;
Prakash Dhavali7090c5f2015-11-02 17:55:19 -080092}
93
94static inline int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id,
95 enum ipa_wlan_event type, uint8_t *mac_addr)
96{
97 return 0;
98}
99
100static inline int hdd_ipa_send_mcc_scc_msg(hdd_context_t *hdd_ctx,
101 bool mcc_mode)
102{
103 return 0;
104}
105
106static inline int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx,
107 uint64_t tx_packets,
108 uint64_t rx_packets)
109{
110 return 0;
111}
112
113static inline int hdd_ipa_suspend(hdd_context_t *hdd_ctx)
114{
115 return 0;
116}
117
118static inline int hdd_ipa_resume(hdd_context_t *hdd_ctx)
119{
120 return 0;
121}
122
123static inline void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx,
124 uint32_t *ipa_tx_diff,
125 uint32_t *ipa_rx_diff)
126{
127 *ipa_tx_diff = 0;
128 *ipa_rx_diff = 0;
129 return;
130}
131
132static inline void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter,
133 uint8_t reason)
134{
135 return;
136}
137
Leo Chang3bc8fed2015-11-13 10:59:47 -0800138static inline void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx)
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800139{
140 return;
141}
142
143static inline bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx)
144{
145 return false;
146}
147
148static inline bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx)
149{
150 return false;
151}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800152static inline int hdd_ipa_uc_ssr_reinit(void)
153{
154 return false;
155}
156
157static inline int hdd_ipa_uc_ssr_deinit(void)
158{
159 return false;
160}
Leo Change3e49442015-10-26 20:07:13 -0700161static inline void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx)
162{
163 return;
164}
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800165
Leo Chang3bc8fed2015-11-13 10:59:47 -0800166/**
167 * hdd_ipa_tx_packet_ipa() - send packet to IPA
168 * @hdd_ctx: Global HDD context
169 * @skb: skb sent to IPA
170 * @session_id: send packet instance session id
171 *
172 * Send TX packet which generated by system to IPA.
173 * This routine only will be used for function verification
174 *
175 * Return: NULL packet sent to IPA properly
176 * skb packet not sent to IPA. legacy data path should handle
177 */
178static inline struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx,
179 struct sk_buff *skb, uint8_t session_id)
180{
181 return skb;
182}
183#endif /* IPA_OFFLOAD */
Prakash Dhavali7090c5f2015-11-02 17:55:19 -0800184#endif /* #ifndef HDD_IPA_H__ */