diff options
Diffstat (limited to 'include')
106 files changed, 2166 insertions, 861 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 4e8ea8c8ec1e..831c4634162c 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -301,6 +301,7 @@ header-y += quota.h | |||
| 301 | header-y += radeonfb.h | 301 | header-y += radeonfb.h |
| 302 | header-y += random.h | 302 | header-y += random.h |
| 303 | header-y += raw.h | 303 | header-y += raw.h |
| 304 | header-y += rds.h | ||
| 304 | header-y += reboot.h | 305 | header-y += reboot.h |
| 305 | header-y += reiserfs_fs.h | 306 | header-y += reiserfs_fs.h |
| 306 | header-y += reiserfs_xattr.h | 307 | header-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 | ||
| 450 | static inline int atm_guess_pdu2truesize(int size) | 450 | static 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/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h index dba28268e651..8e20540043f5 100644 --- a/include/linux/can/platform/mcp251x.h +++ b/include/linux/can/platform/mcp251x.h | |||
| @@ -12,7 +12,6 @@ | |||
| 12 | /** | 12 | /** |
| 13 | * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data | 13 | * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data |
| 14 | * @oscillator_frequency: - oscillator frequency in Hz | 14 | * @oscillator_frequency: - oscillator frequency in Hz |
| 15 | * @model: - actual type of chip | ||
| 16 | * @board_specific_setup: - called before probing the chip (power,reset) | 15 | * @board_specific_setup: - called before probing the chip (power,reset) |
| 17 | * @transceiver_enable: - called to power on/off the transceiver | 16 | * @transceiver_enable: - called to power on/off the transceiver |
| 18 | * @power_enable: - called to power on/off the mcp *and* the | 17 | * @power_enable: - called to power on/off the mcp *and* the |
| @@ -25,9 +24,6 @@ | |||
| 25 | 24 | ||
| 26 | struct mcp251x_platform_data { | 25 | struct mcp251x_platform_data { |
| 27 | unsigned long oscillator_frequency; | 26 | unsigned long oscillator_frequency; |
| 28 | int model; | ||
| 29 | #define CAN_MCP251X_MCP2510 0x2510 | ||
| 30 | #define CAN_MCP251X_MCP2515 0x2515 | ||
| 31 | int (*board_specific_setup)(struct spi_device *spi); | 27 | int (*board_specific_setup)(struct spi_device *spi); |
| 32 | int (*transceiver_enable)(int enable); | 28 | int (*transceiver_enable)(int enable); |
| 33 | int (*power_enable) (int enable); | 29 | int (*power_enable) (int enable); |
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 | */ |
| 72 | static inline int is_multicast_ether_addr(const u8 *addr) | 72 | static 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 | */ |
| 83 | static inline int is_local_ether_addr(const u8 *addr) | 83 | static 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 | ||
| 240 | static inline int compare_ether_header(const void *a, const void *b) | 240 | static 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..6628a507fd3b 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. */ |
| 19 | struct ethtool_cmd { | 20 | struct ethtool_cmd { |
| @@ -308,15 +309,28 @@ struct ethtool_perm_addr { | |||
| 308 | * flag differs from the read-only value. | 309 | * flag differs from the read-only value. |
| 309 | */ | 310 | */ |
| 310 | enum ethtool_flags { | 311 | enum ethtool_flags { |
| 312 | ETH_FLAG_TXVLAN = (1 << 7), /* TX VLAN offload enabled */ | ||
| 313 | ETH_FLAG_RXVLAN = (1 << 8), /* RX VLAN offload enabled */ | ||
| 311 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 314 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
| 312 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | 315 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ |
| 313 | ETH_FLAG_RXHASH = (1 << 28), | 316 | ETH_FLAG_RXHASH = (1 << 28), |
| 314 | }; | 317 | }; |
| 315 | 318 | ||
| 316 | /* The following structures are for supporting RX network flow | 319 | /* The following structures are for supporting RX network flow |
| 317 | * classification configuration. Note, all multibyte fields, e.g., | 320 | * classification and RX n-tuple configuration. Note, all multibyte |
| 318 | * ip4src, ip4dst, psrc, pdst, spi, etc. are expected to be in network | 321 | * fields, e.g., ip4src, ip4dst, psrc, pdst, spi, etc. are expected to |
| 319 | * byte order. | 322 | * be in network byte order. |
| 323 | */ | ||
| 324 | |||
| 325 | /** | ||
| 326 | * struct ethtool_tcpip4_spec - flow specification for TCP/IPv4 etc. | ||
| 327 | * @ip4src: Source host | ||
| 328 | * @ip4dst: Destination host | ||
| 329 | * @psrc: Source port | ||
| 330 | * @pdst: Destination port | ||
| 331 | * @tos: Type-of-service | ||
| 332 | * | ||
| 333 | * This can be used to specify a TCP/IPv4, UDP/IPv4 or SCTP/IPv4 flow. | ||
| 320 | */ | 334 | */ |
| 321 | struct ethtool_tcpip4_spec { | 335 | struct ethtool_tcpip4_spec { |
| 322 | __be32 ip4src; | 336 | __be32 ip4src; |
| @@ -326,6 +340,15 @@ struct ethtool_tcpip4_spec { | |||
| 326 | __u8 tos; | 340 | __u8 tos; |
| 327 | }; | 341 | }; |
| 328 | 342 | ||
| 343 | /** | ||
| 344 | * struct ethtool_ah_espip4_spec - flow specification for IPsec/IPv4 | ||
| 345 | * @ip4src: Source host | ||
| 346 | * @ip4dst: Destination host | ||
| 347 | * @spi: Security parameters index | ||
| 348 | * @tos: Type-of-service | ||
| 349 | * | ||
| 350 | * This can be used to specify an IPsec transport or tunnel over IPv4. | ||
| 351 | */ | ||
| 329 | struct ethtool_ah_espip4_spec { | 352 | struct ethtool_ah_espip4_spec { |
| 330 | __be32 ip4src; | 353 | __be32 ip4src; |
| 331 | __be32 ip4dst; | 354 | __be32 ip4dst; |
| @@ -333,21 +356,17 @@ struct ethtool_ah_espip4_spec { | |||
| 333 | __u8 tos; | 356 | __u8 tos; |
| 334 | }; | 357 | }; |
| 335 | 358 | ||
| 336 | struct ethtool_rawip4_spec { | ||
| 337 | __be32 ip4src; | ||
| 338 | __be32 ip4dst; | ||
| 339 | __u8 hdata[64]; | ||
| 340 | }; | ||
| 341 | |||
| 342 | struct ethtool_ether_spec { | ||
| 343 | __be16 ether_type; | ||
| 344 | __u8 frame_size; | ||
| 345 | __u8 eframe[16]; | ||
| 346 | }; | ||
| 347 | |||
| 348 | #define ETH_RX_NFC_IP4 1 | 359 | #define ETH_RX_NFC_IP4 1 |
| 349 | #define ETH_RX_NFC_IP6 2 | ||
| 350 | 360 | ||
| 361 | /** | ||
| 362 | * struct ethtool_usrip4_spec - general flow specification for IPv4 | ||
| 363 | * @ip4src: Source host | ||
| 364 | * @ip4dst: Destination host | ||
| 365 | * @l4_4_bytes: First 4 bytes of transport (layer 4) header | ||
| 366 | * @tos: Type-of-service | ||
| 367 | * @ip_ver: Value must be %ETH_RX_NFC_IP4; mask must be 0 | ||
| 368 | * @proto: Transport protocol number; mask must be 0 | ||
| 369 | */ | ||
| 351 | struct ethtool_usrip4_spec { | 370 | struct ethtool_usrip4_spec { |
| 352 | __be32 ip4src; | 371 | __be32 ip4src; |
| 353 | __be32 ip4dst; | 372 | __be32 ip4dst; |
| @@ -357,6 +376,15 @@ struct ethtool_usrip4_spec { | |||
| 357 | __u8 proto; | 376 | __u8 proto; |
| 358 | }; | 377 | }; |
| 359 | 378 | ||
| 379 | /** | ||
| 380 | * struct ethtool_rx_flow_spec - specification for RX flow filter | ||
| 381 | * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW | ||
| 382 | * @h_u: Flow fields to match (dependent on @flow_type) | ||
| 383 | * @m_u: Masks for flow field bits to be ignored | ||
| 384 | * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC | ||
| 385 | * if packets should be discarded | ||
| 386 | * @location: Index of filter in hardware table | ||
| 387 | */ | ||
| 360 | struct ethtool_rx_flow_spec { | 388 | struct ethtool_rx_flow_spec { |
| 361 | __u32 flow_type; | 389 | __u32 flow_type; |
| 362 | union { | 390 | union { |
| @@ -365,36 +393,91 @@ struct ethtool_rx_flow_spec { | |||
| 365 | struct ethtool_tcpip4_spec sctp_ip4_spec; | 393 | struct ethtool_tcpip4_spec sctp_ip4_spec; |
| 366 | struct ethtool_ah_espip4_spec ah_ip4_spec; | 394 | struct ethtool_ah_espip4_spec ah_ip4_spec; |
| 367 | struct ethtool_ah_espip4_spec esp_ip4_spec; | 395 | 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; | 396 | struct ethtool_usrip4_spec usr_ip4_spec; |
| 371 | __u8 hdata[64]; | 397 | struct ethhdr ether_spec; |
| 372 | } h_u, m_u; /* entry, mask */ | 398 | __u8 hdata[72]; |
| 399 | } h_u, m_u; | ||
| 373 | __u64 ring_cookie; | 400 | __u64 ring_cookie; |
| 374 | __u32 location; | 401 | __u32 location; |
| 375 | }; | 402 | }; |
| 376 | 403 | ||
| 404 | /** | ||
| 405 | * struct ethtool_rxnfc - command to get or set RX flow classification rules | ||
| 406 | * @cmd: Specific command number - %ETHTOOL_GRXFH, %ETHTOOL_SRXFH, | ||
| 407 | * %ETHTOOL_GRXRINGS, %ETHTOOL_GRXCLSRLCNT, %ETHTOOL_GRXCLSRULE, | ||
| 408 | * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS | ||
| 409 | * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW | ||
| 410 | * @data: Command-dependent value | ||
| 411 | * @fs: Flow filter specification | ||
| 412 | * @rule_cnt: Number of rules to be affected | ||
| 413 | * @rule_locs: Array of valid rule indices | ||
| 414 | * | ||
| 415 | * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating | ||
| 416 | * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following | ||
| 417 | * structure fields must not be used. | ||
| 418 | * | ||
| 419 | * For %ETHTOOL_GRXRINGS, @data is set to the number of RX rings/queues | ||
| 420 | * on return. | ||
| 421 | * | ||
| 422 | * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined | ||
| 423 | * rules on return. | ||
| 424 | * | ||
| 425 | * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an | ||
| 426 | * existing filter rule on entry and @fs contains the rule on return. | ||
| 427 | * | ||
| 428 | * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the | ||
| 429 | * user buffer for @rule_locs on entry. On return, @data is the size | ||
| 430 | * of the filter table and @rule_locs contains the indices of the | ||
| 431 | * defined rules. | ||
| 432 | * | ||
| 433 | * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or | ||
| 434 | * update. @fs.@location specifies the index to use and must not be | ||
| 435 | * ignored. | ||
| 436 | * | ||
| 437 | * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an | ||
| 438 | * existing filter rule on entry. | ||
| 439 | * | ||
| 440 | * Implementation of indexed classification rules generally requires a | ||
| 441 | * TCAM. | ||
| 442 | */ | ||
| 377 | struct ethtool_rxnfc { | 443 | struct ethtool_rxnfc { |
| 378 | __u32 cmd; | 444 | __u32 cmd; |
| 379 | __u32 flow_type; | 445 | __u32 flow_type; |
| 380 | /* The rx flow hash value or the rule DB size */ | ||
| 381 | __u64 data; | 446 | __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; | 447 | struct ethtool_rx_flow_spec fs; |
| 385 | __u32 rule_cnt; | 448 | __u32 rule_cnt; |
| 386 | __u32 rule_locs[0]; | 449 | __u32 rule_locs[0]; |
| 387 | }; | 450 | }; |
| 388 | 451 | ||
| 452 | /** | ||
| 453 | * struct ethtool_rxfh_indir - command to get or set RX flow hash indirection | ||
| 454 | * @cmd: Specific command number - %ETHTOOL_GRXFHINDIR or %ETHTOOL_SRXFHINDIR | ||
| 455 | * @size: On entry, the array size of the user buffer. On return from | ||
| 456 | * %ETHTOOL_GRXFHINDIR, the array size of the hardware indirection table. | ||
| 457 | * @ring_index: RX ring/queue index for each hash value | ||
| 458 | */ | ||
| 389 | struct ethtool_rxfh_indir { | 459 | struct ethtool_rxfh_indir { |
| 390 | __u32 cmd; | 460 | __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; | 461 | __u32 size; |
| 395 | __u32 ring_index[0]; /* ring/queue index for each hash value */ | 462 | __u32 ring_index[0]; |
| 396 | }; | 463 | }; |
| 397 | 464 | ||
| 465 | /** | ||
| 466 | * struct ethtool_rx_ntuple_flow_spec - specification for RX flow filter | ||
| 467 | * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW | ||
| 468 | * @h_u: Flow field values to match (dependent on @flow_type) | ||
| 469 | * @m_u: Masks for flow field value bits to be ignored | ||
| 470 | * @vlan_tag: VLAN tag to match | ||
| 471 | * @vlan_tag_mask: Mask for VLAN tag bits to be ignored | ||
| 472 | * @data: Driver-dependent data to match | ||
| 473 | * @data_mask: Mask for driver-dependent data bits to be ignored | ||
| 474 | * @action: RX ring/queue index to deliver to (non-negative) or other action | ||
| 475 | * (negative, e.g. %ETHTOOL_RXNTUPLE_ACTION_DROP) | ||
| 476 | * | ||
| 477 | * For flow types %TCP_V4_FLOW, %UDP_V4_FLOW and %SCTP_V4_FLOW, where | ||
| 478 | * a field value and mask are both zero this is treated as if all mask | ||
| 479 | * bits are set i.e. the field is ignored. | ||
| 480 | */ | ||
| 398 | struct ethtool_rx_ntuple_flow_spec { | 481 | struct ethtool_rx_ntuple_flow_spec { |
| 399 | __u32 flow_type; | 482 | __u32 flow_type; |
| 400 | union { | 483 | union { |
| @@ -403,22 +486,26 @@ struct ethtool_rx_ntuple_flow_spec { | |||
| 403 | struct ethtool_tcpip4_spec sctp_ip4_spec; | 486 | struct ethtool_tcpip4_spec sctp_ip4_spec; |
| 404 | struct ethtool_ah_espip4_spec ah_ip4_spec; | 487 | struct ethtool_ah_espip4_spec ah_ip4_spec; |
| 405 | struct ethtool_ah_espip4_spec esp_ip4_spec; | 488 | 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; | 489 | struct ethtool_usrip4_spec usr_ip4_spec; |
| 409 | __u8 hdata[64]; | 490 | struct ethhdr ether_spec; |
| 410 | } h_u, m_u; /* entry, mask */ | 491 | __u8 hdata[72]; |
| 492 | } h_u, m_u; | ||
| 411 | 493 | ||
| 412 | __u16 vlan_tag; | 494 | __u16 vlan_tag; |
| 413 | __u16 vlan_tag_mask; | 495 | __u16 vlan_tag_mask; |
| 414 | __u64 data; /* user-defined flow spec data */ | 496 | __u64 data; |
| 415 | __u64 data_mask; /* user-defined flow spec mask */ | 497 | __u64 data_mask; |
| 416 | 498 | ||
| 417 | /* signed to distinguish between queue and actions (DROP) */ | ||
| 418 | __s32 action; | 499 | __s32 action; |
| 419 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | 500 | #define ETHTOOL_RXNTUPLE_ACTION_DROP (-1) /* drop packet */ |
| 501 | #define ETHTOOL_RXNTUPLE_ACTION_CLEAR (-2) /* clear filter */ | ||
| 420 | }; | 502 | }; |
| 421 | 503 | ||
| 504 | /** | ||
| 505 | * struct ethtool_rx_ntuple - command to set or clear RX flow filter | ||
| 506 | * @cmd: Command number - %ETHTOOL_SRXNTUPLE | ||
| 507 | * @fs: Flow filter specification | ||
| 508 | */ | ||
| 422 | struct ethtool_rx_ntuple { | 509 | struct ethtool_rx_ntuple { |
| 423 | __u32 cmd; | 510 | __u32 cmd; |
| 424 | struct ethtool_rx_ntuple_flow_spec fs; | 511 | struct ethtool_rx_ntuple_flow_spec fs; |
| @@ -759,22 +846,23 @@ struct ethtool_ops { | |||
| 759 | #define WAKE_MAGIC (1 << 5) | 846 | #define WAKE_MAGIC (1 << 5) |
| 760 | #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ | 847 | #define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ |
| 761 | 848 | ||
| 762 | /* L3-L4 network traffic flow types */ | 849 | /* L2-L4 network traffic flow types */ |
| 763 | #define TCP_V4_FLOW 0x01 | 850 | #define TCP_V4_FLOW 0x01 /* hash or spec (tcp_ip4_spec) */ |
| 764 | #define UDP_V4_FLOW 0x02 | 851 | #define UDP_V4_FLOW 0x02 /* hash or spec (udp_ip4_spec) */ |
| 765 | #define SCTP_V4_FLOW 0x03 | 852 | #define SCTP_V4_FLOW 0x03 /* hash or spec (sctp_ip4_spec) */ |
| 766 | #define AH_ESP_V4_FLOW 0x04 | 853 | #define AH_ESP_V4_FLOW 0x04 /* hash only */ |
| 767 | #define TCP_V6_FLOW 0x05 | 854 | #define TCP_V6_FLOW 0x05 /* hash only */ |
| 768 | #define UDP_V6_FLOW 0x06 | 855 | #define UDP_V6_FLOW 0x06 /* hash only */ |
| 769 | #define SCTP_V6_FLOW 0x07 | 856 | #define SCTP_V6_FLOW 0x07 /* hash only */ |
| 770 | #define AH_ESP_V6_FLOW 0x08 | 857 | #define AH_ESP_V6_FLOW 0x08 /* hash only */ |
| 771 | #define AH_V4_FLOW 0x09 | 858 | #define AH_V4_FLOW 0x09 /* hash or spec (ah_ip4_spec) */ |
| 772 | #define ESP_V4_FLOW 0x0a | 859 | #define ESP_V4_FLOW 0x0a /* hash or spec (esp_ip4_spec) */ |
| 773 | #define AH_V6_FLOW 0x0b | 860 | #define AH_V6_FLOW 0x0b /* hash only */ |
| 774 | #define ESP_V6_FLOW 0x0c | 861 | #define ESP_V6_FLOW 0x0c /* hash only */ |
| 775 | #define IP_USER_FLOW 0x0d | 862 | #define IP_USER_FLOW 0x0d /* spec only (usr_ip4_spec) */ |
| 776 | #define IPV4_FLOW 0x10 | 863 | #define IPV4_FLOW 0x10 /* hash only */ |
| 777 | #define IPV6_FLOW 0x11 | 864 | #define IPV6_FLOW 0x11 /* hash only */ |
| 865 | #define ETHER_FLOW 0x12 /* spec only (ether_spec) */ | ||
| 778 | 866 | ||
| 779 | /* L3-L4 network traffic flow hash options */ | 867 | /* L3-L4 network traffic flow hash options */ |
| 780 | #define RXH_L2DA (1 << 1) | 868 | #define RXH_L2DA (1 << 1) |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 97b2eae6a22c..ed5a03cbe184 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -986,6 +986,7 @@ struct ieee80211_ht_info { | |||
| 986 | #define WLAN_AUTH_OPEN 0 | 986 | #define WLAN_AUTH_OPEN 0 |
| 987 | #define WLAN_AUTH_SHARED_KEY 1 | 987 | #define WLAN_AUTH_SHARED_KEY 1 |
| 988 | #define WLAN_AUTH_FT 2 | 988 | #define WLAN_AUTH_FT 2 |
| 989 | #define WLAN_AUTH_SAE 3 | ||
| 989 | #define WLAN_AUTH_LEAP 128 | 990 | #define WLAN_AUTH_LEAP 128 |
| 990 | 991 | ||
| 991 | #define WLAN_AUTH_CHALLENGE_LEN 128 | 992 | #define WLAN_AUTH_CHALLENGE_LEN 128 |
| @@ -1072,6 +1073,10 @@ enum ieee80211_statuscode { | |||
| 1072 | WLAN_STATUS_NO_DIRECT_LINK = 48, | 1073 | WLAN_STATUS_NO_DIRECT_LINK = 48, |
| 1073 | WLAN_STATUS_STA_NOT_PRESENT = 49, | 1074 | WLAN_STATUS_STA_NOT_PRESENT = 49, |
| 1074 | WLAN_STATUS_STA_NOT_QSTA = 50, | 1075 | WLAN_STATUS_STA_NOT_QSTA = 50, |
| 1076 | /* 802.11s */ | ||
| 1077 | WLAN_STATUS_ANTI_CLOG_REQUIRED = 76, | ||
| 1078 | WLAN_STATUS_FCG_NOT_SUPP = 78, | ||
| 1079 | WLAN_STATUS_STA_NO_TBTT = 78, | ||
| 1075 | }; | 1080 | }; |
| 1076 | 1081 | ||
| 1077 | 1082 | ||
| @@ -1112,6 +1117,22 @@ enum ieee80211_reasoncode { | |||
| 1112 | WLAN_REASON_QSTA_REQUIRE_SETUP = 38, | 1117 | WLAN_REASON_QSTA_REQUIRE_SETUP = 38, |
| 1113 | WLAN_REASON_QSTA_TIMEOUT = 39, | 1118 | WLAN_REASON_QSTA_TIMEOUT = 39, |
| 1114 | WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45, | 1119 | WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45, |
| 1120 | /* 802.11s */ | ||
| 1121 | WLAN_REASON_MESH_PEER_CANCELED = 52, | ||
| 1122 | WLAN_REASON_MESH_MAX_PEERS = 53, | ||
| 1123 | WLAN_REASON_MESH_CONFIG = 54, | ||
| 1124 | WLAN_REASON_MESH_CLOSE = 55, | ||
| 1125 | WLAN_REASON_MESH_MAX_RETRIES = 56, | ||
| 1126 | WLAN_REASON_MESH_CONFIRM_TIMEOUT = 57, | ||
| 1127 | WLAN_REASON_MESH_INVALID_GTK = 58, | ||
| 1128 | WLAN_REASON_MESH_INCONSISTENT_PARAM = 59, | ||
| 1129 | WLAN_REASON_MESH_INVALID_SECURITY = 60, | ||
| 1130 | WLAN_REASON_MESH_PATH_ERROR = 61, | ||
| 1131 | WLAN_REASON_MESH_PATH_NOFORWARD = 62, | ||
| 1132 | WLAN_REASON_MESH_PATH_DEST_UNREACHABLE = 63, | ||
| 1133 | WLAN_REASON_MAC_EXISTS_IN_MBSS = 64, | ||
| 1134 | WLAN_REASON_MESH_CHAN_REGULATORY = 65, | ||
| 1135 | WLAN_REASON_MESH_CHAN = 66, | ||
| 1115 | }; | 1136 | }; |
| 1116 | 1137 | ||
| 1117 | 1138 | ||
| @@ -1139,20 +1160,33 @@ enum ieee80211_eid { | |||
| 1139 | WLAN_EID_TS_DELAY = 43, | 1160 | WLAN_EID_TS_DELAY = 43, |
| 1140 | WLAN_EID_TCLAS_PROCESSING = 44, | 1161 | WLAN_EID_TCLAS_PROCESSING = 44, |
| 1141 | WLAN_EID_QOS_CAPA = 46, | 1162 | WLAN_EID_QOS_CAPA = 46, |
| 1142 | /* 802.11s | 1163 | /* 802.11s */ |
| 1143 | * | 1164 | WLAN_EID_MESH_CONFIG = 113, |
| 1144 | * All mesh EID numbers are pending IEEE 802.11 ANA approval. | 1165 | WLAN_EID_MESH_ID = 114, |
| 1145 | * The numbers have been incremented from those suggested in | 1166 | WLAN_EID_LINK_METRIC_REPORT = 115, |
| 1146 | * 802.11s/D2.0 so that MESH_CONFIG does not conflict with | 1167 | WLAN_EID_CONGESTION_NOTIFICATION = 116, |
| 1147 | * EXT_SUPP_RATES. | 1168 | /* Note that the Peer Link IE has been replaced with the similar |
| 1169 | * Peer Management IE. We will keep the former definition until mesh | ||
| 1170 | * code is changed to comply with latest 802.11s drafts. | ||
| 1148 | */ | 1171 | */ |
| 1149 | WLAN_EID_MESH_CONFIG = 51, | 1172 | WLAN_EID_PEER_LINK = 55, /* no longer in 802.11s drafts */ |
| 1150 | WLAN_EID_MESH_ID = 52, | 1173 | WLAN_EID_PEER_MGMT = 117, |
| 1151 | WLAN_EID_PEER_LINK = 55, | 1174 | WLAN_EID_CHAN_SWITCH_PARAM = 118, |
| 1152 | WLAN_EID_PREQ = 68, | 1175 | WLAN_EID_MESH_AWAKE_WINDOW = 119, |
| 1153 | WLAN_EID_PREP = 69, | 1176 | WLAN_EID_BEACON_TIMING = 120, |
| 1154 | WLAN_EID_PERR = 70, | 1177 | WLAN_EID_MCCAOP_SETUP_REQ = 121, |
| 1155 | WLAN_EID_RANN = 49, /* compatible with FreeBSD */ | 1178 | WLAN_EID_MCCAOP_SETUP_RESP = 122, |
| 1179 | WLAN_EID_MCCAOP_ADVERT = 123, | ||
| 1180 | WLAN_EID_MCCAOP_TEARDOWN = 124, | ||
| 1181 | WLAN_EID_GANN = 125, | ||
| 1182 | WLAN_EID_RANN = 126, | ||
| 1183 | WLAN_EID_PREQ = 130, | ||
| 1184 | WLAN_EID_PREP = 131, | ||
| 1185 | WLAN_EID_PERR = 132, | ||
| 1186 | WLAN_EID_PXU = 137, | ||
| 1187 | WLAN_EID_PXUC = 138, | ||
| 1188 | WLAN_EID_AUTH_MESH_PEER_EXCH = 139, | ||
| 1189 | WLAN_EID_MIC = 140, | ||
| 1156 | 1190 | ||
| 1157 | WLAN_EID_PWR_CONSTRAINT = 32, | 1191 | WLAN_EID_PWR_CONSTRAINT = 32, |
| 1158 | WLAN_EID_PWR_CAPABILITY = 33, | 1192 | WLAN_EID_PWR_CAPABILITY = 33, |
| @@ -1211,9 +1245,14 @@ enum ieee80211_category { | |||
| 1211 | WLAN_CATEGORY_HT = 7, | 1245 | WLAN_CATEGORY_HT = 7, |
| 1212 | WLAN_CATEGORY_SA_QUERY = 8, | 1246 | WLAN_CATEGORY_SA_QUERY = 8, |
| 1213 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, | 1247 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, |
| 1248 | WLAN_CATEGORY_MESH_ACTION = 13, | ||
| 1249 | WLAN_CATEGORY_MULTIHOP_ACTION = 14, | ||
| 1250 | WLAN_CATEGORY_SELF_PROTECTED = 15, | ||
| 1214 | WLAN_CATEGORY_WMM = 17, | 1251 | WLAN_CATEGORY_WMM = 17, |
| 1215 | WLAN_CATEGORY_MESH_PLINK = 30, /* Pending ANA approval */ | 1252 | /* TODO: remove MESH_PLINK and MESH_PATH_SEL after */ |
| 1216 | WLAN_CATEGORY_MESH_PATH_SEL = 32, /* Pending ANA approval */ | 1253 | /* mesh is updated to current 802.11s draft */ |
| 1254 | WLAN_CATEGORY_MESH_PLINK = 30, | ||
| 1255 | WLAN_CATEGORY_MESH_PATH_SEL = 32, | ||
| 1217 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | 1256 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, |
| 1218 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | 1257 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, |
| 1219 | }; | 1258 | }; |
| @@ -1351,6 +1390,8 @@ enum ieee80211_sa_query_action { | |||
| 1351 | /* AKM suite selectors */ | 1390 | /* AKM suite selectors */ |
| 1352 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 | 1391 | #define WLAN_AKM_SUITE_8021X 0x000FAC01 |
| 1353 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 | 1392 | #define WLAN_AKM_SUITE_PSK 0x000FAC02 |
| 1393 | #define WLAN_AKM_SUITE_SAE 0x000FAC08 | ||
| 1394 | #define WLAN_AKM_SUITE_FT_OVER_SAE 0x000FAC09 | ||
| 1354 | 1395 | ||
| 1355 | #define WLAN_MAX_KEY_LEN 32 | 1396 | #define WLAN_MAX_KEY_LEN 32 |
| 1356 | 1397 | ||
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_bonding.h b/include/linux/if_bonding.h index 2c7994372bde..a17edda8a781 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h | |||
| @@ -84,6 +84,9 @@ | |||
| 84 | #define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ | 84 | #define BOND_DEFAULT_MAX_BONDS 1 /* Default maximum number of devices to support */ |
| 85 | 85 | ||
| 86 | #define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */ | 86 | #define BOND_DEFAULT_TX_QUEUES 16 /* Default number of tx queues per device */ |
| 87 | |||
| 88 | #define BOND_DEFAULT_RESEND_IGMP 1 /* Default number of IGMP membership reports */ | ||
| 89 | |||
| 87 | /* hashing types */ | 90 | /* hashing types */ |
| 88 | #define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ | 91 | #define BOND_XMIT_POLICY_LAYER2 0 /* layer 2 (MAC only), default */ |
| 89 | #define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ | 92 | #define BOND_XMIT_POLICY_LAYER34 1 /* layer 3+4 (IP ^ (TCP || UDP)) */ |
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 | ||
| 138 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 138 | extern 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 | |||
| 43 | struct macvlan_dev { | 49 | struct 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 | ||
| 56 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | 63 | static 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 | */ |
| 42 | typedef __be16 sid_t; | 42 | typedef __be16 sid_t; |
| 43 | struct pppoe_addr{ | 43 | struct 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 | */ |
| 52 | struct 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 | |
| 56 | struct sockaddr_pppox { | 64 | |
| 57 | sa_family_t sa_family; /* address family, AF_PPPOX */ | 65 | struct 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 | ||
| 163 | struct 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 | ||
| 155 | struct pppox_sock { | 172 | struct 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 | ||
| 189 | extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); | 207 | extern int register_pppox_proto(int proto_num, const struct pppox_proto *pp); |
| 190 | extern void unregister_pppox_proto(int proto_num); | 208 | extern void unregister_pppox_proto(int proto_num); |
| 191 | extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ | 209 | extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ |
| 192 | extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 210 | extern 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..c2f3a72712ce 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
| 17 | #include <linux/netdevice.h> | 17 | #include <linux/netdevice.h> |
| 18 | #include <linux/etherdevice.h> | 18 | #include <linux/etherdevice.h> |
| 19 | #include <linux/rtnetlink.h> | ||
| 19 | 20 | ||
| 20 | #define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) | 21 | #define VLAN_HLEN 4 /* The additional bytes (on top of the Ethernet header) |
| 21 | * that VLAN requires. | 22 | * that VLAN requires. |
| @@ -68,6 +69,7 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |||
| 68 | #define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ | 69 | #define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ |
| 69 | #define VLAN_TAG_PRESENT VLAN_CFI_MASK | 70 | #define VLAN_TAG_PRESENT VLAN_CFI_MASK |
| 70 | #define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ | 71 | #define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ |
| 72 | #define VLAN_N_VID 4096 | ||
| 71 | 73 | ||
| 72 | /* found in socket.c */ | 74 | /* found in socket.c */ |
| 73 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | 75 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); |
| @@ -76,9 +78,8 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | |||
| 76 | * depends on completely exhausting the VLAN identifier space. Thus | 78 | * depends on completely exhausting the VLAN identifier space. Thus |
| 77 | * it gives constant time look-up, but in many cases it wastes memory. | 79 | * it gives constant time look-up, but in many cases it wastes memory. |
| 78 | */ | 80 | */ |
| 79 | #define VLAN_GROUP_ARRAY_LEN 4096 | ||
| 80 | #define VLAN_GROUP_ARRAY_SPLIT_PARTS 8 | 81 | #define VLAN_GROUP_ARRAY_SPLIT_PARTS 8 |
| 81 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) | 82 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_N_VID/VLAN_GROUP_ARRAY_SPLIT_PARTS) |
| 82 | 83 | ||
| 83 | struct vlan_group { | 84 | struct vlan_group { |
| 84 | struct net_device *real_dev; /* The ethernet(like) device | 85 | struct net_device *real_dev; /* The ethernet(like) device |
| @@ -114,12 +115,24 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
| 114 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) | 115 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
| 115 | 116 | ||
| 116 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 117 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
| 118 | /* Must be invoked with rcu_read_lock or with RTNL. */ | ||
| 119 | static inline struct net_device *vlan_find_dev(struct net_device *real_dev, | ||
| 120 | u16 vlan_id) | ||
| 121 | { | ||
| 122 | struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp); | ||
| 123 | |||
| 124 | if (grp) | ||
| 125 | return vlan_group_get_device(grp, vlan_id); | ||
| 126 | |||
| 127 | return NULL; | ||
| 128 | } | ||
| 129 | |||
| 117 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | 130 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); |
| 118 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); | 131 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); |
| 119 | 132 | ||
| 120 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | 133 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
| 121 | u16 vlan_tci, int polling); | 134 | u16 vlan_tci, int polling); |
| 122 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); | 135 | extern bool vlan_hwaccel_do_receive(struct sk_buff **skb); |
| 123 | extern gro_result_t | 136 | extern gro_result_t |
| 124 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 137 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
| 125 | unsigned int vlan_tci, struct sk_buff *skb); | 138 | unsigned int vlan_tci, struct sk_buff *skb); |
| @@ -128,6 +141,12 @@ vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | |||
| 128 | unsigned int vlan_tci); | 141 | unsigned int vlan_tci); |
| 129 | 142 | ||
| 130 | #else | 143 | #else |
| 144 | static inline struct net_device *vlan_find_dev(struct net_device *real_dev, | ||
| 145 | u16 vlan_id) | ||
| 146 | { | ||
| 147 | return NULL; | ||
| 148 | } | ||
| 149 | |||
| 131 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 150 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
| 132 | { | 151 | { |
| 133 | BUG(); | 152 | BUG(); |
| @@ -147,9 +166,11 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
| 147 | return NET_XMIT_SUCCESS; | 166 | return NET_XMIT_SUCCESS; |
| 148 | } | 167 | } |
| 149 | 168 | ||
| 150 | static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) | 169 | static inline bool vlan_hwaccel_do_receive(struct sk_buff **skb) |
| 151 | { | 170 | { |
| 152 | return 0; | 171 | if ((*skb)->vlan_tci & VLAN_VID_MASK) |
| 172 | (*skb)->pkt_type = PACKET_OTHERHOST; | ||
| 173 | return false; | ||
| 153 | } | 174 | } |
| 154 | 175 | ||
| 155 | static inline gro_result_t | 176 | static 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 | |||
| 255 | static 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 | |||
| 253 | static inline bool ipv4_is_loopback(__be32 addr) | 272 | static 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/in6.h b/include/linux/in6.h index c4bf46f764bf..097a34b55560 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
| @@ -268,6 +268,10 @@ struct in6_flowlabel_req { | |||
| 268 | /* RFC5082: Generalized Ttl Security Mechanism */ | 268 | /* RFC5082: Generalized Ttl Security Mechanism */ |
| 269 | #define IPV6_MINHOPCOUNT 73 | 269 | #define IPV6_MINHOPCOUNT 73 |
| 270 | 270 | ||
| 271 | #define IPV6_ORIGDSTADDR 74 | ||
| 272 | #define IPV6_RECVORIGDSTADDR IPV6_ORIGDSTADDR | ||
| 273 | #define IPV6_TRANSPARENT 75 | ||
| 274 | |||
| 271 | /* | 275 | /* |
| 272 | * Multicast Routing: | 276 | * Multicast Routing: |
| 273 | * see include/linux/mroute6.h. | 277 | * see include/linux/mroute6.h. |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 2be1a1a2beb9..ccd5b07d678d 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 | ||
| 13 | enum | 14 | enum |
| 14 | { | 15 | { |
| @@ -158,7 +159,12 @@ struct in_ifaddr { | |||
| 158 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 159 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
| 159 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); | 160 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); |
| 160 | 161 | ||
| 161 | extern struct net_device *ip_dev_find(struct net *net, __be32 addr); | 162 | extern struct net_device *__ip_dev_find(struct net *net, __be32 addr, bool devref); |
| 163 | static inline struct net_device *ip_dev_find(struct net *net, __be32 addr) | ||
| 164 | { | ||
| 165 | return __ip_dev_find(net, addr, true); | ||
| 166 | } | ||
| 167 | |||
| 162 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); | 168 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
| 163 | extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); | 169 | extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); |
| 164 | extern void devinet_init(void); | 170 | extern void devinet_init(void); |
| @@ -198,14 +204,10 @@ static __inline__ int bad_mask(__be32 mask, __be32 addr) | |||
| 198 | 204 | ||
| 199 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) | 205 | static inline struct in_device *__in_dev_get_rcu(const struct net_device *dev) |
| 200 | { | 206 | { |
| 201 | struct in_device *in_dev = dev->ip_ptr; | 207 | return rcu_dereference(dev->ip_ptr); |
| 202 | if (in_dev) | ||
| 203 | in_dev = rcu_dereference(in_dev); | ||
| 204 | return in_dev; | ||
| 205 | } | 208 | } |
| 206 | 209 | ||
| 207 | static __inline__ struct in_device * | 210 | static inline struct in_device *in_dev_get(const struct net_device *dev) |
| 208 | in_dev_get(const struct net_device *dev) | ||
| 209 | { | 211 | { |
| 210 | struct in_device *in_dev; | 212 | struct in_device *in_dev; |
| 211 | 213 | ||
| @@ -217,10 +219,9 @@ in_dev_get(const struct net_device *dev) | |||
| 217 | return in_dev; | 219 | return in_dev; |
| 218 | } | 220 | } |
| 219 | 221 | ||
| 220 | static __inline__ struct in_device * | 222 | static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) |
| 221 | __in_dev_get_rtnl(const struct net_device *dev) | ||
| 222 | { | 223 | { |
| 223 | return (struct in_device*)dev->ip_ptr; | 224 | return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held()); |
| 224 | } | 225 | } |
| 225 | 226 | ||
| 226 | extern void in_dev_finish_destroy(struct in_device *idev); | 227 | extern void in_dev_finish_destroy(struct in_device *idev); |
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h index 9708de265bb1..5f43a3b2e3ad 100644 --- a/include/linux/ip_vs.h +++ b/include/linux/ip_vs.h | |||
| @@ -70,6 +70,7 @@ | |||
| 70 | 70 | ||
| 71 | /* | 71 | /* |
| 72 | * IPVS Connection Flags | 72 | * IPVS Connection Flags |
| 73 | * Only flags 0..15 are sent to backup server | ||
| 73 | */ | 74 | */ |
| 74 | #define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ | 75 | #define IP_VS_CONN_F_FWD_MASK 0x0007 /* mask for the fwd methods */ |
| 75 | #define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ | 76 | #define IP_VS_CONN_F_MASQ 0x0000 /* masquerading/NAT */ |
| @@ -88,9 +89,20 @@ | |||
| 88 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ | 89 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ |
| 89 | #define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ | 90 | #define IP_VS_CONN_F_ONE_PACKET 0x2000 /* forward only one packet */ |
| 90 | 91 | ||
| 92 | /* Flags that are not sent to backup server start from bit 16 */ | ||
| 93 | #define IP_VS_CONN_F_NFCT (1 << 16) /* use netfilter conntrack */ | ||
| 94 | |||
| 95 | /* Connection flags from destination that can be changed by user space */ | ||
| 96 | #define IP_VS_CONN_F_DEST_MASK (IP_VS_CONN_F_FWD_MASK | \ | ||
| 97 | IP_VS_CONN_F_ONE_PACKET | \ | ||
| 98 | IP_VS_CONN_F_NFCT | \ | ||
| 99 | 0) | ||
| 100 | |||
| 91 | #define IP_VS_SCHEDNAME_MAXLEN 16 | 101 | #define IP_VS_SCHEDNAME_MAXLEN 16 |
| 102 | #define IP_VS_PENAME_MAXLEN 16 | ||
| 92 | #define IP_VS_IFNAME_MAXLEN 16 | 103 | #define IP_VS_IFNAME_MAXLEN 16 |
| 93 | 104 | ||
| 105 | #define IP_VS_PEDATA_MAXLEN 255 | ||
| 94 | 106 | ||
| 95 | /* | 107 | /* |
| 96 | * The struct ip_vs_service_user and struct ip_vs_dest_user are | 108 | * The struct ip_vs_service_user and struct ip_vs_dest_user are |
| @@ -324,6 +336,9 @@ enum { | |||
| 324 | IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ | 336 | IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ |
| 325 | 337 | ||
| 326 | IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ | 338 | IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ |
| 339 | |||
| 340 | IPVS_SVC_ATTR_PE_NAME, /* name of ct retriever */ | ||
| 341 | |||
| 327 | __IPVS_SVC_ATTR_MAX, | 342 | __IPVS_SVC_ATTR_MAX, |
| 328 | }; | 343 | }; |
| 329 | 344 | ||
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index e62683ba88e6..8e429d0e0405 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
| @@ -341,7 +341,9 @@ struct ipv6_pinfo { | |||
| 341 | odstopts:1, | 341 | odstopts:1, |
| 342 | rxflow:1, | 342 | rxflow:1, |
| 343 | rxtclass:1, | 343 | rxtclass:1, |
| 344 | rxpmtu:1; | 344 | rxpmtu:1, |
| 345 | rxorigdstaddr:1; | ||
| 346 | /* 2 bits hole */ | ||
| 345 | } bits; | 347 | } bits; |
| 346 | __u16 all; | 348 | __u16 all; |
| 347 | } rxopt; | 349 | } rxopt; |
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); |
| 481 | int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); | 487 | int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr); |
| 482 | int mlx4_SYNC_TPT(struct mlx4_dev *dev); | 488 | int mlx4_SYNC_TPT(struct mlx4_dev *dev); |
| 489 | int mlx4_test_interrupts(struct mlx4_dev *dev); | ||
| 483 | 490 | ||
| 484 | #endif /* MLX4_DEVICE_H */ | 491 | #endif /* MLX4_DEVICE_H */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 33b2ea09a4ad..a36ab3bc7b03 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | #define SDIO_CLASS_PHS 0x06 /* PHS standard interface */ | 18 | #define SDIO_CLASS_PHS 0x06 /* PHS standard interface */ |
| 19 | #define SDIO_CLASS_WLAN 0x07 /* WLAN interface */ | 19 | #define SDIO_CLASS_WLAN 0x07 /* WLAN interface */ |
| 20 | #define SDIO_CLASS_ATA 0x08 /* Embedded SDIO-ATA std interface */ | 20 | #define SDIO_CLASS_ATA 0x08 /* Embedded SDIO-ATA std interface */ |
| 21 | #define SDIO_CLASS_BT_AMP 0x09 /* Type-A Bluetooth AMP interface */ | ||
| 21 | 22 | ||
| 22 | /* | 23 | /* |
| 23 | * Vendors and devices. Sort key: vendor first, device next. | 24 | * Vendors and devices. Sort key: vendor first, device next. |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index fa04b246c9ae..0fa7a3a874c8 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
| @@ -213,6 +213,7 @@ struct mfc_cache { | |||
| 213 | unsigned char ttls[MAXVIFS]; /* TTL thresholds */ | 213 | unsigned char ttls[MAXVIFS]; /* TTL thresholds */ |
| 214 | } res; | 214 | } res; |
| 215 | } mfc_un; | 215 | } mfc_un; |
| 216 | struct rcu_head rcu; | ||
| 216 | }; | 217 | }; |
| 217 | 218 | ||
| 218 | #define MFC_STATIC 1 | 219 | #define MFC_STATIC 1 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 46c36ffe20ee..fcd3dda86322 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 | ||
| @@ -281,6 +281,12 @@ struct hh_cache { | |||
| 281 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; | 281 | unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; |
| 282 | }; | 282 | }; |
| 283 | 283 | ||
| 284 | static inline void hh_cache_put(struct hh_cache *hh) | ||
| 285 | { | ||
| 286 | if (atomic_dec_and_test(&hh->hh_refcnt)) | ||
| 287 | kfree(hh); | ||
| 288 | } | ||
| 289 | |||
| 284 | /* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. | 290 | /* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. |
| 285 | * Alternative is: | 291 | * Alternative is: |
| 286 | * dev->hard_header_len ? (dev->hard_header_len + | 292 | * dev->hard_header_len ? (dev->hard_header_len + |
| @@ -884,6 +890,9 @@ struct net_device { | |||
| 884 | int iflink; | 890 | int iflink; |
| 885 | 891 | ||
| 886 | struct net_device_stats stats; | 892 | struct net_device_stats stats; |
| 893 | atomic_long_t rx_dropped; /* dropped packets by core network | ||
| 894 | * Do not use this in drivers. | ||
| 895 | */ | ||
| 887 | 896 | ||
| 888 | #ifdef CONFIG_WIRELESS_EXT | 897 | #ifdef CONFIG_WIRELESS_EXT |
| 889 | /* List of functions to handle Wireless Extensions (instead of ioctl). | 898 | /* List of functions to handle Wireless Extensions (instead of ioctl). |
| @@ -901,7 +910,7 @@ struct net_device { | |||
| 901 | 910 | ||
| 902 | unsigned int flags; /* interface flags (a la BSD) */ | 911 | unsigned int flags; /* interface flags (a la BSD) */ |
| 903 | unsigned short gflags; | 912 | unsigned short gflags; |
| 904 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ | 913 | unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ |
| 905 | unsigned short padded; /* How much padding added by alloc_netdev() */ | 914 | unsigned short padded; /* How much padding added by alloc_netdev() */ |
| 906 | 915 | ||
| 907 | unsigned char operstate; /* RFC2863 operstate */ | 916 | unsigned char operstate; /* RFC2863 operstate */ |
| @@ -918,10 +927,6 @@ struct net_device { | |||
| 918 | unsigned short needed_headroom; | 927 | unsigned short needed_headroom; |
| 919 | unsigned short needed_tailroom; | 928 | unsigned short needed_tailroom; |
| 920 | 929 | ||
| 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. */ | 930 | /* Interface address info. */ |
| 926 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | 931 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ |
| 927 | unsigned char addr_assign_type; /* hw address assignment type */ | 932 | unsigned char addr_assign_type; /* hw address assignment type */ |
| @@ -937,12 +942,15 @@ struct net_device { | |||
| 937 | 942 | ||
| 938 | 943 | ||
| 939 | /* Protocol specific pointers */ | 944 | /* Protocol specific pointers */ |
| 940 | 945 | ||
| 946 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
| 947 | struct vlan_group *vlgrp; /* VLAN group */ | ||
| 948 | #endif | ||
| 941 | #ifdef CONFIG_NET_DSA | 949 | #ifdef CONFIG_NET_DSA |
| 942 | void *dsa_ptr; /* dsa specific data */ | 950 | void *dsa_ptr; /* dsa specific data */ |
| 943 | #endif | 951 | #endif |
| 944 | void *atalk_ptr; /* AppleTalk link */ | 952 | void *atalk_ptr; /* AppleTalk link */ |
| 945 | void *ip_ptr; /* IPv4 specific data */ | 953 | struct in_device __rcu *ip_ptr; /* IPv4 specific data */ |
| 946 | void *dn_ptr; /* DECnet specific data */ | 954 | void *dn_ptr; /* DECnet specific data */ |
| 947 | void *ip6_ptr; /* IPv6 specific data */ | 955 | void *ip6_ptr; /* IPv6 specific data */ |
| 948 | void *ec_ptr; /* Econet specific data */ | 956 | void *ec_ptr; /* Econet specific data */ |
| @@ -951,9 +959,20 @@ struct net_device { | |||
| 951 | assign before registering */ | 959 | assign before registering */ |
| 952 | 960 | ||
| 953 | /* | 961 | /* |
| 954 | * Cache line mostly used on receive path (including eth_type_trans()) | 962 | * Cache lines mostly used on receive path (including eth_type_trans()) |
| 955 | */ | 963 | */ |
| 956 | unsigned long last_rx; /* Time of last Rx */ | 964 | unsigned long last_rx; /* Time of last Rx |
| 965 | * This should not be set in | ||
| 966 | * drivers, unless really needed, | ||
| 967 | * because network stack (bonding) | ||
| 968 | * use it if/when necessary, to | ||
| 969 | * avoid dirtying this cache line. | ||
| 970 | */ | ||
| 971 | |||
| 972 | struct net_device *master; /* Pointer to master device of a group, | ||
| 973 | * which this device is member of. | ||
| 974 | */ | ||
| 975 | |||
| 957 | /* Interface address info used in eth_type_trans() */ | 976 | /* Interface address info used in eth_type_trans() */ |
| 958 | unsigned char *dev_addr; /* hw address, (before bcast | 977 | unsigned char *dev_addr; /* hw address, (before bcast |
| 959 | because most packets are | 978 | because most packets are |
| @@ -969,14 +988,21 @@ struct net_device { | |||
| 969 | 988 | ||
| 970 | struct netdev_rx_queue *_rx; | 989 | struct netdev_rx_queue *_rx; |
| 971 | 990 | ||
| 972 | /* Number of RX queues allocated at alloc_netdev_mq() time */ | 991 | /* Number of RX queues allocated at register_netdev() time */ |
| 973 | unsigned int num_rx_queues; | 992 | unsigned int num_rx_queues; |
| 993 | |||
| 994 | /* Number of RX queues currently active in device */ | ||
| 995 | unsigned int real_num_rx_queues; | ||
| 974 | #endif | 996 | #endif |
| 975 | 997 | ||
| 976 | struct netdev_queue rx_queue; | ||
| 977 | rx_handler_func_t *rx_handler; | 998 | rx_handler_func_t *rx_handler; |
| 978 | void *rx_handler_data; | 999 | void *rx_handler_data; |
| 979 | 1000 | ||
| 1001 | struct netdev_queue __rcu *ingress_queue; | ||
| 1002 | |||
| 1003 | /* | ||
| 1004 | * Cache lines mostly used on transmit path | ||
| 1005 | */ | ||
| 980 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; | 1006 | struct netdev_queue *_tx ____cacheline_aligned_in_smp; |
| 981 | 1007 | ||
| 982 | /* Number of TX queues allocated at alloc_netdev_mq() time */ | 1008 | /* Number of TX queues allocated at alloc_netdev_mq() time */ |
| @@ -990,9 +1016,7 @@ struct net_device { | |||
| 990 | 1016 | ||
| 991 | unsigned long tx_queue_len; /* Max frames per queue allowed */ | 1017 | unsigned long tx_queue_len; /* Max frames per queue allowed */ |
| 992 | spinlock_t tx_global_lock; | 1018 | spinlock_t tx_global_lock; |
| 993 | /* | 1019 | |
| 994 | * One part is mostly used on xmit path (device) | ||
| 995 | */ | ||
| 996 | /* These may be needed for future network-power-down code. */ | 1020 | /* These may be needed for future network-power-down code. */ |
| 997 | 1021 | ||
| 998 | /* | 1022 | /* |
| @@ -1005,7 +1029,7 @@ struct net_device { | |||
| 1005 | struct timer_list watchdog_timer; | 1029 | struct timer_list watchdog_timer; |
| 1006 | 1030 | ||
| 1007 | /* Number of references to this device */ | 1031 | /* Number of references to this device */ |
| 1008 | atomic_t refcnt ____cacheline_aligned_in_smp; | 1032 | int __percpu *pcpu_refcnt; |
| 1009 | 1033 | ||
| 1010 | /* delayed register/unregister */ | 1034 | /* delayed register/unregister */ |
| 1011 | struct list_head todo_list; | 1035 | struct list_head todo_list; |
| @@ -1041,8 +1065,12 @@ struct net_device { | |||
| 1041 | #endif | 1065 | #endif |
| 1042 | 1066 | ||
| 1043 | /* mid-layer private */ | 1067 | /* mid-layer private */ |
| 1044 | void *ml_priv; | 1068 | union { |
| 1045 | 1069 | void *ml_priv; | |
| 1070 | struct pcpu_lstats __percpu *lstats; /* loopback stats */ | ||
| 1071 | struct pcpu_tstats __percpu *tstats; /* tunnel stats */ | ||
| 1072 | struct pcpu_dstats __percpu *dstats; /* dummy stats */ | ||
| 1073 | }; | ||
| 1046 | /* GARP */ | 1074 | /* GARP */ |
| 1047 | struct garp_port *garp_port; | 1075 | struct garp_port *garp_port; |
| 1048 | 1076 | ||
| @@ -1305,6 +1333,7 @@ static inline void unregister_netdevice(struct net_device *dev) | |||
| 1305 | unregister_netdevice_queue(dev, NULL); | 1333 | unregister_netdevice_queue(dev, NULL); |
| 1306 | } | 1334 | } |
| 1307 | 1335 | ||
| 1336 | extern int netdev_refcnt_read(const struct net_device *dev); | ||
| 1308 | extern void free_netdev(struct net_device *dev); | 1337 | extern void free_netdev(struct net_device *dev); |
| 1309 | extern void synchronize_net(void); | 1338 | extern void synchronize_net(void); |
| 1310 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1339 | extern int register_netdevice_notifier(struct notifier_block *nb); |
| @@ -1667,11 +1696,34 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) | |||
| 1667 | */ | 1696 | */ |
| 1668 | static inline int netif_is_multiqueue(const struct net_device *dev) | 1697 | static inline int netif_is_multiqueue(const struct net_device *dev) |
| 1669 | { | 1698 | { |
| 1670 | return (dev->num_tx_queues > 1); | 1699 | return dev->num_tx_queues > 1; |
| 1671 | } | 1700 | } |
| 1672 | 1701 | ||
| 1673 | extern void netif_set_real_num_tx_queues(struct net_device *dev, | 1702 | extern int netif_set_real_num_tx_queues(struct net_device *dev, |
| 1674 | unsigned int txq); | 1703 | unsigned int txq); |
| 1704 | |||
| 1705 | #ifdef CONFIG_RPS | ||
| 1706 | extern int netif_set_real_num_rx_queues(struct net_device *dev, | ||
| 1707 | unsigned int rxq); | ||
| 1708 | #else | ||
| 1709 | static inline int netif_set_real_num_rx_queues(struct net_device *dev, | ||
| 1710 | unsigned int rxq) | ||
| 1711 | { | ||
| 1712 | return 0; | ||
| 1713 | } | ||
| 1714 | #endif | ||
| 1715 | |||
| 1716 | static inline int netif_copy_real_num_queues(struct net_device *to_dev, | ||
| 1717 | const struct net_device *from_dev) | ||
| 1718 | { | ||
| 1719 | netif_set_real_num_tx_queues(to_dev, from_dev->real_num_tx_queues); | ||
| 1720 | #ifdef CONFIG_RPS | ||
| 1721 | return netif_set_real_num_rx_queues(to_dev, | ||
| 1722 | from_dev->real_num_rx_queues); | ||
| 1723 | #else | ||
| 1724 | return 0; | ||
| 1725 | #endif | ||
| 1726 | } | ||
| 1675 | 1727 | ||
| 1676 | /* Use this variant when it is known for sure that it | 1728 | /* Use this variant when it is known for sure that it |
| 1677 | * is executing from hardware interrupt context or with hardware interrupts | 1729 | * is executing from hardware interrupt context or with hardware interrupts |
| @@ -1695,8 +1747,7 @@ extern gro_result_t dev_gro_receive(struct napi_struct *napi, | |||
| 1695 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); | 1747 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); |
| 1696 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, | 1748 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, |
| 1697 | struct sk_buff *skb); | 1749 | struct sk_buff *skb); |
| 1698 | extern void napi_reuse_skb(struct napi_struct *napi, | 1750 | extern void napi_gro_flush(struct napi_struct *napi); |
| 1699 | struct sk_buff *skb); | ||
| 1700 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); | 1751 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); |
| 1701 | extern gro_result_t napi_frags_finish(struct napi_struct *napi, | 1752 | extern gro_result_t napi_frags_finish(struct napi_struct *napi, |
| 1702 | struct sk_buff *skb, | 1753 | struct sk_buff *skb, |
| @@ -1715,7 +1766,6 @@ extern int netdev_rx_handler_register(struct net_device *dev, | |||
| 1715 | void *rx_handler_data); | 1766 | void *rx_handler_data); |
| 1716 | extern void netdev_rx_handler_unregister(struct net_device *dev); | 1767 | extern void netdev_rx_handler_unregister(struct net_device *dev); |
| 1717 | 1768 | ||
| 1718 | extern void netif_nit_deliver(struct sk_buff *skb); | ||
| 1719 | extern int dev_valid_name(const char *name); | 1769 | extern int dev_valid_name(const char *name); |
| 1720 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1770 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
| 1721 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1771 | extern int dev_ethtool(struct net *net, struct ifreq *); |
| @@ -1749,7 +1799,7 @@ extern void netdev_run_todo(void); | |||
| 1749 | */ | 1799 | */ |
| 1750 | static inline void dev_put(struct net_device *dev) | 1800 | static inline void dev_put(struct net_device *dev) |
| 1751 | { | 1801 | { |
| 1752 | atomic_dec(&dev->refcnt); | 1802 | irqsafe_cpu_dec(*dev->pcpu_refcnt); |
| 1753 | } | 1803 | } |
| 1754 | 1804 | ||
| 1755 | /** | 1805 | /** |
| @@ -1760,7 +1810,7 @@ static inline void dev_put(struct net_device *dev) | |||
| 1760 | */ | 1810 | */ |
| 1761 | static inline void dev_hold(struct net_device *dev) | 1811 | static inline void dev_hold(struct net_device *dev) |
| 1762 | { | 1812 | { |
| 1763 | atomic_inc(&dev->refcnt); | 1813 | irqsafe_cpu_inc(*dev->pcpu_refcnt); |
| 1764 | } | 1814 | } |
| 1765 | 1815 | ||
| 1766 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on | 1816 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on |
| @@ -2171,6 +2221,8 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
| 2171 | extern int netdev_class_create_file(struct class_attribute *class_attr); | 2221 | extern int netdev_class_create_file(struct class_attribute *class_attr); |
| 2172 | extern void netdev_class_remove_file(struct class_attribute *class_attr); | 2222 | extern void netdev_class_remove_file(struct class_attribute *class_attr); |
| 2173 | 2223 | ||
| 2224 | extern struct kobj_ns_type_operations net_ns_type_operations; | ||
| 2225 | |||
| 2174 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); | 2226 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); |
| 2175 | 2227 | ||
| 2176 | extern void linkwatch_run_queue(void); | 2228 | extern void linkwatch_run_queue(void); |
| @@ -2191,14 +2243,22 @@ static inline int net_gso_ok(int features, int gso_type) | |||
| 2191 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | 2243 | static inline int skb_gso_ok(struct sk_buff *skb, int features) |
| 2192 | { | 2244 | { |
| 2193 | return net_gso_ok(features, skb_shinfo(skb)->gso_type) && | 2245 | return net_gso_ok(features, skb_shinfo(skb)->gso_type) && |
| 2194 | (!skb_has_frags(skb) || (features & NETIF_F_FRAGLIST)); | 2246 | (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST)); |
| 2195 | } | 2247 | } |
| 2196 | 2248 | ||
| 2197 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 2249 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
| 2198 | { | 2250 | { |
| 2199 | return skb_is_gso(skb) && | 2251 | if (skb_is_gso(skb)) { |
| 2200 | (!skb_gso_ok(skb, dev->features) || | 2252 | int features = dev->features; |
| 2201 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 2253 | |
| 2254 | if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci) | ||
| 2255 | features &= dev->vlan_features; | ||
| 2256 | |||
| 2257 | return (!skb_gso_ok(skb, features) || | ||
| 2258 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | ||
| 2259 | } | ||
| 2260 | |||
| 2261 | return 0; | ||
| 2202 | } | 2262 | } |
| 2203 | 2263 | ||
| 2204 | static inline void netif_set_gso_max_size(struct net_device *dev, | 2264 | static inline void netif_set_gso_max_size(struct net_device *dev, |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 1afd18c855ec..50cdc2559a5a 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -98,8 +98,14 @@ enum ip_conntrack_events { | |||
| 98 | 98 | ||
| 99 | enum ip_conntrack_expect_events { | 99 | enum ip_conntrack_expect_events { |
| 100 | IPEXP_NEW, /* new expectation */ | 100 | IPEXP_NEW, /* new expectation */ |
| 101 | IPEXP_DESTROY, /* destroyed expectation */ | ||
| 101 | }; | 102 | }; |
| 102 | 103 | ||
| 104 | /* expectation flags */ | ||
| 105 | #define NF_CT_EXPECT_PERMANENT 0x1 | ||
| 106 | #define NF_CT_EXPECT_INACTIVE 0x2 | ||
| 107 | #define NF_CT_EXPECT_USERSPACE 0x4 | ||
| 108 | |||
| 103 | #ifdef __KERNEL__ | 109 | #ifdef __KERNEL__ |
| 104 | struct ip_conntrack_stat { | 110 | struct ip_conntrack_stat { |
| 105 | unsigned int searched; | 111 | unsigned int searched; |
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index ff8cfbcf3b81..0ce91d56a5f2 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
| @@ -89,6 +89,7 @@ enum sip_header_types { | |||
| 89 | SIP_HDR_VIA_TCP, | 89 | SIP_HDR_VIA_TCP, |
| 90 | SIP_HDR_EXPIRES, | 90 | SIP_HDR_EXPIRES, |
| 91 | SIP_HDR_CONTENT_LENGTH, | 91 | SIP_HDR_CONTENT_LENGTH, |
| 92 | SIP_HDR_CALL_ID, | ||
| 92 | }; | 93 | }; |
| 93 | 94 | ||
| 94 | enum sdp_header_types { | 95 | enum sdp_header_types { |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 70cd0603911c..19711e3ffd42 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
| @@ -162,6 +162,7 @@ enum ctattr_expect { | |||
| 162 | CTA_EXPECT_ID, | 162 | CTA_EXPECT_ID, |
| 163 | CTA_EXPECT_HELP_NAME, | 163 | CTA_EXPECT_HELP_NAME, |
| 164 | CTA_EXPECT_ZONE, | 164 | CTA_EXPECT_ZONE, |
| 165 | CTA_EXPECT_FLAGS, | ||
| 165 | __CTA_EXPECT_MAX | 166 | __CTA_EXPECT_MAX |
| 166 | }; | 167 | }; |
| 167 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) | 168 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 24e5d01d27d0..742bec051440 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -66,6 +66,11 @@ struct xt_standard_target { | |||
| 66 | int verdict; | 66 | int verdict; |
| 67 | }; | 67 | }; |
| 68 | 68 | ||
| 69 | struct xt_error_target { | ||
| 70 | struct xt_entry_target target; | ||
| 71 | char errorname[XT_FUNCTION_MAXNAMELEN]; | ||
| 72 | }; | ||
| 73 | |||
| 69 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision | 74 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision |
| 70 | * kernel supports, if >= revision. */ | 75 | * kernel supports, if >= revision. */ |
| 71 | struct xt_get_revision { | 76 | struct xt_get_revision { |
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/linux/netfilter/xt_TPROXY.h index 152e8f97132b..3f3d69361289 100644 --- a/include/linux/netfilter/xt_TPROXY.h +++ b/include/linux/netfilter/xt_TPROXY.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | #ifndef _XT_TPROXY_H_target | 1 | #ifndef _XT_TPROXY_H |
| 2 | #define _XT_TPROXY_H_target | 2 | #define _XT_TPROXY_H |
| 3 | 3 | ||
| 4 | /* TPROXY target is capable of marking the packet to perform | 4 | /* TPROXY target is capable of marking the packet to perform |
| 5 | * redirection. We can get rid of that whenever we get support for | 5 | * redirection. We can get rid of that whenever we get support for |
| @@ -11,4 +11,11 @@ struct xt_tproxy_target_info { | |||
| 11 | __be16 lport; | 11 | __be16 lport; |
| 12 | }; | 12 | }; |
| 13 | 13 | ||
| 14 | #endif /* _XT_TPROXY_H_target */ | 14 | struct xt_tproxy_target_info_v1 { |
| 15 | u_int32_t mark_mask; | ||
| 16 | u_int32_t mark_value; | ||
| 17 | union nf_inet_addr laddr; | ||
| 18 | __be16 lport; | ||
| 19 | }; | ||
| 20 | |||
| 21 | #endif /* _XT_TPROXY_H */ | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index e9948c0560f6..adbf4bff87ed 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -21,8 +21,21 @@ | |||
| 21 | 21 | ||
| 22 | #include <linux/netfilter/x_tables.h> | 22 | #include <linux/netfilter/x_tables.h> |
| 23 | 23 | ||
| 24 | #ifndef __KERNEL__ | ||
| 24 | #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN | 25 | #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN |
| 25 | #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN | 26 | #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN |
| 27 | #define arpt_entry_target xt_entry_target | ||
| 28 | #define arpt_standard_target xt_standard_target | ||
| 29 | #define arpt_error_target xt_error_target | ||
| 30 | #define ARPT_CONTINUE XT_CONTINUE | ||
| 31 | #define ARPT_RETURN XT_RETURN | ||
| 32 | #define arpt_counters_info xt_counters_info | ||
| 33 | #define arpt_counters xt_counters | ||
| 34 | #define ARPT_STANDARD_TARGET XT_STANDARD_TARGET | ||
| 35 | #define ARPT_ERROR_TARGET XT_ERROR_TARGET | ||
| 36 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 37 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) | ||
| 38 | #endif | ||
| 26 | 39 | ||
| 27 | #define ARPT_DEV_ADDR_LEN_MAX 16 | 40 | #define ARPT_DEV_ADDR_LEN_MAX 16 |
| 28 | 41 | ||
| @@ -63,9 +76,6 @@ struct arpt_arp { | |||
| 63 | u_int16_t invflags; | 76 | u_int16_t invflags; |
| 64 | }; | 77 | }; |
| 65 | 78 | ||
| 66 | #define arpt_entry_target xt_entry_target | ||
| 67 | #define arpt_standard_target xt_standard_target | ||
| 68 | |||
| 69 | /* Values for "flag" field in struct arpt_ip (general arp structure). | 79 | /* Values for "flag" field in struct arpt_ip (general arp structure). |
| 70 | * No flags defined yet. | 80 | * No flags defined yet. |
| 71 | */ | 81 | */ |
| @@ -125,16 +135,10 @@ struct arpt_entry | |||
| 125 | #define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3) | 135 | #define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3) |
| 126 | #define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET) | 136 | #define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET) |
| 127 | 137 | ||
| 128 | /* CONTINUE verdict for targets */ | ||
| 129 | #define ARPT_CONTINUE XT_CONTINUE | ||
| 130 | |||
| 131 | /* For standard target */ | ||
| 132 | #define ARPT_RETURN XT_RETURN | ||
| 133 | |||
| 134 | /* The argument to ARPT_SO_GET_INFO */ | 138 | /* The argument to ARPT_SO_GET_INFO */ |
| 135 | struct arpt_getinfo { | 139 | struct arpt_getinfo { |
| 136 | /* Which table: caller fills this in. */ | 140 | /* Which table: caller fills this in. */ |
| 137 | char name[ARPT_TABLE_MAXNAMELEN]; | 141 | char name[XT_TABLE_MAXNAMELEN]; |
| 138 | 142 | ||
| 139 | /* Kernel fills these in. */ | 143 | /* Kernel fills these in. */ |
| 140 | /* Which hook entry points are valid: bitmask */ | 144 | /* Which hook entry points are valid: bitmask */ |
| @@ -156,7 +160,7 @@ struct arpt_getinfo { | |||
| 156 | /* The argument to ARPT_SO_SET_REPLACE. */ | 160 | /* The argument to ARPT_SO_SET_REPLACE. */ |
| 157 | struct arpt_replace { | 161 | struct arpt_replace { |
| 158 | /* Which table. */ | 162 | /* Which table. */ |
| 159 | char name[ARPT_TABLE_MAXNAMELEN]; | 163 | char name[XT_TABLE_MAXNAMELEN]; |
| 160 | 164 | ||
| 161 | /* Which hook entry points are valid: bitmask. You can't | 165 | /* Which hook entry points are valid: bitmask. You can't |
| 162 | change this. */ | 166 | change this. */ |
| @@ -184,14 +188,10 @@ struct arpt_replace { | |||
| 184 | struct arpt_entry entries[0]; | 188 | struct arpt_entry entries[0]; |
| 185 | }; | 189 | }; |
| 186 | 190 | ||
| 187 | /* The argument to ARPT_SO_ADD_COUNTERS. */ | ||
| 188 | #define arpt_counters_info xt_counters_info | ||
| 189 | #define arpt_counters xt_counters | ||
| 190 | |||
| 191 | /* The argument to ARPT_SO_GET_ENTRIES. */ | 191 | /* The argument to ARPT_SO_GET_ENTRIES. */ |
| 192 | struct arpt_get_entries { | 192 | struct arpt_get_entries { |
| 193 | /* Which table: user fills this in. */ | 193 | /* Which table: user fills this in. */ |
| 194 | char name[ARPT_TABLE_MAXNAMELEN]; | 194 | char name[XT_TABLE_MAXNAMELEN]; |
| 195 | 195 | ||
| 196 | /* User fills this in: total entry size. */ | 196 | /* User fills this in: total entry size. */ |
| 197 | unsigned int size; | 197 | unsigned int size; |
| @@ -200,23 +200,12 @@ struct arpt_get_entries { | |||
| 200 | struct arpt_entry entrytable[0]; | 200 | struct arpt_entry entrytable[0]; |
| 201 | }; | 201 | }; |
| 202 | 202 | ||
| 203 | /* Standard return verdict, or do jump. */ | ||
| 204 | #define ARPT_STANDARD_TARGET XT_STANDARD_TARGET | ||
| 205 | /* Error verdict. */ | ||
| 206 | #define ARPT_ERROR_TARGET XT_ERROR_TARGET | ||
| 207 | |||
| 208 | /* Helper functions */ | 203 | /* Helper functions */ |
| 209 | static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e) | 204 | static __inline__ struct xt_entry_target *arpt_get_target(struct arpt_entry *e) |
| 210 | { | 205 | { |
| 211 | return (void *)e + e->target_offset; | 206 | return (void *)e + e->target_offset; |
| 212 | } | 207 | } |
| 213 | 208 | ||
| 214 | #ifndef __KERNEL__ | ||
| 215 | /* fn returns 0 to continue iteration */ | ||
| 216 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 217 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) | ||
| 218 | #endif | ||
| 219 | |||
| 220 | /* | 209 | /* |
| 221 | * Main firewall chains definitions and global var's definitions. | 210 | * Main firewall chains definitions and global var's definitions. |
| 222 | */ | 211 | */ |
| @@ -225,17 +214,12 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
| 225 | /* Standard entry. */ | 214 | /* Standard entry. */ |
| 226 | struct arpt_standard { | 215 | struct arpt_standard { |
| 227 | struct arpt_entry entry; | 216 | struct arpt_entry entry; |
| 228 | struct arpt_standard_target target; | 217 | struct xt_standard_target target; |
| 229 | }; | ||
| 230 | |||
| 231 | struct arpt_error_target { | ||
| 232 | struct arpt_entry_target target; | ||
| 233 | char errorname[ARPT_FUNCTION_MAXNAMELEN]; | ||
| 234 | }; | 218 | }; |
| 235 | 219 | ||
| 236 | struct arpt_error { | 220 | struct arpt_error { |
| 237 | struct arpt_entry entry; | 221 | struct arpt_entry entry; |
| 238 | struct arpt_error_target target; | 222 | struct xt_error_target target; |
| 239 | }; | 223 | }; |
| 240 | 224 | ||
| 241 | #define ARPT_ENTRY_INIT(__size) \ | 225 | #define ARPT_ENTRY_INIT(__size) \ |
| @@ -247,16 +231,16 @@ struct arpt_error { | |||
| 247 | #define ARPT_STANDARD_INIT(__verdict) \ | 231 | #define ARPT_STANDARD_INIT(__verdict) \ |
| 248 | { \ | 232 | { \ |
| 249 | .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ | 233 | .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_standard)), \ |
| 250 | .target = XT_TARGET_INIT(ARPT_STANDARD_TARGET, \ | 234 | .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \ |
| 251 | sizeof(struct arpt_standard_target)), \ | 235 | sizeof(struct xt_standard_target)), \ |
| 252 | .target.verdict = -(__verdict) - 1, \ | 236 | .target.verdict = -(__verdict) - 1, \ |
| 253 | } | 237 | } |
| 254 | 238 | ||
| 255 | #define ARPT_ERROR_INIT \ | 239 | #define ARPT_ERROR_INIT \ |
| 256 | { \ | 240 | { \ |
| 257 | .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \ | 241 | .entry = ARPT_ENTRY_INIT(sizeof(struct arpt_error)), \ |
| 258 | .target = XT_TARGET_INIT(ARPT_ERROR_TARGET, \ | 242 | .target = XT_TARGET_INIT(XT_ERROR_TARGET, \ |
| 259 | sizeof(struct arpt_error_target)), \ | 243 | sizeof(struct xt_error_target)), \ |
| 260 | .target.errorname = "ERROR", \ | 244 | .target.errorname = "ERROR", \ |
| 261 | } | 245 | } |
| 262 | 246 | ||
| @@ -271,8 +255,6 @@ extern unsigned int arpt_do_table(struct sk_buff *skb, | |||
| 271 | const struct net_device *out, | 255 | const struct net_device *out, |
| 272 | struct xt_table *table); | 256 | struct xt_table *table); |
| 273 | 257 | ||
| 274 | #define ARPT_ALIGN(s) XT_ALIGN(s) | ||
| 275 | |||
| 276 | #ifdef CONFIG_COMPAT | 258 | #ifdef CONFIG_COMPAT |
| 277 | #include <net/compat.h> | 259 | #include <net/compat.h> |
| 278 | 260 | ||
| @@ -285,14 +267,12 @@ struct compat_arpt_entry { | |||
| 285 | unsigned char elems[0]; | 267 | unsigned char elems[0]; |
| 286 | }; | 268 | }; |
| 287 | 269 | ||
| 288 | static inline struct arpt_entry_target * | 270 | static inline struct xt_entry_target * |
| 289 | compat_arpt_get_target(struct compat_arpt_entry *e) | 271 | compat_arpt_get_target(struct compat_arpt_entry *e) |
| 290 | { | 272 | { |
| 291 | return (void *)e + e->target_offset; | 273 | return (void *)e + e->target_offset; |
| 292 | } | 274 | } |
| 293 | 275 | ||
| 294 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
| 295 | |||
| 296 | #endif /* CONFIG_COMPAT */ | 276 | #endif /* CONFIG_COMPAT */ |
| 297 | #endif /*__KERNEL__*/ | 277 | #endif /*__KERNEL__*/ |
| 298 | #endif /* _ARPTABLES_H */ | 278 | #endif /* _ARPTABLES_H */ |
diff --git a/include/linux/netfilter_bridge/Kbuild b/include/linux/netfilter_bridge/Kbuild index d4d78672873e..e48f1a3f5a4a 100644 --- a/include/linux/netfilter_bridge/Kbuild +++ b/include/linux/netfilter_bridge/Kbuild | |||
| @@ -3,11 +3,13 @@ header-y += ebt_among.h | |||
| 3 | header-y += ebt_arp.h | 3 | header-y += ebt_arp.h |
| 4 | header-y += ebt_arpreply.h | 4 | header-y += ebt_arpreply.h |
| 5 | header-y += ebt_ip.h | 5 | header-y += ebt_ip.h |
| 6 | header-y += ebt_ip6.h | ||
| 6 | header-y += ebt_limit.h | 7 | header-y += ebt_limit.h |
| 7 | header-y += ebt_log.h | 8 | header-y += ebt_log.h |
| 8 | header-y += ebt_mark_m.h | 9 | header-y += ebt_mark_m.h |
| 9 | header-y += ebt_mark_t.h | 10 | header-y += ebt_mark_t.h |
| 10 | header-y += ebt_nat.h | 11 | header-y += ebt_nat.h |
| 12 | header-y += ebt_nflog.h | ||
| 11 | header-y += ebt_pkttype.h | 13 | header-y += ebt_pkttype.h |
| 12 | header-y += ebt_redirect.h | 14 | header-y += ebt_redirect.h |
| 13 | header-y += ebt_stp.h | 15 | header-y += ebt_stp.h |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 704a7b6e8169..64a5d95c58e8 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -27,12 +27,49 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/netfilter/x_tables.h> | 28 | #include <linux/netfilter/x_tables.h> |
| 29 | 29 | ||
| 30 | #ifndef __KERNEL__ | ||
| 30 | #define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN | 31 | #define IPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN |
| 31 | #define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN | 32 | #define IPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN |
| 32 | #define ipt_match xt_match | 33 | #define ipt_match xt_match |
| 33 | #define ipt_target xt_target | 34 | #define ipt_target xt_target |
| 34 | #define ipt_table xt_table | 35 | #define ipt_table xt_table |
| 35 | #define ipt_get_revision xt_get_revision | 36 | #define ipt_get_revision xt_get_revision |
| 37 | #define ipt_entry_match xt_entry_match | ||
| 38 | #define ipt_entry_target xt_entry_target | ||
| 39 | #define ipt_standard_target xt_standard_target | ||
| 40 | #define ipt_error_target xt_error_target | ||
| 41 | #define ipt_counters xt_counters | ||
| 42 | #define IPT_CONTINUE XT_CONTINUE | ||
| 43 | #define IPT_RETURN XT_RETURN | ||
| 44 | |||
| 45 | /* This group is older than old (iptables < v1.4.0-rc1~89) */ | ||
| 46 | #include <linux/netfilter/xt_tcpudp.h> | ||
| 47 | #define ipt_udp xt_udp | ||
| 48 | #define ipt_tcp xt_tcp | ||
| 49 | #define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT | ||
| 50 | #define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT | ||
| 51 | #define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS | ||
| 52 | #define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION | ||
| 53 | #define IPT_TCP_INV_MASK XT_TCP_INV_MASK | ||
| 54 | #define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT | ||
| 55 | #define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT | ||
| 56 | #define IPT_UDP_INV_MASK XT_UDP_INV_MASK | ||
| 57 | |||
| 58 | /* The argument to IPT_SO_ADD_COUNTERS. */ | ||
| 59 | #define ipt_counters_info xt_counters_info | ||
| 60 | /* Standard return verdict, or do jump. */ | ||
| 61 | #define IPT_STANDARD_TARGET XT_STANDARD_TARGET | ||
| 62 | /* Error verdict. */ | ||
| 63 | #define IPT_ERROR_TARGET XT_ERROR_TARGET | ||
| 64 | |||
| 65 | /* fn returns 0 to continue iteration */ | ||
| 66 | #define IPT_MATCH_ITERATE(e, fn, args...) \ | ||
| 67 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) | ||
| 68 | |||
| 69 | /* fn returns 0 to continue iteration */ | ||
| 70 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 71 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) | ||
| 72 | #endif | ||
| 36 | 73 | ||
| 37 | /* Yes, Virginia, you have to zero the padding. */ | 74 | /* Yes, Virginia, you have to zero the padding. */ |
| 38 | struct ipt_ip { | 75 | struct ipt_ip { |
| @@ -52,12 +89,6 @@ struct ipt_ip { | |||
| 52 | u_int8_t invflags; | 89 | u_int8_t invflags; |
| 53 | }; | 90 | }; |
| 54 | 91 | ||
| 55 | #define ipt_entry_match xt_entry_match | ||
| 56 | #define ipt_entry_target xt_entry_target | ||
| 57 | #define ipt_standard_target xt_standard_target | ||
| 58 | |||
| 59 | #define ipt_counters xt_counters | ||
| 60 | |||
| 61 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ | 92 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ |
| 62 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ | 93 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ |
| 63 | #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ | 94 | #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ |
| @@ -116,23 +147,6 @@ struct ipt_entry { | |||
| 116 | #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) | 147 | #define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3) |
| 117 | #define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET | 148 | #define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET |
| 118 | 149 | ||
| 119 | #define IPT_CONTINUE XT_CONTINUE | ||
| 120 | #define IPT_RETURN XT_RETURN | ||
| 121 | |||
| 122 | #include <linux/netfilter/xt_tcpudp.h> | ||
| 123 | #define ipt_udp xt_udp | ||
| 124 | #define ipt_tcp xt_tcp | ||
| 125 | |||
| 126 | #define IPT_TCP_INV_SRCPT XT_TCP_INV_SRCPT | ||
| 127 | #define IPT_TCP_INV_DSTPT XT_TCP_INV_DSTPT | ||
| 128 | #define IPT_TCP_INV_FLAGS XT_TCP_INV_FLAGS | ||
| 129 | #define IPT_TCP_INV_OPTION XT_TCP_INV_OPTION | ||
| 130 | #define IPT_TCP_INV_MASK XT_TCP_INV_MASK | ||
| 131 | |||
| 132 | #define IPT_UDP_INV_SRCPT XT_UDP_INV_SRCPT | ||
| 133 | #define IPT_UDP_INV_DSTPT XT_UDP_INV_DSTPT | ||
| 134 | #define IPT_UDP_INV_MASK XT_UDP_INV_MASK | ||
| 135 | |||
| 136 | /* ICMP matching stuff */ | 150 | /* ICMP matching stuff */ |
| 137 | struct ipt_icmp { | 151 | struct ipt_icmp { |
| 138 | u_int8_t type; /* type to match */ | 152 | u_int8_t type; /* type to match */ |
| @@ -146,7 +160,7 @@ struct ipt_icmp { | |||
| 146 | /* The argument to IPT_SO_GET_INFO */ | 160 | /* The argument to IPT_SO_GET_INFO */ |
| 147 | struct ipt_getinfo { | 161 | struct ipt_getinfo { |
| 148 | /* Which table: caller fills this in. */ | 162 | /* Which table: caller fills this in. */ |
| 149 | char name[IPT_TABLE_MAXNAMELEN]; | 163 | char name[XT_TABLE_MAXNAMELEN]; |
| 150 | 164 | ||
| 151 | /* Kernel fills these in. */ | 165 | /* Kernel fills these in. */ |
| 152 | /* Which hook entry points are valid: bitmask */ | 166 | /* Which hook entry points are valid: bitmask */ |
| @@ -168,7 +182,7 @@ struct ipt_getinfo { | |||
| 168 | /* The argument to IPT_SO_SET_REPLACE. */ | 182 | /* The argument to IPT_SO_SET_REPLACE. */ |
| 169 | struct ipt_replace { | 183 | struct ipt_replace { |
| 170 | /* Which table. */ | 184 | /* Which table. */ |
| 171 | char name[IPT_TABLE_MAXNAMELEN]; | 185 | char name[XT_TABLE_MAXNAMELEN]; |
| 172 | 186 | ||
| 173 | /* Which hook entry points are valid: bitmask. You can't | 187 | /* Which hook entry points are valid: bitmask. You can't |
| 174 | change this. */ | 188 | change this. */ |
| @@ -196,13 +210,10 @@ struct ipt_replace { | |||
| 196 | struct ipt_entry entries[0]; | 210 | struct ipt_entry entries[0]; |
| 197 | }; | 211 | }; |
| 198 | 212 | ||
| 199 | /* The argument to IPT_SO_ADD_COUNTERS. */ | ||
| 200 | #define ipt_counters_info xt_counters_info | ||
| 201 | |||
| 202 | /* The argument to IPT_SO_GET_ENTRIES. */ | 213 | /* The argument to IPT_SO_GET_ENTRIES. */ |
| 203 | struct ipt_get_entries { | 214 | struct ipt_get_entries { |
| 204 | /* Which table: user fills this in. */ | 215 | /* Which table: user fills this in. */ |
| 205 | char name[IPT_TABLE_MAXNAMELEN]; | 216 | char name[XT_TABLE_MAXNAMELEN]; |
| 206 | 217 | ||
| 207 | /* User fills this in: total entry size. */ | 218 | /* User fills this in: total entry size. */ |
| 208 | unsigned int size; | 219 | unsigned int size; |
| @@ -211,28 +222,13 @@ struct ipt_get_entries { | |||
| 211 | struct ipt_entry entrytable[0]; | 222 | struct ipt_entry entrytable[0]; |
| 212 | }; | 223 | }; |
| 213 | 224 | ||
| 214 | /* Standard return verdict, or do jump. */ | ||
| 215 | #define IPT_STANDARD_TARGET XT_STANDARD_TARGET | ||
| 216 | /* Error verdict. */ | ||
| 217 | #define IPT_ERROR_TARGET XT_ERROR_TARGET | ||
| 218 | |||
| 219 | /* Helper functions */ | 225 | /* Helper functions */ |
| 220 | static __inline__ struct ipt_entry_target * | 226 | static __inline__ struct xt_entry_target * |
| 221 | ipt_get_target(struct ipt_entry *e) | 227 | ipt_get_target(struct ipt_entry *e) |
| 222 | { | 228 | { |
| 223 | return (void *)e + e->target_offset; | 229 | return (void *)e + e->target_offset; |
| 224 | } | 230 | } |
| 225 | 231 | ||
| 226 | #ifndef __KERNEL__ | ||
| 227 | /* fn returns 0 to continue iteration */ | ||
| 228 | #define IPT_MATCH_ITERATE(e, fn, args...) \ | ||
| 229 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) | ||
| 230 | |||
| 231 | /* fn returns 0 to continue iteration */ | ||
| 232 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 233 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) | ||
| 234 | #endif | ||
| 235 | |||
| 236 | /* | 232 | /* |
| 237 | * Main firewall chains definitions and global var's definitions. | 233 | * Main firewall chains definitions and global var's definitions. |
| 238 | */ | 234 | */ |
| @@ -249,17 +245,12 @@ extern void ipt_unregister_table(struct net *net, struct xt_table *table); | |||
| 249 | /* Standard entry. */ | 245 | /* Standard entry. */ |
| 250 | struct ipt_standard { | 246 | struct ipt_standard { |
| 251 | struct ipt_entry entry; | 247 | struct ipt_entry entry; |
| 252 | struct ipt_standard_target target; | 248 | struct xt_standard_target target; |
| 253 | }; | ||
| 254 | |||
| 255 | struct ipt_error_target { | ||
| 256 | struct ipt_entry_target target; | ||
| 257 | char errorname[IPT_FUNCTION_MAXNAMELEN]; | ||
| 258 | }; | 249 | }; |
| 259 | 250 | ||
| 260 | struct ipt_error { | 251 | struct ipt_error { |
| 261 | struct ipt_entry entry; | 252 | struct ipt_entry entry; |
| 262 | struct ipt_error_target target; | 253 | struct xt_error_target target; |
| 263 | }; | 254 | }; |
| 264 | 255 | ||
| 265 | #define IPT_ENTRY_INIT(__size) \ | 256 | #define IPT_ENTRY_INIT(__size) \ |
| @@ -271,7 +262,7 @@ struct ipt_error { | |||
| 271 | #define IPT_STANDARD_INIT(__verdict) \ | 262 | #define IPT_STANDARD_INIT(__verdict) \ |
| 272 | { \ | 263 | { \ |
| 273 | .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ | 264 | .entry = IPT_ENTRY_INIT(sizeof(struct ipt_standard)), \ |
| 274 | .target = XT_TARGET_INIT(IPT_STANDARD_TARGET, \ | 265 | .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \ |
| 275 | sizeof(struct xt_standard_target)), \ | 266 | sizeof(struct xt_standard_target)), \ |
| 276 | .target.verdict = -(__verdict) - 1, \ | 267 | .target.verdict = -(__verdict) - 1, \ |
| 277 | } | 268 | } |
| @@ -279,8 +270,8 @@ struct ipt_error { | |||
| 279 | #define IPT_ERROR_INIT \ | 270 | #define IPT_ERROR_INIT \ |
| 280 | { \ | 271 | { \ |
| 281 | .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ | 272 | .entry = IPT_ENTRY_INIT(sizeof(struct ipt_error)), \ |
| 282 | .target = XT_TARGET_INIT(IPT_ERROR_TARGET, \ | 273 | .target = XT_TARGET_INIT(XT_ERROR_TARGET, \ |
| 283 | sizeof(struct ipt_error_target)), \ | 274 | sizeof(struct xt_error_target)), \ |
| 284 | .target.errorname = "ERROR", \ | 275 | .target.errorname = "ERROR", \ |
| 285 | } | 276 | } |
| 286 | 277 | ||
| @@ -291,8 +282,6 @@ extern unsigned int ipt_do_table(struct sk_buff *skb, | |||
| 291 | const struct net_device *out, | 282 | const struct net_device *out, |
| 292 | struct xt_table *table); | 283 | struct xt_table *table); |
| 293 | 284 | ||
| 294 | #define IPT_ALIGN(s) XT_ALIGN(s) | ||
| 295 | |||
| 296 | #ifdef CONFIG_COMPAT | 285 | #ifdef CONFIG_COMPAT |
| 297 | #include <net/compat.h> | 286 | #include <net/compat.h> |
| 298 | 287 | ||
| @@ -307,14 +296,12 @@ struct compat_ipt_entry { | |||
| 307 | }; | 296 | }; |
| 308 | 297 | ||
| 309 | /* Helper functions */ | 298 | /* Helper functions */ |
| 310 | static inline struct ipt_entry_target * | 299 | static inline struct xt_entry_target * |
| 311 | compat_ipt_get_target(struct compat_ipt_entry *e) | 300 | compat_ipt_get_target(struct compat_ipt_entry *e) |
| 312 | { | 301 | { |
| 313 | return (void *)e + e->target_offset; | 302 | return (void *)e + e->target_offset; |
| 314 | } | 303 | } |
| 315 | 304 | ||
| 316 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
| 317 | |||
| 318 | #endif /* CONFIG_COMPAT */ | 305 | #endif /* CONFIG_COMPAT */ |
| 319 | #endif /*__KERNEL__*/ | 306 | #endif /*__KERNEL__*/ |
| 320 | #endif /* _IPTABLES_H */ | 307 | #endif /* _IPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index 18442ff19c07..c9784f7a9c1f 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -27,13 +27,42 @@ | |||
| 27 | 27 | ||
| 28 | #include <linux/netfilter/x_tables.h> | 28 | #include <linux/netfilter/x_tables.h> |
| 29 | 29 | ||
| 30 | #ifndef __KERNEL__ | ||
| 30 | #define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN | 31 | #define IP6T_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN |
| 31 | #define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN | 32 | #define IP6T_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN |
| 32 | |||
| 33 | #define ip6t_match xt_match | 33 | #define ip6t_match xt_match |
| 34 | #define ip6t_target xt_target | 34 | #define ip6t_target xt_target |
| 35 | #define ip6t_table xt_table | 35 | #define ip6t_table xt_table |
| 36 | #define ip6t_get_revision xt_get_revision | 36 | #define ip6t_get_revision xt_get_revision |
| 37 | #define ip6t_entry_match xt_entry_match | ||
| 38 | #define ip6t_entry_target xt_entry_target | ||
| 39 | #define ip6t_standard_target xt_standard_target | ||
| 40 | #define ip6t_error_target xt_error_target | ||
| 41 | #define ip6t_counters xt_counters | ||
| 42 | #define IP6T_CONTINUE XT_CONTINUE | ||
| 43 | #define IP6T_RETURN XT_RETURN | ||
| 44 | |||
| 45 | /* Pre-iptables-1.4.0 */ | ||
| 46 | #include <linux/netfilter/xt_tcpudp.h> | ||
| 47 | #define ip6t_tcp xt_tcp | ||
| 48 | #define ip6t_udp xt_udp | ||
| 49 | #define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT | ||
| 50 | #define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT | ||
| 51 | #define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS | ||
| 52 | #define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION | ||
| 53 | #define IP6T_TCP_INV_MASK XT_TCP_INV_MASK | ||
| 54 | #define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT | ||
| 55 | #define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT | ||
| 56 | #define IP6T_UDP_INV_MASK XT_UDP_INV_MASK | ||
| 57 | |||
| 58 | #define ip6t_counters_info xt_counters_info | ||
| 59 | #define IP6T_STANDARD_TARGET XT_STANDARD_TARGET | ||
| 60 | #define IP6T_ERROR_TARGET XT_ERROR_TARGET | ||
| 61 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ | ||
| 62 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) | ||
| 63 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 64 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) | ||
| 65 | #endif | ||
| 37 | 66 | ||
| 38 | /* Yes, Virginia, you have to zero the padding. */ | 67 | /* Yes, Virginia, you have to zero the padding. */ |
| 39 | struct ip6t_ip6 { | 68 | struct ip6t_ip6 { |
| @@ -62,12 +91,6 @@ struct ip6t_ip6 { | |||
| 62 | u_int8_t invflags; | 91 | u_int8_t invflags; |
| 63 | }; | 92 | }; |
| 64 | 93 | ||
| 65 | #define ip6t_entry_match xt_entry_match | ||
| 66 | #define ip6t_entry_target xt_entry_target | ||
| 67 | #define ip6t_standard_target xt_standard_target | ||
| 68 | |||
| 69 | #define ip6t_counters xt_counters | ||
| 70 | |||
| 71 | /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ | 94 | /* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ |
| 72 | #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper | 95 | #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper |
| 73 | protocols */ | 96 | protocols */ |
| @@ -112,17 +135,12 @@ struct ip6t_entry { | |||
| 112 | /* Standard entry */ | 135 | /* Standard entry */ |
| 113 | struct ip6t_standard { | 136 | struct ip6t_standard { |
| 114 | struct ip6t_entry entry; | 137 | struct ip6t_entry entry; |
| 115 | struct ip6t_standard_target target; | 138 | struct xt_standard_target target; |
| 116 | }; | ||
| 117 | |||
| 118 | struct ip6t_error_target { | ||
| 119 | struct ip6t_entry_target target; | ||
| 120 | char errorname[IP6T_FUNCTION_MAXNAMELEN]; | ||
| 121 | }; | 139 | }; |
| 122 | 140 | ||
| 123 | struct ip6t_error { | 141 | struct ip6t_error { |
| 124 | struct ip6t_entry entry; | 142 | struct ip6t_entry entry; |
| 125 | struct ip6t_error_target target; | 143 | struct xt_error_target target; |
| 126 | }; | 144 | }; |
| 127 | 145 | ||
| 128 | #define IP6T_ENTRY_INIT(__size) \ | 146 | #define IP6T_ENTRY_INIT(__size) \ |
| @@ -134,16 +152,16 @@ struct ip6t_error { | |||
| 134 | #define IP6T_STANDARD_INIT(__verdict) \ | 152 | #define IP6T_STANDARD_INIT(__verdict) \ |
| 135 | { \ | 153 | { \ |
| 136 | .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ | 154 | .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_standard)), \ |
| 137 | .target = XT_TARGET_INIT(IP6T_STANDARD_TARGET, \ | 155 | .target = XT_TARGET_INIT(XT_STANDARD_TARGET, \ |
| 138 | sizeof(struct ip6t_standard_target)), \ | 156 | sizeof(struct xt_standard_target)), \ |
| 139 | .target.verdict = -(__verdict) - 1, \ | 157 | .target.verdict = -(__verdict) - 1, \ |
| 140 | } | 158 | } |
| 141 | 159 | ||
| 142 | #define IP6T_ERROR_INIT \ | 160 | #define IP6T_ERROR_INIT \ |
| 143 | { \ | 161 | { \ |
| 144 | .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \ | 162 | .entry = IP6T_ENTRY_INIT(sizeof(struct ip6t_error)), \ |
| 145 | .target = XT_TARGET_INIT(IP6T_ERROR_TARGET, \ | 163 | .target = XT_TARGET_INIT(XT_ERROR_TARGET, \ |
| 146 | sizeof(struct ip6t_error_target)), \ | 164 | sizeof(struct xt_error_target)), \ |
| 147 | .target.errorname = "ERROR", \ | 165 | .target.errorname = "ERROR", \ |
| 148 | } | 166 | } |
| 149 | 167 | ||
| @@ -166,30 +184,6 @@ struct ip6t_error { | |||
| 166 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) | 184 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) |
| 167 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET | 185 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET |
| 168 | 186 | ||
| 169 | /* CONTINUE verdict for targets */ | ||
| 170 | #define IP6T_CONTINUE XT_CONTINUE | ||
| 171 | |||
| 172 | /* For standard target */ | ||
| 173 | #define IP6T_RETURN XT_RETURN | ||
| 174 | |||
| 175 | /* TCP/UDP matching stuff */ | ||
| 176 | #include <linux/netfilter/xt_tcpudp.h> | ||
| 177 | |||
| 178 | #define ip6t_tcp xt_tcp | ||
| 179 | #define ip6t_udp xt_udp | ||
| 180 | |||
| 181 | /* Values for "inv" field in struct ipt_tcp. */ | ||
| 182 | #define IP6T_TCP_INV_SRCPT XT_TCP_INV_SRCPT | ||
| 183 | #define IP6T_TCP_INV_DSTPT XT_TCP_INV_DSTPT | ||
| 184 | #define IP6T_TCP_INV_FLAGS XT_TCP_INV_FLAGS | ||
| 185 | #define IP6T_TCP_INV_OPTION XT_TCP_INV_OPTION | ||
| 186 | #define IP6T_TCP_INV_MASK XT_TCP_INV_MASK | ||
| 187 | |||
| 188 | /* Values for "invflags" field in struct ipt_udp. */ | ||
| 189 | #define IP6T_UDP_INV_SRCPT XT_UDP_INV_SRCPT | ||
| 190 | #define IP6T_UDP_INV_DSTPT XT_UDP_INV_DSTPT | ||
| 191 | #define IP6T_UDP_INV_MASK XT_UDP_INV_MASK | ||
| 192 | |||
| 193 | /* ICMP matching stuff */ | 187 | /* ICMP matching stuff */ |
| 194 | struct ip6t_icmp { | 188 | struct ip6t_icmp { |
| 195 | u_int8_t type; /* type to match */ | 189 | u_int8_t type; /* type to match */ |
| @@ -203,7 +197,7 @@ struct ip6t_icmp { | |||
| 203 | /* The argument to IP6T_SO_GET_INFO */ | 197 | /* The argument to IP6T_SO_GET_INFO */ |
| 204 | struct ip6t_getinfo { | 198 | struct ip6t_getinfo { |
| 205 | /* Which table: caller fills this in. */ | 199 | /* Which table: caller fills this in. */ |
| 206 | char name[IP6T_TABLE_MAXNAMELEN]; | 200 | char name[XT_TABLE_MAXNAMELEN]; |
| 207 | 201 | ||
| 208 | /* Kernel fills these in. */ | 202 | /* Kernel fills these in. */ |
| 209 | /* Which hook entry points are valid: bitmask */ | 203 | /* Which hook entry points are valid: bitmask */ |
| @@ -225,7 +219,7 @@ struct ip6t_getinfo { | |||
| 225 | /* The argument to IP6T_SO_SET_REPLACE. */ | 219 | /* The argument to IP6T_SO_SET_REPLACE. */ |
| 226 | struct ip6t_replace { | 220 | struct ip6t_replace { |
| 227 | /* Which table. */ | 221 | /* Which table. */ |
| 228 | char name[IP6T_TABLE_MAXNAMELEN]; | 222 | char name[XT_TABLE_MAXNAMELEN]; |
| 229 | 223 | ||
| 230 | /* Which hook entry points are valid: bitmask. You can't | 224 | /* Which hook entry points are valid: bitmask. You can't |
| 231 | change this. */ | 225 | change this. */ |
| @@ -253,13 +247,10 @@ struct ip6t_replace { | |||
| 253 | struct ip6t_entry entries[0]; | 247 | struct ip6t_entry entries[0]; |
| 254 | }; | 248 | }; |
| 255 | 249 | ||
| 256 | /* The argument to IP6T_SO_ADD_COUNTERS. */ | ||
| 257 | #define ip6t_counters_info xt_counters_info | ||
| 258 | |||
| 259 | /* The argument to IP6T_SO_GET_ENTRIES. */ | 250 | /* The argument to IP6T_SO_GET_ENTRIES. */ |
| 260 | struct ip6t_get_entries { | 251 | struct ip6t_get_entries { |
| 261 | /* Which table: user fills this in. */ | 252 | /* Which table: user fills this in. */ |
| 262 | char name[IP6T_TABLE_MAXNAMELEN]; | 253 | char name[XT_TABLE_MAXNAMELEN]; |
| 263 | 254 | ||
| 264 | /* User fills this in: total entry size. */ | 255 | /* User fills this in: total entry size. */ |
| 265 | unsigned int size; | 256 | unsigned int size; |
| @@ -268,28 +259,13 @@ struct ip6t_get_entries { | |||
| 268 | struct ip6t_entry entrytable[0]; | 259 | struct ip6t_entry entrytable[0]; |
| 269 | }; | 260 | }; |
| 270 | 261 | ||
| 271 | /* Standard return verdict, or do jump. */ | ||
| 272 | #define IP6T_STANDARD_TARGET XT_STANDARD_TARGET | ||
| 273 | /* Error verdict. */ | ||
| 274 | #define IP6T_ERROR_TARGET XT_ERROR_TARGET | ||
| 275 | |||
| 276 | /* Helper functions */ | 262 | /* Helper functions */ |
| 277 | static __inline__ struct ip6t_entry_target * | 263 | static __inline__ struct xt_entry_target * |
| 278 | ip6t_get_target(struct ip6t_entry *e) | 264 | ip6t_get_target(struct ip6t_entry *e) |
| 279 | { | 265 | { |
| 280 | return (void *)e + e->target_offset; | 266 | return (void *)e + e->target_offset; |
| 281 | } | 267 | } |
| 282 | 268 | ||
| 283 | #ifndef __KERNEL__ | ||
| 284 | /* fn returns 0 to continue iteration */ | ||
| 285 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ | ||
| 286 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) | ||
| 287 | |||
| 288 | /* fn returns 0 to continue iteration */ | ||
| 289 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 290 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) | ||
| 291 | #endif | ||
| 292 | |||
| 293 | /* | 269 | /* |
| 294 | * Main firewall chains definitions and global var's definitions. | 270 | * Main firewall chains definitions and global var's definitions. |
| 295 | */ | 271 | */ |
| @@ -316,8 +292,6 @@ extern int ip6t_ext_hdr(u8 nexthdr); | |||
| 316 | extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, | 292 | extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, |
| 317 | int target, unsigned short *fragoff); | 293 | int target, unsigned short *fragoff); |
| 318 | 294 | ||
| 319 | #define IP6T_ALIGN(s) XT_ALIGN(s) | ||
| 320 | |||
| 321 | #ifdef CONFIG_COMPAT | 295 | #ifdef CONFIG_COMPAT |
| 322 | #include <net/compat.h> | 296 | #include <net/compat.h> |
| 323 | 297 | ||
| @@ -331,14 +305,12 @@ struct compat_ip6t_entry { | |||
| 331 | unsigned char elems[0]; | 305 | unsigned char elems[0]; |
| 332 | }; | 306 | }; |
| 333 | 307 | ||
| 334 | static inline struct ip6t_entry_target * | 308 | static inline struct xt_entry_target * |
| 335 | compat_ip6t_get_target(struct compat_ip6t_entry *e) | 309 | compat_ip6t_get_target(struct compat_ip6t_entry *e) |
| 336 | { | 310 | { |
| 337 | return (void *)e + e->target_offset; | 311 | return (void *)e + e->target_offset; |
| 338 | } | 312 | } |
| 339 | 313 | ||
| 340 | #define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) | ||
| 341 | |||
| 342 | #endif /* CONFIG_COMPAT */ | 314 | #endif /* CONFIG_COMPAT */ |
| 343 | #endif /*__KERNEL__*/ | 315 | #endif /*__KERNEL__*/ |
| 344 | #endif /* _IP6_TABLES_H */ | 316 | #endif /* _IP6_TABLES_H */ |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 50d8009be86c..79358bb712c6 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | 14 | ||
| 15 | struct netpoll { | 15 | struct netpoll { |
| 16 | struct net_device *dev; | 16 | struct net_device *dev; |
| 17 | struct net_device *real_dev; | ||
| 18 | char dev_name[IFNAMSIZ]; | 17 | char dev_name[IFNAMSIZ]; |
| 19 | const char *name; | 18 | const char *name; |
| 20 | void (*rx_hook)(struct netpoll *, int, char *, int); | 19 | void (*rx_hook)(struct netpoll *, int, char *, int); |
| @@ -53,7 +52,13 @@ void netpoll_set_trap(int trap); | |||
| 53 | void __netpoll_cleanup(struct netpoll *np); | 52 | void __netpoll_cleanup(struct netpoll *np); |
| 54 | void netpoll_cleanup(struct netpoll *np); | 53 | void netpoll_cleanup(struct netpoll *np); |
| 55 | int __netpoll_rx(struct sk_buff *skb); | 54 | int __netpoll_rx(struct sk_buff *skb); |
| 56 | void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb); | 55 | void netpoll_send_skb_on_dev(struct netpoll *np, struct sk_buff *skb, |
| 56 | struct net_device *dev); | ||
| 57 | static inline void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) | ||
| 58 | { | ||
| 59 | netpoll_send_skb_on_dev(np, skb, np->dev); | ||
| 60 | } | ||
| 61 | |||
| 57 | 62 | ||
| 58 | 63 | ||
| 59 | #ifdef CONFIG_NETPOLL | 64 | #ifdef CONFIG_NETPOLL |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 2c8701687336..0edb2566c14c 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. |
| @@ -276,8 +315,8 @@ | |||
| 276 | * channel for the specified amount of time. This can be used to do | 315 | * channel for the specified amount of time. This can be used to do |
| 277 | * off-channel operations like transmit a Public Action frame and wait for | 316 | * off-channel operations like transmit a Public Action frame and wait for |
| 278 | * a response while being associated to an AP on another channel. | 317 | * a response while being associated to an AP on another channel. |
| 279 | * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which | 318 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus |
| 280 | * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the | 319 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the |
| 281 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be | 320 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be |
| 282 | * optionally used to specify additional channel parameters. | 321 | * optionally used to specify additional channel parameters. |
| 283 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds | 322 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds |
| @@ -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. |
| @@ -341,6 +387,8 @@ | |||
| 341 | * of any other interfaces, and other interfaces will again take | 387 | * of any other interfaces, and other interfaces will again take |
| 342 | * precedence when they are used. | 388 | * precedence when they are used. |
| 343 | * | 389 | * |
| 390 | * @NL80211_CMD_SET_WDS_PEER: Set the MAC address of the peer on a WDS interface. | ||
| 391 | * | ||
| 344 | * @NL80211_CMD_MAX: highest used command number | 392 | * @NL80211_CMD_MAX: highest used command number |
| 345 | * @__NL80211_CMD_AFTER_LAST: internal use | 393 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 346 | */ | 394 | */ |
| @@ -429,9 +477,12 @@ enum nl80211_commands { | |||
| 429 | 477 | ||
| 430 | NL80211_CMD_SET_TX_BITRATE_MASK, | 478 | NL80211_CMD_SET_TX_BITRATE_MASK, |
| 431 | 479 | ||
| 432 | NL80211_CMD_REGISTER_ACTION, | 480 | NL80211_CMD_REGISTER_FRAME, |
| 433 | NL80211_CMD_ACTION, | 481 | NL80211_CMD_REGISTER_ACTION = NL80211_CMD_REGISTER_FRAME, |
| 434 | NL80211_CMD_ACTION_TX_STATUS, | 482 | NL80211_CMD_FRAME, |
| 483 | NL80211_CMD_ACTION = NL80211_CMD_FRAME, | ||
| 484 | NL80211_CMD_FRAME_TX_STATUS, | ||
| 485 | NL80211_CMD_ACTION_TX_STATUS = NL80211_CMD_FRAME_TX_STATUS, | ||
| 435 | 486 | ||
| 436 | NL80211_CMD_SET_POWER_SAVE, | 487 | NL80211_CMD_SET_POWER_SAVE, |
| 437 | NL80211_CMD_GET_POWER_SAVE, | 488 | NL80211_CMD_GET_POWER_SAVE, |
| @@ -440,6 +491,7 @@ enum nl80211_commands { | |||
| 440 | NL80211_CMD_NOTIFY_CQM, | 491 | NL80211_CMD_NOTIFY_CQM, |
| 441 | 492 | ||
| 442 | NL80211_CMD_SET_CHANNEL, | 493 | NL80211_CMD_SET_CHANNEL, |
| 494 | NL80211_CMD_SET_WDS_PEER, | ||
| 443 | 495 | ||
| 444 | /* add new commands above here */ | 496 | /* add new commands above here */ |
| 445 | 497 | ||
| @@ -639,6 +691,15 @@ enum nl80211_commands { | |||
| 639 | * request, the driver will assume that the port is unauthorized until | 691 | * request, the driver will assume that the port is unauthorized until |
| 640 | * authorized by user space. Otherwise, port is marked authorized by | 692 | * authorized by user space. Otherwise, port is marked authorized by |
| 641 | * default in station mode. | 693 | * default in station mode. |
| 694 | * @NL80211_ATTR_CONTROL_PORT_ETHERTYPE: A 16-bit value indicating the | ||
| 695 | * ethertype that will be used for key negotiation. It can be | ||
| 696 | * specified with the associate and connect commands. If it is not | ||
| 697 | * specified, the value defaults to 0x888E (PAE, 802.1X). This | ||
| 698 | * attribute is also used as a flag in the wiphy information to | ||
| 699 | * indicate that protocols other than PAE are supported. | ||
| 700 | * @NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT: When included along with | ||
| 701 | * %NL80211_ATTR_CONTROL_PORT_ETHERTYPE, indicates that the custom | ||
| 702 | * ethertype frames used for key negotiation must not be encrypted. | ||
| 642 | * | 703 | * |
| 643 | * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. | 704 | * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. |
| 644 | * We recommend using nested, driver-specific attributes within this. | 705 | * We recommend using nested, driver-specific attributes within this. |
| @@ -708,7 +769,16 @@ enum nl80211_commands { | |||
| 708 | * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. | 769 | * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. |
| 709 | * | 770 | * |
| 710 | * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain | 771 | * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain |
| 711 | * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. | 772 | * at least one byte, currently used with @NL80211_CMD_REGISTER_FRAME. |
| 773 | * @NL80211_ATTR_FRAME_TYPE: A u16 indicating the frame type/subtype for the | ||
| 774 | * @NL80211_CMD_REGISTER_FRAME command. | ||
| 775 | * @NL80211_ATTR_TX_FRAME_TYPES: wiphy capability attribute, which is a | ||
| 776 | * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing | ||
| 777 | * information about which frame types can be transmitted with | ||
| 778 | * %NL80211_CMD_FRAME. | ||
| 779 | * @NL80211_ATTR_RX_FRAME_TYPES: wiphy capability attribute, which is a | ||
| 780 | * nested attribute of %NL80211_ATTR_FRAME_TYPE attributes, containing | ||
| 781 | * information about which frame types can be registered for RX. | ||
| 712 | * | 782 | * |
| 713 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was | 783 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was |
| 714 | * acknowledged by the recipient. | 784 | * acknowledged by the recipient. |
| @@ -731,6 +801,9 @@ enum nl80211_commands { | |||
| 731 | * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING | 801 | * This is used in association with @NL80211_ATTR_WIPHY_TX_POWER_SETTING |
| 732 | * for non-automatic settings. | 802 | * for non-automatic settings. |
| 733 | * | 803 | * |
| 804 | * @NL80211_ATTR_SUPPORT_IBSS_RSN: The device supports IBSS RSN, which mostly | ||
| 805 | * means support for per-station GTKs. | ||
| 806 | * | ||
| 734 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 807 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 735 | * @__NL80211_ATTR_AFTER_LAST: internal use | 808 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 736 | */ | 809 | */ |
| @@ -891,6 +964,15 @@ enum nl80211_attrs { | |||
| 891 | NL80211_ATTR_WIPHY_TX_POWER_SETTING, | 964 | NL80211_ATTR_WIPHY_TX_POWER_SETTING, |
| 892 | NL80211_ATTR_WIPHY_TX_POWER_LEVEL, | 965 | NL80211_ATTR_WIPHY_TX_POWER_LEVEL, |
| 893 | 966 | ||
| 967 | NL80211_ATTR_TX_FRAME_TYPES, | ||
| 968 | NL80211_ATTR_RX_FRAME_TYPES, | ||
| 969 | NL80211_ATTR_FRAME_TYPE, | ||
| 970 | |||
| 971 | NL80211_ATTR_CONTROL_PORT_ETHERTYPE, | ||
| 972 | NL80211_ATTR_CONTROL_PORT_NO_ENCRYPT, | ||
| 973 | |||
| 974 | NL80211_ATTR_SUPPORT_IBSS_RSN, | ||
| 975 | |||
| 894 | /* add attributes here, update the policy in nl80211.c */ | 976 | /* add attributes here, update the policy in nl80211.c */ |
| 895 | 977 | ||
| 896 | __NL80211_ATTR_AFTER_LAST, | 978 | __NL80211_ATTR_AFTER_LAST, |
| @@ -946,8 +1028,10 @@ enum nl80211_attrs { | |||
| 946 | * @NL80211_IFTYPE_WDS: wireless distribution interface | 1028 | * @NL80211_IFTYPE_WDS: wireless distribution interface |
| 947 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames | 1029 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames |
| 948 | * @NL80211_IFTYPE_MESH_POINT: mesh point | 1030 | * @NL80211_IFTYPE_MESH_POINT: mesh point |
| 1031 | * @NL80211_IFTYPE_P2P_CLIENT: P2P client | ||
| 1032 | * @NL80211_IFTYPE_P2P_GO: P2P group owner | ||
| 949 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined | 1033 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined |
| 950 | * @__NL80211_IFTYPE_AFTER_LAST: internal use | 1034 | * @NUM_NL80211_IFTYPES: number of defined interface types |
| 951 | * | 1035 | * |
| 952 | * These values are used with the %NL80211_ATTR_IFTYPE | 1036 | * These values are used with the %NL80211_ATTR_IFTYPE |
| 953 | * to set the type of an interface. | 1037 | * to set the type of an interface. |
| @@ -962,10 +1046,12 @@ enum nl80211_iftype { | |||
| 962 | NL80211_IFTYPE_WDS, | 1046 | NL80211_IFTYPE_WDS, |
| 963 | NL80211_IFTYPE_MONITOR, | 1047 | NL80211_IFTYPE_MONITOR, |
| 964 | NL80211_IFTYPE_MESH_POINT, | 1048 | NL80211_IFTYPE_MESH_POINT, |
| 1049 | NL80211_IFTYPE_P2P_CLIENT, | ||
| 1050 | NL80211_IFTYPE_P2P_GO, | ||
| 965 | 1051 | ||
| 966 | /* keep last */ | 1052 | /* keep last */ |
| 967 | __NL80211_IFTYPE_AFTER_LAST, | 1053 | NUM_NL80211_IFTYPES, |
| 968 | NL80211_IFTYPE_MAX = __NL80211_IFTYPE_AFTER_LAST - 1 | 1054 | NL80211_IFTYPE_MAX = NUM_NL80211_IFTYPES - 1 |
| 969 | }; | 1055 | }; |
| 970 | 1056 | ||
| 971 | /** | 1057 | /** |
| @@ -974,11 +1060,14 @@ enum nl80211_iftype { | |||
| 974 | * Station flags. When a station is added to an AP interface, it is | 1060 | * Station flags. When a station is added to an AP interface, it is |
| 975 | * assumed to be already associated (and hence authenticated.) | 1061 | * assumed to be already associated (and hence authenticated.) |
| 976 | * | 1062 | * |
| 1063 | * @__NL80211_STA_FLAG_INVALID: attribute number 0 is reserved | ||
| 977 | * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) | 1064 | * @NL80211_STA_FLAG_AUTHORIZED: station is authorized (802.1X) |
| 978 | * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames | 1065 | * @NL80211_STA_FLAG_SHORT_PREAMBLE: station is capable of receiving frames |
| 979 | * with short barker preamble | 1066 | * with short barker preamble |
| 980 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable | 1067 | * @NL80211_STA_FLAG_WME: station is WME/QoS capable |
| 981 | * @NL80211_STA_FLAG_MFP: station uses management frame protection | 1068 | * @NL80211_STA_FLAG_MFP: station uses management frame protection |
| 1069 | * @NL80211_STA_FLAG_MAX: highest station flag number currently defined | ||
| 1070 | * @__NL80211_STA_FLAG_AFTER_LAST: internal use | ||
| 982 | */ | 1071 | */ |
| 983 | enum nl80211_sta_flags { | 1072 | enum nl80211_sta_flags { |
| 984 | __NL80211_STA_FLAG_INVALID, | 1073 | __NL80211_STA_FLAG_INVALID, |
| @@ -1048,6 +1137,8 @@ enum nl80211_rate_info { | |||
| 1048 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) | 1137 | * @NL80211_STA_INFO_RX_PACKETS: total received packet (u32, from this station) |
| 1049 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this | 1138 | * @NL80211_STA_INFO_TX_PACKETS: total transmitted packets (u32, to this |
| 1050 | * station) | 1139 | * station) |
| 1140 | * @NL80211_STA_INFO_TX_RETRIES: total retries (u32, to this station) | ||
| 1141 | * @NL80211_STA_INFO_TX_FAILED: total failed packets (u32, to this station) | ||
| 1051 | */ | 1142 | */ |
| 1052 | enum nl80211_sta_info { | 1143 | enum nl80211_sta_info { |
| 1053 | __NL80211_STA_INFO_INVALID, | 1144 | __NL80211_STA_INFO_INVALID, |
| @@ -1061,6 +1152,8 @@ enum nl80211_sta_info { | |||
| 1061 | NL80211_STA_INFO_TX_BITRATE, | 1152 | NL80211_STA_INFO_TX_BITRATE, |
| 1062 | NL80211_STA_INFO_RX_PACKETS, | 1153 | NL80211_STA_INFO_RX_PACKETS, |
| 1063 | NL80211_STA_INFO_TX_PACKETS, | 1154 | NL80211_STA_INFO_TX_PACKETS, |
| 1155 | NL80211_STA_INFO_TX_RETRIES, | ||
| 1156 | NL80211_STA_INFO_TX_FAILED, | ||
| 1064 | 1157 | ||
| 1065 | /* keep last */ | 1158 | /* keep last */ |
| 1066 | __NL80211_STA_INFO_AFTER_LAST, | 1159 | __NL80211_STA_INFO_AFTER_LAST, |
| @@ -1091,14 +1184,17 @@ enum nl80211_mpath_flags { | |||
| 1091 | * information about a mesh path. | 1184 | * information about a mesh path. |
| 1092 | * | 1185 | * |
| 1093 | * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved | 1186 | * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved |
| 1094 | * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination | 1187 | * @NL80211_MPATH_INFO_FRAME_QLEN: number of queued frames for this destination |
| 1095 | * @NL80211_ATTR_MPATH_SN: destination sequence number | 1188 | * @NL80211_MPATH_INFO_SN: destination sequence number |
| 1096 | * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path | 1189 | * @NL80211_MPATH_INFO_METRIC: metric (cost) of this mesh path |
| 1097 | * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now | 1190 | * @NL80211_MPATH_INFO_EXPTIME: expiration time for the path, in msec from now |
| 1098 | * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in | 1191 | * @NL80211_MPATH_INFO_FLAGS: mesh path flags, enumerated in |
| 1099 | * &enum nl80211_mpath_flags; | 1192 | * &enum nl80211_mpath_flags; |
| 1100 | * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec | 1193 | * @NL80211_MPATH_INFO_DISCOVERY_TIMEOUT: total path discovery timeout, in msec |
| 1101 | * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries | 1194 | * @NL80211_MPATH_INFO_DISCOVERY_RETRIES: mesh path discovery retries |
| 1195 | * @NL80211_MPATH_INFO_MAX: highest mesh path information attribute number | ||
| 1196 | * currently defind | ||
| 1197 | * @__NL80211_MPATH_INFO_AFTER_LAST: internal use | ||
| 1102 | */ | 1198 | */ |
| 1103 | enum nl80211_mpath_info { | 1199 | enum nl80211_mpath_info { |
| 1104 | __NL80211_MPATH_INFO_INVALID, | 1200 | __NL80211_MPATH_INFO_INVALID, |
| @@ -1127,6 +1223,8 @@ enum nl80211_mpath_info { | |||
| 1127 | * @NL80211_BAND_ATTR_HT_CAPA: HT capabilities, as in the HT information IE | 1223 | * @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 | 1224 | * @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 | 1225 | * @NL80211_BAND_ATTR_HT_AMPDU_DENSITY: A-MPDU density, as in 11n |
| 1226 | * @NL80211_BAND_ATTR_MAX: highest band attribute currently defined | ||
| 1227 | * @__NL80211_BAND_ATTR_AFTER_LAST: internal use | ||
| 1130 | */ | 1228 | */ |
| 1131 | enum nl80211_band_attr { | 1229 | enum nl80211_band_attr { |
| 1132 | __NL80211_BAND_ATTR_INVALID, | 1230 | __NL80211_BAND_ATTR_INVALID, |
| @@ -1147,6 +1245,7 @@ enum nl80211_band_attr { | |||
| 1147 | 1245 | ||
| 1148 | /** | 1246 | /** |
| 1149 | * enum nl80211_frequency_attr - frequency attributes | 1247 | * enum nl80211_frequency_attr - frequency attributes |
| 1248 | * @__NL80211_FREQUENCY_ATTR_INVALID: attribute number 0 is reserved | ||
| 1150 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz | 1249 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz |
| 1151 | * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current | 1250 | * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current |
| 1152 | * regulatory domain. | 1251 | * regulatory domain. |
| @@ -1158,6 +1257,9 @@ enum nl80211_band_attr { | |||
| 1158 | * on this channel in current regulatory domain. | 1257 | * on this channel in current regulatory domain. |
| 1159 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm | 1258 | * @NL80211_FREQUENCY_ATTR_MAX_TX_POWER: Maximum transmission power in mBm |
| 1160 | * (100 * dBm). | 1259 | * (100 * dBm). |
| 1260 | * @NL80211_FREQUENCY_ATTR_MAX: highest frequency attribute number | ||
| 1261 | * currently defined | ||
| 1262 | * @__NL80211_FREQUENCY_ATTR_AFTER_LAST: internal use | ||
| 1161 | */ | 1263 | */ |
| 1162 | enum nl80211_frequency_attr { | 1264 | enum nl80211_frequency_attr { |
| 1163 | __NL80211_FREQUENCY_ATTR_INVALID, | 1265 | __NL80211_FREQUENCY_ATTR_INVALID, |
| @@ -1177,9 +1279,13 @@ enum nl80211_frequency_attr { | |||
| 1177 | 1279 | ||
| 1178 | /** | 1280 | /** |
| 1179 | * enum nl80211_bitrate_attr - bitrate attributes | 1281 | * enum nl80211_bitrate_attr - bitrate attributes |
| 1282 | * @__NL80211_BITRATE_ATTR_INVALID: attribute number 0 is reserved | ||
| 1180 | * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps | 1283 | * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps |
| 1181 | * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported | 1284 | * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported |
| 1182 | * in 2.4 GHz band. | 1285 | * in 2.4 GHz band. |
| 1286 | * @NL80211_BITRATE_ATTR_MAX: highest bitrate attribute number | ||
| 1287 | * currently defined | ||
| 1288 | * @__NL80211_BITRATE_ATTR_AFTER_LAST: internal use | ||
| 1183 | */ | 1289 | */ |
| 1184 | enum nl80211_bitrate_attr { | 1290 | enum nl80211_bitrate_attr { |
| 1185 | __NL80211_BITRATE_ATTR_INVALID, | 1291 | __NL80211_BITRATE_ATTR_INVALID, |
| @@ -1235,6 +1341,7 @@ enum nl80211_reg_type { | |||
| 1235 | 1341 | ||
| 1236 | /** | 1342 | /** |
| 1237 | * enum nl80211_reg_rule_attr - regulatory rule attributes | 1343 | * enum nl80211_reg_rule_attr - regulatory rule attributes |
| 1344 | * @__NL80211_REG_RULE_ATTR_INVALID: attribute number 0 is reserved | ||
| 1238 | * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional | 1345 | * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional |
| 1239 | * considerations for a given frequency range. These are the | 1346 | * considerations for a given frequency range. These are the |
| 1240 | * &enum nl80211_reg_rule_flags. | 1347 | * &enum nl80211_reg_rule_flags. |
| @@ -1251,6 +1358,9 @@ enum nl80211_reg_type { | |||
| 1251 | * If you don't have one then don't send this. | 1358 | * If you don't have one then don't send this. |
| 1252 | * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for | 1359 | * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for |
| 1253 | * a given frequency range. The value is in mBm (100 * dBm). | 1360 | * a given frequency range. The value is in mBm (100 * dBm). |
| 1361 | * @NL80211_REG_RULE_ATTR_MAX: highest regulatory rule attribute number | ||
| 1362 | * currently defined | ||
| 1363 | * @__NL80211_REG_RULE_ATTR_AFTER_LAST: internal use | ||
| 1254 | */ | 1364 | */ |
| 1255 | enum nl80211_reg_rule_attr { | 1365 | enum nl80211_reg_rule_attr { |
| 1256 | __NL80211_REG_RULE_ATTR_INVALID, | 1366 | __NL80211_REG_RULE_ATTR_INVALID, |
| @@ -1302,11 +1412,31 @@ enum nl80211_reg_rule_flags { | |||
| 1302 | * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved | 1412 | * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved |
| 1303 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel | 1413 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel |
| 1304 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) | 1414 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) |
| 1415 | * @NL80211_SURVEY_INFO_IN_USE: channel is currently being used | ||
| 1416 | * @NL80211_SURVEY_INFO_CHANNEL_TIME: amount of time (in ms) that the radio | ||
| 1417 | * spent on this channel | ||
| 1418 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY: amount of the time the primary | ||
| 1419 | * channel was sensed busy (either due to activity or energy detect) | ||
| 1420 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: amount of time the extension | ||
| 1421 | * channel was sensed busy | ||
| 1422 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_RX: amount of time the radio spent | ||
| 1423 | * receiving data | ||
| 1424 | * @NL80211_SURVEY_INFO_CHANNEL_TIME_TX: amount of time the radio spent | ||
| 1425 | * transmitting data | ||
| 1426 | * @NL80211_SURVEY_INFO_MAX: highest survey info attribute number | ||
| 1427 | * currently defined | ||
| 1428 | * @__NL80211_SURVEY_INFO_AFTER_LAST: internal use | ||
| 1305 | */ | 1429 | */ |
| 1306 | enum nl80211_survey_info { | 1430 | enum nl80211_survey_info { |
| 1307 | __NL80211_SURVEY_INFO_INVALID, | 1431 | __NL80211_SURVEY_INFO_INVALID, |
| 1308 | NL80211_SURVEY_INFO_FREQUENCY, | 1432 | NL80211_SURVEY_INFO_FREQUENCY, |
| 1309 | NL80211_SURVEY_INFO_NOISE, | 1433 | NL80211_SURVEY_INFO_NOISE, |
| 1434 | NL80211_SURVEY_INFO_IN_USE, | ||
| 1435 | NL80211_SURVEY_INFO_CHANNEL_TIME, | ||
| 1436 | NL80211_SURVEY_INFO_CHANNEL_TIME_BUSY, | ||
| 1437 | NL80211_SURVEY_INFO_CHANNEL_TIME_EXT_BUSY, | ||
| 1438 | NL80211_SURVEY_INFO_CHANNEL_TIME_RX, | ||
| 1439 | NL80211_SURVEY_INFO_CHANNEL_TIME_TX, | ||
| 1310 | 1440 | ||
| 1311 | /* keep last */ | 1441 | /* keep last */ |
| 1312 | __NL80211_SURVEY_INFO_AFTER_LAST, | 1442 | __NL80211_SURVEY_INFO_AFTER_LAST, |
| @@ -1466,6 +1596,7 @@ enum nl80211_channel_type { | |||
| 1466 | * enum nl80211_bss - netlink attributes for a BSS | 1596 | * enum nl80211_bss - netlink attributes for a BSS |
| 1467 | * | 1597 | * |
| 1468 | * @__NL80211_BSS_INVALID: invalid | 1598 | * @__NL80211_BSS_INVALID: invalid |
| 1599 | * @NL80211_BSS_BSSID: BSSID of the BSS (6 octets) | ||
| 1469 | * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) | 1600 | * @NL80211_BSS_FREQUENCY: frequency in MHz (u32) |
| 1470 | * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) | 1601 | * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64) |
| 1471 | * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) | 1602 | * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) |
| @@ -1509,6 +1640,12 @@ enum nl80211_bss { | |||
| 1509 | 1640 | ||
| 1510 | /** | 1641 | /** |
| 1511 | * enum nl80211_bss_status - BSS "status" | 1642 | * enum nl80211_bss_status - BSS "status" |
| 1643 | * @NL80211_BSS_STATUS_AUTHENTICATED: Authenticated with this BSS. | ||
| 1644 | * @NL80211_BSS_STATUS_ASSOCIATED: Associated with this BSS. | ||
| 1645 | * @NL80211_BSS_STATUS_IBSS_JOINED: Joined to this IBSS. | ||
| 1646 | * | ||
| 1647 | * The BSS status is a BSS attribute in scan dumps, which | ||
| 1648 | * indicates the status the interface has wrt. this BSS. | ||
| 1512 | */ | 1649 | */ |
| 1513 | enum nl80211_bss_status { | 1650 | enum nl80211_bss_status { |
| 1514 | NL80211_BSS_STATUS_AUTHENTICATED, | 1651 | NL80211_BSS_STATUS_AUTHENTICATED, |
| @@ -1546,11 +1683,14 @@ enum nl80211_auth_type { | |||
| 1546 | * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key | 1683 | * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key |
| 1547 | * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key | 1684 | * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key |
| 1548 | * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) | 1685 | * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) |
| 1686 | * @NUM_NL80211_KEYTYPES: number of defined key types | ||
| 1549 | */ | 1687 | */ |
| 1550 | enum nl80211_key_type { | 1688 | enum nl80211_key_type { |
| 1551 | NL80211_KEYTYPE_GROUP, | 1689 | NL80211_KEYTYPE_GROUP, |
| 1552 | NL80211_KEYTYPE_PAIRWISE, | 1690 | NL80211_KEYTYPE_PAIRWISE, |
| 1553 | NL80211_KEYTYPE_PEERKEY, | 1691 | NL80211_KEYTYPE_PEERKEY, |
| 1692 | |||
| 1693 | NUM_NL80211_KEYTYPES | ||
| 1554 | }; | 1694 | }; |
| 1555 | 1695 | ||
| 1556 | /** | 1696 | /** |
| @@ -1581,6 +1721,9 @@ enum nl80211_wpa_versions { | |||
| 1581 | * CCMP keys, each six bytes in little endian | 1721 | * CCMP keys, each six bytes in little endian |
| 1582 | * @NL80211_KEY_DEFAULT: flag indicating default key | 1722 | * @NL80211_KEY_DEFAULT: flag indicating default key |
| 1583 | * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key | 1723 | * @NL80211_KEY_DEFAULT_MGMT: flag indicating default management key |
| 1724 | * @NL80211_KEY_TYPE: the key type from enum nl80211_key_type, if not | ||
| 1725 | * specified the default depends on whether a MAC address was | ||
| 1726 | * given with the command using the key or not (u32) | ||
| 1584 | * @__NL80211_KEY_AFTER_LAST: internal | 1727 | * @__NL80211_KEY_AFTER_LAST: internal |
| 1585 | * @NL80211_KEY_MAX: highest key attribute | 1728 | * @NL80211_KEY_MAX: highest key attribute |
| 1586 | */ | 1729 | */ |
| @@ -1592,6 +1735,7 @@ enum nl80211_key_attributes { | |||
| 1592 | NL80211_KEY_SEQ, | 1735 | NL80211_KEY_SEQ, |
| 1593 | NL80211_KEY_DEFAULT, | 1736 | NL80211_KEY_DEFAULT, |
| 1594 | NL80211_KEY_DEFAULT_MGMT, | 1737 | NL80211_KEY_DEFAULT_MGMT, |
| 1738 | NL80211_KEY_TYPE, | ||
| 1595 | 1739 | ||
| 1596 | /* keep last */ | 1740 | /* keep last */ |
| 1597 | __NL80211_KEY_AFTER_LAST, | 1741 | __NL80211_KEY_AFTER_LAST, |
| @@ -1619,8 +1763,8 @@ enum nl80211_tx_rate_attributes { | |||
| 1619 | 1763 | ||
| 1620 | /** | 1764 | /** |
| 1621 | * enum nl80211_band - Frequency band | 1765 | * enum nl80211_band - Frequency band |
| 1622 | * @NL80211_BAND_2GHZ - 2.4 GHz ISM band | 1766 | * @NL80211_BAND_2GHZ: 2.4 GHz ISM band |
| 1623 | * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz) | 1767 | * @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz) |
| 1624 | */ | 1768 | */ |
| 1625 | enum nl80211_band { | 1769 | enum nl80211_band { |
| 1626 | NL80211_BAND_2GHZ, | 1770 | NL80211_BAND_2GHZ, |
| @@ -1658,9 +1802,9 @@ enum nl80211_attr_cqm { | |||
| 1658 | 1802 | ||
| 1659 | /** | 1803 | /** |
| 1660 | * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event | 1804 | * enum nl80211_cqm_rssi_threshold_event - RSSI threshold event |
| 1661 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW - The RSSI level is lower than the | 1805 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_LOW: The RSSI level is lower than the |
| 1662 | * configured threshold | 1806 | * configured threshold |
| 1663 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH - The RSSI is higher than the | 1807 | * @NL80211_CQM_RSSI_THRESHOLD_EVENT_HIGH: The RSSI is higher than the |
| 1664 | * configured threshold | 1808 | * configured threshold |
| 1665 | */ | 1809 | */ |
| 1666 | enum nl80211_cqm_rssi_threshold_event { | 1810 | enum nl80211_cqm_rssi_threshold_event { |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index e4471b27c396..90c038c0ad96 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2194,6 +2194,9 @@ | |||
| 2194 | #define PCI_VENDOR_ID_ARIMA 0x161f | 2194 | #define PCI_VENDOR_ID_ARIMA 0x161f |
| 2195 | 2195 | ||
| 2196 | #define PCI_VENDOR_ID_BROCADE 0x1657 | 2196 | #define PCI_VENDOR_ID_BROCADE 0x1657 |
| 2197 | #define PCI_DEVICE_ID_BROCADE_CT 0x0014 | ||
| 2198 | #define PCI_DEVICE_ID_BROCADE_FC_8G1P 0x0017 | ||
| 2199 | #define PCI_DEVICE_ID_BROCADE_CT_FC 0x0021 | ||
| 2197 | 2200 | ||
| 2198 | #define PCI_VENDOR_ID_SIBYTE 0x166d | 2201 | #define PCI_VENDOR_ID_SIBYTE 0x166d |
| 2199 | #define PCI_DEVICE_ID_BCM1250_PCI 0x0001 | 2202 | #define PCI_DEVICE_ID_BCM1250_PCI 0x0001 |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h index 76edadf046d3..26c8df786918 100644 --- a/include/linux/phonet.h +++ b/include/linux/phonet.h | |||
| @@ -36,6 +36,9 @@ | |||
| 36 | /* Socket options for SOL_PNPIPE level */ | 36 | /* Socket options for SOL_PNPIPE level */ |
| 37 | #define PNPIPE_ENCAP 1 | 37 | #define PNPIPE_ENCAP 1 |
| 38 | #define PNPIPE_IFINDEX 2 | 38 | #define PNPIPE_IFINDEX 2 |
| 39 | #define PNPIPE_PIPE_HANDLE 3 | ||
| 40 | #define PNPIPE_ENABLE 4 | ||
| 41 | /* unused slot */ | ||
| 39 | 42 | ||
| 40 | #define PNADDR_ANY 0 | 43 | #define PNADDR_ANY 0 |
| 41 | #define PNADDR_BROADCAST 0xFC | 44 | #define PNADDR_BROADCAST 0xFC |
| @@ -47,6 +50,8 @@ | |||
| 47 | 50 | ||
| 48 | /* ioctls */ | 51 | /* ioctls */ |
| 49 | #define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) | 52 | #define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) |
| 53 | #define SIOCPNADDRESOURCE (SIOCPROTOPRIVATE + 14) | ||
| 54 | #define SIOCPNDELRESOURCE (SIOCPROTOPRIVATE + 15) | ||
| 50 | 55 | ||
| 51 | /* Phonet protocol header */ | 56 | /* Phonet protocol header */ |
| 52 | struct phonethdr { | 57 | struct 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 | ||
| 100 | struct rds_info_counter { | 95 | struct 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 | ||
| 111 | struct rds_info_connection { | 106 | struct 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 | |||
| 120 | struct 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 | ||
| 131 | struct rds_info_message { | 118 | struct 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 | ||
| 141 | struct rds_info_socket { | 128 | struct 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 | ||
| 151 | struct rds_info_tcp_socket { | 138 | struct 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 |
| 164 | struct rds_info_rdma_connection { | 151 | struct 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 | */ |
| 215 | typedef u_int64_t rds_rdma_cookie_t; | 202 | typedef uint64_t rds_rdma_cookie_t; |
| 216 | 203 | ||
| 217 | struct rds_iovec { | 204 | struct rds_iovec { |
| 218 | u_int64_t addr; | 205 | uint64_t addr; |
| 219 | u_int64_t bytes; | 206 | uint64_t bytes; |
| 220 | }; | 207 | }; |
| 221 | 208 | ||
| 222 | struct rds_get_mr_args { | 209 | struct 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 | ||
| 228 | struct rds_get_mr_for_dest_args { | 215 | struct 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 | ||
| 235 | struct rds_free_mr_args { | 222 | struct 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 | ||
| 240 | struct rds_rdma_args { | 227 | struct 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 | |||
| 236 | struct 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 | ||
| 249 | struct rds_rdma_notify { | 263 | struct 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..d42f274418b8 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -6,6 +6,7 @@ | |||
| 6 | #include <linux/if_link.h> | 6 | #include <linux/if_link.h> |
| 7 | #include <linux/if_addr.h> | 7 | #include <linux/if_addr.h> |
| 8 | #include <linux/neighbour.h> | 8 | #include <linux/neighbour.h> |
| 9 | #include <linux/netdevice.h> | ||
| 9 | 10 | ||
| 10 | /* rtnetlink families. Values up to 127 are reserved for real address | 11 | /* rtnetlink families. Values up to 127 are reserved for real address |
| 11 | * families, values above 128 may be used arbitrarily. | 12 | * families, values above 128 may be used arbitrarily. |
| @@ -749,6 +750,35 @@ extern int rtnl_is_locked(void); | |||
| 749 | extern int lockdep_rtnl_is_held(void); | 750 | extern int lockdep_rtnl_is_held(void); |
| 750 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | 751 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ |
| 751 | 752 | ||
| 753 | /** | ||
| 754 | * rcu_dereference_rtnl - rcu_dereference with debug checking | ||
| 755 | * @p: The pointer to read, prior to dereferencing | ||
| 756 | * | ||
| 757 | * Do an rcu_dereference(p), but check caller either holds rcu_read_lock() | ||
| 758 | * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() | ||
| 759 | */ | ||
| 760 | #define rcu_dereference_rtnl(p) \ | ||
| 761 | rcu_dereference_check(p, rcu_read_lock_held() || \ | ||
| 762 | lockdep_rtnl_is_held()) | ||
| 763 | |||
| 764 | /** | ||
| 765 | * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL | ||
| 766 | * @p: The pointer to read, prior to dereferencing | ||
| 767 | * | ||
| 768 | * Return the value of the specified RCU-protected pointer, but omit | ||
| 769 | * both the smp_read_barrier_depends() and the ACCESS_ONCE(), because | ||
| 770 | * caller holds RTNL. | ||
| 771 | */ | ||
| 772 | #define rtnl_dereference(p) \ | ||
| 773 | rcu_dereference_protected(p, lockdep_rtnl_is_held()) | ||
| 774 | |||
| 775 | static inline struct netdev_queue *dev_ingress_queue(struct net_device *dev) | ||
| 776 | { | ||
| 777 | return rtnl_dereference(dev->ingress_queue); | ||
| 778 | } | ||
| 779 | |||
| 780 | extern struct netdev_queue *dev_ingress_queue_create(struct net_device *dev); | ||
| 781 | |||
| 752 | extern void rtnetlink_init(void); | 782 | extern void rtnetlink_init(void); |
| 753 | extern void __rtnl_unlock(void); | 783 | extern void __rtnl_unlock(void); |
| 754 | 784 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 77eb60d2b496..e6ba898de61c 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 | ||
| 130 | struct skb_frag_struct { | 130 | struct 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 | 172 | enum { |
| 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 */ |
| 178 | union 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 | ||
| @@ -462,19 +460,7 @@ static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) | |||
| 462 | skb->_skb_refdst = (unsigned long)dst; | 460 | skb->_skb_refdst = (unsigned long)dst; |
| 463 | } | 461 | } |
| 464 | 462 | ||
| 465 | /** | 463 | extern void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst); |
| 466 | * skb_dst_set_noref - sets skb dst, without a reference | ||
| 467 | * @skb: buffer | ||
| 468 | * @dst: dst entry | ||
| 469 | * | ||
| 470 | * Sets skb dst, assuming a reference was not taken on dst | ||
| 471 | * skb_dst_drop() should not dst_release() this dst | ||
| 472 | */ | ||
| 473 | static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst) | ||
| 474 | { | ||
| 475 | WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held()); | ||
| 476 | skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF; | ||
| 477 | } | ||
| 478 | 464 | ||
| 479 | /** | 465 | /** |
| 480 | * skb_dst_is_noref - Test if skb dst isnt refcounted | 466 | * skb_dst_is_noref - Test if skb dst isnt refcounted |
| @@ -498,13 +484,13 @@ extern struct sk_buff *__alloc_skb(unsigned int size, | |||
| 498 | static inline struct sk_buff *alloc_skb(unsigned int size, | 484 | static inline struct sk_buff *alloc_skb(unsigned int size, |
| 499 | gfp_t priority) | 485 | gfp_t priority) |
| 500 | { | 486 | { |
| 501 | return __alloc_skb(size, priority, 0, -1); | 487 | return __alloc_skb(size, priority, 0, NUMA_NO_NODE); |
| 502 | } | 488 | } |
| 503 | 489 | ||
| 504 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | 490 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, |
| 505 | gfp_t priority) | 491 | gfp_t priority) |
| 506 | { | 492 | { |
| 507 | return __alloc_skb(size, priority, 1, -1); | 493 | return __alloc_skb(size, priority, 1, NUMA_NO_NODE); |
| 508 | } | 494 | } |
| 509 | 495 | ||
| 510 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); | 496 | extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); |
| @@ -558,6 +544,15 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |||
| 558 | unsigned int to, struct ts_config *config, | 544 | unsigned int to, struct ts_config *config, |
| 559 | struct ts_state *state); | 545 | struct ts_state *state); |
| 560 | 546 | ||
| 547 | extern __u32 __skb_get_rxhash(struct sk_buff *skb); | ||
| 548 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) | ||
| 549 | { | ||
| 550 | if (!skb->rxhash) | ||
| 551 | skb->rxhash = __skb_get_rxhash(skb); | ||
| 552 | |||
| 553 | return skb->rxhash; | ||
| 554 | } | ||
| 555 | |||
| 561 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 556 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
| 562 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) | 557 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) |
| 563 | { | 558 | { |
| @@ -578,11 +573,6 @@ static inline struct skb_shared_hwtstamps *skb_hwtstamps(struct sk_buff *skb) | |||
| 578 | return &skb_shinfo(skb)->hwtstamps; | 573 | return &skb_shinfo(skb)->hwtstamps; |
| 579 | } | 574 | } |
| 580 | 575 | ||
| 581 | static inline union skb_shared_tx *skb_tx(struct sk_buff *skb) | ||
| 582 | { | ||
| 583 | return &skb_shinfo(skb)->tx_flags; | ||
| 584 | } | ||
| 585 | |||
| 586 | /** | 576 | /** |
| 587 | * skb_queue_empty - check if a queue is empty | 577 | * skb_queue_empty - check if a queue is empty |
| 588 | * @list: queue head | 578 | * @list: queue head |
| @@ -604,7 +594,7 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) | |||
| 604 | static inline bool skb_queue_is_last(const struct sk_buff_head *list, | 594 | static inline bool skb_queue_is_last(const struct sk_buff_head *list, |
| 605 | const struct sk_buff *skb) | 595 | const struct sk_buff *skb) |
| 606 | { | 596 | { |
| 607 | return (skb->next == (struct sk_buff *) list); | 597 | return skb->next == (struct sk_buff *)list; |
| 608 | } | 598 | } |
| 609 | 599 | ||
| 610 | /** | 600 | /** |
| @@ -617,7 +607,7 @@ static inline bool skb_queue_is_last(const struct sk_buff_head *list, | |||
| 617 | static inline bool skb_queue_is_first(const struct sk_buff_head *list, | 607 | static inline bool skb_queue_is_first(const struct sk_buff_head *list, |
| 618 | const struct sk_buff *skb) | 608 | const struct sk_buff *skb) |
| 619 | { | 609 | { |
| 620 | return (skb->prev == (struct sk_buff *) list); | 610 | return skb->prev == (struct sk_buff *)list; |
| 621 | } | 611 | } |
| 622 | 612 | ||
| 623 | /** | 613 | /** |
| @@ -1123,7 +1113,7 @@ extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, | |||
| 1123 | int off, int size); | 1113 | int off, int size); |
| 1124 | 1114 | ||
| 1125 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) | 1115 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) |
| 1126 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frags(skb)) | 1116 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frag_list(skb)) |
| 1127 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) | 1117 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) |
| 1128 | 1118 | ||
| 1129 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 1119 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
| @@ -1561,13 +1551,25 @@ static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | |||
| 1561 | return skb; | 1551 | return skb; |
| 1562 | } | 1552 | } |
| 1563 | 1553 | ||
| 1564 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); | 1554 | /** |
| 1555 | * __netdev_alloc_page - allocate a page for ps-rx on a specific device | ||
| 1556 | * @dev: network device to receive on | ||
| 1557 | * @gfp_mask: alloc_pages_node mask | ||
| 1558 | * | ||
| 1559 | * Allocate a new page. dev currently unused. | ||
| 1560 | * | ||
| 1561 | * %NULL is returned if there is no free memory. | ||
| 1562 | */ | ||
| 1563 | static inline struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask) | ||
| 1564 | { | ||
| 1565 | return alloc_pages_node(NUMA_NO_NODE, gfp_mask, 0); | ||
| 1566 | } | ||
| 1565 | 1567 | ||
| 1566 | /** | 1568 | /** |
| 1567 | * netdev_alloc_page - allocate a page for ps-rx on a specific device | 1569 | * netdev_alloc_page - allocate a page for ps-rx on a specific device |
| 1568 | * @dev: network device to receive on | 1570 | * @dev: network device to receive on |
| 1569 | * | 1571 | * |
| 1570 | * Allocate a new page node local to the specified device. | 1572 | * Allocate a new page. dev currently unused. |
| 1571 | * | 1573 | * |
| 1572 | * %NULL is returned if there is no free memory. | 1574 | * %NULL is returned if there is no free memory. |
| 1573 | */ | 1575 | */ |
| @@ -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 | ||
| 1790 | static inline bool skb_has_frags(const struct sk_buff *skb) | 1792 | static 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 | ||
| 1988 | static inline void sw_tx_timestamp(struct sk_buff *skb) | 1990 | static 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 | ||
| 2160 | static inline bool skb_rx_queue_recorded(const struct sk_buff *skb) | 2162 | static 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 | ||
| 2165 | extern u16 skb_tx_hash(const struct net_device *dev, | 2167 | extern 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 | */ | ||
| 2222 | static 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 | |||
| 2212 | bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); | 2229 | bool 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/socket.h b/include/linux/socket.h index a8f56e1ec760..5146b50202ce 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
| @@ -326,7 +326,6 @@ extern long verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *a | |||
| 326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 326 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
| 327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | 327 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, |
| 328 | int offset, int len); | 328 | int offset, int len); |
| 329 | extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen); | ||
| 330 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); | 329 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); |
| 331 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 330 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
| 332 | 331 | ||
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 @@ | |||
| 32 | struct plat_stmmacenet_data { | 32 | struct 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 | |||
| 4 | header-y += tc_pedit.h | 4 | header-y += tc_pedit.h |
| 5 | header-y += tc_nat.h | 5 | header-y += tc_nat.h |
| 6 | header-y += tc_skbedit.h | 6 | header-y += tc_skbedit.h |
| 7 | header-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 | |||
| 9 | enum { | ||
| 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 | |||
| 17 | enum { | ||
| 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 | |||
| 26 | struct 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/tipc.h b/include/linux/tipc.h index 181c8d0e6f73..d10614b29d59 100644 --- a/include/linux/tipc.h +++ b/include/linux/tipc.h | |||
| @@ -127,17 +127,23 @@ static inline unsigned int tipc_node(__u32 addr) | |||
| 127 | * TIPC topology subscription service definitions | 127 | * TIPC topology subscription service definitions |
| 128 | */ | 128 | */ |
| 129 | 129 | ||
| 130 | #define TIPC_SUB_SERVICE 0x00 /* Filter for service availability */ | 130 | #define TIPC_SUB_PORTS 0x01 /* filter for port availability */ |
| 131 | #define TIPC_SUB_PORTS 0x01 /* Filter for port availability */ | 131 | #define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ |
| 132 | #define TIPC_SUB_CANCEL 0x04 /* Cancel a subscription */ | 132 | #define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */ |
| 133 | #if 0 | ||
| 134 | /* The following filter options are not currently implemented */ | ||
| 135 | #define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ | ||
| 136 | #define TIPC_SUB_NO_UNBIND_EVTS 0x08 /* filter out "withdraw" events */ | ||
| 137 | #define TIPC_SUB_SINGLE_EVT 0x10 /* expire after first event */ | ||
| 138 | #endif | ||
| 133 | 139 | ||
| 134 | #define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ | 140 | #define TIPC_WAIT_FOREVER ~0 /* timeout for permanent subscription */ |
| 135 | 141 | ||
| 136 | struct tipc_subscr { | 142 | struct tipc_subscr { |
| 137 | struct tipc_name_seq seq; /* NBO. Name sequence of interest */ | 143 | struct tipc_name_seq seq; /* name sequence of interest */ |
| 138 | __u32 timeout; /* NBO. Subscription duration (in ms) */ | 144 | __u32 timeout; /* subscription duration (in ms) */ |
| 139 | __u32 filter; /* NBO. Bitmask of filter options */ | 145 | __u32 filter; /* bitmask of filter options */ |
| 140 | char usr_handle[8]; /* Opaque. Available for subscriber use */ | 146 | char usr_handle[8]; /* available for subscriber use */ |
| 141 | }; | 147 | }; |
| 142 | 148 | ||
| 143 | #define TIPC_PUBLISHED 1 /* publication event */ | 149 | #define TIPC_PUBLISHED 1 /* publication event */ |
| @@ -145,11 +151,11 @@ struct tipc_subscr { | |||
| 145 | #define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */ | 151 | #define TIPC_SUBSCR_TIMEOUT 3 /* subscription timeout event */ |
| 146 | 152 | ||
| 147 | struct tipc_event { | 153 | struct tipc_event { |
| 148 | __u32 event; /* NBO. Event type, as defined above */ | 154 | __u32 event; /* event type */ |
| 149 | __u32 found_lower; /* NBO. Matching name seq instances */ | 155 | __u32 found_lower; /* matching name seq instances */ |
| 150 | __u32 found_upper; /* " " " " " */ | 156 | __u32 found_upper; /* " " " " */ |
| 151 | struct tipc_portid port; /* NBO. Associated port */ | 157 | struct tipc_portid port; /* associated port */ |
| 152 | struct tipc_subscr s; /* Original, associated subscription */ | 158 | struct tipc_subscr s; /* associated subscription */ |
| 153 | }; | 159 | }; |
| 154 | 160 | ||
| 155 | /* | 161 | /* |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index e6827eedf18b..4395b28bb86c 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
| @@ -1157,6 +1157,6 @@ struct __compat_iw_event { | |||
| 1157 | #define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) | 1157 | #define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) |
| 1158 | #define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) | 1158 | #define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) |
| 1159 | #define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) | 1159 | #define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) |
| 1160 | #define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4) | 1160 | #define IW_EV_POINT_PK_LEN (IW_EV_LCP_PK_LEN + 4) |
| 1161 | 1161 | ||
| 1162 | #endif /* _LINUX_WIRELESS_H */ | 1162 | #endif /* _LINUX_WIRELESS_H */ |
diff --git a/include/linux/spi/wl12xx.h b/include/linux/wl12xx.h index a223ecbc71ef..4f902e1908aa 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,31 @@ | |||
| 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 | ||
| 27 | struct wl12xx_platform_data { | 27 | struct 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 | ||
| 35 | #ifdef CONFIG_WL12XX_PLATFORM_DATA | ||
| 36 | |||
| 37 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data); | ||
| 38 | |||
| 39 | #else | ||
| 40 | |||
| 41 | static inline | ||
| 42 | int wl12xx_set_platform_data(const struct wl12xx_platform_data *data) | ||
| 43 | { | ||
| 44 | return -ENOSYS; | ||
| 45 | } | ||
| 46 | |||
| 47 | #endif | ||
| 48 | |||
| 49 | const struct wl12xx_platform_data *wl12xx_get_platform_data(void); | ||
| 50 | |||
| 34 | #endif | 51 | #endif |
diff --git a/include/net/9p/client.h b/include/net/9p/client.h index d1aa2cfb30f0..7f63d5ab7b44 100644 --- a/include/net/9p/client.h +++ b/include/net/9p/client.h | |||
| @@ -212,15 +212,12 @@ struct p9_dirent { | |||
| 212 | 212 | ||
| 213 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); | 213 | int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); |
| 214 | int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name); | 214 | int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name); |
| 215 | int p9_client_version(struct p9_client *); | ||
| 216 | struct p9_client *p9_client_create(const char *dev_name, char *options); | 215 | struct p9_client *p9_client_create(const char *dev_name, char *options); |
| 217 | void p9_client_destroy(struct p9_client *clnt); | 216 | void p9_client_destroy(struct p9_client *clnt); |
| 218 | void p9_client_disconnect(struct p9_client *clnt); | 217 | void p9_client_disconnect(struct p9_client *clnt); |
| 219 | void p9_client_begin_disconnect(struct p9_client *clnt); | 218 | void p9_client_begin_disconnect(struct p9_client *clnt); |
| 220 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, | 219 | struct p9_fid *p9_client_attach(struct p9_client *clnt, struct p9_fid *afid, |
| 221 | char *uname, u32 n_uname, char *aname); | 220 | char *uname, u32 n_uname, char *aname); |
| 222 | struct p9_fid *p9_client_auth(struct p9_client *clnt, char *uname, | ||
| 223 | u32 n_uname, char *aname); | ||
| 224 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames, | 221 | struct p9_fid *p9_client_walk(struct p9_fid *oldfid, int nwname, char **wnames, |
| 225 | int clone); | 222 | int clone); |
| 226 | int p9_client_open(struct p9_fid *fid, int mode); | 223 | int p9_client_open(struct p9_fid *fid, int mode); |
diff --git a/include/net/addrconf.h b/include/net/addrconf.h index 4d40c4d0230b..a9441249306c 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, | |||
| 175 | extern int register_inet6addr_notifier(struct notifier_block *nb); | 175 | extern int register_inet6addr_notifier(struct notifier_block *nb); |
| 176 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); | 176 | extern int unregister_inet6addr_notifier(struct notifier_block *nb); |
| 177 | 177 | ||
| 178 | static 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 | */ | ||
| 185 | static 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 | ||
| 186 | static inline struct inet6_dev * | 190 | /** |
| 187 | in6_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 | */ | ||
| 198 | static 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 | ||
| 198 | extern void in6_dev_finish_destroy(struct inet6_dev *idev); | 210 | extern void in6_dev_finish_destroy(struct inet6_dev *idev); |
| 199 | 211 | ||
| 200 | static inline void | 212 | static inline void in6_dev_put(struct inet6_dev *idev) |
| 201 | in6_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) | 218 | static 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 | ||
| 223 | static inline void in6_dev_hold(struct inet6_dev *idev) | ||
| 224 | { | ||
| 225 | atomic_inc(&idev->refcnt); | ||
| 226 | } | ||
| 210 | 227 | ||
| 211 | extern void inet6_ifa_finish_destroy(struct inet6_ifaddr *ifp); | 228 | extern 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) | 236 | static 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 | ||
| 241 | static 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,21 @@ static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) | |||
| 241 | 264 | ||
| 242 | static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) | 265 | static 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 | ||
| 249 | static inline int ipv6_addr_is_ll_all_routers(const struct in6_addr *addr) | 272 | static 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 | ||
| 256 | extern int __ipv6_isatap_ifid(u8 *eui, __be32 addr); | ||
| 257 | |||
| 258 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) | 279 | static inline int ipv6_addr_is_isatap(const struct in6_addr *addr) |
| 259 | { | 280 | { |
| 260 | return ((addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE)); | 281 | return (addr->s6_addr32[2] | htonl(0x02000000)) == htonl(0x02005EFE); |
| 261 | } | 282 | } |
| 262 | 283 | ||
| 263 | #ifdef CONFIG_PROC_FS | 284 | #ifdef CONFIG_PROC_FS |
diff --git a/include/net/arp.h b/include/net/arp.h index 716f43c5c98e..f4cf6ce66586 100644 --- a/include/net/arp.h +++ b/include/net/arp.h | |||
| @@ -26,6 +26,4 @@ extern struct sk_buff *arp_create(int type, int ptype, __be32 dest_ip, | |||
| 26 | const unsigned char *target_hw); | 26 | const unsigned char *target_hw); |
| 27 | extern void arp_xmit(struct sk_buff *skb); | 27 | extern void arp_xmit(struct sk_buff *skb); |
| 28 | 28 | ||
| 29 | extern const struct neigh_ops arp_broken_ops; | ||
| 30 | |||
| 31 | #endif /* _ARP_H */ | 29 | #endif /* _ARP_H */ |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 30fce0128dd7..d81ea7997701 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -126,6 +126,8 @@ int bt_sock_unregister(int proto); | |||
| 126 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); | 126 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); |
| 127 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); | 127 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); |
| 128 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); | 128 | int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); |
| 129 | int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, | ||
| 130 | struct msghdr *msg, size_t len, int flags); | ||
| 129 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); | 131 | uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); |
| 130 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 132 | int bt_sock_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
| 131 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); | 133 | int bt_sock_wait_state(struct sock *sk, int state, unsigned long timeo); |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index bcbdd6d4e6dd..e30e00834340 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
| @@ -54,7 +54,7 @@ | |||
| 54 | 54 | ||
| 55 | /* HCI controller types */ | 55 | /* HCI controller types */ |
| 56 | #define HCI_BREDR 0x00 | 56 | #define HCI_BREDR 0x00 |
| 57 | #define HCI_80211 0x01 | 57 | #define HCI_AMP 0x01 |
| 58 | 58 | ||
| 59 | /* HCI device quirks */ | 59 | /* HCI device quirks */ |
| 60 | enum { | 60 | enum { |
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) | |||
| 233 | static inline int inquiry_cache_empty(struct hci_dev *hdev) | 233 | static 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 | ||
| 239 | static inline long inquiry_cache_age(struct hci_dev *hdev) | 239 | static 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/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h index a140847d622c..71047bc0af84 100644 --- a/include/net/bluetooth/rfcomm.h +++ b/include/net/bluetooth/rfcomm.h | |||
| @@ -213,11 +213,6 @@ struct rfcomm_dlc { | |||
| 213 | #define RFCOMM_DEFER_SETUP 8 | 213 | #define RFCOMM_DEFER_SETUP 8 |
| 214 | 214 | ||
| 215 | /* Scheduling flags and events */ | 215 | /* Scheduling flags and events */ |
| 216 | #define RFCOMM_SCHED_STATE 0 | ||
| 217 | #define RFCOMM_SCHED_RX 1 | ||
| 218 | #define RFCOMM_SCHED_TX 2 | ||
| 219 | #define RFCOMM_SCHED_TIMEO 3 | ||
| 220 | #define RFCOMM_SCHED_AUTH 4 | ||
| 221 | #define RFCOMM_SCHED_WAKEUP 31 | 216 | #define RFCOMM_SCHED_WAKEUP 31 |
| 222 | 217 | ||
| 223 | /* MSC exchange flags */ | 218 | /* MSC exchange flags */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 2fd06c60ffbb..2a7936d7851d 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 |
| @@ -241,12 +293,24 @@ struct key_params { | |||
| 241 | * enum survey_info_flags - survey information flags | 293 | * enum survey_info_flags - survey information flags |
| 242 | * | 294 | * |
| 243 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 295 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
| 296 | * @SURVEY_INFO_IN_USE: channel is currently being used | ||
| 297 | * @SURVEY_INFO_CHANNEL_TIME: channel active time (in ms) was filled in | ||
| 298 | * @SURVEY_INFO_CHANNEL_TIME_BUSY: channel busy time was filled in | ||
| 299 | * @SURVEY_INFO_CHANNEL_TIME_EXT_BUSY: extension channel busy time was filled in | ||
| 300 | * @SURVEY_INFO_CHANNEL_TIME_RX: channel receive time was filled in | ||
| 301 | * @SURVEY_INFO_CHANNEL_TIME_TX: channel transmit time was filled in | ||
| 244 | * | 302 | * |
| 245 | * Used by the driver to indicate which info in &struct survey_info | 303 | * Used by the driver to indicate which info in &struct survey_info |
| 246 | * it has filled in during the get_survey(). | 304 | * it has filled in during the get_survey(). |
| 247 | */ | 305 | */ |
| 248 | enum survey_info_flags { | 306 | enum survey_info_flags { |
| 249 | SURVEY_INFO_NOISE_DBM = 1<<0, | 307 | SURVEY_INFO_NOISE_DBM = 1<<0, |
| 308 | SURVEY_INFO_IN_USE = 1<<1, | ||
| 309 | SURVEY_INFO_CHANNEL_TIME = 1<<2, | ||
| 310 | SURVEY_INFO_CHANNEL_TIME_BUSY = 1<<3, | ||
| 311 | SURVEY_INFO_CHANNEL_TIME_EXT_BUSY = 1<<4, | ||
| 312 | SURVEY_INFO_CHANNEL_TIME_RX = 1<<5, | ||
| 313 | SURVEY_INFO_CHANNEL_TIME_TX = 1<<6, | ||
| 250 | }; | 314 | }; |
| 251 | 315 | ||
| 252 | /** | 316 | /** |
| @@ -256,6 +320,11 @@ enum survey_info_flags { | |||
| 256 | * @filled: bitflag of flags from &enum survey_info_flags | 320 | * @filled: bitflag of flags from &enum survey_info_flags |
| 257 | * @noise: channel noise in dBm. This and all following fields are | 321 | * @noise: channel noise in dBm. This and all following fields are |
| 258 | * optional | 322 | * optional |
| 323 | * @channel_time: amount of time in ms the radio spent on the channel | ||
| 324 | * @channel_time_busy: amount of time the primary channel was sensed busy | ||
| 325 | * @channel_time_ext_busy: amount of time the extension channel was sensed busy | ||
| 326 | * @channel_time_rx: amount of time the radio spent receiving data | ||
| 327 | * @channel_time_tx: amount of time the radio spent transmitting data | ||
| 259 | * | 328 | * |
| 260 | * Used by dump_survey() to report back per-channel survey information. | 329 | * Used by dump_survey() to report back per-channel survey information. |
| 261 | * | 330 | * |
| @@ -264,6 +333,11 @@ enum survey_info_flags { | |||
| 264 | */ | 333 | */ |
| 265 | struct survey_info { | 334 | struct survey_info { |
| 266 | struct ieee80211_channel *channel; | 335 | struct ieee80211_channel *channel; |
| 336 | u64 channel_time; | ||
| 337 | u64 channel_time_busy; | ||
| 338 | u64 channel_time_ext_busy; | ||
| 339 | u64 channel_time_rx; | ||
| 340 | u64 channel_time_tx; | ||
| 267 | u32 filled; | 341 | u32 filled; |
| 268 | s8 noise; | 342 | s8 noise; |
| 269 | }; | 343 | }; |
| @@ -347,6 +421,9 @@ struct station_parameters { | |||
| 347 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) | 421 | * (tx_bitrate, tx_bitrate_flags and tx_bitrate_mcs) |
| 348 | * @STATION_INFO_RX_PACKETS: @rx_packets filled | 422 | * @STATION_INFO_RX_PACKETS: @rx_packets filled |
| 349 | * @STATION_INFO_TX_PACKETS: @tx_packets filled | 423 | * @STATION_INFO_TX_PACKETS: @tx_packets filled |
| 424 | * @STATION_INFO_TX_RETRIES: @tx_retries filled | ||
| 425 | * @STATION_INFO_TX_FAILED: @tx_failed filled | ||
| 426 | * @STATION_INFO_RX_DROP_MISC: @rx_dropped_misc filled | ||
| 350 | */ | 427 | */ |
| 351 | enum station_info_flags { | 428 | enum station_info_flags { |
| 352 | STATION_INFO_INACTIVE_TIME = 1<<0, | 429 | STATION_INFO_INACTIVE_TIME = 1<<0, |
| @@ -359,6 +436,9 @@ enum station_info_flags { | |||
| 359 | STATION_INFO_TX_BITRATE = 1<<7, | 436 | STATION_INFO_TX_BITRATE = 1<<7, |
| 360 | STATION_INFO_RX_PACKETS = 1<<8, | 437 | STATION_INFO_RX_PACKETS = 1<<8, |
| 361 | STATION_INFO_TX_PACKETS = 1<<9, | 438 | STATION_INFO_TX_PACKETS = 1<<9, |
| 439 | STATION_INFO_TX_RETRIES = 1<<10, | ||
| 440 | STATION_INFO_TX_FAILED = 1<<11, | ||
| 441 | STATION_INFO_RX_DROP_MISC = 1<<12, | ||
| 362 | }; | 442 | }; |
| 363 | 443 | ||
| 364 | /** | 444 | /** |
| @@ -408,6 +488,9 @@ struct rate_info { | |||
| 408 | * @txrate: current unicast bitrate to this station | 488 | * @txrate: current unicast bitrate to this station |
| 409 | * @rx_packets: packets received from this station | 489 | * @rx_packets: packets received from this station |
| 410 | * @tx_packets: packets transmitted to this station | 490 | * @tx_packets: packets transmitted to this station |
| 491 | * @tx_retries: cumulative retry counts | ||
| 492 | * @tx_failed: number of failed transmissions (retries exceeded, no ACK) | ||
| 493 | * @rx_dropped_misc: Dropped for un-specified reason. | ||
| 411 | * @generation: generation number for nl80211 dumps. | 494 | * @generation: generation number for nl80211 dumps. |
| 412 | * This number should increase every time the list of stations | 495 | * This number should increase every time the list of stations |
| 413 | * changes, i.e. when a station is added or removed, so that | 496 | * changes, i.e. when a station is added or removed, so that |
| @@ -425,6 +508,9 @@ struct station_info { | |||
| 425 | struct rate_info txrate; | 508 | struct rate_info txrate; |
| 426 | u32 rx_packets; | 509 | u32 rx_packets; |
| 427 | u32 tx_packets; | 510 | u32 tx_packets; |
| 511 | u32 tx_retries; | ||
| 512 | u32 tx_failed; | ||
| 513 | u32 rx_dropped_misc; | ||
| 428 | 514 | ||
| 429 | int generation; | 515 | int generation; |
| 430 | }; | 516 | }; |
| @@ -570,8 +656,28 @@ struct ieee80211_txq_params { | |||
| 570 | /* from net/wireless.h */ | 656 | /* from net/wireless.h */ |
| 571 | struct wiphy; | 657 | struct wiphy; |
| 572 | 658 | ||
| 573 | /* from net/ieee80211.h */ | 659 | /** |
| 574 | struct ieee80211_channel; | 660 | * DOC: Scanning and BSS list handling |
| 661 | * | ||
| 662 | * The scanning process itself is fairly simple, but cfg80211 offers quite | ||
| 663 | * a bit of helper functionality. To start a scan, the scan operation will | ||
| 664 | * be invoked with a scan definition. This scan definition contains the | ||
| 665 | * channels to scan, and the SSIDs to send probe requests for (including the | ||
| 666 | * wildcard, if desired). A passive scan is indicated by having no SSIDs to | ||
| 667 | * probe. Additionally, a scan request may contain extra information elements | ||
| 668 | * that should be added to the probe request. The IEs are guaranteed to be | ||
| 669 | * well-formed, and will not exceed the maximum length the driver advertised | ||
| 670 | * in the wiphy structure. | ||
| 671 | * | ||
| 672 | * When scanning finds a BSS, cfg80211 needs to be notified of that, because | ||
| 673 | * it is responsible for maintaining the BSS list; the driver should not | ||
| 674 | * maintain a list itself. For this notification, various functions exist. | ||
| 675 | * | ||
| 676 | * Since drivers do not maintain a BSS list, there are also a number of | ||
| 677 | * functions to search for a BSS and obtain information about it from the | ||
| 678 | * BSS structure cfg80211 maintains. The BSS list is also made available | ||
| 679 | * to userspace. | ||
| 680 | */ | ||
| 575 | 681 | ||
| 576 | /** | 682 | /** |
| 577 | * struct cfg80211_ssid - SSID description | 683 | * struct cfg80211_ssid - SSID description |
| @@ -691,6 +797,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 | 797 | * sets/clears %NL80211_STA_FLAG_AUTHORIZED. If true, the driver is |
| 692 | * required to assume that the port is unauthorized until authorized by | 798 | * required to assume that the port is unauthorized until authorized by |
| 693 | * user space. Otherwise, port is marked authorized by default. | 799 | * user space. Otherwise, port is marked authorized by default. |
| 800 | * @control_port_ethertype: the control port protocol that should be | ||
| 801 | * allowed through even on unauthorized ports | ||
| 802 | * @control_port_no_encrypt: TRUE to prevent encryption of control port | ||
| 803 | * protocol frames. | ||
| 694 | */ | 804 | */ |
| 695 | struct cfg80211_crypto_settings { | 805 | struct cfg80211_crypto_settings { |
| 696 | u32 wpa_versions; | 806 | u32 wpa_versions; |
| @@ -700,6 +810,8 @@ struct cfg80211_crypto_settings { | |||
| 700 | int n_akm_suites; | 810 | int n_akm_suites; |
| 701 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; | 811 | u32 akm_suites[NL80211_MAX_NR_AKM_SUITES]; |
| 702 | bool control_port; | 812 | bool control_port; |
| 813 | __be16 control_port_ethertype; | ||
| 814 | bool control_port_no_encrypt; | ||
| 703 | }; | 815 | }; |
| 704 | 816 | ||
| 705 | /** | 817 | /** |
| @@ -1020,7 +1132,7 @@ struct cfg80211_pmksa { | |||
| 1020 | * @cancel_remain_on_channel: Cancel an on-going remain-on-channel operation. | 1132 | * @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 | 1133 | * This allows the operation to be terminated prior to timeout based on |
| 1022 | * the duration value. | 1134 | * the duration value. |
| 1023 | * @action: Transmit an action frame | 1135 | * @mgmt_tx: Transmit a management frame |
| 1024 | * | 1136 | * |
| 1025 | * @testmode_cmd: run a test mode command | 1137 | * @testmode_cmd: run a test mode command |
| 1026 | * | 1138 | * |
| @@ -1035,6 +1147,9 @@ struct cfg80211_pmksa { | |||
| 1035 | * allows the driver to adjust the dynamic ps timeout value. | 1147 | * allows the driver to adjust the dynamic ps timeout value. |
| 1036 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. | 1148 | * @set_cqm_rssi_config: Configure connection quality monitor RSSI threshold. |
| 1037 | * | 1149 | * |
| 1150 | * @mgmt_frame_register: Notify driver that a management frame type was | ||
| 1151 | * registered. Note that this callback may not sleep, and cannot run | ||
| 1152 | * concurrently with itself. | ||
| 1038 | */ | 1153 | */ |
| 1039 | struct cfg80211_ops { | 1154 | struct cfg80211_ops { |
| 1040 | int (*suspend)(struct wiphy *wiphy); | 1155 | int (*suspend)(struct wiphy *wiphy); |
| @@ -1050,13 +1165,14 @@ struct cfg80211_ops { | |||
| 1050 | struct vif_params *params); | 1165 | struct vif_params *params); |
| 1051 | 1166 | ||
| 1052 | int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, | 1167 | int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, |
| 1053 | u8 key_index, const u8 *mac_addr, | 1168 | u8 key_index, bool pairwise, const u8 *mac_addr, |
| 1054 | struct key_params *params); | 1169 | struct key_params *params); |
| 1055 | int (*get_key)(struct wiphy *wiphy, struct net_device *netdev, | 1170 | int (*get_key)(struct wiphy *wiphy, struct net_device *netdev, |
| 1056 | u8 key_index, const u8 *mac_addr, void *cookie, | 1171 | u8 key_index, bool pairwise, const u8 *mac_addr, |
| 1172 | void *cookie, | ||
| 1057 | void (*callback)(void *cookie, struct key_params*)); | 1173 | void (*callback)(void *cookie, struct key_params*)); |
| 1058 | int (*del_key)(struct wiphy *wiphy, struct net_device *netdev, | 1174 | int (*del_key)(struct wiphy *wiphy, struct net_device *netdev, |
| 1059 | u8 key_index, const u8 *mac_addr); | 1175 | u8 key_index, bool pairwise, const u8 *mac_addr); |
| 1060 | int (*set_default_key)(struct wiphy *wiphy, | 1176 | int (*set_default_key)(struct wiphy *wiphy, |
| 1061 | struct net_device *netdev, | 1177 | struct net_device *netdev, |
| 1062 | u8 key_index); | 1178 | u8 key_index); |
| @@ -1140,7 +1256,7 @@ struct cfg80211_ops { | |||
| 1140 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1256 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); |
| 1141 | 1257 | ||
| 1142 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1258 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
| 1143 | u8 *addr); | 1259 | const u8 *addr); |
| 1144 | 1260 | ||
| 1145 | void (*rfkill_poll)(struct wiphy *wiphy); | 1261 | void (*rfkill_poll)(struct wiphy *wiphy); |
| 1146 | 1262 | ||
| @@ -1172,7 +1288,7 @@ struct cfg80211_ops { | |||
| 1172 | struct net_device *dev, | 1288 | struct net_device *dev, |
| 1173 | u64 cookie); | 1289 | u64 cookie); |
| 1174 | 1290 | ||
| 1175 | int (*action)(struct wiphy *wiphy, struct net_device *dev, | 1291 | int (*mgmt_tx)(struct wiphy *wiphy, struct net_device *dev, |
| 1176 | struct ieee80211_channel *chan, | 1292 | struct ieee80211_channel *chan, |
| 1177 | enum nl80211_channel_type channel_type, | 1293 | enum nl80211_channel_type channel_type, |
| 1178 | bool channel_type_valid, | 1294 | bool channel_type_valid, |
| @@ -1184,6 +1300,10 @@ struct cfg80211_ops { | |||
| 1184 | int (*set_cqm_rssi_config)(struct wiphy *wiphy, | 1300 | int (*set_cqm_rssi_config)(struct wiphy *wiphy, |
| 1185 | struct net_device *dev, | 1301 | struct net_device *dev, |
| 1186 | s32 rssi_thold, u32 rssi_hyst); | 1302 | s32 rssi_thold, u32 rssi_hyst); |
| 1303 | |||
| 1304 | void (*mgmt_frame_register)(struct wiphy *wiphy, | ||
| 1305 | struct net_device *dev, | ||
| 1306 | u16 frame_type, bool reg); | ||
| 1187 | }; | 1307 | }; |
| 1188 | 1308 | ||
| 1189 | /* | 1309 | /* |
| @@ -1221,21 +1341,31 @@ struct cfg80211_ops { | |||
| 1221 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station | 1341 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station |
| 1222 | * on a VLAN interface) | 1342 | * on a VLAN interface) |
| 1223 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station | 1343 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station |
| 1344 | * @WIPHY_FLAG_CONTROL_PORT_PROTOCOL: This device supports setting the | ||
| 1345 | * control port protocol ethertype. The device also honours the | ||
| 1346 | * control_port_no_encrypt flag. | ||
| 1347 | * @WIPHY_FLAG_IBSS_RSN: The device supports IBSS RSN. | ||
| 1224 | */ | 1348 | */ |
| 1225 | enum wiphy_flags { | 1349 | enum wiphy_flags { |
| 1226 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | 1350 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), |
| 1227 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), | 1351 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), |
| 1228 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), | 1352 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), |
| 1229 | WIPHY_FLAG_NETNS_OK = BIT(3), | 1353 | WIPHY_FLAG_NETNS_OK = BIT(3), |
| 1230 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), | 1354 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), |
| 1231 | WIPHY_FLAG_4ADDR_AP = BIT(5), | 1355 | WIPHY_FLAG_4ADDR_AP = BIT(5), |
| 1232 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | 1356 | WIPHY_FLAG_4ADDR_STATION = BIT(6), |
| 1357 | WIPHY_FLAG_CONTROL_PORT_PROTOCOL = BIT(7), | ||
| 1358 | WIPHY_FLAG_IBSS_RSN = BIT(7), | ||
| 1233 | }; | 1359 | }; |
| 1234 | 1360 | ||
| 1235 | struct mac_address { | 1361 | struct mac_address { |
| 1236 | u8 addr[ETH_ALEN]; | 1362 | u8 addr[ETH_ALEN]; |
| 1237 | }; | 1363 | }; |
| 1238 | 1364 | ||
| 1365 | struct ieee80211_txrx_stypes { | ||
| 1366 | u16 tx, rx; | ||
| 1367 | }; | ||
| 1368 | |||
| 1239 | /** | 1369 | /** |
| 1240 | * struct wiphy - wireless hardware description | 1370 | * struct wiphy - wireless hardware description |
| 1241 | * @reg_notifier: the driver's regulatory notification callback | 1371 | * @reg_notifier: the driver's regulatory notification callback |
| @@ -1286,6 +1416,10 @@ struct mac_address { | |||
| 1286 | * @privid: a pointer that drivers can use to identify if an arbitrary | 1416 | * @privid: a pointer that drivers can use to identify if an arbitrary |
| 1287 | * wiphy is theirs, e.g. in global notifiers | 1417 | * wiphy is theirs, e.g. in global notifiers |
| 1288 | * @bands: information about bands/channels supported by this device | 1418 | * @bands: information about bands/channels supported by this device |
| 1419 | * | ||
| 1420 | * @mgmt_stypes: bitmasks of frame subtypes that can be subscribed to or | ||
| 1421 | * transmitted through nl80211, points to an array indexed by interface | ||
| 1422 | * type | ||
| 1289 | */ | 1423 | */ |
| 1290 | struct wiphy { | 1424 | struct wiphy { |
| 1291 | /* assign these fields before you register the wiphy */ | 1425 | /* assign these fields before you register the wiphy */ |
| @@ -1294,9 +1428,12 @@ struct wiphy { | |||
| 1294 | u8 perm_addr[ETH_ALEN]; | 1428 | u8 perm_addr[ETH_ALEN]; |
| 1295 | u8 addr_mask[ETH_ALEN]; | 1429 | u8 addr_mask[ETH_ALEN]; |
| 1296 | 1430 | ||
| 1297 | u16 n_addresses; | ||
| 1298 | struct mac_address *addresses; | 1431 | struct mac_address *addresses; |
| 1299 | 1432 | ||
| 1433 | const struct ieee80211_txrx_stypes *mgmt_stypes; | ||
| 1434 | |||
| 1435 | u16 n_addresses; | ||
| 1436 | |||
| 1300 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 1437 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
| 1301 | u16 interface_modes; | 1438 | u16 interface_modes; |
| 1302 | 1439 | ||
| @@ -1492,8 +1629,8 @@ struct cfg80211_cached_keys; | |||
| 1492 | * set by driver (if supported) on add_interface BEFORE registering the | 1629 | * 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 | 1630 | * netdev and may otherwise be used by driver read-only, will be update |
| 1494 | * by cfg80211 on change_interface | 1631 | * by cfg80211 on change_interface |
| 1495 | * @action_registrations: list of registrations for action frames | 1632 | * @mgmt_registrations: list of registrations for management frames |
| 1496 | * @action_registrations_lock: lock for the list | 1633 | * @mgmt_registrations_lock: lock for the list |
| 1497 | * @mtx: mutex used to lock data in this struct | 1634 | * @mtx: mutex used to lock data in this struct |
| 1498 | * @cleanup_work: work struct used for cleanup that can't be done directly | 1635 | * @cleanup_work: work struct used for cleanup that can't be done directly |
| 1499 | */ | 1636 | */ |
| @@ -1505,8 +1642,8 @@ struct wireless_dev { | |||
| 1505 | struct list_head list; | 1642 | struct list_head list; |
| 1506 | struct net_device *netdev; | 1643 | struct net_device *netdev; |
| 1507 | 1644 | ||
| 1508 | struct list_head action_registrations; | 1645 | struct list_head mgmt_registrations; |
| 1509 | spinlock_t action_registrations_lock; | 1646 | spinlock_t mgmt_registrations_lock; |
| 1510 | 1647 | ||
| 1511 | struct mutex mtx; | 1648 | struct mutex mtx; |
| 1512 | 1649 | ||
| @@ -1563,8 +1700,10 @@ static inline void *wdev_priv(struct wireless_dev *wdev) | |||
| 1563 | return wiphy_priv(wdev->wiphy); | 1700 | return wiphy_priv(wdev->wiphy); |
| 1564 | } | 1701 | } |
| 1565 | 1702 | ||
| 1566 | /* | 1703 | /** |
| 1567 | * Utility functions | 1704 | * DOC: Utility functions |
| 1705 | * | ||
| 1706 | * cfg80211 offers a number of utility functions that can be useful. | ||
| 1568 | */ | 1707 | */ |
| 1569 | 1708 | ||
| 1570 | /** | 1709 | /** |
| @@ -1715,7 +1854,15 @@ unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); | |||
| 1715 | * ieee80211_hdrlen - get header length in bytes from frame control | 1854 | * ieee80211_hdrlen - get header length in bytes from frame control |
| 1716 | * @fc: frame control field in little-endian format | 1855 | * @fc: frame control field in little-endian format |
| 1717 | */ | 1856 | */ |
| 1718 | unsigned int ieee80211_hdrlen(__le16 fc); | 1857 | unsigned int __attribute_const__ ieee80211_hdrlen(__le16 fc); |
| 1858 | |||
| 1859 | /** | ||
| 1860 | * DOC: Data path helpers | ||
| 1861 | * | ||
| 1862 | * In addition to generic utilities, cfg80211 also offers | ||
| 1863 | * functions that help implement the data path for devices | ||
| 1864 | * that do not do the 802.11/802.3 conversion on the device. | ||
| 1865 | */ | ||
| 1719 | 1866 | ||
| 1720 | /** | 1867 | /** |
| 1721 | * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 | 1868 | * ieee80211_data_to_8023 - convert an 802.11 data frame to 802.3 |
| @@ -1777,8 +1924,10 @@ unsigned int cfg80211_classify8021d(struct sk_buff *skb); | |||
| 1777 | */ | 1924 | */ |
| 1778 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); | 1925 | const u8 *cfg80211_find_ie(u8 eid, const u8 *ies, int len); |
| 1779 | 1926 | ||
| 1780 | /* | 1927 | /** |
| 1781 | * Regulatory helper functions for wiphys | 1928 | * DOC: Regulatory enforcement infrastructure |
| 1929 | * | ||
| 1930 | * TODO | ||
| 1782 | */ | 1931 | */ |
| 1783 | 1932 | ||
| 1784 | /** | 1933 | /** |
| @@ -2181,6 +2330,20 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | |||
| 2181 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); | 2330 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); |
| 2182 | 2331 | ||
| 2183 | /** | 2332 | /** |
| 2333 | * DOC: RFkill integration | ||
| 2334 | * | ||
| 2335 | * RFkill integration in cfg80211 is almost invisible to drivers, | ||
| 2336 | * as cfg80211 automatically registers an rfkill instance for each | ||
| 2337 | * wireless device it knows about. Soft kill is also translated | ||
| 2338 | * into disconnecting and turning all interfaces off, drivers are | ||
| 2339 | * expected to turn off the device when all interfaces are down. | ||
| 2340 | * | ||
| 2341 | * However, devices may have a hard RFkill line, in which case they | ||
| 2342 | * also need to interact with the rfkill subsystem, via cfg80211. | ||
| 2343 | * They can do this with a few helper functions documented here. | ||
| 2344 | */ | ||
| 2345 | |||
| 2346 | /** | ||
| 2184 | * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state | 2347 | * wiphy_rfkill_set_hw_state - notify cfg80211 about hw block state |
| 2185 | * @wiphy: the wiphy | 2348 | * @wiphy: the wiphy |
| 2186 | * @blocked: block status | 2349 | * @blocked: block status |
| @@ -2201,6 +2364,17 @@ void wiphy_rfkill_stop_polling(struct wiphy *wiphy); | |||
| 2201 | 2364 | ||
| 2202 | #ifdef CONFIG_NL80211_TESTMODE | 2365 | #ifdef CONFIG_NL80211_TESTMODE |
| 2203 | /** | 2366 | /** |
| 2367 | * DOC: Test mode | ||
| 2368 | * | ||
| 2369 | * Test mode is a set of utility functions to allow drivers to | ||
| 2370 | * interact with driver-specific tools to aid, for instance, | ||
| 2371 | * factory programming. | ||
| 2372 | * | ||
| 2373 | * This chapter describes how drivers interact with it, for more | ||
| 2374 | * information see the nl80211 book's chapter on it. | ||
| 2375 | */ | ||
| 2376 | |||
| 2377 | /** | ||
| 2204 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply | 2378 | * cfg80211_testmode_alloc_reply_skb - allocate testmode reply |
| 2205 | * @wiphy: the wiphy | 2379 | * @wiphy: the wiphy |
| 2206 | * @approxlen: an upper bound of the length of the data that will | 2380 | * @approxlen: an upper bound of the length of the data that will |
| @@ -2373,38 +2547,39 @@ void cfg80211_new_sta(struct net_device *dev, const u8 *mac_addr, | |||
| 2373 | struct station_info *sinfo, gfp_t gfp); | 2547 | struct station_info *sinfo, gfp_t gfp); |
| 2374 | 2548 | ||
| 2375 | /** | 2549 | /** |
| 2376 | * cfg80211_rx_action - notification of received, unprocessed Action frame | 2550 | * cfg80211_rx_mgmt - notification of received, unprocessed management frame |
| 2377 | * @dev: network device | 2551 | * @dev: network device |
| 2378 | * @freq: Frequency on which the frame was received in MHz | 2552 | * @freq: Frequency on which the frame was received in MHz |
| 2379 | * @buf: Action frame (header + body) | 2553 | * @buf: Management frame (header + body) |
| 2380 | * @len: length of the frame data | 2554 | * @len: length of the frame data |
| 2381 | * @gfp: context flags | 2555 | * @gfp: context flags |
| 2382 | * Returns %true if a user space application is responsible for rejecting the | 2556 | * |
| 2383 | * unrecognized Action frame; %false if no such application is registered | 2557 | * Returns %true if a user space application has registered for this frame. |
| 2384 | * (i.e., the driver is responsible for rejecting the unrecognized Action | 2558 | * For action frames, that makes it responsible for rejecting unrecognized |
| 2385 | * frame) | 2559 | * action frames; %false otherwise, in which case for action frames the |
| 2560 | * driver is responsible for rejecting the frame. | ||
| 2386 | * | 2561 | * |
| 2387 | * This function is called whenever an Action frame is received for a station | 2562 | * This function is called whenever an Action frame is received for a station |
| 2388 | * mode interface, but is not processed in kernel. | 2563 | * mode interface, but is not processed in kernel. |
| 2389 | */ | 2564 | */ |
| 2390 | bool cfg80211_rx_action(struct net_device *dev, int freq, const u8 *buf, | 2565 | bool cfg80211_rx_mgmt(struct net_device *dev, int freq, const u8 *buf, |
| 2391 | size_t len, gfp_t gfp); | 2566 | size_t len, gfp_t gfp); |
| 2392 | 2567 | ||
| 2393 | /** | 2568 | /** |
| 2394 | * cfg80211_action_tx_status - notification of TX status for Action frame | 2569 | * cfg80211_mgmt_tx_status - notification of TX status for management frame |
| 2395 | * @dev: network device | 2570 | * @dev: network device |
| 2396 | * @cookie: Cookie returned by cfg80211_ops::action() | 2571 | * @cookie: Cookie returned by cfg80211_ops::mgmt_tx() |
| 2397 | * @buf: Action frame (header + body) | 2572 | * @buf: Management frame (header + body) |
| 2398 | * @len: length of the frame data | 2573 | * @len: length of the frame data |
| 2399 | * @ack: Whether frame was acknowledged | 2574 | * @ack: Whether frame was acknowledged |
| 2400 | * @gfp: context flags | 2575 | * @gfp: context flags |
| 2401 | * | 2576 | * |
| 2402 | * This function is called whenever an Action frame was requested to be | 2577 | * 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 | 2578 | * transmitted with cfg80211_ops::mgmt_tx() to report the TX status of the |
| 2404 | * transmission attempt. | 2579 | * transmission attempt. |
| 2405 | */ | 2580 | */ |
| 2406 | void cfg80211_action_tx_status(struct net_device *dev, u64 cookie, | 2581 | void cfg80211_mgmt_tx_status(struct net_device *dev, u64 cookie, |
| 2407 | const u8 *buf, size_t len, bool ack, gfp_t gfp); | 2582 | const u8 *buf, size_t len, bool ack, gfp_t gfp); |
| 2408 | 2583 | ||
| 2409 | 2584 | ||
| 2410 | /** | 2585 | /** |
| @@ -2420,56 +2595,41 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
| 2420 | enum nl80211_cqm_rssi_threshold_event rssi_event, | 2595 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
| 2421 | gfp_t gfp); | 2596 | gfp_t gfp); |
| 2422 | 2597 | ||
| 2423 | #ifdef __KERNEL__ | ||
| 2424 | |||
| 2425 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 2598 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
| 2426 | 2599 | ||
| 2427 | /* wiphy_printk helpers, similar to dev_printk */ | 2600 | /* wiphy_printk helpers, similar to dev_printk */ |
| 2428 | 2601 | ||
| 2429 | #define wiphy_printk(level, wiphy, format, args...) \ | 2602 | #define wiphy_printk(level, wiphy, format, args...) \ |
| 2430 | printk(level "%s: " format, wiphy_name(wiphy), ##args) | 2603 | dev_printk(level, &(wiphy)->dev, format, ##args) |
| 2431 | #define wiphy_emerg(wiphy, format, args...) \ | 2604 | #define wiphy_emerg(wiphy, format, args...) \ |
| 2432 | wiphy_printk(KERN_EMERG, wiphy, format, ##args) | 2605 | dev_emerg(&(wiphy)->dev, format, ##args) |
| 2433 | #define wiphy_alert(wiphy, format, args...) \ | 2606 | #define wiphy_alert(wiphy, format, args...) \ |
| 2434 | wiphy_printk(KERN_ALERT, wiphy, format, ##args) | 2607 | dev_alert(&(wiphy)->dev, format, ##args) |
| 2435 | #define wiphy_crit(wiphy, format, args...) \ | 2608 | #define wiphy_crit(wiphy, format, args...) \ |
| 2436 | wiphy_printk(KERN_CRIT, wiphy, format, ##args) | 2609 | dev_crit(&(wiphy)->dev, format, ##args) |
| 2437 | #define wiphy_err(wiphy, format, args...) \ | 2610 | #define wiphy_err(wiphy, format, args...) \ |
| 2438 | wiphy_printk(KERN_ERR, wiphy, format, ##args) | 2611 | dev_err(&(wiphy)->dev, format, ##args) |
| 2439 | #define wiphy_warn(wiphy, format, args...) \ | 2612 | #define wiphy_warn(wiphy, format, args...) \ |
| 2440 | wiphy_printk(KERN_WARNING, wiphy, format, ##args) | 2613 | dev_warn(&(wiphy)->dev, format, ##args) |
| 2441 | #define wiphy_notice(wiphy, format, args...) \ | 2614 | #define wiphy_notice(wiphy, format, args...) \ |
| 2442 | wiphy_printk(KERN_NOTICE, wiphy, format, ##args) | 2615 | dev_notice(&(wiphy)->dev, format, ##args) |
| 2443 | #define wiphy_info(wiphy, format, args...) \ | 2616 | #define wiphy_info(wiphy, format, args...) \ |
| 2444 | wiphy_printk(KERN_INFO, wiphy, format, ##args) | 2617 | dev_info(&(wiphy)->dev, format, ##args) |
| 2445 | 2618 | ||
| 2446 | int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) | 2619 | #define wiphy_debug(wiphy, format, args...) \ |
| 2447 | __attribute__ ((format (printf, 2, 3))); | ||
| 2448 | |||
| 2449 | #if defined(DEBUG) | ||
| 2450 | #define wiphy_dbg(wiphy, format, args...) \ | ||
| 2451 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) | 2620 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) |
| 2452 | #elif defined(CONFIG_DYNAMIC_DEBUG) | 2621 | |
| 2453 | #define wiphy_dbg(wiphy, format, args...) \ | 2622 | #define wiphy_dbg(wiphy, format, args...) \ |
| 2454 | dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) | 2623 | 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 | 2624 | ||
| 2464 | #if defined(VERBOSE_DEBUG) | 2625 | #if defined(VERBOSE_DEBUG) |
| 2465 | #define wiphy_vdbg wiphy_dbg | 2626 | #define wiphy_vdbg wiphy_dbg |
| 2466 | #else | 2627 | #else |
| 2467 | |||
| 2468 | #define wiphy_vdbg(wiphy, format, args...) \ | 2628 | #define wiphy_vdbg(wiphy, format, args...) \ |
| 2469 | ({ \ | 2629 | ({ \ |
| 2470 | if (0) \ | 2630 | if (0) \ |
| 2471 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | 2631 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ |
| 2472 | 0; \ | 2632 | 0; \ |
| 2473 | }) | 2633 | }) |
| 2474 | #endif | 2634 | #endif |
| 2475 | 2635 | ||
| @@ -2481,6 +2641,4 @@ int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) | |||
| 2481 | #define wiphy_WARN(wiphy, format, args...) \ | 2641 | #define wiphy_WARN(wiphy, format, args...) \ |
| 2482 | WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args); | 2642 | WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args); |
| 2483 | 2643 | ||
| 2484 | #endif | ||
| 2485 | |||
| 2486 | #endif /* __NET_CFG80211_H */ | 2644 | #endif /* __NET_CFG80211_H */ |
diff --git a/include/net/dst.h b/include/net/dst.h index 02386505033d..a217c838ec0d 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
| @@ -43,10 +43,11 @@ struct dst_entry { | |||
| 43 | short error; | 43 | short error; |
| 44 | short obsolete; | 44 | short obsolete; |
| 45 | int flags; | 45 | int flags; |
| 46 | #define DST_HOST 1 | 46 | #define DST_HOST 0x0001 |
| 47 | #define DST_NOXFRM 2 | 47 | #define DST_NOXFRM 0x0002 |
| 48 | #define DST_NOPOLICY 4 | 48 | #define DST_NOPOLICY 0x0004 |
| 49 | #define DST_NOHASH 8 | 49 | #define DST_NOHASH 0x0008 |
| 50 | #define DST_NOCACHE 0x0010 | ||
| 50 | unsigned long expires; | 51 | unsigned long expires; |
| 51 | 52 | ||
| 52 | unsigned short header_len; /* more space at head required */ | 53 | unsigned short header_len; /* more space at head required */ |
| @@ -228,23 +229,37 @@ static inline void skb_dst_force(struct sk_buff *skb) | |||
| 228 | 229 | ||
| 229 | 230 | ||
| 230 | /** | 231 | /** |
| 232 | * __skb_tunnel_rx - prepare skb for rx reinsert | ||
| 233 | * @skb: buffer | ||
| 234 | * @dev: tunnel device | ||
| 235 | * | ||
| 236 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, | ||
| 237 | * so make some cleanups. (no accounting done) | ||
| 238 | */ | ||
| 239 | static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | ||
| 240 | { | ||
| 241 | skb->dev = dev; | ||
| 242 | skb->rxhash = 0; | ||
| 243 | skb_set_queue_mapping(skb, 0); | ||
| 244 | skb_dst_drop(skb); | ||
| 245 | nf_reset(skb); | ||
| 246 | } | ||
| 247 | |||
| 248 | /** | ||
| 231 | * skb_tunnel_rx - prepare skb for rx reinsert | 249 | * skb_tunnel_rx - prepare skb for rx reinsert |
| 232 | * @skb: buffer | 250 | * @skb: buffer |
| 233 | * @dev: tunnel device | 251 | * @dev: tunnel device |
| 234 | * | 252 | * |
| 235 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, | 253 | * After decapsulation, packet is going to re-enter (netif_rx()) our stack, |
| 236 | * so make some cleanups, and perform accounting. | 254 | * so make some cleanups, and perform accounting. |
| 255 | * Note: this accounting is not SMP safe. | ||
| 237 | */ | 256 | */ |
| 238 | static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) | 257 | static inline void skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) |
| 239 | { | 258 | { |
| 240 | skb->dev = dev; | ||
| 241 | /* TODO : stats should be SMP safe */ | 259 | /* TODO : stats should be SMP safe */ |
| 242 | dev->stats.rx_packets++; | 260 | dev->stats.rx_packets++; |
| 243 | dev->stats.rx_bytes += skb->len; | 261 | dev->stats.rx_bytes += skb->len; |
| 244 | skb->rxhash = 0; | 262 | __skb_tunnel_rx(skb, dev); |
| 245 | skb_set_queue_mapping(skb, 0); | ||
| 246 | skb_dst_drop(skb); | ||
| 247 | nf_reset(skb); | ||
| 248 | } | 263 | } |
| 249 | 264 | ||
| 250 | /* Children define the path of the packet through the | 265 | /* Children define the path of the packet through the |
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h index d1ff9b7e99b8..1fa5306e3e23 100644 --- a/include/net/dst_ops.h +++ b/include/net/dst_ops.h | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | #ifndef _NET_DST_OPS_H | 1 | #ifndef _NET_DST_OPS_H |
| 2 | #define _NET_DST_OPS_H | 2 | #define _NET_DST_OPS_H |
| 3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
| 4 | #include <linux/percpu_counter.h> | ||
| 4 | 5 | ||
| 5 | struct dst_entry; | 6 | struct dst_entry; |
| 6 | struct kmem_cachep; | 7 | struct kmem_cachep; |
| @@ -22,7 +23,41 @@ struct dst_ops { | |||
| 22 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); | 23 | void (*update_pmtu)(struct dst_entry *dst, u32 mtu); |
| 23 | int (*local_out)(struct sk_buff *skb); | 24 | int (*local_out)(struct sk_buff *skb); |
| 24 | 25 | ||
| 25 | atomic_t entries; | ||
| 26 | struct kmem_cache *kmem_cachep; | 26 | struct kmem_cache *kmem_cachep; |
| 27 | |||
| 28 | struct percpu_counter pcpuc_entries ____cacheline_aligned_in_smp; | ||
| 27 | }; | 29 | }; |
| 30 | |||
| 31 | static inline int dst_entries_get_fast(struct dst_ops *dst) | ||
| 32 | { | ||
| 33 | return percpu_counter_read_positive(&dst->pcpuc_entries); | ||
| 34 | } | ||
| 35 | |||
| 36 | static inline int dst_entries_get_slow(struct dst_ops *dst) | ||
| 37 | { | ||
| 38 | int res; | ||
| 39 | |||
| 40 | local_bh_disable(); | ||
| 41 | res = percpu_counter_sum_positive(&dst->pcpuc_entries); | ||
| 42 | local_bh_enable(); | ||
| 43 | return res; | ||
| 44 | } | ||
| 45 | |||
| 46 | static inline void dst_entries_add(struct dst_ops *dst, int val) | ||
| 47 | { | ||
| 48 | local_bh_disable(); | ||
| 49 | percpu_counter_add(&dst->pcpuc_entries, val); | ||
| 50 | local_bh_enable(); | ||
| 51 | } | ||
| 52 | |||
| 53 | static inline int dst_entries_init(struct dst_ops *dst) | ||
| 54 | { | ||
| 55 | return percpu_counter_init(&dst->pcpuc_entries, 0); | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline void dst_entries_destroy(struct dst_ops *dst) | ||
| 59 | { | ||
| 60 | percpu_counter_destroy(&dst->pcpuc_entries); | ||
| 61 | } | ||
| 62 | |||
| 28 | #endif | 63 | #endif |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index e8923bc20f9f..106f3097d384 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
| @@ -31,6 +31,8 @@ struct fib_lookup_arg { | |||
| 31 | void *lookup_ptr; | 31 | void *lookup_ptr; |
| 32 | void *result; | 32 | void *result; |
| 33 | struct fib_rule *rule; | 33 | struct fib_rule *rule; |
| 34 | int flags; | ||
| 35 | #define FIB_LOOKUP_NOREF 1 | ||
| 34 | }; | 36 | }; |
| 35 | 37 | ||
| 36 | struct fib_rules_ops { | 38 | struct fib_rules_ops { |
| @@ -106,7 +108,6 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
| 106 | 108 | ||
| 107 | extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); | 109 | extern struct fib_rules_ops *fib_rules_register(const struct fib_rules_ops *, struct net *); |
| 108 | extern void fib_rules_unregister(struct fib_rules_ops *); | 110 | extern void fib_rules_unregister(struct fib_rules_ops *); |
| 109 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | ||
| 110 | 111 | ||
| 111 | extern int fib_rules_lookup(struct fib_rules_ops *, | 112 | extern int fib_rules_lookup(struct fib_rules_ops *, |
| 112 | struct flowi *, int flags, | 113 | struct flowi *, int flags, |
diff --git a/include/net/flow.h b/include/net/flow.h index bb08692a20b0..0ac3fb5e0973 100644 --- a/include/net/flow.h +++ b/include/net/flow.h | |||
| @@ -49,6 +49,7 @@ struct flowi { | |||
| 49 | __u8 proto; | 49 | __u8 proto; |
| 50 | __u8 flags; | 50 | __u8 flags; |
| 51 | #define FLOWI_FLAG_ANYSRC 0x01 | 51 | #define FLOWI_FLAG_ANYSRC 0x01 |
| 52 | #define FLOWI_FLAG_MATCH_ANY_IIF 0x02 | ||
| 52 | union { | 53 | union { |
| 53 | struct { | 54 | struct { |
| 54 | __be16 sport; | 55 | __be16 sport; |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index f7dcd2c70412..8a64b811a39a 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
| @@ -20,6 +20,9 @@ struct genl_multicast_group { | |||
| 20 | u32 id; | 20 | u32 id; |
| 21 | }; | 21 | }; |
| 22 | 22 | ||
| 23 | struct genl_ops; | ||
| 24 | struct genl_info; | ||
| 25 | |||
| 23 | /** | 26 | /** |
| 24 | * struct genl_family - generic netlink family | 27 | * struct genl_family - generic netlink family |
| 25 | * @id: protocol family idenfitier | 28 | * @id: protocol family idenfitier |
| @@ -29,6 +32,10 @@ struct genl_multicast_group { | |||
| 29 | * @maxattr: maximum number of attributes supported | 32 | * @maxattr: maximum number of attributes supported |
| 30 | * @netnsok: set to true if the family can handle network | 33 | * @netnsok: set to true if the family can handle network |
| 31 | * namespaces and should be presented in all of them | 34 | * namespaces and should be presented in all of them |
| 35 | * @pre_doit: called before an operation's doit callback, it may | ||
| 36 | * do additional, common, filtering and return an error | ||
| 37 | * @post_doit: called after an operation's doit callback, it may | ||
| 38 | * undo operations done by pre_doit, for example release locks | ||
| 32 | * @attrbuf: buffer to store parsed attributes | 39 | * @attrbuf: buffer to store parsed attributes |
| 33 | * @ops_list: list of all assigned operations | 40 | * @ops_list: list of all assigned operations |
| 34 | * @family_list: family list | 41 | * @family_list: family list |
| @@ -41,6 +48,12 @@ struct genl_family { | |||
| 41 | unsigned int version; | 48 | unsigned int version; |
| 42 | unsigned int maxattr; | 49 | unsigned int maxattr; |
| 43 | bool netnsok; | 50 | bool netnsok; |
| 51 | int (*pre_doit)(struct genl_ops *ops, | ||
| 52 | struct sk_buff *skb, | ||
| 53 | struct genl_info *info); | ||
| 54 | void (*post_doit)(struct genl_ops *ops, | ||
| 55 | struct sk_buff *skb, | ||
| 56 | struct genl_info *info); | ||
| 44 | struct nlattr ** attrbuf; /* private */ | 57 | struct nlattr ** attrbuf; /* private */ |
| 45 | struct list_head ops_list; /* private */ | 58 | struct list_head ops_list; /* private */ |
| 46 | struct list_head family_list; /* private */ | 59 | struct list_head family_list; /* private */ |
| @@ -55,6 +68,8 @@ struct genl_family { | |||
| 55 | * @genlhdr: generic netlink message header | 68 | * @genlhdr: generic netlink message header |
| 56 | * @userhdr: user specific header | 69 | * @userhdr: user specific header |
| 57 | * @attrs: netlink attributes | 70 | * @attrs: netlink attributes |
| 71 | * @_net: network namespace | ||
| 72 | * @user_ptr: user pointers | ||
| 58 | */ | 73 | */ |
| 59 | struct genl_info { | 74 | struct genl_info { |
| 60 | u32 snd_seq; | 75 | u32 snd_seq; |
| @@ -66,6 +81,7 @@ struct genl_info { | |||
| 66 | #ifdef CONFIG_NET_NS | 81 | #ifdef CONFIG_NET_NS |
| 67 | struct net * _net; | 82 | struct net * _net; |
| 68 | #endif | 83 | #endif |
| 84 | void * user_ptr[2]; | ||
| 69 | }; | 85 | }; |
| 70 | 86 | ||
| 71 | static inline struct net *genl_info_net(struct genl_info *info) | 87 | static inline struct net *genl_info_net(struct genl_info *info) |
| @@ -81,6 +97,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) | |||
| 81 | /** | 97 | /** |
| 82 | * struct genl_ops - generic netlink operations | 98 | * struct genl_ops - generic netlink operations |
| 83 | * @cmd: command identifier | 99 | * @cmd: command identifier |
| 100 | * @internal_flags: flags used by the family | ||
| 84 | * @flags: flags | 101 | * @flags: flags |
| 85 | * @policy: attribute validation policy | 102 | * @policy: attribute validation policy |
| 86 | * @doit: standard command callback | 103 | * @doit: standard command callback |
| @@ -90,6 +107,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) | |||
| 90 | */ | 107 | */ |
| 91 | struct genl_ops { | 108 | struct genl_ops { |
| 92 | u8 cmd; | 109 | u8 cmd; |
| 110 | u8 internal_flags; | ||
| 93 | unsigned int flags; | 111 | unsigned int flags; |
| 94 | const struct nla_policy *policy; | 112 | const struct nla_policy *policy; |
| 95 | int (*doit)(struct sk_buff *skb, | 113 | int (*doit)(struct sk_buff *skb, |
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 | |||
| 10 | struct gre_protocol { | ||
| 11 | int (*handler)(struct sk_buff *skb); | ||
| 12 | void (*err_handler)(struct sk_buff *skb, u32 info); | ||
| 13 | }; | ||
| 14 | |||
| 15 | int gre_add_protocol(const struct gre_protocol *proto, u8 version); | ||
| 16 | int 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 | ||
| 28 | static inline int INET_ECN_is_capable(__u8 dsfield) | 28 | static 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 | ||
| 33 | static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) | 33 | static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 74358d1b3f43..e9c2ed8af864 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
| @@ -245,7 +245,7 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk) | |||
| 245 | } | 245 | } |
| 246 | 246 | ||
| 247 | /* Caller must disable local BH processing. */ | 247 | /* Caller must disable local BH processing. */ |
| 248 | extern void __inet_inherit_port(struct sock *sk, struct sock *child); | 248 | extern int __inet_inherit_port(struct sock *sk, struct sock *child); |
| 249 | 249 | ||
| 250 | extern void inet_put_port(struct sock *sk); | 250 | extern void inet_put_port(struct sock *sk); |
| 251 | 251 | ||
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) | |||
| 238 | static inline | 238 | static inline |
| 239 | int ip_dont_fragment(struct sock *sk, struct dst_entry *dst) | 239 | int 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 | ||
| 246 | extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); | 246 | extern void __ip_select_ident(struct iphdr *iph, struct dst_entry *dst, int more); |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index c93f94edc610..ba3666d31766 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
| @@ -86,6 +86,7 @@ struct fib_info { | |||
| 86 | #ifdef CONFIG_IP_ROUTE_MULTIPATH | 86 | #ifdef CONFIG_IP_ROUTE_MULTIPATH |
| 87 | int fib_power; | 87 | int fib_power; |
| 88 | #endif | 88 | #endif |
| 89 | struct rcu_head rcu; | ||
| 89 | struct fib_nh fib_nh[0]; | 90 | struct fib_nh fib_nh[0]; |
| 90 | #define fib_dev fib_nh[0].nh_dev | 91 | #define fib_dev fib_nh[0].nh_dev |
| 91 | }; | 92 | }; |
| @@ -148,7 +149,7 @@ struct fib_table { | |||
| 148 | }; | 149 | }; |
| 149 | 150 | ||
| 150 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp, | 151 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp, |
| 151 | struct fib_result *res); | 152 | struct fib_result *res, int fib_flags); |
| 152 | extern int fib_table_insert(struct fib_table *, struct fib_config *); | 153 | extern int fib_table_insert(struct fib_table *, struct fib_config *); |
| 153 | extern int fib_table_delete(struct fib_table *, struct fib_config *); | 154 | extern int fib_table_delete(struct fib_table *, struct fib_config *); |
| 154 | extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, | 155 | extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, |
| @@ -185,11 +186,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp, | |||
| 185 | struct fib_table *table; | 186 | struct fib_table *table; |
| 186 | 187 | ||
| 187 | table = fib_get_table(net, RT_TABLE_LOCAL); | 188 | table = fib_get_table(net, RT_TABLE_LOCAL); |
| 188 | if (!fib_table_lookup(table, flp, res)) | 189 | if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF)) |
| 189 | return 0; | 190 | return 0; |
| 190 | 191 | ||
| 191 | table = fib_get_table(net, RT_TABLE_MAIN); | 192 | table = fib_get_table(net, RT_TABLE_MAIN); |
| 192 | if (!fib_table_lookup(table, flp, res)) | 193 | if (!fib_table_lookup(table, flp, res, FIB_LOOKUP_NOREF)) |
| 193 | return 0; | 194 | return 0; |
| 194 | return -ENETUNREACH; | 195 | return -ENETUNREACH; |
| 195 | } | 196 | } |
| @@ -254,16 +255,6 @@ static inline void fib_info_put(struct fib_info *fi) | |||
| 254 | free_fib_info(fi); | 255 | free_fib_info(fi); |
| 255 | } | 256 | } |
| 256 | 257 | ||
| 257 | static inline void fib_res_put(struct fib_result *res) | ||
| 258 | { | ||
| 259 | if (res->fi) | ||
| 260 | fib_info_put(res->fi); | ||
| 261 | #ifdef CONFIG_IP_MULTIPLE_TABLES | ||
| 262 | if (res->r) | ||
| 263 | fib_rule_put(res->r); | ||
| 264 | #endif | ||
| 265 | } | ||
| 266 | |||
| 267 | #ifdef CONFIG_PROC_FS | 258 | #ifdef CONFIG_PROC_FS |
| 268 | extern int __net_init fib_proc_init(struct net *net); | 259 | extern int __net_init fib_proc_init(struct net *net); |
| 269 | extern void __net_exit fib_proc_exit(struct net *net); | 260 | extern void __net_exit fib_proc_exit(struct net *net); |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index f976885f686f..b7bbd6c28cfa 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
| @@ -25,7 +25,9 @@ | |||
| 25 | #include <linux/ip.h> | 25 | #include <linux/ip.h> |
| 26 | #include <linux/ipv6.h> /* for struct ipv6hdr */ | 26 | #include <linux/ipv6.h> /* for struct ipv6hdr */ |
| 27 | #include <net/ipv6.h> /* for ipv6_addr_copy */ | 27 | #include <net/ipv6.h> /* for ipv6_addr_copy */ |
| 28 | 28 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | |
| 29 | #include <net/netfilter/nf_conntrack.h> | ||
| 30 | #endif | ||
| 29 | 31 | ||
| 30 | /* Connections' size value needed by ip_vs_ctl.c */ | 32 | /* Connections' size value needed by ip_vs_ctl.c */ |
| 31 | extern int ip_vs_conn_tab_size; | 33 | extern int ip_vs_conn_tab_size; |
| @@ -134,24 +136,24 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
| 134 | if (net_ratelimit()) \ | 136 | if (net_ratelimit()) \ |
| 135 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ | 137 | printk(KERN_DEBUG pr_fmt(msg), ##__VA_ARGS__); \ |
| 136 | } while (0) | 138 | } while (0) |
| 137 | #define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) \ | 139 | #define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg) \ |
| 138 | do { \ | 140 | do { \ |
| 139 | if (level <= ip_vs_get_debug_level()) \ | 141 | if (level <= ip_vs_get_debug_level()) \ |
| 140 | pp->debug_packet(pp, skb, ofs, msg); \ | 142 | pp->debug_packet(af, pp, skb, ofs, msg); \ |
| 141 | } while (0) | 143 | } while (0) |
| 142 | #define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) \ | 144 | #define IP_VS_DBG_RL_PKT(level, af, pp, skb, ofs, msg) \ |
| 143 | do { \ | 145 | do { \ |
| 144 | if (level <= ip_vs_get_debug_level() && \ | 146 | if (level <= ip_vs_get_debug_level() && \ |
| 145 | net_ratelimit()) \ | 147 | net_ratelimit()) \ |
| 146 | pp->debug_packet(pp, skb, ofs, msg); \ | 148 | pp->debug_packet(af, pp, skb, ofs, msg); \ |
| 147 | } while (0) | 149 | } while (0) |
| 148 | #else /* NO DEBUGGING at ALL */ | 150 | #else /* NO DEBUGGING at ALL */ |
| 149 | #define IP_VS_DBG_BUF(level, msg...) do {} while (0) | 151 | #define IP_VS_DBG_BUF(level, msg...) do {} while (0) |
| 150 | #define IP_VS_ERR_BUF(msg...) do {} while (0) | 152 | #define IP_VS_ERR_BUF(msg...) do {} while (0) |
| 151 | #define IP_VS_DBG(level, msg...) do {} while (0) | 153 | #define IP_VS_DBG(level, msg...) do {} while (0) |
| 152 | #define IP_VS_DBG_RL(msg...) do {} while (0) | 154 | #define IP_VS_DBG_RL(msg...) do {} while (0) |
| 153 | #define IP_VS_DBG_PKT(level, pp, skb, ofs, msg) do {} while (0) | 155 | #define IP_VS_DBG_PKT(level, af, pp, skb, ofs, msg) do {} while (0) |
| 154 | #define IP_VS_DBG_RL_PKT(level, pp, skb, ofs, msg) do {} while (0) | 156 | #define IP_VS_DBG_RL_PKT(level, af, pp, skb, ofs, msg) do {} while (0) |
| 155 | #endif | 157 | #endif |
| 156 | 158 | ||
| 157 | #define IP_VS_BUG() BUG() | 159 | #define IP_VS_BUG() BUG() |
| @@ -343,7 +345,7 @@ struct ip_vs_protocol { | |||
| 343 | 345 | ||
| 344 | int (*app_conn_bind)(struct ip_vs_conn *cp); | 346 | int (*app_conn_bind)(struct ip_vs_conn *cp); |
| 345 | 347 | ||
| 346 | void (*debug_packet)(struct ip_vs_protocol *pp, | 348 | void (*debug_packet)(int af, struct ip_vs_protocol *pp, |
| 347 | const struct sk_buff *skb, | 349 | const struct sk_buff *skb, |
| 348 | int offset, | 350 | int offset, |
| 349 | const char *msg); | 351 | const char *msg); |
| @@ -355,6 +357,19 @@ struct ip_vs_protocol { | |||
| 355 | 357 | ||
| 356 | extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); | 358 | extern struct ip_vs_protocol * ip_vs_proto_get(unsigned short proto); |
| 357 | 359 | ||
| 360 | struct ip_vs_conn_param { | ||
| 361 | const union nf_inet_addr *caddr; | ||
| 362 | const union nf_inet_addr *vaddr; | ||
| 363 | __be16 cport; | ||
| 364 | __be16 vport; | ||
| 365 | __u16 protocol; | ||
| 366 | u16 af; | ||
| 367 | |||
| 368 | const struct ip_vs_pe *pe; | ||
| 369 | char *pe_data; | ||
| 370 | __u8 pe_data_len; | ||
| 371 | }; | ||
| 372 | |||
| 358 | /* | 373 | /* |
| 359 | * IP_VS structure allocated for each dynamically scheduled connection | 374 | * IP_VS structure allocated for each dynamically scheduled connection |
| 360 | */ | 375 | */ |
| @@ -366,6 +381,7 @@ struct ip_vs_conn { | |||
| 366 | union nf_inet_addr caddr; /* client address */ | 381 | union nf_inet_addr caddr; /* client address */ |
| 367 | union nf_inet_addr vaddr; /* virtual address */ | 382 | union nf_inet_addr vaddr; /* virtual address */ |
| 368 | union nf_inet_addr daddr; /* destination address */ | 383 | union nf_inet_addr daddr; /* destination address */ |
| 384 | volatile __u32 flags; /* status flags */ | ||
| 369 | __be16 cport; | 385 | __be16 cport; |
| 370 | __be16 vport; | 386 | __be16 vport; |
| 371 | __be16 dport; | 387 | __be16 dport; |
| @@ -378,7 +394,6 @@ struct ip_vs_conn { | |||
| 378 | 394 | ||
| 379 | /* Flags and state transition */ | 395 | /* Flags and state transition */ |
| 380 | spinlock_t lock; /* lock for state transition */ | 396 | spinlock_t lock; /* lock for state transition */ |
| 381 | volatile __u16 flags; /* status flags */ | ||
| 382 | volatile __u16 state; /* state info */ | 397 | volatile __u16 state; /* state info */ |
| 383 | volatile __u16 old_state; /* old state, to be used for | 398 | volatile __u16 old_state; /* old state, to be used for |
| 384 | * state transition triggerd | 399 | * state transition triggerd |
| @@ -394,6 +409,7 @@ struct ip_vs_conn { | |||
| 394 | /* packet transmitter for different forwarding methods. If it | 409 | /* packet transmitter for different forwarding methods. If it |
| 395 | mangles the packet, it must return NF_DROP or better NF_STOLEN, | 410 | mangles the packet, it must return NF_DROP or better NF_STOLEN, |
| 396 | otherwise this must be changed to a sk_buff **. | 411 | otherwise this must be changed to a sk_buff **. |
| 412 | NF_ACCEPT can be returned when destination is local. | ||
| 397 | */ | 413 | */ |
| 398 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, | 414 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 399 | struct ip_vs_protocol *pp); | 415 | struct ip_vs_protocol *pp); |
| @@ -405,6 +421,9 @@ struct ip_vs_conn { | |||
| 405 | void *app_data; /* Application private data */ | 421 | void *app_data; /* Application private data */ |
| 406 | struct ip_vs_seq in_seq; /* incoming seq. struct */ | 422 | struct ip_vs_seq in_seq; /* incoming seq. struct */ |
| 407 | struct ip_vs_seq out_seq; /* outgoing seq. struct */ | 423 | struct ip_vs_seq out_seq; /* outgoing seq. struct */ |
| 424 | |||
| 425 | char *pe_data; | ||
| 426 | __u8 pe_data_len; | ||
| 408 | }; | 427 | }; |
| 409 | 428 | ||
| 410 | 429 | ||
| @@ -426,6 +445,7 @@ struct ip_vs_service_user_kern { | |||
| 426 | 445 | ||
| 427 | /* virtual service options */ | 446 | /* virtual service options */ |
| 428 | char *sched_name; | 447 | char *sched_name; |
| 448 | char *pe_name; | ||
| 429 | unsigned flags; /* virtual service flags */ | 449 | unsigned flags; /* virtual service flags */ |
| 430 | unsigned timeout; /* persistent timeout in sec */ | 450 | unsigned timeout; /* persistent timeout in sec */ |
| 431 | u32 netmask; /* persistent netmask */ | 451 | u32 netmask; /* persistent netmask */ |
| @@ -475,6 +495,9 @@ struct ip_vs_service { | |||
| 475 | struct ip_vs_scheduler *scheduler; /* bound scheduler object */ | 495 | struct ip_vs_scheduler *scheduler; /* bound scheduler object */ |
| 476 | rwlock_t sched_lock; /* lock sched_data */ | 496 | rwlock_t sched_lock; /* lock sched_data */ |
| 477 | void *sched_data; /* scheduler application data */ | 497 | void *sched_data; /* scheduler application data */ |
| 498 | |||
| 499 | /* alternate persistence engine */ | ||
| 500 | struct ip_vs_pe *pe; | ||
| 478 | }; | 501 | }; |
| 479 | 502 | ||
| 480 | 503 | ||
| @@ -507,6 +530,10 @@ struct ip_vs_dest { | |||
| 507 | spinlock_t dst_lock; /* lock of dst_cache */ | 530 | spinlock_t dst_lock; /* lock of dst_cache */ |
| 508 | struct dst_entry *dst_cache; /* destination cache entry */ | 531 | struct dst_entry *dst_cache; /* destination cache entry */ |
| 509 | u32 dst_rtos; /* RT_TOS(tos) for dst */ | 532 | u32 dst_rtos; /* RT_TOS(tos) for dst */ |
| 533 | u32 dst_cookie; | ||
| 534 | #ifdef CONFIG_IP_VS_IPV6 | ||
| 535 | struct in6_addr dst_saddr; | ||
| 536 | #endif | ||
| 510 | 537 | ||
| 511 | /* for virtual service */ | 538 | /* for virtual service */ |
| 512 | struct ip_vs_service *svc; /* service it belongs to */ | 539 | struct ip_vs_service *svc; /* service it belongs to */ |
| @@ -538,6 +565,21 @@ struct ip_vs_scheduler { | |||
| 538 | const struct sk_buff *skb); | 565 | const struct sk_buff *skb); |
| 539 | }; | 566 | }; |
| 540 | 567 | ||
| 568 | /* The persistence engine object */ | ||
| 569 | struct ip_vs_pe { | ||
| 570 | struct list_head n_list; /* d-linked list head */ | ||
| 571 | char *name; /* scheduler name */ | ||
| 572 | atomic_t refcnt; /* reference counter */ | ||
| 573 | struct module *module; /* THIS_MODULE/NULL */ | ||
| 574 | |||
| 575 | /* get the connection template, if any */ | ||
| 576 | int (*fill_param)(struct ip_vs_conn_param *p, struct sk_buff *skb); | ||
| 577 | bool (*ct_match)(const struct ip_vs_conn_param *p, | ||
| 578 | struct ip_vs_conn *ct); | ||
| 579 | u32 (*hashkey_raw)(const struct ip_vs_conn_param *p, u32 initval, | ||
| 580 | bool inverse); | ||
| 581 | int (*show_pe_data)(const struct ip_vs_conn *cp, char *buf); | ||
| 582 | }; | ||
| 541 | 583 | ||
| 542 | /* | 584 | /* |
| 543 | * The application module object (a.k.a. app incarnation) | 585 | * The application module object (a.k.a. app incarnation) |
| @@ -556,11 +598,19 @@ struct ip_vs_app { | |||
| 556 | __be16 port; /* port number in net order */ | 598 | __be16 port; /* port number in net order */ |
| 557 | atomic_t usecnt; /* usage counter */ | 599 | atomic_t usecnt; /* usage counter */ |
| 558 | 600 | ||
| 559 | /* output hook: return false if can't linearize. diff set for TCP. */ | 601 | /* |
| 602 | * output hook: Process packet in inout direction, diff set for TCP. | ||
| 603 | * Return: 0=Error, 1=Payload Not Mangled/Mangled but checksum is ok, | ||
| 604 | * 2=Mangled but checksum was not updated | ||
| 605 | */ | ||
| 560 | int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *, | 606 | int (*pkt_out)(struct ip_vs_app *, struct ip_vs_conn *, |
| 561 | struct sk_buff *, int *diff); | 607 | struct sk_buff *, int *diff); |
| 562 | 608 | ||
| 563 | /* input hook: return false if can't linearize. diff set for TCP. */ | 609 | /* |
| 610 | * input hook: Process packet in outin direction, diff set for TCP. | ||
| 611 | * Return: 0=Error, 1=Payload Not Mangled/Mangled but checksum is ok, | ||
| 612 | * 2=Mangled but checksum was not updated | ||
| 613 | */ | ||
| 564 | int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *, | 614 | int (*pkt_in)(struct ip_vs_app *, struct ip_vs_conn *, |
| 565 | struct sk_buff *, int *diff); | 615 | struct sk_buff *, int *diff); |
| 566 | 616 | ||
| @@ -624,13 +674,25 @@ enum { | |||
| 624 | IP_VS_DIR_LAST, | 674 | IP_VS_DIR_LAST, |
| 625 | }; | 675 | }; |
| 626 | 676 | ||
| 627 | extern struct ip_vs_conn *ip_vs_conn_in_get | 677 | static inline void ip_vs_conn_fill_param(int af, int protocol, |
| 628 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | 678 | const union nf_inet_addr *caddr, |
| 629 | const union nf_inet_addr *d_addr, __be16 d_port); | 679 | __be16 cport, |
| 680 | const union nf_inet_addr *vaddr, | ||
| 681 | __be16 vport, | ||
| 682 | struct ip_vs_conn_param *p) | ||
| 683 | { | ||
| 684 | p->af = af; | ||
| 685 | p->protocol = protocol; | ||
| 686 | p->caddr = caddr; | ||
| 687 | p->cport = cport; | ||
| 688 | p->vaddr = vaddr; | ||
| 689 | p->vport = vport; | ||
| 690 | p->pe = NULL; | ||
| 691 | p->pe_data = NULL; | ||
| 692 | } | ||
| 630 | 693 | ||
| 631 | extern struct ip_vs_conn *ip_vs_ct_in_get | 694 | struct ip_vs_conn *ip_vs_conn_in_get(const struct ip_vs_conn_param *p); |
| 632 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | 695 | struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); |
| 633 | const union nf_inet_addr *d_addr, __be16 d_port); | ||
| 634 | 696 | ||
| 635 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 697 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
| 636 | struct ip_vs_protocol *pp, | 698 | struct ip_vs_protocol *pp, |
| @@ -638,9 +700,7 @@ struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | |||
| 638 | unsigned int proto_off, | 700 | unsigned int proto_off, |
| 639 | int inverse); | 701 | int inverse); |
| 640 | 702 | ||
| 641 | extern struct ip_vs_conn *ip_vs_conn_out_get | 703 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
| 642 | (int af, int protocol, const union nf_inet_addr *s_addr, __be16 s_port, | ||
| 643 | const union nf_inet_addr *d_addr, __be16 d_port); | ||
| 644 | 704 | ||
| 645 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 705 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
| 646 | struct ip_vs_protocol *pp, | 706 | struct ip_vs_protocol *pp, |
| @@ -656,11 +716,10 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) | |||
| 656 | extern void ip_vs_conn_put(struct ip_vs_conn *cp); | 716 | extern void ip_vs_conn_put(struct ip_vs_conn *cp); |
| 657 | extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); | 717 | extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport); |
| 658 | 718 | ||
| 659 | extern struct ip_vs_conn * | 719 | struct ip_vs_conn *ip_vs_conn_new(const struct ip_vs_conn_param *p, |
| 660 | ip_vs_conn_new(int af, int proto, const union nf_inet_addr *caddr, __be16 cport, | 720 | const union nf_inet_addr *daddr, |
| 661 | const union nf_inet_addr *vaddr, __be16 vport, | 721 | __be16 dport, unsigned flags, |
| 662 | const union nf_inet_addr *daddr, __be16 dport, unsigned flags, | 722 | struct ip_vs_dest *dest); |
| 663 | struct ip_vs_dest *dest); | ||
| 664 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); | 723 | extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); |
| 665 | 724 | ||
| 666 | extern const char * ip_vs_state_name(__u16 proto, int state); | 725 | extern const char * ip_vs_state_name(__u16 proto, int state); |
| @@ -751,6 +810,12 @@ extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); | |||
| 751 | extern int ip_vs_app_init(void); | 810 | extern int ip_vs_app_init(void); |
| 752 | extern void ip_vs_app_cleanup(void); | 811 | extern void ip_vs_app_cleanup(void); |
| 753 | 812 | ||
| 813 | void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe); | ||
| 814 | void ip_vs_unbind_pe(struct ip_vs_service *svc); | ||
| 815 | int register_ip_vs_pe(struct ip_vs_pe *pe); | ||
| 816 | int unregister_ip_vs_pe(struct ip_vs_pe *pe); | ||
| 817 | extern struct ip_vs_pe *ip_vs_pe_get(const char *name); | ||
| 818 | extern void ip_vs_pe_put(struct ip_vs_pe *pe); | ||
| 754 | 819 | ||
| 755 | /* | 820 | /* |
| 756 | * IPVS protocol functions (from ip_vs_proto.c) | 821 | * IPVS protocol functions (from ip_vs_proto.c) |
| @@ -763,7 +828,8 @@ extern int | |||
| 763 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, | 828 | ip_vs_set_state_timeout(int *table, int num, const char *const *names, |
| 764 | const char *name, int to); | 829 | const char *name, int to); |
| 765 | extern void | 830 | extern void |
| 766 | ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp, const struct sk_buff *skb, | 831 | ip_vs_tcpudp_debug_packet(int af, struct ip_vs_protocol *pp, |
| 832 | const struct sk_buff *skb, | ||
| 767 | int offset, const char *msg); | 833 | int offset, const char *msg); |
| 768 | 834 | ||
| 769 | extern struct ip_vs_protocol ip_vs_protocol_tcp; | 835 | extern struct ip_vs_protocol ip_vs_protocol_tcp; |
| @@ -785,7 +851,8 @@ extern int ip_vs_unbind_scheduler(struct ip_vs_service *svc); | |||
| 785 | extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | 851 | extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); |
| 786 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 852 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
| 787 | extern struct ip_vs_conn * | 853 | extern struct ip_vs_conn * |
| 788 | ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb); | 854 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
| 855 | struct ip_vs_protocol *pp, int *ignored); | ||
| 789 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 856 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
| 790 | struct ip_vs_protocol *pp); | 857 | struct ip_vs_protocol *pp); |
| 791 | 858 | ||
| @@ -798,6 +865,8 @@ extern int sysctl_ip_vs_expire_nodest_conn; | |||
| 798 | extern int sysctl_ip_vs_expire_quiescent_template; | 865 | extern int sysctl_ip_vs_expire_quiescent_template; |
| 799 | extern int sysctl_ip_vs_sync_threshold[2]; | 866 | extern int sysctl_ip_vs_sync_threshold[2]; |
| 800 | extern int sysctl_ip_vs_nat_icmp_send; | 867 | extern int sysctl_ip_vs_nat_icmp_send; |
| 868 | extern int sysctl_ip_vs_conntrack; | ||
| 869 | extern int sysctl_ip_vs_snat_reroute; | ||
| 801 | extern struct ip_vs_stats ip_vs_stats; | 870 | extern struct ip_vs_stats ip_vs_stats; |
| 802 | extern const struct ctl_path net_vs_ctl_path[]; | 871 | extern const struct ctl_path net_vs_ctl_path[]; |
| 803 | 872 | ||
| @@ -955,8 +1024,65 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum) | |||
| 955 | return csum_partial(diff, sizeof(diff), oldsum); | 1024 | return csum_partial(diff, sizeof(diff), oldsum); |
| 956 | } | 1025 | } |
| 957 | 1026 | ||
| 1027 | /* | ||
| 1028 | * Forget current conntrack (unconfirmed) and attach notrack entry | ||
| 1029 | */ | ||
| 1030 | static inline void ip_vs_notrack(struct sk_buff *skb) | ||
| 1031 | { | ||
| 1032 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
| 1033 | enum ip_conntrack_info ctinfo; | ||
| 1034 | struct nf_conn *ct = ct = nf_ct_get(skb, &ctinfo); | ||
| 1035 | |||
| 1036 | if (!ct || !nf_ct_is_untracked(ct)) { | ||
| 1037 | nf_reset(skb); | ||
| 1038 | skb->nfct = &nf_ct_untracked_get()->ct_general; | ||
| 1039 | skb->nfctinfo = IP_CT_NEW; | ||
| 1040 | nf_conntrack_get(skb->nfct); | ||
| 1041 | } | ||
| 1042 | #endif | ||
| 1043 | } | ||
| 1044 | |||
| 1045 | #ifdef CONFIG_IP_VS_NFCT | ||
| 1046 | /* | ||
| 1047 | * Netfilter connection tracking | ||
| 1048 | * (from ip_vs_nfct.c) | ||
| 1049 | */ | ||
| 1050 | static inline int ip_vs_conntrack_enabled(void) | ||
| 1051 | { | ||
| 1052 | return sysctl_ip_vs_conntrack; | ||
| 1053 | } | ||
| 1054 | |||
| 958 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, | 1055 | extern void ip_vs_update_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp, |
| 959 | int outin); | 1056 | int outin); |
| 1057 | extern int ip_vs_confirm_conntrack(struct sk_buff *skb, struct ip_vs_conn *cp); | ||
| 1058 | extern void ip_vs_nfct_expect_related(struct sk_buff *skb, struct nf_conn *ct, | ||
| 1059 | struct ip_vs_conn *cp, u_int8_t proto, | ||
| 1060 | const __be16 port, int from_rs); | ||
| 1061 | extern void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp); | ||
| 1062 | |||
| 1063 | #else | ||
| 1064 | |||
| 1065 | static inline int ip_vs_conntrack_enabled(void) | ||
| 1066 | { | ||
| 1067 | return 0; | ||
| 1068 | } | ||
| 1069 | |||
| 1070 | static inline void ip_vs_update_conntrack(struct sk_buff *skb, | ||
| 1071 | struct ip_vs_conn *cp, int outin) | ||
| 1072 | { | ||
| 1073 | } | ||
| 1074 | |||
| 1075 | static inline int ip_vs_confirm_conntrack(struct sk_buff *skb, | ||
| 1076 | struct ip_vs_conn *cp) | ||
| 1077 | { | ||
| 1078 | return NF_ACCEPT; | ||
| 1079 | } | ||
| 1080 | |||
| 1081 | static inline void ip_vs_conn_drop_conntrack(struct ip_vs_conn *cp) | ||
| 1082 | { | ||
| 1083 | } | ||
| 1084 | /* CONFIG_IP_VS_NFCT */ | ||
| 1085 | #endif | ||
| 960 | 1086 | ||
| 961 | #endif /* __KERNEL__ */ | 1087 | #endif /* __KERNEL__ */ |
| 962 | 1088 | ||
diff --git a/include/net/ipip.h b/include/net/ipip.h index 65caea8b414f..58abbf966b0c 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
| @@ -45,7 +45,7 @@ struct ip_tunnel_prl_entry { | |||
| 45 | struct rcu_head rcu_head; | 45 | struct rcu_head rcu_head; |
| 46 | }; | 46 | }; |
| 47 | 47 | ||
| 48 | #define IPTUNNEL_XMIT() do { \ | 48 | #define __IPTUNNEL_XMIT(stats1, stats2) do { \ |
| 49 | int err; \ | 49 | int err; \ |
| 50 | int pkt_len = skb->len - skb_transport_offset(skb); \ | 50 | int pkt_len = skb->len - skb_transport_offset(skb); \ |
| 51 | \ | 51 | \ |
| @@ -54,12 +54,14 @@ struct ip_tunnel_prl_entry { | |||
| 54 | \ | 54 | \ |
| 55 | err = ip_local_out(skb); \ | 55 | err = ip_local_out(skb); \ |
| 56 | if (likely(net_xmit_eval(err) == 0)) { \ | 56 | if (likely(net_xmit_eval(err) == 0)) { \ |
| 57 | txq->tx_bytes += pkt_len; \ | 57 | (stats1)->tx_bytes += pkt_len; \ |
| 58 | txq->tx_packets++; \ | 58 | (stats1)->tx_packets++; \ |
| 59 | } else { \ | 59 | } else { \ |
| 60 | stats->tx_errors++; \ | 60 | (stats2)->tx_errors++; \ |
| 61 | stats->tx_aborted_errors++; \ | 61 | (stats2)->tx_aborted_errors++; \ |
| 62 | } \ | 62 | } \ |
| 63 | } while (0) | 63 | } while (0) |
| 64 | 64 | ||
| 65 | #define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) | ||
| 66 | |||
| 65 | #endif | 67 | #endif |
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 | ||
| 263 | static inline int __ipv6_addr_src_scope(int type) | 263 | static 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 | ||
| 268 | static inline int ipv6_addr_src_scope(const struct in6_addr *addr) | 268 | static inline int ipv6_addr_src_scope(const struct in6_addr *addr) |
| @@ -279,10 +279,10 @@ static inline int | |||
| 279 | ipv6_masked_addr_cmp(const struct in6_addr *a1, const struct in6_addr *m, | 279 | ipv6_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 | ||
| 288 | static inline void ipv6_addr_copy(struct in6_addr *a1, const struct in6_addr *a2) | 288 | static 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, | |||
| 317 | static inline int ipv6_addr_equal(const struct in6_addr *a1, | 317 | static 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 | ||
| 326 | static inline int __ipv6_prefix_equal(const __be32 *a1, const __be32 *a2, | 326 | static 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 | ||
| 374 | static inline int ipv6_addr_any(const struct in6_addr *a) | 374 | static 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 | ||
| 380 | static inline int ipv6_addr_loopback(const struct in6_addr *a) | 380 | static 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 | ||
| 386 | static inline int ipv6_addr_v4mapped(const struct in6_addr *a) | 386 | static 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 | */ |
| 396 | static inline int ipv6_addr_orchid(const struct in6_addr *a) | 396 | static 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 | ||
| 402 | static inline void ipv6_addr_set_v4mapped(const __be32 addr, | 401 | static 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 | ||
| 447 | static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_addr *a2) | 446 | static 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 | ||
| 70 | extern char *irlan_state[]; | 70 | extern const char * const irlan_state[]; |
| 71 | 71 | ||
| 72 | void irlan_do_client_event(struct irlan_cb *self, IRLAN_EVENT event, | 72 | void 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..9fdf982d1286 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 | */ |
| 153 | enum ieee80211_bss_change { | 154 | enum 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 | */ |
| 227 | struct ieee80211_bss_conf { | 232 | struct 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 | /** |
| @@ -315,6 +321,9 @@ struct ieee80211_bss_conf { | |||
| 315 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame | 321 | * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame |
| 316 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this | 322 | * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this |
| 317 | * frame and selects the maximum number of streams that it can use. | 323 | * frame and selects the maximum number of streams that it can use. |
| 324 | * | ||
| 325 | * Note: If you have to add new flags to the enumeration, then don't | ||
| 326 | * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. | ||
| 318 | */ | 327 | */ |
| 319 | enum mac80211_tx_control_flags { | 328 | enum mac80211_tx_control_flags { |
| 320 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), | 329 | IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), |
| @@ -344,6 +353,19 @@ enum mac80211_tx_control_flags { | |||
| 344 | 353 | ||
| 345 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 | 354 | #define IEEE80211_TX_CTL_STBC_SHIFT 23 |
| 346 | 355 | ||
| 356 | /* | ||
| 357 | * This definition is used as a mask to clear all temporary flags, which are | ||
| 358 | * set by the tx handlers for each transmission attempt by the mac80211 stack. | ||
| 359 | */ | ||
| 360 | #define IEEE80211_TX_TEMPORARY_FLAGS (IEEE80211_TX_CTL_NO_ACK | \ | ||
| 361 | IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_FIRST_FRAGMENT | \ | ||
| 362 | IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ | ||
| 363 | IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ | ||
| 364 | IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ | ||
| 365 | IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ | ||
| 366 | IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ | ||
| 367 | IEEE80211_TX_CTL_STBC) | ||
| 368 | |||
| 347 | /** | 369 | /** |
| 348 | * enum mac80211_rate_control_flags - per-rate flags set by the | 370 | * enum mac80211_rate_control_flags - per-rate flags set by the |
| 349 | * Rate Control algorithm. | 371 | * Rate Control algorithm. |
| @@ -559,9 +581,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
| 559 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 581 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
| 560 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 582 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
| 561 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 583 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
| 562 | * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported | ||
| 563 | * on cooked monitor to avoid double-reporting it for multiple | ||
| 564 | * virtual interfaces | ||
| 565 | */ | 584 | */ |
| 566 | enum mac80211_rx_flags { | 585 | enum mac80211_rx_flags { |
| 567 | RX_FLAG_MMIC_ERROR = 1<<0, | 586 | RX_FLAG_MMIC_ERROR = 1<<0, |
| @@ -575,7 +594,6 @@ enum mac80211_rx_flags { | |||
| 575 | RX_FLAG_HT = 1<<9, | 594 | RX_FLAG_HT = 1<<9, |
| 576 | RX_FLAG_40MHZ = 1<<10, | 595 | RX_FLAG_40MHZ = 1<<10, |
| 577 | RX_FLAG_SHORT_GI = 1<<11, | 596 | RX_FLAG_SHORT_GI = 1<<11, |
| 578 | RX_FLAG_INTERNAL_CMTR = 1<<12, | ||
| 579 | }; | 597 | }; |
| 580 | 598 | ||
| 581 | /** | 599 | /** |
| @@ -596,6 +614,7 @@ enum mac80211_rx_flags { | |||
| 596 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 614 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
| 597 | * HT rates are use (RX_FLAG_HT) | 615 | * HT rates are use (RX_FLAG_HT) |
| 598 | * @flag: %RX_FLAG_* | 616 | * @flag: %RX_FLAG_* |
| 617 | * @rx_flags: internal RX flags for mac80211 | ||
| 599 | */ | 618 | */ |
| 600 | struct ieee80211_rx_status { | 619 | struct ieee80211_rx_status { |
| 601 | u64 mactime; | 620 | u64 mactime; |
| @@ -605,6 +624,7 @@ struct ieee80211_rx_status { | |||
| 605 | int antenna; | 624 | int antenna; |
| 606 | int rate_idx; | 625 | int rate_idx; |
| 607 | int flag; | 626 | int flag; |
| 627 | unsigned int rx_flags; | ||
| 608 | }; | 628 | }; |
| 609 | 629 | ||
| 610 | /** | 630 | /** |
| @@ -763,6 +783,8 @@ struct ieee80211_channel_switch { | |||
| 763 | * @bss_conf: BSS configuration for this interface, either our own | 783 | * @bss_conf: BSS configuration for this interface, either our own |
| 764 | * or the BSS we're associated to | 784 | * or the BSS we're associated to |
| 765 | * @addr: address of this interface | 785 | * @addr: address of this interface |
| 786 | * @p2p: indicates whether this AP or STA interface is a p2p | ||
| 787 | * interface, i.e. a GO or p2p-sta respectively | ||
| 766 | * @drv_priv: data area for driver use, will always be aligned to | 788 | * @drv_priv: data area for driver use, will always be aligned to |
| 767 | * sizeof(void *). | 789 | * sizeof(void *). |
| 768 | */ | 790 | */ |
| @@ -770,6 +792,7 @@ struct ieee80211_vif { | |||
| 770 | enum nl80211_iftype type; | 792 | enum nl80211_iftype type; |
| 771 | struct ieee80211_bss_conf bss_conf; | 793 | struct ieee80211_bss_conf bss_conf; |
| 772 | u8 addr[ETH_ALEN]; | 794 | u8 addr[ETH_ALEN]; |
| 795 | bool p2p; | ||
| 773 | /* must be last */ | 796 | /* must be last */ |
| 774 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 797 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
| 775 | }; | 798 | }; |
| @@ -783,20 +806,6 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
| 783 | } | 806 | } |
| 784 | 807 | ||
| 785 | /** | 808 | /** |
| 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 | */ | ||
| 792 | enum 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 | 809 | * enum ieee80211_key_flags - key flags |
| 801 | * | 810 | * |
| 802 | * These flags are used for communication about keys between the driver | 811 | * These flags are used for communication about keys between the driver |
| @@ -833,7 +842,7 @@ enum ieee80211_key_flags { | |||
| 833 | * @hw_key_idx: To be set by the driver, this is the key index the driver | 842 | * @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 | 843 | * wants to be given when a frame is transmitted and needs to be |
| 835 | * encrypted in hardware. | 844 | * encrypted in hardware. |
| 836 | * @alg: The key algorithm. | 845 | * @cipher: The key's cipher suite selector. |
| 837 | * @flags: key flags, see &enum ieee80211_key_flags. | 846 | * @flags: key flags, see &enum ieee80211_key_flags. |
| 838 | * @keyidx: the key index (0-3) | 847 | * @keyidx: the key index (0-3) |
| 839 | * @keylen: key material length | 848 | * @keylen: key material length |
| @@ -846,7 +855,7 @@ enum ieee80211_key_flags { | |||
| 846 | * @iv_len: The IV length for this key type | 855 | * @iv_len: The IV length for this key type |
| 847 | */ | 856 | */ |
| 848 | struct ieee80211_key_conf { | 857 | struct ieee80211_key_conf { |
| 849 | enum ieee80211_key_alg alg; | 858 | u32 cipher; |
| 850 | u8 icv_len; | 859 | u8 icv_len; |
| 851 | u8 iv_len; | 860 | u8 iv_len; |
| 852 | u8 hw_key_idx; | 861 | u8 hw_key_idx; |
| @@ -1032,6 +1041,13 @@ enum ieee80211_tkip_key_type { | |||
| 1032 | * @IEEE80211_HW_NEED_DTIM_PERIOD: | 1041 | * @IEEE80211_HW_NEED_DTIM_PERIOD: |
| 1033 | * This device needs to know the DTIM period for the BSS before | 1042 | * This device needs to know the DTIM period for the BSS before |
| 1034 | * associating. | 1043 | * associating. |
| 1044 | * | ||
| 1045 | * @IEEE80211_HW_SUPPORTS_PER_STA_GTK: The device's crypto engine supports | ||
| 1046 | * per-station GTKs as used by IBSS RSN or during fast transition. If | ||
| 1047 | * the device doesn't support per-station GTKs, but can be asked not | ||
| 1048 | * to decrypt group addressed frames, then IBSS RSN support is still | ||
| 1049 | * possible but software crypto will be used. Advertise the wiphy flag | ||
| 1050 | * only in that case. | ||
| 1035 | */ | 1051 | */ |
| 1036 | enum ieee80211_hw_flags { | 1052 | enum ieee80211_hw_flags { |
| 1037 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | 1053 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, |
| @@ -1055,6 +1071,7 @@ enum ieee80211_hw_flags { | |||
| 1055 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, | 1071 | IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, |
| 1056 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, | 1072 | IEEE80211_HW_CONNECTION_MONITOR = 1<<19, |
| 1057 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, | 1073 | IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, |
| 1074 | IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, | ||
| 1058 | }; | 1075 | }; |
| 1059 | 1076 | ||
| 1060 | /** | 1077 | /** |
| @@ -1100,8 +1117,15 @@ enum ieee80211_hw_flags { | |||
| 1100 | * @sta_data_size: size (in bytes) of the drv_priv data area | 1117 | * @sta_data_size: size (in bytes) of the drv_priv data area |
| 1101 | * within &struct ieee80211_sta. | 1118 | * within &struct ieee80211_sta. |
| 1102 | * | 1119 | * |
| 1103 | * @max_rates: maximum number of alternate rate retry stages | 1120 | * @max_rates: maximum number of alternate rate retry stages the hw |
| 1121 | * can handle. | ||
| 1122 | * @max_report_rates: maximum number of alternate rate retry stages | ||
| 1123 | * the hw can report back. | ||
| 1104 | * @max_rate_tries: maximum number of tries for each stage | 1124 | * @max_rate_tries: maximum number of tries for each stage |
| 1125 | * | ||
| 1126 | * @napi_weight: weight used for NAPI polling. You must specify an | ||
| 1127 | * appropriate value here if a napi_poll operation is provided | ||
| 1128 | * by your driver. | ||
| 1105 | */ | 1129 | */ |
| 1106 | struct ieee80211_hw { | 1130 | struct ieee80211_hw { |
| 1107 | struct ieee80211_conf conf; | 1131 | struct ieee80211_conf conf; |
| @@ -1113,10 +1137,12 @@ struct ieee80211_hw { | |||
| 1113 | int channel_change_time; | 1137 | int channel_change_time; |
| 1114 | int vif_data_size; | 1138 | int vif_data_size; |
| 1115 | int sta_data_size; | 1139 | int sta_data_size; |
| 1140 | int napi_weight; | ||
| 1116 | u16 queues; | 1141 | u16 queues; |
| 1117 | u16 max_listen_interval; | 1142 | u16 max_listen_interval; |
| 1118 | s8 max_signal; | 1143 | s8 max_signal; |
| 1119 | u8 max_rates; | 1144 | u8 max_rates; |
| 1145 | u8 max_report_rates; | ||
| 1120 | u8 max_rate_tries; | 1146 | u8 max_rate_tries; |
| 1121 | }; | 1147 | }; |
| 1122 | 1148 | ||
| @@ -1245,8 +1271,8 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1245 | * %IEEE80211_CONF_PS flag enabled means that the powersave mode defined in | 1271 | * %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 | 1272 | * 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 | 1273 | * with hardware wakeup and sleep states. Driver is responsible for waking |
| 1248 | * up the hardware before issueing commands to the hardware and putting it | 1274 | * up the hardware before issuing commands to the hardware and putting it |
| 1249 | * back to sleep at approriate times. | 1275 | * back to sleep at appropriate times. |
| 1250 | * | 1276 | * |
| 1251 | * When PS is enabled, hardware needs to wakeup for beacons and receive the | 1277 | * 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 | 1278 | * buffered multicast/broadcast frames after the beacon. Also it must be |
| @@ -1267,7 +1293,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1267 | * there's data traffic and still saving significantly power in idle | 1293 | * there's data traffic and still saving significantly power in idle |
| 1268 | * periods. | 1294 | * periods. |
| 1269 | * | 1295 | * |
| 1270 | * Dynamic powersave is supported by simply mac80211 enabling and disabling | 1296 | * Dynamic powersave is simply supported by mac80211 enabling and disabling |
| 1271 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS | 1297 | * PS based on traffic. Driver needs to only set %IEEE80211_HW_SUPPORTS_PS |
| 1272 | * flag and mac80211 will handle everything automatically. Additionally, | 1298 | * flag and mac80211 will handle everything automatically. Additionally, |
| 1273 | * hardware having support for the dynamic PS feature may set the | 1299 | * hardware having support for the dynamic PS feature may set the |
| @@ -1452,12 +1478,14 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, | |||
| 1452 | * honour this flag if possible. | 1478 | * honour this flag if possible. |
| 1453 | * | 1479 | * |
| 1454 | * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS | 1480 | * @FIF_CONTROL: pass control frames (except for PS Poll), if PROMISC_IN_BSS |
| 1455 | * is not set then only those addressed to this station. | 1481 | * is not set then only those addressed to this station. |
| 1456 | * | 1482 | * |
| 1457 | * @FIF_OTHER_BSS: pass frames destined to other BSSes | 1483 | * @FIF_OTHER_BSS: pass frames destined to other BSSes |
| 1458 | * | 1484 | * |
| 1459 | * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only | 1485 | * @FIF_PSPOLL: pass PS Poll frames, if PROMISC_IN_BSS is not set then only |
| 1460 | * those addressed to this station. | 1486 | * those addressed to this station. |
| 1487 | * | ||
| 1488 | * @FIF_PROBE_REQ: pass probe request frames | ||
| 1461 | */ | 1489 | */ |
| 1462 | enum ieee80211_filter_flags { | 1490 | enum ieee80211_filter_flags { |
| 1463 | FIF_PROMISC_IN_BSS = 1<<0, | 1491 | FIF_PROMISC_IN_BSS = 1<<0, |
| @@ -1468,6 +1496,7 @@ enum ieee80211_filter_flags { | |||
| 1468 | FIF_CONTROL = 1<<5, | 1496 | FIF_CONTROL = 1<<5, |
| 1469 | FIF_OTHER_BSS = 1<<6, | 1497 | FIF_OTHER_BSS = 1<<6, |
| 1470 | FIF_PSPOLL = 1<<7, | 1498 | FIF_PSPOLL = 1<<7, |
| 1499 | FIF_PROBE_REQ = 1<<8, | ||
| 1471 | }; | 1500 | }; |
| 1472 | 1501 | ||
| 1473 | /** | 1502 | /** |
| @@ -1540,6 +1569,12 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1540 | * negative error code (which will be seen in userspace.) | 1569 | * negative error code (which will be seen in userspace.) |
| 1541 | * Must be implemented and can sleep. | 1570 | * Must be implemented and can sleep. |
| 1542 | * | 1571 | * |
| 1572 | * @change_interface: Called when a netdevice changes type. This callback | ||
| 1573 | * is optional, but only if it is supported can interface types be | ||
| 1574 | * switched while the interface is UP. The callback may sleep. | ||
| 1575 | * Note that while an interface is being switched, it will not be | ||
| 1576 | * found by the interface iteration callbacks. | ||
| 1577 | * | ||
| 1543 | * @remove_interface: Notifies a driver that an interface is going down. | 1578 | * @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 | 1579 | * The @stop callback is called after this if it is the last interface |
| 1545 | * and no monitor interfaces are present. | 1580 | * and no monitor interfaces are present. |
| @@ -1687,6 +1722,8 @@ enum ieee80211_ampdu_mlme_action { | |||
| 1687 | * switch operation for CSAs received from the AP may implement this | 1722 | * switch operation for CSAs received from the AP may implement this |
| 1688 | * callback. They must then call ieee80211_chswitch_done() to indicate | 1723 | * callback. They must then call ieee80211_chswitch_done() to indicate |
| 1689 | * completion of the channel switch. | 1724 | * completion of the channel switch. |
| 1725 | * | ||
| 1726 | * @napi_poll: Poll Rx queue for incoming data frames. | ||
| 1690 | */ | 1727 | */ |
| 1691 | struct ieee80211_ops { | 1728 | struct ieee80211_ops { |
| 1692 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); | 1729 | int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); |
| @@ -1694,6 +1731,9 @@ struct ieee80211_ops { | |||
| 1694 | void (*stop)(struct ieee80211_hw *hw); | 1731 | void (*stop)(struct ieee80211_hw *hw); |
| 1695 | int (*add_interface)(struct ieee80211_hw *hw, | 1732 | int (*add_interface)(struct ieee80211_hw *hw, |
| 1696 | struct ieee80211_vif *vif); | 1733 | struct ieee80211_vif *vif); |
| 1734 | int (*change_interface)(struct ieee80211_hw *hw, | ||
| 1735 | struct ieee80211_vif *vif, | ||
| 1736 | enum nl80211_iftype new_type, bool p2p); | ||
| 1697 | void (*remove_interface)(struct ieee80211_hw *hw, | 1737 | void (*remove_interface)(struct ieee80211_hw *hw, |
| 1698 | struct ieee80211_vif *vif); | 1738 | struct ieee80211_vif *vif); |
| 1699 | int (*config)(struct ieee80211_hw *hw, u32 changed); | 1739 | int (*config)(struct ieee80211_hw *hw, u32 changed); |
| @@ -1752,6 +1792,7 @@ struct ieee80211_ops { | |||
| 1752 | void (*flush)(struct ieee80211_hw *hw, bool drop); | 1792 | void (*flush)(struct ieee80211_hw *hw, bool drop); |
| 1753 | void (*channel_switch)(struct ieee80211_hw *hw, | 1793 | void (*channel_switch)(struct ieee80211_hw *hw, |
| 1754 | struct ieee80211_channel_switch *ch_switch); | 1794 | struct ieee80211_channel_switch *ch_switch); |
| 1795 | int (*napi_poll)(struct ieee80211_hw *hw, int budget); | ||
| 1755 | }; | 1796 | }; |
| 1756 | 1797 | ||
| 1757 | /** | 1798 | /** |
| @@ -1897,6 +1938,22 @@ void ieee80211_free_hw(struct ieee80211_hw *hw); | |||
| 1897 | */ | 1938 | */ |
| 1898 | void ieee80211_restart_hw(struct ieee80211_hw *hw); | 1939 | void ieee80211_restart_hw(struct ieee80211_hw *hw); |
| 1899 | 1940 | ||
| 1941 | /** ieee80211_napi_schedule - schedule NAPI poll | ||
| 1942 | * | ||
| 1943 | * Use this function to schedule NAPI polling on a device. | ||
| 1944 | * | ||
| 1945 | * @hw: the hardware to start polling | ||
| 1946 | */ | ||
| 1947 | void ieee80211_napi_schedule(struct ieee80211_hw *hw); | ||
| 1948 | |||
| 1949 | /** ieee80211_napi_complete - complete NAPI polling | ||
| 1950 | * | ||
| 1951 | * Use this function to finish NAPI polling on a device. | ||
| 1952 | * | ||
| 1953 | * @hw: the hardware to stop polling | ||
| 1954 | */ | ||
| 1955 | void ieee80211_napi_complete(struct ieee80211_hw *hw); | ||
| 1956 | |||
| 1900 | /** | 1957 | /** |
| 1901 | * ieee80211_rx - receive frame | 1958 | * ieee80211_rx - receive frame |
| 1902 | * | 1959 | * |
| @@ -2252,7 +2309,8 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw); | |||
| 2252 | * | 2309 | * |
| 2253 | * When hardware scan offload is used (i.e. the hw_scan() callback is | 2310 | * 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 | 2311 | * assigned) this function needs to be called by the driver to notify |
| 2255 | * mac80211 that the scan finished. | 2312 | * mac80211 that the scan finished. This function can be called from |
| 2313 | * any context, including hardirq context. | ||
| 2256 | * | 2314 | * |
| 2257 | * @hw: the hardware that finished the scan | 2315 | * @hw: the hardware that finished the scan |
| 2258 | * @aborted: set to true if scan was aborted | 2316 | * @aborted: set to true if scan was aborted |
| @@ -2267,6 +2325,7 @@ void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted); | |||
| 2267 | * This function allows the iterator function to sleep, when the iterator | 2325 | * This function allows the iterator function to sleep, when the iterator |
| 2268 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 2326 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
| 2269 | * be used. | 2327 | * be used. |
| 2328 | * Does not iterate over a new interface during add_interface() | ||
| 2270 | * | 2329 | * |
| 2271 | * @hw: the hardware struct of which the interfaces should be iterated over | 2330 | * @hw: the hardware struct of which the interfaces should be iterated over |
| 2272 | * @iterator: the iterator function to call | 2331 | * @iterator: the iterator function to call |
| @@ -2284,6 +2343,7 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
| 2284 | * hardware that are currently active and calls the callback for them. | 2343 | * hardware that are currently active and calls the callback for them. |
| 2285 | * This function requires the iterator callback function to be atomic, | 2344 | * This function requires the iterator callback function to be atomic, |
| 2286 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 2345 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
| 2346 | * Does not iterate over a new interface during add_interface() | ||
| 2287 | * | 2347 | * |
| 2288 | * @hw: the hardware struct of which the interfaces should be iterated over | 2348 | * @hw: the hardware struct of which the interfaces should be iterated over |
| 2289 | * @iterator: the iterator function to call, cannot sleep | 2349 | * @iterator: the iterator function to call, cannot sleep |
| @@ -2385,25 +2445,28 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, | |||
| 2385 | const u8 *addr); | 2445 | const u8 *addr); |
| 2386 | 2446 | ||
| 2387 | /** | 2447 | /** |
| 2388 | * ieee80211_find_sta_by_hw - find a station on hardware | 2448 | * ieee80211_find_sta_by_ifaddr - find a station on hardware |
| 2389 | * | 2449 | * |
| 2390 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 2450 | * @hw: pointer as obtained from ieee80211_alloc_hw() |
| 2391 | * @addr: station's address | 2451 | * @addr: remote station's address |
| 2452 | * @localaddr: local address (vif->sdata->vif.addr). Use NULL for 'any'. | ||
| 2392 | * | 2453 | * |
| 2393 | * This function must be called under RCU lock and the | 2454 | * This function must be called under RCU lock and the |
| 2394 | * resulting pointer is only valid under RCU lock as well. | 2455 | * resulting pointer is only valid under RCU lock as well. |
| 2395 | * | 2456 | * |
| 2396 | * NOTE: This function should not be used! When mac80211 is converted | 2457 | * NOTE: You may pass NULL for localaddr, but then you will just get |
| 2397 | * internally to properly keep track of stations on multiple | 2458 | * the first STA that matches the remote address 'addr'. |
| 2398 | * virtual interfaces, it will not always know which station to | 2459 | * We can have multiple STA associated with multiple |
| 2399 | * return here since a single address might be used by multiple | 2460 | * logical stations (e.g. consider a station connecting to another |
| 2400 | * logical stations (e.g. consider a station connecting to another | 2461 | * BSSID on the same AP hardware without disconnecting first). |
| 2401 | * BSSID on the same AP hardware without disconnecting first). | 2462 | * In this case, the result of this method with localaddr NULL |
| 2463 | * is not reliable. | ||
| 2402 | * | 2464 | * |
| 2403 | * DO NOT USE THIS FUNCTION. | 2465 | * DO NOT USE THIS FUNCTION with localaddr NULL if at all possible. |
| 2404 | */ | 2466 | */ |
| 2405 | struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, | 2467 | struct ieee80211_sta *ieee80211_find_sta_by_ifaddr(struct ieee80211_hw *hw, |
| 2406 | const u8 *addr); | 2468 | const u8 *addr, |
| 2469 | const u8 *localaddr); | ||
| 2407 | 2470 | ||
| 2408 | /** | 2471 | /** |
| 2409 | * ieee80211_sta_block_awake - block station from waking up | 2472 | * ieee80211_sta_block_awake - block station from waking up |
| @@ -2442,7 +2505,7 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | |||
| 2442 | * | 2505 | * |
| 2443 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2506 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 2444 | * | 2507 | * |
| 2445 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING and | 2508 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER and |
| 2446 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the | 2509 | * %IEEE80211_CONF_PS is set, the driver needs to inform whenever the |
| 2447 | * hardware is not receiving beacons with this function. | 2510 | * hardware is not receiving beacons with this function. |
| 2448 | */ | 2511 | */ |
| @@ -2453,7 +2516,7 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif); | |||
| 2453 | * | 2516 | * |
| 2454 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 2517 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
| 2455 | * | 2518 | * |
| 2456 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTERING, and | 2519 | * When beacon filtering is enabled with %IEEE80211_HW_BEACON_FILTER, and |
| 2457 | * %IEEE80211_CONF_PS and %IEEE80211_HW_CONNECTION_MONITOR are set, the driver | 2520 | * %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. | 2521 | * needs to inform if the connection to the AP has been lost. |
| 2459 | * | 2522 | * |
| @@ -2518,6 +2581,34 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif, | |||
| 2518 | */ | 2581 | */ |
| 2519 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); | 2582 | void ieee80211_chswitch_done(struct ieee80211_vif *vif, bool success); |
| 2520 | 2583 | ||
| 2584 | /** | ||
| 2585 | * ieee80211_request_smps - request SM PS transition | ||
| 2586 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | ||
| 2587 | * @smps_mode: new SM PS mode | ||
| 2588 | * | ||
| 2589 | * This allows the driver to request an SM PS transition in managed | ||
| 2590 | * mode. This is useful when the driver has more information than | ||
| 2591 | * the stack about possible interference, for example by bluetooth. | ||
| 2592 | */ | ||
| 2593 | void ieee80211_request_smps(struct ieee80211_vif *vif, | ||
| 2594 | enum ieee80211_smps_mode smps_mode); | ||
| 2595 | |||
| 2596 | /** | ||
| 2597 | * ieee80211_key_removed - disable hw acceleration for key | ||
| 2598 | * @key_conf: The key hw acceleration should be disabled for | ||
| 2599 | * | ||
| 2600 | * This allows drivers to indicate that the given key has been | ||
| 2601 | * removed from hardware acceleration, due to a new key that | ||
| 2602 | * was added. Don't use this if the key can continue to be used | ||
| 2603 | * for TX, if the key restriction is on RX only it is permitted | ||
| 2604 | * to keep the key for TX only and not call this function. | ||
| 2605 | * | ||
| 2606 | * Due to locking constraints, it may only be called during | ||
| 2607 | * @set_key. This function must be allowed to sleep, and the | ||
| 2608 | * key it tries to disable may still be used until it returns. | ||
| 2609 | */ | ||
| 2610 | void ieee80211_key_removed(struct ieee80211_key_conf *key_conf); | ||
| 2611 | |||
| 2521 | /* Rate control API */ | 2612 | /* Rate control API */ |
| 2522 | 2613 | ||
| 2523 | /** | 2614 | /** |
| @@ -2681,4 +2772,26 @@ conf_is_ht(struct ieee80211_conf *conf) | |||
| 2681 | return conf->channel_type != NL80211_CHAN_NO_HT; | 2772 | return conf->channel_type != NL80211_CHAN_NO_HT; |
| 2682 | } | 2773 | } |
| 2683 | 2774 | ||
| 2775 | static inline enum nl80211_iftype | ||
| 2776 | ieee80211_iftype_p2p(enum nl80211_iftype type, bool p2p) | ||
| 2777 | { | ||
| 2778 | if (p2p) { | ||
| 2779 | switch (type) { | ||
| 2780 | case NL80211_IFTYPE_STATION: | ||
| 2781 | return NL80211_IFTYPE_P2P_CLIENT; | ||
| 2782 | case NL80211_IFTYPE_AP: | ||
| 2783 | return NL80211_IFTYPE_P2P_GO; | ||
| 2784 | default: | ||
| 2785 | break; | ||
| 2786 | } | ||
| 2787 | } | ||
| 2788 | return type; | ||
| 2789 | } | ||
| 2790 | |||
| 2791 | static inline enum nl80211_iftype | ||
| 2792 | ieee80211_vif_type_p2p(struct ieee80211_vif *vif) | ||
| 2793 | { | ||
| 2794 | return ieee80211_iftype_p2p(vif->type, vif->p2p); | ||
| 2795 | } | ||
| 2796 | |||
| 2684 | #endif /* MAC80211_H */ | 2797 | #endif /* MAC80211_H */ |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 242879b6c4df..55590ab16b3e 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
| @@ -91,26 +91,28 @@ struct neigh_statistics { | |||
| 91 | #define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field) | 91 | #define NEIGH_CACHE_STAT_INC(tbl, field) this_cpu_inc((tbl)->stats->field) |
| 92 | 92 | ||
| 93 | struct neighbour { | 93 | struct neighbour { |
| 94 | struct neighbour *next; | 94 | struct neighbour __rcu *next; |
| 95 | struct neigh_table *tbl; | 95 | struct neigh_table *tbl; |
| 96 | struct neigh_parms *parms; | 96 | struct neigh_parms *parms; |
| 97 | struct net_device *dev; | ||
| 98 | unsigned long used; | ||
| 99 | unsigned long confirmed; | 97 | unsigned long confirmed; |
| 100 | unsigned long updated; | 98 | unsigned long updated; |
| 101 | __u8 flags; | 99 | __u8 flags; |
| 102 | __u8 nud_state; | 100 | __u8 nud_state; |
| 103 | __u8 type; | 101 | __u8 type; |
| 104 | __u8 dead; | 102 | __u8 dead; |
| 103 | atomic_t refcnt; | ||
| 104 | struct sk_buff_head arp_queue; | ||
| 105 | struct timer_list timer; | ||
| 106 | unsigned long used; | ||
| 105 | atomic_t probes; | 107 | atomic_t probes; |
| 106 | rwlock_t lock; | 108 | rwlock_t lock; |
| 109 | seqlock_t ha_lock; | ||
| 107 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; | 110 | unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; |
| 108 | struct hh_cache *hh; | 111 | struct hh_cache *hh; |
| 109 | atomic_t refcnt; | ||
| 110 | int (*output)(struct sk_buff *skb); | 112 | int (*output)(struct sk_buff *skb); |
| 111 | struct sk_buff_head arp_queue; | ||
| 112 | struct timer_list timer; | ||
| 113 | const struct neigh_ops *ops; | 113 | const struct neigh_ops *ops; |
| 114 | struct rcu_head rcu; | ||
| 115 | struct net_device *dev; | ||
| 114 | u8 primary_key[0]; | 116 | u8 primary_key[0]; |
| 115 | }; | 117 | }; |
| 116 | 118 | ||
| @@ -138,13 +140,22 @@ struct pneigh_entry { | |||
| 138 | * neighbour table manipulation | 140 | * neighbour table manipulation |
| 139 | */ | 141 | */ |
| 140 | 142 | ||
| 143 | struct neigh_hash_table { | ||
| 144 | struct neighbour __rcu **hash_buckets; | ||
| 145 | unsigned int hash_mask; | ||
| 146 | __u32 hash_rnd; | ||
| 147 | struct rcu_head rcu; | ||
| 148 | }; | ||
| 149 | |||
| 141 | 150 | ||
| 142 | struct neigh_table { | 151 | struct neigh_table { |
| 143 | struct neigh_table *next; | 152 | struct neigh_table *next; |
| 144 | int family; | 153 | int family; |
| 145 | int entry_size; | 154 | int entry_size; |
| 146 | int key_len; | 155 | int key_len; |
| 147 | __u32 (*hash)(const void *pkey, const struct net_device *); | 156 | __u32 (*hash)(const void *pkey, |
| 157 | const struct net_device *dev, | ||
| 158 | __u32 hash_rnd); | ||
| 148 | int (*constructor)(struct neighbour *); | 159 | int (*constructor)(struct neighbour *); |
| 149 | int (*pconstructor)(struct pneigh_entry *); | 160 | int (*pconstructor)(struct pneigh_entry *); |
| 150 | void (*pdestructor)(struct pneigh_entry *); | 161 | void (*pdestructor)(struct pneigh_entry *); |
| @@ -163,11 +174,9 @@ struct neigh_table { | |||
| 163 | atomic_t entries; | 174 | atomic_t entries; |
| 164 | rwlock_t lock; | 175 | rwlock_t lock; |
| 165 | unsigned long last_rand; | 176 | unsigned long last_rand; |
| 166 | struct kmem_cache *kmem_cachep; | 177 | struct kmem_cache *kmem_cachep; |
| 167 | struct neigh_statistics __percpu *stats; | 178 | struct neigh_statistics __percpu *stats; |
| 168 | struct neighbour **hash_buckets; | 179 | struct neigh_hash_table __rcu *nht; |
| 169 | unsigned int hash_mask; | ||
| 170 | __u32 hash_rnd; | ||
| 171 | struct pneigh_entry **phash_buckets; | 180 | struct pneigh_entry **phash_buckets; |
| 172 | }; | 181 | }; |
| 173 | 182 | ||
| @@ -237,6 +246,7 @@ extern void pneigh_for_each(struct neigh_table *tbl, void (*cb)(struct pneigh_en | |||
| 237 | struct neigh_seq_state { | 246 | struct neigh_seq_state { |
| 238 | struct seq_net_private p; | 247 | struct seq_net_private p; |
| 239 | struct neigh_table *tbl; | 248 | struct neigh_table *tbl; |
| 249 | struct neigh_hash_table *nht; | ||
| 240 | void *(*neigh_sub_iter)(struct neigh_seq_state *state, | 250 | void *(*neigh_sub_iter)(struct neigh_seq_state *state, |
| 241 | struct neighbour *n, loff_t *pos); | 251 | struct neighbour *n, loff_t *pos); |
| 242 | unsigned int bucket; | 252 | unsigned int bucket; |
| @@ -293,7 +303,10 @@ static inline void neigh_confirm(struct neighbour *neigh) | |||
| 293 | 303 | ||
| 294 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) | 304 | static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) |
| 295 | { | 305 | { |
| 296 | neigh->used = jiffies; | 306 | unsigned long now = ACCESS_ONCE(jiffies); |
| 307 | |||
| 308 | if (neigh->used != now) | ||
| 309 | neigh->used = now; | ||
| 297 | if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE))) | 310 | if (!(neigh->nud_state&(NUD_CONNECTED|NUD_DELAY|NUD_PROBE))) |
| 298 | return __neigh_event_send(neigh, skb); | 311 | return __neigh_event_send(neigh, skb); |
| 299 | return 0; | 312 | return 0; |
| @@ -364,4 +377,14 @@ struct neighbour_cb { | |||
| 364 | 377 | ||
| 365 | #define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb) | 378 | #define NEIGH_CB(skb) ((struct neighbour_cb *)(skb)->cb) |
| 366 | 379 | ||
| 380 | static inline void neigh_ha_snapshot(char *dst, const struct neighbour *n, | ||
| 381 | const struct net_device *dev) | ||
| 382 | { | ||
| 383 | unsigned int seq; | ||
| 384 | |||
| 385 | do { | ||
| 386 | seq = read_seqbegin(&n->ha_lock); | ||
| 387 | memcpy(dst, n->ha, dev->addr_len); | ||
| 388 | } while (read_seqretry(&n->ha_lock, seq)); | ||
| 389 | } | ||
| 367 | #endif | 390 | #endif |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index bd10a7908993..65af9a07cf76 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
| @@ -41,6 +41,8 @@ struct net { | |||
| 41 | * destroy on demand | 41 | * destroy on demand |
| 42 | */ | 42 | */ |
| 43 | #endif | 43 | #endif |
| 44 | spinlock_t rules_mod_lock; | ||
| 45 | |||
| 44 | struct list_head list; /* list of network namespaces */ | 46 | struct list_head list; /* list of network namespaces */ |
| 45 | struct list_head cleanup_list; /* namespaces on death row */ | 47 | struct list_head cleanup_list; /* namespaces on death row */ |
| 46 | struct list_head exit_list; /* Use only net_mutex */ | 48 | struct list_head exit_list; /* Use only net_mutex */ |
| @@ -52,7 +54,8 @@ struct net { | |||
| 52 | struct ctl_table_set sysctls; | 54 | struct ctl_table_set sysctls; |
| 53 | #endif | 55 | #endif |
| 54 | 56 | ||
| 55 | struct net_device *loopback_dev; /* The loopback */ | 57 | struct sock *rtnl; /* rtnetlink socket */ |
| 58 | struct sock *genl_sock; | ||
| 56 | 59 | ||
| 57 | struct list_head dev_base_head; | 60 | struct list_head dev_base_head; |
| 58 | struct hlist_head *dev_name_head; | 61 | struct hlist_head *dev_name_head; |
| @@ -60,11 +63,9 @@ struct net { | |||
| 60 | 63 | ||
| 61 | /* core fib_rules */ | 64 | /* core fib_rules */ |
| 62 | struct list_head rules_ops; | 65 | struct list_head rules_ops; |
| 63 | spinlock_t rules_mod_lock; | ||
| 64 | 66 | ||
| 65 | struct sock *rtnl; /* rtnetlink socket */ | ||
| 66 | struct sock *genl_sock; | ||
| 67 | 67 | ||
| 68 | struct net_device *loopback_dev; /* The loopback */ | ||
| 68 | struct netns_core core; | 69 | struct netns_core core; |
| 69 | struct netns_mib mib; | 70 | struct netns_mib mib; |
| 70 | struct netns_packet packet; | 71 | struct netns_packet packet; |
| @@ -84,13 +85,15 @@ struct net { | |||
| 84 | struct sock *nfnl; | 85 | struct sock *nfnl; |
| 85 | struct sock *nfnl_stash; | 86 | struct sock *nfnl_stash; |
| 86 | #endif | 87 | #endif |
| 87 | #ifdef CONFIG_XFRM | ||
| 88 | struct netns_xfrm xfrm; | ||
| 89 | #endif | ||
| 90 | #ifdef CONFIG_WEXT_CORE | 88 | #ifdef CONFIG_WEXT_CORE |
| 91 | struct sk_buff_head wext_nlevents; | 89 | struct sk_buff_head wext_nlevents; |
| 92 | #endif | 90 | #endif |
| 93 | struct net_generic *gen; | 91 | struct net_generic *gen; |
| 92 | |||
| 93 | /* Note : following structs are cache line aligned */ | ||
| 94 | #ifdef CONFIG_XFRM | ||
| 95 | struct netns_xfrm xfrm; | ||
| 96 | #endif | ||
| 94 | }; | 97 | }; |
| 95 | 98 | ||
| 96 | 99 | ||
diff --git a/include/net/netfilter/ipv6/nf_defrag_ipv6.h b/include/net/netfilter/ipv6/nf_defrag_ipv6.h new file mode 100644 index 000000000000..94dd54d76b48 --- /dev/null +++ b/include/net/netfilter/ipv6/nf_defrag_ipv6.h | |||
| @@ -0,0 +1,6 @@ | |||
| 1 | #ifndef _NF_DEFRAG_IPV6_H | ||
| 2 | #define _NF_DEFRAG_IPV6_H | ||
| 3 | |||
| 4 | extern void nf_defrag_ipv6_enable(void); | ||
| 5 | |||
| 6 | #endif /* _NF_DEFRAG_IPV6_H */ | ||
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index 11e815084fcf..0f8a8c587532 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
| @@ -67,9 +67,6 @@ struct nf_conntrack_expect_policy { | |||
| 67 | 67 | ||
| 68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 | 68 | #define NF_CT_EXPECT_CLASS_DEFAULT 0 |
| 69 | 69 | ||
| 70 | #define NF_CT_EXPECT_PERMANENT 0x1 | ||
| 71 | #define NF_CT_EXPECT_INACTIVE 0x2 | ||
| 72 | |||
| 73 | int nf_conntrack_expect_init(struct net *net); | 70 | int nf_conntrack_expect_init(struct net *net); |
| 74 | void nf_conntrack_expect_fini(struct net *net); | 71 | void nf_conntrack_expect_fini(struct net *net); |
| 75 | 72 | ||
| @@ -85,9 +82,16 @@ struct nf_conntrack_expect * | |||
| 85 | nf_ct_find_expectation(struct net *net, u16 zone, | 82 | nf_ct_find_expectation(struct net *net, u16 zone, |
| 86 | const struct nf_conntrack_tuple *tuple); | 83 | const struct nf_conntrack_tuple *tuple); |
| 87 | 84 | ||
| 88 | void nf_ct_unlink_expect(struct nf_conntrack_expect *exp); | 85 | void nf_ct_unlink_expect_report(struct nf_conntrack_expect *exp, |
| 86 | u32 pid, int report); | ||
| 87 | static inline void nf_ct_unlink_expect(struct nf_conntrack_expect *exp) | ||
| 88 | { | ||
| 89 | nf_ct_unlink_expect_report(exp, 0, 0); | ||
| 90 | } | ||
| 91 | |||
| 89 | void nf_ct_remove_expectations(struct nf_conn *ct); | 92 | void nf_ct_remove_expectations(struct nf_conn *ct); |
| 90 | void nf_ct_unexpect_related(struct nf_conntrack_expect *exp); | 93 | void nf_ct_unexpect_related(struct nf_conntrack_expect *exp); |
| 94 | void nf_ct_remove_userspace_expectations(void); | ||
| 91 | 95 | ||
| 92 | /* Allocate space for an expectation: this is mandatory before calling | 96 | /* Allocate space for an expectation: this is mandatory before calling |
| 93 | nf_ct_expect_related. You will have to call put afterwards. */ | 97 | nf_ct_expect_related. You will have to call put afterwards. */ |
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h index df17bac46bf5..93cc90d28e66 100644 --- a/include/net/netfilter/nf_nat_protocol.h +++ b/include/net/netfilter/nf_nat_protocol.h | |||
| @@ -45,9 +45,6 @@ struct nf_nat_protocol { | |||
| 45 | extern int nf_nat_protocol_register(const struct nf_nat_protocol *proto); | 45 | extern int nf_nat_protocol_register(const struct nf_nat_protocol *proto); |
| 46 | extern void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto); | 46 | extern void nf_nat_protocol_unregister(const struct nf_nat_protocol *proto); |
| 47 | 47 | ||
| 48 | extern const struct nf_nat_protocol *nf_nat_proto_find_get(u_int8_t protocol); | ||
| 49 | extern void nf_nat_proto_put(const struct nf_nat_protocol *proto); | ||
| 50 | |||
| 51 | /* Built-in protocols. */ | 48 | /* Built-in protocols. */ |
| 52 | extern const struct nf_nat_protocol nf_nat_protocol_tcp; | 49 | extern const struct nf_nat_protocol nf_nat_protocol_tcp; |
| 53 | extern const struct nf_nat_protocol nf_nat_protocol_udp; | 50 | extern const struct nf_nat_protocol nf_nat_protocol_udp; |
diff --git a/include/net/netfilter/nf_tproxy_core.h b/include/net/netfilter/nf_tproxy_core.h index 208b46f4d6d2..cd85b3bc8327 100644 --- a/include/net/netfilter/nf_tproxy_core.h +++ b/include/net/netfilter/nf_tproxy_core.h | |||
| @@ -5,15 +5,201 @@ | |||
| 5 | #include <linux/in.h> | 5 | #include <linux/in.h> |
| 6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
| 7 | #include <net/sock.h> | 7 | #include <net/sock.h> |
| 8 | #include <net/inet_sock.h> | 8 | #include <net/inet_hashtables.h> |
| 9 | #include <net/inet6_hashtables.h> | ||
| 9 | #include <net/tcp.h> | 10 | #include <net/tcp.h> |
| 10 | 11 | ||
| 12 | #define NFT_LOOKUP_ANY 0 | ||
| 13 | #define NFT_LOOKUP_LISTENER 1 | ||
| 14 | #define NFT_LOOKUP_ESTABLISHED 2 | ||
| 15 | |||
| 11 | /* look up and get a reference to a matching socket */ | 16 | /* look up and get a reference to a matching socket */ |
| 12 | extern struct sock * | 17 | |
| 18 | |||
| 19 | /* This function is used by the 'TPROXY' target and the 'socket' | ||
| 20 | * match. The following lookups are supported: | ||
| 21 | * | ||
| 22 | * Explicit TProxy target rule | ||
| 23 | * =========================== | ||
| 24 | * | ||
| 25 | * This is used when the user wants to intercept a connection matching | ||
| 26 | * an explicit iptables rule. In this case the sockets are assumed | ||
| 27 | * matching in preference order: | ||
| 28 | * | ||
| 29 | * - match: if there's a fully established connection matching the | ||
| 30 | * _packet_ tuple, it is returned, assuming the redirection | ||
| 31 | * already took place and we process a packet belonging to an | ||
| 32 | * established connection | ||
| 33 | * | ||
| 34 | * - match: if there's a listening socket matching the redirection | ||
| 35 | * (e.g. on-port & on-ip of the connection), it is returned, | ||
| 36 | * regardless if it was bound to 0.0.0.0 or an explicit | ||
| 37 | * address. The reasoning is that if there's an explicit rule, it | ||
| 38 | * does not really matter if the listener is bound to an interface | ||
| 39 | * or to 0. The user already stated that he wants redirection | ||
| 40 | * (since he added the rule). | ||
| 41 | * | ||
| 42 | * "socket" match based redirection (no specific rule) | ||
| 43 | * =================================================== | ||
| 44 | * | ||
| 45 | * There are connections with dynamic endpoints (e.g. FTP data | ||
| 46 | * connection) that the user is unable to add explicit rules | ||
| 47 | * for. These are taken care of by a generic "socket" rule. It is | ||
| 48 | * assumed that the proxy application is trusted to open such | ||
| 49 | * connections without explicit iptables rule (except of course the | ||
| 50 | * generic 'socket' rule). In this case the following sockets are | ||
| 51 | * matched in preference order: | ||
| 52 | * | ||
| 53 | * - match: if there's a fully established connection matching the | ||
| 54 | * _packet_ tuple | ||
| 55 | * | ||
| 56 | * - match: if there's a non-zero bound listener (possibly with a | ||
| 57 | * non-local address) We don't accept zero-bound listeners, since | ||
| 58 | * then local services could intercept traffic going through the | ||
| 59 | * box. | ||
| 60 | * | ||
| 61 | * Please note that there's an overlap between what a TPROXY target | ||
| 62 | * and a socket match will match. Normally if you have both rules the | ||
| 63 | * "socket" match will be the first one, effectively all packets | ||
| 64 | * belonging to established connections going through that one. | ||
| 65 | */ | ||
| 66 | static inline struct sock * | ||
| 13 | nf_tproxy_get_sock_v4(struct net *net, const u8 protocol, | 67 | nf_tproxy_get_sock_v4(struct net *net, const u8 protocol, |
| 14 | const __be32 saddr, const __be32 daddr, | 68 | const __be32 saddr, const __be32 daddr, |
| 15 | const __be16 sport, const __be16 dport, | 69 | const __be16 sport, const __be16 dport, |
| 16 | const struct net_device *in, bool listening); | 70 | const struct net_device *in, int lookup_type) |
| 71 | { | ||
| 72 | struct sock *sk; | ||
| 73 | |||
| 74 | /* look up socket */ | ||
| 75 | switch (protocol) { | ||
| 76 | case IPPROTO_TCP: | ||
| 77 | switch (lookup_type) { | ||
| 78 | case NFT_LOOKUP_ANY: | ||
| 79 | sk = __inet_lookup(net, &tcp_hashinfo, | ||
| 80 | saddr, sport, daddr, dport, | ||
| 81 | in->ifindex); | ||
| 82 | break; | ||
| 83 | case NFT_LOOKUP_LISTENER: | ||
| 84 | sk = inet_lookup_listener(net, &tcp_hashinfo, | ||
| 85 | daddr, dport, | ||
| 86 | in->ifindex); | ||
| 87 | |||
| 88 | /* NOTE: we return listeners even if bound to | ||
| 89 | * 0.0.0.0, those are filtered out in | ||
| 90 | * xt_socket, since xt_TPROXY needs 0 bound | ||
| 91 | * listeners too */ | ||
| 92 | |||
| 93 | break; | ||
| 94 | case NFT_LOOKUP_ESTABLISHED: | ||
| 95 | sk = inet_lookup_established(net, &tcp_hashinfo, | ||
| 96 | saddr, sport, daddr, dport, | ||
| 97 | in->ifindex); | ||
| 98 | break; | ||
| 99 | default: | ||
| 100 | WARN_ON(1); | ||
| 101 | sk = NULL; | ||
| 102 | break; | ||
| 103 | } | ||
| 104 | break; | ||
| 105 | case IPPROTO_UDP: | ||
| 106 | sk = udp4_lib_lookup(net, saddr, sport, daddr, dport, | ||
| 107 | in->ifindex); | ||
| 108 | if (sk && lookup_type != NFT_LOOKUP_ANY) { | ||
| 109 | int connected = (sk->sk_state == TCP_ESTABLISHED); | ||
| 110 | int wildcard = (inet_sk(sk)->inet_rcv_saddr == 0); | ||
| 111 | |||
| 112 | /* NOTE: we return listeners even if bound to | ||
| 113 | * 0.0.0.0, those are filtered out in | ||
| 114 | * xt_socket, since xt_TPROXY needs 0 bound | ||
| 115 | * listeners too */ | ||
| 116 | if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) || | ||
| 117 | (lookup_type == NFT_LOOKUP_LISTENER && connected)) { | ||
| 118 | sock_put(sk); | ||
| 119 | sk = NULL; | ||
| 120 | } | ||
| 121 | } | ||
| 122 | break; | ||
| 123 | default: | ||
| 124 | WARN_ON(1); | ||
| 125 | sk = NULL; | ||
| 126 | } | ||
| 127 | |||
| 128 | pr_debug("tproxy socket lookup: proto %u %08x:%u -> %08x:%u, lookup type: %d, sock %p\n", | ||
| 129 | protocol, ntohl(saddr), ntohs(sport), ntohl(daddr), ntohs(dport), lookup_type, sk); | ||
| 130 | |||
| 131 | return sk; | ||
| 132 | } | ||
| 133 | |||
| 134 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 135 | static inline struct sock * | ||
| 136 | nf_tproxy_get_sock_v6(struct net *net, const u8 protocol, | ||
| 137 | const struct in6_addr *saddr, const struct in6_addr *daddr, | ||
| 138 | const __be16 sport, const __be16 dport, | ||
| 139 | const struct net_device *in, int lookup_type) | ||
| 140 | { | ||
| 141 | struct sock *sk; | ||
| 142 | |||
| 143 | /* look up socket */ | ||
| 144 | switch (protocol) { | ||
| 145 | case IPPROTO_TCP: | ||
| 146 | switch (lookup_type) { | ||
| 147 | case NFT_LOOKUP_ANY: | ||
| 148 | sk = inet6_lookup(net, &tcp_hashinfo, | ||
| 149 | saddr, sport, daddr, dport, | ||
| 150 | in->ifindex); | ||
| 151 | break; | ||
| 152 | case NFT_LOOKUP_LISTENER: | ||
| 153 | sk = inet6_lookup_listener(net, &tcp_hashinfo, | ||
| 154 | daddr, ntohs(dport), | ||
| 155 | in->ifindex); | ||
| 156 | |||
| 157 | /* NOTE: we return listeners even if bound to | ||
| 158 | * 0.0.0.0, those are filtered out in | ||
| 159 | * xt_socket, since xt_TPROXY needs 0 bound | ||
| 160 | * listeners too */ | ||
| 161 | |||
| 162 | break; | ||
| 163 | case NFT_LOOKUP_ESTABLISHED: | ||
| 164 | sk = __inet6_lookup_established(net, &tcp_hashinfo, | ||
| 165 | saddr, sport, daddr, ntohs(dport), | ||
| 166 | in->ifindex); | ||
| 167 | break; | ||
| 168 | default: | ||
| 169 | WARN_ON(1); | ||
| 170 | sk = NULL; | ||
| 171 | break; | ||
| 172 | } | ||
| 173 | break; | ||
| 174 | case IPPROTO_UDP: | ||
| 175 | sk = udp6_lib_lookup(net, saddr, sport, daddr, dport, | ||
| 176 | in->ifindex); | ||
| 177 | if (sk && lookup_type != NFT_LOOKUP_ANY) { | ||
| 178 | int connected = (sk->sk_state == TCP_ESTABLISHED); | ||
| 179 | int wildcard = ipv6_addr_any(&inet6_sk(sk)->rcv_saddr); | ||
| 180 | |||
| 181 | /* NOTE: we return listeners even if bound to | ||
| 182 | * 0.0.0.0, those are filtered out in | ||
| 183 | * xt_socket, since xt_TPROXY needs 0 bound | ||
| 184 | * listeners too */ | ||
| 185 | if ((lookup_type == NFT_LOOKUP_ESTABLISHED && (!connected || wildcard)) || | ||
| 186 | (lookup_type == NFT_LOOKUP_LISTENER && connected)) { | ||
| 187 | sock_put(sk); | ||
| 188 | sk = NULL; | ||
| 189 | } | ||
| 190 | } | ||
| 191 | break; | ||
| 192 | default: | ||
| 193 | WARN_ON(1); | ||
| 194 | sk = NULL; | ||
| 195 | } | ||
| 196 | |||
| 197 | pr_debug("tproxy socket lookup: proto %u %pI6:%u -> %pI6:%u, lookup type: %d, sock %p\n", | ||
| 198 | protocol, saddr, ntohs(sport), daddr, ntohs(dport), lookup_type, sk); | ||
| 199 | |||
| 200 | return sk; | ||
| 201 | } | ||
| 202 | #endif | ||
| 17 | 203 | ||
| 18 | static inline void | 204 | static inline void |
| 19 | nf_tproxy_put_sock(struct sock *sk) | 205 | nf_tproxy_put_sock(struct sock *sk) |
diff --git a/include/net/netfilter/xt_log.h b/include/net/netfilter/xt_log.h new file mode 100644 index 000000000000..0dfb34a5b53c --- /dev/null +++ b/include/net/netfilter/xt_log.h | |||
| @@ -0,0 +1,54 @@ | |||
| 1 | #define S_SIZE (1024 - (sizeof(unsigned int) + 1)) | ||
| 2 | |||
| 3 | struct sbuff { | ||
| 4 | unsigned int count; | ||
| 5 | char buf[S_SIZE + 1]; | ||
| 6 | }; | ||
| 7 | static struct sbuff emergency, *emergency_ptr = &emergency; | ||
| 8 | |||
| 9 | static int sb_add(struct sbuff *m, const char *f, ...) | ||
| 10 | { | ||
| 11 | va_list args; | ||
| 12 | int len; | ||
| 13 | |||
| 14 | if (likely(m->count < S_SIZE)) { | ||
| 15 | va_start(args, f); | ||
| 16 | len = vsnprintf(m->buf + m->count, S_SIZE - m->count, f, args); | ||
| 17 | va_end(args); | ||
| 18 | if (likely(m->count + len < S_SIZE)) { | ||
| 19 | m->count += len; | ||
| 20 | return 0; | ||
| 21 | } | ||
| 22 | } | ||
| 23 | m->count = S_SIZE; | ||
| 24 | printk_once(KERN_ERR KBUILD_MODNAME " please increase S_SIZE\n"); | ||
| 25 | return -1; | ||
| 26 | } | ||
| 27 | |||
| 28 | static struct sbuff *sb_open(void) | ||
| 29 | { | ||
| 30 | struct sbuff *m = kmalloc(sizeof(*m), GFP_ATOMIC); | ||
| 31 | |||
| 32 | if (unlikely(!m)) { | ||
| 33 | local_bh_disable(); | ||
| 34 | do { | ||
| 35 | m = xchg(&emergency_ptr, NULL); | ||
| 36 | } while (!m); | ||
| 37 | } | ||
| 38 | m->count = 0; | ||
| 39 | return m; | ||
| 40 | } | ||
| 41 | |||
| 42 | static void sb_close(struct sbuff *m) | ||
| 43 | { | ||
| 44 | m->buf[m->count] = 0; | ||
| 45 | printk("%s\n", m->buf); | ||
| 46 | |||
| 47 | if (likely(m != &emergency)) | ||
| 48 | kfree(m); | ||
| 49 | else { | ||
| 50 | xchg(&emergency_ptr, m); | ||
| 51 | local_bh_enable(); | ||
| 52 | } | ||
| 53 | } | ||
| 54 | |||
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 74f119a2829a..748f91f87cd5 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
| @@ -43,10 +43,6 @@ struct netns_xfrm { | |||
| 43 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; | 43 | unsigned int policy_count[XFRM_POLICY_MAX * 2]; |
| 44 | struct work_struct policy_hash_work; | 44 | struct work_struct policy_hash_work; |
| 45 | 45 | ||
| 46 | struct dst_ops xfrm4_dst_ops; | ||
| 47 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 48 | struct dst_ops xfrm6_dst_ops; | ||
| 49 | #endif | ||
| 50 | 46 | ||
| 51 | struct sock *nlsk; | 47 | struct sock *nlsk; |
| 52 | struct sock *nlsk_stash; | 48 | struct sock *nlsk_stash; |
| @@ -58,6 +54,11 @@ struct netns_xfrm { | |||
| 58 | #ifdef CONFIG_SYSCTL | 54 | #ifdef CONFIG_SYSCTL |
| 59 | struct ctl_table_header *sysctl_hdr; | 55 | struct ctl_table_header *sysctl_hdr; |
| 60 | #endif | 56 | #endif |
| 57 | |||
| 58 | struct dst_ops xfrm4_dst_ops; | ||
| 59 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
| 60 | struct dst_ops xfrm6_dst_ops; | ||
| 61 | #endif | ||
| 61 | }; | 62 | }; |
| 62 | 63 | ||
| 63 | #endif | 64 | #endif |
diff --git a/include/net/phonet/pep.h b/include/net/phonet/pep.h index 35672b1cf44a..b60b28c99e87 100644 --- a/include/net/phonet/pep.h +++ b/include/net/phonet/pep.h | |||
| @@ -45,6 +45,10 @@ struct pep_sock { | |||
| 45 | u8 tx_fc; /* TX flow control */ | 45 | u8 tx_fc; /* TX flow control */ |
| 46 | u8 init_enable; /* auto-enable at creation */ | 46 | u8 init_enable; /* auto-enable at creation */ |
| 47 | u8 aligned; | 47 | u8 aligned; |
| 48 | #ifdef CONFIG_PHONET_PIPECTRLR | ||
| 49 | u8 pipe_state; | ||
| 50 | struct sockaddr_pn remote_pep; | ||
| 51 | #endif | ||
| 48 | }; | 52 | }; |
| 49 | 53 | ||
| 50 | static inline struct pep_sock *pep_sk(struct sock *sk) | 54 | static inline struct pep_sock *pep_sk(struct sock *sk) |
| @@ -77,6 +81,11 @@ static inline struct pnpipehdr *pnp_hdr(struct sk_buff *skb) | |||
| 77 | #define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4) | 81 | #define MAX_PNPIPE_HEADER (MAX_PHONET_HEADER + 4) |
| 78 | 82 | ||
| 79 | enum { | 83 | enum { |
| 84 | PNS_PIPE_CREATE_REQ = 0x00, | ||
| 85 | PNS_PIPE_CREATE_RESP, | ||
| 86 | PNS_PIPE_REMOVE_REQ, | ||
| 87 | PNS_PIPE_REMOVE_RESP, | ||
| 88 | |||
| 80 | PNS_PIPE_DATA = 0x20, | 89 | PNS_PIPE_DATA = 0x20, |
| 81 | PNS_PIPE_ALIGNED_DATA, | 90 | PNS_PIPE_ALIGNED_DATA, |
| 82 | 91 | ||
| @@ -160,4 +169,21 @@ enum { | |||
| 160 | PEP_IND_READY, | 169 | PEP_IND_READY, |
| 161 | }; | 170 | }; |
| 162 | 171 | ||
| 172 | #ifdef CONFIG_PHONET_PIPECTRLR | ||
| 173 | #define PNS_PEP_CONNECT_UTID 0x02 | ||
| 174 | #define PNS_PIPE_CREATED_IND_UTID 0x04 | ||
| 175 | #define PNS_PIPE_ENABLE_UTID 0x0A | ||
| 176 | #define PNS_PIPE_ENABLED_IND_UTID 0x0C | ||
| 177 | #define PNS_PIPE_DISABLE_UTID 0x0F | ||
| 178 | #define PNS_PIPE_DISABLED_IND_UTID 0x11 | ||
| 179 | #define PNS_PEP_DISCONNECT_UTID 0x06 | ||
| 180 | |||
| 181 | /* Used for tracking state of a pipe */ | ||
| 182 | enum { | ||
| 183 | PIPE_IDLE, | ||
| 184 | PIPE_DISABLED, | ||
| 185 | PIPE_ENABLED, | ||
| 186 | }; | ||
| 187 | #endif /* CONFIG_PHONET_PIPECTRLR */ | ||
| 188 | |||
| 163 | #endif | 189 | #endif |
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); | |||
| 54 | void pn_sock_unhash(struct sock *sk); | 54 | void pn_sock_unhash(struct sock *sk); |
| 55 | int pn_sock_get_port(struct sock *sk, unsigned short sport); | 55 | int pn_sock_get_port(struct sock *sk, unsigned short sport); |
| 56 | 56 | ||
| 57 | struct sock *pn_find_sock_by_res(struct net *net, u8 res); | ||
| 58 | int pn_sock_bind_res(struct sock *sock, u8 res); | ||
| 59 | int pn_sock_unbind_res(struct sock *sk, u8 res); | ||
| 60 | void pn_sock_unbind_all_res(struct sock *sk); | ||
| 61 | |||
| 57 | int pn_skb_send(struct sock *sk, struct sk_buff *skb, | 62 | int 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 | ||
| 59 | extern const struct file_operations pn_sock_seq_fops; | 59 | extern const struct file_operations pn_sock_seq_fops; |
| 60 | extern 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) | 48 | static inline struct raw_iter_state *raw_seq_private(struct seq_file *seq) |
| 49 | { | ||
| 50 | return seq->private; | ||
| 51 | } | ||
| 49 | void *raw_seq_start(struct seq_file *seq, loff_t *pos); | 52 | void *raw_seq_start(struct seq_file *seq, loff_t *pos); |
| 50 | void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); | 53 | void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos); |
| 51 | void raw_seq_stop(struct seq_file *seq, void *v); | 54 | void raw_seq_stop(struct seq_file *seq, void *v); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index af60fd050844..e013c68bfb00 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
| @@ -79,7 +79,6 @@ struct rtnl_link_ops { | |||
| 79 | 79 | ||
| 80 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); | 80 | extern int __rtnl_link_register(struct rtnl_link_ops *ops); |
| 81 | extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); | 81 | extern void __rtnl_link_unregister(struct rtnl_link_ops *ops); |
| 82 | extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops); | ||
| 83 | 82 | ||
| 84 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 83 | extern int rtnl_link_register(struct rtnl_link_ops *ops); |
| 85 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 84 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 3c8728aaab4e..ea1f8a83160d 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
| @@ -328,8 +328,7 @@ extern void qdisc_destroy(struct Qdisc *qdisc); | |||
| 328 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); | 328 | extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); |
| 329 | extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, | 329 | extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue, |
| 330 | struct Qdisc_ops *ops); | 330 | struct Qdisc_ops *ops); |
| 331 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, | 331 | extern struct Qdisc *qdisc_create_dflt(struct netdev_queue *dev_queue, |
| 332 | struct netdev_queue *dev_queue, | ||
| 333 | struct Qdisc_ops *ops, u32 parentid); | 332 | struct Qdisc_ops *ops, u32 parentid); |
| 334 | extern void qdisc_calculate_pkt_len(struct sk_buff *skb, | 333 | extern void qdisc_calculate_pkt_len(struct sk_buff *skb, |
| 335 | struct qdisc_size_table *stab); | 334 | struct qdisc_size_table *stab); |
| @@ -601,7 +600,7 @@ static inline u32 qdisc_l2t(struct qdisc_rate_table* rtab, unsigned int pktlen) | |||
| 601 | slot = 0; | 600 | slot = 0; |
| 602 | slot >>= rtab->rate.cell_log; | 601 | slot >>= rtab->rate.cell_log; |
| 603 | if (slot > 255) | 602 | if (slot > 255) |
| 604 | return (rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]); | 603 | return rtab->data[255]*(slot >> 8) + rtab->data[slot & 0xFF]; |
| 605 | return rtab->data[slot]; | 604 | return rtab->data[slot]; |
| 606 | } | 605 | } |
| 607 | 606 | ||
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 |
| 277 | extern int sctp_debug_flag; | 277 | extern 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))) | 279 | do { \ |
| 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, \ | 284 | do { \ |
| 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, \ | 290 | do { \ |
| 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. */ |
| 394 | static inline sctp_assoc_t sctp_assoc2id(const struct sctp_association *asoc) | 406 | static 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. */ |
| 462 | static inline int sctp_list_single_entry(struct list_head *head) | 474 | static 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. */ |
| 620 | static inline int sctp_phashfn(__u16 lport) | 632 | static 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. */ |
| 626 | static inline int sctp_ep_hashfn(__u16 lport) | 638 | static 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 | ||
| 346 | static inline int TSN_lt(__u32 s, __u32 t) | 346 | static 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 | ||
| 351 | static inline int TSN_lte(__u32 s, __u32 t) | 351 | static 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 | ||
| 370 | static inline int SSN_lt(__u16 s, __u16 t) | 370 | static 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 | ||
| 375 | static inline int SSN_lte(__u16 s, __u16 t) | 375 | static 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 | ||
| 389 | static inline int ADDIP_SERIAL_gte(__u16 s, __u16 t) | 389 | static 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 | ||
| 848 | static inline int sctp_packet_empty(struct sctp_packet *packet) | 848 | static 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? */ |
| 158 | static inline int sctp_tsnmap_has_gap(const struct sctp_tsnmap *map) | 158 | static 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 | ||
| 1563 | static inline void sk_stream_moderate_sndbuf(struct sock *sk) | 1567 | static 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 | */ |
| 1680 | extern int sock_tx_timestamp(struct msghdr *msg, | 1683 | extern 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 | |||
| 7 | struct 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..4fee0424af7e 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
| @@ -346,8 +346,6 @@ static inline void tcp_dec_quickack_mode(struct sock *sk, | |||
| 346 | } | 346 | } |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | extern void tcp_enter_quickack_mode(struct sock *sk); | ||
| 350 | |||
| 351 | #define TCP_ECN_OK 1 | 349 | #define TCP_ECN_OK 1 |
| 352 | #define TCP_ECN_QUEUE_CWR 2 | 350 | #define TCP_ECN_QUEUE_CWR 2 |
| 353 | #define TCP_ECN_DEMAND_CWR 4 | 351 | #define TCP_ECN_DEMAND_CWR 4 |
| @@ -803,6 +801,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 */ | 801 | /* 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) | 802 | #define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) |
| 805 | 803 | ||
| 804 | /* | ||
| 805 | * Convert RFC 3390 larger initial window into an equivalent number of packets. | ||
| 806 | * This is based on the numbers specified in RFC 5681, 3.1. | ||
| 807 | */ | ||
| 808 | static inline u32 rfc3390_bytes_to_packets(const u32 smss) | ||
| 809 | { | ||
| 810 | return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3); | ||
| 811 | } | ||
| 812 | |||
| 806 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); | 813 | extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); |
| 807 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); | 814 | extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); |
| 808 | 815 | ||
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h index 15af6dca0b49..1e0645e1eed2 100644 --- a/include/net/tipc/tipc.h +++ b/include/net/tipc/tipc.h | |||
| @@ -50,8 +50,6 @@ | |||
| 50 | * TIPC operating mode routines | 50 | * TIPC operating mode routines |
| 51 | */ | 51 | */ |
| 52 | 52 | ||
| 53 | u32 tipc_get_addr(void); | ||
| 54 | |||
| 55 | #define TIPC_NOT_RUNNING 0 | 53 | #define TIPC_NOT_RUNNING 0 |
| 56 | #define TIPC_NODE_MODE 1 | 54 | #define TIPC_NODE_MODE 1 |
| 57 | #define TIPC_NET_MODE 2 | 55 | #define TIPC_NET_MODE 2 |
| @@ -62,8 +60,6 @@ int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle); | |||
| 62 | 60 | ||
| 63 | void tipc_detach(unsigned int userref); | 61 | void tipc_detach(unsigned int userref); |
| 64 | 62 | ||
| 65 | int tipc_get_mode(void); | ||
| 66 | |||
| 67 | /* | 63 | /* |
| 68 | * TIPC port manipulation routines | 64 | * TIPC port manipulation routines |
| 69 | */ | 65 | */ |
| @@ -153,12 +149,6 @@ int tipc_disconnect(u32 portref); | |||
| 153 | 149 | ||
| 154 | int tipc_shutdown(u32 ref); | 150 | int tipc_shutdown(u32 ref); |
| 155 | 151 | ||
| 156 | int tipc_isconnected(u32 portref, int *isconnected); | ||
| 157 | |||
| 158 | int tipc_peer(u32 portref, struct tipc_portid *peer); | ||
| 159 | |||
| 160 | int tipc_ref_valid(u32 portref); | ||
| 161 | |||
| 162 | /* | 152 | /* |
| 163 | * TIPC messaging routines | 153 | * TIPC messaging routines |
| 164 | */ | 154 | */ |
| @@ -170,38 +160,12 @@ int tipc_send(u32 portref, | |||
| 170 | unsigned int num_sect, | 160 | unsigned int num_sect, |
| 171 | struct iovec const *msg_sect); | 161 | struct iovec const *msg_sect); |
| 172 | 162 | ||
| 173 | int tipc_send_buf(u32 portref, | ||
| 174 | struct sk_buff *buf, | ||
| 175 | unsigned int dsz); | ||
| 176 | |||
| 177 | int tipc_send2name(u32 portref, | 163 | int tipc_send2name(u32 portref, |
| 178 | struct tipc_name const *name, | 164 | struct tipc_name const *name, |
| 179 | u32 domain, | 165 | u32 domain, |
| 180 | unsigned int num_sect, | 166 | unsigned int num_sect, |
| 181 | struct iovec const *msg_sect); | 167 | struct iovec const *msg_sect); |
| 182 | 168 | ||
| 183 | int tipc_send_buf2name(u32 portref, | ||
| 184 | struct tipc_name const *name, | ||
| 185 | u32 domain, | ||
| 186 | struct sk_buff *buf, | ||
| 187 | unsigned int dsz); | ||
| 188 | |||
| 189 | int tipc_forward2name(u32 portref, | ||
| 190 | struct tipc_name const *name, | ||
| 191 | u32 domain, | ||
| 192 | unsigned int section_count, | ||
| 193 | struct iovec const *msg_sect, | ||
| 194 | struct tipc_portid const *origin, | ||
| 195 | unsigned int importance); | ||
| 196 | |||
| 197 | int tipc_forward_buf2name(u32 portref, | ||
| 198 | struct tipc_name const *name, | ||
| 199 | u32 domain, | ||
| 200 | struct sk_buff *buf, | ||
| 201 | unsigned int dsz, | ||
| 202 | struct tipc_portid const *orig, | ||
| 203 | unsigned int importance); | ||
| 204 | |||
| 205 | int tipc_send2port(u32 portref, | 169 | int tipc_send2port(u32 portref, |
| 206 | struct tipc_portid const *dest, | 170 | struct tipc_portid const *dest, |
| 207 | unsigned int num_sect, | 171 | unsigned int num_sect, |
| @@ -212,46 +176,11 @@ int tipc_send_buf2port(u32 portref, | |||
| 212 | struct sk_buff *buf, | 176 | struct sk_buff *buf, |
| 213 | unsigned int dsz); | 177 | unsigned int dsz); |
| 214 | 178 | ||
| 215 | int tipc_forward2port(u32 portref, | ||
| 216 | struct tipc_portid const *dest, | ||
| 217 | unsigned int num_sect, | ||
| 218 | struct iovec const *msg_sect, | ||
| 219 | struct tipc_portid const *origin, | ||
| 220 | unsigned int importance); | ||
| 221 | |||
| 222 | int tipc_forward_buf2port(u32 portref, | ||
| 223 | struct tipc_portid const *dest, | ||
| 224 | struct sk_buff *buf, | ||
| 225 | unsigned int dsz, | ||
| 226 | struct tipc_portid const *orig, | ||
| 227 | unsigned int importance); | ||
| 228 | |||
| 229 | int tipc_multicast(u32 portref, | 179 | int tipc_multicast(u32 portref, |
| 230 | struct tipc_name_seq const *seq, | 180 | struct tipc_name_seq const *seq, |
| 231 | u32 domain, /* currently unused */ | 181 | u32 domain, /* currently unused */ |
| 232 | unsigned int section_count, | 182 | unsigned int section_count, |
| 233 | struct iovec const *msg); | 183 | struct iovec const *msg); |
| 234 | |||
| 235 | #if 0 | ||
| 236 | int tipc_multicast_buf(u32 portref, | ||
| 237 | struct tipc_name_seq const *seq, | ||
| 238 | u32 domain, | ||
| 239 | void *buf, | ||
| 240 | unsigned int size); | ||
| 241 | #endif | ||
| 242 | |||
| 243 | /* | ||
| 244 | * TIPC subscription routines | ||
| 245 | */ | ||
| 246 | |||
| 247 | int tipc_ispublished(struct tipc_name const *name); | ||
| 248 | |||
| 249 | /* | ||
| 250 | * Get number of available nodes within specified domain (excluding own node) | ||
| 251 | */ | ||
| 252 | |||
| 253 | unsigned int tipc_available_nodes(const u32 domain); | ||
| 254 | |||
| 255 | #endif | 184 | #endif |
| 256 | 185 | ||
| 257 | #endif | 186 | #endif |
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 | ||
| 108 | static inline int msg_short(struct tipc_msg *m) | 108 | static 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 | ||
| 113 | static inline u32 msg_size(struct tipc_msg *m) | 113 | static inline u32 msg_size(struct tipc_msg *m) |
| @@ -117,7 +117,7 @@ static inline u32 msg_size(struct tipc_msg *m) | |||
| 117 | 117 | ||
| 118 | static inline u32 msg_data_sz(struct tipc_msg *m) | 118 | static 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 | ||
| 123 | static inline unchar *msg_data(struct tipc_msg *m) | 123 | static inline unchar *msg_data(struct tipc_msg *m) |
| @@ -132,17 +132,17 @@ static inline u32 msg_type(struct tipc_msg *m) | |||
| 132 | 132 | ||
| 133 | static inline u32 msg_named(struct tipc_msg *m) | 133 | static 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 | ||
| 138 | static inline u32 msg_mcast(struct tipc_msg *m) | 138 | static 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 | ||
| 143 | static inline u32 msg_connected(struct tipc_msg *m) | 143 | static 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 | ||
| 148 | static inline u32 msg_errcode(struct tipc_msg *m) | 148 | static inline u32 msg_errcode(struct tipc_msg *m) |
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h index c54917cbfa48..1893aaf49426 100644 --- a/include/net/tipc/tipc_port.h +++ b/include/net/tipc/tipc_port.h | |||
| @@ -88,8 +88,6 @@ void tipc_acknowledge(u32 port_ref,u32 ack); | |||
| 88 | 88 | ||
| 89 | struct tipc_port *tipc_get_port(const u32 ref); | 89 | struct tipc_port *tipc_get_port(const u32 ref); |
| 90 | 90 | ||
| 91 | void *tipc_get_handle(const u32 ref); | ||
| 92 | |||
| 93 | /* | 91 | /* |
| 94 | * The following routines require that the port be locked on entry | 92 | * The following routines require that the port be locked on entry |
| 95 | */ | 93 | */ |
diff --git a/include/net/udp.h b/include/net/udp.h index a184d3496b13..200b82848c9a 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
| @@ -183,6 +183,9 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | |||
| 183 | extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, | 183 | extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport, |
| 184 | __be32 daddr, __be16 dport, | 184 | __be32 daddr, __be16 dport, |
| 185 | int dif); | 185 | int dif); |
| 186 | extern struct sock *udp6_lib_lookup(struct net *net, const struct in6_addr *saddr, __be16 sport, | ||
| 187 | const struct in6_addr *daddr, __be16 dport, | ||
| 188 | int dif); | ||
| 186 | 189 | ||
| 187 | /* | 190 | /* |
| 188 | * SNMP statistics for UDP and UDP-Lite | 191 | * SNMP statistics for UDP and UDP-Lite |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 4f53532d4c2f..f28d7c9b9f8d 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
| @@ -1419,7 +1419,6 @@ extern int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, | |||
| 1419 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); | 1419 | extern int xfrm6_tunnel_register(struct xfrm6_tunnel *handler, unsigned short family); |
| 1420 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); | 1420 | extern int xfrm6_tunnel_deregister(struct xfrm6_tunnel *handler, unsigned short family); |
| 1421 | extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); | 1421 | extern __be32 xfrm6_tunnel_alloc_spi(struct net *net, xfrm_address_t *saddr); |
| 1422 | extern void xfrm6_tunnel_free_spi(struct net *net, xfrm_address_t *saddr); | ||
| 1423 | extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr); | 1422 | extern __be32 xfrm6_tunnel_spi_lookup(struct net *net, xfrm_address_t *saddr); |
| 1424 | extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); | 1423 | extern int xfrm6_extract_output(struct xfrm_state *x, struct sk_buff *skb); |
| 1425 | extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); | 1424 | extern int xfrm6_prepare_output(struct xfrm_state *x, struct sk_buff *skb); |
| @@ -1466,8 +1465,6 @@ struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark, | |||
| 1466 | xfrm_address_t *saddr, int create, | 1465 | xfrm_address_t *saddr, int create, |
| 1467 | unsigned short family); | 1466 | unsigned short family); |
| 1468 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); | 1467 | extern int xfrm_sk_policy_insert(struct sock *sk, int dir, struct xfrm_policy *pol); |
| 1469 | extern int xfrm_bundle_ok(struct xfrm_policy *pol, struct xfrm_dst *xdst, | ||
| 1470 | struct flowi *fl, int family, int strict); | ||
| 1471 | 1468 | ||
| 1472 | #ifdef CONFIG_XFRM_MIGRATE | 1469 | #ifdef CONFIG_XFRM_MIGRATE |
| 1473 | extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type, | 1470 | extern int km_migrate(struct xfrm_selector *sel, u8 dir, u8 type, |
