xref: /NextBSD/sys/dev/netfpga10g/nf10bmac/if_nf10bmacreg.h (revision d7cd1d425cc1ea9451fa235e3af9b6625c3e0de2)
1 /*-
2  * Copyright (c) 2014 Bjoern A. Zeeb
3  * All rights reserved.
4  *
5  * This software was developed by SRI International and the University of
6  * Cambridge Computer Laboratory under DARPA/AFRL contract FA8750-11-C-0249
7  * ("MRC2"), as part of the DARPA MRC research programme.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28  * SUCH DAMAGE.
29  *
30  * $FreeBSD$
31  */
32 
33 #ifndef	_DEV_IF_NF10BMACREG_H
34 #define	_DEV_IF_NF10BMACREG_H
35 
36 struct nf10bmac_softc {
37 	struct ifnet		*nf10bmac_ifp;
38 	struct resource		*nf10bmac_ctrl_res;
39 	struct resource		*nf10bmac_tx_mem_res;
40 	struct resource		*nf10bmac_rx_mem_res;
41 	struct resource		*nf10bmac_intr_res;
42 	struct resource		*nf10bmac_rx_irq_res;
43 	void			*nf10bmac_rx_intrhand;
44 	uint8_t			*nf10bmac_tx_buf;
45 	device_t		nf10bmac_dev;
46 	int			nf10bmac_unit;
47 	int			nf10bmac_ctrl_rid;
48 	int			nf10bmac_tx_mem_rid;
49 	int			nf10bmac_rx_mem_rid;
50 	int			nf10bmac_intr_rid;
51 	int			nf10bmac_rx_irq_rid;
52 	int			nf10bmac_if_flags;
53 	uint32_t		nf10bmac_flags;
54 #define	NF10BMAC_FLAGS_LINK		0x00000001
55 	uint8_t			nf10bmac_eth_addr[ETHER_ADDR_LEN];
56 #ifdef ENABLE_WATCHDOG
57 	uint16_t		nf10bmac_watchdog_timer;
58 	struct callout		nf10bmac_tick;
59 #endif
60 	struct ifmedia		nf10bmac_media; /* to fake it. */
61 	struct mtx		nf10bmac_mtx;
62 };
63 
64 int	nf10bmac_attach(device_t);
65 int	nf10bmac_detach_dev(device_t);
66 void	nf10bmac_detach_resources(device_t);
67 
68 extern devclass_t nf10bmac_devclass;
69 
70 #endif /* _DEV_IF_NF10BMACREG_H */
71 
72 /* end */
73