mirror of https://github.com/hak5/openwrt.git
parent
a8d3109208
commit
3e3a4d3d6b
|
@ -721,6 +721,8 @@ void __init ath79_register_eth(unsigned int id)
|
|||
pdata->speed = SPEED_1000;
|
||||
pdata->duplex = DUPLEX_FULL;
|
||||
pdata->switch_data = &ath79_switch_data;
|
||||
|
||||
ath79_switch_data.phy_poll_mask |= BIT(4);
|
||||
}
|
||||
pdata->has_gbit = 1;
|
||||
pdata->is_ar724x = 1;
|
||||
|
@ -776,6 +778,8 @@ void __init ath79_register_eth(unsigned int id)
|
|||
pdata->speed = SPEED_1000;
|
||||
pdata->duplex = DUPLEX_FULL;
|
||||
pdata->switch_data = &ath79_switch_data;
|
||||
|
||||
ath79_switch_data.phy_poll_mask |= BIT(4);
|
||||
}
|
||||
|
||||
pdata->has_gbit = 1;
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
struct ag71xx_switch_platform_data {
|
||||
u8 phy4_mii_en:1;
|
||||
u8 phy_poll_mask;
|
||||
};
|
||||
|
||||
struct ag71xx_platform_data {
|
||||
|
|
|
@ -1115,11 +1115,18 @@ 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);
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue