hme.h revision 06673d9b6d946016a5231efebdb7818b7486bafc
/*
* 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 _SYS_HME_H
#define _SYS_HME_H
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
/* default IPG settings */
#define IPG1 8
#define IPG2 4
/*
* Declarations and definitions specific to the
* FEPS 10/100 Mbps Ethernet (hme) device.
*/
/*
* Per-Stream instance state information.
*
* Each instance is dynamically allocated at open() and free'd
* at close(). Each per-Stream instance points to at most one
* per-device structure using the sb_hmep field. All instances
* are threaded together into one list of active instances
* ordered on minor device number.
*/
#define HME_2P1_REVID 0x20
#define HME_2P1_REVID_OBP 0x21
typedef struct {
} hmebuf_t;
/*
* HME Device Channel instance state information.
*
* Each instance is dynamically allocated on first attach.
*/
struct hme {
int instance; /* instance */
int hme_mifpoll_enable;
int hme_frame_enable;
int hme_rxcv_enable;
int hme_phy_failure; /* phy failure type */
int hme_64bit_xfer; /* 64-bit Sbus xfers */
int hme_phyad;
int hme_nlasttries;
int hme_cheerio_mode;
unsigned char *hme_romp; /* fcode rom pointer */
/*
* DDI dma handle, kernel virtual base,
* and io virtual base of IOPB area.
*/
/*
* check if transmitter is hung
*/
/*
* Debuging kstats
*/
};
/* flags */
/* Mac address flags */
struct hmekstat {
};
/*
* This structure is organized to meet the following requirements:
* - bb_buf starts on an HMEBURSTSIZE boundary.
* - hmebuf is an even multiple of HMEBURSTSIZE
* - bb_buf[] is large enough to contain max VLAN frame (1522) plus
* (3 x HMEBURSTSIZE) rounded up to the next HMEBURSTSIZE
* XXX What about another 128 bytes (HMEC requirement).
* Fast aligned copy requires both the source and destination
* addresses have the same offset from some N-byte boundary.
*/
#define HMEBURSTSIZE (64)
#define HMEBUFSIZE (1728)
/*
* Define offset from start of bb_buf[] to point receive descriptor.
* Requirements:
* - must be 14 bytes back of a 4-byte boundary so the start of
* the network packet is 4-byte aligned.
* - leave some headroom for others
*/
#define HMEHEADROOM (34)
/* Offset for the first byte in the receive buffer */
#define HME_FSTBYTE_OFFSET 2
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_HME_H */