aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/networking/ip-sysctl.txt4
-rw-r--r--MAINTAINERS4
-rw-r--r--arch/powerpc/net/bpf_jit.h8
-rw-r--r--arch/powerpc/net/bpf_jit_64.S108
-rw-r--r--arch/powerpc/net/bpf_jit_comp.c26
-rw-r--r--drivers/bluetooth/ath3k.c4
-rw-r--r--drivers/bluetooth/btusb.c6
-rw-r--r--drivers/net/ethernet/broadcom/tg3.c18
-rw-r--r--drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c92
-rw-r--r--drivers/net/ethernet/dlink/dl2k.c52
-rw-r--r--drivers/net/ethernet/dlink/dl2k.h7
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.c6
-rw-r--r--drivers/net/ethernet/freescale/ucc_geth.h2
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c60
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_phyp.h2
-rw-r--r--drivers/net/ethernet/intel/e1000e/netdev.c2
-rw-r--r--drivers/net/ethernet/intel/e1000e/param.c99
-rw-r--r--drivers/net/ethernet/intel/igbvf/netdev.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c9
-rw-r--r--drivers/net/ethernet/marvell/sky2.c31
-rw-r--r--drivers/net/ethernet/marvell/sky2.h1
-rw-r--r--drivers/net/ethernet/sun/sungem.c2
-rw-r--r--drivers/net/ethernet/ti/davinci_emac.c2
-rw-r--r--drivers/net/ethernet/ti/tlan.c2
-rw-r--r--drivers/net/usb/asix.c4
-rw-r--r--drivers/net/usb/smsc75xx.c35
-rw-r--r--drivers/net/usb/smsc95xx.c3
-rw-r--r--drivers/net/usb/usbnet.c5
-rw-r--r--drivers/net/wireless/ath/ath5k/ahb.c1
-rw-r--r--drivers/net/wireless/ath/ath9k/ar5008_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_paprd.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/ar9003_phy.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/eeprom_9287.c2
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.c9
-rw-r--r--drivers/net/wireless/ath/ath9k/hw.h3
-rw-r--r--drivers/net/wireless/b43/main.c10
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c8
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c63
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c3
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c13
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-fh.h24
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-mac80211.c10
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-prph.h27
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c1
-rw-r--r--drivers/net/wireless/wl1251/main.c1
-rw-r--r--drivers/net/wireless/wl1251/sdio.c2
-rw-r--r--drivers/s390/net/qeth_core_main.c6
-rw-r--r--include/linux/netfilter_bridge.h9
-rw-r--r--include/linux/skbuff.h4
-rw-r--r--include/net/bluetooth/hci_core.h3
-rw-r--r--include/net/dst.h1
-rw-r--r--include/net/ip_vs.h4
-rw-r--r--include/net/sock.h4
-rw-r--r--net/bluetooth/hci_core.c27
-rw-r--r--net/bluetooth/hci_event.c3
-rw-r--r--net/bluetooth/mgmt.c2
-rw-r--r--net/bridge/br_forward.c1
-rw-r--r--net/bridge/br_netfilter.c8
-rw-r--r--net/core/drop_monitor.c88
-rw-r--r--net/ieee802154/6lowpan.c40
-rw-r--r--net/ipv4/inet_diag.c2
-rw-r--r--net/ipv4/tcp.c9
-rw-r--r--net/ipv4/tcp_input.c13
-rw-r--r--net/ipv4/udp_diag.c9
-rw-r--r--net/l2tp/l2tp_ip.c3
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/iface.c4
-rw-r--r--net/mac80211/mlme.c2
-rw-r--r--net/mac80211/tx.c3
-rw-r--r--net/netfilter/ipvs/ip_vs_core.c11
-rw-r--r--net/netfilter/ipvs/ip_vs_ctl.c56
-rw-r--r--net/netfilter/ipvs/ip_vs_ftp.c2
-rw-r--r--net/netfilter/ipvs/ip_vs_lblc.c3
-rw-r--r--net/netfilter/ipvs/ip_vs_lblcr.c3
-rw-r--r--net/netfilter/ipvs/ip_vs_proto.c38
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_sctp.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_tcp.c5
-rw-r--r--net/netfilter/ipvs/ip_vs_proto_udp.c5
-rw-r--r--net/netfilter/xt_CT.c2
-rw-r--r--net/sched/sch_netem.c6
86 files changed, 795 insertions, 418 deletions
diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
index bd80ba5847d2..1619a8c80873 100644
--- a/Documentation/networking/ip-sysctl.txt
+++ b/Documentation/networking/ip-sysctl.txt
@@ -147,7 +147,7 @@ tcp_adv_win_scale - INTEGER
147 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale), 147 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale),
148 if it is <= 0. 148 if it is <= 0.
149 Possible values are [-31, 31], inclusive. 149 Possible values are [-31, 31], inclusive.
150 Default: 2 150 Default: 1
151 151
152tcp_allowed_congestion_control - STRING 152tcp_allowed_congestion_control - STRING
153 Show/set the congestion control choices available to non-privileged 153 Show/set the congestion control choices available to non-privileged
@@ -410,7 +410,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
410 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables 410 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables
411 automatic tuning of that socket's receive buffer size, in which 411 automatic tuning of that socket's receive buffer size, in which
412 case this value is ignored. 412 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.
414 414
415tcp_sack - BOOLEAN 415tcp_sack - BOOLEAN
416 Enable select acknowledgments (SACKS). 416 Enable select acknowledgments (SACKS).
diff --git a/MAINTAINERS b/MAINTAINERS
index bb76fc42fc42..57bc6770f37a 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5892,11 +5892,11 @@ F: Documentation/scsi/st.txt
5892F: drivers/scsi/st* 5892F: drivers/scsi/st*
5893 5893
5894SCTP PROTOCOL 5894SCTP PROTOCOL
5895M: Vlad Yasevich <vladislav.yasevich@hp.com> 5895M: Vlad Yasevich <vyasevich@gmail.com>
5896M: Sridhar Samudrala <sri@us.ibm.com> 5896M: Sridhar Samudrala <sri@us.ibm.com>
5897L: linux-sctp@vger.kernel.org 5897L: linux-sctp@vger.kernel.org
5898W: http://lksctp.sourceforge.net 5898W: http://lksctp.sourceforge.net
5899S: Supported 5899S: Maintained
5900F: Documentation/networking/sctp.txt 5900F: Documentation/networking/sctp.txt
5901F: include/linux/sctp.h 5901F: include/linux/sctp.h
5902F: include/net/sctp/ 5902F: include/net/sctp/
diff --git a/arch/powerpc/net/bpf_jit.h b/arch/powerpc/net/bpf_jit.h
index af1ab5e9a691..5c3cf2d04e41 100644
--- a/arch/powerpc/net/bpf_jit.h
+++ b/arch/powerpc/net/bpf_jit.h
@@ -48,7 +48,13 @@
48/* 48/*
49 * Assembly helpers from arch/powerpc/net/bpf_jit.S: 49 * Assembly helpers from arch/powerpc/net/bpf_jit.S:
50 */ 50 */
51extern 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
54DECLARE_LOAD_FUNC(sk_load_word);
55DECLARE_LOAD_FUNC(sk_load_half);
56DECLARE_LOAD_FUNC(sk_load_byte);
57DECLARE_LOAD_FUNC(sk_load_byte_msh);
52 58
53#define FUNCTION_DESCR_SIZE 24 59#define FUNCTION_DESCR_SIZE 24
54 60
diff --git a/arch/powerpc/net/bpf_jit_64.S b/arch/powerpc/net/bpf_jit_64.S
index ff4506e85cce..55ba3855a97f 100644
--- a/arch/powerpc/net/bpf_jit_64.S
+++ b/arch/powerpc/net/bpf_jit_64.S
@@ -31,14 +31,13 @@
31 * then branch directly to slow_path_XXX if required. (In fact, could 31 * then branch directly to slow_path_XXX if required. (In fact, could
32 * load a spare GPR with the address of slow_path_generic and pass size 32 * load a spare GPR with the address of slow_path_generic and pass size
33 * as an argument, making the call site a mtlr, li and bllr.) 33 * 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.
37 */ 34 */
38 .globl sk_load_word 35 .globl sk_load_word
39sk_load_word: 36sk_load_word:
40 cmpdi r_addr, 0 37 cmpdi r_addr, 0
41 blt bpf_error 38 blt bpf_slow_path_word_neg
39 .globl sk_load_word_positive_offset
40sk_load_word_positive_offset:
42 /* Are we accessing past headlen? */ 41 /* Are we accessing past headlen? */
43 subi r_scratch1, r_HL, 4 42 subi r_scratch1, r_HL, 4
44 cmpd r_scratch1, r_addr 43 cmpd r_scratch1, r_addr
@@ -51,7 +50,9 @@ sk_load_word:
51 .globl sk_load_half 50 .globl sk_load_half
52sk_load_half: 51sk_load_half:
53 cmpdi r_addr, 0 52 cmpdi r_addr, 0
54 blt bpf_error 53 blt bpf_slow_path_half_neg
54 .globl sk_load_half_positive_offset
55sk_load_half_positive_offset:
55 subi r_scratch1, r_HL, 2 56 subi r_scratch1, r_HL, 2
56 cmpd r_scratch1, r_addr 57 cmpd r_scratch1, r_addr
57 blt bpf_slow_path_half 58 blt bpf_slow_path_half
@@ -61,7 +62,9 @@ sk_load_half:
61 .globl sk_load_byte 62 .globl sk_load_byte
62sk_load_byte: 63sk_load_byte:
63 cmpdi r_addr, 0 64 cmpdi r_addr, 0
64 blt bpf_error 65 blt bpf_slow_path_byte_neg
66 .globl sk_load_byte_positive_offset
67sk_load_byte_positive_offset:
65 cmpd r_HL, r_addr 68 cmpd r_HL, r_addr
66 ble bpf_slow_path_byte 69 ble bpf_slow_path_byte
67 lbzx r_A, r_D, r_addr 70 lbzx r_A, r_D, r_addr
@@ -69,22 +72,20 @@ sk_load_byte:
69 72
70/* 73/*
71 * BPF_S_LDX_B_MSH: ldxb 4*([offset]&0xf) 74 * 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
73 */ 76 */
74 .globl sk_load_byte_msh 77 .globl sk_load_byte_msh
75sk_load_byte_msh: 78sk_load_byte_msh:
79 cmpdi r_addr, 0
80 blt bpf_slow_path_byte_msh_neg
81 .globl sk_load_byte_msh_positive_offset
82sk_load_byte_msh_positive_offset:
76 cmpd r_HL, r_addr 83 cmpd r_HL, r_addr
77 ble bpf_slow_path_byte_msh 84 ble bpf_slow_path_byte_msh
78 lbzx r_X, r_D, r_addr 85 lbzx r_X, r_D, r_addr
79 rlwinm r_X, r_X, 2, 32-4-2, 31-2 86 rlwinm r_X, r_X, 2, 32-4-2, 31-2
80 blr 87 blr
81 88
82bpf_error:
83 /* Entered with cr0 = lt */
84 li r3, 0
85 /* Generated code will 'blt epilogue', returning 0. */
86 blr
87
88/* Call out to skb_copy_bits: 89/* Call out to skb_copy_bits:
89 * We'll need to back up our volatile regs first; we have 90 * We'll need to back up our volatile regs first; we have
90 * local variable space at r1+(BPF_PPC_STACK_BASIC). 91 * local variable space at r1+(BPF_PPC_STACK_BASIC).
@@ -136,3 +137,84 @@ bpf_slow_path_byte_msh:
136 lbz r_X, BPF_PPC_STACK_BASIC+(2*8)(r1) 137 lbz r_X, BPF_PPC_STACK_BASIC+(2*8)(r1)
137 rlwinm r_X, r_X, 2, 32-4-2, 31-2 138 rlwinm r_X, r_X, 2, 32-4-2, 31-2
138 blr 139 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
171bpf_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
176sk_load_word_negative_offset:
177 sk_negative_common(4)
178 lwz r_A, 0(r_addr)
179 blr
180
181bpf_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
186sk_load_half_negative_offset:
187 sk_negative_common(2)
188 lhz r_A, 0(r_addr)
189 blr
190
191bpf_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
196sk_load_byte_negative_offset:
197 sk_negative_common(1)
198 lbz r_A, 0(r_addr)
199 blr
200
201bpf_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
206sk_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
212bpf_error_slow:
213 /* fabricate a cr0 = lt */
214 li r_scratch1, -1
215 cmpdi r_scratch1, 0
216bpf_error:
217 /* Entered with cr0 = lt */
218 li r3, 0
219 /* Generated code will 'blt epilogue', returning 0. */
220 blr
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c
index 73619d3aeb6c..2dc8b1484845 100644
--- a/arch/powerpc/net/bpf_jit_comp.c
+++ b/arch/powerpc/net/bpf_jit_comp.c
@@ -127,6 +127,9 @@ static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx)
127 PPC_BLR(); 127 PPC_BLR();
128} 128}
129 129
130#define CHOOSE_LOAD_FUNC(K, func) \
131 ((int)K < 0 ? ((int)K >= SKF_LL_OFF ? func##_negative_offset : func) : func##_positive_offset)
132
130/* Assemble the body code between the prologue & epilogue. */ 133/* Assemble the body code between the prologue & epilogue. */
131static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, 134static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
132 struct codegen_context *ctx, 135 struct codegen_context *ctx,
@@ -391,21 +394,16 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
391 394
392 /*** Absolute loads from packet header/data ***/ 395 /*** Absolute loads from packet header/data ***/
393 case BPF_S_LD_W_ABS: 396 case BPF_S_LD_W_ABS:
394 func = sk_load_word; 397 func = CHOOSE_LOAD_FUNC(K, sk_load_word);
395 goto common_load; 398 goto common_load;
396 case BPF_S_LD_H_ABS: 399 case BPF_S_LD_H_ABS:
397 func = sk_load_half; 400 func = CHOOSE_LOAD_FUNC(K, sk_load_half);
398 goto common_load; 401 goto common_load;
399 case BPF_S_LD_B_ABS: 402 case BPF_S_LD_B_ABS:
400 func = sk_load_byte; 403 func = CHOOSE_LOAD_FUNC(K, sk_load_byte);
401 common_load: 404 common_load:
402 /* 405 /* Load from [K]. */
403 * Load from [K]. Reference with the (negative)
404 * SKF_NET_OFF/SKF_LL_OFF offsets is unsupported.
405 */
406 ctx->seen |= SEEN_DATAREF; 406 ctx->seen |= SEEN_DATAREF;
407 if ((int)K < 0)
408 return -ENOTSUPP;
409 PPC_LI64(r_scratch1, func); 407 PPC_LI64(r_scratch1, func);
410 PPC_MTLR(r_scratch1); 408 PPC_MTLR(r_scratch1);
411 PPC_LI32(r_addr, K); 409 PPC_LI32(r_addr, K);
@@ -429,7 +427,7 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
429 common_load_ind: 427 common_load_ind:
430 /* 428 /*
431 * Load from [X + K]. Negative offsets are tested for 429 * 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.
433 */ 431 */
434 ctx->seen |= SEEN_DATAREF | SEEN_XREG; 432 ctx->seen |= SEEN_DATAREF | SEEN_XREG;
435 PPC_LI64(r_scratch1, func); 433 PPC_LI64(r_scratch1, func);
@@ -443,13 +441,7 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image,
443 break; 441 break;
444 442
445 case BPF_S_LDX_B_MSH: 443 case BPF_S_LDX_B_MSH:
446 /* 444 func = CHOOSE_LOAD_FUNC(K, sk_load_byte_msh);
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;
453 goto common_load; 445 goto common_load;
454 break; 446 break;
455 447
diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
index ae9edca7b56d..57fd867553d7 100644
--- a/drivers/bluetooth/ath3k.c
+++ b/drivers/bluetooth/ath3k.c
@@ -75,6 +75,8 @@ static struct usb_device_id ath3k_table[] = {
75 { USB_DEVICE(0x0CF3, 0x311D) }, 75 { USB_DEVICE(0x0CF3, 0x311D) },
76 { USB_DEVICE(0x13d3, 0x3375) }, 76 { USB_DEVICE(0x13d3, 0x3375) },
77 { USB_DEVICE(0x04CA, 0x3005) }, 77 { USB_DEVICE(0x04CA, 0x3005) },
78 { USB_DEVICE(0x13d3, 0x3362) },
79 { USB_DEVICE(0x0CF3, 0xE004) },
78 80
79 /* Atheros AR5BBU12 with sflash firmware */ 81 /* Atheros AR5BBU12 with sflash firmware */
80 { USB_DEVICE(0x0489, 0xE02C) }, 82 { USB_DEVICE(0x0489, 0xE02C) },
@@ -94,6 +96,8 @@ static struct usb_device_id ath3k_blist_tbl[] = {
94 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 }, 96 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
95 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, 97 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
96 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, 98 { 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 },
97 101
98 { } /* Terminating entry */ 102 { } /* Terminating entry */
99}; 103};
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 3311b812a0c6..9217121362e1 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -101,12 +101,16 @@ static struct usb_device_id btusb_table[] = {
101 { USB_DEVICE(0x0c10, 0x0000) }, 101 { USB_DEVICE(0x0c10, 0x0000) },
102 102
103 /* Broadcom BCM20702A0 */ 103 /* Broadcom BCM20702A0 */
104 { USB_DEVICE(0x0489, 0xe042) },
104 { USB_DEVICE(0x0a5c, 0x21e3) }, 105 { USB_DEVICE(0x0a5c, 0x21e3) },
105 { USB_DEVICE(0x0a5c, 0x21e6) }, 106 { USB_DEVICE(0x0a5c, 0x21e6) },
106 { USB_DEVICE(0x0a5c, 0x21e8) }, 107 { USB_DEVICE(0x0a5c, 0x21e8) },
107 { USB_DEVICE(0x0a5c, 0x21f3) }, 108 { USB_DEVICE(0x0a5c, 0x21f3) },
108 { USB_DEVICE(0x413c, 0x8197) }, 109 { USB_DEVICE(0x413c, 0x8197) },
109 110
111 /* Foxconn - Hon Hai */
112 { USB_DEVICE(0x0489, 0xe033) },
113
110 { } /* Terminating entry */ 114 { } /* Terminating entry */
111}; 115};
112 116
@@ -133,6 +137,8 @@ static struct usb_device_id blacklist_table[] = {
133 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 }, 137 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
134 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 }, 138 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
135 { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 }, 139 { 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 },
136 142
137 /* Atheros AR5BBU12 with sflash firmware */ 143 /* Atheros AR5BBU12 with sflash firmware */
138 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE }, 144 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c
index 062ac333fde6..ceeab8e852ef 100644
--- a/drivers/net/ethernet/broadcom/tg3.c
+++ b/drivers/net/ethernet/broadcom/tg3.c
@@ -879,8 +879,13 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi)
879 if (sblk->status & SD_STATUS_LINK_CHG) 879 if (sblk->status & SD_STATUS_LINK_CHG)
880 work_exists = 1; 880 work_exists = 1;
881 } 881 }
882 /* check for RX/TX work to do */ 882
883 if (sblk->idx[0].tx_consumer != tnapi->tx_cons || 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 &&
884 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr) 889 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
885 work_exists = 1; 890 work_exists = 1;
886 891
@@ -6124,6 +6129,9 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
6124 return work_done; 6129 return work_done;
6125 } 6130 }
6126 6131
6132 if (!tnapi->rx_rcb_prod_idx)
6133 return work_done;
6134
6127 /* run RX thread, within the bounds set by NAPI. 6135 /* run RX thread, within the bounds set by NAPI.
6128 * All RX "locking" is done by ensuring outside 6136 * All RX "locking" is done by ensuring outside
6129 * code synchronizes with tg3->napi.poll() 6137 * code synchronizes with tg3->napi.poll()
@@ -7567,6 +7575,12 @@ static int tg3_alloc_consistent(struct tg3 *tp)
7567 */ 7575 */
7568 switch (i) { 7576 switch (i) {
7569 default: 7577 default:
7578 if (tg3_flag(tp, ENABLE_RSS)) {
7579 tnapi->rx_rcb_prod_idx = NULL;
7580 break;
7581 }
7582 /* Fall through */
7583 case 1:
7570 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer; 7584 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer;
7571 break; 7585 break;
7572 case 2: 7586 case 2:
diff --git a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
index 63bfdd10bd6d..abb6ce7c1b7e 100644
--- a/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
+++ b/drivers/net/ethernet/chelsio/cxgb3/cxgb3_main.c
@@ -1150,6 +1150,48 @@ release_tpsram:
1150} 1150}
1151 1151
1152/** 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 */
1161static 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
1173static 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
1194/**
1153 * cxgb_up - enable the adapter 1195 * cxgb_up - enable the adapter
1154 * @adapter: adapter being enabled 1196 * @adapter: adapter being enabled
1155 * 1197 *
@@ -1161,7 +1203,7 @@ release_tpsram:
1161 */ 1203 */
1162static int cxgb_up(struct adapter *adap) 1204static int cxgb_up(struct adapter *adap)
1163{ 1205{
1164 int err; 1206 int i, err;
1165 1207
1166 if (!(adap->flags & FULL_INIT_DONE)) { 1208 if (!(adap->flags & FULL_INIT_DONE)) {
1167 err = t3_check_fw_version(adap); 1209 err = t3_check_fw_version(adap);
@@ -1198,6 +1240,9 @@ static int cxgb_up(struct adapter *adap)
1198 if (err) 1240 if (err)
1199 goto out; 1241 goto out;
1200 1242
1243 for_each_port(adap, i)
1244 cxgb_vlan_mode(adap->port[i], adap->port[i]->features);
1245
1201 setup_rss(adap); 1246 setup_rss(adap);
1202 if (!(adap->flags & NAPI_INIT)) 1247 if (!(adap->flags & NAPI_INIT))
1203 init_napi(adap); 1248 init_napi(adap);
@@ -2508,48 +2553,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
2508 return 0; 2553 return 0;
2509} 2554}
2510 2555
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 */
2520static 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
2532static 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
2553static netdev_features_t cxgb_fix_features(struct net_device *dev, 2556static netdev_features_t cxgb_fix_features(struct net_device *dev,
2554 netdev_features_t features) 2557 netdev_features_t features)
2555{ 2558{
@@ -3353,9 +3356,6 @@ static int __devinit init_one(struct pci_dev *pdev,
3353 err = sysfs_create_group(&adapter->port[0]->dev.kobj, 3356 err = sysfs_create_group(&adapter->port[0]->dev.kobj,
3354 &cxgb3_attr_group); 3357 &cxgb3_attr_group);
3355 3358
3356 for_each_port(adapter, i)
3357 cxgb_vlan_mode(adapter->port[i], adapter->port[i]->features);
3358
3359 print_port_info(adapter, ai); 3359 print_port_info(adapter, ai);
3360 return 0; 3360 return 0;
3361 3361
diff --git a/drivers/net/ethernet/dlink/dl2k.c b/drivers/net/ethernet/dlink/dl2k.c
index b2dc2c81a147..2e09edb9cdf8 100644
--- a/drivers/net/ethernet/dlink/dl2k.c
+++ b/drivers/net/ethernet/dlink/dl2k.c
@@ -1259,55 +1259,21 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
1259{ 1259{
1260 int phy_addr; 1260 int phy_addr;
1261 struct netdev_private *np = netdev_priv(dev); 1261 struct netdev_private *np = netdev_priv(dev);
1262 struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru; 1262 struct mii_ioctl_data *miidata = if_mii(rq);
1263
1264 struct netdev_desc *desc;
1265 int i;
1266 1263
1267 phy_addr = np->phy_addr; 1264 phy_addr = np->phy_addr;
1268 switch (cmd) { 1265 switch (cmd) {
1269 case SIOCDEVPRIVATE: 1266 case SIOCGMIIPHY:
1270 break; 1267 miidata->phy_id = phy_addr;
1271
1272 case SIOCDEVPRIVATE + 1:
1273 miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num);
1274 break; 1268 break;
1275 case SIOCDEVPRIVATE + 2: 1269 case SIOCGMIIREG:
1276 mii_write (dev, phy_addr, miidata->reg_num, miidata->in_value); 1270 miidata->val_out = mii_read (dev, phy_addr, miidata->reg_num);
1277 break; 1271 break;
1278 case SIOCDEVPRIVATE + 3: 1272 case SIOCSMIIREG:
1279 break; 1273 if (!capable(CAP_NET_ADMIN))
1280 case SIOCDEVPRIVATE + 4: 1274 return -EPERM;
1281 break; 1275 mii_write (dev, phy_addr, miidata->reg_num, miidata->val_in);
1282 case SIOCDEVPRIVATE + 5:
1283 netif_stop_queue (dev);
1284 break; 1276 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
1311 default: 1277 default:
1312 return -EOPNOTSUPP; 1278 return -EOPNOTSUPP;
1313 } 1279 }
diff --git a/drivers/net/ethernet/dlink/dl2k.h b/drivers/net/ethernet/dlink/dl2k.h
index ba0adcafa55a..30c2da3de548 100644
--- a/drivers/net/ethernet/dlink/dl2k.h
+++ b/drivers/net/ethernet/dlink/dl2k.h
@@ -365,13 +365,6 @@ struct ioctl_data {
365 char *data; 365 char *data;
366}; 366};
367 367
368struct mii_data {
369 __u16 reserved;
370 __u16 reg_num;
371 __u16 in_value;
372 __u16 out_value;
373};
374
375/* The Rx and Tx buffer descriptors. */ 368/* The Rx and Tx buffer descriptors. */
376struct netdev_desc { 369struct netdev_desc {
377 __le64 next_desc; 370 __le64 next_desc;
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index 17a46e76123f..9ac14f804851 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -116,10 +116,10 @@ static struct ucc_geth_info ugeth_primary_info = {
116 .maxGroupAddrInHash = 4, 116 .maxGroupAddrInHash = 4,
117 .maxIndAddrInHash = 4, 117 .maxIndAddrInHash = 4,
118 .prel = 7, 118 .prel = 7,
119 .maxFrameLength = 1518, 119 .maxFrameLength = 1518+16, /* Add extra bytes for VLANs etc. */
120 .minFrameLength = 64, 120 .minFrameLength = 64,
121 .maxD1Length = 1520, 121 .maxD1Length = 1520+16, /* Add extra bytes for VLANs etc. */
122 .maxD2Length = 1520, 122 .maxD2Length = 1520+16, /* Add extra bytes for VLANs etc. */
123 .vlantype = 0x8100, 123 .vlantype = 0x8100,
124 .ecamptr = ((uint32_t) NULL), 124 .ecamptr = ((uint32_t) NULL),
125 .eventRegMask = UCCE_OTHER, 125 .eventRegMask = UCCE_OTHER,
diff --git a/drivers/net/ethernet/freescale/ucc_geth.h b/drivers/net/ethernet/freescale/ucc_geth.h
index 2e395a2566b8..f71b3e7b12de 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.h
+++ b/drivers/net/ethernet/freescale/ucc_geth.h
@@ -877,7 +877,7 @@ struct ucc_geth_hardware_statistics {
877 877
878/* Driver definitions */ 878/* Driver definitions */
879#define TX_BD_RING_LEN 0x10 879#define TX_BD_RING_LEN 0x10
880#define RX_BD_RING_LEN 0x10 880#define RX_BD_RING_LEN 0x20
881 881
882#define TX_RING_MOD_MASK(size) (size-1) 882#define TX_RING_MOD_MASK(size) (size-1)
883#define RX_RING_MOD_MASK(size) (size-1) 883#define RX_RING_MOD_MASK(size) (size-1)
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c
index 3516e17a399d..c9069a28832b 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_main.c
+++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c
@@ -290,16 +290,18 @@ static void ehea_update_bcmc_registrations(void)
290 290
291 arr[i].adh = adapter->handle; 291 arr[i].adh = adapter->handle;
292 arr[i].port_id = port->logical_port_id; 292 arr[i].port_id = port->logical_port_id;
293 arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | 293 arr[i].reg_type = EHEA_BCMC_MULTICAST |
294 EHEA_BCMC_MULTICAST |
295 EHEA_BCMC_UNTAGGED; 294 EHEA_BCMC_UNTAGGED;
295 if (mc_entry->macaddr == 0)
296 arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
296 arr[i++].macaddr = mc_entry->macaddr; 297 arr[i++].macaddr = mc_entry->macaddr;
297 298
298 arr[i].adh = adapter->handle; 299 arr[i].adh = adapter->handle;
299 arr[i].port_id = port->logical_port_id; 300 arr[i].port_id = port->logical_port_id;
300 arr[i].reg_type = EHEA_BCMC_SCOPE_ALL | 301 arr[i].reg_type = EHEA_BCMC_MULTICAST |
301 EHEA_BCMC_MULTICAST |
302 EHEA_BCMC_VLANID_ALL; 302 EHEA_BCMC_VLANID_ALL;
303 if (mc_entry->macaddr == 0)
304 arr[i].reg_type |= EHEA_BCMC_SCOPE_ALL;
303 arr[i++].macaddr = mc_entry->macaddr; 305 arr[i++].macaddr = mc_entry->macaddr;
304 num_registrations -= 2; 306 num_registrations -= 2;
305 } 307 }
@@ -1838,8 +1840,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
1838 u64 hret; 1840 u64 hret;
1839 u8 reg_type; 1841 u8 reg_type;
1840 1842
1841 reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST 1843 reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_UNTAGGED;
1842 | EHEA_BCMC_UNTAGGED; 1844 if (mc_mac_addr == 0)
1845 reg_type |= EHEA_BCMC_SCOPE_ALL;
1843 1846
1844 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, 1847 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
1845 port->logical_port_id, 1848 port->logical_port_id,
@@ -1847,8 +1850,9 @@ static u64 ehea_multicast_reg_helper(struct ehea_port *port, u64 mc_mac_addr,
1847 if (hret) 1850 if (hret)
1848 goto out; 1851 goto out;
1849 1852
1850 reg_type = EHEA_BCMC_SCOPE_ALL | EHEA_BCMC_MULTICAST 1853 reg_type = EHEA_BCMC_MULTICAST | EHEA_BCMC_VLANID_ALL;
1851 | EHEA_BCMC_VLANID_ALL; 1854 if (mc_mac_addr == 0)
1855 reg_type |= EHEA_BCMC_SCOPE_ALL;
1852 1856
1853 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle, 1857 hret = ehea_h_reg_dereg_bcmc(port->adapter->handle,
1854 port->logical_port_id, 1858 port->logical_port_id,
@@ -1898,7 +1902,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
1898 netdev_err(dev, 1902 netdev_err(dev,
1899 "failed enabling IFF_ALLMULTI\n"); 1903 "failed enabling IFF_ALLMULTI\n");
1900 } 1904 }
1901 } else 1905 } else {
1902 if (!enable) { 1906 if (!enable) {
1903 /* Disable ALLMULTI */ 1907 /* Disable ALLMULTI */
1904 hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC); 1908 hret = ehea_multicast_reg_helper(port, 0, H_DEREG_BCMC);
@@ -1908,6 +1912,7 @@ static void ehea_allmulti(struct net_device *dev, int enable)
1908 netdev_err(dev, 1912 netdev_err(dev,
1909 "failed disabling IFF_ALLMULTI\n"); 1913 "failed disabling IFF_ALLMULTI\n");
1910 } 1914 }
1915 }
1911} 1916}
1912 1917
1913static void ehea_add_multicast_entry(struct ehea_port *port, u8 *mc_mac_addr) 1918static 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)
1941 struct netdev_hw_addr *ha; 1946 struct netdev_hw_addr *ha;
1942 int ret; 1947 int ret;
1943 1948
1944 if (port->promisc) { 1949 ehea_promiscuous(dev, !!(dev->flags & IFF_PROMISC));
1945 ehea_promiscuous(dev, 1);
1946 return;
1947 }
1948 ehea_promiscuous(dev, 0);
1949 1950
1950 if (dev->flags & IFF_ALLMULTI) { 1951 if (dev->flags & IFF_ALLMULTI) {
1951 ehea_allmulti(dev, 1); 1952 ehea_allmulti(dev, 1);
@@ -2463,6 +2464,7 @@ static int ehea_down(struct net_device *dev)
2463 return 0; 2464 return 0;
2464 2465
2465 ehea_drop_multicast_list(dev); 2466 ehea_drop_multicast_list(dev);
2467 ehea_allmulti(dev, 0);
2466 ehea_broadcast_reg_helper(port, H_DEREG_BCMC); 2468 ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
2467 2469
2468 ehea_free_interrupts(dev); 2470 ehea_free_interrupts(dev);
@@ -3261,6 +3263,7 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3261 struct ehea_adapter *adapter; 3263 struct ehea_adapter *adapter;
3262 const u64 *adapter_handle; 3264 const u64 *adapter_handle;
3263 int ret; 3265 int ret;
3266 int i;
3264 3267
3265 if (!dev || !dev->dev.of_node) { 3268 if (!dev || !dev->dev.of_node) {
3266 pr_err("Invalid ibmebus device probed\n"); 3269 pr_err("Invalid ibmebus device probed\n");
@@ -3314,17 +3317,9 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3314 tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet, 3317 tasklet_init(&adapter->neq_tasklet, ehea_neq_tasklet,
3315 (unsigned long)adapter); 3318 (unsigned long)adapter);
3316 3319
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
3325 ret = ehea_create_device_sysfs(dev); 3320 ret = ehea_create_device_sysfs(dev);
3326 if (ret) 3321 if (ret)
3327 goto out_free_irq; 3322 goto out_kill_eq;
3328 3323
3329 ret = ehea_setup_ports(adapter); 3324 ret = ehea_setup_ports(adapter);
3330 if (ret) { 3325 if (ret) {
@@ -3332,15 +3327,28 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev,
3332 goto out_rem_dev_sysfs; 3327 goto out_rem_dev_sysfs;
3333 } 3328 }
3334 3329
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
3335 ret = 0; 3339 ret = 0;
3336 goto out; 3340 goto out;
3337 3341
3342out_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
3338out_rem_dev_sysfs: 3349out_rem_dev_sysfs:
3339 ehea_remove_device_sysfs(dev); 3350 ehea_remove_device_sysfs(dev);
3340 3351
3341out_free_irq:
3342 ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
3343
3344out_kill_eq: 3352out_kill_eq:
3345 ehea_destroy_eq(adapter->neq); 3353 ehea_destroy_eq(adapter->neq);
3346 3354
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
index 52c456ec4d6c..8364815c32ff 100644
--- a/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
+++ b/drivers/net/ethernet/ibm/ehea/ehea_phyp.h
@@ -450,7 +450,7 @@ u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
450 void *cb_addr); 450 void *cb_addr);
451 451
452#define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63) 452#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)
454#define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63) 454#define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63)
455#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63) 455#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)
456 456
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c
index 19ab2154802c..9520a6ac1f30 100644
--- a/drivers/net/ethernet/intel/e1000e/netdev.c
+++ b/drivers/net/ethernet/intel/e1000e/netdev.c
@@ -3799,7 +3799,7 @@ static int e1000_test_msi_interrupt(struct e1000_adapter *adapter)
3799 /* fire an unusual interrupt on the test handler */ 3799 /* fire an unusual interrupt on the test handler */
3800 ew32(ICS, E1000_ICS_RXSEQ); 3800 ew32(ICS, E1000_ICS_RXSEQ);
3801 e1e_flush(); 3801 e1e_flush();
3802 msleep(50); 3802 msleep(100);
3803 3803
3804 e1000_irq_disable(adapter); 3804 e1000_irq_disable(adapter);
3805 3805
diff --git a/drivers/net/ethernet/intel/e1000e/param.c b/drivers/net/ethernet/intel/e1000e/param.c
index ff796e42c3eb..16adeb9418a8 100644
--- a/drivers/net/ethernet/intel/e1000e/param.c
+++ b/drivers/net/ethernet/intel/e1000e/param.c
@@ -106,7 +106,7 @@ E1000_PARAM(RxAbsIntDelay, "Receive Absolute Interrupt Delay");
106/* 106/*
107 * Interrupt Throttle Rate (interrupts/sec) 107 * Interrupt Throttle Rate (interrupts/sec)
108 * 108 *
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
110 */ 110 */
111E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate"); 111E1000_PARAM(InterruptThrottleRate, "Interrupt Throttling Rate");
112#define DEFAULT_ITR 3 112#define DEFAULT_ITR 3
@@ -344,53 +344,60 @@ void __devinit e1000e_check_options(struct e1000_adapter *adapter)
344 344
345 if (num_InterruptThrottleRate > bd) { 345 if (num_InterruptThrottleRate > bd) {
346 adapter->itr = InterruptThrottleRate[bd]; 346 adapter->itr = InterruptThrottleRate[bd];
347 switch (adapter->itr) { 347
348 case 0: 348 /*
349 e_info("%s turned off\n", opt.name); 349 * Make sure a message is printed for non-special
350 break; 350 * values. And in case of an invalid option, display
351 case 1: 351 * warning, use default and got through itr/itr_setting
352 e_info("%s set to dynamic mode\n", opt.name); 352 * adjustment logic below
353 adapter->itr_setting = adapter->itr; 353 */
354 adapter->itr = 20000; 354 if ((adapter->itr > 4) &&
355 break; 355 e1000_validate_option(&adapter->itr, &opt, adapter))
356 case 3: 356 adapter->itr = opt.def;
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 }
391 } else { 357 } 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);
393 adapter->itr = 20000; 385 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;
394 } 401 }
395 } 402 }
396 { /* Interrupt Mode */ 403 { /* Interrupt Mode */
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
index d61ca2a732f0..8ec74b07f940 100644
--- a/drivers/net/ethernet/intel/igbvf/netdev.c
+++ b/drivers/net/ethernet/intel/igbvf/netdev.c
@@ -2731,14 +2731,14 @@ static int __devinit igbvf_probe(struct pci_dev *pdev,
2731 netdev->addr_len); 2731 netdev->addr_len);
2732 } 2732 }
2733 2733
2734 if (!is_valid_ether_addr(netdev->perm_addr)) { 2734 if (!is_valid_ether_addr(netdev->dev_addr)) {
2735 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n", 2735 dev_err(&pdev->dev, "Invalid MAC Address: %pM\n",
2736 netdev->dev_addr); 2736 netdev->dev_addr);
2737 err = -EIO; 2737 err = -EIO;
2738 goto err_hw_init; 2738 goto err_hw_init;
2739 } 2739 }
2740 2740
2741 memcpy(netdev->perm_addr, adapter->hw.mac.addr, netdev->addr_len); 2741 memcpy(netdev->perm_addr, netdev->dev_addr, netdev->addr_len);
2742 2742
2743 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog, 2743 setup_timer(&adapter->watchdog_timer, &igbvf_watchdog,
2744 (unsigned long) adapter); 2744 (unsigned long) adapter);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
index 77ea4b716535..bc07933d67da 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_fcoe.c
@@ -437,6 +437,7 @@ int ixgbe_fcoe_ddp(struct ixgbe_adapter *adapter,
437 */ 437 */
438 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) && 438 if ((fh->fh_r_ctl == FC_RCTL_DD_SOL_DATA) &&
439 (fctl & FC_FC_END_SEQ)) { 439 (fctl & FC_FC_END_SEQ)) {
440 skb_linearize(skb);
440 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc)); 441 crc = (struct fcoe_crc_eof *)skb_put(skb, sizeof(*crc));
441 crc->fcoe_eof = FC_EOF_T; 442 crc->fcoe_eof = FC_EOF_T;
442 } 443 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index a7f3cd872caf..88f6b2e9b72d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -4873,10 +4873,6 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake)
4873 } 4873 }
4874 4874
4875 ixgbe_clear_interrupt_scheme(adapter); 4875 ixgbe_clear_interrupt_scheme(adapter);
4876#ifdef CONFIG_DCB
4877 kfree(adapter->ixgbe_ieee_pfc);
4878 kfree(adapter->ixgbe_ieee_ets);
4879#endif
4880 4876
4881#ifdef CONFIG_PM 4877#ifdef CONFIG_PM
4882 retval = pci_save_state(pdev); 4878 retval = pci_save_state(pdev);
@@ -7224,6 +7220,11 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
7224 7220
7225 ixgbe_release_hw_control(adapter); 7221 ixgbe_release_hw_control(adapter);
7226 7222
7223#ifdef CONFIG_DCB
7224 kfree(adapter->ixgbe_ieee_pfc);
7225 kfree(adapter->ixgbe_ieee_ets);
7226
7227#endif
7227 iounmap(adapter->hw.hw_addr); 7228 iounmap(adapter->hw.hw_addr);
7228 pci_release_selected_regions(pdev, pci_select_bars(pdev, 7229 pci_release_selected_regions(pdev, pci_select_bars(pdev,
7229 IORESOURCE_MEM)); 7230 IORESOURCE_MEM));
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index c9b504e2dfc3..487a6c8bd4ec 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -2494,8 +2494,13 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
2494 skb_copy_from_linear_data(re->skb, skb->data, length); 2494 skb_copy_from_linear_data(re->skb, skb->data, length);
2495 skb->ip_summed = re->skb->ip_summed; 2495 skb->ip_summed = re->skb->ip_summed;
2496 skb->csum = re->skb->csum; 2496 skb->csum = re->skb->csum;
2497 skb->rxhash = re->skb->rxhash;
2498 skb->vlan_tci = re->skb->vlan_tci;
2499
2497 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, 2500 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
2498 length, PCI_DMA_FROMDEVICE); 2501 length, PCI_DMA_FROMDEVICE);
2502 re->skb->vlan_tci = 0;
2503 re->skb->rxhash = 0;
2499 re->skb->ip_summed = CHECKSUM_NONE; 2504 re->skb->ip_summed = CHECKSUM_NONE;
2500 skb_put(skb, length); 2505 skb_put(skb, length);
2501 } 2506 }
@@ -2580,9 +2585,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
2580 struct sk_buff *skb = NULL; 2585 struct sk_buff *skb = NULL;
2581 u16 count = (status & GMR_FS_LEN) >> 16; 2586 u16 count = (status & GMR_FS_LEN) >> 16;
2582 2587
2583 if (status & GMR_FS_VLAN)
2584 count -= VLAN_HLEN; /* Account for vlan tag */
2585
2586 netif_printk(sky2, rx_status, KERN_DEBUG, dev, 2588 netif_printk(sky2, rx_status, KERN_DEBUG, dev,
2587 "rx slot %u status 0x%x len %d\n", 2589 "rx slot %u status 0x%x len %d\n",
2588 sky2->rx_next, status, length); 2590 sky2->rx_next, status, length);
@@ -2590,6 +2592,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
2590 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending; 2592 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
2591 prefetch(sky2->rx_ring + sky2->rx_next); 2593 prefetch(sky2->rx_ring + sky2->rx_next);
2592 2594
2595 if (vlan_tx_tag_present(re->skb))
2596 count -= VLAN_HLEN; /* Account for vlan tag */
2597
2593 /* This chip has hardware problems that generates bogus status. 2598 /* This chip has hardware problems that generates bogus status.
2594 * So do only marginal checking and expect higher level protocols 2599 * So do only marginal checking and expect higher level protocols
2595 * to handle crap frames. 2600 * to handle crap frames.
@@ -2647,11 +2652,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
2647} 2652}
2648 2653
2649static inline void sky2_skb_rx(const struct sky2_port *sky2, 2654static inline void sky2_skb_rx(const struct sky2_port *sky2,
2650 u32 status, struct sk_buff *skb) 2655 struct sk_buff *skb)
2651{ 2656{
2652 if (status & GMR_FS_VLAN)
2653 __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));
2654
2655 if (skb->ip_summed == CHECKSUM_NONE) 2657 if (skb->ip_summed == CHECKSUM_NONE)
2656 netif_receive_skb(skb); 2658 netif_receive_skb(skb);
2657 else 2659 else
@@ -2705,6 +2707,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status)
2705 } 2707 }
2706} 2708}
2707 2709
2710static 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
2708static void sky2_rx_hash(struct sky2_port *sky2, u32 status) 2718static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
2709{ 2719{
2710 struct sk_buff *skb; 2720 struct sk_buff *skb;
@@ -2763,8 +2773,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
2763 } 2773 }
2764 2774
2765 skb->protocol = eth_type_trans(skb, dev); 2775 skb->protocol = eth_type_trans(skb, dev);
2766 2776 sky2_skb_rx(sky2, skb);
2767 sky2_skb_rx(sky2, status, skb);
2768 2777
2769 /* Stop after net poll weight */ 2778 /* Stop after net poll weight */
2770 if (++work_done >= to_do) 2779 if (++work_done >= to_do)
@@ -2772,11 +2781,11 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
2772 break; 2781 break;
2773 2782
2774 case OP_RXVLAN: 2783 case OP_RXVLAN:
2775 sky2->rx_tag = length; 2784 sky2_rx_tag(sky2, length);
2776 break; 2785 break;
2777 2786
2778 case OP_RXCHKSVLAN: 2787 case OP_RXCHKSVLAN:
2779 sky2->rx_tag = length; 2788 sky2_rx_tag(sky2, length);
2780 /* fall through */ 2789 /* fall through */
2781 case OP_RXCHKS: 2790 case OP_RXCHKS:
2782 if (likely(dev->features & NETIF_F_RXCSUM)) 2791 if (likely(dev->features & NETIF_F_RXCSUM))
diff --git a/drivers/net/ethernet/marvell/sky2.h b/drivers/net/ethernet/marvell/sky2.h
index ff6f58bf822a..3c896ce80b71 100644
--- a/drivers/net/ethernet/marvell/sky2.h
+++ b/drivers/net/ethernet/marvell/sky2.h
@@ -2241,7 +2241,6 @@ struct sky2_port {
2241 u16 rx_pending; 2241 u16 rx_pending;
2242 u16 rx_data_size; 2242 u16 rx_data_size;
2243 u16 rx_nfrags; 2243 u16 rx_nfrags;
2244 u16 rx_tag;
2245 2244
2246 struct { 2245 struct {
2247 unsigned long last; 2246 unsigned long last;
diff --git a/drivers/net/ethernet/sun/sungem.c b/drivers/net/ethernet/sun/sungem.c
index 558409ff4058..4ba969096717 100644
--- a/drivers/net/ethernet/sun/sungem.c
+++ b/drivers/net/ethernet/sun/sungem.c
@@ -2339,7 +2339,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
2339 netif_device_detach(dev); 2339 netif_device_detach(dev);
2340 2340
2341 /* Switch off chip, remember WOL setting */ 2341 /* Switch off chip, remember WOL setting */
2342 gp->asleep_wol = gp->wake_on_lan; 2342 gp->asleep_wol = !!gp->wake_on_lan;
2343 gem_do_stop(dev, gp->asleep_wol); 2343 gem_do_stop(dev, gp->asleep_wol);
2344 2344
2345 /* Unlock the network stack */ 2345 /* Unlock the network stack */
diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c
index 174a3348f676..08aff1a2087c 100644
--- a/drivers/net/ethernet/ti/davinci_emac.c
+++ b/drivers/net/ethernet/ti/davinci_emac.c
@@ -1511,7 +1511,7 @@ static int emac_devioctl(struct net_device *ndev, struct ifreq *ifrq, int cmd)
1511 1511
1512static int match_first_device(struct device *dev, void *data) 1512static int match_first_device(struct device *dev, void *data)
1513{ 1513{
1514 return 1; 1514 return !strncmp(dev_name(dev), "davinci_mdio", 12);
1515} 1515}
1516 1516
1517/** 1517/**
diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c
index 817ad3bc4957..efd36691ce54 100644
--- a/drivers/net/ethernet/ti/tlan.c
+++ b/drivers/net/ethernet/ti/tlan.c
@@ -228,7 +228,7 @@ tlan_get_skb(const struct tlan_list *tag)
228 unsigned long addr; 228 unsigned long addr;
229 229
230 addr = tag->buffer[9].address; 230 addr = tag->buffer[9].address;
231 addr |= (tag->buffer[8].address << 16) << 16; 231 addr |= ((unsigned long) tag->buffer[8].address << 16) << 16;
232 return (struct sk_buff *) addr; 232 return (struct sk_buff *) addr;
233} 233}
234 234
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 5ee032cafade..42b5151aa78a 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -355,7 +355,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
355 u32 packet_len; 355 u32 packet_len;
356 u32 padbytes = 0xffff0000; 356 u32 padbytes = 0xffff0000;
357 357
358 padlen = ((skb->len + 4) % 512) ? 0 : 4; 358 padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4;
359 359
360 if ((!skb_cloned(skb)) && 360 if ((!skb_cloned(skb)) &&
361 ((headroom + tailroom) >= (4 + padlen))) { 361 ((headroom + tailroom) >= (4 + padlen))) {
@@ -377,7 +377,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
377 cpu_to_le32s(&packet_len); 377 cpu_to_le32s(&packet_len);
378 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len)); 378 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
379 379
380 if ((skb->len % 512) == 0) { 380 if (padlen) {
381 cpu_to_le32s(&padbytes); 381 cpu_to_le32s(&padbytes);
382 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes)); 382 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
383 skb_put(skb, sizeof(padbytes)); 383 skb_put(skb, sizeof(padbytes));
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index a2349483cd2a..00103a8c5e04 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -98,7 +98,7 @@ static int __must_check smsc75xx_read_reg(struct usbnet *dev, u32 index,
98 98
99 if (unlikely(ret < 0)) 99 if (unlikely(ret < 0))
100 netdev_warn(dev->net, 100 netdev_warn(dev->net,
101 "Failed to read register index 0x%08x", index); 101 "Failed to read reg index 0x%08x: %d", index, ret);
102 102
103 le32_to_cpus(buf); 103 le32_to_cpus(buf);
104 *data = *buf; 104 *data = *buf;
@@ -128,7 +128,7 @@ static int __must_check smsc75xx_write_reg(struct usbnet *dev, u32 index,
128 128
129 if (unlikely(ret < 0)) 129 if (unlikely(ret < 0))
130 netdev_warn(dev->net, 130 netdev_warn(dev->net,
131 "Failed to write register index 0x%08x", index); 131 "Failed to write reg index 0x%08x: %d", index, ret);
132 132
133 kfree(buf); 133 kfree(buf);
134 134
@@ -171,7 +171,7 @@ static int smsc75xx_mdio_read(struct net_device *netdev, int phy_id, int idx)
171 idx &= dev->mii.reg_num_mask; 171 idx &= dev->mii.reg_num_mask;
172 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) 172 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
173 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) 173 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
174 | MII_ACCESS_READ; 174 | MII_ACCESS_READ | MII_ACCESS_BUSY;
175 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); 175 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
176 check_warn_goto_done(ret, "Error writing MII_ACCESS"); 176 check_warn_goto_done(ret, "Error writing MII_ACCESS");
177 177
@@ -210,7 +210,7 @@ static void smsc75xx_mdio_write(struct net_device *netdev, int phy_id, int idx,
210 idx &= dev->mii.reg_num_mask; 210 idx &= dev->mii.reg_num_mask;
211 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR) 211 addr = ((phy_id << MII_ACCESS_PHY_ADDR_SHIFT) & MII_ACCESS_PHY_ADDR)
212 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR) 212 | ((idx << MII_ACCESS_REG_ADDR_SHIFT) & MII_ACCESS_REG_ADDR)
213 | MII_ACCESS_WRITE; 213 | MII_ACCESS_WRITE | MII_ACCESS_BUSY;
214 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr); 214 ret = smsc75xx_write_reg(dev, MII_ACCESS, addr);
215 check_warn_goto_done(ret, "Error writing MII_ACCESS"); 215 check_warn_goto_done(ret, "Error writing MII_ACCESS");
216 216
@@ -508,9 +508,10 @@ static int smsc75xx_link_reset(struct usbnet *dev)
508 u16 lcladv, rmtadv; 508 u16 lcladv, rmtadv;
509 int ret; 509 int ret;
510 510
511 /* clear interrupt status */ 511 /* read and write to clear phy interrupt status */
512 ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC); 512 ret = smsc75xx_mdio_read(dev->net, mii->phy_id, PHY_INT_SRC);
513 check_warn_return(ret, "Error reading PHY_INT_SRC"); 513 check_warn_return(ret, "Error reading PHY_INT_SRC");
514 smsc75xx_mdio_write(dev->net, mii->phy_id, PHY_INT_SRC, 0xffff);
514 515
515 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL); 516 ret = smsc75xx_write_reg(dev, INT_STS, INT_STS_CLEAR_ALL);
516 check_warn_return(ret, "Error writing INT_STS"); 517 check_warn_return(ret, "Error writing INT_STS");
@@ -643,7 +644,7 @@ static int smsc75xx_set_mac_address(struct usbnet *dev)
643 644
644static int smsc75xx_phy_initialize(struct usbnet *dev) 645static int smsc75xx_phy_initialize(struct usbnet *dev)
645{ 646{
646 int bmcr, timeout = 0; 647 int bmcr, ret, timeout = 0;
647 648
648 /* Initialize MII structure */ 649 /* Initialize MII structure */
649 dev->mii.dev = dev->net; 650 dev->mii.dev = dev->net;
@@ -651,6 +652,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
651 dev->mii.mdio_write = smsc75xx_mdio_write; 652 dev->mii.mdio_write = smsc75xx_mdio_write;
652 dev->mii.phy_id_mask = 0x1f; 653 dev->mii.phy_id_mask = 0x1f;
653 dev->mii.reg_num_mask = 0x1f; 654 dev->mii.reg_num_mask = 0x1f;
655 dev->mii.supports_gmii = 1;
654 dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID; 656 dev->mii.phy_id = SMSC75XX_INTERNAL_PHY_ID;
655 657
656 /* reset phy and wait for reset to complete */ 658 /* reset phy and wait for reset to complete */
@@ -661,7 +663,7 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
661 bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR); 663 bmcr = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, MII_BMCR);
662 check_warn_return(bmcr, "Error reading MII_BMCR"); 664 check_warn_return(bmcr, "Error reading MII_BMCR");
663 timeout++; 665 timeout++;
664 } while ((bmcr & MII_BMCR) && (timeout < 100)); 666 } while ((bmcr & BMCR_RESET) && (timeout < 100));
665 667
666 if (timeout >= 100) { 668 if (timeout >= 100) {
667 netdev_warn(dev->net, "timeout on PHY Reset"); 669 netdev_warn(dev->net, "timeout on PHY Reset");
@@ -671,10 +673,13 @@ static int smsc75xx_phy_initialize(struct usbnet *dev)
671 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE, 673 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_ADVERTISE,
672 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP | 674 ADVERTISE_ALL | ADVERTISE_CSMA | ADVERTISE_PAUSE_CAP |
673 ADVERTISE_PAUSE_ASYM); 675 ADVERTISE_PAUSE_ASYM);
676 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
677 ADVERTISE_1000FULL);
674 678
675 /* read to clear */ 679 /* read and write to clear phy interrupt status */
676 smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC); 680 ret = smsc75xx_mdio_read(dev->net, dev->mii.phy_id, PHY_INT_SRC);
677 check_warn_return(bmcr, "Error reading 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);
678 683
679 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK, 684 smsc75xx_mdio_write(dev->net, dev->mii.phy_id, PHY_INT_MASK,
680 PHY_INT_MASK_DEFAULT); 685 PHY_INT_MASK_DEFAULT);
@@ -946,6 +951,14 @@ static int smsc75xx_reset(struct usbnet *dev)
946 ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf); 951 ret = smsc75xx_write_reg(dev, INT_EP_CTL, buf);
947 check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret); 952 check_warn_return(ret, "Failed to write INT_EP_CTL: %d", ret);
948 953
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
949 ret = smsc75xx_read_reg(dev, MAC_TX, &buf); 962 ret = smsc75xx_read_reg(dev, MAC_TX, &buf);
950 check_warn_return(ret, "Failed to read MAC_TX: %d", ret); 963 check_warn_return(ret, "Failed to read MAC_TX: %d", ret);
951 964
@@ -1212,7 +1225,7 @@ static const struct driver_info smsc75xx_info = {
1212 .rx_fixup = smsc75xx_rx_fixup, 1225 .rx_fixup = smsc75xx_rx_fixup,
1213 .tx_fixup = smsc75xx_tx_fixup, 1226 .tx_fixup = smsc75xx_tx_fixup,
1214 .status = smsc75xx_status, 1227 .status = smsc75xx_status,
1215 .flags = FLAG_ETHER | FLAG_SEND_ZLP, 1228 .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
1216}; 1229};
1217 1230
1218static const struct usb_device_id products[] = { 1231static const struct usb_device_id products[] = {
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 5f19f84d3494..94ae66999f59 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -1017,6 +1017,7 @@ static int smsc95xx_bind(struct usbnet *dev, struct usb_interface *intf)
1017 dev->net->ethtool_ops = &smsc95xx_ethtool_ops; 1017 dev->net->ethtool_ops = &smsc95xx_ethtool_ops;
1018 dev->net->flags |= IFF_MULTICAST; 1018 dev->net->flags |= IFF_MULTICAST;
1019 dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM; 1019 dev->net->hard_header_len += SMSC95XX_TX_OVERHEAD_CSUM;
1020 dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
1020 return 0; 1021 return 0;
1021} 1022}
1022 1023
@@ -1191,7 +1192,7 @@ static const struct driver_info smsc95xx_info = {
1191 .rx_fixup = smsc95xx_rx_fixup, 1192 .rx_fixup = smsc95xx_rx_fixup,
1192 .tx_fixup = smsc95xx_tx_fixup, 1193 .tx_fixup = smsc95xx_tx_fixup,
1193 .status = smsc95xx_status, 1194 .status = smsc95xx_status,
1194 .flags = FLAG_ETHER | FLAG_SEND_ZLP, 1195 .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
1195}; 1196};
1196 1197
1197static const struct usb_device_id products[] = { 1198static const struct usb_device_id products[] = {
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index b7b3f5b0d406..2d927fb4adf4 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -210,6 +210,7 @@ static int init_status (struct usbnet *dev, struct usb_interface *intf)
210 } else { 210 } else {
211 usb_fill_int_urb(dev->interrupt, dev->udev, pipe, 211 usb_fill_int_urb(dev->interrupt, dev->udev, pipe,
212 buf, maxp, intr_complete, dev, period); 212 buf, maxp, intr_complete, dev, period);
213 dev->interrupt->transfer_flags |= URB_FREE_BUFFER;
213 dev_dbg(&intf->dev, 214 dev_dbg(&intf->dev,
214 "status ep%din, %d bytes period %d\n", 215 "status ep%din, %d bytes period %d\n",
215 usb_pipeendpoint(pipe), maxp, period); 216 usb_pipeendpoint(pipe), maxp, period);
@@ -1443,7 +1444,7 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1443 1444
1444 status = register_netdev (net); 1445 status = register_netdev (net);
1445 if (status) 1446 if (status)
1446 goto out3; 1447 goto out4;
1447 netif_info(dev, probe, dev->net, 1448 netif_info(dev, probe, dev->net,
1448 "register '%s' at usb-%s-%s, %s, %pM\n", 1449 "register '%s' at usb-%s-%s, %s, %pM\n",
1449 udev->dev.driver->name, 1450 udev->dev.driver->name,
@@ -1461,6 +1462,8 @@ usbnet_probe (struct usb_interface *udev, const struct usb_device_id *prod)
1461 1462
1462 return 0; 1463 return 0;
1463 1464
1465out4:
1466 usb_free_urb(dev->interrupt);
1464out3: 1467out3:
1465 if (info->unbind) 1468 if (info->unbind)
1466 info->unbind (dev, udev); 1469 info->unbind (dev, udev);
diff --git a/drivers/net/wireless/ath/ath5k/ahb.c b/drivers/net/wireless/ath/ath5k/ahb.c
index 8c50d9d19d78..aec33cc207fd 100644
--- a/drivers/net/wireless/ath/ath5k/ahb.c
+++ b/drivers/net/wireless/ath/ath5k/ahb.c
@@ -220,6 +220,7 @@ static int ath_ahb_remove(struct platform_device *pdev)
220 } 220 }
221 221
222 ath5k_deinit_ah(ah); 222 ath5k_deinit_ah(ah);
223 iounmap(ah->iobase);
223 platform_set_drvdata(pdev, NULL); 224 platform_set_drvdata(pdev, NULL);
224 ieee80211_free_hw(hw); 225 ieee80211_free_hw(hw);
225 226
diff --git a/drivers/net/wireless/ath/ath9k/ar5008_phy.c b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
index d7d8e9199140..aba088005b22 100644
--- a/drivers/net/wireless/ath/ath9k/ar5008_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar5008_phy.c
@@ -869,7 +869,7 @@ static int ar5008_hw_process_ini(struct ath_hw *ah,
869 ar5008_hw_set_channel_regs(ah, chan); 869 ar5008_hw_set_channel_regs(ah, chan);
870 ar5008_hw_init_chain_masks(ah); 870 ar5008_hw_init_chain_masks(ah);
871 ath9k_olc_init(ah); 871 ath9k_olc_init(ah);
872 ath9k_hw_apply_txpower(ah, chan); 872 ath9k_hw_apply_txpower(ah, chan, false);
873 873
874 /* Write analog registers */ 874 /* Write analog registers */
875 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) { 875 if (!ath9k_hw_set_rf_regs(ah, chan, freqIndex)) {
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
index 59647a3ceb7f..3d400e8d6535 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_paprd.c
@@ -54,7 +54,7 @@ void ar9003_paprd_enable(struct ath_hw *ah, bool val)
54 54
55 if (val) { 55 if (val) {
56 ah->paprd_table_write_done = true; 56 ah->paprd_table_write_done = true;
57 ath9k_hw_apply_txpower(ah, chan); 57 ath9k_hw_apply_txpower(ah, chan, false);
58 } 58 }
59 59
60 REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0, 60 REG_RMW_FIELD(ah, AR_PHY_PAPRD_CTRL0_B0,
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
index bc992b237ae5..deb6cfb2959a 100644
--- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c
+++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c
@@ -694,7 +694,7 @@ static int ar9003_hw_process_ini(struct ath_hw *ah,
694 ar9003_hw_override_ini(ah); 694 ar9003_hw_override_ini(ah);
695 ar9003_hw_set_channel_regs(ah, chan); 695 ar9003_hw_set_channel_regs(ah, chan);
696 ar9003_hw_set_chain_masks(ah, ah->rxchainmask, ah->txchainmask); 696 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);
698 698
699 if (AR_SREV_9462(ah)) { 699 if (AR_SREV_9462(ah)) {
700 if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0, 700 if (REG_READ_FIELD(ah, AR_PHY_TX_IQCAL_CONTROL_0,
diff --git a/drivers/net/wireless/ath/ath9k/eeprom_9287.c b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
index f272236d8053..b34e8b2990b1 100644
--- a/drivers/net/wireless/ath/ath9k/eeprom_9287.c
+++ b/drivers/net/wireless/ath/ath9k/eeprom_9287.c
@@ -824,6 +824,8 @@ static void ath9k_hw_ar9287_set_txpower(struct ath_hw *ah,
824 regulatory->max_power_level = ratesArray[i]; 824 regulatory->max_power_level = ratesArray[i];
825 } 825 }
826 826
827 ath9k_hw_update_regulatory_maxpower(ah);
828
827 if (test) 829 if (test)
828 return; 830 return;
829 831
diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
index 6c69e4e8b1cb..fa84e37bf091 100644
--- a/drivers/net/wireless/ath/ath9k/hw.c
+++ b/drivers/net/wireless/ath/ath9k/hw.c
@@ -1454,7 +1454,7 @@ static bool ath9k_hw_channel_change(struct ath_hw *ah,
1454 return false; 1454 return false;
1455 } 1455 }
1456 ath9k_hw_set_clockrate(ah); 1456 ath9k_hw_set_clockrate(ah);
1457 ath9k_hw_apply_txpower(ah, chan); 1457 ath9k_hw_apply_txpower(ah, chan, false);
1458 ath9k_hw_rfbus_done(ah); 1458 ath9k_hw_rfbus_done(ah);
1459 1459
1460 if (IS_CHAN_OFDM(chan) || IS_CHAN_HT(chan)) 1460 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)
2652 return ah->eep_ops->get_eeprom(ah, gain_param); 2652 return ah->eep_ops->get_eeprom(ah, gain_param);
2653} 2653}
2654 2654
2655void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan) 2655void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
2656 bool test)
2656{ 2657{
2657 struct ath_regulatory *reg = ath9k_hw_regulatory(ah); 2658 struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
2658 struct ieee80211_channel *channel; 2659 struct ieee80211_channel *channel;
@@ -2673,7 +2674,7 @@ void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan)
2673 2674
2674 ah->eep_ops->set_txpower(ah, chan, 2675 ah->eep_ops->set_txpower(ah, chan,
2675 ath9k_regd_get_ctl(reg, chan), 2676 ath9k_regd_get_ctl(reg, chan),
2676 ant_reduction, new_pwr, false); 2677 ant_reduction, new_pwr, test);
2677} 2678}
2678 2679
2679void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test) 2680void 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)
2686 if (test) 2687 if (test)
2687 channel->max_power = MAX_RATE_POWER / 2; 2688 channel->max_power = MAX_RATE_POWER / 2;
2688 2689
2689 ath9k_hw_apply_txpower(ah, chan); 2690 ath9k_hw_apply_txpower(ah, chan, test);
2690 2691
2691 if (test) 2692 if (test)
2692 channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2); 2693 channel->max_power = DIV_ROUND_UP(reg->max_power_level, 2);
diff --git a/drivers/net/wireless/ath/ath9k/hw.h b/drivers/net/wireless/ath/ath9k/hw.h
index aa1680a0c7fd..e88f182ff45c 100644
--- a/drivers/net/wireless/ath/ath9k/hw.h
+++ b/drivers/net/wireless/ath/ath9k/hw.h
@@ -985,7 +985,8 @@ void ath9k_hw_name(struct ath_hw *ah, char *hw_name, size_t len);
985/* PHY */ 985/* PHY */
986void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled, 986void ath9k_hw_get_delta_slope_vals(struct ath_hw *ah, u32 coef_scaled,
987 u32 *coef_mantissa, u32 *coef_exponent); 987 u32 *coef_mantissa, u32 *coef_exponent);
988void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan); 988void ath9k_hw_apply_txpower(struct ath_hw *ah, struct ath9k_channel *chan,
989 bool test);
989 990
990/* 991/*
991 * Code Specific to AR5008, AR9001 or AR9002, 992 * Code Specific to AR5008, AR9001 or AR9002,
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index c79e6638c88d..e4d6dc2e37d1 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -4827,8 +4827,14 @@ static int b43_op_start(struct ieee80211_hw *hw)
4827 out_mutex_unlock: 4827 out_mutex_unlock:
4828 mutex_unlock(&wl->mutex); 4828 mutex_unlock(&wl->mutex);
4829 4829
4830 /* reload configuration */ 4830 /*
4831 b43_op_config(hw, ~0); 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);
4832 4838
4833 return err; 4839 return err;
4834} 4840}
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 4688904908ec..758c115b556e 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -108,9 +108,15 @@ static inline int brcmf_sdioh_f0_write_byte(struct brcmf_sdio_dev *sdiodev,
108 sdio_release_host(sdfunc); 108 sdio_release_host(sdfunc);
109 } 109 }
110 } else if (regaddr == SDIO_CCCR_ABORT) { 110 } 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;
111 sdio_claim_host(sdfunc); 116 sdio_claim_host(sdfunc);
112 sdio_writeb(sdfunc, *byte, regaddr, &err_ret); 117 sdio_writeb(sdfunc, *byte, regaddr, &err_ret);
113 sdio_release_host(sdfunc); 118 sdio_release_host(sdfunc);
119 kfree(sdfunc);
114 } else if (regaddr < 0xF0) { 120 } else if (regaddr < 0xF0) {
115 brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr); 121 brcmf_dbg(ERROR, "F0 Wr:0x%02x: write disallowed\n", regaddr);
116 err_ret = -EPERM; 122 err_ret = -EPERM;
@@ -486,7 +492,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
486 kfree(bus_if); 492 kfree(bus_if);
487 return -ENOMEM; 493 return -ENOMEM;
488 } 494 }
489 sdiodev->func[0] = func->card->sdio_func[0]; 495 sdiodev->func[0] = func;
490 sdiodev->func[1] = func; 496 sdiodev->func[1] = func;
491 sdiodev->bus_if = bus_if; 497 sdiodev->bus_if = bus_if;
492 bus_if->bus_priv.sdio = sdiodev; 498 bus_if->bus_priv.sdio = sdiodev;
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index 2bf5dda29291..eb3829b03cd3 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -574,6 +574,8 @@ struct brcmf_sdio {
574 574
575 struct task_struct *dpc_tsk; 575 struct task_struct *dpc_tsk;
576 struct completion dpc_wait; 576 struct completion dpc_wait;
577 struct list_head dpc_tsklst;
578 spinlock_t dpc_tl_lock;
577 579
578 struct semaphore sdsem; 580 struct semaphore sdsem;
579 581
@@ -2594,29 +2596,58 @@ clkwait:
2594 return resched; 2596 return resched;
2595} 2597}
2596 2598
2599static 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
2597static int brcmf_sdbrcm_dpc_thread(void *data) 2616static int brcmf_sdbrcm_dpc_thread(void *data)
2598{ 2617{
2599 struct brcmf_sdio *bus = (struct brcmf_sdio *) data; 2618 struct brcmf_sdio *bus = (struct brcmf_sdio *) data;
2619 struct list_head *cur_hd, *tmp_hd;
2620 unsigned long flags;
2600 2621
2601 allow_signal(SIGTERM); 2622 allow_signal(SIGTERM);
2602 /* Run until signal received */ 2623 /* Run until signal received */
2603 while (1) { 2624 while (1) {
2604 if (kthread_should_stop()) 2625 if (kthread_should_stop())
2605 break; 2626 break;
2606 if (!wait_for_completion_interruptible(&bus->dpc_wait)) { 2627
2607 /* Call bus dpc unless it indicated down 2628 if (list_empty(&bus->dpc_tsklst))
2608 (then clean stop) */ 2629 if (wait_for_completion_interruptible(&bus->dpc_wait))
2609 if (bus->sdiodev->bus_if->state != BRCMF_BUS_DOWN) { 2630 break;
2610 if (brcmf_sdbrcm_dpc(bus)) 2631
2611 complete(&bus->dpc_wait); 2632 spin_lock_irqsave(&bus->dpc_tl_lock, flags);
2612 } else { 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) {
2613 /* after stopping the bus, exit thread */ 2637 /* after stopping the bus, exit thread */
2614 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); 2638 brcmf_sdbrcm_bus_stop(bus->sdiodev->dev);
2615 bus->dpc_tsk = NULL; 2639 bus->dpc_tsk = NULL;
2616 break; 2640 break;
2617 } 2641 }
2618 } else 2642
2619 break; 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);
2620 } 2651 }
2621 return 0; 2652 return 0;
2622} 2653}
@@ -2669,8 +2700,10 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt)
2669 /* Schedule DPC if needed to send queued packet(s) */ 2700 /* Schedule DPC if needed to send queued packet(s) */
2670 if (!bus->dpc_sched) { 2701 if (!bus->dpc_sched) {
2671 bus->dpc_sched = true; 2702 bus->dpc_sched = true;
2672 if (bus->dpc_tsk) 2703 if (bus->dpc_tsk) {
2704 brcmf_sdbrcm_adddpctsk(bus);
2673 complete(&bus->dpc_wait); 2705 complete(&bus->dpc_wait);
2706 }
2674 } 2707 }
2675 2708
2676 return ret; 2709 return ret;
@@ -3514,8 +3547,10 @@ void brcmf_sdbrcm_isr(void *arg)
3514 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); 3547 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n");
3515 3548
3516 bus->dpc_sched = true; 3549 bus->dpc_sched = true;
3517 if (bus->dpc_tsk) 3550 if (bus->dpc_tsk) {
3551 brcmf_sdbrcm_adddpctsk(bus);
3518 complete(&bus->dpc_wait); 3552 complete(&bus->dpc_wait);
3553 }
3519} 3554}
3520 3555
3521static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus) 3556static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)
@@ -3559,8 +3594,10 @@ static bool brcmf_sdbrcm_bus_watchdog(struct brcmf_sdio *bus)
3559 bus->ipend = true; 3594 bus->ipend = true;
3560 3595
3561 bus->dpc_sched = true; 3596 bus->dpc_sched = true;
3562 if (bus->dpc_tsk) 3597 if (bus->dpc_tsk) {
3598 brcmf_sdbrcm_adddpctsk(bus);
3563 complete(&bus->dpc_wait); 3599 complete(&bus->dpc_wait);
3600 }
3564 } 3601 }
3565 } 3602 }
3566 3603
@@ -3897,6 +3934,8 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3897 } 3934 }
3898 /* Initialize DPC thread */ 3935 /* Initialize DPC thread */
3899 init_completion(&bus->dpc_wait); 3936 init_completion(&bus->dpc_wait);
3937 INIT_LIST_HEAD(&bus->dpc_tsklst);
3938 spin_lock_init(&bus->dpc_tl_lock);
3900 bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread, 3939 bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread,
3901 bus, "brcmf_dpc"); 3940 bus, "brcmf_dpc");
3902 if (IS_ERR(bus->dpc_tsk)) { 3941 if (IS_ERR(bus->dpc_tsk)) {
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 7083db75b00c..b4d92792c502 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -847,8 +847,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs)
847 */ 847 */
848 if (!(txs->status & TX_STATUS_AMPDU) 848 if (!(txs->status & TX_STATUS_AMPDU)
849 && (txs->status & TX_STATUS_INTERMEDIATE)) { 849 && (txs->status & TX_STATUS_INTERMEDIATE)) {
850 wiphy_err(wlc->wiphy, "%s: INTERMEDIATE but not AMPDU\n", 850 BCMMSG(wlc->wiphy, "INTERMEDIATE but not AMPDU\n");
851 __func__);
852 return false; 851 return false;
853 } 852 }
854 853
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 2b022571a859..1779db3aa2b0 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -2191,6 +2191,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
2191{ 2191{
2192 int rc = 0; 2192 int rc = 0;
2193 unsigned long flags; 2193 unsigned long flags;
2194 unsigned long now, end;
2194 2195
2195 spin_lock_irqsave(&priv->lock, flags); 2196 spin_lock_irqsave(&priv->lock, flags);
2196 if (priv->status & STATUS_HCMD_ACTIVE) { 2197 if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -2232,10 +2233,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
2232 } 2233 }
2233 spin_unlock_irqrestore(&priv->lock, flags); 2234 spin_unlock_irqrestore(&priv->lock, flags);
2234 2235
2236 now = jiffies;
2237 end = now + HOST_COMPLETE_TIMEOUT;
2238again:
2235 rc = wait_event_interruptible_timeout(priv->wait_command_queue, 2239 rc = wait_event_interruptible_timeout(priv->wait_command_queue,
2236 !(priv-> 2240 !(priv->
2237 status & STATUS_HCMD_ACTIVE), 2241 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
2239 if (rc == 0) { 2250 if (rc == 0) {
2240 spin_lock_irqsave(&priv->lock, flags); 2251 spin_lock_irqsave(&priv->lock, flags);
2241 if (priv->status & STATUS_HCMD_ACTIVE) { 2252 if (priv->status & STATUS_HCMD_ACTIVE) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index 5b0d888f746b..8d80e233bc7a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -46,8 +46,8 @@
46#include "iwl-prph.h" 46#include "iwl-prph.h"
47 47
48/* Highest firmware API version supported */ 48/* Highest firmware API version supported */
49#define IWL1000_UCODE_API_MAX 6 49#define IWL1000_UCODE_API_MAX 5
50#define IWL100_UCODE_API_MAX 6 50#define IWL100_UCODE_API_MAX 5
51 51
52/* Oldest version we won't warn about */ 52/* Oldest version we won't warn about */
53#define IWL1000_UCODE_API_OK 5 53#define IWL1000_UCODE_API_OK 5
@@ -226,5 +226,5 @@ const struct iwl_cfg iwl100_bg_cfg = {
226 IWL_DEVICE_100, 226 IWL_DEVICE_100,
227}; 227};
228 228
229MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_MAX)); 229MODULE_FIRMWARE(IWL1000_MODULE_FIRMWARE(IWL1000_UCODE_API_OK));
230MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_MAX)); 230MODULE_FIRMWARE(IWL100_MODULE_FIRMWARE(IWL100_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 5635b9e2c69e..ea108622e0bd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -51,10 +51,10 @@
51#define IWL135_UCODE_API_MAX 6 51#define IWL135_UCODE_API_MAX 6
52 52
53/* Oldest version we won't warn about */ 53/* Oldest version we won't warn about */
54#define IWL2030_UCODE_API_OK 5 54#define IWL2030_UCODE_API_OK 6
55#define IWL2000_UCODE_API_OK 5 55#define IWL2000_UCODE_API_OK 6
56#define IWL105_UCODE_API_OK 5 56#define IWL105_UCODE_API_OK 6
57#define IWL135_UCODE_API_OK 5 57#define IWL135_UCODE_API_OK 6
58 58
59/* Lowest firmware API version supported */ 59/* Lowest firmware API version supported */
60#define IWL2030_UCODE_API_MIN 5 60#define IWL2030_UCODE_API_MIN 5
@@ -328,7 +328,7 @@ const struct iwl_cfg iwl135_bgn_cfg = {
328 .ht_params = &iwl2000_ht_params, 328 .ht_params = &iwl2000_ht_params,
329}; 329};
330 330
331MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_MAX)); 331MODULE_FIRMWARE(IWL2000_MODULE_FIRMWARE(IWL2000_UCODE_API_OK));
332MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_MAX)); 332MODULE_FIRMWARE(IWL2030_MODULE_FIRMWARE(IWL2030_UCODE_API_OK));
333MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_MAX)); 333MODULE_FIRMWARE(IWL105_MODULE_FIRMWARE(IWL105_UCODE_API_OK));
334MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_MAX)); 334MODULE_FIRMWARE(IWL135_MODULE_FIRMWARE(IWL135_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index a805e97b89af..de0920c74cdd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -51,6 +51,10 @@
51#define IWL5000_UCODE_API_MAX 5 51#define IWL5000_UCODE_API_MAX 5
52#define IWL5150_UCODE_API_MAX 2 52#define IWL5150_UCODE_API_MAX 2
53 53
54/* Oldest version we won't warn about */
55#define IWL5000_UCODE_API_OK 5
56#define IWL5150_UCODE_API_OK 2
57
54/* Lowest firmware API version supported */ 58/* Lowest firmware API version supported */
55#define IWL5000_UCODE_API_MIN 1 59#define IWL5000_UCODE_API_MIN 1
56#define IWL5150_UCODE_API_MIN 1 60#define IWL5150_UCODE_API_MIN 1
@@ -326,6 +330,7 @@ static const struct iwl_ht_params iwl5000_ht_params = {
326#define IWL_DEVICE_5000 \ 330#define IWL_DEVICE_5000 \
327 .fw_name_pre = IWL5000_FW_PRE, \ 331 .fw_name_pre = IWL5000_FW_PRE, \
328 .ucode_api_max = IWL5000_UCODE_API_MAX, \ 332 .ucode_api_max = IWL5000_UCODE_API_MAX, \
333 .ucode_api_ok = IWL5000_UCODE_API_OK, \
329 .ucode_api_min = IWL5000_UCODE_API_MIN, \ 334 .ucode_api_min = IWL5000_UCODE_API_MIN, \
330 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 335 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
331 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 336 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
@@ -371,6 +376,7 @@ const struct iwl_cfg iwl5350_agn_cfg = {
371 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN", 376 .name = "Intel(R) WiMAX/WiFi Link 5350 AGN",
372 .fw_name_pre = IWL5000_FW_PRE, 377 .fw_name_pre = IWL5000_FW_PRE,
373 .ucode_api_max = IWL5000_UCODE_API_MAX, 378 .ucode_api_max = IWL5000_UCODE_API_MAX,
379 .ucode_api_ok = IWL5000_UCODE_API_OK,
374 .ucode_api_min = IWL5000_UCODE_API_MIN, 380 .ucode_api_min = IWL5000_UCODE_API_MIN,
375 .max_inst_size = IWLAGN_RTC_INST_SIZE, 381 .max_inst_size = IWLAGN_RTC_INST_SIZE,
376 .max_data_size = IWLAGN_RTC_DATA_SIZE, 382 .max_data_size = IWLAGN_RTC_DATA_SIZE,
@@ -386,6 +392,7 @@ const struct iwl_cfg iwl5350_agn_cfg = {
386#define IWL_DEVICE_5150 \ 392#define IWL_DEVICE_5150 \
387 .fw_name_pre = IWL5150_FW_PRE, \ 393 .fw_name_pre = IWL5150_FW_PRE, \
388 .ucode_api_max = IWL5150_UCODE_API_MAX, \ 394 .ucode_api_max = IWL5150_UCODE_API_MAX, \
395 .ucode_api_ok = IWL5150_UCODE_API_OK, \
389 .ucode_api_min = IWL5150_UCODE_API_MIN, \ 396 .ucode_api_min = IWL5150_UCODE_API_MIN, \
390 .max_inst_size = IWLAGN_RTC_INST_SIZE, \ 397 .max_inst_size = IWLAGN_RTC_INST_SIZE, \
391 .max_data_size = IWLAGN_RTC_DATA_SIZE, \ 398 .max_data_size = IWLAGN_RTC_DATA_SIZE, \
@@ -409,5 +416,5 @@ const struct iwl_cfg iwl5150_abg_cfg = {
409 IWL_DEVICE_5150, 416 IWL_DEVICE_5150,
410}; 417};
411 418
412MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_MAX)); 419MODULE_FIRMWARE(IWL5000_MODULE_FIRMWARE(IWL5000_UCODE_API_OK));
413MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_MAX)); 420MODULE_FIRMWARE(IWL5150_MODULE_FIRMWARE(IWL5150_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index 64060cd738b5..f0c91505a7f7 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -53,6 +53,8 @@
53/* Oldest version we won't warn about */ 53/* Oldest version we won't warn about */
54#define IWL6000_UCODE_API_OK 4 54#define IWL6000_UCODE_API_OK 4
55#define IWL6000G2_UCODE_API_OK 5 55#define IWL6000G2_UCODE_API_OK 5
56#define IWL6050_UCODE_API_OK 5
57#define IWL6000G2B_UCODE_API_OK 6
56 58
57/* Lowest firmware API version supported */ 59/* Lowest firmware API version supported */
58#define IWL6000_UCODE_API_MIN 4 60#define IWL6000_UCODE_API_MIN 4
@@ -388,7 +390,7 @@ const struct iwl_cfg iwl6005_2agn_mow2_cfg = {
388#define IWL_DEVICE_6030 \ 390#define IWL_DEVICE_6030 \
389 .fw_name_pre = IWL6030_FW_PRE, \ 391 .fw_name_pre = IWL6030_FW_PRE, \
390 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \ 392 .ucode_api_max = IWL6000G2_UCODE_API_MAX, \
391 .ucode_api_ok = IWL6000G2_UCODE_API_OK, \ 393 .ucode_api_ok = IWL6000G2B_UCODE_API_OK, \
392 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \ 394 .ucode_api_min = IWL6000G2_UCODE_API_MIN, \
393 .max_inst_size = IWL60_RTC_INST_SIZE, \ 395 .max_inst_size = IWL60_RTC_INST_SIZE, \
394 .max_data_size = IWL60_RTC_DATA_SIZE, \ 396 .max_data_size = IWL60_RTC_DATA_SIZE, \
@@ -557,6 +559,6 @@ const struct iwl_cfg iwl6000_3agn_cfg = {
557}; 559};
558 560
559MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK)); 561MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_OK));
560MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_MAX)); 562MODULE_FIRMWARE(IWL6050_MODULE_FIRMWARE(IWL6050_UCODE_API_OK));
561MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); 563MODULE_FIRMWARE(IWL6005_MODULE_FIRMWARE(IWL6000G2_UCODE_API_OK));
562MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2_UCODE_API_MAX)); 564MODULE_FIRMWARE(IWL6030_MODULE_FIRMWARE(IWL6000G2B_UCODE_API_OK));
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index f1226dbf789d..2a9a16f901c3 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -863,7 +863,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
863 863
864void iwlagn_prepare_restart(struct iwl_priv *priv) 864void iwlagn_prepare_restart(struct iwl_priv *priv)
865{ 865{
866 struct iwl_rxon_context *ctx;
867 bool bt_full_concurrent; 866 bool bt_full_concurrent;
868 u8 bt_ci_compliance; 867 u8 bt_ci_compliance;
869 u8 bt_load; 868 u8 bt_load;
@@ -872,8 +871,6 @@ void iwlagn_prepare_restart(struct iwl_priv *priv)
872 871
873 lockdep_assert_held(&priv->mutex); 872 lockdep_assert_held(&priv->mutex);
874 873
875 for_each_context(priv, ctx)
876 ctx->vif = NULL;
877 priv->is_open = 0; 874 priv->is_open = 0;
878 875
879 /* 876 /*
diff --git a/drivers/net/wireless/iwlwifi/iwl-fh.h b/drivers/net/wireless/iwlwifi/iwl-fh.h
index 90208094b8eb..74bce97a8600 100644
--- a/drivers/net/wireless/iwlwifi/iwl-fh.h
+++ b/drivers/net/wireless/iwlwifi/iwl-fh.h
@@ -104,15 +104,29 @@
104 * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04 104 * (see struct iwl_tfd_frame). These 16 pointer registers are offset by 0x04
105 * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte 105 * bytes from one another. Each TFD circular buffer in DRAM must be 256-byte
106 * aligned (address bits 0-7 must be 0). 106 * 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.
107 * 109 *
108 * Bit fields in each pointer register: 110 * Bit fields in each pointer register:
109 * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned 111 * 27-0: TFD CB physical base address [35:8], must be 256-byte aligned
110 */ 112 */
111#define FH_MEM_CBBC_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0) 113#define FH_MEM_CBBC_0_15_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0x9D0)
112#define FH_MEM_CBBC_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10) 114#define FH_MEM_CBBC_0_15_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xA10)
113 115#define FH_MEM_CBBC_16_19_LOWER_BOUND (FH_MEM_LOWER_BOUND + 0xBF0)
114/* Find TFD CB base pointer for given queue (range 0-15). */ 116#define FH_MEM_CBBC_16_19_UPPER_BOUND (FH_MEM_LOWER_BOUND + 0xC00)
115#define FH_MEM_CBBC_QUEUE(x) (FH_MEM_CBBC_LOWER_BOUND + (x) * 0x4) 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 */
121static 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}
116 130
117 131
118/** 132/**
diff --git a/drivers/net/wireless/iwlwifi/iwl-mac80211.c b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
index b6805f8e9a01..c24a7134a6f9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ b/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -1244,6 +1244,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1244 struct iwl_rxon_context *tmp, *ctx = NULL; 1244 struct iwl_rxon_context *tmp, *ctx = NULL;
1245 int err; 1245 int err;
1246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif); 1246 enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
1247 bool reset = false;
1247 1248
1248 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n", 1249 IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
1249 viftype, vif->addr); 1250 viftype, vif->addr);
@@ -1265,6 +1266,13 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1265 tmp->interface_modes | tmp->exclusive_interface_modes; 1266 tmp->interface_modes | tmp->exclusive_interface_modes;
1266 1267
1267 if (tmp->vif) { 1268 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
1268 /* check if this busy context is exclusive */ 1276 /* check if this busy context is exclusive */
1269 if (tmp->exclusive_interface_modes & 1277 if (tmp->exclusive_interface_modes &
1270 BIT(tmp->vif->type)) { 1278 BIT(tmp->vif->type)) {
@@ -1291,7 +1299,7 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
1291 ctx->vif = vif; 1299 ctx->vif = vif;
1292 1300
1293 err = iwl_setup_interface(priv, ctx); 1301 err = iwl_setup_interface(priv, ctx);
1294 if (!err) 1302 if (!err || reset)
1295 goto out; 1303 goto out;
1296 1304
1297 ctx->vif = NULL; 1305 ctx->vif = NULL;
diff --git a/drivers/net/wireless/iwlwifi/iwl-prph.h b/drivers/net/wireless/iwlwifi/iwl-prph.h
index 75dc20bd965b..3b1069290fa9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-prph.h
+++ b/drivers/net/wireless/iwlwifi/iwl-prph.h
@@ -223,12 +223,33 @@
223#define SCD_AIT (SCD_BASE + 0x0c) 223#define SCD_AIT (SCD_BASE + 0x0c)
224#define SCD_TXFACT (SCD_BASE + 0x10) 224#define SCD_TXFACT (SCD_BASE + 0x10)
225#define SCD_ACTIVE (SCD_BASE + 0x14) 225#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)
228#define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8) 226#define SCD_QUEUECHAIN_SEL (SCD_BASE + 0xe8)
229#define SCD_AGGR_SEL (SCD_BASE + 0x248) 227#define SCD_AGGR_SEL (SCD_BASE + 0x248)
230#define SCD_INTERRUPT_MASK (SCD_BASE + 0x108) 228#define SCD_INTERRUPT_MASK (SCD_BASE + 0x108)
231#define SCD_QUEUE_STATUS_BITS(x) (SCD_BASE + 0x10c + (x) * 4) 229
230static 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
238static 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
246static 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}
232 253
233/*********************** END TX SCHEDULER *************************************/ 254/*********************** END TX SCHEDULER *************************************/
234 255
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 288b035a3579..cc15fdb36060 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1941,6 +1941,7 @@ void rtl_pci_disconnect(struct pci_dev *pdev)
1941 rtl_deinit_deferred_work(hw); 1941 rtl_deinit_deferred_work(hw);
1942 rtlpriv->intf_ops->adapter_stop(hw); 1942 rtlpriv->intf_ops->adapter_stop(hw);
1943 } 1943 }
1944 rtlpriv->cfg->ops->disable_interrupt(hw);
1944 1945
1945 /*deinit rfkill */ 1946 /*deinit rfkill */
1946 rtl_deinit_rfkill(hw); 1947 rtl_deinit_rfkill(hw);
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 41302c7b1ad0..d1afb8e3b2ef 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -479,6 +479,7 @@ static void wl1251_op_stop(struct ieee80211_hw *hw)
479 cancel_work_sync(&wl->irq_work); 479 cancel_work_sync(&wl->irq_work);
480 cancel_work_sync(&wl->tx_work); 480 cancel_work_sync(&wl->tx_work);
481 cancel_work_sync(&wl->filter_work); 481 cancel_work_sync(&wl->filter_work);
482 cancel_delayed_work_sync(&wl->elp_work);
482 483
483 mutex_lock(&wl->mutex); 484 mutex_lock(&wl->mutex);
484 485
diff --git a/drivers/net/wireless/wl1251/sdio.c b/drivers/net/wireless/wl1251/sdio.c
index f78694295c39..1b851f650e07 100644
--- a/drivers/net/wireless/wl1251/sdio.c
+++ b/drivers/net/wireless/wl1251/sdio.c
@@ -315,8 +315,8 @@ static void __devexit wl1251_sdio_remove(struct sdio_func *func)
315 315
316 if (wl->irq) 316 if (wl->irq)
317 free_irq(wl->irq, wl); 317 free_irq(wl->irq, wl);
318 kfree(wl_sdio);
319 wl1251_free_hw(wl); 318 wl1251_free_hw(wl);
319 kfree(wl_sdio);
320 320
321 sdio_claim_host(func); 321 sdio_claim_host(func);
322 sdio_release_irq(func); 322 sdio_release_irq(func);
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 120955c66410..8334dadc681d 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1672,7 +1672,8 @@ static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
1672{ 1672{
1673 QETH_DBF_TEXT(SETUP, 2, "cfgblkt"); 1673 QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
1674 1674
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)) {
1676 card->info.blkt.time_total = 250; 1677 card->info.blkt.time_total = 250;
1677 card->info.blkt.inter_packet = 5; 1678 card->info.blkt.inter_packet = 5;
1678 card->info.blkt.inter_packet_jumbo = 15; 1679 card->info.blkt.inter_packet_jumbo = 15;
@@ -4540,7 +4541,8 @@ static void qeth_determine_capabilities(struct qeth_card *card)
4540 goto out_offline; 4541 goto out_offline;
4541 } 4542 }
4542 qeth_configure_unitaddr(card, prcd); 4543 qeth_configure_unitaddr(card, prcd);
4543 qeth_configure_blkt_default(card, prcd); 4544 if (ddev_offline)
4545 qeth_configure_blkt_default(card, prcd);
4544 kfree(prcd); 4546 kfree(prcd);
4545 4547
4546 rc = qdio_get_ssqd_desc(ddev, &card->ssqd); 4548 rc = qdio_get_ssqd_desc(ddev, &card->ssqd);
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 0ddd161f3b06..31d2844e6572 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -104,9 +104,18 @@ struct bridge_skb_cb {
104 } daddr; 104 } daddr;
105}; 105};
106 106
107static 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
107#else 115#else
108#define nf_bridge_maybe_copy_header(skb) (0) 116#define nf_bridge_maybe_copy_header(skb) (0)
109#define nf_bridge_pad(skb) (0) 117#define nf_bridge_pad(skb) (0)
118#define br_drop_fake_rtable(skb) do { } while (0)
110#endif /* CONFIG_BRIDGE_NETFILTER */ 119#endif /* CONFIG_BRIDGE_NETFILTER */
111 120
112#endif /* __KERNEL__ */ 121#endif /* __KERNEL__ */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 775292a66fa4..111f26b6e28b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1020,7 +1020,7 @@ static inline void skb_queue_splice(const struct sk_buff_head *list,
1020} 1020}
1021 1021
1022/** 1022/**
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
1024 * @list: the new list to add 1024 * @list: the new list to add
1025 * @head: the place to add it in the first list 1025 * @head: the place to add it in the first list
1026 * 1026 *
@@ -1051,7 +1051,7 @@ static inline void skb_queue_splice_tail(const struct sk_buff_head *list,
1051} 1051}
1052 1052
1053/** 1053/**
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
1055 * @list: the new list to add 1055 * @list: the new list to add
1056 * @head: the place to add it in the first list 1056 * @head: the place to add it in the first list
1057 * 1057 *
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6822d2595aff..db1c5df45224 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -314,6 +314,7 @@ struct hci_conn {
314 314
315 __u8 remote_cap; 315 __u8 remote_cap;
316 __u8 remote_auth; 316 __u8 remote_auth;
317 bool flush_key;
317 318
318 unsigned int sent; 319 unsigned int sent;
319 320
@@ -980,7 +981,7 @@ int mgmt_discoverable(struct hci_dev *hdev, u8 discoverable);
980int mgmt_connectable(struct hci_dev *hdev, u8 connectable); 981int mgmt_connectable(struct hci_dev *hdev, u8 connectable);
981int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status); 982int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status);
982int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, 983int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key,
983 u8 persistent); 984 bool persistent);
984int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type, 985int mgmt_device_connected(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 link_type,
985 u8 addr_type, u32 flags, u8 *name, u8 name_len, 986 u8 addr_type, u32 flags, u8 *name, u8 name_len,
986 u8 *dev_class); 987 u8 *dev_class);
diff --git a/include/net/dst.h b/include/net/dst.h
index ff4da42fcfc6..bed833d9796a 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -59,6 +59,7 @@ struct dst_entry {
59#define DST_NOCACHE 0x0010 59#define DST_NOCACHE 0x0010
60#define DST_NOCOUNT 0x0020 60#define DST_NOCOUNT 0x0020
61#define DST_NOPEER 0x0040 61#define DST_NOPEER 0x0040
62#define DST_FAKE_RTABLE 0x0080
62 63
63 short error; 64 short error;
64 short obsolete; 65 short obsolete;
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 2bdee51ba30d..72522f087375 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -393,7 +393,7 @@ struct ip_vs_protocol {
393 393
394 void (*exit)(struct ip_vs_protocol *pp); 394 void (*exit)(struct ip_vs_protocol *pp);
395 395
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);
397 397
398 void (*exit_netns)(struct net *net, struct ip_vs_proto_data *pd); 398 void (*exit_netns)(struct net *net, struct ip_vs_proto_data *pd);
399 399
@@ -1203,6 +1203,8 @@ ip_vs_lookup_real_service(struct net *net, int af, __u16 protocol,
1203 1203
1204extern int ip_vs_use_count_inc(void); 1204extern int ip_vs_use_count_inc(void);
1205extern void ip_vs_use_count_dec(void); 1205extern void ip_vs_use_count_dec(void);
1206extern int ip_vs_register_nl_ioctl(void);
1207extern void ip_vs_unregister_nl_ioctl(void);
1206extern int ip_vs_control_init(void); 1208extern int ip_vs_control_init(void);
1207extern void ip_vs_control_cleanup(void); 1209extern void ip_vs_control_cleanup(void);
1208extern struct ip_vs_dest * 1210extern struct ip_vs_dest *
diff --git a/include/net/sock.h b/include/net/sock.h
index 188532ee88b6..5a0a58ac4126 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1129,9 +1129,9 @@ sk_sockets_allocated_read_positive(struct sock *sk)
1129 struct proto *prot = sk->sk_prot; 1129 struct proto *prot = sk->sk_prot;
1130 1130
1131 if (mem_cgroup_sockets_enabled && sk->sk_cgrp) 1131 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);
1133 1133
1134 return percpu_counter_sum_positive(prot->sockets_allocated); 1134 return percpu_counter_read_positive(prot->sockets_allocated);
1135} 1135}
1136 1136
1137static inline int 1137static inline int
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 92a857e3786d..edfd61addcec 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -1215,40 +1215,40 @@ struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr)
1215 return NULL; 1215 return NULL;
1216} 1216}
1217 1217
1218static int hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn, 1218static bool hci_persistent_key(struct hci_dev *hdev, struct hci_conn *conn,
1219 u8 key_type, u8 old_key_type) 1219 u8 key_type, u8 old_key_type)
1220{ 1220{
1221 /* Legacy key */ 1221 /* Legacy key */
1222 if (key_type < 0x03) 1222 if (key_type < 0x03)
1223 return 1; 1223 return true;
1224 1224
1225 /* Debug keys are insecure so don't store them persistently */ 1225 /* Debug keys are insecure so don't store them persistently */
1226 if (key_type == HCI_LK_DEBUG_COMBINATION) 1226 if (key_type == HCI_LK_DEBUG_COMBINATION)
1227 return 0; 1227 return false;
1228 1228
1229 /* Changed combination key and there's no previous one */ 1229 /* Changed combination key and there's no previous one */
1230 if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff) 1230 if (key_type == HCI_LK_CHANGED_COMBINATION && old_key_type == 0xff)
1231 return 0; 1231 return false;
1232 1232
1233 /* Security mode 3 case */ 1233 /* Security mode 3 case */
1234 if (!conn) 1234 if (!conn)
1235 return 1; 1235 return true;
1236 1236
1237 /* Neither local nor remote side had no-bonding as requirement */ 1237 /* Neither local nor remote side had no-bonding as requirement */
1238 if (conn->auth_type > 0x01 && conn->remote_auth > 0x01) 1238 if (conn->auth_type > 0x01 && conn->remote_auth > 0x01)
1239 return 1; 1239 return true;
1240 1240
1241 /* Local side had dedicated bonding as requirement */ 1241 /* Local side had dedicated bonding as requirement */
1242 if (conn->auth_type == 0x02 || conn->auth_type == 0x03) 1242 if (conn->auth_type == 0x02 || conn->auth_type == 0x03)
1243 return 1; 1243 return true;
1244 1244
1245 /* Remote side had dedicated bonding as requirement */ 1245 /* Remote side had dedicated bonding as requirement */
1246 if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03) 1246 if (conn->remote_auth == 0x02 || conn->remote_auth == 0x03)
1247 return 1; 1247 return true;
1248 1248
1249 /* If none of the above criteria match, then don't store the key 1249 /* If none of the above criteria match, then don't store the key
1250 * persistently */ 1250 * persistently */
1251 return 0; 1251 return false;
1252} 1252}
1253 1253
1254struct smp_ltk *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]) 1254struct 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,
1285 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len) 1285 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len)
1286{ 1286{
1287 struct link_key *key, *old_key; 1287 struct link_key *key, *old_key;
1288 u8 old_key_type, persistent; 1288 u8 old_key_type;
1289 bool persistent;
1289 1290
1290 old_key = hci_find_link_key(hdev, bdaddr); 1291 old_key = hci_find_link_key(hdev, bdaddr);
1291 if (old_key) { 1292 if (old_key) {
@@ -1328,10 +1329,8 @@ int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
1328 1329
1329 mgmt_new_link_key(hdev, key, persistent); 1330 mgmt_new_link_key(hdev, key, persistent);
1330 1331
1331 if (!persistent) { 1332 if (conn)
1332 list_del(&key->list); 1333 conn->flush_key = !persistent;
1333 kfree(key);
1334 }
1335 1334
1336 return 0; 1335 return 0;
1337} 1336}
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index b37531094c49..6c065254afc0 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -1901,6 +1901,8 @@ static inline void hci_disconn_complete_evt(struct hci_dev *hdev, struct sk_buff
1901 } 1901 }
1902 1902
1903 if (ev->status == 0) { 1903 if (ev->status == 0) {
1904 if (conn->type == ACL_LINK && conn->flush_key)
1905 hci_remove_link_key(hdev, &conn->dst);
1904 hci_proto_disconn_cfm(conn, ev->reason); 1906 hci_proto_disconn_cfm(conn, ev->reason);
1905 hci_conn_del(conn); 1907 hci_conn_del(conn);
1906 } 1908 }
@@ -2311,6 +2313,7 @@ static inline void hci_cmd_complete_evt(struct hci_dev *hdev, struct sk_buff *sk
2311 2313
2312 case HCI_OP_USER_PASSKEY_NEG_REPLY: 2314 case HCI_OP_USER_PASSKEY_NEG_REPLY:
2313 hci_cc_user_passkey_neg_reply(hdev, skb); 2315 hci_cc_user_passkey_neg_reply(hdev, skb);
2316 break;
2314 2317
2315 case HCI_OP_LE_SET_SCAN_PARAM: 2318 case HCI_OP_LE_SET_SCAN_PARAM:
2316 hci_cc_le_set_scan_param(hdev, skb); 2319 hci_cc_le_set_scan_param(hdev, skb);
diff --git a/net/bluetooth/mgmt.c b/net/bluetooth/mgmt.c
index 4ef275c69675..4bb03b111122 100644
--- a/net/bluetooth/mgmt.c
+++ b/net/bluetooth/mgmt.c
@@ -2884,7 +2884,7 @@ int mgmt_write_scan_failed(struct hci_dev *hdev, u8 scan, u8 status)
2884 return 0; 2884 return 0;
2885} 2885}
2886 2886
2887int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, u8 persistent) 2887int mgmt_new_link_key(struct hci_dev *hdev, struct link_key *key, bool persistent)
2888{ 2888{
2889 struct mgmt_ev_new_link_key ev; 2889 struct mgmt_ev_new_link_key ev;
2890 2890
diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c
index 61f65344e711..a2098e3de500 100644
--- a/net/bridge/br_forward.c
+++ b/net/bridge/br_forward.c
@@ -47,6 +47,7 @@ int br_dev_queue_push_xmit(struct sk_buff *skb)
47 kfree_skb(skb); 47 kfree_skb(skb);
48 } else { 48 } else {
49 skb_push(skb, ETH_HLEN); 49 skb_push(skb, ETH_HLEN);
50 br_drop_fake_rtable(skb);
50 dev_queue_xmit(skb); 51 dev_queue_xmit(skb);
51 } 52 }
52 53
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index dec4f3817133..d7f49b63ab0f 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -156,7 +156,7 @@ void br_netfilter_rtable_init(struct net_bridge *br)
156 rt->dst.dev = br->dev; 156 rt->dst.dev = br->dev;
157 rt->dst.path = &rt->dst; 157 rt->dst.path = &rt->dst;
158 dst_init_metrics(&rt->dst, br_dst_default_metrics, true); 158 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;
160 rt->dst.ops = &fake_dst_ops; 160 rt->dst.ops = &fake_dst_ops;
161} 161}
162 162
@@ -694,11 +694,7 @@ static unsigned int br_nf_local_in(unsigned int hook, struct sk_buff *skb,
694 const struct net_device *out, 694 const struct net_device *out,
695 int (*okfn)(struct sk_buff *)) 695 int (*okfn)(struct sk_buff *))
696{ 696{
697 struct rtable *rt = skb_rtable(skb); 697 br_drop_fake_rtable(skb);
698
699 if (rt && rt == bridge_parent_rtable(in))
700 skb_dst_drop(skb);
701
702 return NF_ACCEPT; 698 return NF_ACCEPT;
703} 699}
704 700
diff --git a/net/core/drop_monitor.c b/net/core/drop_monitor.c
index 5c3c81a609e5..a7cad741df01 100644
--- a/net/core/drop_monitor.c
+++ b/net/core/drop_monitor.c
@@ -42,13 +42,14 @@ static void send_dm_alert(struct work_struct *unused);
42 * netlink alerts 42 * netlink alerts
43 */ 43 */
44static int trace_state = TRACE_OFF; 44static int trace_state = TRACE_OFF;
45static DEFINE_SPINLOCK(trace_state_lock); 45static DEFINE_MUTEX(trace_state_mutex);
46 46
47struct per_cpu_dm_data { 47struct per_cpu_dm_data {
48 struct work_struct dm_alert_work; 48 struct work_struct dm_alert_work;
49 struct sk_buff *skb; 49 struct sk_buff __rcu *skb;
50 atomic_t dm_hit_count; 50 atomic_t dm_hit_count;
51 struct timer_list send_timer; 51 struct timer_list send_timer;
52 int cpu;
52}; 53};
53 54
54struct dm_hw_stat_delta { 55struct dm_hw_stat_delta {
@@ -79,29 +80,53 @@ static void reset_per_cpu_data(struct per_cpu_dm_data *data)
79 size_t al; 80 size_t al;
80 struct net_dm_alert_msg *msg; 81 struct net_dm_alert_msg *msg;
81 struct nlattr *nla; 82 struct nlattr *nla;
83 struct sk_buff *skb;
84 struct sk_buff *oskb = rcu_dereference_protected(data->skb, 1);
82 85
83 al = sizeof(struct net_dm_alert_msg); 86 al = sizeof(struct net_dm_alert_msg);
84 al += dm_hit_limit * sizeof(struct net_dm_drop_point); 87 al += dm_hit_limit * sizeof(struct net_dm_drop_point);
85 al += sizeof(struct nlattr); 88 al += sizeof(struct nlattr);
86 89
87 data->skb = genlmsg_new(al, GFP_KERNEL); 90 skb = genlmsg_new(al, GFP_KERNEL);
88 genlmsg_put(data->skb, 0, 0, &net_drop_monitor_family, 91
89 0, NET_DM_CMD_ALERT); 92 if (skb) {
90 nla = nla_reserve(data->skb, NLA_UNSPEC, sizeof(struct net_dm_alert_msg)); 93 genlmsg_put(skb, 0, 0, &net_drop_monitor_family,
91 msg = nla_data(nla); 94 0, NET_DM_CMD_ALERT);
92 memset(msg, 0, al); 95 nla = nla_reserve(skb, NLA_UNSPEC,
93 atomic_set(&data->dm_hit_count, dm_hit_limit); 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
94} 117}
95 118
96static void send_dm_alert(struct work_struct *unused) 119static void send_dm_alert(struct work_struct *unused)
97{ 120{
98 struct sk_buff *skb; 121 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());
100 125
101 /* 126 /*
102 * Grab the skb we're about to send 127 * Grab the skb we're about to send
103 */ 128 */
104 skb = data->skb; 129 skb = rcu_dereference_protected(data->skb, 1);
105 130
106 /* 131 /*
107 * Replace it with a new one 132 * Replace it with a new one
@@ -111,8 +136,10 @@ static void send_dm_alert(struct work_struct *unused)
111 /* 136 /*
112 * Ship it! 137 * Ship it!
113 */ 138 */
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);
115 141
142 put_cpu_var(dm_cpu_data);
116} 143}
117 144
118/* 145/*
@@ -123,9 +150,11 @@ static void send_dm_alert(struct work_struct *unused)
123 */ 150 */
124static void sched_send_work(unsigned long unused) 151static void sched_send_work(unsigned long unused)
125{ 152{
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);
127 156
128 schedule_work(&data->dm_alert_work); 157 put_cpu_var(dm_cpu_data);
129} 158}
130 159
131static void trace_drop_common(struct sk_buff *skb, void *location) 160static 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)
134 struct nlmsghdr *nlh; 163 struct nlmsghdr *nlh;
135 struct nlattr *nla; 164 struct nlattr *nla;
136 int i; 165 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);
138 172
173 if (!dskb)
174 goto out;
139 175
140 if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) { 176 if (!atomic_add_unless(&data->dm_hit_count, -1, 0)) {
141 /* 177 /*
@@ -144,7 +180,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
144 goto out; 180 goto out;
145 } 181 }
146 182
147 nlh = (struct nlmsghdr *)data->skb->data; 183 nlh = (struct nlmsghdr *)dskb->data;
148 nla = genlmsg_data(nlmsg_data(nlh)); 184 nla = genlmsg_data(nlmsg_data(nlh));
149 msg = nla_data(nla); 185 msg = nla_data(nla);
150 for (i = 0; i < msg->entries; i++) { 186 for (i = 0; i < msg->entries; i++) {
@@ -158,7 +194,7 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
158 /* 194 /*
159 * We need to create a new entry 195 * We need to create a new entry
160 */ 196 */
161 __nla_reserve_nohdr(data->skb, sizeof(struct net_dm_drop_point)); 197 __nla_reserve_nohdr(dskb, sizeof(struct net_dm_drop_point));
162 nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point)); 198 nla->nla_len += NLA_ALIGN(sizeof(struct net_dm_drop_point));
163 memcpy(msg->points[msg->entries].pc, &location, sizeof(void *)); 199 memcpy(msg->points[msg->entries].pc, &location, sizeof(void *));
164 msg->points[msg->entries].count = 1; 200 msg->points[msg->entries].count = 1;
@@ -170,6 +206,8 @@ static void trace_drop_common(struct sk_buff *skb, void *location)
170 } 206 }
171 207
172out: 208out:
209 rcu_read_unlock();
210 put_cpu_var(dm_cpu_data);
173 return; 211 return;
174} 212}
175 213
@@ -214,7 +252,7 @@ static int set_all_monitor_traces(int state)
214 struct dm_hw_stat_delta *new_stat = NULL; 252 struct dm_hw_stat_delta *new_stat = NULL;
215 struct dm_hw_stat_delta *temp; 253 struct dm_hw_stat_delta *temp;
216 254
217 spin_lock(&trace_state_lock); 255 mutex_lock(&trace_state_mutex);
218 256
219 if (state == trace_state) { 257 if (state == trace_state) {
220 rc = -EAGAIN; 258 rc = -EAGAIN;
@@ -253,7 +291,7 @@ static int set_all_monitor_traces(int state)
253 rc = -EINPROGRESS; 291 rc = -EINPROGRESS;
254 292
255out_unlock: 293out_unlock:
256 spin_unlock(&trace_state_lock); 294 mutex_unlock(&trace_state_mutex);
257 295
258 return rc; 296 return rc;
259} 297}
@@ -296,12 +334,12 @@ static int dropmon_net_event(struct notifier_block *ev_block,
296 334
297 new_stat->dev = dev; 335 new_stat->dev = dev;
298 new_stat->last_rx = jiffies; 336 new_stat->last_rx = jiffies;
299 spin_lock(&trace_state_lock); 337 mutex_lock(&trace_state_mutex);
300 list_add_rcu(&new_stat->list, &hw_stats_list); 338 list_add_rcu(&new_stat->list, &hw_stats_list);
301 spin_unlock(&trace_state_lock); 339 mutex_unlock(&trace_state_mutex);
302 break; 340 break;
303 case NETDEV_UNREGISTER: 341 case NETDEV_UNREGISTER:
304 spin_lock(&trace_state_lock); 342 mutex_lock(&trace_state_mutex);
305 list_for_each_entry_safe(new_stat, tmp, &hw_stats_list, list) { 343 list_for_each_entry_safe(new_stat, tmp, &hw_stats_list, list) {
306 if (new_stat->dev == dev) { 344 if (new_stat->dev == dev) {
307 new_stat->dev = NULL; 345 new_stat->dev = NULL;
@@ -312,7 +350,7 @@ static int dropmon_net_event(struct notifier_block *ev_block,
312 } 350 }
313 } 351 }
314 } 352 }
315 spin_unlock(&trace_state_lock); 353 mutex_unlock(&trace_state_mutex);
316 break; 354 break;
317 } 355 }
318out: 356out:
@@ -368,13 +406,15 @@ static int __init init_net_drop_monitor(void)
368 406
369 for_each_present_cpu(cpu) { 407 for_each_present_cpu(cpu) {
370 data = &per_cpu(dm_cpu_data, cpu); 408 data = &per_cpu(dm_cpu_data, cpu);
371 reset_per_cpu_data(data); 409 data->cpu = cpu;
372 INIT_WORK(&data->dm_alert_work, send_dm_alert); 410 INIT_WORK(&data->dm_alert_work, send_dm_alert);
373 init_timer(&data->send_timer); 411 init_timer(&data->send_timer);
374 data->send_timer.data = cpu; 412 data->send_timer.data = cpu;
375 data->send_timer.function = sched_send_work; 413 data->send_timer.function = sched_send_work;
414 reset_per_cpu_data(data);
376 } 415 }
377 416
417
378 goto out; 418 goto out;
379 419
380out_unreg: 420out_unreg:
diff --git a/net/ieee802154/6lowpan.c b/net/ieee802154/6lowpan.c
index 368515885368..840821b90bcd 100644
--- a/net/ieee802154/6lowpan.c
+++ b/net/ieee802154/6lowpan.c
@@ -1044,6 +1044,24 @@ static void lowpan_dev_free(struct net_device *dev)
1044 free_netdev(dev); 1044 free_netdev(dev);
1045} 1045}
1046 1046
1047static 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
1053static 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
1059static 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
1047static struct header_ops lowpan_header_ops = { 1065static struct header_ops lowpan_header_ops = {
1048 .create = lowpan_header_create, 1066 .create = lowpan_header_create,
1049}; 1067};
@@ -1053,6 +1071,12 @@ static const struct net_device_ops lowpan_netdev_ops = {
1053 .ndo_set_mac_address = eth_mac_addr, 1071 .ndo_set_mac_address = eth_mac_addr,
1054}; 1072};
1055 1073
1074static 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
1056static void lowpan_setup(struct net_device *dev) 1080static void lowpan_setup(struct net_device *dev)
1057{ 1081{
1058 pr_debug("(%s)\n", __func__); 1082 pr_debug("(%s)\n", __func__);
@@ -1070,6 +1094,7 @@ static void lowpan_setup(struct net_device *dev)
1070 1094
1071 dev->netdev_ops = &lowpan_netdev_ops; 1095 dev->netdev_ops = &lowpan_netdev_ops;
1072 dev->header_ops = &lowpan_header_ops; 1096 dev->header_ops = &lowpan_header_ops;
1097 dev->ml_priv = &lowpan_mlme;
1073 dev->destructor = lowpan_dev_free; 1098 dev->destructor = lowpan_dev_free;
1074} 1099}
1075 1100
@@ -1143,6 +1168,8 @@ static int lowpan_newlink(struct net *src_net, struct net_device *dev,
1143 list_add_tail(&entry->list, &lowpan_devices); 1168 list_add_tail(&entry->list, &lowpan_devices);
1144 mutex_unlock(&lowpan_dev_info(dev)->dev_list_mtx); 1169 mutex_unlock(&lowpan_dev_info(dev)->dev_list_mtx);
1145 1170
1171 spin_lock_init(&flist_lock);
1172
1146 register_netdevice(dev); 1173 register_netdevice(dev);
1147 1174
1148 return 0; 1175 return 0;
@@ -1152,11 +1179,20 @@ static void lowpan_dellink(struct net_device *dev, struct list_head *head)
1152{ 1179{
1153 struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev); 1180 struct lowpan_dev_info *lowpan_dev = lowpan_dev_info(dev);
1154 struct net_device *real_dev = lowpan_dev->real_dev; 1181 struct net_device *real_dev = lowpan_dev->real_dev;
1155 struct lowpan_dev_record *entry; 1182 struct lowpan_dev_record *entry, *tmp;
1156 struct lowpan_dev_record *tmp; 1183 struct lowpan_fragment *frame, *tframe;
1157 1184
1158 ASSERT_RTNL(); 1185 ASSERT_RTNL();
1159 1186
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
1160 mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx); 1196 mutex_lock(&lowpan_dev_info(dev)->dev_list_mtx);
1161 list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) { 1197 list_for_each_entry_safe(entry, tmp, &lowpan_devices, list) {
1162 if (entry->ldev == dev) { 1198 if (entry->ldev == dev) {
diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
index 8d25a1c557eb..8f8db724bfaf 100644
--- a/net/ipv4/inet_diag.c
+++ b/net/ipv4/inet_diag.c
@@ -141,7 +141,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
141 goto rtattr_failure; 141 goto rtattr_failure;
142 142
143 if (icsk == NULL) { 143 if (icsk == NULL) {
144 r->idiag_rqueue = r->idiag_wqueue = 0; 144 handler->idiag_get_info(sk, r, NULL);
145 goto out; 145 goto out;
146 } 146 }
147 147
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 8bb6adeb62c0..1272a88c2a63 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3243,7 +3243,7 @@ void __init tcp_init(void)
3243{ 3243{
3244 struct sk_buff *skb = NULL; 3244 struct sk_buff *skb = NULL;
3245 unsigned long limit; 3245 unsigned long limit;
3246 int max_share, cnt; 3246 int max_rshare, max_wshare, cnt;
3247 unsigned int i; 3247 unsigned int i;
3248 unsigned long jiffy = jiffies; 3248 unsigned long jiffy = jiffies;
3249 3249
@@ -3303,15 +3303,16 @@ void __init tcp_init(void)
3303 tcp_init_mem(&init_net); 3303 tcp_init_mem(&init_net);
3304 /* Set per-socket limits to no more than 1/128 the pressure threshold */ 3304 /* Set per-socket limits to no more than 1/128 the pressure threshold */
3305 limit = nr_free_buffer_pages() << (PAGE_SHIFT - 7); 3305 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);
3307 3308
3308 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM; 3309 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
3309 sysctl_tcp_wmem[1] = 16*1024; 3310 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);
3311 3312
3312 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM; 3313 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM;
3313 sysctl_tcp_rmem[1] = 87380; 3314 sysctl_tcp_rmem[1] = 87380;
3314 sysctl_tcp_rmem[2] = max(87380, max_share); 3315 sysctl_tcp_rmem[2] = max(87380, max_rshare);
3315 3316
3316 pr_info("Hash tables configured (established %u bind %u)\n", 3317 pr_info("Hash tables configured (established %u bind %u)\n",
3317 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size); 3318 tcp_hashinfo.ehash_mask + 1, tcp_hashinfo.bhash_size);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 3ff364065376..257b61789eeb 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -85,7 +85,7 @@ int sysctl_tcp_ecn __read_mostly = 2;
85EXPORT_SYMBOL(sysctl_tcp_ecn); 85EXPORT_SYMBOL(sysctl_tcp_ecn);
86int sysctl_tcp_dsack __read_mostly = 1; 86int sysctl_tcp_dsack __read_mostly = 1;
87int sysctl_tcp_app_win __read_mostly = 31; 87int sysctl_tcp_app_win __read_mostly = 31;
88int sysctl_tcp_adv_win_scale __read_mostly = 2; 88int sysctl_tcp_adv_win_scale __read_mostly = 1;
89EXPORT_SYMBOL(sysctl_tcp_adv_win_scale); 89EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);
90 90
91int sysctl_tcp_stdurg __read_mostly; 91int sysctl_tcp_stdurg __read_mostly;
@@ -495,7 +495,7 @@ static inline void tcp_rcv_rtt_measure(struct tcp_sock *tp)
495 goto new_measure; 495 goto new_measure;
496 if (before(tp->rcv_nxt, tp->rcv_rtt_est.seq)) 496 if (before(tp->rcv_nxt, tp->rcv_rtt_est.seq))
497 return; 497 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);
499 499
500new_measure: 500new_measure:
501 tp->rcv_rtt_est.seq = tp->rcv_nxt + tp->rcv_wnd; 501 tp->rcv_rtt_est.seq = tp->rcv_nxt + tp->rcv_wnd;
@@ -2868,11 +2868,14 @@ static inline void tcp_complete_cwr(struct sock *sk)
2868 2868
2869 /* Do not moderate cwnd if it's already undone in cwr or recovery. */ 2869 /* Do not moderate cwnd if it's already undone in cwr or recovery. */
2870 if (tp->undo_marker) { 2870 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) {
2872 tp->snd_cwnd = min(tp->snd_cwnd, tp->snd_ssthresh); 2872 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. */
2874 tp->snd_cwnd = tp->snd_ssthresh; 2876 tp->snd_cwnd = tp->snd_ssthresh;
2875 tp->snd_cwnd_stamp = tcp_time_stamp; 2877 tp->snd_cwnd_stamp = tcp_time_stamp;
2878 }
2876 } 2879 }
2877 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR); 2880 tcp_ca_event(sk, CA_EVENT_COMPLETE_CWR);
2878} 2881}
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index 8a949f19deb6..a7f86a3cd502 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -146,9 +146,17 @@ static int udp_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *nlh,
146 return udp_dump_one(&udp_table, in_skb, nlh, req); 146 return udp_dump_one(&udp_table, in_skb, nlh, req);
147} 147}
148 148
149static 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
149static const struct inet_diag_handler udp_diag_handler = { 156static const struct inet_diag_handler udp_diag_handler = {
150 .dump = udp_diag_dump, 157 .dump = udp_diag_dump,
151 .dump_one = udp_diag_dump_one, 158 .dump_one = udp_diag_dump_one,
159 .idiag_get_info = udp_diag_get_info,
152 .idiag_type = IPPROTO_UDP, 160 .idiag_type = IPPROTO_UDP,
153}; 161};
154 162
@@ -167,6 +175,7 @@ static int udplite_diag_dump_one(struct sk_buff *in_skb, const struct nlmsghdr *
167static const struct inet_diag_handler udplite_diag_handler = { 175static const struct inet_diag_handler udplite_diag_handler = {
168 .dump = udplite_diag_dump, 176 .dump = udplite_diag_dump,
169 .dump_one = udplite_diag_dump_one, 177 .dump_one = udplite_diag_dump_one,
178 .idiag_get_info = udp_diag_get_info,
170 .idiag_type = IPPROTO_UDPLITE, 179 .idiag_type = IPPROTO_UDPLITE,
171}; 180};
172 181
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
index 585d93ecee2d..6274f0be82b0 100644
--- a/net/l2tp/l2tp_ip.c
+++ b/net/l2tp/l2tp_ip.c
@@ -442,8 +442,9 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
442 442
443 daddr = lip->l2tp_addr.s_addr; 443 daddr = lip->l2tp_addr.s_addr;
444 } else { 444 } else {
445 rc = -EDESTADDRREQ;
445 if (sk->sk_state != TCP_ESTABLISHED) 446 if (sk->sk_state != TCP_ESTABLISHED)
446 return -EDESTADDRREQ; 447 goto out;
447 448
448 daddr = inet->inet_daddr; 449 daddr = inet->inet_daddr;
449 connected = 1; 450 connected = 1;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index d9798a307f20..db8fae51714c 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -1210,7 +1210,7 @@ void ieee80211_sta_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
1210 struct sk_buff *skb); 1210 struct sk_buff *skb);
1211void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata); 1211void ieee80211_sta_reset_beacon_monitor(struct ieee80211_sub_if_data *sdata);
1212void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata); 1212void ieee80211_sta_reset_conn_monitor(struct ieee80211_sub_if_data *sdata);
1213void ieee80211_mgd_teardown(struct ieee80211_sub_if_data *sdata); 1213void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata);
1214 1214
1215/* IBSS code */ 1215/* IBSS code */
1216void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local); 1216void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
index 401c01f0731e..c20051b7ffcd 100644
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
@@ -486,6 +486,8 @@ static void ieee80211_do_stop(struct ieee80211_sub_if_data *sdata,
486 /* free all potentially still buffered bcast frames */ 486 /* free all potentially still buffered bcast frames */
487 local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps_bc_buf); 487 local->total_ps_buffered -= skb_queue_len(&sdata->u.ap.ps_bc_buf);
488 skb_queue_purge(&sdata->u.ap.ps_bc_buf); 488 skb_queue_purge(&sdata->u.ap.ps_bc_buf);
489 } else if (sdata->vif.type == NL80211_IFTYPE_STATION) {
490 ieee80211_mgd_stop(sdata);
489 } 491 }
490 492
491 if (going_down) 493 if (going_down)
@@ -644,8 +646,6 @@ static void ieee80211_teardown_sdata(struct net_device *dev)
644 646
645 if (ieee80211_vif_is_mesh(&sdata->vif)) 647 if (ieee80211_vif_is_mesh(&sdata->vif))
646 mesh_rmc_free(sdata); 648 mesh_rmc_free(sdata);
647 else if (sdata->vif.type == NL80211_IFTYPE_STATION)
648 ieee80211_mgd_teardown(sdata);
649 649
650 flushed = sta_info_flush(local, sdata); 650 flushed = sta_info_flush(local, sdata);
651 WARN_ON(flushed); 651 WARN_ON(flushed);
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index f76da5b3f5c5..20c680bfc3ae 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3497,7 +3497,7 @@ int ieee80211_mgd_disassoc(struct ieee80211_sub_if_data *sdata,
3497 return 0; 3497 return 0;
3498} 3498}
3499 3499
3500void ieee80211_mgd_teardown(struct ieee80211_sub_if_data *sdata) 3500void ieee80211_mgd_stop(struct ieee80211_sub_if_data *sdata)
3501{ 3501{
3502 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; 3502 struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
3503 3503
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 782a60198df4..e76facc69e95 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1158,7 +1158,8 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
1158 tx->sta = rcu_dereference(sdata->u.vlan.sta); 1158 tx->sta = rcu_dereference(sdata->u.vlan.sta);
1159 if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr) 1159 if (!tx->sta && sdata->dev->ieee80211_ptr->use_4addr)
1160 return TX_DROP; 1160 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) {
1162 tx->sta = sta_info_get_bss(sdata, hdr->addr1); 1163 tx->sta = sta_info_get_bss(sdata, hdr->addr1);
1163 } 1164 }
1164 if (!tx->sta) 1165 if (!tx->sta)
diff --git a/net/netfilter/ipvs/ip_vs_core.c b/net/netfilter/ipvs/ip_vs_core.c
index 2555816e7788..00bdb1d9d690 100644
--- a/net/netfilter/ipvs/ip_vs_core.c
+++ b/net/netfilter/ipvs/ip_vs_core.c
@@ -1924,6 +1924,7 @@ protocol_fail:
1924control_fail: 1924control_fail:
1925 ip_vs_estimator_net_cleanup(net); 1925 ip_vs_estimator_net_cleanup(net);
1926estimator_fail: 1926estimator_fail:
1927 net->ipvs = NULL;
1927 return -ENOMEM; 1928 return -ENOMEM;
1928} 1929}
1929 1930
@@ -1936,6 +1937,7 @@ static void __net_exit __ip_vs_cleanup(struct net *net)
1936 ip_vs_control_net_cleanup(net); 1937 ip_vs_control_net_cleanup(net);
1937 ip_vs_estimator_net_cleanup(net); 1938 ip_vs_estimator_net_cleanup(net);
1938 IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen); 1939 IP_VS_DBG(2, "ipvs netns %d released\n", net_ipvs(net)->gen);
1940 net->ipvs = NULL;
1939} 1941}
1940 1942
1941static void __net_exit __ip_vs_dev_cleanup(struct net *net) 1943static void __net_exit __ip_vs_dev_cleanup(struct net *net)
@@ -1993,10 +1995,18 @@ static int __init ip_vs_init(void)
1993 goto cleanup_dev; 1995 goto cleanup_dev;
1994 } 1996 }
1995 1997
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
1996 pr_info("ipvs loaded.\n"); 2004 pr_info("ipvs loaded.\n");
1997 2005
1998 return ret; 2006 return ret;
1999 2007
2008cleanup_hooks:
2009 nf_unregister_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
2000cleanup_dev: 2010cleanup_dev:
2001 unregister_pernet_device(&ipvs_core_dev_ops); 2011 unregister_pernet_device(&ipvs_core_dev_ops);
2002cleanup_sub: 2012cleanup_sub:
@@ -2012,6 +2022,7 @@ exit:
2012 2022
2013static void __exit ip_vs_cleanup(void) 2023static void __exit ip_vs_cleanup(void)
2014{ 2024{
2025 ip_vs_unregister_nl_ioctl();
2015 nf_unregister_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops)); 2026 nf_unregister_hooks(ip_vs_ops, ARRAY_SIZE(ip_vs_ops));
2016 unregister_pernet_device(&ipvs_core_dev_ops); 2027 unregister_pernet_device(&ipvs_core_dev_ops);
2017 unregister_pernet_subsys(&ipvs_core_ops); /* free ip_vs struct */ 2028 unregister_pernet_subsys(&ipvs_core_ops); /* free ip_vs struct */
diff --git a/net/netfilter/ipvs/ip_vs_ctl.c b/net/netfilter/ipvs/ip_vs_ctl.c
index b3afe189af61..f5589987fc80 100644
--- a/net/netfilter/ipvs/ip_vs_ctl.c
+++ b/net/netfilter/ipvs/ip_vs_ctl.c
@@ -3680,7 +3680,7 @@ int __net_init ip_vs_control_net_init_sysctl(struct net *net)
3680 return 0; 3680 return 0;
3681} 3681}
3682 3682
3683void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net) 3683void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net)
3684{ 3684{
3685 struct netns_ipvs *ipvs = net_ipvs(net); 3685 struct netns_ipvs *ipvs = net_ipvs(net);
3686 3686
@@ -3692,7 +3692,7 @@ void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net)
3692#else 3692#else
3693 3693
3694int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; } 3694int __net_init ip_vs_control_net_init_sysctl(struct net *net) { return 0; }
3695void __net_init ip_vs_control_net_cleanup_sysctl(struct net *net) { } 3695void __net_exit ip_vs_control_net_cleanup_sysctl(struct net *net) { }
3696 3696
3697#endif 3697#endif
3698 3698
@@ -3750,21 +3750,10 @@ void __net_exit ip_vs_control_net_cleanup(struct net *net)
3750 free_percpu(ipvs->tot_stats.cpustats); 3750 free_percpu(ipvs->tot_stats.cpustats);
3751} 3751}
3752 3752
3753int __init ip_vs_control_init(void) 3753int __init ip_vs_register_nl_ioctl(void)
3754{ 3754{
3755 int idx;
3756 int ret; 3755 int ret;
3757 3756
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
3768 ret = nf_register_sockopt(&ip_vs_sockopts); 3757 ret = nf_register_sockopt(&ip_vs_sockopts);
3769 if (ret) { 3758 if (ret) {
3770 pr_err("cannot register sockopt.\n"); 3759 pr_err("cannot register sockopt.\n");
@@ -3776,28 +3765,47 @@ int __init ip_vs_control_init(void)
3776 pr_err("cannot register Generic Netlink interface.\n"); 3765 pr_err("cannot register Generic Netlink interface.\n");
3777 goto err_genl; 3766 goto err_genl;
3778 } 3767 }
3779
3780 ret = register_netdevice_notifier(&ip_vs_dst_notifier);
3781 if (ret < 0)
3782 goto err_notf;
3783
3784 LeaveFunction(2);
3785 return 0; 3768 return 0;
3786 3769
3787err_notf:
3788 ip_vs_genl_unregister();
3789err_genl: 3770err_genl:
3790 nf_unregister_sockopt(&ip_vs_sockopts); 3771 nf_unregister_sockopt(&ip_vs_sockopts);
3791err_sock: 3772err_sock:
3792 return ret; 3773 return ret;
3793} 3774}
3794 3775
3776void ip_vs_unregister_nl_ioctl(void)
3777{
3778 ip_vs_genl_unregister();
3779 nf_unregister_sockopt(&ip_vs_sockopts);
3780}
3781
3782int __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
3795 3805
3796void ip_vs_control_cleanup(void) 3806void ip_vs_control_cleanup(void)
3797{ 3807{
3798 EnterFunction(2); 3808 EnterFunction(2);
3799 unregister_netdevice_notifier(&ip_vs_dst_notifier); 3809 unregister_netdevice_notifier(&ip_vs_dst_notifier);
3800 ip_vs_genl_unregister();
3801 nf_unregister_sockopt(&ip_vs_sockopts);
3802 LeaveFunction(2); 3810 LeaveFunction(2);
3803} 3811}
diff --git a/net/netfilter/ipvs/ip_vs_ftp.c b/net/netfilter/ipvs/ip_vs_ftp.c
index 538d74ee4f68..e39f693dd3e4 100644
--- a/net/netfilter/ipvs/ip_vs_ftp.c
+++ b/net/netfilter/ipvs/ip_vs_ftp.c
@@ -439,6 +439,8 @@ static int __net_init __ip_vs_ftp_init(struct net *net)
439 struct ip_vs_app *app; 439 struct ip_vs_app *app;
440 struct netns_ipvs *ipvs = net_ipvs(net); 440 struct netns_ipvs *ipvs = net_ipvs(net);
441 441
442 if (!ipvs)
443 return -ENOENT;
442 app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL); 444 app = kmemdup(&ip_vs_ftp, sizeof(struct ip_vs_app), GFP_KERNEL);
443 if (!app) 445 if (!app)
444 return -ENOMEM; 446 return -ENOMEM;
diff --git a/net/netfilter/ipvs/ip_vs_lblc.c b/net/netfilter/ipvs/ip_vs_lblc.c
index 0f16283fd058..caa43704e55e 100644
--- a/net/netfilter/ipvs/ip_vs_lblc.c
+++ b/net/netfilter/ipvs/ip_vs_lblc.c
@@ -551,6 +551,9 @@ static int __net_init __ip_vs_lblc_init(struct net *net)
551{ 551{
552 struct netns_ipvs *ipvs = net_ipvs(net); 552 struct netns_ipvs *ipvs = net_ipvs(net);
553 553
554 if (!ipvs)
555 return -ENOENT;
556
554 if (!net_eq(net, &init_net)) { 557 if (!net_eq(net, &init_net)) {
555 ipvs->lblc_ctl_table = kmemdup(vs_vars_table, 558 ipvs->lblc_ctl_table = kmemdup(vs_vars_table,
556 sizeof(vs_vars_table), 559 sizeof(vs_vars_table),
diff --git a/net/netfilter/ipvs/ip_vs_lblcr.c b/net/netfilter/ipvs/ip_vs_lblcr.c
index eec797f8cce7..548bf37aa29e 100644
--- a/net/netfilter/ipvs/ip_vs_lblcr.c
+++ b/net/netfilter/ipvs/ip_vs_lblcr.c
@@ -745,6 +745,9 @@ static int __net_init __ip_vs_lblcr_init(struct net *net)
745{ 745{
746 struct netns_ipvs *ipvs = net_ipvs(net); 746 struct netns_ipvs *ipvs = net_ipvs(net);
747 747
748 if (!ipvs)
749 return -ENOENT;
750
748 if (!net_eq(net, &init_net)) { 751 if (!net_eq(net, &init_net)) {
749 ipvs->lblcr_ctl_table = kmemdup(vs_vars_table, 752 ipvs->lblcr_ctl_table = kmemdup(vs_vars_table,
750 sizeof(vs_vars_table), 753 sizeof(vs_vars_table),
diff --git a/net/netfilter/ipvs/ip_vs_proto.c b/net/netfilter/ipvs/ip_vs_proto.c
index f843a8833250..ed835e67a07e 100644
--- a/net/netfilter/ipvs/ip_vs_proto.c
+++ b/net/netfilter/ipvs/ip_vs_proto.c
@@ -59,9 +59,6 @@ static int __used __init register_ip_vs_protocol(struct ip_vs_protocol *pp)
59 return 0; 59 return 0;
60} 60}
61 61
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)
65/* 62/*
66 * register an ipvs protocols netns related data 63 * register an ipvs protocols netns related data
67 */ 64 */
@@ -81,12 +78,18 @@ register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
81 ipvs->proto_data_table[hash] = pd; 78 ipvs->proto_data_table[hash] = pd;
82 atomic_set(&pd->appcnt, 0); /* Init app counter */ 79 atomic_set(&pd->appcnt, 0); /* Init app counter */
83 80
84 if (pp->init_netns != NULL) 81 if (pp->init_netns != NULL) {
85 pp->init_netns(net, pd); 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 }
86 90
87 return 0; 91 return 0;
88} 92}
89#endif
90 93
91/* 94/*
92 * unregister an ipvs protocol 95 * unregister an ipvs protocol
@@ -316,22 +319,35 @@ ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp,
316 */ 319 */
317int __net_init ip_vs_protocol_net_init(struct net *net) 320int __net_init ip_vs_protocol_net_init(struct net *net)
318{ 321{
322 int i, ret;
323 static struct ip_vs_protocol *protos[] = {
319#ifdef CONFIG_IP_VS_PROTO_TCP 324#ifdef CONFIG_IP_VS_PROTO_TCP
320 register_ip_vs_proto_netns(net, &ip_vs_protocol_tcp); 325 &ip_vs_protocol_tcp,
321#endif 326#endif
322#ifdef CONFIG_IP_VS_PROTO_UDP 327#ifdef CONFIG_IP_VS_PROTO_UDP
323 register_ip_vs_proto_netns(net, &ip_vs_protocol_udp); 328 &ip_vs_protocol_udp,
324#endif 329#endif
325#ifdef CONFIG_IP_VS_PROTO_SCTP 330#ifdef CONFIG_IP_VS_PROTO_SCTP
326 register_ip_vs_proto_netns(net, &ip_vs_protocol_sctp); 331 &ip_vs_protocol_sctp,
327#endif 332#endif
328#ifdef CONFIG_IP_VS_PROTO_AH 333#ifdef CONFIG_IP_VS_PROTO_AH
329 register_ip_vs_proto_netns(net, &ip_vs_protocol_ah); 334 &ip_vs_protocol_ah,
330#endif 335#endif
331#ifdef CONFIG_IP_VS_PROTO_ESP 336#ifdef CONFIG_IP_VS_PROTO_ESP
332 register_ip_vs_proto_netns(net, &ip_vs_protocol_esp); 337 &ip_vs_protocol_esp,
333#endif 338#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 }
334 return 0; 346 return 0;
347
348cleanup:
349 ip_vs_protocol_net_cleanup(net);
350 return ret;
335} 351}
336 352
337void __net_exit ip_vs_protocol_net_cleanup(struct net *net) 353void __net_exit ip_vs_protocol_net_cleanup(struct net *net)
diff --git a/net/netfilter/ipvs/ip_vs_proto_sctp.c b/net/netfilter/ipvs/ip_vs_proto_sctp.c
index 1fbf7a2816f5..9f3fb751c491 100644
--- a/net/netfilter/ipvs/ip_vs_proto_sctp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_sctp.c
@@ -1090,7 +1090,7 @@ out:
1090 * timeouts is netns related now. 1090 * timeouts is netns related now.
1091 * --------------------------------------------- 1091 * ---------------------------------------------
1092 */ 1092 */
1093static void __ip_vs_sctp_init(struct net *net, struct ip_vs_proto_data *pd) 1093static int __ip_vs_sctp_init(struct net *net, struct ip_vs_proto_data *pd)
1094{ 1094{
1095 struct netns_ipvs *ipvs = net_ipvs(net); 1095 struct netns_ipvs *ipvs = net_ipvs(net);
1096 1096
@@ -1098,6 +1098,9 @@ static void __ip_vs_sctp_init(struct net *net, struct ip_vs_proto_data *pd)
1098 spin_lock_init(&ipvs->sctp_app_lock); 1098 spin_lock_init(&ipvs->sctp_app_lock);
1099 pd->timeout_table = ip_vs_create_timeout_table((int *)sctp_timeouts, 1099 pd->timeout_table = ip_vs_create_timeout_table((int *)sctp_timeouts,
1100 sizeof(sctp_timeouts)); 1100 sizeof(sctp_timeouts));
1101 if (!pd->timeout_table)
1102 return -ENOMEM;
1103 return 0;
1101} 1104}
1102 1105
1103static void __ip_vs_sctp_exit(struct net *net, struct ip_vs_proto_data *pd) 1106static void __ip_vs_sctp_exit(struct net *net, struct ip_vs_proto_data *pd)
diff --git a/net/netfilter/ipvs/ip_vs_proto_tcp.c b/net/netfilter/ipvs/ip_vs_proto_tcp.c
index ef8641f7af83..cd609cc62721 100644
--- a/net/netfilter/ipvs/ip_vs_proto_tcp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_tcp.c
@@ -677,7 +677,7 @@ void ip_vs_tcp_conn_listen(struct net *net, struct ip_vs_conn *cp)
677 * timeouts is netns related now. 677 * timeouts is netns related now.
678 * --------------------------------------------- 678 * ---------------------------------------------
679 */ 679 */
680static void __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd) 680static int __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd)
681{ 681{
682 struct netns_ipvs *ipvs = net_ipvs(net); 682 struct netns_ipvs *ipvs = net_ipvs(net);
683 683
@@ -685,7 +685,10 @@ static void __ip_vs_tcp_init(struct net *net, struct ip_vs_proto_data *pd)
685 spin_lock_init(&ipvs->tcp_app_lock); 685 spin_lock_init(&ipvs->tcp_app_lock);
686 pd->timeout_table = ip_vs_create_timeout_table((int *)tcp_timeouts, 686 pd->timeout_table = ip_vs_create_timeout_table((int *)tcp_timeouts,
687 sizeof(tcp_timeouts)); 687 sizeof(tcp_timeouts));
688 if (!pd->timeout_table)
689 return -ENOMEM;
688 pd->tcp_state_table = tcp_states; 690 pd->tcp_state_table = tcp_states;
691 return 0;
689} 692}
690 693
691static void __ip_vs_tcp_exit(struct net *net, struct ip_vs_proto_data *pd) 694static void __ip_vs_tcp_exit(struct net *net, struct ip_vs_proto_data *pd)
diff --git a/net/netfilter/ipvs/ip_vs_proto_udp.c b/net/netfilter/ipvs/ip_vs_proto_udp.c
index f4b7262896bb..2fedb2dcb3d1 100644
--- a/net/netfilter/ipvs/ip_vs_proto_udp.c
+++ b/net/netfilter/ipvs/ip_vs_proto_udp.c
@@ -467,7 +467,7 @@ udp_state_transition(struct ip_vs_conn *cp, int direction,
467 cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL]; 467 cp->timeout = pd->timeout_table[IP_VS_UDP_S_NORMAL];
468} 468}
469 469
470static void __udp_init(struct net *net, struct ip_vs_proto_data *pd) 470static int __udp_init(struct net *net, struct ip_vs_proto_data *pd)
471{ 471{
472 struct netns_ipvs *ipvs = net_ipvs(net); 472 struct netns_ipvs *ipvs = net_ipvs(net);
473 473
@@ -475,6 +475,9 @@ static void __udp_init(struct net *net, struct ip_vs_proto_data *pd)
475 spin_lock_init(&ipvs->udp_app_lock); 475 spin_lock_init(&ipvs->udp_app_lock);
476 pd->timeout_table = ip_vs_create_timeout_table((int *)udp_timeouts, 476 pd->timeout_table = ip_vs_create_timeout_table((int *)udp_timeouts,
477 sizeof(udp_timeouts)); 477 sizeof(udp_timeouts));
478 if (!pd->timeout_table)
479 return -ENOMEM;
480 return 0;
478} 481}
479 482
480static void __udp_exit(struct net *net, struct ip_vs_proto_data *pd) 483static void __udp_exit(struct net *net, struct ip_vs_proto_data *pd)
diff --git a/net/netfilter/xt_CT.c b/net/netfilter/xt_CT.c
index 59530e93fa58..3746d8b9a478 100644
--- a/net/netfilter/xt_CT.c
+++ b/net/netfilter/xt_CT.c
@@ -227,7 +227,7 @@ static int xt_ct_tg_check_v1(const struct xt_tgchk_param *par)
227 } 227 }
228 228
229#ifdef CONFIG_NF_CONNTRACK_TIMEOUT 229#ifdef CONFIG_NF_CONNTRACK_TIMEOUT
230 if (info->timeout) { 230 if (info->timeout[0]) {
231 typeof(nf_ct_timeout_find_get_hook) timeout_find_get; 231 typeof(nf_ct_timeout_find_get_hook) timeout_find_get;
232 struct nf_conn_timeout *timeout_ext; 232 struct nf_conn_timeout *timeout_ext;
233 233
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 5da548fa7ae9..ebd22966f748 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -408,10 +408,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
408 if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) { 408 if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
409 if (!(skb = skb_unshare(skb, GFP_ATOMIC)) || 409 if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||
410 (skb->ip_summed == CHECKSUM_PARTIAL && 410 (skb->ip_summed == CHECKSUM_PARTIAL &&
411 skb_checksum_help(skb))) { 411 skb_checksum_help(skb)))
412 sch->qstats.drops++; 412 return qdisc_drop(skb, sch);
413 return NET_XMIT_DROP;
414 }
415 413
416 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8); 414 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
417 } 415 }