summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2012-08-09 15:49:51 +0800
committerSascha Hauer <s.hauer@pengutronix.de>2012-09-25 08:18:58 +0200
commit2263e27814f1db83745a9e65c373c957307c36a0 (patch)
treee0ce1c1acaef410531018e0d390854194ef91478 /net
parent26eab97b41da45353300d447870fe1c7fbfe7542 (diff)
downloadbarebox-2263e27814f1db83745a9e65c373c957307c36a0.tar.gz
barebox-2263e27814f1db83745a9e65c373c957307c36a0.tar.xz
net: introduce phylib
Adapt phylib from linux switch all the driver to it reimplement mii bus This will allow to have - phy drivers - to only connect the phy at then opening of the device - if the phy is not ready or not up fail on open Same behaviour as in linux and will allow to share code and simplify porting. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'net')
-rw-r--r--net/eth.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/net/eth.c b/net/eth.c
index c034eaae25..6cfe4f2bbc 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -27,7 +27,7 @@
#include <driver.h>
#include <init.h>
#include <net.h>
-#include <miidev.h>
+#include <linux/phy.h>
#include <errno.h>
#include <malloc.h>
@@ -139,7 +139,11 @@ int eth_send(void *packet, int length)
ret = eth_current->open(eth_current);
if (ret)
return ret;
- eth_current->active = 1;
+
+ if (eth_current->phydev)
+ eth_current->active = eth_current->phydev->link;
+ else
+ eth_current->active = 1;
}
led_trigger_network(LED_TRIGGER_NET_TX);