I generate the ethtool source code with command bitbake ethtool -c patch -f and find them in build_<platform>/tmp/work/<core>-fsl-linux/ethtool/4.0-r0/ethtool-4.0/.
Also, I get kernel source code with command bitbake virtual/kernel -c patch -f in inbuild_<platform>/tmp/work/<platform>-fsl-linux/linux-qoriq/<version>/git/,
In this directory, source files drivers/net/ethernet/intel/e1000/e1000_ethtool.c, drivers/net/mii.c and drivers/net/mdio.c are related.
However I don't know, how to use this source files to read and write by MDIO interface?