projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a6228a
)
net: phy: fix auto negotiation checking for teranetics
author
Shaohui Xie
<
[email protected]
>
Fri, 24 Jul 2015 11:26:02 +0000
(19:26 +0800)
committer
David S. Miller
<
[email protected]
>
Mon, 27 Jul 2015 08:04:30 +0000
(
01:04
-0700)
When using fiber port, the phy cannot report it's auto negotiation state,
driver should always report auto negotiation is done when using fiber port.
Signed-off-by: Shaohui Xie <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/phy/teranetics.c
patch
|
blob
|
history
diff --git
a/drivers/net/phy/teranetics.c
b/drivers/net/phy/teranetics.c
index 7dcb5aada1c416bad656c1d57a6a6ecac149c3fa..91e1bec6079fafc20665a3d26949250da2817a55 100644
(file)
--- a/
drivers/net/phy/teranetics.c
+++ b/
drivers/net/phy/teranetics.c
@@
-51,8
+51,15
@@
static int teranetics_aneg_done(struct phy_device *phydev)
{
int reg;
- reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
- return (reg < 0) ? reg : (reg & BMSR_ANEGCOMPLETE);
+ /* auto negotiation state can only be checked when using copper
+ * port, if using fiber port, just lie it's done.
+ */
+ if (!phy_read_mmd(phydev, MDIO_MMD_VEND1, 93)) {
+ reg = phy_read_mmd(phydev, MDIO_MMD_AN, MDIO_STAT1);
+ return (reg < 0) ? reg : (reg & BMSR_ANEGCOMPLETE);
+ }
+
+ return 1;
}
static int teranetics_config_aneg(struct phy_device *phydev)