From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752550AbaKKRoX (ORCPT ); Tue, 11 Nov 2014 12:44:23 -0500 Received: from mail-lb0-f182.google.com ([209.85.217.182]:34063 "EHLO mail-lb0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751631AbaKKRiq (ORCPT ); Tue, 11 Nov 2014 12:38:46 -0500 From: Johan Hovold To: Florian Fainelli Cc: "David S. Miller" , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Johan Hovold Subject: [PATCH 08/22] net: phy: micrel: disable broadcast for KSZ8081/KSZ8091 Date: Tue, 11 Nov 2014 18:37:26 +0100 Message-Id: <1415727460-20417-9-git-send-email-johan@kernel.org> X-Mailer: git-send-email 2.0.4 In-Reply-To: <1415727460-20417-1-git-send-email-johan@kernel.org> References: <1415727460-20417-1-git-send-email-johan@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/phy/micrel.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/micrel.c b/drivers/net/phy/micrel.c index 21abe5ade3df..16135ac18bfe 100644 --- a/drivers/net/phy/micrel.c +++ b/drivers/net/phy/micrel.c @@ -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, -- 2.0.4