summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2008-04-09 19:38:13 -0500
committerJeff Garzik <jgarzik@redhat.com>2008-04-16 20:09:35 -0400
commit9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0 (patch)
tree51b2ee6bfa87bbd6faac0bc00a787354e1fb72a0 /include
parentd080cd6301e107e79c6a0fc654319f8979f70549 (diff)
phy: Change mii_bus id field to a string
Having the id field be an int was making more complex bus topologies excessively difficult. For now, just convert it to a string, and change all instances of "bus->id = val" to snprintf(id, MII_BUS_ID_LEN, "%x", val). Signed-off-by: Andy Fleming <afleming@freescale.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/fsl_devices.h2
-rw-r--r--include/linux/phy.h12
2 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 1831b196c70a..2cad5c67397e 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -50,7 +50,7 @@ struct gianfar_platform_data {
u32 device_flags;
/* board specific information */
u32 board_flags;
- u32 bus_id;
+ char bus_id[MII_BUS_ID_SIZE];
u32 phy_id;
u8 mac_addr[6];
phy_interface_t interface;
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 5e43ae751412..6509f377bb10 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -63,8 +63,6 @@ typedef enum {
PHY_INTERFACE_MODE_RTBI
} phy_interface_t;
-#define MII_BUS_MAX 4
-
#define PHY_INIT_TIMEOUT 100000
#define PHY_STATE_TIME 1
@@ -74,13 +72,19 @@ typedef enum {
#define PHY_MAX_ADDR 32
/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
-#define PHY_ID_FMT "%x:%02x"
+#define PHY_ID_FMT "%s:%02x"
+
+/*
+ * Need to be a little smaller than phydev->dev.bus_id to leave room
+ * for the ":%02x"
+ */
+#define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3)
/* The Bus class for PHYs. Devices which provide access to
* PHYs should register using this structure */
struct mii_bus {
const char *name;
- int id;
+ char id[MII_BUS_ID_SIZE];
void *priv;
int (*read)(struct mii_bus *bus, int phy_id, int regnum);
int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);