Home | History | Annotate | Line # | Download | only in pci
if_nfevar.h revision 1.1.16.6
      1  1.1.16.6  yamt /*	$NetBSD: if_nfevar.h,v 1.1.16.6 2008/02/04 09:23:31 yamt Exp $	*/
      2  1.1.16.2  yamt /*	$OpenBSD: if_nfevar.h,v 1.11 2006/02/19 13:57:02 damien Exp $	*/
      3  1.1.16.2  yamt 
      4  1.1.16.2  yamt /*-
      5  1.1.16.2  yamt  * Copyright (c) 2005 Jonathan Gray <jsg (at) openbsd.org>
      6  1.1.16.2  yamt  *
      7  1.1.16.2  yamt  * Permission to use, copy, modify, and distribute this software for any
      8  1.1.16.2  yamt  * purpose with or without fee is hereby granted, provided that the above
      9  1.1.16.2  yamt  * copyright notice and this permission notice appear in all copies.
     10  1.1.16.2  yamt  *
     11  1.1.16.2  yamt  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     12  1.1.16.2  yamt  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     13  1.1.16.2  yamt  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     14  1.1.16.2  yamt  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     15  1.1.16.2  yamt  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     16  1.1.16.2  yamt  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     17  1.1.16.2  yamt  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     18  1.1.16.2  yamt  */
     19  1.1.16.2  yamt 
     20  1.1.16.2  yamt #define NFE_IFQ_MAXLEN	64
     21  1.1.16.2  yamt 
     22  1.1.16.2  yamt struct nfe_tx_data {
     23  1.1.16.2  yamt 	bus_dmamap_t	map;
     24  1.1.16.2  yamt 	bus_dmamap_t	active;
     25  1.1.16.2  yamt 	struct mbuf	*m;
     26  1.1.16.2  yamt };
     27  1.1.16.2  yamt 
     28  1.1.16.2  yamt struct nfe_tx_ring {
     29  1.1.16.2  yamt 	bus_dmamap_t		map;
     30  1.1.16.2  yamt 	bus_dma_segment_t	seg;
     31  1.1.16.2  yamt 	bus_addr_t		physaddr;
     32  1.1.16.2  yamt 	struct nfe_desc32	*desc32;
     33  1.1.16.2  yamt 	struct nfe_desc64	*desc64;
     34  1.1.16.2  yamt 	struct nfe_tx_data	data[NFE_TX_RING_COUNT];
     35  1.1.16.2  yamt 	int			queued;
     36  1.1.16.2  yamt 	int			cur;
     37  1.1.16.2  yamt 	int			next;
     38  1.1.16.2  yamt };
     39  1.1.16.2  yamt 
     40  1.1.16.2  yamt struct nfe_jbuf {
     41  1.1.16.3  yamt 	void *			buf;
     42  1.1.16.2  yamt 	bus_addr_t		physaddr;
     43  1.1.16.2  yamt 	SLIST_ENTRY(nfe_jbuf)	jnext;
     44  1.1.16.2  yamt };
     45  1.1.16.2  yamt 
     46  1.1.16.2  yamt struct nfe_rx_data {
     47  1.1.16.2  yamt 	bus_dmamap_t	map;
     48  1.1.16.2  yamt 	struct mbuf	*m;
     49  1.1.16.2  yamt };
     50  1.1.16.2  yamt 
     51  1.1.16.2  yamt struct nfe_rx_ring {
     52  1.1.16.2  yamt 	bus_dmamap_t		map;
     53  1.1.16.2  yamt 	bus_dma_segment_t	seg;
     54  1.1.16.2  yamt 	bus_dmamap_t		jmap;
     55  1.1.16.2  yamt 	bus_dma_segment_t	jseg;
     56  1.1.16.2  yamt 	bus_addr_t		physaddr;
     57  1.1.16.2  yamt 	struct nfe_desc32	*desc32;
     58  1.1.16.2  yamt 	struct nfe_desc64	*desc64;
     59  1.1.16.3  yamt 	void *			jpool;
     60  1.1.16.2  yamt 	struct nfe_rx_data	data[NFE_RX_RING_COUNT];
     61  1.1.16.2  yamt 	struct nfe_jbuf		jbuf[NFE_JPOOL_COUNT];
     62  1.1.16.4  yamt 	int			jbufmap[NFE_RX_RING_COUNT];
     63  1.1.16.2  yamt 	SLIST_HEAD(, nfe_jbuf)	jfreelist;
     64  1.1.16.2  yamt 	int			bufsz;
     65  1.1.16.2  yamt 	int			cur;
     66  1.1.16.2  yamt 	int			next;
     67  1.1.16.2  yamt };
     68  1.1.16.2  yamt 
     69  1.1.16.2  yamt struct nfe_softc {
     70  1.1.16.2  yamt 	struct device		sc_dev;
     71  1.1.16.2  yamt 	struct ethercom		sc_ethercom;
     72  1.1.16.2  yamt 	uint8_t			sc_enaddr[ETHER_ADDR_LEN];
     73  1.1.16.2  yamt 	bus_space_handle_t	sc_memh;
     74  1.1.16.2  yamt 	bus_space_tag_t		sc_memt;
     75  1.1.16.2  yamt 	void			*sc_ih;
     76  1.1.16.2  yamt 	bus_dma_tag_t		sc_dmat;
     77  1.1.16.2  yamt 	struct mii_data		sc_mii;
     78  1.1.16.2  yamt 	struct callout		sc_tick_ch;
     79  1.1.16.2  yamt 
     80  1.1.16.2  yamt 	int			sc_if_flags;
     81  1.1.16.2  yamt 	u_int			sc_flags;
     82  1.1.16.5  yamt #define NFE_JUMBO_SUP		0x01
     83  1.1.16.5  yamt #define NFE_40BIT_ADDR		0x02
     84  1.1.16.5  yamt #define NFE_HW_CSUM		0x04
     85  1.1.16.5  yamt #define NFE_HW_VLAN		0x08
     86  1.1.16.5  yamt #define NFE_USE_JUMBO		0x10
     87  1.1.16.5  yamt #define NFE_CORRECT_MACADDR	0x20
     88  1.1.16.6  yamt #define NFE_PWR_MGMT		0x40
     89  1.1.16.2  yamt 
     90  1.1.16.2  yamt 	uint32_t		rxtxctl;
     91  1.1.16.2  yamt 	uint8_t			mii_phyaddr;
     92  1.1.16.2  yamt 
     93  1.1.16.2  yamt 	struct nfe_tx_ring	txq;
     94  1.1.16.2  yamt 	struct nfe_rx_ring	rxq;
     95  1.1.16.2  yamt };
     96