Commit f896424c authored by Matt Porter's avatar Matt Porter Committed by Jeff Garzik

[PATCH] phy address mask support for generic phy layer

Adds a phy_mask field to struct mii_bus and uses it.  This field
indicates each phy address to be ignored when probing the mdio bus.

This support is needed for the fs_enet and ibm_emac drivers to be
converted to the generic phy layer among other drivers. Many systems
lock up on probing certain phy addresses or probing doesn't return
0xffff when nothing is found at the address. A new driver I'm
working on also makes use of this mask.
Signed-off-by: default avatarMatt Porter <mporter@kernel.crashing.org>
Signed-off-by: default avatarJeff Garzik <jgarzik@pobox.com>
parent 4371dc6c
...@@ -61,6 +61,9 @@ int mdiobus_register(struct mii_bus *bus) ...@@ -61,6 +61,9 @@ int mdiobus_register(struct mii_bus *bus)
for (i = 0; i < PHY_MAX_ADDR; i++) { for (i = 0; i < PHY_MAX_ADDR; i++) {
struct phy_device *phydev; struct phy_device *phydev;
if (bus->phy_mask & (1 << i))
continue;
phydev = get_phy_device(bus, i); phydev = get_phy_device(bus, i);
if (IS_ERR(phydev)) if (IS_ERR(phydev))
......
...@@ -72,6 +72,9 @@ struct mii_bus { ...@@ -72,6 +72,9 @@ struct mii_bus {
/* list of all PHYs on bus */ /* list of all PHYs on bus */
struct phy_device *phy_map[PHY_MAX_ADDR]; struct phy_device *phy_map[PHY_MAX_ADDR];
/* Phy addresses to be ignored when probing */
u32 phy_mask;
/* Pointer to an array of interrupts, each PHY's /* Pointer to an array of interrupts, each PHY's
* interrupt at the index matching its address */ * interrupt at the index matching its address */
int *irq; int *irq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment