From patchwork Wed Jun 19 18:45:48 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartosz Golaszewski X-Patchwork-Id: 13704449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5295CC27C79 for ; Wed, 19 Jun 2024 18:46:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=DQB6Cx2g3Hd80tsoqIkz/xMhmvkJf1bvi8aoKUzsHuk=; b=FkM3oGV1NzCPhM8FPEljmquUpD bBTM8B3bYjrMM5+U52g7jddafbzzxjPwrl7KF1gizGZR6SXEjNsVefEvJ8R+MuudTkq2+G35JQZ8E +mRWXHNkmbLrh4FD965cPBWk+I2ohnhHb+x1Iy6h5RJXmdd6w6MzpgmszgF175zjCyFpd6OH5/QZx KyBiYTfnJM7W5LWjlSU5IMLqY6wFroppSyUkZcd3z5HSk5KyutE0/YqqUXjl51kriD73GilVrlLKI GgLfGM2sf2Be175GgGQIRuVhphvTKzcNlVhh+J8SnJyHDQqvBCOEc0xr/39UM7yxSugIeGPy0CNSx 7FipcOXg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK0K5-00000002Qdc-3u1K; Wed, 19 Jun 2024 18:46:21 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sK0Jv-00000002QVE-1tBG for linux-arm-kernel@lists.infradead.org; Wed, 19 Jun 2024 18:46:12 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42172ab4b60so1204065e9.0 for ; Wed, 19 Jun 2024 11:46:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bgdev-pl.20230601.gappssmtp.com; s=20230601; t=1718822769; x=1719427569; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DQB6Cx2g3Hd80tsoqIkz/xMhmvkJf1bvi8aoKUzsHuk=; b=1mLhl+vRyzcCsiIfXZa48JSVjwf36kauCfeDKEQ2mxvR619tZxZgJhZw5Zw/YpJJAW tS6aWMTUHfkq+G0HGQwsoCmx+s8r849HP+gTVhTdnXKHLxe2Brpf35vyeK+9K9aOlLvD t/ij0OyH0syW2PzNfubGtfytFs6MVA6992ZAs2BFqvOnHcuLBWPKKNL5xKvVhEg8G5me IECscbwlboYsIKv/wBcQRgX6xLXnt0BQ356uPN1q+0aCiQ+uLwtJ7FxKjPfAJb2HX6mi hCydJ+vncquAAflSzrt97DdRCEBWz2Sin1G/FP3WZSbpgq01588deiSqoDSTO3FmQAp8 uiUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718822769; x=1719427569; h=content-transfer-encoding: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=DQB6Cx2g3Hd80tsoqIkz/xMhmvkJf1bvi8aoKUzsHuk=; b=Z6Wob0oExiqHbjzE5hMWOBJzP8Pdjjb/WbxCHapB4F3YxWiGmccjvqhD6ESTZZlHFY w4hKBfq0qew1vDLU5ckpHFknMFJ5/ZNJwW3ezmlLlrfmUflhQf6LahsiphL1Q0enKnFT sLvJ3iFUZAs1GHXO8/vWUUh2S3+vvj1F3FFVMBmUBIOg7BNsCn973S5adp6YBTySZNXk ue6wlkRtdPjP7XBqP7Dqn4KrtW2ld19ZMa997yVLSq7OiifTIeXEPYHGer+LWP4h4tXi bN/COgdwgOMv10gb4V4rfbDjJ9kKac1tAYA87X67AHOGGURN9gx5j/Ku9kX4GrJf6pHW gXXA== X-Forwarded-Encrypted: i=1; AJvYcCV0fVMYy8TUsm0TqRkr0VByJNkZhuS8WyxnLBFLuVvsnN0VFo4EvtPH33OboU8cbfwo7XOGW3rQmd6N6w27qcFyHCuOtBHbE/GNd26VkQS983nS6uM= X-Gm-Message-State: AOJu0YygQ/NzHCcWI5OmRxHvHJ2VwX7JI0DyTMrVvMzCsYzL99ES7Tmd IdRS628epP1s+p/09ec08S5CXRTZOVAI5Zx8I0PuD37CmxjIqJJmarAOFMgvij0= X-Google-Smtp-Source: AGHT+IFc10tmtmw3xb52p2cInNEHf/dEPq+PJZ9vw9EtMnLBEOS8Dh29bqwtYNyT87EfbHfTnNwe9A== X-Received: by 2002:a5d:4902:0:b0:35f:2002:3033 with SMTP id ffacd0b85a97d-36317d75626mr2704226f8f.37.1718822769540; Wed, 19 Jun 2024 11:46:09 -0700 (PDT) Received: from brgl-uxlite.home ([2a01:cb1d:dc:7e00:991f:deb8:4c5d:d73d]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-36098c8c596sm7594156f8f.14.2024.06.19.11.46.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Jun 2024 11:46:09 -0700 (PDT) From: Bartosz Golaszewski To: Vinod Koul , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Andrew Lunn , Heiner Kallweit , Russell King Cc: netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski Subject: [PATCH net-next 7/8] net: stmmac: provide the open() callback Date: Wed, 19 Jun 2024 20:45:48 +0200 Message-ID: <20240619184550.34524-8-brgl@bgdev.pl> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619184550.34524-1-brgl@bgdev.pl> References: <20240619184550.34524-1-brgl@bgdev.pl> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_114611_518122_EE3CE738 X-CRM114-Status: GOOD ( 12.18 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Bartosz Golaszewski Provide drivers with means of injecting additional code into the stmmac_open() function. Signed-off-by: Bartosz Golaszewski --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++ include/linux/stmmac.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 644bc8a24661..5f628176d994 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -3953,6 +3953,9 @@ static int __stmmac_open(struct net_device *dev, if (ret < 0) return ret; + if (priv->plat->open) + priv->plat->open(dev, priv->plat->bsp_priv); + if ((!priv->hw->xpcs || xpcs_get_an_mode(priv->hw->xpcs, mode) != DW_AN_C73)) { ret = stmmac_init_phy(dev); diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index 9dc54d6d65ae..59991b38cadb 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h @@ -262,6 +262,7 @@ struct plat_stmmacenet_data { void (*serdes_powerdown)(struct net_device *ndev, void *priv); void (*speed_mode_2500)(struct net_device *ndev, void *priv); void (*ptp_clk_freq_config)(struct stmmac_priv *priv); + void (*open)(struct net_device *ndev, void *priv); int (*init)(struct platform_device *pdev, void *priv); void (*exit)(struct platform_device *pdev, void *priv); struct mac_device_info *(*setup)(void *priv);