summaryrefslogtreecommitdiff
path: root/target/linux
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-03-13 17:29:36 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-03-13 17:29:36 +0000
commit7c9534cfd7dfaeef7869cc1bcf47a182bb785ce6 (patch)
tree9c56d71eb23c11d8c43ea956619b588bab546499 /target/linux
parent8449eecf5f5f842fb11fa38dd46459f9c28fdf15 (diff)
downloadmtk-20170518-7c9534cfd7dfaeef7869cc1bcf47a182bb785ce6.zip
mtk-20170518-7c9534cfd7dfaeef7869cc1bcf47a182bb785ce6.tar.gz
mtk-20170518-7c9534cfd7dfaeef7869cc1bcf47a182bb785ce6.tar.bz2
ar71xx: ag71xx: poll PHY status of all available switch ports
SVN-Revision: 30924
Diffstat (limited to 'target/linux')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
index 25ee7d4..f14b231 100644
--- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
+++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c
@@ -1070,11 +1070,12 @@ err_free:
static void link_function(struct work_struct *work) {
struct ag71xx *ag = container_of(work, struct ag71xx, link_work.work);
+ struct ar7240sw *as = ag->phy_priv;
unsigned long flags;
int i;
int status = 0;
- for (i = 0; i < 4; i++) {
+ for (i = 0; i < as->swdev.ports; i++) {
int link = ar7240sw_phy_read(ag->mii_bus, i, MII_BMSR);
if(link & BMSR_LSTATUS) {
status = 1;