History

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

Pull networking fixes from David Miller: 1) Transfer padding was wrong for full-speed USB in ASIX driver, fix from Ingo van Lil. 2) Propagate the negative packet offset fix into the PowerPC BPF JIT. From Jan Seiffert. 3) dl2k driver's private ioctls were letting unprivileged tasks make MII writes and other ugly bits like that. Fix from Jeff Mahoney. 4) Fix TX VLAN and RX packet drops in ucc_geth, from Joakim Tjernlund. 5) OOPS and network namespace fixes in IPVS from Hans Schillstrom and Julian Anastasov. 6) Fix races and sleeping in locked context bugs in drop_monitor, from Neil Horman. 7) Fix link status indication in smsc95xx driver, from Paolo Pisati. 8) Fix bridge netfilter OOPS, from Peter Huang. 9) L2TP sendmsg can return on error conditions with the socket lock held, oops. Fix from Sasha Levin. 10) udp_diag should return meaningful values for socket memory usage, from Shan Wei. 11) Eric Dumazet is so awesome he gets his own section: Socket memory cgroup code (I never should have applied those patches, grumble...) made erroneous changes to sk_sockets_allocated_read_positive(). It was changed to use percpu_counter_sum_positive (which requires BH disabling) instead of percpu_counter_read_positive (which does not). Revert back to avoid crashes and lockdep warnings. Adjust the default tcp_adv_win_scale and tcp_rmem[2] values to fix throughput regressions. This is necessary as a result of our more precise skb->truesize tracking. Fix SKB leak in netem packet scheduler. 12) New device IDs for various bluetooth devices, from Manoj Iyer, AceLan Kao, and Steven Harms. 13) Fix command completion race in ipw2200, from Stanislav Yakovlev. 14) Fix rtlwifi oops on unload, from Larry Finger. 15) Fix hard_mtu when adjusting hard_header_len in smsc95xx driver. From Stephane Fillod. 16) ehea driver registers it's IRQ before all the necessary state is setup, resulting in crashes. Fix from Thadeu Lima de Souza Cascardo. 17) Fix PHY connection failures in davinci_emac driver, from Anatolij Gustschin. 18) Missing break; in switch statement in bluetooth's hci_cmd_complete_evt(). Fix from Szymon Janc. 19) Fix queue programming in iwlwifi, from Johannes Berg. 20) Interrupt throttling defaults not being actually programmed into the hardware, fix from Jeff Kirsher and Ying Cai. 21) TLAN driver SKB encoding in descriptor busted on 64-bit, fix from Benjamin Poirier. 22) Fix blind status block RX producer pointer deref in TG3 driver, from Matt Carlson. 23) Promisc and multicast are busted on ehea, fixes from Thadeu Lima de Souza Cascardo. 24) Fix crashes in 6lowpan, from Alexander Smirnov. 25) tcp_complete_cwr() needs to be careful to not rewind the CWND to ssthresh if ssthresh has the "infinite" value. Fix from Yuchung Cheng. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (81 commits) sungem: Fix WakeOnLan tcp: change tcp_adv_win_scale and tcp_rmem[2] net: l2tp: unlock socket lock before returning from l2tp_ip_sendmsg drop_monitor: prevent init path from scheduling on the wrong cpu usbnet: fix failure handling in usbnet_probe usbnet: fix leak of transfer buffer of dev->interrupt ucc_geth: Add 16 bytes to max TX frame for VLANs net: ucc_geth, increase no. of HW RX descriptors netem: fix possible skb leak sky2: fix receive length error in mixed non-VLAN/VLAN traffic sky2: propogate rx hash when packet is copied net: fix two typos in skbuff.h cxgb3: Don't call cxgb_vlan_mode until q locks are initialized ixgbe: fix calling skb_put on nonlinear skb assertion bug ixgbe: Fix a memory leak in IEEE DCB igbvf: fix the bug when initializing the igbvf smsc75xx: enable mac to detect speed/duplex from phy smsc75xx: declare smsc75xx's MII as GMII capable smsc75xx: fix phy interrupt acknowledge smsc75xx: fix phy init reset loop ...

Linus Torvalds committed 14 years ago

Commit c42f1d42 parents 913a904 5a8887d86 files · +795 −418Browse files

Unified · Split

86 files
  1. Documentation/networking/ip-sysctl.txt +2 −2
  2. MAINTAINERS +2 −2
  3. arch/powerpc/net/bpf_jit.h +7 −1
  4. arch/powerpc/net/bpf_jit_64.S +95 −13
  5. arch/powerpc/net/bpf_jit_comp.c +9 −17
  6. drivers/bluetooth/ath3k.c +4 −0
  7. drivers/bluetooth/btusb.c +6 −0
  8. drivers/net/ethernet/broadcom/tg3.c +16 −2
  9. drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c +46 −46
  10. drivers/net/ethernet/dlink/dl2k.c +9 −43
  11. drivers/net/ethernet/dlink/dl2k.h +0 −7
  12. drivers/net/ethernet/freescale/ucc_geth.c +3 −3
  13. drivers/net/ethernet/freescale/ucc_geth.h +1 −1
  14. drivers/net/ethernet/ibm/ehea/ehea_main.c +34 −26
  15. drivers/net/ethernet/ibm/ehea/ehea_phyp.h +1 −1
  16. drivers/net/ethernet/intel/e1000e/netdev.c +1 −1
  17. drivers/net/ethernet/intel/e1000e/param.c +53 −46
  18. drivers/net/ethernet/intel/igbvf/netdev.c +2 −2
  19. drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c +1 −0
  20. drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +5 −4
  21. drivers/net/ethernet/marvell/sky2.c +20 −11
  22. drivers/net/ethernet/marvell/sky2.h +0 −1
  23. drivers/net/ethernet/sun/sungem.c +1 −1
  24. drivers/net/ethernet/ti/davinci_emac.c +1 −1
  25. drivers/net/ethernet/ti/tlan.c +1 −1
  26. drivers/net/usb/asix.c +2 −2
  27. drivers/net/usb/smsc75xx.c +24 −11
  28. drivers/net/usb/smsc95xx.c +2 −1
  29. drivers/net/usb/usbnet.c +4 −1
  30. drivers/net/wireless/ath/ath5k/ahb.c +1 −0
  31. drivers/net/wireless/ath/ath9k/ar5008_phy.c +1 −1
  32. drivers/net/wireless/ath/ath9k/ar9003_paprd.c +1 −1
  33. drivers/net/wireless/ath/ath9k/ar9003_phy.c +1 −1
  34. drivers/net/wireless/ath/ath9k/eeprom_9287.c +2 −0
  35. drivers/net/wireless/ath/ath9k/hw.c +5 −4
  36. drivers/net/wireless/ath/ath9k/hw.h +2 −1
  37. drivers/net/wireless/b43/main.c +8 −2
  38. drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c +7 −1
  39. drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +51 −12
  40. drivers/net/wireless/brcm80211/brcmsmac/main.c +1 −2
  41. drivers/net/wireless/ipw2x00/ipw2200.c +12 −1
  42. drivers/net/wireless/iwlwifi/iwl-1000.c +4 −4
  43. drivers/net/wireless/iwlwifi/iwl-2000.c +8 −8
  44. drivers/net/wireless/iwlwifi/iwl-5000.c +9 −2
  45. drivers/net/wireless/iwlwifi/iwl-6000.c +6 −4
  46. drivers/net/wireless/iwlwifi/iwl-agn.c +0 −3
  47. drivers/net/wireless/iwlwifi/iwl-fh.h +19 −5
  48. drivers/net/wireless/iwlwifi/iwl-mac80211.c +9 −1
  49. drivers/net/wireless/iwlwifi/iwl-prph.h +24 −3
  50. drivers/net/wireless/rtlwifi/pci.c +1 −0
  51. drivers/net/wireless/wl1251/main.c +1 −0
  52. drivers/net/wireless/wl1251/sdio.c +1 −1
  53. drivers/s390/net/qeth_core_main.c +4 −2
  54. include/linux/netfilter_bridge.h +9 −0
  55. include/linux/skbuff.h +2 −2
  56. include/net/bluetooth/hci_core.h +2 −1
  57. include/net/dst.h +1 −0
  58. include/net/ip_vs.h +3 −1
  59. include/net/sock.h +2 −2
  60. net/bluetooth/hci_core.c +13 −14
  61. net/bluetooth/hci_event.c +3 −0
  62. net/bluetooth/mgmt.c +1 −1
  63. net/bridge/br_forward.c +1 −0
  64. net/bridge/br_netfilter.c +2 −6
  65. net/core/drop_monitor.c +64 −24
  66. net/ieee802154/6lowpan.c +38 −2
  67. net/ipv4/inet_diag.c +1 −1
  68. net/ipv4/tcp.c +5 −4
  69. net/ipv4/tcp_input.c +8 −5
  70. net/ipv4/udp_diag.c +9 −0
  71. net/l2tp/l2tp_ip.c +2 −1
  72. net/mac80211/ieee80211_i.h +1 −1
  73. net/mac80211/iface.c +2 −2
  74. net/mac80211/mlme.c +1 −1
  75. net/mac80211/tx.c +2 −1
  76. net/netfilter/ipvs/ip_vs_core.c +11 −0
  77. net/netfilter/ipvs/ip_vs_ctl.c +32 −24
  78. net/netfilter/ipvs/ip_vs_ftp.c +2 −0
  79. net/netfilter/ipvs/ip_vs_lblc.c +3 −0
  80. net/netfilter/ipvs/ip_vs_lblcr.c +3 −0
  81. net/netfilter/ipvs/ip_vs_proto.c +27 −11
  82. net/netfilter/ipvs/ip_vs_proto_sctp.c +4 −1
  83. net/netfilter/ipvs/ip_vs_proto_tcp.c +4 −1
  84. net/netfilter/ipvs/ip_vs_proto_udp.c +4 −1
  85. net/netfilter/xt_CT.c +1 −1
  86. net/sched/sch_netem.c +2 −4
Documentation/networking/ip-sysctl.txt+2−2
@@ -147,7 +147,7 @@ tcp_adv_win_scale - INTEGER · 146 unmodified lines
147147 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale),
148148 if it is <= 0.
149149 Possible values are [-31, 31], inclusive.
150− Default: 2
150+ Default: 1
151151
152152 tcp_allowed_congestion_control - STRING
153153 Show/set the congestion control choices available to non-privileged
@@ -410,7 +410,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max · 256 unmodified lines
410410 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables
411411 automatic tuning of that socket's receive buffer size, in which
412412 case this value is ignored.
413− Default: between 87380B and 4MB, depending on RAM size.
413+ Default: between 87380B and 6MB, depending on RAM size.
414414
415415 tcp_sack - BOOLEAN
416416 Enable select acknowledgments (SACKS).
MAINTAINERS+2−2
@@ -5892,11 +5892,11 @@ F: Documentation/scsi/st.txt · 5891 unmodified lines
58925892 F: drivers/scsi/st*
58935893
58945894 SCTP PROTOCOL
5895−M: Vlad Yasevich <vladislav.yasevich@hp.com>
5895+M: Vlad Yasevich <vyasevich@gmail.com>
58965896 M: Sridhar Samudrala <sri@us.ibm.com>
58975897 L: linux-sctp@vger.kernel.org
58985898 W: http://lksctp.sourceforge.net
5899−S: Supported
5899+S: Maintained
59005900 F: Documentation/networking/sctp.txt
59015901 F: include/linux/sctp.h
59025902 F: include/net/sctp/
arch/powerpc/net/bpf_jit.h+7−1
@@ -48,7 +48,13 @@ · 47 unmodified lines
4848 /*
4949 * Assembly helpers from arch/powerpc/net/bpf_jit.S:
5050 */
51−extern u8 sk_load_word[], sk_load_half[], sk_load_byte[], sk_load_byte_msh[];
51+#define DECLARE_LOAD_FUNC(func) \
52+ extern u8 func[], func##_negative_offset[], func##_positive_offset[]
53+
54+DECLARE_LOAD_FUNC(sk_load_word);
55+DECLARE_LOAD_FUNC(sk_load_half);
56+DECLARE_LOAD_FUNC(sk_load_byte);
57+DECLARE_LOAD_FUNC(sk_load_byte_msh);
5258
5359 #define FUNCTION_DESCR_SIZE 24
5460
arch/powerpc/net/bpf_jit_64.S+95−13
@@ -31,14 +31,13 @@ · 30 unmodified lines
3131 * then branch directly to slow_path_XXX if required. (In fact, could
3232 * load a spare GPR with the address of slow_path_generic and pass size
3333 * as an argument, making the call site a mtlr, li and bllr.)
34− *
35− * Technically, the "is addr < 0" check is unnecessary & slowing down
36− * the ABS path, as it's statically checked on generation.
3734 */
3835 .globl sk_load_word
3936 sk_load_word:
4037 cmpdi r_addr, 0
41− blt bpf_error
38+ blt bpf_slow_path_word_neg
39+ .globl sk_load_word_positive_offset
40+sk_load_word_positive_offset:
4241 /* Are we accessing past headlen? */
4342 subi r_scratch1, r_HL, 4
4443 cmpd r_scratch1, r_addr
@@ -51,7 +50,9 @@ sk_load_word: · 6 unmodified lines
5150 .globl sk_load_half
5251 sk_load_half:
5352 cmpdi r_addr, 0
54− blt bpf_error
53+ blt bpf_slow_path_half_neg
54+ .globl sk_load_half_positive_offset
55+sk_load_half_positive_offset:
5556 subi r_scratch1, r_HL, 2
5657 cmpd r_scratch1, r_addr
5758 blt bpf_slow_path_half
@@ -61,7 +62,9 @@ sk_load_half: · 3 unmodified lines
6162 .globl sk_load_byte
6263 sk_load_byte:
6364 cmpdi r_addr, 0
64− blt bpf_error
65+ blt bpf_slow_path_byte_neg
66+ .globl sk_load_byte_positive_offset
67+sk_load_byte_positive_offset:
6568 cmpd r_HL, r_addr
6669 ble bpf_slow_path_byte
6770 lbzx r_A, r_D, r_addr
@@ -69,22 +72,20 @@ sk_load_byte: · 1 unmodified line
6972
7073 /*
7174 * BPF_S_LDX_B_MSH: ldxb 4*([offset]&0xf)
72− * r_addr is the offset value, already known positive
75+ * r_addr is the offset value
7376 */
7477 .globl sk_load_byte_msh
7578 sk_load_byte_msh:
79+ cmpdi r_addr, 0
80+ blt bpf_slow_path_byte_msh_neg
81+ .globl sk_load_byte_msh_positive_offset
82+sk_load_byte_msh_positive_offset:
7683 cmpd r_HL, r_addr
7784 ble bpf_slow_path_byte_msh
7885 lbzx r_X, r_D, r_addr
7986 rlwinm r_X, r_X, 2, 32-4-2, 31-2
8087 blr
8188
82−bpf_error:
83− /* Entered with cr0 = lt */
84− li r3, 0
85− /* Generated code will 'blt epilogue', returning 0. */
86− blr
87−
8889 /* Call out to skb_copy_bits:
8990 * We'll need to back up our volatile regs first; we have
9091 * local variable space at r1+(BPF_PPC_STACK_BASIC).
@@ -136,3 +137,84 @@ bpf_slow_path_byte_msh: · 45 unmodified lines
136137 lbz r_X, BPF_PPC_STACK_BASIC+(2*8)(r1)
137138 rlwinm r_X, r_X, 2, 32-4-2, 31-2
138139 blr
140+
141+/* Call out to bpf_internal_load_pointer_neg_helper:
142+ * We'll need to back up our volatile regs first; we have
143+ * local variable space at r1+(BPF_PPC_STACK_BASIC).
144+ * Allocate a new stack frame here to remain ABI-compliant in
145+ * stashing LR.
146+ */
147+#define sk_negative_common(SIZE) \
148+ mflr r0; \
149+ std r0, 16(r1); \
150+ /* R3 goes in parameter space of caller's frame */ \
151+ std r_skb, (BPF_PPC_STACKFRAME+48)(r1); \
152+ std r_A, (BPF_PPC_STACK_BASIC+(0*8))(r1); \
153+ std r_X, (BPF_PPC_STACK_BASIC+(1*8))(r1); \
154+ stdu r1, -BPF_PPC_SLOWPATH_FRAME(r1); \
155+ /* R3 = r_skb, as passed */ \
156+ mr r4, r_addr; \
157+ li r5, SIZE; \
158+ bl bpf_internal_load_pointer_neg_helper; \
159+ /* R3 != 0 on success */ \
160+ addi r1, r1, BPF_PPC_SLOWPATH_FRAME; \
161+ ld r0, 16(r1); \
162+ ld r_A, (BPF_PPC_STACK_BASIC+(0*8))(r1); \
163+ ld r_X, (BPF_PPC_STACK_BASIC+(1*8))(r1); \
164+ mtlr r0; \
165+ cmpldi r3, 0; \
166+ beq bpf_error_slow; /* cr0 = EQ */ \
167+ mr r_addr, r3; \
168+ ld r_skb, (BPF_PPC_STACKFRAME+48)(r1); \
169+ /* Great success! */
170+
171+bpf_slow_path_word_neg:
172+ lis r_scratch1,-32 /* SKF_LL_OFF */
173+ cmpd r_addr, r_scratch1 /* addr < SKF_* */
174+ blt bpf_error /* cr0 = LT */
175+ .globl sk_load_word_negative_offset
176+sk_load_word_negative_offset:
177+ sk_negative_common(4)
178+ lwz r_A, 0(r_addr)
179+ blr
180+
181+bpf_slow_path_half_neg:
182+ lis r_scratch1,-32 /* SKF_LL_OFF */
183+ cmpd r_addr, r_scratch1 /* addr < SKF_* */
184+ blt bpf_error /* cr0 = LT */
185+ .globl sk_load_half_negative_offset
186+sk_load_half_negative_offset:
187+ sk_negative_common(2)
188+ lhz r_A, 0(r_addr)
189+ blr
190+
191+bpf_slow_path_byte_neg:
192+ lis r_scratch1,-32 /* SKF_LL_OFF */
193+ cmpd r_addr, r_scratch1 /* addr < SKF_* */
194+ blt bpf_error /* cr0 = LT */
195+ .globl sk_load_byte_negative_offset
196+sk_load_byte_negative_offset:
197+ sk_negative_common(1)
198+ lbz r_A, 0(r_addr)
199+ blr
200+
201+bpf_slow_path_byte_msh_neg:
202+ lis r_scratch1,-32 /* SKF_LL_OFF */
203+ cmpd r_addr, r_scratch1 /* addr < SKF_* */
204+ blt bpf_error /* cr0 = LT */
205+ .globl sk_load_byte_msh_negative_offset
206+sk_load_byte_msh_negative_offset:
207+ sk_negative_common(1)
208+ lbz r_X, 0(r_addr)
209+ rlwinm r_X, r_X, 2, 32-4-2, 31-2
210+ blr
211+
212+bpf_error_slow:
213+ /* fabricate a cr0 = lt */
214+ li r_scratch1, -1
215+ cmpdi r_scratch1, 0
216+bpf_error:
217+ /* Entered with cr0 = lt */
218+ li r3, 0
219+ /* Generated code will 'blt epilogue', returning 0. */
220+ blr
arch/powerpc/net/bpf_jit_comp.c+9−17
@@ -127,6 +127,9 @@ static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx) · 126 unmodified lines
127127 PPC_BLR();
128128 }
129129
130+#define CHOOSE_LOAD_FUNC(K, func) \
131+ ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset)
132+
130133 /* Assemble the body code between the prologue & epilogue. */
131134 static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
132135 struct codegen_context *ctx,
@@ -391,21 +394,16 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, · 258 unmodified lines
391394
392395 /*** Absolute loads from packet header/data ***/
393396 case BPF_S_LD_W_ABS:
394− func = sk_load_word;
397+ func = CHOOSE_LOAD_FUNC(K, sk_load_word);
395398 goto common_load;
396399 case BPF_S_LD_H_ABS:
397− func = sk_load_half;
400+ func = CHOOSE_LOAD_FUNC(K, sk_load_half);
398401 goto common_load;
399402 case BPF_S_LD_B_ABS:
400− func = sk_load_byte;
403+ func = CHOOSE_LOAD_FUNC(K, sk_load_byte);
401404 common_load:
402− /*
403− * Load from [K]. Reference with the (negative)
404− * SKF_NET_OFF/SKF_LL_OFF offsets is unsupported.
405− */
405+ /* Load from [K]. */
406406 ctx->seen |= SEEN_DATAREF;
407− if ((int)K < 0)
408− return -ENOTSUPP;
409407 PPC_LI64(r_scratch1, func);
410408 PPC_MTLR(r_scratch1);
411409 PPC_LI32(r_addr, K);
@@ -429,7 +427,7 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, · 17 unmodified lines
429427 common_load_ind:
430428 /*
431429 * Load from [X + K]. Negative offsets are tested for
432− * in the helper functions, and result in a 'ret 0'.
430+ * in the helper functions.
433431 */
434432 ctx->seen |= SEEN_DATAREF | SEEN_XREG;
435433 PPC_LI64(r_scratch1, func);
@@ -443,13 +441,7 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, · 7 unmodified lines
443441 break;
444442
445443 case BPF_S_LDX_B_MSH:
446− /*
447− * x86 version drops packet (RET 0) when K<0, whereas
448− * interpreter does allow K<0 (__load_pointer, special
449− * ancillary data). common_load returns ENOTSUPP if K<0,
450− * so we fall back to interpreter & filter works.
451− */
452− func = sk_load_byte_msh;
444+ func = CHOOSE_LOAD_FUNC(K, sk_load_byte_msh);
453445 goto common_load;
454446 break;
455447
drivers/bluetooth/ath3k.c+4−0
@@ -75,6 +75,8 @@ static struct usb_device_id ath3k_table[] = { · 74 unmodified lines
7575 { USB_DEVICE(0x0CF3, 0x311D) },
7676 { USB_DEVICE(0x13d3, 0x3375) },
7777 { USB_DEVICE(0x04CA, 0x3005) },
78+ { USB_DEVICE(0x13d3, 0x3362) },
79+ { USB_DEVICE(0x0CF3, 0xE004) },
7880
7981 /* Atheros AR5BBU12 with sflash firmware */
8082 { USB_DEVICE(0x0489, 0xE02C) },
@@ -94,6 +96,8 @@ static struct usb_device_id ath3k_blist_tbl[] = { · 13 unmodified lines
9496 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
9597 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
9698 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
99+ { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
100+ { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
97101
98102 { } /* Terminating entry */
99103 };
drivers/bluetooth/btusb.c+6−0
@@ -101,12 +101,16 @@ static struct usb_device_id btusb_table[] = { · 100 unmodified lines
101101 { USB_DEVICE(0x0c10, 0x0000) },
102102
103103 /* Broadcom BCM20702A0 */
104+ { USB_DEVICE(0x0489, 0xe042) },
104105 { USB_DEVICE(0x0a5c, 0x21e3) },
105106 { USB_DEVICE(0x0a5c, 0x21e6) },
106107 { USB_DEVICE(0x0a5c, 0x21e8) },
107108 { USB_DEVICE(0x0a5c, 0x21f3) },
108109 { USB_DEVICE(0x413c, 0x8197) },
109110
111+ /* Foxconn - Hon Hai */
112+ { USB_DEVICE(0x0489, 0xe033) },
113+
110114 { } /* Terminating entry */
111115 };
112116
@@ -133,6 +137,8 @@ static struct usb_device_id blacklist_table[] = { · 20 unmodified lines
133137 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
134138 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
135139 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
140+ { USB_DEVICE(0x13d3, 0x3362), .driver_info = BTUSB_ATH3012 },
141+ { USB_DEVICE(0x0cf3, 0xe004), .driver_info = BTUSB_ATH3012 },
136142
137143 /* Atheros AR5BBU12 with sflash firmware */
138144 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
drivers/net/ethernet/broadcom/tg3.c+16−2
@@ -879,8 +879,13 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi) · 878 unmodified lines
879879 if (sblk->status & SD_STATUS_LINK_CHG)
880880 work_exists = 1;
881881 }
882− /* check for RX/TX work to do */
883− if (sblk->idx[0].tx_consumer != tnapi->tx_cons ||
882+
883+ /* check for TX work to do */
884+ if (sblk->idx[0].tx_consumer != tnapi->tx_cons)
885+ work_exists = 1;
886+
887+ /* check for RX work to do */
888+ if (tnapi->rx_rcb_prod_idx &&
884889 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
885890 work_exists = 1;
886891
@@ -6124,6 +6129,9 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget) · 5237 unmodified lines
61246129 return work_done;
61256130 }
61266131
6132+ if (!tnapi->rx_rcb_prod_idx)
6133+ return work_done;
6134+
61276135 /* run RX thread, within the bounds set by NAPI.
61286136 * All RX "locking" is done by ensuring outside
61296137 * code synchronizes with tg3->napi.poll()
@@ -7567,6 +7575,12 @@ static int tg3_alloc_consistent(struct tg3 *tp) · 1437 unmodified lines
75677575 */
75687576 switch (i) {
75697577 default:
7578+ if (tg3_flag(tp, ENABLE_RSS)) {
7579+ tnapi->rx_rcb_prod_idx = NULL;
7580+ break;
7581+ }
7582+ /* Fall through */
7583+ case 1:
75707584 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer;
75717585 break;
75727586 case 2:
drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c+46−46
@@ -1149,6 +1149,48 @@ release_tpsram: · 1148 unmodified lines
11491149 return ret;
11501150 }
11511151
1152+/**
1153+ * t3_synchronize_rx - wait for current Rx processing on a port to complete
1154+ * @adap: the adapter
1155+ * @p: the port
1156+ *
1157+ * Ensures that current Rx processing on any of the queues associated with
1158+ * the given port completes before returning. We do this by acquiring and
1159+ * releasing the locks of the response queues associated with the port.
1160+ */
1161+static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
1162+{
1163+ int i;
1164+
1165+ for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
1166+ struct sge_rspq *q = &adap->sge.qs[i].rspq;
1167+
1168+ spin_lock_irq(&q->lock);
1169+ spin_unlock_irq(&q->lock);
1170+ }
1171+}
1172+
1173+static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
1174+{
1175+ struct port_info *pi = netdev_priv(dev);
1176+ struct adapter *adapter = pi->adapter;
1177+
1178+ if (adapter->params.rev > 0) {
1179+ t3_set_vlan_accel(adapter, 1 << pi->port_id,
1180+ features & NETIF_F_HW_VLAN_RX);
1181+ } else {
1182+ /* single control for all ports */
1183+ unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
1184+
1185+ for_each_port(adapter, i)
1186+ have_vlans |=
1187+ adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
1188+
1189+ t3_set_vlan_accel(adapter, 1, have_vlans);
1190+ }
1191+ t3_synchronize_rx(adapter, pi);
1192+}
1193+
11521194 /**
11531195 * cxgb_up - enable the adapter
11541196 * @adapter: adapter being enabled
@@ -1161,7 +1203,7 @@ release_tpsram: · 6 unmodified lines
11611203 */
11621204 static int cxgb_up(struct adapter *adap)
11631205 {
1164− int err;
1206+ int i, err;
11651207
11661208 if (!(adap->flags & FULL_INIT_DONE)) {
11671209 err = t3_check_fw_version(adap);
@@ -1198,6 +1240,9 @@ static int cxgb_up(struct adapter *adap) · 30 unmodified lines
11981240 if (err)
11991241 goto out;
12001242
1243+ for_each_port(adap, i)
1244+ cxgb_vlan_mode(adap->port[i], adap->port[i]->features);
1245+
12011246 setup_rss(adap);
12021247 if (!(adap->flags & NAPI_INIT))
12031248 init_napi(adap);
@@ -2508,48 +2553,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p) · 1304 unmodified lines
25082553 return 0;
25092554 }
25102555
2511−/**
2512− * t3_synchronize_rx - wait for current Rx processing on a port to complete
2513− * @adap: the adapter
2514− * @p: the port
2515− *
2516− * Ensures that current Rx processing on any of the queues associated with
2517− * the given port completes before returning. We do this by acquiring and
2518− * releasing the locks of the response queues associated with the port.
2519− */
2520−static void t3_synchronize_rx(struct adapter *adap, const struct port_info *p)
2521−{
2522− int i;
2523−
2524− for (i = p->first_qset; i < p->first_qset + p->nqsets; i++) {
2525− struct sge_rspq *q = &adap->sge.qs[i].rspq;
2526−
2527− spin_lock_irq(&q->lock);
2528− spin_unlock_irq(&q->lock);
2529− }
2530−}
2531−
2532−static void cxgb_vlan_mode(struct net_device *dev, netdev_features_t features)
2533−{
2534− struct port_info *pi = netdev_priv(dev);
2535− struct adapter *adapter = pi->adapter;
2536−
2537− if (adapter->params.rev > 0) {
2538− t3_set_vlan_accel(adapter, 1 << pi->port_id,
2539− features & NETIF_F_HW_VLAN_RX);
2540− } else {
2541− /* single control for all ports */
2542− unsigned int i, have_vlans = features & NETIF_F_HW_VLAN_RX;
2543−
2544− for_each_port(adapter, i)
2545− have_vlans |=
2546− adapter->port[i]->features & NETIF_F_HW_VLAN_RX;
2547−
2548− t3_set_vlan_accel(adapter, 1, have_vlans);
2549− }
2550− t3_synchronize_rx(adapter, pi);
2551−}
2552−
25532556 static netdev_features_t cxgb_fix_features(struct net_device *dev,
25542557 netdev_features_t features)
25552558 {
@@ -3353,9 +3356,6 @@ static int __devinit init_one(struct pci_dev *pdev, · 797 unmodified lines
33533356 err = sysfs_create_group(&adapter->port[0]->dev.kobj,
33543357 &cxgb3_attr_group);
33553358
3356− for_each_port(adapter, i)
3357− cxgb_vlan_mode(adapter->port[i], adapter->port[i]->features);
3358−
33593359 print_port_info(adapter, ai);
33603360 return 0;
33613361
drivers/net/ethernet/dlink/dl2k.c+9−43
@@ -1259,55 +1259,21 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd) · 1258 unmodified lines
12591259 {
12601260 int phy_addr;
12611261 struct netdev_private *np = netdev_priv(dev);
1262− struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru;
1263−
1264− struct netdev_desc *desc;
1265− int i;
1262+ struct mii_ioctl_data *miidata = if_mii(rq);
12661263
12671264 phy_addr = np->phy_addr;
12681265 switch (cmd) {
1269− case SIOCDEVPRIVATE:
1270− break;
1271−
1272− case SIOCDEVPRIVATE + 1:
1273− miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num);
1266+ case SIOCGMIIPHY:
1267+ miidata->phy_id = phy_addr;
12741268 break;
1275− case SIOCDEVPRIVATE + 2:
1276− mii_write (dev, phy_addr, miidata->reg_num, miidata->in_value);
1269+ case SIOCGMIIREG:
1270+ miidata->val_out = mii_read (dev, phy_addr, miidata->reg_num);
12771271 break;
1278− case SIOCDEVPRIVATE + 3:
1279− break;
1280− case SIOCDEVPRIVATE + 4:
1281− break;
1282− case SIOCDEVPRIVATE + 5:
1283− netif_stop_queue (dev);
1272+ case SIOCSMIIREG:
1273+ if (!capable(CAP_NET_ADMIN))
1274+ return -EPERM;
1275+ mii_write (dev, phy_addr, miidata->reg_num, miidata->val_in);
12841276 break;
1285− case SIOCDEVPRIVATE + 6:
1286− netif_wake_queue (dev);
1287− break;
1288− case SIOCDEVPRIVATE + 7:
1289− printk
1290− ("tx_full=%x cur_tx=%lx old_tx=%lx cur_rx=%lx old_rx=%lx\n",
1291− netif_queue_stopped(dev), np->cur_tx, np->old_tx, np->cur_rx,
1292− np->old_rx);
1293− break;
1294− case SIOCDEVPRIVATE + 8:
1295− printk("TX ring:\n");
1296− for (i = 0; i < TX_RING_SIZE; i++) {
1297− desc = &np->tx_ring[i];
1298− printk
1299− ("%02x:cur:%08x next:%08x status:%08x frag1:%08x frag0:%08x",
1300− i,
1301− (u32) (np->tx_ring_dma + i * sizeof (*desc)),
1302− (u32)le64_to_cpu(desc->next_desc),
1303− (u32)le64_to_cpu(desc->status),
1304− (u32)(le64_to_cpu(desc->fraginfo) >> 32),
1305− (u32)le64_to_cpu(desc->fraginfo));
1306− printk ("\n");
1307− }
1308− printk ("\n");
1309− break;
1310−
13111277 default:
13121278 return -EOPNOTSUPP;
13131279 }
drivers/net/ethernet/dlink/dl2k.h+0−7
@@ -365,13 +365,6 @@ struct ioctl_data { · 364 unmodified lines
365365 char *data;
366366 };
367367
368−struct mii_data {
369− __u16 reserved;
370− __u16 reg_num;
371− __u16 in_value;
372− __u16 out_value;
373−};
374−
375368 /* The Rx and Tx buffer descriptors. */
376369 struct netdev_desc {
377370 __le64 next_desc;
drivers/net/ethernet/freescale/ucc_geth.c+3−3
@@ -116,10 +116,10 @@ static struct ucc_geth_info ugeth_primary_info = { · 115 unmodified lines
116116 .maxGroupAddrInHash = 4,
117117 .maxIndAddrInHash = 4,
118118 .prel = 7,
119− .maxFrameLength = 1518,
119+ .maxFrameLength = 1518+16, /* Add extra bytes for VLANs etc. */
120120 .minFrameLength = 64,
121− .maxD1Length = 1520,
122− .maxD2Length = 1520,
121+ .maxD1Length = 1520+16, /* Add extra bytes for VLANs etc. */
122+ .maxD2Length = 1520+16, /* Add extra bytes for VLANs etc. */
123123 .vlantype = 0x8100,
124124 .ecamptr = ((uint32_t) NULL),
125125 .eventRegMask = UCCE_OTHER,
drivers/net/ethernet/freescale/ucc_geth.h+1−1
@@ -877,7 +877,7 @@ struct ucc_geth_hardware_statistics { · 876 unmodified lines
877877
878878 /* Driver definitions */
879879 #define TX_BD_RING_LEN 0x10
880−#define RX_BD_RING_LEN 0x10
880+#define RX_BD_RING_LEN 0x20
881881
882882 #define TX_RING_MOD_MASK(size) (size-1)
883883 #define RX_RING_MOD_MASK(size) (size-1)
drivers/net/ethernet/ibm/ehea/ehea_main.c+34−26
@@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void) · 289 unmodified lines
290290
291291 arr[i].adh = adapter->handle;
292292 arr[i].port_id = port->logical_port_id;
293− arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
294− EHEA_BCMC_MULTICAST |
293+ arr[i].reg_type = EHEA_BCMC_MULTICAST |
295294 EHEA_BCMC_UNTAGGED;
295+ if (mc_entry->macaddr == 0)
296+ arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
296297 arr[i++].macaddr = mc_entry->macaddr;
297298
298299 arr[i].adh = adapter->handle;
299300 arr[i].port_id = port->logical_port_id;
300− arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
301− EHEA_BCMC_MULTICAST |
301+ arr[i].reg_type = EHEA_BCMC_MULTICAST |
302302 EHEA_BCMC_VLANID_ALL;
303+ if (mc_entry->macaddr == 0)
304+ arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
303305 arr[i++].macaddr = mc_entry->macaddr;
304306 num_registrations -= 2;
305307 }
@@ -1838,8 +1840,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr, · 1532 unmodified lines
18381840 u64 hret;
18391841 u8 reg_type;
18401842
1841− reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST
1842− | EHEA_BCMC_UNTAGGED;
1843+ reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_UNTAGGED;
1844+ if (mc_mac_addr == 0)
1845+ reg_type |= EHEA_BCMC_SCOPE_ALL;
18431846
18441847 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
18451848 port->logical_port_id,
@@ -1847,8 +1850,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr, · 1 unmodified line
18471850 if (hret)
18481851 goto out;
18491852
1850− reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST
1851− | EHEA_BCMC_VLANID_ALL;
1853+ reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_VLANID_ALL;
1854+ if (mc_mac_addr == 0)
1855+ reg_type |= EHEA_BCMC_SCOPE_ALL;
18521856
18531857 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
18541858 port->logical_port_id,
@@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) · 43 unmodified lines
18981902 netdev_err(dev,
18991903 "failed enabling IFF_ALLMULTI\n");
19001904 }
1901− } else
1905+ } else {
19021906 if (!enable) {
19031907 /* Disable ALLMULTI */
19041908 hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC);
@@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable) · 3 unmodified lines
19081912 netdev_err(dev,
19091913 "failed disabling IFF_ALLMULTI\n");
19101914 }
1915+ }
19111916 }
19121917
19131918 static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr)
@@ -1941,11 +1946,7 @@ static void ehea_set_multicast_list(struct net_device *dev) · 27 unmodified lines
19411946 struct netdev_hw_addr *ha;
19421947 int ret;
19431948
1944− if (port->promisc) {
1945− ehea_promiscuous(dev, 1);
1946− return;
1947− }
1948− ehea_promiscuous(dev, 0);
1949+ ehea_promiscuous(dev, !!(dev->flags & IFF_PROMISC));
19491950
19501951 if (dev->flags & IFF_ALLMULTI) {
19511952 ehea_allmulti(dev, 1);
@@ -2463,6 +2464,7 @@ static int ehea_down(struct net_device *dev) · 511 unmodified lines
24632464 return 0;
24642465
24652466 ehea_drop_multicast_list(dev);
2467+ ehea_allmulti(dev, 0);
24662468 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
24672469
24682470 ehea_free_interrupts(dev);
@@ -3261,6 +3263,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, · 792 unmodified lines
32613263 struct ehea_adapter *adapter;
32623264 const u64 *adapter_handle;
32633265 int ret;
3266+ int i;
32643267
32653268 if (!dev || !dev->dev.of_node) {
32663269 pr_err("Invalid ibmebus device probed\n");
@@ -3314,17 +3317,9 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, · 47 unmodified lines
33143317 tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet,
33153318 (unsigned long)adapter);
33163319
3317− ret = ibmebus_request_irq(adapter->neq->attr.ist1,
3318− ehea_interrupt_neq, IRQF_DISABLED,
3319− "ehea_neq", adapter);
3320− if (ret) {
3321− dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
3322− goto out_kill_eq;
3323− }
3324−
33253320 ret = ehea_create_device_sysfs(dev);
33263321 if (ret)
3327− goto out_free_irq;
3322+ goto out_kill_eq;
33283323
33293324 ret = ehea_setup_ports(adapter);
33303325 if (ret) {
@@ -3332,15 +3327,28 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, · 1 unmodified line
33323327 goto out_rem_dev_sysfs;
33333328 }
33343329
3330+ ret = ibmebus_request_irq(adapter->neq->attr.ist1,
3331+ ehea_interrupt_neq, IRQF_DISABLED,
3332+ "ehea_neq", adapter);
3333+ if (ret) {
3334+ dev_err(&dev->dev, "requesting NEQ IRQ failed\n");
3335+ goto out_shutdown_ports;
3336+ }
3337+
3338+
33353339 ret = 0;
33363340 goto out;
33373341
3342+out_shutdown_ports:
3343+ for (i = 0; i < EHEA_MAX_PORTS; i++)
3344+ if (adapter->port[i]) {
3345+ ehea_shutdown_single_port(adapter->port[i]);
3346+ adapter->port[i] = NULL;
3347+ }
3348+
33383349 out_rem_dev_sysfs:
33393350 ehea_remove_device_sysfs(dev);
33403351
3341−out_free_irq:
3342− ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
3343−
33443352 out_kill_eq:
33453353 ehea_destroy_eq(adapter->neq);
33463354
drivers/net/ethernet/ibm/ehea/ehea_phyp.h+1−1
@@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num, · 449 unmodified lines
450450 void *cb_addr);
451451
452452 #define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63)
453−#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(61, 63)
453+#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(60, 63)
454454 #define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63)
455455 #define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)
456456
drivers/net/ethernet/intel/e1000e/netdev.c+1−1
@@ -3799,7 +3799,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter) · 3798 unmodified lines
37993799 /* fire an unusual interrupt on the test handler */
38003800 ew32(ICS, E1000_ICS_RXSEQ);
38013801 e1e_flush();
3802− msleep(50);
3802+ msleep(100);
38033803
38043804 e1000_irq_disable(adapter);
38053805
drivers/net/ethernet/intel/e1000e/param.c+53−46
@@ -106,7 +106,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay"); · 105 unmodified lines
106106 /*
107107 * Interrupt Throttle Rate (interrupts/sec)
108108 *
109− * Valid Range: 100-100000 (0=off, 1=dynamic, 3=dynamic conservative)
109+ * Valid Range: 100-100000 or one of: 0=off, 1=dynamic, 3=dynamic conservative
110110 */
111111 E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
112112 #define DEFAULT_ITR 3
@@ -344,53 +344,60 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter) · 231 unmodified lines
344344
345345 if (num_InterruptThrottleRate > bd) {
346346 adapter->itr = InterruptThrottleRate[bd];
347− switch (adapter->itr) {
348− case 0:
349− e_info("%s turned off\n", opt.name);
350− break;
351− case 1:
352− e_info("%s set to dynamic mode\n", opt.name);
353− adapter->itr_setting = adapter->itr;
354− adapter->itr = 20000;
355− break;
356− case 3:
357− e_info("%s set to dynamic conservative mode\n",
358− opt.name);
359− adapter->itr_setting = adapter->itr;
360− adapter->itr = 20000;
361− break;
362− case 4:
363− e_info("%s set to simplified (2000-8000 ints) "
364− "mode\n", opt.name);
365− adapter->itr_setting = 4;
366− break;
367− default:
368− /*
369− * Save the setting, because the dynamic bits
370− * change itr.
371− */
372− if (e1000_validate_option(&adapter->itr, &opt,
373− adapter) &&
374− (adapter->itr == 3)) {
375− /*
376− * In case of invalid user value,
377− * default to conservative mode.
378− */
379− adapter->itr_setting = adapter->itr;
380− adapter->itr = 20000;
381− } else {
382− /*
383− * Clear the lower two bits because
384− * they are used as control.
385− */
386− adapter->itr_setting =
387− adapter->itr & ~3;
388− }
389− break;
390− }
347+
348+ /*
349+ * Make sure a message is printed for non-special
350+ * values. And in case of an invalid option, display
351+ * warning, use default and got through itr/itr_setting
352+ * adjustment logic below
353+ */
354+ if ((adapter->itr > 4) &&
355+ e1000_validate_option(&adapter->itr, &opt, adapter))
356+ adapter->itr = opt.def;
391357 } else {
392− adapter->itr_setting = opt.def;
358+ /*
359+ * If no option specified, use default value and go
360+ * through the logic below to adjust itr/itr_setting
361+ */
362+ adapter->itr = opt.def;
363+
364+ /*
365+ * Make sure a message is printed for non-special
366+ * default values
367+ */
368+ if (adapter->itr > 40)
369+ e_info("%s set to default %d\n", opt.name,
370+ adapter->itr);
371+ }
372+
373+ adapter->itr_setting = adapter->itr;
374+ switch (adapter->itr) {
375+ case 0:
376+ e_info("%s turned off\n", opt.name);
377+ break;
378+ case 1:
379+ e_info("%s set to dynamic mode\n", opt.name);
380+ adapter->itr = 20000;
381+ break;
382+ case 3:
383+ e_info("%s set to dynamic conservative mode\n",
384+ opt.name);
393385 adapter->itr = 20000;
386+ break;
387+ case 4:
388+ e_info("%s set to simplified (2000-8000 ints) mode\n",
389+ opt.name);
390+ break;
391+ default:
392+ /*
393+ * Save the setting, because the dynamic bits
394+ * change itr.
395+ *
396+ * Clear the lower two bits because
397+ * they are used as control.
398+ */
399+ adapter->itr_setting &= ~3;
400+ break;
394401 }
395402 }
396403 { /* Interrupt Mode */
drivers/net/ethernet/intel/igbvf/netdev.c+2−2
@@ -2731,14 +2731,14 @@ static int __devinit igbvf_probe(struct pci_dev *pdev, · 2730 unmodified lines
27312731 netdev->addr_len);
27322732 }
27332733
2734− if (!is_valid_ether_addr(netdev->perm_addr)) {
2734+ if (!is_valid_ether_addr(netdev->dev_addr)) {
27352735 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
27362736 netdev->dev_addr);
27372737 err = -EIO;
27382738 goto err_hw_init;
27392739 }
27402740
2741− memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len);
2741+ memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
27422742
27432743 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog,
27442744 (unsigned long) adapter);
drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c+1−0
@@ -437,6 +437,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter, · 436 unmodified lines
437437 */
438438 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) &&
439439 (fctl & FC_FC_END_SEQ)) {
440+ skb_linearize(skb);
440441 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc));
441442 crc->fcoe_eof = FC_EOF_T;
442443 }
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c+5−4
@@ -4873,10 +4873,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) · 4872 unmodified lines
48734873 }
48744874
48754875 ixgbe_clear_interrupt_scheme(adapter);
4876−#ifdef CONFIG_DCB
4877− kfree(adapter->ixgbe_ieee_pfc);
4878− kfree(adapter->ixgbe_ieee_ets);
4879−#endif
48804876
48814877 #ifdef CONFIG_PM
48824878 retval = pci_save_state(pdev);
@@ -7224,6 +7220,11 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) · 2341 unmodified lines
72247220
72257221 ixgbe_release_hw_control(adapter);
72267222
7223+#ifdef CONFIG_DCB
7224+ kfree(adapter->ixgbe_ieee_pfc);
7225+ kfree(adapter->ixgbe_ieee_ets);
7226+
7227+#endif
72277228 iounmap(adapter->hw.hw_addr);
72287229 pci_release_selected_regions(pdev, pci_select_bars(pdev,
72297230 IORESOURCE_MEM));
drivers/net/ethernet/marvell/sky2.c+20−11
@@ -2494,8 +2494,13 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2, · 2493 unmodified lines
24942494 skb_copy_from_linear_data(re->skb, skb->data, length);
24952495 skb->ip_summed = re->skb->ip_summed;
24962496 skb->csum = re->skb->csum;
2497+ skb->rxhash = re->skb->rxhash;
2498+ skb->vlan_tci = re->skb->vlan_tci;
2499+
24972500 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
24982501 length, PCI_DMA_FROMDEVICE);
2502+ re->skb->vlan_tci = 0;
2503+ re->skb->rxhash = 0;
24992504 re->skb->ip_summed = CHECKSUM_NONE;
25002505 skb_put(skb, length);
25012506 }
@@ -2580,9 +2585,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev, · 78 unmodified lines
25802585 struct sk_buff *skb = NULL;
25812586 u16 count = (status & GMR_FS_LEN) >> 16;
25822587
2583− if (status & GMR_FS_VLAN)
2584− count -= VLAN_HLEN; /* Account for vlan tag */
2585−
25862588 netif_printk(sky2, rx_status, KERN_DEBUG, dev,
25872589 "rx slot %u status 0x%x len %d\n",
25882590 sky2->rx_next, status, length);
@@ -2590,6 +2592,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev, · 1 unmodified line
25902592 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
25912593 prefetch(sky2->rx_ring + sky2->rx_next);
25922594
2595+ if (vlan_tx_tag_present(re->skb))
2596+ count -= VLAN_HLEN; /* Account for vlan tag */
2597+
25932598 /* This chip has hardware problems that generates bogus status.
25942599 * So do only marginal checking and expect higher level protocols
25952600 * to handle crap frames.
@@ -2647,11 +2652,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last) · 51 unmodified lines
26472652 }
26482653
26492654 static inline void sky2_skb_rx(const struct sky2_port *sky2,
2650− u32 status, struct sk_buff *skb)
2655+ struct sk_buff *skb)
26512656 {
2652− if (status & GMR_FS_VLAN)
2653− __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));
2654−
26552657 if (skb->ip_summed == CHECKSUM_NONE)
26562658 netif_receive_skb(skb);
26572659 else
@@ -2705,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status) · 47 unmodified lines
27052707 }
27062708 }
27072709
2710+static void sky2_rx_tag(struct sky2_port *sky2, u16 length)
2711+{
2712+ struct sk_buff *skb;
2713+
2714+ skb = sky2->rx_ring[sky2->rx_next].skb;
2715+ __vlan_hwaccel_put_tag(skb, be16_to_cpu(length));
2716+}
2717+
27082718 static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
27092719 {
27102720 struct sk_buff *skb;
@@ -2763,8 +2773,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) · 52 unmodified lines
27632773 }
27642774
27652775 skb->protocol = eth_type_trans(skb, dev);
2766−
2767− sky2_skb_rx(sky2, status, skb);
2776+ sky2_skb_rx(sky2, skb);
27682777
27692778 /* Stop after net poll weight */
27702779 if (++work_done >= to_do)
@@ -2772,11 +2781,11 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) · 1 unmodified line
27722781 break;
27732782
27742783 case OP_RXVLAN:
2775− sky2->rx_tag = length;
2784+ sky2_rx_tag(sky2, length);
27762785 break;
27772786
27782787 case OP_RXCHKSVLAN:
2779− sky2->rx_tag = length;
2788+ sky2_rx_tag(sky2, length);
27802789 /* fall through */
27812790 case OP_RXCHKS:
27822791 if (likely(dev->features & NETIF_F_RXCSUM))
drivers/net/ethernet/marvell/sky2.h+0−1
@@ -2241,7 +2241,6 @@ struct sky2_port { · 2240 unmodified lines
22412241 u16 rx_pending;
22422242 u16 rx_data_size;
22432243 u16 rx_nfrags;
2244− u16 rx_tag;
22452244
22462245 struct {
22472246 unsigned long last;
drivers/net/ethernet/sun/sungem.c+1−1
@@ -2339,7 +2339,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state) · 2338 unmodified lines
23392339 netif_device_detach(dev);
23402340
23412341 /* Switch off chip, remember WOL setting */
2342− gp->asleep_wol = gp->wake_on_lan;
2342+ gp->asleep_wol = !!gp->wake_on_lan;
23432343 gem_do_stop(dev, gp->asleep_wol);
23442344
23452345 /* Unlock the network stack */
drivers/net/ethernet/ti/davinci_emac.c+1−1
@@ -1511,7 +1511,7 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd) · 1510 unmodified lines
15111511
15121512 static int match_first_device(struct device *dev, void *data)
15131513 {
1514− return 1;
1514+ return !strncmp(dev_name(dev), "davinci_mdio", 12);
15151515 }
15161516
15171517 /**
drivers/net/ethernet/ti/tlan.c+1−1
@@ -228,7 +228,7 @@ tlan_get_skb(const struct tlan_list *tag) · 227 unmodified lines
228228 unsigned long addr;
229229
230230 addr = tag->buffer[9].address;
231− addr |= (tag->buffer[8].address << 16) << 16;
231+ addr |= ((unsigned long) tag->buffer[8].address << 16) << 16;
232232 return (struct sk_buff *) addr;
233233 }
234234
drivers/net/usb/asix.c+2−2
@@ -355,7 +355,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb, · 354 unmodified lines
355355 u32 packet_len;
356356 u32 padbytes = 0xffff0000;
357357
358− padlen = ((skb->len + 4) % 512) ? 0 : 4;
358+ padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4;
359359
360360 if ((!skb_cloned(skb)) &&
361361 ((headroom + tailroom) >= (4 + padlen))) {
@@ -377,7 +377,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb, · 15 unmodified lines
377377 cpu_to_le32s(&packet_len);
378378 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
379379
380− if ((skb->len % 512) == 0) {
380+ if (padlen) {
381381 cpu_to_le32s(&padbytes);
382382 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
383383 skb_put(skb, sizeof(padbytes));
drivers/net/usb/smsc75xx.c+24−11
@@ -98,7 +98,7 @@ static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index, · 97 unmodified lines
9898
9999 if (unlikely(ret < 0))
100100 netdev_warn(dev->net,
101− "Failed to read register index 0x%08x", index);
101+ "Failed to read reg index 0x%08x: %d", index, ret);
102102
103103 le32_to_cpus(buf);
104104 *data = *buf;
@@ -128,7 +128,7 @@ static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index, · 23 unmodified lines
128128
129129 if (unlikely(ret < 0))
130130 netdev_warn(dev->net,
131− "Failed to write register index 0x%08x", index);
131+ "Failed to write reg index 0x%08x: %d", index, ret);
132132
133133 kfree(buf);
134134
@@ -171,7 +171,7 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx) · 36 unmodified lines
171171 idx &= dev->mii.reg_num_mask;
172172 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
173173 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
174− | MII_ACCESS_READ;
174+ | MII_ACCESS_READ | MII_ACCESS_BUSY;
175175 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
176176 check_warn_goto_done(ret, "Error writing MII_ACCESS");
177177
@@ -210,7 +210,7 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx, · 32 unmodified lines
210210 idx &= dev->mii.reg_num_mask;
211211 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
212212 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
213− | MII_ACCESS_WRITE;
213+ | MII_ACCESS_WRITE | MII_ACCESS_BUSY;
214214 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
215215 check_warn_goto_done(ret, "Error writing MII_ACCESS");
216216
@@ -508,9 +508,10 @@ static int smsc75xx_link_reset(struct usbnet *dev) · 291 unmodified lines
508508 u16 lcladv, rmtadv;
509509 int ret;
510510
511− /* clear interrupt status */
511+ /* read and write to clear phy interrupt status */
512512 ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
513513 check_warn_return(ret, "Error reading PHY_INT_SRC");
514+ smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC, 0xffff);
514515
515516 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
516517 check_warn_return(ret, "Error writing INT_STS");
@@ -643,7 +644,7 @@ static int smsc75xx_set_mac_address(struct usbnet *dev) · 126 unmodified lines
643644
644645 static int smsc75xx_phy_initialize(struct usbnet *dev)
645646 {
646− int bmcr, timeout = 0;
647+ int bmcr, ret, timeout = 0;
647648
648649 /* Initialize MII structure */
649650 dev->mii.dev = dev->net;
@@ -651,6 +652,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) · 1 unmodified line
651652 dev->mii.mdio_write = smsc75xx_mdio_write;
652653 dev->mii.phy_id_mask = 0x1f;
653654 dev->mii.reg_num_mask = 0x1f;
655+ dev->mii.supports_gmii = 1;
654656 dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID;
655657
656658 /* reset phy and wait for reset to complete */
@@ -661,7 +663,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) · 4 unmodified lines
661663 bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
662664 check_warn_return(bmcr, "Error reading MII_BMCR");
663665 timeout++;
664− } while ((bmcr & MII_BMCR) && (timeout < 100));
666+ } while ((bmcr & BMCR_RESET) && (timeout < 100));
665667
666668 if (timeout >= 100) {
667669 netdev_warn(dev->net, "timeout on PHY Reset");
@@ -671,10 +673,13 @@ static int smsc75xx_phy_initialize(struct usbnet *dev) · 3 unmodified lines
671673 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
672674 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
673675 ADVERTISE_PAUSE_ASYM);
676+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
677+ ADVERTISE_1000FULL);
674678
675− /* read to clear */
676− smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
677− check_warn_return(bmcr, "Error reading PHY_INT_SRC");
679+ /* read and write to clear phy interrupt status */
680+ ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
681+ check_warn_return(ret, "Error reading PHY_INT_SRC");
682+ smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_SRC, 0xffff);
678683
679684 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
680685 PHY_INT_MASK_DEFAULT);
@@ -946,6 +951,14 @@ static int smsc75xx_reset(struct usbnet *dev) · 265 unmodified lines
946951 ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf);
947952 check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret);
948953
954+ /* allow mac to detect speed and duplex from phy */
955+ ret = smsc75xx_read_reg(dev, MAC_CR, &buf);
956+ check_warn_return(ret, "Failed to read MAC_CR: %d", ret);
957+
958+ buf |= (MAC_CR_ADD | MAC_CR_ASD);
959+ ret = smsc75xx_write_reg(dev, MAC_CR, buf);
960+ check_warn_return(ret, "Failed to write MAC_CR: %d", ret);
961+
949962 ret = smsc75xx_read_reg(dev, MAC_TX, &buf);
950963 check_warn_return(ret, "Failed to read MAC_TX: %d", ret);
951964
@@ -1212,7 +1225,7 @@ static const struct driver_info smsc75xx_info = { · 260 unmodified lines
12121225 .rx_fixup = smsc75xx_rx_fixup,
12131226 .tx_fixup = smsc75xx_tx_fixup,
12141227 .status = smsc75xx_status,
1215− .flags = FLAG_ETHER | FLAG_SEND_ZLP,
1228+ .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
12161229 };
12171230
12181231 static const struct usb_device_id products[] = {
drivers/net/usb/smsc95xx.c+2−1
@@ -1017,6 +1017,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf) · 1016 unmodified lines
10171017 dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
10181018 dev->net->flags |= IFF_MULTICAST;
10191019 dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
1020+ dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
10201021 return 0;
10211022 }
10221023
@@ -1191,7 +1192,7 @@ static const struct driver_info smsc95xx_info = { · 168 unmodified lines
11911192 .rx_fixup = smsc95xx_rx_fixup,
11921193 .tx_fixup = smsc95xx_tx_fixup,
11931194 .status = smsc95xx_status,
1194− .flags = FLAG_ETHER | FLAG_SEND_ZLP,
1195+ .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
11951196 };
11961197
11971198 static const struct usb_device_id products[] = {
drivers/net/usb/usbnet.c+4−1
@@ -210,6 +210,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf) · 209 unmodified lines
210210 } else {
211211 usb_fill_int_urb(dev->interrupt, dev->udev, pipe,
212212 buf, maxp, intr_complete, dev, period);
213+ dev->interrupt->transfer_flags |= URB_FREE_BUFFER;
213214 dev_dbg(&intf->dev,
214215 "status ep%din, %d bytes period %d\n",
215216 usb_pipeendpoint(pipe), maxp, period);
@@ -1443,7 +1444,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) · 1227 unmodified lines
14431444
14441445 status = register_netdev (net);
14451446 if (status)
1446− goto out3;
1447+ goto out4;
14471448 netif_info(dev, probe, dev->net,
14481449 "register '%s' at usb-%s-%s, %s, %pM\n",
14491450 udev->dev.driver->name,
@@ -1461,6 +1462,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod) · 11 unmodified lines
14611462
14621463 return 0;
14631464
1465+out4:
1466+ usb_free_urb(dev->interrupt);
14641467 out3:
14651468 if (info->unbind)
14661469 info->unbind (dev, udev);
drivers/net/wireless/ath/ath5k/ahb.c+1−0
@@ -220,6 +220,7 @@ static int ath_ahb_remove(struct platform_device *pdev) · 219 unmodified lines
220220 }
221221
222222 ath5k_deinit_ah(ah);
223+ iounmap(ah->iobase);
223224 platform_set_drvdata(pdev, NULL);
224225 ieee80211_free_hw(hw);
225226
drivers/net/wireless/ath/ath9k/ar5008_phy.c+1−1
@@ -869,7 +869,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah, · 868 unmodified lines
869869 ar5008_hw_set_channel_regs(ah, chan);
870870 ar5008_hw_init_chain_masks(ah);
871871 ath9k_olc_init(ah);
872− ath9k_hw_apply_txpower(ah, chan);
872+ ath9k_hw_apply_txpower(ah, chan, false);
873873
874874 /* Write analog registers */
875875 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
drivers/net/wireless/ath/ath9k/ar9003_paprd.c+1−1
@@ -54,7 +54,7 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val) · 53 unmodified lines
5454
5555 if (val) {
5656 ah->paprd_table_write_done = true;
57− ath9k_hw_apply_txpower(ah, chan);
57+ ath9k_hw_apply_txpower(ah, chan, false);
5858 }
5959
6060 REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0,
drivers/net/wireless/ath/ath9k/ar9003_phy.c+1−1
@@ -694,7 +694,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah, · 693 unmodified lines
694694 ar9003_hw_override_ini(ah);
695695 ar9003_hw_set_channel_regs(ah, chan);
696696 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask);
697− ath9k_hw_apply_txpower(ah, chan);
697+ ath9k_hw_apply_txpower(ah, chan, false);
698698
699699 if (AR_SREV_9462(ah)) {
700700 if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0,
drivers/net/wireless/ath/ath9k/eeprom_9287.c+2−0
@@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah, · 823 unmodified lines
824824 regulatory->max_power_level = ratesArray[i];
825825 }
826826
827+ ath9k_hw_update_regulatory_maxpower(ah);
828+
827829 if (test)
828830 return;
829831
drivers/net/wireless/ath/ath9k/hw.c+5−4
@@ -1454,7 +1454,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah, · 1453 unmodified lines
14541454 return false;
14551455 }
14561456 ath9k_hw_set_clockrate(ah);
1457− ath9k_hw_apply_txpower(ah, chan);
1457+ ath9k_hw_apply_txpower(ah, chan, false);
14581458 ath9k_hw_rfbus_done(ah);
14591459
14601460 if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan))
@@ -2652,7 +2652,8 @@ static int get_antenna_gain(struct ath_hw *ah, struct ath9k_channel *chan) · 1191 unmodified lines
26522652 return ah->eep_ops->get_eeprom(ah, gain_param);
26532653 }
26542654
2655−void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
2655+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
2656+ bool test)
26562657 {
26572658 struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
26582659 struct ieee80211_channel *channel;
@@ -2673,7 +2674,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) · 14 unmodified lines
26732674
26742675 ah->eep_ops->set_txpower(ah, chan,
26752676 ath9k_regd_get_ctl(reg, chan),
2676− ant_reduction, new_pwr, false);
2677+ ant_reduction, new_pwr, test);
26772678 }
26782679
26792680 void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
@@ -2686,7 +2687,7 @@ void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) · 6 unmodified lines
26862687 if (test)
26872688 channel->max_power = MAX_RATE_POWER / 2;
26882689
2689− ath9k_hw_apply_txpower(ah, chan);
2690+ ath9k_hw_apply_txpower(ah, chan, test);
26902691
26912692 if (test)
26922693 channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2);
drivers/net/wireless/ath/ath9k/hw.h+2−1
@@ -985,7 +985,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len); · 984 unmodified lines
985985 /* PHY */
986986 void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
987987 u32 *coef_mantissa, u32 *coef_exponent);
988−void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan);
988+void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
989+ bool test);
989990
990991 /*
991992 * Code Specific to AR5008, AR9001 or AR9002,
drivers/net/wireless/b43/main.c+8−2
@@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw) · 4826 unmodified lines
48274827 out_mutex_unlock:
48284828 mutex_unlock(&wl->mutex);
48294829
4830− /* reload configuration */
4831− b43_op_config(hw, ~0);
4830+ /*
4831+ * Configuration may have been overwritten during initialization.
4832+ * Reload the configuration, but only if initialization was
4833+ * successful. Reloading the configuration after a failed init
4834+ * may hang the system.
4835+ */
4836+ if (!err)
4837+ b43_op_config(hw, ~0);
48324838
48334839 return err;
48344840 }
drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c+7−1
@@ -108,9 +108,15 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev, · 107 unmodified lines
108108 sdio_release_host(sdfunc);
109109 }
110110 } else if (regaddr == SDIO_CCCR_ABORT) {
111+ sdfunc = kmemdup(sdiodev->func[0], sizeof(struct sdio_func),
112+ GFP_KERNEL);
113+ if (!sdfunc)
114+ return -ENOMEM;
115+ sdfunc->num = 0;
111116 sdio_claim_host(sdfunc);
112117 sdio_writeb(sdfunc, *byte, regaddr, &err_ret);
113118 sdio_release_host(sdfunc);
119+ kfree(sdfunc);
114120 } else if (regaddr < 0xF0) {
115121 brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
116122 err_ret = -EPERM;
@@ -486,7 +492,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func, · 369 unmodified lines
486492 kfree(bus_if);
487493 return -ENOMEM;
488494 }
489− sdiodev->func[0] = func->card->sdio_func[0];
495+ sdiodev->func[0] = func;
490496 sdiodev->func[1] = func;
491497 sdiodev->bus_if = bus_if;
492498 bus_if->bus_priv.sdio = sdiodev;
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c+51−12
@@ -574,6 +574,8 @@ struct brcmf_sdio { · 573 unmodified lines
574574
575575 struct task_struct *dpc_tsk;
576576 struct completion dpc_wait;
577+ struct list_head dpc_tsklst;
578+ spinlock_t dpc_tl_lock;
577579
578580 struct semaphore sdsem;
579581
@@ -2594,29 +2596,58 @@ clkwait: · 2014 unmodified lines
25942596 return resched;
25952597 }
25962598
2599+static inline void brcmf_sdbrcm_adddpctsk(struct brcmf_sdio *bus)
2600+{
2601+ struct list_head *new_hd;
2602+ unsigned long flags;
2603+
2604+ if (in_interrupt())
2605+ new_hd = kzalloc(sizeof(struct list_head), GFP_ATOMIC);
2606+ else
2607+ new_hd = kzalloc(sizeof(struct list_head), GFP_KERNEL);
2608+ if (new_hd == NULL)
2609+ return;
2610+
2611+ spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2612+ list_add_tail(new_hd, &bus->dpc_tsklst);
2613+ spin_unlock_irqrestore(&bus->dpc_tl_lock, flags);
2614+}
2615+
25972616 static int brcmf_sdbrcm_dpc_thread(void *data)
25982617 {
25992618 struct brcmf_sdio *bus = (struct brcmf_sdio *) data;
2619+ struct list_head *cur_hd, *tmp_hd;
2620+ unsigned long flags;
26002621
26012622 allow_signal(SIGTERM);
26022623 /* Run until signal received */
26032624 while (1) {
26042625 if (kthread_should_stop())
26052626 break;
2606− if (!wait_for_completion_interruptible(&bus->dpc_wait)) {
2607− /* Call bus dpc unless it indicated down
2608− (then clean stop) */
2609− if (bus->sdiodev->bus_if->state != BRCMF_BUS_DOWN) {
2610− if (brcmf_sdbrcm_dpc(bus))
2611− complete(&bus->dpc_wait);
2612− } else {
2627+
2628+ if (list_empty(&bus->dpc_tsklst))
2629+ if (wait_for_completion_interruptible(&bus->dpc_wait))
2630+ break;
2631+
2632+ spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2633+ list_for_each_safe(cur_hd, tmp_hd, &bus->dpc_tsklst) {
2634+ spin_unlock_irqrestore(&bus->dpc_tl_lock, flags);
2635+
2636+ if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) {
26132637 /* after stopping the bus, exit thread */
26142638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev);
26152639 bus->dpc_tsk = NULL;
26162640 break;
26172641 }
2618− } else
2619− break;
2642+
2643+ if (brcmf_sdbrcm_dpc(bus))
2644+ brcmf_sdbrcm_adddpctsk(bus);
2645+
2646+ spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2647+ list_del(cur_hd);
2648+ kfree(cur_hd);
2649+ }
2650+ spin_unlock_irqrestore(&bus->dpc_tl_lock, flags);
26202651 }
26212652 return 0;
26222653 }
@@ -2669,8 +2700,10 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt) · 46 unmodified lines
26692700 /* Schedule DPC if needed to send queued packet(s) */
26702701 if (!bus->dpc_sched) {
26712702 bus->dpc_sched = true;
2672− if (bus->dpc_tsk)
2703+ if (bus->dpc_tsk) {
2704+ brcmf_sdbrcm_adddpctsk(bus);
26732705 complete(&bus->dpc_wait);
2706+ }
26742707 }
26752708
26762709 return ret;
@@ -3514,8 +3547,10 @@ void brcmf_sdbrcm_isr(void *arg) · 837 unmodified lines
35143547 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n");
35153548
35163549 bus->dpc_sched = true;
3517− if (bus->dpc_tsk)
3550+ if (bus->dpc_tsk) {
3551+ brcmf_sdbrcm_adddpctsk(bus);
35183552 complete(&bus->dpc_wait);
3553+ }
35193554 }
35203555
35213556 static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)
@@ -3559,8 +3594,10 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) · 37 unmodified lines
35593594 bus->ipend = true;
35603595
35613596 bus->dpc_sched = true;
3562− if (bus->dpc_tsk)
3597+ if (bus->dpc_tsk) {
3598+ brcmf_sdbrcm_adddpctsk(bus);
35633599 complete(&bus->dpc_wait);
3600+ }
35643601 }
35653602 }
35663603
@@ -3897,6 +3934,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev) · 330 unmodified lines
38973934 }
38983935 /* Initialize DPC thread */
38993936 init_completion(&bus->dpc_wait);
3937+ INIT_LIST_HEAD(&bus->dpc_tsklst);
3938+ spin_lock_init(&bus->dpc_tl_lock);
39003939 bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread,
39013940 bus, "brcmf_dpc");
39023941 if (IS_ERR(bus->dpc_tsk)) {
drivers/net/wireless/brcm80211/brcmsmac/main.c+1−2
@@ -847,8 +847,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) · 846 unmodified lines
847847 */
848848 if (!(txs->status & TX_STATUS_AMPDU)
849849 && (txs->status & TX_STATUS_INTERMEDIATE)) {
850− wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n",
851− __func__);
850+ BCMMSG(wlc->wiphy, "INTERMEDIATE but not AMPDU\n");
852851 return false;
853852 }
854853
drivers/net/wireless/ipw2x00/ipw2200.c+12−1
@@ -2191,6 +2191,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd) · 2190 unmodified lines
21912191 {
21922192 int rc = 0;
21932193 unsigned long flags;
2194+ unsigned long now, end;
21942195
21952196 spin_lock_irqsave(&priv->lock, flags);
21962197 if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -2232,10 +2233,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd) · 35 unmodified lines
22322233 }
22332234 spin_unlock_irqrestore(&priv->lock, flags);
22342235
2236+ now = jiffies;
2237+ end = now + HOST_COMPLETE_TIMEOUT;
2238+again:
22352239 rc = wait_event_interruptible_timeout(priv->wait_command_queue,
22362240 !(priv->
22372241 status & STATUS_HCMD_ACTIVE),
2238− HOST_COMPLETE_TIMEOUT);
2242+ end - now);
2243+ if (rc < 0) {
2244+ now = jiffies;
2245+ if (time_before(now, end))
2246+ goto again;
2247+ rc = 0;
2248+ }
2249+
22392250 if (rc == 0) {
22402251 spin_lock_irqsave(&priv->lock, flags);
22412252 if (priv->status & STATUS_HCMD_ACTIVE) {
drivers/net/wireless/iwlwifi/iwl-1000.c+4−4
@@ -46,8 +46,8 @@ · 45 unmodified lines
4646 #include "iwl-prph.h"
4747
4848 /* Highest firmware API version supported */
49−#define IWL1000_UCODE_API_MAX 6
50−#define IWL100_UCODE_API_MAX 6
49+#define IWL1000_UCODE_API_MAX 5
50+#define IWL100_UCODE_API_MAX 5
5151
5252 /* Oldest version we won't warn about */
5353 #define IWL1000_UCODE_API_OK 5
@@ -226,5 +226,5 @@ const struct iwl_cfg iwl100_bg_cfg = { · 172 unmodified lines
226226 IWL_DEVICE_100,
227227 };
228228
229−MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX));
230−MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX));
229+MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
230+MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));
drivers/net/wireless/iwlwifi/iwl-2000.c+8−8
@@ -51,10 +51,10 @@ · 50 unmodified lines
5151 #define IWL135_UCODE_API_MAX 6
5252
5353 /* Oldest version we won't warn about */
54−#define IWL2030_UCODE_API_OK 5
55−#define IWL2000_UCODE_API_OK 5
56−#define IWL105_UCODE_API_OK 5
57−#define IWL135_UCODE_API_OK 5
54+#define IWL2030_UCODE_API_OK 6
55+#define IWL2000_UCODE_API_OK 6
56+#define IWL105_UCODE_API_OK 6
57+#define IWL135_UCODE_API_OK 6
5858
5959 /* Lowest firmware API version supported */
6060 #define IWL2030_UCODE_API_MIN 5
@@ -328,7 +328,7 @@ const struct iwl_cfg iwl135_bgn_cfg = { · 267 unmodified lines
328328 .ht_params = &iwl2000_ht_params,
329329 };
330330
331−MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX));
332−MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX));
333−MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX));
334−MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX));
331+MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
332+MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
333+MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
334+MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));
drivers/net/wireless/iwlwifi/iwl-5000.c+9−2
@@ -51,6 +51,10 @@ · 50 unmodified lines
5151 #define IWL5000_UCODE_API_MAX 5
5252 #define IWL5150_UCODE_API_MAX 2
5353
54+/* Oldest version we won't warn about */
55+#define IWL5000_UCODE_API_OK 5
56+#define IWL5150_UCODE_API_OK 2
57+
5458 /* Lowest firmware API version supported */
5559 #define IWL5000_UCODE_API_MIN 1
5660 #define IWL5150_UCODE_API_MIN 1
@@ -326,6 +330,7 @@ static const struct iwl_ht_params iwl5000_ht_params = { · 269 unmodified lines
326330 #define IWL_DEVICE_5000 \
327331 .fw_name_pre = IWL5000_FW_PRE, \
328332 .ucode_api_max = IWL5000_UCODE_API_MAX, \
333+ .ucode_api_ok = IWL5000_UCODE_API_OK, \
329334 .ucode_api_min = IWL5000_UCODE_API_MIN, \
330335 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
331336 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
@@ -371,6 +376,7 @@ const struct iwl_cfg iwl5350_agn_cfg = { · 39 unmodified lines
371376 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
372377 .fw_name_pre = IWL5000_FW_PRE,
373378 .ucode_api_max = IWL5000_UCODE_API_MAX,
379+ .ucode_api_ok = IWL5000_UCODE_API_OK,
374380 .ucode_api_min = IWL5000_UCODE_API_MIN,
375381 .max_inst_size = IWLAGN_RTC_INST_SIZE,
376382 .max_data_size = IWLAGN_RTC_DATA_SIZE,
@@ -386,6 +392,7 @@ const struct iwl_cfg iwl5350_agn_cfg = { · 9 unmodified lines
386392 #define IWL_DEVICE_5150 \
387393 .fw_name_pre = IWL5150_FW_PRE, \
388394 .ucode_api_max = IWL5150_UCODE_API_MAX, \
395+ .ucode_api_ok = IWL5150_UCODE_API_OK, \
389396 .ucode_api_min = IWL5150_UCODE_API_MIN, \
390397 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
391398 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
@@ -409,5 +416,5 @@ const struct iwl_cfg iwl5150_abg_cfg = { · 17 unmodified lines
409416 IWL_DEVICE_5150,
410417 };
411418
412−MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX));
413−MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX));
419+MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
420+MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));
drivers/net/wireless/iwlwifi/iwl-6000.c+6−4
@@ -53,6 +53,8 @@ · 52 unmodified lines
5353 /* Oldest version we won't warn about */
5454 #define IWL6000_UCODE_API_OK 4
5555 #define IWL6000G2_UCODE_API_OK 5
56+#define IWL6050_UCODE_API_OK 5
57+#define IWL6000G2B_UCODE_API_OK 6
5658
5759 /* Lowest firmware API version supported */
5860 #define IWL6000_UCODE_API_MIN 4
@@ -388,7 +390,7 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = { · 329 unmodified lines
388390 #define IWL_DEVICE_6030 \
389391 .fw_name_pre = IWL6030_FW_PRE, \
390392 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
391− .ucode_api_ok = IWL6000G2_UCODE_API_OK, \
393+ .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
392394 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
393395 .max_inst_size = IWL60_RTC_INST_SIZE, \
394396 .max_data_size = IWL60_RTC_DATA_SIZE, \
@@ -557,6 +559,6 @@ const struct iwl_cfg iwl6000_3agn_cfg = { · 162 unmodified lines
557559 };
558560
559561 MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
560−MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX));
561−MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
562−MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX));
562+MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
563+MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
564+MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));
drivers/net/wireless/iwlwifi/iwl-agn.c+0−3
@@ -863,7 +863,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work) · 862 unmodified lines
863863
864864 void iwlagn_prepare_restart(struct iwl_priv *priv)
865865 {
866− struct iwl_rxon_context *ctx;
867866 bool bt_full_concurrent;
868867 u8 bt_ci_compliance;
869868 u8 bt_load;
@@ -872,8 +871,6 @@ void iwlagn_prepare_restart(struct iwl_priv *priv) · 2 unmodified lines
872871
873872 lockdep_assert_held(&priv->mutex);
874873
875− for_each_context(priv, ctx)
876− ctx->vif = NULL;
877874 priv->is_open = 0;
878875
879876 /*
drivers/net/wireless/iwlwifi/iwl-fh.h+19−5
@@ -104,15 +104,29 @@ · 103 unmodified lines
104104 * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04
105105 * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte
106106 * aligned (address bits 0-7 must be 0).
107+ * Later devices have 20 (5000 series) or 30 (higher) queues, but the registers
108+ * for them are in different places.
107109 *
108110 * Bit fields in each pointer register:
109111 * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned
110112 */
111−#define FH_MEM_CBBC_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0)
112−#define FH_MEM_CBBC_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10)
113−
114−/* Find TFD CB base pointer for given queue (range 0-15). */
115−#define FH_MEM_CBBC_QUEUE(x) (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4)
113+#define FH_MEM_CBBC_0_15_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0)
114+#define FH_MEM_CBBC_0_15_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10)
115+#define FH_MEM_CBBC_16_19_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xBF0)
116+#define FH_MEM_CBBC_16_19_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xC00)
117+#define FH_MEM_CBBC_20_31_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xB20)
118+#define FH_MEM_CBBC_20_31_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xB80)
119+
120+/* Find TFD CB base pointer for given queue */
121+static inline unsigned int FH_MEM_CBBC_QUEUE(unsigned int chnl)
122+{
123+ if (chnl < 16)
124+ return FH_MEM_CBBC_0_15_LOWER_BOUND + 4 * chnl;
125+ if (chnl < 20)
126+ return FH_MEM_CBBC_16_19_LOWER_BOUND + 4 * (chnl - 16);
127+ WARN_ON_ONCE(chnl >= 32);
128+ return FH_MEM_CBBC_20_31_LOWER_BOUND + 4 * (chnl - 20);
129+}
116130
117131
118132 /**
drivers/net/wireless/iwlwifi/iwl-mac80211.c+9−1
@@ -1244,6 +1244,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, · 1243 unmodified lines
12441244 struct iwl_rxon_context *tmp, *ctx = NULL;
12451245 int err;
12461246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
1247+ bool reset = false;
12471248
12481249 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
12491250 viftype, vif->addr);
@@ -1265,6 +1266,13 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, · 15 unmodified lines
12651266 tmp->interface_modes | tmp->exclusive_interface_modes;
12661267
12671268 if (tmp->vif) {
1269+ /* On reset we need to add the same interface again */
1270+ if (tmp->vif == vif) {
1271+ reset = true;
1272+ ctx = tmp;
1273+ break;
1274+ }
1275+
12681276 /* check if this busy context is exclusive */
12691277 if (tmp->exclusive_interface_modes &
12701278 BIT(tmp->vif->type)) {
@@ -1291,7 +1299,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw, · 20 unmodified lines
12911299 ctx->vif = vif;
12921300
12931301 err = iwl_setup_interface(priv, ctx);
1294− if (!err)
1302+ if (!err || reset)
12951303 goto out;
12961304
12971305 ctx->vif = NULL;
drivers/net/wireless/iwlwifi/iwl-prph.h+24−3
@@ -223,12 +223,33 @@ · 222 unmodified lines
223223 #define SCD_AIT (SCD_BASE + 0x0c)
224224 #define SCD_TXFACT (SCD_BASE + 0x10)
225225 #define SCD_ACTIVE (SCD_BASE + 0x14)
226−#define SCD_QUEUE_WRPTR(x) (SCD_BASE + 0x18 + (x) * 4)
227−#define SCD_QUEUE_RDPTR(x) (SCD_BASE + 0x68 + (x) * 4)
228226 #define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8)
229227 #define SCD_AGGR_SEL (SCD_BASE + 0x248)
230228 #define SCD_INTERRUPT_MASK (SCD_BASE + 0x108)
231−#define SCD_QUEUE_STATUS_BITS(x) (SCD_BASE + 0x10c + (x) * 4)
229+
230+static inline unsigned int SCD_QUEUE_WRPTR(unsigned int chnl)
231+{
232+ if (chnl < 20)
233+ return SCD_BASE + 0x18 + chnl * 4;
234+ WARN_ON_ONCE(chnl >= 32);
235+ return SCD_BASE + 0x284 + (chnl - 20) * 4;
236+}
237+
238+static inline unsigned int SCD_QUEUE_RDPTR(unsigned int chnl)
239+{
240+ if (chnl < 20)
241+ return SCD_BASE + 0x68 + chnl * 4;
242+ WARN_ON_ONCE(chnl >= 32);
243+ return SCD_BASE + 0x2B4 + (chnl - 20) * 4;
244+}
245+
246+static inline unsigned int SCD_QUEUE_STATUS_BITS(unsigned int chnl)
247+{
248+ if (chnl < 20)
249+ return SCD_BASE + 0x10c + chnl * 4;
250+ WARN_ON_ONCE(chnl >= 32);
251+ return SCD_BASE + 0x384 + (chnl - 20) * 4;
252+}
232253
233254 /*********************** END TX SCHEDULER *************************************/
234255
drivers/net/wireless/rtlwifi/pci.c+1−0
@@ -1941,6 +1941,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev) · 1940 unmodified lines
19411941 rtl_deinit_deferred_work(hw);
19421942 rtlpriv->intf_ops->adapter_stop(hw);
19431943 }
1944+ rtlpriv->cfg->ops->disable_interrupt(hw);
19441945
19451946 /*deinit rfkill */
19461947 rtl_deinit_rfkill(hw);
drivers/net/wireless/wl1251/main.c+1−0
@@ -479,6 +479,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw) · 478 unmodified lines
479479 cancel_work_sync(&wl->irq_work);
480480 cancel_work_sync(&wl->tx_work);
481481 cancel_work_sync(&wl->filter_work);
482+ cancel_delayed_work_sync(&wl->elp_work);
482483
483484 mutex_lock(&wl->mutex);
484485
drivers/net/wireless/wl1251/sdio.c+1−1
@@ -315,8 +315,8 @@ static void __devexit wl1251_sdio_remove(struct sdio_func *func) · 314 unmodified lines
315315
316316 if (wl->irq)
317317 free_irq(wl->irq, wl);
318− kfree(wl_sdio);
319318 wl1251_free_hw(wl);
319+ kfree(wl_sdio);
320320
321321 sdio_claim_host(func);
322322 sdio_release_irq(func);
drivers/s390/net/qeth_core_main.c+4−2
@@ -1672,7 +1672,8 @@ static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd) · 1671 unmodified lines
16721672 {
16731673 QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
16741674
1675− if (prcd[74] == 0xF0 && prcd[75] == 0xF0 && prcd[76] == 0xF5) {
1675+ if (prcd[74] == 0xF0 && prcd[75] == 0xF0 &&
1676+ (prcd[76] == 0xF5 || prcd[76] == 0xF6)) {
16761677 card->info.blkt.time_total = 250;
16771678 card->info.blkt.inter_packet = 5;
16781679 card->info.blkt.inter_packet_jumbo = 15;
@@ -4540,7 +4541,8 @@ static void qeth_determine_capabilities(struct qeth_card *card) · 2861 unmodified lines
45404541 goto out_offline;
45414542 }
45424543 qeth_configure_unitaddr(card, prcd);
4543− qeth_configure_blkt_default(card, prcd);
4544+ if (ddev_offline)
4545+ qeth_configure_blkt_default(card, prcd);
45444546 kfree(prcd);
45454547
45464548 rc = qdio_get_ssqd_desc(ddev, &card->ssqd);
include/linux/netfilter_bridge.h+9−0
@@ -104,9 +104,18 @@ struct bridge_skb_cb { · 103 unmodified lines
104104 } daddr;
105105 };
106106
107+static inline void br_drop_fake_rtable(struct sk_buff *skb)
108+{
109+ struct dst_entry *dst = skb_dst(skb);
110+
111+ if (dst && (dst->flags & DST_FAKE_RTABLE))
112+ skb_dst_drop(skb);
113+}
114+
107115 #else
108116 #define nf_bridge_maybe_copy_header(skb) (0)
109117 #define nf_bridge_pad(skb) (0)
118+#define br_drop_fake_rtable(skb) do { } while (0)
110119 #endif /* CONFIG_BRIDGE_NETFILTER */
111120
112121 #endif /* __KERNEL__ */
include/linux/skbuff.h+2−2
@@ -1020,7 +1020,7 @@ static inline void skb_queue_splice(const struct sk_buff_head *list, · 1019 unmodified lines
10201020 }
10211021
10221022 /**
1023− * skb_queue_splice - join two skb lists and reinitialise the emptied list
1023+ * skb_queue_splice_init - join two skb lists and reinitialise the emptied list
10241024 * @list: the new list to add
10251025 * @head: the place to add it in the first list
10261026 *
@@ -1051,7 +1051,7 @@ static inline void skb_queue_splice_tail(const struct sk_buff_head *list, · 24 unmodified lines
10511051 }
10521052
10531053 /**
1054− * skb_queue_splice_tail - join two skb lists and reinitialise the emptied list
1054+ * skb_queue_splice_tail_init - join two skb lists and reinitialise the emptied list
10551055 * @list: the new list to add
10561056 * @head: the place to add it in the first list
10571057 *
include/net/bluetooth/hci_core.h+2−1
@@ -314,6 +314,7 @@ struct hci_conn { · 313 unmodified lines
314314
315315 __u8 remote_cap;
316316 __u8 remote_auth;
317+ bool flush_key;
317318
318319 unsigned int sent;
319320
@@ -980,7 +981,7 @@ int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable); · 660 unmodified lines
980981 int mgmt_connectable(struct hci_dev *hdev, u8 connectable);
981982 int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
982983 int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
983− u8 persistent);
984+ bool persistent);
984985 int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
985986 u8 addr_type, u32 flags, u8 *name, u8 name_len,
986987 u8 *dev_class);
include/net/dst.h+1−0
@@ -59,6 +59,7 @@ struct dst_entry { · 58 unmodified lines
5959 #define DST_NOCACHE 0x0010
6060 #define DST_NOCOUNT 0x0020
6161 #define DST_NOPEER 0x0040
62+#define DST_FAKE_RTABLE 0x0080
6263
6364 short error;
6465 short obsolete;
include/net/ip_vs.h+3−1
@@ -393,7 +393,7 @@ struct ip_vs_protocol { · 392 unmodified lines
393393
394394 void (*exit)(struct ip_vs_protocol *pp);
395395
396− void (*init_netns)(struct net *net, struct ip_vs_proto_data *pd);
396+ int (*init_netns)(struct net *net, struct ip_vs_proto_data *pd);
397397
398398 void (*exit_netns)(struct net *net, struct ip_vs_proto_data *pd);
399399
@@ -1203,6 +1203,8 @@ ip_vs_lookup_real_service(struct net *net, int af, __u16 protocol, · 803 unmodified lines
12031203
12041204 extern int ip_vs_use_count_inc(void);
12051205 extern void ip_vs_use_count_dec(void);
1206+extern int ip_vs_register_nl_ioctl(void);
1207+extern void ip_vs_unregister_nl_ioctl(void);
12061208 extern int ip_vs_control_init(void);
12071209 extern void ip_vs_control_cleanup(void);
12081210 extern struct ip_vs_dest *
include/net/sock.h+2−2
@@ -1129,9 +1129,9 @@ sk_sockets_allocated_read_positive(struct sock *sk) · 1128 unmodified lines
11291129 struct proto *prot = sk->sk_prot;
11301130
11311131 if (mem_cgroup_sockets_enabled && sk->sk_cgrp)
1132− return percpu_counter_sum_positive(sk->sk_cgrp->sockets_allocated);
1132+ return percpu_counter_read_positive(sk->sk_cgrp->sockets_allocated);
11331133
1134− return percpu_counter_sum_positive(prot->sockets_allocated);
1134+ return percpu_counter_read_positive(prot->sockets_allocated);
11351135 }
11361136
11371137 static inline int
net/bluetooth/hci_core.c+13−14
@@ -1215,40 +1215,40 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr) · 1214 unmodified lines
12151215 return NULL;
12161216 }
12171217
1218−static int hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,
1218+static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,
12191219 u8 key_type, u8 old_key_type)
12201220 {
12211221 /* Legacy key */
12221222 if (key_type < 0x03)
1223− return 1;
1223+ return true;
12241224
12251225 /* Debug keys are insecure so don't store them persistently */
12261226 if (key_type == HCI_LK_DEBUG_COMBINATION)
1227− return 0;
1227+ return false;
12281228
12291229 /* Changed combination key and there's no previous one */
12301230 if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff)
1231− return 0;
1231+ return false;
12321232
12331233 /* Security mode 3 case */
12341234 if (!conn)
1235− return 1;
1235+ return true;
12361236
12371237 /* Neither local nor remote side had no-bonding as requirement */
12381238 if (conn->auth_type > 0x01 && conn->remote_auth > 0x01)
1239− return 1;
1239+ return true;
12401240
12411241 /* Local side had dedicated bonding as requirement */
12421242 if (conn->auth_type == 0x02 || conn->auth_type == 0x03)
1243− return 1;
1243+ return true;
12441244
12451245 /* Remote side had dedicated bonding as requirement */
12461246 if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03)
1247− return 1;
1247+ return true;
12481248
12491249 /* If none of the above criteria match, then don't store the key
12501250 * persistently */
1251− return 0;
1251+ return false;
12521252 }
12531253
12541254 struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8])
@@ -1285,7 +1285,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, · 30 unmodified lines
12851285 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len)
12861286 {
12871287 struct link_key *key, *old_key;
1288− u8 old_key_type, persistent;
1288+ u8 old_key_type;
1289+ bool persistent;
12891290
12901291 old_key = hci_find_link_key(hdev, bdaddr);
12911292 if (old_key) {
@@ -1328,10 +1329,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, · 36 unmodified lines
13281329
13291330 mgmt_new_link_key(hdev, key, persistent);
13301331
1331− if (!persistent) {
1332− list_del(&key->list);
1333− kfree(key);
1334− }
1332+ if (conn)
1333+ conn->flush_key = !persistent;
13351334
13361335 return 0;
13371336 }
net/bluetooth/hci_event.c+3−0
@@ -1901,6 +1901,8 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff · 1900 unmodified lines
19011901 }
19021902
19031903 if (ev->status == 0) {
1904+ if (conn->type == ACL_LINK && conn->flush_key)
1905+ hci_remove_link_key(hdev, &conn->dst);
19041906 hci_proto_disconn_cfm(conn, ev->reason);
19051907 hci_conn_del(conn);
19061908 }
@@ -2311,6 +2313,7 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk · 404 unmodified lines
23112313
23122314 case HCI_OP_USER_PASSKEY_NEG_REPLY:
23132315 hci_cc_user_passkey_neg_reply(hdev, skb);
2316+ break;
23142317
23152318 case HCI_OP_LE_SET_SCAN_PARAM:
23162319 hci_cc_le_set_scan_param(hdev, skb);
net/bluetooth/mgmt.c+1−1
@@ -2884,7 +2884,7 @@ int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status) · 2883 unmodified lines
28842884 return 0;
28852885 }
28862886
2887−int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, u8 persistent)
2887+int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, bool persistent)
28882888 {
28892889 struct mgmt_ev_new_link_key ev;
28902890
net/bridge/br_forward.c+1−0
@@ -47,6 +47,7 @@ int br_dev_queue_push_xmit(struct sk_buff *skb) · 46 unmodified lines
4747 kfree_skb(skb);
4848 } else {
4949 skb_push(skb, ETH_HLEN);
50+ br_drop_fake_rtable(skb);
5051 dev_queue_xmit(skb);
5152 }
5253
net/bridge/br_netfilter.c+2−6
@@ -156,7 +156,7 @@ void br_netfilter_rtable_init(struct net_bridge *br) · 155 unmodified lines
156156 rt->dst.dev = br->dev;
157157 rt->dst.path = &rt->dst;
158158 dst_init_metrics(&rt->dst, br_dst_default_metrics, true);
159− rt->dst.flags = DST_NOXFRM | DST_NOPEER;
159+ rt->dst.flags = DST_NOXFRM | DST_NOPEER | DST_FAKE_RTABLE;
160160 rt->dst.ops = &fake_dst_ops;
161161 }
162162
@@ -694,11 +694,7 @@ static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff *skb, · 531 unmodified lines
694694 const struct net_device *out,
695695 int (*okfn)(struct sk_buff *))
696696 {
697− struct rtable *rt = skb_rtable(skb);
698−
699− if (rt && rt == bridge_parent_rtable(in))
700− skb_dst_drop(skb);
701−
697+ br_drop_fake_rtable(skb);
702698 return NF_ACCEPT;
703699 }
704700
net/core/drop_monitor.c+64−24
@@ -42,13 +42,14 @@ static void send_dm_alert(struct work_struct *unused); · 41 unmodified lines
4242 * netlink alerts
4343 */
4444 static int trace_state = TRACE_OFF;
45−static DEFINE_SPINLOCK(trace_state_lock);
45+static DEFINE_MUTEX(trace_state_mutex);
4646
4747 struct per_cpu_dm_data {
4848 struct work_struct dm_alert_work;
49− struct sk_buff *skb;
49+ struct sk_buff __rcu *skb;
5050 atomic_t dm_hit_count;
5151 struct timer_list send_timer;
52+ int cpu;
5253 };
5354
5455 struct dm_hw_stat_delta {
@@ -79,29 +80,53 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data) · 24 unmodified lines
7980 size_t al;
8081 struct net_dm_alert_msg *msg;
8182 struct nlattr *nla;
83+ struct sk_buff *skb;
84+ struct sk_buff *oskb = rcu_dereference_protected(data->skb, 1);
8285
8386 al = sizeof(struct net_dm_alert_msg);
8487 al += dm_hit_limit * sizeof(struct net_dm_drop_point);
8588 al += sizeof(struct nlattr);
8689
87− data->skb = genlmsg_new(al, GFP_KERNEL);
88− genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family,
89− 0, NET_DM_CMD_ALERT);
90− nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg));
91− msg = nla_data(nla);
92− memset(msg, 0, al);
93− atomic_set(&data->dm_hit_count, dm_hit_limit);
90+ skb = genlmsg_new(al, GFP_KERNEL);
91+
92+ if (skb) {
93+ genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
94+ 0, NET_DM_CMD_ALERT);
95+ nla = nla_reserve(skb, NLA_UNSPEC,
96+ sizeof(struct net_dm_alert_msg));
97+ msg = nla_data(nla);
98+ memset(msg, 0, al);
99+ } else
100+ schedule_work_on(data->cpu, &data->dm_alert_work);
101+
102+ /*
103+ * Don't need to lock this, since we are guaranteed to only
104+ * run this on a single cpu at a time.
105+ * Note also that we only update data->skb if the old and new skb
106+ * pointers don't match. This ensures that we don't continually call
107+ * synchornize_rcu if we repeatedly fail to alloc a new netlink message.
108+ */
109+ if (skb != oskb) {
110+ rcu_assign_pointer(data->skb, skb);
111+
112+ synchronize_rcu();
113+
114+ atomic_set(&data->dm_hit_count, dm_hit_limit);
115+ }
116+
94117 }
95118
96119 static void send_dm_alert(struct work_struct *unused)
97120 {
98121 struct sk_buff *skb;
99− struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
122+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
123+
124+ WARN_ON_ONCE(data->cpu != smp_processor_id());
100125
101126 /*
102127 * Grab the skb we're about to send
103128 */
104− skb = data->skb;
129+ skb = rcu_dereference_protected(data->skb, 1);
105130
106131 /*
107132 * Replace it with a new one
@@ -111,8 +136,10 @@ static void send_dm_alert(struct work_struct *unused) · 3 unmodified lines
111136 /*
112137 * Ship it!
113138 */
114− genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
139+ if (skb)
140+ genlmsg_multicast(skb, 0, NET_DM_GRP_ALERT, GFP_KERNEL);
115141
142+ put_cpu_var(dm_cpu_data);
116143 }
117144
118145 /*
@@ -123,9 +150,11 @@ static void send_dm_alert(struct work_struct *unused) · 4 unmodified lines
123150 */
124151 static void sched_send_work(unsigned long unused)
125152 {
126− struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
153+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
154+
155+ schedule_work_on(smp_processor_id(), &data->dm_alert_work);
127156
128− schedule_work(&data->dm_alert_work);
157+ put_cpu_var(dm_cpu_data);
129158 }
130159
131160 static void trace_drop_common(struct sk_buff *skb, void *location)
@@ -134,8 +163,15 @@ static void trace_drop_common(struct sk_buff *skb, void *location) · 2 unmodified lines
134163 struct nlmsghdr *nlh;
135164 struct nlattr *nla;
136165 int i;
137− struct per_cpu_dm_data *data = &__get_cpu_var(dm_cpu_data);
166+ struct sk_buff *dskb;
167+ struct per_cpu_dm_data *data = &get_cpu_var(dm_cpu_data);
168+
169+
170+ rcu_read_lock();
171+ dskb = rcu_dereference(data->skb);
138172
173+ if (!dskb)
174+ goto out;
139175
140176 if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
141177 /*
@@ -144,7 +180,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) · 2 unmodified lines
144180 goto out;
145181 }
146182
147− nlh = (struct nlmsghdr *)data->skb->data;
183+ nlh = (struct nlmsghdr *)dskb->data;
148184 nla = genlmsg_data(nlmsg_data(nlh));
149185 msg = nla_data(nla);
150186 for (i = 0; i < msg->entries; i++) {
@@ -158,7 +194,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location) · 7 unmodified lines
158194 /*
159195 * We need to create a new entry
160196 */
161− __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point));
197+ __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
162198 nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
163199 memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
164200 msg->points[msg->entries].count = 1;
@@ -170,6 +206,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location) · 5 unmodified lines
170206 }
171207
172208 out:
209+ rcu_read_unlock();
210+ put_cpu_var(dm_cpu_data);
173211 return;
174212 }
175213
@@ -214,7 +252,7 @@ static int set_all_monitor_traces(int state) · 38 unmodified lines
214252 struct dm_hw_stat_delta *new_stat = NULL;
215253 struct dm_hw_stat_delta *temp;
216254
217− spin_lock(&trace_state_lock);
255+ mutex_lock(&trace_state_mutex);
218256
219257 if (state == trace_state) {
220258 rc = -EAGAIN;
@@ -253,7 +291,7 @@ static int set_all_monitor_traces(int state) · 32 unmodified lines
253291 rc = -EINPROGRESS;
254292
255293 out_unlock:
256− spin_unlock(&trace_state_lock);
294+ mutex_unlock(&trace_state_mutex);
257295
258296 return rc;
259297 }
@@ -296,12 +334,12 @@ static int dropmon_net_event(struct notifier_block *ev_block, · 36 unmodified lines
296334
297335 new_stat->dev = dev;
298336 new_stat->last_rx = jiffies;
299− spin_lock(&trace_state_lock);
337+ mutex_lock(&trace_state_mutex);
300338 list_add_rcu(&new_stat->list, &hw_stats_list);
301− spin_unlock(&trace_state_lock);
339+ mutex_unlock(&trace_state_mutex);
302340 break;
303341 case NETDEV_UNREGISTER:
304− spin_lock(&trace_state_lock);
342+ mutex_lock(&trace_state_mutex);
305343 list_for_each_entry_safe(new_stat, tmp, &hw_stats_list, list) {
306344 if (new_stat->dev == dev) {
307345 new_stat->dev = NULL;
@@ -312,7 +350,7 @@ static int dropmon_net_event(struct notifier_block *ev_block, · 4 unmodified lines
312350 }
313351 }
314352 }
315− spin_unlock(&trace_state_lock);
353+ mutex_unlock(&trace_state_mutex);
316354 break;
317355 }
318356 out:
@@ -368,13 +406,15 @@ static int __init init_net_drop_monitor(void) · 49 unmodified lines
368406
369407 for_each_present_cpu(cpu) {
370408 data = &per_cpu(dm_cpu_data, cpu);
371− reset_per_cpu_data(data);
409+ data->cpu = cpu;
372410 INIT_WORK(&data->dm_alert_work, send_dm_alert);
373411 init_timer(&data->send_timer);
374412 data->send_timer.data = cpu;
375413 data->send_timer.function = sched_send_work;
414+ reset_per_cpu_data(data);
376415 }
377416
417+
378418 goto out;
379419
380420 out_unreg:
net/ieee802154/6lowpan.c+38−2
@@ -1044,6 +1044,24 @@ static void lowpan_dev_free(struct net_device *dev) · 1043 unmodified lines
10441044 free_netdev(dev);
10451045 }
10461046
1047+static struct wpan_phy *lowpan_get_phy(const struct net_device *dev)
1048+{
1049+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1050+ return ieee802154_mlme_ops(real_dev)->get_phy(real_dev);
1051+}
1052+
1053+static u16 lowpan_get_pan_id(const struct net_device *dev)
1054+{
1055+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1056+ return ieee802154_mlme_ops(real_dev)->get_pan_id(real_dev);
1057+}
1058+
1059+static u16 lowpan_get_short_addr(const struct net_device *dev)
1060+{
1061+ struct net_device *real_dev = lowpan_dev_info(dev)->real_dev;
1062+ return ieee802154_mlme_ops(real_dev)->get_short_addr(real_dev);
1063+}
1064+
10471065 static struct header_ops lowpan_header_ops = {
10481066 .create = lowpan_header_create,
10491067 };
@@ -1053,6 +1071,12 @@ static const struct net_device_ops lowpan_netdev_ops = { · 3 unmodified lines
10531071 .ndo_set_mac_address = eth_mac_addr,
10541072 };
10551073
1074+static struct ieee802154_mlme_ops lowpan_mlme = {
1075+ .get_pan_id = lowpan_get_pan_id,
1076+ .get_phy = lowpan_get_phy,
1077+ .get_short_addr = lowpan_get_short_addr,
1078+};
1079+
10561080 static void lowpan_setup(struct net_device *dev)
10571081 {
10581082 pr_debug("(%s)\n", __func__);
@@ -1070,6 +1094,7 @@ static void lowpan_setup(struct net_device *dev) · 11 unmodified lines
10701094
10711095 dev->netdev_ops = &lowpan_netdev_ops;
10721096 dev->header_ops = &lowpan_header_ops;
1097+ dev->ml_priv = &lowpan_mlme;
10731098 dev->destructor = lowpan_dev_free;
10741099 }
10751100
@@ -1143,6 +1168,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev, · 67 unmodified lines
11431168 list_add_tail(&entry->list, &lowpan_devices);
11441169 mutex_unlock(&lowpan_dev_info(dev)->dev_list_mtx);
11451170
1171+ spin_lock_init(&flist_lock);
1172+
11461173 register_netdevice(dev);
11471174
11481175 return 0;
@@ -1152,11 +1179,20 @@ static void lowpan_dellink(struct net_device *dev, struct list_head *head) · 3 unmodified lines
11521179 {
11531180 struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev);
11541181 struct net_device *real_dev = lowpan_dev->real_dev;
1155− struct lowpan_dev_record *entry;
1156− struct lowpan_dev_record *tmp;
1182+ struct lowpan_dev_record *entry, *tmp;
1183+ struct lowpan_fragment *frame, *tframe;
11571184
11581185 ASSERT_RTNL();
11591186
1187+ spin_lock(&flist_lock);
1188+ list_for_each_entry_safe(frame, tframe, &lowpan_fragments, list) {
1189+ del_timer(&frame->timer);
1190+ list_del(&frame->list);
1191+ dev_kfree_skb(frame->skb);
1192+ kfree(frame);
1193+ }
1194+ spin_unlock(&flist_lock);
1195+
11601196 mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx);
11611197 list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) {
11621198 if (entry->ldev == dev) {
net/ipv4/inet_diag.c+1−1
@@ -141,7 +141,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk, · 140 unmodified lines
141141 goto rtattr_failure;
142142
143143 if (icsk == NULL) {
144− r->idiag_rqueue = r->idiag_wqueue = 0;
144+ handler->idiag_get_info(sk, r, NULL);
145145 goto out;
146146 }
147147
net/ipv4/tcp.c+5−4
@@ -3243,7 +3243,7 @@ void __init tcp_init(void) · 3242 unmodified lines
32433243 {
32443244 struct sk_buff *skb = NULL;
32453245 unsigned long limit;
3246− int max_share, cnt;
3246+ int max_rshare, max_wshare, cnt;
32473247 unsigned int i;
32483248 unsigned long jiffy = jiffies;
32493249
@@ -3303,15 +3303,16 @@ void __init tcp_init(void) · 53 unmodified lines
33033303 tcp_init_mem(&init_net);
33043304 /* Set per-socket limits to no more than 1/128 the pressure threshold */
33053305 limit = nr_free_buffer_pages() << (PAGE_SHIFT - 7);
3306− max_share = min(4UL*1024*1024, limit);
3306+ max_wshare = min(4UL*1024*1024, limit);
3307+ max_rshare = min(6UL*1024*1024, limit);
33073308
33083309 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
33093310 sysctl_tcp_wmem[1] = 16*1024;
3310− sysctl_tcp_wmem[2] = max(64*1024, max_share);
3311+ sysctl_tcp_wmem[2] = max(64*1024, max_wshare);
33113312
33123313 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM;
33133314 sysctl_tcp_rmem[1] = 87380;
3314− sysctl_tcp_rmem[2] = max(87380, max_share);
3315+ sysctl_tcp_rmem[2] = max(87380, max_rshare);
33153316
33163317 pr_info("Hash tables configured (established %u bind %u)\n",
33173318 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size);
net/ipv4/tcp_input.c+8−5
@@ -85,7 +85,7 @@ int sysctl_tcp_ecn __read_mostly = 2; · 84 unmodified lines
8585 EXPORT_SYMBOL(sysctl_tcp_ecn);
8686 int sysctl_tcp_dsack __read_mostly = 1;
8787 int sysctl_tcp_app_win __read_mostly = 31;
88−int sysctl_tcp_adv_win_scale __read_mostly = 2;
88+int sysctl_tcp_adv_win_scale __read_mostly = 1;
8989 EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);
9090
9191 int sysctl_tcp_stdurg __read_mostly;
@@ -495,7 +495,7 @@ static inline void tcp_rcv_rtt_measure(struct tcp_sock *tp) · 403 unmodified lines
495495 goto new_measure;
496496 if (before(tp->rcv_nxt, tp->rcv_rtt_est.seq))
497497 return;
498− tcp_rcv_rtt_update(tp, jiffies - tp->rcv_rtt_est.time, 1);
498+ tcp_rcv_rtt_update(tp, tcp_time_stamp - tp->rcv_rtt_est.time, 1);
499499
500500 new_measure:
501501 tp->rcv_rtt_est.seq = tp->rcv_nxt + tp->rcv_wnd;
@@ -2868,11 +2868,14 @@ static inline void tcp_complete_cwr(struct sock *sk) · 2366 unmodified lines
28682868
28692869 /* Do not moderate cwnd if it's already undone in cwr or recovery. */
28702870 if (tp->undo_marker) {
2871− if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR)
2871+ if (inet_csk(sk)->icsk_ca_state == TCP_CA_CWR) {
28722872 tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh);
2873− else /* PRR */
2873+ tp->snd_cwnd_stamp = tcp_time_stamp;
2874+ } else if (tp->snd_ssthresh < TCP_INFINITE_SSTHRESH) {
2875+ /* PRR algorithm. */
28742876 tp->snd_cwnd = tp->snd_ssthresh;
2875− tp->snd_cwnd_stamp = tcp_time_stamp;
2877+ tp->snd_cwnd_stamp = tcp_time_stamp;
2878+ }
28762879 }
28772880 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
28782881 }
net/ipv4/udp_diag.c+9−0
@@ -146,9 +146,17 @@ static int udp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh, · 145 unmodified lines
146146 return udp_dump_one(&udp_table, in_skb, nlh, req);
147147 }
148148
149+static void udp_diag_get_info(struct sock *sk, struct inet_diag_msg *r,
150+ void *info)
151+{
152+ r->idiag_rqueue = sk_rmem_alloc_get(sk);
153+ r->idiag_wqueue = sk_wmem_alloc_get(sk);
154+}
155+
149156 static const struct inet_diag_handler udp_diag_handler = {
150157 .dump = udp_diag_dump,
151158 .dump_one = udp_diag_dump_one,
159+ .idiag_get_info = udp_diag_get_info,
152160 .idiag_type = IPPROTO_UDP,
153161 };
154162
@@ -167,6 +175,7 @@ static int udplite_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr * · 12 unmodified lines
167175 static const struct inet_diag_handler udplite_diag_handler = {
168176 .dump = udplite_diag_dump,
169177 .dump_one = udplite_diag_dump_one,
178+ .idiag_get_info = udp_diag_get_info,
170179 .idiag_type = IPPROTO_UDPLITE,
171180 };
172181
net/l2tp/l2tp_ip.c+2−1
@@ -442,8 +442,9 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m · 441 unmodified lines
442442
443443 daddr = lip->l2tp_addr.s_addr;
444444 } else {
445+ rc = -EDESTADDRREQ;
445446 if (sk->sk_state != TCP_ESTABLISHED)
446− return -EDESTADDRREQ;
447+ goto out;
447448
448449 daddr = inet->inet_daddr;
449450 connected = 1;
net/mac80211/ieee80211_i.h+1−1
@@ -1210,7 +1210,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, · 1209 unmodified lines
12101210 struct sk_buff *skb);
12111211 void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
12121212 void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
1213−void ieee80211_mgd_teardown(struct ieee80211_sub_if_data *sdata);
1213+void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
12141214
12151215 /* IBSS code */
12161216 void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
net/mac80211/iface.c+2−2
@@ -486,6 +486,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata, · 485 unmodified lines
486486 /* free all potentially still buffered bcast frames */
487487 local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps_bc_buf);
488488 skb_queue_purge(&sdata->u.ap.ps_bc_buf);
489+ } else if (sdata->vif.type == NL80211_IFTYPE_STATION) {
490+ ieee80211_mgd_stop(sdata);
489491 }
490492
491493 if (going_down)
@@ -644,8 +646,6 @@ static void ieee80211_teardown_sdata(struct net_device *dev) · 152 unmodified lines
644646
645647 if (ieee80211_vif_is_mesh(&sdata->vif))
646648 mesh_rmc_free(sdata);
647− else if (sdata->vif.type == NL80211_IFTYPE_STATION)
648− ieee80211_mgd_teardown(sdata);
649649
650650 flushed = sta_info_flush(local, sdata);
651651 WARN_ON(flushed);
net/mac80211/mlme.c+1−1
@@ -3497,7 +3497,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata, · 3496 unmodified lines
34973497 return 0;
34983498 }
34993499
3500−void ieee80211_mgd_teardown(struct ieee80211_sub_if_data *sdata)
3500+void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata)
35013501 {
35023502 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
35033503
net/mac80211/tx.c+2−1
@@ -1158,7 +1158,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata, · 1157 unmodified lines
11581158 tx->sta = rcu_dereference(sdata->u.vlan.sta);
11591159 if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
11601160 return TX_DROP;
1161− } else if (info->flags & IEEE80211_TX_CTL_INJECTED) {
1161+ } else if (info->flags & IEEE80211_TX_CTL_INJECTED ||
1162+ tx->sdata->control_port_protocol == tx->skb->protocol) {
11621163 tx->sta = sta_info_get_bss(sdata, hdr->addr1);
11631164 }
11641165 if (!tx->sta)
net/netfilter/ipvs/ip_vs_core.c+11−0
@@ -1924,6 +1924,7 @@ protocol_fail: · 1923 unmodified lines
19241924 control_fail:
19251925 ip_vs_estimator_net_cleanup(net);
19261926 estimator_fail:
1927+ net->ipvs = NULL;
19271928 return -ENOMEM;
19281929 }
19291930
@@ -1936,6 +1937,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net) · 6 unmodified lines
19361937 ip_vs_control_net_cleanup(net);
19371938 ip_vs_estimator_net_cleanup(net);
19381939 IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
1940+ net->ipvs = NULL;
19391941 }
19401942
19411943 static void __net_exit __ip_vs_dev_cleanup(struct net *net)
@@ -1993,10 +1995,18 @@ static int __init ip_vs_init(void) · 51 unmodified lines
19931995 goto cleanup_dev;
19941996 }
19951997
1998+ ret = ip_vs_register_nl_ioctl();
1999+ if (ret < 0) {
2000+ pr_err("can't register netlink/ioctl.\n");
2001+ goto cleanup_hooks;
2002+ }
2003+
19962004 pr_info("ipvs loaded.\n");
19972005
19982006 return ret;
19992007
2008+cleanup_hooks:
2009+ nf_unregister_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
20002010 cleanup_dev:
20012011 unregister_pernet_device(&ipvs_core_dev_ops);
20022012 cleanup_sub:
@@ -2012,6 +2022,7 @@ exit: · 9 unmodified lines
20122022
20132023 static void __exit ip_vs_cleanup(void)
20142024 {
2025+ ip_vs_unregister_nl_ioctl();
20152026 nf_unregister_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
20162027 unregister_pernet_device(&ipvs_core_dev_ops);
20172028 unregister_pernet_subsys(&ipvs_core_ops); /* free ip_vs struct */
net/netfilter/ipvs/ip_vs_ctl.c+32−24
@@ -3680,7 +3680,7 @@ int __net_init ip_vs_control_net_init_sysctl(struct net *net) · 3679 unmodified lines
36803680 return 0;
36813681 }
36823682
3683−void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net)
3683+void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net)
36843684 {
36853685 struct netns_ipvs *ipvs = net_ipvs(net);
36863686
@@ -3692,7 +3692,7 @@ void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net) · 5 unmodified lines
36923692 #else
36933693
36943694 int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; }
3695−void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net) { }
3695+void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net) { }
36963696
36973697 #endif
36983698
@@ -3750,21 +3750,10 @@ void __net_exit ip_vs_control_net_cleanup(struct net *net) · 51 unmodified lines
37503750 free_percpu(ipvs->tot_stats.cpustats);
37513751 }
37523752
3753−int __init ip_vs_control_init(void)
3753+int __init ip_vs_register_nl_ioctl(void)
37543754 {
3755− int idx;
37563755 int ret;
37573756
3758− EnterFunction(2);
3759−
3760− /* Initialize svc_table, ip_vs_svc_fwm_table, rs_table */
3761− for(idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
3762− INIT_LIST_HEAD(&ip_vs_svc_table[idx]);
3763− INIT_LIST_HEAD(&ip_vs_svc_fwm_table[idx]);
3764− }
3765−
3766− smp_wmb(); /* Do we really need it now ? */
3767−
37683757 ret = nf_register_sockopt(&ip_vs_sockopts);
37693758 if (ret) {
37703759 pr_err("cannot register sockopt.\n");
@@ -3776,28 +3765,47 @@ int __init ip_vs_control_init(void) · 5 unmodified lines
37763765 pr_err("cannot register Generic Netlink interface.\n");
37773766 goto err_genl;
37783767 }
3779−
3780− ret = register_netdevice_notifier(&ip_vs_dst_notifier);
3781− if (ret < 0)
3782− goto err_notf;
3783−
3784− LeaveFunction(2);
37853768 return 0;
37863769
3787−err_notf:
3788− ip_vs_genl_unregister();
37893770 err_genl:
37903771 nf_unregister_sockopt(&ip_vs_sockopts);
37913772 err_sock:
37923773 return ret;
37933774 }
37943775
3776+void ip_vs_unregister_nl_ioctl(void)
3777+{
3778+ ip_vs_genl_unregister();
3779+ nf_unregister_sockopt(&ip_vs_sockopts);
3780+}
3781+
3782+int __init ip_vs_control_init(void)
3783+{
3784+ int idx;
3785+ int ret;
3786+
3787+ EnterFunction(2);
3788+
3789+ /* Initialize svc_table, ip_vs_svc_fwm_table, rs_table */
3790+ for (idx = 0; idx < IP_VS_SVC_TAB_SIZE; idx++) {
3791+ INIT_LIST_HEAD(&ip_vs_svc_table[idx]);
3792+ INIT_LIST_HEAD(&ip_vs_svc_fwm_table[idx]);
3793+ }
3794+
3795+ smp_wmb(); /* Do we really need it now ? */
3796+
3797+ ret = register_netdevice_notifier(&ip_vs_dst_notifier);
3798+ if (ret < 0)
3799+ return ret;
3800+
3801+ LeaveFunction(2);
3802+ return 0;
3803+}
3804+
37953805
37963806 void ip_vs_control_cleanup(void)
37973807 {
37983808 EnterFunction(2);
37993809 unregister_netdevice_notifier(&ip_vs_dst_notifier);
3800− ip_vs_genl_unregister();
3801− nf_unregister_sockopt(&ip_vs_sockopts);
38023810 LeaveFunction(2);
38033811 }
net/netfilter/ipvs/ip_vs_ftp.c+2−0
@@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net) · 438 unmodified lines
439439 struct ip_vs_app *app;
440440 struct netns_ipvs *ipvs = net_ipvs(net);
441441
442+ if (!ipvs)
443+ return -ENOENT;
442444 app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
443445 if (!app)
444446 return -ENOMEM;
net/netfilter/ipvs/ip_vs_lblc.c+3−0
@@ -551,6 +551,9 @@ static int __net_init __ip_vs_lblc_init(struct net *net) · 550 unmodified lines
551551 {
552552 struct netns_ipvs *ipvs = net_ipvs(net);
553553
554+ if (!ipvs)
555+ return -ENOENT;
556+
554557 if (!net_eq(net, &init_net)) {
555558 ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
556559 sizeof(vs_vars_table),
net/netfilter/ipvs/ip_vs_lblcr.c+3−0
@@ -745,6 +745,9 @@ static int __net_init __ip_vs_lblcr_init(struct net *net) · 744 unmodified lines
745745 {
746746 struct netns_ipvs *ipvs = net_ipvs(net);
747747
748+ if (!ipvs)
749+ return -ENOENT;
750+
748751 if (!net_eq(net, &init_net)) {
749752 ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
750753 sizeof(vs_vars_table),
net/netfilter/ipvs/ip_vs_proto.c+27−11
@@ -59,9 +59,6 @@ static int __used __init register_ip_vs_protocol(struct ip_vs_protocol *pp) · 58 unmodified lines
5959 return 0;
6060 }
6161
62−#if defined(CONFIG_IP_VS_PROTO_TCP) || defined(CONFIG_IP_VS_PROTO_UDP) || \
63− defined(CONFIG_IP_VS_PROTO_SCTP) || defined(CONFIG_IP_VS_PROTO_AH) || \
64− defined(CONFIG_IP_VS_PROTO_ESP)
6562 /*
6663 * register an ipvs protocols netns related data
6764 */
@@ -81,12 +78,18 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp) · 13 unmodified lines
8178 ipvs->proto_data_table[hash] = pd;
8279 atomic_set(&pd->appcnt, 0); /* Init app counter */
8380
84− if (pp->init_netns != NULL)
85− pp->init_netns(net, pd);
81+ if (pp->init_netns != NULL) {
82+ int ret = pp->init_netns(net, pd);
83+ if (ret) {
84+ /* unlink an free proto data */
85+ ipvs->proto_data_table[hash] = pd->next;
86+ kfree(pd);
87+ return ret;
88+ }
89+ }
8690
8791 return 0;
8892 }
89−#endif
9093
9194 /*
9295 * unregister an ipvs protocol
@@ -316,22 +319,35 @@ ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp, · 223 unmodified lines
316319 */
317320 int __net_init ip_vs_protocol_net_init(struct net *net)
318321 {
322+ int i, ret;
323+ static struct ip_vs_protocol *protos[] = {
319324 #ifdef CONFIG_IP_VS_PROTO_TCP
320− register_ip_vs_proto_netns(net, &ip_vs_protocol_tcp);
325+ &ip_vs_protocol_tcp,
321326 #endif
322327 #ifdef CONFIG_IP_VS_PROTO_UDP
323− register_ip_vs_proto_netns(net, &ip_vs_protocol_udp);
328+ &ip_vs_protocol_udp,
324329 #endif
325330 #ifdef CONFIG_IP_VS_PROTO_SCTP
326− register_ip_vs_proto_netns(net, &ip_vs_protocol_sctp);
331+ &ip_vs_protocol_sctp,
327332 #endif
328333 #ifdef CONFIG_IP_VS_PROTO_AH
329− register_ip_vs_proto_netns(net, &ip_vs_protocol_ah);
334+ &ip_vs_protocol_ah,
330335 #endif
331336 #ifdef CONFIG_IP_VS_PROTO_ESP
332− register_ip_vs_proto_netns(net, &ip_vs_protocol_esp);
337+ &ip_vs_protocol_esp,
333338 #endif
339+ };
340+
341+ for (i = 0; i < ARRAY_SIZE(protos); i++) {
342+ ret = register_ip_vs_proto_netns(net, protos[i]);
343+ if (ret < 0)
344+ goto cleanup;
345+ }
334346 return 0;
347+
348+cleanup:
349+ ip_vs_protocol_net_cleanup(net);
350+ return ret;
335351 }
336352
337353 void __net_exit ip_vs_protocol_net_cleanup(struct net *net)
net/netfilter/ipvs/ip_vs_proto_sctp.c+4−1
@@ -1090,7 +1090,7 @@ out: · 1089 unmodified lines
10901090 * timeouts is netns related now.
10911091 * ---------------------------------------------
10921092 */
1093−static void __ip_vs_sctp_init(struct net *net, struct ip_vs_proto_data *pd)
1093+static int __ip_vs_sctp_init(struct net *net, struct ip_vs_proto_data *pd)
10941094 {
10951095 struct netns_ipvs *ipvs = net_ipvs(net);
10961096
@@ -1098,6 +1098,9 @@ static void __ip_vs_sctp_init(struct net *net, struct ip_vs_proto_data *pd) · 1 unmodified line
10981098 spin_lock_init(&ipvs->sctp_app_lock);
10991099 pd->timeout_table = ip_vs_create_timeout_table((int *)sctp_timeouts,
11001100 sizeof(sctp_timeouts));
1101+ if (!pd->timeout_table)
1102+ return -ENOMEM;
1103+ return 0;
11011104 }
11021105
11031106 static void __ip_vs_sctp_exit(struct net *net, struct ip_vs_proto_data *pd)
net/netfilter/ipvs/ip_vs_proto_tcp.c+4−1
@@ -677,7 +677,7 @@ void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp) · 676 unmodified lines
677677 * timeouts is netns related now.
678678 * ---------------------------------------------
679679 */
680−static void __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd)
680+static int __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd)
681681 {
682682 struct netns_ipvs *ipvs = net_ipvs(net);
683683
@@ -685,7 +685,10 @@ static void __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd) · 1 unmodified line
685685 spin_lock_init(&ipvs->tcp_app_lock);
686686 pd->timeout_table = ip_vs_create_timeout_table((int *)tcp_timeouts,
687687 sizeof(tcp_timeouts));
688+ if (!pd->timeout_table)
689+ return -ENOMEM;
688690 pd->tcp_state_table = tcp_states;
691+ return 0;
689692 }
690693
691694 static void __ip_vs_tcp_exit(struct net *net, struct ip_vs_proto_data *pd)
net/netfilter/ipvs/ip_vs_proto_udp.c+4−1
@@ -467,7 +467,7 @@ udp_state_transition(struct ip_vs_conn *cp, int direction, · 466 unmodified lines
467467 cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL];
468468 }
469469
470−static void __udp_init(struct net *net, struct ip_vs_proto_data *pd)
470+static int __udp_init(struct net *net, struct ip_vs_proto_data *pd)
471471 {
472472 struct netns_ipvs *ipvs = net_ipvs(net);
473473
@@ -475,6 +475,9 @@ static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) · 1 unmodified line
475475 spin_lock_init(&ipvs->udp_app_lock);
476476 pd->timeout_table = ip_vs_create_timeout_table((int *)udp_timeouts,
477477 sizeof(udp_timeouts));
478+ if (!pd->timeout_table)
479+ return -ENOMEM;
480+ return 0;
478481 }
479482
480483 static void __udp_exit(struct net *net, struct ip_vs_proto_data *pd)
net/netfilter/xt_CT.c+1−1
@@ -227,7 +227,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par) · 226 unmodified lines
227227 }
228228
229229 #ifdef CONFIG_NF_CONNTRACK_TIMEOUT
230− if (info->timeout) {
230+ if (info->timeout[0]) {
231231 typeof(nf_ct_timeout_find_get_hook) timeout_find_get;
232232 struct nf_conn_timeout *timeout_ext;
233233
net/sched/sch_netem.c+2−4
@@ -408,10 +408,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch) · 407 unmodified lines
408408 if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
409409 if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||
410410 (skb->ip_summed == CHECKSUM_PARTIAL &&
411− skb_checksum_help(skb))) {
412− sch->qstats.drops++;
413− return NET_XMIT_DROP;
414− }
411+ skb_checksum_help(skb)))
412+ return qdisc_drop(skb, sch);
415413
416414 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
417415 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t