This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

smsc lan91cxx link check patch


Hello Gary,

> This doesn't look very good to me - the delay for checking for an
> existing IP address should be at most 4 seconds and if this is too
> much for you, then perhaps that should be configurable.
>
> Alternatively, you could make the network initialization fail if not
> connected.  Look at the PowerPC/FCC driver for an example (it tests
> for the presence of the link or else it fails)
>
> --
> Gary Thomas <gary@mlbassoc.com>
> MLB Associates

Well,ok - then here is my smsc lan91cxx patch for checking the link on
initialization.
It is tested on EDOSK-2674 board and works well.

Index: devs/eth/smsc/lan91cxx/current/src/if_lan91cxx.c
===================================================================
--- old/if_lan91cxx.c 2004-01-06 23:46:50.000000000 +0100
+++ if_lan91cxx.c 2004-01-06 23:48:16.000000000 +0100
@@ -331,6 +331,15 @@
     put_reg(sc, LAN91CXX_RCR, 0);

     val = get_reg(sc, LAN91CXX_EPH_STATUS);
+#ifndef LAN91CXX_IS_LAN91C111
+    // LINK_OK on 91C111 is just a general purpose input and may not
+    // have anything to do with the link.
+    if (!(val & LAN91CXX_STATUS_LINK_OK)) {
+ db_printf("no link\n");
+        return false;  // Link not connected
+    }
+#endif
+

 #if DEBUG & 9
     db_printf("LAN91CXX - status: %04x\n", val);



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]