From patchwork Wed Oct 11 22:12:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13418011 X-Patchwork-Delegate: kuba@kernel.org Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net [23.128.96.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4544C9CA50 for ; Wed, 11 Oct 2023 22:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="JA9ZddAP" Received: from mail-qk1-x72f.google.com (mail-qk1-x72f.google.com [IPv6:2607:f8b0:4864:20::72f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B7778B7 for ; Wed, 11 Oct 2023 15:13:14 -0700 (PDT) Received: by mail-qk1-x72f.google.com with SMTP id af79cd13be357-77574c2cffdso25353685a.0 for ; Wed, 11 Oct 2023 15:13:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1697062393; x=1697667193; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=vgBfKQI+bcdgnUJLRPi9K81lb/kb64EIO01uYuyTmK0=; b=JA9ZddAPaJ0APLyfYFthnNPHid8AaQ661BB5lnhtU1OoWfMXmzQZSYvf+iiOyON/CD BPzJuCrF5+KmVchpQ8/P37kTYEnthE35G4aVWw+vzOnW/lFLb3nDwHCi81h34QGHrmyM CtHDB6kt05apJdif1+y916xs/prEE/iV+koEo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697062393; x=1697667193; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=vgBfKQI+bcdgnUJLRPi9K81lb/kb64EIO01uYuyTmK0=; b=O5j6pIv0u4+X2qqr8/YuNUVEWBSdoRK5QGJY04sRu5HsIixhqjqfp7oz9AJ6DtOZLy DGvZfE07lEUDPA4RXf09Pr7oUNtjiLCKfreVmFGIvz63MXSAUz5tCuUW+pu6aFKKJhF7 SUC+YcYLABjNKvzUeer85+Ky0e6cdj9NG12+sZbwIdBTw8JYFU0P4+cV6SJ5JEU3Vyof fNu9un3twL+RDZpinToKPLcZY55uTMcVZZcvZScX6hUDm9QE6h0VKFIy/7NvcNM3uE72 wgLXEdN8ZwLue+JlCuOxDCtkfOB1n96MhQxdeyHKep05V/U6fqnAKgkwdkUUGopFKg7v vOQQ== X-Gm-Message-State: AOJu0YzxF6TP6KfeN85Q88Ab41bOooPxkF3GwkEoxq6JWMcbOwSGFxiq zBjhVchrIIKfQC44vj3sUi/LV1opTfzXjaEQGDr/qbRslOvF0afz2uZhtyn8Ky6PwTExGlk9Tv+ l/Zhu3+bBaKdJNQ5BTzJzCPHYzxUA9/5UC2QfBg+G603ZD9gsG2xAmPHuBF7Ys8azqnncBF7jsl 3pJksqdobo/w== X-Google-Smtp-Source: AGHT+IE0DsHWYfnklFYHHNKa9TfNNc/z6g4z5e4XKLQqLNohgJTeJLS1BbSIiD6Ara1XTcHPYgRnjQ== X-Received: by 2002:a05:620a:c45:b0:76c:b7f0:2bc9 with SMTP id u5-20020a05620a0c4500b0076cb7f02bc9mr27782993qki.16.1697062393404; Wed, 11 Oct 2023 15:13:13 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id a12-20020a05620a102c00b007759a81d88esm5505705qkk.50.2023.10.11.15.13.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 15:13:12 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Broadcom internal kernel review list , Andrew Lunn , Heiner Kallweit , Russell King , opendmb@gmail.com, justin.chen@broadcom.com, Michal Kubecek Subject: [PATCH net-next 2/2] net: phy: broadcom: Add support for WAKE_MDA Date: Wed, 11 Oct 2023 15:12:41 -0700 Message-Id: <20231011221242.4180589-4-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231011221242.4180589-1-florian.fainelli@broadcom.com> References: <20231011221242.4180589-1-florian.fainelli@broadcom.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net X-Patchwork-Delegate: kuba@kernel.org Add support for waking-up from a custom MAC destination address which involves programming the BCM54XX_WOL_MPD_DATA2() and BCM54XX_WOL_MASK() register groups. Signed-off-by: Florian Fainelli --- drivers/net/phy/bcm-phy-lib.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/phy/bcm-phy-lib.c b/drivers/net/phy/bcm-phy-lib.c index 876f28fd8256..00c0424f7b63 100644 --- a/drivers/net/phy/bcm-phy-lib.c +++ b/drivers/net/phy/bcm-phy-lib.c @@ -827,7 +827,8 @@ EXPORT_SYMBOL_GPL(bcm_phy_cable_test_get_status_rdb); WAKE_MCAST | \ WAKE_BCAST | \ WAKE_MAGIC | \ - WAKE_MAGICSECURE) + WAKE_MAGICSECURE | \ + WAKE_MDA) int bcm_phy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) { @@ -908,6 +909,8 @@ int bcm_phy_set_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) eth_broadcast_addr(da); } else if (wol->wolopts & WAKE_MAGICSECURE) { ether_addr_copy(da, wol->sopass); + } else if (wol->wolopts & WAKE_MDA) { + ether_addr_copy(da, wol->mac_da); } else if (wol->wolopts & WAKE_MAGIC) { memset(da, 0, sizeof(da)); memset(mask, 0xff, sizeof(mask)); @@ -1010,6 +1013,8 @@ void bcm_phy_get_wol(struct phy_device *phydev, struct ethtool_wolinfo *wol) } if (ctl & BCM54XX_WOL_DIR_PKT_EN) { + memcpy(wol->mac_da, da, sizeof(da)); + wol->wolopts |= WAKE_MDA; if (is_broadcast_ether_addr(da)) wol->wolopts |= WAKE_BCAST; else if (is_multicast_ether_addr(da))