blob: f58ef19d3fba88bf5e66da2332e1c697bfbc12b9 [file] [log] [blame]
Houston Hoffman32bc8eb2016-03-14 21:11:34 -07001/*
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
Houston Hoffman32bc8eb2016-03-14 21:11:34 -070028#include "hif.h"
29#include "hif_main.h"
Houston Hoffman8f239f62016-03-14 21:12:05 -070030#include "multibus.h"
Houston Hoffman162164c2016-03-14 21:12:10 -070031#include "ce_main.h"
Houston Hoffman32bc8eb2016-03-14 21:11:34 -070032#include "snoc_api.h"
Houston Hoffman4ca03b62016-03-14 21:11:51 -070033#include "dummy.h"
Nirav Shah3573f952016-05-12 18:37:03 +053034#include "ce_api.h"
Houston Hoffman32bc8eb2016-03-14 21:11:34 -070035
36/**
37 * hif_initialize_pci_ops() - initialize the pci ops
38 * @bus_ops: hif_bus_ops table pointer to initialize
39 *
40 * Return: QDF_STATUS_SUCCESS
41 */
42QDF_STATUS hif_initialize_snoc_ops(struct hif_bus_ops *bus_ops)
43{
44 bus_ops->hif_bus_open = &hif_snoc_open;
45 bus_ops->hif_bus_close = &hif_snoc_close;
Houston Hoffman4ca03b62016-03-14 21:11:51 -070046 bus_ops->hif_bus_prevent_linkdown = &hif_dummy_bus_prevent_linkdown;
47 bus_ops->hif_reset_soc = &hif_dummy_reset_soc;
48 bus_ops->hif_bus_suspend = &hif_dummy_bus_suspend;
49 bus_ops->hif_bus_resume = &hif_dummy_bus_resume;
50 bus_ops->hif_target_sleep_state_adjust =
51 &hif_dummy_target_sleep_state_adjust;
52
Houston Hoffman8f239f62016-03-14 21:12:05 -070053 bus_ops->hif_disable_isr = &hif_snoc_disable_isr;
54 bus_ops->hif_nointrs = &hif_snoc_nointrs;
55 bus_ops->hif_enable_bus = &hif_snoc_enable_bus;
56 bus_ops->hif_disable_bus = &hif_snoc_disable_bus;
57 bus_ops->hif_bus_configure = &hif_snoc_bus_configure;
Nirav Shah3573f952016-05-12 18:37:03 +053058 bus_ops->hif_get_config_item = &hif_dummy_get_config_item;
59 bus_ops->hif_set_mailbox_swap = &hif_dummy_set_mailbox_swap;
60 bus_ops->hif_claim_device = &hif_dummy_claim_device;
61 bus_ops->hif_shutdown_device = &hif_ce_stop;
62 bus_ops->hif_stop = &hif_ce_stop;
Nirav Shah3573f952016-05-12 18:37:03 +053063 bus_ops->hif_cancel_deferred_target_sleep =
64 &hif_dummy_cancel_deferred_target_sleep;
Houston Hoffman8f239f62016-03-14 21:12:05 -070065 bus_ops->hif_irq_disable = &hif_snoc_irq_disable;
66 bus_ops->hif_irq_enable = &hif_snoc_irq_enable;
Houston Hoffman3c017e72016-03-14 21:12:11 -070067 bus_ops->hif_dump_registers = &hif_snoc_dump_registers;
Nirav Shah3573f952016-05-12 18:37:03 +053068 bus_ops->hif_dump_target_memory = &hif_ce_dump_target_memory;
69 bus_ops->hif_ipa_get_ce_resource = &hif_ce_ipa_get_ce_resource;
70 bus_ops->hif_mask_interrupt_call = &hif_dummy_mask_interrupt_call;
Houston Hoffmanb4149dd2016-03-23 15:55:41 -070071 bus_ops->hif_enable_power_management =
72 &hif_dummy_enable_power_management;
73 bus_ops->hif_disable_power_management =
74 &hif_dummy_disable_power_management;
Houston Hoffman8f239f62016-03-14 21:12:05 -070075
Houston Hoffman32bc8eb2016-03-14 21:11:34 -070076 return QDF_STATUS_SUCCESS;
77}
Houston Hoffman162164c2016-03-14 21:12:10 -070078
79/**
80 * hif_snoc_get_context_size() - return the size of the snoc context
81 *
82 * Return the size of the context. (0 for invalid bus)
83 */
84int hif_snoc_get_context_size(void)
85{
86 return sizeof(struct HIF_CE_state);
87}