~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to drivers/net/smc911x.c

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings, Ben Hutchings, Aurelien Jarno, Martin Michlmayr
  • Date: 2011-04-06 13:53:30 UTC
  • mfrom: (43.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20110406135330-wjufxhd0tvn3zx4z
Tags: 2.6.38-3
[ Ben Hutchings ]
* [ppc64] Add to linux-tools package architectures (Closes: #620124)
* [amd64] Save cr4 to mmu_cr4_features at boot time (Closes: #620284)
* appletalk: Fix bugs introduced when removing use of BKL
* ALSA: Fix yet another race in disconnection
* cciss: Fix lost command issue
* ath9k: Fix kernel panic in AR2427
* ses: Avoid kernel panic when lun 0 is not mapped
* PCI/ACPI: Report ASPM support to BIOS if not disabled from command line

[ Aurelien Jarno ]
* rtlwifi: fix build when PCI is not enabled.

[ Martin Michlmayr ]
* rtlwifi: Eliminate udelay calls with too large values (Closes: #620204)

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
#include <linux/module.h>
60
60
#include <linux/kernel.h>
61
61
#include <linux/sched.h>
62
 
#include <linux/slab.h>
63
62
#include <linux/delay.h>
64
63
#include <linux/interrupt.h>
65
64
#include <linux/errno.h>
383
382
        DBG(SMC_DEBUG_FUNC | SMC_DEBUG_RX, "%s: --> %s\n",
384
383
                dev->name, __func__);
385
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
386
                dev->name, (status & 0x3fff0000) >> 16, status & 0xc000ffff);
388
387
        pkt_len = (status & RX_STS_PKT_LEN_) >> 16;
389
388
        if (status & RX_STS_ES_) {
1136
1135
                }
1137
1136
#else
1138
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
1139
                        smc911x_tx(dev);
1141
1140
                        SMC_ACK_INT(lp, INT_STS_TSFL_);
1142
1141
                }
1275
1274
        status = SMC_GET_INT(lp);
1276
1275
        mask = SMC_GET_INT_EN(lp);
1277
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
1278
                dev->name, status, mask);
1280
1279
 
1281
1280
        /* Dump the current TX FIFO contents and restart */
1290
1289
                schedule_work(&lp->phy_configure);
1291
1290
 
1292
1291
        /* We can accept TX packets again */
1293
 
        dev->trans_start = jiffies;
 
1292
        dev->trans_start = jiffies; /* prevent tx timeout */
1294
1293
        netif_wake_queue(dev);
1295
1294
}
1296
1295
 
1323
1322
         * I don't need to zero the multicast table, because the flag is
1324
1323
         * checked before the table is
1325
1324
         */
1326
 
        else if (dev->flags & IFF_ALLMULTI || dev->mc_count > 16) {
 
1325
        else if (dev->flags & IFF_ALLMULTI || netdev_mc_count(dev) > 16) {
1327
1326
                DBG(SMC_DEBUG_MISC, "%s: RCR_ALMUL\n", dev->name);
1328
1327
                mcr |= MAC_CR_MCPAS_;
1329
1328
        }
1340
1339
         * the number of the 32 bit register, while the low 5 bits are the bit
1341
1340
         * within that register.
1342
1341
         */
1343
 
        else if (dev->mc_count)  {
1344
 
                int i;
1345
 
                struct dev_mc_list *cur_addr;
 
1342
        else if (!netdev_mc_empty(dev)) {
 
1343
                struct netdev_hw_addr *ha;
1346
1344
 
1347
1345
                /* Set the Hash perfec mode */
1348
1346
                mcr |= MAC_CR_HPFILT_;
1350
1348
                /* start with a table of all zeros: reject all */
1351
1349
                memset(multicast_table, 0, sizeof(multicast_table));
1352
1350
 
1353
 
                cur_addr = dev->mc_list;
1354
 
                for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) {
 
1351
                netdev_for_each_mc_addr(ha, dev) {
1355
1352
                        u32 position;
1356
1353
 
1357
 
                        /* do we have a pointer here? */
1358
 
                        if (!cur_addr)
1359
 
                                break;
1360
1354
                        /* make sure this is a multicast address -
1361
1355
                                shouldn't this be a given if we have it here ? */
1362
 
                        if (!(*cur_addr->dmi_addr & 1))
1363
 
                                 continue;
 
1356
                        if (!(*ha->addr & 1))
 
1357
                                continue;
1364
1358
 
1365
1359
                        /* upper 6 bits are used as hash index */
1366
 
                        position = ether_crc(ETH_ALEN, cur_addr->dmi_addr)>>26;
 
1360
                        position = ether_crc(ETH_ALEN, ha->addr)>>26;
1367
1361
 
1368
1362
                        multicast_table[position>>5] |= 1 << (position&0x1f);
1369
1363
                }
1984
1978
#endif
1985
1979
 
1986
1980
        /* Grab the IRQ */
1987
 
        retval = request_irq(dev->irq, &smc911x_interrupt,
 
1981
        retval = request_irq(dev->irq, smc911x_interrupt,
1988
1982
                             irq_flags, dev->name, dev);
1989
1983
        if (retval)
1990
1984
                goto err_out;
2017
2011
                                        "set using ifconfig\n", dev->name);
2018
2012
                } else {
2019
2013
                        /* Print the Ethernet address */
2020
 
                        printk("%s: Ethernet addr: ", dev->name);
2021
 
                        for (i = 0; i < 5; i++)
2022
 
                                printk("%2.2x:", dev->dev_addr[i]);
2023
 
                        printk("%2.2x\n", dev->dev_addr[5]);
 
2014
                        printk("%s: Ethernet addr: %pM\n",
 
2015
                                dev->name, dev->dev_addr);
2024
2016
                }
2025
2017
 
2026
2018
                if (lp->phy_type == 0) {