Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 1 | /* |
Yu Wang | 1e487a5 | 2017-02-07 20:10:42 +0800 | [diff] [blame^] | 2 | * Copyright (c) 2016-2017 The Linux Foundation. All rights reserved. |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [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 | |
| 29 | /* this file dispatches functions to bus specific definitions */ |
| 30 | #include "hif_debug.h" |
| 31 | #include "hif.h" |
| 32 | #include "hif_main.h" |
Jeff Johnson | 6950fdb | 2016-10-07 13:00:59 -0700 | [diff] [blame] | 33 | #include "hif_io32.h" |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 34 | #include "multibus.h" |
Mohit Khanna | 1957ba9 | 2016-05-11 11:17:01 -0700 | [diff] [blame] | 35 | #include "dummy.h" |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 36 | #if defined(HIF_PCI) || defined(HIF_SNOC) || defined(HIF_AHB) |
Houston Hoffman | 162164c | 2016-03-14 21:12:10 -0700 | [diff] [blame] | 37 | #include "ce_main.h" |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 38 | #endif |
Komal Seelam | 6ee5590 | 2016-04-11 17:11:07 +0530 | [diff] [blame] | 39 | #include "htc_services.h" |
| 40 | #include "a_types.h" |
Nirav Shah | b70bd73 | 2016-05-25 14:31:51 +0530 | [diff] [blame] | 41 | #include "dummy.h" |
| 42 | |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 43 | /** |
| 44 | * hif_intialize_default_ops() - intializes default operations values |
| 45 | * |
| 46 | * bus specific features should assign their dummy implementations here. |
| 47 | */ |
| 48 | static void hif_intialize_default_ops(struct hif_softc *hif_sc) |
| 49 | { |
| 50 | struct hif_bus_ops *bus_ops = &hif_sc->bus_ops; |
| 51 | |
| 52 | /* must be filled in by hif_bus_open */ |
| 53 | bus_ops->hif_bus_close = NULL; |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 54 | /* dummy implementations */ |
Nirav Shah | b70bd73 | 2016-05-25 14:31:51 +0530 | [diff] [blame] | 55 | bus_ops->hif_display_stats = |
| 56 | &hif_dummy_display_stats; |
| 57 | bus_ops->hif_clear_stats = |
| 58 | &hif_dummy_clear_stats; |
Houston Hoffman | 7fdff0c | 2016-08-29 12:31:58 -0700 | [diff] [blame] | 59 | bus_ops->hif_set_bundle_mode = &hif_dummy_set_bundle_mode; |
| 60 | bus_ops->hif_bus_reset_resume = &hif_dummy_bus_reset_resume; |
| 61 | bus_ops->hif_bus_suspend_noirq = &hif_dummy_bus_suspend_noirq; |
| 62 | bus_ops->hif_bus_resume_noirq = &hif_dummy_bus_resume_noirq; |
Venkateswara Swamy Bandaru | 31108f3 | 2016-08-08 18:04:29 +0530 | [diff] [blame] | 63 | bus_ops->hif_grp_irq_disable = &hif_dummy_grp_irq_disable; |
| 64 | bus_ops->hif_grp_irq_enable = &hif_dummy_grp_irq_enable; |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | #define NUM_OPS (sizeof(struct hif_bus_ops) / sizeof(void *)) |
| 68 | |
| 69 | /** |
| 70 | * hif_verify_basic_ops() - ensure required bus apis are defined |
| 71 | * |
| 72 | * all bus operations must be defined to avoid crashes |
| 73 | * itterate over the structure and ensure all function pointers |
| 74 | * are non null. |
| 75 | * |
| 76 | * Return: QDF_STATUS_SUCCESS if all the operations are defined |
| 77 | */ |
| 78 | static QDF_STATUS hif_verify_basic_ops(struct hif_softc *hif_sc) |
| 79 | { |
| 80 | struct hif_bus_ops *bus_ops = &hif_sc->bus_ops; |
| 81 | void **ops_array = (void *)bus_ops; |
| 82 | QDF_STATUS status = QDF_STATUS_SUCCESS; |
| 83 | int i; |
| 84 | |
| 85 | for (i = 0; i < NUM_OPS; i++) { |
| 86 | if (!ops_array[i]) { |
| 87 | HIF_ERROR("%s: function %d is null", __func__, i); |
| 88 | status = QDF_STATUS_E_NOSUPPORT; |
| 89 | } |
| 90 | } |
| 91 | return status; |
| 92 | } |
| 93 | |
| 94 | /** |
Houston Hoffman | 162164c | 2016-03-14 21:12:10 -0700 | [diff] [blame] | 95 | * hif_bus_get_context_size - API to return size of the bus specific structure |
| 96 | * |
| 97 | * Return: sizeof of hif_pci_softc |
| 98 | */ |
| 99 | int hif_bus_get_context_size(enum qdf_bus_type bus_type) |
| 100 | { |
| 101 | switch (bus_type) { |
| 102 | case QDF_BUS_TYPE_PCI: |
| 103 | return hif_pci_get_context_size(); |
Houston Hoffman | 3db96a4 | 2016-05-05 19:54:39 -0700 | [diff] [blame] | 104 | case QDF_BUS_TYPE_AHB: |
| 105 | return hif_ahb_get_context_size(); |
Houston Hoffman | 162164c | 2016-03-14 21:12:10 -0700 | [diff] [blame] | 106 | case QDF_BUS_TYPE_SNOC: |
| 107 | return hif_snoc_get_context_size(); |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 108 | case QDF_BUS_TYPE_SDIO: |
| 109 | return hif_sdio_get_context_size(); |
Mohit Khanna | 1957ba9 | 2016-05-11 11:17:01 -0700 | [diff] [blame] | 110 | case QDF_BUS_TYPE_USB: |
| 111 | return hif_usb_get_context_size(); |
Houston Hoffman | 162164c | 2016-03-14 21:12:10 -0700 | [diff] [blame] | 112 | default: |
| 113 | return 0; |
| 114 | } |
| 115 | } |
| 116 | |
| 117 | /** |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 118 | * hif_bus_open() - initialize the bus_ops and call the bus specific open |
| 119 | * hif_sc: hif_context |
| 120 | * bus_type: type of bus being enumerated |
| 121 | * |
| 122 | * Return: QDF_STATUS_SUCCESS or error |
| 123 | */ |
| 124 | QDF_STATUS hif_bus_open(struct hif_softc *hif_sc, |
| 125 | enum qdf_bus_type bus_type) |
| 126 | { |
| 127 | QDF_STATUS status = QDF_STATUS_E_INVAL; |
| 128 | |
| 129 | hif_intialize_default_ops(hif_sc); |
| 130 | |
| 131 | switch (bus_type) { |
| 132 | case QDF_BUS_TYPE_PCI: |
Houston Hoffman | 54ef87d | 2016-03-14 21:11:58 -0700 | [diff] [blame] | 133 | status = hif_initialize_pci_ops(hif_sc); |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 134 | break; |
| 135 | case QDF_BUS_TYPE_SNOC: |
| 136 | status = hif_initialize_snoc_ops(&hif_sc->bus_ops); |
| 137 | break; |
Houston Hoffman | 3db96a4 | 2016-05-05 19:54:39 -0700 | [diff] [blame] | 138 | case QDF_BUS_TYPE_AHB: |
| 139 | status = hif_initialize_ahb_ops(&hif_sc->bus_ops); |
| 140 | break; |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 141 | case QDF_BUS_TYPE_SDIO: |
| 142 | status = hif_initialize_sdio_ops(hif_sc); |
Yu Wang | 1e487a5 | 2017-02-07 20:10:42 +0800 | [diff] [blame^] | 143 | break; |
Mohit Khanna | 1957ba9 | 2016-05-11 11:17:01 -0700 | [diff] [blame] | 144 | case QDF_BUS_TYPE_USB: |
| 145 | status = hif_initialize_usb_ops(&hif_sc->bus_ops); |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 146 | break; |
Houston Hoffman | 32bc8eb | 2016-03-14 21:11:34 -0700 | [diff] [blame] | 147 | default: |
| 148 | status = QDF_STATUS_E_NOSUPPORT; |
| 149 | break; |
| 150 | } |
| 151 | |
| 152 | if (status != QDF_STATUS_SUCCESS) { |
| 153 | HIF_ERROR("%s: %d not supported", __func__, bus_type); |
| 154 | return status; |
| 155 | } |
| 156 | |
| 157 | status = hif_verify_basic_ops(hif_sc); |
| 158 | if (status != QDF_STATUS_SUCCESS) |
| 159 | return status; |
| 160 | |
| 161 | return hif_sc->bus_ops.hif_bus_open(hif_sc, bus_type); |
| 162 | } |
| 163 | |
| 164 | /** |
| 165 | * hif_bus_close() - close the bus |
| 166 | * @hif_sc: hif_context |
| 167 | */ |
| 168 | void hif_bus_close(struct hif_softc *hif_sc) |
| 169 | { |
| 170 | hif_sc->bus_ops.hif_bus_close(hif_sc); |
| 171 | } |
Houston Hoffman | 4ca03b6 | 2016-03-14 21:11:51 -0700 | [diff] [blame] | 172 | |
| 173 | /** |
| 174 | * hif_bus_prevent_linkdown() - prevent linkdown |
| 175 | * @hif_ctx: hif context |
| 176 | * @flag: true = keep bus alive false = let bus go to sleep |
| 177 | * |
| 178 | * Keeps the bus awake durring suspend. |
| 179 | */ |
| 180 | void hif_bus_prevent_linkdown(struct hif_softc *hif_sc, bool flag) |
| 181 | { |
| 182 | hif_sc->bus_ops.hif_bus_prevent_linkdown(hif_sc, flag); |
| 183 | } |
| 184 | |
| 185 | |
| 186 | void hif_reset_soc(struct hif_opaque_softc *hif_ctx) |
| 187 | { |
| 188 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 189 | hif_sc->bus_ops.hif_reset_soc(hif_sc); |
| 190 | } |
| 191 | |
| 192 | int hif_bus_suspend(struct hif_opaque_softc *hif_ctx) |
| 193 | { |
| 194 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 195 | return hif_sc->bus_ops.hif_bus_suspend(hif_sc); |
| 196 | } |
| 197 | |
| 198 | int hif_bus_resume(struct hif_opaque_softc *hif_ctx) |
| 199 | { |
| 200 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 201 | return hif_sc->bus_ops.hif_bus_resume(hif_sc); |
| 202 | } |
| 203 | |
Houston Hoffman | 7fdff0c | 2016-08-29 12:31:58 -0700 | [diff] [blame] | 204 | int hif_bus_suspend_noirq(struct hif_opaque_softc *hif_ctx) |
| 205 | { |
| 206 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 207 | return hif_sc->bus_ops.hif_bus_suspend_noirq(hif_sc); |
| 208 | } |
| 209 | |
| 210 | int hif_bus_resume_noirq(struct hif_opaque_softc *hif_ctx) |
| 211 | { |
| 212 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 213 | return hif_sc->bus_ops.hif_bus_resume_noirq(hif_sc); |
| 214 | } |
| 215 | |
Houston Hoffman | 4ca03b6 | 2016-03-14 21:11:51 -0700 | [diff] [blame] | 216 | int hif_target_sleep_state_adjust(struct hif_softc *hif_sc, |
| 217 | bool sleep_ok, bool wait_for_it) |
| 218 | { |
| 219 | return hif_sc->bus_ops.hif_target_sleep_state_adjust(hif_sc, |
| 220 | sleep_ok, wait_for_it); |
| 221 | } |
Houston Hoffman | 8f239f6 | 2016-03-14 21:12:05 -0700 | [diff] [blame] | 222 | |
| 223 | void hif_disable_isr(struct hif_opaque_softc *hif_hdl) |
| 224 | { |
| 225 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 226 | hif_sc->bus_ops.hif_disable_isr(hif_sc); |
| 227 | } |
| 228 | |
| 229 | void hif_nointrs(struct hif_softc *hif_sc) |
| 230 | { |
| 231 | hif_sc->bus_ops.hif_nointrs(hif_sc); |
| 232 | } |
| 233 | |
| 234 | QDF_STATUS hif_enable_bus(struct hif_softc *hif_sc, struct device *dev, |
| 235 | void *bdev, const hif_bus_id *bid, |
| 236 | enum hif_enable_type type) |
| 237 | { |
| 238 | return hif_sc->bus_ops.hif_enable_bus(hif_sc, dev, bdev, bid, type); |
| 239 | } |
| 240 | |
| 241 | void hif_disable_bus(struct hif_softc *hif_sc) |
| 242 | { |
| 243 | hif_sc->bus_ops.hif_disable_bus(hif_sc); |
| 244 | } |
| 245 | |
| 246 | int hif_bus_configure(struct hif_softc *hif_sc) |
| 247 | { |
| 248 | return hif_sc->bus_ops.hif_bus_configure(hif_sc); |
| 249 | } |
| 250 | |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 251 | QDF_STATUS hif_get_config_item(struct hif_opaque_softc *hif_ctx, |
| 252 | int opcode, void *config, uint32_t config_len) |
| 253 | { |
| 254 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 255 | return hif_sc->bus_ops.hif_get_config_item(hif_sc, opcode, config, |
| 256 | config_len); |
| 257 | } |
| 258 | |
| 259 | void hif_set_mailbox_swap(struct hif_opaque_softc *hif_ctx) |
| 260 | { |
| 261 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 262 | hif_sc->bus_ops.hif_set_mailbox_swap(hif_sc); |
| 263 | } |
| 264 | |
| 265 | void hif_claim_device(struct hif_opaque_softc *hif_ctx) |
| 266 | { |
| 267 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 268 | hif_sc->bus_ops.hif_claim_device(hif_sc); |
| 269 | } |
| 270 | |
| 271 | void hif_shutdown_device(struct hif_opaque_softc *hif_ctx) |
| 272 | { |
| 273 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 274 | hif_sc->bus_ops.hif_shutdown_device(hif_sc); |
| 275 | } |
| 276 | |
| 277 | void hif_stop(struct hif_opaque_softc *hif_ctx) |
| 278 | { |
| 279 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_ctx); |
| 280 | hif_sc->bus_ops.hif_stop(hif_sc); |
| 281 | } |
| 282 | |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 283 | void hif_cancel_deferred_target_sleep(struct hif_softc *hif_sc) |
| 284 | { |
| 285 | return hif_sc->bus_ops.hif_cancel_deferred_target_sleep(hif_sc); |
| 286 | } |
| 287 | |
Houston Hoffman | 8f239f6 | 2016-03-14 21:12:05 -0700 | [diff] [blame] | 288 | void hif_irq_enable(struct hif_softc *hif_sc, int irq_id) |
| 289 | { |
| 290 | hif_sc->bus_ops.hif_irq_enable(hif_sc, irq_id); |
| 291 | } |
| 292 | |
Venkateswara Swamy Bandaru | 31108f3 | 2016-08-08 18:04:29 +0530 | [diff] [blame] | 293 | void hif_grp_irq_enable(struct hif_softc *hif_sc, uint32_t grp_id) |
| 294 | { |
| 295 | hif_sc->bus_ops.hif_grp_irq_enable(hif_sc, grp_id); |
| 296 | } |
| 297 | |
Houston Hoffman | 8f239f6 | 2016-03-14 21:12:05 -0700 | [diff] [blame] | 298 | void hif_irq_disable(struct hif_softc *hif_sc, int irq_id) |
| 299 | { |
| 300 | hif_sc->bus_ops.hif_irq_disable(hif_sc, irq_id); |
| 301 | } |
Houston Hoffman | 3c017e7 | 2016-03-14 21:12:11 -0700 | [diff] [blame] | 302 | |
Venkateswara Swamy Bandaru | 31108f3 | 2016-08-08 18:04:29 +0530 | [diff] [blame] | 303 | void hif_grp_irq_disable(struct hif_softc *hif_sc, uint32_t grp_id) |
| 304 | { |
| 305 | hif_sc->bus_ops.hif_grp_irq_disable(hif_sc, grp_id); |
| 306 | } |
| 307 | |
Houston Hoffman | 3c017e7 | 2016-03-14 21:12:11 -0700 | [diff] [blame] | 308 | int hif_dump_registers(struct hif_opaque_softc *hif_hdl) |
| 309 | { |
| 310 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 311 | return hif_sc->bus_ops.hif_dump_registers(hif_sc); |
| 312 | } |
Houston Hoffman | b4149dd | 2016-03-23 15:55:41 -0700 | [diff] [blame] | 313 | |
Nirav Shah | 3573f95 | 2016-05-12 18:37:03 +0530 | [diff] [blame] | 314 | void hif_dump_target_memory(struct hif_opaque_softc *hif_hdl, |
| 315 | void *ramdump_base, |
| 316 | uint32_t address, uint32_t size) |
| 317 | { |
| 318 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 319 | hif_sc->bus_ops.hif_dump_target_memory(hif_sc, ramdump_base, |
| 320 | address, size); |
| 321 | } |
| 322 | |
| 323 | void hif_ipa_get_ce_resource(struct hif_opaque_softc *hif_hdl, |
| 324 | qdf_dma_addr_t *ce_sr_base_paddr, |
| 325 | uint32_t *ce_sr_ring_size, |
| 326 | qdf_dma_addr_t *ce_reg_paddr) |
| 327 | { |
| 328 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 329 | hif_sc->bus_ops.hif_ipa_get_ce_resource(hif_sc, ce_sr_base_paddr, |
| 330 | ce_sr_ring_size, ce_reg_paddr); |
| 331 | } |
| 332 | |
| 333 | void hif_mask_interrupt_call(struct hif_opaque_softc *hif_hdl) |
| 334 | { |
| 335 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 336 | hif_sc->bus_ops.hif_mask_interrupt_call(hif_sc); |
| 337 | } |
| 338 | |
Nirav Shah | b70bd73 | 2016-05-25 14:31:51 +0530 | [diff] [blame] | 339 | void hif_display_bus_stats(struct hif_opaque_softc *scn) |
| 340 | { |
| 341 | struct hif_softc *hif_sc = HIF_GET_SOFTC(scn); |
| 342 | |
| 343 | hif_sc->bus_ops.hif_display_stats(hif_sc); |
| 344 | } |
| 345 | |
| 346 | void hif_clear_bus_stats(struct hif_opaque_softc *scn) |
| 347 | { |
| 348 | struct hif_softc *hif_sc = HIF_GET_SOFTC(scn); |
| 349 | |
| 350 | hif_sc->bus_ops.hif_clear_stats(hif_sc); |
| 351 | } |
| 352 | |
Houston Hoffman | b4149dd | 2016-03-23 15:55:41 -0700 | [diff] [blame] | 353 | /** |
| 354 | * hif_enable_power_management() - enable power management after driver load |
| 355 | * @hif_hdl: opaque pointer to the hif context |
| 356 | * is_packet_log_enabled: true if packet log is enabled |
| 357 | * |
| 358 | * Driver load and firmware download are done in a high performance mode. |
| 359 | * Enable power management after the driver is loaded. |
| 360 | * packet log can require fewer power management features to be enabled. |
| 361 | */ |
| 362 | void hif_enable_power_management(struct hif_opaque_softc *hif_hdl, |
| 363 | bool is_packet_log_enabled) |
| 364 | { |
| 365 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 366 | hif_sc->bus_ops.hif_enable_power_management(hif_sc, |
| 367 | is_packet_log_enabled); |
| 368 | } |
| 369 | |
| 370 | /** |
| 371 | * hif_disable_power_management() - reset the bus power management |
| 372 | * @hif_hdl: opaque pointer to the hif context |
| 373 | * |
| 374 | * return the power management of the bus to its default state. |
| 375 | * This isn't necessarily a complete reversal of its counterpart. |
| 376 | * This should be called when unloading the driver. |
| 377 | */ |
| 378 | void hif_disable_power_management(struct hif_opaque_softc *hif_hdl) |
| 379 | { |
| 380 | struct hif_softc *hif_sc = HIF_GET_SOFTC(hif_hdl); |
| 381 | hif_sc->bus_ops.hif_disable_power_management(hif_sc); |
| 382 | } |
| 383 | |
Mohit Khanna | 1957ba9 | 2016-05-11 11:17:01 -0700 | [diff] [blame] | 384 | /** |
| 385 | * hif_set_bundle_mode() - enable bundling and set default rx bundle cnt |
| 386 | * @scn: pointer to hif_opaque_softc structure |
| 387 | * @enabled: flag to enable/disable bundling |
| 388 | * @rx_bundle_cnt: bundle count to be used for RX |
| 389 | * |
| 390 | * Return: none |
| 391 | */ |
| 392 | void hif_set_bundle_mode(struct hif_opaque_softc *scn, bool enabled, |
| 393 | int rx_bundle_cnt) |
| 394 | { |
| 395 | struct hif_softc *hif_sc = HIF_GET_SOFTC(scn); |
| 396 | hif_sc->bus_ops.hif_set_bundle_mode(hif_sc, enabled, rx_bundle_cnt); |
| 397 | } |
| 398 | |
| 399 | /** |
| 400 | * hif_bus_reset_resume() - resume the bus after reset |
| 401 | * @scn: struct hif_opaque_softc |
| 402 | * |
| 403 | * This function is called to tell the driver that USB device has been resumed |
| 404 | * and it has also been reset. The driver should redo any necessary |
| 405 | * initialization. This function resets WLAN SOC. |
| 406 | * |
| 407 | * Return: int 0 for success, non zero for failure |
| 408 | */ |
| 409 | int hif_bus_reset_resume(struct hif_opaque_softc *scn) |
| 410 | |
| 411 | { |
| 412 | struct hif_softc *hif_sc = HIF_GET_SOFTC(scn); |
| 413 | return hif_sc->bus_ops.hif_bus_reset_resume(hif_sc); |
| 414 | } |