aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
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 {
50 u32 device_flags; 50 u32 device_flags;
51 /* board specific information */ 51 /* board specific information */
52 u32 board_flags; 52 u32 board_flags;
53 u32 bus_id; 53 char bus_id[MII_BUS_ID_SIZE];
54 u32 phy_id; 54 u32 phy_id;
55 u8 mac_addr[6]; 55 u8 mac_addr[6];
56 phy_interface_t interface; 56 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 {
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);