qls_glbl.h revision 330897
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2013-2014 Qlogic Corporation
5 * All rights reserved.
6 *
7 *  Redistribution and use in source and binary forms, with or without
8 *  modification, are permitted provided that the following conditions
9 *  are met:
10 *
11 *  1. Redistributions of source code must retain the above copyright
12 *     notice, this list of conditions and the following disclaimer.
13 *  2. Redistributions in binary form must reproduce the above copyright
14 *     notice, this list of conditions and the following disclaimer in the
15 *     documentation and/or other materials provided with the distribution.
16 *
17 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 *  POSSIBILITY OF SUCH DAMAGE.
28 *
29 * $FreeBSD: stable/11/sys/dev/qlxge/qls_glbl.h 330897 2018-03-14 03:19:51Z eadler $
30 */
31/*
32 * File: qls_glbl.h
33 * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
34 * Content: Contains prototypes of the exported functions from each file.
35 */
36#ifndef _QLS_GLBL_H_
37#define _QLS_GLBL_H_
38
39/*
40 * from qls_isr.c
41 */
42
43extern void qls_isr(void *arg);
44
45/*
46 * from qls_os.c
47 */
48
49extern int qls_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
50extern void qls_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
51extern int qls_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp);
52
53/*
54 * from qls_hw.c
55 */
56
57extern int qls_init_host_fw(qla_host_t *ha);
58extern int qls_get_msix_count(qla_host_t *ha);
59
60extern void qls_hw_add_sysctls(qla_host_t *ha);
61
62extern void qls_free_dma(qla_host_t *ha);
63extern int qls_alloc_dma(qla_host_t *ha);
64
65extern int qls_set_promisc(qla_host_t *ha);
66extern void qls_reset_promisc(qla_host_t *ha);
67extern int qls_set_allmulti(qla_host_t *ha);
68extern void qls_reset_allmulti(qla_host_t *ha);
69
70extern int qls_hw_tx_done(qla_host_t *ha, uint32_t txr_idx);
71
72extern int qls_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
73		uint32_t tx_idx, struct mbuf *mp, uint32_t txr_idx);
74
75extern void qls_del_hw_if(qla_host_t *ha);
76extern int qls_init_hw_if(qla_host_t *ha);
77
78extern void qls_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt,
79	uint32_t add_multi);
80
81extern void qls_update_link_state(qla_host_t *ha);
82
83extern int qls_init_hw(qla_host_t *ha);
84
85extern int qls_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data);
86extern int qls_rd_nic_params(qla_host_t *ha);
87
88extern int qls_mbx_rd_reg(qla_host_t *ha, uint32_t reg, uint32_t *data);
89extern int qls_mbx_wr_reg(qla_host_t *ha, uint32_t reg, uint32_t data);
90extern int qls_mpi_risc_rd_reg(qla_host_t *ha, uint32_t reg, uint32_t *data);
91extern int qls_mpi_risc_wr_reg(qla_host_t *ha, uint32_t reg, uint32_t data);
92
93extern int qls_mbx_dump_risc_ram(qla_host_t *ha, void *buf, uint32_t r_addr,
94		uint32_t r_size);
95
96extern int qls_mpi_reset(qla_host_t *ha);
97
98/*
99 * from qls_ioctl.c
100 */
101
102extern int qls_make_cdev(qla_host_t *ha);
103extern void qls_del_cdev(qla_host_t *ha);
104
105extern int qls_mpi_core_dump(qla_host_t *ha);
106
107#endif /* #ifndef_QLS_GLBL_H_ */
108