xref: /wlan-dirver/qca-wifi-host-cmn/hif/src/dispatcher/pci_api.h (revision dd4dc88b837a295134aa9869114a2efee0f4894b)
1 /*
2  * Copyright (c) 2016-2019 The Linux Foundation. All rights reserved.
3  *
4  * Permission to use, copy, modify, and/or distribute this software for
5  * any purpose with or without fee is hereby granted, provided that the
6  * above copyright notice and this permission notice appear in all
7  * copies.
8  *
9  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
10  * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
11  * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
12  * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
13  * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
14  * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
15  * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
16  * PERFORMANCE OF THIS SOFTWARE.
17  */
18 
19 #ifndef _PCI_API_H_
20 #define _PCI_API_H_
21 struct hif_exec_context;
22 
23 QDF_STATUS hif_pci_open(struct hif_softc *hif_ctx,
24 			enum qdf_bus_type bus_type);
25 void hif_pci_close(struct hif_softc *hif_ctx);
26 void hif_pci_prevent_linkdown(struct hif_softc *scn, bool flag);
27 void hif_pci_reset_soc(struct hif_softc *ol_sc);
28 int hif_pci_bus_suspend(struct hif_softc *scn);
29 int hif_pci_bus_suspend_noirq(struct hif_softc *scn);
30 int hif_pci_bus_resume(struct hif_softc *scn);
31 int hif_pci_bus_resume_noirq(struct hif_softc *scn);
32 int hif_pci_target_sleep_state_adjust(struct hif_softc *scn,
33 			bool sleep_ok, bool wait_for_it);
34 
35 void hif_pci_disable_isr(struct hif_softc *scn);
36 void hif_pci_nointrs(struct hif_softc *scn);
37 QDF_STATUS hif_pci_enable_bus(struct hif_softc *scn,
38 			struct device *dev, void *bdev,
39 			const struct hif_bus_id *bid,
40 			enum hif_enable_type type);
41 void hif_pci_disable_bus(struct hif_softc *scn);
42 int hif_pci_bus_configure(struct hif_softc *scn);
43 void hif_pci_irq_disable(struct hif_softc *scn, int ce_id);
44 void hif_pci_irq_enable(struct hif_softc *scn, int ce_id);
45 int hif_pci_dump_registers(struct hif_softc *scn);
46 void hif_pci_enable_power_management(struct hif_softc *hif_ctx,
47 				 bool is_packet_log_enabled);
48 void hif_pci_disable_power_management(struct hif_softc *hif_ctx);
49 int hif_pci_configure_grp_irq(struct hif_softc *scn,
50 			      struct hif_exec_context *exec);
51 void hif_pci_display_stats(struct hif_softc *hif_ctx);
52 void hif_pci_clear_stats(struct hif_softc *hif_ctx);
53 int hif_pci_legacy_map_ce_to_irq(struct hif_softc *scn, int ce_id);
54 bool hif_pci_needs_bmi(struct hif_softc *scn);
55 const char *hif_pci_get_irq_name(int irq_no);
56 #endif /* _PCI_API_H_ */
57