if_nfevar.h revision 1.5
1/*	$OpenBSD: if_nfevar.h,v 1.5 2006/01/22 21:35:08 damien Exp $	*/
2/*
3 * Copyright (c) 2005 Jonathan Gray <jsg@openbsd.org>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17
18#define NFE_IFQ_MAXLEN	64
19
20struct nfe_tx_data {
21	bus_dmamap_t	map;
22	bus_dmamap_t	active;
23	struct mbuf	*m;
24};
25
26struct nfe_tx_ring {
27	bus_dmamap_t		map;
28	bus_dma_segment_t	seg;
29	bus_addr_t		physaddr;
30	struct nfe_desc32	*desc32;
31	struct nfe_desc64	*desc64;
32	struct nfe_tx_data	data[NFE_TX_RING_COUNT];
33	int			queued;
34	int			cur;
35	int			next;
36};
37
38struct nfe_rx_data {
39	bus_dmamap_t	map;
40	struct mbuf	*m;
41};
42
43struct nfe_rx_ring {
44	bus_dmamap_t		map;
45	bus_dma_segment_t	seg;
46	bus_addr_t		physaddr;
47	struct nfe_desc32	*desc32;
48	struct nfe_desc64	*desc64;
49	struct nfe_rx_data	data[NFE_RX_RING_COUNT];
50	int			cur;
51	int			next;
52};
53
54struct nfe_softc {
55	struct device		sc_dev;
56	struct arpcom		sc_arpcom;
57	bus_space_handle_t	sc_memh;
58	bus_space_tag_t		sc_memt;
59	void			*sc_ih;
60	bus_dma_tag_t		sc_dmat;
61	struct mii_data		sc_mii;
62	struct timeout		sc_timeout;
63	void			*sc_powerhook;
64
65	u_int			sc_flags;
66#define NFE_JUMBO_SUP	0x01
67#define NFE_40BIT_ADDR	0x02
68#define NFE_HW_CSUM	0x04
69
70	uint8_t			phyaddr;
71
72	struct nfe_tx_ring	txq;
73	struct nfe_rx_ring	rxq;
74};
75