1 /* 2 * Copyright (c) 2016-2018 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 #ifndef _PCI_API_H_ 28 #define _PCI_API_H_ 29 struct hif_exec_context; 30 31 QDF_STATUS hif_pci_open(struct hif_softc *hif_ctx, 32 enum qdf_bus_type bus_type); 33 void hif_pci_close(struct hif_softc *hif_ctx); 34 void hif_pci_prevent_linkdown(struct hif_softc *scn, bool flag); 35 void hif_pci_reset_soc(struct hif_softc *ol_sc); 36 int hif_pci_bus_suspend(struct hif_softc *scn); 37 int hif_pci_bus_suspend_noirq(struct hif_softc *scn); 38 int hif_pci_bus_resume(struct hif_softc *scn); 39 int hif_pci_bus_resume_noirq(struct hif_softc *scn); 40 int hif_pci_target_sleep_state_adjust(struct hif_softc *scn, 41 bool sleep_ok, bool wait_for_it); 42 43 void hif_pci_disable_isr(struct hif_softc *scn); 44 void hif_pci_nointrs(struct hif_softc *scn); 45 QDF_STATUS hif_pci_enable_bus(struct hif_softc *scn, 46 struct device *dev, void *bdev, 47 const struct hif_bus_id *bid, 48 enum hif_enable_type type); 49 void hif_pci_disable_bus(struct hif_softc *scn); 50 int hif_pci_bus_configure(struct hif_softc *scn); 51 void hif_pci_irq_disable(struct hif_softc *scn, int ce_id); 52 void hif_pci_irq_enable(struct hif_softc *scn, int ce_id); 53 int hif_pci_dump_registers(struct hif_softc *scn); 54 void hif_pci_enable_power_management(struct hif_softc *hif_ctx, 55 bool is_packet_log_enabled); 56 void hif_pci_disable_power_management(struct hif_softc *hif_ctx); 57 int hif_pci_configure_grp_irq(struct hif_softc *scn, 58 struct hif_exec_context *exec); 59 void hif_pci_display_stats(struct hif_softc *hif_ctx); 60 void hif_pci_clear_stats(struct hif_softc *hif_ctx); 61 int hif_pci_legacy_map_ce_to_irq(struct hif_softc *scn, int ce_id); 62 bool hif_pci_needs_bmi(struct hif_softc *scn); 63 #endif /* _PCI_API_H_ */ 64