/*
* 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 _DNET_H
#define _DNET_H
/* debug flags */
#ifdef DEBUG
#endif
/* Misc */
/* board state */
#define DNET_IDLE 0
#define SUCCESS 0
/* Apparently, the 21143 and 142 are distinguished by revision ID */
#ifndef GLD_INTR_WAIT
/* Temporary until this makes it into the build environment's gld.h */
#endif
/* User defined PCI config space registers */
/* CSR Description */
/* Helpful defines for register access */
/* Bit descriptions of CSR registers */
/* BUS_MODE_REG, CSR0 */
/* TX_POLL_REG, CSR1 */
/* RX_POLL_REG, CSR2 */
/* STATUS_REG, CSR5 */
/* OPN_REG , CSR6 */
/* INT_MASK_REG , CSR7 */
/* MISSED_FRAME_REG, CSR8 */
/* Serial ROM Register CSR9 */
/* GPR Timer reg, CSR11 */
/* SIA Connectivity reg, CSR13 (040, 041, 142) */
#define CSR15_C
#define MEDIA_TP 0
/* CSR15 */
/*
* In GPR and reset sequences in the ROM this is used to decide wheather the
* CWE bit should be set when writing to the GPR. However, the CWE bit is
* different on the 143 and 140, so we pick a bit where we can safely store
* this information in the ROM structure before writing it out to the GPR
* register itself
*/
/* command block bit flags from SROM */
struct dnetinstance;
typedef struct _media_block_t {
int type;
int gprseqlen;
int rstseqlen;
int media_code;
union {
struct {
int phy_num;
} mii;
struct {
} sia;
} un;
typedef struct leaf_format {
int block_count;
int is_static;
} LEAF_FORMAT;
typedef struct srom_format {
int init_from_srom;
/* elements used to store Version 1,3 and proprietary formats */
} SROM_FORMAT;
struct dnetinstance {
int full_duplex;
int leaf;
int vendor_21140;
int vendor_revision;
int promisc;
int need_saddr;
int pgmask;
/* used for xmit */
int mii_speed;
int mii_duplex;
int phyaddr;
int disable_scrambler;
int overrun_workaround;
int interrupts_disabled;
int mii_up;
struct {
} timer;
};
#pragma pack(1)
/*
* Receive descriptor description
*/
struct rx_desc_type {
struct {
volatile uint32_t
} desc0;
struct {
volatile uint32_t
} desc1;
};
/*
* Receive descriptor description
*/
struct tx_desc_type {
struct {
volatile uint32_t
} desc0;
struct {
volatile uint32_t
} desc1;
};
#pragma pack()
#endif /* _DNET_H */