nxge_mii.h revision 6b4389256364527aaad06f3fd83d4b05358a4c02
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_NXGE_NXGE_MII_H_
#define _SYS_NXGE_NXGE_MII_H_
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Configuration Register space.
*/
#define NXGE_MII_LPRXNPR 8
#define NXGE_MII_GCR 9
#define NXGE_MII_GSR 10
#define NXGE_MII_RES0 11
#define NXGE_MII_RES1 12
#define NXGE_MII_RES2 13
#define NXGE_MII_RES3 14
#define NXGE_MII_ESR 15
/* Shadow register definition */
#define NXGE_MAX_MII_REGS 32
/*
* Configuration Register space.
*/
typedef struct _mii_regs {
} mii_regs_t, *p_mii_regs_t;
/*
* MII Register 0: Basic mode control register.
*/
typedef union _mii_bmcr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#endif
} bits;
} mii_bmcr_t, *p_mii_bmcr_t;
/*
* MII Register 1: Basic mode status register.
*/
typedef union _mii_bmsr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#endif
} bits;
} mii_bmsr_t, *p_mii_bmsr_t;
/*
* MII Register 2: Physical Identifier 1.
*/
/* contains BCM OUI bits [3:18] */
typedef union _mii_idr1 {
struct {
} bits;
} mii_idr1_t, *p_mii_idr1_t;
/*
* MII Register 3: Physical Identifier 2.
*/
typedef union _mii_idr2 {
struct {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#endif
} bits;
} mii_idr2_t, *p_mii_idr2_t;
/*
* MII Register 4: Auto-negotiation advertisement register.
*/
typedef union _mii_anar {
struct {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#endif
} bits;
} mii_anar_t, *p_mii_anar_t;
/*
* MII Register 5: Auto-negotiation link partner ability register.
*/
/*
* MII Register 6: Auto-negotiation expansion register.
*/
typedef union _mii_aner {
struct {
#if defined(_BIT_FIELDS_HTOL)
#else
#endif
} bits;
} mii_aner_t, *p_mii_aner_t;
/*
* MII Register 7: Next page transmit register.
*/
typedef union _mii_nptxr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#else
#endif
} bits;
} mii_nptxr_t, *p_mii_nptxr_t;
/*
* MII Register 8: Link partner received next page register.
*/
typedef union _mii_lprxnpr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#else
#endif
} bits;
/*
* MII Register 9: 1000BaseT control register.
*/
typedef union _mii_gcr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#else
#endif
} bits;
} mii_gcr_t, *p_mii_gcr_t;
/*
* MII Register 10: 1000BaseT status register.
*/
typedef union _mii_gsr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#else
#endif
} bits;
} mii_gsr_t, *p_mii_gsr_t;
/*
* MII Register 15: Extended status register.
*/
typedef union _mii_esr {
struct {
#if defined(_BIT_FIELDS_HTOL)
#else
#endif
} bits;
} mii_esr_t, *p_mii_esr_t;
#define NXGE_MODE_SELECT_FIBER 0x01
/* Shadow regiser 0x11111 */
typedef union _mii_mode_control_stat {
struct {
#if defined(_BIT_FIELDS_HTOL)
#elif defined(_BIT_FIELDS_LTOH)
#endif
} bits;
#ifdef __cplusplus
}
#endif
#endif /* _SYS_NXGE_NXGE_MII_H_ */