diff options
Diffstat (limited to 'drivers/net/mv643xx_eth.c')
-rw-r--r-- | drivers/net/mv643xx_eth.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c index 7253a499d9c8..13f11f402a99 100644 --- a/drivers/net/mv643xx_eth.c +++ b/drivers/net/mv643xx_eth.c | |||
@@ -136,21 +136,23 @@ static char mv643xx_eth_driver_version[] = "1.4"; | |||
136 | /* | 136 | /* |
137 | * SDMA configuration register. | 137 | * SDMA configuration register. |
138 | */ | 138 | */ |
139 | #define RX_BURST_SIZE_4_64BIT (2 << 1) | ||
139 | #define RX_BURST_SIZE_16_64BIT (4 << 1) | 140 | #define RX_BURST_SIZE_16_64BIT (4 << 1) |
140 | #define BLM_RX_NO_SWAP (1 << 4) | 141 | #define BLM_RX_NO_SWAP (1 << 4) |
141 | #define BLM_TX_NO_SWAP (1 << 5) | 142 | #define BLM_TX_NO_SWAP (1 << 5) |
143 | #define TX_BURST_SIZE_4_64BIT (2 << 22) | ||
142 | #define TX_BURST_SIZE_16_64BIT (4 << 22) | 144 | #define TX_BURST_SIZE_16_64BIT (4 << 22) |
143 | 145 | ||
144 | #if defined(__BIG_ENDIAN) | 146 | #if defined(__BIG_ENDIAN) |
145 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 147 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
146 | (RX_BURST_SIZE_16_64BIT | \ | 148 | (RX_BURST_SIZE_4_64BIT | \ |
147 | TX_BURST_SIZE_16_64BIT) | 149 | TX_BURST_SIZE_4_64BIT) |
148 | #elif defined(__LITTLE_ENDIAN) | 150 | #elif defined(__LITTLE_ENDIAN) |
149 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ | 151 | #define PORT_SDMA_CONFIG_DEFAULT_VALUE \ |
150 | (RX_BURST_SIZE_16_64BIT | \ | 152 | (RX_BURST_SIZE_4_64BIT | \ |
151 | BLM_RX_NO_SWAP | \ | 153 | BLM_RX_NO_SWAP | \ |
152 | BLM_TX_NO_SWAP | \ | 154 | BLM_TX_NO_SWAP | \ |
153 | TX_BURST_SIZE_16_64BIT) | 155 | TX_BURST_SIZE_4_64BIT) |
154 | #else | 156 | #else |
155 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined | 157 | #error One of __BIG_ENDIAN or __LITTLE_ENDIAN must be defined |
156 | #endif | 158 | #endif |
@@ -1173,7 +1175,7 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
1173 | { | 1175 | { |
1174 | struct mib_counters *p = &mp->mib_counters; | 1176 | struct mib_counters *p = &mp->mib_counters; |
1175 | 1177 | ||
1176 | spin_lock(&mp->mib_counters_lock); | 1178 | spin_lock_bh(&mp->mib_counters_lock); |
1177 | p->good_octets_received += mib_read(mp, 0x00); | 1179 | p->good_octets_received += mib_read(mp, 0x00); |
1178 | p->good_octets_received += (u64)mib_read(mp, 0x04) << 32; | 1180 | p->good_octets_received += (u64)mib_read(mp, 0x04) << 32; |
1179 | p->bad_octets_received += mib_read(mp, 0x08); | 1181 | p->bad_octets_received += mib_read(mp, 0x08); |
@@ -1206,7 +1208,7 @@ static void mib_counters_update(struct mv643xx_eth_private *mp) | |||
1206 | p->bad_crc_event += mib_read(mp, 0x74); | 1208 | p->bad_crc_event += mib_read(mp, 0x74); |
1207 | p->collision += mib_read(mp, 0x78); | 1209 | p->collision += mib_read(mp, 0x78); |
1208 | p->late_collision += mib_read(mp, 0x7c); | 1210 | p->late_collision += mib_read(mp, 0x7c); |
1209 | spin_unlock(&mp->mib_counters_lock); | 1211 | spin_unlock_bh(&mp->mib_counters_lock); |
1210 | 1212 | ||
1211 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); | 1213 | mod_timer(&mp->mib_counters_timer, jiffies + 30 * HZ); |
1212 | } | 1214 | } |
@@ -1573,7 +1575,7 @@ oom: | |||
1573 | return; | 1575 | return; |
1574 | } | 1576 | } |
1575 | 1577 | ||
1576 | mc_spec = kmalloc(0x200, GFP_KERNEL); | 1578 | mc_spec = kmalloc(0x200, GFP_ATOMIC); |
1577 | if (mc_spec == NULL) | 1579 | if (mc_spec == NULL) |
1578 | goto oom; | 1580 | goto oom; |
1579 | mc_other = mc_spec + (0x100 >> 2); | 1581 | mc_other = mc_spec + (0x100 >> 2); |
@@ -1594,7 +1596,7 @@ oom: | |||
1594 | entry = addr_crc(a); | 1596 | entry = addr_crc(a); |
1595 | } | 1597 | } |
1596 | 1598 | ||
1597 | table[entry >> 2] |= 1 << (entry & 3); | 1599 | table[entry >> 2] |= 1 << (8 * (entry & 3)); |
1598 | } | 1600 | } |
1599 | 1601 | ||
1600 | for (i = 0; i < 0x100; i += 4) { | 1602 | for (i = 0; i < 0x100; i += 4) { |
@@ -2210,11 +2212,10 @@ static int mv643xx_eth_stop(struct net_device *dev) | |||
2210 | struct mv643xx_eth_private *mp = netdev_priv(dev); | 2212 | struct mv643xx_eth_private *mp = netdev_priv(dev); |
2211 | int i; | 2213 | int i; |
2212 | 2214 | ||
2215 | wrlp(mp, INT_MASK_EXT, 0x00000000); | ||
2213 | wrlp(mp, INT_MASK, 0x00000000); | 2216 | wrlp(mp, INT_MASK, 0x00000000); |
2214 | rdlp(mp, INT_MASK); | 2217 | rdlp(mp, INT_MASK); |
2215 | 2218 | ||
2216 | del_timer_sync(&mp->mib_counters_timer); | ||
2217 | |||
2218 | napi_disable(&mp->napi); | 2219 | napi_disable(&mp->napi); |
2219 | 2220 | ||
2220 | del_timer_sync(&mp->rx_oom); | 2221 | del_timer_sync(&mp->rx_oom); |
@@ -2226,6 +2227,7 @@ static int mv643xx_eth_stop(struct net_device *dev) | |||
2226 | port_reset(mp); | 2227 | port_reset(mp); |
2227 | mv643xx_eth_get_stats(dev); | 2228 | mv643xx_eth_get_stats(dev); |
2228 | mib_counters_update(mp); | 2229 | mib_counters_update(mp); |
2230 | del_timer_sync(&mp->mib_counters_timer); | ||
2229 | 2231 | ||
2230 | skb_queue_purge(&mp->rx_recycle); | 2232 | skb_queue_purge(&mp->rx_recycle); |
2231 | 2233 | ||