net: phy: micrel: disable broadcast for KSZ8081/KSZ8091
authorJohan Hovold <johan@kernel.org>
Tue, 11 Nov 2014 19:00:11 +0000 (20:00 +0100)
committerDavid S. Miller <davem@davemloft.net>
Wed, 12 Nov 2014 18:55:36 +0000 (13:55 -0500)
Disable PHY address 0 as the broadcast address, so that it can be used
as a unique (non-broadcast) address on a shared bus.

Note that this can also be configured using the B-CAST_OFF pin on
KSZ9091, but that KSZ8081 lacks this pin and is also limited to
addresses 0 and 3.

Specifically, this allows for dual KSZ8081 setups.

Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/micrel.c

index 21abe5ade3df05b6c86df0608fbf1aa419490c42..16135ac18bfe7e6ad9925405ac1a427e4db626a4 100644 (file)
@@ -243,6 +243,13 @@ static int ks8051_config_init(struct phy_device *phydev)
        return rc < 0 ? rc : 0;
 }
 
+static int ksz8081_config_init(struct phy_device *phydev)
+{
+       kszphy_broadcast_disable(phydev);
+
+       return 0;
+}
+
 static int ksz9021_load_values_from_of(struct phy_device *phydev,
                                       struct device_node *of_node, u16 reg,
                                       char *field1, char *field2,
@@ -605,7 +612,7 @@ static struct phy_driver ksphy_driver[] = {
        .phy_id_mask    = 0x00fffff0,
        .features       = (PHY_BASIC_FEATURES | SUPPORTED_Pause),
        .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
-       .config_init    = kszphy_config_init,
+       .config_init    = ksz8081_config_init,
        .config_aneg    = genphy_config_aneg,
        .read_status    = genphy_read_status,
        .ack_interrupt  = kszphy_ack_interrupt,