From patchwork Fri Apr 19 09:03:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13635977 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9CF2B7580B; Fri, 19 Apr 2024 09:04:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713517450; cv=none; b=B9Ps6UEHoy8CoX5mKtRWUhHes3i2GskYLuz2ycs9YN7oUWsZL/kHY9iD/2Y+i4ioV7CyfzOonL5x8tjU0lccudnv9JsREQfzbxsyVfWwHuBDVY9JMH8KmzTVHoC9PLppeiE/ZNxYZJ6hoOkoNpOqZVCInD5o7FVdITgqyPG1syo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713517450; c=relaxed/simple; bh=CqFOLW57OsSaPgqpmoP9GqLHbrWurxYyi2L/kr/r3Yo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rJT+STw28RA1AoXWlsio0hSiY28YSt7jmK+aUzePJSYTddQ8+OYLk0S8WqYTwTlrmZToHNYx4sUnHy1bV4+RUvq9ZN/9febTfzuG7HFL7OpTTYIlqXYQSlRfYkVpfyTbI/gudckHQgoT/+cVUE6KIS9jgqCgRDl0gigsNYirX/A= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BqLsvaBo; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BqLsvaBo" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2db101c11feso12263661fa.0; Fri, 19 Apr 2024 02:04:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713517447; x=1714122247; darn=vger.kernel.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=2+UxECjZ2bOznPZSMcj9cuChQ4TT4LhNaweaduToB00=; b=BqLsvaBo4zVhb8tmSOx6qtXdr7uiwKZ0lWNSugujeiEUjT+K2j72VJ9sZRqwbzoPU4 D6AQmwuM1W3pf5dmXk4HIKz7pr/1P+QbPm/tokPTCZhUWS8JGD3tP04WDYscZnSmBvD9 LhDVDsDVhI6zac24kGSQHKgVyx5LyZYPjGDmKwrmrg4c8TrbiiqJjqitxnO+YiyswOVr xDO91XXa4N8es0UI9l8YvcFRID1JaldyS9Pm+HUE0JrUkjj52jifWBh5IlCmpMjamSvN Ga9M/kMb4K19bFVA0C+1MR5kGVzeTfWp1kVpvyICymqBGgjbNZ2fZOygKRCqX7qefzEV Ujog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713517447; x=1714122247; 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=2+UxECjZ2bOznPZSMcj9cuChQ4TT4LhNaweaduToB00=; b=W42F7Xe12TjiX9FLiyLhYJr5ZIiLFGnW4veynKeOz3qLYxP+aQBM+1NNsSPt3kUi63 31OFkQKSKzyqPFkHcgOoSp6NjN0z4nR3ScoBs8Xf/GeqV8+NsfgJMSCfSsQW0qAxUXKO RpKpSKU2XxQEe16mFIOHafsGWhfV9/ACEIXuMf1zPt/JE/3lBgkAroMkjxZktwGz269X lO0BNsRwPHZOCDyDQxSEcmvLq8Py2sgNV6GNqbA2QyhfN5EykPr4H3cMSqZ3phZtX4wv FDk3UrVN78WjvLMVy8QL/b3BvKcfLORF53UU1/YZAL122lQBeinjXaFkt7GQnHS05MbM 6qng== X-Forwarded-Encrypted: i=1; AJvYcCVOf6fsVUZOGF5ZtLqEj85d5om/8sZh2iYx944VNuaSFdXFRTPCcZ2ao0r+Bi8dYqgOFlxLqSM/iIczS1b4hVOnMQLUfYx9HF7n4ymLc0PgihwjvnQl1KZpZWe1ovToLmB095FS X-Gm-Message-State: AOJu0YzBJW+Z5Hn2lya3gPDU9ljTAZIFhtr6oDmo4C9ukvHdip1bZ01O iDrBqH4Z23y2hws1eGJKMJRNd4l9yxzi0ikDQ4cSIaYDXhxwvF5V X-Google-Smtp-Source: AGHT+IFH89zQPQ3GixxrpiN7kS+j8bXFxn8wZiGxujO3H0oIWI/CEKmSLCc+cQUZORC9BEhMDNEbYw== X-Received: by 2002:a2e:b94d:0:b0:2d8:606d:c797 with SMTP id 13-20020a2eb94d000000b002d8606dc797mr507570ljs.10.1713517446579; Fri, 19 Apr 2024 02:04:06 -0700 (PDT) Received: from localhost (srv1.baikalchip.ru. [87.245.175.227]) by smtp.gmail.com with ESMTPSA id l2-20020a2e7002000000b002d9ff7ff007sm523884ljc.40.2024.04.19.02.04.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:04:06 -0700 (PDT) From: Serge Semin To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Yanteng Si , Romain Gantois , Maxime Coquelin Cc: Serge Semin , Simon Horman , Huacai Chen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH RESEND net-next v3 1/2] net: stmmac: Rename phylink_get_caps() callback to update_caps() Date: Fri, 19 Apr 2024 12:03:05 +0300 Message-ID: <20240419090357.5547-2-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240419090357.5547-1-fancer.lancer@gmail.com> References: <20240419090357.5547-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Since recent commits the stmmac_ops::phylink_get_caps() callback has no longer been responsible for the phylink MAC capabilities getting, but merely updates the MAC capabilities in the mac_device_info::link::caps field. Rename the callback to comply with the what the method does now. Signed-off-by: Serge Semin Reviewed-by: Romain Gantois --- Link: https://lore.kernel.org/netdev/20240412180340.7965-5-fancer.lancer@gmail.com/ Changelog v2: - This is a new patch created based on the discussion around patch #4 in the series above. --- drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c | 8 ++++---- drivers/net/ethernet/stmicro/stmmac/hwif.h | 8 ++++---- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c index a38226d7cc6a..b25774d69195 100644 --- a/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac4_core.c @@ -68,7 +68,7 @@ static void dwmac4_core_init(struct mac_device_info *hw, init_waitqueue_head(&priv->tstamp_busy_wait); } -static void dwmac4_phylink_get_caps(struct stmmac_priv *priv) +static void dwmac4_update_caps(struct stmmac_priv *priv) { if (priv->plat->tx_queues_to_use > 1) priv->hw->link.caps &= ~(MAC_10HD | MAC_100HD | MAC_1000HD); @@ -1190,7 +1190,7 @@ static void dwmac4_set_hw_vlan_mode(struct mac_device_info *hw) const struct stmmac_ops dwmac4_ops = { .core_init = dwmac4_core_init, - .phylink_get_caps = dwmac4_phylink_get_caps, + .update_caps = dwmac4_update_caps, .set_mac = stmmac_set_mac, .rx_ipc = dwmac4_rx_ipc_enable, .rx_queue_enable = dwmac4_rx_queue_enable, @@ -1235,7 +1235,7 @@ const struct stmmac_ops dwmac4_ops = { const struct stmmac_ops dwmac410_ops = { .core_init = dwmac4_core_init, - .phylink_get_caps = dwmac4_phylink_get_caps, + .update_caps = dwmac4_update_caps, .set_mac = stmmac_dwmac4_set_mac, .rx_ipc = dwmac4_rx_ipc_enable, .rx_queue_enable = dwmac4_rx_queue_enable, @@ -1284,7 +1284,7 @@ const struct stmmac_ops dwmac410_ops = { const struct stmmac_ops dwmac510_ops = { .core_init = dwmac4_core_init, - .phylink_get_caps = dwmac4_phylink_get_caps, + .update_caps = dwmac4_update_caps, .set_mac = stmmac_dwmac4_set_mac, .rx_ipc = dwmac4_rx_ipc_enable, .rx_queue_enable = dwmac4_rx_queue_enable, diff --git a/drivers/net/ethernet/stmicro/stmmac/hwif.h b/drivers/net/ethernet/stmicro/stmmac/hwif.h index 7be04b54738b..90384db228b5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/hwif.h +++ b/drivers/net/ethernet/stmicro/stmmac/hwif.h @@ -308,8 +308,8 @@ struct stmmac_est; struct stmmac_ops { /* MAC core initialization */ void (*core_init)(struct mac_device_info *hw, struct net_device *dev); - /* Get phylink capabilities */ - void (*phylink_get_caps)(struct stmmac_priv *priv); + /* Update MAC capabilities */ + void (*update_caps)(struct stmmac_priv *priv); /* Enable the MAC RX/TX */ void (*set_mac)(void __iomem *ioaddr, bool enable); /* Enable and verify that the IPC module is supported */ @@ -430,8 +430,8 @@ struct stmmac_ops { #define stmmac_core_init(__priv, __args...) \ stmmac_do_void_callback(__priv, mac, core_init, __args) -#define stmmac_mac_phylink_get_caps(__priv) \ - stmmac_do_void_callback(__priv, mac, phylink_get_caps, __priv) +#define stmmac_mac_update_caps(__priv) \ + stmmac_do_void_callback(__priv, mac, update_caps, __priv) #define stmmac_mac_set(__priv, __args...) \ stmmac_do_void_callback(__priv, mac, set_mac, __args) #define stmmac_rx_ipc(__priv, __args...) \ diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index 7c6fb14b5555..b810f6b69bf5 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -1225,8 +1225,8 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) xpcs_get_interfaces(priv->hw->xpcs, priv->phylink_config.supported_interfaces); - /* Get the MAC specific capabilities */ - stmmac_mac_phylink_get_caps(priv); + /* Refresh the MAC-specific capabilities */ + stmmac_mac_update_caps(priv); priv->phylink_config.mac_capabilities = priv->hw->link.caps; @@ -7341,7 +7341,7 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt) priv->rss.table[i] = ethtool_rxfh_indir_default(i, rx_cnt); - stmmac_mac_phylink_get_caps(priv); + stmmac_mac_update_caps(priv); priv->phylink_config.mac_capabilities = priv->hw->link.caps; From patchwork Fri Apr 19 09:03:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Serge Semin X-Patchwork-Id: 13635978 X-Patchwork-Delegate: kuba@kernel.org Received: from mail-lj1-f176.google.com (mail-lj1-f176.google.com [209.85.208.176]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2D6CB79949; Fri, 19 Apr 2024 09:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713517451; cv=none; b=HB7JVpB61UECjp72jkqgw0AnfcePg8cDUIzoWgSYFCYm9OaKV8iHKLi44ZmSVdsb0WXPlmDh/k1IYm+03sTr8qIjlFsKPDvWA8QU+1S9TqYtpuZCz3xr1wOa2HpHHj3rnHmkeOwHUyU50VDVxj6yvfamZ84XPBwVFK7n8u2VMXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713517451; c=relaxed/simple; bh=yYoDQShDvmrOZ9K2+7B7afIlK5+dkxlsEVPcBywafew=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Grs+LnMfkUckmP3gBGEo72evk+4qagvCCimbBZr7VGRBN2Qxj/P/rLXfovudsbfMm2vwoxfxwE3eCmHVVMN/x51c/oZPj3LXwo7GBf8r0OEKLhD2el3xuJFWpYgT2EIc4AZGEovV+Ia+wiJ0sMxXvnC80OCxTY5Nebmw4TbAEx0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=NAOuEUb7; arc=none smtp.client-ip=209.85.208.176 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NAOuEUb7" Received: by mail-lj1-f176.google.com with SMTP id 38308e7fff4ca-2da01cb187cso31191721fa.0; Fri, 19 Apr 2024 02:04:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713517448; x=1714122248; darn=vger.kernel.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=rgMQYr4oV4JNndEuD2biU5vQV/pnebRAnRkbrVejXaA=; b=NAOuEUb7WgJEj8njit/zXVSz0BKrQR4AWPES9QfrV2/yjdWc8nrl4EdwHRXXxxFIXz 9QsB7uyD3UeUSM3IP0CJ0GUplyTlsrfkqbEf1NdzIODSkG7yD+aY6MiLBdjmJcDUVsO/ i0MxP/a8+P1WbBHBndeDZwOm43rGiJLn3Drmaa7y3CyqU5Z6XfuRLRTw0+wj08dYeKts scDamhWSGV9hNSI4RLJsaK90gwbEotpyTg7gxEFGMjOY4N6cL4EJ5/MN0IyJPRpKQOC/ 7KIRM+lWoUz33iz/5f6xKfW3FW7vU5p7OX9YxTAHftcCMMAp/eu699BVuHgmeh67Pq6t Mxqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713517448; x=1714122248; 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=rgMQYr4oV4JNndEuD2biU5vQV/pnebRAnRkbrVejXaA=; b=hGLoFd06nLSmTtdbdzPGtKE/nDEnjwR+0mxM1ErzqTb9Rz5rGQ70q/YykacLPVx38U wEWyaH4QgiHrN+aNyHcjGzs8UboPPUrrwrncIa8yABtTH1QxVMH/j7O6w65KU13WoRXQ gfWADzNf4eLDYUO8BxXRuC7TNy9lczsHOvEwi0+0iM5ti8qSJC5k0DdzVYMscrVM8pVf lEw+PKlx+wOxyZAPewoCm1r/aqYdHifxRyMFxcyUM3JdPcxmuO8pnmO+hEJ4HWSdtTSh eASCVFfJCxYsqsJ4K/2ZjoAQCYA3qsUiOIUAdaSn/1sMHeZGe6PBF2X8Vgu7g1tdPZVY nspA== X-Forwarded-Encrypted: i=1; AJvYcCVvXtBrjU7QCbYIQb3UygH7d9hLqFQCIjlIQr/vs7VxiTn9egT4YLQa4/PFEheYWmNSOsLc9gFrB/EVv3ebevyjaamwn93T59jR/hd2SdXuNhLbq3wHUCCoC3XZLuzrT3OwknXZ X-Gm-Message-State: AOJu0YxMhJu3PlWkqXWwnI5nIqotsfsdLMeQ1YP67UPWsfLvVOhjcTAA QdlyFWFkQIKjACzycdusmvJpKt8XlsjmAf2JV54UUaCQY+UCbIJg X-Google-Smtp-Source: AGHT+IHQi06xeUbRVNwJPi1rGkVQYXntNtrD89Vy0P8/uMlqN9zH9EDGdcfcGdRrkx/08kp0eZERLQ== X-Received: by 2002:a2e:2a46:0:b0:2d4:7455:89f6 with SMTP id q67-20020a2e2a46000000b002d4745589f6mr1137769ljq.40.1713517448297; Fri, 19 Apr 2024 02:04:08 -0700 (PDT) Received: from localhost (srv1.baikalchip.ru. [87.245.175.227]) by smtp.gmail.com with ESMTPSA id h25-20020a2e3a19000000b002da968f03f9sm520526lja.89.2024.04.19.02.04.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 02:04:07 -0700 (PDT) From: Serge Semin To: Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Russell King , Yanteng Si , Romain Gantois , Maxime Coquelin Cc: Serge Semin , Simon Horman , Huacai Chen , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH RESEND net-next v3 2/2] net: stmmac: Move MAC caps init to phylink MAC caps getter Date: Fri, 19 Apr 2024 12:03:06 +0300 Message-ID: <20240419090357.5547-3-fancer.lancer@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240419090357.5547-1-fancer.lancer@gmail.com> References: <20240419090357.5547-1-fancer.lancer@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org After a set of recent fixes the stmmac_phy_setup() and stmmac_reinit_queues() methods have turned to having some duplicated code. Let's get rid from the duplication by moving the MAC-capabilities initialization to the PHYLINK MAC-capabilities getter. The getter is called during each network device interface open/close cycle. So the MAC-capabilities will be initialized in generic device open procedure and in case of the Tx/Rx queues re-initialization as the original code semantics implies. Signed-off-by: Serge Semin Reviewed-by: Romain Gantois --- Link: https://lore.kernel.org/netdev/20240412180340.7965-5-fancer.lancer@gmail.com/ Changelog v2: - Resubmit the patch to net-next separately from the main patchset (Paolo) --- .../net/ethernet/stmicro/stmmac/stmmac_main.c | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b810f6b69bf5..0d6cd1704e6a 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -936,6 +936,22 @@ static void stmmac_mac_flow_ctrl(struct stmmac_priv *priv, u32 duplex) priv->pause, tx_cnt); } +static unsigned long stmmac_mac_get_caps(struct phylink_config *config, + phy_interface_t interface) +{ + struct stmmac_priv *priv = netdev_priv(to_net_dev(config->dev)); + + /* Refresh the MAC-specific capabilities */ + stmmac_mac_update_caps(priv); + + config->mac_capabilities = priv->hw->link.caps; + + if (priv->plat->max_speed) + phylink_limit_mac_speed(config, priv->plat->max_speed); + + return config->mac_capabilities; +} + static struct phylink_pcs *stmmac_mac_select_pcs(struct phylink_config *config, phy_interface_t interface) { @@ -1105,6 +1121,7 @@ static void stmmac_mac_link_up(struct phylink_config *config, } static const struct phylink_mac_ops stmmac_phylink_mac_ops = { + .mac_get_caps = stmmac_mac_get_caps, .mac_select_pcs = stmmac_mac_select_pcs, .mac_config = stmmac_mac_config, .mac_link_down = stmmac_mac_link_down, @@ -1204,7 +1221,6 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) int mode = priv->plat->phy_interface; struct fwnode_handle *fwnode; struct phylink *phylink; - int max_speed; priv->phylink_config.dev = &priv->dev->dev; priv->phylink_config.type = PHYLINK_NETDEV; @@ -1225,15 +1241,6 @@ static int stmmac_phy_setup(struct stmmac_priv *priv) xpcs_get_interfaces(priv->hw->xpcs, priv->phylink_config.supported_interfaces); - /* Refresh the MAC-specific capabilities */ - stmmac_mac_update_caps(priv); - - priv->phylink_config.mac_capabilities = priv->hw->link.caps; - - max_speed = priv->plat->max_speed; - if (max_speed) - phylink_limit_mac_speed(&priv->phylink_config, max_speed); - fwnode = priv->plat->port_node; if (!fwnode) fwnode = dev_fwnode(priv->device); @@ -7327,7 +7334,6 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt) { struct stmmac_priv *priv = netdev_priv(dev); int ret = 0, i; - int max_speed; if (netif_running(dev)) stmmac_release(dev); @@ -7341,14 +7347,6 @@ int stmmac_reinit_queues(struct net_device *dev, u32 rx_cnt, u32 tx_cnt) priv->rss.table[i] = ethtool_rxfh_indir_default(i, rx_cnt); - stmmac_mac_update_caps(priv); - - priv->phylink_config.mac_capabilities = priv->hw->link.caps; - - max_speed = priv->plat->max_speed; - if (max_speed) - phylink_limit_mac_speed(&priv->phylink_config, max_speed); - stmmac_napi_add(dev); if (netif_running(dev))