1 TODO: take care of additional PHYs through the PHY abstraction layer
3 --- a/arch/arm/mach-ixp4xx/include/mach/platform.h
4 +++ b/arch/arm/mach-ixp4xx/include/mach/platform.h
5 @@ -95,12 +95,23 @@ struct ixp4xx_pata_data {
6 #define IXP4XX_ETH_NPEB 0x10
7 #define IXP4XX_ETH_NPEC 0x20
9 +#define IXP4XX_ETH_PHY_MAX_ADDR 32
11 /* Information about built-in Ethernet MAC interfaces */
12 struct eth_plat_info {
13 u8 phy; /* MII PHY ID, 0 - 31 */
14 u8 rxq; /* configurable, currently 0 - 31 only */
28 /* Information about built-in HSS (synchronous serial) interfaces */
29 --- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
30 +++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
31 @@ -610,6 +610,37 @@ static int ixp4xx_phy_connect(struct net
32 struct eth_plat_info *plat = port->plat;
33 char phy_id[MII_BUS_ID_SIZE + 3];
35 + if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) {
37 + switch (plat->speed) {
42 + printk(KERN_ERR "%s: invalid speed (%d)\n",
43 + dev->name, plat->speed);
47 + switch (plat->duplex) {
52 + printk(KERN_ERR "%s: invalid duplex mode (%d)\n",
53 + dev->name, plat->duplex);
56 + port->speed = plat->speed;
57 + port->duplex = plat->duplex;
59 + port->speed = plat->speed_10 ? SPEED_10 : SPEED_100;
60 + port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL;
66 snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
67 mdio_bus->id, plat->phy);
68 port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link,
69 @@ -625,6 +656,10 @@ static int ixp4xx_phy_connect(struct net
71 port->phydev->irq = PHY_POLL;
80 @@ -632,21 +667,32 @@ static void ixp4xx_phy_disconnect(struct
82 struct port *port = netdev_priv(dev);
84 - phy_disconnect(port->phydev);
86 + phy_disconnect(port->phydev);
89 static void ixp4xx_phy_start(struct net_device *dev)
91 struct port *port = netdev_priv(dev);
93 - phy_start(port->phydev);
95 + phy_start(port->phydev);
98 + ixp4xx_update_link(dev);
102 static void ixp4xx_phy_stop(struct net_device *dev)
104 struct port *port = netdev_priv(dev);
106 - phy_stop(port->phydev);
107 + if (port->phydev) {
108 + phy_stop(port->phydev);
111 + ixp4xx_update_link(dev);
115 static inline void debug_pkt(struct net_device *dev, const char *func,
116 @@ -1048,6 +1094,9 @@ static int eth_ioctl(struct net_device *
117 return hwtstamp_get(dev, req);
121 + return -EOPNOTSUPP;
123 return phy_mii_ioctl(port->phydev, req, cmd);
126 @@ -1068,18 +1117,30 @@ static void ixp4xx_get_drvinfo(struct ne
127 static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
129 struct port *port = netdev_priv(dev);
132 + return -EOPNOTSUPP;
134 return phy_ethtool_gset(port->phydev, cmd);
137 static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
139 struct port *port = netdev_priv(dev);
142 + return -EOPNOTSUPP;
144 return phy_ethtool_sset(port->phydev, cmd);
147 static int ixp4xx_nway_reset(struct net_device *dev)
149 struct port *port = netdev_priv(dev);
152 + return -EOPNOTSUPP;
154 return phy_start_aneg(port->phydev);
157 @@ -1529,10 +1590,6 @@ static int eth_init_one(struct platform_
158 if ((err = register_netdev(dev)))
165 printk(KERN_INFO "%s: MII PHY %i on %s\n", dev->name, plat->phy,
166 npe_name(port->npe));