aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/ar71xx/files/drivers
diff options
context:
space:
mode:
authorGabor Juhos <juhosg@openwrt.org>2012-04-29 18:29:24 +0000
committerGabor Juhos <juhosg@openwrt.org>2012-04-29 18:29:24 +0000
commit01bea635cbe73129de41e5baf41a2b3cab5d43d5 (patch)
tree8c0368352567cf0b7a28d7147345492387ae356c /target/linux/ar71xx/files/drivers
parentca5d892a23dd15a82a4b4e0c0c1a07a82adb7624 (diff)
downloadupstream-01bea635cbe73129de41e5baf41a2b3cab5d43d5.tar.gz
upstream-01bea635cbe73129de41e5baf41a2b3cab5d43d5.tar.bz2
upstream-01bea635cbe73129de41e5baf41a2b3cab5d43d5.zip
ar71xx: allow to disable link polling on unused PHYs
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31533 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/ar71xx/files/drivers')
-rw-r--r--target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c15
1 files changed, 11 insertions, 4 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 fc8b6d53eb..49f077520b 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
@@ -1115,19 +1115,26 @@ 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;
+ u8 mask;
int i;
int status = 0;
- for (i = 0; i < as->swdev.ports; i++) {
- int link = ar7240sw_phy_read(ag->mii_bus, i, MII_BMSR);
- if(link & BMSR_LSTATUS) {
+ mask = ~as->swdata->phy_poll_mask;
+ for (i = 0; i < AR7240_NUM_PHYS; i++) {
+ int link;
+
+ if (!(mask & BIT(i)))
+ continue;
+
+ link = ar7240sw_phy_read(ag->mii_bus, i, MII_BMSR);
+ if (link & BMSR_LSTATUS) {
status = 1;
break;
}
}
spin_lock_irqsave(&ag->lock, flags);
- if(status != ag->link) {
+ if (status != ag->link) {
ag->link = status;
ag71xx_link_adjust(ag);
}