But what does that have to do with the shared structure? I don't think
you have to "bundle" the shared structure with the "access the global
registers" method.
We don't need to. But it would be a good way to clean up code which
locks the mdio bus, does a register access on some other device, and
then unlocks the bus.
As a general rule of thumb, it is better to have the core do the
locking, rather than the driver. Driver writers don't always think
about locking, so it is better to give driver writers safe APIs to
use.
I'm making the assumption that all global addresses are at the baseGet the core to do reference counting on the structure?The "base" access is another thing, I guess, which has nothing to do
Add helpers phy_read_shared(), phy_write_shared(), etc, which does
MDIO accesses on the base device, taking care of the locking.
with the shared structure.
address. If we don't want to make that assumption, we need the change
the API above so you pass a cookie, and all PHYs need to use the same
cookie to identify the package.
Maybe base is the wrong name, since MSCC can have the base as the high
address of the four, not the low?