Deleted Added
full compact
mii.h (215297) mii.h (221407)
1/* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 1997 Manuel Bouyer. All rights reserved.
5 *
6 * Modification to match BSD/OS 3.0 MII interface by Jason R. Thorpe,
7 * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
8 *

--- 12 unchanged lines hidden (view full) ---

21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
1/* $NetBSD: mii.h,v 1.9 2001/05/31 03:07:14 thorpej Exp $ */
2
3/*-
4 * Copyright (c) 1997 Manuel Bouyer. All rights reserved.
5 *
6 * Modification to match BSD/OS 3.0 MII interface by Jason R. Thorpe,
7 * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
8 *

--- 12 unchanged lines hidden (view full) ---

21 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28 *
29 * $FreeBSD: head/sys/dev/mii/mii.h 215297 2010-11-14 13:26:10Z marius $
29 * $FreeBSD: head/sys/dev/mii/mii.h 221407 2011-05-03 19:51:29Z marius $
30 */
31
32#ifndef _DEV_MII_MII_H_
33#define _DEV_MII_MII_H_
34
35/*
36 * Registers common to all PHYs.
37 */

--- 46 unchanged lines hidden (view full) ---

84
85#define BMSR_DEFCAPMASK 0xffffffff
86
87/*
88 * Note that the EXTSTAT bit indicates that there is extended status
89 * info available in register 15, but 802.3 section 22.2.4.3 also
90 * states that that all 1000 Mb/s capable PHYs will set this bit to 1.
91 */
30 */
31
32#ifndef _DEV_MII_MII_H_
33#define _DEV_MII_MII_H_
34
35/*
36 * Registers common to all PHYs.
37 */

--- 46 unchanged lines hidden (view full) ---

84
85#define BMSR_DEFCAPMASK 0xffffffff
86
87/*
88 * Note that the EXTSTAT bit indicates that there is extended status
89 * info available in register 15, but 802.3 section 22.2.4.3 also
90 * states that that all 1000 Mb/s capable PHYs will set this bit to 1.
91 */
92#if 0
93#define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX|BMSR_10TFDX| \
94 BMSR_10THDX|BMSR_ANEG)
95
92
96#else
97/* NetBSD uses: */
98#define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \
99 BMSR_10TFDX|BMSR_10THDX|BMSR_100T2FDX|BMSR_100T2HDX)
93#define BMSR_MEDIAMASK (BMSR_100T4|BMSR_100TXFDX|BMSR_100TXHDX| \
94 BMSR_10TFDX|BMSR_10THDX|BMSR_100T2FDX|BMSR_100T2HDX)
100#endif
101
102/*
103 * Convert BMSR media capabilities to ANAR bits for autonegotiation.
104 * Note the shift chopps off the BMSR_ANEG bit.
105 */
106#define BMSR_MEDIA_TO_ANAR(x) (((x) & BMSR_MEDIAMASK) >> 6)
107
108#define MII_PHYIDR1 0x02 /* ID register 1 (ro) */
109
110#define MII_PHYIDR2 0x03 /* ID register 2 (ro) */
111#define IDR2_OUILSB 0xfc00 /* OUI LSB */
112#define IDR2_MODEL 0x03f0 /* vendor model */
113#define IDR2_REV 0x000f /* vendor revision */
114
95
96/*
97 * Convert BMSR media capabilities to ANAR bits for autonegotiation.
98 * Note the shift chopps off the BMSR_ANEG bit.
99 */
100#define BMSR_MEDIA_TO_ANAR(x) (((x) & BMSR_MEDIAMASK) >> 6)
101
102#define MII_PHYIDR1 0x02 /* ID register 1 (ro) */
103
104#define MII_PHYIDR2 0x03 /* ID register 2 (ro) */
105#define IDR2_OUILSB 0xfc00 /* OUI LSB */
106#define IDR2_MODEL 0x03f0 /* vendor model */
107#define IDR2_REV 0x000f /* vendor revision */
108
115#define MII_OUI(id1, id2) (((id1) << 6) | ((id2) >> 10))
116#define MII_MODEL(id2) (((id2) & IDR2_MODEL) >> 4)
117#define MII_REV(id2) ((id2) & IDR2_REV)
118
119#define MII_ANAR 0x04 /* Autonegotiation advertisement (rw) */
120 /* section 28.2.4.1 and 37.2.6.1 */
121#define ANAR_NP 0x8000 /* Next page (ro) */
122#define ANAR_ACK 0x4000 /* link partner abilities acknowledged (ro) */
123#define ANAR_RF 0x2000 /* remote fault (ro) */
124#define ANAR_FC 0x0400 /* local device supports PAUSE */
125#define ANAR_T4 0x0200 /* local device supports 100bT4 */
126#define ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */

--- 86 unchanged lines hidden ---
109#define MII_ANAR 0x04 /* Autonegotiation advertisement (rw) */
110 /* section 28.2.4.1 and 37.2.6.1 */
111#define ANAR_NP 0x8000 /* Next page (ro) */
112#define ANAR_ACK 0x4000 /* link partner abilities acknowledged (ro) */
113#define ANAR_RF 0x2000 /* remote fault (ro) */
114#define ANAR_FC 0x0400 /* local device supports PAUSE */
115#define ANAR_T4 0x0200 /* local device supports 100bT4 */
116#define ANAR_TX_FD 0x0100 /* local device supports 100bTx FD */

--- 86 unchanged lines hidden ---