summaryrefslogtreecommitdiff
path: root/include/linux/phy.h
diff options
context:
space:
mode:
authorAndy Fleming <afleming@freescale.com>2006-12-01 12:01:06 -0600
committerJeff Garzik <jeff@garzik.org>2006-12-02 00:33:11 -0500
commite8a2b6a4207332a2d59628a12cece9e8c1d769e4 (patch)
tree31028a18413517ed3024450c20cd2e919441b437 /include/linux/phy.h
parentcabdfb373ae74036225826ce260c16a8e260eb0b (diff)
[PATCH] PHY: Add support for configuring the PHY connection interface
Most PHYs connect to an ethernet controller over a GMII or MII interface. However, a growing number are connected over different interfaces, such as RGMII or SGMII. The ethernet driver will tell the PHY what type of connection it is by setting it manually, or passing it in through phy_connect (or phy_attach). Changes include: * Updates to documentation * Updates to PHY Lib consumers * Changes to PHY Lib to add interface support * Some minor changes to whitespace in phy.h * gianfar driver now detects interface and passes appropriate value to PHY Lib Signed-off-by: Andrew Fleming <afleming@freescale.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/phy.h')
-rw-r--r--include/linux/phy.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/linux/phy.h b/include/linux/phy.h
index ce8bc80b3c86..edd4c88ca7d8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -47,15 +47,26 @@
#define PHY_HAS_INTERRUPT 0x00000001
#define PHY_HAS_MAGICANEG 0x00000002
+/* Interface Mode definitions */
+typedef enum {
+ PHY_INTERFACE_MODE_MII,
+ PHY_INTERFACE_MODE_GMII,
+ PHY_INTERFACE_MODE_SGMII,
+ PHY_INTERFACE_MODE_TBI,
+ PHY_INTERFACE_MODE_RMII,
+ PHY_INTERFACE_MODE_RGMII,
+ PHY_INTERFACE_MODE_RTBI
+} phy_interface_t;
+
#define MII_BUS_MAX 4
-#define PHY_INIT_TIMEOUT 100000
+#define PHY_INIT_TIMEOUT 100000
#define PHY_STATE_TIME 1
#define PHY_FORCE_TIMEOUT 10
#define PHY_AN_TIMEOUT 10
-#define PHY_MAX_ADDR 32
+#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"
@@ -87,8 +98,8 @@ struct mii_bus {
int *irq;
};
-#define PHY_INTERRUPT_DISABLED 0x0
-#define PHY_INTERRUPT_ENABLED 0x80000000
+#define PHY_INTERRUPT_DISABLED 0x0
+#define PHY_INTERRUPT_ENABLED 0x80000000
/* PHY state machine states:
*
@@ -230,6 +241,8 @@ struct phy_device {
u32 dev_flags;
+ phy_interface_t interface;
+
/* Bus address of the PHY (0-32) */
int addr;
@@ -345,9 +358,10 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
int phy_clear_interrupt(struct phy_device *phydev);
int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
struct phy_device * phy_attach(struct net_device *dev,
- const char *phy_id, u32 flags);
+ const char *phy_id, u32 flags, phy_interface_t interface);
struct phy_device * phy_connect(struct net_device *dev, const char *phy_id,
- void (*handler)(struct net_device *), u32 flags);
+ void (*handler)(struct net_device *), u32 flags,
+ phy_interface_t interface);
void phy_disconnect(struct phy_device *phydev);
void phy_detach(struct phy_device *phydev);
void phy_start(struct phy_device *phydev);