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