Houston Hoffman | 4ca03b6 | 2016-03-14 21:11:51 -0700 | [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 | #include "qdf_types.h" |
| 29 | #include "dummy.h" |
| 30 | #include "hif_debug.h" |
| 31 | |
| 32 | /** |
| 33 | * hif_dummy_bus_prevent_linkdown() - prevent linkdown |
| 34 | * @hif_ctx: hif context |
| 35 | * @flag: weather to keep the bus alive or not |
| 36 | * |
| 37 | * Dummy function for busses and platforms that do not support |
| 38 | * link down. This may need to be replaced with a wakelock. |
| 39 | */ |
| 40 | void hif_dummy_bus_prevent_linkdown(struct hif_softc *scn, bool flag) |
| 41 | { |
| 42 | HIF_ERROR("wlan: %s pcie power collapse ignored", |
| 43 | (flag ? "disable" : "enable")); |
| 44 | } |
| 45 | |
| 46 | /** |
| 47 | * hif_reset_soc(): reset soc |
| 48 | * |
| 49 | * this function resets soc |
| 50 | * |
| 51 | * @hif_ctx: HIF context |
| 52 | * |
| 53 | * Return: void |
| 54 | */ |
| 55 | /* Function to reset SoC */ |
| 56 | void hif_dummy_reset_soc(struct hif_softc *hif_ctx) |
| 57 | { |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * hif_dummy_suspend() - suspend the bus |
| 62 | * @hif_ctx: hif context |
| 63 | * |
| 64 | * dummy for busses that don't need to suspend. |
| 65 | * |
| 66 | * Return: 0 for success and non-zero for failure |
| 67 | */ |
| 68 | int hif_dummy_bus_suspend(struct hif_softc *hif_ctx) |
| 69 | { |
| 70 | return 0; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * hif_dummy_resume() - hif resume API |
| 75 | * |
| 76 | * This function resumes the bus. but snoc doesn't need to resume. |
| 77 | * Therefore do nothing. |
| 78 | * |
| 79 | * Return: 0 for success and non-zero for failure |
| 80 | */ |
| 81 | int hif_dummy_bus_resume(struct hif_softc *hif_ctx) |
| 82 | { |
| 83 | return 0; |
| 84 | } |
| 85 | |
| 86 | /** |
Houston Hoffman | 7fdff0c | 2016-08-29 12:31:58 -0700 | [diff] [blame] | 87 | * hif_dummy_suspend_noirq() - suspend the bus |
| 88 | * @hif_ctx: hif context |
| 89 | * |
| 90 | * dummy for busses that don't need to syncronize |
| 91 | * with interrupt disable. |
| 92 | * |
| 93 | * Return: 0 for success and non-zero for failure |
| 94 | */ |
| 95 | int hif_dummy_bus_suspend_noirq(struct hif_softc *hif_ctx) |
| 96 | { |
| 97 | return 0; |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * hif_dummy_resume_noirq() - resume the bus |
| 102 | * @hif_ctx: hif context |
| 103 | * |
| 104 | * dummy for busses that don't need to syncronize |
| 105 | * with interrupt disable. |
| 106 | * |
| 107 | * Return: 0 for success and non-zero for failure |
| 108 | */ |
| 109 | int hif_dummy_bus_resume_noirq(struct hif_softc *hif_ctx) |
| 110 | { |
| 111 | return 0; |
| 112 | } |
| 113 | |
| 114 | /** |
Houston Hoffman | 4ca03b6 | 2016-03-14 21:11:51 -0700 | [diff] [blame] | 115 | * hif_dummy_target_sleep_state_adjust() - api to adjust state of target |
| 116 | * @scn: hif context |
| 117 | * @sleep_ok: allow or deny target to go to sleep |
| 118 | * @wait_for_it: ensure target has change |
| 119 | */ |
| 120 | int hif_dummy_target_sleep_state_adjust(struct hif_softc *scn, |
| 121 | bool sleep_ok, bool wait_for_it) |
| 122 | { |
| 123 | return 0; |
| 124 | } |
Houston Hoffman | b4149dd | 2016-03-23 15:55:41 -0700 | [diff] [blame] | 125 | |
| 126 | /** |
| 127 | * hif_dummy_enable_power_management - dummy call |
| 128 | * hif_ctx: hif context |
| 129 | * is_packet_log_enabled: true if packet log is enabled |
| 130 | */ |
| 131 | void hif_dummy_enable_power_management(struct hif_softc *hif_ctx, |
| 132 | bool is_packet_log_enabled) |
| 133 | {} |
| 134 | |
| 135 | /** |
| 136 | * hif_dummy_disable_power_management - dummy call |
| 137 | * hif_ctx: hif context |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 138 | * |
| 139 | * Return: none |
Houston Hoffman | b4149dd | 2016-03-23 15:55:41 -0700 | [diff] [blame] | 140 | */ |
| 141 | void hif_dummy_disable_power_management(struct hif_softc *hif_ctx) |
| 142 | {} |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 143 | |
| 144 | /** |
| 145 | * hif_dummy_disable_isr - dummy call |
| 146 | * hif_ctx: hif context |
| 147 | * |
| 148 | * Return: none |
| 149 | */ |
| 150 | void hif_dummy_disable_isr(struct hif_softc *scn) |
| 151 | {} |
| 152 | |
| 153 | /** |
| 154 | * hif_dummy_nointrs - dummy call |
| 155 | * hif_sc: hif context |
| 156 | * |
| 157 | * Return: none |
| 158 | */ |
| 159 | void hif_dummy_nointrs(struct hif_softc *hif_sc) |
| 160 | {} |
| 161 | |
| 162 | /** |
| 163 | * hif_dummy_bus_configure - dummy call |
| 164 | * hif_ctx: hif context |
| 165 | * |
| 166 | * Return: 0 for sucess |
| 167 | */ |
| 168 | int hif_dummy_bus_configure(struct hif_softc *hif_sc) |
| 169 | { |
| 170 | return 0; |
| 171 | } |
| 172 | |
| 173 | /** |
| 174 | * hif_dummy_get_config_item - dummy call |
| 175 | * @hif_sc: hif context |
| 176 | * @opcode: configuration type |
| 177 | * @config: configuration value to set |
| 178 | * @config_len: configuration length |
| 179 | * |
| 180 | * Return: 0 for sucess |
| 181 | */ |
| 182 | QDF_STATUS |
| 183 | hif_dummy_get_config_item(struct hif_softc *hif_sc, |
| 184 | int opcode, void *config, uint32_t config_len) |
| 185 | { |
| 186 | return 0; |
| 187 | } |
| 188 | |
| 189 | /** |
| 190 | * hif_dummy_set_mailbox_swap - dummy call |
| 191 | * @hif_sc: hif context |
| 192 | * |
| 193 | * Return: None |
| 194 | */ |
| 195 | void |
| 196 | hif_dummy_set_mailbox_swap(struct hif_softc *hif_sc) |
| 197 | { |
| 198 | return; |
| 199 | } |
| 200 | |
| 201 | /** |
| 202 | * hif_dummy_claim_device - dummy call |
| 203 | * @hif_sc: hif context |
| 204 | * |
| 205 | * Return: None |
| 206 | */ |
| 207 | void |
| 208 | hif_dummy_claim_device(struct hif_softc *hif_sc) |
| 209 | { |
| 210 | return; |
| 211 | } |
| 212 | |
| 213 | /** |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 214 | * hif_dummy_cancel_deferred_target_sleep - dummy call |
| 215 | * @hif_sc: hif context |
| 216 | * |
| 217 | * Return: None |
| 218 | */ |
| 219 | void |
| 220 | hif_dummy_cancel_deferred_target_sleep(struct hif_softc *hif_sc) |
| 221 | { |
| 222 | return; |
| 223 | } |
| 224 | |
| 225 | /** |
| 226 | * hif_dummy_irq_enable - dummy call |
| 227 | * hif_ctx: hif context |
| 228 | * @irq_id: irq id |
| 229 | * |
| 230 | * Return: none |
| 231 | */ |
| 232 | void hif_dummy_irq_enable(struct hif_softc *hif_sc, int irq_id) |
| 233 | {} |
| 234 | |
| 235 | /** |
Venkateswara Swamy Bandaru | 31108f3 | 2016-08-08 18:04:29 +0530 | [diff] [blame] | 236 | * hif_dummy_grp_irq_enable - dummy call |
| 237 | * hif_ctx: hif context |
| 238 | * @irq_id: grp id |
| 239 | * |
| 240 | * Return: none |
| 241 | */ |
| 242 | void hif_dummy_grp_irq_enable(struct hif_softc *hif_sc, uint32_t grp_id) |
| 243 | {} |
| 244 | |
| 245 | /** |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 246 | * hif_dummy_irq_disable - dummy call |
| 247 | * hif_ctx: hif context |
| 248 | * @irq_id: irq id |
| 249 | * |
| 250 | * Return: none |
| 251 | */ |
| 252 | void hif_dummy_irq_disable(struct hif_softc *hif_sc, int irq_id) |
| 253 | {} |
| 254 | |
| 255 | /** |
Venkateswara Swamy Bandaru | 31108f3 | 2016-08-08 18:04:29 +0530 | [diff] [blame] | 256 | * hif_dummy_grp_irq_disable- dummy call |
| 257 | * hif_ctx: hif context |
| 258 | * @grp_id: grp id |
| 259 | * |
| 260 | * Return: none |
| 261 | */ |
| 262 | void hif_dummy_grp_irq_disable(struct hif_softc *hif_sc, uint32_t grp_id) |
| 263 | {} |
| 264 | /** |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 265 | * hif_dummy_dump_registers - dummy call |
| 266 | * hif_sc: hif context |
| 267 | * |
| 268 | * Return: 0 for sucess |
| 269 | */ |
| 270 | int hif_dummy_dump_registers(struct hif_softc *hif_sc) |
| 271 | { |
| 272 | return 0; |
| 273 | } |
| 274 | |
| 275 | /** |
| 276 | * hif_dummy_dump_target_memory - dummy call |
| 277 | * @hif_sc: hif context |
| 278 | * @ramdump_base: base |
| 279 | * @address: address |
| 280 | * @size: size |
| 281 | * |
| 282 | * Return: None |
| 283 | */ |
| 284 | void hif_dummy_dump_target_memory(struct hif_softc *hif_sc, void *ramdump_base, |
| 285 | uint32_t address, uint32_t size) |
| 286 | { |
| 287 | } |
| 288 | |
| 289 | /** |
| 290 | * hif_dummy_ipa_get_ce_resource - dummy call |
| 291 | * @scn: HIF context |
| 292 | * @sr_base_paddr: source base address |
| 293 | * @sr_ring_size: source ring size |
| 294 | * @reg_paddr: bus physical address |
| 295 | * |
| 296 | * Return: None |
| 297 | */ |
| 298 | void hif_dummy_ipa_get_ce_resource(struct hif_softc *hif_sc, |
| 299 | qdf_dma_addr_t *sr_base_paddr, |
| 300 | uint32_t *sr_ring_size, |
| 301 | qdf_dma_addr_t *reg_paddr) |
| 302 | { |
| 303 | } |
| 304 | |
| 305 | /** |
| 306 | * hif_dummy_mask_interrupt_call - dummy call |
| 307 | * @hif_sc: hif context |
| 308 | * |
| 309 | * Return: None |
| 310 | */ |
| 311 | void |
| 312 | hif_dummy_mask_interrupt_call(struct hif_softc *hif_sc) |
| 313 | { |
| 314 | return; |
| 315 | } |
Nirav Shah | b70bd73 | 2016-05-25 14:31:51 +0530 | [diff] [blame] | 316 | |
| 317 | /** |
| 318 | * hif_dummy_display_stats - dummy call |
| 319 | * hif_ctx: hif context |
| 320 | * |
| 321 | * Return: none |
| 322 | */ |
| 323 | void hif_dummy_display_stats(struct hif_softc *hif_ctx) |
| 324 | {} |
| 325 | |
| 326 | /** |
| 327 | * hif_dummy_clear_stats - dummy call |
| 328 | * hif_ctx: hif context |
| 329 | * |
| 330 | * Return: none |
| 331 | */ |
| 332 | void hif_dummy_clear_stats(struct hif_softc *hif_ctx) |
| 333 | {} |
Mohit Khanna | 1957ba9 | 2016-05-11 11:17:01 -0700 | [diff] [blame] | 334 | /** |
| 335 | * hif_dummy_set_bundle_mode() - dummy call |
| 336 | * @hif_sc: hif context |
| 337 | * @enabled: flag to enable/disable bundling |
| 338 | * @rx_bundle_cnt: bundle count to be used for RX |
| 339 | * |
| 340 | * Return: none |
| 341 | */ |
| 342 | void hif_dummy_set_bundle_mode(struct hif_softc *hif_ctx, |
| 343 | bool enabled, int rx_bundle_cnt) |
| 344 | { |
| 345 | return; |
| 346 | } |
| 347 | |
| 348 | /** |
| 349 | * hif_dummy_bus_reset_resume() - dummy call |
| 350 | * @hif_sc: hif context |
| 351 | * |
| 352 | * Return: int 0 for success, non zero for failure |
| 353 | */ |
| 354 | int hif_dummy_bus_reset_resume(struct hif_softc *hif_ctx) |
| 355 | { |
| 356 | return 0; |
| 357 | } |