From: Thangaraj Samynathan <thangaraj.s@microchip.com>
To: <netdev@vger.kernel.org>
Cc: <andrew+netdev@lunn.ch>, <davem@davemloft.net>,
<edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>,
<bryan.whitehead@microchip.com>, <UNGLinuxDriver@microchip.com>,
<linux@armlinux.org.uk>, <linux-kernel@vger.kernel.org>
Subject: [PATCH net-next v3 1/5] net: lan743x: rename is_sgmii_en to is_pcs_en
Date: Fri, 8 May 2026 10:51:46 +0530 [thread overview]
Message-ID: <20260508052150.11852-2-thangaraj.s@microchip.com> (raw)
In-Reply-To: <20260508052150.11852-1-thangaraj.s@microchip.com>
The flag is_sgmii_en indicates whether the PCS interface is enabled.
However, the name implies that the interface is strictly SGMII, which is
misleading.
Rename the variable to is_pcs_en to better reflect that the flag
represents the PCS enable state rather than a specific interface mode.
Update all references and logs accordingly (but keep device registers
unchanged to match its documentation).
No functional change intended.
Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
---
.../net/ethernet/microchip/lan743x_ethtool.c | 4 ++--
drivers/net/ethernet/microchip/lan743x_main.c | 18 +++++++++---------
drivers/net/ethernet/microchip/lan743x_main.h | 2 +-
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/drivers/net/ethernet/microchip/lan743x_ethtool.c b/drivers/net/ethernet/microchip/lan743x_ethtool.c
index 9195419ecee0..743acfd56554 100644
--- a/drivers/net/ethernet/microchip/lan743x_ethtool.c
+++ b/drivers/net/ethernet/microchip/lan743x_ethtool.c
@@ -1312,7 +1312,7 @@ static int lan743x_get_regs_len(struct net_device *dev)
struct lan743x_adapter *adapter = netdev_priv(dev);
u32 num_regs = MAX_LAN743X_ETH_COMMON_REGS;
- if (adapter->is_sgmii_en)
+ if (adapter->is_pcs_en)
num_regs += MAX_LAN743X_ETH_SGMII_REGS;
return num_regs * sizeof(u32);
@@ -1333,7 +1333,7 @@ static void lan743x_get_regs(struct net_device *dev,
lan743x_common_regs(dev, p);
p = (u32 *)p + MAX_LAN743X_ETH_COMMON_REGS;
- if (adapter->is_sgmii_en) {
+ if (adapter->is_pcs_en) {
lan743x_sgmii_regs(dev, p);
p = (u32 *)p + MAX_LAN743X_ETH_SGMII_REGS;
}
diff --git a/drivers/net/ethernet/microchip/lan743x_main.c b/drivers/net/ethernet/microchip/lan743x_main.c
index f3332417162e..fad4a246e06e 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.c
+++ b/drivers/net/ethernet/microchip/lan743x_main.c
@@ -59,22 +59,22 @@ static void pci11x1x_strap_get_status(struct lan743x_adapter *adapter)
hw_cfg & HW_CFG_RST_PROTECT_)) ||
(strap & STRAP_READ_USE_SGMII_EN_)) {
if (strap & STRAP_READ_SGMII_EN_)
- adapter->is_sgmii_en = true;
+ adapter->is_pcs_en = true;
else
- adapter->is_sgmii_en = false;
+ adapter->is_pcs_en = false;
} else {
fpga_rev = lan743x_csr_read(adapter, FPGA_REV);
if (fpga_rev) {
if (fpga_rev & FPGA_SGMII_OP)
- adapter->is_sgmii_en = true;
+ adapter->is_pcs_en = true;
else
- adapter->is_sgmii_en = false;
+ adapter->is_pcs_en = false;
} else {
- adapter->is_sgmii_en = false;
+ adapter->is_pcs_en = false;
}
}
netif_dbg(adapter, drv, adapter->netdev,
- "SGMII I/F %sable\n", adapter->is_sgmii_en ? "En" : "Dis");
+ "PCS I/F %s\n", str_enable_disable(adapter->is_pcs_en));
}
static bool is_pci11x1x_chip(struct lan743x_adapter *adapter)
@@ -1361,7 +1361,7 @@ static void lan743x_phy_interface_select(struct lan743x_adapter *adapter)
data = lan743x_csr_read(adapter, MAC_CR);
id_rev = adapter->csr.id_rev & ID_REV_ID_MASK_;
- if (adapter->is_pci11x1x && adapter->is_sgmii_en)
+ if (adapter->is_pci11x1x && adapter->is_pcs_en)
adapter->phy_interface = PHY_INTERFACE_MODE_SGMII;
else if (id_rev == ID_REV_ID_LAN7430_)
adapter->phy_interface = PHY_INTERFACE_MODE_GMII;
@@ -3515,7 +3515,7 @@ static int lan743x_hardware_init(struct lan743x_adapter *adapter,
mutex_init(&adapter->sgmii_rw_lock);
pci11x1x_set_rfe_rd_fifo_threshold(adapter);
sgmii_ctl = lan743x_csr_read(adapter, SGMII_CTL);
- if (adapter->is_sgmii_en) {
+ if (adapter->is_pcs_en) {
sgmii_ctl |= SGMII_CTL_SGMII_ENABLE_;
sgmii_ctl &= ~SGMII_CTL_SGMII_POWER_DN_;
} else {
@@ -3580,7 +3580,7 @@ static int lan743x_mdiobus_init(struct lan743x_adapter *adapter)
adapter->mdiobus->priv = (void *)adapter;
if (adapter->is_pci11x1x) {
- if (adapter->is_sgmii_en) {
+ if (adapter->is_pcs_en) {
netif_dbg(adapter, drv, adapter->netdev,
"SGMII operation\n");
adapter->mdiobus->read = lan743x_mdiobus_read_c22;
diff --git a/drivers/net/ethernet/microchip/lan743x_main.h b/drivers/net/ethernet/microchip/lan743x_main.h
index 160d94a7cee6..f0fa0580b04e 100644
--- a/drivers/net/ethernet/microchip/lan743x_main.h
+++ b/drivers/net/ethernet/microchip/lan743x_main.h
@@ -1070,7 +1070,7 @@ struct lan743x_adapter {
struct lan743x_tx tx[PCI11X1X_USED_TX_CHANNELS];
struct lan743x_rx rx[LAN743X_USED_RX_CHANNELS];
bool is_pci11x1x;
- bool is_sgmii_en;
+ bool is_pcs_en;
/* protect ethernet syslock */
spinlock_t eth_syslock_spinlock;
bool eth_syslock_en;
--
2.34.1
next prev parent reply other threads:[~2026-05-08 5:22 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 5:21 [PATCH net-next v3 0/5] net: lan743x: Add SFP support for PCI11x1x Thangaraj Samynathan
2026-05-08 5:21 ` Thangaraj Samynathan [this message]
2026-05-08 5:21 ` [PATCH net-next v3 2/5] net: lan743x: read SFP straps from PCI11x1x device Thangaraj Samynathan
2026-05-12 2:08 ` Jakub Kicinski
2026-05-08 5:21 ` [PATCH net-next v3 3/5] net: lan743x: Add support to software-nodes for SFP Thangaraj Samynathan
2026-05-12 2:08 ` Jakub Kicinski
2026-05-08 5:21 ` [PATCH net-next v3 4/5] net: lan743x: Register SFP platform device for PCI11x1x Thangaraj Samynathan
2026-05-12 2:08 ` Jakub Kicinski
2026-05-08 5:21 ` [PATCH net-next v3 5/5] net: lan743x: Add PCS/XPCS support for SFP on PCI11x1x Thangaraj Samynathan
2026-05-12 2:08 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260508052150.11852-2-thangaraj.s@microchip.com \
--to=thangaraj.s@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew+netdev@lunn.ch \
--cc=bryan.whitehead@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox