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

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:

drivers/net/wireless/rt2x00/Kconfig
drivers/net/wireless/rt2x00/rt2x00usb.c
net/sctp/protocol.c

+251 -180
+9 -2
drivers/atm/he.c
··· 1542 1542 /* initialize framer */ 1543 1543 1544 1544 #ifdef CONFIG_ATM_HE_USE_SUNI 1545 - suni_init(he_dev->atm_dev); 1545 + if (he_isMM(he_dev)) 1546 + suni_init(he_dev->atm_dev); 1546 1547 if (he_dev->atm_dev->phy && he_dev->atm_dev->phy->start) 1547 1548 he_dev->atm_dev->phy->start(he_dev->atm_dev); 1548 1549 #endif /* CONFIG_ATM_HE_USE_SUNI */ ··· 1555 1554 val = he_phy_get(he_dev->atm_dev, SUNI_TPOP_APM); 1556 1555 val = (val & ~SUNI_TPOP_APM_S) | (SUNI_TPOP_S_SDH << SUNI_TPOP_APM_S_SHIFT); 1557 1556 he_phy_put(he_dev->atm_dev, val, SUNI_TPOP_APM); 1557 + he_phy_put(he_dev->atm_dev, SUNI_TACP_IUCHP_CLP, SUNI_TACP_IUCHP); 1558 1558 } 1559 1559 1560 1560 /* 5.1.12 enable transmit and receive */ ··· 2846 2844 if (copy_from_user(&reg, arg, 2847 2845 sizeof(struct he_ioctl_reg))) 2848 2846 return -EFAULT; 2849 - 2847 + 2850 2848 spin_lock_irqsave(&he_dev->global_lock, flags); 2851 2849 switch (reg.type) { 2852 2850 case HE_REGTYPE_PCI: 2851 + if (reg.addr < 0 || reg.addr >= HE_REGMAP_SIZE) { 2852 + err = -EINVAL; 2853 + break; 2854 + } 2855 + 2853 2856 reg.val = he_readl(he_dev, reg.addr); 2854 2857 break; 2855 2858 case HE_REGTYPE_RCM:
+4 -9
drivers/atm/he.h
··· 267 267 268 268 char prod_id[30]; 269 269 char mac_addr[6]; 270 - int media; /* 271 - * 0x26 = HE155 MM 272 - * 0x27 = HE622 MM 273 - * 0x46 = HE155 SM 274 - * 0x47 = HE622 SM 275 - */ 276 - 270 + int media; 277 271 278 272 unsigned int vcibits, vpibits; 279 273 unsigned int cells_per_row; ··· 386 392 #define HE_DEV(dev) ((struct he_dev *) (dev)->dev_data) 387 393 388 394 #define he_is622(dev) ((dev)->media & 0x1) 395 + #define he_isMM(dev) ((dev)->media & 0x20) 389 396 390 397 #define HE_REGMAP_SIZE 0x100000 391 398 ··· 871 876 #define M_SN 0x3a /* integer */ 872 877 #define MEDIA 0x3e /* integer */ 873 878 #define HE155MM 0x26 874 - #define HE155SM 0x27 875 - #define HE622MM 0x46 879 + #define HE622MM 0x27 880 + #define HE155SM 0x46 876 881 #define HE622SM 0x47 877 882 #define MAC_ADDR 0x42 /* char[] */ 878 883
+13 -14
drivers/atm/iphase.c
··· 2562 2562 error = suni_init(dev); 2563 2563 if (error) 2564 2564 goto err_free_rx; 2565 - /* 2566 - * Enable interrupt on loss of signal 2567 - * SUNI_RSOP_CIE - 0x10 2568 - * SUNI_RSOP_CIE_LOSE - 0x04 2569 - */ 2570 - ia_phy_put(dev, ia_phy_get(dev, 0x10) | 0x04, 0x10); 2571 - #ifndef MODULE 2572 - error = dev->phy->start(dev); 2573 - if (error) 2574 - goto err_free_rx; 2575 - #endif 2565 + if (dev->phy->start) { 2566 + error = dev->phy->start(dev); 2567 + if (error) 2568 + goto err_free_rx; 2569 + } 2576 2570 /* Get iadev->carrier_detect status */ 2577 2571 IaFrontEndIntr(iadev); 2578 2572 } ··· 3192 3198 IF_INIT(printk("dev_id = 0x%x iadev->LineRate = %d \n", (u32)dev, 3193 3199 iadev->LineRate);) 3194 3200 3201 + pci_set_drvdata(pdev, dev); 3202 + 3195 3203 ia_dev[iadev_count] = iadev; 3196 3204 _ia_dev[iadev_count] = dev; 3197 3205 iadev_count++; ··· 3215 3219 iadev->next_board = ia_boards; 3216 3220 ia_boards = dev; 3217 3221 3218 - pci_set_drvdata(pdev, dev); 3219 - 3220 3222 return 0; 3221 3223 3222 3224 err_out_deregister_dev: ··· 3232 3238 struct atm_dev *dev = pci_get_drvdata(pdev); 3233 3239 IADEV *iadev = INPH_IA_DEV(dev); 3234 3240 3235 - ia_phy_put(dev, ia_phy_get(dev,0x10) & ~(0x4), 0x10); 3241 + /* Disable phy interrupts */ 3242 + ia_phy_put(dev, ia_phy_get(dev, SUNI_RSOP_CIE) & ~(SUNI_RSOP_CIE_LOSE), 3243 + SUNI_RSOP_CIE); 3236 3244 udelay(1); 3245 + 3246 + if (dev->phy && dev->phy->stop) 3247 + dev->phy->stop(dev); 3237 3248 3238 3249 /* De-register device */ 3239 3250 free_irq(iadev->irq, dev);
-1
drivers/net/wireless/b43/b43.h
··· 649 649 650 650 /* Context information for a noise calculation (Link Quality). */ 651 651 struct b43_noise_calculation { 652 - u8 channel_at_start; 653 652 bool calculation_running; 654 653 u8 nr_samples; 655 654 s8 samples[8][4];
+46 -47
drivers/net/wireless/b43/dma.c
··· 795 795 { 796 796 struct b43_dmaring *ring; 797 797 int err; 798 - int nr_slots; 799 798 dma_addr_t dma_test; 800 799 801 800 ring = kzalloc(sizeof(*ring), GFP_KERNEL); 802 801 if (!ring) 803 802 goto out; 804 - ring->type = type; 805 803 806 - nr_slots = B43_RXRING_SLOTS; 804 + ring->nr_slots = B43_RXRING_SLOTS; 807 805 if (for_tx) 808 - nr_slots = B43_TXRING_SLOTS; 806 + ring->nr_slots = B43_TXRING_SLOTS; 809 807 810 - ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta), 808 + ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta), 811 809 GFP_KERNEL); 812 810 if (!ring->meta) 813 811 goto err_kfree_ring; 814 - if (for_tx) { 815 - ring->txhdr_cache = kcalloc(nr_slots, 816 - b43_txhdr_size(dev), 817 - GFP_KERNEL); 818 - if (!ring->txhdr_cache) 819 - goto err_kfree_meta; 820 812 821 - /* test for ability to dma to txhdr_cache */ 822 - dma_test = dma_map_single(dev->dev->dma_dev, 823 - ring->txhdr_cache, 824 - b43_txhdr_size(dev), 825 - DMA_TO_DEVICE); 826 - 827 - if (b43_dma_mapping_error(ring, dma_test, 828 - b43_txhdr_size(dev), 1)) { 829 - /* ugh realloc */ 830 - kfree(ring->txhdr_cache); 831 - ring->txhdr_cache = kcalloc(nr_slots, 832 - b43_txhdr_size(dev), 833 - GFP_KERNEL | GFP_DMA); 834 - if (!ring->txhdr_cache) 835 - goto err_kfree_meta; 836 - 837 - dma_test = dma_map_single(dev->dev->dma_dev, 838 - ring->txhdr_cache, 839 - b43_txhdr_size(dev), 840 - DMA_TO_DEVICE); 841 - 842 - if (b43_dma_mapping_error(ring, dma_test, 843 - b43_txhdr_size(dev), 1)) { 844 - 845 - b43err(dev->wl, 846 - "TXHDR DMA allocation failed\n"); 847 - goto err_kfree_txhdr_cache; 848 - } 849 - } 850 - 851 - dma_unmap_single(dev->dev->dma_dev, 852 - dma_test, b43_txhdr_size(dev), 853 - DMA_TO_DEVICE); 854 - } 855 - 813 + ring->type = type; 856 814 ring->dev = dev; 857 - ring->nr_slots = nr_slots; 858 815 ring->mmio_base = b43_dmacontroller_base(type, controller_index); 859 816 ring->index = controller_index; 860 817 if (type == B43_DMA_64BIT) ··· 835 878 #ifdef CONFIG_B43_DEBUG 836 879 ring->last_injected_overflow = jiffies; 837 880 #endif 881 + 882 + if (for_tx) { 883 + ring->txhdr_cache = kcalloc(ring->nr_slots, 884 + b43_txhdr_size(dev), 885 + GFP_KERNEL); 886 + if (!ring->txhdr_cache) 887 + goto err_kfree_meta; 888 + 889 + /* test for ability to dma to txhdr_cache */ 890 + dma_test = dma_map_single(dev->dev->dma_dev, 891 + ring->txhdr_cache, 892 + b43_txhdr_size(dev), 893 + DMA_TO_DEVICE); 894 + 895 + if (b43_dma_mapping_error(ring, dma_test, 896 + b43_txhdr_size(dev), 1)) { 897 + /* ugh realloc */ 898 + kfree(ring->txhdr_cache); 899 + ring->txhdr_cache = kcalloc(ring->nr_slots, 900 + b43_txhdr_size(dev), 901 + GFP_KERNEL | GFP_DMA); 902 + if (!ring->txhdr_cache) 903 + goto err_kfree_meta; 904 + 905 + dma_test = dma_map_single(dev->dev->dma_dev, 906 + ring->txhdr_cache, 907 + b43_txhdr_size(dev), 908 + DMA_TO_DEVICE); 909 + 910 + if (b43_dma_mapping_error(ring, dma_test, 911 + b43_txhdr_size(dev), 1)) { 912 + 913 + b43err(dev->wl, 914 + "TXHDR DMA allocation failed\n"); 915 + goto err_kfree_txhdr_cache; 916 + } 917 + } 918 + 919 + dma_unmap_single(dev->dev->dma_dev, 920 + dma_test, b43_txhdr_size(dev), 921 + DMA_TO_DEVICE); 922 + } 838 923 839 924 err = alloc_ringmemory(ring); 840 925 if (err)
+10 -6
drivers/net/wireless/b43/main.c
··· 1145 1145 b43_jssi_write(dev, 0x7F7F7F7F); 1146 1146 b43_write32(dev, B43_MMIO_MACCMD, 1147 1147 b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE); 1148 - B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel); 1149 1148 } 1150 1149 1151 1150 static void b43_calculate_link_quality(struct b43_wldev *dev) ··· 1153 1154 1154 1155 if (dev->noisecalc.calculation_running) 1155 1156 return; 1156 - dev->noisecalc.channel_at_start = dev->phy.channel; 1157 1157 dev->noisecalc.calculation_running = 1; 1158 1158 dev->noisecalc.nr_samples = 0; 1159 1159 ··· 1169 1171 1170 1172 /* Bottom half of Link Quality calculation. */ 1171 1173 1174 + /* Possible race condition: It might be possible that the user 1175 + * changed to a different channel in the meantime since we 1176 + * started the calculation. We ignore that fact, since it's 1177 + * not really that much of a problem. The background noise is 1178 + * an estimation only anyway. Slightly wrong results will get damped 1179 + * by the averaging of the 8 sample rounds. Additionally the 1180 + * value is shortlived. So it will be replaced by the next noise 1181 + * calculation round soon. */ 1182 + 1172 1183 B43_WARN_ON(!dev->noisecalc.calculation_running); 1173 - if (dev->noisecalc.channel_at_start != phy->channel) 1174 - goto drop_calculation; 1175 1184 *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev)); 1176 1185 if (noise[0] == 0x7F || noise[1] == 0x7F || 1177 1186 noise[2] == 0x7F || noise[3] == 0x7F) ··· 1219 1214 average -= 48; 1220 1215 1221 1216 dev->stats.link_noise = average; 1222 - drop_calculation: 1223 1217 dev->noisecalc.calculation_running = 0; 1224 1218 return; 1225 1219 } 1226 - generate_new: 1220 + generate_new: 1227 1221 b43_generate_noise_sample(dev); 1228 1222 } 1229 1223
+10 -9
drivers/net/wireless/rt2x00/Kconfig
··· 36 36 config RT2X00_LIB_RFKILL 37 37 boolean 38 38 depends on RT2X00_LIB 39 + depends on INPUT 39 40 select RFKILL 40 41 select INPUT_POLLDEV 41 42 42 43 config RT2X00_LIB_LEDS 43 44 boolean 44 - depends on RT2X00_LIB 45 + depends on RT2X00_LIB && NEW_LEDS 45 46 46 47 config RT2400PCI 47 48 tristate "Ralink rt2400 (PCI/PCMCIA) support" ··· 57 56 58 57 config RT2400PCI_RFKILL 59 58 bool "Ralink rt2400 rfkill support" 60 - depends on RT2400PCI 59 + depends on RT2400PCI && INPUT 61 60 select RT2X00_LIB_RFKILL 62 61 ---help--- 63 62 This adds support for integrated rt2400 hardware that features a ··· 66 65 67 66 config RT2400PCI_LEDS 68 67 bool "Ralink rt2400 leds support" 69 - depends on RT2400PCI 68 + depends on RT2400PCI && NEW_LEDS 70 69 select LEDS_CLASS 71 70 select RT2X00_LIB_LEDS 72 71 ---help--- ··· 85 84 86 85 config RT2500PCI_RFKILL 87 86 bool "Ralink rt2500 rfkill support" 88 - depends on RT2500PCI 87 + depends on RT2500PCI && INPUT 89 88 select RT2X00_LIB_RFKILL 90 89 ---help--- 91 90 This adds support for integrated rt2500 hardware that features a ··· 94 93 95 94 config RT2500PCI_LEDS 96 95 bool "Ralink rt2500 leds support" 97 - depends on RT2500PCI 96 + depends on RT2500PCI && NEW_LEDS 98 97 select LEDS_CLASS 99 98 select RT2X00_LIB_LEDS 100 99 ---help--- ··· 115 114 116 115 config RT61PCI_RFKILL 117 116 bool "Ralink rt2501/rt61 rfkill support" 118 - depends on RT61PCI 117 + depends on RT61PCI && INPUT 119 118 select RT2X00_LIB_RFKILL 120 119 ---help--- 121 120 This adds support for integrated rt61 hardware that features a ··· 124 123 125 124 config RT61PCI_LEDS 126 125 bool "Ralink rt2501/rt61 leds support" 127 - depends on RT61PCI 126 + depends on RT61PCI && NEW_LEDS 128 127 select LEDS_CLASS 129 128 select RT2X00_LIB_LEDS 130 129 ---help--- ··· 142 141 143 142 config RT2500USB_LEDS 144 143 bool "Ralink rt2500 leds support" 145 - depends on RT2500USB 144 + depends on RT2500USB && NEW_LEDS 146 145 select LEDS_CLASS 147 146 select RT2X00_LIB_LEDS 148 147 ---help--- ··· 162 161 163 162 config RT73USB_LEDS 164 163 bool "Ralink rt2501/rt73 leds support" 165 - depends on RT73USB 164 + depends on RT73USB && NEW_LEDS 166 165 select LEDS_CLASS 167 166 select RT2X00_LIB_LEDS 168 167 ---help---
+1 -2
drivers/net/wireless/rt2x00/rt2x00pci.c
··· 357 357 if (pci_set_mwi(pci_dev)) 358 358 ERROR_PROBE("MWI not available.\n"); 359 359 360 - if (pci_set_dma_mask(pci_dev, DMA_64BIT_MASK) && 361 - pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { 360 + if (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) { 362 361 ERROR_PROBE("PCI DMA not supported.\n"); 363 362 retval = -EIO; 364 363 goto exit_disable_device;
+4 -1
drivers/net/wireless/rt2x00/rt2x00usb.c
··· 345 345 } 346 346 347 347 /* 348 - * Kill guardian urb. 348 + * Kill guardian urb (if required by driver). 349 349 */ 350 + if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags)) 351 + return; 352 + 350 353 for (i = 0; i < rt2x00dev->bcn->limit; i++) { 351 354 bcn_priv = rt2x00dev->bcn->entries[i].priv_data; 352 355 if (bcn_priv->guardian_urb)
+1
drivers/net/wireless/rt2x00/rt73usb.c
··· 2114 2114 /* D-Link */ 2115 2115 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, 2116 2116 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, 2117 + { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) }, 2117 2118 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, 2118 2119 /* Gemtek */ 2119 2120 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },
+9 -3
drivers/ssb/main.c
··· 1168 1168 int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask) 1169 1169 { 1170 1170 struct device *dma_dev = ssb_dev->dma_dev; 1171 + int err = 0; 1171 1172 1172 1173 #ifdef CONFIG_SSB_PCIHOST 1173 - if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) 1174 - return dma_set_mask(dma_dev, mask); 1174 + if (ssb_dev->bus->bustype == SSB_BUSTYPE_PCI) { 1175 + err = pci_set_dma_mask(ssb_dev->bus->host_pci, mask); 1176 + if (err) 1177 + return err; 1178 + err = pci_set_consistent_dma_mask(ssb_dev->bus->host_pci, mask); 1179 + return err; 1180 + } 1175 1181 #endif 1176 1182 dma_dev->coherent_dma_mask = mask; 1177 1183 dma_dev->dma_mask = &dma_dev->coherent_dma_mask; 1178 1184 1179 - return 0; 1185 + return err; 1180 1186 } 1181 1187 EXPORT_SYMBOL(ssb_dma_set_mask); 1182 1188
+1 -1
include/linux/if_tunnel.h
··· 41 41 __u16 __reserved; 42 42 __u32 datalen; 43 43 __u32 __reserved2; 44 - void __user *data; 44 + /* data follows */ 45 45 }; 46 46 47 47 /* PRL flags */
+45 -33
net/atm/br2684.c
··· 188 188 return 0; 189 189 } 190 190 } 191 - } else { 192 - skb_push(skb, 2); 193 - if (brdev->payload == p_bridged) 191 + } else { /* e_vc */ 192 + if (brdev->payload == p_bridged) { 193 + skb_push(skb, 2); 194 194 memset(skb->data, 0, 2); 195 + } else { /* p_routed */ 196 + skb_pull(skb, ETH_HLEN); 197 + } 195 198 } 196 199 skb_debug(skb); 197 200 ··· 380 377 (skb->data + 6, ethertype_ipv4, 381 378 sizeof(ethertype_ipv4)) == 0) 382 379 skb->protocol = __constant_htons(ETH_P_IP); 383 - else { 384 - brdev->stats.rx_errors++; 385 - dev_kfree_skb(skb); 386 - return; 387 - } 380 + else 381 + goto error; 388 382 skb_pull(skb, sizeof(llc_oui_ipv4)); 389 383 skb_reset_network_header(skb); 390 384 skb->pkt_type = PACKET_HOST; ··· 394 394 (memcmp(skb->data, llc_oui_pid_pad, 7) == 0)) { 395 395 skb_pull(skb, sizeof(llc_oui_pid_pad)); 396 396 skb->protocol = eth_type_trans(skb, net_dev); 397 - } else { 398 - brdev->stats.rx_errors++; 399 - dev_kfree_skb(skb); 400 - return; 401 - } 397 + } else 398 + goto error; 402 399 403 - } else { 404 - /* first 2 chars should be 0 */ 405 - if (*((u16 *) (skb->data)) != 0) { 406 - brdev->stats.rx_errors++; 407 - dev_kfree_skb(skb); 408 - return; 400 + } else { /* e_vc */ 401 + if (brdev->payload == p_routed) { 402 + struct iphdr *iph; 403 + 404 + skb_reset_network_header(skb); 405 + iph = ip_hdr(skb); 406 + if (iph->version == 4) 407 + skb->protocol = __constant_htons(ETH_P_IP); 408 + else if (iph->version == 6) 409 + skb->protocol = __constant_htons(ETH_P_IPV6); 410 + else 411 + goto error; 412 + skb->pkt_type = PACKET_HOST; 413 + } else { /* p_bridged */ 414 + /* first 2 chars should be 0 */ 415 + if (*((u16 *) (skb->data)) != 0) 416 + goto error; 417 + skb_pull(skb, BR2684_PAD_LEN); 418 + skb->protocol = eth_type_trans(skb, net_dev); 409 419 } 410 - skb_pull(skb, BR2684_PAD_LEN + ETH_HLEN); /* pad, dstmac, srcmac, ethtype */ 411 - skb->protocol = eth_type_trans(skb, net_dev); 412 420 } 413 421 414 422 #ifdef CONFIG_ATM_BR2684_IPFILTER 415 - if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) { 416 - brdev->stats.rx_dropped++; 417 - dev_kfree_skb(skb); 418 - return; 419 - } 423 + if (unlikely(packet_fails_filter(skb->protocol, brvcc, skb))) 424 + goto dropped; 420 425 #endif /* CONFIG_ATM_BR2684_IPFILTER */ 421 426 skb->dev = net_dev; 422 427 ATM_SKB(skb)->vcc = atmvcc; /* needed ? */ 423 428 pr_debug("received packet's protocol: %x\n", ntohs(skb->protocol)); 424 429 skb_debug(skb); 425 - if (unlikely(!(net_dev->flags & IFF_UP))) { 426 - /* sigh, interface is down */ 427 - brdev->stats.rx_dropped++; 428 - dev_kfree_skb(skb); 429 - return; 430 - } 430 + /* sigh, interface is down? */ 431 + if (unlikely(!(net_dev->flags & IFF_UP))) 432 + goto dropped; 431 433 brdev->stats.rx_packets++; 432 434 brdev->stats.rx_bytes += skb->len; 433 435 memset(ATM_SKB(skb), 0, sizeof(struct atm_skb_data)); 434 436 netif_rx(skb); 437 + return; 438 + 439 + dropped: 440 + brdev->stats.rx_dropped++; 441 + goto free_skb; 442 + error: 443 + brdev->stats.rx_errors++; 444 + free_skb: 445 + dev_kfree_skb(skb); 446 + return; 435 447 } 436 448 437 449 /* ··· 530 518 struct sk_buff *next = skb->next; 531 519 532 520 skb->next = skb->prev = NULL; 521 + br2684_push(atmvcc, skb); 533 522 BRPRIV(skb->dev)->stats.rx_bytes -= skb->len; 534 523 BRPRIV(skb->dev)->stats.rx_packets--; 535 - br2684_push(atmvcc, skb); 536 524 537 525 skb = next; 538 526 }
+26 -8
net/core/dev.c
··· 119 119 #include <linux/err.h> 120 120 #include <linux/ctype.h> 121 121 #include <linux/if_arp.h> 122 + #include <linux/if_vlan.h> 122 123 123 124 #include "net-sysfs.h" 124 125 ··· 1363 1362 } 1364 1363 EXPORT_SYMBOL(netif_device_attach); 1365 1364 1365 + static bool can_checksum_protocol(unsigned long features, __be16 protocol) 1366 + { 1367 + return ((features & NETIF_F_GEN_CSUM) || 1368 + ((features & NETIF_F_IP_CSUM) && 1369 + protocol == htons(ETH_P_IP)) || 1370 + ((features & NETIF_F_IPV6_CSUM) && 1371 + protocol == htons(ETH_P_IPV6))); 1372 + } 1373 + 1374 + static bool dev_can_checksum(struct net_device *dev, struct sk_buff *skb) 1375 + { 1376 + if (can_checksum_protocol(dev->features, skb->protocol)) 1377 + return true; 1378 + 1379 + if (skb->protocol == htons(ETH_P_8021Q)) { 1380 + struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; 1381 + if (can_checksum_protocol(dev->features & dev->vlan_features, 1382 + veh->h_vlan_encapsulated_proto)) 1383 + return true; 1384 + } 1385 + 1386 + return false; 1387 + } 1366 1388 1367 1389 /* 1368 1390 * Invalidate hardware checksum when packet is to be mangled, and ··· 1664 1640 if (skb->ip_summed == CHECKSUM_PARTIAL) { 1665 1641 skb_set_transport_header(skb, skb->csum_start - 1666 1642 skb_headroom(skb)); 1667 - 1668 - if (!(dev->features & NETIF_F_GEN_CSUM) && 1669 - !((dev->features & NETIF_F_IP_CSUM) && 1670 - skb->protocol == htons(ETH_P_IP)) && 1671 - !((dev->features & NETIF_F_IPV6_CSUM) && 1672 - skb->protocol == htons(ETH_P_IPV6))) 1673 - if (skb_checksum_help(skb)) 1674 - goto out_kfree_skb; 1643 + if (!dev_can_checksum(dev, skb) && skb_checksum_help(skb)) 1644 + goto out_kfree_skb; 1675 1645 } 1676 1646 1677 1647 gso:
+3 -3
net/ipv4/inet_connection_sock.c
··· 468 468 reqp=&lopt->syn_table[i]; 469 469 while ((req = *reqp) != NULL) { 470 470 if (time_after_eq(now, req->expires)) { 471 - if ((req->retrans < (inet_rsk(req)->acked ? max_retries : thresh)) && 472 - (inet_rsk(req)->acked || 473 - !req->rsk_ops->rtx_syn_ack(parent, req))) { 471 + if ((req->retrans < thresh || 472 + (inet_rsk(req)->acked && req->retrans < max_retries)) 473 + && !req->rsk_ops->rtx_syn_ack(parent, req)) { 474 474 unsigned long timeo; 475 475 476 476 if (req->retrans++ == 0)
+1 -1
net/ipv4/raw.c
··· 931 931 srcp = inet->num; 932 932 933 933 seq_printf(seq, "%4d: %08X:%04X %08X:%04X" 934 - " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d", 934 + " %02X %08X:%08X %02X:%08lX %08X %5d %8d %lu %d %p %d\n", 935 935 i, src, srcp, dest, destp, sp->sk_state, 936 936 atomic_read(&sp->sk_wmem_alloc), 937 937 atomic_read(&sp->sk_rmem_alloc),
-4
net/ipv4/tcp_ipv4.c
··· 83 83 int sysctl_tcp_tw_reuse __read_mostly; 84 84 int sysctl_tcp_low_latency __read_mostly; 85 85 86 - /* Check TCP sequence numbers in ICMP packets. */ 87 - #define ICMP_MIN_LENGTH 8 88 - 89 - void tcp_v4_send_check(struct sock *sk, int len, struct sk_buff *skb); 90 86 91 87 #ifdef CONFIG_TCP_MD5SIG 92 88 static struct tcp_md5sig_key *tcp_v4_md5_do_lookup(struct sock *sk,
+24 -20
net/ipv6/sit.c
··· 220 220 221 221 } 222 222 223 - static int ipip6_tunnel_get_prl(struct ip_tunnel *t, struct ip_tunnel_prl *a) 223 + static int ipip6_tunnel_get_prl(struct ip_tunnel *t, 224 + struct ip_tunnel_prl __user *a) 224 225 { 225 - struct ip_tunnel_prl *kp; 226 + struct ip_tunnel_prl kprl, *kp; 226 227 struct ip_tunnel_prl_entry *prl; 227 228 unsigned int cmax, c = 0, ca, len; 228 229 int ret = 0; 229 230 230 - cmax = a->datalen / sizeof(*a); 231 - if (cmax > 1 && a->addr != htonl(INADDR_ANY)) 231 + if (copy_from_user(&kprl, a, sizeof(kprl))) 232 + return -EFAULT; 233 + cmax = kprl.datalen / sizeof(kprl); 234 + if (cmax > 1 && kprl.addr != htonl(INADDR_ANY)) 232 235 cmax = 1; 233 236 234 237 /* For simple GET or for root users, ··· 262 259 for (prl = t->prl; prl; prl = prl->next) { 263 260 if (c > cmax) 264 261 break; 265 - if (a->addr != htonl(INADDR_ANY) && prl->addr != a->addr) 262 + if (kprl.addr != htonl(INADDR_ANY) && prl->addr != kprl.addr) 266 263 continue; 267 264 kp[c].addr = prl->addr; 268 265 kp[c].flags = prl->flags; 269 266 c++; 270 - if (a->addr != htonl(INADDR_ANY)) 267 + if (kprl.addr != htonl(INADDR_ANY)) 271 268 break; 272 269 } 273 270 out: 274 271 read_unlock(&ipip6_lock); 275 272 276 273 len = sizeof(*kp) * c; 277 - ret = len ? copy_to_user(a->data, kp, len) : 0; 274 + ret = 0; 275 + if ((len && copy_to_user(a + 1, kp, len)) || put_user(len, &a->datalen)) 276 + ret = -EFAULT; 278 277 279 278 kfree(kp); 280 - if (ret) 281 - return -EFAULT; 282 279 283 - a->datalen = len; 284 - return 0; 280 + return ret; 285 281 } 286 282 287 283 static int ··· 873 871 break; 874 872 875 873 case SIOCGETPRL: 874 + err = -EINVAL; 875 + if (dev == sitn->fb_tunnel_dev) 876 + goto done; 877 + err = -ENOENT; 878 + if (!(t = netdev_priv(dev))) 879 + goto done; 880 + err = ipip6_tunnel_get_prl(t, ifr->ifr_ifru.ifru_data); 881 + break; 882 + 876 883 case SIOCADDPRL: 877 884 case SIOCDELPRL: 878 885 case SIOCCHGPRL: 879 886 err = -EPERM; 880 - if (cmd != SIOCGETPRL && !capable(CAP_NET_ADMIN)) 887 + if (!capable(CAP_NET_ADMIN)) 881 888 goto done; 882 889 err = -EINVAL; 883 890 if (dev == sitn->fb_tunnel_dev) ··· 899 888 goto done; 900 889 901 890 switch (cmd) { 902 - case SIOCGETPRL: 903 - err = ipip6_tunnel_get_prl(t, &prl); 904 - if (!err && copy_to_user(ifr->ifr_ifru.ifru_data, 905 - &prl, sizeof(prl))) 906 - err = -EFAULT; 907 - break; 908 891 case SIOCDELPRL: 909 892 err = ipip6_tunnel_del_prl(t, &prl); 910 893 break; ··· 907 902 err = ipip6_tunnel_add_prl(t, &prl, cmd == SIOCCHGPRL); 908 903 break; 909 904 } 910 - if (cmd != SIOCGETPRL) 911 - netdev_state_change(dev); 905 + netdev_state_change(dev); 912 906 break; 913 907 914 908 default:
+2 -1
net/mac80211/wext.c
··· 508 508 sdata = IEEE80211_DEV_TO_SUB_IF(dev); 509 509 if (sdata->vif.type == IEEE80211_IF_TYPE_STA || 510 510 sdata->vif.type == IEEE80211_IF_TYPE_IBSS) { 511 - if (sdata->u.sta.state == IEEE80211_ASSOCIATED) { 511 + if (sdata->u.sta.state == IEEE80211_ASSOCIATED || 512 + sdata->u.sta.state == IEEE80211_IBSS_JOINED) { 512 513 ap_addr->sa_family = ARPHRD_ETHER; 513 514 memcpy(&ap_addr->sa_data, sdata->u.sta.bssid, ETH_ALEN); 514 515 return 0;
+1 -1
net/mac80211/wme.c
··· 637 637 #ifdef CONFIG_MAC80211_HT_DEBUG 638 638 if (net_ratelimit()) 639 639 printk(KERN_DEBUG "allocated aggregation queue" 640 - " %d tid %d addr %s pool=0x%lX", 640 + " %d tid %d addr %s pool=0x%lX\n", 641 641 i, tid, print_mac(mac, sta->addr), 642 642 q->qdisc_pool[0]); 643 643 #endif /* CONFIG_MAC80211_HT_DEBUG */
+15 -8
net/sched/sch_htb.c
··· 26 26 * and many others. thanks. 27 27 */ 28 28 #include <linux/module.h> 29 + #include <linux/moduleparam.h> 29 30 #include <linux/types.h> 30 31 #include <linux/kernel.h> 31 32 #include <linux/string.h> ··· 52 51 */ 53 52 54 53 #define HTB_HSIZE 16 /* classid hash size */ 55 - #define HTB_HYSTERESIS 1 /* whether to use mode hysteresis for speedup */ 54 + static int htb_hysteresis __read_mostly = 0; /* whether to use mode hysteresis for speedup */ 56 55 #define HTB_VER 0x30011 /* major must be matched with number suplied by TC as version */ 57 56 58 57 #if HTB_VER >> 16 != TC_HTB_PROTOVER 59 58 #error "Mismatched sch_htb.c and pkt_sch.h" 60 59 #endif 60 + 61 + /* Module parameter and sysfs export */ 62 + module_param (htb_hysteresis, int, 0640); 63 + MODULE_PARM_DESC(htb_hysteresis, "Hysteresis mode, less CPU load, less accurate"); 61 64 62 65 /* used internaly to keep status of single class */ 63 66 enum htb_cmode { ··· 465 460 htb_remove_class_from_row(q, cl, mask); 466 461 } 467 462 468 - #if HTB_HYSTERESIS 469 463 static inline long htb_lowater(const struct htb_class *cl) 470 464 { 471 - return cl->cmode != HTB_CANT_SEND ? -cl->cbuffer : 0; 465 + if (htb_hysteresis) 466 + return cl->cmode != HTB_CANT_SEND ? -cl->cbuffer : 0; 467 + else 468 + return 0; 472 469 } 473 470 static inline long htb_hiwater(const struct htb_class *cl) 474 471 { 475 - return cl->cmode == HTB_CAN_SEND ? -cl->buffer : 0; 472 + if (htb_hysteresis) 473 + return cl->cmode == HTB_CAN_SEND ? -cl->buffer : 0; 474 + else 475 + return 0; 476 476 } 477 - #else 478 - #define htb_lowater(cl) (0) 479 - #define htb_hiwater(cl) (0) 480 - #endif 477 + 481 478 482 479 /** 483 480 * htb_class_mode - computes and returns current class mode
+11 -2
net/sctp/associola.c
··· 476 476 void sctp_assoc_set_primary(struct sctp_association *asoc, 477 477 struct sctp_transport *transport) 478 478 { 479 + int changeover = 0; 480 + 481 + /* it's a changeover only if we already have a primary path 482 + * that we are changing 483 + */ 484 + if (asoc->peer.primary_path != NULL && 485 + asoc->peer.primary_path != transport) 486 + changeover = 1 ; 487 + 479 488 asoc->peer.primary_path = transport; 480 489 481 490 /* Set a default msg_name for events. */ ··· 510 501 * double switch to the same destination address. 511 502 */ 512 503 if (transport->cacc.changeover_active) 513 - transport->cacc.cycling_changeover = 1; 504 + transport->cacc.cycling_changeover = changeover; 514 505 515 506 /* 2) The sender MUST set CHANGEOVER_ACTIVE to indicate that 516 507 * a changeover has occurred. 517 508 */ 518 - transport->cacc.changeover_active = 1; 509 + transport->cacc.changeover_active = changeover; 519 510 520 511 /* 3) The sender MUST store the next TSN to be sent in 521 512 * next_tsn_at_change.
+15 -4
net/sctp/protocol.c
··· 108 108 } 109 109 110 110 if (sctp_snmp_proc_init()) 111 - goto out_nomem; 111 + goto out_snmp_proc_init; 112 112 if (sctp_eps_proc_init()) 113 - goto out_nomem; 113 + goto out_eps_proc_init; 114 114 if (sctp_assocs_proc_init()) 115 - goto out_nomem; 115 + goto out_assocs_proc_init; 116 116 if (sctp_remaddr_proc_init()) 117 - goto out_nomem; 117 + goto out_remaddr_proc_init; 118 118 119 119 return 0; 120 120 121 + out_remaddr_proc_init: 122 + sctp_remaddr_proc_exit(); 123 + out_assocs_proc_init: 124 + sctp_eps_proc_exit(); 125 + out_eps_proc_init: 126 + sctp_snmp_proc_exit(); 127 + out_snmp_proc_init: 128 + if (proc_net_sctp) { 129 + proc_net_sctp = NULL; 130 + remove_proc_entry("sctp", init_net.proc_net); 131 + } 121 132 out_nomem: 122 133 return -ENOMEM; 123 134 }