1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2025-04-21 12:27:27 +03:00

ar71xx: allow to disable link polling on unused PHYs

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@31533 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
juhosg
2012-04-29 18:29:24 +00:00
parent b20dcb287e
commit f07500066e
3 changed files with 16 additions and 4 deletions

View File

@@ -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);
}