xref: /illumos-gate/usr/src/uts/common/io/iprb/iprb.h (revision 0529d5c6)
182743679SGarrett D'Amore /*
282743679SGarrett D'Amore  * This file and its contents are supplied under the terms of the
382743679SGarrett D'Amore  * Common Development and Distribution License ("CDDL"), version 1.0.
482743679SGarrett D'Amore  * You may only use this file in accordance with the terms of version
582743679SGarrett D'Amore  * 1.0 of the CDDL.
682743679SGarrett D'Amore  *
782743679SGarrett D'Amore  * A full copy of the text of the CDDL should have accompanied this
882743679SGarrett D'Amore  * source.  A copy of the CDDL is also available via the Internet at
982743679SGarrett D'Amore  * http://www.illumos.org/license/CDDL.
1082743679SGarrett D'Amore  */
1182743679SGarrett D'Amore 
1282743679SGarrett D'Amore /*
13*0529d5c6SJosef 'Jeff' Sipek  * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
1482743679SGarrett D'Amore  */
1582743679SGarrett D'Amore 
1682743679SGarrett D'Amore #ifndef _IPRB_H
1782743679SGarrett D'Amore #define	_IPRB_H
1882743679SGarrett D'Amore 
1982743679SGarrett D'Amore /*
2082743679SGarrett D'Amore  * iprb - Intel Pro/100B Ethernet Driver
2182743679SGarrett D'Amore  */
2282743679SGarrett D'Amore 
2382743679SGarrett D'Amore /*
2482743679SGarrett D'Amore  * Tunables.
2582743679SGarrett D'Amore  */
2682743679SGarrett D'Amore #define	NUM_TX		128	/* outstanding tx queue */
2782743679SGarrett D'Amore #define	NUM_RX		128	/* outstanding rx queue */
2882743679SGarrett D'Amore 
29*0529d5c6SJosef 'Jeff' Sipek /* timeouts for the rx and tx watchdogs (nsec) */
30*0529d5c6SJosef 'Jeff' Sipek #define	RX_WATCHDOG	(15 * NANOSEC)
31*0529d5c6SJosef 'Jeff' Sipek #define	TX_WATCHDOG	(15 * NANOSEC)
3282743679SGarrett D'Amore 
3382743679SGarrett D'Amore /*
3482743679SGarrett D'Amore  * Driver structures.
3582743679SGarrett D'Amore  */
3682743679SGarrett D'Amore typedef struct {
3782743679SGarrett D'Amore 	ddi_acc_handle_t	acch;
3882743679SGarrett D'Amore 	ddi_dma_handle_t	dmah;
3982743679SGarrett D'Amore 	caddr_t			vaddr;
4082743679SGarrett D'Amore 	uint32_t		paddr;
4182743679SGarrett D'Amore } iprb_dma_t;
4282743679SGarrett D'Amore 
4382743679SGarrett D'Amore typedef struct iprb_mcast {
4482743679SGarrett D'Amore 	list_node_t		node;
4582743679SGarrett D'Amore 	uint8_t			addr[6];
4682743679SGarrett D'Amore } iprb_mcast_t;
4782743679SGarrett D'Amore 
4882743679SGarrett D'Amore typedef struct iprb {
4982743679SGarrett D'Amore 	dev_info_t		*dip;
5082743679SGarrett D'Amore 	ddi_acc_handle_t	pcih;
5182743679SGarrett D'Amore 	ddi_acc_handle_t	regsh;
5282743679SGarrett D'Amore 	caddr_t			regs;
5382743679SGarrett D'Amore 
5482743679SGarrett D'Amore 	uint16_t		devid;
5582743679SGarrett D'Amore 	uint8_t			revid;
5682743679SGarrett D'Amore 
5782743679SGarrett D'Amore 	mac_handle_t		mach;
5882743679SGarrett D'Amore 	mii_handle_t		miih;
5982743679SGarrett D'Amore 
6082743679SGarrett D'Amore 	ddi_intr_handle_t	intrh;
6182743679SGarrett D'Amore 
6282743679SGarrett D'Amore 	ddi_periodic_t		perh;
6382743679SGarrett D'Amore 
6482743679SGarrett D'Amore 	kmutex_t		culock;
6582743679SGarrett D'Amore 	kmutex_t		rulock;
6682743679SGarrett D'Amore 
6782743679SGarrett D'Amore 	uint8_t			factaddr[6];
6882743679SGarrett D'Amore 	uint8_t			curraddr[6];
6982743679SGarrett D'Amore 
7082743679SGarrett D'Amore 	int			nmcast;
7182743679SGarrett D'Amore 	list_t			mcast;
7282743679SGarrett D'Amore 	boolean_t		promisc;
7382743679SGarrett D'Amore 	iprb_dma_t		cmds[NUM_TX];
7482743679SGarrett D'Amore 	iprb_dma_t		rxb[NUM_RX];
7582743679SGarrett D'Amore 	iprb_dma_t		stats;
76*0529d5c6SJosef 'Jeff' Sipek 	hrtime_t		stats_time;
7782743679SGarrett D'Amore 
7882743679SGarrett D'Amore 	uint16_t		cmd_head;
7982743679SGarrett D'Amore 	uint16_t		cmd_last;
8082743679SGarrett D'Amore 	uint16_t		cmd_tail;
8182743679SGarrett D'Amore 	uint16_t		cmd_count;
8282743679SGarrett D'Amore 
8382743679SGarrett D'Amore 	uint16_t		rx_index;
8482743679SGarrett D'Amore 	uint16_t		rx_last;
85*0529d5c6SJosef 'Jeff' Sipek 	hrtime_t		rx_wdog;
86*0529d5c6SJosef 'Jeff' Sipek 	hrtime_t		rx_timeout;
87*0529d5c6SJosef 'Jeff' Sipek 	hrtime_t		tx_wdog;
88*0529d5c6SJosef 'Jeff' Sipek 	hrtime_t		tx_timeout;
8982743679SGarrett D'Amore 
9082743679SGarrett D'Amore 	uint16_t		eeprom_bits;
9182743679SGarrett D'Amore 
9282743679SGarrett D'Amore 	boolean_t		running;
9382743679SGarrett D'Amore 	boolean_t		suspended;
9482743679SGarrett D'Amore 	boolean_t		wantw;
9582743679SGarrett D'Amore 	boolean_t		rxhangbug;
9682743679SGarrett D'Amore 	boolean_t		resumebug;
9782743679SGarrett D'Amore 	boolean_t		is557;
9882743679SGarrett D'Amore 	boolean_t		canpause;
9982743679SGarrett D'Amore 	boolean_t		canmwi;
10082743679SGarrett D'Amore 
10182743679SGarrett D'Amore 	/*
10282743679SGarrett D'Amore 	 * Statistics
10382743679SGarrett D'Amore 	 */
10482743679SGarrett D'Amore 	uint64_t		ipackets;
10582743679SGarrett D'Amore 	uint64_t		rbytes;
10682743679SGarrett D'Amore 	uint64_t		multircv;
10782743679SGarrett D'Amore 	uint64_t		brdcstrcv;
10882743679SGarrett D'Amore 	uint64_t		opackets;
10982743679SGarrett D'Amore 	uint64_t		obytes;
11082743679SGarrett D'Amore 	uint64_t		multixmt;
11182743679SGarrett D'Amore 	uint64_t		brdcstxmt;
11282743679SGarrett D'Amore 	uint64_t		ex_coll;
11382743679SGarrett D'Amore 	uint64_t		late_coll;
11482743679SGarrett D'Amore 	uint64_t		uflo;
11582743679SGarrett D'Amore 	uint64_t		defer_xmt;
11682743679SGarrett D'Amore 	uint64_t		one_coll;
11782743679SGarrett D'Amore 	uint64_t		multi_coll;
11882743679SGarrett D'Amore 	uint64_t		collisions;
11982743679SGarrett D'Amore 	uint64_t		fcs_errs;
12082743679SGarrett D'Amore 	uint64_t		align_errs;
12182743679SGarrett D'Amore 	uint64_t		norcvbuf;
12282743679SGarrett D'Amore 	uint64_t		oflo;
12382743679SGarrett D'Amore 	uint64_t		runt;
12482743679SGarrett D'Amore 	uint64_t		nocarrier;
12582743679SGarrett D'Amore 	uint64_t		toolong;
12682743679SGarrett D'Amore 	uint64_t		macxmt_errs;
12782743679SGarrett D'Amore 	uint64_t		macrcv_errs;
12882743679SGarrett D'Amore } iprb_t;
12982743679SGarrett D'Amore 
13082743679SGarrett D'Amore /*
13182743679SGarrett D'Amore  * Idenfication values.
13282743679SGarrett D'Amore  */
13382743679SGarrett D'Amore #define	REV_82557	1
13482743679SGarrett D'Amore #define	REV_82558_A4	4
13582743679SGarrett D'Amore #define	REV_82558_B0	5
13682743679SGarrett D'Amore #define	REV_82559_A0	8
13782743679SGarrett D'Amore #define	REV_82559S_A	9
13882743679SGarrett D'Amore #define	REV_82550	12
13982743679SGarrett D'Amore #define	REV_82550_C	13
14082743679SGarrett D'Amore #define	REV_82551_E	14
14182743679SGarrett D'Amore #define	REV_82551_F	15
14282743679SGarrett D'Amore #define	REV_82551_10	16
14382743679SGarrett D'Amore 
14482743679SGarrett D'Amore /*
14582743679SGarrett D'Amore  * Device registers.
14682743679SGarrett D'Amore  */
14782743679SGarrett D'Amore #define	CSR_STATE	0x00
14882743679SGarrett D'Amore #define	CSR_STS		0x01
14982743679SGarrett D'Amore #define	CSR_CMD		0x02
15082743679SGarrett D'Amore #define	CSR_INTCTL	0x03
15182743679SGarrett D'Amore #define	CSR_GEN_PTR	0x04
15282743679SGarrett D'Amore #define	CSR_PORT	0x08
15382743679SGarrett D'Amore #define	CSR_EECTL	0x0e
15482743679SGarrett D'Amore #define	CSR_MDICTL	0x10
15582743679SGarrett D'Amore 
15682743679SGarrett D'Amore #define	STATE_CUS	0xc0	/* CU state (mask) */
15782743679SGarrett D'Amore #define	STATE_CUS_IDLE	0x00	/* CU idle */
15882743679SGarrett D'Amore #define	STATE_CUS_SUSP	0x40	/* CU suspended */
15982743679SGarrett D'Amore #define	STATE_CUS_LPQA	0x80	/* LPQ active */
16082743679SGarrett D'Amore #define	STATE_CUS_HQPA	0xc0	/* HQP active */
16182743679SGarrett D'Amore #define	STATE_RUS	0x3c	/* RU state (mask) */
16282743679SGarrett D'Amore #define	STATE_RUS_IDLE	0x00	/* RU idle */
16382743679SGarrett D'Amore #define	STATE_RUS_SUSP	0x04	/* RU suspended */
16482743679SGarrett D'Amore #define	STATE_RUS_NORES	0x08	/* RU no resources */
16582743679SGarrett D'Amore #define	STATE_RUS_READY	0x10	/* RU ready */
16682743679SGarrett D'Amore 
16782743679SGarrett D'Amore #define	STS_FCP		0x01	/* flow control pause */
16882743679SGarrett D'Amore #define	STS_RSVD	0x02	/* reserved bit */
16982743679SGarrett D'Amore #define	STS_SWI		0x04	/* software interrupt */
17082743679SGarrett D'Amore #define	STS_MDI		0x08	/* MDI read/write done */
17182743679SGarrett D'Amore #define	STS_RNR		0x10	/* RU not ready */
17282743679SGarrett D'Amore #define	STS_CNA		0x20	/* CU state change */
17382743679SGarrett D'Amore #define	STS_FR		0x40	/* frame receive */
17482743679SGarrett D'Amore #define	STS_CX		0x80	/* cmd exec done */
17582743679SGarrett D'Amore 
17682743679SGarrett D'Amore #define	CMD_CUC		0xf0	/* CU command (mask) */
17782743679SGarrett D'Amore #define	CUC_NOP		0x00	/* no operation */
17882743679SGarrett D'Amore #define	CUC_START	0x10	/* start CU */
17982743679SGarrett D'Amore #define	CUC_RESUME	0x20	/* resume CU */
18082743679SGarrett D'Amore #define	CUC_STATSBASE	0x40	/* load statistics address */
18182743679SGarrett D'Amore #define	CUC_STATS	0x50	/* dump statistics */
18282743679SGarrett D'Amore #define	CUC_CUBASE	0x60	/* load CU base address */
18382743679SGarrett D'Amore #define	CUC_STATS_RST	0x70	/* dump statistics and reset */
18482743679SGarrett D'Amore #define	CUC_SRES	0xa0	/* static resume CU */
18582743679SGarrett D'Amore #define	CMD_RUC		0x07	/* RU command (mask) */
18682743679SGarrett D'Amore #define	RUC_NOP		0x00	/* no operation */
18782743679SGarrett D'Amore #define	RUC_START	0x01	/* start RU */
18882743679SGarrett D'Amore #define	RUC_RESUME	0x02	/* resume RU */
18982743679SGarrett D'Amore #define	RUC_DMAREDIR	0x03	/* receive DMA redirect */
19082743679SGarrett D'Amore #define	RUC_ABORT	0x40	/* abort RU */
19182743679SGarrett D'Amore #define	RUC_HDRSZ	0x50	/* load header data size */
19282743679SGarrett D'Amore #define	RUC_RUBASE	0x60	/* load RU base address */
19382743679SGarrett D'Amore 
19482743679SGarrett D'Amore #define	INTCTL_MASK	0x01	/* disable all interrupts */
19582743679SGarrett D'Amore #define	INTCTL_SI	0x02	/* generate software interrupt */
19682743679SGarrett D'Amore #define	INTCTL_FCP	0x04	/* flow control pause */
19782743679SGarrett D'Amore #define	INTCTL_ER	0x08	/* early receive */
19882743679SGarrett D'Amore #define	INTCTL_RNR	0x10	/* RU not ready */
19982743679SGarrett D'Amore #define	INTCTL_CNA	0x20	/* CU state change */
20082743679SGarrett D'Amore #define	INTCTL_FR	0x40	/* frame receive */
20182743679SGarrett D'Amore #define	INTCTL_CX	0x80	/* cmd exec done */
20282743679SGarrett D'Amore 
20382743679SGarrett D'Amore #define	PORT_SW_RESET	0x00
20482743679SGarrett D'Amore #define	PORT_SELF_TEST	0x01
20582743679SGarrett D'Amore #define	PORT_SEL_RESET	0x02
20682743679SGarrett D'Amore 
20782743679SGarrett D'Amore #define	EEPROM_EEDO	0x0008	/* data out */
20882743679SGarrett D'Amore #define	EEPROM_EEDI	0x0004	/* data in */
20982743679SGarrett D'Amore #define	EEPROM_EECS	0x0002	/* chip select */
21082743679SGarrett D'Amore #define	EEPROM_EESK	0x0001	/* clock */
21182743679SGarrett D'Amore 
21282743679SGarrett D'Amore #define	EEPROM_OP_RD	0x06
21382743679SGarrett D'Amore #define	EEPROM_OP_WR	0x05
21482743679SGarrett D'Amore #define	EEPROM_OP_WE	0x13	/* write enable */
21582743679SGarrett D'Amore #define	EEPROM_OP_WD	0x13	/* write disable */
21682743679SGarrett D'Amore 
21782743679SGarrett D'Amore #define	MDI_IE		0x20000000	/* interrupt enable */
21882743679SGarrett D'Amore #define	MDI_R		0x10000000	/* ready */
21982743679SGarrett D'Amore #define	MDI_OP_RD	0x08000000	/* read */
22082743679SGarrett D'Amore #define	MDI_OP_WR	0x04000000	/* write */
22182743679SGarrett D'Amore #define	MDI_PHYAD_SHIFT	21
22282743679SGarrett D'Amore #define	MDI_REGAD_SHIFT	16
22382743679SGarrett D'Amore 
22482743679SGarrett D'Amore #define	GET8(ip, offset)					\
22582743679SGarrett D'Amore 	ddi_get8(ip->regsh, (void *)(ip->regs + (offset)))
22682743679SGarrett D'Amore #define	GET16(ip, offset)					\
22782743679SGarrett D'Amore 	ddi_get16(ip->regsh, (void *)(ip->regs + (offset)))
22882743679SGarrett D'Amore #define	GET32(ip, offset)					\
22982743679SGarrett D'Amore 	ddi_get32(ip->regsh, (void *)(ip->regs + (offset)))
23082743679SGarrett D'Amore #define	PUT8(ip, offset, val)						\
23182743679SGarrett D'Amore 	ddi_put8(ip->regsh, (void *)(ip->regs + (offset)), (val))
23282743679SGarrett D'Amore #define	PUT16(ip, offset, val)						\
23382743679SGarrett D'Amore 	ddi_put16(ip->regsh, (void *)(ip->regs + (offset)), (val))
23482743679SGarrett D'Amore #define	PUT32(ip, offset, val)						\
23582743679SGarrett D'Amore 	ddi_put32(ip->regsh, (void *)(ip->regs + (offset)), (val))
23682743679SGarrett D'Amore 
23782743679SGarrett D'Amore 
23882743679SGarrett D'Amore #define	PUTDMA8(d, off, val)					\
23982743679SGarrett D'Amore 	ddi_put8(d->acch, (void *)(d->vaddr + (off)), LE_8(val))
24082743679SGarrett D'Amore #define	PUTDMA16(d, off, val)						\
24182743679SGarrett D'Amore 	ddi_put16(d->acch, (void *)(d->vaddr + (off)), LE_16(val))
24282743679SGarrett D'Amore #define	PUTDMA32(d, off, val)						\
24382743679SGarrett D'Amore 	ddi_put32(d->acch, (void *)(d->vaddr + (off)), LE_32(val))
24482743679SGarrett D'Amore #define	GETDMA8(d, off)						\
24582743679SGarrett D'Amore 	LE_8(ddi_get8(d->acch, (void *)(d->vaddr + (off))))
24682743679SGarrett D'Amore #define	GETDMA16(d, off)					\
24782743679SGarrett D'Amore 	LE_16(ddi_get16(d->acch, (void *)(d->vaddr + (off))))
24882743679SGarrett D'Amore #define	GETDMA32(d, off)					\
24982743679SGarrett D'Amore 	LE_32(ddi_get32(d->acch, (void *)(d->vaddr + (off))))
25082743679SGarrett D'Amore #define	SYNCDMA(d, off, size, dir)			\
25182743679SGarrett D'Amore 	(void) ddi_dma_sync(d->dmah, off, size, dir)
25282743679SGarrett D'Amore 
25382743679SGarrett D'Amore /*
25482743679SGarrett D'Amore  * Command block offsets.
25582743679SGarrett D'Amore  */
25682743679SGarrett D'Amore #define	CB_STS_OFFSET		0
25782743679SGarrett D'Amore #define	CB_CMD_OFFSET		2
25882743679SGarrett D'Amore #define	CB_LNK_OFFSET		4
25982743679SGarrett D'Amore #define	CB_SIZE			2048	/* size of cmd blk */
26082743679SGarrett D'Amore 
26182743679SGarrett D'Amore #define	CB_IAS_ADR_OFFSET	8
26282743679SGarrett D'Amore 
26382743679SGarrett D'Amore #define	CB_MCS_CNT_OFFSET	8
26482743679SGarrett D'Amore #define	CB_MCS_ADR_OFFSET	10
26582743679SGarrett D'Amore #define	CB_MCS_CNT_MAX		((CB_SIZE - CB_MCS_ADR_OFFSET) / 6)
26682743679SGarrett D'Amore 
26782743679SGarrett D'Amore #define	CB_UCODE_OFFSET		8
26882743679SGarrett D'Amore 
26982743679SGarrett D'Amore #define	CB_CONFIG_OFFSET	8
27082743679SGarrett D'Amore 
27182743679SGarrett D'Amore #define	CB_TX_TBD_OFFSET	8
27282743679SGarrett D'Amore #define	CB_TX_COUNT_OFFSET	12
27382743679SGarrett D'Amore #define	CB_TX_EOF		0x8000
27482743679SGarrett D'Amore #define	CB_TX_THRESH_OFFSET	14
27582743679SGarrett D'Amore #define	CB_TX_NUMBER_OFFSET	15
27682743679SGarrett D'Amore #define	CB_TX_DATA_OFFSET	16
27782743679SGarrett D'Amore 
27882743679SGarrett D'Amore #define	PUTCB8(cb, o, v)	PUTDMA8(cb, o, v)
27982743679SGarrett D'Amore #define	PUTCB16(cb, o, v)	PUTDMA16(cb, o, v)
28082743679SGarrett D'Amore #define	PUTCB32(cb, o, v)	PUTDMA32(cb, o, v)
28182743679SGarrett D'Amore #define	PUTCBEA(cb, o, enet)						\
28282743679SGarrett D'Amore 	ddi_rep_put8(cb->acch, enet, (void *)(cb->vaddr + (o)), 6,	\
28382743679SGarrett D'Amore 	DDI_DEV_AUTOINCR);
28482743679SGarrett D'Amore #define	GETCB8(cb, o)		GETDMA8(cb, o)
28582743679SGarrett D'Amore #define	GETCB16(cb, o)		GETDMA16(cb, o)
28682743679SGarrett D'Amore #define	GETCB32(cb, o)		GETDMA32(cb, o)
28782743679SGarrett D'Amore #define	SYNCCB(cb, o, s, dir)	SYNCDMA(cb, o, s, dir)
28882743679SGarrett D'Amore /*
28982743679SGarrett D'Amore  * CB status bits.
29082743679SGarrett D'Amore  */
29182743679SGarrett D'Amore #define	CB_STS_OK		0x2000
29282743679SGarrett D'Amore #define	CB_STS_C		0x8000
29382743679SGarrett D'Amore 
29482743679SGarrett D'Amore /*
29582743679SGarrett D'Amore  * Commands.
29682743679SGarrett D'Amore  */
29782743679SGarrett D'Amore #define	CB_CMD_NOP		0x0
29882743679SGarrett D'Amore #define	CB_CMD_IAS		0x1
29982743679SGarrett D'Amore #define	CB_CMD_CONFIG		0x2
30082743679SGarrett D'Amore #define	CB_CMD_MCS		0x3
30182743679SGarrett D'Amore #define	CB_CMD_TX		0x4
30282743679SGarrett D'Amore #define	CB_CMD_UCODE		0x5
30382743679SGarrett D'Amore /* and flags to go with */
30482743679SGarrett D'Amore #define	CB_CMD_SF		0x0008	/* simple/flex */
30582743679SGarrett D'Amore #define	CB_CMD_I		0x2000	/* generate an interrupt */
30682743679SGarrett D'Amore #define	CB_CMD_S		0x4000	/* suspend on completion */
30782743679SGarrett D'Amore #define	CB_CMD_EL		0x8000	/* end of list */
30882743679SGarrett D'Amore 
30982743679SGarrett D'Amore /*
31082743679SGarrett D'Amore  * RFD offsets.
31182743679SGarrett D'Amore  */
31282743679SGarrett D'Amore #define	GETRFD16(r, o)		GETDMA16(r, o)
31382743679SGarrett D'Amore #define	PUTRFD16(r, o, v)	PUTDMA16(r, o, v)
31482743679SGarrett D'Amore #define	PUTRFD32(r, o, v)	PUTDMA32(r, o, v)
31582743679SGarrett D'Amore #define	SYNCRFD(r, o, s, dir)	SYNCDMA(r, o, s, dir)
31682743679SGarrett D'Amore 
31782743679SGarrett D'Amore #define	RFD_STS_OFFSET		0x00
31882743679SGarrett D'Amore #define	RFD_CTL_OFFSET		0x02
31982743679SGarrett D'Amore #define	RFD_LNK_OFFSET		0x04
32082743679SGarrett D'Amore #define	RFD_CNT_OFFSET		0x0c	/* bytes received */
32182743679SGarrett D'Amore #define	RFD_SIZ_OFFSET		0x0e	/* size of packet area */
32282743679SGarrett D'Amore #define	RFD_PKT_OFFSET		0x10
32382743679SGarrett D'Amore #define	RFD_SIZE		2048
32482743679SGarrett D'Amore 
32582743679SGarrett D'Amore #define	RFD_CTL_EL		0x8000
32682743679SGarrett D'Amore #define	RFD_CTL_S		0x4000
32782743679SGarrett D'Amore #define	RFD_CTL_H		0x0010
32882743679SGarrett D'Amore #define	RFD_CTL_SF		0x0008
32982743679SGarrett D'Amore 
33082743679SGarrett D'Amore #define	RFD_STS_C		0x8000
33182743679SGarrett D'Amore #define	RFD_STS_OK		0x2000
33282743679SGarrett D'Amore #define	RFD_STS_FCS		0x0800
33382743679SGarrett D'Amore #define	RFD_STS_ALIGN		0x0400
33482743679SGarrett D'Amore #define	RFD_STS_TOOBIG		0x0200
33582743679SGarrett D'Amore #define	RFD_STS_DMAOFLO		0x0100
33682743679SGarrett D'Amore #define	RFD_STS_TOOSHORT	0x0080
33782743679SGarrett D'Amore #define	RFD_STS_802		0x0020
33882743679SGarrett D'Amore #define	RFD_STS_RXERR		0x0010
33982743679SGarrett D'Amore #define	RFD_STS_NOMATCH		0x0004
34082743679SGarrett D'Amore #define	RFD_STS_IAMATCH		0x0002
34182743679SGarrett D'Amore #define	RFD_STS_COLL_TCO	0x0001
34282743679SGarrett D'Amore #define	RFD_STS_ERRS		0x0d90
34382743679SGarrett D'Amore 
34482743679SGarrett D'Amore #define	RFD_CNT_EOF		0x8000
34582743679SGarrett D'Amore #define	RFD_CNT_F		0x4000
34682743679SGarrett D'Amore 
34782743679SGarrett D'Amore /*
34882743679SGarrett D'Amore  * Stats offsets.
34982743679SGarrett D'Amore  */
35082743679SGarrett D'Amore #define	STATS_TX_GOOD_OFFSET	0
35182743679SGarrett D'Amore #define	STATS_TX_MAXCOL_OFFSET	4
35282743679SGarrett D'Amore #define	STATS_TX_LATECOL_OFFSET	8
35382743679SGarrett D'Amore #define	STATS_TX_UFLO_OFFSET	16
35482743679SGarrett D'Amore #define	STATS_TX_DEFER_OFFSET	20
35582743679SGarrett D'Amore #define	STATS_TX_ONECOL_OFFSET	24
35682743679SGarrett D'Amore #define	STATS_TX_MULTCOL_OFFSET	28
35782743679SGarrett D'Amore #define	STATS_TX_TOTCOL_OFFSET	32
35882743679SGarrett D'Amore #define	STATS_RX_GOOD_OFFSET	36
35982743679SGarrett D'Amore #define	STATS_RX_FCS_OFFSET	40
36082743679SGarrett D'Amore #define	STATS_RX_ALIGN_OFFSET	44
36182743679SGarrett D'Amore #define	STATS_RX_NOBUF_OFFSET	48
36282743679SGarrett D'Amore #define	STATS_RX_OFLO_OFFSET	52
36382743679SGarrett D'Amore #define	STATS_RX_COL_OFFSET	56
36482743679SGarrett D'Amore #define	STATS_RX_SHORT_OFFSET	60
36582743679SGarrett D'Amore #define	STATS_DONE_OFFSET	64
36682743679SGarrett D'Amore #define	STATS_SIZE		68
36782743679SGarrett D'Amore #define	STATS_DONE		0xa005
36882743679SGarrett D'Amore #define	STATS_RST_DONE		0xa007
36982743679SGarrett D'Amore 
37082743679SGarrett D'Amore #define	SYNCSTATS(sp, o, s, dir)	SYNCDMA(sp, o, s, dir)
37182743679SGarrett D'Amore #define	PUTSTAT(sp, o, v)		PUTDMA32(sp, o, v)
37282743679SGarrett D'Amore #define	GETSTAT(sp, o)			GETDMA32(sp, o)
37382743679SGarrett D'Amore 
37482743679SGarrett D'Amore #endif /* _IPRB_H */
375