aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorBen Dooks <ben-linux@fluff.org>2008-06-24 17:16:03 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-06-24 22:57:58 -0400
commitaa1eb452e8d8a97ee65ace0054e7a733ae12cf6d (patch)
tree2fd50def329fa3c7ee6ce8441f7941d548b09f6c /drivers/net
parentf8d79e79a1700fdcf26a1dfcaefad905b1279600 (diff)
DM9000: Use NSR to determine link-status on internal PHY
The DM9000_NSR register contains a copy of the internal PHY's link status which we can use to determine if the link is up or down. This eliminates the more costly (and sleeping) PHY read when using the DM9000's own PHY. Signed-off-by: Ben Dooks <ben-linux@fluff.org> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/dm9000.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 679c291107f5..7c38f6129b55 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -473,7 +473,14 @@ static int dm9000_nway_reset(struct net_device *dev)
473static u32 dm9000_get_link(struct net_device *dev) 473static u32 dm9000_get_link(struct net_device *dev)
474{ 474{
475 board_info_t *dm = to_dm9000_board(dev); 475 board_info_t *dm = to_dm9000_board(dev);
476 return mii_link_ok(&dm->mii); 476 u32 ret;
477
478 if (dm->flags & DM9000_PLATF_EXT_PHY)
479 ret = mii_link_ok(&dm->mii);
480 else
481 ret = dm9000_read_locked(dm, DM9000_NSR) & NSR_LINKST ? 1 : 0;
482
483 return ret;
477} 484}
478 485
479#define DM_EEPROM_MAGIC (0x444D394B) 486#define DM_EEPROM_MAGIC (0x444D394B)