Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6

* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6:
ibmtr: Drain rich supply of modpost warnings.
3c59x: Fix several modpost warnings
z85230: Fix FIFO handling
r8169: fix a race between PCI probe and dev_open
r8169: revert bogus BMCR reset
sky2: turn off Rx checksum on bad hardware
mv643xx: Clear pending interrupts before calling request_irq
myri10ge: add a wc_enabled flag to myri10ge_priv
myri10ge: prevent 4k rdma on SGI TIOCE chipset
myri10ge: use pci_map_page to prepare the dmatest buffer
myri10ge: fix error checking and return value in myri10ge_allocate_rings
netxen: fix warnings
via-rhine: set avoid_D3 for broken BIOSes
[PATCH] bcm43xx: Fix assertion failures in interrupt handler
[PATCH] bcm43xx: Fix bug in frequency to channel conversion
[PATCH] bcm43xx: Fix errors in specs to code translation in B6PHY init

+145 -63
+13 -15
drivers/net/3c59x.c
··· 858 858 }; 859 859 MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids); 860 860 861 - static int vortex_eisa_probe(struct device *device); 862 - static int vortex_eisa_remove(struct device *device); 863 - 864 - static struct eisa_driver vortex_eisa_driver = { 865 - .id_table = vortex_eisa_ids, 866 - .driver = { 867 - .name = "3c59x", 868 - .probe = vortex_eisa_probe, 869 - .remove = vortex_eisa_remove 870 - } 871 - }; 872 - 873 - static int vortex_eisa_probe(struct device *device) 861 + static int __init vortex_eisa_probe(struct device *device) 874 862 { 875 863 void __iomem *ioaddr; 876 864 struct eisa_device *edev; ··· 881 893 return 0; 882 894 } 883 895 884 - static int vortex_eisa_remove(struct device *device) 896 + static int __devexit vortex_eisa_remove(struct device *device) 885 897 { 886 898 struct eisa_device *edev; 887 899 struct net_device *dev; ··· 906 918 free_netdev(dev); 907 919 return 0; 908 920 } 909 - #endif 921 + 922 + static struct eisa_driver vortex_eisa_driver = { 923 + .id_table = vortex_eisa_ids, 924 + .driver = { 925 + .name = "3c59x", 926 + .probe = vortex_eisa_probe, 927 + .remove = __devexit_p(vortex_eisa_remove) 928 + } 929 + }; 930 + 931 + #endif /* CONFIG_EISA */ 910 932 911 933 /* returns count found (>= 0), or negative on error */ 912 934 static int __init vortex_eisa_init(void)
+6 -4
drivers/net/mv643xx_eth.c
··· 787 787 unsigned int size; 788 788 int err; 789 789 790 + /* Clear any pending ethernet port interrupts */ 791 + mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); 792 + mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); 793 + /* wait for previous write to complete */ 794 + mv_read (MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num)); 795 + 790 796 err = request_irq(dev->irq, mv643xx_eth_int_handler, 791 797 IRQF_SHARED | IRQF_SAMPLE_RANDOM, dev->name, dev); 792 798 if (err) { ··· 880 874 ether_init_rx_desc_ring(mp); 881 875 882 876 mv643xx_eth_rx_refill_descs(dev); /* Fill RX ring with skb's */ 883 - 884 - /* Clear any pending ethernet port interrupts */ 885 - mv_write(MV643XX_ETH_INTERRUPT_CAUSE_REG(port_num), 0); 886 - mv_write(MV643XX_ETH_INTERRUPT_CAUSE_EXTEND_REG(port_num), 0); 887 877 888 878 eth_port_start(dev); 889 879
+33 -9
drivers/net/myri10ge/myri10ge.c
··· 181 181 int intr_coal_delay; 182 182 __be32 __iomem *intr_coal_delay_ptr; 183 183 int mtrr; 184 + int wc_enabled; 184 185 int wake_queue; 185 186 int stop_queue; 186 187 int down_cnt; ··· 718 717 int status; 719 718 size_t bytes; 720 719 u32 len; 720 + struct page *dmatest_page; 721 + dma_addr_t dmatest_bus; 721 722 722 723 /* try to send a reset command to the card to see if it 723 724 * is alive */ ··· 729 726 dev_err(&mgp->pdev->dev, "failed reset\n"); 730 727 return -ENXIO; 731 728 } 729 + dmatest_page = alloc_page(GFP_KERNEL); 730 + if (!dmatest_page) 731 + return -ENOMEM; 732 + dmatest_bus = pci_map_page(mgp->pdev, dmatest_page, 0, PAGE_SIZE, 733 + DMA_BIDIRECTIONAL); 732 734 733 735 /* Now exchange information about interrupts */ 734 736 ··· 772 764 773 765 len = mgp->tx.boundary; 774 766 775 - cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); 776 - cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); 767 + cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus); 768 + cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus); 777 769 cmd.data2 = len * 0x10000; 778 770 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); 779 771 if (status == 0) ··· 782 774 else 783 775 dev_warn(&mgp->pdev->dev, "DMA read benchmark failed: %d\n", 784 776 status); 785 - cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); 786 - cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); 777 + cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus); 778 + cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus); 787 779 cmd.data2 = len * 0x1; 788 780 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); 789 781 if (status == 0) ··· 793 785 dev_warn(&mgp->pdev->dev, "DMA write benchmark failed: %d\n", 794 786 status); 795 787 796 - cmd.data0 = MYRI10GE_LOWPART_TO_U32(mgp->rx_done.bus); 797 - cmd.data1 = MYRI10GE_HIGHPART_TO_U32(mgp->rx_done.bus); 788 + cmd.data0 = MYRI10GE_LOWPART_TO_U32(dmatest_bus); 789 + cmd.data1 = MYRI10GE_HIGHPART_TO_U32(dmatest_bus); 798 790 cmd.data2 = len * 0x10001; 799 791 status = myri10ge_send_cmd(mgp, MXGEFW_DMA_TEST, &cmd, 0); 800 792 if (status == 0) ··· 803 795 else 804 796 dev_warn(&mgp->pdev->dev, 805 797 "DMA read/write benchmark failed: %d\n", status); 798 + 799 + pci_unmap_page(mgp->pdev, dmatest_bus, PAGE_SIZE, DMA_BIDIRECTIONAL); 800 + put_page(dmatest_page); 806 801 807 802 memset(mgp->rx_done.entry, 0, bytes); 808 803 ··· 1386 1375 data[i] = ((unsigned long *)&mgp->stats)[i]; 1387 1376 1388 1377 data[i++] = (unsigned int)mgp->tx.boundary; 1389 - data[i++] = (unsigned int)(mgp->mtrr >= 0); 1378 + data[i++] = (unsigned int)mgp->wc_enabled; 1390 1379 data[i++] = (unsigned int)mgp->pdev->irq; 1391 1380 data[i++] = (unsigned int)mgp->msi_enabled; 1392 1381 data[i++] = (unsigned int)mgp->read_dma; ··· 1467 1456 status = myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_SEND_RING_SIZE, &cmd, 0); 1468 1457 tx_ring_size = cmd.data0; 1469 1458 status |= myri10ge_send_cmd(mgp, MXGEFW_CMD_GET_RX_RING_SIZE, &cmd, 0); 1459 + if (status != 0) 1460 + return status; 1470 1461 rx_ring_size = cmd.data0; 1471 1462 1472 1463 tx_ring_entries = tx_ring_size / sizeof(struct mcp_kreq_ether_send); 1473 1464 rx_ring_entries = rx_ring_size / sizeof(struct mcp_dma_addr); 1474 1465 mgp->tx.mask = tx_ring_entries - 1; 1475 1466 mgp->rx_small.mask = mgp->rx_big.mask = rx_ring_entries - 1; 1467 + 1468 + status = -ENOMEM; 1476 1469 1477 1470 /* allocate the host shadow rings */ 1478 1471 ··· 1750 1735 goto abort_with_irq; 1751 1736 } 1752 1737 1753 - if (myri10ge_wcfifo && mgp->mtrr >= 0) { 1738 + if (myri10ge_wcfifo && mgp->wc_enabled) { 1754 1739 mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; 1755 1740 mgp->rx_small.wc_fifo = 1756 1741 (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; ··· 2525 2510 bridge->vendor, bridge->device); 2526 2511 mgp->tx.boundary = 4096; 2527 2512 mgp->fw_name = myri10ge_fw_aligned; 2513 + } else if (bridge && 2514 + bridge->vendor == PCI_VENDOR_ID_SGI && 2515 + bridge->device == 0x4002 /* TIOCE pcie-port */ ) { 2516 + /* this pcie bridge does not support 4K rdma request */ 2517 + mgp->tx.boundary = 2048; 2518 + mgp->fw_name = myri10ge_fw_aligned; 2528 2519 } 2529 2520 } else { 2530 2521 if (myri10ge_force_firmware == 1) { ··· 2851 2830 mgp->board_span = pci_resource_len(pdev, 0); 2852 2831 mgp->iomem_base = pci_resource_start(pdev, 0); 2853 2832 mgp->mtrr = -1; 2833 + mgp->wc_enabled = 0; 2854 2834 #ifdef CONFIG_MTRR 2855 2835 mgp->mtrr = mtrr_add(mgp->iomem_base, mgp->board_span, 2856 2836 MTRR_TYPE_WRCOMB, 1); 2837 + if (mgp->mtrr >= 0) 2838 + mgp->wc_enabled = 1; 2857 2839 #endif 2858 2840 /* Hack. need to get rid of these magic numbers */ 2859 2841 mgp->sram_size = ··· 2951 2927 dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", 2952 2928 (mgp->msi_enabled ? "MSI" : "xPIC"), 2953 2929 netdev->irq, mgp->tx.boundary, mgp->fw_name, 2954 - (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); 2930 + (mgp->wc_enabled ? "Enabled" : "Disabled")); 2955 2931 2956 2932 return 0; 2957 2933
+3 -2
drivers/net/netxen/netxen_nic_hw.c
··· 228 228 &adapter->ctx_desc_pdev); 229 229 230 230 printk("ctx_desc_phys_addr: 0x%llx\n", 231 - (u64) adapter->ctx_desc_phys_addr); 231 + (unsigned long long) adapter->ctx_desc_phys_addr); 232 232 if (addr == NULL) { 233 233 DPRINTK(ERR, "bad return from pci_alloc_consistent\n"); 234 234 err = -ENOMEM; ··· 247 247 adapter->max_tx_desc_count, 248 248 (dma_addr_t *) & hw->cmd_desc_phys_addr, 249 249 &adapter->ahw.cmd_desc_pdev); 250 - printk("cmd_desc_phys_addr: 0x%llx\n", (u64) hw->cmd_desc_phys_addr); 250 + printk("cmd_desc_phys_addr: 0x%llx\n", 251 + (unsigned long long) hw->cmd_desc_phys_addr); 251 252 252 253 if (addr == NULL) { 253 254 DPRINTK(ERR, "bad return from pci_alloc_consistent\n");
+7 -7
drivers/net/r8169.c
··· 572 572 { 573 573 unsigned int val; 574 574 575 - mdio_write(ioaddr, MII_BMCR, BMCR_RESET); 576 - val = mdio_read(ioaddr, MII_BMCR); 575 + val = mdio_read(ioaddr, MII_BMCR) | BMCR_RESET; 576 + mdio_write(ioaddr, MII_BMCR, val & 0xffff); 577 577 } 578 578 579 579 static void rtl8169_check_link_status(struct net_device *dev, ··· 1368 1368 (tp->phy_version >= RTL_GIGA_PHY_VER_H)) 1369 1369 return; 1370 1370 1371 - init_timer(timer); 1372 - timer->expires = jiffies + RTL8169_PHY_TIMEOUT; 1373 - timer->data = (unsigned long)(dev); 1374 - timer->function = rtl8169_phy_timer; 1375 - add_timer(timer); 1371 + mod_timer(timer, jiffies + RTL8169_PHY_TIMEOUT); 1376 1372 } 1377 1373 1378 1374 #ifdef CONFIG_NET_POLL_CONTROLLER ··· 1680 1684 tp->pci_dev = pdev; 1681 1685 tp->mmio_addr = ioaddr; 1682 1686 tp->align = rtl_cfg_info[ent->driver_data].align; 1687 + 1688 + init_timer(&tp->timer); 1689 + tp->timer.data = (unsigned long) dev; 1690 + tp->timer.function = rtl8169_phy_timer; 1683 1691 1684 1692 spin_lock_init(&tp->lock); 1685 1693
+21 -3
drivers/net/sky2.c
··· 2165 2165 /* fall through */ 2166 2166 #endif 2167 2167 case OP_RXCHKS: 2168 - skb = sky2->rx_ring[sky2->rx_next].skb; 2169 - skb->ip_summed = CHECKSUM_COMPLETE; 2170 - skb->csum = status & 0xffff; 2168 + if (!sky2->rx_csum) 2169 + break; 2170 + 2171 + /* Both checksum counters are programmed to start at 2172 + * the same offset, so unless there is a problem they 2173 + * should match. This failure is an early indication that 2174 + * hardware receive checksumming won't work. 2175 + */ 2176 + if (likely(status >> 16 == (status & 0xffff))) { 2177 + skb = sky2->rx_ring[sky2->rx_next].skb; 2178 + skb->ip_summed = CHECKSUM_COMPLETE; 2179 + skb->csum = status & 0xffff; 2180 + } else { 2181 + printk(KERN_NOTICE PFX "%s: hardware receive " 2182 + "checksum problem (status = %#x)\n", 2183 + dev->name, status); 2184 + sky2->rx_csum = 0; 2185 + sky2_write32(sky2->hw, 2186 + Q_ADDR(rxqaddr[le->link], Q_CSR), 2187 + BMU_DIS_RX_CHKSUM); 2188 + } 2171 2189 break; 2172 2190 2173 2191 case OP_TXINDEXLE:
+12 -13
drivers/net/tokenring/ibmtr.c
··· 186 186 #define TRC_INITV 0x02 /* verbose init trace points */ 187 187 static unsigned char ibmtr_debug_trace = 0; 188 188 189 - static int ibmtr_probe(struct net_device *dev); 190 189 static int ibmtr_probe1(struct net_device *dev, int ioaddr); 191 190 static unsigned char get_sram_size(struct tok_info *adapt_info); 192 191 static int trdev_init(struct net_device *dev); ··· 334 335 #endif 335 336 } 336 337 337 - int ibmtr_probe_card(struct net_device *dev) 338 - { 339 - int err = ibmtr_probe(dev); 340 - if (!err) { 341 - err = register_netdev(dev); 342 - if (err) 343 - ibmtr_cleanup_card(dev); 344 - } 345 - return err; 346 - } 347 - 348 338 /**************************************************************************** 349 339 * ibmtr_probe(): Routine specified in the network device structure 350 340 * to probe for an IBM Token Ring Adapter. Routine outline: ··· 346 358 * which references it. 347 359 ****************************************************************************/ 348 360 349 - static int ibmtr_probe(struct net_device *dev) 361 + static int __init ibmtr_probe(struct net_device *dev) 350 362 { 351 363 int i; 352 364 int base_addr = dev->base_addr; ··· 364 376 if (!ibmtr_probe1(dev, ioaddr)) return 0; 365 377 } 366 378 return -ENODEV; 379 + } 380 + 381 + int __init ibmtr_probe_card(struct net_device *dev) 382 + { 383 + int err = ibmtr_probe(dev); 384 + if (!err) { 385 + err = register_netdev(dev); 386 + if (err) 387 + ibmtr_cleanup_card(dev); 388 + } 389 + return err; 367 390 } 368 391 369 392 /*****************************************************************************/
+30 -2
drivers/net/via-rhine.c
··· 30 30 */ 31 31 32 32 #define DRV_NAME "via-rhine" 33 - #define DRV_VERSION "1.4.2" 34 - #define DRV_RELDATE "Sept-11-2006" 33 + #define DRV_VERSION "1.4.3" 34 + #define DRV_RELDATE "2007-03-06" 35 35 36 36 37 37 /* A few user-configurable values. ··· 105 105 #include <asm/io.h> 106 106 #include <asm/irq.h> 107 107 #include <asm/uaccess.h> 108 + #include <linux/dmi.h> 108 109 109 110 /* These identify the driver base version and may not be removed. */ 110 111 static char version[] __devinitdata = ··· 1996 1995 .shutdown = rhine_shutdown, 1997 1996 }; 1998 1997 1998 + static struct dmi_system_id __initdata rhine_dmi_table[] = { 1999 + { 2000 + .ident = "EPIA-M", 2001 + .matches = { 2002 + DMI_MATCH(DMI_BIOS_VENDOR, "Award Software International, Inc."), 2003 + DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"), 2004 + }, 2005 + }, 2006 + { 2007 + .ident = "KV7", 2008 + .matches = { 2009 + DMI_MATCH(DMI_BIOS_VENDOR, "Phoenix Technologies, LTD"), 2010 + DMI_MATCH(DMI_BIOS_VERSION, "6.00 PG"), 2011 + }, 2012 + }, 2013 + { NULL } 2014 + }; 1999 2015 2000 2016 static int __init rhine_init(void) 2001 2017 { ··· 2020 2002 #ifdef MODULE 2021 2003 printk(version); 2022 2004 #endif 2005 + if (dmi_check_system(rhine_dmi_table)) { 2006 + /* these BIOSes fail at PXE boot if chip is in D3 */ 2007 + avoid_D3 = 1; 2008 + printk(KERN_WARNING "%s: Broken BIOS detected, avoid_D3 " 2009 + "enabled.\n", 2010 + DRV_NAME); 2011 + } 2012 + else if (avoid_D3) 2013 + printk(KERN_INFO "%s: avoid_D3 set.\n", DRV_NAME); 2014 + 2023 2015 return pci_register_driver(&rhine_driver); 2024 2016 } 2025 2017
+1 -1
drivers/net/wan/z85230.c
··· 407 407 while(c->txcount) { 408 408 /* FIFO full ? */ 409 409 if(!(read_zsreg(c, R0)&4)) 410 - break; 410 + return; 411 411 c->txcount--; 412 412 /* 413 413 * Shovel out the byte
+3 -3
drivers/net/wireless/bcm43xx/bcm43xx_main.c
··· 1858 1858 1859 1859 spin_lock(&bcm->irq_lock); 1860 1860 1861 - assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); 1862 - assert(bcm->current_core->id == BCM43xx_COREID_80211); 1863 - 1864 1861 reason = bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_REASON); 1865 1862 if (reason == 0xffffffff) { 1866 1863 /* irq not for us (shared irq) */ ··· 1867 1870 reason &= bcm43xx_read32(bcm, BCM43xx_MMIO_GEN_IRQ_MASK); 1868 1871 if (!reason) 1869 1872 goto out; 1873 + 1874 + assert(bcm43xx_status(bcm) == BCM43xx_STAT_INITIALIZED); 1875 + assert(bcm->current_core->id == BCM43xx_COREID_80211); 1870 1876 1871 1877 bcm->dma_reason[0] = bcm43xx_read32(bcm, BCM43xx_MMIO_DMA0_REASON) 1872 1878 & 0x0001DC00;
+8 -2
drivers/net/wireless/bcm43xx/bcm43xx_phy.c
··· 859 859 bcm43xx_radio_write16(bcm, 0x005D, 0x0088); 860 860 bcm43xx_radio_write16(bcm, 0x005E, 0x0088); 861 861 bcm43xx_radio_write16(bcm, 0x007D, 0x0088); 862 + bcm43xx_shm_write32(bcm, BCM43xx_SHM_SHARED, 863 + BCM43xx_UCODEFLAGS_OFFSET, 864 + (bcm43xx_shm_read32(bcm, BCM43xx_SHM_SHARED, 865 + BCM43xx_UCODEFLAGS_OFFSET) 866 + | 0x00000200)); 862 867 } 863 868 if (radio->revision == 8) { 864 869 bcm43xx_radio_write16(bcm, 0x0051, 0x0000); ··· 946 941 bcm43xx_phy_write(bcm, 0x0038, 0x0668); 947 942 bcm43xx_radio_set_txpower_bg(bcm, 0xFFFF, 0xFFFF, 0xFFFF); 948 943 if (radio->revision <= 5) 949 - bcm43xx_phy_write(bcm, 0x005D, bcm43xx_phy_read(bcm, 0x005D) | 0x0003); 944 + bcm43xx_phy_write(bcm, 0x005D, (bcm43xx_phy_read(bcm, 0x005D) 945 + & 0xFF80) | 0x0003); 950 946 if (radio->revision <= 2) 951 947 bcm43xx_radio_write16(bcm, 0x005D, 0x000D); 952 948 ··· 964 958 bcm43xx_phy_write(bcm, 0x0016, 0x0410); 965 959 bcm43xx_phy_write(bcm, 0x0017, 0x0820); 966 960 bcm43xx_phy_write(bcm, 0x0062, 0x0007); 967 - (void) bcm43xx_radio_calibrationvalue(bcm); 961 + bcm43xx_radio_init2050(bcm); 968 962 bcm43xx_phy_lo_g_measure(bcm); 969 963 if (bcm->sprom.boardflags & BCM43xx_BFL_RSSI) { 970 964 bcm43xx_calc_nrssi_slope(bcm);
+8 -2
drivers/net/wireless/bcm43xx/bcm43xx_wx.c
··· 105 105 struct bcm43xx_private *bcm = bcm43xx_priv(net_dev); 106 106 unsigned long flags; 107 107 u8 channel; 108 + s8 expon; 108 109 int freq; 109 110 int err = -EINVAL; 110 111 111 112 mutex_lock(&bcm->mutex); 112 113 spin_lock_irqsave(&bcm->irq_lock, flags); 113 114 114 - if ((data->freq.m >= 0) && (data->freq.m <= 1000)) { 115 + if ((data->freq.e == 0) && 116 + (data->freq.m >= 0) && (data->freq.m <= 1000)) { 115 117 channel = data->freq.m; 116 118 freq = bcm43xx_channel_to_freq(bcm, channel); 117 119 } else { 118 - channel = bcm43xx_freq_to_channel(bcm, data->freq.m); 119 120 freq = data->freq.m; 121 + expon = 6 - data->freq.e; 122 + while (--expon >= 0) /* scale down the frequency to MHz */ 123 + freq /= 10; 124 + assert(freq > 1000); 125 + channel = bcm43xx_freq_to_channel(bcm, freq); 120 126 } 121 127 if (!ieee80211_is_valid_channel(bcm->ieee, channel)) 122 128 goto out_unlock;