diff options
Diffstat (limited to 'drivers/net/smc911x.c')
-rw-r--r-- | drivers/net/smc911x.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c index 9871a2b61f86..66831f378396 100644 --- a/drivers/net/smc911x.c +++ b/drivers/net/smc911x.c | |||
@@ -59,7 +59,6 @@ static const char version[] = | |||
59 | #include <linux/module.h> | 59 | #include <linux/module.h> |
60 | #include <linux/kernel.h> | 60 | #include <linux/kernel.h> |
61 | #include <linux/sched.h> | 61 | #include <linux/sched.h> |
62 | #include <linux/slab.h> | ||
63 | #include <linux/delay.h> | 62 | #include <linux/delay.h> |
64 | #include <linux/interrupt.h> | 63 | #include <linux/interrupt.h> |
65 | #include <linux/errno.h> | 64 | #include <linux/errno.h> |
@@ -383,7 +382,7 @@ static inline void smc911x_rcv(struct net_device *dev) | |||
383 | DBG(SMC_DEBUG_FUNC | SMC_DEBUG_RX, "%s: --> %s\n", | 382 | DBG(SMC_DEBUG_FUNC | SMC_DEBUG_RX, "%s: --> %s\n", |
384 | dev->name, __func__); | 383 | dev->name, __func__); |
385 | status = SMC_GET_RX_STS_FIFO(lp); | 384 | status = SMC_GET_RX_STS_FIFO(lp); |
386 | DBG(SMC_DEBUG_RX, "%s: Rx pkt len %d status 0x%08x \n", | 385 | DBG(SMC_DEBUG_RX, "%s: Rx pkt len %d status 0x%08x\n", |
387 | dev->name, (status & 0x3fff0000) >> 16, status & 0xc000ffff); | 386 | dev->name, (status & 0x3fff0000) >> 16, status & 0xc000ffff); |
388 | pkt_len = (status & RX_STS_PKT_LEN_) >> 16; | 387 | pkt_len = (status & RX_STS_PKT_LEN_) >> 16; |
389 | if (status & RX_STS_ES_) { | 388 | if (status & RX_STS_ES_) { |
@@ -1136,7 +1135,7 @@ static irqreturn_t smc911x_interrupt(int irq, void *dev_id) | |||
1136 | } | 1135 | } |
1137 | #else | 1136 | #else |
1138 | if (status & INT_STS_TSFL_) { | 1137 | if (status & INT_STS_TSFL_) { |
1139 | DBG(SMC_DEBUG_TX, "%s: TX status FIFO limit (%d) irq \n", dev->name, ); | 1138 | DBG(SMC_DEBUG_TX, "%s: TX status FIFO limit (%d) irq\n", dev->name, ); |
1140 | smc911x_tx(dev); | 1139 | smc911x_tx(dev); |
1141 | SMC_ACK_INT(lp, INT_STS_TSFL_); | 1140 | SMC_ACK_INT(lp, INT_STS_TSFL_); |
1142 | } | 1141 | } |
@@ -1275,7 +1274,7 @@ static void smc911x_timeout(struct net_device *dev) | |||
1275 | status = SMC_GET_INT(lp); | 1274 | status = SMC_GET_INT(lp); |
1276 | mask = SMC_GET_INT_EN(lp); | 1275 | mask = SMC_GET_INT_EN(lp); |
1277 | spin_unlock_irqrestore(&lp->lock, flags); | 1276 | spin_unlock_irqrestore(&lp->lock, flags); |
1278 | DBG(SMC_DEBUG_MISC, "%s: INT 0x%02x MASK 0x%02x \n", | 1277 | DBG(SMC_DEBUG_MISC, "%s: INT 0x%02x MASK 0x%02x\n", |
1279 | dev->name, status, mask); | 1278 | dev->name, status, mask); |
1280 | 1279 | ||
1281 | /* Dump the current TX FIFO contents and restart */ | 1280 | /* Dump the current TX FIFO contents and restart */ |
@@ -1290,7 +1289,7 @@ static void smc911x_timeout(struct net_device *dev) | |||
1290 | schedule_work(&lp->phy_configure); | 1289 | schedule_work(&lp->phy_configure); |
1291 | 1290 | ||
1292 | /* We can accept TX packets again */ | 1291 | /* We can accept TX packets again */ |
1293 | dev->trans_start = jiffies; | 1292 | dev->trans_start = jiffies; /* prevent tx timeout */ |
1294 | netif_wake_queue(dev); | 1293 | netif_wake_queue(dev); |
1295 | } | 1294 | } |
1296 | 1295 | ||
@@ -1341,7 +1340,7 @@ static void smc911x_set_multicast_list(struct net_device *dev) | |||
1341 | * within that register. | 1340 | * within that register. |
1342 | */ | 1341 | */ |
1343 | else if (!netdev_mc_empty(dev)) { | 1342 | else if (!netdev_mc_empty(dev)) { |
1344 | struct dev_mc_list *cur_addr; | 1343 | struct netdev_hw_addr *ha; |
1345 | 1344 | ||
1346 | /* Set the Hash perfec mode */ | 1345 | /* Set the Hash perfec mode */ |
1347 | mcr |= MAC_CR_HPFILT_; | 1346 | mcr |= MAC_CR_HPFILT_; |
@@ -1349,19 +1348,16 @@ static void smc911x_set_multicast_list(struct net_device *dev) | |||
1349 | /* start with a table of all zeros: reject all */ | 1348 | /* start with a table of all zeros: reject all */ |
1350 | memset(multicast_table, 0, sizeof(multicast_table)); | 1349 | memset(multicast_table, 0, sizeof(multicast_table)); |
1351 | 1350 | ||
1352 | netdev_for_each_mc_addr(cur_addr, dev) { | 1351 | netdev_for_each_mc_addr(ha, dev) { |
1353 | u32 position; | 1352 | u32 position; |
1354 | 1353 | ||
1355 | /* do we have a pointer here? */ | ||
1356 | if (!cur_addr) | ||
1357 | break; | ||
1358 | /* make sure this is a multicast address - | 1354 | /* make sure this is a multicast address - |
1359 | shouldn't this be a given if we have it here ? */ | 1355 | shouldn't this be a given if we have it here ? */ |
1360 | if (!(*cur_addr->dmi_addr & 1)) | 1356 | if (!(*ha->addr & 1)) |
1361 | continue; | 1357 | continue; |
1362 | 1358 | ||
1363 | /* upper 6 bits are used as hash index */ | 1359 | /* upper 6 bits are used as hash index */ |
1364 | position = ether_crc(ETH_ALEN, cur_addr->dmi_addr)>>26; | 1360 | position = ether_crc(ETH_ALEN, ha->addr)>>26; |
1365 | 1361 | ||
1366 | multicast_table[position>>5] |= 1 << (position&0x1f); | 1362 | multicast_table[position>>5] |= 1 << (position&0x1f); |
1367 | } | 1363 | } |