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