1250661Sdavidcs/*
2284741Sdavidcs * Copyright (c) 2013-2016 Qlogic Corporation
3250661Sdavidcs * All rights reserved.
4250661Sdavidcs *
5250661Sdavidcs *  Redistribution and use in source and binary forms, with or without
6250661Sdavidcs *  modification, are permitted provided that the following conditions
7250661Sdavidcs *  are met:
8250661Sdavidcs *
9250661Sdavidcs *  1. Redistributions of source code must retain the above copyright
10250661Sdavidcs *     notice, this list of conditions and the following disclaimer.
11250661Sdavidcs *  2. Redistributions in binary form must reproduce the above copyright
12250661Sdavidcs *     notice, this list of conditions and the following disclaimer in the
13250661Sdavidcs *     documentation and/or other materials provided with the distribution.
14250661Sdavidcs *
15250661Sdavidcs *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
16250661Sdavidcs *  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17250661Sdavidcs *  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18250661Sdavidcs *  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
19250661Sdavidcs *  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
20250661Sdavidcs *  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
21250661Sdavidcs *  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
22250661Sdavidcs *  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
23250661Sdavidcs *  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
24250661Sdavidcs *  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25250661Sdavidcs *  POSSIBILITY OF SUCH DAMAGE.
26250661Sdavidcs *
27250661Sdavidcs * $FreeBSD: releng/11.0/sys/dev/qlxgbe/ql_glbl.h 284741 2015-06-23 22:22:36Z davidcs $
28250661Sdavidcs */
29250661Sdavidcs/*
30250661Sdavidcs * File: ql_glbl.h
31250661Sdavidcs * Author : David C Somayajulu, Qlogic Corporation, Aliso Viejo, CA 92656.
32250661Sdavidcs * Content: Contains prototypes of the exported functions from each file.
33250661Sdavidcs */
34250661Sdavidcs#ifndef _QL_GLBL_H_
35250661Sdavidcs#define _QL_GLBL_H_
36250661Sdavidcs
37250661Sdavidcs/*
38250661Sdavidcs * from ql_isr.c
39250661Sdavidcs */
40250661Sdavidcsextern void ql_mbx_isr(void *arg);
41250661Sdavidcsextern void ql_isr(void *arg);
42250661Sdavidcs
43250661Sdavidcs/*
44250661Sdavidcs * from ql_os.c
45250661Sdavidcs */
46250661Sdavidcsextern int ql_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
47250661Sdavidcsextern void ql_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
48250661Sdavidcsextern int ql_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp);
49250661Sdavidcs
50250661Sdavidcs/*
51250661Sdavidcs * from ql_hw.c
52250661Sdavidcs */
53250661Sdavidcsextern int ql_alloc_dma(qla_host_t *ha);
54250661Sdavidcsextern void ql_free_dma(qla_host_t *ha);
55250661Sdavidcsextern void ql_hw_add_sysctls(qla_host_t *ha);
56250661Sdavidcsextern int ql_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
57284741Sdavidcs                uint32_t tx_idx, struct mbuf *mp, uint32_t txr_idx,
58284741Sdavidcs		uint32_t iscsi_pdu);
59284741Sdavidcsextern void qla_confirm_9kb_enable(qla_host_t *ha);
60250661Sdavidcsextern int ql_init_hw_if(qla_host_t *ha);
61250661Sdavidcsextern int ql_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt,
62250661Sdavidcs		uint32_t add_multi);
63250661Sdavidcsextern void ql_del_hw_if(qla_host_t *ha);
64250661Sdavidcsextern int ql_set_promisc(qla_host_t *ha);
65284741Sdavidcsextern void qla_reset_promisc(qla_host_t *ha);
66250661Sdavidcsextern int ql_set_allmulti(qla_host_t *ha);
67284741Sdavidcsextern void qla_reset_allmulti(qla_host_t *ha);
68250661Sdavidcsextern void ql_update_link_state(qla_host_t *ha);
69250661Sdavidcsextern void ql_hw_tx_done(qla_host_t *ha);
70250661Sdavidcsextern int ql_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id);
71250661Sdavidcsextern void ql_hw_stop_rcv(qla_host_t *ha);
72250661Sdavidcsextern void ql_get_stats(qla_host_t *ha);
73250661Sdavidcsextern void ql_hw_link_status(qla_host_t *ha);
74250661Sdavidcsextern int ql_hw_check_health(qla_host_t *ha);
75284741Sdavidcsextern void qla_hw_async_event(qla_host_t *ha);
76284741Sdavidcsextern int qla_get_nic_partition(qla_host_t *ha, uint32_t *supports_9kb,
77284741Sdavidcs		uint32_t *num_rcvq);
78284741Sdavidcs
79284741Sdavidcsextern int qla_iscsi_pdu(qla_host_t *ha, struct mbuf *mp);
80284741Sdavidcs
81250661Sdavidcsextern void ql_minidump(qla_host_t *ha);
82250661Sdavidcs
83250661Sdavidcs/*
84250661Sdavidcs * from ql_misc.c
85250661Sdavidcs */
86250661Sdavidcsextern int ql_init_hw(qla_host_t *ha);
87250661Sdavidcsextern int ql_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val,
88250661Sdavidcs		uint32_t rd);
89250661Sdavidcsextern int ql_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data);
90250661Sdavidcsextern int ql_rdwr_offchip_mem(qla_host_t *ha, uint64_t addr,
91250661Sdavidcs		q80_offchip_mem_val_t *val, uint32_t rd);
92250661Sdavidcsextern void ql_read_mac_addr(qla_host_t *ha);
93250661Sdavidcsextern int ql_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size);
94250661Sdavidcsextern int ql_wr_flash_buffer(qla_host_t *ha, uint32_t off, uint32_t size,
95250661Sdavidcs		void *buf);
96250661Sdavidcsextern int ql_stop_sequence(qla_host_t *ha);
97250661Sdavidcsextern int ql_start_sequence(qla_host_t *ha, uint16_t index);
98250661Sdavidcs
99250661Sdavidcs/*
100250661Sdavidcs * from ql_ioctl.c
101250661Sdavidcs */
102250661Sdavidcsextern int ql_make_cdev(qla_host_t *ha);
103250661Sdavidcsextern void ql_del_cdev(qla_host_t *ha);
104250661Sdavidcs
105284741Sdavidcsextern unsigned char ql83xx_firmware[];
106284741Sdavidcsextern unsigned int ql83xx_firmware_len;
107284741Sdavidcsextern unsigned char ql83xx_bootloader[];
108284741Sdavidcsextern unsigned int ql83xx_bootloader_len;
109284741Sdavidcsextern unsigned char ql83xx_resetseq[];
110284741Sdavidcsextern unsigned int ql83xx_resetseq_len;
111284741Sdavidcsextern unsigned char ql83xx_minidump[];
112284741Sdavidcsextern unsigned int ql83xx_minidump_len;
113284741Sdavidcs
114250661Sdavidcs#endif /* #ifndef_QL_GLBL_H_ */
115