aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/au1000_eth.c38
-rw-r--r--drivers/net/au1000_eth.h6
2 files changed, 30 insertions, 14 deletions
diff --git a/drivers/net/au1000_eth.c b/drivers/net/au1000_eth.c
index f4c394fa2d93..43489f89c142 100644
--- a/drivers/net/au1000_eth.c
+++ b/drivers/net/au1000_eth.c
@@ -229,11 +229,15 @@ static void au1000_mdio_write(struct net_device *dev, int phy_addr,
229static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum) 229static int au1000_mdiobus_read(struct mii_bus *bus, int phy_addr, int regnum)
230{ 230{
231 /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does 231 /* WARNING: bus->phy_map[phy_addr].attached_dev == dev does
232 * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus) */ 232 * _NOT_ hold (e.g. when PHY is accessed through other MAC's MII bus)
233 */
233 struct net_device *const dev = bus->priv; 234 struct net_device *const dev = bus->priv;
234 235
235 au1000_enable_mac(dev, 0); /* make sure the MAC associated with this 236 /* make sure the MAC associated with this
236 * mii_bus is enabled */ 237 * mii_bus is enabled
238 */
239 au1000_enable_mac(dev, 0);
240
237 return au1000_mdio_read(dev, phy_addr, regnum); 241 return au1000_mdio_read(dev, phy_addr, regnum);
238} 242}
239 243
@@ -242,8 +246,11 @@ static int au1000_mdiobus_write(struct mii_bus *bus, int phy_addr, int regnum,
242{ 246{
243 struct net_device *const dev = bus->priv; 247 struct net_device *const dev = bus->priv;
244 248
245 au1000_enable_mac(dev, 0); /* make sure the MAC associated with this 249 /* make sure the MAC associated with this
246 * mii_bus is enabled */ 250 * mii_bus is enabled
251 */
252 au1000_enable_mac(dev, 0);
253
247 au1000_mdio_write(dev, phy_addr, regnum, value); 254 au1000_mdio_write(dev, phy_addr, regnum, value);
248 return 0; 255 return 0;
249} 256}
@@ -252,8 +259,11 @@ static int au1000_mdiobus_reset(struct mii_bus *bus)
252{ 259{
253 struct net_device *const dev = bus->priv; 260 struct net_device *const dev = bus->priv;
254 261
255 au1000_enable_mac(dev, 0); /* make sure the MAC associated with this 262 /* make sure the MAC associated with this
256 * mii_bus is enabled */ 263 * mii_bus is enabled
264 */
265 au1000_enable_mac(dev, 0);
266
257 return 0; 267 return 0;
258} 268}
259 269
@@ -380,7 +390,8 @@ static int au1000_mii_probe(struct net_device *dev)
380 } 390 }
381 391
382 /* find the first (lowest address) PHY 392 /* find the first (lowest address) PHY
383 * on the current MAC's MII bus */ 393 * on the current MAC's MII bus
394 */
384 for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++) 395 for (phy_addr = 0; phy_addr < PHY_MAX_ADDR; phy_addr++)
385 if (aup->mii_bus->phy_map[phy_addr]) { 396 if (aup->mii_bus->phy_map[phy_addr]) {
386 phydev = aup->mii_bus->phy_map[phy_addr]; 397 phydev = aup->mii_bus->phy_map[phy_addr];
@@ -774,7 +785,8 @@ static void au1000_update_tx_stats(struct net_device *dev, u32 status)
774 if (!aup->phy_dev || (DUPLEX_FULL == aup->phy_dev->duplex)) { 785 if (!aup->phy_dev || (DUPLEX_FULL == aup->phy_dev->duplex)) {
775 if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) { 786 if (status & (TX_JAB_TIMEOUT | TX_UNDERRUN)) {
776 /* any other tx errors are only valid 787 /* any other tx errors are only valid
777 * in half duplex mode */ 788 * in half duplex mode
789 */
778 ps->tx_errors++; 790 ps->tx_errors++;
779 ps->tx_aborted_errors++; 791 ps->tx_aborted_errors++;
780 } 792 }
@@ -1068,8 +1080,9 @@ static int __devinit au1000_probe(struct platform_device *pdev)
1068 aup->msg_enable = (au1000_debug < 4 ? 1080 aup->msg_enable = (au1000_debug < 4 ?
1069 AU1000_DEF_MSG_ENABLE : au1000_debug); 1081 AU1000_DEF_MSG_ENABLE : au1000_debug);
1070 1082
1071 /* Allocate the data buffers */ 1083 /* Allocate the data buffers
1072 /* Snooping works fine with eth on all au1xxx */ 1084 * Snooping works fine with eth on all au1xxx
1085 */
1073 aup->vaddr = (u32)dma_alloc_noncoherent(NULL, MAX_BUF_SIZE * 1086 aup->vaddr = (u32)dma_alloc_noncoherent(NULL, MAX_BUF_SIZE *
1074 (NUM_TX_BUFFS + NUM_RX_BUFFS), 1087 (NUM_TX_BUFFS + NUM_RX_BUFFS),
1075 &aup->dma_addr, 0); 1088 &aup->dma_addr, 0);
@@ -1226,7 +1239,8 @@ err_out:
1226 mdiobus_unregister(aup->mii_bus); 1239 mdiobus_unregister(aup->mii_bus);
1227 1240
1228 /* here we should have a valid dev plus aup-> register addresses 1241 /* here we should have a valid dev plus aup-> register addresses
1229 * so we can reset the mac properly.*/ 1242 * so we can reset the mac properly.
1243 */
1230 au1000_reset_mac(dev); 1244 au1000_reset_mac(dev);
1231 1245
1232 for (i = 0; i < NUM_RX_DMA; i++) { 1246 for (i = 0; i < NUM_RX_DMA; i++) {
diff --git a/drivers/net/au1000_eth.h b/drivers/net/au1000_eth.h
index 4b638df22240..6229c774552c 100644
--- a/drivers/net/au1000_eth.h
+++ b/drivers/net/au1000_eth.h
@@ -100,7 +100,8 @@ struct au1000_private {
100 int mac_id; 100 int mac_id;
101 101
102 int mac_enabled; /* whether MAC is currently enabled and running 102 int mac_enabled; /* whether MAC is currently enabled and running
103 (req. for mdio) */ 103 * (req. for mdio)
104 */
104 105
105 int old_link; /* used by au1000_adjust_link */ 106 int old_link; /* used by au1000_adjust_link */
106 int old_speed; 107 int old_speed;
@@ -119,7 +120,8 @@ struct au1000_private {
119 int phy_irq; 120 int phy_irq;
120 121
121 /* These variables are just for quick access 122 /* These variables are just for quick access
122 * to certain regs addresses. */ 123 * to certain regs addresses.
124 */
123 struct mac_reg *mac; /* mac registers */ 125 struct mac_reg *mac; /* mac registers */
124 u32 *enable; /* address of MAC Enable Register */ 126 u32 *enable; /* address of MAC Enable Register */
125 127