I'm writing a rather peculiar software, that runs in an equally peculiar scenario
Basically I can't have kernel modules, all the devices are "kernel-builtin", and there are about two Tulip cards, each quad-ethernet, plus two more VIA, also quad-ethernet
There are too many network ports ... but that's not the problem, when it comes to the fact that only the Tulips offer "CPU offloading" and are capable of working in extra-jumbo.
I work with several kernels, some of the old 4 family, some of the 5 family, some of the 6 family, all compiled for the same target, even if not always both types of network cards are installed.
Sometimes only the Tulips, sometimes only the VIAs, sometimes there are also some 3Coms.
To make it short, and for how my software works, I would need to know which driver is associated with a network interface.
eth0 <---- SoC built-in
eth1 <---- Tulips? Via? 3Com? Other? Which kernel driver?
...
ethN <---- Tulips? Via? 3Com? Other? Which kernel driver?
How can I get this information?
# ls /sys/class/net/eth*/
I looked into something like this, but is seems it doesn't export anything about the kernel driver.
As a temporary solution, I identify the driver by the mac-address.
That is, I made a table of all the mac-addresses of all the network cards used.
But it is not practical .... at the moment it is a file with about 242 lines!