aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2014-08-22 21:55:42 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-23 14:39:09 -0400
commita2dbba7674468ad03aa6cf4378ed0965f453e034 (patch)
treecb80f62a71331df216ddeaf3f9a0dda6a5c3f949
parent9df54ddab9aa91d53b672b1c0efbeb5d07919e66 (diff)
net: phy: fixed: return an error for Clause 45 over 22 reads
The fixed PHY driver does not properly emulate Clause 45 over Clause 22 MDIO reads, and as such, will return bogus values when we access such registers. Return an error when accessing these registers in order to prevent advertising bogus capabilities such as EEE support and such. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/phy/fixed.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index d60d875cb445..5b19fbbda6d4 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -124,6 +124,17 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
124 if (reg_num >= MII_REGS_NUM) 124 if (reg_num >= MII_REGS_NUM)
125 return -1; 125 return -1;
126 126
127 /* We do not support emulating Clause 45 over Clause 22 register reads
128 * return an error instead of bogus data.
129 */
130 switch (reg_num) {
131 case MII_MMD_CTRL:
132 case MII_MMD_DATA:
133 return -1;
134 default:
135 break;
136 }
137
127 list_for_each_entry(fp, &fmb->phys, node) { 138 list_for_each_entry(fp, &fmb->phys, node) {
128 if (fp->addr == phy_addr) { 139 if (fp->addr == phy_addr) {
129 /* Issue callback if user registered it. */ 140 /* Issue callback if user registered it. */