From: Jonas Jelonek Date: Mon, 25 May 2026 17:06:41 +0000 (+0000) Subject: realtek: pcs: add per-link port storage to rtpcs_serdes X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=c4f5c34fa4eaee7622aeae41009c1efe980b591e;p=thirdparty%2Fopenwrt.git 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) Link: https://github.com/openwrt/openwrt/pull/23539 Signed-off-by: Jonas Jelonek --- diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index a7bfb6cfc9f..507bb1bbe1a 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -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)