From patchwork Tue May 16 23:17:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Fainelli X-Patchwork-Id: 13243990 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 20FE51427F for ; Tue, 16 May 2023 23:17:29 +0000 (UTC) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FF0F7DA0 for ; Tue, 16 May 2023 16:17:25 -0700 (PDT) Received: by mail-qv1-xf35.google.com with SMTP id 6a1803df08f44-619be7d7211so739846d6.3 for ; Tue, 16 May 2023 16:17:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1684279043; x=1686871043; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=gjSDn3+Sy0xt0PplRVyfEfkAPiPn/l95ri3Yvrqhh9g=; b=Yx9NwrXaI/KMTrnvdxRo2paStmQ6FD356rAPADbzFVJaQWpBXI0JF4Cgque4TwdHR3 PJjq2MAZQzDGUvdBtq9n1LnZdhHbdLQQnR/L91J/Taa3FYquSiWmlHQkcr9K9HgQvsCB trt51LRBumDYdnrO2XavQVtiQYAiiNnV9C6zo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684279044; x=1686871044; 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=gjSDn3+Sy0xt0PplRVyfEfkAPiPn/l95ri3Yvrqhh9g=; b=kHRXDYSXIbwPd1JFTlMKLJrQJxssOO7mDoDJ2qI99+xJ0h2Rji8GiNjZPqtOc/qwWg T+B2H3z2AgoxKlacdVUVwaSn0QqjM7mgL133gAZ/JrBjfI9X3cMynHm3nEdpjqK2c5bI W3aqH0X+I1UEalf4J9zNHBxaOvb1eCXjqsdxz4mRLm+q5UH+lmPOKdpHS+FTxQ8wZxmm tWGA35fJ4a44z9C6QtQb2YPI8cpiQIZLmhRDlRi7O94q/OkGJ15EsnUj7ZRi2HeaBzSE IFTh+3/2Dev+KONQXvDx2nAcRFa3BVHQtFj8QbkFjQ7HINU/xPmhzgnZRuF3dYAfRn24 K/6A== X-Gm-Message-State: AC+VfDy0DRbDbLNyye4K/rwf7ISwAqYuS5MTbvf1+8y8OSO/9OYl+dHK 9HW7EOjFZEsooaXRnjEgbEZS/NbUz5zVWwF6R3O+HXhpOiAnfszoVkuA0et5LsuOXTOqJrEy7Ax UB3HlbloXIr2685xOcE2L2mqugsCWI/4HyVFfo07oolNXeii6ZQvLEYyPdF4JtzlMC0BnGU9X+h 1oU8BufHVTvQ== X-Google-Smtp-Source: ACHHUZ5mIy3oebGw2B2l1bD0DWTnGxsSCSW83O8QTYdfVq17rltJO5eMvsrDghdDsEciPe8Vg9tgAg== X-Received: by 2002:a05:6214:21aa:b0:5b9:ff75:a011 with SMTP id t10-20020a05621421aa00b005b9ff75a011mr56863191qvc.48.1684279043563; Tue, 16 May 2023 16:17:23 -0700 (PDT) Received: from fainelli-desktop.igp.broadcom.net ([192.19.223.252]) by smtp.gmail.com with ESMTPSA id g17-20020a0cf851000000b0061b7784b3basm5495427qvo.84.2023.05.16.16.17.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 May 2023 16:17:23 -0700 (PDT) From: Florian Fainelli To: netdev@vger.kernel.org Cc: Florian Fainelli , Doug Berger , Florian Fainelli , Broadcom internal kernel review list , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Andrew Lunn , Heiner Kallweit , Russell King , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net-next 3/3] net: bcmgenet: Interrogate PHY for WAKE_FILTER programming Date: Tue, 16 May 2023 16:17:13 -0700 Message-Id: <20230516231713.2882879-4-florian.fainelli@broadcom.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230516231713.2882879-1-florian.fainelli@broadcom.com> References: <20230516231713.2882879-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_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE,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 Determine whether the PHY can support waking up from the user programmed network filter, and if it can utilize it. Signed-off-by: Florian Fainelli > --- drivers/net/ethernet/broadcom/genet/bcmgenet.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c index f28ffc31df22..bbd9d4b73402 100644 --- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c +++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c @@ -1527,6 +1527,12 @@ static int bcmgenet_set_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd) struct bcmgenet_priv *priv = netdev_priv(dev); int err = 0; + if (dev->phydev) { + err = phy_ethtool_set_rxnfc(dev->phydev, cmd); + if (err != -EOPNOTSUPP) + return err; + } + switch (cmd->cmd) { case ETHTOOL_SRXCLSRLINS: err = bcmgenet_insert_flow(dev, cmd); @@ -1582,6 +1588,12 @@ static int bcmgenet_get_rxnfc(struct net_device *dev, struct ethtool_rxnfc *cmd, int err = 0; int i = 0; + if (dev->phydev) { + err = phy_ethtool_get_rxnfc(dev->phydev, cmd, rule_locs); + if (err != -EOPNOTSUPP) + return err; + } + switch (cmd->cmd) { case ETHTOOL_GRXRINGS: cmd->data = priv->hw_params->rx_queues ?: 1;