diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-02 10:55:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-02 10:55:08 -0500 |
commit | 6d6b89bd2e316b78d668f761d380837b81fa71ef (patch) | |
tree | 7e63c58611fc6181153526abbdafdd846ed1a19d /include/linux | |
parent | 13dda80e48439b446d0bc9bab34b91484bc8f533 (diff) | |
parent | 2507c05ff55fbf38326b08ed27eaed233bc75042 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1341 commits)
virtio_net: remove forgotten assignment
be2net: fix tx completion polling
sis190: fix cable detect via link status poll
net: fix protocol sk_buff field
bridge: Fix build error when IGMP_SNOOPING is not enabled
bnx2x: Tx barriers and locks
scm: Only support SCM_RIGHTS on unix domain sockets.
vhost-net: restart tx poll on sk_sndbuf full
vhost: fix get_user_pages_fast error handling
vhost: initialize log eventfd context pointer
vhost: logging thinko fix
wireless: convert to use netdev_for_each_mc_addr
ethtool: do not set some flags, if others failed
ipoib: returned back addrlen check for mc addresses
netlink: Adding inode field to /proc/net/netlink
axnet_cs: add new id
bridge: Make IGMP snooping depend upon BRIDGE.
bridge: Add multicast count/interval sysfs entries
bridge: Add hash elasticity/max sysfs entries
bridge: Add multicast_snooping sysfs toggle
...
Trivial conflicts in Documentation/feature-removal-schedule.txt
Diffstat (limited to 'include/linux')
48 files changed, 1210 insertions, 187 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 91be0d896322..5b0d997f23ef 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -363,6 +363,7 @@ unifdef-y += uio.h | |||
363 | unifdef-y += unistd.h | 363 | unifdef-y += unistd.h |
364 | unifdef-y += usbdevice_fs.h | 364 | unifdef-y += usbdevice_fs.h |
365 | unifdef-y += utsname.h | 365 | unifdef-y += utsname.h |
366 | unifdef-y += vhost.h | ||
366 | unifdef-y += videodev2.h | 367 | unifdef-y += videodev2.h |
367 | unifdef-y += videodev.h | 368 | unifdef-y += videodev.h |
368 | unifdef-y += virtio_config.h | 369 | unifdef-y += virtio_config.h |
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 2b31b91f5871..7f437ca1ed44 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
@@ -1,3 +1,14 @@ | |||
1 | #define PHY_ID_BCM50610 0x0143bd60 | ||
2 | #define PHY_ID_BCM50610M 0x0143bd70 | ||
3 | #define PHY_ID_BCMAC131 0x0143bc70 | ||
4 | #define PHY_ID_BCM57780 0x03625d90 | ||
5 | |||
6 | #define PHY_BCM_OUI_MASK 0xfffffc00 | ||
7 | #define PHY_BCM_OUI_1 0x00206000 | ||
8 | #define PHY_BCM_OUI_2 0x0143bc00 | ||
9 | #define PHY_BCM_OUI_3 0x03625c00 | ||
10 | |||
11 | |||
1 | #define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 | 12 | #define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 |
2 | #define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 | 13 | #define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 |
3 | #define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 | 14 | #define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 3db7767d2a17..6e5a7f00223d 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -38,6 +38,7 @@ struct can_priv { | |||
38 | 38 | ||
39 | enum can_state state; | 39 | enum can_state state; |
40 | u32 ctrlmode; | 40 | u32 ctrlmode; |
41 | u32 ctrlmode_supported; | ||
41 | 42 | ||
42 | int restart_ms; | 43 | int restart_ms; |
43 | struct timer_list restart_timer; | 44 | struct timer_list restart_timer; |
@@ -46,6 +47,8 @@ struct can_priv { | |||
46 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); | 47 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); |
47 | int (*do_get_state)(const struct net_device *dev, | 48 | int (*do_get_state)(const struct net_device *dev, |
48 | enum can_state *state); | 49 | enum can_state *state); |
50 | int (*do_get_berr_counter)(const struct net_device *dev, | ||
51 | struct can_berr_counter *bec); | ||
49 | 52 | ||
50 | unsigned int echo_skb_max; | 53 | unsigned int echo_skb_max; |
51 | struct sk_buff **echo_skb; | 54 | struct sk_buff **echo_skb; |
@@ -60,6 +63,21 @@ struct can_priv { | |||
60 | */ | 63 | */ |
61 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | 64 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) |
62 | 65 | ||
66 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ | ||
67 | static inline int can_dropped_invalid_skb(struct net_device *dev, | ||
68 | struct sk_buff *skb) | ||
69 | { | ||
70 | const struct can_frame *cf = (struct can_frame *)skb->data; | ||
71 | |||
72 | if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) { | ||
73 | kfree_skb(skb); | ||
74 | dev->stats.tx_dropped++; | ||
75 | return 1; | ||
76 | } | ||
77 | |||
78 | return 0; | ||
79 | } | ||
80 | |||
63 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 81 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
64 | void free_candev(struct net_device *dev); | 82 | void free_candev(struct net_device *dev); |
65 | 83 | ||
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h index 9ecbb7871c0e..3250de935e1a 100644 --- a/include/linux/can/netlink.h +++ b/include/linux/can/netlink.h | |||
@@ -70,6 +70,14 @@ enum can_state { | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | /* | 72 | /* |
73 | * CAN bus error counters | ||
74 | */ | ||
75 | struct can_berr_counter { | ||
76 | __u16 txerr; | ||
77 | __u16 rxerr; | ||
78 | }; | ||
79 | |||
80 | /* | ||
73 | * CAN controller mode | 81 | * CAN controller mode |
74 | */ | 82 | */ |
75 | struct can_ctrlmode { | 83 | struct can_ctrlmode { |
@@ -77,9 +85,11 @@ struct can_ctrlmode { | |||
77 | __u32 flags; | 85 | __u32 flags; |
78 | }; | 86 | }; |
79 | 87 | ||
80 | #define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */ | 88 | #define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */ |
81 | #define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */ | 89 | #define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */ |
82 | #define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */ | 90 | #define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */ |
91 | #define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */ | ||
92 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ | ||
83 | 93 | ||
84 | /* | 94 | /* |
85 | * CAN device statistics | 95 | * CAN device statistics |
@@ -105,6 +115,7 @@ enum { | |||
105 | IFLA_CAN_CTRLMODE, | 115 | IFLA_CAN_CTRLMODE, |
106 | IFLA_CAN_RESTART_MS, | 116 | IFLA_CAN_RESTART_MS, |
107 | IFLA_CAN_RESTART, | 117 | IFLA_CAN_RESTART, |
118 | IFLA_CAN_BERR_COUNTER, | ||
108 | __IFLA_CAN_MAX | 119 | __IFLA_CAN_MAX |
109 | }; | 120 | }; |
110 | 121 | ||
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h index 4688c7bb1bd1..af17cb3f7a84 100644 --- a/include/linux/can/platform/ti_hecc.h +++ b/include/linux/can/platform/ti_hecc.h | |||
@@ -1,3 +1,6 @@ | |||
1 | #ifndef __CAN_PLATFORM_TI_HECC_H__ | ||
2 | #define __CAN_PLATFORM_TI_HECC_H__ | ||
3 | |||
1 | /* | 4 | /* |
2 | * TI HECC (High End CAN Controller) driver platform header | 5 | * TI HECC (High End CAN Controller) driver platform header |
3 | * | 6 | * |
@@ -23,6 +26,7 @@ | |||
23 | * @mbx_offset: Mailbox RAM offset | 26 | * @mbx_offset: Mailbox RAM offset |
24 | * @int_line: Interrupt line to use - 0 or 1 | 27 | * @int_line: Interrupt line to use - 0 or 1 |
25 | * @version: version for future use | 28 | * @version: version for future use |
29 | * @transceiver_switch: platform specific callback fn for transceiver control | ||
26 | * | 30 | * |
27 | * Platform data structure to get all platform specific settings. | 31 | * Platform data structure to get all platform specific settings. |
28 | * this structure also accounts the fact that the IP may have different | 32 | * this structure also accounts the fact that the IP may have different |
@@ -35,6 +39,6 @@ struct ti_hecc_platform_data { | |||
35 | u32 mbx_offset; | 39 | u32 mbx_offset; |
36 | u32 int_line; | 40 | u32 int_line; |
37 | u32 version; | 41 | u32 version; |
42 | void (*transceiver_switch) (int); | ||
38 | }; | 43 | }; |
39 | 44 | #endif | |
40 | |||
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ef4a2d84d922..cca1c3de140d 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -242,6 +242,7 @@ enum ethtool_stringset { | |||
242 | ETH_SS_TEST = 0, | 242 | ETH_SS_TEST = 0, |
243 | ETH_SS_STATS, | 243 | ETH_SS_STATS, |
244 | ETH_SS_PRIV_FLAGS, | 244 | ETH_SS_PRIV_FLAGS, |
245 | ETH_SS_NTUPLE_FILTERS, | ||
245 | }; | 246 | }; |
246 | 247 | ||
247 | /* for passing string sets for data tagging */ | 248 | /* for passing string sets for data tagging */ |
@@ -290,6 +291,7 @@ struct ethtool_perm_addr { | |||
290 | */ | 291 | */ |
291 | enum ethtool_flags { | 292 | enum ethtool_flags { |
292 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 293 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
294 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | ||
293 | }; | 295 | }; |
294 | 296 | ||
295 | /* The following structures are for supporting RX network flow | 297 | /* The following structures are for supporting RX network flow |
@@ -363,6 +365,35 @@ struct ethtool_rxnfc { | |||
363 | __u32 rule_locs[0]; | 365 | __u32 rule_locs[0]; |
364 | }; | 366 | }; |
365 | 367 | ||
368 | struct ethtool_rx_ntuple_flow_spec { | ||
369 | __u32 flow_type; | ||
370 | union { | ||
371 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
372 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
373 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
374 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
375 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
376 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
377 | struct ethtool_ether_spec ether_spec; | ||
378 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
379 | __u8 hdata[64]; | ||
380 | } h_u, m_u; /* entry, mask */ | ||
381 | |||
382 | __u16 vlan_tag; | ||
383 | __u16 vlan_tag_mask; | ||
384 | __u64 data; /* user-defined flow spec data */ | ||
385 | __u64 data_mask; /* user-defined flow spec mask */ | ||
386 | |||
387 | /* signed to distinguish between queue and actions (DROP) */ | ||
388 | __s32 action; | ||
389 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | ||
390 | }; | ||
391 | |||
392 | struct ethtool_rx_ntuple { | ||
393 | __u32 cmd; | ||
394 | struct ethtool_rx_ntuple_flow_spec fs; | ||
395 | }; | ||
396 | |||
366 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | 397 | #define ETHTOOL_FLASH_MAX_FILENAME 128 |
367 | enum ethtool_flash_op_type { | 398 | enum ethtool_flash_op_type { |
368 | ETHTOOL_FLASH_ALL_REGIONS = 0, | 399 | ETHTOOL_FLASH_ALL_REGIONS = 0, |
@@ -377,6 +408,20 @@ struct ethtool_flash { | |||
377 | 408 | ||
378 | #ifdef __KERNEL__ | 409 | #ifdef __KERNEL__ |
379 | 410 | ||
411 | #include <linux/rculist.h> | ||
412 | |||
413 | struct ethtool_rx_ntuple_flow_spec_container { | ||
414 | struct ethtool_rx_ntuple_flow_spec fs; | ||
415 | struct list_head list; | ||
416 | }; | ||
417 | |||
418 | struct ethtool_rx_ntuple_list { | ||
419 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
420 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
421 | struct list_head list; | ||
422 | unsigned int count; | ||
423 | }; | ||
424 | |||
380 | struct net_device; | 425 | struct net_device; |
381 | 426 | ||
382 | /* Some generic methods drivers may use in their ethtool_ops */ | 427 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -394,6 +439,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev); | |||
394 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 439 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
395 | u32 ethtool_op_get_flags(struct net_device *dev); | 440 | u32 ethtool_op_get_flags(struct net_device *dev); |
396 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 441 | int ethtool_op_set_flags(struct net_device *dev, u32 data); |
442 | void ethtool_ntuple_flush(struct net_device *dev); | ||
397 | 443 | ||
398 | /** | 444 | /** |
399 | * ðtool_ops - Alter and report network device settings | 445 | * ðtool_ops - Alter and report network device settings |
@@ -500,6 +546,8 @@ struct ethtool_ops { | |||
500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 546 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 547 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
502 | int (*reset)(struct net_device *, u32 *); | 548 | int (*reset)(struct net_device *, u32 *); |
549 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | ||
550 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
503 | }; | 551 | }; |
504 | #endif /* __KERNEL__ */ | 552 | #endif /* __KERNEL__ */ |
505 | 553 | ||
@@ -559,6 +607,9 @@ struct ethtool_ops { | |||
559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 607 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 608 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
561 | 609 | ||
610 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | ||
611 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | ||
612 | |||
562 | /* compatibility with older code */ | 613 | /* compatibility with older code */ |
563 | #define SPARC_ETH_GSET ETHTOOL_GSET | 614 | #define SPARC_ETH_GSET ETHTOOL_GSET |
564 | #define SPARC_ETH_SSET ETHTOOL_SSET | 615 | #define SPARC_ETH_SSET ETHTOOL_SSET |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index c0d8357917e2..4c4c74ec5987 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -174,8 +174,7 @@ struct icmp6_filter { | |||
174 | 174 | ||
175 | extern void icmpv6_send(struct sk_buff *skb, | 175 | extern void icmpv6_send(struct sk_buff *skb, |
176 | u8 type, u8 code, | 176 | u8 type, u8 code, |
177 | __u32 info, | 177 | __u32 info); |
178 | struct net_device *dev); | ||
179 | 178 | ||
180 | extern int icmpv6_init(void); | 179 | extern int icmpv6_init(void); |
181 | extern int icmpv6_err_convert(u8 type, u8 code, | 180 | extern int icmpv6_err_convert(u8 type, u8 code, |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 163c840437d6..19984958ab7b 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -120,6 +120,26 @@ | |||
120 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 120 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
121 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 121 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
122 | 122 | ||
123 | /* U-APSD queue for WMM IEs sent by AP */ | ||
124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | ||
125 | |||
126 | /* U-APSD queues for WMM IEs sent by STA */ | ||
127 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0) | ||
128 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VI (1<<1) | ||
129 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_BK (1<<2) | ||
130 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_BE (1<<3) | ||
131 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK 0x0f | ||
132 | |||
133 | /* U-APSD max SP length for WMM IEs sent by STA */ | ||
134 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL 0x00 | ||
135 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_2 0x01 | ||
136 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_4 0x02 | ||
137 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_6 0x03 | ||
138 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK 0x03 | ||
139 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT 5 | ||
140 | |||
141 | #define IEEE80211_HT_CTL_LEN 4 | ||
142 | |||
123 | struct ieee80211_hdr { | 143 | struct ieee80211_hdr { |
124 | __le16 frame_control; | 144 | __le16 frame_control; |
125 | __le16 duration_id; | 145 | __le16 duration_id; |
@@ -130,6 +150,25 @@ struct ieee80211_hdr { | |||
130 | u8 addr4[6]; | 150 | u8 addr4[6]; |
131 | } __attribute__ ((packed)); | 151 | } __attribute__ ((packed)); |
132 | 152 | ||
153 | struct ieee80211_hdr_3addr { | ||
154 | __le16 frame_control; | ||
155 | __le16 duration_id; | ||
156 | u8 addr1[6]; | ||
157 | u8 addr2[6]; | ||
158 | u8 addr3[6]; | ||
159 | __le16 seq_ctrl; | ||
160 | } __attribute__ ((packed)); | ||
161 | |||
162 | struct ieee80211_qos_hdr { | ||
163 | __le16 frame_control; | ||
164 | __le16 duration_id; | ||
165 | u8 addr1[6]; | ||
166 | u8 addr2[6]; | ||
167 | u8 addr3[6]; | ||
168 | __le16 seq_ctrl; | ||
169 | __le16 qos_ctrl; | ||
170 | } __attribute__ ((packed)); | ||
171 | |||
133 | /** | 172 | /** |
134 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set | 173 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set |
135 | * @fc: frame control bytes in little-endian byteorder | 174 | * @fc: frame control bytes in little-endian byteorder |
@@ -707,6 +746,10 @@ struct ieee80211_mgmt { | |||
707 | u8 action; | 746 | u8 action; |
708 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; | 747 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; |
709 | } __attribute__ ((packed)) sa_query; | 748 | } __attribute__ ((packed)) sa_query; |
749 | struct { | ||
750 | u8 action; | ||
751 | u8 smps_control; | ||
752 | } __attribute__ ((packed)) ht_smps; | ||
710 | } u; | 753 | } u; |
711 | } __attribute__ ((packed)) action; | 754 | } __attribute__ ((packed)) action; |
712 | } u; | 755 | } u; |
@@ -771,7 +814,10 @@ struct ieee80211_bar { | |||
771 | /** | 814 | /** |
772 | * struct ieee80211_mcs_info - MCS information | 815 | * struct ieee80211_mcs_info - MCS information |
773 | * @rx_mask: RX mask | 816 | * @rx_mask: RX mask |
774 | * @rx_highest: highest supported RX rate | 817 | * @rx_highest: highest supported RX rate. If set represents |
818 | * the highest supported RX data rate in units of 1 Mbps. | ||
819 | * If this field is 0 this value should not be used to | ||
820 | * consider the highest RX data rate supported. | ||
775 | * @tx_params: TX parameters | 821 | * @tx_params: TX parameters |
776 | */ | 822 | */ |
777 | struct ieee80211_mcs_info { | 823 | struct ieee80211_mcs_info { |
@@ -824,6 +870,7 @@ struct ieee80211_ht_cap { | |||
824 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 | 870 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 |
825 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 | 871 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 |
826 | #define IEEE80211_HT_CAP_SM_PS 0x000C | 872 | #define IEEE80211_HT_CAP_SM_PS 0x000C |
873 | #define IEEE80211_HT_CAP_SM_PS_SHIFT 2 | ||
827 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | 874 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 |
828 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | 875 | #define IEEE80211_HT_CAP_SGI_20 0x0020 |
829 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 876 | #define IEEE80211_HT_CAP_SGI_40 0x0040 |
@@ -839,6 +886,7 @@ struct ieee80211_ht_cap { | |||
839 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ | 886 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ |
840 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | 887 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 |
841 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | 888 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C |
889 | #define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2 | ||
842 | 890 | ||
843 | /* | 891 | /* |
844 | * Maximum length of AMPDU that the STA can receive. | 892 | * Maximum length of AMPDU that the STA can receive. |
@@ -922,12 +970,17 @@ struct ieee80211_ht_info { | |||
922 | #define IEEE80211_MAX_AMPDU_BUF 0x40 | 970 | #define IEEE80211_MAX_AMPDU_BUF 0x40 |
923 | 971 | ||
924 | 972 | ||
925 | /* Spatial Multiplexing Power Save Modes */ | 973 | /* Spatial Multiplexing Power Save Modes (for capability) */ |
926 | #define WLAN_HT_CAP_SM_PS_STATIC 0 | 974 | #define WLAN_HT_CAP_SM_PS_STATIC 0 |
927 | #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 | 975 | #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 |
928 | #define WLAN_HT_CAP_SM_PS_INVALID 2 | 976 | #define WLAN_HT_CAP_SM_PS_INVALID 2 |
929 | #define WLAN_HT_CAP_SM_PS_DISABLED 3 | 977 | #define WLAN_HT_CAP_SM_PS_DISABLED 3 |
930 | 978 | ||
979 | /* for SM power control field lower two bits */ | ||
980 | #define WLAN_HT_SMPS_CONTROL_DISABLED 0 | ||
981 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 | ||
982 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 | ||
983 | |||
931 | /* Authentication algorithms */ | 984 | /* Authentication algorithms */ |
932 | #define WLAN_AUTH_OPEN 0 | 985 | #define WLAN_AUTH_OPEN 0 |
933 | #define WLAN_AUTH_SHARED_KEY 1 | 986 | #define WLAN_AUTH_SHARED_KEY 1 |
@@ -1071,12 +1124,12 @@ enum ieee80211_eid { | |||
1071 | WLAN_EID_TIM = 5, | 1124 | WLAN_EID_TIM = 5, |
1072 | WLAN_EID_IBSS_PARAMS = 6, | 1125 | WLAN_EID_IBSS_PARAMS = 6, |
1073 | WLAN_EID_CHALLENGE = 16, | 1126 | WLAN_EID_CHALLENGE = 16, |
1074 | /* 802.11d */ | 1127 | |
1075 | WLAN_EID_COUNTRY = 7, | 1128 | WLAN_EID_COUNTRY = 7, |
1076 | WLAN_EID_HP_PARAMS = 8, | 1129 | WLAN_EID_HP_PARAMS = 8, |
1077 | WLAN_EID_HP_TABLE = 9, | 1130 | WLAN_EID_HP_TABLE = 9, |
1078 | WLAN_EID_REQUEST = 10, | 1131 | WLAN_EID_REQUEST = 10, |
1079 | /* 802.11e */ | 1132 | |
1080 | WLAN_EID_QBSS_LOAD = 11, | 1133 | WLAN_EID_QBSS_LOAD = 11, |
1081 | WLAN_EID_EDCA_PARAM_SET = 12, | 1134 | WLAN_EID_EDCA_PARAM_SET = 12, |
1082 | WLAN_EID_TSPEC = 13, | 1135 | WLAN_EID_TSPEC = 13, |
@@ -1099,7 +1152,7 @@ enum ieee80211_eid { | |||
1099 | WLAN_EID_PREP = 69, | 1152 | WLAN_EID_PREP = 69, |
1100 | WLAN_EID_PERR = 70, | 1153 | WLAN_EID_PERR = 70, |
1101 | WLAN_EID_RANN = 49, /* compatible with FreeBSD */ | 1154 | WLAN_EID_RANN = 49, /* compatible with FreeBSD */ |
1102 | /* 802.11h */ | 1155 | |
1103 | WLAN_EID_PWR_CONSTRAINT = 32, | 1156 | WLAN_EID_PWR_CONSTRAINT = 32, |
1104 | WLAN_EID_PWR_CAPABILITY = 33, | 1157 | WLAN_EID_PWR_CAPABILITY = 33, |
1105 | WLAN_EID_TPC_REQUEST = 34, | 1158 | WLAN_EID_TPC_REQUEST = 34, |
@@ -1110,20 +1163,41 @@ enum ieee80211_eid { | |||
1110 | WLAN_EID_MEASURE_REPORT = 39, | 1163 | WLAN_EID_MEASURE_REPORT = 39, |
1111 | WLAN_EID_QUIET = 40, | 1164 | WLAN_EID_QUIET = 40, |
1112 | WLAN_EID_IBSS_DFS = 41, | 1165 | WLAN_EID_IBSS_DFS = 41, |
1113 | /* 802.11g */ | 1166 | |
1114 | WLAN_EID_ERP_INFO = 42, | 1167 | WLAN_EID_ERP_INFO = 42, |
1115 | WLAN_EID_EXT_SUPP_RATES = 50, | 1168 | WLAN_EID_EXT_SUPP_RATES = 50, |
1116 | /* 802.11n */ | 1169 | |
1117 | WLAN_EID_HT_CAPABILITY = 45, | 1170 | WLAN_EID_HT_CAPABILITY = 45, |
1118 | WLAN_EID_HT_INFORMATION = 61, | 1171 | WLAN_EID_HT_INFORMATION = 61, |
1119 | /* 802.11i */ | 1172 | |
1120 | WLAN_EID_RSN = 48, | 1173 | WLAN_EID_RSN = 48, |
1121 | WLAN_EID_TIMEOUT_INTERVAL = 56, | 1174 | WLAN_EID_MMIE = 76, |
1122 | WLAN_EID_MMIE = 76 /* 802.11w */, | ||
1123 | WLAN_EID_WPA = 221, | 1175 | WLAN_EID_WPA = 221, |
1124 | WLAN_EID_GENERIC = 221, | 1176 | WLAN_EID_GENERIC = 221, |
1125 | WLAN_EID_VENDOR_SPECIFIC = 221, | 1177 | WLAN_EID_VENDOR_SPECIFIC = 221, |
1126 | WLAN_EID_QOS_PARAMETER = 222 | 1178 | WLAN_EID_QOS_PARAMETER = 222, |
1179 | |||
1180 | WLAN_EID_AP_CHAN_REPORT = 51, | ||
1181 | WLAN_EID_NEIGHBOR_REPORT = 52, | ||
1182 | WLAN_EID_RCPI = 53, | ||
1183 | WLAN_EID_BSS_AVG_ACCESS_DELAY = 63, | ||
1184 | WLAN_EID_ANTENNA_INFO = 64, | ||
1185 | WLAN_EID_RSNI = 65, | ||
1186 | WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66, | ||
1187 | WLAN_EID_BSS_AVAILABLE_CAPACITY = 67, | ||
1188 | WLAN_EID_BSS_AC_ACCESS_DELAY = 68, | ||
1189 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, | ||
1190 | WLAN_EID_MULTIPLE_BSSID = 71, | ||
1191 | |||
1192 | WLAN_EID_MOBILITY_DOMAIN = 54, | ||
1193 | WLAN_EID_FAST_BSS_TRANSITION = 55, | ||
1194 | WLAN_EID_TIMEOUT_INTERVAL = 56, | ||
1195 | WLAN_EID_RIC_DATA = 57, | ||
1196 | WLAN_EID_RIC_DESCRIPTOR = 75, | ||
1197 | |||
1198 | WLAN_EID_DSE_REGISTERED_LOCATION = 58, | ||
1199 | WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, | ||
1200 | WLAN_EID_EXT_CHANSWITCH_ANN = 60, | ||
1127 | }; | 1201 | }; |
1128 | 1202 | ||
1129 | /* Action category code */ | 1203 | /* Action category code */ |
@@ -1150,6 +1224,18 @@ enum ieee80211_spectrum_mgmt_actioncode { | |||
1150 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, | 1224 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, |
1151 | }; | 1225 | }; |
1152 | 1226 | ||
1227 | /* HT action codes */ | ||
1228 | enum ieee80211_ht_actioncode { | ||
1229 | WLAN_HT_ACTION_NOTIFY_CHANWIDTH = 0, | ||
1230 | WLAN_HT_ACTION_SMPS = 1, | ||
1231 | WLAN_HT_ACTION_PSMP = 2, | ||
1232 | WLAN_HT_ACTION_PCO_PHASE = 3, | ||
1233 | WLAN_HT_ACTION_CSI = 4, | ||
1234 | WLAN_HT_ACTION_NONCOMPRESSED_BF = 5, | ||
1235 | WLAN_HT_ACTION_COMPRESSED_BF = 6, | ||
1236 | WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, | ||
1237 | }; | ||
1238 | |||
1153 | /* Security key length */ | 1239 | /* Security key length */ |
1154 | enum ieee80211_key_len { | 1240 | enum ieee80211_key_len { |
1155 | WLAN_KEY_LEN_WEP40 = 5, | 1241 | WLAN_KEY_LEN_WEP40 = 5, |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 6674791622ca..c9bf92cd7653 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -78,6 +78,11 @@ enum { | |||
78 | #define IFLA_LINKINFO IFLA_LINKINFO | 78 | #define IFLA_LINKINFO IFLA_LINKINFO |
79 | IFLA_NET_NS_PID, | 79 | IFLA_NET_NS_PID, |
80 | IFLA_IFALIAS, | 80 | IFLA_IFALIAS, |
81 | IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ | ||
82 | IFLA_VF_MAC, /* Hardware queue specific attributes */ | ||
83 | IFLA_VF_VLAN, | ||
84 | IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ | ||
85 | IFLA_VFINFO, | ||
81 | __IFLA_MAX | 86 | __IFLA_MAX |
82 | }; | 87 | }; |
83 | 88 | ||
@@ -196,4 +201,29 @@ enum macvlan_mode { | |||
196 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ | 201 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ |
197 | }; | 202 | }; |
198 | 203 | ||
204 | /* SR-IOV virtual function managment section */ | ||
205 | |||
206 | struct ifla_vf_mac { | ||
207 | __u32 vf; | ||
208 | __u8 mac[32]; /* MAX_ADDR_LEN */ | ||
209 | }; | ||
210 | |||
211 | struct ifla_vf_vlan { | ||
212 | __u32 vf; | ||
213 | __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */ | ||
214 | __u32 qos; | ||
215 | }; | ||
216 | |||
217 | struct ifla_vf_tx_rate { | ||
218 | __u32 vf; | ||
219 | __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ | ||
220 | }; | ||
221 | |||
222 | struct ifla_vf_info { | ||
223 | __u32 vf; | ||
224 | __u8 mac[32]; | ||
225 | __u32 vlan; | ||
226 | __u32 qos; | ||
227 | __u32 tx_rate; | ||
228 | }; | ||
199 | #endif /* _LINUX_IF_LINK_H */ | 229 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 5f200bac3749..b78a712247da 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -1,6 +1,90 @@ | |||
1 | #ifndef _LINUX_IF_MACVLAN_H | 1 | #ifndef _LINUX_IF_MACVLAN_H |
2 | #define _LINUX_IF_MACVLAN_H | 2 | #define _LINUX_IF_MACVLAN_H |
3 | 3 | ||
4 | #include <linux/if_link.h> | ||
5 | #include <linux/list.h> | ||
6 | #include <linux/netdevice.h> | ||
7 | #include <linux/netlink.h> | ||
8 | #include <net/netlink.h> | ||
9 | |||
10 | #if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) | ||
11 | struct socket *macvtap_get_socket(struct file *); | ||
12 | #else | ||
13 | #include <linux/err.h> | ||
14 | #include <linux/errno.h> | ||
15 | struct file; | ||
16 | struct socket; | ||
17 | static inline struct socket *macvtap_get_socket(struct file *f) | ||
18 | { | ||
19 | return ERR_PTR(-EINVAL); | ||
20 | } | ||
21 | #endif /* CONFIG_MACVTAP */ | ||
22 | |||
23 | struct macvlan_port; | ||
24 | struct macvtap_queue; | ||
25 | |||
26 | /** | ||
27 | * struct macvlan_rx_stats - MACVLAN percpu rx stats | ||
28 | * @rx_packets: number of received packets | ||
29 | * @rx_bytes: number of received bytes | ||
30 | * @multicast: number of received multicast packets | ||
31 | * @rx_errors: number of errors | ||
32 | */ | ||
33 | struct macvlan_rx_stats { | ||
34 | unsigned long rx_packets; | ||
35 | unsigned long rx_bytes; | ||
36 | unsigned long multicast; | ||
37 | unsigned long rx_errors; | ||
38 | }; | ||
39 | |||
40 | struct macvlan_dev { | ||
41 | struct net_device *dev; | ||
42 | struct list_head list; | ||
43 | struct hlist_node hlist; | ||
44 | struct macvlan_port *port; | ||
45 | struct net_device *lowerdev; | ||
46 | struct macvlan_rx_stats __percpu *rx_stats; | ||
47 | enum macvlan_mode mode; | ||
48 | int (*receive)(struct sk_buff *skb); | ||
49 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | ||
50 | struct macvtap_queue *tap; | ||
51 | }; | ||
52 | |||
53 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | ||
54 | unsigned int len, bool success, | ||
55 | bool multicast) | ||
56 | { | ||
57 | struct macvlan_rx_stats *rx_stats; | ||
58 | |||
59 | rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id()); | ||
60 | if (likely(success)) { | ||
61 | rx_stats->rx_packets++;; | ||
62 | rx_stats->rx_bytes += len; | ||
63 | if (multicast) | ||
64 | rx_stats->multicast++; | ||
65 | } else { | ||
66 | rx_stats->rx_errors++; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | ||
71 | struct nlattr *tb[], struct nlattr *data[], | ||
72 | int (*receive)(struct sk_buff *skb), | ||
73 | int (*forward)(struct net_device *dev, | ||
74 | struct sk_buff *skb)); | ||
75 | |||
76 | extern void macvlan_count_rx(const struct macvlan_dev *vlan, | ||
77 | unsigned int len, bool success, | ||
78 | bool multicast); | ||
79 | |||
80 | extern void macvlan_dellink(struct net_device *dev, struct list_head *head); | ||
81 | |||
82 | extern int macvlan_link_register(struct rtnl_link_ops *ops); | ||
83 | |||
84 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | ||
85 | struct net_device *dev); | ||
86 | |||
87 | |||
4 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); | 88 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); |
5 | 89 | ||
6 | #endif /* _LINUX_IF_MACVLAN_H */ | 90 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 4021d47cc437..aa57a5f993fc 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -46,6 +46,7 @@ struct sockaddr_ll { | |||
46 | #define PACKET_RESERVE 12 | 46 | #define PACKET_RESERVE 12 |
47 | #define PACKET_TX_RING 13 | 47 | #define PACKET_TX_RING 13 |
48 | #define PACKET_LOSS 14 | 48 | #define PACKET_LOSS 14 |
49 | #define PACKET_VNET_HDR 15 | ||
49 | 50 | ||
50 | struct tpacket_stats { | 51 | struct tpacket_stats { |
51 | unsigned int tp_packets; | 52 | unsigned int tp_packets; |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 3f5fd523b49d..1350a246893a 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/if_ether.h> | 20 | #include <linux/if_ether.h> |
21 | #include <linux/filter.h> | ||
21 | 22 | ||
22 | /* Read queue size */ | 23 | /* Read queue size */ |
23 | #define TUN_READQ_SIZE 500 | 24 | #define TUN_READQ_SIZE 500 |
@@ -48,6 +49,8 @@ | |||
48 | #define TUNGETIFF _IOR('T', 210, unsigned int) | 49 | #define TUNGETIFF _IOR('T', 210, unsigned int) |
49 | #define TUNGETSNDBUF _IOR('T', 211, int) | 50 | #define TUNGETSNDBUF _IOR('T', 211, int) |
50 | #define TUNSETSNDBUF _IOW('T', 212, int) | 51 | #define TUNSETSNDBUF _IOW('T', 212, int) |
52 | #define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog) | ||
53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) | ||
51 | 54 | ||
52 | /* TUNSETIFF ifr flags */ | 55 | /* TUNSETIFF ifr flags */ |
53 | #define IFF_TUN 0x0001 | 56 | #define IFF_TUN 0x0001 |
@@ -86,4 +89,18 @@ struct tun_filter { | |||
86 | __u8 addr[0][ETH_ALEN]; | 89 | __u8 addr[0][ETH_ALEN]; |
87 | }; | 90 | }; |
88 | 91 | ||
92 | #ifdef __KERNEL__ | ||
93 | #if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) | ||
94 | struct socket *tun_get_socket(struct file *); | ||
95 | #else | ||
96 | #include <linux/err.h> | ||
97 | #include <linux/errno.h> | ||
98 | struct file; | ||
99 | struct socket; | ||
100 | static inline struct socket *tun_get_socket(struct file *f) | ||
101 | { | ||
102 | return ERR_PTR(-EINVAL); | ||
103 | } | ||
104 | #endif /* CONFIG_TUN */ | ||
105 | #endif /* __KERNEL__ */ | ||
89 | #endif /* __IF_TUN_H */ | 106 | #endif /* __IF_TUN_H */ |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 724c27e5d173..93fc2449af10 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -153,6 +153,7 @@ extern int sysctl_igmp_max_msf; | |||
153 | struct ip_sf_socklist { | 153 | struct ip_sf_socklist { |
154 | unsigned int sl_max; | 154 | unsigned int sl_max; |
155 | unsigned int sl_count; | 155 | unsigned int sl_count; |
156 | struct rcu_head rcu; | ||
156 | __be32 sl_addr[0]; | 157 | __be32 sl_addr[0]; |
157 | }; | 158 | }; |
158 | 159 | ||
@@ -170,6 +171,7 @@ struct ip_mc_socklist { | |||
170 | struct ip_mreqn multi; | 171 | struct ip_mreqn multi; |
171 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 172 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
172 | struct ip_sf_socklist *sflist; | 173 | struct ip_sf_socklist *sflist; |
174 | struct rcu_head rcu; | ||
173 | }; | 175 | }; |
174 | 176 | ||
175 | struct ip_sf_list { | 177 | struct ip_sf_list { |
diff --git a/include/linux/in.h b/include/linux/in.h index b615649db129..583c76f9c30f 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -84,6 +84,8 @@ struct in_addr { | |||
84 | #define IP_ORIGDSTADDR 20 | 84 | #define IP_ORIGDSTADDR 20 |
85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR | 85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR |
86 | 86 | ||
87 | #define IP_MINTTL 21 | ||
88 | |||
87 | /* IP_MTU_DISCOVER values */ | 89 | /* IP_MTU_DISCOVER values */ |
88 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ | 90 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ |
89 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ | 91 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index b2304929434e..2be1a1a2beb9 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -10,10 +10,40 @@ | |||
10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
11 | #include <linux/sysctl.h> | 11 | #include <linux/sysctl.h> |
12 | 12 | ||
13 | enum | ||
14 | { | ||
15 | IPV4_DEVCONF_FORWARDING=1, | ||
16 | IPV4_DEVCONF_MC_FORWARDING, | ||
17 | IPV4_DEVCONF_PROXY_ARP, | ||
18 | IPV4_DEVCONF_ACCEPT_REDIRECTS, | ||
19 | IPV4_DEVCONF_SECURE_REDIRECTS, | ||
20 | IPV4_DEVCONF_SEND_REDIRECTS, | ||
21 | IPV4_DEVCONF_SHARED_MEDIA, | ||
22 | IPV4_DEVCONF_RP_FILTER, | ||
23 | IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE, | ||
24 | IPV4_DEVCONF_BOOTP_RELAY, | ||
25 | IPV4_DEVCONF_LOG_MARTIANS, | ||
26 | IPV4_DEVCONF_TAG, | ||
27 | IPV4_DEVCONF_ARPFILTER, | ||
28 | IPV4_DEVCONF_MEDIUM_ID, | ||
29 | IPV4_DEVCONF_NOXFRM, | ||
30 | IPV4_DEVCONF_NOPOLICY, | ||
31 | IPV4_DEVCONF_FORCE_IGMP_VERSION, | ||
32 | IPV4_DEVCONF_ARP_ANNOUNCE, | ||
33 | IPV4_DEVCONF_ARP_IGNORE, | ||
34 | IPV4_DEVCONF_PROMOTE_SECONDARIES, | ||
35 | IPV4_DEVCONF_ARP_ACCEPT, | ||
36 | IPV4_DEVCONF_ARP_NOTIFY, | ||
37 | IPV4_DEVCONF_ACCEPT_LOCAL, | ||
38 | IPV4_DEVCONF_SRC_VMARK, | ||
39 | IPV4_DEVCONF_PROXY_ARP_PVLAN, | ||
40 | __IPV4_DEVCONF_MAX | ||
41 | }; | ||
42 | |||
13 | struct ipv4_devconf { | 43 | struct ipv4_devconf { |
14 | void *sysctl; | 44 | void *sysctl; |
15 | int data[__NET_IPV4_CONF_MAX - 1]; | 45 | int data[__IPV4_DEVCONF_MAX - 1]; |
16 | DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); | 46 | DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); |
17 | }; | 47 | }; |
18 | 48 | ||
19 | struct in_device { | 49 | struct in_device { |
@@ -40,7 +70,7 @@ struct in_device { | |||
40 | struct rcu_head rcu_head; | 70 | struct rcu_head rcu_head; |
41 | }; | 71 | }; |
42 | 72 | ||
43 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) | 73 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1]) |
44 | #define IPV4_DEVCONF_ALL(net, attr) \ | 74 | #define IPV4_DEVCONF_ALL(net, attr) \ |
45 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) | 75 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) |
46 | 76 | ||
@@ -60,13 +90,13 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, | |||
60 | 90 | ||
61 | static inline void ipv4_devconf_setall(struct in_device *in_dev) | 91 | static inline void ipv4_devconf_setall(struct in_device *in_dev) |
62 | { | 92 | { |
63 | bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1); | 93 | bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); |
64 | } | 94 | } |
65 | 95 | ||
66 | #define IN_DEV_CONF_GET(in_dev, attr) \ | 96 | #define IN_DEV_CONF_GET(in_dev, attr) \ |
67 | ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) | 97 | ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr) |
68 | #define IN_DEV_CONF_SET(in_dev, attr, val) \ | 98 | #define IN_DEV_CONF_SET(in_dev, attr, val) \ |
69 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) | 99 | ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val)) |
70 | 100 | ||
71 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 101 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
72 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ | 102 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ |
@@ -89,6 +119,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
89 | 119 | ||
90 | #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) | 120 | #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) |
91 | #define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) | 121 | #define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) |
122 | #define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN) | ||
92 | #define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) | 123 | #define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) |
93 | #define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) | 124 | #define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) |
94 | #define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ | 125 | #define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ |
diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h index 7acb87a44872..11b57c485854 100644 --- a/include/linux/isdn/capilli.h +++ b/include/linux/isdn/capilli.h | |||
@@ -50,8 +50,7 @@ struct capi_ctr { | |||
50 | u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); | 50 | u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); |
51 | 51 | ||
52 | char *(*procinfo)(struct capi_ctr *); | 52 | char *(*procinfo)(struct capi_ctr *); |
53 | int (*ctr_read_proc)(char *page, char **start, off_t off, | 53 | const struct file_operations *proc_fops; |
54 | int count, int *eof, struct capi_ctr *card); | ||
55 | 54 | ||
56 | /* filled in before calling ready callback */ | 55 | /* filled in before calling ready callback */ |
57 | u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ | 56 | u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ |
@@ -67,9 +66,10 @@ struct capi_ctr { | |||
67 | unsigned long nsentdatapkt; | 66 | unsigned long nsentdatapkt; |
68 | 67 | ||
69 | int cnr; /* controller number */ | 68 | int cnr; /* controller number */ |
70 | volatile unsigned short cardstate; /* controller state */ | 69 | unsigned short state; /* controller state */ |
71 | volatile int blocked; /* output blocked */ | 70 | int blocked; /* output blocked */ |
72 | int traceflag; /* capi trace */ | 71 | int traceflag; /* capi trace */ |
72 | wait_queue_head_t state_wait_queue; | ||
73 | 73 | ||
74 | struct proc_dir_entry *procent; | 74 | struct proc_dir_entry *procent; |
75 | char procfn[128]; | 75 | char procfn[128]; |
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index a53e932f80fb..9c2683929fd3 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h | |||
@@ -48,9 +48,7 @@ typedef struct kcapi_carddef { | |||
48 | #include <linux/list.h> | 48 | #include <linux/list.h> |
49 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
50 | #include <linux/workqueue.h> | 50 | #include <linux/workqueue.h> |
51 | 51 | #include <linux/notifier.h> | |
52 | #define KCI_CONTRUP 0 /* arg: struct capi_profile */ | ||
53 | #define KCI_CONTRDOWN 1 /* arg: NULL */ | ||
54 | 52 | ||
55 | struct capi20_appl { | 53 | struct capi20_appl { |
56 | u16 applid; | 54 | u16 applid; |
@@ -67,11 +65,6 @@ struct capi20_appl { | |||
67 | struct sk_buff_head recv_queue; | 65 | struct sk_buff_head recv_queue; |
68 | struct work_struct recv_work; | 66 | struct work_struct recv_work; |
69 | int release_in_progress; | 67 | int release_in_progress; |
70 | |||
71 | /* ugly hack to allow for notification of added/removed | ||
72 | * controllers. The Right Way (tm) is known. XXX | ||
73 | */ | ||
74 | void (*callback) (unsigned int cmd, __u32 contr, void *data); | ||
75 | }; | 68 | }; |
76 | 69 | ||
77 | u16 capi20_isinstalled(void); | 70 | u16 capi20_isinstalled(void); |
@@ -84,11 +77,11 @@ u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]); | |||
84 | u16 capi20_get_profile(u32 contr, struct capi_profile *profp); | 77 | u16 capi20_get_profile(u32 contr, struct capi_profile *profp); |
85 | int capi20_manufacturer(unsigned int cmd, void __user *data); | 78 | int capi20_manufacturer(unsigned int cmd, void __user *data); |
86 | 79 | ||
87 | /* temporary hack XXX */ | 80 | #define CAPICTR_UP 0 |
88 | void capi20_set_callback(struct capi20_appl *ap, | 81 | #define CAPICTR_DOWN 1 |
89 | void (*callback) (unsigned int cmd, __u32 contr, void *data)); | ||
90 | |||
91 | 82 | ||
83 | int register_capictr_notifier(struct notifier_block *nb); | ||
84 | int unregister_capictr_notifier(struct notifier_block *nb); | ||
92 | 85 | ||
93 | #define CAPI_NOERROR 0x0000 | 86 | #define CAPI_NOERROR 0x0000 |
94 | 87 | ||
diff --git a/include/linux/llc.h b/include/linux/llc.h index 7733585603f1..ad7074ba81af 100644 --- a/include/linux/llc.h +++ b/include/linux/llc.h | |||
@@ -36,6 +36,7 @@ enum llc_sockopts { | |||
36 | LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ | 36 | LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ |
37 | LLC_OPT_TX_WIN, /* tx window size. */ | 37 | LLC_OPT_TX_WIN, /* tx window size. */ |
38 | LLC_OPT_RX_WIN, /* rx window size. */ | 38 | LLC_OPT_RX_WIN, /* rx window size. */ |
39 | LLC_OPT_PKTINFO, /* ancillary packet information. */ | ||
39 | LLC_OPT_MAX | 40 | LLC_OPT_MAX |
40 | }; | 41 | }; |
41 | 42 | ||
@@ -70,6 +71,12 @@ enum llc_sockopts { | |||
70 | #define LLC_SAP_RM 0xD4 /* Resource Management */ | 71 | #define LLC_SAP_RM 0xD4 /* Resource Management */ |
71 | #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ | 72 | #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ |
72 | 73 | ||
74 | struct llc_pktinfo { | ||
75 | int lpi_ifindex; | ||
76 | unsigned char lpi_sap; | ||
77 | unsigned char lpi_mac[IFHWADDRLEN]; | ||
78 | }; | ||
79 | |||
73 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
74 | #define LLC_SAP_DYN_START 0xC0 | 81 | #define LLC_SAP_DYN_START 0xC0 |
75 | #define LLC_SAP_DYN_STOP 0xDE | 82 | #define LLC_SAP_DYN_STOP 0xDE |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index adaf3c15e449..8b5f7cc0fba6 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #define HPET_MINOR 228 | 30 | #define HPET_MINOR 228 |
31 | #define FUSE_MINOR 229 | 31 | #define FUSE_MINOR 229 |
32 | #define KVM_MINOR 232 | 32 | #define KVM_MINOR 232 |
33 | #define VHOST_NET_MINOR 233 | ||
33 | #define MISC_DYNAMIC_MINOR 255 | 34 | #define MISC_DYNAMIC_MINOR 255 |
34 | 35 | ||
35 | struct device; | 36 | struct device; |
diff --git a/include/linux/net.h b/include/linux/net.h index 5e8083cacc8b..4157b5d42bd6 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -174,18 +174,22 @@ struct proto_ops { | |||
174 | struct poll_table_struct *wait); | 174 | struct poll_table_struct *wait); |
175 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 175 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
176 | unsigned long arg); | 176 | unsigned long arg); |
177 | #ifdef CONFIG_COMPAT | ||
177 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | 178 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, |
178 | unsigned long arg); | 179 | unsigned long arg); |
180 | #endif | ||
179 | int (*listen) (struct socket *sock, int len); | 181 | int (*listen) (struct socket *sock, int len); |
180 | int (*shutdown) (struct socket *sock, int flags); | 182 | int (*shutdown) (struct socket *sock, int flags); |
181 | int (*setsockopt)(struct socket *sock, int level, | 183 | int (*setsockopt)(struct socket *sock, int level, |
182 | int optname, char __user *optval, unsigned int optlen); | 184 | int optname, char __user *optval, unsigned int optlen); |
183 | int (*getsockopt)(struct socket *sock, int level, | 185 | int (*getsockopt)(struct socket *sock, int level, |
184 | int optname, char __user *optval, int __user *optlen); | 186 | int optname, char __user *optval, int __user *optlen); |
187 | #ifdef CONFIG_COMPAT | ||
185 | int (*compat_setsockopt)(struct socket *sock, int level, | 188 | int (*compat_setsockopt)(struct socket *sock, int level, |
186 | int optname, char __user *optval, unsigned int optlen); | 189 | int optname, char __user *optval, unsigned int optlen); |
187 | int (*compat_getsockopt)(struct socket *sock, int level, | 190 | int (*compat_getsockopt)(struct socket *sock, int level, |
188 | int optname, char __user *optval, int __user *optlen); | 191 | int optname, char __user *optval, int __user *optlen); |
192 | #endif | ||
189 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 193 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
190 | struct msghdr *m, size_t total_len); | 194 | struct msghdr *m, size_t total_len); |
191 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 195 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a3fccc85b1a0..c79a88be7c33 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/if.h> | 28 | #include <linux/if.h> |
29 | #include <linux/if_ether.h> | 29 | #include <linux/if_ether.h> |
30 | #include <linux/if_packet.h> | 30 | #include <linux/if_packet.h> |
31 | #include <linux/if_link.h> | ||
31 | 32 | ||
32 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
33 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
@@ -136,7 +137,7 @@ static inline bool dev_xmit_complete(int rc) | |||
136 | * used. | 137 | * used. |
137 | */ | 138 | */ |
138 | 139 | ||
139 | #if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | 140 | #if defined(CONFIG_WLAN) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) |
140 | # if defined(CONFIG_MAC80211_MESH) | 141 | # if defined(CONFIG_MAC80211_MESH) |
141 | # define LL_MAX_HEADER 128 | 142 | # define LL_MAX_HEADER 128 |
142 | # else | 143 | # else |
@@ -263,6 +264,17 @@ struct netdev_hw_addr_list { | |||
263 | int count; | 264 | int count; |
264 | }; | 265 | }; |
265 | 266 | ||
267 | #define netdev_uc_count(dev) ((dev)->uc.count) | ||
268 | #define netdev_uc_empty(dev) ((dev)->uc.count == 0) | ||
269 | #define netdev_for_each_uc_addr(ha, dev) \ | ||
270 | list_for_each_entry(ha, &dev->uc.list, list) | ||
271 | |||
272 | #define netdev_mc_count(dev) ((dev)->mc_count) | ||
273 | #define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) | ||
274 | |||
275 | #define netdev_for_each_mc_addr(mclist, dev) \ | ||
276 | for (mclist = dev->mc_list; mclist; mclist = mclist->next) | ||
277 | |||
266 | struct hh_cache { | 278 | struct hh_cache { |
267 | struct hh_cache *hh_next; /* Next entry */ | 279 | struct hh_cache *hh_next; /* Next entry */ |
268 | atomic_t hh_refcnt; /* number of users */ | 280 | atomic_t hh_refcnt; /* number of users */ |
@@ -610,6 +622,13 @@ struct netdev_queue { | |||
610 | * this function is called when a VLAN id is unregistered. | 622 | * this function is called when a VLAN id is unregistered. |
611 | * | 623 | * |
612 | * void (*ndo_poll_controller)(struct net_device *dev); | 624 | * void (*ndo_poll_controller)(struct net_device *dev); |
625 | * | ||
626 | * SR-IOV management functions. | ||
627 | * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); | ||
628 | * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); | ||
629 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); | ||
630 | * int (*ndo_get_vf_config)(struct net_device *dev, | ||
631 | * int vf, struct ifla_vf_info *ivf); | ||
613 | */ | 632 | */ |
614 | #define HAVE_NET_DEVICE_OPS | 633 | #define HAVE_NET_DEVICE_OPS |
615 | struct net_device_ops { | 634 | struct net_device_ops { |
@@ -621,30 +640,21 @@ struct net_device_ops { | |||
621 | struct net_device *dev); | 640 | struct net_device *dev); |
622 | u16 (*ndo_select_queue)(struct net_device *dev, | 641 | u16 (*ndo_select_queue)(struct net_device *dev, |
623 | struct sk_buff *skb); | 642 | struct sk_buff *skb); |
624 | #define HAVE_CHANGE_RX_FLAGS | ||
625 | void (*ndo_change_rx_flags)(struct net_device *dev, | 643 | void (*ndo_change_rx_flags)(struct net_device *dev, |
626 | int flags); | 644 | int flags); |
627 | #define HAVE_SET_RX_MODE | ||
628 | void (*ndo_set_rx_mode)(struct net_device *dev); | 645 | void (*ndo_set_rx_mode)(struct net_device *dev); |
629 | #define HAVE_MULTICAST | ||
630 | void (*ndo_set_multicast_list)(struct net_device *dev); | 646 | void (*ndo_set_multicast_list)(struct net_device *dev); |
631 | #define HAVE_SET_MAC_ADDR | ||
632 | int (*ndo_set_mac_address)(struct net_device *dev, | 647 | int (*ndo_set_mac_address)(struct net_device *dev, |
633 | void *addr); | 648 | void *addr); |
634 | #define HAVE_VALIDATE_ADDR | ||
635 | int (*ndo_validate_addr)(struct net_device *dev); | 649 | int (*ndo_validate_addr)(struct net_device *dev); |
636 | #define HAVE_PRIVATE_IOCTL | ||
637 | int (*ndo_do_ioctl)(struct net_device *dev, | 650 | int (*ndo_do_ioctl)(struct net_device *dev, |
638 | struct ifreq *ifr, int cmd); | 651 | struct ifreq *ifr, int cmd); |
639 | #define HAVE_SET_CONFIG | ||
640 | int (*ndo_set_config)(struct net_device *dev, | 652 | int (*ndo_set_config)(struct net_device *dev, |
641 | struct ifmap *map); | 653 | struct ifmap *map); |
642 | #define HAVE_CHANGE_MTU | ||
643 | int (*ndo_change_mtu)(struct net_device *dev, | 654 | int (*ndo_change_mtu)(struct net_device *dev, |
644 | int new_mtu); | 655 | int new_mtu); |
645 | int (*ndo_neigh_setup)(struct net_device *dev, | 656 | int (*ndo_neigh_setup)(struct net_device *dev, |
646 | struct neigh_parms *); | 657 | struct neigh_parms *); |
647 | #define HAVE_TX_TIMEOUT | ||
648 | void (*ndo_tx_timeout) (struct net_device *dev); | 658 | void (*ndo_tx_timeout) (struct net_device *dev); |
649 | 659 | ||
650 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 660 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
@@ -656,9 +666,17 @@ struct net_device_ops { | |||
656 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, | 666 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, |
657 | unsigned short vid); | 667 | unsigned short vid); |
658 | #ifdef CONFIG_NET_POLL_CONTROLLER | 668 | #ifdef CONFIG_NET_POLL_CONTROLLER |
659 | #define HAVE_NETDEV_POLL | ||
660 | void (*ndo_poll_controller)(struct net_device *dev); | 669 | void (*ndo_poll_controller)(struct net_device *dev); |
661 | #endif | 670 | #endif |
671 | int (*ndo_set_vf_mac)(struct net_device *dev, | ||
672 | int queue, u8 *mac); | ||
673 | int (*ndo_set_vf_vlan)(struct net_device *dev, | ||
674 | int queue, u16 vlan, u8 qos); | ||
675 | int (*ndo_set_vf_tx_rate)(struct net_device *dev, | ||
676 | int vf, int rate); | ||
677 | int (*ndo_get_vf_config)(struct net_device *dev, | ||
678 | int vf, | ||
679 | struct ifla_vf_info *ivf); | ||
662 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 680 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
663 | int (*ndo_fcoe_enable)(struct net_device *dev); | 681 | int (*ndo_fcoe_enable)(struct net_device *dev); |
664 | int (*ndo_fcoe_disable)(struct net_device *dev); | 682 | int (*ndo_fcoe_disable)(struct net_device *dev); |
@@ -745,6 +763,7 @@ struct net_device { | |||
745 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ | 763 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ |
746 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | 764 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ |
747 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ | 765 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ |
766 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ | ||
748 | 767 | ||
749 | /* Segmentation offload features */ | 768 | /* Segmentation offload features */ |
750 | #define NETIF_F_GSO_SHIFT 16 | 769 | #define NETIF_F_GSO_SHIFT 16 |
@@ -905,7 +924,12 @@ struct net_device { | |||
905 | NETREG_UNREGISTERED, /* completed unregister todo */ | 924 | NETREG_UNREGISTERED, /* completed unregister todo */ |
906 | NETREG_RELEASED, /* called free_netdev */ | 925 | NETREG_RELEASED, /* called free_netdev */ |
907 | NETREG_DUMMY, /* dummy device for NAPI poll */ | 926 | NETREG_DUMMY, /* dummy device for NAPI poll */ |
908 | } reg_state; | 927 | } reg_state:16; |
928 | |||
929 | enum { | ||
930 | RTNL_LINK_INITIALIZED, | ||
931 | RTNL_LINK_INITIALIZING, | ||
932 | } rtnl_link_state:16; | ||
909 | 933 | ||
910 | /* Called from unregister, can be used to call free_netdev */ | 934 | /* Called from unregister, can be used to call free_netdev */ |
911 | void (*destructor)(struct net_device *dev); | 935 | void (*destructor)(struct net_device *dev); |
@@ -953,6 +977,8 @@ struct net_device { | |||
953 | /* max exchange id for FCoE LRO by ddp */ | 977 | /* max exchange id for FCoE LRO by ddp */ |
954 | unsigned int fcoe_ddp_xid; | 978 | unsigned int fcoe_ddp_xid; |
955 | #endif | 979 | #endif |
980 | /* n-tuple filter list attached to this device */ | ||
981 | struct ethtool_rx_ntuple_list ethtool_ntuple_list; | ||
956 | }; | 982 | }; |
957 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 983 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
958 | 984 | ||
@@ -1009,6 +1035,15 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
1009 | return 0; | 1035 | return 0; |
1010 | } | 1036 | } |
1011 | 1037 | ||
1038 | #ifndef CONFIG_NET_NS | ||
1039 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
1040 | { | ||
1041 | skb->dev = dev; | ||
1042 | } | ||
1043 | #else /* CONFIG_NET_NS */ | ||
1044 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
1045 | #endif | ||
1046 | |||
1012 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1047 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
1013 | { | 1048 | { |
1014 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1049 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |
@@ -1527,7 +1562,6 @@ extern int netif_rx(struct sk_buff *skb); | |||
1527 | extern int netif_rx_ni(struct sk_buff *skb); | 1562 | extern int netif_rx_ni(struct sk_buff *skb); |
1528 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1563 | #define HAVE_NETIF_RECEIVE_SKB 1 |
1529 | extern int netif_receive_skb(struct sk_buff *skb); | 1564 | extern int netif_receive_skb(struct sk_buff *skb); |
1530 | extern void napi_gro_flush(struct napi_struct *napi); | ||
1531 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, | 1565 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, |
1532 | struct sk_buff *skb); | 1566 | struct sk_buff *skb); |
1533 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); | 1567 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); |
@@ -1553,7 +1587,9 @@ extern int dev_valid_name(const char *name); | |||
1553 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1587 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
1554 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1588 | extern int dev_ethtool(struct net *net, struct ifreq *); |
1555 | extern unsigned dev_get_flags(const struct net_device *); | 1589 | extern unsigned dev_get_flags(const struct net_device *); |
1590 | extern int __dev_change_flags(struct net_device *, unsigned int flags); | ||
1556 | extern int dev_change_flags(struct net_device *, unsigned); | 1591 | extern int dev_change_flags(struct net_device *, unsigned); |
1592 | extern void __dev_notify_flags(struct net_device *, unsigned int old_flags); | ||
1557 | extern int dev_change_name(struct net_device *, const char *); | 1593 | extern int dev_change_name(struct net_device *, const char *); |
1558 | extern int dev_set_alias(struct net_device *, const char *, size_t); | 1594 | extern int dev_set_alias(struct net_device *, const char *, size_t); |
1559 | extern int dev_change_net_namespace(struct net_device *, | 1595 | extern int dev_change_net_namespace(struct net_device *, |
@@ -2083,6 +2119,130 @@ static inline u32 dev_ethtool_get_flags(struct net_device *dev) | |||
2083 | return 0; | 2119 | return 0; |
2084 | return dev->ethtool_ops->get_flags(dev); | 2120 | return dev->ethtool_ops->get_flags(dev); |
2085 | } | 2121 | } |
2122 | |||
2123 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | ||
2124 | |||
2125 | /* netdev_printk helpers, similar to dev_printk */ | ||
2126 | |||
2127 | static inline const char *netdev_name(const struct net_device *dev) | ||
2128 | { | ||
2129 | if (dev->reg_state != NETREG_REGISTERED) | ||
2130 | return "(unregistered net_device)"; | ||
2131 | return dev->name; | ||
2132 | } | ||
2133 | |||
2134 | #define netdev_printk(level, netdev, format, args...) \ | ||
2135 | dev_printk(level, (netdev)->dev.parent, \ | ||
2136 | "%s: " format, \ | ||
2137 | netdev_name(netdev), ##args) | ||
2138 | |||
2139 | #define netdev_emerg(dev, format, args...) \ | ||
2140 | netdev_printk(KERN_EMERG, dev, format, ##args) | ||
2141 | #define netdev_alert(dev, format, args...) \ | ||
2142 | netdev_printk(KERN_ALERT, dev, format, ##args) | ||
2143 | #define netdev_crit(dev, format, args...) \ | ||
2144 | netdev_printk(KERN_CRIT, dev, format, ##args) | ||
2145 | #define netdev_err(dev, format, args...) \ | ||
2146 | netdev_printk(KERN_ERR, dev, format, ##args) | ||
2147 | #define netdev_warn(dev, format, args...) \ | ||
2148 | netdev_printk(KERN_WARNING, dev, format, ##args) | ||
2149 | #define netdev_notice(dev, format, args...) \ | ||
2150 | netdev_printk(KERN_NOTICE, dev, format, ##args) | ||
2151 | #define netdev_info(dev, format, args...) \ | ||
2152 | netdev_printk(KERN_INFO, dev, format, ##args) | ||
2153 | |||
2154 | #if defined(DEBUG) | ||
2155 | #define netdev_dbg(__dev, format, args...) \ | ||
2156 | netdev_printk(KERN_DEBUG, __dev, format, ##args) | ||
2157 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
2158 | #define netdev_dbg(__dev, format, args...) \ | ||
2159 | do { \ | ||
2160 | dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \ | ||
2161 | netdev_name(__dev), ##args); \ | ||
2162 | } while (0) | ||
2163 | #else | ||
2164 | #define netdev_dbg(__dev, format, args...) \ | ||
2165 | ({ \ | ||
2166 | if (0) \ | ||
2167 | netdev_printk(KERN_DEBUG, __dev, format, ##args); \ | ||
2168 | 0; \ | ||
2169 | }) | ||
2170 | #endif | ||
2171 | |||
2172 | #if defined(VERBOSE_DEBUG) | ||
2173 | #define netdev_vdbg netdev_dbg | ||
2174 | #else | ||
2175 | |||
2176 | #define netdev_vdbg(dev, format, args...) \ | ||
2177 | ({ \ | ||
2178 | if (0) \ | ||
2179 | netdev_printk(KERN_DEBUG, dev, format, ##args); \ | ||
2180 | 0; \ | ||
2181 | }) | ||
2182 | #endif | ||
2183 | |||
2184 | /* | ||
2185 | * netdev_WARN() acts like dev_printk(), but with the key difference | ||
2186 | * of using a WARN/WARN_ON to get the message out, including the | ||
2187 | * file/line information and a backtrace. | ||
2188 | */ | ||
2189 | #define netdev_WARN(dev, format, args...) \ | ||
2190 | WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args); | ||
2191 | |||
2192 | /* netif printk helpers, similar to netdev_printk */ | ||
2193 | |||
2194 | #define netif_printk(priv, type, level, dev, fmt, args...) \ | ||
2195 | do { \ | ||
2196 | if (netif_msg_##type(priv)) \ | ||
2197 | netdev_printk(level, (dev), fmt, ##args); \ | ||
2198 | } while (0) | ||
2199 | |||
2200 | #define netif_emerg(priv, type, dev, fmt, args...) \ | ||
2201 | netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args) | ||
2202 | #define netif_alert(priv, type, dev, fmt, args...) \ | ||
2203 | netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args) | ||
2204 | #define netif_crit(priv, type, dev, fmt, args...) \ | ||
2205 | netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args) | ||
2206 | #define netif_err(priv, type, dev, fmt, args...) \ | ||
2207 | netif_printk(priv, type, KERN_ERR, dev, fmt, ##args) | ||
2208 | #define netif_warn(priv, type, dev, fmt, args...) \ | ||
2209 | netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args) | ||
2210 | #define netif_notice(priv, type, dev, fmt, args...) \ | ||
2211 | netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args) | ||
2212 | #define netif_info(priv, type, dev, fmt, args...) \ | ||
2213 | netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args) | ||
2214 | |||
2215 | #if defined(DEBUG) | ||
2216 | #define netif_dbg(priv, type, dev, format, args...) \ | ||
2217 | netif_printk(priv, type, KERN_DEBUG, dev, format, ##args) | ||
2218 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
2219 | #define netif_dbg(priv, type, netdev, format, args...) \ | ||
2220 | do { \ | ||
2221 | if (netif_msg_##type(priv)) \ | ||
2222 | dynamic_dev_dbg((netdev)->dev.parent, \ | ||
2223 | "%s: " format, \ | ||
2224 | netdev_name(netdev), ##args); \ | ||
2225 | } while (0) | ||
2226 | #else | ||
2227 | #define netif_dbg(priv, type, dev, format, args...) \ | ||
2228 | ({ \ | ||
2229 | if (0) \ | ||
2230 | netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \ | ||
2231 | 0; \ | ||
2232 | }) | ||
2233 | #endif | ||
2234 | |||
2235 | #if defined(VERBOSE_DEBUG) | ||
2236 | #define netif_vdbg netdev_dbg | ||
2237 | #else | ||
2238 | #define netif_vdbg(priv, type, dev, format, args...) \ | ||
2239 | ({ \ | ||
2240 | if (0) \ | ||
2241 | netif_printk(KERN_DEBUG, dev, format, ##args); \ | ||
2242 | 0; \ | ||
2243 | }) | ||
2244 | #endif | ||
2245 | |||
2086 | #endif /* __KERNEL__ */ | 2246 | #endif /* __KERNEL__ */ |
2087 | 2247 | ||
2088 | #endif /* _LINUX_NETDEVICE_H */ | 2248 | #endif /* _LINUX_NETDEVICE_H */ |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 48c54960773c..89341c32631a 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -114,15 +114,17 @@ struct nf_sockopt_ops { | |||
114 | int set_optmin; | 114 | int set_optmin; |
115 | int set_optmax; | 115 | int set_optmax; |
116 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); | 116 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); |
117 | #ifdef CONFIG_COMPAT | ||
117 | int (*compat_set)(struct sock *sk, int optval, | 118 | int (*compat_set)(struct sock *sk, int optval, |
118 | void __user *user, unsigned int len); | 119 | void __user *user, unsigned int len); |
119 | 120 | #endif | |
120 | int get_optmin; | 121 | int get_optmin; |
121 | int get_optmax; | 122 | int get_optmax; |
122 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); | 123 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); |
124 | #ifdef CONFIG_COMPAT | ||
123 | int (*compat_get)(struct sock *sk, int optval, | 125 | int (*compat_get)(struct sock *sk, int optval, |
124 | void __user *user, int *len); | 126 | void __user *user, int *len); |
125 | 127 | #endif | |
126 | /* Use the module struct to lock set/get code in place */ | 128 | /* Use the module struct to lock set/get code in place */ |
127 | struct module *owner; | 129 | struct module *owner; |
128 | }; | 130 | }; |
@@ -161,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | |||
161 | struct sk_buff *skb, | 163 | struct sk_buff *skb, |
162 | struct net_device *indev, | 164 | struct net_device *indev, |
163 | struct net_device *outdev, | 165 | struct net_device *outdev, |
164 | int (*okfn)(struct sk_buff *), int thresh, | 166 | int (*okfn)(struct sk_buff *), int thresh) |
165 | int cond) | ||
166 | { | 167 | { |
167 | if (!cond) | ||
168 | return 1; | ||
169 | #ifndef CONFIG_NETFILTER_DEBUG | 168 | #ifndef CONFIG_NETFILTER_DEBUG |
170 | if (list_empty(&nf_hooks[pf][hook])) | 169 | if (list_empty(&nf_hooks[pf][hook])) |
171 | return 1; | 170 | return 1; |
@@ -177,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | |||
177 | struct net_device *indev, struct net_device *outdev, | 176 | struct net_device *indev, struct net_device *outdev, |
178 | int (*okfn)(struct sk_buff *)) | 177 | int (*okfn)(struct sk_buff *)) |
179 | { | 178 | { |
180 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1); | 179 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN); |
181 | } | 180 | } |
182 | 181 | ||
183 | /* Activate hook; either okfn or kfree_skb called, unless a hook | 182 | /* Activate hook; either okfn or kfree_skb called, unless a hook |
@@ -197,36 +196,49 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | |||
197 | coders :) | 196 | coders :) |
198 | */ | 197 | */ |
199 | 198 | ||
200 | /* This is gross, but inline doesn't cut it for avoiding the function | 199 | static inline int |
201 | call in fast path: gcc doesn't inline (needs value tracking?). --RR */ | 200 | NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb, |
202 | 201 | struct net_device *in, struct net_device *out, | |
203 | /* HX: It's slightly less gross now. */ | 202 | int (*okfn)(struct sk_buff *), int thresh) |
203 | { | ||
204 | int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh); | ||
205 | if (ret == 1) | ||
206 | ret = okfn(skb); | ||
207 | return ret; | ||
208 | } | ||
204 | 209 | ||
205 | #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ | 210 | static inline int |
206 | ({int __ret; \ | 211 | NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, |
207 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\ | 212 | struct net_device *in, struct net_device *out, |
208 | __ret = (okfn)(skb); \ | 213 | int (*okfn)(struct sk_buff *), bool cond) |
209 | __ret;}) | 214 | { |
215 | int ret; | ||
210 | 216 | ||
211 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ | 217 | if (!cond || |
212 | ({int __ret; \ | 218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) |
213 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ | 219 | ret = okfn(skb); |
214 | __ret = (okfn)(skb); \ | 220 | return ret; |
215 | __ret;}) | 221 | } |
216 | 222 | ||
217 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ | 223 | static inline int |
218 | NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) | 224 | NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb, |
225 | struct net_device *in, struct net_device *out, | ||
226 | int (*okfn)(struct sk_buff *)) | ||
227 | { | ||
228 | return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, INT_MIN); | ||
229 | } | ||
219 | 230 | ||
220 | /* Call setsockopt() */ | 231 | /* Call setsockopt() */ |
221 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 232 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
222 | unsigned int len); | 233 | unsigned int len); |
223 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 234 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
224 | int *len); | 235 | int *len); |
225 | 236 | #ifdef CONFIG_COMPAT | |
226 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, | 237 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, |
227 | char __user *opt, unsigned int len); | 238 | char __user *opt, unsigned int len); |
228 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, | 239 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, |
229 | char __user *opt, int *len); | 240 | char __user *opt, int *len); |
241 | #endif | ||
230 | 242 | ||
231 | /* Call this before modifying an existing packet: ensures it is | 243 | /* Call this before modifying an existing packet: ensures it is |
232 | modifiable and linear to the point you care about (writable_len). | 244 | modifiable and linear to the point you care about (writable_len). |
@@ -325,8 +337,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | |||
325 | struct sk_buff *skb, | 337 | struct sk_buff *skb, |
326 | struct net_device *indev, | 338 | struct net_device *indev, |
327 | struct net_device *outdev, | 339 | struct net_device *outdev, |
328 | int (*okfn)(struct sk_buff *), int thresh, | 340 | int (*okfn)(struct sk_buff *), int thresh) |
329 | int cond) | ||
330 | { | 341 | { |
331 | return okfn(skb); | 342 | return okfn(skb); |
332 | } | 343 | } |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 2aea50399c0b..a5a63e41b8af 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -6,6 +6,7 @@ header-y += nfnetlink_queue.h | |||
6 | header-y += xt_CLASSIFY.h | 6 | header-y += xt_CLASSIFY.h |
7 | header-y += xt_CONNMARK.h | 7 | header-y += xt_CONNMARK.h |
8 | header-y += xt_CONNSECMARK.h | 8 | header-y += xt_CONNSECMARK.h |
9 | header-y += xt_CT.h | ||
9 | header-y += xt_DSCP.h | 10 | header-y += xt_DSCP.h |
10 | header-y += xt_LED.h | 11 | header-y += xt_LED.h |
11 | header-y += xt_MARK.h | 12 | header-y += xt_MARK.h |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index a374787ed9b0..c608677dda60 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -72,6 +72,28 @@ enum ip_conntrack_status { | |||
72 | /* Connection has fixed timeout. */ | 72 | /* Connection has fixed timeout. */ |
73 | IPS_FIXED_TIMEOUT_BIT = 10, | 73 | IPS_FIXED_TIMEOUT_BIT = 10, |
74 | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), | 74 | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), |
75 | |||
76 | /* Conntrack is a template */ | ||
77 | IPS_TEMPLATE_BIT = 11, | ||
78 | IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT), | ||
79 | }; | ||
80 | |||
81 | /* Connection tracking event types */ | ||
82 | enum ip_conntrack_events { | ||
83 | IPCT_NEW, /* new conntrack */ | ||
84 | IPCT_RELATED, /* related conntrack */ | ||
85 | IPCT_DESTROY, /* destroyed conntrack */ | ||
86 | IPCT_REPLY, /* connection has seen two-way traffic */ | ||
87 | IPCT_ASSURED, /* connection status has changed to assured */ | ||
88 | IPCT_PROTOINFO, /* protocol information has changed */ | ||
89 | IPCT_HELPER, /* new helper has been set */ | ||
90 | IPCT_MARK, /* new mark has been set */ | ||
91 | IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ | ||
92 | IPCT_SECMARK, /* new security mark has been set */ | ||
93 | }; | ||
94 | |||
95 | enum ip_conntrack_expect_events { | ||
96 | IPEXP_NEW, /* new expectation */ | ||
75 | }; | 97 | }; |
76 | 98 | ||
77 | #ifdef __KERNEL__ | 99 | #ifdef __KERNEL__ |
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 23aa2ec6b7b7..ff8cfbcf3b81 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -14,6 +14,7 @@ enum sip_expectation_classes { | |||
14 | SIP_EXPECT_SIGNALLING, | 14 | SIP_EXPECT_SIGNALLING, |
15 | SIP_EXPECT_AUDIO, | 15 | SIP_EXPECT_AUDIO, |
16 | SIP_EXPECT_VIDEO, | 16 | SIP_EXPECT_VIDEO, |
17 | SIP_EXPECT_IMAGE, | ||
17 | __SIP_EXPECT_MAX | 18 | __SIP_EXPECT_MAX |
18 | }; | 19 | }; |
19 | #define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) | 20 | #define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) |
@@ -34,10 +35,10 @@ struct sdp_media_type { | |||
34 | struct sip_handler { | 35 | struct sip_handler { |
35 | const char *method; | 36 | const char *method; |
36 | unsigned int len; | 37 | unsigned int len; |
37 | int (*request)(struct sk_buff *skb, | 38 | int (*request)(struct sk_buff *skb, unsigned int dataoff, |
38 | const char **dptr, unsigned int *datalen, | 39 | const char **dptr, unsigned int *datalen, |
39 | unsigned int cseq); | 40 | unsigned int cseq); |
40 | int (*response)(struct sk_buff *skb, | 41 | int (*response)(struct sk_buff *skb, unsigned int dataoff, |
41 | const char **dptr, unsigned int *datalen, | 42 | const char **dptr, unsigned int *datalen, |
42 | unsigned int cseq, unsigned int code); | 43 | unsigned int cseq, unsigned int code); |
43 | }; | 44 | }; |
@@ -84,7 +85,8 @@ enum sip_header_types { | |||
84 | SIP_HDR_FROM, | 85 | SIP_HDR_FROM, |
85 | SIP_HDR_TO, | 86 | SIP_HDR_TO, |
86 | SIP_HDR_CONTACT, | 87 | SIP_HDR_CONTACT, |
87 | SIP_HDR_VIA, | 88 | SIP_HDR_VIA_UDP, |
89 | SIP_HDR_VIA_TCP, | ||
88 | SIP_HDR_EXPIRES, | 90 | SIP_HDR_EXPIRES, |
89 | SIP_HDR_CONTENT_LENGTH, | 91 | SIP_HDR_CONTENT_LENGTH, |
90 | }; | 92 | }; |
@@ -100,33 +102,40 @@ enum sdp_header_types { | |||
100 | }; | 102 | }; |
101 | 103 | ||
102 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, | 104 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, |
105 | unsigned int dataoff, | ||
103 | const char **dptr, | 106 | const char **dptr, |
104 | unsigned int *datalen); | 107 | unsigned int *datalen); |
108 | extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, s16 off); | ||
105 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, | 109 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, |
110 | unsigned int dataoff, | ||
106 | const char **dptr, | 111 | const char **dptr, |
107 | unsigned int *datalen, | 112 | unsigned int *datalen, |
108 | struct nf_conntrack_expect *exp, | 113 | struct nf_conntrack_expect *exp, |
109 | unsigned int matchoff, | 114 | unsigned int matchoff, |
110 | unsigned int matchlen); | 115 | unsigned int matchlen); |
111 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, | 116 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, |
112 | const char **dptr, | ||
113 | unsigned int dataoff, | 117 | unsigned int dataoff, |
118 | const char **dptr, | ||
114 | unsigned int *datalen, | 119 | unsigned int *datalen, |
120 | unsigned int sdpoff, | ||
115 | enum sdp_header_types type, | 121 | enum sdp_header_types type, |
116 | enum sdp_header_types term, | 122 | enum sdp_header_types term, |
117 | const union nf_inet_addr *addr); | 123 | const union nf_inet_addr *addr); |
118 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, | 124 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, |
125 | unsigned int dataoff, | ||
119 | const char **dptr, | 126 | const char **dptr, |
120 | unsigned int *datalen, | 127 | unsigned int *datalen, |
121 | unsigned int matchoff, | 128 | unsigned int matchoff, |
122 | unsigned int matchlen, | 129 | unsigned int matchlen, |
123 | u_int16_t port); | 130 | u_int16_t port); |
124 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, | 131 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, |
125 | const char **dptr, | ||
126 | unsigned int dataoff, | 132 | unsigned int dataoff, |
133 | const char **dptr, | ||
127 | unsigned int *datalen, | 134 | unsigned int *datalen, |
135 | unsigned int sdpoff, | ||
128 | const union nf_inet_addr *addr); | 136 | const union nf_inet_addr *addr); |
129 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, | 137 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, |
138 | unsigned int dataoff, | ||
130 | const char **dptr, | 139 | const char **dptr, |
131 | unsigned int *datalen, | 140 | unsigned int *datalen, |
132 | struct nf_conntrack_expect *rtp_exp, | 141 | struct nf_conntrack_expect *rtp_exp, |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 49d321f3ccd2..53923868c9bd 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -73,11 +73,11 @@ struct nfnetlink_subsystem { | |||
73 | extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); | 73 | extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); |
74 | extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); | 74 | extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); |
75 | 75 | ||
76 | extern int nfnetlink_has_listeners(unsigned int group); | 76 | extern int nfnetlink_has_listeners(struct net *net, unsigned int group); |
77 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | 77 | extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, |
78 | int echo, gfp_t flags); | 78 | int echo, gfp_t flags); |
79 | extern void nfnetlink_set_err(u32 pid, u32 group, int error); | 79 | extern void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); |
80 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 80 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); |
81 | 81 | ||
82 | extern void nfnl_lock(void); | 82 | extern void nfnl_lock(void); |
83 | extern void nfnl_unlock(void); | 83 | extern void nfnl_unlock(void); |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index ed4ef8d0b11b..9ed534c991b9 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -40,6 +40,7 @@ enum ctattr_type { | |||
40 | CTA_NAT_SEQ_ADJ_ORIG, | 40 | CTA_NAT_SEQ_ADJ_ORIG, |
41 | CTA_NAT_SEQ_ADJ_REPLY, | 41 | CTA_NAT_SEQ_ADJ_REPLY, |
42 | CTA_SECMARK, | 42 | CTA_SECMARK, |
43 | CTA_ZONE, | ||
43 | __CTA_MAX | 44 | __CTA_MAX |
44 | }; | 45 | }; |
45 | #define CTA_MAX (__CTA_MAX - 1) | 46 | #define CTA_MAX (__CTA_MAX - 1) |
@@ -159,6 +160,7 @@ enum ctattr_expect { | |||
159 | CTA_EXPECT_TIMEOUT, | 160 | CTA_EXPECT_TIMEOUT, |
160 | CTA_EXPECT_ID, | 161 | CTA_EXPECT_ID, |
161 | CTA_EXPECT_HELP_NAME, | 162 | CTA_EXPECT_HELP_NAME, |
163 | CTA_EXPECT_ZONE, | ||
162 | __CTA_EXPECT_MAX | 164 | __CTA_EXPECT_MAX |
163 | }; | 165 | }; |
164 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) | 166 | #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 378f27ae7772..84c7c928e9eb 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -93,8 +93,7 @@ struct _xt_align { | |||
93 | __u64 u64; | 93 | __u64 u64; |
94 | }; | 94 | }; |
95 | 95 | ||
96 | #define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ | 96 | #define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) |
97 | & ~(__alignof__(struct _xt_align)-1)) | ||
98 | 97 | ||
99 | /* Standard return verdict, or do jump. */ | 98 | /* Standard return verdict, or do jump. */ |
100 | #define XT_STANDARD_TARGET "" | 99 | #define XT_STANDARD_TARGET "" |
@@ -121,6 +120,7 @@ struct xt_counters_info { | |||
121 | 120 | ||
122 | #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ | 121 | #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ |
123 | 122 | ||
123 | #ifndef __KERNEL__ | ||
124 | /* fn returns 0 to continue iteration */ | 124 | /* fn returns 0 to continue iteration */ |
125 | #define XT_MATCH_ITERATE(type, e, fn, args...) \ | 125 | #define XT_MATCH_ITERATE(type, e, fn, args...) \ |
126 | ({ \ | 126 | ({ \ |
@@ -164,6 +164,22 @@ struct xt_counters_info { | |||
164 | #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ | 164 | #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ |
165 | XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) | 165 | XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) |
166 | 166 | ||
167 | #endif /* !__KERNEL__ */ | ||
168 | |||
169 | /* pos is normally a struct ipt_entry/ip6t_entry/etc. */ | ||
170 | #define xt_entry_foreach(pos, ehead, esize) \ | ||
171 | for ((pos) = (typeof(pos))(ehead); \ | ||
172 | (pos) < (typeof(pos))((char *)(ehead) + (esize)); \ | ||
173 | (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset)) | ||
174 | |||
175 | /* can only be xt_entry_match, so no use of typeof here */ | ||
176 | #define xt_ematch_foreach(pos, entry) \ | ||
177 | for ((pos) = (struct xt_entry_match *)entry->elems; \ | ||
178 | (pos) < (struct xt_entry_match *)((char *)(entry) + \ | ||
179 | (entry)->target_offset); \ | ||
180 | (pos) = (struct xt_entry_match *)((char *)(pos) + \ | ||
181 | (pos)->u.match_size)) | ||
182 | |||
167 | #ifdef __KERNEL__ | 183 | #ifdef __KERNEL__ |
168 | 184 | ||
169 | #include <linux/netdevice.h> | 185 | #include <linux/netdevice.h> |
@@ -205,6 +221,7 @@ struct xt_match_param { | |||
205 | * @hook_mask: via which hooks the new rule is reachable | 221 | * @hook_mask: via which hooks the new rule is reachable |
206 | */ | 222 | */ |
207 | struct xt_mtchk_param { | 223 | struct xt_mtchk_param { |
224 | struct net *net; | ||
208 | const char *table; | 225 | const char *table; |
209 | const void *entryinfo; | 226 | const void *entryinfo; |
210 | const struct xt_match *match; | 227 | const struct xt_match *match; |
@@ -215,6 +232,7 @@ struct xt_mtchk_param { | |||
215 | 232 | ||
216 | /* Match destructor parameters */ | 233 | /* Match destructor parameters */ |
217 | struct xt_mtdtor_param { | 234 | struct xt_mtdtor_param { |
235 | struct net *net; | ||
218 | const struct xt_match *match; | 236 | const struct xt_match *match; |
219 | void *matchinfo; | 237 | void *matchinfo; |
220 | u_int8_t family; | 238 | u_int8_t family; |
@@ -247,6 +265,7 @@ struct xt_target_param { | |||
247 | * Other fields see above. | 265 | * Other fields see above. |
248 | */ | 266 | */ |
249 | struct xt_tgchk_param { | 267 | struct xt_tgchk_param { |
268 | struct net *net; | ||
250 | const char *table; | 269 | const char *table; |
251 | const void *entryinfo; | 270 | const void *entryinfo; |
252 | const struct xt_target *target; | 271 | const struct xt_target *target; |
@@ -257,6 +276,7 @@ struct xt_tgchk_param { | |||
257 | 276 | ||
258 | /* Target destructor parameters */ | 277 | /* Target destructor parameters */ |
259 | struct xt_tgdtor_param { | 278 | struct xt_tgdtor_param { |
279 | struct net *net; | ||
260 | const struct xt_target *target; | 280 | const struct xt_target *target; |
261 | void *targinfo; | 281 | void *targinfo; |
262 | u_int8_t family; | 282 | u_int8_t family; |
@@ -281,11 +301,11 @@ struct xt_match { | |||
281 | 301 | ||
282 | /* Called when entry of this type deleted. */ | 302 | /* Called when entry of this type deleted. */ |
283 | void (*destroy)(const struct xt_mtdtor_param *); | 303 | void (*destroy)(const struct xt_mtdtor_param *); |
284 | 304 | #ifdef CONFIG_COMPAT | |
285 | /* Called when userspace align differs from kernel space one */ | 305 | /* Called when userspace align differs from kernel space one */ |
286 | void (*compat_from_user)(void *dst, void *src); | 306 | void (*compat_from_user)(void *dst, const void *src); |
287 | int (*compat_to_user)(void __user *dst, void *src); | 307 | int (*compat_to_user)(void __user *dst, const void *src); |
288 | 308 | #endif | |
289 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 309 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
290 | struct module *me; | 310 | struct module *me; |
291 | 311 | ||
@@ -294,7 +314,9 @@ struct xt_match { | |||
294 | 314 | ||
295 | const char *table; | 315 | const char *table; |
296 | unsigned int matchsize; | 316 | unsigned int matchsize; |
317 | #ifdef CONFIG_COMPAT | ||
297 | unsigned int compatsize; | 318 | unsigned int compatsize; |
319 | #endif | ||
298 | unsigned int hooks; | 320 | unsigned int hooks; |
299 | unsigned short proto; | 321 | unsigned short proto; |
300 | 322 | ||
@@ -321,17 +343,19 @@ struct xt_target { | |||
321 | 343 | ||
322 | /* Called when entry of this type deleted. */ | 344 | /* Called when entry of this type deleted. */ |
323 | void (*destroy)(const struct xt_tgdtor_param *); | 345 | void (*destroy)(const struct xt_tgdtor_param *); |
324 | 346 | #ifdef CONFIG_COMPAT | |
325 | /* Called when userspace align differs from kernel space one */ | 347 | /* Called when userspace align differs from kernel space one */ |
326 | void (*compat_from_user)(void *dst, void *src); | 348 | void (*compat_from_user)(void *dst, const void *src); |
327 | int (*compat_to_user)(void __user *dst, void *src); | 349 | int (*compat_to_user)(void __user *dst, const void *src); |
328 | 350 | #endif | |
329 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 351 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
330 | struct module *me; | 352 | struct module *me; |
331 | 353 | ||
332 | const char *table; | 354 | const char *table; |
333 | unsigned int targetsize; | 355 | unsigned int targetsize; |
356 | #ifdef CONFIG_COMPAT | ||
334 | unsigned int compatsize; | 357 | unsigned int compatsize; |
358 | #endif | ||
335 | unsigned int hooks; | 359 | unsigned int hooks; |
336 | unsigned short proto; | 360 | unsigned short proto; |
337 | 361 | ||
@@ -353,6 +377,7 @@ struct xt_table { | |||
353 | struct module *me; | 377 | struct module *me; |
354 | 378 | ||
355 | u_int8_t af; /* address/protocol family */ | 379 | u_int8_t af; /* address/protocol family */ |
380 | int priority; /* hook order */ | ||
356 | 381 | ||
357 | /* A unique name... */ | 382 | /* A unique name... */ |
358 | const char name[XT_TABLE_MAXNAMELEN]; | 383 | const char name[XT_TABLE_MAXNAMELEN]; |
@@ -514,6 +539,9 @@ static inline unsigned long ifname_compare_aligned(const char *_a, | |||
514 | return ret; | 539 | return ret; |
515 | } | 540 | } |
516 | 541 | ||
542 | extern struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *); | ||
543 | extern void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *); | ||
544 | |||
517 | #ifdef CONFIG_COMPAT | 545 | #ifdef CONFIG_COMPAT |
518 | #include <net/compat.h> | 546 | #include <net/compat.h> |
519 | 547 | ||
@@ -554,11 +582,7 @@ struct compat_xt_entry_target { | |||
554 | * current task alignment */ | 582 | * current task alignment */ |
555 | 583 | ||
556 | struct compat_xt_counters { | 584 | struct compat_xt_counters { |
557 | #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) | 585 | compat_u64 pcnt, bcnt; /* Packet and byte counters */ |
558 | u_int32_t cnt[4]; | ||
559 | #else | ||
560 | u_int64_t cnt[2]; | ||
561 | #endif | ||
562 | }; | 586 | }; |
563 | 587 | ||
564 | struct compat_xt_counters_info { | 588 | struct compat_xt_counters_info { |
@@ -567,26 +591,32 @@ struct compat_xt_counters_info { | |||
567 | struct compat_xt_counters counters[0]; | 591 | struct compat_xt_counters counters[0]; |
568 | }; | 592 | }; |
569 | 593 | ||
570 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ | 594 | struct _compat_xt_align { |
571 | & ~(__alignof__(struct compat_xt_counters)-1)) | 595 | __u8 u8; |
596 | __u16 u16; | ||
597 | __u32 u32; | ||
598 | compat_u64 u64; | ||
599 | }; | ||
600 | |||
601 | #define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) | ||
572 | 602 | ||
573 | extern void xt_compat_lock(u_int8_t af); | 603 | extern void xt_compat_lock(u_int8_t af); |
574 | extern void xt_compat_unlock(u_int8_t af); | 604 | extern void xt_compat_unlock(u_int8_t af); |
575 | 605 | ||
576 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); | 606 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); |
577 | extern void xt_compat_flush_offsets(u_int8_t af); | 607 | extern void xt_compat_flush_offsets(u_int8_t af); |
578 | extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); | 608 | extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset); |
579 | 609 | ||
580 | extern int xt_compat_match_offset(const struct xt_match *match); | 610 | extern int xt_compat_match_offset(const struct xt_match *match); |
581 | extern int xt_compat_match_from_user(struct xt_entry_match *m, | 611 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
582 | void **dstptr, unsigned int *size); | 612 | void **dstptr, unsigned int *size); |
583 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | 613 | extern int xt_compat_match_to_user(const struct xt_entry_match *m, |
584 | void __user **dstptr, unsigned int *size); | 614 | void __user **dstptr, unsigned int *size); |
585 | 615 | ||
586 | extern int xt_compat_target_offset(const struct xt_target *target); | 616 | extern int xt_compat_target_offset(const struct xt_target *target); |
587 | extern void xt_compat_target_from_user(struct xt_entry_target *t, | 617 | extern void xt_compat_target_from_user(struct xt_entry_target *t, |
588 | void **dstptr, unsigned int *size); | 618 | void **dstptr, unsigned int *size); |
589 | extern int xt_compat_target_to_user(struct xt_entry_target *t, | 619 | extern int xt_compat_target_to_user(const struct xt_entry_target *t, |
590 | void __user **dstptr, unsigned int *size); | 620 | void __user **dstptr, unsigned int *size); |
591 | 621 | ||
592 | #endif /* CONFIG_COMPAT */ | 622 | #endif /* CONFIG_COMPAT */ |
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h new file mode 100644 index 000000000000..1b564106891d --- /dev/null +++ b/include/linux/netfilter/xt_CT.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _XT_CT_H | ||
2 | #define _XT_CT_H | ||
3 | |||
4 | #define XT_CT_NOTRACK 0x1 | ||
5 | |||
6 | struct xt_ct_target_info { | ||
7 | u_int16_t flags; | ||
8 | u_int16_t zone; | ||
9 | u_int32_t ct_events; | ||
10 | u_int32_t exp_events; | ||
11 | char helper[16]; | ||
12 | |||
13 | /* Used internally by the kernel */ | ||
14 | struct nf_conn *ct __attribute__((aligned(8))); | ||
15 | }; | ||
16 | |||
17 | #endif /* _XT_CT_H */ | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index f2336523a9df..e9948c0560f6 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -211,9 +211,11 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
211 | return (void *)e + e->target_offset; | 211 | return (void *)e + e->target_offset; |
212 | } | 212 | } |
213 | 213 | ||
214 | #ifndef __KERNEL__ | ||
214 | /* fn returns 0 to continue iteration */ | 215 | /* fn returns 0 to continue iteration */ |
215 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | 216 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
216 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) | 217 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) |
218 | #endif | ||
217 | 219 | ||
218 | /* | 220 | /* |
219 | * Main firewall chains definitions and global var's definitions. | 221 | * Main firewall chains definitions and global var's definitions. |
@@ -258,6 +260,7 @@ struct arpt_error { | |||
258 | .target.errorname = "ERROR", \ | 260 | .target.errorname = "ERROR", \ |
259 | } | 261 | } |
260 | 262 | ||
263 | extern void *arpt_alloc_initial_table(const struct xt_table *); | ||
261 | extern struct xt_table *arpt_register_table(struct net *net, | 264 | extern struct xt_table *arpt_register_table(struct net *net, |
262 | const struct xt_table *table, | 265 | const struct xt_table *table, |
263 | const struct arpt_replace *repl); | 266 | const struct arpt_replace *repl); |
@@ -290,14 +293,6 @@ compat_arpt_get_target(struct compat_arpt_entry *e) | |||
290 | 293 | ||
291 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) | 294 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) |
292 | 295 | ||
293 | /* fn returns 0 to continue iteration */ | ||
294 | #define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
295 | XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args) | ||
296 | |||
297 | #define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
298 | XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \ | ||
299 | fn, ## args) | ||
300 | |||
301 | #endif /* CONFIG_COMPAT */ | 296 | #endif /* CONFIG_COMPAT */ |
302 | #endif /*__KERNEL__*/ | 297 | #endif /*__KERNEL__*/ |
303 | #endif /* _ARPTABLES_H */ | 298 | #endif /* _ARPTABLES_H */ |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index 3cc40c131cc3..1c6f0c5f530e 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -289,7 +289,7 @@ struct ebt_table { | |||
289 | ~(__alignof__(struct ebt_replace)-1)) | 289 | ~(__alignof__(struct ebt_replace)-1)) |
290 | extern struct ebt_table *ebt_register_table(struct net *net, | 290 | extern struct ebt_table *ebt_register_table(struct net *net, |
291 | const struct ebt_table *table); | 291 | const struct ebt_table *table); |
292 | extern void ebt_unregister_table(struct ebt_table *table); | 292 | extern void ebt_unregister_table(struct net *net, struct ebt_table *table); |
293 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 293 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
294 | const struct net_device *in, const struct net_device *out, | 294 | const struct net_device *in, const struct net_device *out, |
295 | struct ebt_table *table); | 295 | struct ebt_table *table); |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 27b3f5807305..704a7b6e8169 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -223,6 +223,7 @@ ipt_get_target(struct ipt_entry *e) | |||
223 | return (void *)e + e->target_offset; | 223 | return (void *)e + e->target_offset; |
224 | } | 224 | } |
225 | 225 | ||
226 | #ifndef __KERNEL__ | ||
226 | /* fn returns 0 to continue iteration */ | 227 | /* fn returns 0 to continue iteration */ |
227 | #define IPT_MATCH_ITERATE(e, fn, args...) \ | 228 | #define IPT_MATCH_ITERATE(e, fn, args...) \ |
228 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) | 229 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) |
@@ -230,6 +231,7 @@ ipt_get_target(struct ipt_entry *e) | |||
230 | /* fn returns 0 to continue iteration */ | 231 | /* fn returns 0 to continue iteration */ |
231 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | 232 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
232 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) | 233 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) |
234 | #endif | ||
233 | 235 | ||
234 | /* | 236 | /* |
235 | * Main firewall chains definitions and global var's definitions. | 237 | * Main firewall chains definitions and global var's definitions. |
@@ -242,7 +244,7 @@ extern void ipt_init(void) __init; | |||
242 | extern struct xt_table *ipt_register_table(struct net *net, | 244 | extern struct xt_table *ipt_register_table(struct net *net, |
243 | const struct xt_table *table, | 245 | const struct xt_table *table, |
244 | const struct ipt_replace *repl); | 246 | const struct ipt_replace *repl); |
245 | extern void ipt_unregister_table(struct xt_table *table); | 247 | extern void ipt_unregister_table(struct net *net, struct xt_table *table); |
246 | 248 | ||
247 | /* Standard entry. */ | 249 | /* Standard entry. */ |
248 | struct ipt_standard { | 250 | struct ipt_standard { |
@@ -282,6 +284,7 @@ struct ipt_error { | |||
282 | .target.errorname = "ERROR", \ | 284 | .target.errorname = "ERROR", \ |
283 | } | 285 | } |
284 | 286 | ||
287 | extern void *ipt_alloc_initial_table(const struct xt_table *); | ||
285 | extern unsigned int ipt_do_table(struct sk_buff *skb, | 288 | extern unsigned int ipt_do_table(struct sk_buff *skb, |
286 | unsigned int hook, | 289 | unsigned int hook, |
287 | const struct net_device *in, | 290 | const struct net_device *in, |
@@ -312,19 +315,6 @@ compat_ipt_get_target(struct compat_ipt_entry *e) | |||
312 | 315 | ||
313 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) | 316 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) |
314 | 317 | ||
315 | /* fn returns 0 to continue iteration */ | ||
316 | #define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \ | ||
317 | XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args) | ||
318 | |||
319 | /* fn returns 0 to continue iteration */ | ||
320 | #define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
321 | XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args) | ||
322 | |||
323 | /* fn returns 0 to continue iteration */ | ||
324 | #define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
325 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \ | ||
326 | fn, ## args) | ||
327 | |||
328 | #endif /* CONFIG_COMPAT */ | 318 | #endif /* CONFIG_COMPAT */ |
329 | #endif /*__KERNEL__*/ | 319 | #endif /*__KERNEL__*/ |
330 | #endif /* _IPTABLES_H */ | 320 | #endif /* _IPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index b31050d20ae4..e5ba03d783c6 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -280,6 +280,7 @@ ip6t_get_target(struct ip6t_entry *e) | |||
280 | return (void *)e + e->target_offset; | 280 | return (void *)e + e->target_offset; |
281 | } | 281 | } |
282 | 282 | ||
283 | #ifndef __KERNEL__ | ||
283 | /* fn returns 0 to continue iteration */ | 284 | /* fn returns 0 to continue iteration */ |
284 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ | 285 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ |
285 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) | 286 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) |
@@ -287,6 +288,7 @@ ip6t_get_target(struct ip6t_entry *e) | |||
287 | /* fn returns 0 to continue iteration */ | 288 | /* fn returns 0 to continue iteration */ |
288 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | 289 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ |
289 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) | 290 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) |
291 | #endif | ||
290 | 292 | ||
291 | /* | 293 | /* |
292 | * Main firewall chains definitions and global var's definitions. | 294 | * Main firewall chains definitions and global var's definitions. |
@@ -297,10 +299,11 @@ ip6t_get_target(struct ip6t_entry *e) | |||
297 | #include <linux/init.h> | 299 | #include <linux/init.h> |
298 | extern void ip6t_init(void) __init; | 300 | extern void ip6t_init(void) __init; |
299 | 301 | ||
302 | extern void *ip6t_alloc_initial_table(const struct xt_table *); | ||
300 | extern struct xt_table *ip6t_register_table(struct net *net, | 303 | extern struct xt_table *ip6t_register_table(struct net *net, |
301 | const struct xt_table *table, | 304 | const struct xt_table *table, |
302 | const struct ip6t_replace *repl); | 305 | const struct ip6t_replace *repl); |
303 | extern void ip6t_unregister_table(struct xt_table *table); | 306 | extern void ip6t_unregister_table(struct net *net, struct xt_table *table); |
304 | extern unsigned int ip6t_do_table(struct sk_buff *skb, | 307 | extern unsigned int ip6t_do_table(struct sk_buff *skb, |
305 | unsigned int hook, | 308 | unsigned int hook, |
306 | const struct net_device *in, | 309 | const struct net_device *in, |
@@ -340,18 +343,6 @@ compat_ip6t_get_target(struct compat_ip6t_entry *e) | |||
340 | 343 | ||
341 | #define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) | 344 | #define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) |
342 | 345 | ||
343 | /* fn returns 0 to continue iteration */ | ||
344 | #define COMPAT_IP6T_MATCH_ITERATE(e, fn, args...) \ | ||
345 | XT_MATCH_ITERATE(struct compat_ip6t_entry, e, fn, ## args) | ||
346 | |||
347 | /* fn returns 0 to continue iteration */ | ||
348 | #define COMPAT_IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
349 | XT_ENTRY_ITERATE(struct compat_ip6t_entry, entries, size, fn, ## args) | ||
350 | |||
351 | #define COMPAT_IP6T_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
352 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ip6t_entry, entries, size, n, \ | ||
353 | fn, ## args) | ||
354 | |||
355 | #endif /* CONFIG_COMPAT */ | 346 | #endif /* CONFIG_COMPAT */ |
356 | #endif /*__KERNEL__*/ | 347 | #endif /*__KERNEL__*/ |
357 | #endif /* _IP6_TABLES_H */ | 348 | #endif /* _IP6_TABLES_H */ |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 2524267210d3..a765ea898549 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
@@ -21,15 +21,20 @@ struct netpoll { | |||
21 | __be32 local_ip, remote_ip; | 21 | __be32 local_ip, remote_ip; |
22 | u16 local_port, remote_port; | 22 | u16 local_port, remote_port; |
23 | u8 remote_mac[ETH_ALEN]; | 23 | u8 remote_mac[ETH_ALEN]; |
24 | |||
25 | struct list_head rx; /* rx_np list element */ | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | struct netpoll_info { | 28 | struct netpoll_info { |
27 | atomic_t refcnt; | 29 | atomic_t refcnt; |
30 | |||
28 | int rx_flags; | 31 | int rx_flags; |
29 | spinlock_t rx_lock; | 32 | spinlock_t rx_lock; |
30 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 33 | struct list_head rx_np; /* netpolls that registered an rx_hook */ |
34 | |||
31 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | 35 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ |
32 | struct sk_buff_head txq; | 36 | struct sk_buff_head txq; |
37 | |||
33 | struct delayed_work tx_work; | 38 | struct delayed_work tx_work; |
34 | }; | 39 | }; |
35 | 40 | ||
@@ -51,7 +56,7 @@ static inline int netpoll_rx(struct sk_buff *skb) | |||
51 | unsigned long flags; | 56 | unsigned long flags; |
52 | int ret = 0; | 57 | int ret = 0; |
53 | 58 | ||
54 | if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags)) | 59 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) |
55 | return 0; | 60 | return 0; |
56 | 61 | ||
57 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 62 | spin_lock_irqsave(&npinfo->rx_lock, flags); |
@@ -67,7 +72,7 @@ static inline int netpoll_rx_on(struct sk_buff *skb) | |||
67 | { | 72 | { |
68 | struct netpoll_info *npinfo = skb->dev->npinfo; | 73 | struct netpoll_info *npinfo = skb->dev->npinfo; |
69 | 74 | ||
70 | return npinfo && (npinfo->rx_np || npinfo->rx_flags); | 75 | return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); |
71 | } | 76 | } |
72 | 77 | ||
73 | static inline int netpoll_receive_skb(struct sk_buff *skb) | 78 | static inline int netpoll_receive_skb(struct sk_buff *skb) |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index da8ea2e19273..28ba20fda3e2 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -3,7 +3,7 @@ | |||
3 | /* | 3 | /* |
4 | * 802.11 netlink interface public header | 4 | * 802.11 netlink interface public header |
5 | * | 5 | * |
6 | * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> | 7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> |
8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> | 8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> |
9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> | 9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> |
@@ -270,6 +270,60 @@ | |||
270 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices | 270 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices |
271 | * associated with this wiphy must be down and will follow. | 271 | * associated with this wiphy must be down and will follow. |
272 | * | 272 | * |
273 | * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified | ||
274 | * channel for the specified amount of time. This can be used to do | ||
275 | * off-channel operations like transmit a Public Action frame and wait for | ||
276 | * a response while being associated to an AP on another channel. | ||
277 | * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which | ||
278 | * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the | ||
279 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be | ||
280 | * optionally used to specify additional channel parameters. | ||
281 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds | ||
282 | * to remain on the channel. This command is also used as an event to | ||
283 | * notify when the requested duration starts (it may take a while for the | ||
284 | * driver to schedule this time due to other concurrent needs for the | ||
285 | * radio). | ||
286 | * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) | ||
287 | * that will be included with any events pertaining to this request; | ||
288 | * the cookie is also used to cancel the request. | ||
289 | * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a | ||
290 | * pending remain-on-channel duration if the desired operation has been | ||
291 | * completed prior to expiration of the originally requested duration. | ||
292 | * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the | ||
293 | * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to | ||
294 | * uniquely identify the request. | ||
295 | * This command is also used as an event to notify when a requested | ||
296 | * remain-on-channel duration has expired. | ||
297 | * | ||
298 | * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX | ||
299 | * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface | ||
300 | * and @NL80211_ATTR_TX_RATES the set of allowed rates. | ||
301 | * | ||
302 | * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames | ||
303 | * (via @NL80211_CMD_ACTION) for processing in userspace. This command | ||
304 | * requires an interface index and a match attribute containing the first | ||
305 | * few bytes of the frame that should match, e.g. a single byte for only | ||
306 | * a category match or four bytes for vendor frames including the OUI. | ||
307 | * The registration cannot be dropped, but is removed automatically | ||
308 | * when the netlink socket is closed. Multiple registrations can be made. | ||
309 | * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This | ||
310 | * command is used both as a request to transmit an Action frame and as an | ||
311 | * event indicating reception of an Action frame that was not processed in | ||
312 | * kernel code, but is for us (i.e., which may need to be processed in a | ||
313 | * user space application). %NL80211_ATTR_FRAME is used to specify the | ||
314 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | ||
315 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | ||
316 | * which channel the frame is to be transmitted or was received. This | ||
317 | * channel has to be the current channel (remain-on-channel or the | ||
318 | * operational channel). When called, this operation returns a cookie | ||
319 | * (%NL80211_ATTR_COOKIE) that will be included with the TX status event | ||
320 | * pertaining to the TX request. | ||
321 | * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame | ||
322 | * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies | ||
323 | * the TX command and %NL80211_ATTR_FRAME includes the contents of the | ||
324 | * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged | ||
325 | * the frame. | ||
326 | * | ||
273 | * @NL80211_CMD_MAX: highest used command number | 327 | * @NL80211_CMD_MAX: highest used command number |
274 | * @__NL80211_CMD_AFTER_LAST: internal use | 328 | * @__NL80211_CMD_AFTER_LAST: internal use |
275 | */ | 329 | */ |
@@ -353,6 +407,18 @@ enum nl80211_commands { | |||
353 | NL80211_CMD_DEL_PMKSA, | 407 | NL80211_CMD_DEL_PMKSA, |
354 | NL80211_CMD_FLUSH_PMKSA, | 408 | NL80211_CMD_FLUSH_PMKSA, |
355 | 409 | ||
410 | NL80211_CMD_REMAIN_ON_CHANNEL, | ||
411 | NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, | ||
412 | |||
413 | NL80211_CMD_SET_TX_BITRATE_MASK, | ||
414 | |||
415 | NL80211_CMD_REGISTER_ACTION, | ||
416 | NL80211_CMD_ACTION, | ||
417 | NL80211_CMD_ACTION_TX_STATUS, | ||
418 | |||
419 | NL80211_CMD_SET_POWER_SAVE, | ||
420 | NL80211_CMD_GET_POWER_SAVE, | ||
421 | |||
356 | /* add new commands above here */ | 422 | /* add new commands above here */ |
357 | 423 | ||
358 | /* used to define NL80211_CMD_MAX below */ | 424 | /* used to define NL80211_CMD_MAX below */ |
@@ -402,6 +468,8 @@ enum nl80211_commands { | |||
402 | * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length | 468 | * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length |
403 | * larger than or equal to this use RTS/CTS handshake); allowed range: | 469 | * larger than or equal to this use RTS/CTS handshake); allowed range: |
404 | * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 | 470 | * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 |
471 | * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11 | ||
472 | * section 7.3.2.9; dot11CoverageClass; u8 | ||
405 | * | 473 | * |
406 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on | 474 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on |
407 | * @NL80211_ATTR_IFNAME: network interface name | 475 | * @NL80211_ATTR_IFNAME: network interface name |
@@ -606,6 +674,23 @@ enum nl80211_commands { | |||
606 | * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can | 674 | * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can |
607 | * cache, a wiphy attribute. | 675 | * cache, a wiphy attribute. |
608 | * | 676 | * |
677 | * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. | ||
678 | * | ||
679 | * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. | ||
680 | * | ||
681 | * @NL80211_ATTR_TX_RATES: Nested set of attributes | ||
682 | * (enum nl80211_tx_rate_attributes) describing TX rates per band. The | ||
683 | * enum nl80211_band value is used as the index (nla_type() of the nested | ||
684 | * data. If a band is not included, it will be configured to allow all | ||
685 | * rates based on negotiated supported rates information. This attribute | ||
686 | * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. | ||
687 | * | ||
688 | * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain | ||
689 | * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. | ||
690 | * | ||
691 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was | ||
692 | * acknowledged by the recipient. | ||
693 | * | ||
609 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 694 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
610 | * @__NL80211_ATTR_AFTER_LAST: internal use | 695 | * @__NL80211_ATTR_AFTER_LAST: internal use |
611 | */ | 696 | */ |
@@ -743,6 +828,20 @@ enum nl80211_attrs { | |||
743 | NL80211_ATTR_PMKID, | 828 | NL80211_ATTR_PMKID, |
744 | NL80211_ATTR_MAX_NUM_PMKIDS, | 829 | NL80211_ATTR_MAX_NUM_PMKIDS, |
745 | 830 | ||
831 | NL80211_ATTR_DURATION, | ||
832 | |||
833 | NL80211_ATTR_COOKIE, | ||
834 | |||
835 | NL80211_ATTR_WIPHY_COVERAGE_CLASS, | ||
836 | |||
837 | NL80211_ATTR_TX_RATES, | ||
838 | |||
839 | NL80211_ATTR_FRAME_MATCH, | ||
840 | |||
841 | NL80211_ATTR_ACK, | ||
842 | |||
843 | NL80211_ATTR_PS_STATE, | ||
844 | |||
746 | /* add attributes here, update the policy in nl80211.c */ | 845 | /* add attributes here, update the policy in nl80211.c */ |
747 | 846 | ||
748 | __NL80211_ATTR_AFTER_LAST, | 847 | __NL80211_ATTR_AFTER_LAST, |
@@ -1323,13 +1422,20 @@ enum nl80211_channel_type { | |||
1323 | * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) | 1422 | * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) |
1324 | * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) | 1423 | * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) |
1325 | * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the | 1424 | * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the |
1326 | * raw information elements from the probe response/beacon (bin) | 1425 | * raw information elements from the probe response/beacon (bin); |
1426 | * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are | ||
1427 | * from a Probe Response frame; otherwise they are from a Beacon frame. | ||
1428 | * However, if the driver does not indicate the source of the IEs, these | ||
1429 | * IEs may be from either frame subtype. | ||
1327 | * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon | 1430 | * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon |
1328 | * in mBm (100 * dBm) (s32) | 1431 | * in mBm (100 * dBm) (s32) |
1329 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon | 1432 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon |
1330 | * in unspecified units, scaled to 0..100 (u8) | 1433 | * in unspecified units, scaled to 0..100 (u8) |
1331 | * @NL80211_BSS_STATUS: status, if this BSS is "used" | 1434 | * @NL80211_BSS_STATUS: status, if this BSS is "used" |
1332 | * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms | 1435 | * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms |
1436 | * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information | ||
1437 | * elements from a Beacon frame (bin); not present if no Beacon frame has | ||
1438 | * yet been received | ||
1333 | * @__NL80211_BSS_AFTER_LAST: internal | 1439 | * @__NL80211_BSS_AFTER_LAST: internal |
1334 | * @NL80211_BSS_MAX: highest BSS attribute | 1440 | * @NL80211_BSS_MAX: highest BSS attribute |
1335 | */ | 1441 | */ |
@@ -1345,6 +1451,7 @@ enum nl80211_bss { | |||
1345 | NL80211_BSS_SIGNAL_UNSPEC, | 1451 | NL80211_BSS_SIGNAL_UNSPEC, |
1346 | NL80211_BSS_STATUS, | 1452 | NL80211_BSS_STATUS, |
1347 | NL80211_BSS_SEEN_MS_AGO, | 1453 | NL80211_BSS_SEEN_MS_AGO, |
1454 | NL80211_BSS_BEACON_IES, | ||
1348 | 1455 | ||
1349 | /* keep last */ | 1456 | /* keep last */ |
1350 | __NL80211_BSS_AFTER_LAST, | 1457 | __NL80211_BSS_AFTER_LAST, |
@@ -1442,4 +1549,38 @@ enum nl80211_key_attributes { | |||
1442 | NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 | 1549 | NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 |
1443 | }; | 1550 | }; |
1444 | 1551 | ||
1552 | /** | ||
1553 | * enum nl80211_tx_rate_attributes - TX rate set attributes | ||
1554 | * @__NL80211_TXRATE_INVALID: invalid | ||
1555 | * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection | ||
1556 | * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with | ||
1557 | * 1 = 500 kbps) but without the IE length restriction (at most | ||
1558 | * %NL80211_MAX_SUPP_RATES in a single array). | ||
1559 | * @__NL80211_TXRATE_AFTER_LAST: internal | ||
1560 | * @NL80211_TXRATE_MAX: highest TX rate attribute | ||
1561 | */ | ||
1562 | enum nl80211_tx_rate_attributes { | ||
1563 | __NL80211_TXRATE_INVALID, | ||
1564 | NL80211_TXRATE_LEGACY, | ||
1565 | |||
1566 | /* keep last */ | ||
1567 | __NL80211_TXRATE_AFTER_LAST, | ||
1568 | NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 | ||
1569 | }; | ||
1570 | |||
1571 | /** | ||
1572 | * enum nl80211_band - Frequency band | ||
1573 | * @NL80211_BAND_2GHZ - 2.4 GHz ISM band | ||
1574 | * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz) | ||
1575 | */ | ||
1576 | enum nl80211_band { | ||
1577 | NL80211_BAND_2GHZ, | ||
1578 | NL80211_BAND_5GHZ, | ||
1579 | }; | ||
1580 | |||
1581 | enum nl80211_ps_state { | ||
1582 | NL80211_PS_DISABLED, | ||
1583 | NL80211_PS_ENABLED, | ||
1584 | }; | ||
1585 | |||
1445 | #endif /* __LINUX_NL80211_H */ | 1586 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 25813738c71a..ec95ebe629f1 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -662,6 +662,9 @@ extern void pci_remove_bus_device(struct pci_dev *dev); | |||
662 | extern void pci_stop_bus_device(struct pci_dev *dev); | 662 | extern void pci_stop_bus_device(struct pci_dev *dev); |
663 | void pci_setup_cardbus(struct pci_bus *bus); | 663 | void pci_setup_cardbus(struct pci_bus *bus); |
664 | extern void pci_sort_breadthfirst(void); | 664 | extern void pci_sort_breadthfirst(void); |
665 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | ||
666 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) | ||
667 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) | ||
665 | 668 | ||
666 | /* Generic PCI functions exported to card drivers */ | 669 | /* Generic PCI functions exported to card drivers */ |
667 | 670 | ||
@@ -1195,6 +1198,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | |||
1195 | unsigned int devfn) | 1198 | unsigned int devfn) |
1196 | { return NULL; } | 1199 | { return NULL; } |
1197 | 1200 | ||
1201 | #define dev_is_pci(d) (false) | ||
1202 | #define dev_is_pf(d) (false) | ||
1203 | #define dev_num_vf(d) (0) | ||
1198 | #endif /* CONFIG_PCI */ | 1204 | #endif /* CONFIG_PCI */ |
1199 | 1205 | ||
1200 | /* Include architecture-dependent settings and functions */ | 1206 | /* Include architecture-dependent settings and functions */ |
@@ -1356,6 +1362,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | |||
1356 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1362 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
1357 | extern void pci_disable_sriov(struct pci_dev *dev); | 1363 | extern void pci_disable_sriov(struct pci_dev *dev); |
1358 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); | 1364 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); |
1365 | extern int pci_num_vf(struct pci_dev *dev); | ||
1359 | #else | 1366 | #else |
1360 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1367 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
1361 | { | 1368 | { |
@@ -1368,6 +1375,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | |||
1368 | { | 1375 | { |
1369 | return IRQ_NONE; | 1376 | return IRQ_NONE; |
1370 | } | 1377 | } |
1378 | static inline int pci_num_vf(struct pci_dev *dev) | ||
1379 | { | ||
1380 | return 0; | ||
1381 | } | ||
1371 | #endif | 1382 | #endif |
1372 | 1383 | ||
1373 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1384 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
@@ -1404,5 +1415,93 @@ static inline bool pci_is_pcie(struct pci_dev *dev) | |||
1404 | 1415 | ||
1405 | void pci_request_acs(void); | 1416 | void pci_request_acs(void); |
1406 | 1417 | ||
1418 | |||
1419 | #define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ | ||
1420 | #define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) | ||
1421 | |||
1422 | /* Large Resource Data Type Tag Item Names */ | ||
1423 | #define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */ | ||
1424 | #define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */ | ||
1425 | #define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */ | ||
1426 | |||
1427 | #define PCI_VPD_LRDT_ID_STRING PCI_VPD_LRDT_ID(PCI_VPD_LTIN_ID_STRING) | ||
1428 | #define PCI_VPD_LRDT_RO_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RO_DATA) | ||
1429 | #define PCI_VPD_LRDT_RW_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RW_DATA) | ||
1430 | |||
1431 | /* Small Resource Data Type Tag Item Names */ | ||
1432 | #define PCI_VPD_STIN_END 0x78 /* End */ | ||
1433 | |||
1434 | #define PCI_VPD_SRDT_END PCI_VPD_STIN_END | ||
1435 | |||
1436 | #define PCI_VPD_SRDT_TIN_MASK 0x78 | ||
1437 | #define PCI_VPD_SRDT_LEN_MASK 0x07 | ||
1438 | |||
1439 | #define PCI_VPD_LRDT_TAG_SIZE 3 | ||
1440 | #define PCI_VPD_SRDT_TAG_SIZE 1 | ||
1441 | |||
1442 | #define PCI_VPD_INFO_FLD_HDR_SIZE 3 | ||
1443 | |||
1444 | #define PCI_VPD_RO_KEYWORD_PARTNO "PN" | ||
1445 | #define PCI_VPD_RO_KEYWORD_MFR_ID "MN" | ||
1446 | #define PCI_VPD_RO_KEYWORD_VENDOR0 "V0" | ||
1447 | |||
1448 | /** | ||
1449 | * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length | ||
1450 | * @lrdt: Pointer to the beginning of the Large Resource Data Type tag | ||
1451 | * | ||
1452 | * Returns the extracted Large Resource Data Type length. | ||
1453 | */ | ||
1454 | static inline u16 pci_vpd_lrdt_size(const u8 *lrdt) | ||
1455 | { | ||
1456 | return (u16)lrdt[1] + ((u16)lrdt[2] << 8); | ||
1457 | } | ||
1458 | |||
1459 | /** | ||
1460 | * pci_vpd_srdt_size - Extracts the Small Resource Data Type length | ||
1461 | * @lrdt: Pointer to the beginning of the Small Resource Data Type tag | ||
1462 | * | ||
1463 | * Returns the extracted Small Resource Data Type length. | ||
1464 | */ | ||
1465 | static inline u8 pci_vpd_srdt_size(const u8 *srdt) | ||
1466 | { | ||
1467 | return (*srdt) & PCI_VPD_SRDT_LEN_MASK; | ||
1468 | } | ||
1469 | |||
1470 | /** | ||
1471 | * pci_vpd_info_field_size - Extracts the information field length | ||
1472 | * @lrdt: Pointer to the beginning of an information field header | ||
1473 | * | ||
1474 | * Returns the extracted information field length. | ||
1475 | */ | ||
1476 | static inline u8 pci_vpd_info_field_size(const u8 *info_field) | ||
1477 | { | ||
1478 | return info_field[2]; | ||
1479 | } | ||
1480 | |||
1481 | /** | ||
1482 | * pci_vpd_find_tag - Locates the Resource Data Type tag provided | ||
1483 | * @buf: Pointer to buffered vpd data | ||
1484 | * @off: The offset into the buffer at which to begin the search | ||
1485 | * @len: The length of the vpd buffer | ||
1486 | * @rdt: The Resource Data Type to search for | ||
1487 | * | ||
1488 | * Returns the index where the Resource Data Type was found or | ||
1489 | * -ENOENT otherwise. | ||
1490 | */ | ||
1491 | int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); | ||
1492 | |||
1493 | /** | ||
1494 | * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD | ||
1495 | * @buf: Pointer to buffered vpd data | ||
1496 | * @off: The offset into the buffer at which to begin the search | ||
1497 | * @len: The length of the buffer area, relative to off, in which to search | ||
1498 | * @kw: The keyword to search for | ||
1499 | * | ||
1500 | * Returns the index where the information field keyword was found or | ||
1501 | * -ENOENT otherwise. | ||
1502 | */ | ||
1503 | int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | ||
1504 | unsigned int len, const char *kw); | ||
1505 | |||
1407 | #endif /* __KERNEL__ */ | 1506 | #endif /* __KERNEL__ */ |
1408 | #endif /* LINUX_PCI_H */ | 1507 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 6a7eb402165d..14d7fdf6a90a 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -452,6 +452,7 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | |||
452 | u32 flags, phy_interface_t interface); | 452 | u32 flags, phy_interface_t interface); |
453 | struct phy_device * phy_attach(struct net_device *dev, | 453 | struct phy_device * phy_attach(struct net_device *dev, |
454 | const char *bus_id, u32 flags, phy_interface_t interface); | 454 | const char *bus_id, u32 flags, phy_interface_t interface); |
455 | struct phy_device *phy_find_first(struct mii_bus *bus); | ||
455 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, | 456 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, |
456 | void (*handler)(struct net_device *), u32 flags, | 457 | void (*handler)(struct net_device *), u32 flags, |
457 | phy_interface_t interface); | 458 | phy_interface_t interface); |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 779d70749beb..2c9b46cff3d7 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -406,6 +406,11 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
406 | n->next->pprev = &n->next; | 406 | n->next->pprev = &n->next; |
407 | } | 407 | } |
408 | 408 | ||
409 | #define __hlist_for_each_rcu(pos, head) \ | ||
410 | for (pos = rcu_dereference((head)->first); \ | ||
411 | pos && ({ prefetch(pos->next); 1; }); \ | ||
412 | pos = rcu_dereference(pos->next)) | ||
413 | |||
409 | /** | 414 | /** |
410 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 415 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
411 | * @tpos: the type * to use as a loop cursor. | 416 | * @tpos: the type * to use as a loop cursor. |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 5c52fa43785c..d1c7c90e9cd4 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -362,6 +362,8 @@ enum { | |||
362 | #define RTAX_FEATURES RTAX_FEATURES | 362 | #define RTAX_FEATURES RTAX_FEATURES |
363 | RTAX_RTO_MIN, | 363 | RTAX_RTO_MIN, |
364 | #define RTAX_RTO_MIN RTAX_RTO_MIN | 364 | #define RTAX_RTO_MIN RTAX_RTO_MIN |
365 | RTAX_INITRWND, | ||
366 | #define RTAX_INITRWND RTAX_INITRWND | ||
365 | __RTAX_MAX | 367 | __RTAX_MAX |
366 | }; | 368 | }; |
367 | 369 | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 8366d8f12e53..03c0232b4169 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -135,4 +135,22 @@ extern struct list_head *seq_list_start_head(struct list_head *head, | |||
135 | extern struct list_head *seq_list_next(void *v, struct list_head *head, | 135 | extern struct list_head *seq_list_next(void *v, struct list_head *head, |
136 | loff_t *ppos); | 136 | loff_t *ppos); |
137 | 137 | ||
138 | /* | ||
139 | * Helpers for iteration over hlist_head-s in seq_files | ||
140 | */ | ||
141 | |||
142 | extern struct hlist_node *seq_hlist_start(struct hlist_head *head, | ||
143 | loff_t pos); | ||
144 | extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head, | ||
145 | loff_t pos); | ||
146 | extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head, | ||
147 | loff_t *ppos); | ||
148 | |||
149 | extern struct hlist_node *seq_hlist_start_rcu(struct hlist_head *head, | ||
150 | loff_t pos); | ||
151 | extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head, | ||
152 | loff_t pos); | ||
153 | extern struct hlist_node *seq_hlist_next_rcu(void *v, | ||
154 | struct hlist_head *head, | ||
155 | loff_t *ppos); | ||
138 | #endif | 156 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ae836fded530..03f816a9b659 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -315,22 +315,23 @@ struct sk_buff { | |||
315 | struct sk_buff *next; | 315 | struct sk_buff *next; |
316 | struct sk_buff *prev; | 316 | struct sk_buff *prev; |
317 | 317 | ||
318 | struct sock *sk; | ||
319 | ktime_t tstamp; | 318 | ktime_t tstamp; |
319 | |||
320 | struct sock *sk; | ||
320 | struct net_device *dev; | 321 | struct net_device *dev; |
321 | 322 | ||
322 | unsigned long _skb_dst; | ||
323 | #ifdef CONFIG_XFRM | ||
324 | struct sec_path *sp; | ||
325 | #endif | ||
326 | /* | 323 | /* |
327 | * This is the control buffer. It is free to use for every | 324 | * This is the control buffer. It is free to use for every |
328 | * layer. Please put your private variables there. If you | 325 | * layer. Please put your private variables there. If you |
329 | * want to keep them across layers you have to do a skb_clone() | 326 | * want to keep them across layers you have to do a skb_clone() |
330 | * first. This is owned by whoever has the skb queued ATM. | 327 | * first. This is owned by whoever has the skb queued ATM. |
331 | */ | 328 | */ |
332 | char cb[48]; | 329 | char cb[48] __aligned(8); |
333 | 330 | ||
331 | unsigned long _skb_dst; | ||
332 | #ifdef CONFIG_XFRM | ||
333 | struct sec_path *sp; | ||
334 | #endif | ||
334 | unsigned int len, | 335 | unsigned int len, |
335 | data_len; | 336 | data_len; |
336 | __u16 mac_len, | 337 | __u16 mac_len, |
@@ -354,8 +355,8 @@ struct sk_buff { | |||
354 | ipvs_property:1, | 355 | ipvs_property:1, |
355 | peeked:1, | 356 | peeked:1, |
356 | nf_trace:1; | 357 | nf_trace:1; |
357 | __be16 protocol:16; | ||
358 | kmemcheck_bitfield_end(flags1); | 358 | kmemcheck_bitfield_end(flags1); |
359 | __be16 protocol; | ||
359 | 360 | ||
360 | void (*destructor)(struct sk_buff *skb); | 361 | void (*destructor)(struct sk_buff *skb); |
361 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 362 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
@@ -738,7 +739,7 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | |||
738 | } | 739 | } |
739 | 740 | ||
740 | /** | 741 | /** |
741 | * skb_peek | 742 | * skb_peek - peek at the head of an &sk_buff_head |
742 | * @list_: list to peek at | 743 | * @list_: list to peek at |
743 | * | 744 | * |
744 | * Peek an &sk_buff. Unlike most other operations you _MUST_ | 745 | * Peek an &sk_buff. Unlike most other operations you _MUST_ |
@@ -759,7 +760,7 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) | |||
759 | } | 760 | } |
760 | 761 | ||
761 | /** | 762 | /** |
762 | * skb_peek_tail | 763 | * skb_peek_tail - peek at the tail of an &sk_buff_head |
763 | * @list_: list to peek at | 764 | * @list_: list to peek at |
764 | * | 765 | * |
765 | * Peek an &sk_buff. Unlike most other operations you _MUST_ | 766 | * Peek an &sk_buff. Unlike most other operations you _MUST_ |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 0f953fe40413..e28f5a0182e8 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -257,6 +257,7 @@ enum | |||
257 | LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ | 257 | LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ |
258 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ | 258 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ |
259 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ | 259 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ |
260 | LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ | ||
260 | __LINUX_MIB_XFRMMAX | 261 | __LINUX_MIB_XFRMMAX |
261 | }; | 262 | }; |
262 | 263 | ||
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h new file mode 100644 index 000000000000..32bfd1a8a48d --- /dev/null +++ b/include/linux/stmmac.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /******************************************************************************* | ||
2 | |||
3 | Header file for stmmac platform data | ||
4 | |||
5 | Copyright (C) 2009 STMicroelectronics Ltd | ||
6 | |||
7 | This program is free software; you can redistribute it and/or modify it | ||
8 | under the terms and conditions of the GNU General Public License, | ||
9 | version 2, as published by the Free Software Foundation. | ||
10 | |||
11 | This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | more details. | ||
15 | |||
16 | You should have received a copy of the GNU General Public License along with | ||
17 | this program; if not, write to the Free Software Foundation, Inc., | ||
18 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
19 | |||
20 | The full GNU General Public License is included in this distribution in | ||
21 | the file called "COPYING". | ||
22 | |||
23 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | ||
24 | *******************************************************************************/ | ||
25 | |||
26 | #ifndef __STMMAC_PLATFORM_DATA | ||
27 | #define __STMMAC_PLATFORM_DATA | ||
28 | |||
29 | /* platfrom data for platfrom device structure's platfrom_data field */ | ||
30 | |||
31 | /* Private data for the STM on-board ethernet driver */ | ||
32 | struct plat_stmmacenet_data { | ||
33 | int bus_id; | ||
34 | int pbl; | ||
35 | int has_gmac; | ||
36 | void (*fix_mac_speed)(void *priv, unsigned int speed); | ||
37 | void (*bus_setup)(unsigned long ioaddr); | ||
38 | #ifdef CONFIG_STM_DRIVERS | ||
39 | struct stm_pad_config *pad_config; | ||
40 | #endif | ||
41 | void *bsp_priv; | ||
42 | }; | ||
43 | |||
44 | struct plat_stmmacphy_data { | ||
45 | int bus_id; | ||
46 | int phy_addr; | ||
47 | unsigned int phy_mask; | ||
48 | int interface; | ||
49 | int (*phy_reset)(void *priv); | ||
50 | void *priv; | ||
51 | }; | ||
52 | #endif | ||
53 | |||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index bd27fbc9db62..f66014c90c9f 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -481,9 +481,6 @@ enum | |||
481 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | 481 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, |
482 | NET_IPV4_CONF_ARP_ACCEPT=21, | 482 | NET_IPV4_CONF_ARP_ACCEPT=21, |
483 | NET_IPV4_CONF_ARP_NOTIFY=22, | 483 | NET_IPV4_CONF_ARP_NOTIFY=22, |
484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, | ||
485 | NET_IPV4_CONF_SRC_VMARK=24, | ||
486 | __NET_IPV4_CONF_MAX | ||
487 | }; | 484 | }; |
488 | 485 | ||
489 | /* /proc/sys/net/ipv4/netfilter */ | 486 | /* /proc/sys/net/ipv4/netfilter */ |
@@ -599,7 +596,6 @@ enum { | |||
599 | NET_NEIGH_GC_THRESH3=16, | 596 | NET_NEIGH_GC_THRESH3=16, |
600 | NET_NEIGH_RETRANS_TIME_MS=17, | 597 | NET_NEIGH_RETRANS_TIME_MS=17, |
601 | NET_NEIGH_REACHABLE_TIME_MS=18, | 598 | NET_NEIGH_REACHABLE_TIME_MS=18, |
602 | __NET_NEIGH_MAX | ||
603 | }; | 599 | }; |
604 | 600 | ||
605 | /* /proc/sys/net/dccp */ | 601 | /* /proc/sys/net/dccp */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 7fee8a4df931..a778ee024590 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -103,6 +103,8 @@ enum { | |||
103 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ | 103 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ |
104 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ | 104 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ |
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*/ | ||
107 | #define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ | ||
106 | 108 | ||
107 | /* for TCP_INFO socket option */ | 109 | /* for TCP_INFO socket option */ |
108 | #define TCPI_OPT_TIMESTAMPS 1 | 110 | #define TCPI_OPT_TIMESTAMPS 1 |
@@ -340,7 +342,10 @@ struct tcp_sock { | |||
340 | u32 frto_highmark; /* snd_nxt when RTO occurred */ | 342 | u32 frto_highmark; /* snd_nxt when RTO occurred */ |
341 | u16 advmss; /* Advertised MSS */ | 343 | u16 advmss; /* Advertised MSS */ |
342 | u8 frto_counter; /* Number of new acks after RTO */ | 344 | u8 frto_counter; /* Number of new acks after RTO */ |
343 | u8 nonagle; /* Disable Nagle algorithm? */ | 345 | u8 nonagle : 4,/* Disable Nagle algorithm? */ |
346 | thin_lto : 1,/* Use linear timeouts for thin streams */ | ||
347 | thin_dupack : 1,/* Fast retransmit on first dupack */ | ||
348 | unused : 2; | ||
344 | 349 | ||
345 | /* RTT measurement */ | 350 | /* RTT measurement */ |
346 | u32 srtt; /* smoothed round trip time << 3 */ | 351 | u32 srtt; /* smoothed round trip time << 3 */ |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 8ce61359bf73..df1e83dd9a54 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32); | |||
214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); | 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); |
215 | extern int usbnet_nway_reset(struct net_device *net); | 215 | extern int usbnet_nway_reset(struct net_device *net); |
216 | 216 | ||
217 | /* messaging support includes the interface name, so it must not be | ||
218 | * used before it has one ... notably, in minidriver bind() calls. | ||
219 | */ | ||
220 | #ifdef DEBUG | ||
221 | #define devdbg(usbnet, fmt, arg...) \ | ||
222 | printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
223 | #else | ||
224 | #define devdbg(usbnet, fmt, arg...) \ | ||
225 | ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \ | ||
226 | ## arg); 0; }) | ||
227 | #endif | ||
228 | |||
229 | #define deverr(usbnet, fmt, arg...) \ | ||
230 | printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
231 | #define devwarn(usbnet, fmt, arg...) \ | ||
232 | printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
233 | |||
234 | #define devinfo(usbnet, fmt, arg...) \ | ||
235 | printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \ | ||
236 | |||
237 | |||
238 | #endif /* __LINUX_USB_USBNET_H */ | 217 | #endif /* __LINUX_USB_USBNET_H */ |
diff --git a/include/linux/vhost.h b/include/linux/vhost.h new file mode 100644 index 000000000000..e847f1e30756 --- /dev/null +++ b/include/linux/vhost.h | |||
@@ -0,0 +1,130 @@ | |||
1 | #ifndef _LINUX_VHOST_H | ||
2 | #define _LINUX_VHOST_H | ||
3 | /* Userspace interface for in-kernel virtio accelerators. */ | ||
4 | |||
5 | /* vhost is used to reduce the number of system calls involved in virtio. | ||
6 | * | ||
7 | * Existing virtio net code is used in the guest without modification. | ||
8 | * | ||
9 | * This header includes interface used by userspace hypervisor for | ||
10 | * device configuration. | ||
11 | */ | ||
12 | |||
13 | #include <linux/types.h> | ||
14 | #include <linux/compiler.h> | ||
15 | #include <linux/ioctl.h> | ||
16 | #include <linux/virtio_config.h> | ||
17 | #include <linux/virtio_ring.h> | ||
18 | |||
19 | struct vhost_vring_state { | ||
20 | unsigned int index; | ||
21 | unsigned int num; | ||
22 | }; | ||
23 | |||
24 | struct vhost_vring_file { | ||
25 | unsigned int index; | ||
26 | int fd; /* Pass -1 to unbind from file. */ | ||
27 | |||
28 | }; | ||
29 | |||
30 | struct vhost_vring_addr { | ||
31 | unsigned int index; | ||
32 | /* Option flags. */ | ||
33 | unsigned int flags; | ||
34 | /* Flag values: */ | ||
35 | /* Whether log address is valid. If set enables logging. */ | ||
36 | #define VHOST_VRING_F_LOG 0 | ||
37 | |||
38 | /* Start of array of descriptors (virtually contiguous) */ | ||
39 | __u64 desc_user_addr; | ||
40 | /* Used structure address. Must be 32 bit aligned */ | ||
41 | __u64 used_user_addr; | ||
42 | /* Available structure address. Must be 16 bit aligned */ | ||
43 | __u64 avail_user_addr; | ||
44 | /* Logging support. */ | ||
45 | /* Log writes to used structure, at offset calculated from specified | ||
46 | * address. Address must be 32 bit aligned. */ | ||
47 | __u64 log_guest_addr; | ||
48 | }; | ||
49 | |||
50 | struct vhost_memory_region { | ||
51 | __u64 guest_phys_addr; | ||
52 | __u64 memory_size; /* bytes */ | ||
53 | __u64 userspace_addr; | ||
54 | __u64 flags_padding; /* No flags are currently specified. */ | ||
55 | }; | ||
56 | |||
57 | /* All region addresses and sizes must be 4K aligned. */ | ||
58 | #define VHOST_PAGE_SIZE 0x1000 | ||
59 | |||
60 | struct vhost_memory { | ||
61 | __u32 nregions; | ||
62 | __u32 padding; | ||
63 | struct vhost_memory_region regions[0]; | ||
64 | }; | ||
65 | |||
66 | /* ioctls */ | ||
67 | |||
68 | #define VHOST_VIRTIO 0xAF | ||
69 | |||
70 | /* Features bitmask for forward compatibility. Transport bits are used for | ||
71 | * vhost specific features. */ | ||
72 | #define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64) | ||
73 | #define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64) | ||
74 | |||
75 | /* Set current process as the (exclusive) owner of this file descriptor. This | ||
76 | * must be called before any other vhost command. Further calls to | ||
77 | * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */ | ||
78 | #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01) | ||
79 | /* Give up ownership, and reset the device to default values. | ||
80 | * Allows subsequent call to VHOST_OWNER_SET to succeed. */ | ||
81 | #define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02) | ||
82 | |||
83 | /* Set up/modify memory layout */ | ||
84 | #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory) | ||
85 | |||
86 | /* Write logging setup. */ | ||
87 | /* Memory writes can optionally be logged by setting bit at an offset | ||
88 | * (calculated from the physical address) from specified log base. | ||
89 | * The bit is set using an atomic 32 bit operation. */ | ||
90 | /* Set base address for logging. */ | ||
91 | #define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64) | ||
92 | /* Specify an eventfd file descriptor to signal on log write. */ | ||
93 | #define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int) | ||
94 | |||
95 | /* Ring setup. */ | ||
96 | /* Set number of descriptors in ring. This parameter can not | ||
97 | * be modified while ring is running (bound to a device). */ | ||
98 | #define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state) | ||
99 | /* Set addresses for the ring. */ | ||
100 | #define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr) | ||
101 | /* Base value where queue looks for available descriptors */ | ||
102 | #define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state) | ||
103 | /* Get accessor: reads index, writes value in num */ | ||
104 | #define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state) | ||
105 | |||
106 | /* The following ioctls use eventfd file descriptors to signal and poll | ||
107 | * for events. */ | ||
108 | |||
109 | /* Set eventfd to poll for added buffers */ | ||
110 | #define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file) | ||
111 | /* Set eventfd to signal when buffers have beed used */ | ||
112 | #define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file) | ||
113 | /* Set eventfd to signal an error */ | ||
114 | #define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file) | ||
115 | |||
116 | /* VHOST_NET specific defines */ | ||
117 | |||
118 | /* Attach virtio net ring to a raw socket, or tap device. | ||
119 | * The socket must be already bound to an ethernet device, this device will be | ||
120 | * used for transmit. Pass fd -1 to unbind from the socket and the transmit | ||
121 | * device. This can be used to stop the ring (e.g. for migration). */ | ||
122 | #define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file) | ||
123 | |||
124 | /* Feature bits */ | ||
125 | /* Log all write descriptors. Can be changed while device is active. */ | ||
126 | #define VHOST_F_LOG_ALL 26 | ||
127 | /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */ | ||
128 | #define VHOST_NET_F_VIRTIO_NET_HDR 27 | ||
129 | |||
130 | #endif | ||
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 29e04beb1fc9..b971e3848493 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -267,8 +267,8 @@ enum xfrm_attr_type_t { | |||
267 | XFRMA_ALG_COMP, /* struct xfrm_algo */ | 267 | XFRMA_ALG_COMP, /* struct xfrm_algo */ |
268 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ | 268 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ |
269 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ | 269 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ |
270 | XFRMA_SA, | 270 | XFRMA_SA, /* struct xfrm_usersa_info */ |
271 | XFRMA_POLICY, | 271 | XFRMA_POLICY, /*struct xfrm_userpolicy_info */ |
272 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ | 272 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ |
273 | XFRMA_LTIME_VAL, | 273 | XFRMA_LTIME_VAL, |
274 | XFRMA_REPLAY_VAL, | 274 | XFRMA_REPLAY_VAL, |
@@ -276,17 +276,23 @@ enum xfrm_attr_type_t { | |||
276 | XFRMA_ETIMER_THRESH, | 276 | XFRMA_ETIMER_THRESH, |
277 | XFRMA_SRCADDR, /* xfrm_address_t */ | 277 | XFRMA_SRCADDR, /* xfrm_address_t */ |
278 | XFRMA_COADDR, /* xfrm_address_t */ | 278 | XFRMA_COADDR, /* xfrm_address_t */ |
279 | XFRMA_LASTUSED, | 279 | XFRMA_LASTUSED, /* unsigned long */ |
280 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ | 280 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ |
281 | XFRMA_MIGRATE, | 281 | XFRMA_MIGRATE, |
282 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ | 282 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ |
283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | 283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ |
284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ | 284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ |
285 | XFRMA_MARK, /* struct xfrm_mark */ | ||
285 | __XFRMA_MAX | 286 | __XFRMA_MAX |
286 | 287 | ||
287 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 288 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
288 | }; | 289 | }; |
289 | 290 | ||
291 | struct xfrm_mark { | ||
292 | __u32 v; /* value */ | ||
293 | __u32 m; /* mask */ | ||
294 | }; | ||
295 | |||
290 | enum xfrm_sadattr_type_t { | 296 | enum xfrm_sadattr_type_t { |
291 | XFRMA_SAD_UNSPEC, | 297 | XFRMA_SAD_UNSPEC, |
292 | XFRMA_SAD_CNT, | 298 | XFRMA_SAD_CNT, |