diff options
Diffstat (limited to 'drivers/net/au1000_eth.c')
-rw-r--r-- | drivers/net/au1000_eth.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c index 7b92201a7b50..019b13c08ae6 100644 --- a/drivers/net/au1000_eth.c +++ b/drivers/net/au1000_eth.c | |||
@@ -94,8 +94,8 @@ static irqreturn_t au1000_interrupt(int, void *); | |||
94 | static void au1000_tx_timeout(struct net_device *); | 94 | static void au1000_tx_timeout(struct net_device *); |
95 | static void set_rx_mode(struct net_device *); | 95 | static void set_rx_mode(struct net_device *); |
96 | static int au1000_ioctl(struct net_device *, struct ifreq *, int); | 96 | static int au1000_ioctl(struct net_device *, struct ifreq *, int); |
97 | static int mdio_read(struct net_device *, int, int); | 97 | static int au1000_mdio_read(struct net_device *, int, int); |
98 | static void mdio_write(struct net_device *, int, int, u16); | 98 | static void au1000_mdio_write(struct net_device *, int, int, u16); |
99 | static void au1000_adjust_link(struct net_device *); | 99 | static void au1000_adjust_link(struct net_device *); |
100 | static void enable_mac(struct net_device *, int); | 100 | static void enable_mac(struct net_device *, int); |
101 | 101 | ||
@@ -191,7 +191,7 @@ struct au1000_private *au_macs[NUM_ETH_INTERFACES]; | |||
191 | /* | 191 | /* |
192 | * MII operations | 192 | * MII operations |
193 | */ | 193 | */ |
194 | static int mdio_read(struct net_device *dev, int phy_addr, int reg) | 194 | static int au1000_mdio_read(struct net_device *dev, int phy_addr, int reg) |
195 | { | 195 | { |
196 | struct au1000_private *aup = (struct au1000_private *) dev->priv; | 196 | struct au1000_private *aup = (struct au1000_private *) dev->priv; |
197 | volatile u32 *const mii_control_reg = &aup->mac->mii_control; | 197 | volatile u32 *const mii_control_reg = &aup->mac->mii_control; |
@@ -225,7 +225,8 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg) | |||
225 | return (int)*mii_data_reg; | 225 | return (int)*mii_data_reg; |
226 | } | 226 | } |
227 | 227 | ||
228 | static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value) | 228 | static void au1000_mdio_write(struct net_device *dev, int phy_addr, |
229 | int reg, u16 value) | ||
229 | { | 230 | { |
230 | struct au1000_private *aup = (struct au1000_private *) dev->priv; | 231 | struct au1000_private *aup = (struct au1000_private *) dev->priv; |
231 | volatile u32 *const mii_control_reg = &aup->mac->mii_control; | 232 | volatile u32 *const mii_control_reg = &aup->mac->mii_control; |
@@ -249,7 +250,7 @@ static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value) | |||
249 | *mii_control_reg = mii_control; | 250 | *mii_control_reg = mii_control; |
250 | } | 251 | } |
251 | 252 | ||
252 | static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) | 253 | static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) |
253 | { | 254 | { |
254 | /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does | 255 | /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does |
255 | * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus) */ | 256 | * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus) */ |
@@ -257,21 +258,21 @@ static int mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) | |||
257 | 258 | ||
258 | enable_mac(dev, 0); /* make sure the MAC associated with this | 259 | enable_mac(dev, 0); /* make sure the MAC associated with this |
259 | * mii_bus is enabled */ | 260 | * mii_bus is enabled */ |
260 | return mdio_read(dev, phy_addr, regnum); | 261 | return au1000_mdio_read(dev, phy_addr, regnum); |
261 | } | 262 | } |
262 | 263 | ||
263 | static int mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, | 264 | static int au1000_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum, |
264 | u16 value) | 265 | u16 value) |
265 | { | 266 | { |
266 | struct net_device *const dev = bus->priv; | 267 | struct net_device *const dev = bus->priv; |
267 | 268 | ||
268 | enable_mac(dev, 0); /* make sure the MAC associated with this | 269 | enable_mac(dev, 0); /* make sure the MAC associated with this |
269 | * mii_bus is enabled */ | 270 | * mii_bus is enabled */ |
270 | mdio_write(dev, phy_addr, regnum, value); | 271 | au1000_mdio_write(dev, phy_addr, regnum, value); |
271 | return 0; | 272 | return 0; |
272 | } | 273 | } |
273 | 274 | ||
274 | static int mdiobus_reset(struct mii_bus *bus) | 275 | static int au1000_mdiobus_reset(struct mii_bus *bus) |
275 | { | 276 | { |
276 | struct net_device *const dev = bus->priv; | 277 | struct net_device *const dev = bus->priv; |
277 | 278 | ||
@@ -703,9 +704,9 @@ static struct net_device * au1000_probe(int port_num) | |||
703 | goto err_out; | 704 | goto err_out; |
704 | 705 | ||
705 | aup->mii_bus->priv = dev; | 706 | aup->mii_bus->priv = dev; |
706 | aup->mii_bus->read = mdiobus_read; | 707 | aup->mii_bus->read = au1000_mdiobus_read; |
707 | aup->mii_bus->write = mdiobus_write; | 708 | aup->mii_bus->write = au1000_mdiobus_write; |
708 | aup->mii_bus->reset = mdiobus_reset; | 709 | aup->mii_bus->reset = au1000_mdiobus_reset; |
709 | aup->mii_bus->name = "au1000_eth_mii"; | 710 | aup->mii_bus->name = "au1000_eth_mii"; |
710 | snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id); | 711 | snprintf(aup->mii_bus->id, MII_BUS_ID_SIZE, "%x", aup->mac_id); |
711 | aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); | 712 | aup->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); |