using genphy_parse_link seems not working here…code looks similar, structured differently, but does not work like this way:
ret = en8811h_get_autonego(phydev, &phydev->autoneg);
if (ret) {
printf("EN8811H get AN fail.\n");
return ret;
}
ret = genphy_parse_link(phydev);
printf("EN8811H genphy_parse_link (ret:%d)...\n",ret);
printf("EN8811H speed (after genphy): %d duplex: %d pause: %d asym_pause: %d\n",phydev->speed, phydev->duplex,phydev->pause,phydev->asym_pause);
EN8811H speed: 100 duplex: 1 pause: 0 asym_pause: 0
EN8811H BMSR_LSTATUS
EN8811H driver get autoneg.
EN8811H genphy_parse_link (ret:0)...
EN8811H speed (after genphy): 100 duplex: 1 pause: 0 asym_pause: 0
Using ethernet@15100000 device
ARP Retry count exceeded; starting again
ping failed; host 192.168.0.10 is not alive
BPI-R3M>
current code matches for LPA flags where genphy looks for SUPPORTED_1000baseT_Full
if (common_adv_gb & (LPA_1000FULL | LPA_1000HALF))
else if (common_adv & (LPA_100FULL | LPA_100HALF))
seems like current phy-driver does not set the phydev->supported field…so i added like this:
phydev->supported = ( SUPPORTED_1000baseT_Full | SUPPORTED_1000baseT_Half);
and genphy_parselink returns with
EN8811H speed (after genphy): 1000 duplex: 1 pause: 0 asym_pause: 0
but ping does not work ;(
something is still different…but output is same (and after adding the phylink-suported set i can change back the 1G-“fix” back to &)
EN8811H speed: 100 duplex: 1 pause: 0 asym_pause: 0
EN8811H BMSR_LSTATUS
EN8811H driver get autoneg.
EN8811H genphy_parse_link (ret:0)...
EN8811H (after genphy) speed: 1000 duplex: 1 pause: 0 asym_pause: 0
AN mode...SPEED 1000/100!
EN8811H speed detection (adv_gb: 0x00000800,adv: 0x00000101)...
EN8811H speed 1000...
EN8811H (after original code) speed: 1000 duplex: 1 pause: 0 asym_pause: 0
Using ethernet@15100000 device
host 192.168.0.10 is alive
BPI-R3M>
wonder why genphy is not enough…both seem to only read and set only the phydev members and do this to same values