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 @@ -593,6 +593,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 @@ -614,21 +645,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 @@ -1025,6 +1067,9 @@ static int eth_ioctl(struct net_device *
115 if (cpu_is_ixp46x() && cmd == SIOCSHWTSTAMP)
116 return hwtstamp_ioctl(dev, req, cmd);
119 + return -EOPNOTSUPP;
121 return phy_mii_ioctl(port->phydev, req, cmd);
124 @@ -1044,18 +1089,30 @@ static void ixp4xx_get_drvinfo(struct ne
125 static int ixp4xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
127 struct port *port = netdev_priv(dev);
130 + return -EOPNOTSUPP;
132 return phy_ethtool_gset(port->phydev, cmd);
135 static int ixp4xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
137 struct port *port = netdev_priv(dev);
140 + return -EOPNOTSUPP;
142 return phy_ethtool_sset(port->phydev, cmd);
145 static int ixp4xx_nway_reset(struct net_device *dev)
147 struct port *port = netdev_priv(dev);
150 + return -EOPNOTSUPP;
152 return phy_start_aneg(port->phydev);