Merge branch 'master' into upstream-fixes
authorJeff Garzik <jeff@garzik.org>
Sat, 1 Dec 2007 21:18:56 +0000 (16:18 -0500)
committerJeff Garzik <jeff@garzik.org>
Sat, 1 Dec 2007 21:18:56 +0000 (16:18 -0500)
16 files changed:
drivers/net/Kconfig
drivers/net/amd8111e.c
drivers/net/bfin_mac.c
drivers/net/ehea/ehea.h
drivers/net/ehea/ehea_main.c
drivers/net/ehea/ehea_qmr.h
drivers/net/forcedeth.c
drivers/net/ibm_newemac/core.c
drivers/net/ibm_newemac/core.h
drivers/net/sky2.c
drivers/net/smc911x.c
drivers/net/smc911x.h
drivers/net/smc91x.h
drivers/net/tulip/dmfe.c
drivers/net/usb/dm9601.c
include/linux/pci_ids.h

index e8d69b0adf90a8efc47adde0b54875b44d19c5eb..1437b37a6b93c1a32b6f844ba6a506baa9a7607c 100644 (file)
@@ -888,7 +888,7 @@ config SMC91X
        tristate "SMC 91C9x/91C1xxx support"
        select CRC32
        select MII
-       depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || SOC_AU1X00 || BFIN
+       depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || SOC_AU1X00 || BLACKFIN
        help
          This is a driver for SMC's 91x series of Ethernet chipsets,
          including the SMC91C94 and the SMC91C111. Say Y if you want it
index eebf5bb2b03ae6a4958df7bff99d973adddc3771..e7fdd81919bd15edd65e6b2e749b8bf827c94b14 100644 (file)
@@ -1340,7 +1340,9 @@ static int amd8111e_close(struct net_device * dev)
        struct amd8111e_priv *lp = netdev_priv(dev);
        netif_stop_queue(dev);
 
+#ifdef CONFIG_AMD8111E_NAPI
        napi_disable(&lp->napi);
+#endif
 
        spin_lock_irq(&lp->lock);
 
@@ -1372,7 +1374,9 @@ static int amd8111e_open(struct net_device * dev )
                                         dev->name, dev))
                return -EAGAIN;
 
+#ifdef CONFIG_AMD8111E_NAPI
        napi_enable(&lp->napi);
+#endif
 
        spin_lock_irq(&lp->lock);
 
@@ -1380,7 +1384,9 @@ static int amd8111e_open(struct net_device * dev )
 
        if(amd8111e_restart(dev)){
                spin_unlock_irq(&lp->lock);
+#ifdef CONFIG_AMD8111E_NAPI
                napi_disable(&lp->napi);
+#endif
                if (dev->irq)
                        free_irq(dev->irq, dev);
                return -ENOMEM;
index 0b99b554929545cecf0abf93812873d7306518d4..eb971755a3ff34c5b8f76d5b8b63bf5f3a83aad0 100644 (file)
@@ -676,7 +676,7 @@ static void bf537mac_rx(struct net_device *dev)
        skb->protocol = eth_type_trans(skb, dev);
 #if defined(BFIN_MAC_CSUM_OFFLOAD)
        skb->csum = current_rx_ptr->status.ip_payload_csum;
-       skb->ip_summed = CHECKSUM_PARTIAL;
+       skb->ip_summed = CHECKSUM_COMPLETE;
 #endif
 
        netif_rx(skb);
index f78e5bf7cb3334f7dba7e1dcdddf35c10fd79a7b..5f82a4647eee4dcec3240be6ec51932926efae16 100644 (file)
@@ -40,7 +40,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME       "ehea"
-#define DRV_VERSION    "EHEA_0080"
+#define DRV_VERSION    "EHEA_0083"
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
index f0319f1e8e052e99adfde7ca658cfaf7074b1ac1..869e1604b16ea0e4b5555acbe77dff969f42cb5b 100644 (file)
@@ -136,7 +136,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
        struct ehea_port *port = netdev_priv(dev);
        struct net_device_stats *stats = &port->stats;
        struct hcp_ehea_port_cb2 *cb2;
-       u64 hret, rx_packets;
+       u64 hret, rx_packets, tx_packets;
        int i;
 
        memset(stats, 0, sizeof(*stats));
@@ -162,7 +162,11 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)
        for (i = 0; i < port->num_def_qps; i++)
                rx_packets += port->port_res[i].rx_packets;
 
-       stats->tx_packets = cb2->txucp + cb2->txmcp + cb2->txbcp;
+       tx_packets = 0;
+       for (i = 0; i < port->num_def_qps + port->num_add_tx_qps; i++)
+               tx_packets += port->port_res[i].tx_packets;
+
+       stats->tx_packets = tx_packets;
        stats->multicast = cb2->rxmcp;
        stats->rx_errors = cb2->rxuerr;
        stats->rx_bytes = cb2->rxo;
@@ -406,11 +410,6 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
        if (cqe->status & EHEA_CQE_STAT_ERR_CRC)
                pr->p_stats.err_frame_crc++;
 
-       if (netif_msg_rx_err(pr->port)) {
-               ehea_error("CQE Error for QP %d", pr->qp->init_attr.qp_nr);
-               ehea_dump(cqe, sizeof(*cqe), "CQE");
-       }
-
        if (rq == 2) {
                *processed_rq2 += 1;
                skb = get_skb_by_index(pr->rq2_skba.arr, pr->rq2_skba.len, cqe);
@@ -422,7 +421,11 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
        }
 
        if (cqe->status & EHEA_CQE_STAT_FAT_ERR_MASK) {
-               ehea_error("Critical receive error. Resetting port.");
+               if (netif_msg_rx_err(pr->port)) {
+                       ehea_error("Critical receive error for QP %d. "
+                                  "Resetting port.", pr->qp->init_attr.qp_nr);
+                       ehea_dump(cqe, sizeof(*cqe), "CQE");
+               }
                schedule_work(&pr->port->reset_task);
                return 1;
        }
@@ -2000,6 +2003,7 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev)
        }
 
        ehea_post_swqe(pr->qp, swqe);
+       pr->tx_packets++;
 
        if (unlikely(atomic_read(&pr->swqe_avail) <= 1)) {
                spin_lock_irqsave(&pr->netif_queue, flags);
index 562de0ebdd851a3e3e3cabee9f41df66fcaa4e1a..bc62d389c166578fe179567968009bc8b6752b60 100644 (file)
@@ -145,8 +145,8 @@ struct ehea_rwqe {
 #define EHEA_CQE_VLAN_TAG_XTRACT   0x0400
 
 #define EHEA_CQE_TYPE_RQ           0x60
-#define EHEA_CQE_STAT_ERR_MASK     0x720F
-#define EHEA_CQE_STAT_FAT_ERR_MASK 0x1F
+#define EHEA_CQE_STAT_ERR_MASK     0x700F
+#define EHEA_CQE_STAT_FAT_ERR_MASK 0xF
 #define EHEA_CQE_STAT_ERR_TCP      0x4000
 #define EHEA_CQE_STAT_ERR_IP       0x2000
 #define EHEA_CQE_STAT_ERR_CRC      0x1000
index 92ce2e38f0d54611c65a1ae7e0eb51ed4a78693b..a96583cceb5ef77c1e374caa47a45ec43471f151 100644 (file)
@@ -5286,19 +5286,15 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
                if (readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_PHY_INIT) {
                        np->mac_in_use = readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_MGMT_ST;
                        dprintk(KERN_INFO "%s: mgmt unit is running. mac in use %x.\n", pci_name(pci_dev), np->mac_in_use);
-                       for (i = 0; i < 5000; i++) {
-                               msleep(1);
-                               if (nv_mgmt_acquire_sema(dev)) {
-                                       /* management unit setup the phy already? */
-                                       if ((readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK) ==
-                                           NVREG_XMITCTL_SYNC_PHY_INIT) {
-                                               /* phy is inited by mgmt unit */
-                                               phyinitialized = 1;
-                                               dprintk(KERN_INFO "%s: Phy already initialized by mgmt unit.\n", pci_name(pci_dev));
-                                       } else {
-                                               /* we need to init the phy */
-                                       }
-                                       break;
+                       if (nv_mgmt_acquire_sema(dev)) {
+                               /* management unit setup the phy already? */
+                               if ((readl(base + NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK) ==
+                                   NVREG_XMITCTL_SYNC_PHY_INIT) {
+                                       /* phy is inited by mgmt unit */
+                                       phyinitialized = 1;
+                                       dprintk(KERN_INFO "%s: Phy already initialized by mgmt unit.\n", pci_name(pci_dev));
+                               } else {
+                                       /* we need to init the phy */
                                }
                        }
                }
@@ -5613,6 +5609,22 @@ static struct pci_device_id pci_tbl[] = {
                PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_35),
                .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
        },
+       {       /* MCP79 Ethernet Controller */
+               PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_36),
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+       },
+       {       /* MCP79 Ethernet Controller */
+               PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_37),
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+       },
+       {       /* MCP79 Ethernet Controller */
+               PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_38),
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+       },
+       {       /* MCP79 Ethernet Controller */
+               PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, PCI_DEVICE_ID_NVIDIA_NVENET_39),
+               .driver_data = DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+       },
        {0,},
 };
 
index 0de3aa2a2e44172d99598556ee7d5b2e9c721997..eb0718b441bbb01523739a7093b0f7fcd87d769e 100644 (file)
@@ -642,9 +642,11 @@ static void emac_reset_work(struct work_struct *work)
        DBG(dev, "reset_work" NL);
 
        mutex_lock(&dev->link_lock);
-       emac_netif_stop(dev);
-       emac_full_tx_reset(dev);
-       emac_netif_start(dev);
+       if (dev->opened) {
+               emac_netif_stop(dev);
+               emac_full_tx_reset(dev);
+               emac_netif_start(dev);
+       }
        mutex_unlock(&dev->link_lock);
 }
 
@@ -1063,10 +1065,9 @@ static int emac_open(struct net_device *ndev)
        dev->rx_sg_skb = NULL;
 
        mutex_lock(&dev->link_lock);
+       dev->opened = 1;
 
-       /* XXX Start PHY polling now. Shouldn't wr do like sungem instead and
-        * always poll the PHY even when the iface is down ? That would allow
-        * things like laptop-net to work. --BenH
+       /* Start PHY polling now.
         */
        if (dev->phy.address >= 0) {
                int link_poll_interval;
@@ -1145,9 +1146,11 @@ static void emac_link_timer(struct work_struct *work)
        int link_poll_interval;
 
        mutex_lock(&dev->link_lock);
-
        DBG2(dev, "link timer" NL);
 
+       if (!dev->opened)
+               goto bail;
+
        if (dev->phy.def->ops->poll_link(&dev->phy)) {
                if (!netif_carrier_ok(dev->ndev)) {
                        /* Get new link parameters */
@@ -1170,13 +1173,14 @@ static void emac_link_timer(struct work_struct *work)
                link_poll_interval = PHY_POLL_LINK_OFF;
        }
        schedule_delayed_work(&dev->link_work, link_poll_interval);
-
+ bail:
        mutex_unlock(&dev->link_lock);
 }
 
 static void emac_force_link_update(struct emac_instance *dev)
 {
        netif_carrier_off(dev->ndev);
+       smp_rmb();
        if (dev->link_polling) {
                cancel_rearming_delayed_work(&dev->link_work);
                if (dev->link_polling)
@@ -1191,11 +1195,14 @@ static int emac_close(struct net_device *ndev)
 
        DBG(dev, "close" NL);
 
-       if (dev->phy.address >= 0)
+       if (dev->phy.address >= 0) {
+               dev->link_polling = 0;
                cancel_rearming_delayed_work(&dev->link_work);
-
+       }
+       mutex_lock(&dev->link_lock);
        emac_netif_stop(dev);
-       flush_scheduled_work();
+       dev->opened = 0;
+       mutex_unlock(&dev->link_lock);
 
        emac_rx_disable(dev);
        emac_tx_disable(dev);
@@ -2756,6 +2763,8 @@ static int __devexit emac_remove(struct of_device *ofdev)
 
        unregister_netdev(dev->ndev);
 
+       flush_scheduled_work();
+
        if (emac_has_feature(dev, EMAC_FTR_HAS_TAH))
                tah_detach(dev->tah_dev, dev->tah_port);
        if (emac_has_feature(dev, EMAC_FTR_HAS_RGMII))
index 4011803117caae85be457cc5b6774b351c097fb1..a010b2463fd93ba3a285a40063941f03399472dc 100644 (file)
@@ -258,6 +258,7 @@ struct emac_instance {
        int                             stop_timeout;   /* in us */
        int                             no_mcast;
        int                             mcast_pending;
+       int                             opened;
        struct work_struct              reset_work;
        spinlock_t                      lock;
 };
index a2070db725c903ced2fae8079cf71fd2ae32d182..8c4c7430d906cf38cf8e7ce54aec3db5456826ec 100644 (file)
@@ -1320,15 +1320,11 @@ static int sky2_up(struct net_device *dev)
         */
        if (otherdev && netif_running(otherdev) &&
            (cap = pci_find_capability(hw->pdev, PCI_CAP_ID_PCIX))) {
-               struct sky2_port *osky2 = netdev_priv(otherdev);
                u16 cmd;
 
                pci_read_config_word(hw->pdev, cap + PCI_X_CMD, &cmd);
                cmd &= ~PCI_X_CMD_MAX_SPLIT;
                pci_write_config_word(hw->pdev, cap + PCI_X_CMD, cmd);
-
-               sky2->rx_csum = 0;
-               osky2->rx_csum = 0;
        }
 
        if (netif_msg_ifup(sky2))
@@ -4013,7 +4009,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
        sky2->duplex = -1;
        sky2->speed = -1;
        sky2->advertising = sky2_supported_modes(hw);
-       sky2->rx_csum = 1;
+       sky2->rx_csum = (hw->chip_id != CHIP_ID_YUKON_XL);
        sky2->wol = wol;
 
        spin_lock_init(&sky2->phy_lock);
index dd18af0ce67616653d815be1c9bc8102ce6c80b8..1a3d80bfe9ea45927864f6fbd1c42fedcebaa595 100644 (file)
@@ -428,7 +428,6 @@ static inline void smc911x_drop_pkt(struct net_device *dev)
  */
 static inline void      smc911x_rcv(struct net_device *dev)
 {
-       struct smc911x_local *lp = netdev_priv(dev);
        unsigned long ioaddr = dev->base_addr;
        unsigned int pkt_len, status;
        struct sk_buff *skb;
@@ -473,6 +472,7 @@ static inline void   smc911x_rcv(struct net_device *dev)
                skb_put(skb,pkt_len-4);
 #ifdef SMC_USE_DMA
                {
+               struct smc911x_local *lp = netdev_priv(dev);
                unsigned int fifo;
                /* Lower the FIFO threshold if possible */
                fifo = SMC_GET_FIFO_INT();
@@ -1379,13 +1379,6 @@ static void smc911x_set_multicast_list(struct net_device *dev)
        unsigned int multicast_table[2];
        unsigned int mcr, update_multicast = 0;
        unsigned long flags;
-       /* table for flipping the order of 5 bits */
-       static const unsigned char invert5[] =
-               {0x00, 0x10, 0x08, 0x18, 0x04, 0x14, 0x0C, 0x1C,
-                0x02, 0x12, 0x0A, 0x1A, 0x06, 0x16, 0x0E, 0x1E,
-                0x01, 0x11, 0x09, 0x19, 0x05, 0x15, 0x0D, 0x1D,
-                0x03, 0x13, 0x0B, 0x1B, 0x07, 0x17, 0x0F, 0x1F};
-
 
        DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __FUNCTION__);
 
@@ -1432,7 +1425,7 @@ static void smc911x_set_multicast_list(struct net_device *dev)
 
                cur_addr = dev->mc_list;
                for (i = 0; i < dev->mc_count; i++, cur_addr = cur_addr->next) {
-                       int position;
+                       u32 position;
 
                        /* do we have a pointer here? */
                        if (!cur_addr)
@@ -1442,12 +1435,10 @@ static void smc911x_set_multicast_list(struct net_device *dev)
                        if (!(*cur_addr->dmi_addr & 1))
                                 continue;
 
-                       /* only use the low order bits */
-                       position = crc32_le(~0, cur_addr->dmi_addr, 6) & 0x3f;
+                       /* upper 6 bits are used as hash index */
+                       position = ether_crc(ETH_ALEN, cur_addr->dmi_addr)>>26;
 
-                       /* do some messy swapping to put the bit in the right spot */
-                       multicast_table[invert5[position&0x1F]&0x1] |=
-                               (1<<invert5[(position>>1)&0x1F]);
+                       multicast_table[position>>5] |= 1 << (position&0x1f);
                }
 
                /* be sure I get rid of flags I might have set */
index 16a0edc078fd370b7995d98cbe331aff8cc26785..d04e4fa35206b888d1d65e724d2baf38af1dd3c9 100644 (file)
@@ -37,7 +37,7 @@
   #define SMC_USE_16BIT                0
   #define SMC_USE_32BIT                1
   #define SMC_IRQ_SENSE                IRQF_TRIGGER_FALLING
-#elif CONFIG_SH_MAGIC_PANEL_R2
+#elif defined(CONFIG_SH_MAGIC_PANEL_R2)
   #define SMC_USE_SH_DMA       0
   #define SMC_USE_16BIT                0
   #define SMC_USE_32BIT                1
index db34e1eb67e98e678c08c61ae4dd19daded4b073..07b7f7120e374854be1a296496916690c587cc38 100644 (file)
@@ -55,7 +55,7 @@
 #define SMC_insw(a, r, p, l)   readsw((a) + (r), p, l)
 #define SMC_outsw(a, r, p, l)  writesw((a) + (r), p, l)
 
-#elif defined(CONFIG_BFIN)
+#elif defined(CONFIG_BLACKFIN)
 
 #define SMC_IRQ_FLAGS          IRQF_TRIGGER_HIGH
 #define RPC_LSA_DEFAULT                RPC_LED_100_10
index ca90566d5bcd4f5a0f8cb1e06de329103280ffbe..b4891caeae5ad36aeeb0ed913ecdc85fe012ade3 100644 (file)
@@ -2118,8 +2118,8 @@ static int dmfe_suspend(struct pci_dev *pci_dev, pm_message_t state)
        pci_enable_wake(pci_dev, PCI_D3cold, 1);
 
        /* Power down device*/
-       pci_set_power_state(pci_dev, pci_choose_state (pci_dev,state));
        pci_save_state(pci_dev);
+       pci_set_power_state(pci_dev, pci_choose_state (pci_dev, state));
 
        return 0;
 }
@@ -2129,8 +2129,8 @@ static int dmfe_resume(struct pci_dev *pci_dev)
        struct net_device *dev = pci_get_drvdata(pci_dev);
        u32 tmp;
 
-       pci_restore_state(pci_dev);
        pci_set_power_state(pci_dev, PCI_D0);
+       pci_restore_state(pci_dev);
 
        /* Re-initilize DM910X board */
        dmfe_init_dm910x(dev);
index 2c685734b7a4e36a988ad3f53553bdafda10c5ff..1ffdd106f4c49a898f61f8a6d5be98da4c1a4d95 100644 (file)
@@ -94,7 +94,7 @@ static void dm_write_async_callback(struct urb *urb)
        struct usb_ctrlrequest *req = (struct usb_ctrlrequest *)urb->context;
 
        if (urb->status < 0)
-               printk(KERN_DEBUG "dm_write_async_callback() failed with %d",
+               printk(KERN_DEBUG "dm_write_async_callback() failed with %d\n",
                       urb->status);
 
        kfree(req);
index 1ee009e8fec8c6a670c7a33ac7da40b0844d3b80..111aa10f11369deed862766a8cb7b27956099f87 100644 (file)
 #define PCI_DEVICE_ID_NVIDIA_NVENET_33              0x0761
 #define PCI_DEVICE_ID_NVIDIA_NVENET_34              0x0762
 #define PCI_DEVICE_ID_NVIDIA_NVENET_35              0x0763
+#define PCI_DEVICE_ID_NVIDIA_NVENET_36              0x0AB0
+#define PCI_DEVICE_ID_NVIDIA_NVENET_37              0x0AB1
+#define PCI_DEVICE_ID_NVIDIA_NVENET_38              0x0AB2
+#define PCI_DEVICE_ID_NVIDIA_NVENET_39              0x0AB3
 
 #define PCI_VENDOR_ID_IMS              0x10e0
 #define PCI_DEVICE_ID_IMS_TT128                0x9128