Skip to content

Commit

Permalink
[PATCH] phy address mask support for generic phy layer
Browse files Browse the repository at this point in the history
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: Matt Porter <mporter@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
  • Loading branch information
Matt Porter authored and Jeff Garzik committed Nov 5, 2005
1 parent 4371dc6 commit f896424
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/phy/mdio_bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ int mdiobus_register(struct mii_bus *bus)
for (i = 0; i < PHY_MAX_ADDR; i++) {
struct phy_device *phydev;

if (bus->phy_mask & (1 << i))
continue;

phydev = get_phy_device(bus, i);

if (IS_ERR(phydev))
Expand Down
3 changes: 3 additions & 0 deletions include/linux/phy.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@ struct mii_bus {
/* list of all PHYs on bus */
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
* interrupt at the index matching its address */
int *irq;
Expand Down

0 comments on commit f896424

Please sign in to comment.