aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/dccp.h6
-rw-r--r--include/linux/etherdevice.h22
-rw-r--r--include/linux/ethtool.h188
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_macvlan.h9
-rw-r--r--include/linux/if_pppox.h52
-rw-r--r--include/linux/if_vlan.h5
-rw-r--r--include/linux/in.h19
-rw-r--r--include/linux/inetdevice.h14
-rw-r--r--include/linux/mlx4/cmd.h1
-rw-r--r--include/linux/mlx4/device.h7
-rw-r--r--include/linux/netdevice.h48
-rw-r--r--include/linux/nl80211.h170
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/phonet.h2
-rw-r--r--include/linux/phy.h4
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/rds.h115
-rw-r--r--include/linux/rtnetlink.h20
-rw-r--r--include/linux/skbuff.h83
-rw-r--r--include/linux/ssb/ssb_regs.h1
-rw-r--r--include/linux/stmmac.h6
-rw-r--r--include/linux/tc_act/Kbuild1
-rw-r--r--include/linux/tc_act/tc_csum.h32
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h1
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/wl12xx.h (renamed from include/linux/spi/wl12xx.h)10
-rw-r--r--include/net/addrconf.h63
-rw-r--r--include/net/bluetooth/hci_core.h2
-rw-r--r--include/net/bluetooth/l2cap.h2
-rw-r--r--include/net/cfg80211.h240
-rw-r--r--include/net/gre.h18
-rw-r--r--include/net/inet_connection_sock.h1
-rw-r--r--include/net/inet_ecn.h2
-rw-r--r--include/net/ip.h6
-rw-r--r--include/net/ipv6.h35
-rw-r--r--include/net/irda/irlan_common.h1
-rw-r--r--include/net/irda/irlan_event.h2
-rw-r--r--include/net/irda/irlap.h2
-rw-r--r--include/net/irda/irlmp.h2
-rw-r--r--include/net/irda/irttp.h2
-rw-r--r--include/net/mac80211.h109
-rw-r--r--include/net/phonet/pep.h5
-rw-r--r--include/net/phonet/phonet.h5
-rw-r--r--include/net/phonet/pn_dev.h1
-rw-r--r--include/net/raw.h5
-rw-r--r--include/net/sch_generic.h2
-rw-r--r--include/net/sctp/sctp.h60
-rw-r--r--include/net/sctp/sm.h10
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/sctp/tsnmap.h2
-rw-r--r--include/net/sock.h14
-rw-r--r--include/net/tc_act/tc_csum.h15
-rw-r--r--include/net/tcp.h9
-rw-r--r--include/net/tipc/tipc_msg.h10
58 files changed, 1052 insertions, 403 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 626b629429ff..c7fbf298ad68 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -302,6 +302,7 @@ header-y += quota.h
302header-y += radeonfb.h 302header-y += radeonfb.h
303header-y += random.h 303header-y += random.h
304header-y += raw.h 304header-y += raw.h
305header-y += rds.h
305header-y += reboot.h 306header-y += reboot.h
306header-y += reiserfs_fs.h 307header-y += reiserfs_fs.h
307header-y += reiserfs_xattr.h 308header-y += reiserfs_xattr.h
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index f6481daf6e52..a8e4e832cdbb 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -449,7 +449,7 @@ void vcc_insert_socket(struct sock *sk);
449 449
450static inline int atm_guess_pdu2truesize(int size) 450static inline int atm_guess_pdu2truesize(int size)
451{ 451{
452 return (SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info)); 452 return SKB_DATA_ALIGN(size) + sizeof(struct skb_shared_info);
453} 453}
454 454
455 455
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 7434a8353e23..7187bd8a75f6 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -165,8 +165,10 @@ enum {
165 DCCPO_TIMESTAMP_ECHO = 42, 165 DCCPO_TIMESTAMP_ECHO = 42,
166 DCCPO_ELAPSED_TIME = 43, 166 DCCPO_ELAPSED_TIME = 43,
167 DCCPO_MAX = 45, 167 DCCPO_MAX = 45,
168 DCCPO_MIN_CCID_SPECIFIC = 128, 168 DCCPO_MIN_RX_CCID_SPECIFIC = 128, /* from sender to receiver */
169 DCCPO_MAX_CCID_SPECIFIC = 255, 169 DCCPO_MAX_RX_CCID_SPECIFIC = 191,
170 DCCPO_MIN_TX_CCID_SPECIFIC = 192, /* from receiver to sender */
171 DCCPO_MAX_TX_CCID_SPECIFIC = 255,
170}; 172};
171/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */ 173/* maximum size of a single TLV-encoded DCCP option (sans type/len bytes) */
172#define DCCP_SINGLE_OPT_MAXLEN 253 174#define DCCP_SINGLE_OPT_MAXLEN 253
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 2308fbb4523a..f16a01081e15 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -71,7 +71,7 @@ static inline int is_zero_ether_addr(const u8 *addr)
71 */ 71 */
72static inline int is_multicast_ether_addr(const u8 *addr) 72static inline int is_multicast_ether_addr(const u8 *addr)
73{ 73{
74 return (0x01 & addr[0]); 74 return 0x01 & addr[0];
75} 75}
76 76
77/** 77/**
@@ -82,7 +82,7 @@ static inline int is_multicast_ether_addr(const u8 *addr)
82 */ 82 */
83static inline int is_local_ether_addr(const u8 *addr) 83static inline int is_local_ether_addr(const u8 *addr)
84{ 84{
85 return (0x02 & addr[0]); 85 return 0x02 & addr[0];
86} 86}
87 87
88/** 88/**
@@ -237,13 +237,29 @@ static inline bool is_etherdev_addr(const struct net_device *dev,
237 * entry points. 237 * entry points.
238 */ 238 */
239 239
240static inline int compare_ether_header(const void *a, const void *b) 240static inline unsigned long compare_ether_header(const void *a, const void *b)
241{ 241{
242#if defined(CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS) && BITS_PER_LONG == 64
243 unsigned long fold;
244
245 /*
246 * We want to compare 14 bytes:
247 * [a0 ... a13] ^ [b0 ... b13]
248 * Use two long XOR, ORed together, with an overlap of two bytes.
249 * [a0 a1 a2 a3 a4 a5 a6 a7 ] ^ [b0 b1 b2 b3 b4 b5 b6 b7 ] |
250 * [a6 a7 a8 a9 a10 a11 a12 a13] ^ [b6 b7 b8 b9 b10 b11 b12 b13]
251 * This means the [a6 a7] ^ [b6 b7] part is done two times.
252 */
253 fold = *(unsigned long *)a ^ *(unsigned long *)b;
254 fold |= *(unsigned long *)(a + 6) ^ *(unsigned long *)(b + 6);
255 return fold;
256#else
242 u32 *a32 = (u32 *)((u8 *)a + 2); 257 u32 *a32 = (u32 *)((u8 *)a + 2);
243 u32 *b32 = (u32 *)((u8 *)b + 2); 258 u32 *b32 = (u32 *)((u8 *)b + 2);
244 259
245 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) | 260 return (*(u16 *)a ^ *(u16 *)b) | (a32[0] ^ b32[0]) |
246 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]); 261 (a32[1] ^ b32[1]) | (a32[2] ^ b32[2]);
262#endif
247} 263}
248 264
249#endif /* _LINUX_ETHERDEVICE_H */ 265#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 991269e5b152..8a3338ceb438 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -14,6 +14,7 @@
14#define _LINUX_ETHTOOL_H 14#define _LINUX_ETHTOOL_H
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17#include <linux/if_ether.h>
17 18
18/* This should work for both 32 and 64 bit userland. */ 19/* This should work for both 32 and 64 bit userland. */
19struct ethtool_cmd { 20struct ethtool_cmd {
@@ -314,9 +315,20 @@ enum ethtool_flags {
314}; 315};
315 316
316/* The following structures are for supporting RX network flow 317/* The following structures are for supporting RX network flow
317 * classification configuration. Note, all multibyte fields, e.g., 318 * classification and RX n-tuple configuration. Note, all multibyte
318 * ip4src, ip4dst, psrc, pdst, spi, etc. are expected to be in network 319 * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to
319 * byte order. 320 * be in network byte order.
321 */
322
323/**
324 * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc.
325 * @ip4src: Source host
326 * @ip4dst: Destination host
327 * @psrc: Source port
328 * @pdst: Destination port
329 * @tos: Type-of-service
330 *
331 * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow.
320 */ 332 */
321struct ethtool_tcpip4_spec { 333struct ethtool_tcpip4_spec {
322 __be32 ip4src; 334 __be32 ip4src;
@@ -326,6 +338,15 @@ struct ethtool_tcpip4_spec {
326 __u8 tos; 338 __u8 tos;
327}; 339};
328 340
341/**
342 * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4
343 * @ip4src: Source host
344 * @ip4dst: Destination host
345 * @spi: Security parameters index
346 * @tos: Type-of-service
347 *
348 * This can be used to specify an IPsec transport or tunnel over IPv4.
349 */
329struct ethtool_ah_espip4_spec { 350struct ethtool_ah_espip4_spec {
330 __be32 ip4src; 351 __be32 ip4src;
331 __be32 ip4dst; 352 __be32 ip4dst;
@@ -333,21 +354,17 @@ struct ethtool_ah_espip4_spec {
333 __u8 tos; 354 __u8 tos;
334}; 355};
335 356
336struct ethtool_rawip4_spec {
337 __be32 ip4src;
338 __be32 ip4dst;
339 __u8 hdata[64];
340};
341
342struct ethtool_ether_spec {
343 __be16 ether_type;
344 __u8 frame_size;
345 __u8 eframe[16];
346};
347
348#define ETH_RX_NFC_IP4 1 357#define ETH_RX_NFC_IP4 1
349#define ETH_RX_NFC_IP6 2
350 358
359/**
360 * struct ethtool_usrip4_spec - general flow specification for IPv4
361 * @ip4src: Source host
362 * @ip4dst: Destination host
363 * @l4_4_bytes: First 4 bytes of transport (layer 4) header
364 * @tos: Type-of-service
365 * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0
366 * @proto: Transport protocol number; mask must be 0
367 */
351struct ethtool_usrip4_spec { 368struct ethtool_usrip4_spec {
352 __be32 ip4src; 369 __be32 ip4src;
353 __be32 ip4dst; 370 __be32 ip4dst;
@@ -357,6 +374,15 @@ struct ethtool_usrip4_spec {
357 __u8 proto; 374 __u8 proto;
358}; 375};
359 376
377/**
378 * struct ethtool_rx_flow_spec - specification for RX flow filter
379 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
380 * @h_u: Flow fields to match (dependent on @flow_type)
381 * @m_u: Masks for flow field bits to be ignored
382 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
383 * if packets should be discarded
384 * @location: Index of filter in hardware table
385 */
360struct ethtool_rx_flow_spec { 386struct ethtool_rx_flow_spec {
361 __u32 flow_type; 387 __u32 flow_type;
362 union { 388 union {
@@ -365,36 +391,91 @@ struct ethtool_rx_flow_spec {
365 struct ethtool_tcpip4_spec sctp_ip4_spec; 391 struct ethtool_tcpip4_spec sctp_ip4_spec;
366 struct ethtool_ah_espip4_spec ah_ip4_spec; 392 struct ethtool_ah_espip4_spec ah_ip4_spec;
367 struct ethtool_ah_espip4_spec esp_ip4_spec; 393 struct ethtool_ah_espip4_spec esp_ip4_spec;
368 struct ethtool_rawip4_spec raw_ip4_spec;
369 struct ethtool_ether_spec ether_spec;
370 struct ethtool_usrip4_spec usr_ip4_spec; 394 struct ethtool_usrip4_spec usr_ip4_spec;
371 __u8 hdata[64]; 395 struct ethhdr ether_spec;
372 } h_u, m_u; /* entry, mask */ 396 __u8 hdata[72];
397 } h_u, m_u;
373 __u64 ring_cookie; 398 __u64 ring_cookie;
374 __u32 location; 399 __u32 location;
375}; 400};
376 401
402/**
403 * struct ethtool_rxnfc - command to get or set RX flow classification rules
404 * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH,
405 * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE,
406 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
407 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
408 * @data: Command-dependent value
409 * @fs: Flow filter specification
410 * @rule_cnt: Number of rules to be affected
411 * @rule_locs: Array of valid rule indices
412 *
413 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
414 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
415 * structure fields must not be used.
416 *
417 * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues
418 * on return.
419 *
420 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
421 * rules on return.
422 *
423 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an
424 * existing filter rule on entry and @fs contains the rule on return.
425 *
426 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
427 * user buffer for @rule_locs on entry. On return, @data is the size
428 * of the filter table and @rule_locs contains the indices of the
429 * defined rules.
430 *
431 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or
432 * update. @fs.@location specifies the index to use and must not be
433 * ignored.
434 *
435 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an
436 * existing filter rule on entry.
437 *
438 * Implementation of indexed classification rules generally requires a
439 * TCAM.
440 */
377struct ethtool_rxnfc { 441struct ethtool_rxnfc {
378 __u32 cmd; 442 __u32 cmd;
379 __u32 flow_type; 443 __u32 flow_type;
380 /* The rx flow hash value or the rule DB size */
381 __u64 data; 444 __u64 data;
382 /* The following fields are not valid and must not be used for
383 * the ETHTOOL_{G,X}RXFH commands. */
384 struct ethtool_rx_flow_spec fs; 445 struct ethtool_rx_flow_spec fs;
385 __u32 rule_cnt; 446 __u32 rule_cnt;
386 __u32 rule_locs[0]; 447 __u32 rule_locs[0];
387}; 448};
388 449
450/**
451 * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection
452 * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR
453 * @size: On entry, the array size of the user buffer. On return from
454 * %ETHTOOL_GRXFHINDIR, the array size of the hardware indirection table.
455 * @ring_index: RX ring/queue index for each hash value
456 */
389struct ethtool_rxfh_indir { 457struct ethtool_rxfh_indir {
390 __u32 cmd; 458 __u32 cmd;
391 /* On entry, this is the array size of the user buffer. On
392 * return from ETHTOOL_GRXFHINDIR, this is the array size of
393 * the hardware indirection table. */
394 __u32 size; 459 __u32 size;
395 __u32 ring_index[0]; /* ring/queue index for each hash value */ 460 __u32 ring_index[0];
396}; 461};
397 462
463/**
464 * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter
465 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
466 * @h_u: Flow field values to match (dependent on @flow_type)
467 * @m_u: Masks for flow field value bits to be ignored
468 * @vlan_tag: VLAN tag to match
469 * @vlan_tag_mask: Mask for VLAN tag bits to be ignored
470 * @data: Driver-dependent data to match
471 * @data_mask: Mask for driver-dependent data bits to be ignored
472 * @action: RX ring/queue index to deliver to (non-negative) or other action
473 * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP)
474 *
475 * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where
476 * a field value and mask are both zero this is treated as if all mask
477 * bits are set i.e. the field is ignored.
478 */
398struct ethtool_rx_ntuple_flow_spec { 479struct ethtool_rx_ntuple_flow_spec {
399 __u32 flow_type; 480 __u32 flow_type;
400 union { 481 union {
@@ -403,22 +484,26 @@ struct ethtool_rx_ntuple_flow_spec {
403 struct ethtool_tcpip4_spec sctp_ip4_spec; 484 struct ethtool_tcpip4_spec sctp_ip4_spec;
404 struct ethtool_ah_espip4_spec ah_ip4_spec; 485 struct ethtool_ah_espip4_spec ah_ip4_spec;
405 struct ethtool_ah_espip4_spec esp_ip4_spec; 486 struct ethtool_ah_espip4_spec esp_ip4_spec;
406 struct ethtool_rawip4_spec raw_ip4_spec;
407 struct ethtool_ether_spec ether_spec;
408 struct ethtool_usrip4_spec usr_ip4_spec; 487 struct ethtool_usrip4_spec usr_ip4_spec;
409 __u8 hdata[64]; 488 struct ethhdr ether_spec;
410 } h_u, m_u; /* entry, mask */ 489 __u8 hdata[72];
490 } h_u, m_u;
411 491
412 __u16 vlan_tag; 492 __u16 vlan_tag;
413 __u16 vlan_tag_mask; 493 __u16 vlan_tag_mask;
414 __u64 data; /* user-defined flow spec data */ 494 __u64 data;
415 __u64 data_mask; /* user-defined flow spec mask */ 495 __u64 data_mask;
416 496
417 /* signed to distinguish between queue and actions (DROP) */
418 __s32 action; 497 __s32 action;
419#define ETHTOOL_RXNTUPLE_ACTION_DROP -1 498#define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */
499#define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */
420}; 500};
421 501
502/**
503 * struct ethtool_rx_ntuple - command to set or clear RX flow filter
504 * @cmd: Command number - %ETHTOOL_SRXNTUPLE
505 * @fs: Flow filter specification
506 */
422struct ethtool_rx_ntuple { 507struct ethtool_rx_ntuple {
423 __u32 cmd; 508 __u32 cmd;
424 struct ethtool_rx_ntuple_flow_spec fs; 509 struct ethtool_rx_ntuple_flow_spec fs;
@@ -759,22 +844,23 @@ struct ethtool_ops {
759#define WAKE_MAGIC (1 << 5) 844#define WAKE_MAGIC (1 << 5)
760#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ 845#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
761 846
762/* L3-L4 network traffic flow types */ 847/* L2-L4 network traffic flow types */
763#define TCP_V4_FLOW 0x01 848#define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */
764#define UDP_V4_FLOW 0x02 849#define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */
765#define SCTP_V4_FLOW 0x03 850#define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */
766#define AH_ESP_V4_FLOW 0x04 851#define AH_ESP_V4_FLOW 0x04 /* hash only */
767#define TCP_V6_FLOW 0x05 852#define TCP_V6_FLOW 0x05 /* hash only */
768#define UDP_V6_FLOW 0x06 853#define UDP_V6_FLOW 0x06 /* hash only */
769#define SCTP_V6_FLOW 0x07 854#define SCTP_V6_FLOW 0x07 /* hash only */
770#define AH_ESP_V6_FLOW 0x08 855#define AH_ESP_V6_FLOW 0x08 /* hash only */
771#define AH_V4_FLOW 0x09 856#define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */
772#define ESP_V4_FLOW 0x0a 857#define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */
773#define AH_V6_FLOW 0x0b 858#define AH_V6_FLOW 0x0b /* hash only */
774#define ESP_V6_FLOW 0x0c 859#define ESP_V6_FLOW 0x0c /* hash only */
775#define IP_USER_FLOW 0x0d 860#define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */
776#define IPV4_FLOW 0x10 861#define IPV4_FLOW 0x10 /* hash only */
777#define IPV6_FLOW 0x11 862#define IPV6_FLOW 0x11 /* hash only */
863#define ETHER_FLOW 0x12 /* spec only (ether_spec) */
778 864
779/* L3-L4 network traffic flow hash options */ 865/* L3-L4 network traffic flow hash options */
780#define RXH_L2DA (1 << 1) 866#define RXH_L2DA (1 << 1)
diff --git a/include/linux/if.h b/include/linux/if.h
index 53558ec59e1b..123959927745 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -75,6 +75,8 @@
75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */ 75#define IFF_DISABLE_NETPOLL 0x2000 /* disable netpoll at run-time */
76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */ 76#define IFF_MACVLAN_PORT 0x4000 /* device used as macvlan port */
77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */ 77#define IFF_BRIDGE_PORT 0x8000 /* device used as bridge port */
78#define IFF_OVS_DATAPATH 0x10000 /* device used as Open vSwitch
79 * datapath port */
78 80
79#define IF_GET_IFACE 0x0001 /* for querying only */ 81#define IF_GET_IFACE 0x0001 /* for querying only */
80#define IF_GET_PROTO 0x0002 82#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index bed7a4682b90..f9c3df03db0f 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -137,8 +137,6 @@ extern struct ctl_table ether_table[];
137 137
138extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); 138extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
139 139
140#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
141
142#endif 140#endif
143 141
144#endif /* _LINUX_IF_ETHER_H */ 142#endif /* _LINUX_IF_ETHER_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 35280b302290..8a2fd66a8b5f 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -40,6 +40,12 @@ struct macvlan_rx_stats {
40 unsigned long rx_errors; 40 unsigned long rx_errors;
41}; 41};
42 42
43/*
44 * Maximum times a macvtap device can be opened. This can be used to
45 * configure the number of receive queue, e.g. for multiqueue virtio.
46 */
47#define MAX_MACVTAP_QUEUES (NR_CPUS < 16 ? NR_CPUS : 16)
48
43struct macvlan_dev { 49struct macvlan_dev {
44 struct net_device *dev; 50 struct net_device *dev;
45 struct list_head list; 51 struct list_head list;
@@ -50,7 +56,8 @@ struct macvlan_dev {
50 enum macvlan_mode mode; 56 enum macvlan_mode mode;
51 int (*receive)(struct sk_buff *skb); 57 int (*receive)(struct sk_buff *skb);
52 int (*forward)(struct net_device *dev, struct sk_buff *skb); 58 int (*forward)(struct net_device *dev, struct sk_buff *skb);
53 struct macvtap_queue *tap; 59 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
60 int numvtaps;
54}; 61};
55 62
56static inline void macvlan_count_rx(const struct macvlan_dev *vlan, 63static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 27741e05446f..397921b09ef9 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -40,25 +40,35 @@
40 * PPPoE addressing definition 40 * PPPoE addressing definition
41 */ 41 */
42typedef __be16 sid_t; 42typedef __be16 sid_t;
43struct pppoe_addr{ 43struct pppoe_addr {
44 sid_t sid; /* Session identifier */ 44 sid_t sid; /* Session identifier */
45 unsigned char remote[ETH_ALEN]; /* Remote address */ 45 unsigned char remote[ETH_ALEN]; /* Remote address */
46 char dev[IFNAMSIZ]; /* Local device to use */ 46 char dev[IFNAMSIZ]; /* Local device to use */
47}; 47};
48 48
49/************************************************************************ 49/************************************************************************
50 * Protocols supported by AF_PPPOX 50 * PPTP addressing definition
51 */ 51 */
52struct pptp_addr {
53 __be16 call_id;
54 struct in_addr sin_addr;
55};
56
57/************************************************************************
58 * Protocols supported by AF_PPPOX
59 */
52#define PX_PROTO_OE 0 /* Currently just PPPoE */ 60#define PX_PROTO_OE 0 /* Currently just PPPoE */
53#define PX_PROTO_OL2TP 1 /* Now L2TP also */ 61#define PX_PROTO_OL2TP 1 /* Now L2TP also */
54#define PX_MAX_PROTO 2 62#define PX_PROTO_PPTP 2
55 63#define PX_MAX_PROTO 3
56struct sockaddr_pppox { 64
57 sa_family_t sa_family; /* address family, AF_PPPOX */ 65struct sockaddr_pppox {
58 unsigned int sa_protocol; /* protocol identifier */ 66 sa_family_t sa_family; /* address family, AF_PPPOX */
59 union{ 67 unsigned int sa_protocol; /* protocol identifier */
60 struct pppoe_addr pppoe; 68 union {
61 }sa_addr; 69 struct pppoe_addr pppoe;
70 struct pptp_addr pptp;
71 } sa_addr;
62} __attribute__((packed)); 72} __attribute__((packed));
63 73
64/* The use of the above union isn't viable because the size of this 74/* The use of the above union isn't viable because the size of this
@@ -150,15 +160,23 @@ struct pppoe_opt {
150 relayed to (PPPoE relaying) */ 160 relayed to (PPPoE relaying) */
151}; 161};
152 162
163struct pptp_opt {
164 struct pptp_addr src_addr;
165 struct pptp_addr dst_addr;
166 u32 ack_sent, ack_recv;
167 u32 seq_sent, seq_recv;
168 int ppp_flags;
169};
153#include <net/sock.h> 170#include <net/sock.h>
154 171
155struct pppox_sock { 172struct pppox_sock {
156 /* struct sock must be the first member of pppox_sock */ 173 /* struct sock must be the first member of pppox_sock */
157 struct sock sk; 174 struct sock sk;
158 struct ppp_channel chan; 175 struct ppp_channel chan;
159 struct pppox_sock *next; /* for hash table */ 176 struct pppox_sock *next; /* for hash table */
160 union { 177 union {
161 struct pppoe_opt pppoe; 178 struct pppoe_opt pppoe;
179 struct pptp_opt pptp;
162 } proto; 180 } proto;
163 __be16 num; 181 __be16 num;
164}; 182};
@@ -186,7 +204,7 @@ struct pppox_proto {
186 struct module *owner; 204 struct module *owner;
187}; 205};
188 206
189extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); 207extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp);
190extern void unregister_pppox_proto(int proto_num); 208extern void unregister_pppox_proto(int proto_num);
191extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ 209extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
192extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); 210extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 3d870fda8c4f..a52320751bfc 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -119,7 +119,7 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev);
119 119
120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, 120extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
121 u16 vlan_tci, int polling); 121 u16 vlan_tci, int polling);
122extern int vlan_hwaccel_do_receive(struct sk_buff *skb); 122extern void vlan_hwaccel_do_receive(struct sk_buff *skb);
123extern gro_result_t 123extern gro_result_t
124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, 124vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
125 unsigned int vlan_tci, struct sk_buff *skb); 125 unsigned int vlan_tci, struct sk_buff *skb);
@@ -147,9 +147,8 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
147 return NET_XMIT_SUCCESS; 147 return NET_XMIT_SUCCESS;
148} 148}
149 149
150static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) 150static inline void vlan_hwaccel_do_receive(struct sk_buff *skb)
151{ 151{
152 return 0;
153} 152}
154 153
155static inline gro_result_t 154static inline gro_result_t
diff --git a/include/linux/in.h b/include/linux/in.h
index 41d88a4689af..beeb6dee2b49 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -250,6 +250,25 @@ struct sockaddr_in {
250 250
251#ifdef __KERNEL__ 251#ifdef __KERNEL__
252 252
253#include <linux/errno.h>
254
255static inline int proto_ports_offset(int proto)
256{
257 switch (proto) {
258 case IPPROTO_TCP:
259 case IPPROTO_UDP:
260 case IPPROTO_DCCP:
261 case IPPROTO_ESP: /* SPI */
262 case IPPROTO_SCTP:
263 case IPPROTO_UDPLITE:
264 return 0;
265 case IPPROTO_AH: /* SPI */
266 return 4;
267 default:
268 return -EINVAL;
269 }
270}
271
253static inline bool ipv4_is_loopback(__be32 addr) 272static inline bool ipv4_is_loopback(__be32 addr)
254{ 273{
255 return (addr & htonl(0xff000000)) == htonl(0x7f000000); 274 return (addr & htonl(0xff000000)) == htonl(0x7f000000);
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 2be1a1a2beb9..1ec09bb4a3ab 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -9,6 +9,7 @@
9#include <linux/rcupdate.h> 9#include <linux/rcupdate.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h> 11#include <linux/sysctl.h>
12#include <linux/rtnetlink.h>
12 13
13enum 14enum
14{ 15{
@@ -198,14 +199,10 @@ static __inline__ int bad_mask(__be32 mask, __be32 addr)
198 199
199static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) 200static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev)
200{ 201{
201 struct in_device *in_dev = dev->ip_ptr; 202 return rcu_dereference(dev->ip_ptr);
202 if (in_dev)
203 in_dev = rcu_dereference(in_dev);
204 return in_dev;
205} 203}
206 204
207static __inline__ struct in_device * 205static inline struct in_device *in_dev_get(const struct net_device *dev)
208in_dev_get(const struct net_device *dev)
209{ 206{
210 struct in_device *in_dev; 207 struct in_device *in_dev;
211 208
@@ -217,10 +214,9 @@ in_dev_get(const struct net_device *dev)
217 return in_dev; 214 return in_dev;
218} 215}
219 216
220static __inline__ struct in_device * 217static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
221__in_dev_get_rtnl(const struct net_device *dev)
222{ 218{
223 return (struct in_device*)dev->ip_ptr; 219 return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held());
224} 220}
225 221
226extern void in_dev_finish_destroy(struct in_device *idev); 222extern void in_dev_finish_destroy(struct in_device *idev);
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 0f82293a82ed..78a1b9671752 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -56,6 +56,7 @@ enum {
56 MLX4_CMD_QUERY_HCA = 0xb, 56 MLX4_CMD_QUERY_HCA = 0xb,
57 MLX4_CMD_QUERY_PORT = 0x43, 57 MLX4_CMD_QUERY_PORT = 0x43,
58 MLX4_CMD_SENSE_PORT = 0x4d, 58 MLX4_CMD_SENSE_PORT = 0x4d,
59 MLX4_CMD_HW_HEALTH_CHECK = 0x50,
59 MLX4_CMD_SET_PORT = 0xc, 60 MLX4_CMD_SET_PORT = 0xc,
60 MLX4_CMD_ACCESS_DDR = 0x2e, 61 MLX4_CMD_ACCESS_DDR = 0x2e,
61 MLX4_CMD_MAP_ICM = 0xffa, 62 MLX4_CMD_MAP_ICM = 0xffa,
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 7a7f9c1e679a..7338654c02b4 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -186,6 +186,10 @@ struct mlx4_caps {
186 int eth_mtu_cap[MLX4_MAX_PORTS + 1]; 186 int eth_mtu_cap[MLX4_MAX_PORTS + 1];
187 int gid_table_len[MLX4_MAX_PORTS + 1]; 187 int gid_table_len[MLX4_MAX_PORTS + 1];
188 int pkey_table_len[MLX4_MAX_PORTS + 1]; 188 int pkey_table_len[MLX4_MAX_PORTS + 1];
189 int trans_type[MLX4_MAX_PORTS + 1];
190 int vendor_oui[MLX4_MAX_PORTS + 1];
191 int wavelength[MLX4_MAX_PORTS + 1];
192 u64 trans_code[MLX4_MAX_PORTS + 1];
189 int local_ca_ack_delay; 193 int local_ca_ack_delay;
190 int num_uars; 194 int num_uars;
191 int bf_reg_size; 195 int bf_reg_size;
@@ -229,6 +233,8 @@ struct mlx4_caps {
229 u32 bmme_flags; 233 u32 bmme_flags;
230 u32 reserved_lkey; 234 u32 reserved_lkey;
231 u16 stat_rate_support; 235 u16 stat_rate_support;
236 int udp_rss;
237 int loopback_support;
232 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 238 u8 port_width_cap[MLX4_MAX_PORTS + 1];
233 int max_gso_sz; 239 int max_gso_sz;
234 int reserved_qps_cnt[MLX4_NUM_QP_REGION]; 240 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
@@ -480,5 +486,6 @@ void mlx4_fmr_unmap(struct mlx4_dev *dev, struct mlx4_fmr *fmr,
480 u32 *lkey, u32 *rkey); 486 u32 *lkey, u32 *rkey);
481int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); 487int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr);
482int mlx4_SYNC_TPT(struct mlx4_dev *dev); 488int mlx4_SYNC_TPT(struct mlx4_dev *dev);
489int mlx4_test_interrupts(struct mlx4_dev *dev);
483 490
484#endif /* MLX4_DEVICE_H */ 491#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 46c36ffe20ee..01bd4c82d982 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -228,9 +228,9 @@ struct netdev_hw_addr {
228#define NETDEV_HW_ADDR_T_SLAVE 3 228#define NETDEV_HW_ADDR_T_SLAVE 3
229#define NETDEV_HW_ADDR_T_UNICAST 4 229#define NETDEV_HW_ADDR_T_UNICAST 4
230#define NETDEV_HW_ADDR_T_MULTICAST 5 230#define NETDEV_HW_ADDR_T_MULTICAST 5
231 int refcount;
232 bool synced; 231 bool synced;
233 bool global_use; 232 bool global_use;
233 int refcount;
234 struct rcu_head rcu_head; 234 struct rcu_head rcu_head;
235}; 235};
236 236
@@ -901,7 +901,7 @@ struct net_device {
901 901
902 unsigned int flags; /* interface flags (a la BSD) */ 902 unsigned int flags; /* interface flags (a la BSD) */
903 unsigned short gflags; 903 unsigned short gflags;
904 unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ 904 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */
905 unsigned short padded; /* How much padding added by alloc_netdev() */ 905 unsigned short padded; /* How much padding added by alloc_netdev() */
906 906
907 unsigned char operstate; /* RFC2863 operstate */ 907 unsigned char operstate; /* RFC2863 operstate */
@@ -918,10 +918,6 @@ struct net_device {
918 unsigned short needed_headroom; 918 unsigned short needed_headroom;
919 unsigned short needed_tailroom; 919 unsigned short needed_tailroom;
920 920
921 struct net_device *master; /* Pointer to master device of a group,
922 * which this device is member of.
923 */
924
925 /* Interface address info. */ 921 /* Interface address info. */
926 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 922 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */
927 unsigned char addr_assign_type; /* hw address assignment type */ 923 unsigned char addr_assign_type; /* hw address assignment type */
@@ -942,7 +938,7 @@ struct net_device {
942 void *dsa_ptr; /* dsa specific data */ 938 void *dsa_ptr; /* dsa specific data */
943#endif 939#endif
944 void *atalk_ptr; /* AppleTalk link */ 940 void *atalk_ptr; /* AppleTalk link */
945 void *ip_ptr; /* IPv4 specific data */ 941 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
946 void *dn_ptr; /* DECnet specific data */ 942 void *dn_ptr; /* DECnet specific data */
947 void *ip6_ptr; /* IPv6 specific data */ 943 void *ip6_ptr; /* IPv6 specific data */
948 void *ec_ptr; /* Econet specific data */ 944 void *ec_ptr; /* Econet specific data */
@@ -951,9 +947,20 @@ struct net_device {
951 assign before registering */ 947 assign before registering */
952 948
953/* 949/*
954 * Cache line mostly used on receive path (including eth_type_trans()) 950 * Cache lines mostly used on receive path (including eth_type_trans())
955 */ 951 */
956 unsigned long last_rx; /* Time of last Rx */ 952 unsigned long last_rx; /* Time of last Rx
953 * This should not be set in
954 * drivers, unless really needed,
955 * because network stack (bonding)
956 * use it if/when necessary, to
957 * avoid dirtying this cache line.
958 */
959
960 struct net_device *master; /* Pointer to master device of a group,
961 * which this device is member of.
962 */
963
957 /* Interface address info used in eth_type_trans() */ 964 /* Interface address info used in eth_type_trans() */
958 unsigned char *dev_addr; /* hw address, (before bcast 965 unsigned char *dev_addr; /* hw address, (before bcast
959 because most packets are 966 because most packets are
@@ -973,10 +980,14 @@ struct net_device {
973 unsigned int num_rx_queues; 980 unsigned int num_rx_queues;
974#endif 981#endif
975 982
976 struct netdev_queue rx_queue;
977 rx_handler_func_t *rx_handler; 983 rx_handler_func_t *rx_handler;
978 void *rx_handler_data; 984 void *rx_handler_data;
979 985
986 struct netdev_queue rx_queue; /* use two cache lines */
987
988/*
989 * Cache lines mostly used on transmit path
990 */
980 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 991 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
981 992
982 /* Number of TX queues allocated at alloc_netdev_mq() time */ 993 /* Number of TX queues allocated at alloc_netdev_mq() time */
@@ -990,9 +1001,7 @@ struct net_device {
990 1001
991 unsigned long tx_queue_len; /* Max frames per queue allowed */ 1002 unsigned long tx_queue_len; /* Max frames per queue allowed */
992 spinlock_t tx_global_lock; 1003 spinlock_t tx_global_lock;
993/* 1004
994 * One part is mostly used on xmit path (device)
995 */
996 /* These may be needed for future network-power-down code. */ 1005 /* These may be needed for future network-power-down code. */
997 1006
998 /* 1007 /*
@@ -1041,8 +1050,10 @@ struct net_device {
1041#endif 1050#endif
1042 1051
1043 /* mid-layer private */ 1052 /* mid-layer private */
1044 void *ml_priv; 1053 union {
1045 1054 void *ml_priv;
1055 struct pcpu_lstats __percpu *lstats; /* loopback stats */
1056 };
1046 /* GARP */ 1057 /* GARP */
1047 struct garp_port *garp_port; 1058 struct garp_port *garp_port;
1048 1059
@@ -1667,7 +1678,7 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1667 */ 1678 */
1668static inline int netif_is_multiqueue(const struct net_device *dev) 1679static inline int netif_is_multiqueue(const struct net_device *dev)
1669{ 1680{
1670 return (dev->num_tx_queues > 1); 1681 return dev->num_tx_queues > 1;
1671} 1682}
1672 1683
1673extern void netif_set_real_num_tx_queues(struct net_device *dev, 1684extern void netif_set_real_num_tx_queues(struct net_device *dev,
@@ -1695,6 +1706,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi,
1695extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); 1706extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb);
1696extern gro_result_t napi_gro_receive(struct napi_struct *napi, 1707extern gro_result_t napi_gro_receive(struct napi_struct *napi,
1697 struct sk_buff *skb); 1708 struct sk_buff *skb);
1709extern void napi_gro_flush(struct napi_struct *napi);
1698extern void napi_reuse_skb(struct napi_struct *napi, 1710extern void napi_reuse_skb(struct napi_struct *napi,
1699 struct sk_buff *skb); 1711 struct sk_buff *skb);
1700extern struct sk_buff * napi_get_frags(struct napi_struct *napi); 1712extern struct sk_buff * napi_get_frags(struct napi_struct *napi);
@@ -2171,6 +2183,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v);
2171extern int netdev_class_create_file(struct class_attribute *class_attr); 2183extern int netdev_class_create_file(struct class_attribute *class_attr);
2172extern void netdev_class_remove_file(struct class_attribute *class_attr); 2184extern void netdev_class_remove_file(struct class_attribute *class_attr);
2173 2185
2186extern struct kobj_ns_type_operations net_ns_type_operations;
2187
2174extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); 2188extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len);
2175 2189
2176extern void linkwatch_run_queue(void); 2190extern void linkwatch_run_queue(void);
@@ -2191,7 +2205,7 @@ static inline int net_gso_ok(int features, int gso_type)
2191static inline int skb_gso_ok(struct sk_buff *skb, int features) 2205static inline int skb_gso_ok(struct sk_buff *skb, int features)
2192{ 2206{
2193 return net_gso_ok(features, skb_shinfo(skb)->gso_type) && 2207 return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
2194 (!skb_has_frags(skb) || (features & NETIF_F_FRAGLIST)); 2208 (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
2195} 2209}
2196 2210
2197static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 2211static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 2c8701687336..f0518b0278a9 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -40,6 +40,43 @@
40 */ 40 */
41 41
42/** 42/**
43 * DOC: Frame transmission/registration support
44 *
45 * Frame transmission and registration support exists to allow userspace
46 * management entities such as wpa_supplicant react to management frames
47 * that are not being handled by the kernel. This includes, for example,
48 * certain classes of action frames that cannot be handled in the kernel
49 * for various reasons.
50 *
51 * Frame registration is done on a per-interface basis and registrations
52 * cannot be removed other than by closing the socket. It is possible to
53 * specify a registration filter to register, for example, only for a
54 * certain type of action frame. In particular with action frames, those
55 * that userspace registers for will not be returned as unhandled by the
56 * driver, so that the registered application has to take responsibility
57 * for doing that.
58 *
59 * The type of frame that can be registered for is also dependent on the
60 * driver and interface type. The frame types are advertised in wiphy
61 * attributes so applications know what to expect.
62 *
63 * NOTE: When an interface changes type while registrations are active,
64 * these registrations are ignored until the interface type is
65 * changed again. This means that changing the interface type can
66 * lead to a situation that couldn't otherwise be produced, but
67 * any such registrations will be dormant in the sense that they
68 * will not be serviced, i.e. they will not receive any frames.
69 *
70 * Frame transmission allows userspace to send for example the required
71 * responses to action frames. It is subject to some sanity checking,
72 * but many frames can be transmitted. When a frame was transmitted, its
73 * status is indicated to the sending socket.
74 *
75 * For more technical details, see the corresponding command descriptions
76 * below.
77 */
78
79/**
43 * enum nl80211_commands - supported nl80211 commands 80 * enum nl80211_commands - supported nl80211 commands
44 * 81 *
45 * @NL80211_CMD_UNSPEC: unspecified command to catch errors 82 * @NL80211_CMD_UNSPEC: unspecified command to catch errors
@@ -258,7 +295,9 @@
258 * auth and assoc steps. For this, you need to specify the SSID in a 295 * auth and assoc steps. For this, you need to specify the SSID in a
259 * %NL80211_ATTR_SSID attribute, and can optionally specify the association 296 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
260 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC, 297 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
261 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT. 298 * %NL80211_ATTR_WIPHY_FREQ, %NL80211_ATTR_CONTROL_PORT,
299 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE and
300 * %NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT.
262 * It is also sent as an event, with the BSSID and response IEs when the 301 * It is also sent as an event, with the BSSID and response IEs when the
263 * connection is established or failed to be established. This can be 302 * connection is established or failed to be established. This can be
264 * determined by the STATUS_CODE attribute. 303 * determined by the STATUS_CODE attribute.
@@ -301,16 +340,20 @@
301 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface 340 * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface
302 * and @NL80211_ATTR_TX_RATES the set of allowed rates. 341 * and @NL80211_ATTR_TX_RATES the set of allowed rates.
303 * 342 *
304 * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames 343 * @NL80211_CMD_REGISTER_FRAME: Register for receiving certain mgmt frames
305 * (via @NL80211_CMD_ACTION) for processing in userspace. This command 344 * (via @NL80211_CMD_FRAME) for processing in userspace. This command
306 * requires an interface index and a match attribute containing the first 345 * requires an interface index, a frame type attribute (optional for
307 * few bytes of the frame that should match, e.g. a single byte for only 346 * backward compatibility reasons, if not given assumes action frames)
308 * a category match or four bytes for vendor frames including the OUI. 347 * and a match attribute containing the first few bytes of the frame
309 * The registration cannot be dropped, but is removed automatically 348 * that should match, e.g. a single byte for only a category match or
310 * when the netlink socket is closed. Multiple registrations can be made. 349 * four bytes for vendor frames including the OUI. The registration
311 * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This 350 * cannot be dropped, but is removed automatically when the netlink
312 * command is used both as a request to transmit an Action frame and as an 351 * socket is closed. Multiple registrations can be made.
313 * event indicating reception of an Action frame that was not processed in 352 * @NL80211_CMD_REGISTER_ACTION: Alias for @NL80211_CMD_REGISTER_FRAME for
353 * backward compatibility
354 * @NL80211_CMD_FRAME: Management frame TX request and RX notification. This
355 * command is used both as a request to transmit a management frame and
356 * as an event indicating reception of a frame that was not processed in
314 * kernel code, but is for us (i.e., which may need to be processed in a 357 * kernel code, but is for us (i.e., which may need to be processed in a
315 * user space application). %NL80211_ATTR_FRAME is used to specify the 358 * user space application). %NL80211_ATTR_FRAME is used to specify the
316 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and 359 * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and
@@ -320,11 +363,14 @@
320 * operational channel). When called, this operation returns a cookie 363 * operational channel). When called, this operation returns a cookie
321 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event 364 * (%NL80211_ATTR_COOKIE) that will be included with the TX status event
322 * pertaining to the TX request. 365 * pertaining to the TX request.
323 * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame 366 * @NL80211_CMD_ACTION: Alias for @NL80211_CMD_FRAME for backward compatibility.
324 * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies 367 * @NL80211_CMD_FRAME_TX_STATUS: Report TX status of a management frame
368 * transmitted with %NL80211_CMD_FRAME. %NL80211_ATTR_COOKIE identifies
325 * the TX command and %NL80211_ATTR_FRAME includes the contents of the 369 * the TX command and %NL80211_ATTR_FRAME includes the contents of the
326 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged 370 * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged
327 * the frame. 371 * the frame.
372 * @NL80211_CMD_ACTION_TX_STATUS: Alias for @NL80211_CMD_FRAME_TX_STATUS for
373 * backward compatibility.
328 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command 374 * @NL80211_CMD_SET_CQM: Connection quality monitor configuration. This command
329 * is used to configure connection quality monitoring notification trigger 375 * is used to configure connection quality monitoring notification trigger
330 * levels. 376 * levels.
@@ -429,9 +475,12 @@ enum nl80211_commands {
429 475
430 NL80211_CMD_SET_TX_BITRATE_MASK, 476 NL80211_CMD_SET_TX_BITRATE_MASK,
431 477
432 NL80211_CMD_REGISTER_ACTION, 478 NL80211_CMD_REGISTER_FRAME,
433 NL80211_CMD_ACTION, 479 NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME,
434 NL80211_CMD_ACTION_TX_STATUS, 480 NL80211_CMD_FRAME,
481 NL80211_CMD_ACTION = NL80211_CMD_FRAME,
482 NL80211_CMD_FRAME_TX_STATUS,
483 NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS,
435 484
436 NL80211_CMD_SET_POWER_SAVE, 485 NL80211_CMD_SET_POWER_SAVE,
437 NL80211_CMD_GET_POWER_SAVE, 486 NL80211_CMD_GET_POWER_SAVE,
@@ -639,6 +688,15 @@ enum nl80211_commands {
639 * request, the driver will assume that the port is unauthorized until 688 * request, the driver will assume that the port is unauthorized until
640 * authorized by user space. Otherwise, port is marked authorized by 689 * authorized by user space. Otherwise, port is marked authorized by
641 * default in station mode. 690 * default in station mode.
691 * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the
692 * ethertype that will be used for key negotiation. It can be
693 * specified with the associate and connect commands. If it is not
694 * specified, the value defaults to 0x888E (PAE, 802.1X). This
695 * attribute is also used as a flag in the wiphy information to
696 * indicate that protocols other than PAE are supported.
697 * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with
698 * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom
699 * ethertype frames used for key negotiation must not be encrypted.
642 * 700 *
643 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. 701 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
644 * We recommend using nested, driver-specific attributes within this. 702 * We recommend using nested, driver-specific attributes within this.
@@ -708,7 +766,16 @@ enum nl80211_commands {
708 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. 766 * is used with %NL80211_CMD_SET_TX_BITRATE_MASK.
709 * 767 *
710 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain 768 * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain
711 * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. 769 * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME.
770 * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the
771 * @NL80211_CMD_REGISTER_FRAME command.
772 * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a
773 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
774 * information about which frame types can be transmitted with
775 * %NL80211_CMD_FRAME.
776 * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a
777 * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing
778 * information about which frame types can be registered for RX.
712 * 779 *
713 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was 780 * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was
714 * acknowledged by the recipient. 781 * acknowledged by the recipient.
@@ -891,6 +958,13 @@ enum nl80211_attrs {
891 NL80211_ATTR_WIPHY_TX_POWER_SETTING, 958 NL80211_ATTR_WIPHY_TX_POWER_SETTING,
892 NL80211_ATTR_WIPHY_TX_POWER_LEVEL, 959 NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
893 960
961 NL80211_ATTR_TX_FRAME_TYPES,
962 NL80211_ATTR_RX_FRAME_TYPES,
963 NL80211_ATTR_FRAME_TYPE,
964
965 NL80211_ATTR_CONTROL_PORT_ETHERTYPE,
966 NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT,
967
894 /* add attributes here, update the policy in nl80211.c */ 968 /* add attributes here, update the policy in nl80211.c */
895 969
896 __NL80211_ATTR_AFTER_LAST, 970 __NL80211_ATTR_AFTER_LAST,
@@ -946,8 +1020,10 @@ enum nl80211_attrs {
946 * @NL80211_IFTYPE_WDS: wireless distribution interface 1020 * @NL80211_IFTYPE_WDS: wireless distribution interface
947 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames 1021 * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames
948 * @NL80211_IFTYPE_MESH_POINT: mesh point 1022 * @NL80211_IFTYPE_MESH_POINT: mesh point
1023 * @NL80211_IFTYPE_P2P_CLIENT: P2P client
1024 * @NL80211_IFTYPE_P2P_GO: P2P group owner
949 * @NL80211_IFTYPE_MAX: highest interface type number currently defined 1025 * @NL80211_IFTYPE_MAX: highest interface type number currently defined
950 * @__NL80211_IFTYPE_AFTER_LAST: internal use 1026 * @NUM_NL80211_IFTYPES: number of defined interface types
951 * 1027 *
952 * These values are used with the %NL80211_ATTR_IFTYPE 1028 * These values are used with the %NL80211_ATTR_IFTYPE
953 * to set the type of an interface. 1029 * to set the type of an interface.
@@ -962,10 +1038,12 @@ enum nl80211_iftype {
962 NL80211_IFTYPE_WDS, 1038 NL80211_IFTYPE_WDS,
963 NL80211_IFTYPE_MONITOR, 1039 NL80211_IFTYPE_MONITOR,
964 NL80211_IFTYPE_MESH_POINT, 1040 NL80211_IFTYPE_MESH_POINT,
1041 NL80211_IFTYPE_P2P_CLIENT,
1042 NL80211_IFTYPE_P2P_GO,
965 1043
966 /* keep last */ 1044 /* keep last */
967 __NL80211_IFTYPE_AFTER_LAST, 1045 NUM_NL80211_IFTYPES,
968 NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 1046 NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1
969}; 1047};
970 1048
971/** 1049/**
@@ -974,11 +1052,14 @@ enum nl80211_iftype {
974 * Station flags. When a station is added to an AP interface, it is 1052 * Station flags. When a station is added to an AP interface, it is
975 * assumed to be already associated (and hence authenticated.) 1053 * assumed to be already associated (and hence authenticated.)
976 * 1054 *
1055 * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved
977 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) 1056 * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X)
978 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames 1057 * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames
979 * with short barker preamble 1058 * with short barker preamble
980 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 1059 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
981 * @NL80211_STA_FLAG_MFP: station uses management frame protection 1060 * @NL80211_STA_FLAG_MFP: station uses management frame protection
1061 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1062 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
982 */ 1063 */
983enum nl80211_sta_flags { 1064enum nl80211_sta_flags {
984 __NL80211_STA_FLAG_INVALID, 1065 __NL80211_STA_FLAG_INVALID,
@@ -1091,14 +1172,17 @@ enum nl80211_mpath_flags {
1091 * information about a mesh path. 1172 * information about a mesh path.
1092 * 1173 *
1093 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved 1174 * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved
1094 * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination 1175 * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination
1095 * @NL80211_ATTR_MPATH_SN: destination sequence number 1176 * @NL80211_MPATH_INFO_SN: destination sequence number
1096 * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path 1177 * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path
1097 * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now 1178 * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now
1098 * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in 1179 * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in
1099 * &enum nl80211_mpath_flags; 1180 * &enum nl80211_mpath_flags;
1100 * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec 1181 * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec
1101 * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries 1182 * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries
1183 * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number
1184 * currently defind
1185 * @__NL80211_MPATH_INFO_AFTER_LAST: internal use
1102 */ 1186 */
1103enum nl80211_mpath_info { 1187enum nl80211_mpath_info {
1104 __NL80211_MPATH_INFO_INVALID, 1188 __NL80211_MPATH_INFO_INVALID,
@@ -1127,6 +1211,8 @@ enum nl80211_mpath_info {
1127 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE 1211 * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE
1128 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n 1212 * @NL80211_BAND_ATTR_HT_AMPDU_FACTOR: A-MPDU factor, as in 11n
1129 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n 1213 * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n
1214 * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined
1215 * @__NL80211_BAND_ATTR_AFTER_LAST: internal use
1130 */ 1216 */
1131enum nl80211_band_attr { 1217enum nl80211_band_attr {
1132 __NL80211_BAND_ATTR_INVALID, 1218 __NL80211_BAND_ATTR_INVALID,
@@ -1147,6 +1233,7 @@ enum nl80211_band_attr {
1147 1233
1148/** 1234/**
1149 * enum nl80211_frequency_attr - frequency attributes 1235 * enum nl80211_frequency_attr - frequency attributes
1236 * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved
1150 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz 1237 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
1151 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current 1238 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
1152 * regulatory domain. 1239 * regulatory domain.
@@ -1158,6 +1245,9 @@ enum nl80211_band_attr {
1158 * on this channel in current regulatory domain. 1245 * on this channel in current regulatory domain.
1159 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm 1246 * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm
1160 * (100 * dBm). 1247 * (100 * dBm).
1248 * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number
1249 * currently defined
1250 * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use
1161 */ 1251 */
1162enum nl80211_frequency_attr { 1252enum nl80211_frequency_attr {
1163 __NL80211_FREQUENCY_ATTR_INVALID, 1253 __NL80211_FREQUENCY_ATTR_INVALID,
@@ -1177,9 +1267,13 @@ enum nl80211_frequency_attr {
1177 1267
1178/** 1268/**
1179 * enum nl80211_bitrate_attr - bitrate attributes 1269 * enum nl80211_bitrate_attr - bitrate attributes
1270 * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved
1180 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps 1271 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
1181 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported 1272 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
1182 * in 2.4 GHz band. 1273 * in 2.4 GHz band.
1274 * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number
1275 * currently defined
1276 * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use
1183 */ 1277 */
1184enum nl80211_bitrate_attr { 1278enum nl80211_bitrate_attr {
1185 __NL80211_BITRATE_ATTR_INVALID, 1279 __NL80211_BITRATE_ATTR_INVALID,
@@ -1235,6 +1329,7 @@ enum nl80211_reg_type {
1235 1329
1236/** 1330/**
1237 * enum nl80211_reg_rule_attr - regulatory rule attributes 1331 * enum nl80211_reg_rule_attr - regulatory rule attributes
1332 * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved
1238 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional 1333 * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional
1239 * considerations for a given frequency range. These are the 1334 * considerations for a given frequency range. These are the
1240 * &enum nl80211_reg_rule_flags. 1335 * &enum nl80211_reg_rule_flags.
@@ -1251,6 +1346,9 @@ enum nl80211_reg_type {
1251 * If you don't have one then don't send this. 1346 * If you don't have one then don't send this.
1252 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for 1347 * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for
1253 * a given frequency range. The value is in mBm (100 * dBm). 1348 * a given frequency range. The value is in mBm (100 * dBm).
1349 * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number
1350 * currently defined
1351 * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use
1254 */ 1352 */
1255enum nl80211_reg_rule_attr { 1353enum nl80211_reg_rule_attr {
1256 __NL80211_REG_RULE_ATTR_INVALID, 1354 __NL80211_REG_RULE_ATTR_INVALID,
@@ -1302,6 +1400,9 @@ enum nl80211_reg_rule_flags {
1302 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved 1400 * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved
1303 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel 1401 * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel
1304 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) 1402 * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm)
1403 * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number
1404 * currently defined
1405 * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use
1305 */ 1406 */
1306enum nl80211_survey_info { 1407enum nl80211_survey_info {
1307 __NL80211_SURVEY_INFO_INVALID, 1408 __NL80211_SURVEY_INFO_INVALID,
@@ -1466,6 +1567,7 @@ enum nl80211_channel_type {
1466 * enum nl80211_bss - netlink attributes for a BSS 1567 * enum nl80211_bss - netlink attributes for a BSS
1467 * 1568 *
1468 * @__NL80211_BSS_INVALID: invalid 1569 * @__NL80211_BSS_INVALID: invalid
1570 * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets)
1469 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) 1571 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
1470 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) 1572 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
1471 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) 1573 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
@@ -1509,6 +1611,12 @@ enum nl80211_bss {
1509 1611
1510/** 1612/**
1511 * enum nl80211_bss_status - BSS "status" 1613 * enum nl80211_bss_status - BSS "status"
1614 * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS.
1615 * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS.
1616 * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS.
1617 *
1618 * The BSS status is a BSS attribute in scan dumps, which
1619 * indicates the status the interface has wrt. this BSS.
1512 */ 1620 */
1513enum nl80211_bss_status { 1621enum nl80211_bss_status {
1514 NL80211_BSS_STATUS_AUTHENTICATED, 1622 NL80211_BSS_STATUS_AUTHENTICATED,
@@ -1619,8 +1727,8 @@ enum nl80211_tx_rate_attributes {
1619 1727
1620/** 1728/**
1621 * enum nl80211_band - Frequency band 1729 * enum nl80211_band - Frequency band
1622 * @NL80211_BAND_2GHZ - 2.4 GHz ISM band 1730 * @NL80211_BAND_2GHZ: 2.4 GHz ISM band
1623 * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz) 1731 * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
1624 */ 1732 */
1625enum nl80211_band { 1733enum nl80211_band {
1626 NL80211_BAND_2GHZ, 1734 NL80211_BAND_2GHZ,
@@ -1658,9 +1766,9 @@ enum nl80211_attr_cqm {
1658 1766
1659/** 1767/**
1660 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event 1768 * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event
1661 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW - The RSSI level is lower than the 1769 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the
1662 * configured threshold 1770 * configured threshold
1663 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH - The RSSI is higher than the 1771 * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the
1664 * configured threshold 1772 * configured threshold
1665 */ 1773 */
1666enum nl80211_cqm_rssi_threshold_event { 1774enum nl80211_cqm_rssi_threshold_event {
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 10d33309e9a6..9438660b46ea 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2189,6 +2189,9 @@
2189#define PCI_VENDOR_ID_ARIMA 0x161f 2189#define PCI_VENDOR_ID_ARIMA 0x161f
2190 2190
2191#define PCI_VENDOR_ID_BROCADE 0x1657 2191#define PCI_VENDOR_ID_BROCADE 0x1657
2192#define PCI_DEVICE_ID_BROCADE_CT 0x0014
2193#define PCI_DEVICE_ID_BROCADE_FC_8G1P 0x0017
2194#define PCI_DEVICE_ID_BROCADE_CT_FC 0x0021
2192 2195
2193#define PCI_VENDOR_ID_SIBYTE 0x166d 2196#define PCI_VENDOR_ID_SIBYTE 0x166d
2194#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2197#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 76edadf046d3..85e14a83283b 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -47,6 +47,8 @@
47 47
48/* ioctls */ 48/* ioctls */
49#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) 49#define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0)
50#define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14)
51#define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15)
50 52
51/* Phonet protocol header */ 53/* Phonet protocol header */
52struct phonethdr { 54struct phonethdr {
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 6b0a782c6224..a6e047a04f79 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -116,7 +116,7 @@ struct mii_bus {
116 /* list of all PHYs on bus */ 116 /* list of all PHYs on bus */
117 struct phy_device *phy_map[PHY_MAX_ADDR]; 117 struct phy_device *phy_map[PHY_MAX_ADDR];
118 118
119 /* Phy addresses to be ignored when probing */ 119 /* PHY addresses to be ignored when probing */
120 u32 phy_mask; 120 u32 phy_mask;
121 121
122 /* 122 /*
@@ -283,7 +283,7 @@ struct phy_device {
283 283
284 phy_interface_t interface; 284 phy_interface_t interface;
285 285
286 /* Bus address of the PHY (0-32) */ 286 /* Bus address of the PHY (0-31) */
287 int addr; 287 int addr;
288 288
289 /* 289 /*
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 7f6ba8658abe..defbde203d07 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -332,6 +332,7 @@ enum {
332 FLOW_KEY_SKUID, 332 FLOW_KEY_SKUID,
333 FLOW_KEY_SKGID, 333 FLOW_KEY_SKGID,
334 FLOW_KEY_VLAN_TAG, 334 FLOW_KEY_VLAN_TAG,
335 FLOW_KEY_RXHASH,
335 __FLOW_KEY_MAX, 336 __FLOW_KEY_MAX,
336}; 337};
337 338
diff --git a/include/linux/rds.h b/include/linux/rds.h
index 24bce3ded9ea..91950950aa59 100644
--- a/include/linux/rds.h
+++ b/include/linux/rds.h
@@ -36,15 +36,6 @@
36 36
37#include <linux/types.h> 37#include <linux/types.h>
38 38
39/* These sparse annotated types shouldn't be in any user
40 * visible header file. We should clean this up rather
41 * than kludging around them. */
42#ifndef __KERNEL__
43#define __be16 u_int16_t
44#define __be32 u_int32_t
45#define __be64 u_int64_t
46#endif
47
48#define RDS_IB_ABI_VERSION 0x301 39#define RDS_IB_ABI_VERSION 0x301
49 40
50/* 41/*
@@ -82,6 +73,10 @@
82#define RDS_CMSG_RDMA_MAP 3 73#define RDS_CMSG_RDMA_MAP 3
83#define RDS_CMSG_RDMA_STATUS 4 74#define RDS_CMSG_RDMA_STATUS 4
84#define RDS_CMSG_CONG_UPDATE 5 75#define RDS_CMSG_CONG_UPDATE 5
76#define RDS_CMSG_ATOMIC_FADD 6
77#define RDS_CMSG_ATOMIC_CSWP 7
78#define RDS_CMSG_MASKED_ATOMIC_FADD 8
79#define RDS_CMSG_MASKED_ATOMIC_CSWP 9
85 80
86#define RDS_INFO_FIRST 10000 81#define RDS_INFO_FIRST 10000
87#define RDS_INFO_COUNTERS 10000 82#define RDS_INFO_COUNTERS 10000
@@ -98,9 +93,9 @@
98#define RDS_INFO_LAST 10010 93#define RDS_INFO_LAST 10010
99 94
100struct rds_info_counter { 95struct rds_info_counter {
101 u_int8_t name[32]; 96 uint8_t name[32];
102 u_int64_t value; 97 uint64_t value;
103} __packed; 98} __attribute__((packed));
104 99
105#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 100#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
106#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02 101#define RDS_INFO_CONNECTION_FLAG_CONNECTING 0x02
@@ -109,56 +104,48 @@ struct rds_info_counter {
109#define TRANSNAMSIZ 16 104#define TRANSNAMSIZ 16
110 105
111struct rds_info_connection { 106struct rds_info_connection {
112 u_int64_t next_tx_seq; 107 uint64_t next_tx_seq;
113 u_int64_t next_rx_seq; 108 uint64_t next_rx_seq;
114 __be32 laddr;
115 __be32 faddr;
116 u_int8_t transport[TRANSNAMSIZ]; /* null term ascii */
117 u_int8_t flags;
118} __packed;
119
120struct rds_info_flow {
121 __be32 laddr; 109 __be32 laddr;
122 __be32 faddr; 110 __be32 faddr;
123 u_int32_t bytes; 111 uint8_t transport[TRANSNAMSIZ]; /* null term ascii */
124 __be16 lport; 112 uint8_t flags;
125 __be16 fport; 113} __attribute__((packed));
126} __packed;
127 114
128#define RDS_INFO_MESSAGE_FLAG_ACK 0x01 115#define RDS_INFO_MESSAGE_FLAG_ACK 0x01
129#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 116#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02
130 117
131struct rds_info_message { 118struct rds_info_message {
132 u_int64_t seq; 119 uint64_t seq;
133 u_int32_t len; 120 uint32_t len;
134 __be32 laddr; 121 __be32 laddr;
135 __be32 faddr; 122 __be32 faddr;
136 __be16 lport; 123 __be16 lport;
137 __be16 fport; 124 __be16 fport;
138 u_int8_t flags; 125 uint8_t flags;
139} __packed; 126} __attribute__((packed));
140 127
141struct rds_info_socket { 128struct rds_info_socket {
142 u_int32_t sndbuf; 129 uint32_t sndbuf;
143 __be32 bound_addr; 130 __be32 bound_addr;
144 __be32 connected_addr; 131 __be32 connected_addr;
145 __be16 bound_port; 132 __be16 bound_port;
146 __be16 connected_port; 133 __be16 connected_port;
147 u_int32_t rcvbuf; 134 uint32_t rcvbuf;
148 u_int64_t inum; 135 uint64_t inum;
149} __packed; 136} __attribute__((packed));
150 137
151struct rds_info_tcp_socket { 138struct rds_info_tcp_socket {
152 __be32 local_addr; 139 __be32 local_addr;
153 __be16 local_port; 140 __be16 local_port;
154 __be32 peer_addr; 141 __be32 peer_addr;
155 __be16 peer_port; 142 __be16 peer_port;
156 u_int64_t hdr_rem; 143 uint64_t hdr_rem;
157 u_int64_t data_rem; 144 uint64_t data_rem;
158 u_int32_t last_sent_nxt; 145 uint32_t last_sent_nxt;
159 u_int32_t last_expected_una; 146 uint32_t last_expected_una;
160 u_int32_t last_seen_una; 147 uint32_t last_seen_una;
161} __packed; 148} __attribute__((packed));
162 149
163#define RDS_IB_GID_LEN 16 150#define RDS_IB_GID_LEN 16
164struct rds_info_rdma_connection { 151struct rds_info_rdma_connection {
@@ -212,42 +199,69 @@ struct rds_info_rdma_connection {
212 * (so that the application does not have to worry about 199 * (so that the application does not have to worry about
213 * alignment). 200 * alignment).
214 */ 201 */
215typedef u_int64_t rds_rdma_cookie_t; 202typedef uint64_t rds_rdma_cookie_t;
216 203
217struct rds_iovec { 204struct rds_iovec {
218 u_int64_t addr; 205 uint64_t addr;
219 u_int64_t bytes; 206 uint64_t bytes;
220}; 207};
221 208
222struct rds_get_mr_args { 209struct rds_get_mr_args {
223 struct rds_iovec vec; 210 struct rds_iovec vec;
224 u_int64_t cookie_addr; 211 uint64_t cookie_addr;
225 uint64_t flags; 212 uint64_t flags;
226}; 213};
227 214
228struct rds_get_mr_for_dest_args { 215struct rds_get_mr_for_dest_args {
229 struct sockaddr_storage dest_addr; 216 struct sockaddr_storage dest_addr;
230 struct rds_iovec vec; 217 struct rds_iovec vec;
231 u_int64_t cookie_addr; 218 uint64_t cookie_addr;
232 uint64_t flags; 219 uint64_t flags;
233}; 220};
234 221
235struct rds_free_mr_args { 222struct rds_free_mr_args {
236 rds_rdma_cookie_t cookie; 223 rds_rdma_cookie_t cookie;
237 u_int64_t flags; 224 uint64_t flags;
238}; 225};
239 226
240struct rds_rdma_args { 227struct rds_rdma_args {
241 rds_rdma_cookie_t cookie; 228 rds_rdma_cookie_t cookie;
242 struct rds_iovec remote_vec; 229 struct rds_iovec remote_vec;
243 u_int64_t local_vec_addr; 230 uint64_t local_vec_addr;
244 u_int64_t nr_local; 231 uint64_t nr_local;
245 u_int64_t flags; 232 uint64_t flags;
246 u_int64_t user_token; 233 uint64_t user_token;
234};
235
236struct rds_atomic_args {
237 rds_rdma_cookie_t cookie;
238 uint64_t local_addr;
239 uint64_t remote_addr;
240 union {
241 struct {
242 uint64_t compare;
243 uint64_t swap;
244 } cswp;
245 struct {
246 uint64_t add;
247 } fadd;
248 struct {
249 uint64_t compare;
250 uint64_t swap;
251 uint64_t compare_mask;
252 uint64_t swap_mask;
253 } m_cswp;
254 struct {
255 uint64_t add;
256 uint64_t nocarry_mask;
257 } m_fadd;
258 };
259 uint64_t flags;
260 uint64_t user_token;
247}; 261};
248 262
249struct rds_rdma_notify { 263struct rds_rdma_notify {
250 u_int64_t user_token; 264 uint64_t user_token;
251 int32_t status; 265 int32_t status;
252}; 266};
253 267
@@ -266,5 +280,6 @@ struct rds_rdma_notify {
266#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */ 280#define RDS_RDMA_USE_ONCE 0x0008 /* free MR after use */
267#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */ 281#define RDS_RDMA_DONTWAIT 0x0010 /* Don't wait in SET_BARRIER */
268#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */ 282#define RDS_RDMA_NOTIFY_ME 0x0020 /* Notify when operation completes */
283#define RDS_RDMA_SILENT 0x0040 /* Do not interrupt remote */
269 284
270#endif /* IB_RDS_H */ 285#endif /* IB_RDS_H */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 58d44491880f..68c436bddc88 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -749,6 +749,26 @@ extern int rtnl_is_locked(void);
749extern int lockdep_rtnl_is_held(void); 749extern int lockdep_rtnl_is_held(void);
750#endif /* #ifdef CONFIG_PROVE_LOCKING */ 750#endif /* #ifdef CONFIG_PROVE_LOCKING */
751 751
752/**
753 * rcu_dereference_rtnl - rcu_dereference with debug checking
754 * @p: The pointer to read, prior to dereferencing
755 *
756 * Do an rcu_dereference(p), but check caller either holds rcu_read_lock()
757 * or RTNL
758 */
759#define rcu_dereference_rtnl(p) \
760 rcu_dereference_check(p, rcu_read_lock_held() || \
761 lockdep_rtnl_is_held())
762
763/**
764 * rtnl_dereference - rcu_dereference with debug checking
765 * @p: The pointer to read, prior to dereferencing
766 *
767 * Do an rcu_dereference(p), but check caller holds RTNL
768 */
769#define rtnl_dereference(p) \
770 rcu_dereference_check(p, lockdep_rtnl_is_held())
771
752extern void rtnetlink_init(void); 772extern void rtnetlink_init(void);
753extern void __rtnl_unlock(void); 773extern void __rtnl_unlock(void);
754 774
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 77eb60d2b496..0b53c43ac92e 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -129,8 +129,13 @@ typedef struct skb_frag_struct skb_frag_t;
129 129
130struct skb_frag_struct { 130struct skb_frag_struct {
131 struct page *page; 131 struct page *page;
132#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
132 __u32 page_offset; 133 __u32 page_offset;
133 __u32 size; 134 __u32 size;
135#else
136 __u16 page_offset;
137 __u16 size;
138#endif
134}; 139};
135 140
136#define HAVE_HW_TIME_STAMP 141#define HAVE_HW_TIME_STAMP
@@ -163,26 +168,19 @@ struct skb_shared_hwtstamps {
163 ktime_t syststamp; 168 ktime_t syststamp;
164}; 169};
165 170
166/** 171/* Definitions for tx_flags in struct skb_shared_info */
167 * struct skb_shared_tx - instructions for time stamping of outgoing packets 172enum {
168 * @hardware: generate hardware time stamp 173 /* generate hardware time stamp */
169 * @software: generate software time stamp 174 SKBTX_HW_TSTAMP = 1 << 0,
170 * @in_progress: device driver is going to provide 175
171 * hardware time stamp 176 /* generate software time stamp */
172 * @prevent_sk_orphan: make sk reference available on driver level 177 SKBTX_SW_TSTAMP = 1 << 1,
173 * @flags: all shared_tx flags 178
174 * 179 /* device driver is going to provide hardware time stamp */
175 * These flags are attached to packets as part of the 180 SKBTX_IN_PROGRESS = 1 << 2,
176 * &skb_shared_info. Use skb_tx() to get a pointer. 181
177 */ 182 /* ensure the originating sk reference is available on driver level */
178union skb_shared_tx { 183 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
179 struct {
180 __u8 hardware:1,
181 software:1,
182 in_progress:1,
183 prevent_sk_orphan:1;
184 };
185 __u8 flags;
186}; 184};
187 185
188/* This data is invariant across clones and lives at 186/* This data is invariant across clones and lives at
@@ -195,7 +193,7 @@ struct skb_shared_info {
195 unsigned short gso_segs; 193 unsigned short gso_segs;
196 unsigned short gso_type; 194 unsigned short gso_type;
197 __be32 ip6_frag_id; 195 __be32 ip6_frag_id;
198 union skb_shared_tx tx_flags; 196 __u8 tx_flags;
199 struct sk_buff *frag_list; 197 struct sk_buff *frag_list;
200 struct skb_shared_hwtstamps hwtstamps; 198 struct skb_shared_hwtstamps hwtstamps;
201 199
@@ -558,6 +556,15 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
558 unsigned int to, struct ts_config *config, 556 unsigned int to, struct ts_config *config,
559 struct ts_state *state); 557 struct ts_state *state);
560 558
559extern __u32 __skb_get_rxhash(struct sk_buff *skb);
560static inline __u32 skb_get_rxhash(struct sk_buff *skb)
561{
562 if (!skb->rxhash)
563 skb->rxhash = __skb_get_rxhash(skb);
564
565 return skb->rxhash;
566}
567
561#ifdef NET_SKBUFF_DATA_USES_OFFSET 568#ifdef NET_SKBUFF_DATA_USES_OFFSET
562static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) 569static inline unsigned char *skb_end_pointer(const struct sk_buff *skb)
563{ 570{
@@ -578,11 +585,6 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb)
578 return &skb_shinfo(skb)->hwtstamps; 585 return &skb_shinfo(skb)->hwtstamps;
579} 586}
580 587
581static inline union skb_shared_tx *skb_tx(struct sk_buff *skb)
582{
583 return &skb_shinfo(skb)->tx_flags;
584}
585
586/** 588/**
587 * skb_queue_empty - check if a queue is empty 589 * skb_queue_empty - check if a queue is empty
588 * @list: queue head 590 * @list: queue head
@@ -604,7 +606,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list)
604static inline bool skb_queue_is_last(const struct sk_buff_head *list, 606static inline bool skb_queue_is_last(const struct sk_buff_head *list,
605 const struct sk_buff *skb) 607 const struct sk_buff *skb)
606{ 608{
607 return (skb->next == (struct sk_buff *) list); 609 return skb->next == (struct sk_buff *)list;
608} 610}
609 611
610/** 612/**
@@ -617,7 +619,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list,
617static inline bool skb_queue_is_first(const struct sk_buff_head *list, 619static inline bool skb_queue_is_first(const struct sk_buff_head *list,
618 const struct sk_buff *skb) 620 const struct sk_buff *skb)
619{ 621{
620 return (skb->prev == (struct sk_buff *) list); 622 return skb->prev == (struct sk_buff *)list;
621} 623}
622 624
623/** 625/**
@@ -1123,7 +1125,7 @@ extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
1123 int off, int size); 1125 int off, int size);
1124 1126
1125#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) 1127#define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags)
1126#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frags(skb)) 1128#define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb))
1127#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) 1129#define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb))
1128 1130
1129#ifdef NET_SKBUFF_DATA_USES_OFFSET 1131#ifdef NET_SKBUFF_DATA_USES_OFFSET
@@ -1787,7 +1789,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1787 skb = skb->prev) 1789 skb = skb->prev)
1788 1790
1789 1791
1790static inline bool skb_has_frags(const struct sk_buff *skb) 1792static inline bool skb_has_frag_list(const struct sk_buff *skb)
1791{ 1793{
1792 return skb_shinfo(skb)->frag_list != NULL; 1794 return skb_shinfo(skb)->frag_list != NULL;
1793} 1795}
@@ -1987,8 +1989,8 @@ extern void skb_tstamp_tx(struct sk_buff *orig_skb,
1987 1989
1988static inline void sw_tx_timestamp(struct sk_buff *skb) 1990static inline void sw_tx_timestamp(struct sk_buff *skb)
1989{ 1991{
1990 union skb_shared_tx *shtx = skb_tx(skb); 1992 if (skb_shinfo(skb)->tx_flags & SKBTX_SW_TSTAMP &&
1991 if (shtx->software && !shtx->in_progress) 1993 !(skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS))
1992 skb_tstamp_tx(skb, NULL); 1994 skb_tstamp_tx(skb, NULL);
1993} 1995}
1994 1996
@@ -2159,7 +2161,7 @@ static inline u16 skb_get_rx_queue(const struct sk_buff *skb)
2159 2161
2160static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) 2162static inline bool skb_rx_queue_recorded(const struct sk_buff *skb)
2161{ 2163{
2162 return (skb->queue_mapping != 0); 2164 return skb->queue_mapping != 0;
2163} 2165}
2164 2166
2165extern u16 skb_tx_hash(const struct net_device *dev, 2167extern u16 skb_tx_hash(const struct net_device *dev,
@@ -2209,6 +2211,21 @@ static inline void skb_forward_csum(struct sk_buff *skb)
2209 skb->ip_summed = CHECKSUM_NONE; 2211 skb->ip_summed = CHECKSUM_NONE;
2210} 2212}
2211 2213
2214/**
2215 * skb_checksum_none_assert - make sure skb ip_summed is CHECKSUM_NONE
2216 * @skb: skb to check
2217 *
2218 * fresh skbs have their ip_summed set to CHECKSUM_NONE.
2219 * Instead of forcing ip_summed to CHECKSUM_NONE, we can
2220 * use this helper, to document places where we make this assertion.
2221 */
2222static inline void skb_checksum_none_assert(struct sk_buff *skb)
2223{
2224#ifdef DEBUG
2225 BUG_ON(skb->ip_summed != CHECKSUM_NONE);
2226#endif
2227}
2228
2212bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2229bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2213#endif /* __KERNEL__ */ 2230#endif /* __KERNEL__ */
2214#endif /* _LINUX_SKBUFF_H */ 2231#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h
index a6d5225b9275..11daf9c140e7 100644
--- a/include/linux/ssb/ssb_regs.h
+++ b/include/linux/ssb/ssb_regs.h
@@ -97,6 +97,7 @@
97#define SSB_TMSLOW_RESET 0x00000001 /* Reset */ 97#define SSB_TMSLOW_RESET 0x00000001 /* Reset */
98#define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */ 98#define SSB_TMSLOW_REJECT_22 0x00000002 /* Reject (Backplane rev 2.2) */
99#define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */ 99#define SSB_TMSLOW_REJECT_23 0x00000004 /* Reject (Backplane rev 2.3) */
100#define SSB_TMSLOW_PHYCLK 0x00000010 /* MAC PHY Clock Control Enable */
100#define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */ 101#define SSB_TMSLOW_CLOCK 0x00010000 /* Clock Enable */
101#define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */ 102#define SSB_TMSLOW_FGC 0x00020000 /* Force Gated Clocks On */
102#define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */ 103#define SSB_TMSLOW_PE 0x40000000 /* Power Management Enable */
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 632ff7c03280..d66c61774d95 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -32,10 +32,14 @@
32struct plat_stmmacenet_data { 32struct plat_stmmacenet_data {
33 int bus_id; 33 int bus_id;
34 int pbl; 34 int pbl;
35 int clk_csr;
35 int has_gmac; 36 int has_gmac;
36 int enh_desc; 37 int enh_desc;
38 int tx_coe;
39 int bugged_jumbo;
40 int pmt;
37 void (*fix_mac_speed)(void *priv, unsigned int speed); 41 void (*fix_mac_speed)(void *priv, unsigned int speed);
38 void (*bus_setup)(unsigned long ioaddr); 42 void (*bus_setup)(void __iomem *ioaddr);
39#ifdef CONFIG_STM_DRIVERS 43#ifdef CONFIG_STM_DRIVERS
40 struct stm_pad_config *pad_config; 44 struct stm_pad_config *pad_config;
41#endif 45#endif
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild
index 76990937f4c9..67b501c302b2 100644
--- a/include/linux/tc_act/Kbuild
+++ b/include/linux/tc_act/Kbuild
@@ -4,3 +4,4 @@ header-y += tc_mirred.h
4header-y += tc_pedit.h 4header-y += tc_pedit.h
5header-y += tc_nat.h 5header-y += tc_nat.h
6header-y += tc_skbedit.h 6header-y += tc_skbedit.h
7header-y += tc_csum.h
diff --git a/include/linux/tc_act/tc_csum.h b/include/linux/tc_act/tc_csum.h
new file mode 100644
index 000000000000..a047c49a3153
--- /dev/null
+++ b/include/linux/tc_act/tc_csum.h
@@ -0,0 +1,32 @@
1#ifndef __LINUX_TC_CSUM_H
2#define __LINUX_TC_CSUM_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7#define TCA_ACT_CSUM 16
8
9enum {
10 TCA_CSUM_UNSPEC,
11 TCA_CSUM_PARMS,
12 TCA_CSUM_TM,
13 __TCA_CSUM_MAX
14};
15#define TCA_CSUM_MAX (__TCA_CSUM_MAX - 1)
16
17enum {
18 TCA_CSUM_UPDATE_FLAG_IPV4HDR = 1,
19 TCA_CSUM_UPDATE_FLAG_ICMP = 2,
20 TCA_CSUM_UPDATE_FLAG_IGMP = 4,
21 TCA_CSUM_UPDATE_FLAG_TCP = 8,
22 TCA_CSUM_UPDATE_FLAG_UDP = 16,
23 TCA_CSUM_UPDATE_FLAG_UDPLITE = 32
24};
25
26struct tc_csum {
27 tc_gen;
28
29 __u32 update_flags;
30};
31
32#endif /* __LINUX_TC_CSUM_H */
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 0864206ec1a3..7138962664f8 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -79,6 +79,7 @@ enum {
79 TCF_META_ID_SK_SENDMSG_OFF, 79 TCF_META_ID_SK_SENDMSG_OFF,
80 TCF_META_ID_SK_WRITE_PENDING, 80 TCF_META_ID_SK_WRITE_PENDING,
81 TCF_META_ID_VLAN_TAG, 81 TCF_META_ID_VLAN_TAG,
82 TCF_META_ID_RXHASH,
82 __TCF_META_ID_MAX 83 __TCF_META_ID_MAX
83}; 84};
84#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 85#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index a778ee024590..e64f4c67d0ef 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -105,6 +105,7 @@ enum {
105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ 105#define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */
106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ 106#define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/
107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ 107#define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */
108#define TCP_USER_TIMEOUT 18 /* How long for loss retry before timeout */
108 109
109/* for TCP_INFO socket option */ 110/* for TCP_INFO socket option */
110#define TCPI_OPT_TIMESTAMPS 1 111#define TCPI_OPT_TIMESTAMPS 1
diff --git a/include/linux/spi/wl12xx.h b/include/linux/wl12xx.h
index a223ecbc71ef..95deae3968f4 100644
--- a/include/linux/spi/wl12xx.h
+++ b/include/linux/wl12xx.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Nokia Corporation 4 * Copyright (C) 2009 Nokia Corporation
5 * 5 *
6 * Contact: Kalle Valo <kalle.valo@nokia.com> 6 * Contact: Luciano Coelho <luciano.coelho@nokia.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or 8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License 9 * modify it under the terms of the GNU General Public License
@@ -21,14 +21,18 @@
21 * 21 *
22 */ 22 */
23 23
24#ifndef _LINUX_SPI_WL12XX_H 24#ifndef _LINUX_WL12XX_H
25#define _LINUX_SPI_WL12XX_H 25#define _LINUX_WL12XX_H
26 26
27struct wl12xx_platform_data { 27struct wl12xx_platform_data {
28 void (*set_power)(bool enable); 28 void (*set_power)(bool enable);
29 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */ 29 /* SDIO only: IRQ number if WLAN_IRQ line is used, 0 for SDIO IRQs */
30 int irq; 30 int irq;
31 bool use_eeprom; 31 bool use_eeprom;
32 int board_ref_clock;
32}; 33};
33 34
35int wl12xx_set_platform_data(const struct wl12xx_platform_data *data);
36const struct wl12xx_platform_data *wl12xx_get_platform_data(void);
37
34#endif 38#endif
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 4d40c4d0230b..958d2749b7a9 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -175,20 +175,32 @@ extern int ipv6_chk_acast_addr(struct net *net, struct net_device *dev,
175extern int register_inet6addr_notifier(struct notifier_block *nb); 175extern int register_inet6addr_notifier(struct notifier_block *nb);
176extern int unregister_inet6addr_notifier(struct notifier_block *nb); 176extern int unregister_inet6addr_notifier(struct notifier_block *nb);
177 177
178static inline struct inet6_dev * 178/**
179__in6_dev_get(struct net_device *dev) 179 * __in6_dev_get - get inet6_dev pointer from netdevice
180 * @dev: network device
181 *
182 * Caller must hold rcu_read_lock or RTNL, because this function
183 * does not take a reference on the inet6_dev.
184 */
185static inline struct inet6_dev *__in6_dev_get(const struct net_device *dev)
180{ 186{
181 return rcu_dereference_check(dev->ip6_ptr, 187 return rcu_dereference_rtnl(dev->ip6_ptr);
182 rcu_read_lock_held() ||
183 lockdep_rtnl_is_held());
184} 188}
185 189
186static inline struct inet6_dev * 190/**
187in6_dev_get(struct net_device *dev) 191 * in6_dev_get - get inet6_dev pointer from netdevice
192 * @dev: network device
193 *
194 * This version can be used in any context, and takes a reference
195 * on the inet6_dev. Callers must use in6_dev_put() later to
196 * release this reference.
197 */
198static inline struct inet6_dev *in6_dev_get(const struct net_device *dev)
188{ 199{
189 struct inet6_dev *idev = NULL; 200 struct inet6_dev *idev;
201
190 rcu_read_lock(); 202 rcu_read_lock();
191 idev = __in6_dev_get(dev); 203 idev = rcu_dereference(dev->ip6_ptr);
192 if (idev) 204 if (idev)
193 atomic_inc(&idev->refcnt); 205 atomic_inc(&idev->refcnt);
194 rcu_read_unlock(); 206 rcu_read_unlock();
@@ -197,16 +209,21 @@ in6_dev_get(struct net_device *dev)
197 209
198extern void in6_dev_finish_destroy(struct inet6_dev *idev); 210extern void in6_dev_finish_destroy(struct inet6_dev *idev);
199 211
200static inline void 212static inline void in6_dev_put(struct inet6_dev *idev)
201in6_dev_put(struct inet6_dev *idev)
202{ 213{
203 if (atomic_dec_and_test(&idev->refcnt)) 214 if (atomic_dec_and_test(&idev->refcnt))
204 in6_dev_finish_destroy(idev); 215 in6_dev_finish_destroy(idev);
205} 216}
206 217
207#define __in6_dev_put(idev) atomic_dec(&(idev)->refcnt) 218static inline void __in6_dev_put(struct inet6_dev *idev)
208#define in6_dev_hold(idev) atomic_inc(&(idev)->refcnt) 219{
220 atomic_dec(&idev->refcnt);
221}
209 222
223static inline void in6_dev_hold(struct inet6_dev *idev)
224{
225 atomic_inc(&idev->refcnt);
226}
210 227
211extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); 228extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp);
212 229
@@ -216,9 +233,15 @@ static inline void in6_ifa_put(struct inet6_ifaddr *ifp)
216 inet6_ifa_finish_destroy(ifp); 233 inet6_ifa_finish_destroy(ifp);
217} 234}
218 235
219#define __in6_ifa_put(ifp) atomic_dec(&(ifp)->refcnt) 236static inline void __in6_ifa_put(struct inet6_ifaddr *ifp)
220#define in6_ifa_hold(ifp) atomic_inc(&(ifp)->refcnt) 237{
238 atomic_dec(&ifp->refcnt);
239}
221 240
241static inline void in6_ifa_hold(struct inet6_ifaddr *ifp)
242{
243 atomic_inc(&ifp->refcnt);
244}
222 245
223 246
224/* 247/*
@@ -241,23 +264,23 @@ static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
241 264
242static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) 265static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
243{ 266{
244 return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | 267 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
245 addr->s6_addr32[1] | addr->s6_addr32[2] | 268 addr->s6_addr32[1] | addr->s6_addr32[2] |
246 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0); 269 (addr->s6_addr32[3] ^ htonl(0x00000001))) == 0;
247} 270}
248 271
249static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) 272static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr)
250{ 273{
251 return (((addr->s6_addr32[0] ^ htonl(0xff020000)) | 274 return ((addr->s6_addr32[0] ^ htonl(0xff020000)) |
252 addr->s6_addr32[1] | addr->s6_addr32[2] | 275 addr->s6_addr32[1] | addr->s6_addr32[2] |
253 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0); 276 (addr->s6_addr32[3] ^ htonl(0x00000002))) == 0;
254} 277}
255 278
256extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr); 279extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr);
257 280
258static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) 281static inline int ipv6_addr_is_isatap(const struct in6_addr *addr)
259{ 282{
260 return ((addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE)); 283 return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE);
261} 284}
262 285
263#ifdef CONFIG_PROC_FS 286#ifdef CONFIG_PROC_FS
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 4568b938ca35..ebec8c9a929d 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -233,7 +233,7 @@ static inline void inquiry_cache_init(struct hci_dev *hdev)
233static inline int inquiry_cache_empty(struct hci_dev *hdev) 233static inline int inquiry_cache_empty(struct hci_dev *hdev)
234{ 234{
235 struct inquiry_cache *c = &hdev->inq_cache; 235 struct inquiry_cache *c = &hdev->inq_cache;
236 return (c->list == NULL); 236 return c->list == NULL;
237} 237}
238 238
239static inline long inquiry_cache_age(struct hci_dev *hdev) 239static inline long inquiry_cache_age(struct hci_dev *hdev)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 6c241444f902..c819c8bf9b68 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -414,7 +414,7 @@ static inline int l2cap_tx_window_full(struct sock *sk)
414 if (sub < 0) 414 if (sub < 0)
415 sub += 64; 415 sub += 64;
416 416
417 return (sub == pi->remote_tx_win); 417 return sub == pi->remote_tx_win;
418} 418}
419 419
420#define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1 420#define __get_txseq(ctrl) ((ctrl) & L2CAP_CTRL_TXSEQ) >> 1
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 2fd06c60ffbb..a0613ff62c97 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -25,6 +25,43 @@
25#include <linux/wireless.h> 25#include <linux/wireless.h>
26 26
27 27
28/**
29 * DOC: Introduction
30 *
31 * cfg80211 is the configuration API for 802.11 devices in Linux. It bridges
32 * userspace and drivers, and offers some utility functionality associated
33 * with 802.11. cfg80211 must, directly or indirectly via mac80211, be used
34 * by all modern wireless drivers in Linux, so that they offer a consistent
35 * API through nl80211. For backward compatibility, cfg80211 also offers
36 * wireless extensions to userspace, but hides them from drivers completely.
37 *
38 * Additionally, cfg80211 contains code to help enforce regulatory spectrum
39 * use restrictions.
40 */
41
42
43/**
44 * DOC: Device registration
45 *
46 * In order for a driver to use cfg80211, it must register the hardware device
47 * with cfg80211. This happens through a number of hardware capability structs
48 * described below.
49 *
50 * The fundamental structure for each device is the 'wiphy', of which each
51 * instance describes a physical wireless device connected to the system. Each
52 * such wiphy can have zero, one, or many virtual interfaces associated with
53 * it, which need to be identified as such by pointing the network interface's
54 * @ieee80211_ptr pointer to a &struct wireless_dev which further describes
55 * the wireless part of the interface, normally this struct is embedded in the
56 * network interface's private data area. Drivers can optionally allow creating
57 * or destroying virtual interfaces on the fly, but without at least one or the
58 * ability to create some the wireless device isn't useful.
59 *
60 * Each wiphy structure contains device capability information, and also has
61 * a pointer to the various operations the driver offers. The definitions and
62 * structures here describe these capabilities in detail.
63 */
64
28/* 65/*
29 * wireless hardware capability structures 66 * wireless hardware capability structures
30 */ 67 */
@@ -205,6 +242,21 @@ struct ieee80211_supported_band {
205 */ 242 */
206 243
207/** 244/**
245 * DOC: Actions and configuration
246 *
247 * Each wireless device and each virtual interface offer a set of configuration
248 * operations and other actions that are invoked by userspace. Each of these
249 * actions is described in the operations structure, and the parameters these
250 * operations use are described separately.
251 *
252 * Additionally, some operations are asynchronous and expect to get status
253 * information via some functions that drivers need to call.
254 *
255 * Scanning and BSS list handling with its associated functionality is described
256 * in a separate chapter.
257 */
258
259/**
208 * struct vif_params - describes virtual interface parameters 260 * struct vif_params - describes virtual interface parameters
209 * @mesh_id: mesh ID to use 261 * @mesh_id: mesh ID to use
210 * @mesh_id_len: length of the mesh ID 262 * @mesh_id_len: length of the mesh ID
@@ -570,8 +622,28 @@ struct ieee80211_txq_params {
570/* from net/wireless.h */ 622/* from net/wireless.h */
571struct wiphy; 623struct wiphy;
572 624
573/* from net/ieee80211.h */ 625/**
574struct ieee80211_channel; 626 * DOC: Scanning and BSS list handling
627 *
628 * The scanning process itself is fairly simple, but cfg80211 offers quite
629 * a bit of helper functionality. To start a scan, the scan operation will
630 * be invoked with a scan definition. This scan definition contains the
631 * channels to scan, and the SSIDs to send probe requests for (including the
632 * wildcard, if desired). A passive scan is indicated by having no SSIDs to
633 * probe. Additionally, a scan request may contain extra information elements
634 * that should be added to the probe request. The IEs are guaranteed to be
635 * well-formed, and will not exceed the maximum length the driver advertised
636 * in the wiphy structure.
637 *
638 * When scanning finds a BSS, cfg80211 needs to be notified of that, because
639 * it is responsible for maintaining the BSS list; the driver should not
640 * maintain a list itself. For this notification, various functions exist.
641 *
642 * Since drivers do not maintain a BSS list, there are also a number of
643 * functions to search for a BSS and obtain information about it from the
644 * BSS structure cfg80211 maintains. The BSS list is also made available
645 * to userspace.
646 */
575 647
576/** 648/**
577 * struct cfg80211_ssid - SSID description 649 * struct cfg80211_ssid - SSID description
@@ -691,6 +763,10 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie);
691 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is 763 * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is
692 * required to assume that the port is unauthorized until authorized by 764 * required to assume that the port is unauthorized until authorized by
693 * user space. Otherwise, port is marked authorized by default. 765 * user space. Otherwise, port is marked authorized by default.
766 * @control_port_ethertype: the control port protocol that should be
767 * allowed through even on unauthorized ports
768 * @control_port_no_encrypt: TRUE to prevent encryption of control port
769 * protocol frames.
694 */ 770 */
695struct cfg80211_crypto_settings { 771struct cfg80211_crypto_settings {
696 u32 wpa_versions; 772 u32 wpa_versions;
@@ -700,6 +776,8 @@ struct cfg80211_crypto_settings {
700 int n_akm_suites; 776 int n_akm_suites;
701 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; 777 u32 akm_suites[NL80211_MAX_NR_AKM_SUITES];
702 bool control_port; 778 bool control_port;
779 __be16 control_port_ethertype;
780 bool control_port_no_encrypt;
703}; 781};
704 782
705/** 783/**
@@ -1020,7 +1098,7 @@ struct cfg80211_pmksa {
1020 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. 1098 * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation.
1021 * This allows the operation to be terminated prior to timeout based on 1099 * This allows the operation to be terminated prior to timeout based on
1022 * the duration value. 1100 * the duration value.
1023 * @action: Transmit an action frame 1101 * @mgmt_tx: Transmit a management frame
1024 * 1102 *
1025 * @testmode_cmd: run a test mode command 1103 * @testmode_cmd: run a test mode command
1026 * 1104 *
@@ -1172,7 +1250,7 @@ struct cfg80211_ops {
1172 struct net_device *dev, 1250 struct net_device *dev,
1173 u64 cookie); 1251 u64 cookie);
1174 1252
1175 int (*action)(struct wiphy *wiphy, struct net_device *dev, 1253 int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev,
1176 struct ieee80211_channel *chan, 1254 struct ieee80211_channel *chan,
1177 enum nl80211_channel_type channel_type, 1255 enum nl80211_channel_type channel_type,
1178 bool channel_type_valid, 1256 bool channel_type_valid,
@@ -1221,21 +1299,29 @@ struct cfg80211_ops {
1221 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station 1299 * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station
1222 * on a VLAN interface) 1300 * on a VLAN interface)
1223 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station 1301 * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station
1302 * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the
1303 * control port protocol ethertype. The device also honours the
1304 * control_port_no_encrypt flag.
1224 */ 1305 */
1225enum wiphy_flags { 1306enum wiphy_flags {
1226 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1307 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
1227 WIPHY_FLAG_STRICT_REGULATORY = BIT(1), 1308 WIPHY_FLAG_STRICT_REGULATORY = BIT(1),
1228 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), 1309 WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2),
1229 WIPHY_FLAG_NETNS_OK = BIT(3), 1310 WIPHY_FLAG_NETNS_OK = BIT(3),
1230 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), 1311 WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4),
1231 WIPHY_FLAG_4ADDR_AP = BIT(5), 1312 WIPHY_FLAG_4ADDR_AP = BIT(5),
1232 WIPHY_FLAG_4ADDR_STATION = BIT(6), 1313 WIPHY_FLAG_4ADDR_STATION = BIT(6),
1314 WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7),
1233}; 1315};
1234 1316
1235struct mac_address { 1317struct mac_address {
1236 u8 addr[ETH_ALEN]; 1318 u8 addr[ETH_ALEN];
1237}; 1319};
1238 1320
1321struct ieee80211_txrx_stypes {
1322 u16 tx, rx;
1323};
1324
1239/** 1325/**
1240 * struct wiphy - wireless hardware description 1326 * struct wiphy - wireless hardware description
1241 * @reg_notifier: the driver's regulatory notification callback 1327 * @reg_notifier: the driver's regulatory notification callback
@@ -1286,6 +1372,10 @@ struct mac_address {
1286 * @privid: a pointer that drivers can use to identify if an arbitrary 1372 * @privid: a pointer that drivers can use to identify if an arbitrary
1287 * wiphy is theirs, e.g. in global notifiers 1373 * wiphy is theirs, e.g. in global notifiers
1288 * @bands: information about bands/channels supported by this device 1374 * @bands: information about bands/channels supported by this device
1375 *
1376 * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or
1377 * transmitted through nl80211, points to an array indexed by interface
1378 * type
1289 */ 1379 */
1290struct wiphy { 1380struct wiphy {
1291 /* assign these fields before you register the wiphy */ 1381 /* assign these fields before you register the wiphy */
@@ -1294,9 +1384,12 @@ struct wiphy {
1294 u8 perm_addr[ETH_ALEN]; 1384 u8 perm_addr[ETH_ALEN];
1295 u8 addr_mask[ETH_ALEN]; 1385 u8 addr_mask[ETH_ALEN];
1296 1386
1297 u16 n_addresses;
1298 struct mac_address *addresses; 1387 struct mac_address *addresses;
1299 1388
1389 const struct ieee80211_txrx_stypes *mgmt_stypes;
1390
1391 u16 n_addresses;
1392
1300 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 1393 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
1301 u16 interface_modes; 1394 u16 interface_modes;
1302 1395
@@ -1492,8 +1585,8 @@ struct cfg80211_cached_keys;
1492 * set by driver (if supported) on add_interface BEFORE registering the 1585 * set by driver (if supported) on add_interface BEFORE registering the
1493 * netdev and may otherwise be used by driver read-only, will be update 1586 * netdev and may otherwise be used by driver read-only, will be update
1494 * by cfg80211 on change_interface 1587 * by cfg80211 on change_interface
1495 * @action_registrations: list of registrations for action frames 1588 * @mgmt_registrations: list of registrations for management frames
1496 * @action_registrations_lock: lock for the list 1589 * @mgmt_registrations_lock: lock for the list
1497 * @mtx: mutex used to lock data in this struct 1590 * @mtx: mutex used to lock data in this struct
1498 * @cleanup_work: work struct used for cleanup that can't be done directly 1591 * @cleanup_work: work struct used for cleanup that can't be done directly
1499 */ 1592 */
@@ -1505,8 +1598,8 @@ struct wireless_dev {
1505 struct list_head list; 1598 struct list_head list;
1506 struct net_device *netdev; 1599 struct net_device *netdev;
1507 1600
1508 struct list_head action_registrations; 1601 struct list_head mgmt_registrations;
1509 spinlock_t action_registrations_lock; 1602 spinlock_t mgmt_registrations_lock;
1510 1603
1511 struct mutex mtx; 1604 struct mutex mtx;
1512 1605
@@ -1563,8 +1656,10 @@ static inline void *wdev_priv(struct wireless_dev *wdev)
1563 return wiphy_priv(wdev->wiphy); 1656 return wiphy_priv(wdev->wiphy);
1564} 1657}
1565 1658
1566/* 1659/**
1567 * Utility functions 1660 * DOC: Utility functions
1661 *
1662 * cfg80211 offers a number of utility functions that can be useful.
1568 */ 1663 */
1569 1664
1570/** 1665/**
@@ -1715,7 +1810,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1715 * ieee80211_hdrlen - get header length in bytes from frame control 1810 * ieee80211_hdrlen - get header length in bytes from frame control
1716 * @fc: frame control field in little-endian format 1811 * @fc: frame control field in little-endian format
1717 */ 1812 */
1718unsigned int ieee80211_hdrlen(__le16 fc); 1813unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc);
1814
1815/**
1816 * DOC: Data path helpers
1817 *
1818 * In addition to generic utilities, cfg80211 also offers
1819 * functions that help implement the data path for devices
1820 * that do not do the 802.11/802.3 conversion on the device.
1821 */
1719 1822
1720/** 1823/**
1721 * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 1824 * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3
@@ -1777,8 +1880,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb);
1777 */ 1880 */
1778const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); 1881const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len);
1779 1882
1780/* 1883/**
1781 * Regulatory helper functions for wiphys 1884 * DOC: Regulatory enforcement infrastructure
1885 *
1886 * TODO
1782 */ 1887 */
1783 1888
1784/** 1889/**
@@ -2181,6 +2286,20 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr,
2181void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); 2286void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp);
2182 2287
2183/** 2288/**
2289 * DOC: RFkill integration
2290 *
2291 * RFkill integration in cfg80211 is almost invisible to drivers,
2292 * as cfg80211 automatically registers an rfkill instance for each
2293 * wireless device it knows about. Soft kill is also translated
2294 * into disconnecting and turning all interfaces off, drivers are
2295 * expected to turn off the device when all interfaces are down.
2296 *
2297 * However, devices may have a hard RFkill line, in which case they
2298 * also need to interact with the rfkill subsystem, via cfg80211.
2299 * They can do this with a few helper functions documented here.
2300 */
2301
2302/**
2184 * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state 2303 * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state
2185 * @wiphy: the wiphy 2304 * @wiphy: the wiphy
2186 * @blocked: block status 2305 * @blocked: block status
@@ -2201,6 +2320,17 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy);
2201 2320
2202#ifdef CONFIG_NL80211_TESTMODE 2321#ifdef CONFIG_NL80211_TESTMODE
2203/** 2322/**
2323 * DOC: Test mode
2324 *
2325 * Test mode is a set of utility functions to allow drivers to
2326 * interact with driver-specific tools to aid, for instance,
2327 * factory programming.
2328 *
2329 * This chapter describes how drivers interact with it, for more
2330 * information see the nl80211 book's chapter on it.
2331 */
2332
2333/**
2204 * cfg80211_testmode_alloc_reply_skb - allocate testmode reply 2334 * cfg80211_testmode_alloc_reply_skb - allocate testmode reply
2205 * @wiphy: the wiphy 2335 * @wiphy: the wiphy
2206 * @approxlen: an upper bound of the length of the data that will 2336 * @approxlen: an upper bound of the length of the data that will
@@ -2373,38 +2503,39 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr,
2373 struct station_info *sinfo, gfp_t gfp); 2503 struct station_info *sinfo, gfp_t gfp);
2374 2504
2375/** 2505/**
2376 * cfg80211_rx_action - notification of received, unprocessed Action frame 2506 * cfg80211_rx_mgmt - notification of received, unprocessed management frame
2377 * @dev: network device 2507 * @dev: network device
2378 * @freq: Frequency on which the frame was received in MHz 2508 * @freq: Frequency on which the frame was received in MHz
2379 * @buf: Action frame (header + body) 2509 * @buf: Management frame (header + body)
2380 * @len: length of the frame data 2510 * @len: length of the frame data
2381 * @gfp: context flags 2511 * @gfp: context flags
2382 * Returns %true if a user space application is responsible for rejecting the 2512 *
2383 * unrecognized Action frame; %false if no such application is registered 2513 * Returns %true if a user space application has registered for this frame.
2384 * (i.e., the driver is responsible for rejecting the unrecognized Action 2514 * For action frames, that makes it responsible for rejecting unrecognized
2385 * frame) 2515 * action frames; %false otherwise, in which case for action frames the
2516 * driver is responsible for rejecting the frame.
2386 * 2517 *
2387 * This function is called whenever an Action frame is received for a station 2518 * This function is called whenever an Action frame is received for a station
2388 * mode interface, but is not processed in kernel. 2519 * mode interface, but is not processed in kernel.
2389 */ 2520 */
2390bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, 2521bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf,
2391 size_t len, gfp_t gfp); 2522 size_t len, gfp_t gfp);
2392 2523
2393/** 2524/**
2394 * cfg80211_action_tx_status - notification of TX status for Action frame 2525 * cfg80211_mgmt_tx_status - notification of TX status for management frame
2395 * @dev: network device 2526 * @dev: network device
2396 * @cookie: Cookie returned by cfg80211_ops::action() 2527 * @cookie: Cookie returned by cfg80211_ops::mgmt_tx()
2397 * @buf: Action frame (header + body) 2528 * @buf: Management frame (header + body)
2398 * @len: length of the frame data 2529 * @len: length of the frame data
2399 * @ack: Whether frame was acknowledged 2530 * @ack: Whether frame was acknowledged
2400 * @gfp: context flags 2531 * @gfp: context flags
2401 * 2532 *
2402 * This function is called whenever an Action frame was requested to be 2533 * This function is called whenever a management frame was requested to be
2403 * transmitted with cfg80211_ops::action() to report the TX status of the 2534 * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the
2404 * transmission attempt. 2535 * transmission attempt.
2405 */ 2536 */
2406void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, 2537void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie,
2407 const u8 *buf, size_t len, bool ack, gfp_t gfp); 2538 const u8 *buf, size_t len, bool ack, gfp_t gfp);
2408 2539
2409 2540
2410/** 2541/**
@@ -2427,49 +2558,36 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
2427/* wiphy_printk helpers, similar to dev_printk */ 2558/* wiphy_printk helpers, similar to dev_printk */
2428 2559
2429#define wiphy_printk(level, wiphy, format, args...) \ 2560#define wiphy_printk(level, wiphy, format, args...) \
2430 printk(level "%s: " format, wiphy_name(wiphy), ##args) 2561 dev_printk(level, &(wiphy)->dev, format, ##args)
2431#define wiphy_emerg(wiphy, format, args...) \ 2562#define wiphy_emerg(wiphy, format, args...) \
2432 wiphy_printk(KERN_EMERG, wiphy, format, ##args) 2563 dev_emerg(&(wiphy)->dev, format, ##args)
2433#define wiphy_alert(wiphy, format, args...) \ 2564#define wiphy_alert(wiphy, format, args...) \
2434 wiphy_printk(KERN_ALERT, wiphy, format, ##args) 2565 dev_alert(&(wiphy)->dev, format, ##args)
2435#define wiphy_crit(wiphy, format, args...) \ 2566#define wiphy_crit(wiphy, format, args...) \
2436 wiphy_printk(KERN_CRIT, wiphy, format, ##args) 2567 dev_crit(&(wiphy)->dev, format, ##args)
2437#define wiphy_err(wiphy, format, args...) \ 2568#define wiphy_err(wiphy, format, args...) \
2438 wiphy_printk(KERN_ERR, wiphy, format, ##args) 2569 dev_err(&(wiphy)->dev, format, ##args)
2439#define wiphy_warn(wiphy, format, args...) \ 2570#define wiphy_warn(wiphy, format, args...) \
2440 wiphy_printk(KERN_WARNING, wiphy, format, ##args) 2571 dev_warn(&(wiphy)->dev, format, ##args)
2441#define wiphy_notice(wiphy, format, args...) \ 2572#define wiphy_notice(wiphy, format, args...) \
2442 wiphy_printk(KERN_NOTICE, wiphy, format, ##args) 2573 dev_notice(&(wiphy)->dev, format, ##args)
2443#define wiphy_info(wiphy, format, args...) \ 2574#define wiphy_info(wiphy, format, args...) \
2444 wiphy_printk(KERN_INFO, wiphy, format, ##args) 2575 dev_info(&(wiphy)->dev, format, ##args)
2445
2446int wiphy_debug(const struct wiphy *wiphy, const char *format, ...)
2447 __attribute__ ((format (printf, 2, 3)));
2448 2576
2449#if defined(DEBUG) 2577#define wiphy_debug(wiphy, format, args...) \
2450#define wiphy_dbg(wiphy, format, args...) \
2451 wiphy_printk(KERN_DEBUG, wiphy, format, ##args) 2578 wiphy_printk(KERN_DEBUG, wiphy, format, ##args)
2452#elif defined(CONFIG_DYNAMIC_DEBUG) 2579
2453#define wiphy_dbg(wiphy, format, args...) \ 2580#define wiphy_dbg(wiphy, format, args...) \
2454 dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) 2581 dev_dbg(&(wiphy)->dev, format, ##args)
2455#else
2456#define wiphy_dbg(wiphy, format, args...) \
2457({ \
2458 if (0) \
2459 wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \
2460 0; \
2461})
2462#endif
2463 2582
2464#if defined(VERBOSE_DEBUG) 2583#if defined(VERBOSE_DEBUG)
2465#define wiphy_vdbg wiphy_dbg 2584#define wiphy_vdbg wiphy_dbg
2466#else 2585#else
2467
2468#define wiphy_vdbg(wiphy, format, args...) \ 2586#define wiphy_vdbg(wiphy, format, args...) \
2469({ \ 2587({ \
2470 if (0) \ 2588 if (0) \
2471 wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ 2589 wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \
2472 0; \ 2590 0; \
2473}) 2591})
2474#endif 2592#endif
2475 2593
diff --git a/include/net/gre.h b/include/net/gre.h
new file mode 100644
index 000000000000..82665474bcb7
--- /dev/null
+++ b/include/net/gre.h
@@ -0,0 +1,18 @@
1#ifndef __LINUX_GRE_H
2#define __LINUX_GRE_H
3
4#include <linux/skbuff.h>
5
6#define GREPROTO_CISCO 0
7#define GREPROTO_PPTP 1
8#define GREPROTO_MAX 2
9
10struct gre_protocol {
11 int (*handler)(struct sk_buff *skb);
12 void (*err_handler)(struct sk_buff *skb, u32 info);
13};
14
15int gre_add_protocol(const struct gre_protocol *proto, u8 version);
16int gre_del_protocol(const struct gre_protocol *proto, u8 version);
17
18#endif
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index b6d3b55da19b..e4f494b42e06 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -125,6 +125,7 @@ struct inet_connection_sock {
125 int probe_size; 125 int probe_size;
126 } icsk_mtup; 126 } icsk_mtup;
127 u32 icsk_ca_priv[16]; 127 u32 icsk_ca_priv[16];
128 u32 icsk_user_timeout;
128#define ICSK_CA_PRIV_SIZE (16 * sizeof(u32)) 129#define ICSK_CA_PRIV_SIZE (16 * sizeof(u32))
129}; 130};
130 131
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 9b5d08f4f6e8..88bdd010d65d 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -27,7 +27,7 @@ static inline int INET_ECN_is_not_ect(__u8 dsfield)
27 27
28static inline int INET_ECN_is_capable(__u8 dsfield) 28static inline int INET_ECN_is_capable(__u8 dsfield)
29{ 29{
30 return (dsfield & INET_ECN_ECT_0); 30 return dsfield & INET_ECN_ECT_0;
31} 31}
32 32
33static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) 33static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
diff --git a/include/net/ip.h b/include/net/ip.h
index 890f9725d681..dbee3fe260e1 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -53,7 +53,7 @@ struct ipcm_cookie {
53 __be32 addr; 53 __be32 addr;
54 int oif; 54 int oif;
55 struct ip_options *opt; 55 struct ip_options *opt;
56 union skb_shared_tx shtx; 56 __u8 tx_flags;
57}; 57};
58 58
59#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) 59#define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb))
@@ -238,9 +238,9 @@ int ip_decrease_ttl(struct iphdr *iph)
238static inline 238static inline
239int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) 239int ip_dont_fragment(struct sock *sk, struct dst_entry *dst)
240{ 240{
241 return (inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO || 241 return inet_sk(sk)->pmtudisc == IP_PMTUDISC_DO ||
242 (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT && 242 (inet_sk(sk)->pmtudisc == IP_PMTUDISC_WANT &&
243 !(dst_metric_locked(dst, RTAX_MTU)))); 243 !(dst_metric_locked(dst, RTAX_MTU)));
244} 244}
245 245
246extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); 246extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 1f8412410998..4a3cd2cd2f5e 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -262,7 +262,7 @@ static inline int ipv6_addr_scope(const struct in6_addr *addr)
262 262
263static inline int __ipv6_addr_src_scope(int type) 263static inline int __ipv6_addr_src_scope(int type)
264{ 264{
265 return (type == IPV6_ADDR_ANY ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16)); 265 return (type == IPV6_ADDR_ANY) ? __IPV6_ADDR_SCOPE_INVALID : (type >> 16);
266} 266}
267 267
268static inline int ipv6_addr_src_scope(const struct in6_addr *addr) 268static inline int ipv6_addr_src_scope(const struct in6_addr *addr)
@@ -279,10 +279,10 @@ static inline int
279ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, 279ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m,
280 const struct in6_addr *a2) 280 const struct in6_addr *a2)
281{ 281{
282 return (!!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) | 282 return !!(((a1->s6_addr32[0] ^ a2->s6_addr32[0]) & m->s6_addr32[0]) |
283 ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) | 283 ((a1->s6_addr32[1] ^ a2->s6_addr32[1]) & m->s6_addr32[1]) |
284 ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) | 284 ((a1->s6_addr32[2] ^ a2->s6_addr32[2]) & m->s6_addr32[2]) |
285 ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]))); 285 ((a1->s6_addr32[3] ^ a2->s6_addr32[3]) & m->s6_addr32[3]));
286} 286}
287 287
288static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) 288static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2)
@@ -317,10 +317,10 @@ static inline void ipv6_addr_set(struct in6_addr *addr,
317static inline int ipv6_addr_equal(const struct in6_addr *a1, 317static inline int ipv6_addr_equal(const struct in6_addr *a1,
318 const struct in6_addr *a2) 318 const struct in6_addr *a2)
319{ 319{
320 return (((a1->s6_addr32[0] ^ a2->s6_addr32[0]) | 320 return ((a1->s6_addr32[0] ^ a2->s6_addr32[0]) |
321 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) | 321 (a1->s6_addr32[1] ^ a2->s6_addr32[1]) |
322 (a1->s6_addr32[2] ^ a2->s6_addr32[2]) | 322 (a1->s6_addr32[2] ^ a2->s6_addr32[2]) |
323 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0); 323 (a1->s6_addr32[3] ^ a2->s6_addr32[3])) == 0;
324} 324}
325 325
326static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, 326static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2,
@@ -373,20 +373,20 @@ int ip6_frag_match(struct inet_frag_queue *q, void *a);
373 373
374static inline int ipv6_addr_any(const struct in6_addr *a) 374static inline int ipv6_addr_any(const struct in6_addr *a)
375{ 375{
376 return ((a->s6_addr32[0] | a->s6_addr32[1] | 376 return (a->s6_addr32[0] | a->s6_addr32[1] |
377 a->s6_addr32[2] | a->s6_addr32[3] ) == 0); 377 a->s6_addr32[2] | a->s6_addr32[3]) == 0;
378} 378}
379 379
380static inline int ipv6_addr_loopback(const struct in6_addr *a) 380static inline int ipv6_addr_loopback(const struct in6_addr *a)
381{ 381{
382 return ((a->s6_addr32[0] | a->s6_addr32[1] | 382 return (a->s6_addr32[0] | a->s6_addr32[1] |
383 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0); 383 a->s6_addr32[2] | (a->s6_addr32[3] ^ htonl(1))) == 0;
384} 384}
385 385
386static inline int ipv6_addr_v4mapped(const struct in6_addr *a) 386static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
387{ 387{
388 return ((a->s6_addr32[0] | a->s6_addr32[1] | 388 return (a->s6_addr32[0] | a->s6_addr32[1] |
389 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0); 389 (a->s6_addr32[2] ^ htonl(0x0000ffff))) == 0;
390} 390}
391 391
392/* 392/*
@@ -395,8 +395,7 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
395 */ 395 */
396static inline int ipv6_addr_orchid(const struct in6_addr *a) 396static inline int ipv6_addr_orchid(const struct in6_addr *a)
397{ 397{
398 return ((a->s6_addr32[0] & htonl(0xfffffff0)) 398 return (a->s6_addr32[0] & htonl(0xfffffff0)) == htonl(0x20010010);
399 == htonl(0x20010010));
400} 399}
401 400
402static inline void ipv6_addr_set_v4mapped(const __be32 addr, 401static inline void ipv6_addr_set_v4mapped(const __be32 addr,
@@ -441,7 +440,7 @@ static inline int __ipv6_addr_diff(const void *token1, const void *token2, int a
441 * if returned value is greater than prefix length. 440 * if returned value is greater than prefix length.
442 * --ANK (980803) 441 * --ANK (980803)
443 */ 442 */
444 return (addrlen << 5); 443 return addrlen << 5;
445} 444}
446 445
447static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) 446static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2)
diff --git a/include/net/irda/irlan_common.h b/include/net/irda/irlan_common.h
index 73cacb3ac16c..0af8b8dfbc22 100644
--- a/include/net/irda/irlan_common.h
+++ b/include/net/irda/irlan_common.h
@@ -171,7 +171,6 @@ struct irlan_cb {
171 int magic; 171 int magic;
172 struct list_head dev_list; 172 struct list_head dev_list;
173 struct net_device *dev; /* Ethernet device structure*/ 173 struct net_device *dev; /* Ethernet device structure*/
174 struct net_device_stats stats;
175 174
176 __u32 saddr; /* Source device address */ 175 __u32 saddr; /* Source device address */
177 __u32 daddr; /* Destination device address */ 176 __u32 daddr; /* Destination device address */
diff --git a/include/net/irda/irlan_event.h b/include/net/irda/irlan_event.h
index 6d9539f05806..018b5a77e610 100644
--- a/include/net/irda/irlan_event.h
+++ b/include/net/irda/irlan_event.h
@@ -67,7 +67,7 @@ typedef enum {
67 IRLAN_WATCHDOG_TIMEOUT, 67 IRLAN_WATCHDOG_TIMEOUT,
68} IRLAN_EVENT; 68} IRLAN_EVENT;
69 69
70extern char *irlan_state[]; 70extern const char * const irlan_state[];
71 71
72void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, 72void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event,
73 struct sk_buff *skb); 73 struct sk_buff *skb);
diff --git a/include/net/irda/irlap.h b/include/net/irda/irlap.h
index 9d0c78ea92f5..17fcd964f9d9 100644
--- a/include/net/irda/irlap.h
+++ b/include/net/irda/irlap.h
@@ -282,7 +282,7 @@ static inline int irlap_is_primary(struct irlap_cb *self)
282 default: 282 default:
283 ret = -1; 283 ret = -1;
284 } 284 }
285 return(ret); 285 return ret;
286} 286}
287 287
288/* Clear a pending IrLAP disconnect. - Jean II */ 288/* Clear a pending IrLAP disconnect. - Jean II */
diff --git a/include/net/irda/irlmp.h b/include/net/irda/irlmp.h
index 3ffc1d0f93d6..fff11b7fe8a4 100644
--- a/include/net/irda/irlmp.h
+++ b/include/net/irda/irlmp.h
@@ -274,7 +274,7 @@ static inline int irlmp_lap_tx_queue_full(struct lsap_cb *self)
274 if (self->lap->irlap == NULL) 274 if (self->lap->irlap == NULL)
275 return 0; 275 return 0;
276 276
277 return(IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap) >= LAP_HIGH_THRESHOLD); 277 return IRLAP_GET_TX_QUEUE_LEN(self->lap->irlap) >= LAP_HIGH_THRESHOLD;
278} 278}
279 279
280/* After doing a irlmp_dup(), this get one of the two socket back into 280/* After doing a irlmp_dup(), this get one of the two socket back into
diff --git a/include/net/irda/irttp.h b/include/net/irda/irttp.h
index 11aee7a2972a..af4b87721d13 100644
--- a/include/net/irda/irttp.h
+++ b/include/net/irda/irttp.h
@@ -204,7 +204,7 @@ static inline int irttp_is_primary(struct tsap_cb *self)
204 (self->lsap->lap == NULL) || 204 (self->lsap->lap == NULL) ||
205 (self->lsap->lap->irlap == NULL)) 205 (self->lsap->lap->irlap == NULL))
206 return -2; 206 return -2;
207 return(irlap_is_primary(self->lsap->lap->irlap)); 207 return irlap_is_primary(self->lsap->lap->irlap);
208} 208}
209 209
210#endif /* IRTTP_H */ 210#endif /* IRTTP_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index b0787a1dea90..12a49f0ba32c 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -149,6 +149,7 @@ struct ieee80211_low_level_stats {
149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed. 149 * @BSS_CHANGED_ARP_FILTER: Hardware ARP filter address list or state changed.
150 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note 150 * @BSS_CHANGED_QOS: QoS for this association was enabled/disabled. Note
151 * that it is only ever disabled for station mode. 151 * that it is only ever disabled for station mode.
152 * @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
152 */ 153 */
153enum ieee80211_bss_change { 154enum ieee80211_bss_change {
154 BSS_CHANGED_ASSOC = 1<<0, 155 BSS_CHANGED_ASSOC = 1<<0,
@@ -165,6 +166,7 @@ enum ieee80211_bss_change {
165 BSS_CHANGED_IBSS = 1<<11, 166 BSS_CHANGED_IBSS = 1<<11,
166 BSS_CHANGED_ARP_FILTER = 1<<12, 167 BSS_CHANGED_ARP_FILTER = 1<<12,
167 BSS_CHANGED_QOS = 1<<13, 168 BSS_CHANGED_QOS = 1<<13,
169 BSS_CHANGED_IDLE = 1<<14,
168 170
169 /* when adding here, make sure to change ieee80211_reconfig */ 171 /* when adding here, make sure to change ieee80211_reconfig */
170}; 172};
@@ -223,6 +225,9 @@ enum ieee80211_bss_change {
223 * hardware must not perform any ARP filtering. Note, that the filter will 225 * hardware must not perform any ARP filtering. Note, that the filter will
224 * be enabled also in promiscuous mode. 226 * be enabled also in promiscuous mode.
225 * @qos: This is a QoS-enabled BSS. 227 * @qos: This is a QoS-enabled BSS.
228 * @idle: This interface is idle. There's also a global idle flag in the
229 * hardware config which may be more appropriate depending on what
230 * your driver/device needs to do.
226 */ 231 */
227struct ieee80211_bss_conf { 232struct ieee80211_bss_conf {
228 const u8 *bssid; 233 const u8 *bssid;
@@ -247,6 +252,7 @@ struct ieee80211_bss_conf {
247 u8 arp_addr_cnt; 252 u8 arp_addr_cnt;
248 bool arp_filter_enabled; 253 bool arp_filter_enabled;
249 bool qos; 254 bool qos;
255 bool idle;
250}; 256};
251 257
252/** 258/**
@@ -763,6 +769,8 @@ struct ieee80211_channel_switch {
763 * @bss_conf: BSS configuration for this interface, either our own 769 * @bss_conf: BSS configuration for this interface, either our own
764 * or the BSS we're associated to 770 * or the BSS we're associated to
765 * @addr: address of this interface 771 * @addr: address of this interface
772 * @p2p: indicates whether this AP or STA interface is a p2p
773 * interface, i.e. a GO or p2p-sta respectively
766 * @drv_priv: data area for driver use, will always be aligned to 774 * @drv_priv: data area for driver use, will always be aligned to
767 * sizeof(void *). 775 * sizeof(void *).
768 */ 776 */
@@ -770,6 +778,7 @@ struct ieee80211_vif {
770 enum nl80211_iftype type; 778 enum nl80211_iftype type;
771 struct ieee80211_bss_conf bss_conf; 779 struct ieee80211_bss_conf bss_conf;
772 u8 addr[ETH_ALEN]; 780 u8 addr[ETH_ALEN];
781 bool p2p;
773 /* must be last */ 782 /* must be last */
774 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 783 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
775}; 784};
@@ -783,20 +792,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
783} 792}
784 793
785/** 794/**
786 * enum ieee80211_key_alg - key algorithm
787 * @ALG_WEP: WEP40 or WEP104
788 * @ALG_TKIP: TKIP
789 * @ALG_CCMP: CCMP (AES)
790 * @ALG_AES_CMAC: AES-128-CMAC
791 */
792enum ieee80211_key_alg {
793 ALG_WEP,
794 ALG_TKIP,
795 ALG_CCMP,
796 ALG_AES_CMAC,
797};
798
799/**
800 * enum ieee80211_key_flags - key flags 795 * enum ieee80211_key_flags - key flags
801 * 796 *
802 * These flags are used for communication about keys between the driver 797 * These flags are used for communication about keys between the driver
@@ -833,7 +828,7 @@ enum ieee80211_key_flags {
833 * @hw_key_idx: To be set by the driver, this is the key index the driver 828 * @hw_key_idx: To be set by the driver, this is the key index the driver
834 * wants to be given when a frame is transmitted and needs to be 829 * wants to be given when a frame is transmitted and needs to be
835 * encrypted in hardware. 830 * encrypted in hardware.
836 * @alg: The key algorithm. 831 * @cipher: The key's cipher suite selector.
837 * @flags: key flags, see &enum ieee80211_key_flags. 832 * @flags: key flags, see &enum ieee80211_key_flags.
838 * @keyidx: the key index (0-3) 833 * @keyidx: the key index (0-3)
839 * @keylen: key material length 834 * @keylen: key material length
@@ -846,7 +841,7 @@ enum ieee80211_key_flags {
846 * @iv_len: The IV length for this key type 841 * @iv_len: The IV length for this key type
847 */ 842 */
848struct ieee80211_key_conf { 843struct ieee80211_key_conf {
849 enum ieee80211_key_alg alg; 844 u32 cipher;
850 u8 icv_len; 845 u8 icv_len;
851 u8 iv_len; 846 u8 iv_len;
852 u8 hw_key_idx; 847 u8 hw_key_idx;
@@ -1102,6 +1097,10 @@ enum ieee80211_hw_flags {
1102 * 1097 *
1103 * @max_rates: maximum number of alternate rate retry stages 1098 * @max_rates: maximum number of alternate rate retry stages
1104 * @max_rate_tries: maximum number of tries for each stage 1099 * @max_rate_tries: maximum number of tries for each stage
1100 *
1101 * @napi_weight: weight used for NAPI polling. You must specify an
1102 * appropriate value here if a napi_poll operation is provided
1103 * by your driver.
1105 */ 1104 */
1106struct ieee80211_hw { 1105struct ieee80211_hw {
1107 struct ieee80211_conf conf; 1106 struct ieee80211_conf conf;
@@ -1113,6 +1112,7 @@ struct ieee80211_hw {
1113 int channel_change_time; 1112 int channel_change_time;
1114 int vif_data_size; 1113 int vif_data_size;
1115 int sta_data_size; 1114 int sta_data_size;
1115 int napi_weight;
1116 u16 queues; 1116 u16 queues;
1117 u16 max_listen_interval; 1117 u16 max_listen_interval;
1118 s8 max_signal; 1118 s8 max_signal;
@@ -1245,8 +1245,8 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1245 * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in 1245 * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in
1246 * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused 1246 * IEEE 802.11-2007 section 11.2 is enabled. This is not to be confused
1247 * with hardware wakeup and sleep states. Driver is responsible for waking 1247 * with hardware wakeup and sleep states. Driver is responsible for waking
1248 * up the hardware before issueing commands to the hardware and putting it 1248 * up the hardware before issuing commands to the hardware and putting it
1249 * back to sleep at approriate times. 1249 * back to sleep at appropriate times.
1250 * 1250 *
1251 * When PS is enabled, hardware needs to wakeup for beacons and receive the 1251 * When PS is enabled, hardware needs to wakeup for beacons and receive the
1252 * buffered multicast/broadcast frames after the beacon. Also it must be 1252 * buffered multicast/broadcast frames after the beacon. Also it must be
@@ -1267,7 +1267,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1267 * there's data traffic and still saving significantly power in idle 1267 * there's data traffic and still saving significantly power in idle
1268 * periods. 1268 * periods.
1269 * 1269 *
1270 * Dynamic powersave is supported by simply mac80211 enabling and disabling 1270 * Dynamic powersave is simply supported by mac80211 enabling and disabling
1271 * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS 1271 * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS
1272 * flag and mac80211 will handle everything automatically. Additionally, 1272 * flag and mac80211 will handle everything automatically. Additionally,
1273 * hardware having support for the dynamic PS feature may set the 1273 * hardware having support for the dynamic PS feature may set the
@@ -1540,6 +1540,12 @@ enum ieee80211_ampdu_mlme_action {
1540 * negative error code (which will be seen in userspace.) 1540 * negative error code (which will be seen in userspace.)
1541 * Must be implemented and can sleep. 1541 * Must be implemented and can sleep.
1542 * 1542 *
1543 * @change_interface: Called when a netdevice changes type. This callback
1544 * is optional, but only if it is supported can interface types be
1545 * switched while the interface is UP. The callback may sleep.
1546 * Note that while an interface is being switched, it will not be
1547 * found by the interface iteration callbacks.
1548 *
1543 * @remove_interface: Notifies a driver that an interface is going down. 1549 * @remove_interface: Notifies a driver that an interface is going down.
1544 * The @stop callback is called after this if it is the last interface 1550 * The @stop callback is called after this if it is the last interface
1545 * and no monitor interfaces are present. 1551 * and no monitor interfaces are present.
@@ -1687,6 +1693,8 @@ enum ieee80211_ampdu_mlme_action {
1687 * switch operation for CSAs received from the AP may implement this 1693 * switch operation for CSAs received from the AP may implement this
1688 * callback. They must then call ieee80211_chswitch_done() to indicate 1694 * callback. They must then call ieee80211_chswitch_done() to indicate
1689 * completion of the channel switch. 1695 * completion of the channel switch.
1696 *
1697 * @napi_poll: Poll Rx queue for incoming data frames.
1690 */ 1698 */
1691struct ieee80211_ops { 1699struct ieee80211_ops {
1692 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1700 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1694,6 +1702,9 @@ struct ieee80211_ops {
1694 void (*stop)(struct ieee80211_hw *hw); 1702 void (*stop)(struct ieee80211_hw *hw);
1695 int (*add_interface)(struct ieee80211_hw *hw, 1703 int (*add_interface)(struct ieee80211_hw *hw,
1696 struct ieee80211_vif *vif); 1704 struct ieee80211_vif *vif);
1705 int (*change_interface)(struct ieee80211_hw *hw,
1706 struct ieee80211_vif *vif,
1707 enum nl80211_iftype new_type, bool p2p);
1697 void (*remove_interface)(struct ieee80211_hw *hw, 1708 void (*remove_interface)(struct ieee80211_hw *hw,
1698 struct ieee80211_vif *vif); 1709 struct ieee80211_vif *vif);
1699 int (*config)(struct ieee80211_hw *hw, u32 changed); 1710 int (*config)(struct ieee80211_hw *hw, u32 changed);
@@ -1752,6 +1763,7 @@ struct ieee80211_ops {
1752 void (*flush)(struct ieee80211_hw *hw, bool drop); 1763 void (*flush)(struct ieee80211_hw *hw, bool drop);
1753 void (*channel_switch)(struct ieee80211_hw *hw, 1764 void (*channel_switch)(struct ieee80211_hw *hw,
1754 struct ieee80211_channel_switch *ch_switch); 1765 struct ieee80211_channel_switch *ch_switch);
1766 int (*napi_poll)(struct ieee80211_hw *hw, int budget);
1755}; 1767};
1756 1768
1757/** 1769/**
@@ -1897,6 +1909,22 @@ void ieee80211_free_hw(struct ieee80211_hw *hw);
1897 */ 1909 */
1898void ieee80211_restart_hw(struct ieee80211_hw *hw); 1910void ieee80211_restart_hw(struct ieee80211_hw *hw);
1899 1911
1912/** ieee80211_napi_schedule - schedule NAPI poll
1913 *
1914 * Use this function to schedule NAPI polling on a device.
1915 *
1916 * @hw: the hardware to start polling
1917 */
1918void ieee80211_napi_schedule(struct ieee80211_hw *hw);
1919
1920/** ieee80211_napi_complete - complete NAPI polling
1921 *
1922 * Use this function to finish NAPI polling on a device.
1923 *
1924 * @hw: the hardware to stop polling
1925 */
1926void ieee80211_napi_complete(struct ieee80211_hw *hw);
1927
1900/** 1928/**
1901 * ieee80211_rx - receive frame 1929 * ieee80211_rx - receive frame
1902 * 1930 *
@@ -2252,7 +2280,8 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
2252 * 2280 *
2253 * When hardware scan offload is used (i.e. the hw_scan() callback is 2281 * When hardware scan offload is used (i.e. the hw_scan() callback is
2254 * assigned) this function needs to be called by the driver to notify 2282 * assigned) this function needs to be called by the driver to notify
2255 * mac80211 that the scan finished. 2283 * mac80211 that the scan finished. This function can be called from
2284 * any context, including hardirq context.
2256 * 2285 *
2257 * @hw: the hardware that finished the scan 2286 * @hw: the hardware that finished the scan
2258 * @aborted: set to true if scan was aborted 2287 * @aborted: set to true if scan was aborted
@@ -2267,6 +2296,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted);
2267 * This function allows the iterator function to sleep, when the iterator 2296 * This function allows the iterator function to sleep, when the iterator
2268 * function is atomic @ieee80211_iterate_active_interfaces_atomic can 2297 * function is atomic @ieee80211_iterate_active_interfaces_atomic can
2269 * be used. 2298 * be used.
2299 * Does not iterate over a new interface during add_interface()
2270 * 2300 *
2271 * @hw: the hardware struct of which the interfaces should be iterated over 2301 * @hw: the hardware struct of which the interfaces should be iterated over
2272 * @iterator: the iterator function to call 2302 * @iterator: the iterator function to call
@@ -2284,6 +2314,7 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
2284 * hardware that are currently active and calls the callback for them. 2314 * hardware that are currently active and calls the callback for them.
2285 * This function requires the iterator callback function to be atomic, 2315 * This function requires the iterator callback function to be atomic,
2286 * if that is not desired, use @ieee80211_iterate_active_interfaces instead. 2316 * if that is not desired, use @ieee80211_iterate_active_interfaces instead.
2317 * Does not iterate over a new interface during add_interface()
2287 * 2318 *
2288 * @hw: the hardware struct of which the interfaces should be iterated over 2319 * @hw: the hardware struct of which the interfaces should be iterated over
2289 * @iterator: the iterator function to call, cannot sleep 2320 * @iterator: the iterator function to call, cannot sleep
@@ -2442,7 +2473,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2442 * 2473 *
2443 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2474 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2444 * 2475 *
2445 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and 2476 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and
2446 * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the 2477 * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the
2447 * hardware is not receiving beacons with this function. 2478 * hardware is not receiving beacons with this function.
2448 */ 2479 */
@@ -2453,7 +2484,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
2453 * 2484 *
2454 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 2485 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2455 * 2486 *
2456 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and 2487 * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and
2457 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver 2488 * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver
2458 * needs to inform if the connection to the AP has been lost. 2489 * needs to inform if the connection to the AP has been lost.
2459 * 2490 *
@@ -2518,6 +2549,18 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
2518 */ 2549 */
2519void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); 2550void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success);
2520 2551
2552/**
2553 * ieee80211_request_smps - request SM PS transition
2554 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2555 * @smps_mode: new SM PS mode
2556 *
2557 * This allows the driver to request an SM PS transition in managed
2558 * mode. This is useful when the driver has more information than
2559 * the stack about possible interference, for example by bluetooth.
2560 */
2561void ieee80211_request_smps(struct ieee80211_vif *vif,
2562 enum ieee80211_smps_mode smps_mode);
2563
2521/* Rate control API */ 2564/* Rate control API */
2522 2565
2523/** 2566/**
@@ -2681,4 +2724,26 @@ conf_is_ht(struct ieee80211_conf *conf)
2681 return conf->channel_type != NL80211_CHAN_NO_HT; 2724 return conf->channel_type != NL80211_CHAN_NO_HT;
2682} 2725}
2683 2726
2727static inline enum nl80211_iftype
2728ieee80211_iftype_p2p(enum nl80211_iftype type, bool p2p)
2729{
2730 if (p2p) {
2731 switch (type) {
2732 case NL80211_IFTYPE_STATION:
2733 return NL80211_IFTYPE_P2P_CLIENT;
2734 case NL80211_IFTYPE_AP:
2735 return NL80211_IFTYPE_P2P_GO;
2736 default:
2737 break;
2738 }
2739 }
2740 return type;
2741}
2742
2743static inline enum nl80211_iftype
2744ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
2745{
2746 return ieee80211_iftype_p2p(vif->type, vif->p2p);
2747}
2748
2684#endif /* MAC80211_H */ 2749#endif /* MAC80211_H */
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h
index 35672b1cf44a..37f23dc05de8 100644
--- a/include/net/phonet/pep.h
+++ b/include/net/phonet/pep.h
@@ -77,6 +77,11 @@ static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb)
77#define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4) 77#define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4)
78 78
79enum { 79enum {
80 PNS_PIPE_CREATE_REQ = 0x00,
81 PNS_PIPE_CREATE_RESP,
82 PNS_PIPE_REMOVE_REQ,
83 PNS_PIPE_REMOVE_RESP,
84
80 PNS_PIPE_DATA = 0x20, 85 PNS_PIPE_DATA = 0x20,
81 PNS_PIPE_ALIGNED_DATA, 86 PNS_PIPE_ALIGNED_DATA,
82 87
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h
index 7b114079a51b..d5df797f9540 100644
--- a/include/net/phonet/phonet.h
+++ b/include/net/phonet/phonet.h
@@ -54,6 +54,11 @@ void pn_sock_hash(struct sock *sk);
54void pn_sock_unhash(struct sock *sk); 54void pn_sock_unhash(struct sock *sk);
55int pn_sock_get_port(struct sock *sk, unsigned short sport); 55int pn_sock_get_port(struct sock *sk, unsigned short sport);
56 56
57struct sock *pn_find_sock_by_res(struct net *net, u8 res);
58int pn_sock_bind_res(struct sock *sock, u8 res);
59int pn_sock_unbind_res(struct sock *sk, u8 res);
60void pn_sock_unbind_all_res(struct sock *sk);
61
57int pn_skb_send(struct sock *sk, struct sk_buff *skb, 62int pn_skb_send(struct sock *sk, struct sk_buff *skb,
58 const struct sockaddr_pn *target); 63 const struct sockaddr_pn *target);
59 64
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h
index 2d16783d5e20..13649eb57413 100644
--- a/include/net/phonet/pn_dev.h
+++ b/include/net/phonet/pn_dev.h
@@ -57,5 +57,6 @@ struct net_device *phonet_route_output(struct net *net, u8 daddr);
57#define PN_NO_ADDR 0xff 57#define PN_NO_ADDR 0xff
58 58
59extern const struct file_operations pn_sock_seq_fops; 59extern const struct file_operations pn_sock_seq_fops;
60extern const struct file_operations pn_res_seq_fops;
60 61
61#endif 62#endif
diff --git a/include/net/raw.h b/include/net/raw.h
index 43c57502659b..42ce6fe7a2d5 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -45,7 +45,10 @@ struct raw_iter_state {
45 struct raw_hashinfo *h; 45 struct raw_hashinfo *h;
46}; 46};
47 47
48#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private) 48static inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)
49{
50 return seq->private;
51}
49void *raw_seq_start(struct seq_file *seq, loff_t *pos); 52void *raw_seq_start(struct seq_file *seq, loff_t *pos);
50void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); 53void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
51void raw_seq_stop(struct seq_file *seq, void *v); 54void raw_seq_stop(struct seq_file *seq, void *v);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 3c8728aaab4e..eda8808fdacd 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -601,7 +601,7 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen)
601 slot = 0; 601 slot = 0;
602 slot >>= rtab->rate.cell_log; 602 slot >>= rtab->rate.cell_log;
603 if (slot > 255) 603 if (slot > 255)
604 return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]); 604 return rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF];
605 return rtab->data[slot]; 605 return rtab->data[slot];
606} 606}
607 607
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 65946bc43d00..505845ddb0be 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -275,24 +275,35 @@ struct sctp_mib {
275/* Print debugging messages. */ 275/* Print debugging messages. */
276#if SCTP_DEBUG 276#if SCTP_DEBUG
277extern int sctp_debug_flag; 277extern int sctp_debug_flag;
278#define SCTP_DEBUG_PRINTK(whatever...) \ 278#define SCTP_DEBUG_PRINTK(fmt, args...) \
279 ((void) (sctp_debug_flag && printk(KERN_DEBUG whatever))) 279do { \
280#define SCTP_DEBUG_PRINTK_IPADDR(lead, trail, leadparm, saddr, otherparms...) \ 280 if (sctp_debug_flag) \
281 if (sctp_debug_flag) { \ 281 printk(KERN_DEBUG pr_fmt(fmt), ##args); \
282 if (saddr->sa.sa_family == AF_INET6) { \ 282} while (0)
283 printk(KERN_DEBUG \ 283#define SCTP_DEBUG_PRINTK_CONT(fmt, args...) \
284 lead "%pI6" trail, \ 284do { \
285 leadparm, \ 285 if (sctp_debug_flag) \
286 &saddr->v6.sin6_addr, \ 286 pr_cont(fmt, ##args); \
287 otherparms); \ 287} while (0)
288 } else { \ 288#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \
289 printk(KERN_DEBUG \ 289 args_lead, saddr, args_trail...) \
290 lead "%pI4" trail, \ 290do { \
291 leadparm, \ 291 if (sctp_debug_flag) { \
292 &saddr->v4.sin_addr.s_addr, \ 292 if (saddr->sa.sa_family == AF_INET6) { \
293 otherparms); \ 293 printk(KERN_DEBUG \
294 } \ 294 pr_fmt(fmt_lead "%pI6" fmt_trail), \
295 } 295 args_lead, \
296 &saddr->v6.sin6_addr, \
297 args_trail); \
298 } else { \
299 printk(KERN_DEBUG \
300 pr_fmt(fmt_lead "%pI4" fmt_trail), \
301 args_lead, \
302 &saddr->v4.sin_addr.s_addr, \
303 args_trail); \
304 } \
305 } \
306} while (0)
296#define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; } 307#define SCTP_ENABLE_DEBUG { sctp_debug_flag = 1; }
297#define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; } 308#define SCTP_DISABLE_DEBUG { sctp_debug_flag = 0; }
298 309
@@ -306,6 +317,7 @@ extern int sctp_debug_flag;
306#else /* SCTP_DEBUG */ 317#else /* SCTP_DEBUG */
307 318
308#define SCTP_DEBUG_PRINTK(whatever...) 319#define SCTP_DEBUG_PRINTK(whatever...)
320#define SCTP_DEBUG_PRINTK_CONT(fmt, args...)
309#define SCTP_DEBUG_PRINTK_IPADDR(whatever...) 321#define SCTP_DEBUG_PRINTK_IPADDR(whatever...)
310#define SCTP_ENABLE_DEBUG 322#define SCTP_ENABLE_DEBUG
311#define SCTP_DISABLE_DEBUG 323#define SCTP_DISABLE_DEBUG
@@ -393,7 +405,7 @@ static inline void sctp_v6_del_protocol(void) { return; }
393/* Map an association to an assoc_id. */ 405/* Map an association to an assoc_id. */
394static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) 406static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc)
395{ 407{
396 return (asoc?asoc->assoc_id:0); 408 return asoc ? asoc->assoc_id : 0;
397} 409}
398 410
399/* Look up the association by its id. */ 411/* Look up the association by its id. */
@@ -461,7 +473,7 @@ static inline void sctp_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
461/* Tests if the list has one and only one entry. */ 473/* Tests if the list has one and only one entry. */
462static inline int sctp_list_single_entry(struct list_head *head) 474static inline int sctp_list_single_entry(struct list_head *head)
463{ 475{
464 return ((head->next != head) && (head->next == head->prev)); 476 return (head->next != head) && (head->next == head->prev);
465} 477}
466 478
467/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */ 479/* Generate a random jitter in the range of -50% ~ +50% of input RTO. */
@@ -619,13 +631,13 @@ static inline int sctp_sanity_check(void)
619/* This is the hash function for the SCTP port hash table. */ 631/* This is the hash function for the SCTP port hash table. */
620static inline int sctp_phashfn(__u16 lport) 632static inline int sctp_phashfn(__u16 lport)
621{ 633{
622 return (lport & (sctp_port_hashsize - 1)); 634 return lport & (sctp_port_hashsize - 1);
623} 635}
624 636
625/* This is the hash function for the endpoint hash table. */ 637/* This is the hash function for the endpoint hash table. */
626static inline int sctp_ep_hashfn(__u16 lport) 638static inline int sctp_ep_hashfn(__u16 lport)
627{ 639{
628 return (lport & (sctp_ep_hashsize - 1)); 640 return lport & (sctp_ep_hashsize - 1);
629} 641}
630 642
631/* This is the hash function for the association hash table. */ 643/* This is the hash function for the association hash table. */
@@ -633,7 +645,7 @@ static inline int sctp_assoc_hashfn(__u16 lport, __u16 rport)
633{ 645{
634 int h = (lport << 16) + rport; 646 int h = (lport << 16) + rport;
635 h ^= h>>8; 647 h ^= h>>8;
636 return (h & (sctp_assoc_hashsize - 1)); 648 return h & (sctp_assoc_hashsize - 1);
637} 649}
638 650
639/* This is the hash function for the association hash table. This is 651/* This is the hash function for the association hash table. This is
@@ -644,7 +656,7 @@ static inline int sctp_vtag_hashfn(__u16 lport, __u16 rport, __u32 vtag)
644{ 656{
645 int h = (lport << 16) + rport; 657 int h = (lport << 16) + rport;
646 h ^= vtag; 658 h ^= vtag;
647 return (h & (sctp_assoc_hashsize-1)); 659 return h & (sctp_assoc_hashsize - 1);
648} 660}
649 661
650#define sctp_for_each_hentry(epb, node, head) \ 662#define sctp_for_each_hentry(epb, node, head) \
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h
index 4088c89a9055..9352d12f02de 100644
--- a/include/net/sctp/sm.h
+++ b/include/net/sctp/sm.h
@@ -345,12 +345,12 @@ enum {
345 345
346static inline int TSN_lt(__u32 s, __u32 t) 346static inline int TSN_lt(__u32 s, __u32 t)
347{ 347{
348 return (((s) - (t)) & TSN_SIGN_BIT); 348 return ((s) - (t)) & TSN_SIGN_BIT;
349} 349}
350 350
351static inline int TSN_lte(__u32 s, __u32 t) 351static inline int TSN_lte(__u32 s, __u32 t)
352{ 352{
353 return (((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT)); 353 return ((s) == (t)) || (((s) - (t)) & TSN_SIGN_BIT);
354} 354}
355 355
356/* Compare two SSNs */ 356/* Compare two SSNs */
@@ -369,12 +369,12 @@ enum {
369 369
370static inline int SSN_lt(__u16 s, __u16 t) 370static inline int SSN_lt(__u16 s, __u16 t)
371{ 371{
372 return (((s) - (t)) & SSN_SIGN_BIT); 372 return ((s) - (t)) & SSN_SIGN_BIT;
373} 373}
374 374
375static inline int SSN_lte(__u16 s, __u16 t) 375static inline int SSN_lte(__u16 s, __u16 t)
376{ 376{
377 return (((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT)); 377 return ((s) == (t)) || (((s) - (t)) & SSN_SIGN_BIT);
378} 378}
379 379
380/* 380/*
@@ -388,7 +388,7 @@ enum {
388 388
389static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) 389static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t)
390{ 390{
391 return (((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT)); 391 return ((s) == (t)) || (((t) - (s)) & ADDIP_SERIAL_SIGN_BIT);
392} 392}
393 393
394/* Check VTAG of the packet matches the sender's own tag. */ 394/* Check VTAG of the packet matches the sender's own tag. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index f9e7473613bd..69fef4fb79c0 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -847,7 +847,7 @@ void sctp_packet_free(struct sctp_packet *);
847 847
848static inline int sctp_packet_empty(struct sctp_packet *packet) 848static inline int sctp_packet_empty(struct sctp_packet *packet)
849{ 849{
850 return (packet->size == packet->overhead); 850 return packet->size == packet->overhead;
851} 851}
852 852
853/* This represents a remote transport address. 853/* This represents a remote transport address.
diff --git a/include/net/sctp/tsnmap.h b/include/net/sctp/tsnmap.h
index 4aabc5a96cf6..e7728bc14ccf 100644
--- a/include/net/sctp/tsnmap.h
+++ b/include/net/sctp/tsnmap.h
@@ -157,7 +157,7 @@ __u16 sctp_tsnmap_pending(struct sctp_tsnmap *map);
157/* Is there a gap in the TSN map? */ 157/* Is there a gap in the TSN map? */
158static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) 158static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map)
159{ 159{
160 return (map->cumulative_tsn_ack_point != map->max_tsn_seen); 160 return map->cumulative_tsn_ack_point != map->max_tsn_seen;
161} 161}
162 162
163/* Mark a duplicate TSN. Note: limit the storage of duplicate TSN 163/* Mark a duplicate TSN. Note: limit the storage of duplicate TSN
diff --git a/include/net/sock.h b/include/net/sock.h
index adab9dc58183..73a4f9702a65 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1558,7 +1558,11 @@ static inline void sk_wake_async(struct sock *sk, int how, int band)
1558} 1558}
1559 1559
1560#define SOCK_MIN_SNDBUF 2048 1560#define SOCK_MIN_SNDBUF 2048
1561#define SOCK_MIN_RCVBUF 256 1561/*
1562 * Since sk_rmem_alloc sums skb->truesize, even a small frame might need
1563 * sizeof(sk_buff) + MTU + padding, unless net driver perform copybreak
1564 */
1565#define SOCK_MIN_RCVBUF (2048 + sizeof(struct sk_buff))
1562 1566
1563static inline void sk_stream_moderate_sndbuf(struct sock *sk) 1567static inline void sk_stream_moderate_sndbuf(struct sock *sk)
1564{ 1568{
@@ -1670,17 +1674,13 @@ static inline void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk,
1670 1674
1671/** 1675/**
1672 * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped 1676 * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped
1673 * @msg: outgoing packet
1674 * @sk: socket sending this packet 1677 * @sk: socket sending this packet
1675 * @shtx: filled with instructions for time stamping 1678 * @tx_flags: filled with instructions for time stamping
1676 * 1679 *
1677 * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if 1680 * Currently only depends on SOCK_TIMESTAMPING* flags. Returns error code if
1678 * parameters are invalid. 1681 * parameters are invalid.
1679 */ 1682 */
1680extern int sock_tx_timestamp(struct msghdr *msg, 1683extern int sock_tx_timestamp(struct sock *sk, __u8 *tx_flags);
1681 struct sock *sk,
1682 union skb_shared_tx *shtx);
1683
1684 1684
1685/** 1685/**
1686 * sk_eat_skb - Release a skb if it is no longer needed 1686 * sk_eat_skb - Release a skb if it is no longer needed
diff --git a/include/net/tc_act/tc_csum.h b/include/net/tc_act/tc_csum.h
new file mode 100644
index 000000000000..9e8710be7a04
--- /dev/null
+++ b/include/net/tc_act/tc_csum.h
@@ -0,0 +1,15 @@
1#ifndef __NET_TC_CSUM_H
2#define __NET_TC_CSUM_H
3
4#include <linux/types.h>
5#include <net/act_api.h>
6
7struct tcf_csum {
8 struct tcf_common common;
9
10 u32 update_flags;
11};
12#define to_tcf_csum(pc) \
13 container_of(pc,struct tcf_csum,common)
14
15#endif /* __NET_TC_CSUM_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 3e4b33e36602..914a60c7ad62 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -803,6 +803,15 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
803/* Use define here intentionally to get WARN_ON location shown at the caller */ 803/* Use define here intentionally to get WARN_ON location shown at the caller */
804#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) 804#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out)
805 805
806/*
807 * Convert RFC 3390 larger initial window into an equivalent number of packets.
808 * This is based on the numbers specified in RFC 5681, 3.1.
809 */
810static inline u32 rfc3390_bytes_to_packets(const u32 smss)
811{
812 return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3);
813}
814
806extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); 815extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
807extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); 816extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
808 817
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h
index 2e159a812f83..ffe50b4e7b93 100644
--- a/include/net/tipc/tipc_msg.h
+++ b/include/net/tipc/tipc_msg.h
@@ -107,7 +107,7 @@ static inline u32 msg_hdr_sz(struct tipc_msg *m)
107 107
108static inline int msg_short(struct tipc_msg *m) 108static inline int msg_short(struct tipc_msg *m)
109{ 109{
110 return (msg_hdr_sz(m) == 24); 110 return msg_hdr_sz(m) == 24;
111} 111}
112 112
113static inline u32 msg_size(struct tipc_msg *m) 113static inline u32 msg_size(struct tipc_msg *m)
@@ -117,7 +117,7 @@ static inline u32 msg_size(struct tipc_msg *m)
117 117
118static inline u32 msg_data_sz(struct tipc_msg *m) 118static inline u32 msg_data_sz(struct tipc_msg *m)
119{ 119{
120 return (msg_size(m) - msg_hdr_sz(m)); 120 return msg_size(m) - msg_hdr_sz(m);
121} 121}
122 122
123static inline unchar *msg_data(struct tipc_msg *m) 123static inline unchar *msg_data(struct tipc_msg *m)
@@ -132,17 +132,17 @@ static inline u32 msg_type(struct tipc_msg *m)
132 132
133static inline u32 msg_named(struct tipc_msg *m) 133static inline u32 msg_named(struct tipc_msg *m)
134{ 134{
135 return (msg_type(m) == TIPC_NAMED_MSG); 135 return msg_type(m) == TIPC_NAMED_MSG;
136} 136}
137 137
138static inline u32 msg_mcast(struct tipc_msg *m) 138static inline u32 msg_mcast(struct tipc_msg *m)
139{ 139{
140 return (msg_type(m) == TIPC_MCAST_MSG); 140 return msg_type(m) == TIPC_MCAST_MSG;
141} 141}
142 142
143static inline u32 msg_connected(struct tipc_msg *m) 143static inline u32 msg_connected(struct tipc_msg *m)
144{ 144{
145 return (msg_type(m) == TIPC_CONN_MSG); 145 return msg_type(m) == TIPC_CONN_MSG;
146} 146}
147 147
148static inline u32 msg_errcode(struct tipc_msg *m) 148static inline u32 msg_errcode(struct tipc_msg *m)