]>
git.saurik.com Git - apple/xnu.git/blob - iokit/Drivers/network/drvPPCBMac/BMacEnetMII.h
2 * Copyright (c) 1998-2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
23 * Copyright (c) 1998-1999 by Apple Computer, Inc., All rights reserved.
25 * MII protocol and PHY register definitions.
31 #ifndef _BMACENETMII_H
32 #define _BMACENETMII_H
35 * MII command frame (32-bits) as documented in IEEE 802.3u
38 // _BIG_ENDIAN is already defined for PPC
51 st
:2, // start of frame
53 op
:2, // operation code
54 #define MII_OP_READ 0x02
55 #define MII_OP_WRITE 0x01
56 phyad
:5, // PHY address
57 regad
:5, // register address
59 data
:16; // 16-bit data field
64 data
:16, // 16-bit data field
66 regad
:5, // register address
67 phyad
:5, // PHY address
68 op
:2, // operation code
69 st
:2; // start of frame
74 #define MII_FRAME_PREAMBLE 0xFFFFFFFF
75 #define MII_FRAME_SIZE 32
76 #define MII_FRAME_READ 0x60000000
77 #define MII_FRAME_WRITE 0x50020000
79 #define MII_MAX_PHY 32
86 #define MII_ADVERTISEMENT 4
87 #define MII_LINKPARTNER 5
88 #define MII_EXPANSION 6
89 #define MII_NEXTPAGE 7
91 /* MII Control register bits */
92 #define MII_CONTROL_RESET 0x8000
93 #define MII_CONTROL_LOOPBACK 0x4000
94 #define MII_CONTROL_SPEED_SELECTION 0x2000
95 #define MII_CONTROL_AUTONEGOTIATION 0x1000
96 #define MII_CONTROL_POWERDOWN 0x800
97 #define MII_CONTROL_ISOLATE 0x400
98 #define MII_CONTROL_RESTART_NEGOTIATION 0x200
99 #define MII_CONTROL_FULLDUPLEX 0x100
100 #define MII_CONTROL_COLLISION_TEST 0x80
102 /* MII Status register bits */
103 #define MII_STATUS_100BASET4 0x8000
104 #define MII_STATUS_100BASETX_FD 0x4000
105 #define MII_STATUS_100BASETX 0x2000
106 #define MII_STATUS_10BASET_FD 0x1000
107 #define MII_STATUS_10BASET 0x800
108 #define MII_STATUS_NEGOTIATION_COMPLETE 0x20
109 #define MII_STATUS_REMOTE_FAULT 0x10
110 #define MII_STATUS_NEGOTIATION_ABILITY 0x8
111 #define MII_STATUS_LINK_STATUS 0x4
112 #define MII_STATUS_JABBER_DETECT 0x2
113 #define MII_STATUS_EXTENDED_CAPABILITY 0x1
115 /* MII ANAR register bits */
116 #define MII_ANAR_100BASET4 0x200
117 #define MII_ANAR_100BASETX_FD 0x100
118 #define MII_ANAR_100BASETX 0x80
119 #define MII_ANAR_10BASET_FD 0x40
120 #define MII_ANAR_10BASET 0x20
122 /* MII ST10040 Specific */
125 #define MII_ST10040_OUI 0x1e0400
126 #define MII_ST10040_MODEL 0x00
127 #define MII_ST10040_REV 0x01
128 #define MII_ST10040_ID ((MII_ST10040_OUI << 10) | \
129 (MII_ST10040_MODEL << 4))
130 #define MII_ST10040_MASK 0xfffffff0
132 #define MII_ST10040_DELAY 1
134 /* MII ST10040 Regs */
135 #define MII_ST10040_CHIPST 0x14
137 /* MII ST10040 CHIPST register bits */
138 #define MII_ST10040_CHIPST_LINK 0x2000
139 #define MII_ST10040_CHIPST_DUPLEX 0x1000
140 #define MII_ST10040_CHIPST_SPEED 0x0800
141 #define MII_ST10040_CHIPST_NEGOTIATION 0x0020
143 /* MII DP83843 Specific */
146 #define MII_DP83843_OUI 0x080017
147 #define MII_DP83843_MODEL 0x01
148 #define MII_DP83843_REV 0x00
149 #define MII_DP83843_ID ((MII_DP83843_OUI << 10) | \
150 (MII_DP83843_MODEL << 4))
151 #define MII_DP83843_MASK 0xfffffff0
153 #define MII_DP83843_DELAY 20
155 /* MII DP83843 PHYSTS register bits */
156 #define MII_DP83843_PHYSTS 0x10
157 #define MII_DP83843_PHYSTS_LINK 0x0001
158 #define MII_DP83843_PHYSTS_SPEED10 0x0002
159 #define MII_DP83843_PHYSTS_DUPLEX 0x0004
160 #define MII_DP83843_PHYSTS_NEGOTIATION 0x0020
164 #define MII_DEFAULT_DELAY 20
165 #define MII_RESET_TIMEOUT 100
166 #define MII_RESET_DELAY 10
168 #define MII_LINK_TIMEOUT 2500
169 #define MII_LINK_DELAY 20
171 #endif /* _BMACENETMII_H */