1
1

realtek: pcs: add per-link port storage to rtpcs_serdes

Add an s16 link_port[] array to struct rtpcs_serdes, initialised to
-1 in probe. This is preparatory storage for the port number that
each link serves; it will be populated in the follow-up fwnode_pcs
migration commit by scanning consumer DT nodes for their reg, and
consumed by the resolver when allocating rtpcs_link.

Assisted-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Link: https://github.com/openwrt/openwrt/pull/23539
Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
This commit is contained in:
Jonas Jelonek 2026-05-25 17:06:41 +00:00
parent dbd9a35bf3
commit c4f5c34fa4
No known key found for this signature in database

View File

@ -221,6 +221,7 @@ struct rtpcs_serdes {
struct regmap_field *usxgmii_submode; /* nullable, 93xx only */
} swcore_regs;
struct rtpcs_link *link[RTPCS_MAX_LINKS_PER_SDS];
s16 link_port[RTPCS_MAX_LINKS_PER_SDS];
enum rtpcs_sds_mode hw_mode;
u8 id;
@ -4308,6 +4309,8 @@ static int rtpcs_probe(struct platform_device *pdev)
sds->id = i;
sds->ops = ctrl->cfg->sds_ops;
sds->regs = ctrl->cfg->sds_regs;
for (int j = 0; j < RTPCS_MAX_LINKS_PER_SDS; j++)
sds->link_port[j] = -1;
ret = ctrl->cfg->sds_probe(sds);
if (ret)