xref: /freebsd/sys/dev/qlxgbe/ql_glbl.h (revision 39ee7a7a6bdd1557b1c3532abf60d139798ac88b)
1 /*
2  * Copyright (c) 2013-2016 Qlogic Corporation
3  * All rights reserved.
4  *
5  *  Redistribution and use in source and binary forms, with or without
6  *  modification, are permitted provided that the following conditions
7  *  are met:
8  *
9  *  1. Redistributions of source code must retain the above copyright
10  *     notice, this list of conditions and the following disclaimer.
11  *  2. Redistributions in binary form must reproduce the above copyright
12  *     notice, this list of conditions and the following disclaimer in the
13  *     documentation and/or other materials provided with the distribution.
14  *
15  *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16  *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19  *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20  *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21  *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22  *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23  *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24  *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25  *  POSSIBILITY OF SUCH DAMAGE.
26  *
27  * $FreeBSD$
28  */
29 /*
30  * File: ql_glbl.h
31  * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
32  * Content: Contains prototypes of the exported functions from each file.
33  */
34 #ifndef _QL_GLBL_H_
35 #define _QL_GLBL_H_
36 
37 /*
38  * from ql_isr.c
39  */
40 extern void ql_mbx_isr(void *arg);
41 extern void ql_isr(void *arg);
42 
43 /*
44  * from ql_os.c
45  */
46 extern int ql_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
47 extern void ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
48 extern int ql_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp);
49 
50 /*
51  * from ql_hw.c
52  */
53 extern int ql_alloc_dma(qla_host_t *ha);
54 extern void ql_free_dma(qla_host_t *ha);
55 extern void ql_hw_add_sysctls(qla_host_t *ha);
56 extern int ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
57                 uint32_t tx_idx, struct mbuf *mp, uint32_t txr_idx,
58 		uint32_t iscsi_pdu);
59 extern void qla_confirm_9kb_enable(qla_host_t *ha);
60 extern int ql_init_hw_if(qla_host_t *ha);
61 extern int ql_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt,
62 		uint32_t add_multi);
63 extern void ql_del_hw_if(qla_host_t *ha);
64 extern int ql_set_promisc(qla_host_t *ha);
65 extern void qla_reset_promisc(qla_host_t *ha);
66 extern int ql_set_allmulti(qla_host_t *ha);
67 extern void qla_reset_allmulti(qla_host_t *ha);
68 extern void ql_update_link_state(qla_host_t *ha);
69 extern void ql_hw_tx_done(qla_host_t *ha);
70 extern int ql_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id);
71 extern void ql_hw_stop_rcv(qla_host_t *ha);
72 extern void ql_get_stats(qla_host_t *ha);
73 extern void ql_hw_link_status(qla_host_t *ha);
74 extern int ql_hw_check_health(qla_host_t *ha);
75 extern void qla_hw_async_event(qla_host_t *ha);
76 extern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb,
77 		uint32_t *num_rcvq);
78 
79 extern int qla_iscsi_pdu(qla_host_t *ha, struct mbuf *mp);
80 
81 extern void ql_minidump(qla_host_t *ha);
82 
83 /*
84  * from ql_misc.c
85  */
86 extern int ql_init_hw(qla_host_t *ha);
87 extern int ql_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val,
88 		uint32_t rd);
89 extern int ql_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data);
90 extern int ql_rdwr_offchip_mem(qla_host_t *ha, uint64_t addr,
91 		q80_offchip_mem_val_t *val, uint32_t rd);
92 extern void ql_read_mac_addr(qla_host_t *ha);
93 extern int ql_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size);
94 extern int ql_wr_flash_buffer(qla_host_t *ha, uint32_t off, uint32_t size,
95 		void *buf);
96 extern int ql_stop_sequence(qla_host_t *ha);
97 extern int ql_start_sequence(qla_host_t *ha, uint16_t index);
98 
99 /*
100  * from ql_ioctl.c
101  */
102 extern int ql_make_cdev(qla_host_t *ha);
103 extern void ql_del_cdev(qla_host_t *ha);
104 
105 extern unsigned char ql83xx_firmware[];
106 extern unsigned int ql83xx_firmware_len;
107 extern unsigned char ql83xx_bootloader[];
108 extern unsigned int ql83xx_bootloader_len;
109 extern unsigned char ql83xx_resetseq[];
110 extern unsigned int ql83xx_resetseq_len;
111 extern unsigned char ql83xx_minidump[];
112 extern unsigned int ql83xx_minidump_len;
113 
114 #endif /* #ifndef_QL_GLBL_H_ */
115