Home | History | Annotate | Line # | Download | only in mii
      1  1.28   andvar /*	$NetBSD: mii.h,v 1.28 2025/02/28 09:07:12 andvar Exp $	*/
      2  1.12    perry 
      3   1.1  thorpej /*
      4   1.1  thorpej  * Copyright (c) 1997 Manuel Bouyer.  All rights reserved.
      5   1.1  thorpej  *
      6   1.1  thorpej  * Modification to match BSD/OS 3.0 MII interface by Jason R. Thorpe,
      7   1.1  thorpej  * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
      8   1.1  thorpej  *
      9   1.1  thorpej  * Redistribution and use in source and binary forms, with or without
     10   1.1  thorpej  * modification, are permitted provided that the following conditions
     11   1.1  thorpej  * are met:
     12   1.1  thorpej  * 1. Redistributions of source code must retain the above copyright
     13   1.1  thorpej  *    notice, this list of conditions and the following disclaimer.
     14   1.1  thorpej  * 2. Redistributions in binary form must reproduce the above copyright
     15   1.1  thorpej  *    notice, this list of conditions and the following disclaimer in the
     16   1.1  thorpej  *    documentation and/or other materials provided with the distribution.
     17   1.1  thorpej  *
     18   1.1  thorpej  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     19   1.1  thorpej  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     20   1.1  thorpej  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     21   1.1  thorpej  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     22   1.1  thorpej  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     23   1.1  thorpej  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     24   1.1  thorpej  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     25   1.1  thorpej  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     26   1.1  thorpej  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     27   1.1  thorpej  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     28   1.1  thorpej  */
     29   1.1  thorpej 
     30   1.1  thorpej #ifndef _DEV_MII_MII_H_
     31   1.1  thorpej #define	_DEV_MII_MII_H_
     32   1.1  thorpej 
     33   1.1  thorpej /*
     34   1.1  thorpej  * Registers common to all PHYs.
     35   1.1  thorpej  */
     36   1.1  thorpej 
     37   1.1  thorpej #define	MII_NPHY	32	/* max # of PHYs per MII */
     38  1.20  msaitoh #define	MII_ADDRBITS	5	/* Register address bits (0x00..0x1f) */
     39  1.20  msaitoh #define	MII_ADDRMASK	0x1f	/* Address mask */
     40   1.1  thorpej 
     41   1.1  thorpej /*
     42   1.1  thorpej  * MII commands, used if a device must drive the MII lines
     43   1.1  thorpej  * manually.
     44   1.1  thorpej  */
     45   1.1  thorpej #define	MII_COMMAND_START	0x01
     46   1.1  thorpej #define	MII_COMMAND_READ	0x02
     47   1.1  thorpej #define	MII_COMMAND_WRITE	0x01
     48   1.1  thorpej #define	MII_COMMAND_ACK		0x02
     49   1.1  thorpej 
     50  1.18  msaitoh #define	MII_BMCR	0x00	/* Basic mode control register (rw) */
     51   1.1  thorpej #define	BMCR_RESET	0x8000	/* reset */
     52   1.1  thorpej #define	BMCR_LOOP	0x4000	/* loopback */
     53   1.5  thorpej #define	BMCR_SPEED0	0x2000	/* speed selection (LSB) */
     54   1.1  thorpej #define	BMCR_AUTOEN	0x1000	/* autonegotiation enable */
     55   1.1  thorpej #define	BMCR_PDOWN	0x0800	/* power down */
     56   1.1  thorpej #define	BMCR_ISO	0x0400	/* isolate */
     57   1.1  thorpej #define	BMCR_STARTNEG	0x0200	/* restart autonegotiation */
     58   1.1  thorpej #define	BMCR_FDX	0x0100	/* Set duplex mode */
     59   1.1  thorpej #define	BMCR_CTEST	0x0080	/* collision test */
     60   1.5  thorpej #define	BMCR_SPEED1	0x0040	/* speed selection (MSB) */
     61  1.22  msaitoh #define	BMCR_UNIDIR	0x0020	/* Unidirectional enable */
     62   1.5  thorpej 
     63   1.5  thorpej #define	BMCR_S10	0x0000		/* 10 Mb/s */
     64   1.5  thorpej #define	BMCR_S100	BMCR_SPEED0	/* 100 Mb/s */
     65   1.5  thorpej #define	BMCR_S1000	BMCR_SPEED1	/* 1000 Mb/s */
     66   1.5  thorpej 
     67  1.27  msaitoh #define	BMCR_SPEED(x)	((x) & (BMCR_SPEED0 | BMCR_SPEED1))
     68   1.1  thorpej 
     69   1.1  thorpej #define	MII_BMSR	0x01	/* Basic mode status register (ro) */
     70   1.1  thorpej #define	BMSR_100T4	0x8000	/* 100 base T4 capable */
     71   1.1  thorpej #define	BMSR_100TXFDX	0x4000	/* 100 base Tx full duplex capable */
     72   1.1  thorpej #define	BMSR_100TXHDX	0x2000	/* 100 base Tx half duplex capable */
     73   1.1  thorpej #define	BMSR_10TFDX	0x1000	/* 10 base T full duplex capable */
     74   1.1  thorpej #define	BMSR_10THDX	0x0800	/* 10 base T half duplex capable */
     75   1.5  thorpej #define	BMSR_100T2FDX	0x0400	/* 100 base T2 full duplex capable */
     76   1.5  thorpej #define	BMSR_100T2HDX	0x0200	/* 100 base T2 half duplex capable */
     77   1.7     matt #define	BMSR_EXTSTAT	0x0100	/* Extended status in register 15 */
     78  1.22  msaitoh #define	BMSR_UNIDIR	0x0080	/* Unidirectional ability */
     79   1.3  thorpej #define	BMSR_MFPS	0x0040	/* MII Frame Preamble Suppression */
     80   1.1  thorpej #define	BMSR_ACOMP	0x0020	/* Autonegotiation complete */
     81   1.1  thorpej #define	BMSR_RFAULT	0x0010	/* Link partner fault */
     82   1.1  thorpej #define	BMSR_ANEG	0x0008	/* Autonegotiation capable */
     83   1.1  thorpej #define	BMSR_LINK	0x0004	/* Link status */
     84   1.1  thorpej #define	BMSR_JABBER	0x0002	/* Jabber detected */
     85   1.5  thorpej #define	BMSR_EXTCAP	0x0001	/* Extended capability */
     86   1.5  thorpej 
     87   1.5  thorpej /*
     88   1.5  thorpej  * Note that the EXTSTAT bit indicates that there is extended status
     89   1.5  thorpej  * info available in register 15, but 802.3 section 22.2.4.3 also
     90  1.18  msaitoh  * states that all 1000 Mb/s capable PHYs will set this bit to 1.
     91   1.5  thorpej  */
     92   1.1  thorpej 
     93  1.27  msaitoh #define	BMSR_MEDIAMASK	(BMSR_100T4 | BMSR_100TXFDX | BMSR_100TXHDX | \
     94  1.27  msaitoh 	    BMSR_10TFDX | BMSR_10THDX | BMSR_100T2FDX | BMSR_100T2HDX)
     95   1.1  thorpej 
     96   1.1  thorpej /*
     97   1.1  thorpej  * Convert BMSR media capabilities to ANAR bits for autonegotiation.
     98   1.1  thorpej  * Note the shift chopps off the BMSR_ANEG bit.
     99   1.1  thorpej  */
    100   1.1  thorpej #define	BMSR_MEDIA_TO_ANAR(x)	(((x) & BMSR_MEDIAMASK) >> 6)
    101   1.1  thorpej 
    102   1.1  thorpej #define	MII_PHYIDR1	0x02	/* ID register 1 (ro) */
    103   1.1  thorpej 
    104   1.1  thorpej #define	MII_PHYIDR2	0x03	/* ID register 2 (ro) */
    105   1.1  thorpej #define	IDR2_OUILSB	0xfc00	/* OUI LSB */
    106   1.1  thorpej #define	IDR2_MODEL	0x03f0	/* vendor model */
    107   1.1  thorpej #define	IDR2_REV	0x000f	/* vendor revision */
    108   1.1  thorpej 
    109   1.1  thorpej #define	MII_ANAR	0x04	/* Autonegotiation advertisement (rw) */
    110   1.5  thorpej 		/* section 28.2.4.1 and 37.2.6.1 */
    111   1.1  thorpej #define ANAR_NP		0x8000	/* Next page (ro) */
    112   1.1  thorpej #define	ANAR_ACK	0x4000	/* link partner abilities acknowledged (ro) */
    113   1.1  thorpej #define ANAR_RF		0x2000	/* remote fault (ro) */
    114  1.23  msaitoh #define ANAR_XNP	0x1000	/* Extended Next Page */
    115  1.17  msaitoh 		/* Annex 28B.2 */
    116   1.2  thorpej #define	ANAR_FC		0x0400	/* local device supports PAUSE */
    117   1.1  thorpej #define ANAR_T4		0x0200	/* local device supports 100bT4 */
    118   1.1  thorpej #define ANAR_TX_FD	0x0100	/* local device supports 100bTx FD */
    119   1.1  thorpej #define ANAR_TX		0x0080	/* local device supports 100bTx */
    120   1.1  thorpej #define ANAR_10_FD	0x0040	/* local device supports 10bT FD */
    121   1.1  thorpej #define ANAR_10		0x0020	/* local device supports 10bT */
    122   1.1  thorpej #define	ANAR_CSMA	0x0001	/* protocol selector CSMA/CD */
    123  1.17  msaitoh #define	ANAR_PAUSE_NONE		(0 << 10)
    124  1.17  msaitoh #define	ANAR_PAUSE_SYM		(1 << 10)
    125  1.17  msaitoh #define	ANAR_PAUSE_ASYM		(2 << 10)
    126  1.17  msaitoh #define	ANAR_PAUSE_TOWARDS	(3 << 10)
    127   1.1  thorpej 
    128  1.17  msaitoh 		/* Annex 28D */
    129  1.10  thorpej #define	ANAR_X_FD	0x0020	/* local device supports 1000BASE-X FD */
    130  1.10  thorpej #define	ANAR_X_HD	0x0040	/* local device supports 1000BASE-X HD */
    131  1.17  msaitoh #define	ANAR_X_PAUSE_NONE	(0 << 7)
    132  1.17  msaitoh #define	ANAR_X_PAUSE_SYM	(1 << 7)
    133  1.17  msaitoh #define	ANAR_X_PAUSE_ASYM	(2 << 7)
    134  1.17  msaitoh #define	ANAR_X_PAUSE_TOWARDS	(3 << 7)
    135  1.28   andvar 	/* 37.2.1.5 Remote Fault */
    136  1.23  msaitoh #define	ANAR_X_RF1	0x1000
    137  1.23  msaitoh #define	ANAR_X_RF2	0x2000
    138  1.23  msaitoh #define ANAR_X_RF_MASK		(ANAR_X_RF1 | ANAR_X_RF2)
    139  1.23  msaitoh #define ANAR_X_RF_NONE		(0 << 12)
    140  1.23  msaitoh #define ANAR_X_RF_OFFLINE	(1 << 12)
    141  1.23  msaitoh #define ANAR_X_RF_LINKFAIL	(2 << 12)
    142  1.23  msaitoh #define ANAR_X_RF_ANEGERR	(3 << 12)
    143  1.10  thorpej 
    144  1.22  msaitoh #define	MII_ANLPAR	0x05	/* ANEG Link Partner Base Page abilities (rw)*/
    145   1.5  thorpej 		/* section 28.2.4.1 and 37.2.6.1 */
    146   1.1  thorpej #define ANLPAR_NP	0x8000	/* Next page (ro) */
    147   1.1  thorpej #define	ANLPAR_ACK	0x4000	/* link partner accepted ACK (ro) */
    148   1.1  thorpej #define ANLPAR_RF	0x2000	/* remote fault (ro) */
    149  1.23  msaitoh #define ANLPAR_XNP	0x1000	/* Extended Next Page */
    150   1.2  thorpej #define	ANLPAR_FC	0x0400	/* link partner supports PAUSE */
    151   1.1  thorpej #define ANLPAR_T4	0x0200	/* link partner supports 100bT4 */
    152   1.1  thorpej #define ANLPAR_TX_FD	0x0100	/* link partner supports 100bTx FD */
    153   1.1  thorpej #define ANLPAR_TX	0x0080	/* link partner supports 100bTx */
    154   1.1  thorpej #define ANLPAR_10_FD	0x0040	/* link partner supports 10bT FD */
    155   1.1  thorpej #define ANLPAR_10	0x0020	/* link partner supports 10bT */
    156   1.1  thorpej #define	ANLPAR_CSMA	0x0001	/* protocol selector CSMA/CD */
    157  1.17  msaitoh #define	ANLPAR_PAUSE_MASK	(3 << 10)
    158  1.17  msaitoh #define	ANLPAR_PAUSE_NONE	(0 << 10)
    159  1.17  msaitoh #define	ANLPAR_PAUSE_SYM	(1 << 10)
    160  1.17  msaitoh #define	ANLPAR_PAUSE_ASYM	(2 << 10)
    161  1.17  msaitoh #define	ANLPAR_PAUSE_TOWARDS	(3 << 10)
    162  1.10  thorpej 
    163  1.10  thorpej #define	ANLPAR_X_FD	0x0020	/* local device supports 1000BASE-X FD */
    164  1.10  thorpej #define	ANLPAR_X_HD	0x0040	/* local device supports 1000BASE-X HD */
    165  1.17  msaitoh #define	ANLPAR_X_PAUSE_MASK	(3 << 7)
    166  1.17  msaitoh #define	ANLPAR_X_PAUSE_NONE	(0 << 7)
    167  1.17  msaitoh #define	ANLPAR_X_PAUSE_SYM	(1 << 7)
    168  1.17  msaitoh #define	ANLPAR_X_PAUSE_ASYM	(2 << 7)
    169  1.17  msaitoh #define	ANLPAR_X_PAUSE_TOWARDS	(3 << 7)
    170  1.28   andvar 	/* 37.2.1.5 Remote Fault */
    171  1.23  msaitoh #define	ANLPAR_X_RF1	0x1000
    172  1.23  msaitoh #define	ANLPAR_X_RF2	0x2000
    173  1.23  msaitoh #define	ANLPAR_X_RF_MASK	(ANLPAR_X_RF1 | ANLPAR_X_RF2)
    174  1.23  msaitoh #define ANLPAR_X_RF_NONE	(0 << 12)
    175  1.23  msaitoh #define ANLPAR_X_RF_OFFLINE	(1 << 12)
    176  1.23  msaitoh #define ANLPAR_X_RF_LINKFAIL	(2 << 12)
    177  1.23  msaitoh #define ANLPAR_X_RF_ANEGERR	(3 << 12)
    178   1.1  thorpej 
    179   1.1  thorpej #define	MII_ANER	0x06	/* Autonegotiation expansion (ro) */
    180   1.5  thorpej 		/* section 28.2.4.1 and 37.2.6.1 */
    181  1.22  msaitoh #define ANER_RNPLA	0x0040	/* Receive Next Page Location Able */
    182  1.22  msaitoh #define ANER_RNPSL	0x0020	/* Received Next Page Storage Location */
    183   1.1  thorpej #define ANER_MLF	0x0010	/* multiple link detection fault */
    184  1.21  msaitoh #define ANER_LPNP	0x0008	/* link partner next page-able */
    185   1.1  thorpej #define ANER_NP		0x0004	/* next page-able */
    186   1.1  thorpej #define ANER_PAGE_RX	0x0002	/* Page received */
    187  1.21  msaitoh #define ANER_LPAN	0x0001	/* link partner autoneg-able */
    188   1.5  thorpej 
    189  1.23  msaitoh #define	MII_ANNPT	0x07	/* Autonegotiation next page transmit (rw) */
    190   1.5  thorpej 		/* section 28.2.4.1 and 37.2.6.1 */
    191  1.23  msaitoh #define ANNPT_NP	0x8000	/* Next Page */
    192  1.23  msaitoh #define ANNPT_MP	0x2000	/* Message Page */
    193  1.23  msaitoh #define ANNPT_ACK2	0x1000	/* Acknowledge 2 */
    194  1.23  msaitoh #define ANNPT_TOGGLE	0x0800	/* Toggle */
    195  1.23  msaitoh #define ANNPT_MSGUNF_MASK 0x07ff /* Message(Annex28C)/Unformatted Code Field */
    196  1.23  msaitoh 
    197  1.23  msaitoh /* Next Page Message Code used in ANNPT and ANLPRNP */
    198  1.23  msaitoh #define ANNP_MSG_NULL		1    /* Null Message */
    199  1.23  msaitoh #define ANNP_MSG_1UP_TAF	2    /* 1Up w/ Tech. Ability Field follows */
    200  1.23  msaitoh #define ANNP_MSG_2UP_TAF	3    /* 2Up w/ Tech. Ability Field follows */
    201  1.23  msaitoh #define ANNP_MSG_1UP_BCRF	4    /* 1Up w/ Bin. coded Remote Flt follows */
    202  1.23  msaitoh #define ANNP_MSG_OUIDTMSG	5    /* OUI tagged Message */
    203  1.23  msaitoh #define ANNP_MSG_PHYIDTC	6    /* PHY Identifier Tag Code */
    204  1.23  msaitoh #define ANNP_MSG_TMC_100T2	7    /* 100BASE-T2 Tech. Message Code */
    205  1.23  msaitoh #define ANNP_MSG_TMC_1000T	8    /* 1000BASE-T Tech. Message Code */
    206  1.23  msaitoh #define ANNP_MSG_TMC_10G1G	9    /* 10GBASE-T/1000BASE-T TMC: (XNP) */
    207  1.23  msaitoh #define ANNP_MSG_TMC_EEE	10   /* EEE Technology Message Code */
    208  1.23  msaitoh #define ANNP_MSG_OUIDTM_XNP	11   /* OUI tagged Message (XNP) */
    209  1.23  msaitoh 
    210   1.5  thorpej 
    211   1.5  thorpej #define	MII_ANLPRNP	0x08	/* Autonegotiation link partner rx next page */
    212   1.5  thorpej 		/* section 32.5.1 and 37.2.6.1 */
    213  1.23  msaitoh #define ANLPRNP_NP	0x8000	/* Next Page */
    214  1.23  msaitoh #define ANLPRNP_ACK	0x4000	/* Acknowledge */
    215  1.23  msaitoh #define ANLPRNP_MP	0x2000	/* Message Page */
    216  1.23  msaitoh #define ANLPRNP_ACK2	0x1000	/* Acknowledge 2 */
    217  1.23  msaitoh #define ANLPRNP_TOGGLE	0x0800	/* Toggle */
    218  1.23  msaitoh #define ANLPRNP_MSGUNF_MASK 0x07ff /* Message(Anx28C)/Unformatted Code Field */
    219   1.5  thorpej 
    220  1.24  msaitoh #define	MII_GTCR	0x09	/*
    221  1.24  msaitoh 				 * Master-Slave control register for
    222  1.24  msaitoh 				 * 100BASE-T2 and 1000BASE-T.
    223  1.24  msaitoh 				 */
    224  1.24  msaitoh #define	MII_100T2CR	MII_GTCR /* alias */
    225   1.8  thorpej #define	GTCR_TEST_MASK	0xe000	/* see 802.3ab ss. 40.6.1.1.2 */
    226   1.8  thorpej #define	GTCR_MAN_MS	0x1000	/* enable manual master/slave control */
    227   1.8  thorpej #define	GTCR_ADV_MS	0x0800	/* 1 = adv. master, 0 = adv. slave */
    228   1.8  thorpej #define	GTCR_PORT_TYPE	0x0400	/* 1 = DCE, 0 = DTE (NIC) */
    229   1.8  thorpej #define	GTCR_ADV_1000TFDX 0x0200 /* adv. 1000baseT FDX */
    230   1.8  thorpej #define	GTCR_ADV_1000THDX 0x0100 /* adv. 1000baseT HDX */
    231   1.5  thorpej 
    232  1.25  msaitoh #define T2CR_TEST_NORMAL	(0 << 13) /* Normal Operation */
    233  1.25  msaitoh #define T2CR_TEST_RX		(1 << 13) /* RX test */
    234  1.25  msaitoh #define T2CR_TEST_TX_WAVEFORM	(1 << 14) /* Mode 1. TX waveform test */
    235  1.25  msaitoh #define T2CR_TEST_TX_JITTER	(2 << 14) /* Mode 2. TX jitter test */
    236  1.25  msaitoh #define T2CR_TEST_TX_IDLE	(3 << 14) /* Mode 3. TX idle test */
    237  1.25  msaitoh 
    238  1.25  msaitoh #define GTCR_TEST_NORMAL	(0 << 13) /* Normal Operation */
    239  1.25  msaitoh #define GTCR_TEST_TX_WAVEFORM	(1 << 13) /* Mode 1. TX waveform test */
    240  1.25  msaitoh #define GTCR_TEST_TX_JITTER_M	(2 << 13) /* Mode 2. TX jitter test (Master) */
    241  1.25  msaitoh #define GTCR_TEST_TX_JITTER_S	(3 << 13) /* Mode 3. TX jitter test (Slave) */
    242  1.25  msaitoh #define GTCR_TEST_TX_DISTORTION	(4 << 13) /* Mode 4. TX distortion test */
    243  1.25  msaitoh 
    244  1.24  msaitoh #define	MII_GTSR	0x0a	/*
    245  1.24  msaitoh 				 * Master-Slave status register for
    246  1.24  msaitoh 				 * 100BASE-T2 and 1000BASE-T.
    247  1.24  msaitoh 				 */
    248  1.24  msaitoh #define	MII_100T2SR	MII_GTSR /* alias */
    249   1.8  thorpej #define	GTSR_MAN_MS_FLT	0x8000	/* master/slave config fault */
    250   1.8  thorpej #define	GTSR_MS_RES	0x4000	/* result: 1 = master, 0 = slave */
    251   1.8  thorpej #define	GTSR_LRS	0x2000	/* local rx status, 1 = ok */
    252  1.15  msaitoh #define	GTSR_RRS	0x1000	/* remote rx status, 1 = ok */
    253   1.8  thorpej #define	GTSR_LP_1000TFDX 0x0800	/* link partner 1000baseT FDX capable */
    254   1.8  thorpej #define	GTSR_LP_1000THDX 0x0400	/* link partner 1000baseT HDX capable */
    255   1.9  thorpej #define	GTSR_IDLE_ERR	0x00ff	/* IDLE error count */
    256   1.5  thorpej 
    257  1.16  msaitoh #define	MII_PSECR	0x0b	/* PSE control register */
    258  1.22  msaitoh #define	PSECR_DLLC	0x0020	/* Data Link Layer Classification capability */
    259  1.22  msaitoh #define	PSECR_EPLC	0x0010	/* Enable Physical Layer Classification */
    260  1.16  msaitoh #define	PSECR_PACTLMASK	0x000c	/* pair control mask */
    261  1.16  msaitoh #define	PSECR_PINOUTB	0x0008	/* PSE pinout Alternative B */
    262  1.16  msaitoh #define	PSECR_PINOUTA	0x0004	/* PSE pinout Alternative A */
    263  1.22  msaitoh #define	PSECR_PSEENMASK	0x0003	/* PSE enable mask */
    264  1.16  msaitoh #define	PSECR_FOPOWTST	0x0002	/* Force Power Test Mode */
    265  1.16  msaitoh #define	PSECR_PSEEN	0x0001	/* PSE Enabled */
    266  1.16  msaitoh #define	PSECR_PSEDIS	0x0000	/* PSE Disabled */
    267  1.16  msaitoh 
    268  1.16  msaitoh #define	MII_PSESR	0x0c	/* PSE status register */
    269  1.19  msaitoh #define	PSESR_PWRDENIED	0x1000	/* Power Denied */
    270  1.16  msaitoh #define	PSESR_VALSIG	0x0800	/* Valid PD signature detected */
    271  1.19  msaitoh #define	PSESR_INVALSIG	0x0400	/* Invalid PD signature detected */
    272  1.16  msaitoh #define	PSESR_SHORTCIRC	0x0200	/* Short circuit condition detected */
    273  1.16  msaitoh #define	PSESR_OVERLOAD	0x0100	/* Overload condition detected */
    274  1.16  msaitoh #define	PSESR_MPSABSENT	0x0080	/* MPS absent condition detected */
    275  1.16  msaitoh #define	PSESR_PDCLMASK	0x0070	/* PD Class mask */
    276  1.16  msaitoh #define	PSESR_STATMASK	0x000e	/* PSE Status mask */
    277  1.16  msaitoh #define	PSESR_PAIRCTABL	0x0001	/* PAIR Control Ability */
    278  1.22  msaitoh #define	PSESR_PDCL_INVALID	(5 << 4)	/* Invalid Class */
    279  1.16  msaitoh #define	PSESR_PDCL_4		(4 << 4)	/* Class 4 */
    280  1.16  msaitoh #define	PSESR_PDCL_3		(3 << 4)	/* Class 3 */
    281  1.16  msaitoh #define	PSESR_PDCL_2		(2 << 4)	/* Class 2 */
    282  1.16  msaitoh #define	PSESR_PDCL_1		(1 << 4)	/* Class 1 */
    283  1.16  msaitoh #define	PSESR_PDCL_0		(0 << 4)	/* Class 0 */
    284  1.22  msaitoh #define	PSESR_STAT_ISFLT	(5 << 1)	/* Implement specific fault */
    285  1.22  msaitoh #define	PSESR_STAT_TSTERR	(4 << 1)	/* Test Error */
    286  1.22  msaitoh #define	PSESR_STAT_TSTMODE	(3 << 1)	/* Test Mode */
    287  1.22  msaitoh #define	PSESR_STAT_DELVPWR	(2 << 1)	/* Delivering power */
    288  1.22  msaitoh #define	PSESR_STAT_SEARCH	(1 << 1)	/* Searching */
    289  1.22  msaitoh #define	PSESR_STAT_DIS		(0 << 1)	/* Disabled */
    290  1.16  msaitoh 
    291  1.16  msaitoh #define	MII_MMDACR	0x0d	/* MMD access control register */
    292  1.16  msaitoh #define	MMDACR_FUNCMASK	0xc000	/* function */
    293  1.16  msaitoh #define	MMDACR_DADDRMASK 0x001f	/* device address */
    294  1.16  msaitoh #define	MMDACR_FN_ADDRESS	(0 << 14) /* address */
    295  1.26  msaitoh #define	MMDACR_FN_DATA		(1 << 14) /* data, no post increment */
    296  1.26  msaitoh #define	MMDACR_FN_DATA_INC_RW	(2 << 14) /* data, post increment on r/w */
    297  1.26  msaitoh #define	MMDACR_FN_DATA_INC_W	(3 << 14) /* data, post increment on wr only */
    298  1.16  msaitoh 
    299  1.16  msaitoh #define	MII_MMDAADR	0x0e	/* MMD access address data register */
    300  1.16  msaitoh 
    301   1.5  thorpej #define	MII_EXTSR	0x0f	/* Extended status register */
    302   1.5  thorpej #define	EXTSR_1000XFDX	0x8000	/* 1000X full-duplex capable */
    303   1.5  thorpej #define	EXTSR_1000XHDX	0x4000	/* 1000X half-duplex capable */
    304   1.5  thorpej #define	EXTSR_1000TFDX	0x2000	/* 1000T full-duplex capable */
    305   1.5  thorpej #define	EXTSR_1000THDX	0x1000	/* 1000T half-duplex capable */
    306   1.6  thorpej 
    307  1.27  msaitoh #define	EXTSR_MEDIAMASK	(EXTSR_1000XFDX | EXTSR_1000XHDX | \
    308  1.27  msaitoh 	    EXTSR_1000TFDX | EXTSR_1000THDX)
    309   1.1  thorpej 
    310   1.1  thorpej #endif /* _DEV_MII_MII_H_ */
    311