Hi Biju, On Mon, Aug 2, 2021 at 12:27 PM Biju Das <biju.das.jz@xxxxxxxxxxxxxx> wrote: > The DMAC and EMAC blocks of Gigabit Ethernet IP found on RZ/G2L SoC are > similar to the R-Car Ethernet AVB IP. With a few changes in the driver we > can support both IPs. > > Currently a runtime decision based on the chip type is used to distinguish > the HW differences between the SoC families. > > The number of TX descriptors for R-Car Gen3 is 1 whereas on R-Car Gen2 and > RZ/G2L it is 2. For cases like this it is better to select the number of > TX descriptors by using a structure with a value, rather than a runtime > decision based on the chip type. > > This patch adds the num_tx_desc variable to struct ravb_hw_info and also > replaces the driver data chip type with struct ravb_hw_info by moving chip > type to it. > > Signed-off-by: Biju Das <biju.das.jz@xxxxxxxxxxxxxx> > Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@xxxxxxxxxxxxxx> Thanks for your patch! > --- a/drivers/net/ethernet/renesas/ravb.h > +++ b/drivers/net/ethernet/renesas/ravb.h > @@ -988,6 +988,11 @@ enum ravb_chip_id { > RCAR_GEN3, > }; > > +struct ravb_hw_info { > + enum ravb_chip_id chip_id; > + int num_tx_desc; Why not "unsigned int"? ... This comment applies to a few more subsequent patches. > +}; > + > struct ravb_private { > struct net_device *ndev; > struct platform_device *pdev; > @@ -1040,6 +1045,8 @@ struct ravb_private { > unsigned txcidm:1; /* TX Clock Internal Delay Mode */ > unsigned rgmii_override:1; /* Deprecated rgmii-*id behavior */ > int num_tx_desc; /* TX descriptors per packet */ ... oh, here's the original culprit. > + > + const struct ravb_hw_info *info; > }; > Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds