net: mvmdio: check the MII_ADDR_C45 bit is not set for smi operations
authorAntoine Ténart <antoine.tenart@free-electrons.com>
Thu, 15 Jun 2017 14:43:22 +0000 (16:43 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Jun 2017 16:27:12 +0000 (12:27 -0400)
Add a check for the read and write smi operations, to ensure the
MII_ADDR_C45 bit isn't set. This will be needed as soon as the xSMI
support is added to the mvmdio driver.

Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mvmdio.c

index e4aa8e2d2e8aa06d61b23edf59dae091fcf98e01..fe6072aae0a67ba2c91cdc6571285fcd35b3db17 100644 (file)
@@ -126,6 +126,9 @@ static int orion_mdio_read(struct mii_bus *bus, int mii_id,
        u32 val;
        int ret;
 
+       if (regnum & MII_ADDR_C45)
+               return -EOPNOTSUPP;
+
        ret = orion_mdio_wait_ready(&orion_mdio_smi_ops, bus);
        if (ret < 0)
                goto out;
@@ -157,6 +160,9 @@ static int orion_mdio_write(struct mii_bus *bus, int mii_id,
        struct orion_mdio_dev *dev = bus->priv;
        int ret;
 
+       if (regnum & MII_ADDR_C45)
+               return -EOPNOTSUPP;
+
        ret = orion_mdio_wait_ready(&orion_mdio_smi_ops, bus);
        if (ret < 0)
                goto out;