xref: /freebsd/sys/dev/qlxgbe/ql_glbl.h (revision f7c32ed617858bcd22f8d1b03199099d50125721)
1 /*-
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2013-2016 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$
30  */
31 /*
32  * File: ql_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 _QL_GLBL_H_
37 #define _QL_GLBL_H_
38 
39 /*
40  * from ql_isr.c
41  */
42 extern void ql_mbx_isr(void *arg);
43 extern void ql_isr(void *arg);
44 extern uint32_t ql_rcv_isr(qla_host_t *ha, uint32_t sds_idx, uint32_t count);
45 
46 /*
47  * from ql_os.c
48  */
49 extern int ql_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
50 extern void ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
51 extern int ql_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp);
52 extern void qla_set_error_recovery(qla_host_t *ha);
53 
54 /*
55  * from ql_hw.c
56  */
57 extern int ql_alloc_dma(qla_host_t *ha);
58 extern void ql_free_dma(qla_host_t *ha);
59 extern void ql_hw_add_sysctls(qla_host_t *ha);
60 extern int ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
61                 uint32_t tx_idx, struct mbuf *mp, uint32_t txr_idx,
62 		uint32_t iscsi_pdu);
63 extern void qla_confirm_9kb_enable(qla_host_t *ha);
64 extern int ql_init_hw_if(qla_host_t *ha);
65 extern int ql_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt,
66 		uint32_t add_multi);
67 extern void ql_del_hw_if(qla_host_t *ha);
68 extern int ql_set_promisc(qla_host_t *ha);
69 extern void qla_reset_promisc(qla_host_t *ha);
70 extern int ql_set_allmulti(qla_host_t *ha);
71 extern void qla_reset_allmulti(qla_host_t *ha);
72 extern void ql_update_link_state(qla_host_t *ha);
73 extern void ql_hw_tx_done_locked(qla_host_t *ha, uint32_t txr_idx);
74 extern int ql_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id);
75 extern void ql_get_stats(qla_host_t *ha);
76 extern void ql_hw_link_status(qla_host_t *ha);
77 extern int ql_hw_check_health(qla_host_t *ha);
78 extern void qla_hw_async_event(qla_host_t *ha);
79 extern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb,
80 		uint32_t *num_rcvq);
81 extern int qla_hw_del_all_mcast(qla_host_t *ha);
82 
83 extern int ql_iscsi_pdu(qla_host_t *ha, struct mbuf *mp);
84 extern void ql_minidump(qla_host_t *ha);
85 extern int ql_minidump_init(qla_host_t *ha);
86 
87 /*
88  * from ql_misc.c
89  */
90 extern int ql_init_hw(qla_host_t *ha);
91 extern int ql_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val,
92 		uint32_t rd);
93 extern int ql_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data);
94 extern int ql_rdwr_offchip_mem(qla_host_t *ha, uint64_t addr,
95 		q80_offchip_mem_val_t *val, uint32_t rd);
96 extern void ql_read_mac_addr(qla_host_t *ha);
97 extern int ql_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size);
98 extern int ql_wr_flash_buffer(qla_host_t *ha, uint32_t off, uint32_t size,
99 		void *buf);
100 extern int ql_stop_sequence(qla_host_t *ha);
101 extern int ql_start_sequence(qla_host_t *ha, uint16_t index);
102 
103 /*
104  * from ql_ioctl.c
105  */
106 extern int ql_make_cdev(qla_host_t *ha);
107 extern void ql_del_cdev(qla_host_t *ha);
108 
109 extern unsigned char ql83xx_firmware[];
110 extern unsigned int ql83xx_firmware_len;
111 extern unsigned char ql83xx_bootloader[];
112 extern unsigned int ql83xx_bootloader_len;
113 extern unsigned char ql83xx_resetseq[];
114 extern unsigned int ql83xx_resetseq_len;
115 extern unsigned char ql83xx_minidump[];
116 extern unsigned int ql83xx_minidump_len;
117 
118 extern void ql_alloc_drvr_state_buffer(qla_host_t *ha);
119 extern void ql_free_drvr_state_buffer(qla_host_t *ha);
120 extern void ql_capture_drvr_state(qla_host_t *ha);
121 extern void ql_sp_log(qla_host_t *ha, uint16_t fmtstr_idx, uint16_t num_params,
122 		uint32_t param0, uint32_t param1, uint32_t param2,
123 		uint32_t param3, uint32_t param4);
124 extern void ql_alloc_sp_log_buffer(qla_host_t *ha);
125 extern void ql_free_sp_log_buffer(qla_host_t *ha);
126 
127 #endif /* #ifndef_QL_GLBL_H_ */
128