> Looking at the i2c dumps, and some past dumps from the igb driver, > it's dawning on me on me that the igb driver, without much hacking, > would try to read the PHY ID from the DMI/DDM block - a case which > the drivers/net/phy/mdio-i2c.c specifically avoids :-)
It avoids if for a very good reason. This driver exports a standard Linux MDIO bus. The core phylib code will then probe the bus, read the IDs, find the correct PHY driver and loads it. It is probably good that you spend some time looking at a driver other than igb. Picking one i know a little, say the Freescale FEC. It has functions to perform MDIO read and MDIO write. These are then exported as an MDIO bus to the linux common code. And there are a few calls to phy_connect(), phy_start(), phy_stop(). That is how you build a driver which uses the code in drivers/net/phy. mvneta shows how you can use phylink. Study these two far a while. Andrew