vr.h revision 2ca5b6595b95478e6568b0e77c6c83c8a870867a
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _VR_H
#define _VR_H
#ifdef __cplusplus
extern "C" {
#endif
/*
* Number of descriptor entries for each ring. The no. of descriptors is bound
* to 4K per ring (256 entries a 16 bytes).
*/
#define VR_TX_N_DESC 128
#define VR_RX_N_DESC 256
/*
* The number of TX interrupts to "schedule" on the ring.
*/
#define VR_TX_INTRS_RING 3
/*
* The the periodic check interval of 2 seconds, in nano seconds
*/
/*
* The number of TX checks that must pass without progress before we decide
* to reset the adapter.
*/
#define VR_MAXTXCHECKS 12
/*
* All possible interrupts with the unwanted commented.
*/
#define VR_ICR0_CFG (VR_ICR0_RX_DONE | \
VR_ICR0_TX_DONE | \
VR_ICR0_RX_ERR | \
VR_ICR0_TX_ERR | \
VR_ICR0_BUSERR | \
/* VR_ICR0_STATSMAX | */ \
/* VR_ICR0_RX_EARLY | */ \
VR_ICR0_RX_NOBUF | \
VR_ICR0_TX_ABORT | \
#define VR_ICR1_CFG (/* VR_ICR1_TIMER0 | */ \
/* VR_ICR1_TIMER1 | */ \
/* VR_ICR1_PHYEVENT | */ \
/* VR_ICR1_TDERR | */ \
/* VR_ICR1_SSRCI | */ \
/* VR_ICR1_UINTR_SET| */ \
/* VR_ICR1_UINTR_CLR| */ \
/* VR_ICR1_PWEI */)
/*
* Our definitions of RX and TX errors.
*/
#define VR_ISR_TX_ERR_BITS (VR_ICR0_TX_ERR | \
#define VR_ISR_RX_ERR_BITS (VR_ICR0_RX_ERR | \
#define VR_ISR_SYS_ERR_BITS (VR_ICR0_BUSERR)
#define VR_ISR_ERR_BITS (VR_ISR_TX_ERR_BITS | \
#define VR_TX_MAX_INTR_DISTANCE \
#define VR_SLOPSZ 2
#define VR_DMABUFSZ (VR_MAX_PKTSZ)
#define VR_MMI_WAITINCR (10)
#define VR_MMI_WAITMAX (10000)
#define VR_CAM_SZ (32)
/*
* PCI identification for the Rhine's.
*/
#define VR_PCI_VIA_VENID 0x1106
#define VR_PCI_DEVID_RHINE 0x3043
#define VR_PCI_DEVID_RHINE_IIIM 0x3053
#define VR_PCI_DEVID_RHINE_II2 0x3065
#define VR_PCI_DEVID_RHINE_III 0x3106
#define VR_PCI_DEVID_RHINE_II 0x6100
#define VR_PCI_REVID_VT86C100A_E 0x04
#define VR_PCI_REVID_VT6102_A 0x40
#define VR_PCI_REVID_VT6102_C 0x42
#define VR_PCI_REVID_VT6105_A0 0x80
#define VR_PCI_REVID_VT6105_B0 0x83
#define VR_PCI_REVID_VT6105_LOM 0x8A
#define VR_PCI_REVID_VT6107_A0 0x8C
#define VR_PCI_REVID_VT6107_A1 0x8D
#define VR_PCI_REVID_VT6105M_A0 0x90
#define VR_PCI_REVID_VT6105M_B1 0x94
/*
* Feature bits for the different cards.
*/
#define VR_FEATURE_NONE (0)
/*
* Bug bits for the different cards.
*/
#define VR_BUG_NONE (0)
/*
* Clear bit b in register r.
*/
#define VR_CLRBIT8(acc, r, b) \
#define VR_CLRBIT16(acc, r, b) \
#define VR_CLRBIT32(acc, r, b) \
/*
* Set bit b in register r.
*/
#define VR_SETBIT8(acc, r, b) \
#define VR_SETBIT16(acc, r, b) \
#define VR_SETBIT32(acc, r, b) \
/*
* Set bits b in register r to value v.
*/
#define VR_SETBITS8(acc, r, b, v) \
#define VR_SETBITS16(acc, r, b, v) \
#define VR_SETBITS32(acc, r, b, v) \
/*
* The descriptor as used by the MAC.
*/
typedef struct {
/*
* A structure describing an DMA object.
*/
typedef struct data_dma {
char *buf;
/*
* A descriptor as used by the host.
*/
typedef struct vr_desc {
} vr_desc_t;
typedef struct vr_ring {
} vr_ring_t;
typedef struct {
} vr_tx_t;
typedef struct {
} vr_rx_t;
typedef enum {
typedef enum {
typedef enum {
typedef enum {
/*
* Pause variations.
*/
typedef enum {
/*
* Type of medium attachement unit.
*/
typedef enum {
} vr_mau_t;
typedef struct {
} vr_link_t;
typedef enum {
typedef struct {
} mii_t;
/*
* A structure defining the various types of cards and their habits.
*/
typedef struct {
char name[128];
} chip_info_t;
/*
* A structure describing the card.
*/
typedef struct {
} vr_chip_t;
/*
* Operational parameters.
*/
typedef struct {
} vr_param_t;
typedef enum {
VR_SUCCESS = 0,
VR_FAILURE = 1
} vr_result_t;
typedef struct {
} vr_stats_t;
/*
* Access attributes for the card.
*/
typedef struct {
} vr_acc_t;
/*
* Instance state structure.
*/
typedef struct {
char ifname[12];
int nsets;
} vr_t;
/*
* Function prototypes.
*/
int vr_mac_start(void *vrp);
void vr_mac_stop(void *vrp);
int vr_mac_set_ether_addr(void *vrp,
#ifdef __cplusplus
}
#endif
#endif /* _VR_H */