This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Eth PHY - configurable auto-negotiation timeout
- From: Gary Thomas <gary at mlbassoc dot com>
- To: eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: 07 Nov 2003 10:54:57 -0700
- Subject: Eth PHY - configurable auto-negotiation timeout
- Organization: MLB Associates
--
Gary Thomas <gary@mlbassoc.com>
MLB Associates
Index: devs/eth/phy/current/ChangeLog
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/phy/current/ChangeLog,v
retrieving revision 1.3
diff -u -5 -p -r1.3 ChangeLog
--- devs/eth/phy/current/ChangeLog 11 Sep 2003 13:10:19 -0000 1.3
+++ devs/eth/phy/current/ChangeLog 7 Nov 2003 17:53:59 -0000
@@ -1,5 +1,11 @@
+2003-11-07 Gary Thomas <gary@mlbassoc.com>
+
+ * src/DP83847.c:
+ * src/AM79C874.c:
+ * cdl/phy_eth_drivers.cdl: Make auto-negotiation timeout configurable.
+
2003-09-11 Gary Thomas <gary@mlbassoc.com>
* include/eth_phy.h: Minor improvement in status bitfield [comments]
* doc/eth_phy.sgml: New file - add basic documentation on PHY API.
Index: devs/eth/phy/current/cdl/phy_eth_drivers.cdl
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/phy/current/cdl/phy_eth_drivers.cdl,v
retrieving revision 1.2
diff -u -5 -p -r1.2 phy_eth_drivers.cdl
--- devs/eth/phy/current/cdl/phy_eth_drivers.cdl 26 Aug 2003 17:54:00 -0000 1.2
+++ devs/eth/phy/current/cdl/phy_eth_drivers.cdl 7 Nov 2003 17:50:16 -0000
@@ -58,10 +58,19 @@ cdl_package CYGPKG_DEVS_ETH_PHY {
include_dir cyg/io
compile eth_phy.c
+ cdl_option CYGINT_DEVS_ETH_PHY_AUTO_NEGOTIATION_TIME {
+ display "Time period (seconds) to wait for auto-negotiation"
+ flavor data
+ default_value 5
+ description "
+ The length of time to wait for auto-negotiation to complete
+ before giving up and declaring the link dead/missing."
+ }
+
cdl_option CYGHWR_DEVS_ETH_PHY_DP83847 {
display "NSDP83847"
flavor bool
default_value 0
compile -library=libextras.a DP83847.c
Index: devs/eth/phy/current/src/AM79C874.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/phy/current/src/AM79C874.c,v
retrieving revision 1.1
diff -u -5 -p -r1.1 AM79C874.c
--- devs/eth/phy/current/src/AM79C874.c 26 Aug 2003 17:54:00 -0000 1.1
+++ devs/eth/phy/current/src/AM79C874.c 7 Nov 2003 17:51:17 -0000
@@ -50,10 +50,12 @@
//####DESCRIPTIONEND####
//
//==========================================================================
#include <pkgconf/system.h>
+#include <pkgconf/devs_eth_phy.h>
+
#include <cyg/infra/cyg_type.h>
#include <cyg/infra/diag.h>
#include <cyg/hal/hal_arch.h>
#include <cyg/hal/drv_api.h>
@@ -70,11 +72,11 @@ static bool am79c874_stat(eth_phy_access
// Read negotiated state
if (_eth_phy_read(f, 0x1, f->phy_addr, &phy_state)) {
if ((phy_state & 0x20) == 0) {
diag_printf("... waiting for auto-negotiation");
- for (tries = 0; tries < 15; tries++) {
+ for (tries = 0; tries < CYGINT_DEVS_ETH_PHY_AUTO_NEGOTIATION_TIME; tries++) {
if (_eth_phy_read(f, 0x1, f->phy_addr, &phy_state)) {
if ((phy_state & 0x20) != 0) {
break;
}
}
Index: devs/eth/phy/current/src/DP83847.c
===================================================================
RCS file: /misc/cvsfiles/ecos/packages/devs/eth/phy/current/src/DP83847.c,v
retrieving revision 1.1
diff -u -5 -p -r1.1 DP83847.c
--- devs/eth/phy/current/src/DP83847.c 26 Aug 2003 17:54:00 -0000 1.1
+++ devs/eth/phy/current/src/DP83847.c 7 Nov 2003 17:51:18 -0000
@@ -50,10 +50,12 @@
//####DESCRIPTIONEND####
//
//==========================================================================
#include <pkgconf/system.h>
+#include <pkgconf/devs_eth_phy.h>
+
#include <cyg/infra/cyg_type.h>
#include <cyg/infra/diag.h>
#include <cyg/hal/hal_arch.h>
#include <cyg/hal/drv_api.h>
@@ -70,11 +72,11 @@ static bool dp83847_stat(eth_phy_access_
// Read negotiated state
if (_eth_phy_read(f, 0x10, f->phy_addr, &phy_state)) {
if ((phy_state & 0x10) == 0) {
diag_printf("... waiting for auto-negotiation");
- for (tries = 0; tries < 15; tries++) {
+ for (tries = 0; tries < CYGINT_DEVS_ETH_PHY_AUTO_NEGOTIATION_TIME; tries++) {
if (_eth_phy_read(f, 0x10, f->phy_addr, &phy_state)) {
if ((phy_state & 0x10) != 0) {
break;
}
}