blob: e4c6ccb37e2651b27e7e3d0cda337e7930d3ea2d [file] [log] [blame]
Yuanyuan Liud9f7a362016-01-22 14:27:12 -08001/*
2 * Copyright (c) 2016 The Linux Foundation. All rights reserved.
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 __PLD_PCIE_H__
29#define __PLD_PCIE_H__
30
31#include "pld_common.h"
32
33#ifndef CONFIG_PCI
34static inline int pld_pcie_register_driver(void)
35{
36 return 0;
37}
38
39static inline void pld_pcie_unregister_driver(void)
40{
41 return;
42}
43
44static inline int pld_pcie_get_ce_id(int irq)
45{
46 return 0;
47}
48#else
49int pld_pcie_register_driver(void);
50void pld_pcie_unregister_driver(void);
51int pld_pcie_get_ce_id(int irq);
52#endif
53
54#if (!defined(CONFIG_CNSS)) || (!defined(QCA_WIFI_3_0_ADRASTEA))
55static inline int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
56 enum pld_driver_mode mode, const char *host_version)
57{
58 return 0;
59}
60static inline int pld_pcie_wlan_disable(enum pld_driver_mode mode)
61{
62 return 0;
63}
64static inline int pld_pcie_set_fw_debug_mode(bool enablefwlog)
65{
66 return 0;
67}
68static inline void cnss_intr_notify_q6(void)
69{
70 return;
71}
72#else
73int pld_pcie_wlan_enable(struct pld_wlan_enable_cfg *config,
74 enum pld_driver_mode mode, const char *host_version);
75int pld_pcie_wlan_disable(enum pld_driver_mode mode);
76int pld_pcie_set_fw_debug_mode(bool enablefwlog);
77#endif
78
79#if (!defined(CONFIG_CNSS)) || (!defined(CONFIG_CNSS_SECURE_FW))
80static inline int cnss_get_sha_hash(const u8 *data,
81 u32 data_len, u8 *hash_idx, u8 *out)
82{
83 return 0;
84}
85static inline void *cnss_get_fw_ptr(void)
86{
87 return NULL;
88}
89#endif
90
Yuanyuan Liu466ccb72016-04-21 15:13:22 -070091#if (!defined(CONFIG_CNSS)) || (!defined(CONFIG_PCI_MSM))
92static inline int cnss_wlan_pm_control(bool vote)
93{
94 return 0;
95}
96#endif
97
Yuanyuan Liud9f7a362016-01-22 14:27:12 -080098#ifndef CONFIG_CNSS
99static inline int
100pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
101 u32 target_type, u32 target_version)
102{
103 return 0;
104}
105static inline int
106pld_pcie_get_fw_image(struct pld_image_desc_info *image_desc_info)
107{
108 return 0;
109}
110static inline void cnss_wlan_pci_link_down(void)
111{
112 return;
113}
114static inline int cnss_pcie_shadow_control(bool enable)
115{
116 return 0;
117}
118static inline int
119pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg)
120{
121 return 0;
122}
123static inline int
124cnss_set_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 ch_count)
125{
126 return 0;
127}
128static inline int cnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list,
129 u16 *ch_count, u16 buf_len)
130{
131 return 0;
132}
133static inline int cnss_wlan_set_dfs_nol(void *info, u16 info_len)
134{
135 return 0;
136}
137static inline int cnss_wlan_get_dfs_nol(void *info, u16 info_len)
138{
139 return 0;
140}
Yuanyuan Liu0e0aa932016-05-12 10:17:58 -0700141static void cnss_schedule_recovery_work(void)
142{
143 return;
144}
Yuanyuan Liud9f7a362016-01-22 14:27:12 -0800145static inline void *cnss_get_virt_ramdump_mem(unsigned long *size)
146{
147 return NULL;
148}
149static inline void cnss_device_crashed(void)
150{
151 return;
152}
153static inline void cnss_device_self_recovery(void)
154{
155 return;
156}
157static inline void cnss_request_pm_qos(u32 qos_val)
158{
159 return;
160}
161static inline void cnss_remove_pm_qos(void)
162{
163 return;
164}
165static inline int cnss_request_bus_bandwidth(int bandwidth)
166{
167 return 0;
168}
169static inline int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
170{
171 return 0;
172}
173static inline void pld_pcie_set_driver_status(enum pld_driver_status status)
174{
175 return;
176}
177static inline int cnss_get_bmi_setup(void)
178{
179 return 0;
180}
181static inline int cnss_auto_suspend(void)
182{
183 return 0;
184}
185static inline int cnss_auto_resume(void)
186{
187 return 0;
188}
Yuanyuan Liu44c44772016-04-11 11:11:27 -0700189static void cnss_lock_pm_sem(void)
190{
191 return;
192}
193static void cnss_release_pm_sem(void)
194{
195 return;
196}
Yuanyuan Liud9f7a362016-01-22 14:27:12 -0800197#else
198int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
199 u32 target_type, u32 target_version);
200int pld_pcie_get_fw_image(struct pld_image_desc_info *image_desc_info);
201int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg);
202int pld_pcie_get_platform_cap(struct pld_platform_cap *cap);
203void pld_pcie_set_driver_status(enum pld_driver_status status);
204#endif
205
206#endif