qla_glbl.h revision 330897
1/*-
2 * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3 *
4 * Copyright (c) 2011-2013 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/qlxgb/qla_glbl.h 330897 2018-03-14 03:19:51Z eadler $
30 */
31/*
32 * File: qla_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 _QLA_GLBL_H_
37#define _QLA_GLBL_H_
38
39/*
40 * from qla_isr.c
41 */
42extern void qla_isr(void *arg);
43extern void qla_rcv(void *context, int pending);
44
45/*
46 * from qla_os.c
47 */
48extern uint32_t std_replenish;
49extern uint32_t jumbo_replenish;
50extern uint32_t rcv_pkt_thres;
51extern uint32_t rcv_pkt_thres_d;
52extern uint32_t snd_pkt_thres;
53extern uint32_t free_pkt_thres;
54
55extern int qla_alloc_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
56extern void qla_free_dmabuf(qla_host_t *ha, qla_dma_t *dma_buf);
57extern void qla_start(struct ifnet *ifp);
58extern int qla_get_mbuf(qla_host_t *ha, qla_rx_buf_t *rxb, struct mbuf *nmp,
59	        uint32_t jumbo);
60
61/*
62 * from qla_hw.c
63 */
64extern int qla_get_msix_count(qla_host_t *ha);
65extern int qla_alloc_dma(qla_host_t *ha);
66extern void qla_free_dma(qla_host_t *ha);
67extern void qla_hw_add_sysctls(qla_host_t *ha);
68extern int qla_hw_send(qla_host_t *ha, bus_dma_segment_t *segs, int nsegs,
69		uint32_t *tx_idx, struct mbuf *mp);
70extern int qla_init_hw_if(qla_host_t *ha);
71extern void qla_get_hw_caps(qla_host_t *ha);
72extern void qla_hw_set_multi(qla_host_t *ha, uint8_t *mta, uint32_t mcnt,
73	uint32_t add_multi);
74extern void qla_del_hw_if(qla_host_t *ha);
75extern void qla_set_promisc(qla_host_t *ha);
76extern void qla_set_allmulti(qla_host_t *ha);
77extern void qla_reset_promisc_allmulti(qla_host_t *ha);
78extern void qla_config_ipv4_addr(qla_host_t *ha, uint32_t ipv4_addr);
79extern int qla_hw_tx_compl(qla_host_t *ha);
80extern void qla_update_link_state(qla_host_t *ha);
81extern void qla_hw_tx_done(qla_host_t *ha);
82extern int qla_config_lro(qla_host_t *ha);
83extern void qla_free_lro(qla_host_t *ha);
84extern int qla_set_max_mtu(qla_host_t *ha, uint32_t mtu, uint16_t cntxt_id);
85extern void qla_hw_stop_rcv(qla_host_t *ha);
86
87/*
88 * from qla_misc.c
89 */
90extern int qla_init_hw(qla_host_t *ha);
91extern int qla_rdwr_indreg32(qla_host_t *ha, uint32_t addr, uint32_t *val,
92		uint32_t rd);
93extern int qla_rd_flash32(qla_host_t *ha, uint32_t addr, uint32_t *data);
94extern int qla_flash_rd32_words(qla_host_t *ha, uint32_t addr,
95		uint32_t *val, uint32_t num);
96extern int qla_flash_rd32(qla_host_t *ha, uint32_t addr, uint32_t *val);
97extern int qla_fw_update(qla_host_t *ha, void *fdata, uint32_t off,
98		uint32_t size);
99extern int qla_erase_flash(qla_host_t *ha, uint32_t off, uint32_t size);
100extern int qla_wr_flash_buffer(qla_host_t *ha, uint32_t off, uint32_t size,
101		void *buf, uint32_t pattern);
102
103/*
104 * from qla_ioctl.c
105 */
106extern int qla_make_cdev(qla_host_t *ha);
107extern void qla_del_cdev(qla_host_t *ha);
108extern int qla_eioctl(struct cdev *dev, u_long cmd, caddr_t data, int fflag,
109		struct thread *td);
110
111#endif /* #ifndef_QLA_GLBL_H_ */
112