Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (29 commits)
tcp: Restore ordering of TCP options for the sake of inter-operability
net: Fix disjunct computation of netdev features
sctp: Fix to handle SHUTDOWN in SHUTDOWN_RECEIVED state
sctp: Fix to handle SHUTDOWN in SHUTDOWN-PENDING state
sctp: Add check for the TSN field of the SHUTDOWN chunk
sctp: Drop ICMP packet too big message with MTU larger than current PMTU
p54: enable 2.4/5GHz spectrum by eeprom bits.
orinoco: reduce stack usage in firmware download path
ath5k: fix suspend-related oops on rmmod
[netdrvr] fec_mpc52xx: Implement polling, to make netconsole work.
qlge: Fix MSI/legacy single interrupt bug.
smc911x: Make the driver safer on SMP
smc911x: Add IRQ polarity configuration
smc911x: Allow Kconfig dependency on ARM
sis190: add identifier for Atheros AR8021 PHY
8139x: reduce message severity on driver overlap
igb: add IGB_DCA instead of selecting INTEL_IOATDMA
igb: fix tx data corruption with transition to L0s on 82575
ehea: Fix memory hotplug support
netdev: DM9000: remove BLACKFIN hacking in DM9000 netdev driver
...

+558 -292
+2 -3
drivers/net/8139cp.c
··· 1836 1836 1837 1837 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 1838 1838 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { 1839 - dev_err(&pdev->dev, 1840 - "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", 1839 + dev_info(&pdev->dev, 1840 + "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip, use 8139too\n", 1841 1841 pdev->vendor, pdev->device, pdev->revision); 1842 - dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); 1843 1842 return -ENODEV; 1844 1843 } 1845 1844
+2 -3
drivers/net/8139too.c
··· 946 946 if (pdev->vendor == PCI_VENDOR_ID_REALTEK && 947 947 pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) { 948 948 dev_info(&pdev->dev, 949 - "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", 949 + "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip, use 8139cp\n", 950 950 pdev->vendor, pdev->device, pdev->revision); 951 - dev_info(&pdev->dev, 952 - "Use the \"8139cp\" driver for improved performance and stability.\n"); 951 + return -ENODEV; 953 952 } 954 953 955 954 if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
+7 -2
drivers/net/Kconfig
··· 894 894 select CRC32 895 895 select MII 896 896 depends on ARM || REDWOOD_5 || REDWOOD_6 || M32R || SUPERH || \ 897 - SOC_AU1X00 || BLACKFIN || MN10300 897 + MIPS || BLACKFIN || MN10300 898 898 help 899 899 This is a driver for SMC's 91x series of Ethernet chipsets, 900 900 including the SMC91C94 and the SMC91C111. Say Y if you want it ··· 966 966 tristate "SMSC LAN911[5678] support" 967 967 select CRC32 968 968 select MII 969 - depends on ARCH_PXA || SUPERH 969 + depends on ARM || SUPERH 970 970 help 971 971 This is a driver for SMSC's LAN911x series of Ethernet chipsets 972 972 including the new LAN9115, LAN9116, LAN9117, and LAN9118. ··· 2008 2008 Say Y here if you want to use large receive offload. 2009 2009 2010 2010 If in doubt, say N. 2011 + 2012 + config IGB_DCA 2013 + bool "Enable DCA" 2014 + default y 2015 + depends on IGB && DCA && !(IGB=y && DCA=m) 2011 2016 2012 2017 source "drivers/net/ixp2000/Kconfig" 2013 2018
+3 -3
drivers/net/ax88796.c
··· 838 838 839 839 /* find the platform resources */ 840 840 841 - dev->irq = platform_get_irq(pdev, 0); 842 - if (dev->irq < 0) { 841 + ret = platform_get_irq(pdev, 0); 842 + if (ret < 0) { 843 843 dev_err(&pdev->dev, "no IRQ specified\n"); 844 - ret = -ENXIO; 845 844 goto exit_mem; 846 845 } 846 + dev->irq = ret; 847 847 848 848 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 849 849 if (res == NULL) {
+11 -5
drivers/net/bonding/bond_main.c
··· 1341 1341 int i; 1342 1342 1343 1343 features &= ~(NETIF_F_ALL_CSUM | BOND_VLAN_FEATURES); 1344 - features |= NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | 1345 - NETIF_F_GSO_MASK | NETIF_F_NO_CSUM; 1344 + features |= NETIF_F_GSO_MASK | NETIF_F_NO_CSUM; 1345 + 1346 + if (!bond->first_slave) 1347 + goto done; 1348 + 1349 + features &= ~NETIF_F_ONE_FOR_ALL; 1346 1350 1347 1351 bond_for_each_slave(bond, slave, i) { 1348 - features = netdev_compute_features(features, 1349 - slave->dev->features); 1352 + features = netdev_increment_features(features, 1353 + slave->dev->features, 1354 + NETIF_F_ONE_FOR_ALL); 1350 1355 if (slave->dev->hard_header_len > max_hard_header_len) 1351 1356 max_hard_header_len = slave->dev->hard_header_len; 1352 1357 } 1353 1358 1359 + done: 1354 1360 features |= (bond_dev->features & BOND_VLAN_FEATURES); 1355 - bond_dev->features = features; 1361 + bond_dev->features = netdev_fix_features(features, NULL); 1356 1362 bond_dev->hard_header_len = max_hard_header_len; 1357 1363 1358 1364 return 0;
+1
drivers/net/cxgb3/l2t.c
··· 431 431 for (i = 0; i < l2t_capacity; ++i) { 432 432 d->l2tab[i].idx = i; 433 433 d->l2tab[i].state = L2T_STATE_UNUSED; 434 + __skb_queue_head_init(&d->l2tab[i].arpq); 434 435 spin_lock_init(&d->l2tab[i].lock); 435 436 atomic_set(&d->l2tab[i].refcnt, 0); 436 437 }
-9
drivers/net/dm9000.c
··· 47 47 #define CARDNAME "dm9000" 48 48 #define DRV_VERSION "1.31" 49 49 50 - #ifdef CONFIG_BLACKFIN 51 - #define readsb insb 52 - #define readsw insw 53 - #define readsl insl 54 - #define writesb outsb 55 - #define writesw outsw 56 - #define writesl outsl 57 - #endif 58 - 59 50 /* 60 51 * Transmit timeout, default 5 seconds. 61 52 */
+1 -1
drivers/net/ehea/ehea.h
··· 40 40 #include <asm/io.h> 41 41 42 42 #define DRV_NAME "ehea" 43 - #define DRV_VERSION "EHEA_0093" 43 + #define DRV_VERSION "EHEA_0094" 44 44 45 45 /* eHEA capability flags */ 46 46 #define DLPAR_PORT_ADD_REM 1
+15 -10
drivers/net/ehea/ehea_main.c
··· 2863 2863 struct ehea_adapter *adapter; 2864 2864 2865 2865 mutex_lock(&dlpar_mem_lock); 2866 - ehea_info("LPAR memory enlarged - re-initializing driver"); 2866 + ehea_info("LPAR memory changed - re-initializing driver"); 2867 2867 2868 2868 list_for_each_entry(adapter, &adapter_list, list) 2869 2869 if (adapter->active_ports) { ··· 2899 2899 goto out; 2900 2900 } 2901 2901 } 2902 - 2903 - ehea_destroy_busmap(); 2904 - ret = ehea_create_busmap(); 2905 - if (ret) { 2906 - ehea_error("creating ehea busmap failed"); 2907 - goto out; 2908 - } 2909 2902 2910 2903 clear_bit(__EHEA_STOP_XFER, &ehea_driver_flags); 2911 2904 ··· 3512 3519 static int ehea_mem_notifier(struct notifier_block *nb, 3513 3520 unsigned long action, void *data) 3514 3521 { 3522 + struct memory_notify *arg = data; 3515 3523 switch (action) { 3516 - case MEM_OFFLINE: 3517 - ehea_info("memory has been removed"); 3524 + case MEM_CANCEL_OFFLINE: 3525 + ehea_info("memory offlining canceled"); 3526 + /* Readd canceled memory block */ 3527 + case MEM_ONLINE: 3528 + ehea_info("memory is going online"); 3529 + if (ehea_add_sect_bmap(arg->start_pfn, arg->nr_pages)) 3530 + return NOTIFY_BAD; 3531 + ehea_rereg_mrs(NULL); 3532 + break; 3533 + case MEM_GOING_OFFLINE: 3534 + ehea_info("memory is going offline"); 3535 + if (ehea_rem_sect_bmap(arg->start_pfn, arg->nr_pages)) 3536 + return NOTIFY_BAD; 3518 3537 ehea_rereg_mrs(NULL); 3519 3538 break; 3520 3539 default:
+104 -33
drivers/net/ehea/ehea_qmr.c
··· 567 567 static inline int ehea_init_top_bmap(struct ehea_top_bmap *ehea_top_bmap, 568 568 int dir) 569 569 { 570 - if(!ehea_top_bmap->dir[dir]) { 570 + if (!ehea_top_bmap->dir[dir]) { 571 571 ehea_top_bmap->dir[dir] = 572 572 kzalloc(sizeof(struct ehea_dir_bmap), GFP_KERNEL); 573 573 if (!ehea_top_bmap->dir[dir]) ··· 578 578 579 579 static inline int ehea_init_bmap(struct ehea_bmap *ehea_bmap, int top, int dir) 580 580 { 581 - if(!ehea_bmap->top[top]) { 581 + if (!ehea_bmap->top[top]) { 582 582 ehea_bmap->top[top] = 583 583 kzalloc(sizeof(struct ehea_top_bmap), GFP_KERNEL); 584 584 if (!ehea_bmap->top[top]) ··· 587 587 return ehea_init_top_bmap(ehea_bmap->top[top], dir); 588 588 } 589 589 590 - static int ehea_create_busmap_callback(unsigned long pfn, 591 - unsigned long nr_pages, void *arg) 590 + static DEFINE_MUTEX(ehea_busmap_mutex); 591 + static unsigned long ehea_mr_len; 592 + 593 + #define EHEA_BUSMAP_ADD_SECT 1 594 + #define EHEA_BUSMAP_REM_SECT 0 595 + 596 + static void ehea_rebuild_busmap(void) 592 597 { 593 - unsigned long i, mr_len, start_section, end_section; 594 - start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; 595 - end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE); 596 - mr_len = *(unsigned long *)arg; 598 + u64 vaddr = EHEA_BUSMAP_START; 599 + int top, dir, idx; 597 600 598 - if (!ehea_bmap) 601 + for (top = 0; top < EHEA_MAP_ENTRIES; top++) { 602 + struct ehea_top_bmap *ehea_top; 603 + int valid_dir_entries = 0; 604 + 605 + if (!ehea_bmap->top[top]) 606 + continue; 607 + ehea_top = ehea_bmap->top[top]; 608 + for (dir = 0; dir < EHEA_MAP_ENTRIES; dir++) { 609 + struct ehea_dir_bmap *ehea_dir; 610 + int valid_entries = 0; 611 + 612 + if (!ehea_top->dir[dir]) 613 + continue; 614 + valid_dir_entries++; 615 + ehea_dir = ehea_top->dir[dir]; 616 + for (idx = 0; idx < EHEA_MAP_ENTRIES; idx++) { 617 + if (!ehea_dir->ent[idx]) 618 + continue; 619 + valid_entries++; 620 + ehea_dir->ent[idx] = vaddr; 621 + vaddr += EHEA_SECTSIZE; 622 + } 623 + if (!valid_entries) { 624 + ehea_top->dir[dir] = NULL; 625 + kfree(ehea_dir); 626 + } 627 + } 628 + if (!valid_dir_entries) { 629 + ehea_bmap->top[top] = NULL; 630 + kfree(ehea_top); 631 + } 632 + } 633 + } 634 + 635 + static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add) 636 + { 637 + unsigned long i, start_section, end_section; 638 + 639 + if (!ehea_bmap) { 599 640 ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); 600 - if (!ehea_bmap) 601 - return -ENOMEM; 602 - 603 - for (i = start_section; i < end_section; i++) { 604 - int ret; 605 - int top, dir, idx; 606 - u64 vaddr; 607 - 608 - top = ehea_calc_index(i, EHEA_TOP_INDEX_SHIFT); 609 - dir = ehea_calc_index(i, EHEA_DIR_INDEX_SHIFT); 610 - 611 - ret = ehea_init_bmap(ehea_bmap, top, dir); 612 - if(ret) 613 - return ret; 614 - 615 - idx = i & EHEA_INDEX_MASK; 616 - vaddr = EHEA_BUSMAP_START + mr_len + i * EHEA_SECTSIZE; 617 - 618 - ehea_bmap->top[top]->dir[dir]->ent[idx] = vaddr; 641 + if (!ehea_bmap) 642 + return -ENOMEM; 619 643 } 620 644 621 - mr_len += nr_pages * PAGE_SIZE; 622 - *(unsigned long *)arg = mr_len; 645 + start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; 646 + end_section = start_section + ((pgnum * PAGE_SIZE) / EHEA_SECTSIZE); 647 + /* Mark entries as valid or invalid only; address is assigned later */ 648 + for (i = start_section; i < end_section; i++) { 649 + u64 flag; 650 + int top = ehea_calc_index(i, EHEA_TOP_INDEX_SHIFT); 651 + int dir = ehea_calc_index(i, EHEA_DIR_INDEX_SHIFT); 652 + int idx = i & EHEA_INDEX_MASK; 653 + 654 + if (add) { 655 + int ret = ehea_init_bmap(ehea_bmap, top, dir); 656 + if (ret) 657 + return ret; 658 + flag = 1; /* valid */ 659 + ehea_mr_len += EHEA_SECTSIZE; 660 + } else { 661 + if (!ehea_bmap->top[top]) 662 + continue; 663 + if (!ehea_bmap->top[top]->dir[dir]) 664 + continue; 665 + flag = 0; /* invalid */ 666 + ehea_mr_len -= EHEA_SECTSIZE; 667 + } 623 668 669 + ehea_bmap->top[top]->dir[dir]->ent[idx] = flag; 670 + } 671 + ehea_rebuild_busmap(); /* Assign contiguous addresses for mr */ 624 672 return 0; 625 673 } 626 674 627 - static unsigned long ehea_mr_len; 675 + int ehea_add_sect_bmap(unsigned long pfn, unsigned long nr_pages) 676 + { 677 + int ret; 628 678 629 - static DEFINE_MUTEX(ehea_busmap_mutex); 679 + mutex_lock(&ehea_busmap_mutex); 680 + ret = ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); 681 + mutex_unlock(&ehea_busmap_mutex); 682 + return ret; 683 + } 684 + 685 + int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages) 686 + { 687 + int ret; 688 + 689 + mutex_lock(&ehea_busmap_mutex); 690 + ret = ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_REM_SECT); 691 + mutex_unlock(&ehea_busmap_mutex); 692 + return ret; 693 + } 694 + 695 + static int ehea_create_busmap_callback(unsigned long pfn, 696 + unsigned long nr_pages, void *arg) 697 + { 698 + return ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); 699 + } 630 700 631 701 int ehea_create_busmap(void) 632 702 { 633 703 int ret; 704 + 634 705 mutex_lock(&ehea_busmap_mutex); 635 706 ehea_mr_len = 0; 636 - ret = walk_memory_resource(0, 1ULL << MAX_PHYSMEM_BITS, &ehea_mr_len, 707 + ret = walk_memory_resource(0, 1ULL << MAX_PHYSMEM_BITS, NULL, 637 708 ehea_create_busmap_callback); 638 709 mutex_unlock(&ehea_busmap_mutex); 639 710 return ret;
+2
drivers/net/ehea/ehea_qmr.h
··· 378 378 379 379 void ehea_error_data(struct ehea_adapter *adapter, u64 res_handle); 380 380 381 + int ehea_add_sect_bmap(unsigned long pfn, unsigned long nr_pages); 382 + int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages); 381 383 int ehea_create_busmap(void); 382 384 void ehea_destroy_busmap(void); 383 385 u64 ehea_map_vaddr(void *caddr);
+18
drivers/net/fec_mpc52xx.c
··· 401 401 return 0; 402 402 } 403 403 404 + #ifdef CONFIG_NET_POLL_CONTROLLER 405 + static void mpc52xx_fec_poll_controller(struct net_device *dev) 406 + { 407 + struct mpc52xx_fec_priv *priv = netdev_priv(dev); 408 + 409 + disable_irq(priv->t_irq); 410 + mpc52xx_fec_tx_interrupt(priv->t_irq, dev); 411 + enable_irq(priv->t_irq); 412 + disable_irq(priv->r_irq); 413 + mpc52xx_fec_rx_interrupt(priv->r_irq, dev); 414 + enable_irq(priv->r_irq); 415 + } 416 + #endif 417 + 418 + 404 419 /* This handles BestComm transmit task interrupts 405 420 */ 406 421 static irqreturn_t mpc52xx_fec_tx_interrupt(int irq, void *dev_id) ··· 941 926 ndev->tx_timeout = mpc52xx_fec_tx_timeout; 942 927 ndev->watchdog_timeo = FEC_WATCHDOG_TIMEOUT; 943 928 ndev->base_addr = mem.start; 929 + #ifdef CONFIG_NET_POLL_CONTROLLER 930 + ndev->poll_controller = mpc52xx_fec_poll_controller; 931 + #endif 944 932 945 933 priv->t_irq = priv->r_irq = ndev->irq = NO_IRQ; /* IRQ are free for now */ 946 934
+17 -7
drivers/net/gianfar.c
··· 161 161 struct gfar_private *priv = NULL; 162 162 struct gianfar_platform_data *einfo; 163 163 struct resource *r; 164 - int err = 0; 164 + int err = 0, irq; 165 165 DECLARE_MAC_BUF(mac); 166 166 167 167 einfo = (struct gianfar_platform_data *) pdev->dev.platform_data; ··· 187 187 188 188 /* fill out IRQ fields */ 189 189 if (einfo->device_flags & FSL_GIANFAR_DEV_HAS_MULTI_INTR) { 190 - priv->interruptTransmit = platform_get_irq_byname(pdev, "tx"); 191 - priv->interruptReceive = platform_get_irq_byname(pdev, "rx"); 192 - priv->interruptError = platform_get_irq_byname(pdev, "error"); 193 - if (priv->interruptTransmit < 0 || priv->interruptReceive < 0 || priv->interruptError < 0) 190 + irq = platform_get_irq_byname(pdev, "tx"); 191 + if (irq < 0) 194 192 goto regs_fail; 193 + priv->interruptTransmit = irq; 194 + 195 + irq = platform_get_irq_byname(pdev, "rx"); 196 + if (irq < 0) 197 + goto regs_fail; 198 + priv->interruptReceive = irq; 199 + 200 + irq = platform_get_irq_byname(pdev, "error"); 201 + if (irq < 0) 202 + goto regs_fail; 203 + priv->interruptError = irq; 195 204 } else { 196 - priv->interruptTransmit = platform_get_irq(pdev, 0); 197 - if (priv->interruptTransmit < 0) 205 + irq = platform_get_irq(pdev, 0); 206 + if (irq < 0) 198 207 goto regs_fail; 208 + priv->interruptTransmit = irq; 199 209 } 200 210 201 211 /* get a pointer to the register memory */
+42 -18
drivers/net/igb/igb_main.c
··· 38 38 #include <linux/ethtool.h> 39 39 #include <linux/if_vlan.h> 40 40 #include <linux/pci.h> 41 + #include <linux/pci-aspm.h> 41 42 #include <linux/delay.h> 42 43 #include <linux/interrupt.h> 43 44 #include <linux/if_ether.h> 44 - #ifdef CONFIG_DCA 45 + #ifdef CONFIG_IGB_DCA 45 46 #include <linux/dca.h> 46 47 #endif 47 48 #include "igb.h" ··· 107 106 static irqreturn_t igb_msix_rx(int irq, void *); 108 107 static irqreturn_t igb_msix_tx(int irq, void *); 109 108 static int igb_clean_rx_ring_msix(struct napi_struct *, int); 110 - #ifdef CONFIG_DCA 109 + #ifdef CONFIG_IGB_DCA 111 110 static void igb_update_rx_dca(struct igb_ring *); 112 111 static void igb_update_tx_dca(struct igb_ring *); 113 112 static void igb_setup_dca(struct igb_adapter *); 114 - #endif /* CONFIG_DCA */ 113 + #endif /* CONFIG_IGB_DCA */ 115 114 static bool igb_clean_tx_irq(struct igb_ring *); 116 115 static int igb_poll(struct napi_struct *, int); 117 116 static bool igb_clean_rx_irq_adv(struct igb_ring *, int *, int); ··· 132 131 static int igb_resume(struct pci_dev *); 133 132 #endif 134 133 static void igb_shutdown(struct pci_dev *); 135 - #ifdef CONFIG_DCA 134 + #ifdef CONFIG_IGB_DCA 136 135 static int igb_notify_dca(struct notifier_block *, unsigned long, void *); 137 136 static struct notifier_block dca_notifier = { 138 137 .notifier_call = igb_notify_dca, ··· 208 207 global_quad_port_a = 0; 209 208 210 209 ret = pci_register_driver(&igb_driver); 211 - #ifdef CONFIG_DCA 210 + #ifdef CONFIG_IGB_DCA 212 211 dca_register_notify(&dca_notifier); 213 212 #endif 214 213 return ret; ··· 224 223 **/ 225 224 static void __exit igb_exit_module(void) 226 225 { 227 - #ifdef CONFIG_DCA 226 + #ifdef CONFIG_IGB_DCA 228 227 dca_unregister_notify(&dca_notifier); 229 228 #endif 230 229 pci_unregister_driver(&igb_driver); ··· 967 966 struct net_device *netdev; 968 967 struct igb_adapter *adapter; 969 968 struct e1000_hw *hw; 969 + struct pci_dev *us_dev; 970 970 const struct e1000_info *ei = igb_info_tbl[ent->driver_data]; 971 971 unsigned long mmio_start, mmio_len; 972 - int i, err, pci_using_dac; 973 - u16 eeprom_data = 0; 972 + int i, err, pci_using_dac, pos; 973 + u16 eeprom_data = 0, state = 0; 974 974 u16 eeprom_apme_mask = IGB_EEPROM_APME; 975 975 u32 part_num; 976 976 int bars, need_ioport; ··· 1004 1002 goto err_dma; 1005 1003 } 1006 1004 } 1005 + } 1006 + 1007 + /* 82575 requires that the pci-e link partner disable the L0s state */ 1008 + switch (pdev->device) { 1009 + case E1000_DEV_ID_82575EB_COPPER: 1010 + case E1000_DEV_ID_82575EB_FIBER_SERDES: 1011 + case E1000_DEV_ID_82575GB_QUAD_COPPER: 1012 + us_dev = pdev->bus->self; 1013 + pos = pci_find_capability(us_dev, PCI_CAP_ID_EXP); 1014 + if (pos) { 1015 + pci_read_config_word(us_dev, pos + PCI_EXP_LNKCTL, 1016 + &state); 1017 + state &= ~PCIE_LINK_STATE_L0S; 1018 + pci_write_config_word(us_dev, pos + PCI_EXP_LNKCTL, 1019 + state); 1020 + printk(KERN_INFO "Disabling ASPM L0s upstream switch " 1021 + "port %x:%x.%x\n", us_dev->bus->number, 1022 + PCI_SLOT(us_dev->devfn), 1023 + PCI_FUNC(us_dev->devfn)); 1024 + } 1025 + default: 1026 + break; 1007 1027 } 1008 1028 1009 1029 err = pci_request_selected_regions(pdev, bars, igb_driver_name); ··· 1261 1237 if (err) 1262 1238 goto err_register; 1263 1239 1264 - #ifdef CONFIG_DCA 1240 + #ifdef CONFIG_IGB_DCA 1265 1241 if ((adapter->flags & IGB_FLAG_HAS_DCA) && 1266 1242 (dca_add_requester(&pdev->dev) == 0)) { 1267 1243 adapter->flags |= IGB_FLAG_DCA_ENABLED; ··· 1335 1311 { 1336 1312 struct net_device *netdev = pci_get_drvdata(pdev); 1337 1313 struct igb_adapter *adapter = netdev_priv(netdev); 1338 - #ifdef CONFIG_DCA 1314 + #ifdef CONFIG_IGB_DCA 1339 1315 struct e1000_hw *hw = &adapter->hw; 1340 1316 #endif 1341 1317 ··· 1347 1323 1348 1324 flush_scheduled_work(); 1349 1325 1350 - #ifdef CONFIG_DCA 1326 + #ifdef CONFIG_IGB_DCA 1351 1327 if (adapter->flags & IGB_FLAG_DCA_ENABLED) { 1352 1328 dev_info(&pdev->dev, "DCA disabled\n"); 1353 1329 dca_remove_requester(&pdev->dev); ··· 3295 3271 struct igb_adapter *adapter = tx_ring->adapter; 3296 3272 struct e1000_hw *hw = &adapter->hw; 3297 3273 3298 - #ifdef CONFIG_DCA 3274 + #ifdef CONFIG_IGB_DCA 3299 3275 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3300 3276 igb_update_tx_dca(tx_ring); 3301 3277 #endif ··· 3347 3323 if (netif_rx_schedule_prep(adapter->netdev, &rx_ring->napi)) 3348 3324 __netif_rx_schedule(adapter->netdev, &rx_ring->napi); 3349 3325 3350 - #ifdef CONFIG_DCA 3326 + #ifdef CONFIG_IGB_DCA 3351 3327 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3352 3328 igb_update_rx_dca(rx_ring); 3353 3329 #endif 3354 3330 return IRQ_HANDLED; 3355 3331 } 3356 3332 3357 - #ifdef CONFIG_DCA 3333 + #ifdef CONFIG_IGB_DCA 3358 3334 static void igb_update_rx_dca(struct igb_ring *rx_ring) 3359 3335 { 3360 3336 u32 dca_rxctrl; ··· 3474 3450 3475 3451 return ret_val ? NOTIFY_BAD : NOTIFY_DONE; 3476 3452 } 3477 - #endif /* CONFIG_DCA */ 3453 + #endif /* CONFIG_IGB_DCA */ 3478 3454 3479 3455 /** 3480 3456 * igb_intr_msi - Interrupt Handler ··· 3553 3529 int tx_clean_complete, work_done = 0; 3554 3530 3555 3531 /* this poll routine only supports one tx and one rx queue */ 3556 - #ifdef CONFIG_DCA 3532 + #ifdef CONFIG_IGB_DCA 3557 3533 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3558 3534 igb_update_tx_dca(&adapter->tx_ring[0]); 3559 3535 #endif 3560 3536 tx_clean_complete = igb_clean_tx_irq(&adapter->tx_ring[0]); 3561 3537 3562 - #ifdef CONFIG_DCA 3538 + #ifdef CONFIG_IGB_DCA 3563 3539 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3564 3540 igb_update_rx_dca(&adapter->rx_ring[0]); 3565 3541 #endif ··· 3587 3563 struct net_device *netdev = adapter->netdev; 3588 3564 int work_done = 0; 3589 3565 3590 - #ifdef CONFIG_DCA 3566 + #ifdef CONFIG_IGB_DCA 3591 3567 if (adapter->flags & IGB_FLAG_DCA_ENABLED) 3592 3568 igb_update_rx_dca(rx_ring); 3593 3569 #endif
+5 -1
drivers/net/myri10ge/myri10ge.c
··· 75 75 #include "myri10ge_mcp.h" 76 76 #include "myri10ge_mcp_gen_header.h" 77 77 78 - #define MYRI10GE_VERSION_STR "1.4.3-1.369" 78 + #define MYRI10GE_VERSION_STR "1.4.3-1.371" 79 79 80 80 MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); 81 81 MODULE_AUTHOR("Maintainer: help@myri.com"); ··· 2497 2497 return 0; 2498 2498 2499 2499 abort_with_rings: 2500 + while (slice) { 2501 + slice--; 2502 + napi_disable(&mgp->ss[slice].napi); 2503 + } 2500 2504 for (i = 0; i < mgp->num_slices; i++) 2501 2505 myri10ge_free_rings(&mgp->ss[i]); 2502 2506
+1 -4
drivers/net/qlge/qlge.h
··· 1375 1375 spinlock_t adapter_lock; 1376 1376 spinlock_t hw_lock; 1377 1377 spinlock_t stats_lock; 1378 - spinlock_t legacy_lock; /* used for maintaining legacy intr sync */ 1379 1378 1380 1379 /* PCI Bus Relative Register Addresses */ 1381 1380 void __iomem *reg_base; ··· 1397 1398 u32 intr_count; 1398 1399 struct msix_entry *msi_x_entry; 1399 1400 struct intr_context intr_context[MAX_RX_RINGS]; 1400 - 1401 - int (*legacy_check) (struct ql_adapter *); 1402 1401 1403 1402 int tx_ring_count; /* One per online CPU. */ 1404 1403 u32 rss_ring_first_cq_id;/* index of first inbound (rss) rx_ring */ ··· 1499 1502 void ql_mpi_reset_work(struct work_struct *work); 1500 1503 int ql_wait_reg_rdy(struct ql_adapter *qdev, u32 reg, u32 bit, u32 ebit); 1501 1504 void ql_queue_asic_error(struct ql_adapter *qdev); 1502 - void ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr); 1505 + u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr); 1503 1506 void ql_set_ethtool_ops(struct net_device *ndev); 1504 1507 int ql_read_xgmac_reg64(struct ql_adapter *qdev, u32 reg, u64 *data); 1505 1508
+46 -43
drivers/net/qlge/qlge_main.c
··· 577 577 * incremented everytime we queue a worker and decremented everytime 578 578 * a worker finishes. Once it hits zero we enable the interrupt. 579 579 */ 580 - void ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr) 580 + u32 ql_enable_completion_interrupt(struct ql_adapter *qdev, u32 intr) 581 581 { 582 - if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags))) 582 + u32 var = 0; 583 + unsigned long hw_flags = 0; 584 + struct intr_context *ctx = qdev->intr_context + intr; 585 + 586 + if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags) && intr)) { 587 + /* Always enable if we're MSIX multi interrupts and 588 + * it's not the default (zeroeth) interrupt. 589 + */ 583 590 ql_write32(qdev, INTR_EN, 584 - qdev->intr_context[intr].intr_en_mask); 585 - else { 586 - if (qdev->legacy_check) 587 - spin_lock(&qdev->legacy_lock); 588 - if (atomic_dec_and_test(&qdev->intr_context[intr].irq_cnt)) { 589 - QPRINTK(qdev, INTR, ERR, "Enabling interrupt %d.\n", 590 - intr); 591 - ql_write32(qdev, INTR_EN, 592 - qdev->intr_context[intr].intr_en_mask); 593 - } else { 594 - QPRINTK(qdev, INTR, ERR, 595 - "Skip enable, other queue(s) are active.\n"); 596 - } 597 - if (qdev->legacy_check) 598 - spin_unlock(&qdev->legacy_lock); 591 + ctx->intr_en_mask); 592 + var = ql_read32(qdev, STS); 593 + return var; 599 594 } 595 + 596 + spin_lock_irqsave(&qdev->hw_lock, hw_flags); 597 + if (atomic_dec_and_test(&ctx->irq_cnt)) { 598 + ql_write32(qdev, INTR_EN, 599 + ctx->intr_en_mask); 600 + var = ql_read32(qdev, STS); 601 + } 602 + spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); 603 + return var; 600 604 } 601 605 602 606 static u32 ql_disable_completion_interrupt(struct ql_adapter *qdev, u32 intr) 603 607 { 604 608 u32 var = 0; 609 + unsigned long hw_flags; 610 + struct intr_context *ctx; 605 611 606 - if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags))) 607 - goto exit; 608 - else if (!atomic_read(&qdev->intr_context[intr].irq_cnt)) { 612 + /* HW disables for us if we're MSIX multi interrupts and 613 + * it's not the default (zeroeth) interrupt. 614 + */ 615 + if (likely(test_bit(QL_MSIX_ENABLED, &qdev->flags) && intr)) 616 + return 0; 617 + 618 + ctx = qdev->intr_context + intr; 619 + spin_lock_irqsave(&qdev->hw_lock, hw_flags); 620 + if (!atomic_read(&ctx->irq_cnt)) { 609 621 ql_write32(qdev, INTR_EN, 610 - qdev->intr_context[intr].intr_dis_mask); 622 + ctx->intr_dis_mask); 611 623 var = ql_read32(qdev, STS); 612 624 } 613 - atomic_inc(&qdev->intr_context[intr].irq_cnt); 614 - exit: 625 + atomic_inc(&ctx->irq_cnt); 626 + spin_unlock_irqrestore(&qdev->hw_lock, hw_flags); 615 627 return var; 616 628 } 617 629 ··· 635 623 * and enables only if the result is zero. 636 624 * So we precharge it here. 637 625 */ 638 - atomic_set(&qdev->intr_context[i].irq_cnt, 1); 626 + if (unlikely(!test_bit(QL_MSIX_ENABLED, &qdev->flags) || 627 + i == 0)) 628 + atomic_set(&qdev->intr_context[i].irq_cnt, 1); 639 629 ql_enable_completion_interrupt(qdev, i); 640 630 } 641 631 ··· 1739 1725 return IRQ_HANDLED; 1740 1726 } 1741 1727 1742 - /* We check here to see if we're already handling a legacy 1743 - * interrupt. If we are, then it must belong to another 1744 - * chip with which we're sharing the interrupt line. 1745 - */ 1746 - int ql_legacy_check(struct ql_adapter *qdev) 1747 - { 1748 - int err; 1749 - spin_lock(&qdev->legacy_lock); 1750 - err = atomic_read(&qdev->intr_context[0].irq_cnt); 1751 - spin_unlock(&qdev->legacy_lock); 1752 - return err; 1753 - } 1754 - 1755 1728 /* This handles a fatal error, MPI activity, and the default 1756 1729 * rx_ring in an MSI-X multiple vector environment. 1757 1730 * In MSI/Legacy environment it also process the rest of ··· 1753 1752 int i; 1754 1753 int work_done = 0; 1755 1754 1756 - if (qdev->legacy_check && qdev->legacy_check(qdev)) { 1757 - QPRINTK(qdev, INTR, INFO, "Already busy, not our interrupt.\n"); 1758 - return IRQ_NONE; /* Not our interrupt */ 1755 + spin_lock(&qdev->hw_lock); 1756 + if (atomic_read(&qdev->intr_context[0].irq_cnt)) { 1757 + QPRINTK(qdev, INTR, DEBUG, "Shared Interrupt, Not ours!\n"); 1758 + spin_unlock(&qdev->hw_lock); 1759 + return IRQ_NONE; 1759 1760 } 1761 + spin_unlock(&qdev->hw_lock); 1760 1762 1761 - var = ql_read32(qdev, STS); 1763 + var = ql_disable_completion_interrupt(qdev, intr_context->intr); 1762 1764 1763 1765 /* 1764 1766 * Check for fatal error. ··· 1827 1823 } 1828 1824 } 1829 1825 } 1826 + ql_enable_completion_interrupt(qdev, intr_context->intr); 1830 1827 return work_done ? IRQ_HANDLED : IRQ_NONE; 1831 1828 } 1832 1829 ··· 2706 2701 } 2707 2702 } 2708 2703 irq_type = LEG_IRQ; 2709 - spin_lock_init(&qdev->legacy_lock); 2710 - qdev->legacy_check = ql_legacy_check; 2711 2704 QPRINTK(qdev, IFUP, DEBUG, "Running with legacy interrupts.\n"); 2712 2705 } 2713 2706
+30 -8
drivers/net/r8169.c
··· 81 81 #define RTL8169_TX_TIMEOUT (6*HZ) 82 82 #define RTL8169_PHY_TIMEOUT (10*HZ) 83 83 84 + #define RTL_EEPROM_SIG cpu_to_le32(0x8129) 85 + #define RTL_EEPROM_SIG_MASK cpu_to_le32(0xffff) 86 + #define RTL_EEPROM_SIG_ADDR 0x0000 87 + 84 88 /* write/read MMIO register */ 85 89 #define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg)) 86 90 #define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg)) ··· 1948 1944 void __iomem *ioaddr) 1949 1945 { 1950 1946 struct pci_dev *pdev = tp->pci_dev; 1951 - u8 cfg1; 1952 1947 int vpd_cap; 1948 + __le32 sig; 1953 1949 u8 mac[8]; 1954 - DECLARE_MAC_BUF(buf); 1950 + u8 cfg1; 1955 1951 1956 1952 cfg1 = RTL_R8(Config1); 1957 1953 if (!(cfg1 & VPD)) { 1958 - dprintk("VPD access not enabled, enabling\n"); 1954 + if (netif_msg_probe(tp)) 1955 + dev_info(&pdev->dev, "VPD access disabled, enabling\n"); 1959 1956 RTL_W8(Cfg9346, Cfg9346_Unlock); 1960 1957 RTL_W8(Config1, cfg1 | VPD); 1961 1958 RTL_W8(Cfg9346, Cfg9346_Lock); ··· 1966 1961 if (!vpd_cap) 1967 1962 return; 1968 1963 1969 - /* MAC address is stored in EEPROM at offset 0x0e 1964 + if (rtl_eeprom_read(pdev, vpd_cap, RTL_EEPROM_SIG_ADDR, &sig) < 0) 1965 + return; 1966 + 1967 + if ((sig & RTL_EEPROM_SIG_MASK) != RTL_EEPROM_SIG) { 1968 + dev_info(&pdev->dev, "Missing EEPROM signature: %08x\n", sig); 1969 + return; 1970 + } 1971 + 1972 + /* 1973 + * MAC address is stored in EEPROM at offset 0x0e 1970 1974 * Realtek says: "The VPD address does not have to be a DWORD-aligned 1971 1975 * address as defined in the PCI 2.2 Specifications, but the VPD data 1972 1976 * is always consecutive 4-byte data starting from the VPD address ··· 1983 1969 */ 1984 1970 if (rtl_eeprom_read(pdev, vpd_cap, 0x000e, (__le32*)&mac[0]) < 0 || 1985 1971 rtl_eeprom_read(pdev, vpd_cap, 0x0012, (__le32*)&mac[4]) < 0) { 1986 - dprintk("Reading MAC address from EEPROM failed\n"); 1972 + if (netif_msg_probe(tp)) { 1973 + dev_warn(&pdev->dev, 1974 + "reading MAC address from EEPROM failed\n"); 1975 + } 1987 1976 return; 1988 1977 } 1989 1978 1990 - dprintk("MAC address found in EEPROM: %s\n", print_mac(buf, mac)); 1979 + if (netif_msg_probe(tp)) { 1980 + DECLARE_MAC_BUF(buf); 1991 1981 1992 - /* Write MAC address */ 1993 - rtl_rar_set(tp, mac); 1982 + dev_info(&pdev->dev, "MAC address found in EEPROM: %s\n", 1983 + print_mac(buf, mac)); 1984 + } 1985 + 1986 + if (is_valid_ether_addr(mac)) 1987 + rtl_rar_set(tp, mac); 1994 1988 } 1995 1989 1996 1990 static int __devinit
+1
drivers/net/sis190.c
··· 317 317 unsigned int type; 318 318 u32 feature; 319 319 } mii_chip_table[] = { 320 + { "Atheros PHY AR8012", { 0x004d, 0xd020 }, LAN, 0 }, 320 321 { "Broadcom PHY BCM5461", { 0x0020, 0x60c0 }, LAN, F_PHY_BCM5461 }, 321 322 { "Broadcom PHY AC131", { 0x0143, 0xbc70 }, LAN, 0 }, 322 323 { "Agere PHY ET1101B", { 0x0282, 0xf010 }, LAN, 0 },
+17 -21
drivers/net/smc911x.c
··· 155 155 /* this enables an interrupt in the interrupt mask register */ 156 156 #define SMC_ENABLE_INT(lp, x) do { \ 157 157 unsigned int __mask; \ 158 - unsigned long __flags; \ 159 - spin_lock_irqsave(&lp->lock, __flags); \ 160 158 __mask = SMC_GET_INT_EN((lp)); \ 161 159 __mask |= (x); \ 162 160 SMC_SET_INT_EN((lp), __mask); \ 163 - spin_unlock_irqrestore(&lp->lock, __flags); \ 164 161 } while (0) 165 162 166 163 /* this disables an interrupt from the interrupt mask register */ 167 164 #define SMC_DISABLE_INT(lp, x) do { \ 168 165 unsigned int __mask; \ 169 - unsigned long __flags; \ 170 - spin_lock_irqsave(&lp->lock, __flags); \ 171 166 __mask = SMC_GET_INT_EN((lp)); \ 172 167 __mask &= ~(x); \ 173 168 SMC_SET_INT_EN((lp), __mask); \ 174 - spin_unlock_irqrestore(&lp->lock, __flags); \ 175 169 } while (0) 176 170 177 171 /* ··· 174 180 static void smc911x_reset(struct net_device *dev) 175 181 { 176 182 struct smc911x_local *lp = netdev_priv(dev); 177 - unsigned int reg, timeout=0, resets=1; 183 + unsigned int reg, timeout=0, resets=1, irq_cfg; 178 184 unsigned long flags; 179 185 180 186 DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); ··· 246 252 * Deassert IRQ for 1*10us for edge type interrupts 247 253 * and drive IRQ pin push-pull 248 254 */ 249 - SMC_SET_IRQ_CFG(lp, (1 << 24) | INT_CFG_IRQ_EN_ | INT_CFG_IRQ_TYPE_); 255 + irq_cfg = (1 << 24) | INT_CFG_IRQ_EN_ | INT_CFG_IRQ_TYPE_; 256 + #ifdef SMC_DYNAMIC_BUS_CONFIG 257 + if (lp->cfg.irq_polarity) 258 + irq_cfg |= INT_CFG_IRQ_POL_; 259 + #endif 260 + SMC_SET_IRQ_CFG(lp, irq_cfg); 250 261 251 262 /* clear anything saved */ 252 263 if (lp->pending_tx_skb != NULL) { ··· 273 274 274 275 DBG(SMC_DEBUG_FUNC, "%s: --> %s\n", dev->name, __func__); 275 276 277 + spin_lock_irqsave(&lp->lock, flags); 278 + 276 279 SMC_SET_MAC_ADDR(lp, dev->dev_addr); 277 280 278 281 /* Enable TX */ ··· 287 286 SMC_SET_FIFO_TSL(lp, 64); 288 287 SMC_SET_GPT_CFG(lp, GPT_CFG_TIMER_EN_ | 10000); 289 288 290 - spin_lock_irqsave(&lp->lock, flags); 291 289 SMC_GET_MAC_CR(lp, cr); 292 290 cr |= MAC_CR_TXEN_ | MAC_CR_HBDIS_; 293 291 SMC_SET_MAC_CR(lp, cr); 294 292 SMC_SET_TX_CFG(lp, TX_CFG_TX_ON_); 295 - spin_unlock_irqrestore(&lp->lock, flags); 296 293 297 294 /* Add 2 byte padding to start of packets */ 298 295 SMC_SET_RX_CFG(lp, (2<<8) & RX_CFG_RXDOFF_); ··· 299 300 if (cr & MAC_CR_RXEN_) 300 301 DBG(SMC_DEBUG_RX, "%s: Receiver already enabled\n", dev->name); 301 302 302 - spin_lock_irqsave(&lp->lock, flags); 303 303 SMC_SET_MAC_CR(lp, cr | MAC_CR_RXEN_); 304 - spin_unlock_irqrestore(&lp->lock, flags); 305 304 306 305 /* Interrupt on every received packet */ 307 306 SMC_SET_FIFO_RSA(lp, 0x01); ··· 315 318 mask|=INT_EN_RDFO_EN_; 316 319 } 317 320 SMC_ENABLE_INT(lp, mask); 321 + 322 + spin_unlock_irqrestore(&lp->lock, flags); 318 323 } 319 324 320 325 /* ··· 457 458 struct sk_buff *skb; 458 459 unsigned int cmdA, cmdB, len; 459 460 unsigned char *buf; 460 - unsigned long flags; 461 461 462 462 DBG(SMC_DEBUG_FUNC | SMC_DEBUG_TX, "%s: --> %s\n", dev->name, __func__); 463 463 BUG_ON(lp->pending_tx_skb == NULL); ··· 501 503 dev->trans_start = jiffies; 502 504 dev_kfree_skb(skb); 503 505 #endif 504 - spin_lock_irqsave(&lp->lock, flags); 505 506 if (!lp->tx_throttle) { 506 507 netif_wake_queue(dev); 507 508 } 508 - spin_unlock_irqrestore(&lp->lock, flags); 509 509 SMC_ENABLE_INT(lp, INT_EN_TDFA_EN_ | INT_EN_TSFL_EN_); 510 510 } 511 511 ··· 522 526 DBG(SMC_DEBUG_FUNC | SMC_DEBUG_TX, "%s: --> %s\n", 523 527 dev->name, __func__); 524 528 529 + spin_lock_irqsave(&lp->lock, flags); 530 + 525 531 BUG_ON(lp->pending_tx_skb != NULL); 526 532 527 533 free = SMC_GET_TX_FIFO_INF(lp) & TX_FIFO_INF_TDFREE_; ··· 533 535 if (free <= SMC911X_TX_FIFO_LOW_THRESHOLD) { 534 536 DBG(SMC_DEBUG_TX, "%s: Disabling data flow due to low FIFO space (%d)\n", 535 537 dev->name, free); 536 - spin_lock_irqsave(&lp->lock, flags); 537 538 /* Reenable when at least 1 packet of size MTU present */ 538 539 SMC_SET_FIFO_TDA(lp, (SMC911X_TX_FIFO_LOW_THRESHOLD)/64); 539 540 lp->tx_throttle = 1; 540 541 netif_stop_queue(dev); 541 - spin_unlock_irqrestore(&lp->lock, flags); 542 542 } 543 543 544 544 /* Drop packets when we run out of space in TX FIFO ··· 552 556 lp->pending_tx_skb = NULL; 553 557 dev->stats.tx_errors++; 554 558 dev->stats.tx_dropped++; 559 + spin_unlock_irqrestore(&lp->lock, flags); 555 560 dev_kfree_skb(skb); 556 561 return 0; 557 562 } ··· 562 565 /* If the DMA is already running then defer this packet Tx until 563 566 * the DMA IRQ starts it 564 567 */ 565 - spin_lock_irqsave(&lp->lock, flags); 566 568 if (lp->txdma_active) { 567 569 DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Tx DMA running, deferring packet\n", dev->name); 568 570 lp->pending_tx_skb = skb; ··· 572 576 DBG(SMC_DEBUG_TX | SMC_DEBUG_DMA, "%s: Activating Tx DMA\n", dev->name); 573 577 lp->txdma_active = 1; 574 578 } 575 - spin_unlock_irqrestore(&lp->lock, flags); 576 579 } 577 580 #endif 578 581 lp->pending_tx_skb = skb; 579 582 smc911x_hardware_send_pkt(dev); 583 + spin_unlock_irqrestore(&lp->lock, flags); 580 584 581 585 return 0; 582 586 } ··· 1238 1242 netif_rx(skb); 1239 1243 1240 1244 spin_lock_irqsave(&lp->lock, flags); 1241 - pkts = (SMC_GET_RX_FIFO_INF() & RX_FIFO_INF_RXSUSED_) >> 16; 1245 + pkts = (SMC_GET_RX_FIFO_INF(lp) & RX_FIFO_INF_RXSUSED_) >> 16; 1242 1246 if (pkts != 0) { 1243 1247 smc911x_rcv(dev); 1244 1248 }else { ··· 2050 2054 */ 2051 2055 static int smc911x_drv_probe(struct platform_device *pdev) 2052 2056 { 2053 - struct smc91x_platdata *pd = pdev->dev.platform_data; 2057 + struct smc911x_platdata *pd = pdev->dev.platform_data; 2054 2058 struct net_device *ndev; 2055 2059 struct resource *res; 2056 2060 struct smc911x_local *lp;
+4 -2
drivers/net/smc911x.h
··· 50 50 #define SMC_DYNAMIC_BUS_CONFIG 51 51 #endif 52 52 53 + #ifdef SMC_USE_PXA_DMA 54 + #define SMC_USE_DMA 55 + #endif 56 + 53 57 /* store this information for the driver.. */ 54 58 struct smc911x_local { 55 59 /* ··· 200 196 201 197 202 198 #ifdef SMC_USE_PXA_DMA 203 - #define SMC_USE_DMA 204 - 205 199 /* 206 200 * Define the request and free functions 207 201 * These are unfortunately architecture specific as no generic allocation
+19 -8
drivers/net/wireless/ath5k/base.c
··· 340 340 } 341 341 342 342 /* Interrupt handling */ 343 - static int ath5k_init(struct ath5k_softc *sc); 343 + static int ath5k_init(struct ath5k_softc *sc, bool is_resume); 344 344 static int ath5k_stop_locked(struct ath5k_softc *sc); 345 - static int ath5k_stop_hw(struct ath5k_softc *sc); 345 + static int ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend); 346 346 static irqreturn_t ath5k_intr(int irq, void *dev_id); 347 347 static void ath5k_tasklet_reset(unsigned long data); 348 348 ··· 646 646 647 647 ath5k_led_off(sc); 648 648 649 - ath5k_stop_hw(sc); 649 + ath5k_stop_hw(sc, true); 650 650 651 651 free_irq(pdev->irq, sc); 652 652 pci_save_state(pdev); ··· 683 683 goto err_no_irq; 684 684 } 685 685 686 - err = ath5k_init(sc); 686 + err = ath5k_init(sc, true); 687 687 if (err) 688 688 goto err_irq; 689 689 ath5k_led_enable(sc); ··· 2200 2200 \********************/ 2201 2201 2202 2202 static int 2203 - ath5k_init(struct ath5k_softc *sc) 2203 + ath5k_init(struct ath5k_softc *sc, bool is_resume) 2204 2204 { 2205 2205 int ret; 2206 2206 2207 2207 mutex_lock(&sc->lock); 2208 + 2209 + if (is_resume && !test_bit(ATH_STAT_STARTED, sc->status)) 2210 + goto out_ok; 2211 + 2212 + __clear_bit(ATH_STAT_STARTED, sc->status); 2208 2213 2209 2214 ATH5K_DBG(sc, ATH5K_DEBUG_RESET, "mode %d\n", sc->opmode); 2210 2215 ··· 2235 2230 if (ret) 2236 2231 goto done; 2237 2232 2233 + __set_bit(ATH_STAT_STARTED, sc->status); 2234 + 2238 2235 /* Set ack to be sent at low bit-rates */ 2239 2236 ath5k_hw_set_ack_bitrate_high(sc->ah, false); 2240 2237 2241 2238 mod_timer(&sc->calib_tim, round_jiffies(jiffies + 2242 2239 msecs_to_jiffies(ath5k_calinterval * 1000))); 2243 2240 2241 + out_ok: 2244 2242 ret = 0; 2245 2243 done: 2246 2244 mmiowb(); ··· 2298 2290 * stop is preempted). 2299 2291 */ 2300 2292 static int 2301 - ath5k_stop_hw(struct ath5k_softc *sc) 2293 + ath5k_stop_hw(struct ath5k_softc *sc, bool is_suspend) 2302 2294 { 2303 2295 int ret; 2304 2296 ··· 2329 2321 } 2330 2322 } 2331 2323 ath5k_txbuf_free(sc, sc->bbuf); 2324 + if (!is_suspend) 2325 + __clear_bit(ATH_STAT_STARTED, sc->status); 2326 + 2332 2327 mmiowb(); 2333 2328 mutex_unlock(&sc->lock); 2334 2329 ··· 2729 2718 2730 2719 static int ath5k_start(struct ieee80211_hw *hw) 2731 2720 { 2732 - return ath5k_init(hw->priv); 2721 + return ath5k_init(hw->priv, false); 2733 2722 } 2734 2723 2735 2724 static void ath5k_stop(struct ieee80211_hw *hw) 2736 2725 { 2737 - ath5k_stop_hw(hw->priv); 2726 + ath5k_stop_hw(hw->priv, false); 2738 2727 } 2739 2728 2740 2729 static int ath5k_add_interface(struct ieee80211_hw *hw,
+2 -1
drivers/net/wireless/ath5k/base.h
··· 128 128 size_t desc_len; /* size of TX/RX descriptors */ 129 129 u16 cachelsz; /* cache line size */ 130 130 131 - DECLARE_BITMAP(status, 4); 131 + DECLARE_BITMAP(status, 5); 132 132 #define ATH_STAT_INVALID 0 /* disable hardware accesses */ 133 133 #define ATH_STAT_MRRETRY 1 /* multi-rate retry support */ 134 134 #define ATH_STAT_PROMISC 2 135 135 #define ATH_STAT_LEDSOFT 3 /* enable LED gpio status */ 136 + #define ATH_STAT_STARTED 4 /* opened & irqs enabled */ 136 137 137 138 unsigned int filter_flags; /* HW flags, AR5K_RX_FILTER_* */ 138 139 unsigned int curmode; /* current phy mode */
+29 -13
drivers/net/wireless/orinoco.c
··· 433 433 const static struct fw_info orinoco_fw[] = { 434 434 { "", "agere_sta_fw.bin", "agere_ap_fw.bin", 0x00390000, 1000 }, 435 435 { "", "prism_sta_fw.bin", "prism_ap_fw.bin", 0, 1024 }, 436 - { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", "", 0x00003100, 0x100 } 436 + { "symbol_sp24t_prim_fw", "symbol_sp24t_sec_fw", "", 0x00003100, 512 } 437 437 }; 438 438 439 439 /* Structure used to access fields in FW ··· 458 458 int ap) 459 459 { 460 460 /* Plug Data Area (PDA) */ 461 - __le16 pda[512] = { 0 }; 461 + __le16 *pda; 462 462 463 463 hermes_t *hw = &priv->hw; 464 464 const struct firmware *fw_entry; ··· 467 467 const unsigned char *end; 468 468 const char *firmware; 469 469 struct net_device *dev = priv->ndev; 470 - int err; 470 + int err = 0; 471 + 472 + pda = kzalloc(fw->pda_size, GFP_KERNEL); 473 + if (!pda) 474 + return -ENOMEM; 471 475 472 476 if (ap) 473 477 firmware = fw->ap_fw; ··· 482 478 dev->name, firmware); 483 479 484 480 /* Read current plug data */ 485 - err = hermes_read_pda(hw, pda, fw->pda_addr, 486 - min_t(u16, fw->pda_size, sizeof(pda)), 0); 481 + err = hermes_read_pda(hw, pda, fw->pda_addr, fw->pda_size, 0); 487 482 printk(KERN_DEBUG "%s: Read PDA returned %d\n", dev->name, err); 488 483 if (err) 489 - return err; 484 + goto free; 490 485 491 486 err = request_firmware(&fw_entry, firmware, priv->dev); 492 487 if (err) { 493 488 printk(KERN_ERR "%s: Cannot find firmware %s\n", 494 489 dev->name, firmware); 495 - return -ENOENT; 490 + err = -ENOENT; 491 + goto free; 496 492 } 497 493 498 494 hdr = (const struct orinoco_fw_header *) fw_entry->data; ··· 536 532 537 533 abort: 538 534 release_firmware(fw_entry); 535 + 536 + free: 537 + kfree(pda); 539 538 return err; 540 539 } 541 540 ··· 556 549 int secondary) 557 550 { 558 551 hermes_t *hw = &priv->hw; 559 - int ret; 552 + int ret = 0; 560 553 const unsigned char *ptr; 561 554 const unsigned char *first_block; 562 555 563 556 /* Plug Data Area (PDA) */ 564 - __le16 pda[256]; 557 + __le16 *pda = NULL; 565 558 566 559 /* Binary block begins after the 0x1A marker */ 567 560 ptr = image; ··· 570 563 571 564 /* Read the PDA from EEPROM */ 572 565 if (secondary) { 573 - ret = hermes_read_pda(hw, pda, fw->pda_addr, sizeof(pda), 1); 566 + pda = kzalloc(fw->pda_size, GFP_KERNEL); 567 + if (!pda) 568 + return -ENOMEM; 569 + 570 + ret = hermes_read_pda(hw, pda, fw->pda_addr, fw->pda_size, 1); 574 571 if (ret) 575 - return ret; 572 + goto free; 576 573 } 577 574 578 575 /* Stop the firmware, so that it can be safely rewritten */ 579 576 if (priv->stop_fw) { 580 577 ret = priv->stop_fw(priv, 1); 581 578 if (ret) 582 - return ret; 579 + goto free; 583 580 } 584 581 585 582 /* Program the adapter with new firmware */ 586 583 ret = hermes_program(hw, first_block, end); 587 584 if (ret) 588 - return ret; 585 + goto free; 589 586 590 587 /* Write the PDA to the adapter */ 591 588 if (secondary) { 592 589 size_t len = hermes_blocks_length(first_block); 593 590 ptr = first_block + len; 594 591 ret = hermes_apply_pda(hw, ptr, pda); 592 + kfree(pda); 595 593 if (ret) 596 594 return ret; 597 595 } ··· 620 608 return -ENODEV; 621 609 622 610 return 0; 611 + 612 + free: 613 + kfree(pda); 614 + return ret; 623 615 } 624 616 625 617
+10 -18
drivers/net/wireless/p54/p54common.c
··· 306 306 return 0; 307 307 } 308 308 309 - static const char *p54_rf_chips[] = { "NULL", "Indigo?", "Duette", 310 - "Frisbee", "Xbow", "Longbow" }; 309 + static const char *p54_rf_chips[] = { "NULL", "Duette3", "Duette2", 310 + "Frisbee", "Xbow", "Longbow", "NULL", "NULL" }; 311 311 static int p54_init_xbow_synth(struct ieee80211_hw *dev); 312 312 313 313 static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) ··· 319 319 void *tmp; 320 320 int err; 321 321 u8 *end = (u8 *)eeprom + len; 322 + u16 synth; 322 323 DECLARE_MAC_BUF(mac); 323 324 324 325 wrap = (struct eeprom_pda_wrap *) eeprom; ··· 401 400 tmp = entry->data; 402 401 while ((u8 *)tmp < entry->data + data_len) { 403 402 struct bootrec_exp_if *exp_if = tmp; 404 - if (le16_to_cpu(exp_if->if_id) == 0xF) 405 - priv->rxhw = le16_to_cpu(exp_if->variant) & 0x07; 403 + if (le16_to_cpu(exp_if->if_id) == 0xf) 404 + synth = le16_to_cpu(exp_if->variant); 406 405 tmp += sizeof(struct bootrec_exp_if); 407 406 } 408 407 break; ··· 428 427 goto err; 429 428 } 430 429 431 - switch (priv->rxhw) { 432 - case 4: /* XBow */ 430 + priv->rxhw = synth & 0x07; 431 + if (priv->rxhw == 4) 433 432 p54_init_xbow_synth(dev); 434 - case 1: /* Indigo? */ 435 - case 2: /* Duette */ 436 - dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; 437 - case 3: /* Frisbee */ 438 - case 5: /* Longbow */ 433 + if (!(synth & 0x40)) 439 434 dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &band_2GHz; 440 - break; 441 - default: 442 - printk(KERN_ERR "%s: unsupported RF-Chip\n", 443 - wiphy_name(dev->wiphy)); 444 - err = -EINVAL; 445 - goto err; 446 - } 435 + if (!(synth & 0x80)) 436 + dev->wiphy->bands[IEEE80211_BAND_5GHZ] = &band_5GHz; 447 437 448 438 if (!is_valid_ether_addr(dev->wiphy->perm_addr)) { 449 439 u8 perm_addr[ETH_ALEN];
+11 -1
include/linux/netdevice.h
··· 541 541 #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) 542 542 #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) 543 543 544 + /* 545 + * If one device supports one of these features, then enable them 546 + * for all in netdev_increment_features. 547 + */ 548 + #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ 549 + NETIF_F_SG | NETIF_F_HIGHDMA | \ 550 + NETIF_F_FRAGLIST) 551 + 544 552 /* Interface index. Unique device identifier */ 545 553 int ifindex; 546 554 int iflink; ··· 1706 1698 1707 1699 extern void linkwatch_run_queue(void); 1708 1700 1709 - extern int netdev_compute_features(unsigned long all, unsigned long one); 1701 + unsigned long netdev_increment_features(unsigned long all, unsigned long one, 1702 + unsigned long mask); 1703 + unsigned long netdev_fix_features(unsigned long features, const char *name); 1710 1704 1711 1705 static inline int net_gso_ok(int features, int gso_type) 1712 1706 {
+1
include/linux/smc911x.h
··· 7 7 struct smc911x_platdata { 8 8 unsigned long flags; 9 9 unsigned long irq_flags; /* IRQF_... */ 10 + int irq_polarity; 10 11 }; 11 12 12 13 #endif /* __SMC911X_H__ */
+1
include/net/sctp/sm.h
··· 125 125 sctp_state_fn_t sctp_sf_backbeat_8_3; 126 126 sctp_state_fn_t sctp_sf_do_9_2_final; 127 127 sctp_state_fn_t sctp_sf_do_9_2_shutdown; 128 + sctp_state_fn_t sctp_sf_do_9_2_shut_ctsn; 128 129 sctp_state_fn_t sctp_sf_do_ecn_cwr; 129 130 sctp_state_fn_t sctp_sf_do_ecne; 130 131 sctp_state_fn_t sctp_sf_ootb;
+1 -1
net/bridge/br_device.c
··· 179 179 180 180 dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | NETIF_F_HIGHDMA | 181 181 NETIF_F_GSO_MASK | NETIF_F_NO_CSUM | NETIF_F_LLTX | 182 - NETIF_F_NETNS_LOCAL; 182 + NETIF_F_NETNS_LOCAL | NETIF_F_GSO; 183 183 }
+10 -4
net/bridge/br_if.c
··· 347 347 void br_features_recompute(struct net_bridge *br) 348 348 { 349 349 struct net_bridge_port *p; 350 - unsigned long features; 350 + unsigned long features, mask; 351 351 352 - features = br->feature_mask; 352 + features = mask = br->feature_mask; 353 + if (list_empty(&br->port_list)) 354 + goto done; 355 + 356 + features &= ~NETIF_F_ONE_FOR_ALL; 353 357 354 358 list_for_each_entry(p, &br->port_list, list) { 355 - features = netdev_compute_features(features, p->dev->features); 359 + features = netdev_increment_features(features, 360 + p->dev->features, mask); 356 361 } 357 362 358 - br->dev->features = features; 363 + done: 364 + br->dev->features = netdev_fix_features(features, NULL); 359 365 } 360 366 361 367 /* called with RTNL */
+70 -63
net/core/dev.c
··· 3947 3947 __netdev_init_queue_locks_one(dev, &dev->rx_queue, NULL); 3948 3948 } 3949 3949 3950 + unsigned long netdev_fix_features(unsigned long features, const char *name) 3951 + { 3952 + /* Fix illegal SG+CSUM combinations. */ 3953 + if ((features & NETIF_F_SG) && 3954 + !(features & NETIF_F_ALL_CSUM)) { 3955 + if (name) 3956 + printk(KERN_NOTICE "%s: Dropping NETIF_F_SG since no " 3957 + "checksum feature.\n", name); 3958 + features &= ~NETIF_F_SG; 3959 + } 3960 + 3961 + /* TSO requires that SG is present as well. */ 3962 + if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) { 3963 + if (name) 3964 + printk(KERN_NOTICE "%s: Dropping NETIF_F_TSO since no " 3965 + "SG feature.\n", name); 3966 + features &= ~NETIF_F_TSO; 3967 + } 3968 + 3969 + if (features & NETIF_F_UFO) { 3970 + if (!(features & NETIF_F_GEN_CSUM)) { 3971 + if (name) 3972 + printk(KERN_ERR "%s: Dropping NETIF_F_UFO " 3973 + "since no NETIF_F_HW_CSUM feature.\n", 3974 + name); 3975 + features &= ~NETIF_F_UFO; 3976 + } 3977 + 3978 + if (!(features & NETIF_F_SG)) { 3979 + if (name) 3980 + printk(KERN_ERR "%s: Dropping NETIF_F_UFO " 3981 + "since no NETIF_F_SG feature.\n", name); 3982 + features &= ~NETIF_F_UFO; 3983 + } 3984 + } 3985 + 3986 + return features; 3987 + } 3988 + EXPORT_SYMBOL(netdev_fix_features); 3989 + 3950 3990 /** 3951 3991 * register_netdevice - register a network device 3952 3992 * @dev: device to register ··· 4072 4032 dev->features &= ~(NETIF_F_IP_CSUM|NETIF_F_IPV6_CSUM|NETIF_F_HW_CSUM); 4073 4033 } 4074 4034 4075 - 4076 - /* Fix illegal SG+CSUM combinations. */ 4077 - if ((dev->features & NETIF_F_SG) && 4078 - !(dev->features & NETIF_F_ALL_CSUM)) { 4079 - printk(KERN_NOTICE "%s: Dropping NETIF_F_SG since no checksum feature.\n", 4080 - dev->name); 4081 - dev->features &= ~NETIF_F_SG; 4082 - } 4083 - 4084 - /* TSO requires that SG is present as well. */ 4085 - if ((dev->features & NETIF_F_TSO) && 4086 - !(dev->features & NETIF_F_SG)) { 4087 - printk(KERN_NOTICE "%s: Dropping NETIF_F_TSO since no SG feature.\n", 4088 - dev->name); 4089 - dev->features &= ~NETIF_F_TSO; 4090 - } 4091 - if (dev->features & NETIF_F_UFO) { 4092 - if (!(dev->features & NETIF_F_HW_CSUM)) { 4093 - printk(KERN_ERR "%s: Dropping NETIF_F_UFO since no " 4094 - "NETIF_F_HW_CSUM feature.\n", 4095 - dev->name); 4096 - dev->features &= ~NETIF_F_UFO; 4097 - } 4098 - if (!(dev->features & NETIF_F_SG)) { 4099 - printk(KERN_ERR "%s: Dropping NETIF_F_UFO since no " 4100 - "NETIF_F_SG feature.\n", 4101 - dev->name); 4102 - dev->features &= ~NETIF_F_UFO; 4103 - } 4104 - } 4035 + dev->features = netdev_fix_features(dev->features, dev->name); 4105 4036 4106 4037 /* Enable software GSO if SG is supported. */ 4107 4038 if (dev->features & NETIF_F_SG) ··· 4711 4700 #endif /* CONFIG_NET_DMA */ 4712 4701 4713 4702 /** 4714 - * netdev_compute_feature - compute conjunction of two feature sets 4715 - * @all: first feature set 4716 - * @one: second feature set 4703 + * netdev_increment_features - increment feature set by one 4704 + * @all: current feature set 4705 + * @one: new feature set 4706 + * @mask: mask feature set 4717 4707 * 4718 4708 * Computes a new feature set after adding a device with feature set 4719 - * @one to the master device with current feature set @all. Returns 4720 - * the new feature set. 4709 + * @one to the master device with current feature set @all. Will not 4710 + * enable anything that is off in @mask. Returns the new feature set. 4721 4711 */ 4722 - int netdev_compute_features(unsigned long all, unsigned long one) 4712 + unsigned long netdev_increment_features(unsigned long all, unsigned long one, 4713 + unsigned long mask) 4723 4714 { 4724 - /* if device needs checksumming, downgrade to hw checksumming */ 4725 - if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM)) 4726 - all ^= NETIF_F_NO_CSUM | NETIF_F_HW_CSUM; 4715 + /* If device needs checksumming, downgrade to it. */ 4716 + if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM)) 4717 + all ^= NETIF_F_NO_CSUM | (one & NETIF_F_ALL_CSUM); 4718 + else if (mask & NETIF_F_ALL_CSUM) { 4719 + /* If one device supports v4/v6 checksumming, set for all. */ 4720 + if (one & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM) && 4721 + !(all & NETIF_F_GEN_CSUM)) { 4722 + all &= ~NETIF_F_ALL_CSUM; 4723 + all |= one & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM); 4724 + } 4727 4725 4728 - /* if device can't do all checksum, downgrade to ipv4/ipv6 */ 4729 - if (all & NETIF_F_HW_CSUM && !(one & NETIF_F_HW_CSUM)) 4730 - all ^= NETIF_F_HW_CSUM 4731 - | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 4726 + /* If one device supports hw checksumming, set for all. */ 4727 + if (one & NETIF_F_GEN_CSUM && !(all & NETIF_F_GEN_CSUM)) { 4728 + all &= ~NETIF_F_ALL_CSUM; 4729 + all |= NETIF_F_HW_CSUM; 4730 + } 4731 + } 4732 4732 4733 - if (one & NETIF_F_GSO) 4734 - one |= NETIF_F_GSO_SOFTWARE; 4735 - one |= NETIF_F_GSO; 4733 + one |= NETIF_F_ALL_CSUM; 4736 4734 4737 - /* 4738 - * If even one device supports a GSO protocol with software fallback, 4739 - * enable it for all. 4740 - */ 4741 - all |= one & NETIF_F_GSO_SOFTWARE; 4742 - 4743 - /* If even one device supports robust GSO, enable it for all. */ 4744 - if (one & NETIF_F_GSO_ROBUST) 4745 - all |= NETIF_F_GSO_ROBUST; 4746 - 4747 - all &= one | NETIF_F_LLTX; 4748 - 4749 - if (!(all & NETIF_F_ALL_CSUM)) 4750 - all &= ~NETIF_F_SG; 4751 - if (!(all & NETIF_F_SG)) 4752 - all &= ~NETIF_F_GSO_MASK; 4735 + one |= all & NETIF_F_ONE_FOR_ALL; 4736 + all &= one | NETIF_F_LLTX | NETIF_F_GSO; 4737 + all |= one & mask & NETIF_F_ONE_FOR_ALL; 4753 4738 4754 4739 return all; 4755 4740 } 4756 - EXPORT_SYMBOL(netdev_compute_features); 4741 + EXPORT_SYMBOL(netdev_increment_features); 4757 4742 4758 4743 static struct hlist_head *netdev_create_hash(void) 4759 4744 {
+18 -7
net/ipv4/tcp_output.c
··· 362 362 __u32 tsval, tsecr; /* need to include OPTION_TS */ 363 363 }; 364 364 365 + /* Beware: Something in the Internet is very sensitive to the ordering of 366 + * TCP options, we learned this through the hard way, so be careful here. 367 + * Luckily we can at least blame others for their non-compliance but from 368 + * inter-operatibility perspective it seems that we're somewhat stuck with 369 + * the ordering which we have been using if we want to keep working with 370 + * those broken things (not that it currently hurts anybody as there isn't 371 + * particular reason why the ordering would need to be changed). 372 + * 373 + * At least SACK_PERM as the first option is known to lead to a disaster 374 + * (but it may well be that other scenarios fail similarly). 375 + */ 365 376 static void tcp_options_write(__be32 *ptr, struct tcp_sock *tp, 366 377 const struct tcp_out_options *opts, 367 378 __u8 **md5_hash) { ··· 385 374 ptr += 4; 386 375 } else { 387 376 *md5_hash = NULL; 377 + } 378 + 379 + if (unlikely(opts->mss)) { 380 + *ptr++ = htonl((TCPOPT_MSS << 24) | 381 + (TCPOLEN_MSS << 16) | 382 + opts->mss); 388 383 } 389 384 390 385 if (likely(OPTION_TS & opts->options)) { ··· 407 390 } 408 391 *ptr++ = htonl(opts->tsval); 409 392 *ptr++ = htonl(opts->tsecr); 410 - } 411 - 412 - if (unlikely(opts->mss)) { 413 - *ptr++ = htonl((TCPOPT_MSS << 24) | 414 - (TCPOLEN_MSS << 16) | 415 - opts->mss); 416 393 } 417 394 418 395 if (unlikely(OPTION_SACK_ADVERTISE & opts->options && ··· 443 432 444 433 if (tp->rx_opt.dsack) { 445 434 tp->rx_opt.dsack = 0; 446 - tp->rx_opt.eff_sacks--; 435 + tp->rx_opt.eff_sacks = tp->rx_opt.num_sacks; 447 436 } 448 437 } 449 438 }
+1 -1
net/sctp/input.c
··· 369 369 void sctp_icmp_frag_needed(struct sock *sk, struct sctp_association *asoc, 370 370 struct sctp_transport *t, __u32 pmtu) 371 371 { 372 - if (!t || (t->pathmtu == pmtu)) 372 + if (!t || (t->pathmtu <= pmtu)) 373 373 return; 374 374 375 375 if (sock_owned_by_user(sk)) {
+54
net/sctp/sm_statefuns.c
··· 2544 2544 sctp_shutdownhdr_t *sdh; 2545 2545 sctp_disposition_t disposition; 2546 2546 struct sctp_ulpevent *ev; 2547 + __u32 ctsn; 2547 2548 2548 2549 if (!sctp_vtag_verify(chunk, asoc)) 2549 2550 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); ··· 2559 2558 sdh = (sctp_shutdownhdr_t *)chunk->skb->data; 2560 2559 skb_pull(chunk->skb, sizeof(sctp_shutdownhdr_t)); 2561 2560 chunk->subh.shutdown_hdr = sdh; 2561 + ctsn = ntohl(sdh->cum_tsn_ack); 2562 + 2563 + /* If Cumulative TSN Ack beyond the max tsn currently 2564 + * send, terminating the association and respond to the 2565 + * sender with an ABORT. 2566 + */ 2567 + if (!TSN_lt(ctsn, asoc->next_tsn)) 2568 + return sctp_sf_violation_ctsn(ep, asoc, type, arg, commands); 2562 2569 2563 2570 /* API 5.3.1.5 SCTP_SHUTDOWN_EVENT 2564 2571 * When a peer sends a SHUTDOWN, SCTP delivers this notification to ··· 2606 2597 2607 2598 out: 2608 2599 return disposition; 2600 + } 2601 + 2602 + /* 2603 + * sctp_sf_do_9_2_shut_ctsn 2604 + * 2605 + * Once an endpoint has reached the SHUTDOWN-RECEIVED state, 2606 + * it MUST NOT send a SHUTDOWN in response to a ULP request. 2607 + * The Cumulative TSN Ack of the received SHUTDOWN chunk 2608 + * MUST be processed. 2609 + */ 2610 + sctp_disposition_t sctp_sf_do_9_2_shut_ctsn(const struct sctp_endpoint *ep, 2611 + const struct sctp_association *asoc, 2612 + const sctp_subtype_t type, 2613 + void *arg, 2614 + sctp_cmd_seq_t *commands) 2615 + { 2616 + struct sctp_chunk *chunk = arg; 2617 + sctp_shutdownhdr_t *sdh; 2618 + 2619 + if (!sctp_vtag_verify(chunk, asoc)) 2620 + return sctp_sf_pdiscard(ep, asoc, type, arg, commands); 2621 + 2622 + /* Make sure that the SHUTDOWN chunk has a valid length. */ 2623 + if (!sctp_chunk_length_valid(chunk, 2624 + sizeof(struct sctp_shutdown_chunk_t))) 2625 + return sctp_sf_violation_chunklen(ep, asoc, type, arg, 2626 + commands); 2627 + 2628 + sdh = (sctp_shutdownhdr_t *)chunk->skb->data; 2629 + 2630 + /* If Cumulative TSN Ack beyond the max tsn currently 2631 + * send, terminating the association and respond to the 2632 + * sender with an ABORT. 2633 + */ 2634 + if (!TSN_lt(ntohl(sdh->cum_tsn_ack), asoc->next_tsn)) 2635 + return sctp_sf_violation_ctsn(ep, asoc, type, arg, commands); 2636 + 2637 + /* verify, by checking the Cumulative TSN Ack field of the 2638 + * chunk, that all its outstanding DATA chunks have been 2639 + * received by the SHUTDOWN sender. 2640 + */ 2641 + sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_CTSN, 2642 + SCTP_BE32(sdh->cum_tsn_ack)); 2643 + 2644 + return SCTP_DISPOSITION_CONSUME; 2609 2645 } 2610 2646 2611 2647 /* RFC 2960 9.2
+2 -2
net/sctp/sm_statetable.c
··· 266 266 /* SCTP_STATE_ESTABLISHED */ \ 267 267 TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown), \ 268 268 /* SCTP_STATE_SHUTDOWN_PENDING */ \ 269 - TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ 269 + TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown), \ 270 270 /* SCTP_STATE_SHUTDOWN_SENT */ \ 271 271 TYPE_SCTP_FUNC(sctp_sf_do_9_2_shutdown_ack), \ 272 272 /* SCTP_STATE_SHUTDOWN_RECEIVED */ \ 273 - TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ 273 + TYPE_SCTP_FUNC(sctp_sf_do_9_2_shut_ctsn), \ 274 274 /* SCTP_STATE_SHUTDOWN_ACK_SENT */ \ 275 275 TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \ 276 276 } /* TYPE_SCTP_SHUTDOWN */