blob: 63d07422449ab3573110c3ae31b4114bf7361636 [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
Yuanyuan Liu6a313dc2016-05-10 14:19:10 -070099
Yuanyuan Liud9f7a362016-01-22 14:27:12 -0800100static inline int
101pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
102 u32 target_type, u32 target_version)
103{
Yuanyuan Liu6a313dc2016-05-10 14:19:10 -0700104 pld_get_default_fw_files(pfw_files);
Yuanyuan Liud9f7a362016-01-22 14:27:12 -0800105 return 0;
106}
107static inline int
108pld_pcie_get_fw_image(struct pld_image_desc_info *image_desc_info)
109{
110 return 0;
111}
112static inline void cnss_wlan_pci_link_down(void)
113{
114 return;
115}
116static inline int cnss_pcie_shadow_control(bool enable)
117{
118 return 0;
119}
120static inline int
121pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg)
122{
123 return 0;
124}
125static inline int
126cnss_set_wlan_unsafe_channel(u16 *unsafe_ch_list, u16 ch_count)
127{
128 return 0;
129}
130static inline int cnss_get_wlan_unsafe_channel(u16 *unsafe_ch_list,
131 u16 *ch_count, u16 buf_len)
132{
133 return 0;
134}
135static inline int cnss_wlan_set_dfs_nol(void *info, u16 info_len)
136{
137 return 0;
138}
139static inline int cnss_wlan_get_dfs_nol(void *info, u16 info_len)
140{
141 return 0;
142}
Yuanyuan Liu0e0aa932016-05-12 10:17:58 -0700143static void cnss_schedule_recovery_work(void)
144{
145 return;
146}
Yuanyuan Liud9f7a362016-01-22 14:27:12 -0800147static inline void *cnss_get_virt_ramdump_mem(unsigned long *size)
148{
149 return NULL;
150}
151static inline void cnss_device_crashed(void)
152{
153 return;
154}
155static inline void cnss_device_self_recovery(void)
156{
157 return;
158}
159static inline void cnss_request_pm_qos(u32 qos_val)
160{
161 return;
162}
163static inline void cnss_remove_pm_qos(void)
164{
165 return;
166}
167static inline int cnss_request_bus_bandwidth(int bandwidth)
168{
169 return 0;
170}
171static inline int pld_pcie_get_platform_cap(struct pld_platform_cap *cap)
172{
173 return 0;
174}
175static inline void pld_pcie_set_driver_status(enum pld_driver_status status)
176{
177 return;
178}
179static inline int cnss_get_bmi_setup(void)
180{
181 return 0;
182}
183static inline int cnss_auto_suspend(void)
184{
185 return 0;
186}
187static inline int cnss_auto_resume(void)
188{
189 return 0;
190}
Yuanyuan Liu44c44772016-04-11 11:11:27 -0700191static void cnss_lock_pm_sem(void)
192{
193 return;
194}
195static void cnss_release_pm_sem(void)
196{
197 return;
198}
Yuanyuan Liud9f7a362016-01-22 14:27:12 -0800199#else
200int pld_pcie_get_fw_files_for_target(struct pld_fw_files *pfw_files,
201 u32 target_type, u32 target_version);
202int pld_pcie_get_fw_image(struct pld_image_desc_info *image_desc_info);
203int pld_pcie_get_codeswap_struct(struct pld_codeswap_codeseg_info *swap_seg);
204int pld_pcie_get_platform_cap(struct pld_platform_cap *cap);
205void pld_pcie_set_driver_status(enum pld_driver_status status);
206#endif
207
208#endif