The KSZ9477 maintains the SGMII port's state for speed, duplex and link
status to be able to fixup the accesses to its internal older version of
the Designware XPCS. However, it does so by embedding a full instance of
struct phy_device, only to use the 'speed', 'link' and 'duplex' fields.
This is also only used for the SGMII port, it's otherwise unused for all
other regular ports.
Replace that with simple int/bool values.
Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20260319181705.1576679-1-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
else
duplex = DUPLEX_HALF;
- if (!p->phydev.link ||
- p->phydev.speed != speed ||
- p->phydev.duplex != duplex) {
+ if (!p->link || p->speed != speed ||
+ p->duplex != duplex) {
u16 ctrl;
- p->phydev.link = 1;
- p->phydev.speed = speed;
- p->phydev.duplex = duplex;
+ p->link = true;
+ p->speed = speed;
+ p->duplex = duplex;
port_sgmii_r(dev, port, mmd, MII_BMCR,
&ctrl);
ctrl &= BMCR_ANENABLE;
ctrl);
}
} else {
- p->phydev.link = 0;
+ p->link = false;
}
} else if (reg == MII_BMSR) {
- p->phydev.link = !!(val & BMSR_LSTATUS);
+ p->link = !!(val & BMSR_LSTATUS);
}
}
val = 0x0700;
break;
case MII_STAT1000:
- if (p->phydev.speed == SPEED_1000)
+ if (p->speed == SPEED_1000)
val = 0x3800;
else
val = 0;
if (dev->info->internal_phy[port])
return;
- p->phydev.speed = speed;
+ p->speed = speed;
ksz_port_set_xmii_speed(dev, port, speed);
bool learning;
bool isolated;
int stp_state;
- struct phy_device phydev;
+ int speed;
+ int duplex;
+ bool link;
u32 fiber:1; /* port is fiber */
u32 force:1;