1718cf2ccSPedro F. Giffuni /*- 2*4d846d26SWarner Losh * SPDX-License-Identifier: BSD-2-Clause 3718cf2ccSPedro F. Giffuni * 4711bcba0SDavid C Somayajulu * Copyright (c) 2013-2014 Qlogic Corporation 5711bcba0SDavid C Somayajulu * All rights reserved. 6711bcba0SDavid C Somayajulu * 7711bcba0SDavid C Somayajulu * Redistribution and use in source and binary forms, with or without 8711bcba0SDavid C Somayajulu * modification, are permitted provided that the following conditions 9711bcba0SDavid C Somayajulu * are met: 10711bcba0SDavid C Somayajulu * 11711bcba0SDavid C Somayajulu * 1. Redistributions of source code must retain the above copyright 12711bcba0SDavid C Somayajulu * notice, this list of conditions and the following disclaimer. 13711bcba0SDavid C Somayajulu * 2. Redistributions in binary form must reproduce the above copyright 14711bcba0SDavid C Somayajulu * notice, this list of conditions and the following disclaimer in the 15711bcba0SDavid C Somayajulu * documentation and/or other materials provided with the distribution. 16711bcba0SDavid C Somayajulu * 17711bcba0SDavid C Somayajulu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 18711bcba0SDavid C Somayajulu * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19711bcba0SDavid C Somayajulu * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20711bcba0SDavid C Somayajulu * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 21711bcba0SDavid C Somayajulu * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 22711bcba0SDavid C Somayajulu * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 23711bcba0SDavid C Somayajulu * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 24711bcba0SDavid C Somayajulu * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 25711bcba0SDavid C Somayajulu * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 26711bcba0SDavid C Somayajulu * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 27711bcba0SDavid C Somayajulu * POSSIBILITY OF SUCH DAMAGE. 28711bcba0SDavid C Somayajulu */ 29711bcba0SDavid C Somayajulu /* 30711bcba0SDavid C Somayajulu * File: qls_glbl.h 31711bcba0SDavid C Somayajulu * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656. 32711bcba0SDavid C Somayajulu * Content: Contains prototypes of the exported functions from each file. 33711bcba0SDavid C Somayajulu */ 34711bcba0SDavid C Somayajulu #ifndef _QLS_GLBL_H_ 35711bcba0SDavid C Somayajulu #define _QLS_GLBL_H_ 36711bcba0SDavid C Somayajulu 37711bcba0SDavid C Somayajulu /* 38711bcba0SDavid C Somayajulu * from qls_isr.c 39711bcba0SDavid C Somayajulu */ 40711bcba0SDavid C Somayajulu 41711bcba0SDavid C Somayajulu extern void qls_isr(void *arg); 42711bcba0SDavid C Somayajulu 43711bcba0SDavid C Somayajulu /* 44711bcba0SDavid C Somayajulu * from qls_os.c 45711bcba0SDavid C Somayajulu */ 46711bcba0SDavid C Somayajulu 47711bcba0SDavid C Somayajulu extern int qls_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf); 48711bcba0SDavid C Somayajulu extern void qls_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf); 49711bcba0SDavid C Somayajulu extern int qls_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp); 50711bcba0SDavid C Somayajulu 51711bcba0SDavid C Somayajulu /* 52711bcba0SDavid C Somayajulu * from qls_hw.c 53711bcba0SDavid C Somayajulu */ 54711bcba0SDavid C Somayajulu 55711bcba0SDavid C Somayajulu extern int qls_init_host_fw(qla_host_t *ha); 56711bcba0SDavid C Somayajulu extern int qls_get_msix_count(qla_host_t *ha); 57711bcba0SDavid C Somayajulu 58711bcba0SDavid C Somayajulu extern void qls_hw_add_sysctls(qla_host_t *ha); 59711bcba0SDavid C Somayajulu 60711bcba0SDavid C Somayajulu extern void qls_free_dma(qla_host_t *ha); 61711bcba0SDavid C Somayajulu extern int qls_alloc_dma(qla_host_t *ha); 62711bcba0SDavid C Somayajulu 63711bcba0SDavid C Somayajulu extern int qls_set_promisc(qla_host_t *ha); 64711bcba0SDavid C Somayajulu extern void qls_reset_promisc(qla_host_t *ha); 65711bcba0SDavid C Somayajulu extern int qls_set_allmulti(qla_host_t *ha); 66711bcba0SDavid C Somayajulu extern void qls_reset_allmulti(qla_host_t *ha); 67711bcba0SDavid C Somayajulu 68711bcba0SDavid C Somayajulu extern int qls_hw_tx_done(qla_host_t *ha, uint32_t txr_idx); 69711bcba0SDavid C Somayajulu 70711bcba0SDavid C Somayajulu extern int qls_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs, 71711bcba0SDavid C Somayajulu uint32_t tx_idx, struct mbuf *mp, uint32_t txr_idx); 72711bcba0SDavid C Somayajulu 73711bcba0SDavid C Somayajulu extern void qls_del_hw_if(qla_host_t *ha); 74711bcba0SDavid C Somayajulu extern int qls_init_hw_if(qla_host_t *ha); 75711bcba0SDavid C Somayajulu 76711bcba0SDavid C Somayajulu extern void qls_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt, 77711bcba0SDavid C Somayajulu uint32_t add_multi); 78711bcba0SDavid C Somayajulu 79711bcba0SDavid C Somayajulu extern void qls_update_link_state(qla_host_t *ha); 80711bcba0SDavid C Somayajulu 81711bcba0SDavid C Somayajulu extern int qls_init_hw(qla_host_t *ha); 82711bcba0SDavid C Somayajulu 83711bcba0SDavid C Somayajulu extern int qls_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data); 84711bcba0SDavid C Somayajulu extern int qls_rd_nic_params(qla_host_t *ha); 85711bcba0SDavid C Somayajulu 86711bcba0SDavid C Somayajulu extern int qls_mbx_rd_reg(qla_host_t *ha, uint32_t reg, uint32_t *data); 87711bcba0SDavid C Somayajulu extern int qls_mbx_wr_reg(qla_host_t *ha, uint32_t reg, uint32_t data); 88711bcba0SDavid C Somayajulu extern int qls_mpi_risc_rd_reg(qla_host_t *ha, uint32_t reg, uint32_t *data); 89711bcba0SDavid C Somayajulu extern int qls_mpi_risc_wr_reg(qla_host_t *ha, uint32_t reg, uint32_t data); 90711bcba0SDavid C Somayajulu 91711bcba0SDavid C Somayajulu extern int qls_mbx_dump_risc_ram(qla_host_t *ha, void *buf, uint32_t r_addr, 92711bcba0SDavid C Somayajulu uint32_t r_size); 93711bcba0SDavid C Somayajulu 94711bcba0SDavid C Somayajulu extern int qls_mpi_reset(qla_host_t *ha); 95711bcba0SDavid C Somayajulu 96711bcba0SDavid C Somayajulu /* 97711bcba0SDavid C Somayajulu * from qls_ioctl.c 98711bcba0SDavid C Somayajulu */ 99711bcba0SDavid C Somayajulu 100711bcba0SDavid C Somayajulu extern int qls_make_cdev(qla_host_t *ha); 101711bcba0SDavid C Somayajulu extern void qls_del_cdev(qla_host_t *ha); 102711bcba0SDavid C Somayajulu 103711bcba0SDavid C Somayajulu extern int qls_mpi_core_dump(qla_host_t *ha); 104711bcba0SDavid C Somayajulu 105711bcba0SDavid C Somayajulu #endif /* #ifndef_QLS_GLBL_H_ */ 106