Re: [RFC PATCH net-next 1/6] net: ethernet: implement OPEN Alliance control transaction interface

From: Parthiban.Veerasooran
Date: Thu Sep 21 2023 - 14:35:51 EST


Hi Andrew,

On 13/09/23 7:02 am, Andrew Lunn wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
>
>> If I understand you correctly, this framework has to include the module
>> initialization as well using the below APIs and has to be compiled as a
>> loadable module so that other vendors module can make use of this, isn't it?
>>
>> module_init(oa_tc6_init);
>> module_exit(oa_tc6_exit);
>
> You should not need these, unless there is actions which need to be
> taken when the module is loaded. If there are no actions, it is purely
> a library, don't have them. The module dependency tracking code will
> see that the MAC driver modules has dependencies on symbols in this
> library module, and will load it first. The MAC driver is then loaded,
> and the kernel linker will resolve the missing symbols in the MAC
> driver to those in the library. It also means that there is only ever
> one copy of the library in the kernel, even if there is multiple MAC
> drivers using it.
Ah ok. Actually I missed including this library in the Kconfig and Makefile.

So drivers/net/ethernet/Kconfig file should contain the below,

config OA_TC6
tristate "OPEN Alliance TC6 10BASE-T1x MAC-PHY support"
depends on SPI
select PHYLIB

help
This library implements OPEN Alliance TC6 10BASE-T1x MAC-PHY
Serial Interface protocol for supporting 10BASE-T1x MAC-PHYs.

The drivers/net/ethernet/Makefile file should contain the below,

obj-$(CONFIG_OA_TC6) += oa_tc6.o

Is this you expected right?

Best Regards,
Parthiban V
>
> Andrew
>