aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2008-04-09 20:38:13 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-04-16 20:09:35 -0400
commit9d9326d3bc0ea9a8bbe40bf3e5e66c7b9858caa0 (patch)
tree51b2ee6bfa87bbd6faac0bc00a787354e1fb72a0 /include/linux/phy.h
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/linux/phy.h')
-rw-r--r--include/linux/phy.h12
1 files changed, 8 insertions, 4 deletions
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 {
63 PHY_INTERFACE_MODE_RTBI 63 PHY_INTERFACE_MODE_RTBI
64} phy_interface_t; 64} phy_interface_t;
65 65
66#define MII_BUS_MAX 4
67
68 66
69#define PHY_INIT_TIMEOUT 100000 67#define PHY_INIT_TIMEOUT 100000
70#define PHY_STATE_TIME 1 68#define PHY_STATE_TIME 1
@@ -74,13 +72,19 @@ typedef enum {
74#define PHY_MAX_ADDR 32 72#define PHY_MAX_ADDR 32
75 73
76/* Used when trying to connect to a specific phy (mii bus id:phy device id) */ 74/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
77#define PHY_ID_FMT "%x:%02x" 75#define PHY_ID_FMT "%s:%02x"
76
77/*
78 * Need to be a little smaller than phydev->dev.bus_id to leave room
79 * for the ":%02x"
80 */
81#define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3)
78 82
79/* The Bus class for PHYs. Devices which provide access to 83/* The Bus class for PHYs. Devices which provide access to
80 * PHYs should register using this structure */ 84 * PHYs should register using this structure */
81struct mii_bus { 85struct mii_bus {
82 const char *name; 86 const char *name;
83 int id; 87 char id[MII_BUS_ID_SIZE];
84 void *priv; 88 void *priv;
85 int (*read)(struct mii_bus *bus, int phy_id, int regnum); 89 int (*read)(struct mii_bus *bus, int phy_id, int regnum);
86 int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val); 90 int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val);