NFS: Add nfs_set_page_dirty()
[safe/jmp/linux-2.6] / include / linux / phy.h
index 4f2b5ef..edd4c88 100644 (file)
 
 #include <linux/spinlock.h>
 #include <linux/device.h>
+#include <linux/ethtool.h>
+#include <linux/mii.h>
+#include <linux/timer.h>
+#include <linux/workqueue.h>
 
 #define PHY_BASIC_FEATURES     (SUPPORTED_10baseT_Half | \
                                 SUPPORTED_10baseT_Full | \
 #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"
 
 /* The Bus class for PHYs.  Devices which provide access to
  * PHYs should register using this structure */
@@ -72,13 +90,16 @@ 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;
 };
 
-#define PHY_INTERRUPT_DISABLED 0x0
-#define PHY_INTERRUPT_ENABLED 0x80000000
+#define PHY_INTERRUPT_DISABLED 0x0
+#define PHY_INTERRUPT_ENABLED  0x80000000
 
 /* PHY state machine states:
  *
@@ -220,6 +241,8 @@ struct phy_device {
 
        u32 dev_flags;
 
+       phy_interface_t interface;
+
        /* Bus address of the PHY (0-32) */
        int addr;
 
@@ -334,11 +357,27 @@ int phy_write(struct phy_device *phydev, u16 regnum, u16 val);
 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, phy_interface_t interface);
+struct phy_device * phy_connect(struct net_device *dev, const char *phy_id,
+               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);
+void phy_stop(struct phy_device *phydev);
+int phy_start_aneg(struct phy_device *phydev);
+
+int mdiobus_register(struct mii_bus *bus);
+void mdiobus_unregister(struct mii_bus *bus);
+void phy_sanitize_settings(struct phy_device *phydev);
+int phy_stop_interrupts(struct phy_device *phydev);
 
 static inline int phy_read_status(struct phy_device *phydev) {
        return phydev->drv->read_status(phydev);
 }
 
+int genphy_config_advert(struct phy_device *phydev);
 int genphy_setup_forced(struct phy_device *phydev);
 int genphy_restart_aneg(struct phy_device *phydev);
 int genphy_config_aneg(struct phy_device *phydev);
@@ -355,6 +394,9 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
 int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
 int phy_mii_ioctl(struct phy_device *phydev,
                struct mii_ioctl_data *mii_data, int cmd);
+int phy_start_interrupts(struct phy_device *phydev);
+void phy_print_status(struct phy_device *phydev);
+struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
 
 extern struct bus_type mdio_bus_type;
 #endif /* __PHY_H */