Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 1 | /* |
Houston Hoffman | 43d47fa | 2016-02-24 16:34:30 -0800 | [diff] [blame] | 2 | * Copyright (c) 2013-2016 The Linux Foundation. All rights reserved. |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 3 | * |
| 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 Hoffman | 43d47fa | 2016-02-24 16:34:30 -0800 | [diff] [blame] | 42 | #include <wlan_hdd_assoc.h> /* hdd_context_t */ |
| 43 | |
| 44 | /** |
| 45 | * FIXME: Temporary hack - until IPA functionality gets restored |
| 46 | * |
| 47 | */ |
| 48 | typedef void (*hdd_ipa_nbuf_cb_fn)(cdf_nbuf_t); |
| 49 | void hdd_ipa_nbuf_cb(cdf_nbuf_t skb); /* Fwd declare */ |
| 50 | static inline hdd_ipa_nbuf_cb_fn wlan_hdd_stub_ipa_fn(void) |
| 51 | { |
| 52 | return hdd_ipa_nbuf_cb; |
| 53 | }; |
| 54 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 55 | QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx); |
| 56 | QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx); |
| 57 | QDF_STATUS hdd_ipa_process_rxt(void *cds_context, cdf_nbuf_t rxBuf, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 58 | uint8_t sta_id); |
| 59 | int hdd_ipa_wlan_evt(hdd_adapter_t *adapter, uint8_t sta_id, |
| 60 | enum ipa_wlan_event type, uint8_t *mac_addr); |
| 61 | int hdd_ipa_set_perf_level(hdd_context_t *hdd_ctx, uint64_t tx_packets, |
| 62 | uint64_t rx_packets); |
| 63 | int hdd_ipa_suspend(hdd_context_t *hdd_ctx); |
| 64 | int hdd_ipa_resume(hdd_context_t *hdd_ctx); |
| 65 | void hdd_ipa_uc_stat_query(hdd_context_t *hdd_ctx, uint32_t *ipa_tx_diff, |
| 66 | uint32_t *ipa_rx_diff); |
| 67 | void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx); |
| 68 | void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, uint8_t reason); |
| 69 | bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx); |
| 70 | bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx); |
| 71 | int hdd_ipa_send_mcc_scc_msg(hdd_context_t *pHddCtx, bool mcc_mode); |
Leo Chang | e3e4944 | 2015-10-26 20:07:13 -0700 | [diff] [blame] | 72 | int hdd_ipa_uc_ssr_reinit(void); |
| 73 | int hdd_ipa_uc_ssr_deinit(void); |
| 74 | void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx); |
Leo Chang | 3bc8fed | 2015-11-13 10:59:47 -0800 | [diff] [blame] | 75 | struct sk_buff *hdd_ipa_tx_packet_ipa(hdd_context_t *hdd_ctx, |
| 76 | struct sk_buff *skb, uint8_t session_id); |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 77 | #else |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 78 | static inline QDF_STATUS hdd_ipa_init(hdd_context_t *hdd_ctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 79 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 80 | return QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 81 | } |
| 82 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 83 | static inline QDF_STATUS hdd_ipa_cleanup(hdd_context_t *hdd_ctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 84 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 85 | return QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 86 | } |
| 87 | |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 88 | static inline QDF_STATUS hdd_ipa_process_rxt(void *cds_context, |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 89 | cdf_nbuf_t rxBuf, uint8_t sta_id) |
| 90 | { |
Anurag Chouhan | fb54ab0 | 2016-02-18 18:00:46 +0530 | [diff] [blame] | 91 | return QDF_STATUS_SUCCESS; |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 92 | } |
| 93 | |
| 94 | static 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 | |
| 100 | static inline int hdd_ipa_send_mcc_scc_msg(hdd_context_t *hdd_ctx, |
| 101 | bool mcc_mode) |
| 102 | { |
| 103 | return 0; |
| 104 | } |
| 105 | |
| 106 | static 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 | |
| 113 | static inline int hdd_ipa_suspend(hdd_context_t *hdd_ctx) |
| 114 | { |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | static inline int hdd_ipa_resume(hdd_context_t *hdd_ctx) |
| 119 | { |
| 120 | return 0; |
| 121 | } |
| 122 | |
| 123 | static 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 | |
| 132 | static inline void hdd_ipa_uc_stat_request(hdd_adapter_t *adapter, |
| 133 | uint8_t reason) |
| 134 | { |
| 135 | return; |
| 136 | } |
| 137 | |
Leo Chang | 3bc8fed | 2015-11-13 10:59:47 -0800 | [diff] [blame] | 138 | static inline void hdd_ipa_uc_rt_debug_host_dump(hdd_context_t *hdd_ctx) |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 139 | { |
| 140 | return; |
| 141 | } |
| 142 | |
| 143 | static inline bool hdd_ipa_is_enabled(hdd_context_t *pHddCtx) |
| 144 | { |
| 145 | return false; |
| 146 | } |
| 147 | |
| 148 | static inline bool hdd_ipa_uc_is_enabled(hdd_context_t *pHddCtx) |
| 149 | { |
| 150 | return false; |
| 151 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 152 | static inline int hdd_ipa_uc_ssr_reinit(void) |
| 153 | { |
| 154 | return false; |
| 155 | } |
| 156 | |
| 157 | static inline int hdd_ipa_uc_ssr_deinit(void) |
| 158 | { |
| 159 | return false; |
| 160 | } |
Leo Chang | e3e4944 | 2015-10-26 20:07:13 -0700 | [diff] [blame] | 161 | static inline void hdd_ipa_uc_force_pipe_shutdown(hdd_context_t *hdd_ctx) |
| 162 | { |
| 163 | return; |
| 164 | } |
Prakash Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 165 | |
Leo Chang | 3bc8fed | 2015-11-13 10:59:47 -0800 | [diff] [blame] | 166 | /** |
| 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 | */ |
| 178 | static 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 Dhavali | 7090c5f | 2015-11-02 17:55:19 -0800 | [diff] [blame] | 184 | #endif /* #ifndef HDD_IPA_H__ */ |