source: SVN/cambria/redboot/packages/devs/eth/intel/npe/common/current/include/IxEthMii.h @ 1

Last change on this file since 1 was 1, checked in by Tim Harvey, 2 years ago

restored latest version of files from server backup

Signed-off-by: Tim Harvey <tharvey@…>

File size: 8.3 KB
Line 
1/**
2 * @file    IxEthMii.h
3 *
4 * @brief this file contains the public API of @ref IxEthMii component
5 *
6 * Design notes : 
7 * The main intent of this API is to inplement MII high level fonctionalitoes
8 * to support the codelets provided with the IXP400 software releases. It
9 * superceedes previous interfaces provided with @ref IxEThAcc component.
10 *
11 * This API has been tested with the PHYs provided with the
12 * IXP400 development platforms. It may not work for specific Ethernet PHYs
13 * used on specific boards.
14 *
15 * This source code detects and interface the LXT972, LXT973 and KS6995
16 * Ethernet PHYs.
17 *
18 * This source code should be considered as an example which may need
19 * to be adapted for different hardware implementations.
20 *
21 * It is strongly recommended to use public domain and GPL utilities
22 * like libmii, mii-diag for MII interface support.
23 *
24 *
25 *
26 * @par
27 * IXP400 SW Release version 2.3
28 *
29 * -- Copyright Notice --
30 *
31 * @par
32 * Copyright (c) 2001-2005, Intel Corporation.
33 * All rights reserved.
34 *
35 * @par
36 * Redistribution and use in source and binary forms, with or without
37 * modification, are permitted provided that the following conditions
38 * are met:
39 * 1. Redistributions of source code must retain the above copyright
40 *    notice, this list of conditions and the following disclaimer.
41 * 2. Redistributions in binary form must reproduce the above copyright
42 *    notice, this list of conditions and the following disclaimer in the
43 *    documentation and/or other materials provided with the distribution.
44 * 3. Neither the name of the Intel Corporation nor the names of its contributors
45 *    may be used to endorse or promote products derived from this software
46 *    without specific prior written permission.
47 *
48 *
49 * @par
50 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
51 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
52 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
53 * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
54 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
55 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
56 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
57 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
58 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
59 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
60 * SUCH DAMAGE.
61 *
62 *
63 * @par
64 * -- End of Copyright Notice --
65 */
66
67#ifndef IxEthMii_H
68#define IxEthMii_H
69
70#include <IxTypes.h>
71
72/**
73 * @defgroup IxEthMii Intel (R) IXP400 Software Ethernet Phy Access (IxEthMii) API
74 *
75 * @brief ethMii is a library that does provides access to the
76 * Ethernet PHYs
77 *
78 *@{
79 */
80
81 /**
82  * @ingroup IxEthMii
83  *
84 * @fn  ixEthMiiPhyPresent(UINT32 phyAddr, BOOL *phyPresentPtr)
85 *
86 * @brief Scan the MDIO bus for given PHY.
87 *  This function looks for the PHY with the given address, and sets phyPresent to
88 *  TRUE if a phy is discovered at that address.
89 *
90 * - Reentrant    - no
91 * - ISR Callable - no
92 *
93 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
94 *
95 * @param phyAddr UINT32 [in] - address of PHY to search for.
96 * @param phyPresentPtr BOOL* [in] - pointer to boolean
97 *
98 * @return IX_STATUS
99 * - IX_ETH_ACC_SUCCESS
100 * - IX_ETH_ACC_FAIL : invalid arguments.
101 *
102 * <hr>
103 */
104PUBLIC IX_STATUS ixEthMiiPhyPresent(UINT32 phyAddr, BOOL *phyPresentPtr);
105
106/**
107 * @ingroup IxEthMii
108 *
109 * @fn  ixEthMiiPhyScan(BOOL phyPresent[], UINT32 maxPhyCount)
110 *
111 * @brief Scan the MDIO bus for PHYs
112 *  This function scans PHY addresses 0 through 31, and sets phyPresent[n] to
113 *  TRUE if a phy is discovered at address n.
114 *
115 * - Reentrant    - no
116 * - ISR Callable - no
117 *
118 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
119 *
120 * @param phyPresent BOOL [in] - boolean array of IXP400_ETH_ACC_MII_MAX_ADDR entries
121 * @param maxPhyCount UINT32 [in] - number of PHYs to search for (the scan will stop when
122 *         the indicated number of PHYs is found).
123 *
124 * @return IX_STATUS
125 * - IX_ETH_ACC_SUCCESS
126 * - IX_ETH_ACC_FAIL : invalid arguments.
127 *
128 * <hr>
129 */
130PUBLIC IX_STATUS ixEthMiiPhyScan(BOOL phyPresent[], UINT32 maxPhyCount);
131
132/**
133 * @ingroup IxEthMii
134 *
135 * @fn ixEthMiiPhyConfig(UINT32 phyAddr,
136                         BOOL speed100,
137                         BOOL fullDuplex,
138                         BOOL autonegotiate)
139 *
140 *
141 * @brief Configure a PHY
142 *   Configure a PHY's speed, duplex and autonegotiation status
143 *
144 * - Reentrant    - no
145 * - ISR Callable - no
146 *
147 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
148 *   
149 * @param phyAddr UINT32 [in]
150 * @param speed100 BOOL [in] - set to TRUE for 100Mbit/s operation, FALSE for 10Mbit/s
151 * @param fullDuplex BOOL [in] - set to TRUE for Full Duplex, FALSE for Half Duplex
152 * @param autonegotiate BOOL [in] - set to TRUE to enable autonegotiation
153 *
154 * @return IX_STATUS
155 * - IX_SUCCESS
156 * - IX_FAIL : invalid arguments.
157 *
158 * <hr>
159 */
160PUBLIC IX_STATUS ixEthMiiPhyConfig(UINT32 phyAddr,
161                                    BOOL speed100, 
162                                    BOOL fullDuplex, 
163                                    BOOL autonegotiate);
164
165/**
166 * @ingroup IxEthMii
167 *
168 * @fn ixEthMiiPhyLoopbackEnable(UINT32 phyAddr)
169 *
170 *
171 * @brief Enable PHY Loopback in a specific Eth MII port
172 *
173 * @note When PHY Loopback is enabled, frames sent out to the PHY from the
174 * IXP400 will be looped back to the IXP400. They will not be transmitted out
175 * on the wire.
176 *
177 * - Reentrant    - no
178 * - ISR Callable - no
179 *
180 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
181 *
182 * @return IX_STATUS
183 * - IX_SUCCESS
184 * - IX_FAIL : invalid arguments.
185 * <hr>
186 */
187PUBLIC IX_STATUS
188ixEthMiiPhyLoopbackEnable (UINT32 phyAddr);
189
190/**
191 * @ingroup IxEthMii
192 *
193 * @fn ixEthMiiPhyLoopbackDisable(UINT32 phyAddr)
194 *
195 *
196 * @brief Disable PHY Loopback in a specific Eth MII port
197 *
198 * - Reentrant    - no
199 * - ISR Callable - no
200 *   
201 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
202 *
203 * @return IX_STATUS
204 * - IX_SUCCESS
205 * - IX_FAIL : invalid arguments.
206 * <hr>
207 */
208PUBLIC IX_STATUS
209ixEthMiiPhyLoopbackDisable (UINT32 phyAddr);
210
211/**
212 * @ingroup IxEthMii
213 *
214 * @fn ixEthMiiPhyReset(UINT32 phyAddr)
215 *
216 * @brief Reset a PHY
217 *   Reset a PHY
218 *
219 * - Reentrant    - no
220 * - ISR Callable - no
221 *
222 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
223 *   
224 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
225 *
226 * @return IX_STATUS
227 * - IX_SUCCESS
228 * - IX_FAIL : invalid arguments.
229 *
230 * <hr>
231 */
232PUBLIC IX_STATUS ixEthMiiPhyReset(UINT32 phyAddr);
233
234
235/**
236 * @ingroup IxEthMii
237 *
238 * @fn ixEthMiiLinkStatus(UINT32 phyAddr,
239                          BOOL *linkUp,
240                          BOOL *speed100,
241                          BOOL *fullDuplex,
242                          BOOL *autoneg)
243 *
244 * @brief Retrieve the current status of a PHY
245 *   Retrieve the link, speed, duplex and autonegotiation status of a PHY
246 *
247 * - Reentrant    - no
248 * - ISR Callable - no
249 *
250 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
251 *   
252 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
253 * @param linkUp BOOL [out] - set to TRUE if the link is up
254 * @param speed100 BOOL [out] - set to TRUE indicates 100Mbit/s, FALSE indicates 10Mbit/s
255 * @param fullDuplex BOOL [out] - set to TRUE indicates Full Duplex, FALSE indicates Half Duplex
256 * @param autoneg BOOL [out] - set to TRUE indicates autonegotiation is enabled, FALSE indicates autonegotiation is disabled
257 *
258 * @return IX_STATUS
259 * - IX_SUCCESS
260 * - IX_FAIL : invalid arguments.
261 *
262 * <hr>
263 */
264PUBLIC IX_STATUS ixEthMiiLinkStatus(UINT32 phyAddr, 
265                                     BOOL *linkUp,
266                                     BOOL *speed100, 
267                                     BOOL *fullDuplex,
268                                     BOOL *autoneg);
269
270/**
271 * @ingroup IxEthMii
272 *
273 * @fn ixEthMiiPhyShow (UINT32 phyAddr)
274 *
275 *
276 * @brief Display information on a specified PHY
277 *   Display link status, speed, duplex and Auto Negotiation status
278 *
279 * - Reentrant    - no
280 * - ISR Callable - no
281 *
282 * @pre The MAC on Ethernet Port 2 (NPE C) must be initialised, and generating the MDIO clock.
283 *   
284 * @param phyAddr UINT32 [in] - the address of the Ethernet PHY (0-31)
285 *
286 * @return IX_STATUS
287 * - IX_SUCCESS
288 * - IX_FAIL : invalid arguments.
289 *
290 * <hr>
291 */
292PUBLIC IX_STATUS ixEthMiiPhyShow (UINT32 phyAddr);
293
294#endif /* ndef IxEthMii_H */
295/**
296 *@}
297 */
Note: See TracBrowser for help on using the repository browser.