ar71xx: ag71xx: poll PHY status of all available switch ports
authorGabor Juhos <juhosg@openwrt.org>
Tue, 13 Mar 2012 17:29:36 +0000 (17:29 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Tue, 13 Mar 2012 17:29:36 +0000 (17:29 +0000)
SVN-Revision: 30924

target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_ar7240.c

index 25ee7d4f14e626e31f9b1c62255ad70268173e44..f14b23121ac0701aea4c976e38aa99bcaba3c7da 100644 (file)
@@ -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;