]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
net: phy: fixed: return an error for Clause 45 over 22 reads
authorFlorian Fainelli <f.fainelli@gmail.com>
Sat, 23 Aug 2014 01:55:42 +0000 (18:55 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sat, 23 Aug 2014 18:39:09 +0000 (11:39 -0700)
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>
drivers/net/phy/fixed.c

index d60d875cb4450ab6cf72114c35b4c816e2e031fd..5b19fbbda6d4fd4e2826d873470b60197017999f 100644 (file)
@@ -124,6 +124,17 @@ static int fixed_mdio_read(struct mii_bus *bus, int phy_addr, int reg_num)
        if (reg_num >= MII_REGS_NUM)
                return -1;
 
+       /* We do not support emulating Clause 45 over Clause 22 register reads
+        * return an error instead of bogus data.
+        */
+       switch (reg_num) {
+       case MII_MMD_CTRL:
+       case MII_MMD_DATA:
+               return -1;
+       default:
+               break;
+       }
+
        list_for_each_entry(fp, &fmb->phys, node) {
                if (fp->addr == phy_addr) {
                        /* Issue callback if user registered it. */