diff options
author | Simon Horman <horms@verge.net.au> | 2008-08-19 03:36:22 -0400 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2008-08-19 03:36:22 -0400 |
commit | 3f087668c4e7c97289f0a67f9278ae6e0a765a80 (patch) | |
tree | 6b278344bf96d31a328bf76e445b189bff5f0ce9 | |
parent | 51df1901394a714d1a17202da02ae4957260eab5 (diff) | |
parent | e5befbd9525d92bb074b70192eb2c69aae65fc60 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
49 files changed, 412 insertions, 295 deletions
diff --git a/Documentation/rfkill.txt b/Documentation/rfkill.txt index 28b6ec87c642..6fcb3060dec5 100644 --- a/Documentation/rfkill.txt +++ b/Documentation/rfkill.txt | |||
@@ -363,6 +363,11 @@ This rule exists because users of the rfkill subsystem expect to get (and set, | |||
363 | when possible) the overall transmitter rfkill state, not of a particular rfkill | 363 | when possible) the overall transmitter rfkill state, not of a particular rfkill |
364 | line. | 364 | line. |
365 | 365 | ||
366 | 5. During suspend, the rfkill class will attempt to soft-block the radio | ||
367 | through a call to rfkill->toggle_radio, and will try to restore its previous | ||
368 | state during resume. After a rfkill class is suspended, it will *not* call | ||
369 | rfkill->toggle_radio until it is resumed. | ||
370 | |||
366 | Example of a WLAN wireless driver connected to the rfkill subsystem: | 371 | Example of a WLAN wireless driver connected to the rfkill subsystem: |
367 | -------------------------------------------------------------------- | 372 | -------------------------------------------------------------------- |
368 | 373 | ||
diff --git a/drivers/char/random.c b/drivers/char/random.c index e0d0e371909c..1838aa3d24fe 100644 --- a/drivers/char/random.c +++ b/drivers/char/random.c | |||
@@ -1571,6 +1571,7 @@ u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport) | |||
1571 | 1571 | ||
1572 | return half_md4_transform(hash, keyptr->secret); | 1572 | return half_md4_transform(hash, keyptr->secret); |
1573 | } | 1573 | } |
1574 | EXPORT_SYMBOL_GPL(secure_ipv4_port_ephemeral); | ||
1574 | 1575 | ||
1575 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 1576 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
1576 | u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, | 1577 | u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d4548101e495..2486a656f12d 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -35,8 +35,8 @@ | |||
35 | #include <linux/time.h> | 35 | #include <linux/time.h> |
36 | #include <linux/ethtool.h> | 36 | #include <linux/ethtool.h> |
37 | #include <linux/mii.h> | 37 | #include <linux/mii.h> |
38 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
39 | #include <linux/if_vlan.h> | 38 | #include <linux/if_vlan.h> |
39 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
40 | #define BCM_VLAN 1 | 40 | #define BCM_VLAN 1 |
41 | #endif | 41 | #endif |
42 | #include <net/ip.h> | 42 | #include <net/ip.h> |
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 49f6bc036a92..3b43bfd85a0f 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -64,68 +64,6 @@ struct pcpu_lstats { | |||
64 | unsigned long bytes; | 64 | unsigned long bytes; |
65 | }; | 65 | }; |
66 | 66 | ||
67 | /* KISS: just allocate small chunks and copy bits. | ||
68 | * | ||
69 | * So, in fact, this is documentation, explaining what we expect | ||
70 | * of largesending device modulo TCP checksum, which is ignored for loopback. | ||
71 | */ | ||
72 | |||
73 | #ifdef LOOPBACK_TSO | ||
74 | static void emulate_large_send_offload(struct sk_buff *skb) | ||
75 | { | ||
76 | struct iphdr *iph = ip_hdr(skb); | ||
77 | struct tcphdr *th = (struct tcphdr *)(skb_network_header(skb) + | ||
78 | (iph->ihl * 4)); | ||
79 | unsigned int doffset = (iph->ihl + th->doff) * 4; | ||
80 | unsigned int mtu = skb_shinfo(skb)->gso_size + doffset; | ||
81 | unsigned int offset = 0; | ||
82 | u32 seq = ntohl(th->seq); | ||
83 | u16 id = ntohs(iph->id); | ||
84 | |||
85 | while (offset + doffset < skb->len) { | ||
86 | unsigned int frag_size = min(mtu, skb->len - offset) - doffset; | ||
87 | struct sk_buff *nskb = alloc_skb(mtu + 32, GFP_ATOMIC); | ||
88 | |||
89 | if (!nskb) | ||
90 | break; | ||
91 | skb_reserve(nskb, 32); | ||
92 | skb_set_mac_header(nskb, -ETH_HLEN); | ||
93 | skb_reset_network_header(nskb); | ||
94 | iph = ip_hdr(nskb); | ||
95 | skb_copy_to_linear_data(nskb, skb_network_header(skb), | ||
96 | doffset); | ||
97 | if (skb_copy_bits(skb, | ||
98 | doffset + offset, | ||
99 | nskb->data + doffset, | ||
100 | frag_size)) | ||
101 | BUG(); | ||
102 | skb_put(nskb, doffset + frag_size); | ||
103 | nskb->ip_summed = CHECKSUM_UNNECESSARY; | ||
104 | nskb->dev = skb->dev; | ||
105 | nskb->priority = skb->priority; | ||
106 | nskb->protocol = skb->protocol; | ||
107 | nskb->dst = dst_clone(skb->dst); | ||
108 | memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); | ||
109 | nskb->pkt_type = skb->pkt_type; | ||
110 | |||
111 | th = (struct tcphdr *)(skb_network_header(nskb) + iph->ihl * 4); | ||
112 | iph->tot_len = htons(frag_size + doffset); | ||
113 | iph->id = htons(id); | ||
114 | iph->check = 0; | ||
115 | iph->check = ip_fast_csum((unsigned char *) iph, iph->ihl); | ||
116 | th->seq = htonl(seq); | ||
117 | if (offset + doffset + frag_size < skb->len) | ||
118 | th->fin = th->psh = 0; | ||
119 | netif_rx(nskb); | ||
120 | offset += frag_size; | ||
121 | seq += frag_size; | ||
122 | id++; | ||
123 | } | ||
124 | |||
125 | dev_kfree_skb(skb); | ||
126 | } | ||
127 | #endif /* LOOPBACK_TSO */ | ||
128 | |||
129 | /* | 67 | /* |
130 | * The higher levels take care of making this non-reentrant (it's | 68 | * The higher levels take care of making this non-reentrant (it's |
131 | * called with bh's disabled). | 69 | * called with bh's disabled). |
@@ -137,9 +75,6 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | |||
137 | skb_orphan(skb); | 75 | skb_orphan(skb); |
138 | 76 | ||
139 | skb->protocol = eth_type_trans(skb,dev); | 77 | skb->protocol = eth_type_trans(skb,dev); |
140 | #ifndef LOOPBACK_MUST_CHECKSUM | ||
141 | skb->ip_summed = CHECKSUM_UNNECESSARY; | ||
142 | #endif | ||
143 | 78 | ||
144 | #ifdef LOOPBACK_TSO | 79 | #ifdef LOOPBACK_TSO |
145 | if (skb_is_gso(skb)) { | 80 | if (skb_is_gso(skb)) { |
@@ -234,9 +169,7 @@ static void loopback_setup(struct net_device *dev) | |||
234 | dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ | 169 | dev->type = ARPHRD_LOOPBACK; /* 0x0001*/ |
235 | dev->flags = IFF_LOOPBACK; | 170 | dev->flags = IFF_LOOPBACK; |
236 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST | 171 | dev->features = NETIF_F_SG | NETIF_F_FRAGLIST |
237 | #ifdef LOOPBACK_TSO | ||
238 | | NETIF_F_TSO | 172 | | NETIF_F_TSO |
239 | #endif | ||
240 | | NETIF_F_NO_CSUM | 173 | | NETIF_F_NO_CSUM |
241 | | NETIF_F_HIGHDMA | 174 | | NETIF_F_HIGHDMA |
242 | | NETIF_F_LLTX | 175 | | NETIF_F_LLTX |
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index e6bbc639c2d0..6daea0c91862 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -358,6 +358,66 @@ static unsigned int tun_chr_poll(struct file *file, poll_table * wait) | |||
358 | return mask; | 358 | return mask; |
359 | } | 359 | } |
360 | 360 | ||
361 | /* prepad is the amount to reserve at front. len is length after that. | ||
362 | * linear is a hint as to how much to copy (usually headers). */ | ||
363 | static struct sk_buff *tun_alloc_skb(size_t prepad, size_t len, size_t linear, | ||
364 | gfp_t gfp) | ||
365 | { | ||
366 | struct sk_buff *skb; | ||
367 | unsigned int i; | ||
368 | |||
369 | skb = alloc_skb(prepad + len, gfp|__GFP_NOWARN); | ||
370 | if (skb) { | ||
371 | skb_reserve(skb, prepad); | ||
372 | skb_put(skb, len); | ||
373 | return skb; | ||
374 | } | ||
375 | |||
376 | /* Under a page? Don't bother with paged skb. */ | ||
377 | if (prepad + len < PAGE_SIZE) | ||
378 | return NULL; | ||
379 | |||
380 | /* Start with a normal skb, and add pages. */ | ||
381 | skb = alloc_skb(prepad + linear, gfp); | ||
382 | if (!skb) | ||
383 | return NULL; | ||
384 | |||
385 | skb_reserve(skb, prepad); | ||
386 | skb_put(skb, linear); | ||
387 | |||
388 | len -= linear; | ||
389 | |||
390 | for (i = 0; i < MAX_SKB_FRAGS; i++) { | ||
391 | skb_frag_t *f = &skb_shinfo(skb)->frags[i]; | ||
392 | |||
393 | f->page = alloc_page(gfp|__GFP_ZERO); | ||
394 | if (!f->page) | ||
395 | break; | ||
396 | |||
397 | f->page_offset = 0; | ||
398 | f->size = PAGE_SIZE; | ||
399 | |||
400 | skb->data_len += PAGE_SIZE; | ||
401 | skb->len += PAGE_SIZE; | ||
402 | skb->truesize += PAGE_SIZE; | ||
403 | skb_shinfo(skb)->nr_frags++; | ||
404 | |||
405 | if (len < PAGE_SIZE) { | ||
406 | len = 0; | ||
407 | break; | ||
408 | } | ||
409 | len -= PAGE_SIZE; | ||
410 | } | ||
411 | |||
412 | /* Too large, or alloc fail? */ | ||
413 | if (unlikely(len)) { | ||
414 | kfree_skb(skb); | ||
415 | skb = NULL; | ||
416 | } | ||
417 | |||
418 | return skb; | ||
419 | } | ||
420 | |||
361 | /* Get packet from user space buffer */ | 421 | /* Get packet from user space buffer */ |
362 | static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, size_t count) | 422 | static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, size_t count) |
363 | { | 423 | { |
@@ -391,14 +451,12 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, | |||
391 | return -EINVAL; | 451 | return -EINVAL; |
392 | } | 452 | } |
393 | 453 | ||
394 | if (!(skb = alloc_skb(len + align, GFP_KERNEL))) { | 454 | if (!(skb = tun_alloc_skb(align, len, gso.hdr_len, GFP_KERNEL))) { |
395 | tun->dev->stats.rx_dropped++; | 455 | tun->dev->stats.rx_dropped++; |
396 | return -ENOMEM; | 456 | return -ENOMEM; |
397 | } | 457 | } |
398 | 458 | ||
399 | if (align) | 459 | if (skb_copy_datagram_from_iovec(skb, 0, iv, len)) { |
400 | skb_reserve(skb, align); | ||
401 | if (memcpy_fromiovec(skb_put(skb, len), iv, len)) { | ||
402 | tun->dev->stats.rx_dropped++; | 460 | tun->dev->stats.rx_dropped++; |
403 | kfree_skb(skb); | 461 | kfree_skb(skb); |
404 | return -EFAULT; | 462 | return -EFAULT; |
@@ -748,6 +806,36 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
748 | return err; | 806 | return err; |
749 | } | 807 | } |
750 | 808 | ||
809 | static int tun_get_iff(struct net *net, struct file *file, struct ifreq *ifr) | ||
810 | { | ||
811 | struct tun_struct *tun = file->private_data; | ||
812 | |||
813 | if (!tun) | ||
814 | return -EBADFD; | ||
815 | |||
816 | DBG(KERN_INFO "%s: tun_get_iff\n", tun->dev->name); | ||
817 | |||
818 | strcpy(ifr->ifr_name, tun->dev->name); | ||
819 | |||
820 | ifr->ifr_flags = 0; | ||
821 | |||
822 | if (ifr->ifr_flags & TUN_TUN_DEV) | ||
823 | ifr->ifr_flags |= IFF_TUN; | ||
824 | else | ||
825 | ifr->ifr_flags |= IFF_TAP; | ||
826 | |||
827 | if (tun->flags & TUN_NO_PI) | ||
828 | ifr->ifr_flags |= IFF_NO_PI; | ||
829 | |||
830 | if (tun->flags & TUN_ONE_QUEUE) | ||
831 | ifr->ifr_flags |= IFF_ONE_QUEUE; | ||
832 | |||
833 | if (tun->flags & TUN_VNET_HDR) | ||
834 | ifr->ifr_flags |= IFF_VNET_HDR; | ||
835 | |||
836 | return 0; | ||
837 | } | ||
838 | |||
751 | /* This is like a cut-down ethtool ops, except done via tun fd so no | 839 | /* This is like a cut-down ethtool ops, except done via tun fd so no |
752 | * privs required. */ | 840 | * privs required. */ |
753 | static int set_offload(struct net_device *dev, unsigned long arg) | 841 | static int set_offload(struct net_device *dev, unsigned long arg) |
@@ -833,6 +921,15 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file, | |||
833 | DBG(KERN_INFO "%s: tun_chr_ioctl cmd %d\n", tun->dev->name, cmd); | 921 | DBG(KERN_INFO "%s: tun_chr_ioctl cmd %d\n", tun->dev->name, cmd); |
834 | 922 | ||
835 | switch (cmd) { | 923 | switch (cmd) { |
924 | case TUNGETIFF: | ||
925 | ret = tun_get_iff(current->nsproxy->net_ns, file, &ifr); | ||
926 | if (ret) | ||
927 | return ret; | ||
928 | |||
929 | if (copy_to_user(argp, &ifr, sizeof(ifr))) | ||
930 | return -EFAULT; | ||
931 | break; | ||
932 | |||
836 | case TUNSETNOCSUM: | 933 | case TUNSETNOCSUM: |
837 | /* Disable/Enable checksum */ | 934 | /* Disable/Enable checksum */ |
838 | if (arg) | 935 | if (arg) |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index 2028866f5995..b20a45aa8680 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -40,7 +40,6 @@ | |||
40 | * | 40 | * |
41 | */ | 41 | */ |
42 | 42 | ||
43 | #include <linux/version.h> | ||
44 | #include <linux/module.h> | 43 | #include <linux/module.h> |
45 | #include <linux/delay.h> | 44 | #include <linux/delay.h> |
46 | #include <linux/hardirq.h> | 45 | #include <linux/hardirq.h> |
@@ -587,7 +586,6 @@ ath5k_pci_suspend(struct pci_dev *pdev, pm_message_t state) | |||
587 | ath5k_stop_hw(sc); | 586 | ath5k_stop_hw(sc); |
588 | 587 | ||
589 | free_irq(pdev->irq, sc); | 588 | free_irq(pdev->irq, sc); |
590 | pci_disable_msi(pdev); | ||
591 | pci_save_state(pdev); | 589 | pci_save_state(pdev); |
592 | pci_disable_device(pdev); | 590 | pci_disable_device(pdev); |
593 | pci_set_power_state(pdev, PCI_D3hot); | 591 | pci_set_power_state(pdev, PCI_D3hot); |
@@ -616,12 +614,10 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
616 | */ | 614 | */ |
617 | pci_write_config_byte(pdev, 0x41, 0); | 615 | pci_write_config_byte(pdev, 0x41, 0); |
618 | 616 | ||
619 | pci_enable_msi(pdev); | ||
620 | |||
621 | err = request_irq(pdev->irq, ath5k_intr, IRQF_SHARED, "ath", sc); | 617 | err = request_irq(pdev->irq, ath5k_intr, IRQF_SHARED, "ath", sc); |
622 | if (err) { | 618 | if (err) { |
623 | ATH5K_ERR(sc, "request_irq failed\n"); | 619 | ATH5K_ERR(sc, "request_irq failed\n"); |
624 | goto err_msi; | 620 | goto err_no_irq; |
625 | } | 621 | } |
626 | 622 | ||
627 | err = ath5k_init(sc); | 623 | err = ath5k_init(sc); |
@@ -642,8 +638,7 @@ ath5k_pci_resume(struct pci_dev *pdev) | |||
642 | return 0; | 638 | return 0; |
643 | err_irq: | 639 | err_irq: |
644 | free_irq(pdev->irq, sc); | 640 | free_irq(pdev->irq, sc); |
645 | err_msi: | 641 | err_no_irq: |
646 | pci_disable_msi(pdev); | ||
647 | pci_disable_device(pdev); | 642 | pci_disable_device(pdev); |
648 | return err; | 643 | return err; |
649 | } | 644 | } |
diff --git a/drivers/net/wireless/ath9k/hw.c b/drivers/net/wireless/ath9k/hw.c index bde162f128ab..a17eb130f574 100644 --- a/drivers/net/wireless/ath9k/hw.c +++ b/drivers/net/wireless/ath9k/hw.c | |||
@@ -5017,7 +5017,11 @@ static void ath9k_hw_spur_mitigate(struct ath_hal *ah, | |||
5017 | 5017 | ||
5018 | for (i = 0; i < 123; i++) { | 5018 | for (i = 0; i < 123; i++) { |
5019 | if ((cur_vit_mask > lower) && (cur_vit_mask < upper)) { | 5019 | if ((cur_vit_mask > lower) && (cur_vit_mask < upper)) { |
5020 | if ((abs(cur_vit_mask - bin)) < 75) | 5020 | |
5021 | /* workaround for gcc bug #37014 */ | ||
5022 | volatile int tmp = abs(cur_vit_mask - bin); | ||
5023 | |||
5024 | if (tmp < 75) | ||
5021 | mask_amt = 1; | 5025 | mask_amt = 1; |
5022 | else | 5026 | else |
5023 | mask_amt = 0; | 5027 | mask_amt = 0; |
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index 3bf3a869361f..7205a936ec74 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -33,7 +33,6 @@ | |||
33 | #include <linux/moduleparam.h> | 33 | #include <linux/moduleparam.h> |
34 | #include <linux/if_arp.h> | 34 | #include <linux/if_arp.h> |
35 | #include <linux/etherdevice.h> | 35 | #include <linux/etherdevice.h> |
36 | #include <linux/version.h> | ||
37 | #include <linux/firmware.h> | 36 | #include <linux/firmware.h> |
38 | #include <linux/wireless.h> | 37 | #include <linux/wireless.h> |
39 | #include <linux/workqueue.h> | 38 | #include <linux/workqueue.h> |
@@ -4615,7 +4614,9 @@ static void b43_sprom_fixup(struct ssb_bus *bus) | |||
4615 | if (bus->bustype == SSB_BUSTYPE_PCI) { | 4614 | if (bus->bustype == SSB_BUSTYPE_PCI) { |
4616 | pdev = bus->host_pci; | 4615 | pdev = bus->host_pci; |
4617 | if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) || | 4616 | if (IS_PDEV(pdev, BROADCOM, 0x4318, ASUSTEK, 0x100F) || |
4617 | IS_PDEV(pdev, BROADCOM, 0x4320, DELL, 0x0003) || | ||
4618 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) || | 4618 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0015) || |
4619 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0014) || | ||
4619 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013)) | 4620 | IS_PDEV(pdev, BROADCOM, 0x4320, LINKSYS, 0x0013)) |
4620 | bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST; | 4621 | bus->sprom.boardflags_lo &= ~B43_BFL_BTCOEXIST; |
4621 | } | 4622 | } |
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c index c6f886ec08a3..19a401c4a0dc 100644 --- a/drivers/net/wireless/ipw2100.c +++ b/drivers/net/wireless/ipw2100.c | |||
@@ -157,7 +157,6 @@ that only one external action is invoked at a time. | |||
157 | #include <linux/stringify.h> | 157 | #include <linux/stringify.h> |
158 | #include <linux/tcp.h> | 158 | #include <linux/tcp.h> |
159 | #include <linux/types.h> | 159 | #include <linux/types.h> |
160 | #include <linux/version.h> | ||
161 | #include <linux/time.h> | 160 | #include <linux/time.h> |
162 | #include <linux/firmware.h> | 161 | #include <linux/firmware.h> |
163 | #include <linux/acpi.h> | 162 | #include <linux/acpi.h> |
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c index 36e8d2f6e7b4..dcce3542d5a7 100644 --- a/drivers/net/wireless/ipw2200.c +++ b/drivers/net/wireless/ipw2200.c | |||
@@ -31,7 +31,6 @@ | |||
31 | ******************************************************************************/ | 31 | ******************************************************************************/ |
32 | 32 | ||
33 | #include "ipw2200.h" | 33 | #include "ipw2200.h" |
34 | #include <linux/version.h> | ||
35 | 34 | ||
36 | 35 | ||
37 | #ifndef KBUILD_EXTMOD | 36 | #ifndef KBUILD_EXTMOD |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index b3931f6135a4..3f51f3635344 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/version.h> | ||
30 | #include <linux/init.h> | 29 | #include <linux/init.h> |
31 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
32 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 22bb26985c2e..e2581229d8b2 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -26,7 +26,6 @@ | |||
26 | 26 | ||
27 | #include <linux/kernel.h> | 27 | #include <linux/kernel.h> |
28 | #include <linux/module.h> | 28 | #include <linux/module.h> |
29 | #include <linux/version.h> | ||
30 | #include <linux/init.h> | 29 | #include <linux/init.h> |
31 | #include <linux/pci.h> | 30 | #include <linux/pci.h> |
32 | #include <linux/dma-mapping.h> | 31 | #include <linux/dma-mapping.h> |
@@ -967,7 +966,7 @@ static int iwl4965_interpolate_chan(struct iwl_priv *priv, u32 channel, | |||
967 | 966 | ||
968 | s = iwl4965_get_sub_band(priv, channel); | 967 | s = iwl4965_get_sub_band(priv, channel); |
969 | if (s >= EEPROM_TX_POWER_BANDS) { | 968 | if (s >= EEPROM_TX_POWER_BANDS) { |
970 | IWL_ERROR("Tx Power can not find channel %d ", channel); | 969 | IWL_ERROR("Tx Power can not find channel %d\n", channel); |
971 | return -1; | 970 | return -1; |
972 | } | 971 | } |
973 | 972 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index f3d139b663e6..cbc01a00eaf4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -25,7 +25,6 @@ | |||
25 | 25 | ||
26 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
27 | #include <linux/module.h> | 27 | #include <linux/module.h> |
28 | #include <linux/version.h> | ||
29 | #include <linux/init.h> | 28 | #include <linux/init.h> |
30 | #include <linux/pci.h> | 29 | #include <linux/pci.h> |
31 | #include <linux/dma-mapping.h> | 30 | #include <linux/dma-mapping.h> |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index ed09e48b1b61..061ffba9c884 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -29,7 +29,6 @@ | |||
29 | 29 | ||
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/version.h> | ||
33 | #include <linux/init.h> | 32 | #include <linux/init.h> |
34 | #include <linux/pci.h> | 33 | #include <linux/pci.h> |
35 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 9bd61809129f..c72f72579bea 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/version.h> | ||
32 | #include <net/mac80211.h> | 31 | #include <net/mac80211.h> |
33 | 32 | ||
34 | struct iwl_priv; /* FIXME: remove */ | 33 | struct iwl_priv; /* FIXME: remove */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-eeprom.c b/drivers/net/wireless/iwlwifi/iwl-eeprom.c index bce53830b301..37155755efc5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-eeprom.c +++ b/drivers/net/wireless/iwlwifi/iwl-eeprom.c | |||
@@ -63,7 +63,6 @@ | |||
63 | 63 | ||
64 | #include <linux/kernel.h> | 64 | #include <linux/kernel.h> |
65 | #include <linux/module.h> | 65 | #include <linux/module.h> |
66 | #include <linux/version.h> | ||
67 | #include <linux/init.h> | 66 | #include <linux/init.h> |
68 | 67 | ||
69 | #include <net/mac80211.h> | 68 | #include <net/mac80211.h> |
@@ -146,7 +145,7 @@ int iwlcore_eeprom_verify_signature(struct iwl_priv *priv) | |||
146 | { | 145 | { |
147 | u32 gp = iwl_read32(priv, CSR_EEPROM_GP); | 146 | u32 gp = iwl_read32(priv, CSR_EEPROM_GP); |
148 | if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) { | 147 | if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) { |
149 | IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x", gp); | 148 | IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); |
150 | return -ENOENT; | 149 | return -ENOENT; |
151 | } | 150 | } |
152 | return 0; | 151 | return 0; |
@@ -227,7 +226,7 @@ int iwl_eeprom_init(struct iwl_priv *priv) | |||
227 | 226 | ||
228 | ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv); | 227 | ret = priv->cfg->ops->lib->eeprom_ops.verify_signature(priv); |
229 | if (ret < 0) { | 228 | if (ret < 0) { |
230 | IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x", gp); | 229 | IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); |
231 | ret = -ENOENT; | 230 | ret = -ENOENT; |
232 | goto err; | 231 | goto err; |
233 | } | 232 | } |
@@ -254,7 +253,7 @@ int iwl_eeprom_init(struct iwl_priv *priv) | |||
254 | } | 253 | } |
255 | 254 | ||
256 | if (!(r & CSR_EEPROM_REG_READ_VALID_MSK)) { | 255 | if (!(r & CSR_EEPROM_REG_READ_VALID_MSK)) { |
257 | IWL_ERROR("Time out reading EEPROM[%d]", addr); | 256 | IWL_ERROR("Time out reading EEPROM[%d]\n", addr); |
258 | ret = -ETIMEDOUT; | 257 | ret = -ETIMEDOUT; |
259 | goto done; | 258 | goto done; |
260 | } | 259 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-hcmd.c index 6512834bb916..2eb03eea1908 100644 --- a/drivers/net/wireless/iwlwifi/iwl-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-hcmd.c | |||
@@ -28,7 +28,6 @@ | |||
28 | 28 | ||
29 | #include <linux/kernel.h> | 29 | #include <linux/kernel.h> |
30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
31 | #include <linux/version.h> | ||
32 | #include <net/mac80211.h> | 31 | #include <net/mac80211.h> |
33 | 32 | ||
34 | #include "iwl-dev.h" /* FIXME: remove */ | 33 | #include "iwl-dev.h" /* FIXME: remove */ |
diff --git a/drivers/net/wireless/iwlwifi/iwl-power.c b/drivers/net/wireless/iwlwifi/iwl-power.c index 028e3053c0ca..a099c9e30e55 100644 --- a/drivers/net/wireless/iwlwifi/iwl-power.c +++ b/drivers/net/wireless/iwlwifi/iwl-power.c | |||
@@ -29,7 +29,6 @@ | |||
29 | 29 | ||
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/version.h> | ||
33 | #include <linux/init.h> | 32 | #include <linux/init.h> |
34 | 33 | ||
35 | #include <net/mac80211.h> | 34 | #include <net/mac80211.h> |
diff --git a/drivers/net/wireless/iwlwifi/iwl-sta.c b/drivers/net/wireless/iwlwifi/iwl-sta.c index 60a6e0106036..6283a3a707f5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-sta.c +++ b/drivers/net/wireless/iwlwifi/iwl-sta.c | |||
@@ -207,7 +207,7 @@ static void iwl_set_ht_add_station(struct iwl_priv *priv, u8 index, | |||
207 | case WLAN_HT_CAP_MIMO_PS_DISABLED: | 207 | case WLAN_HT_CAP_MIMO_PS_DISABLED: |
208 | break; | 208 | break; |
209 | default: | 209 | default: |
210 | IWL_WARNING("Invalid MIMO PS mode %d", mimo_ps_mode); | 210 | IWL_WARNING("Invalid MIMO PS mode %d\n", mimo_ps_mode); |
211 | break; | 211 | break; |
212 | } | 212 | } |
213 | 213 | ||
@@ -969,7 +969,7 @@ int iwl_get_sta_id(struct iwl_priv *priv, struct ieee80211_hdr *hdr) | |||
969 | return priv->hw_params.bcast_sta_id; | 969 | return priv->hw_params.bcast_sta_id; |
970 | 970 | ||
971 | default: | 971 | default: |
972 | IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode); | 972 | IWL_WARNING("Unknown mode of operation: %d\n", priv->iw_mode); |
973 | return priv->hw_params.bcast_sta_id; | 973 | return priv->hw_params.bcast_sta_id; |
974 | } | 974 | } |
975 | } | 975 | } |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 4108c7c8f00f..d82823b5c8ab 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -493,7 +493,7 @@ int iwl_txq_ctx_reset(struct iwl_priv *priv) | |||
493 | /* Alloc keep-warm buffer */ | 493 | /* Alloc keep-warm buffer */ |
494 | ret = iwl_kw_alloc(priv); | 494 | ret = iwl_kw_alloc(priv); |
495 | if (ret) { | 495 | if (ret) { |
496 | IWL_ERROR("Keep Warm allocation failed"); | 496 | IWL_ERROR("Keep Warm allocation failed\n"); |
497 | goto error_kw; | 497 | goto error_kw; |
498 | } | 498 | } |
499 | spin_lock_irqsave(&priv->lock, flags); | 499 | spin_lock_irqsave(&priv->lock, flags); |
@@ -1463,7 +1463,7 @@ void iwl_rx_reply_compressed_ba(struct iwl_priv *priv, | |||
1463 | u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn); | 1463 | u16 ba_resp_scd_ssn = le16_to_cpu(ba_resp->scd_ssn); |
1464 | 1464 | ||
1465 | if (scd_flow >= priv->hw_params.max_txq_num) { | 1465 | if (scd_flow >= priv->hw_params.max_txq_num) { |
1466 | IWL_ERROR("BUG_ON scd_flow is bigger than number of queues"); | 1466 | IWL_ERROR("BUG_ON scd_flow is bigger than number of queues\n"); |
1467 | return; | 1467 | return; |
1468 | } | 1468 | } |
1469 | 1469 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 444847ab1b5a..b775d5bab668 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -29,7 +29,6 @@ | |||
29 | 29 | ||
30 | #include <linux/kernel.h> | 30 | #include <linux/kernel.h> |
31 | #include <linux/module.h> | 31 | #include <linux/module.h> |
32 | #include <linux/version.h> | ||
33 | #include <linux/init.h> | 32 | #include <linux/init.h> |
34 | #include <linux/pci.h> | 33 | #include <linux/pci.h> |
35 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
@@ -1558,7 +1557,7 @@ int iwl3945_eeprom_init(struct iwl3945_priv *priv) | |||
1558 | BUILD_BUG_ON(sizeof(priv->eeprom) != IWL_EEPROM_IMAGE_SIZE); | 1557 | BUILD_BUG_ON(sizeof(priv->eeprom) != IWL_EEPROM_IMAGE_SIZE); |
1559 | 1558 | ||
1560 | if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) { | 1559 | if ((gp & CSR_EEPROM_GP_VALID_MSK) == CSR_EEPROM_GP_BAD_SIGNATURE) { |
1561 | IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x", gp); | 1560 | IWL_ERROR("EEPROM not found, EEPROM_GP=0x%08x\n", gp); |
1562 | return -ENOENT; | 1561 | return -ENOENT; |
1563 | } | 1562 | } |
1564 | 1563 | ||
@@ -1583,7 +1582,7 @@ int iwl3945_eeprom_init(struct iwl3945_priv *priv) | |||
1583 | } | 1582 | } |
1584 | 1583 | ||
1585 | if (!(r & CSR_EEPROM_REG_READ_VALID_MSK)) { | 1584 | if (!(r & CSR_EEPROM_REG_READ_VALID_MSK)) { |
1586 | IWL_ERROR("Time out reading EEPROM[%d]", addr); | 1585 | IWL_ERROR("Time out reading EEPROM[%d]\n", addr); |
1587 | return -ETIMEDOUT; | 1586 | return -ETIMEDOUT; |
1588 | } | 1587 | } |
1589 | e[addr / 2] = le16_to_cpu((__force __le16)(r >> 16)); | 1588 | e[addr / 2] = le16_to_cpu((__force __le16)(r >> 16)); |
@@ -2507,7 +2506,7 @@ static int iwl3945_get_sta_id(struct iwl3945_priv *priv, struct ieee80211_hdr *h | |||
2507 | return priv->hw_setting.bcast_sta_id; | 2506 | return priv->hw_setting.bcast_sta_id; |
2508 | 2507 | ||
2509 | default: | 2508 | default: |
2510 | IWL_WARNING("Unknown mode of operation: %d", priv->iw_mode); | 2509 | IWL_WARNING("Unknown mode of operation: %d\n", priv->iw_mode); |
2511 | return priv->hw_setting.bcast_sta_id; | 2510 | return priv->hw_setting.bcast_sta_id; |
2512 | } | 2511 | } |
2513 | } | 2512 | } |
diff --git a/drivers/net/wireless/p54/p54common.c b/drivers/net/wireless/p54/p54common.c index 83cd85e1f847..29be3dc8ee09 100644 --- a/drivers/net/wireless/p54/p54common.c +++ b/drivers/net/wireless/p54/p54common.c | |||
@@ -413,12 +413,12 @@ static void p54_rx_frame_sent(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
413 | last_addr = range->end_addr; | 413 | last_addr = range->end_addr; |
414 | __skb_unlink(entry, &priv->tx_queue); | 414 | __skb_unlink(entry, &priv->tx_queue); |
415 | memset(&info->status, 0, sizeof(info->status)); | 415 | memset(&info->status, 0, sizeof(info->status)); |
416 | priv->tx_stats[skb_get_queue_mapping(skb)].len--; | ||
417 | entry_hdr = (struct p54_control_hdr *) entry->data; | 416 | entry_hdr = (struct p54_control_hdr *) entry->data; |
418 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; | 417 | entry_data = (struct p54_tx_control_allocdata *) entry_hdr->data; |
419 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) | 418 | if ((entry_hdr->magic1 & cpu_to_le16(0x4000)) != 0) |
420 | pad = entry_data->align[0]; | 419 | pad = entry_data->align[0]; |
421 | 420 | ||
421 | priv->tx_stats[entry_data->hw_queue - 4].len--; | ||
422 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { | 422 | if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { |
423 | if (!(payload->status & 0x01)) | 423 | if (!(payload->status & 0x01)) |
424 | info->flags |= IEEE80211_TX_STAT_ACK; | 424 | info->flags |= IEEE80211_TX_STAT_ACK; |
@@ -557,6 +557,7 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
557 | struct p54_tx_control_allocdata *txhdr; | 557 | struct p54_tx_control_allocdata *txhdr; |
558 | size_t padding, len; | 558 | size_t padding, len; |
559 | u8 rate; | 559 | u8 rate; |
560 | u8 cts_rate = 0x20; | ||
560 | 561 | ||
561 | current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)]; | 562 | current_queue = &priv->tx_stats[skb_get_queue_mapping(skb)]; |
562 | if (unlikely(current_queue->len > current_queue->limit)) | 563 | if (unlikely(current_queue->len > current_queue->limit)) |
@@ -581,28 +582,28 @@ static int p54_tx(struct ieee80211_hw *dev, struct sk_buff *skb) | |||
581 | hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1); | 582 | hdr->type = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? 0 : cpu_to_le16(1); |
582 | hdr->retry1 = hdr->retry2 = info->control.retry_limit; | 583 | hdr->retry1 = hdr->retry2 = info->control.retry_limit; |
583 | 584 | ||
584 | memset(txhdr->wep_key, 0x0, 16); | ||
585 | txhdr->padding = 0; | ||
586 | txhdr->padding2 = 0; | ||
587 | |||
588 | /* TODO: add support for alternate retry TX rates */ | 585 | /* TODO: add support for alternate retry TX rates */ |
589 | rate = ieee80211_get_tx_rate(dev, info)->hw_value; | 586 | rate = ieee80211_get_tx_rate(dev, info)->hw_value; |
590 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) | 587 | if (info->flags & IEEE80211_TX_CTL_SHORT_PREAMBLE) { |
591 | rate |= 0x10; | 588 | rate |= 0x10; |
592 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) | 589 | cts_rate |= 0x10; |
590 | } | ||
591 | if (info->flags & IEEE80211_TX_CTL_USE_RTS_CTS) { | ||
593 | rate |= 0x40; | 592 | rate |= 0x40; |
594 | else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) | 593 | cts_rate |= ieee80211_get_rts_cts_rate(dev, info)->hw_value; |
594 | } else if (info->flags & IEEE80211_TX_CTL_USE_CTS_PROTECT) { | ||
595 | rate |= 0x20; | 595 | rate |= 0x20; |
596 | cts_rate |= ieee80211_get_rts_cts_rate(dev, info)->hw_value; | ||
597 | } | ||
596 | memset(txhdr->rateset, rate, 8); | 598 | memset(txhdr->rateset, rate, 8); |
597 | txhdr->wep_key_present = 0; | 599 | txhdr->key_type = 0; |
598 | txhdr->wep_key_len = 0; | 600 | txhdr->key_len = 0; |
599 | txhdr->frame_type = cpu_to_le32(skb_get_queue_mapping(skb) + 4); | 601 | txhdr->hw_queue = skb_get_queue_mapping(skb) + 4; |
600 | txhdr->magic4 = 0; | 602 | txhdr->tx_antenna = (info->antenna_sel_tx == 0) ? |
601 | txhdr->antenna = (info->antenna_sel_tx == 0) ? | ||
602 | 2 : info->antenna_sel_tx - 1; | 603 | 2 : info->antenna_sel_tx - 1; |
603 | txhdr->output_power = 0x7f; // HW Maximum | 604 | txhdr->output_power = 0x7f; // HW Maximum |
604 | txhdr->magic5 = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? | 605 | txhdr->cts_rate = (info->flags & IEEE80211_TX_CTL_NO_ACK) ? |
605 | 0 : ((rate > 0x3) ? cpu_to_le32(0x33) : cpu_to_le32(0x23)); | 606 | 0 : cts_rate; |
606 | if (padding) | 607 | if (padding) |
607 | txhdr->align[0] = padding; | 608 | txhdr->align[0] = padding; |
608 | 609 | ||
@@ -836,10 +837,21 @@ static int p54_start(struct ieee80211_hw *dev) | |||
836 | struct p54_common *priv = dev->priv; | 837 | struct p54_common *priv = dev->priv; |
837 | int err; | 838 | int err; |
838 | 839 | ||
840 | if (!priv->cached_vdcf) { | ||
841 | priv->cached_vdcf = kzalloc(sizeof(struct p54_tx_control_vdcf)+ | ||
842 | priv->tx_hdr_len + sizeof(struct p54_control_hdr), | ||
843 | GFP_KERNEL); | ||
844 | |||
845 | if (!priv->cached_vdcf) | ||
846 | return -ENOMEM; | ||
847 | } | ||
848 | |||
839 | err = priv->open(dev); | 849 | err = priv->open(dev); |
840 | if (!err) | 850 | if (!err) |
841 | priv->mode = IEEE80211_IF_TYPE_MNTR; | 851 | priv->mode = IEEE80211_IF_TYPE_MNTR; |
842 | 852 | ||
853 | p54_init_vdcf(dev); | ||
854 | |||
843 | return err; | 855 | return err; |
844 | } | 856 | } |
845 | 857 | ||
@@ -1019,15 +1031,6 @@ struct ieee80211_hw *p54_init_common(size_t priv_data_len) | |||
1019 | dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 + | 1031 | dev->extra_tx_headroom = sizeof(struct p54_control_hdr) + 4 + |
1020 | sizeof(struct p54_tx_control_allocdata); | 1032 | sizeof(struct p54_tx_control_allocdata); |
1021 | 1033 | ||
1022 | priv->cached_vdcf = kzalloc(sizeof(struct p54_tx_control_vdcf) + | ||
1023 | priv->tx_hdr_len + sizeof(struct p54_control_hdr), GFP_KERNEL); | ||
1024 | |||
1025 | if (!priv->cached_vdcf) { | ||
1026 | ieee80211_free_hw(dev); | ||
1027 | return NULL; | ||
1028 | } | ||
1029 | |||
1030 | p54_init_vdcf(dev); | ||
1031 | mutex_init(&priv->conf_mutex); | 1034 | mutex_init(&priv->conf_mutex); |
1032 | 1035 | ||
1033 | return dev; | 1036 | return dev; |
diff --git a/drivers/net/wireless/p54/p54common.h b/drivers/net/wireless/p54/p54common.h index 2245fcce92dc..8db6c0e8e540 100644 --- a/drivers/net/wireless/p54/p54common.h +++ b/drivers/net/wireless/p54/p54common.h | |||
@@ -183,16 +183,16 @@ struct p54_frame_sent_hdr { | |||
183 | 183 | ||
184 | struct p54_tx_control_allocdata { | 184 | struct p54_tx_control_allocdata { |
185 | u8 rateset[8]; | 185 | u8 rateset[8]; |
186 | u16 padding; | 186 | u8 unalloc0[2]; |
187 | u8 wep_key_present; | 187 | u8 key_type; |
188 | u8 wep_key_len; | 188 | u8 key_len; |
189 | u8 wep_key[16]; | 189 | u8 key[16]; |
190 | __le32 frame_type; | 190 | u8 hw_queue; |
191 | u32 padding2; | 191 | u8 unalloc1[9]; |
192 | __le16 magic4; | 192 | u8 tx_antenna; |
193 | u8 antenna; | ||
194 | u8 output_power; | 193 | u8 output_power; |
195 | __le32 magic5; | 194 | u8 cts_rate; |
195 | u8 unalloc2[3]; | ||
196 | u8 align[0]; | 196 | u8 align[0]; |
197 | } __attribute__ ((packed)); | 197 | } __attribute__ ((packed)); |
198 | 198 | ||
diff --git a/drivers/net/wireless/p54/p54usb.c b/drivers/net/wireless/p54/p54usb.c index 815c095ef797..cbaca23a9453 100644 --- a/drivers/net/wireless/p54/p54usb.c +++ b/drivers/net/wireless/p54/p54usb.c | |||
@@ -109,7 +109,17 @@ static void p54u_rx_cb(struct urb *urb) | |||
109 | urb->context = skb; | 109 | urb->context = skb; |
110 | skb_queue_tail(&priv->rx_queue, skb); | 110 | skb_queue_tail(&priv->rx_queue, skb); |
111 | } else { | 111 | } else { |
112 | if (!priv->hw_type) | ||
113 | skb_push(skb, sizeof(struct net2280_tx_hdr)); | ||
114 | |||
115 | skb_reset_tail_pointer(skb); | ||
112 | skb_trim(skb, 0); | 116 | skb_trim(skb, 0); |
117 | if (urb->transfer_buffer != skb_tail_pointer(skb)) { | ||
118 | /* this should not happen */ | ||
119 | WARN_ON(1); | ||
120 | urb->transfer_buffer = skb_tail_pointer(skb); | ||
121 | } | ||
122 | |||
113 | skb_queue_tail(&priv->rx_queue, skb); | 123 | skb_queue_tail(&priv->rx_queue, skb); |
114 | } | 124 | } |
115 | 125 | ||
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.h b/drivers/net/wireless/rt2x00/rt2x00queue.h index a4a8c57004db..ff78e52ce43c 100644 --- a/drivers/net/wireless/rt2x00/rt2x00queue.h +++ b/drivers/net/wireless/rt2x00/rt2x00queue.h | |||
@@ -173,10 +173,10 @@ struct rxdone_entry_desc { | |||
173 | * frame transmission failed due to excessive retries. | 173 | * frame transmission failed due to excessive retries. |
174 | */ | 174 | */ |
175 | enum txdone_entry_desc_flags { | 175 | enum txdone_entry_desc_flags { |
176 | TXDONE_UNKNOWN = 1 << 0, | 176 | TXDONE_UNKNOWN, |
177 | TXDONE_SUCCESS = 1 << 1, | 177 | TXDONE_SUCCESS, |
178 | TXDONE_FAILURE = 1 << 2, | 178 | TXDONE_FAILURE, |
179 | TXDONE_EXCESSIVE_RETRY = 1 << 3, | 179 | TXDONE_EXCESSIVE_RETRY, |
180 | }; | 180 | }; |
181 | 181 | ||
182 | /** | 182 | /** |
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c index 8d76bb2e0312..2050227ea530 100644 --- a/drivers/net/wireless/rt2x00/rt2x00usb.c +++ b/drivers/net/wireless/rt2x00/rt2x00usb.c | |||
@@ -181,6 +181,7 @@ static void rt2x00usb_interrupt_txdone(struct urb *urb) | |||
181 | * (Only indirectly by looking at the failed TX counters | 181 | * (Only indirectly by looking at the failed TX counters |
182 | * in the register). | 182 | * in the register). |
183 | */ | 183 | */ |
184 | txdesc.flags = 0; | ||
184 | if (!urb->status) | 185 | if (!urb->status) |
185 | __set_bit(TXDONE_UNKNOWN, &txdesc.flags); | 186 | __set_bit(TXDONE_UNKNOWN, &txdesc.flags); |
186 | else | 187 | else |
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index 57376fb993ed..ca5deb6244e6 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c | |||
@@ -40,6 +40,7 @@ static struct usb_device_id rtl8187_table[] __devinitdata = { | |||
40 | /* Netgear */ | 40 | /* Netgear */ |
41 | {USB_DEVICE(0x0846, 0x6100), .driver_info = DEVICE_RTL8187}, | 41 | {USB_DEVICE(0x0846, 0x6100), .driver_info = DEVICE_RTL8187}, |
42 | {USB_DEVICE(0x0846, 0x6a00), .driver_info = DEVICE_RTL8187}, | 42 | {USB_DEVICE(0x0846, 0x6a00), .driver_info = DEVICE_RTL8187}, |
43 | {USB_DEVICE(0x0846, 0x4260), .driver_info = DEVICE_RTL8187B}, | ||
43 | /* HP */ | 44 | /* HP */ |
44 | {USB_DEVICE(0x03f0, 0xca02), .driver_info = DEVICE_RTL8187}, | 45 | {USB_DEVICE(0x03f0, 0xca02), .driver_info = DEVICE_RTL8187}, |
45 | /* Sitecom */ | 46 | /* Sitecom */ |
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index d831a2beff39..87ab2443e66d 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -1165,15 +1165,19 @@ EXPORT_SYMBOL(ssb_dma_translation); | |||
1165 | 1165 | ||
1166 | int ssb_dma_set_mask(struct ssb_device *dev, u64 mask) | 1166 | int ssb_dma_set_mask(struct ssb_device *dev, u64 mask) |
1167 | { | 1167 | { |
1168 | #ifdef CONFIG_SSB_PCIHOST | ||
1168 | int err; | 1169 | int err; |
1170 | #endif | ||
1169 | 1171 | ||
1170 | switch (dev->bus->bustype) { | 1172 | switch (dev->bus->bustype) { |
1171 | case SSB_BUSTYPE_PCI: | 1173 | case SSB_BUSTYPE_PCI: |
1174 | #ifdef CONFIG_SSB_PCIHOST | ||
1172 | err = pci_set_dma_mask(dev->bus->host_pci, mask); | 1175 | err = pci_set_dma_mask(dev->bus->host_pci, mask); |
1173 | if (err) | 1176 | if (err) |
1174 | return err; | 1177 | return err; |
1175 | err = pci_set_consistent_dma_mask(dev->bus->host_pci, mask); | 1178 | err = pci_set_consistent_dma_mask(dev->bus->host_pci, mask); |
1176 | return err; | 1179 | return err; |
1180 | #endif | ||
1177 | case SSB_BUSTYPE_SSB: | 1181 | case SSB_BUSTYPE_SSB: |
1178 | return dma_set_mask(dev->dev, mask); | 1182 | return dma_set_mask(dev->dev, mask); |
1179 | default: | 1183 | default: |
@@ -1188,6 +1192,7 @@ void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | |||
1188 | { | 1192 | { |
1189 | switch (dev->bus->bustype) { | 1193 | switch (dev->bus->bustype) { |
1190 | case SSB_BUSTYPE_PCI: | 1194 | case SSB_BUSTYPE_PCI: |
1195 | #ifdef CONFIG_SSB_PCIHOST | ||
1191 | if (gfp_flags & GFP_DMA) { | 1196 | if (gfp_flags & GFP_DMA) { |
1192 | /* Workaround: The PCI API does not support passing | 1197 | /* Workaround: The PCI API does not support passing |
1193 | * a GFP flag. */ | 1198 | * a GFP flag. */ |
@@ -1195,6 +1200,7 @@ void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size, | |||
1195 | size, dma_handle, gfp_flags); | 1200 | size, dma_handle, gfp_flags); |
1196 | } | 1201 | } |
1197 | return pci_alloc_consistent(dev->bus->host_pci, size, dma_handle); | 1202 | return pci_alloc_consistent(dev->bus->host_pci, size, dma_handle); |
1203 | #endif | ||
1198 | case SSB_BUSTYPE_SSB: | 1204 | case SSB_BUSTYPE_SSB: |
1199 | return dma_alloc_coherent(dev->dev, size, dma_handle, gfp_flags); | 1205 | return dma_alloc_coherent(dev->dev, size, dma_handle, gfp_flags); |
1200 | default: | 1206 | default: |
@@ -1210,6 +1216,7 @@ void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | |||
1210 | { | 1216 | { |
1211 | switch (dev->bus->bustype) { | 1217 | switch (dev->bus->bustype) { |
1212 | case SSB_BUSTYPE_PCI: | 1218 | case SSB_BUSTYPE_PCI: |
1219 | #ifdef CONFIG_SSB_PCIHOST | ||
1213 | if (gfp_flags & GFP_DMA) { | 1220 | if (gfp_flags & GFP_DMA) { |
1214 | /* Workaround: The PCI API does not support passing | 1221 | /* Workaround: The PCI API does not support passing |
1215 | * a GFP flag. */ | 1222 | * a GFP flag. */ |
@@ -1220,6 +1227,7 @@ void ssb_dma_free_consistent(struct ssb_device *dev, size_t size, | |||
1220 | pci_free_consistent(dev->bus->host_pci, size, | 1227 | pci_free_consistent(dev->bus->host_pci, size, |
1221 | vaddr, dma_handle); | 1228 | vaddr, dma_handle); |
1222 | return; | 1229 | return; |
1230 | #endif | ||
1223 | case SSB_BUSTYPE_SSB: | 1231 | case SSB_BUSTYPE_SSB: |
1224 | dma_free_coherent(dev->dev, size, vaddr, dma_handle); | 1232 | dma_free_coherent(dev->dev, size, vaddr, dma_handle); |
1225 | return; | 1233 | return; |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 4c6307ad9fdb..8529f57ba263 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) | 45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) |
46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) | 46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) |
47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) | 47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) |
48 | #define TUNGETIFF _IOR('T', 210, unsigned int) | ||
48 | 49 | ||
49 | /* TUNSETIFF ifr flags */ | 50 | /* TUNSETIFF ifr flags */ |
50 | #define IFF_TUN 0x0001 | 51 | #define IFF_TUN 0x0001 |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 358661c9990e..909923717830 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1452,6 +1452,10 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from, | |||
1452 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | 1452 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, |
1453 | int hlen, | 1453 | int hlen, |
1454 | struct iovec *iov); | 1454 | struct iovec *iov); |
1455 | extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, | ||
1456 | int offset, | ||
1457 | struct iovec *from, | ||
1458 | int len); | ||
1455 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1459 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1456 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1460 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1457 | unsigned int flags); | 1461 | unsigned int flags); |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b397e4d984c7..ff137fd7714f 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -708,10 +708,7 @@ enum ieee80211_tkip_key_type { | |||
708 | * rely on the host system for such buffering. This option is used | 708 | * rely on the host system for such buffering. This option is used |
709 | * to configure the IEEE 802.11 upper layer to buffer broadcast and | 709 | * to configure the IEEE 802.11 upper layer to buffer broadcast and |
710 | * multicast frames when there are power saving stations so that | 710 | * multicast frames when there are power saving stations so that |
711 | * the driver can fetch them with ieee80211_get_buffered_bc(). Note | 711 | * the driver can fetch them with ieee80211_get_buffered_bc(). |
712 | * that not setting this flag works properly only when the | ||
713 | * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because | ||
714 | * otherwise the stack will not know when the DTIM beacon was sent. | ||
715 | * | 712 | * |
716 | * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE: | 713 | * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE: |
717 | * Hardware is not capable of short slot operation on the 2.4 GHz band. | 714 | * Hardware is not capable of short slot operation on the 2.4 GHz band. |
@@ -1099,10 +1096,8 @@ enum ieee80211_ampdu_mlme_action { | |||
1099 | * See the section "Frame filtering" for more information. | 1096 | * See the section "Frame filtering" for more information. |
1100 | * This callback must be implemented and atomic. | 1097 | * This callback must be implemented and atomic. |
1101 | * | 1098 | * |
1102 | * @set_tim: Set TIM bit. If the hardware/firmware takes care of beacon | 1099 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
1103 | * generation (that is, %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is set) | 1100 | * must be set or cleared for a given AID. Must be atomic. |
1104 | * mac80211 calls this function when a TIM bit must be set or cleared | ||
1105 | * for a given AID. Must be atomic. | ||
1106 | * | 1101 | * |
1107 | * @set_key: See the section "Hardware crypto acceleration" | 1102 | * @set_key: See the section "Hardware crypto acceleration" |
1108 | * This callback can sleep, and is only called between add_interface | 1103 | * This callback can sleep, and is only called between add_interface |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index a7abfda3e447..84d25f2e6188 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -27,6 +27,7 @@ enum qdisc_state_t | |||
27 | { | 27 | { |
28 | __QDISC_STATE_RUNNING, | 28 | __QDISC_STATE_RUNNING, |
29 | __QDISC_STATE_SCHED, | 29 | __QDISC_STATE_SCHED, |
30 | __QDISC_STATE_DEACTIVATED, | ||
30 | }; | 31 | }; |
31 | 32 | ||
32 | struct qdisc_size_table { | 33 | struct qdisc_size_table { |
@@ -60,7 +61,6 @@ struct Qdisc | |||
60 | struct gnet_stats_basic bstats; | 61 | struct gnet_stats_basic bstats; |
61 | struct gnet_stats_queue qstats; | 62 | struct gnet_stats_queue qstats; |
62 | struct gnet_stats_rate_est rate_est; | 63 | struct gnet_stats_rate_est rate_est; |
63 | struct rcu_head q_rcu; | ||
64 | int (*reshape_fail)(struct sk_buff *skb, | 64 | int (*reshape_fail)(struct sk_buff *skb, |
65 | struct Qdisc *q); | 65 | struct Qdisc *q); |
66 | 66 | ||
diff --git a/net/bridge/br_device.c b/net/bridge/br_device.c index 9b58d70b0e7d..4f52c3d50ebe 100644 --- a/net/bridge/br_device.c +++ b/net/bridge/br_device.c | |||
@@ -148,11 +148,16 @@ static int br_set_tx_csum(struct net_device *dev, u32 data) | |||
148 | } | 148 | } |
149 | 149 | ||
150 | static struct ethtool_ops br_ethtool_ops = { | 150 | static struct ethtool_ops br_ethtool_ops = { |
151 | .get_drvinfo = br_getinfo, | 151 | .get_drvinfo = br_getinfo, |
152 | .get_link = ethtool_op_get_link, | 152 | .get_link = ethtool_op_get_link, |
153 | .set_sg = br_set_sg, | 153 | .get_tx_csum = ethtool_op_get_tx_csum, |
154 | .set_tx_csum = br_set_tx_csum, | 154 | .set_tx_csum = br_set_tx_csum, |
155 | .set_tso = br_set_tso, | 155 | .get_sg = ethtool_op_get_sg, |
156 | .set_sg = br_set_sg, | ||
157 | .get_tso = ethtool_op_get_tso, | ||
158 | .set_tso = br_set_tso, | ||
159 | .get_ufo = ethtool_op_get_ufo, | ||
160 | .get_flags = ethtool_op_get_flags, | ||
156 | }; | 161 | }; |
157 | 162 | ||
158 | void br_dev_setup(struct net_device *dev) | 163 | void br_dev_setup(struct net_device *dev) |
diff --git a/net/core/datagram.c b/net/core/datagram.c index dd61dcad6019..52f577a0f544 100644 --- a/net/core/datagram.c +++ b/net/core/datagram.c | |||
@@ -339,6 +339,93 @@ fault: | |||
339 | return -EFAULT; | 339 | return -EFAULT; |
340 | } | 340 | } |
341 | 341 | ||
342 | /** | ||
343 | * skb_copy_datagram_from_iovec - Copy a datagram from an iovec. | ||
344 | * @skb: buffer to copy | ||
345 | * @offset: offset in the buffer to start copying to | ||
346 | * @from: io vector to copy to | ||
347 | * @len: amount of data to copy to buffer from iovec | ||
348 | * | ||
349 | * Returns 0 or -EFAULT. | ||
350 | * Note: the iovec is modified during the copy. | ||
351 | */ | ||
352 | int skb_copy_datagram_from_iovec(struct sk_buff *skb, int offset, | ||
353 | struct iovec *from, int len) | ||
354 | { | ||
355 | int start = skb_headlen(skb); | ||
356 | int i, copy = start - offset; | ||
357 | |||
358 | /* Copy header. */ | ||
359 | if (copy > 0) { | ||
360 | if (copy > len) | ||
361 | copy = len; | ||
362 | if (memcpy_fromiovec(skb->data + offset, from, copy)) | ||
363 | goto fault; | ||
364 | if ((len -= copy) == 0) | ||
365 | return 0; | ||
366 | offset += copy; | ||
367 | } | ||
368 | |||
369 | /* Copy paged appendix. Hmm... why does this look so complicated? */ | ||
370 | for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { | ||
371 | int end; | ||
372 | |||
373 | WARN_ON(start > offset + len); | ||
374 | |||
375 | end = start + skb_shinfo(skb)->frags[i].size; | ||
376 | if ((copy = end - offset) > 0) { | ||
377 | int err; | ||
378 | u8 *vaddr; | ||
379 | skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; | ||
380 | struct page *page = frag->page; | ||
381 | |||
382 | if (copy > len) | ||
383 | copy = len; | ||
384 | vaddr = kmap(page); | ||
385 | err = memcpy_fromiovec(vaddr + frag->page_offset + | ||
386 | offset - start, from, copy); | ||
387 | kunmap(page); | ||
388 | if (err) | ||
389 | goto fault; | ||
390 | |||
391 | if (!(len -= copy)) | ||
392 | return 0; | ||
393 | offset += copy; | ||
394 | } | ||
395 | start = end; | ||
396 | } | ||
397 | |||
398 | if (skb_shinfo(skb)->frag_list) { | ||
399 | struct sk_buff *list = skb_shinfo(skb)->frag_list; | ||
400 | |||
401 | for (; list; list = list->next) { | ||
402 | int end; | ||
403 | |||
404 | WARN_ON(start > offset + len); | ||
405 | |||
406 | end = start + list->len; | ||
407 | if ((copy = end - offset) > 0) { | ||
408 | if (copy > len) | ||
409 | copy = len; | ||
410 | if (skb_copy_datagram_from_iovec(list, | ||
411 | offset - start, | ||
412 | from, copy)) | ||
413 | goto fault; | ||
414 | if ((len -= copy) == 0) | ||
415 | return 0; | ||
416 | offset += copy; | ||
417 | } | ||
418 | start = end; | ||
419 | } | ||
420 | } | ||
421 | if (!len) | ||
422 | return 0; | ||
423 | |||
424 | fault: | ||
425 | return -EFAULT; | ||
426 | } | ||
427 | EXPORT_SYMBOL(skb_copy_datagram_from_iovec); | ||
428 | |||
342 | static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, | 429 | static int skb_copy_and_csum_datagram(const struct sk_buff *skb, int offset, |
343 | u8 __user *to, int len, | 430 | u8 __user *to, int len, |
344 | __wsum *csump) | 431 | __wsum *csump) |
diff --git a/net/core/dev.c b/net/core/dev.c index 600bb23c4c2e..8d133802372b 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1339,19 +1339,23 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) | |||
1339 | } | 1339 | } |
1340 | 1340 | ||
1341 | 1341 | ||
1342 | void __netif_schedule(struct Qdisc *q) | 1342 | static inline void __netif_reschedule(struct Qdisc *q) |
1343 | { | 1343 | { |
1344 | if (!test_and_set_bit(__QDISC_STATE_SCHED, &q->state)) { | 1344 | struct softnet_data *sd; |
1345 | struct softnet_data *sd; | 1345 | unsigned long flags; |
1346 | unsigned long flags; | ||
1347 | 1346 | ||
1348 | local_irq_save(flags); | 1347 | local_irq_save(flags); |
1349 | sd = &__get_cpu_var(softnet_data); | 1348 | sd = &__get_cpu_var(softnet_data); |
1350 | q->next_sched = sd->output_queue; | 1349 | q->next_sched = sd->output_queue; |
1351 | sd->output_queue = q; | 1350 | sd->output_queue = q; |
1352 | raise_softirq_irqoff(NET_TX_SOFTIRQ); | 1351 | raise_softirq_irqoff(NET_TX_SOFTIRQ); |
1353 | local_irq_restore(flags); | 1352 | local_irq_restore(flags); |
1354 | } | 1353 | } |
1354 | |||
1355 | void __netif_schedule(struct Qdisc *q) | ||
1356 | { | ||
1357 | if (!test_and_set_bit(__QDISC_STATE_SCHED, &q->state)) | ||
1358 | __netif_reschedule(q); | ||
1355 | } | 1359 | } |
1356 | EXPORT_SYMBOL(__netif_schedule); | 1360 | EXPORT_SYMBOL(__netif_schedule); |
1357 | 1361 | ||
@@ -1800,9 +1804,13 @@ gso: | |||
1800 | 1804 | ||
1801 | spin_lock(root_lock); | 1805 | spin_lock(root_lock); |
1802 | 1806 | ||
1803 | rc = qdisc_enqueue_root(skb, q); | 1807 | if (unlikely(test_bit(__QDISC_STATE_DEACTIVATED, &q->state))) { |
1804 | qdisc_run(q); | 1808 | kfree_skb(skb); |
1805 | 1809 | rc = NET_XMIT_DROP; | |
1810 | } else { | ||
1811 | rc = qdisc_enqueue_root(skb, q); | ||
1812 | qdisc_run(q); | ||
1813 | } | ||
1806 | spin_unlock(root_lock); | 1814 | spin_unlock(root_lock); |
1807 | 1815 | ||
1808 | goto out; | 1816 | goto out; |
@@ -1974,15 +1982,15 @@ static void net_tx_action(struct softirq_action *h) | |||
1974 | 1982 | ||
1975 | head = head->next_sched; | 1983 | head = head->next_sched; |
1976 | 1984 | ||
1977 | smp_mb__before_clear_bit(); | ||
1978 | clear_bit(__QDISC_STATE_SCHED, &q->state); | ||
1979 | |||
1980 | root_lock = qdisc_lock(q); | 1985 | root_lock = qdisc_lock(q); |
1981 | if (spin_trylock(root_lock)) { | 1986 | if (spin_trylock(root_lock)) { |
1987 | smp_mb__before_clear_bit(); | ||
1988 | clear_bit(__QDISC_STATE_SCHED, | ||
1989 | &q->state); | ||
1982 | qdisc_run(q); | 1990 | qdisc_run(q); |
1983 | spin_unlock(root_lock); | 1991 | spin_unlock(root_lock); |
1984 | } else { | 1992 | } else { |
1985 | __netif_schedule(q); | 1993 | __netif_reschedule(q); |
1986 | } | 1994 | } |
1987 | } | 1995 | } |
1988 | } | 1996 | } |
@@ -2084,7 +2092,8 @@ static int ing_filter(struct sk_buff *skb) | |||
2084 | q = rxq->qdisc; | 2092 | q = rxq->qdisc; |
2085 | if (q != &noop_qdisc) { | 2093 | if (q != &noop_qdisc) { |
2086 | spin_lock(qdisc_lock(q)); | 2094 | spin_lock(qdisc_lock(q)); |
2087 | result = qdisc_enqueue_root(skb, q); | 2095 | if (likely(!test_bit(__QDISC_STATE_DEACTIVATED, &q->state))) |
2096 | result = qdisc_enqueue_root(skb, q); | ||
2088 | spin_unlock(qdisc_lock(q)); | 2097 | spin_unlock(qdisc_lock(q)); |
2089 | } | 2098 | } |
2090 | 2099 | ||
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 84640172d65d..ca1ccdf1ef76 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
@@ -2256,14 +2256,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
2256 | segs = nskb; | 2256 | segs = nskb; |
2257 | tail = nskb; | 2257 | tail = nskb; |
2258 | 2258 | ||
2259 | nskb->dev = skb->dev; | 2259 | __copy_skb_header(nskb, skb); |
2260 | skb_copy_queue_mapping(nskb, skb); | ||
2261 | nskb->priority = skb->priority; | ||
2262 | nskb->protocol = skb->protocol; | ||
2263 | nskb->vlan_tci = skb->vlan_tci; | ||
2264 | nskb->dst = dst_clone(skb->dst); | ||
2265 | memcpy(nskb->cb, skb->cb, sizeof(skb->cb)); | ||
2266 | nskb->pkt_type = skb->pkt_type; | ||
2267 | nskb->mac_len = skb->mac_len; | 2260 | nskb->mac_len = skb->mac_len; |
2268 | 2261 | ||
2269 | skb_reserve(nskb, headroom); | 2262 | skb_reserve(nskb, headroom); |
@@ -2274,6 +2267,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
2274 | skb_copy_from_linear_data(skb, skb_put(nskb, doffset), | 2267 | skb_copy_from_linear_data(skb, skb_put(nskb, doffset), |
2275 | doffset); | 2268 | doffset); |
2276 | if (!sg) { | 2269 | if (!sg) { |
2270 | nskb->ip_summed = CHECKSUM_NONE; | ||
2277 | nskb->csum = skb_copy_and_csum_bits(skb, offset, | 2271 | nskb->csum = skb_copy_and_csum_bits(skb, offset, |
2278 | skb_put(nskb, len), | 2272 | skb_put(nskb, len), |
2279 | len, 0); | 2273 | len, 0); |
@@ -2283,8 +2277,6 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features) | |||
2283 | frag = skb_shinfo(nskb)->frags; | 2277 | frag = skb_shinfo(nskb)->frags; |
2284 | k = 0; | 2278 | k = 0; |
2285 | 2279 | ||
2286 | nskb->ip_summed = CHECKSUM_PARTIAL; | ||
2287 | nskb->csum = skb->csum; | ||
2288 | skb_copy_from_linear_data_offset(skb, offset, | 2280 | skb_copy_from_linear_data_offset(skb, offset, |
2289 | skb_put(nskb, hsize), hsize); | 2281 | skb_put(nskb, hsize), hsize); |
2290 | 2282 | ||
diff --git a/net/dccp/input.c b/net/dccp/input.c index df2f110df94a..803933ab396d 100644 --- a/net/dccp/input.c +++ b/net/dccp/input.c | |||
@@ -411,12 +411,6 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, | |||
411 | struct dccp_sock *dp = dccp_sk(sk); | 411 | struct dccp_sock *dp = dccp_sk(sk); |
412 | long tstamp = dccp_timestamp(); | 412 | long tstamp = dccp_timestamp(); |
413 | 413 | ||
414 | /* Stop the REQUEST timer */ | ||
415 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); | ||
416 | WARN_ON(sk->sk_send_head == NULL); | ||
417 | __kfree_skb(sk->sk_send_head); | ||
418 | sk->sk_send_head = NULL; | ||
419 | |||
420 | if (!between48(DCCP_SKB_CB(skb)->dccpd_ack_seq, | 414 | if (!between48(DCCP_SKB_CB(skb)->dccpd_ack_seq, |
421 | dp->dccps_awl, dp->dccps_awh)) { | 415 | dp->dccps_awl, dp->dccps_awh)) { |
422 | dccp_pr_debug("invalid ackno: S.AWL=%llu, " | 416 | dccp_pr_debug("invalid ackno: S.AWL=%llu, " |
@@ -441,6 +435,12 @@ static int dccp_rcv_request_sent_state_process(struct sock *sk, | |||
441 | DCCP_ACKVEC_STATE_RECEIVED)) | 435 | DCCP_ACKVEC_STATE_RECEIVED)) |
442 | goto out_invalid_packet; /* FIXME: change error code */ | 436 | goto out_invalid_packet; /* FIXME: change error code */ |
443 | 437 | ||
438 | /* Stop the REQUEST timer */ | ||
439 | inet_csk_clear_xmit_timer(sk, ICSK_TIME_RETRANS); | ||
440 | WARN_ON(sk->sk_send_head == NULL); | ||
441 | kfree_skb(sk->sk_send_head); | ||
442 | sk->sk_send_head = NULL; | ||
443 | |||
444 | dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; | 444 | dp->dccps_isr = DCCP_SKB_CB(skb)->dccpd_seq; |
445 | dccp_update_gsr(sk, dp->dccps_isr); | 445 | dccp_update_gsr(sk, dp->dccps_isr); |
446 | /* | 446 | /* |
diff --git a/net/ipv4/netfilter/ipt_addrtype.c b/net/ipv4/netfilter/ipt_addrtype.c index 49587a497229..462a22c97877 100644 --- a/net/ipv4/netfilter/ipt_addrtype.c +++ b/net/ipv4/netfilter/ipt_addrtype.c | |||
@@ -70,7 +70,7 @@ addrtype_mt_v1(const struct sk_buff *skb, const struct net_device *in, | |||
70 | (info->flags & IPT_ADDRTYPE_INVERT_SOURCE); | 70 | (info->flags & IPT_ADDRTYPE_INVERT_SOURCE); |
71 | if (ret && info->dest) | 71 | if (ret && info->dest) |
72 | ret &= match_type(dev, iph->daddr, info->dest) ^ | 72 | ret &= match_type(dev, iph->daddr, info->dest) ^ |
73 | (info->flags & IPT_ADDRTYPE_INVERT_DEST); | 73 | !!(info->flags & IPT_ADDRTYPE_INVERT_DEST); |
74 | return ret; | 74 | return ret; |
75 | } | 75 | } |
76 | 76 | ||
diff --git a/net/ipv4/netfilter/nf_nat_proto_common.c b/net/ipv4/netfilter/nf_nat_proto_common.c index 91537f11273f..6c4f11f51446 100644 --- a/net/ipv4/netfilter/nf_nat_proto_common.c +++ b/net/ipv4/netfilter/nf_nat_proto_common.c | |||
@@ -73,9 +73,13 @@ bool nf_nat_proto_unique_tuple(struct nf_conntrack_tuple *tuple, | |||
73 | range_size = ntohs(range->max.all) - min + 1; | 73 | range_size = ntohs(range->max.all) - min + 1; |
74 | } | 74 | } |
75 | 75 | ||
76 | off = *rover; | ||
77 | if (range->flags & IP_NAT_RANGE_PROTO_RANDOM) | 76 | if (range->flags & IP_NAT_RANGE_PROTO_RANDOM) |
78 | off = net_random(); | 77 | off = secure_ipv4_port_ephemeral(tuple->src.u3.ip, tuple->dst.u3.ip, |
78 | maniptype == IP_NAT_MANIP_SRC | ||
79 | ? tuple->dst.u.all | ||
80 | : tuple->src.u.all); | ||
81 | else | ||
82 | off = *rover; | ||
79 | 83 | ||
80 | for (i = 0; i < range_size; i++, off++) { | 84 | for (i = 0; i < range_size; i++, off++) { |
81 | *portptr = htons(min + off % range_size); | 85 | *portptr = htons(min + off % range_size); |
diff --git a/net/ipv6/ipv6_sockglue.c b/net/ipv6/ipv6_sockglue.c index 741cfcd96f88..4e5eac301f91 100644 --- a/net/ipv6/ipv6_sockglue.c +++ b/net/ipv6/ipv6_sockglue.c | |||
@@ -911,7 +911,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
911 | } else { | 911 | } else { |
912 | if (np->rxopt.bits.rxinfo) { | 912 | if (np->rxopt.bits.rxinfo) { |
913 | struct in6_pktinfo src_info; | 913 | struct in6_pktinfo src_info; |
914 | src_info.ipi6_ifindex = np->mcast_oif; | 914 | src_info.ipi6_ifindex = np->mcast_oif ? np->mcast_oif : sk->sk_bound_dev_if; |
915 | ipv6_addr_copy(&src_info.ipi6_addr, &np->daddr); | 915 | ipv6_addr_copy(&src_info.ipi6_addr, &np->daddr); |
916 | put_cmsg(&msg, SOL_IPV6, IPV6_PKTINFO, sizeof(src_info), &src_info); | 916 | put_cmsg(&msg, SOL_IPV6, IPV6_PKTINFO, sizeof(src_info), &src_info); |
917 | } | 917 | } |
@@ -921,7 +921,7 @@ static int do_ipv6_getsockopt(struct sock *sk, int level, int optname, | |||
921 | } | 921 | } |
922 | if (np->rxopt.bits.rxoinfo) { | 922 | if (np->rxopt.bits.rxoinfo) { |
923 | struct in6_pktinfo src_info; | 923 | struct in6_pktinfo src_info; |
924 | src_info.ipi6_ifindex = np->mcast_oif; | 924 | src_info.ipi6_ifindex = np->mcast_oif ? np->mcast_oif : sk->sk_bound_dev_if; |
925 | ipv6_addr_copy(&src_info.ipi6_addr, &np->daddr); | 925 | ipv6_addr_copy(&src_info.ipi6_addr, &np->daddr); |
926 | put_cmsg(&msg, SOL_IPV6, IPV6_2292PKTINFO, sizeof(src_info), &src_info); | 926 | put_cmsg(&msg, SOL_IPV6, IPV6_2292PKTINFO, sizeof(src_info), &src_info); |
927 | } | 927 | } |
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index e1d11c9b6729..1e97fb9fb34b 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c | |||
@@ -2103,6 +2103,8 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata, | |||
2103 | rcu_read_unlock(); | 2103 | rcu_read_unlock(); |
2104 | return; | 2104 | return; |
2105 | } | 2105 | } |
2106 | /* update new sta with its last rx activity */ | ||
2107 | sta->last_rx = jiffies; | ||
2106 | } | 2108 | } |
2107 | 2109 | ||
2108 | /* | 2110 | /* |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 105a616c5c78..a8752031adcb 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -968,7 +968,7 @@ ctnetlink_change_helper(struct nf_conn *ct, struct nlattr *cda[]) | |||
968 | /* need to zero data of old helper */ | 968 | /* need to zero data of old helper */ |
969 | memset(&help->help, 0, sizeof(help->help)); | 969 | memset(&help->help, 0, sizeof(help->help)); |
970 | } else { | 970 | } else { |
971 | help = nf_ct_helper_ext_add(ct, GFP_KERNEL); | 971 | help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); |
972 | if (help == NULL) | 972 | if (help == NULL) |
973 | return -ENOMEM; | 973 | return -ENOMEM; |
974 | } | 974 | } |
@@ -1136,16 +1136,33 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1136 | ct->timeout.expires = jiffies + ct->timeout.expires * HZ; | 1136 | ct->timeout.expires = jiffies + ct->timeout.expires * HZ; |
1137 | ct->status |= IPS_CONFIRMED; | 1137 | ct->status |= IPS_CONFIRMED; |
1138 | 1138 | ||
1139 | rcu_read_lock(); | ||
1140 | helper = __nf_ct_helper_find(rtuple); | ||
1141 | if (helper) { | ||
1142 | help = nf_ct_helper_ext_add(ct, GFP_ATOMIC); | ||
1143 | if (help == NULL) { | ||
1144 | rcu_read_unlock(); | ||
1145 | err = -ENOMEM; | ||
1146 | goto err; | ||
1147 | } | ||
1148 | /* not in hash table yet so not strictly necessary */ | ||
1149 | rcu_assign_pointer(help->helper, helper); | ||
1150 | } | ||
1151 | |||
1139 | if (cda[CTA_STATUS]) { | 1152 | if (cda[CTA_STATUS]) { |
1140 | err = ctnetlink_change_status(ct, cda); | 1153 | err = ctnetlink_change_status(ct, cda); |
1141 | if (err < 0) | 1154 | if (err < 0) { |
1155 | rcu_read_unlock(); | ||
1142 | goto err; | 1156 | goto err; |
1157 | } | ||
1143 | } | 1158 | } |
1144 | 1159 | ||
1145 | if (cda[CTA_PROTOINFO]) { | 1160 | if (cda[CTA_PROTOINFO]) { |
1146 | err = ctnetlink_change_protoinfo(ct, cda); | 1161 | err = ctnetlink_change_protoinfo(ct, cda); |
1147 | if (err < 0) | 1162 | if (err < 0) { |
1163 | rcu_read_unlock(); | ||
1148 | goto err; | 1164 | goto err; |
1165 | } | ||
1149 | } | 1166 | } |
1150 | 1167 | ||
1151 | nf_ct_acct_ext_add(ct, GFP_KERNEL); | 1168 | nf_ct_acct_ext_add(ct, GFP_KERNEL); |
@@ -1155,19 +1172,6 @@ ctnetlink_create_conntrack(struct nlattr *cda[], | |||
1155 | ct->mark = ntohl(nla_get_be32(cda[CTA_MARK])); | 1172 | ct->mark = ntohl(nla_get_be32(cda[CTA_MARK])); |
1156 | #endif | 1173 | #endif |
1157 | 1174 | ||
1158 | rcu_read_lock(); | ||
1159 | helper = __nf_ct_helper_find(rtuple); | ||
1160 | if (helper) { | ||
1161 | help = nf_ct_helper_ext_add(ct, GFP_KERNEL); | ||
1162 | if (help == NULL) { | ||
1163 | rcu_read_unlock(); | ||
1164 | err = -ENOMEM; | ||
1165 | goto err; | ||
1166 | } | ||
1167 | /* not in hash table yet so not strictly necessary */ | ||
1168 | rcu_assign_pointer(help->helper, helper); | ||
1169 | } | ||
1170 | |||
1171 | /* setup master conntrack: this is a confirmed expectation */ | 1175 | /* setup master conntrack: this is a confirmed expectation */ |
1172 | if (master_ct) { | 1176 | if (master_ct) { |
1173 | __set_bit(IPS_EXPECTED_BIT, &ct->status); | 1177 | __set_bit(IPS_EXPECTED_BIT, &ct->status); |
diff --git a/net/rfkill/rfkill.c b/net/rfkill/rfkill.c index d2d45655cd1a..35a9994e2339 100644 --- a/net/rfkill/rfkill.c +++ b/net/rfkill/rfkill.c | |||
@@ -150,6 +150,8 @@ static void update_rfkill_state(struct rfkill *rfkill) | |||
150 | * calls and handling all the red tape such as issuing notifications | 150 | * calls and handling all the red tape such as issuing notifications |
151 | * if the call is successful. | 151 | * if the call is successful. |
152 | * | 152 | * |
153 | * Suspended devices are not touched at all, and -EAGAIN is returned. | ||
154 | * | ||
153 | * Note that the @force parameter cannot override a (possibly cached) | 155 | * Note that the @force parameter cannot override a (possibly cached) |
154 | * state of RFKILL_STATE_HARD_BLOCKED. Any device making use of | 156 | * state of RFKILL_STATE_HARD_BLOCKED. Any device making use of |
155 | * RFKILL_STATE_HARD_BLOCKED implements either get_state() or | 157 | * RFKILL_STATE_HARD_BLOCKED implements either get_state() or |
@@ -168,6 +170,9 @@ static int rfkill_toggle_radio(struct rfkill *rfkill, | |||
168 | int retval = 0; | 170 | int retval = 0; |
169 | enum rfkill_state oldstate, newstate; | 171 | enum rfkill_state oldstate, newstate; |
170 | 172 | ||
173 | if (unlikely(rfkill->dev.power.power_state.event & PM_EVENT_SLEEP)) | ||
174 | return -EBUSY; | ||
175 | |||
171 | oldstate = rfkill->state; | 176 | oldstate = rfkill->state; |
172 | 177 | ||
173 | if (rfkill->get_state && !force && | 178 | if (rfkill->get_state && !force && |
@@ -214,7 +219,7 @@ static int rfkill_toggle_radio(struct rfkill *rfkill, | |||
214 | * | 219 | * |
215 | * This function toggles the state of all switches of given type, | 220 | * This function toggles the state of all switches of given type, |
216 | * unless a specific switch is claimed by userspace (in which case, | 221 | * unless a specific switch is claimed by userspace (in which case, |
217 | * that switch is left alone). | 222 | * that switch is left alone) or suspended. |
218 | */ | 223 | */ |
219 | void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state) | 224 | void rfkill_switch_all(enum rfkill_type type, enum rfkill_state state) |
220 | { | 225 | { |
@@ -239,8 +244,8 @@ EXPORT_SYMBOL(rfkill_switch_all); | |||
239 | /** | 244 | /** |
240 | * rfkill_epo - emergency power off all transmitters | 245 | * rfkill_epo - emergency power off all transmitters |
241 | * | 246 | * |
242 | * This kicks all rfkill devices to RFKILL_STATE_SOFT_BLOCKED, ignoring | 247 | * This kicks all non-suspended rfkill devices to RFKILL_STATE_SOFT_BLOCKED, |
243 | * everything in its path but rfkill_mutex and rfkill->mutex. | 248 | * ignoring everything in its path but rfkill_mutex and rfkill->mutex. |
244 | */ | 249 | */ |
245 | void rfkill_epo(void) | 250 | void rfkill_epo(void) |
246 | { | 251 | { |
@@ -458,13 +463,14 @@ static int rfkill_resume(struct device *dev) | |||
458 | if (dev->power.power_state.event != PM_EVENT_ON) { | 463 | if (dev->power.power_state.event != PM_EVENT_ON) { |
459 | mutex_lock(&rfkill->mutex); | 464 | mutex_lock(&rfkill->mutex); |
460 | 465 | ||
466 | dev->power.power_state.event = PM_EVENT_ON; | ||
467 | |||
461 | /* restore radio state AND notify everybody */ | 468 | /* restore radio state AND notify everybody */ |
462 | rfkill_toggle_radio(rfkill, rfkill->state, 1); | 469 | rfkill_toggle_radio(rfkill, rfkill->state, 1); |
463 | 470 | ||
464 | mutex_unlock(&rfkill->mutex); | 471 | mutex_unlock(&rfkill->mutex); |
465 | } | 472 | } |
466 | 473 | ||
467 | dev->power.power_state = PMSG_ON; | ||
468 | return 0; | 474 | return 0; |
469 | } | 475 | } |
470 | #else | 476 | #else |
diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index c25465e5607a..9372ec41ce84 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/kmod.h> | 27 | #include <linux/kmod.h> |
28 | #include <linux/list.h> | 28 | #include <linux/list.h> |
29 | #include <linux/hrtimer.h> | 29 | #include <linux/hrtimer.h> |
30 | #include <linux/lockdep.h> | ||
30 | 31 | ||
31 | #include <net/net_namespace.h> | 32 | #include <net/net_namespace.h> |
32 | #include <net/sock.h> | 33 | #include <net/sock.h> |
@@ -426,7 +427,7 @@ static enum hrtimer_restart qdisc_watchdog(struct hrtimer *timer) | |||
426 | 427 | ||
427 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; | 428 | wd->qdisc->flags &= ~TCQ_F_THROTTLED; |
428 | smp_wmb(); | 429 | smp_wmb(); |
429 | __netif_schedule(wd->qdisc); | 430 | __netif_schedule(qdisc_root(wd->qdisc)); |
430 | 431 | ||
431 | return HRTIMER_NORESTART; | 432 | return HRTIMER_NORESTART; |
432 | } | 433 | } |
@@ -637,11 +638,8 @@ static void notify_and_destroy(struct sk_buff *skb, struct nlmsghdr *n, u32 clid | |||
637 | if (new || old) | 638 | if (new || old) |
638 | qdisc_notify(skb, n, clid, old, new); | 639 | qdisc_notify(skb, n, clid, old, new); |
639 | 640 | ||
640 | if (old) { | 641 | if (old) |
641 | spin_lock_bh(&old->q.lock); | ||
642 | qdisc_destroy(old); | 642 | qdisc_destroy(old); |
643 | spin_unlock_bh(&old->q.lock); | ||
644 | } | ||
645 | } | 643 | } |
646 | 644 | ||
647 | /* Graft qdisc "new" to class "classid" of qdisc "parent" or | 645 | /* Graft qdisc "new" to class "classid" of qdisc "parent" or |
@@ -707,6 +705,10 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, | |||
707 | return err; | 705 | return err; |
708 | } | 706 | } |
709 | 707 | ||
708 | /* lockdep annotation is needed for ingress; egress gets it only for name */ | ||
709 | static struct lock_class_key qdisc_tx_lock; | ||
710 | static struct lock_class_key qdisc_rx_lock; | ||
711 | |||
710 | /* | 712 | /* |
711 | Allocate and initialize new qdisc. | 713 | Allocate and initialize new qdisc. |
712 | 714 | ||
@@ -767,6 +769,7 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, | |||
767 | if (handle == TC_H_INGRESS) { | 769 | if (handle == TC_H_INGRESS) { |
768 | sch->flags |= TCQ_F_INGRESS; | 770 | sch->flags |= TCQ_F_INGRESS; |
769 | handle = TC_H_MAKE(TC_H_INGRESS, 0); | 771 | handle = TC_H_MAKE(TC_H_INGRESS, 0); |
772 | lockdep_set_class(qdisc_lock(sch), &qdisc_rx_lock); | ||
770 | } else { | 773 | } else { |
771 | if (handle == 0) { | 774 | if (handle == 0) { |
772 | handle = qdisc_alloc_handle(dev); | 775 | handle = qdisc_alloc_handle(dev); |
@@ -774,6 +777,7 @@ qdisc_create(struct net_device *dev, struct netdev_queue *dev_queue, | |||
774 | if (handle == 0) | 777 | if (handle == 0) |
775 | goto err_out3; | 778 | goto err_out3; |
776 | } | 779 | } |
780 | lockdep_set_class(qdisc_lock(sch), &qdisc_tx_lock); | ||
777 | } | 781 | } |
778 | 782 | ||
779 | sch->handle = handle; | 783 | sch->handle = handle; |
@@ -1084,20 +1088,13 @@ create_n_graft: | |||
1084 | } | 1088 | } |
1085 | 1089 | ||
1086 | graft: | 1090 | graft: |
1087 | if (1) { | 1091 | err = qdisc_graft(dev, p, skb, n, clid, q, NULL); |
1088 | spinlock_t *root_lock; | 1092 | if (err) { |
1089 | 1093 | if (q) | |
1090 | err = qdisc_graft(dev, p, skb, n, clid, q, NULL); | 1094 | qdisc_destroy(q); |
1091 | if (err) { | 1095 | return err; |
1092 | if (q) { | ||
1093 | root_lock = qdisc_root_lock(q); | ||
1094 | spin_lock_bh(root_lock); | ||
1095 | qdisc_destroy(q); | ||
1096 | spin_unlock_bh(root_lock); | ||
1097 | } | ||
1098 | return err; | ||
1099 | } | ||
1100 | } | 1096 | } |
1097 | |||
1101 | return 0; | 1098 | return 0; |
1102 | } | 1099 | } |
1103 | 1100 | ||
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c index 4e261ce62f48..47ef492c4ff4 100644 --- a/net/sched/sch_cbq.c +++ b/net/sched/sch_cbq.c | |||
@@ -654,7 +654,7 @@ static enum hrtimer_restart cbq_undelay(struct hrtimer *timer) | |||
654 | } | 654 | } |
655 | 655 | ||
656 | sch->flags &= ~TCQ_F_THROTTLED; | 656 | sch->flags &= ~TCQ_F_THROTTLED; |
657 | __netif_schedule(sch); | 657 | __netif_schedule(qdisc_root(sch)); |
658 | return HRTIMER_NORESTART; | 658 | return HRTIMER_NORESTART; |
659 | } | 659 | } |
660 | 660 | ||
diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c index 468574682caa..c3ed4d44fc14 100644 --- a/net/sched/sch_generic.c +++ b/net/sched/sch_generic.c | |||
@@ -518,14 +518,17 @@ void qdisc_reset(struct Qdisc *qdisc) | |||
518 | } | 518 | } |
519 | EXPORT_SYMBOL(qdisc_reset); | 519 | EXPORT_SYMBOL(qdisc_reset); |
520 | 520 | ||
521 | /* this is the rcu callback function to clean up a qdisc when there | 521 | void qdisc_destroy(struct Qdisc *qdisc) |
522 | * are no further references to it */ | ||
523 | |||
524 | static void __qdisc_destroy(struct rcu_head *head) | ||
525 | { | 522 | { |
526 | struct Qdisc *qdisc = container_of(head, struct Qdisc, q_rcu); | ||
527 | const struct Qdisc_ops *ops = qdisc->ops; | 523 | const struct Qdisc_ops *ops = qdisc->ops; |
528 | 524 | ||
525 | if (qdisc->flags & TCQ_F_BUILTIN || | ||
526 | !atomic_dec_and_test(&qdisc->refcnt)) | ||
527 | return; | ||
528 | |||
529 | if (qdisc->parent) | ||
530 | list_del(&qdisc->list); | ||
531 | |||
529 | #ifdef CONFIG_NET_SCHED | 532 | #ifdef CONFIG_NET_SCHED |
530 | qdisc_put_stab(qdisc->stab); | 533 | qdisc_put_stab(qdisc->stab); |
531 | #endif | 534 | #endif |
@@ -542,20 +545,6 @@ static void __qdisc_destroy(struct rcu_head *head) | |||
542 | 545 | ||
543 | kfree((char *) qdisc - qdisc->padded); | 546 | kfree((char *) qdisc - qdisc->padded); |
544 | } | 547 | } |
545 | |||
546 | /* Under qdisc_lock(qdisc) and BH! */ | ||
547 | |||
548 | void qdisc_destroy(struct Qdisc *qdisc) | ||
549 | { | ||
550 | if (qdisc->flags & TCQ_F_BUILTIN || | ||
551 | !atomic_dec_and_test(&qdisc->refcnt)) | ||
552 | return; | ||
553 | |||
554 | if (qdisc->parent) | ||
555 | list_del(&qdisc->list); | ||
556 | |||
557 | call_rcu(&qdisc->q_rcu, __qdisc_destroy); | ||
558 | } | ||
559 | EXPORT_SYMBOL(qdisc_destroy); | 548 | EXPORT_SYMBOL(qdisc_destroy); |
560 | 549 | ||
561 | static bool dev_all_qdisc_sleeping_noop(struct net_device *dev) | 550 | static bool dev_all_qdisc_sleeping_noop(struct net_device *dev) |
@@ -597,6 +586,9 @@ static void transition_one_qdisc(struct net_device *dev, | |||
597 | struct Qdisc *new_qdisc = dev_queue->qdisc_sleeping; | 586 | struct Qdisc *new_qdisc = dev_queue->qdisc_sleeping; |
598 | int *need_watchdog_p = _need_watchdog; | 587 | int *need_watchdog_p = _need_watchdog; |
599 | 588 | ||
589 | if (!(new_qdisc->flags & TCQ_F_BUILTIN)) | ||
590 | clear_bit(__QDISC_STATE_DEACTIVATED, &new_qdisc->state); | ||
591 | |||
600 | rcu_assign_pointer(dev_queue->qdisc, new_qdisc); | 592 | rcu_assign_pointer(dev_queue->qdisc, new_qdisc); |
601 | if (need_watchdog_p && new_qdisc != &noqueue_qdisc) | 593 | if (need_watchdog_p && new_qdisc != &noqueue_qdisc) |
602 | *need_watchdog_p = 1; | 594 | *need_watchdog_p = 1; |
@@ -640,6 +632,9 @@ static void dev_deactivate_queue(struct net_device *dev, | |||
640 | if (qdisc) { | 632 | if (qdisc) { |
641 | spin_lock_bh(qdisc_lock(qdisc)); | 633 | spin_lock_bh(qdisc_lock(qdisc)); |
642 | 634 | ||
635 | if (!(qdisc->flags & TCQ_F_BUILTIN)) | ||
636 | set_bit(__QDISC_STATE_DEACTIVATED, &qdisc->state); | ||
637 | |||
643 | dev_queue->qdisc = qdisc_default; | 638 | dev_queue->qdisc = qdisc_default; |
644 | qdisc_reset(qdisc); | 639 | qdisc_reset(qdisc); |
645 | 640 | ||
@@ -647,7 +642,7 @@ static void dev_deactivate_queue(struct net_device *dev, | |||
647 | } | 642 | } |
648 | } | 643 | } |
649 | 644 | ||
650 | static bool some_qdisc_is_busy(struct net_device *dev, int lock) | 645 | static bool some_qdisc_is_busy(struct net_device *dev) |
651 | { | 646 | { |
652 | unsigned int i; | 647 | unsigned int i; |
653 | 648 | ||
@@ -661,14 +656,12 @@ static bool some_qdisc_is_busy(struct net_device *dev, int lock) | |||
661 | q = dev_queue->qdisc_sleeping; | 656 | q = dev_queue->qdisc_sleeping; |
662 | root_lock = qdisc_lock(q); | 657 | root_lock = qdisc_lock(q); |
663 | 658 | ||
664 | if (lock) | 659 | spin_lock_bh(root_lock); |
665 | spin_lock_bh(root_lock); | ||
666 | 660 | ||
667 | val = (test_bit(__QDISC_STATE_RUNNING, &q->state) || | 661 | val = (test_bit(__QDISC_STATE_RUNNING, &q->state) || |
668 | test_bit(__QDISC_STATE_SCHED, &q->state)); | 662 | test_bit(__QDISC_STATE_SCHED, &q->state)); |
669 | 663 | ||
670 | if (lock) | 664 | spin_unlock_bh(root_lock); |
671 | spin_unlock_bh(root_lock); | ||
672 | 665 | ||
673 | if (val) | 666 | if (val) |
674 | return true; | 667 | return true; |
@@ -678,8 +671,6 @@ static bool some_qdisc_is_busy(struct net_device *dev, int lock) | |||
678 | 671 | ||
679 | void dev_deactivate(struct net_device *dev) | 672 | void dev_deactivate(struct net_device *dev) |
680 | { | 673 | { |
681 | bool running; | ||
682 | |||
683 | netdev_for_each_tx_queue(dev, dev_deactivate_queue, &noop_qdisc); | 674 | netdev_for_each_tx_queue(dev, dev_deactivate_queue, &noop_qdisc); |
684 | dev_deactivate_queue(dev, &dev->rx_queue, &noop_qdisc); | 675 | dev_deactivate_queue(dev, &dev->rx_queue, &noop_qdisc); |
685 | 676 | ||
@@ -689,25 +680,8 @@ void dev_deactivate(struct net_device *dev) | |||
689 | synchronize_rcu(); | 680 | synchronize_rcu(); |
690 | 681 | ||
691 | /* Wait for outstanding qdisc_run calls. */ | 682 | /* Wait for outstanding qdisc_run calls. */ |
692 | do { | 683 | while (some_qdisc_is_busy(dev)) |
693 | while (some_qdisc_is_busy(dev, 0)) | 684 | yield(); |
694 | yield(); | ||
695 | |||
696 | /* | ||
697 | * Double-check inside queue lock to ensure that all effects | ||
698 | * of the queue run are visible when we return. | ||
699 | */ | ||
700 | running = some_qdisc_is_busy(dev, 1); | ||
701 | |||
702 | /* | ||
703 | * The running flag should never be set at this point because | ||
704 | * we've already set dev->qdisc to noop_qdisc *inside* the same | ||
705 | * pair of spin locks. That is, if any qdisc_run starts after | ||
706 | * our initial test it should see the noop_qdisc and then | ||
707 | * clear the RUNNING bit before dropping the queue lock. So | ||
708 | * if it is set here then we've found a bug. | ||
709 | */ | ||
710 | } while (WARN_ON_ONCE(running)); | ||
711 | } | 685 | } |
712 | 686 | ||
713 | static void dev_init_scheduler_queue(struct net_device *dev, | 687 | static void dev_init_scheduler_queue(struct net_device *dev, |
@@ -736,14 +710,10 @@ static void shutdown_scheduler_queue(struct net_device *dev, | |||
736 | struct Qdisc *qdisc_default = _qdisc_default; | 710 | struct Qdisc *qdisc_default = _qdisc_default; |
737 | 711 | ||
738 | if (qdisc) { | 712 | if (qdisc) { |
739 | spinlock_t *root_lock = qdisc_lock(qdisc); | ||
740 | |||
741 | dev_queue->qdisc = qdisc_default; | 713 | dev_queue->qdisc = qdisc_default; |
742 | dev_queue->qdisc_sleeping = qdisc_default; | 714 | dev_queue->qdisc_sleeping = qdisc_default; |
743 | 715 | ||
744 | spin_lock_bh(root_lock); | ||
745 | qdisc_destroy(qdisc); | 716 | qdisc_destroy(qdisc); |
746 | spin_unlock_bh(root_lock); | ||
747 | } | 717 | } |
748 | } | 718 | } |
749 | 719 | ||
diff --git a/net/sched/sch_htb.c b/net/sched/sch_htb.c index 6febd245e62b..0df0df202ed0 100644 --- a/net/sched/sch_htb.c +++ b/net/sched/sch_htb.c | |||
@@ -577,7 +577,7 @@ static int htb_enqueue(struct sk_buff *skb, struct Qdisc *sch) | |||
577 | sch->qstats.drops++; | 577 | sch->qstats.drops++; |
578 | cl->qstats.drops++; | 578 | cl->qstats.drops++; |
579 | } | 579 | } |
580 | return NET_XMIT_DROP; | 580 | return ret; |
581 | } else { | 581 | } else { |
582 | cl->bstats.packets += | 582 | cl->bstats.packets += |
583 | skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1; | 583 | skb_is_gso(skb)?skb_shinfo(skb)->gso_segs:1; |
@@ -623,7 +623,7 @@ static int htb_requeue(struct sk_buff *skb, struct Qdisc *sch) | |||
623 | sch->qstats.drops++; | 623 | sch->qstats.drops++; |
624 | cl->qstats.drops++; | 624 | cl->qstats.drops++; |
625 | } | 625 | } |
626 | return NET_XMIT_DROP; | 626 | return ret; |
627 | } else | 627 | } else |
628 | htb_activate(q, cl); | 628 | htb_activate(q, cl); |
629 | 629 | ||
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c index eac197610edf..a6697c686c7f 100644 --- a/net/sched/sch_prio.c +++ b/net/sched/sch_prio.c | |||
@@ -113,11 +113,11 @@ prio_requeue(struct sk_buff *skb, struct Qdisc* sch) | |||
113 | if ((ret = qdisc->ops->requeue(skb, qdisc)) == NET_XMIT_SUCCESS) { | 113 | if ((ret = qdisc->ops->requeue(skb, qdisc)) == NET_XMIT_SUCCESS) { |
114 | sch->q.qlen++; | 114 | sch->q.qlen++; |
115 | sch->qstats.requeues++; | 115 | sch->qstats.requeues++; |
116 | return 0; | 116 | return NET_XMIT_SUCCESS; |
117 | } | 117 | } |
118 | if (net_xmit_drop_count(ret)) | 118 | if (net_xmit_drop_count(ret)) |
119 | sch->qstats.drops++; | 119 | sch->qstats.drops++; |
120 | return NET_XMIT_DROP; | 120 | return ret; |
121 | } | 121 | } |
122 | 122 | ||
123 | 123 | ||
diff --git a/net/sched/sch_tbf.c b/net/sched/sch_tbf.c index 7d3b7ff3bf07..94c61598b86a 100644 --- a/net/sched/sch_tbf.c +++ b/net/sched/sch_tbf.c | |||
@@ -123,15 +123,8 @@ static int tbf_enqueue(struct sk_buff *skb, struct Qdisc* sch) | |||
123 | struct tbf_sched_data *q = qdisc_priv(sch); | 123 | struct tbf_sched_data *q = qdisc_priv(sch); |
124 | int ret; | 124 | int ret; |
125 | 125 | ||
126 | if (qdisc_pkt_len(skb) > q->max_size) { | 126 | if (qdisc_pkt_len(skb) > q->max_size) |
127 | sch->qstats.drops++; | 127 | return qdisc_reshape_fail(skb, sch); |
128 | #ifdef CONFIG_NET_CLS_ACT | ||
129 | if (sch->reshape_fail == NULL || sch->reshape_fail(skb, sch)) | ||
130 | #endif | ||
131 | kfree_skb(skb); | ||
132 | |||
133 | return NET_XMIT_DROP; | ||
134 | } | ||
135 | 128 | ||
136 | ret = qdisc_enqueue(skb, q->qdisc); | 129 | ret = qdisc_enqueue(skb, q->qdisc); |
137 | if (ret != 0) { | 130 | if (ret != 0) { |