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 @@ -72,7 +72,7 @@ extern unsigned long ixp4xx_exp_bus_size
7 * Clock Speed Definitions.
9 -#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */
10 +#define IXP4XX_PERIPHERAL_BUS_CLOCK (66) /* 66Mhzi APB BUS */
11 #define IXP4XX_UART_XTAL 14745600
14 @@ -95,12 +95,23 @@ struct sys_timer;
15 #define IXP4XX_ETH_NPEB 0x10
16 #define IXP4XX_ETH_NPEC 0x20
18 +#define IXP4XX_ETH_PHY_MAX_ADDR 32
20 /* Information about built-in Ethernet MAC interfaces */
21 struct eth_plat_info {
22 u8 phy; /* MII PHY ID, 0 - 31 */
23 u8 rxq; /* configurable, currently 0 - 31 only */
37 /* Information about built-in HSS (synchronous serial) interfaces */
38 --- a/drivers/net/arm/ixp4xx_eth.c
39 +++ b/drivers/net/arm/ixp4xx_eth.c
40 @@ -418,6 +418,37 @@ static int ixp4xx_phy_connect(struct net
41 struct eth_plat_info *plat = port->plat;
42 char phy_id[MII_BUS_ID_SIZE + 3];
44 + if (plat->phy == IXP4XX_ETH_PHY_MAX_ADDR) {
46 + switch (plat->speed) {
51 + printk(KERN_ERR "%s: invalid speed (%d)\n",
52 + dev->name, plat->speed);
56 + switch (plat->duplex) {
61 + printk(KERN_ERR "%s: invalid duplex mode (%d)\n",
62 + dev->name, plat->duplex);
65 + port->speed = plat->speed;
66 + port->duplex = plat->duplex;
68 + port->speed = plat->speed_10 ? SPEED_10 : SPEED_100;
69 + port->duplex = plat->half_duplex ? DUPLEX_HALF : DUPLEX_FULL;
75 snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy);
76 port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
77 PHY_INTERFACE_MODE_MII);
78 @@ -439,21 +470,32 @@ static void ixp4xx_phy_disconnect(struct
80 struct port *port = netdev_priv(dev);
82 - phy_disconnect(port->phydev);
84 + phy_disconnect(port->phydev);
87 static void ixp4xx_phy_start(struct net_device *dev)
89 struct port *port = netdev_priv(dev);
91 - phy_start(port->phydev);
93 + phy_start(port->phydev);
96 + ixp4xx_update_link(dev);
100 static void ixp4xx_phy_stop(struct net_device *dev)
102 struct port *port = netdev_priv(dev);
104 - phy_stop(port->phydev);
105 + if (port->phydev) {
106 + phy_stop(port->phydev);
109 + ixp4xx_update_link(dev);
113 static inline void debug_pkt(struct net_device *dev, const char *func,
114 @@ -830,6 +872,10 @@ static int eth_ioctl(struct net_device *
116 if (!netif_running(dev))
120 + return -EOPNOTSUPP;
122 return phy_mii_ioctl(port->phydev, if_mii(req), cmd);
125 @@ -849,18 +895,30 @@ static void ixp4xx_get_drvinfo(struct ne
126 static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
128 struct port *port = netdev_priv(dev);
131 + return -EOPNOTSUPP;
133 return phy_ethtool_gset(port->phydev, cmd);
136 static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
138 struct port *port = netdev_priv(dev);
141 + return -EOPNOTSUPP;
143 return phy_ethtool_sset(port->phydev, cmd);
146 static int ixp4xx_nway_reset(struct net_device *dev)
148 struct port *port = netdev_priv(dev);
151 + return -EOPNOTSUPP;
153 return phy_start_aneg(port->phydev);