iprb.h revision 82743679557cf8b7a5dd51eaa0015e0ca498ac37
/*
* This file and its contents are supplied under the terms of the
* Common Development and Distribution License ("CDDL"), version 1.0.
* You may only use this file in accordance with the terms of version
* 1.0 of the CDDL.
*
* A full copy of the text of the CDDL should have accompanied this
* source. A copy of the CDDL is also available via the Internet at
*/
/*
* Copyright 2010 Nexenta Systems, Inc. All rights reserved.
*/
#ifndef _IPRB_H
#define _IPRB_H
/*
* iprb - Intel Pro/100B Ethernet Driver
*/
/*
* Tunables.
*/
/*
* Driver structures.
*/
typedef struct {
} iprb_dma_t;
typedef struct iprb_mcast {
} iprb_mcast_t;
typedef struct iprb {
int nmcast;
/*
* Statistics
*/
} iprb_t;
/*
* Idenfication values.
*/
#define REV_82557 1
#define REV_82558_A4 4
#define REV_82558_B0 5
#define REV_82559_A0 8
#define REV_82559S_A 9
#define REV_82550 12
#define REV_82550_C 13
#define REV_82551_E 14
#define REV_82551_F 15
#define REV_82551_10 16
/*
* Device registers.
*/
#define CSR_STATE 0x00
#define CSR_STS 0x01
#define CSR_CMD 0x02
#define CSR_INTCTL 0x03
#define CSR_GEN_PTR 0x04
#define CSR_PORT 0x08
#define CSR_EECTL 0x0e
#define CSR_MDICTL 0x10
#define PORT_SW_RESET 0x00
#define PORT_SELF_TEST 0x01
#define PORT_SEL_RESET 0x02
#define EEPROM_OP_RD 0x06
#define EEPROM_OP_WR 0x05
#define MDI_PHYAD_SHIFT 21
#define MDI_REGAD_SHIFT 16
/*
* Command block offsets.
*/
#define CB_STS_OFFSET 0
#define CB_CMD_OFFSET 2
#define CB_LNK_OFFSET 4
#define CB_IAS_ADR_OFFSET 8
#define CB_MCS_CNT_OFFSET 8
#define CB_MCS_ADR_OFFSET 10
#define CB_UCODE_OFFSET 8
#define CB_CONFIG_OFFSET 8
#define CB_TX_TBD_OFFSET 8
#define CB_TX_COUNT_OFFSET 12
#define CB_TX_EOF 0x8000
#define CB_TX_THRESH_OFFSET 14
#define CB_TX_NUMBER_OFFSET 15
#define CB_TX_DATA_OFFSET 16
/*
* CB status bits.
*/
#define CB_STS_OK 0x2000
#define CB_STS_C 0x8000
/*
* Commands.
*/
#define CB_CMD_NOP 0x0
#define CB_CMD_IAS 0x1
#define CB_CMD_CONFIG 0x2
#define CB_CMD_MCS 0x3
#define CB_CMD_TX 0x4
#define CB_CMD_UCODE 0x5
/* and flags to go with */
/*
* RFD offsets.
*/
#define RFD_STS_OFFSET 0x00
#define RFD_CTL_OFFSET 0x02
#define RFD_LNK_OFFSET 0x04
#define RFD_PKT_OFFSET 0x10
#define RFD_SIZE 2048
#define RFD_CTL_EL 0x8000
#define RFD_CTL_S 0x4000
#define RFD_CTL_H 0x0010
#define RFD_CTL_SF 0x0008
#define RFD_STS_C 0x8000
#define RFD_STS_OK 0x2000
#define RFD_STS_FCS 0x0800
#define RFD_STS_ALIGN 0x0400
#define RFD_STS_TOOBIG 0x0200
#define RFD_STS_DMAOFLO 0x0100
#define RFD_STS_TOOSHORT 0x0080
#define RFD_STS_802 0x0020
#define RFD_STS_RXERR 0x0010
#define RFD_STS_NOMATCH 0x0004
#define RFD_STS_IAMATCH 0x0002
#define RFD_STS_COLL_TCO 0x0001
#define RFD_STS_ERRS 0x0d90
#define RFD_CNT_EOF 0x8000
#define RFD_CNT_F 0x4000
/*
* Stats offsets.
*/
#define STATS_TX_GOOD_OFFSET 0
#define STATS_TX_MAXCOL_OFFSET 4
#define STATS_TX_LATECOL_OFFSET 8
#define STATS_TX_UFLO_OFFSET 16
#define STATS_TX_DEFER_OFFSET 20
#define STATS_TX_ONECOL_OFFSET 24
#define STATS_TX_MULTCOL_OFFSET 28
#define STATS_TX_TOTCOL_OFFSET 32
#define STATS_RX_GOOD_OFFSET 36
#define STATS_RX_FCS_OFFSET 40
#define STATS_RX_ALIGN_OFFSET 44
#define STATS_RX_NOBUF_OFFSET 48
#define STATS_RX_OFLO_OFFSET 52
#define STATS_RX_COL_OFFSET 56
#define STATS_RX_SHORT_OFFSET 60
#define STATS_DONE_OFFSET 64
#define STATS_SIZE 68
#define STATS_DONE 0xa005
#define STATS_RST_DONE 0xa007
#endif /* _IPRB_H */