RE: [PATCH net-next V2 2/7] net: enetc: netc-blk-ctrl: factor out common link MII protocol helpers
From: Wei Fang
Date: Fri Nov 27 2026 - 05:17:43 EST
> #define IMX95_CFG_LINK_PCS_PROT(a) (0x8 + (a) * 4)
> @@ -78,6 +77,9 @@
> #define IMX95_ENETC0_BUS_DEVFN 0x0
> #define IMX95_ENETC1_BUS_DEVFN 0x40
> #define IMX95_ENETC2_BUS_DEVFN 0x80
> +#define IMX95_ENETC0_LINK 0
> +#define IMX95_ENETC1_LINK 1
> +#define IMX95_ENETC2_LINK 2
It can be simplified as follows:
#define IMX95_ENETC_LINK(a) (a)
Also, IMX94_ENETC0/1/2_LINK can be refined as follows:
#define IMX94_ENETC_LINK(a) (3 + (a))
>
> #define IMX94_ENETC0_BUS_DEVFN 0x100
> #define IMX94_ENETC1_BUS_DEVFN 0x140
> @@ -95,8 +97,15 @@
> /* Flags for different platforms */
> #define NETC_HAS_NETCMIX BIT(0)
>
> +struct netc_link {
> + u32 bus_devfn;
> + u8 link_id;
> +};
This only applies to ENETC links. Would it be more appropriate to
name it netc_enetc_link?