diff options
Diffstat (limited to 'include/net')
64 files changed, 791 insertions, 576 deletions
diff --git a/include/net/ah.h b/include/net/ah.h index ae1c322f4242..f0129f79a31a 100644 --- a/include/net/ah.h +++ b/include/net/ah.h | |||
@@ -1,43 +1,20 @@ | |||
1 | #ifndef _NET_AH_H | 1 | #ifndef _NET_AH_H |
2 | #define _NET_AH_H | 2 | #define _NET_AH_H |
3 | 3 | ||
4 | #include <linux/crypto.h> | 4 | #include <linux/skbuff.h> |
5 | #include <net/xfrm.h> | ||
6 | 5 | ||
7 | /* This is the maximum truncated ICV length that we know of. */ | 6 | /* This is the maximum truncated ICV length that we know of. */ |
8 | #define MAX_AH_AUTH_LEN 12 | 7 | #define MAX_AH_AUTH_LEN 12 |
9 | 8 | ||
10 | struct ah_data | 9 | struct crypto_ahash; |
11 | { | 10 | |
12 | u8 *work_icv; | 11 | struct ah_data { |
13 | int icv_full_len; | 12 | int icv_full_len; |
14 | int icv_trunc_len; | 13 | int icv_trunc_len; |
15 | 14 | ||
16 | struct crypto_hash *tfm; | 15 | struct crypto_ahash *ahash; |
17 | }; | 16 | }; |
18 | 17 | ||
19 | static inline int ah_mac_digest(struct ah_data *ahp, struct sk_buff *skb, | ||
20 | u8 *auth_data) | ||
21 | { | ||
22 | struct hash_desc desc; | ||
23 | int err; | ||
24 | |||
25 | desc.tfm = ahp->tfm; | ||
26 | desc.flags = 0; | ||
27 | |||
28 | memset(auth_data, 0, ahp->icv_trunc_len); | ||
29 | err = crypto_hash_init(&desc); | ||
30 | if (unlikely(err)) | ||
31 | goto out; | ||
32 | err = skb_icv_walk(skb, &desc, 0, skb->len, crypto_hash_update); | ||
33 | if (unlikely(err)) | ||
34 | goto out; | ||
35 | err = crypto_hash_final(&desc, ahp->work_icv); | ||
36 | |||
37 | out: | ||
38 | return err; | ||
39 | } | ||
40 | |||
41 | struct ip_auth_hdr; | 18 | struct ip_auth_hdr; |
42 | 19 | ||
43 | static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb) | 20 | static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb) |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 718394e2c01e..04a6908e38d2 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -121,7 +121,7 @@ struct bt_sock_list { | |||
121 | rwlock_t lock; | 121 | rwlock_t lock; |
122 | }; | 122 | }; |
123 | 123 | ||
124 | int bt_sock_register(int proto, struct net_proto_family *ops); | 124 | int bt_sock_register(int proto, const struct net_proto_family *ops); |
125 | int bt_sock_unregister(int proto); | 125 | int bt_sock_unregister(int proto); |
126 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); | 126 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); |
127 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); | 127 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3d874c620219..a6492e9bca97 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -206,10 +206,12 @@ struct ieee80211_supported_band { | |||
206 | * struct vif_params - describes virtual interface parameters | 206 | * struct vif_params - describes virtual interface parameters |
207 | * @mesh_id: mesh ID to use | 207 | * @mesh_id: mesh ID to use |
208 | * @mesh_id_len: length of the mesh ID | 208 | * @mesh_id_len: length of the mesh ID |
209 | * @use_4addr: use 4-address frames | ||
209 | */ | 210 | */ |
210 | struct vif_params { | 211 | struct vif_params { |
211 | u8 *mesh_id; | 212 | u8 *mesh_id; |
212 | int mesh_id_len; | 213 | int mesh_id_len; |
214 | int use_4addr; | ||
213 | }; | 215 | }; |
214 | 216 | ||
215 | /** | 217 | /** |
@@ -233,6 +235,35 @@ struct key_params { | |||
233 | }; | 235 | }; |
234 | 236 | ||
235 | /** | 237 | /** |
238 | * enum survey_info_flags - survey information flags | ||
239 | * | ||
240 | * Used by the driver to indicate which info in &struct survey_info | ||
241 | * it has filled in during the get_survey(). | ||
242 | */ | ||
243 | enum survey_info_flags { | ||
244 | SURVEY_INFO_NOISE_DBM = 1<<0, | ||
245 | }; | ||
246 | |||
247 | /** | ||
248 | * struct survey_info - channel survey response | ||
249 | * | ||
250 | * Used by dump_survey() to report back per-channel survey information. | ||
251 | * | ||
252 | * @channel: the channel this survey record reports, mandatory | ||
253 | * @filled: bitflag of flags from &enum survey_info_flags | ||
254 | * @noise: channel noise in dBm. This and all following fields are | ||
255 | * optional | ||
256 | * | ||
257 | * This structure can later be expanded with things like | ||
258 | * channel duty cycle etc. | ||
259 | */ | ||
260 | struct survey_info { | ||
261 | struct ieee80211_channel *channel; | ||
262 | u32 filled; | ||
263 | s8 noise; | ||
264 | }; | ||
265 | |||
266 | /** | ||
236 | * struct beacon_parameters - beacon parameters | 267 | * struct beacon_parameters - beacon parameters |
237 | * | 268 | * |
238 | * Used to configure the beacon for an interface. | 269 | * Used to configure the beacon for an interface. |
@@ -418,7 +449,7 @@ enum monitor_flags { | |||
418 | * in during get_station() or dump_station(). | 449 | * in during get_station() or dump_station(). |
419 | * | 450 | * |
420 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled | 451 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled |
421 | * MPATH_INFO_DSN: @dsn filled | 452 | * MPATH_INFO_SN: @sn filled |
422 | * MPATH_INFO_METRIC: @metric filled | 453 | * MPATH_INFO_METRIC: @metric filled |
423 | * MPATH_INFO_EXPTIME: @exptime filled | 454 | * MPATH_INFO_EXPTIME: @exptime filled |
424 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled | 455 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled |
@@ -427,7 +458,7 @@ enum monitor_flags { | |||
427 | */ | 458 | */ |
428 | enum mpath_info_flags { | 459 | enum mpath_info_flags { |
429 | MPATH_INFO_FRAME_QLEN = BIT(0), | 460 | MPATH_INFO_FRAME_QLEN = BIT(0), |
430 | MPATH_INFO_DSN = BIT(1), | 461 | MPATH_INFO_SN = BIT(1), |
431 | MPATH_INFO_METRIC = BIT(2), | 462 | MPATH_INFO_METRIC = BIT(2), |
432 | MPATH_INFO_EXPTIME = BIT(3), | 463 | MPATH_INFO_EXPTIME = BIT(3), |
433 | MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), | 464 | MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), |
@@ -442,7 +473,7 @@ enum mpath_info_flags { | |||
442 | * | 473 | * |
443 | * @filled: bitfield of flags from &enum mpath_info_flags | 474 | * @filled: bitfield of flags from &enum mpath_info_flags |
444 | * @frame_qlen: number of queued frames for this destination | 475 | * @frame_qlen: number of queued frames for this destination |
445 | * @dsn: destination sequence number | 476 | * @sn: target sequence number |
446 | * @metric: metric (cost) of this mesh path | 477 | * @metric: metric (cost) of this mesh path |
447 | * @exptime: expiration time for the mesh path from now, in msecs | 478 | * @exptime: expiration time for the mesh path from now, in msecs |
448 | * @flags: mesh path flags | 479 | * @flags: mesh path flags |
@@ -456,7 +487,7 @@ enum mpath_info_flags { | |||
456 | struct mpath_info { | 487 | struct mpath_info { |
457 | u32 filled; | 488 | u32 filled; |
458 | u32 frame_qlen; | 489 | u32 frame_qlen; |
459 | u32 dsn; | 490 | u32 sn; |
460 | u32 metric; | 491 | u32 metric; |
461 | u32 exptime; | 492 | u32 exptime; |
462 | u32 discovery_timeout; | 493 | u32 discovery_timeout; |
@@ -506,6 +537,7 @@ struct mesh_config { | |||
506 | u32 dot11MeshHWMPactivePathTimeout; | 537 | u32 dot11MeshHWMPactivePathTimeout; |
507 | u16 dot11MeshHWMPpreqMinInterval; | 538 | u16 dot11MeshHWMPpreqMinInterval; |
508 | u16 dot11MeshHWMPnetDiameterTraversalTime; | 539 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
540 | u8 dot11MeshHWMPRootMode; | ||
509 | }; | 541 | }; |
510 | 542 | ||
511 | /** | 543 | /** |
@@ -941,6 +973,8 @@ struct cfg80211_bitrate_mask { | |||
941 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting | 973 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting |
942 | * functions to adjust rfkill hw state | 974 | * functions to adjust rfkill hw state |
943 | * | 975 | * |
976 | * @dump_survey: get site survey information. | ||
977 | * | ||
944 | * @testmode_cmd: run a test mode command | 978 | * @testmode_cmd: run a test mode command |
945 | */ | 979 | */ |
946 | struct cfg80211_ops { | 980 | struct cfg80211_ops { |
@@ -1060,6 +1094,9 @@ struct cfg80211_ops { | |||
1060 | const u8 *peer, | 1094 | const u8 *peer, |
1061 | const struct cfg80211_bitrate_mask *mask); | 1095 | const struct cfg80211_bitrate_mask *mask); |
1062 | 1096 | ||
1097 | int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev, | ||
1098 | int idx, struct survey_info *info); | ||
1099 | |||
1063 | /* some temporary stuff to finish wext */ | 1100 | /* some temporary stuff to finish wext */ |
1064 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1101 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1065 | bool enabled, int timeout); | 1102 | bool enabled, int timeout); |
@@ -1071,27 +1108,50 @@ struct cfg80211_ops { | |||
1071 | */ | 1108 | */ |
1072 | 1109 | ||
1073 | /** | 1110 | /** |
1074 | * struct wiphy - wireless hardware description | 1111 | * enum wiphy_flags - wiphy capability flags |
1075 | * @idx: the wiphy index assigned to this item | 1112 | * |
1076 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | 1113 | * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device |
1077 | * @custom_regulatory: tells us the driver for this device | ||
1078 | * has its own custom regulatory domain and cannot identify the | 1114 | * has its own custom regulatory domain and cannot identify the |
1079 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled | 1115 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled |
1080 | * we will disregard the first regulatory hint (when the | 1116 | * we will disregard the first regulatory hint (when the |
1081 | * initiator is %REGDOM_SET_BY_CORE). | 1117 | * initiator is %REGDOM_SET_BY_CORE). |
1082 | * @strict_regulatory: tells us the driver for this device will ignore | 1118 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will |
1083 | * regulatory domain settings until it gets its own regulatory domain | 1119 | * ignore regulatory domain settings until it gets its own regulatory |
1084 | * via its regulatory_hint(). After its gets its own regulatory domain | 1120 | * domain via its regulatory_hint(). After its gets its own regulatory |
1085 | * it will only allow further regulatory domain settings to further | 1121 | * domain it will only allow further regulatory domain settings to |
1086 | * enhance compliance. For example if channel 13 and 14 are disabled | 1122 | * further enhance compliance. For example if channel 13 and 14 are |
1087 | * by this regulatory domain no user regulatory domain can enable these | 1123 | * disabled by this regulatory domain no user regulatory domain can |
1088 | * channels at a later time. This can be used for devices which do not | 1124 | * enable these channels at a later time. This can be used for devices |
1089 | * have calibration information gauranteed for frequencies or settings | 1125 | * which do not have calibration information gauranteed for frequencies |
1090 | * outside of its regulatory domain. | 1126 | * or settings outside of its regulatory domain. |
1091 | * @disable_beacon_hints: enable this if your driver needs to ensure that | 1127 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure |
1092 | * passive scan flags and beaconing flags may not be lifted by cfg80211 | 1128 | * that passive scan flags and beaconing flags may not be lifted by |
1093 | * due to regulatory beacon hints. For more information on beacon | 1129 | * cfg80211 due to regulatory beacon hints. For more information on beacon |
1094 | * hints read the documenation for regulatory_hint_found_beacon() | 1130 | * hints read the documenation for regulatory_hint_found_beacon() |
1131 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this | ||
1132 | * wiphy at all | ||
1133 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled | ||
1134 | * by default -- this flag will be set depending on the kernel's default | ||
1135 | * on wiphy_new(), but can be changed by the driver if it has a good | ||
1136 | * reason to override the default | ||
1137 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station | ||
1138 | * on a VLAN interface) | ||
1139 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station | ||
1140 | */ | ||
1141 | enum wiphy_flags { | ||
1142 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | ||
1143 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), | ||
1144 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), | ||
1145 | WIPHY_FLAG_NETNS_OK = BIT(3), | ||
1146 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), | ||
1147 | WIPHY_FLAG_4ADDR_AP = BIT(5), | ||
1148 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | ||
1149 | }; | ||
1150 | |||
1151 | /** | ||
1152 | * struct wiphy - wireless hardware description | ||
1153 | * @idx: the wiphy index assigned to this item | ||
1154 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | ||
1095 | * @reg_notifier: the driver's regulatory notification callback | 1155 | * @reg_notifier: the driver's regulatory notification callback |
1096 | * @regd: the driver's regulatory domain, if one was requested via | 1156 | * @regd: the driver's regulatory domain, if one was requested via |
1097 | * the regulatory_hint() API. This can be used by the driver | 1157 | * the regulatory_hint() API. This can be used by the driver |
@@ -1106,11 +1166,6 @@ struct cfg80211_ops { | |||
1106 | * -1 = fragmentation disabled, only odd values >= 256 used | 1166 | * -1 = fragmentation disabled, only odd values >= 256 used |
1107 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled | 1167 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled |
1108 | * @net: the network namespace this wiphy currently lives in | 1168 | * @net: the network namespace this wiphy currently lives in |
1109 | * @netnsok: if set to false, do not allow changing the netns of this | ||
1110 | * wiphy at all | ||
1111 | * @ps_default: default for powersave, will be set depending on the | ||
1112 | * kernel's default on wiphy_new(), but can be changed by the | ||
1113 | * driver if it has a good reason to override the default | ||
1114 | */ | 1169 | */ |
1115 | struct wiphy { | 1170 | struct wiphy { |
1116 | /* assign these fields before you register the wiphy */ | 1171 | /* assign these fields before you register the wiphy */ |
@@ -1121,12 +1176,7 @@ struct wiphy { | |||
1121 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 1176 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
1122 | u16 interface_modes; | 1177 | u16 interface_modes; |
1123 | 1178 | ||
1124 | bool custom_regulatory; | 1179 | u32 flags; |
1125 | bool strict_regulatory; | ||
1126 | bool disable_beacon_hints; | ||
1127 | |||
1128 | bool netnsok; | ||
1129 | bool ps_default; | ||
1130 | 1180 | ||
1131 | enum cfg80211_signal_type signal_type; | 1181 | enum cfg80211_signal_type signal_type; |
1132 | 1182 | ||
@@ -1142,6 +1192,9 @@ struct wiphy { | |||
1142 | u32 frag_threshold; | 1192 | u32 frag_threshold; |
1143 | u32 rts_threshold; | 1193 | u32 rts_threshold; |
1144 | 1194 | ||
1195 | char fw_version[ETHTOOL_BUSINFO_LEN]; | ||
1196 | u32 hw_version; | ||
1197 | |||
1145 | /* If multiple wiphys are registered and you're handed e.g. | 1198 | /* If multiple wiphys are registered and you're handed e.g. |
1146 | * a regular netdev with assigned ieee80211_ptr, you won't | 1199 | * a regular netdev with assigned ieee80211_ptr, you won't |
1147 | * know whether it points to a wiphy your driver has registered | 1200 | * know whether it points to a wiphy your driver has registered |
@@ -1171,6 +1224,10 @@ struct wiphy { | |||
1171 | struct net *_net; | 1224 | struct net *_net; |
1172 | #endif | 1225 | #endif |
1173 | 1226 | ||
1227 | #ifdef CONFIG_CFG80211_WEXT | ||
1228 | const struct iw_handler_def *wext; | ||
1229 | #endif | ||
1230 | |||
1174 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 1231 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
1175 | }; | 1232 | }; |
1176 | 1233 | ||
@@ -1314,6 +1371,10 @@ struct cfg80211_cached_keys; | |||
1314 | * @ssid_len: (private) Used by the internal configuration code | 1371 | * @ssid_len: (private) Used by the internal configuration code |
1315 | * @wext: (private) Used by the internal wireless extensions compat code | 1372 | * @wext: (private) Used by the internal wireless extensions compat code |
1316 | * @wext_bssid: (private) Used by the internal wireless extensions compat code | 1373 | * @wext_bssid: (private) Used by the internal wireless extensions compat code |
1374 | * @use_4addr: indicates 4addr mode is used on this interface, must be | ||
1375 | * set by driver (if supported) on add_interface BEFORE registering the | ||
1376 | * netdev and may otherwise be used by driver read-only, will be update | ||
1377 | * by cfg80211 on change_interface | ||
1317 | */ | 1378 | */ |
1318 | struct wireless_dev { | 1379 | struct wireless_dev { |
1319 | struct wiphy *wiphy; | 1380 | struct wiphy *wiphy; |
@@ -1327,6 +1388,8 @@ struct wireless_dev { | |||
1327 | 1388 | ||
1328 | struct work_struct cleanup_work; | 1389 | struct work_struct cleanup_work; |
1329 | 1390 | ||
1391 | bool use_4addr; | ||
1392 | |||
1330 | /* currently used for IBSS and SME - might be rearranged later */ | 1393 | /* currently used for IBSS and SME - might be rearranged later */ |
1331 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1394 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
1332 | u8 ssid_len; | 1395 | u8 ssid_len; |
@@ -1345,7 +1408,7 @@ struct wireless_dev { | |||
1345 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; | 1408 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; |
1346 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 1409 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
1347 | 1410 | ||
1348 | #ifdef CONFIG_WIRELESS_EXT | 1411 | #ifdef CONFIG_CFG80211_WEXT |
1349 | /* wext data */ | 1412 | /* wext data */ |
1350 | struct { | 1413 | struct { |
1351 | struct cfg80211_ibss_params ibss; | 1414 | struct cfg80211_ibss_params ibss; |
@@ -1776,6 +1839,18 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); | |||
1776 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); | 1839 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); |
1777 | 1840 | ||
1778 | /** | 1841 | /** |
1842 | * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled | ||
1843 | * @dev: network device | ||
1844 | * @addr: The MAC address of the device with which the authentication timed out | ||
1845 | * | ||
1846 | * When a pending authentication had no action yet, the driver may decide | ||
1847 | * to not send a deauth frame, but in that case must calls this function | ||
1848 | * to tell cfg80211 about this decision. It is only valid to call this | ||
1849 | * function within the deauth() callback. | ||
1850 | */ | ||
1851 | void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr); | ||
1852 | |||
1853 | /** | ||
1779 | * cfg80211_send_rx_assoc - notification of processed association | 1854 | * cfg80211_send_rx_assoc - notification of processed association |
1780 | * @dev: network device | 1855 | * @dev: network device |
1781 | * @buf: (re)association response frame (header + body) | 1856 | * @buf: (re)association response frame (header + body) |
@@ -1802,30 +1877,45 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); | |||
1802 | * @dev: network device | 1877 | * @dev: network device |
1803 | * @buf: deauthentication frame (header + body) | 1878 | * @buf: deauthentication frame (header + body) |
1804 | * @len: length of the frame data | 1879 | * @len: length of the frame data |
1805 | * @cookie: cookie from ->deauth if called within that callback, | ||
1806 | * %NULL otherwise | ||
1807 | * | 1880 | * |
1808 | * This function is called whenever deauthentication has been processed in | 1881 | * This function is called whenever deauthentication has been processed in |
1809 | * station mode. This includes both received deauthentication frames and | 1882 | * station mode. This includes both received deauthentication frames and |
1810 | * locally generated ones. This function may sleep. | 1883 | * locally generated ones. This function may sleep. |
1811 | */ | 1884 | */ |
1812 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, | 1885 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); |
1813 | void *cookie); | 1886 | |
1887 | /** | ||
1888 | * __cfg80211_send_deauth - notification of processed deauthentication | ||
1889 | * @dev: network device | ||
1890 | * @buf: deauthentication frame (header + body) | ||
1891 | * @len: length of the frame data | ||
1892 | * | ||
1893 | * Like cfg80211_send_deauth(), but doesn't take the wdev lock. | ||
1894 | */ | ||
1895 | void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); | ||
1814 | 1896 | ||
1815 | /** | 1897 | /** |
1816 | * cfg80211_send_disassoc - notification of processed disassociation | 1898 | * cfg80211_send_disassoc - notification of processed disassociation |
1817 | * @dev: network device | 1899 | * @dev: network device |
1818 | * @buf: disassociation response frame (header + body) | 1900 | * @buf: disassociation response frame (header + body) |
1819 | * @len: length of the frame data | 1901 | * @len: length of the frame data |
1820 | * @cookie: cookie from ->disassoc if called within that callback, | ||
1821 | * %NULL otherwise | ||
1822 | * | 1902 | * |
1823 | * This function is called whenever disassociation has been processed in | 1903 | * This function is called whenever disassociation has been processed in |
1824 | * station mode. This includes both received disassociation frames and locally | 1904 | * station mode. This includes both received disassociation frames and locally |
1825 | * generated ones. This function may sleep. | 1905 | * generated ones. This function may sleep. |
1826 | */ | 1906 | */ |
1827 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, | 1907 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); |
1828 | void *cookie); | 1908 | |
1909 | /** | ||
1910 | * __cfg80211_send_disassoc - notification of processed disassociation | ||
1911 | * @dev: network device | ||
1912 | * @buf: disassociation response frame (header + body) | ||
1913 | * @len: length of the frame data | ||
1914 | * | ||
1915 | * Like cfg80211_send_disassoc(), but doesn't take the wdev lock. | ||
1916 | */ | ||
1917 | void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, | ||
1918 | size_t len); | ||
1829 | 1919 | ||
1830 | /** | 1920 | /** |
1831 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 1921 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
diff --git a/include/net/compat.h b/include/net/compat.h index 7c3002832d05..3c7d4e38fa1d 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -18,6 +18,11 @@ struct compat_msghdr { | |||
18 | compat_uint_t msg_flags; | 18 | compat_uint_t msg_flags; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct compat_mmsghdr { | ||
22 | struct compat_msghdr msg_hdr; | ||
23 | compat_uint_t msg_len; | ||
24 | }; | ||
25 | |||
21 | struct compat_cmsghdr { | 26 | struct compat_cmsghdr { |
22 | compat_size_t cmsg_len; | 27 | compat_size_t cmsg_len; |
23 | compat_int_t cmsg_level; | 28 | compat_int_t cmsg_level; |
@@ -28,13 +33,20 @@ extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | |||
28 | extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | 33 | extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); |
29 | 34 | ||
30 | #else /* defined(CONFIG_COMPAT) */ | 35 | #else /* defined(CONFIG_COMPAT) */ |
31 | #define compat_msghdr msghdr /* to avoid compiler warnings */ | 36 | /* |
37 | * To avoid compiler warnings: | ||
38 | */ | ||
39 | #define compat_msghdr msghdr | ||
40 | #define compat_mmsghdr mmsghdr | ||
32 | #endif /* defined(CONFIG_COMPAT) */ | 41 | #endif /* defined(CONFIG_COMPAT) */ |
33 | 42 | ||
34 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); | 43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); |
35 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); | 44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); |
36 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); | 45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); |
37 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); | 46 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); |
47 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, | ||
48 | unsigned, unsigned, | ||
49 | struct timespec __user *); | ||
38 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 50 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); |
39 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); | 51 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); |
40 | 52 | ||
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index cee46821dc53..28966cae3fd7 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -97,16 +97,14 @@ struct dn_dev { | |||
97 | unsigned long uptime; /* Time device went up in jiffies */ | 97 | unsigned long uptime; /* Time device went up in jiffies */ |
98 | }; | 98 | }; |
99 | 99 | ||
100 | struct dn_short_packet | 100 | struct dn_short_packet { |
101 | { | ||
102 | __u8 msgflg; | 101 | __u8 msgflg; |
103 | __le16 dstnode; | 102 | __le16 dstnode; |
104 | __le16 srcnode; | 103 | __le16 srcnode; |
105 | __u8 forward; | 104 | __u8 forward; |
106 | } __attribute__((packed)); | 105 | } __attribute__((packed)); |
107 | 106 | ||
108 | struct dn_long_packet | 107 | struct dn_long_packet { |
109 | { | ||
110 | __u8 msgflg; | 108 | __u8 msgflg; |
111 | __u8 d_area; | 109 | __u8 d_area; |
112 | __u8 d_subarea; | 110 | __u8 d_subarea; |
@@ -122,8 +120,7 @@ struct dn_long_packet | |||
122 | 120 | ||
123 | /*------------------------- DRP - Routing messages ---------------------*/ | 121 | /*------------------------- DRP - Routing messages ---------------------*/ |
124 | 122 | ||
125 | struct endnode_hello_message | 123 | struct endnode_hello_message { |
126 | { | ||
127 | __u8 msgflg; | 124 | __u8 msgflg; |
128 | __u8 tiver[3]; | 125 | __u8 tiver[3]; |
129 | __u8 id[6]; | 126 | __u8 id[6]; |
@@ -138,8 +135,7 @@ struct endnode_hello_message | |||
138 | __u8 data[2]; | 135 | __u8 data[2]; |
139 | } __attribute__((packed)); | 136 | } __attribute__((packed)); |
140 | 137 | ||
141 | struct rtnode_hello_message | 138 | struct rtnode_hello_message { |
142 | { | ||
143 | __u8 msgflg; | 139 | __u8 msgflg; |
144 | __u8 tiver[3]; | 140 | __u8 tiver[3]; |
145 | __u8 id[6]; | 141 | __u8 id[6]; |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index c378be7bf960..52da6c3dd50d 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
@@ -4,8 +4,7 @@ | |||
4 | /* WARNING: The ordering of these elements must match ordering | 4 | /* WARNING: The ordering of these elements must match ordering |
5 | * of RTA_* rtnetlink attribute numbers. | 5 | * of RTA_* rtnetlink attribute numbers. |
6 | */ | 6 | */ |
7 | struct dn_kern_rta | 7 | struct dn_kern_rta { |
8 | { | ||
9 | void *rta_dst; | 8 | void *rta_dst; |
10 | void *rta_src; | 9 | void *rta_src; |
11 | int *rta_iif; | 10 | int *rta_iif; |
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index 96e816b6974d..17d43d2db5ec 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h | |||
@@ -70,30 +70,26 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl | |||
70 | 70 | ||
71 | /* Data Messages (data segment/interrupt/link service) */ | 71 | /* Data Messages (data segment/interrupt/link service) */ |
72 | 72 | ||
73 | struct nsp_data_seg_msg | 73 | struct nsp_data_seg_msg { |
74 | { | ||
75 | __u8 msgflg; | 74 | __u8 msgflg; |
76 | __le16 dstaddr; | 75 | __le16 dstaddr; |
77 | __le16 srcaddr; | 76 | __le16 srcaddr; |
78 | } __attribute__((packed)); | 77 | } __attribute__((packed)); |
79 | 78 | ||
80 | struct nsp_data_opt_msg | 79 | struct nsp_data_opt_msg { |
81 | { | ||
82 | __le16 acknum; | 80 | __le16 acknum; |
83 | __le16 segnum; | 81 | __le16 segnum; |
84 | __le16 lsflgs; | 82 | __le16 lsflgs; |
85 | } __attribute__((packed)); | 83 | } __attribute__((packed)); |
86 | 84 | ||
87 | struct nsp_data_opt_msg1 | 85 | struct nsp_data_opt_msg1 { |
88 | { | ||
89 | __le16 acknum; | 86 | __le16 acknum; |
90 | __le16 segnum; | 87 | __le16 segnum; |
91 | } __attribute__((packed)); | 88 | } __attribute__((packed)); |
92 | 89 | ||
93 | 90 | ||
94 | /* Acknowledgment Message (data/other data) */ | 91 | /* Acknowledgment Message (data/other data) */ |
95 | struct nsp_data_ack_msg | 92 | struct nsp_data_ack_msg { |
96 | { | ||
97 | __u8 msgflg; | 93 | __u8 msgflg; |
98 | __le16 dstaddr; | 94 | __le16 dstaddr; |
99 | __le16 srcaddr; | 95 | __le16 srcaddr; |
@@ -101,16 +97,14 @@ struct nsp_data_ack_msg | |||
101 | } __attribute__((packed)); | 97 | } __attribute__((packed)); |
102 | 98 | ||
103 | /* Connect Acknowledgment Message */ | 99 | /* Connect Acknowledgment Message */ |
104 | struct nsp_conn_ack_msg | 100 | struct nsp_conn_ack_msg { |
105 | { | ||
106 | __u8 msgflg; | 101 | __u8 msgflg; |
107 | __le16 dstaddr; | 102 | __le16 dstaddr; |
108 | } __attribute__((packed)); | 103 | } __attribute__((packed)); |
109 | 104 | ||
110 | 105 | ||
111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ | 106 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ |
112 | struct nsp_conn_init_msg | 107 | struct nsp_conn_init_msg { |
113 | { | ||
114 | __u8 msgflg; | 108 | __u8 msgflg; |
115 | #define NSP_CI 0x18 /* Connect Initiate */ | 109 | #define NSP_CI 0x18 /* Connect Initiate */ |
116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ | 110 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ |
@@ -126,8 +120,7 @@ struct nsp_conn_init_msg | |||
126 | } __attribute__((packed)); | 120 | } __attribute__((packed)); |
127 | 121 | ||
128 | /* Disconnect Initiate/Disconnect Confirm */ | 122 | /* Disconnect Initiate/Disconnect Confirm */ |
129 | struct nsp_disconn_init_msg | 123 | struct nsp_disconn_init_msg { |
130 | { | ||
131 | __u8 msgflg; | 124 | __u8 msgflg; |
132 | __le16 dstaddr; | 125 | __le16 dstaddr; |
133 | __le16 srcaddr; | 126 | __le16 srcaddr; |
@@ -136,8 +129,7 @@ struct nsp_disconn_init_msg | |||
136 | 129 | ||
137 | 130 | ||
138 | 131 | ||
139 | struct srcobj_fmt | 132 | struct srcobj_fmt { |
140 | { | ||
141 | __u8 format; | 133 | __u8 format; |
142 | __u8 task; | 134 | __u8 task; |
143 | __le16 grpcode; | 135 | __le16 grpcode; |
diff --git a/include/net/dst.h b/include/net/dst.h index 5a900ddcf10d..387cb3cfde7e 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -36,8 +36,7 @@ | |||
36 | 36 | ||
37 | struct sk_buff; | 37 | struct sk_buff; |
38 | 38 | ||
39 | struct dst_entry | 39 | struct dst_entry { |
40 | { | ||
41 | struct rcu_head rcu_head; | 40 | struct rcu_head rcu_head; |
42 | struct dst_entry *child; | 41 | struct dst_entry *child; |
43 | struct net_device *dev; | 42 | struct net_device *dev; |
@@ -111,6 +110,12 @@ dst_metric(const struct dst_entry *dst, int metric) | |||
111 | return dst->metrics[metric-1]; | 110 | return dst->metrics[metric-1]; |
112 | } | 111 | } |
113 | 112 | ||
113 | static inline u32 | ||
114 | dst_feature(const struct dst_entry *dst, u32 feature) | ||
115 | { | ||
116 | return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0); | ||
117 | } | ||
118 | |||
114 | static inline u32 dst_mtu(const struct dst_entry *dst) | 119 | static inline u32 dst_mtu(const struct dst_entry *dst) |
115 | { | 120 | { |
116 | u32 mtu = dst_metric(dst, RTAX_MTU); | 121 | u32 mtu = dst_metric(dst, RTAX_MTU); |
@@ -136,7 +141,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | |||
136 | static inline u32 | 141 | static inline u32 |
137 | dst_allfrag(const struct dst_entry *dst) | 142 | dst_allfrag(const struct dst_entry *dst) |
138 | { | 143 | { |
139 | int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; | 144 | int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG); |
140 | /* Yes, _exactly_. This is paranoia. */ | 145 | /* Yes, _exactly_. This is paranoia. */ |
141 | barrier(); | 146 | barrier(); |
142 | return ret; | 147 | return ret; |
@@ -222,11 +227,19 @@ static inline void dst_confirm(struct dst_entry *dst) | |||
222 | neigh_confirm(dst->neighbour); | 227 | neigh_confirm(dst->neighbour); |
223 | } | 228 | } |
224 | 229 | ||
225 | static inline void dst_negative_advice(struct dst_entry **dst_p) | 230 | static inline void dst_negative_advice(struct dst_entry **dst_p, |
231 | struct sock *sk) | ||
226 | { | 232 | { |
227 | struct dst_entry * dst = *dst_p; | 233 | struct dst_entry * dst = *dst_p; |
228 | if (dst && dst->ops->negative_advice) | 234 | if (dst && dst->ops->negative_advice) { |
229 | *dst_p = dst->ops->negative_advice(dst); | 235 | *dst_p = dst->ops->negative_advice(dst); |
236 | |||
237 | if (dst != *dst_p) { | ||
238 | extern void sk_reset_txq(struct sock *sk); | ||
239 | |||
240 | sk_reset_txq(sk); | ||
241 | } | ||
242 | } | ||
230 | } | 243 | } |
231 | 244 | ||
232 | static inline void dst_link_failure(struct sk_buff *skb) | 245 | static inline void dst_link_failure(struct sk_buff *skb) |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index ca4b2e840078..2cd707b15d59 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -7,8 +7,7 @@ | |||
7 | #include <net/flow.h> | 7 | #include <net/flow.h> |
8 | #include <net/rtnetlink.h> | 8 | #include <net/rtnetlink.h> |
9 | 9 | ||
10 | struct fib_rule | 10 | struct fib_rule { |
11 | { | ||
12 | struct list_head list; | 11 | struct list_head list; |
13 | atomic_t refcnt; | 12 | atomic_t refcnt; |
14 | int ifindex; | 13 | int ifindex; |
@@ -25,15 +24,13 @@ struct fib_rule | |||
25 | struct net * fr_net; | 24 | struct net * fr_net; |
26 | }; | 25 | }; |
27 | 26 | ||
28 | struct fib_lookup_arg | 27 | struct fib_lookup_arg { |
29 | { | ||
30 | void *lookup_ptr; | 28 | void *lookup_ptr; |
31 | void *result; | 29 | void *result; |
32 | struct fib_rule *rule; | 30 | struct fib_rule *rule; |
33 | }; | 31 | }; |
34 | 32 | ||
35 | struct fib_rules_ops | 33 | struct fib_rules_ops { |
36 | { | ||
37 | int family; | 34 | int family; |
38 | struct list_head list; | 35 | struct list_head list; |
39 | int rule_size; | 36 | int rule_size; |
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index c1488553e349..fa157712e982 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
@@ -6,8 +6,7 @@ | |||
6 | #include <linux/rtnetlink.h> | 6 | #include <linux/rtnetlink.h> |
7 | #include <linux/pkt_sched.h> | 7 | #include <linux/pkt_sched.h> |
8 | 8 | ||
9 | struct gnet_dump | 9 | struct gnet_dump { |
10 | { | ||
11 | spinlock_t * lock; | 10 | spinlock_t * lock; |
12 | struct sk_buff * skb; | 11 | struct sk_buff * skb; |
13 | struct nlattr * tail; | 12 | struct nlattr * tail; |
@@ -30,6 +29,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | |||
30 | extern int gnet_stats_copy_basic(struct gnet_dump *d, | 29 | extern int gnet_stats_copy_basic(struct gnet_dump *d, |
31 | struct gnet_stats_basic_packed *b); | 30 | struct gnet_stats_basic_packed *b); |
32 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, | 31 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, |
32 | const struct gnet_stats_basic_packed *b, | ||
33 | struct gnet_stats_rate_est *r); | 33 | struct gnet_stats_rate_est *r); |
34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, | 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, |
35 | struct gnet_stats_queue *q); | 35 | struct gnet_stats_queue *q); |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 2a1c06874c42..eb551baafc04 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -13,8 +13,7 @@ | |||
13 | * @list: list entry for linking | 13 | * @list: list entry for linking |
14 | * @family: pointer to family, need not be set before registering | 14 | * @family: pointer to family, need not be set before registering |
15 | */ | 15 | */ |
16 | struct genl_multicast_group | 16 | struct genl_multicast_group { |
17 | { | ||
18 | struct genl_family *family; /* private */ | 17 | struct genl_family *family; /* private */ |
19 | struct list_head list; /* private */ | 18 | struct list_head list; /* private */ |
20 | char name[GENL_NAMSIZ]; | 19 | char name[GENL_NAMSIZ]; |
@@ -35,8 +34,7 @@ struct genl_multicast_group | |||
35 | * @family_list: family list | 34 | * @family_list: family list |
36 | * @mcast_groups: multicast groups list | 35 | * @mcast_groups: multicast groups list |
37 | */ | 36 | */ |
38 | struct genl_family | 37 | struct genl_family { |
39 | { | ||
40 | unsigned int id; | 38 | unsigned int id; |
41 | unsigned int hdrsize; | 39 | unsigned int hdrsize; |
42 | char name[GENL_NAMSIZ]; | 40 | char name[GENL_NAMSIZ]; |
@@ -58,8 +56,7 @@ struct genl_family | |||
58 | * @userhdr: user specific header | 56 | * @userhdr: user specific header |
59 | * @attrs: netlink attributes | 57 | * @attrs: netlink attributes |
60 | */ | 58 | */ |
61 | struct genl_info | 59 | struct genl_info { |
62 | { | ||
63 | u32 snd_seq; | 60 | u32 snd_seq; |
64 | u32 snd_pid; | 61 | u32 snd_pid; |
65 | struct nlmsghdr * nlhdr; | 62 | struct nlmsghdr * nlhdr; |
@@ -102,8 +99,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) | |||
102 | * @done: completion callback for dumps | 99 | * @done: completion callback for dumps |
103 | * @ops_list: operations list | 100 | * @ops_list: operations list |
104 | */ | 101 | */ |
105 | struct genl_ops | 102 | struct genl_ops { |
106 | { | ||
107 | u8 cmd; | 103 | u8 cmd; |
108 | unsigned int flags; | 104 | unsigned int flags; |
109 | const struct nla_policy *policy; | 105 | const struct nla_policy *policy; |
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index 23c3f3d97779..9d3d86aaccbb 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h | |||
@@ -80,7 +80,7 @@ struct ieee80211_radiotap_header { | |||
80 | * Additional extensions are made | 80 | * Additional extensions are made |
81 | * by setting bit 31. | 81 | * by setting bit 31. |
82 | */ | 82 | */ |
83 | }; | 83 | } __packed; |
84 | 84 | ||
85 | /* Name Data type Units | 85 | /* Name Data type Units |
86 | * ---- --------- ----- | 86 | * ---- --------- ----- |
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index 5dc6a61952de..57430555487a 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h | |||
@@ -74,8 +74,12 @@ static inline int mac_cb_type(struct sk_buff *skb) | |||
74 | #define IEEE802154_MAC_SCAN_PASSIVE 2 | 74 | #define IEEE802154_MAC_SCAN_PASSIVE 2 |
75 | #define IEEE802154_MAC_SCAN_ORPHAN 3 | 75 | #define IEEE802154_MAC_SCAN_ORPHAN 3 |
76 | 76 | ||
77 | struct wpan_phy; | ||
77 | /* | 78 | /* |
78 | * This should be located at net_device->ml_priv | 79 | * This should be located at net_device->ml_priv |
80 | * | ||
81 | * get_phy should increment the reference counting on returned phy. | ||
82 | * Use wpan_wpy_put to put that reference. | ||
79 | */ | 83 | */ |
80 | struct ieee802154_mlme_ops { | 84 | struct ieee802154_mlme_ops { |
81 | int (*assoc_req)(struct net_device *dev, | 85 | int (*assoc_req)(struct net_device *dev, |
@@ -94,18 +98,20 @@ struct ieee802154_mlme_ops { | |||
94 | int (*scan_req)(struct net_device *dev, | 98 | int (*scan_req)(struct net_device *dev, |
95 | u8 type, u32 channels, u8 page, u8 duration); | 99 | u8 type, u32 channels, u8 page, u8 duration); |
96 | 100 | ||
101 | struct wpan_phy *(*get_phy)(const struct net_device *dev); | ||
102 | |||
97 | /* | 103 | /* |
98 | * FIXME: these should become the part of PIB/MIB interface. | 104 | * FIXME: these should become the part of PIB/MIB interface. |
99 | * However we still don't have IB interface of any kind | 105 | * However we still don't have IB interface of any kind |
100 | */ | 106 | */ |
101 | u16 (*get_pan_id)(struct net_device *dev); | 107 | u16 (*get_pan_id)(const struct net_device *dev); |
102 | u16 (*get_short_addr)(struct net_device *dev); | 108 | u16 (*get_short_addr)(const struct net_device *dev); |
103 | u8 (*get_dsn)(struct net_device *dev); | 109 | u8 (*get_dsn)(const struct net_device *dev); |
104 | u8 (*get_bsn)(struct net_device *dev); | 110 | u8 (*get_bsn)(const struct net_device *dev); |
105 | }; | 111 | }; |
106 | 112 | ||
107 | static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( | 113 | static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( |
108 | struct net_device *dev) | 114 | const struct net_device *dev) |
109 | { | 115 | { |
110 | return dev->ml_priv; | 116 | return dev->ml_priv; |
111 | } | 117 | } |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 38b78132019b..e9d69d198495 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -32,8 +32,7 @@ | |||
32 | 32 | ||
33 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
34 | 34 | ||
35 | struct inet6_ifaddr | 35 | struct inet6_ifaddr { |
36 | { | ||
37 | struct in6_addr addr; | 36 | struct in6_addr addr; |
38 | __u32 prefix_len; | 37 | __u32 prefix_len; |
39 | 38 | ||
@@ -67,8 +66,7 @@ struct inet6_ifaddr | |||
67 | int dead; | 66 | int dead; |
68 | }; | 67 | }; |
69 | 68 | ||
70 | struct ip6_sf_socklist | 69 | struct ip6_sf_socklist { |
71 | { | ||
72 | unsigned int sl_max; | 70 | unsigned int sl_max; |
73 | unsigned int sl_count; | 71 | unsigned int sl_count; |
74 | struct in6_addr sl_addr[0]; | 72 | struct in6_addr sl_addr[0]; |
@@ -79,8 +77,7 @@ struct ip6_sf_socklist | |||
79 | 77 | ||
80 | #define IP6_SFBLOCK 10 /* allocate this many at once */ | 78 | #define IP6_SFBLOCK 10 /* allocate this many at once */ |
81 | 79 | ||
82 | struct ipv6_mc_socklist | 80 | struct ipv6_mc_socklist { |
83 | { | ||
84 | struct in6_addr addr; | 81 | struct in6_addr addr; |
85 | int ifindex; | 82 | int ifindex; |
86 | struct ipv6_mc_socklist *next; | 83 | struct ipv6_mc_socklist *next; |
@@ -89,8 +86,7 @@ struct ipv6_mc_socklist | |||
89 | struct ip6_sf_socklist *sflist; | 86 | struct ip6_sf_socklist *sflist; |
90 | }; | 87 | }; |
91 | 88 | ||
92 | struct ip6_sf_list | 89 | struct ip6_sf_list { |
93 | { | ||
94 | struct ip6_sf_list *sf_next; | 90 | struct ip6_sf_list *sf_next; |
95 | struct in6_addr sf_addr; | 91 | struct in6_addr sf_addr; |
96 | unsigned long sf_count[2]; /* include/exclude counts */ | 92 | unsigned long sf_count[2]; /* include/exclude counts */ |
@@ -105,8 +101,7 @@ struct ip6_sf_list | |||
105 | #define MAF_NOREPORT 0x08 | 101 | #define MAF_NOREPORT 0x08 |
106 | #define MAF_GSQUERY 0x10 | 102 | #define MAF_GSQUERY 0x10 |
107 | 103 | ||
108 | struct ifmcaddr6 | 104 | struct ifmcaddr6 { |
109 | { | ||
110 | struct in6_addr mca_addr; | 105 | struct in6_addr mca_addr; |
111 | struct inet6_dev *idev; | 106 | struct inet6_dev *idev; |
112 | struct ifmcaddr6 *next; | 107 | struct ifmcaddr6 *next; |
@@ -126,15 +121,13 @@ struct ifmcaddr6 | |||
126 | 121 | ||
127 | /* Anycast stuff */ | 122 | /* Anycast stuff */ |
128 | 123 | ||
129 | struct ipv6_ac_socklist | 124 | struct ipv6_ac_socklist { |
130 | { | ||
131 | struct in6_addr acl_addr; | 125 | struct in6_addr acl_addr; |
132 | int acl_ifindex; | 126 | int acl_ifindex; |
133 | struct ipv6_ac_socklist *acl_next; | 127 | struct ipv6_ac_socklist *acl_next; |
134 | }; | 128 | }; |
135 | 129 | ||
136 | struct ifacaddr6 | 130 | struct ifacaddr6 { |
137 | { | ||
138 | struct in6_addr aca_addr; | 131 | struct in6_addr aca_addr; |
139 | struct inet6_dev *aca_idev; | 132 | struct inet6_dev *aca_idev; |
140 | struct rt6_info *aca_rt; | 133 | struct rt6_info *aca_rt; |
@@ -157,8 +150,7 @@ struct ipv6_devstat { | |||
157 | DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); | 150 | DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); |
158 | }; | 151 | }; |
159 | 152 | ||
160 | struct inet6_dev | 153 | struct inet6_dev { |
161 | { | ||
162 | struct net_device *dev; | 154 | struct net_device *dev; |
163 | 155 | ||
164 | struct inet6_ifaddr *addr_list; | 156 | struct inet6_ifaddr *addr_list; |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 22c73a77cd99..92838d3a1ab7 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -46,8 +46,8 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) | |||
46 | const struct ipv6_pinfo *np = inet6_sk(sk); | 46 | const struct ipv6_pinfo *np = inet6_sk(sk); |
47 | const struct in6_addr *laddr = &np->rcv_saddr; | 47 | const struct in6_addr *laddr = &np->rcv_saddr; |
48 | const struct in6_addr *faddr = &np->daddr; | 48 | const struct in6_addr *faddr = &np->daddr; |
49 | const __u16 lport = inet->num; | 49 | const __u16 lport = inet->inet_num; |
50 | const __be16 fport = inet->dport; | 50 | const __be16 fport = inet->inet_dport; |
51 | struct net *net = sock_net(sk); | 51 | struct net *net = sock_net(sk); |
52 | 52 | ||
53 | return inet6_ehashfn(net, laddr, lport, faddr, fport); | 53 | return inet6_ehashfn(net, laddr, lport, faddr, fport); |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index d522dcf3031a..41cbddd25b70 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -92,8 +92,8 @@ static inline struct net *ib_net(struct inet_bind_bucket *ib) | |||
92 | return read_pnet(&ib->ib_net); | 92 | return read_pnet(&ib->ib_net); |
93 | } | 93 | } |
94 | 94 | ||
95 | #define inet_bind_bucket_for_each(tb, node, head) \ | 95 | #define inet_bind_bucket_for_each(tb, pos, head) \ |
96 | hlist_for_each_entry(tb, node, head, node) | 96 | hlist_for_each_entry(tb, pos, head, node) |
97 | 97 | ||
98 | struct inet_bind_hashbucket { | 98 | struct inet_bind_hashbucket { |
99 | spinlock_t lock; | 99 | spinlock_t lock; |
@@ -125,7 +125,7 @@ struct inet_hashinfo { | |||
125 | */ | 125 | */ |
126 | struct inet_ehash_bucket *ehash; | 126 | struct inet_ehash_bucket *ehash; |
127 | spinlock_t *ehash_locks; | 127 | spinlock_t *ehash_locks; |
128 | unsigned int ehash_size; | 128 | unsigned int ehash_mask; |
129 | unsigned int ehash_locks_mask; | 129 | unsigned int ehash_locks_mask; |
130 | 130 | ||
131 | /* Ok, let's try this, I give up, we do need a local binding | 131 | /* Ok, let's try this, I give up, we do need a local binding |
@@ -158,7 +158,7 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket( | |||
158 | struct inet_hashinfo *hashinfo, | 158 | struct inet_hashinfo *hashinfo, |
159 | unsigned int hash) | 159 | unsigned int hash) |
160 | { | 160 | { |
161 | return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; | 161 | return &hashinfo->ehash[hash & hashinfo->ehash_mask]; |
162 | } | 162 | } |
163 | 163 | ||
164 | static inline spinlock_t *inet_ehash_lockp( | 164 | static inline spinlock_t *inet_ehash_lockp( |
@@ -241,7 +241,7 @@ static inline int inet_lhashfn(struct net *net, const unsigned short num) | |||
241 | 241 | ||
242 | static inline int inet_sk_listen_hashfn(const struct sock *sk) | 242 | static inline int inet_sk_listen_hashfn(const struct sock *sk) |
243 | { | 243 | { |
244 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->num); | 244 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->inet_num); |
245 | } | 245 | } |
246 | 246 | ||
247 | /* Caller must disable local BH processing. */ | 247 | /* Caller must disable local BH processing. */ |
@@ -301,8 +301,8 @@ typedef __u64 __bitwise __addrpair; | |||
301 | #endif /* __BIG_ENDIAN */ | 301 | #endif /* __BIG_ENDIAN */ |
302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
304 | ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ | 304 | ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \ |
305 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 305 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
@@ -313,9 +313,9 @@ typedef __u64 __bitwise __addrpair; | |||
313 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 313 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) |
314 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ | 314 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ |
315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
316 | (inet_sk(__sk)->daddr == (__saddr)) && \ | 316 | (inet_sk(__sk)->inet_daddr == (__saddr)) && \ |
317 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ | 317 | (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ |
318 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 318 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ | 320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ |
321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 47004f35cc7e..bd4c53f75ac0 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -93,14 +93,14 @@ struct rtable; | |||
93 | * | 93 | * |
94 | * @sk - ancestor class | 94 | * @sk - ancestor class |
95 | * @pinet6 - pointer to IPv6 control block | 95 | * @pinet6 - pointer to IPv6 control block |
96 | * @daddr - Foreign IPv4 addr | 96 | * @inet_daddr - Foreign IPv4 addr |
97 | * @rcv_saddr - Bound local IPv4 addr | 97 | * @inet_rcv_saddr - Bound local IPv4 addr |
98 | * @dport - Destination port | 98 | * @inet_dport - Destination port |
99 | * @num - Local port | 99 | * @inet_num - Local port |
100 | * @saddr - Sending source | 100 | * @inet_saddr - Sending source |
101 | * @uc_ttl - Unicast TTL | 101 | * @uc_ttl - Unicast TTL |
102 | * @sport - Source port | 102 | * @inet_sport - Source port |
103 | * @id - ID counter for DF pkts | 103 | * @inet_id - ID counter for DF pkts |
104 | * @tos - TOS | 104 | * @tos - TOS |
105 | * @mc_ttl - Multicasting TTL | 105 | * @mc_ttl - Multicasting TTL |
106 | * @is_icsk - is this an inet_connection_sock? | 106 | * @is_icsk - is this an inet_connection_sock? |
@@ -115,16 +115,16 @@ struct inet_sock { | |||
115 | struct ipv6_pinfo *pinet6; | 115 | struct ipv6_pinfo *pinet6; |
116 | #endif | 116 | #endif |
117 | /* Socket demultiplex comparisons on incoming packets. */ | 117 | /* Socket demultiplex comparisons on incoming packets. */ |
118 | __be32 daddr; | 118 | __be32 inet_daddr; |
119 | __be32 rcv_saddr; | 119 | __be32 inet_rcv_saddr; |
120 | __be16 dport; | 120 | __be16 inet_dport; |
121 | __u16 num; | 121 | __u16 inet_num; |
122 | __be32 saddr; | 122 | __be32 inet_saddr; |
123 | __s16 uc_ttl; | 123 | __s16 uc_ttl; |
124 | __u16 cmsg_flags; | 124 | __u16 cmsg_flags; |
125 | struct ip_options *opt; | 125 | struct ip_options *opt; |
126 | __be16 sport; | 126 | __be16 inet_sport; |
127 | __u16 id; | 127 | __u16 inet_id; |
128 | __u8 tos; | 128 | __u8 tos; |
129 | __u8 mc_ttl; | 129 | __u8 mc_ttl; |
130 | __u8 pmtudisc; | 130 | __u8 pmtudisc; |
@@ -190,10 +190,10 @@ static inline unsigned int inet_ehashfn(struct net *net, | |||
190 | static inline int inet_sk_ehashfn(const struct sock *sk) | 190 | static inline int inet_sk_ehashfn(const struct sock *sk) |
191 | { | 191 | { |
192 | const struct inet_sock *inet = inet_sk(sk); | 192 | const struct inet_sock *inet = inet_sk(sk); |
193 | const __be32 laddr = inet->rcv_saddr; | 193 | const __be32 laddr = inet->inet_rcv_saddr; |
194 | const __u16 lport = inet->num; | 194 | const __u16 lport = inet->inet_num; |
195 | const __be32 faddr = inet->daddr; | 195 | const __be32 faddr = inet->inet_daddr; |
196 | const __be16 fport = inet->dport; | 196 | const __be16 fport = inet->inet_dport; |
197 | struct net *net = sock_net(sk); | 197 | struct net *net = sock_net(sk); |
198 | 198 | ||
199 | return inet_ehashfn(net, laddr, lport, faddr, fport); | 199 | return inet_ehashfn(net, laddr, lport, faddr, fport); |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index f93ad90a601b..773b10fa38e4 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -194,7 +194,7 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) | 194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) |
195 | { | 195 | { |
196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? |
197 | inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | 197 | inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; |
198 | } | 198 | } |
199 | 199 | ||
200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | 200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 15e1f8fe4c1f..87b1df0d4d8c 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -13,20 +13,19 @@ | |||
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
15 | 15 | ||
16 | struct inet_peer | 16 | struct inet_peer { |
17 | { | ||
18 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | 17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ |
19 | struct inet_peer *avl_left, *avl_right; | 18 | struct inet_peer *avl_left, *avl_right; |
20 | __be32 v4daddr; /* peer's address */ | 19 | __be32 v4daddr; /* peer's address */ |
21 | __u16 avl_height; | 20 | __u32 avl_height; |
22 | __u16 ip_id_count; /* IP ID for the next packet */ | ||
23 | struct list_head unused; | 21 | struct list_head unused; |
24 | __u32 dtime; /* the time of last use of not | 22 | __u32 dtime; /* the time of last use of not |
25 | * referenced entries */ | 23 | * referenced entries */ |
26 | atomic_t refcnt; | 24 | atomic_t refcnt; |
27 | atomic_t rid; /* Frag reception counter */ | 25 | atomic_t rid; /* Frag reception counter */ |
26 | atomic_t ip_id_count; /* IP ID for the next packet */ | ||
28 | __u32 tcp_ts; | 27 | __u32 tcp_ts; |
29 | unsigned long tcp_ts_stamp; | 28 | __u32 tcp_ts_stamp; |
30 | }; | 29 | }; |
31 | 30 | ||
32 | void inet_initpeers(void) __init; | 31 | void inet_initpeers(void) __init; |
@@ -37,17 +36,11 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create); | |||
37 | /* can be called from BH context or outside */ | 36 | /* can be called from BH context or outside */ |
38 | extern void inet_putpeer(struct inet_peer *p); | 37 | extern void inet_putpeer(struct inet_peer *p); |
39 | 38 | ||
40 | extern spinlock_t inet_peer_idlock; | ||
41 | /* can be called with or without local BH being disabled */ | 39 | /* can be called with or without local BH being disabled */ |
42 | static inline __u16 inet_getid(struct inet_peer *p, int more) | 40 | static inline __u16 inet_getid(struct inet_peer *p, int more) |
43 | { | 41 | { |
44 | __u16 id; | 42 | more++; |
45 | 43 | return atomic_add_return(more, &p->ip_id_count) - more; | |
46 | spin_lock_bh(&inet_peer_idlock); | ||
47 | id = p->ip_id_count; | ||
48 | p->ip_id_count += 1 + more; | ||
49 | spin_unlock_bh(&inet_peer_idlock); | ||
50 | return id; | ||
51 | } | 44 | } |
52 | 45 | ||
53 | #endif /* _NET_INETPEER_H */ | 46 | #endif /* _NET_INETPEER_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 2f47e5482b55..e6b9d12d5f62 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -33,8 +33,7 @@ | |||
33 | 33 | ||
34 | struct sock; | 34 | struct sock; |
35 | 35 | ||
36 | struct inet_skb_parm | 36 | struct inet_skb_parm { |
37 | { | ||
38 | struct ip_options opt; /* Compiled IP options */ | 37 | struct ip_options opt; /* Compiled IP options */ |
39 | unsigned char flags; | 38 | unsigned char flags; |
40 | 39 | ||
@@ -50,8 +49,7 @@ static inline unsigned int ip_hdrlen(const struct sk_buff *skb) | |||
50 | return ip_hdr(skb)->ihl * 4; | 49 | return ip_hdr(skb)->ihl * 4; |
51 | } | 50 | } |
52 | 51 | ||
53 | struct ipcm_cookie | 52 | struct ipcm_cookie { |
54 | { | ||
55 | __be32 addr; | 53 | __be32 addr; |
56 | int oif; | 54 | int oif; |
57 | struct ip_options *opt; | 55 | struct ip_options *opt; |
@@ -60,8 +58,7 @@ struct ipcm_cookie | |||
60 | 58 | ||
61 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 59 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
62 | 60 | ||
63 | struct ip_ra_chain | 61 | struct ip_ra_chain { |
64 | { | ||
65 | struct ip_ra_chain *next; | 62 | struct ip_ra_chain *next; |
66 | struct sock *sk; | 63 | struct sock *sk; |
67 | void (*destructor)(struct sock *); | 64 | void (*destructor)(struct sock *); |
@@ -159,8 +156,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
159 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, | 156 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, |
160 | unsigned int len); | 157 | unsigned int len); |
161 | 158 | ||
162 | struct ipv4_config | 159 | struct ipv4_config { |
163 | { | ||
164 | int log_martians; | 160 | int log_martians; |
165 | int no_pmtu_disc; | 161 | int no_pmtu_disc; |
166 | }; | 162 | }; |
@@ -240,8 +236,8 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str | |||
240 | * does not change, they drop every other packet in | 236 | * does not change, they drop every other packet in |
241 | * a TCP stream using header compression. | 237 | * a TCP stream using header compression. |
242 | */ | 238 | */ |
243 | iph->id = (sk && inet_sk(sk)->daddr) ? | 239 | iph->id = (sk && inet_sk(sk)->inet_daddr) ? |
244 | htons(inet_sk(sk)->id++) : 0; | 240 | htons(inet_sk(sk)->inet_id++) : 0; |
245 | } else | 241 | } else |
246 | __ip_select_ident(iph, dst, 0); | 242 | __ip_select_ident(iph, dst, 0); |
247 | } | 243 | } |
@@ -249,9 +245,9 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str | |||
249 | static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) | 245 | static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) |
250 | { | 246 | { |
251 | if (iph->frag_off & htons(IP_DF)) { | 247 | if (iph->frag_off & htons(IP_DF)) { |
252 | if (sk && inet_sk(sk)->daddr) { | 248 | if (sk && inet_sk(sk)->inet_daddr) { |
253 | iph->id = htons(inet_sk(sk)->id); | 249 | iph->id = htons(inet_sk(sk)->inet_id); |
254 | inet_sk(sk)->id += 1 + more; | 250 | inet_sk(sk)->inet_id += 1 + more; |
255 | } else | 251 | } else |
256 | iph->id = 0; | 252 | iph->id = 0; |
257 | } else | 253 | } else |
@@ -317,7 +313,7 @@ static inline void ip_ib_mc_map(__be32 naddr, const unsigned char *broadcast, ch | |||
317 | 313 | ||
318 | static __inline__ void inet_reset_saddr(struct sock *sk) | 314 | static __inline__ void inet_reset_saddr(struct sock *sk) |
319 | { | 315 | { |
320 | inet_sk(sk)->rcv_saddr = inet_sk(sk)->saddr = 0; | 316 | inet_sk(sk)->inet_rcv_saddr = inet_sk(sk)->inet_saddr = 0; |
321 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 317 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
322 | if (sk->sk_family == PF_INET6) { | 318 | if (sk->sk_family == PF_INET6) { |
323 | struct ipv6_pinfo *np = inet6_sk(sk); | 319 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -336,8 +332,7 @@ extern int ip_call_ra_chain(struct sk_buff *skb); | |||
336 | * Functions provided by ip_fragment.c | 332 | * Functions provided by ip_fragment.c |
337 | */ | 333 | */ |
338 | 334 | ||
339 | enum ip_defrag_users | 335 | enum ip_defrag_users { |
340 | { | ||
341 | IP_DEFRAG_LOCAL_DELIVER, | 336 | IP_DEFRAG_LOCAL_DELIVER, |
342 | IP_DEFRAG_CALL_RA_CHAIN, | 337 | IP_DEFRAG_CALL_RA_CHAIN, |
343 | IP_DEFRAG_CONNTRACK_IN, | 338 | IP_DEFRAG_CONNTRACK_IN, |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 15b492a9aa79..257808188add 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -30,8 +30,7 @@ | |||
30 | 30 | ||
31 | struct rt6_info; | 31 | struct rt6_info; |
32 | 32 | ||
33 | struct fib6_config | 33 | struct fib6_config { |
34 | { | ||
35 | u32 fc_table; | 34 | u32 fc_table; |
36 | u32 fc_metric; | 35 | u32 fc_metric; |
37 | int fc_dst_len; | 36 | int fc_dst_len; |
@@ -51,8 +50,7 @@ struct fib6_config | |||
51 | struct nl_info fc_nlinfo; | 50 | struct nl_info fc_nlinfo; |
52 | }; | 51 | }; |
53 | 52 | ||
54 | struct fib6_node | 53 | struct fib6_node { |
55 | { | ||
56 | struct fib6_node *parent; | 54 | struct fib6_node *parent; |
57 | struct fib6_node *left; | 55 | struct fib6_node *left; |
58 | struct fib6_node *right; | 56 | struct fib6_node *right; |
@@ -78,16 +76,14 @@ struct fib6_node | |||
78 | * | 76 | * |
79 | */ | 77 | */ |
80 | 78 | ||
81 | struct rt6key | 79 | struct rt6key { |
82 | { | ||
83 | struct in6_addr addr; | 80 | struct in6_addr addr; |
84 | int plen; | 81 | int plen; |
85 | }; | 82 | }; |
86 | 83 | ||
87 | struct fib6_table; | 84 | struct fib6_table; |
88 | 85 | ||
89 | struct rt6_info | 86 | struct rt6_info { |
90 | { | ||
91 | union { | 87 | union { |
92 | struct dst_entry dst; | 88 | struct dst_entry dst; |
93 | } u; | 89 | } u; |
@@ -127,8 +123,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | |||
127 | return ((struct rt6_info *)dst)->rt6i_idev; | 123 | return ((struct rt6_info *)dst)->rt6i_idev; |
128 | } | 124 | } |
129 | 125 | ||
130 | struct fib6_walker_t | 126 | struct fib6_walker_t { |
131 | { | ||
132 | struct fib6_walker_t *prev, *next; | 127 | struct fib6_walker_t *prev, *next; |
133 | struct fib6_node *root, *node; | 128 | struct fib6_node *root, *node; |
134 | struct rt6_info *leaf; | 129 | struct rt6_info *leaf; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 0e1b8aebaff8..4a808de7c0f6 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -103,8 +103,7 @@ extern void rt6_pmtu_discovery(struct in6_addr *daddr, | |||
103 | 103 | ||
104 | struct netlink_callback; | 104 | struct netlink_callback; |
105 | 105 | ||
106 | struct rt6_rtnl_dump_arg | 106 | struct rt6_rtnl_dump_arg { |
107 | { | ||
108 | struct sk_buff *skb; | 107 | struct sk_buff *skb; |
109 | struct netlink_callback *cb; | 108 | struct netlink_callback *cb; |
110 | struct net *net; | 109 | struct net *net; |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 4d22fabc7719..c93f94edc610 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -144,18 +144,21 @@ struct fib_table { | |||
144 | struct hlist_node tb_hlist; | 144 | struct hlist_node tb_hlist; |
145 | u32 tb_id; | 145 | u32 tb_id; |
146 | int tb_default; | 146 | int tb_default; |
147 | int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res); | ||
148 | int (*tb_insert)(struct fib_table *, struct fib_config *); | ||
149 | int (*tb_delete)(struct fib_table *, struct fib_config *); | ||
150 | int (*tb_dump)(struct fib_table *table, struct sk_buff *skb, | ||
151 | struct netlink_callback *cb); | ||
152 | int (*tb_flush)(struct fib_table *table); | ||
153 | void (*tb_select_default)(struct fib_table *table, | ||
154 | const struct flowi *flp, struct fib_result *res); | ||
155 | |||
156 | unsigned char tb_data[0]; | 147 | unsigned char tb_data[0]; |
157 | }; | 148 | }; |
158 | 149 | ||
150 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp, | ||
151 | struct fib_result *res); | ||
152 | extern int fib_table_insert(struct fib_table *, struct fib_config *); | ||
153 | extern int fib_table_delete(struct fib_table *, struct fib_config *); | ||
154 | extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, | ||
155 | struct netlink_callback *cb); | ||
156 | extern int fib_table_flush(struct fib_table *table); | ||
157 | extern void fib_table_select_default(struct fib_table *table, | ||
158 | const struct flowi *flp, | ||
159 | struct fib_result *res); | ||
160 | |||
161 | |||
159 | #ifndef CONFIG_IP_MULTIPLE_TABLES | 162 | #ifndef CONFIG_IP_MULTIPLE_TABLES |
160 | 163 | ||
161 | #define TABLE_LOCAL_INDEX 0 | 164 | #define TABLE_LOCAL_INDEX 0 |
@@ -182,11 +185,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp, | |||
182 | struct fib_table *table; | 185 | struct fib_table *table; |
183 | 186 | ||
184 | table = fib_get_table(net, RT_TABLE_LOCAL); | 187 | table = fib_get_table(net, RT_TABLE_LOCAL); |
185 | if (!table->tb_lookup(table, flp, res)) | 188 | if (!fib_table_lookup(table, flp, res)) |
186 | return 0; | 189 | return 0; |
187 | 190 | ||
188 | table = fib_get_table(net, RT_TABLE_MAIN); | 191 | table = fib_get_table(net, RT_TABLE_MAIN); |
189 | if (!table->tb_lookup(table, flp, res)) | 192 | if (!fib_table_lookup(table, flp, res)) |
190 | return 0; | 193 | return 0; |
191 | return -ENETUNREACH; | 194 | return -ENETUNREACH; |
192 | } | 195 | } |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 98978e73f666..8dc3296b7bea 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -251,8 +251,7 @@ struct ip_vs_estimator { | |||
251 | u32 outbps; | 251 | u32 outbps; |
252 | }; | 252 | }; |
253 | 253 | ||
254 | struct ip_vs_stats | 254 | struct ip_vs_stats { |
255 | { | ||
256 | struct ip_vs_stats_user ustats; /* statistics */ | 255 | struct ip_vs_stats_user ustats; /* statistics */ |
257 | struct ip_vs_estimator est; /* estimator */ | 256 | struct ip_vs_estimator est; /* estimator */ |
258 | 257 | ||
@@ -518,8 +517,7 @@ struct ip_vs_scheduler { | |||
518 | /* | 517 | /* |
519 | * The application module object (a.k.a. app incarnation) | 518 | * The application module object (a.k.a. app incarnation) |
520 | */ | 519 | */ |
521 | struct ip_vs_app | 520 | struct ip_vs_app { |
522 | { | ||
523 | struct list_head a_list; /* member in app list */ | 521 | struct list_head a_list; /* member in app list */ |
524 | int type; /* IP_VS_APP_TYPE_xxx */ | 522 | int type; /* IP_VS_APP_TYPE_xxx */ |
525 | char *name; /* application module name */ | 523 | char *name; /* application module name */ |
diff --git a/include/net/ipip.h b/include/net/ipip.h index 87acf8f3a155..11e8513d2d07 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -7,8 +7,15 @@ | |||
7 | /* Keep error state on tunnel for 30 sec */ | 7 | /* Keep error state on tunnel for 30 sec */ |
8 | #define IPTUNNEL_ERR_TIMEO (30*HZ) | 8 | #define IPTUNNEL_ERR_TIMEO (30*HZ) |
9 | 9 | ||
10 | struct ip_tunnel | 10 | /* 6rd prefix/relay information */ |
11 | { | 11 | struct ip_tunnel_6rd_parm { |
12 | struct in6_addr prefix; | ||
13 | __be32 relay_prefix; | ||
14 | u16 prefixlen; | ||
15 | u16 relay_prefixlen; | ||
16 | }; | ||
17 | |||
18 | struct ip_tunnel { | ||
12 | struct ip_tunnel *next; | 19 | struct ip_tunnel *next; |
13 | struct net_device *dev; | 20 | struct net_device *dev; |
14 | 21 | ||
@@ -23,15 +30,19 @@ struct ip_tunnel | |||
23 | 30 | ||
24 | struct ip_tunnel_parm parms; | 31 | struct ip_tunnel_parm parms; |
25 | 32 | ||
33 | /* for SIT */ | ||
34 | #ifdef CONFIG_IPV6_SIT_6RD | ||
35 | struct ip_tunnel_6rd_parm ip6rd; | ||
36 | #endif | ||
26 | struct ip_tunnel_prl_entry *prl; /* potential router list */ | 37 | struct ip_tunnel_prl_entry *prl; /* potential router list */ |
27 | unsigned int prl_count; /* # of entries in PRL */ | 38 | unsigned int prl_count; /* # of entries in PRL */ |
28 | }; | 39 | }; |
29 | 40 | ||
30 | struct ip_tunnel_prl_entry | 41 | struct ip_tunnel_prl_entry { |
31 | { | ||
32 | struct ip_tunnel_prl_entry *next; | 42 | struct ip_tunnel_prl_entry *next; |
33 | __be32 addr; | 43 | __be32 addr; |
34 | u16 flags; | 44 | u16 flags; |
45 | struct rcu_head rcu_head; | ||
35 | }; | 46 | }; |
36 | 47 | ||
37 | #define IPTUNNEL_XMIT() do { \ | 48 | #define IPTUNNEL_XMIT() do { \ |
@@ -42,9 +53,9 @@ struct ip_tunnel_prl_entry | |||
42 | ip_select_ident(iph, &rt->u.dst, NULL); \ | 53 | ip_select_ident(iph, &rt->u.dst, NULL); \ |
43 | \ | 54 | \ |
44 | err = ip_local_out(skb); \ | 55 | err = ip_local_out(skb); \ |
45 | if (net_xmit_eval(err) == 0) { \ | 56 | if (likely(net_xmit_eval(err) == 0)) { \ |
46 | stats->tx_bytes += pkt_len; \ | 57 | txq->tx_bytes += pkt_len; \ |
47 | stats->tx_packets++; \ | 58 | txq->tx_packets++; \ |
48 | } else { \ | 59 | } else { \ |
49 | stats->tx_errors++; \ | 60 | stats->tx_errors++; \ |
50 | stats->tx_aborted_errors++; \ | 61 | stats->tx_aborted_errors++; \ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 8c31d8a0c1fe..92db8617d188 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -160,8 +160,7 @@ extern struct ctl_path net_ipv6_ctl_path[]; | |||
160 | #define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ | 160 | #define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ |
161 | _DEVINC(net, icmpv6msg, _BH, idev, field) | 161 | _DEVINC(net, icmpv6msg, _BH, idev, field) |
162 | 162 | ||
163 | struct ip6_ra_chain | 163 | struct ip6_ra_chain { |
164 | { | ||
165 | struct ip6_ra_chain *next; | 164 | struct ip6_ra_chain *next; |
166 | struct sock *sk; | 165 | struct sock *sk; |
167 | int sel; | 166 | int sel; |
@@ -176,8 +175,7 @@ extern rwlock_t ip6_ra_lock; | |||
176 | ancillary data and passed to IPv6. | 175 | ancillary data and passed to IPv6. |
177 | */ | 176 | */ |
178 | 177 | ||
179 | struct ipv6_txoptions | 178 | struct ipv6_txoptions { |
180 | { | ||
181 | /* Length of this structure */ | 179 | /* Length of this structure */ |
182 | int tot_len; | 180 | int tot_len; |
183 | 181 | ||
@@ -194,8 +192,7 @@ struct ipv6_txoptions | |||
194 | /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ | 192 | /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ |
195 | }; | 193 | }; |
196 | 194 | ||
197 | struct ip6_flowlabel | 195 | struct ip6_flowlabel { |
198 | { | ||
199 | struct ip6_flowlabel *next; | 196 | struct ip6_flowlabel *next; |
200 | __be32 label; | 197 | __be32 label; |
201 | atomic_t users; | 198 | atomic_t users; |
@@ -212,8 +209,7 @@ struct ip6_flowlabel | |||
212 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) | 209 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) |
213 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) | 210 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) |
214 | 211 | ||
215 | struct ipv6_fl_socklist | 212 | struct ipv6_fl_socklist { |
216 | { | ||
217 | struct ipv6_fl_socklist *next; | 213 | struct ipv6_fl_socklist *next; |
218 | struct ip6_flowlabel *fl; | 214 | struct ip6_flowlabel *fl; |
219 | }; | 215 | }; |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index e9054a283fde..b2b98f3fa265 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
@@ -300,8 +300,7 @@ | |||
300 | * This struct is also my long term insurance. I can add new fields here | 300 | * This struct is also my long term insurance. I can add new fields here |
301 | * without breaking the prototype of iw_handler... | 301 | * without breaking the prototype of iw_handler... |
302 | */ | 302 | */ |
303 | struct iw_request_info | 303 | struct iw_request_info { |
304 | { | ||
305 | __u16 cmd; /* Wireless Extension command */ | 304 | __u16 cmd; /* Wireless Extension command */ |
306 | __u16 flags; /* More to come ;-) */ | 305 | __u16 flags; /* More to come ;-) */ |
307 | }; | 306 | }; |
@@ -321,20 +320,20 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info, | |||
321 | * shared by all driver instances... Same for the members... | 320 | * shared by all driver instances... Same for the members... |
322 | * This will be linked from net_device in <linux/netdevice.h> | 321 | * This will be linked from net_device in <linux/netdevice.h> |
323 | */ | 322 | */ |
324 | struct iw_handler_def | 323 | struct iw_handler_def { |
325 | { | ||
326 | /* Number of handlers defined (more precisely, index of the | ||
327 | * last defined handler + 1) */ | ||
328 | __u16 num_standard; | ||
329 | __u16 num_private; | ||
330 | /* Number of private arg description */ | ||
331 | __u16 num_private_args; | ||
332 | 324 | ||
333 | /* Array of handlers for standard ioctls | 325 | /* Array of handlers for standard ioctls |
334 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] | 326 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] |
335 | */ | 327 | */ |
336 | const iw_handler * standard; | 328 | const iw_handler * standard; |
329 | /* Number of handlers defined (more precisely, index of the | ||
330 | * last defined handler + 1) */ | ||
331 | __u16 num_standard; | ||
337 | 332 | ||
333 | #ifdef CONFIG_WEXT_PRIV | ||
334 | __u16 num_private; | ||
335 | /* Number of private arg description */ | ||
336 | __u16 num_private_args; | ||
338 | /* Array of handlers for private ioctls | 337 | /* Array of handlers for private ioctls |
339 | * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] | 338 | * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] |
340 | */ | 339 | */ |
@@ -344,6 +343,7 @@ struct iw_handler_def | |||
344 | * can put it in any order you want and should not leave holes... | 343 | * can put it in any order you want and should not leave holes... |
345 | * We will automatically export that to user space... */ | 344 | * We will automatically export that to user space... */ |
346 | const struct iw_priv_args * private_args; | 345 | const struct iw_priv_args * private_args; |
346 | #endif | ||
347 | 347 | ||
348 | /* New location of get_wireless_stats, to de-bloat struct net_device. | 348 | /* New location of get_wireless_stats, to de-bloat struct net_device. |
349 | * The old pointer in struct net_device will be gradually phased | 349 | * The old pointer in struct net_device will be gradually phased |
@@ -370,8 +370,7 @@ struct iw_handler_def | |||
370 | /* | 370 | /* |
371 | * Describe how a standard IOCTL looks like. | 371 | * Describe how a standard IOCTL looks like. |
372 | */ | 372 | */ |
373 | struct iw_ioctl_description | 373 | struct iw_ioctl_description { |
374 | { | ||
375 | __u8 header_type; /* NULL, iw_point or other */ | 374 | __u8 header_type; /* NULL, iw_point or other */ |
376 | __u8 token_type; /* Future */ | 375 | __u8 token_type; /* Future */ |
377 | __u16 token_size; /* Granularity of payload */ | 376 | __u16 token_size; /* Granularity of payload */ |
@@ -393,8 +392,7 @@ struct iw_ioctl_description | |||
393 | /* | 392 | /* |
394 | * Instance specific spy data, i.e. addresses spied and quality for them. | 393 | * Instance specific spy data, i.e. addresses spied and quality for them. |
395 | */ | 394 | */ |
396 | struct iw_spy_data | 395 | struct iw_spy_data { |
397 | { | ||
398 | /* --- Standard spy support --- */ | 396 | /* --- Standard spy support --- */ |
399 | int spy_number; | 397 | int spy_number; |
400 | u_char spy_address[IW_MAX_SPY][ETH_ALEN]; | 398 | u_char spy_address[IW_MAX_SPY][ETH_ALEN]; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 998c30fc8981..68a9c5f3412f 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -219,7 +219,7 @@ struct ieee80211_bss_conf { | |||
219 | * | 219 | * |
220 | * These flags are used with the @flags member of &ieee80211_tx_info. | 220 | * These flags are used with the @flags member of &ieee80211_tx_info. |
221 | * | 221 | * |
222 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. | 222 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame. |
223 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence | 223 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence |
224 | * number to this frame, taking care of not overwriting the fragment | 224 | * number to this frame, taking care of not overwriting the fragment |
225 | * number and increasing the sequence number only when the | 225 | * number and increasing the sequence number only when the |
@@ -390,10 +390,12 @@ struct ieee80211_tx_rate { | |||
390 | * @control: union for control data | 390 | * @control: union for control data |
391 | * @status: union for status data | 391 | * @status: union for status data |
392 | * @driver_data: array of driver_data pointers | 392 | * @driver_data: array of driver_data pointers |
393 | * @ampdu_ack_len: number of aggregated frames. | 393 | * @ampdu_ack_len: number of acked aggregated frames. |
394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
395 | * @ampdu_ack_map: block ack bit map for the aggregation. | 395 | * @ampdu_ack_map: block ack bit map for the aggregation. |
396 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 396 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
397 | * @ampdu_len: number of aggregated frames. | ||
398 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
397 | * @ack_signal: signal strength of the ACK frame | 399 | * @ack_signal: signal strength of the ACK frame |
398 | */ | 400 | */ |
399 | struct ieee80211_tx_info { | 401 | struct ieee80211_tx_info { |
@@ -428,7 +430,8 @@ struct ieee80211_tx_info { | |||
428 | u8 ampdu_ack_len; | 430 | u8 ampdu_ack_len; |
429 | u64 ampdu_ack_map; | 431 | u64 ampdu_ack_map; |
430 | int ack_signal; | 432 | int ack_signal; |
431 | /* 8 bytes free */ | 433 | u8 ampdu_len; |
434 | /* 7 bytes free */ | ||
432 | } status; | 435 | } status; |
433 | struct { | 436 | struct { |
434 | struct ieee80211_tx_rate driver_rates[ | 437 | struct ieee80211_tx_rate driver_rates[ |
@@ -494,7 +497,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
494 | * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. | 497 | * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. |
495 | * Use together with %RX_FLAG_MMIC_STRIPPED. | 498 | * Use together with %RX_FLAG_MMIC_STRIPPED. |
496 | * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. | 499 | * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. |
497 | * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header. | ||
498 | * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, | 500 | * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, |
499 | * verification has been done by the hardware. | 501 | * verification has been done by the hardware. |
500 | * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. | 502 | * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. |
@@ -515,7 +517,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
515 | enum mac80211_rx_flags { | 517 | enum mac80211_rx_flags { |
516 | RX_FLAG_MMIC_ERROR = 1<<0, | 518 | RX_FLAG_MMIC_ERROR = 1<<0, |
517 | RX_FLAG_DECRYPTED = 1<<1, | 519 | RX_FLAG_DECRYPTED = 1<<1, |
518 | RX_FLAG_RADIOTAP = 1<<2, | ||
519 | RX_FLAG_MMIC_STRIPPED = 1<<3, | 520 | RX_FLAG_MMIC_STRIPPED = 1<<3, |
520 | RX_FLAG_IV_STRIPPED = 1<<4, | 521 | RX_FLAG_IV_STRIPPED = 1<<4, |
521 | RX_FLAG_FAILED_FCS_CRC = 1<<5, | 522 | RX_FLAG_FAILED_FCS_CRC = 1<<5, |
@@ -554,7 +555,7 @@ struct ieee80211_rx_status { | |||
554 | int freq; | 555 | int freq; |
555 | int signal; | 556 | int signal; |
556 | int noise; | 557 | int noise; |
557 | int qual; | 558 | int __deprecated qual; |
558 | int antenna; | 559 | int antenna; |
559 | int rate_idx; | 560 | int rate_idx; |
560 | int flag; | 561 | int flag; |
@@ -565,7 +566,9 @@ struct ieee80211_rx_status { | |||
565 | * | 566 | * |
566 | * Flags to define PHY configuration options | 567 | * Flags to define PHY configuration options |
567 | * | 568 | * |
568 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) | 569 | * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this |
570 | * to determine for example whether to calculate timestamps for packets | ||
571 | * or not, do not use instead of filter flags! | ||
569 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) | 572 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) |
570 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set | 573 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set |
571 | * the driver should be prepared to handle configuration requests but | 574 | * the driver should be prepared to handle configuration requests but |
@@ -574,7 +577,7 @@ struct ieee80211_rx_status { | |||
574 | * it can also be unset in that case when monitor interfaces are active. | 577 | * it can also be unset in that case when monitor interfaces are active. |
575 | */ | 578 | */ |
576 | enum ieee80211_conf_flags { | 579 | enum ieee80211_conf_flags { |
577 | IEEE80211_CONF_RADIOTAP = (1<<0), | 580 | IEEE80211_CONF_MONITOR = (1<<0), |
578 | IEEE80211_CONF_PS = (1<<1), | 581 | IEEE80211_CONF_PS = (1<<1), |
579 | IEEE80211_CONF_IDLE = (1<<2), | 582 | IEEE80211_CONF_IDLE = (1<<2), |
580 | }; | 583 | }; |
@@ -584,7 +587,7 @@ enum ieee80211_conf_flags { | |||
584 | * enum ieee80211_conf_changed - denotes which configuration changed | 587 | * enum ieee80211_conf_changed - denotes which configuration changed |
585 | * | 588 | * |
586 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed | 589 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed |
587 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed | 590 | * @IEEE80211_CONF_CHANGE_MONITOR: the monitor flag changed |
588 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed | 591 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed |
589 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed | 592 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed |
590 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed | 593 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed |
@@ -593,7 +596,7 @@ enum ieee80211_conf_flags { | |||
593 | */ | 596 | */ |
594 | enum ieee80211_conf_changed { | 597 | enum ieee80211_conf_changed { |
595 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), | 598 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), |
596 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), | 599 | IEEE80211_CONF_CHANGE_MONITOR = BIT(3), |
597 | IEEE80211_CONF_CHANGE_PS = BIT(4), | 600 | IEEE80211_CONF_CHANGE_PS = BIT(4), |
598 | IEEE80211_CONF_CHANGE_POWER = BIT(5), | 601 | IEEE80211_CONF_CHANGE_POWER = BIT(5), |
599 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 602 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), |
@@ -852,6 +855,19 @@ enum ieee80211_tkip_key_type { | |||
852 | * any particular flags. There are some exceptions to this rule, | 855 | * any particular flags. There are some exceptions to this rule, |
853 | * however, so you are advised to review these flags carefully. | 856 | * however, so you are advised to review these flags carefully. |
854 | * | 857 | * |
858 | * @IEEE80211_HW_HAS_RATE_CONTROL: | ||
859 | * The hardware or firmware includes rate control, and cannot be | ||
860 | * controlled by the stack. As such, no rate control algorithm | ||
861 | * should be instantiated, and the TX rate reported to userspace | ||
862 | * will be taken from the TX status instead of the rate control | ||
863 | * algorithm. | ||
864 | * Note that this requires that the driver implement a number of | ||
865 | * callbacks so it has the correct information, it needs to have | ||
866 | * the @set_rts_threshold callback and must look at the BSS config | ||
867 | * @use_cts_prot for G/N protection, @use_short_slot for slot | ||
868 | * timing in 2.4 GHz and @use_short_preamble for preambles for | ||
869 | * CCK frames. | ||
870 | * | ||
855 | * @IEEE80211_HW_RX_INCLUDES_FCS: | 871 | * @IEEE80211_HW_RX_INCLUDES_FCS: |
856 | * Indicates that received frames passed to the stack include | 872 | * Indicates that received frames passed to the stack include |
857 | * the FCS at the end. | 873 | * the FCS at the end. |
@@ -910,6 +926,7 @@ enum ieee80211_tkip_key_type { | |||
910 | * avoid waking up cpu. | 926 | * avoid waking up cpu. |
911 | */ | 927 | */ |
912 | enum ieee80211_hw_flags { | 928 | enum ieee80211_hw_flags { |
929 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | ||
913 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, | 930 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, |
914 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 931 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
915 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 932 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
@@ -1511,6 +1528,7 @@ struct ieee80211_ops { | |||
1511 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1528 | void (*reset_tsf)(struct ieee80211_hw *hw); |
1512 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1529 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1513 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1530 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1531 | struct ieee80211_vif *vif, | ||
1514 | enum ieee80211_ampdu_mlme_action action, | 1532 | enum ieee80211_ampdu_mlme_action action, |
1515 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1533 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
1516 | 1534 | ||
@@ -1667,15 +1685,14 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw); | |||
1667 | * ieee80211_rx - receive frame | 1685 | * ieee80211_rx - receive frame |
1668 | * | 1686 | * |
1669 | * Use this function to hand received frames to mac80211. The receive | 1687 | * Use this function to hand received frames to mac80211. The receive |
1670 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap | 1688 | * buffer in @skb must start with an IEEE 802.11 header. |
1671 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. | ||
1672 | * | 1689 | * |
1673 | * This function may not be called in IRQ context. Calls to this function | 1690 | * This function may not be called in IRQ context. Calls to this function |
1674 | * for a single hardware must be synchronized against each other. Calls | 1691 | * for a single hardware must be synchronized against each other. Calls to |
1675 | * to this function and ieee80211_rx_irqsafe() may not be mixed for a | 1692 | * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be |
1676 | * single hardware. | 1693 | * mixed for a single hardware. |
1677 | * | 1694 | * |
1678 | * Note that right now, this function must be called with softirqs disabled. | 1695 | * In process context use instead ieee80211_rx_ni(). |
1679 | * | 1696 | * |
1680 | * @hw: the hardware this frame came in on | 1697 | * @hw: the hardware this frame came in on |
1681 | * @skb: the buffer to receive, owned by mac80211 after this call | 1698 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1688,8 +1705,8 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1688 | * Like ieee80211_rx() but can be called in IRQ context | 1705 | * Like ieee80211_rx() but can be called in IRQ context |
1689 | * (internally defers to a tasklet.) | 1706 | * (internally defers to a tasklet.) |
1690 | * | 1707 | * |
1691 | * Calls to this function and ieee80211_rx() may not be mixed for a | 1708 | * Calls to this function, ieee80211_rx() or ieee80211_rx_ni() may not |
1692 | * single hardware. | 1709 | * be mixed for a single hardware. |
1693 | * | 1710 | * |
1694 | * @hw: the hardware this frame came in on | 1711 | * @hw: the hardware this frame came in on |
1695 | * @skb: the buffer to receive, owned by mac80211 after this call | 1712 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1697,6 +1714,26 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1697 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); | 1714 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); |
1698 | 1715 | ||
1699 | /** | 1716 | /** |
1717 | * ieee80211_rx_ni - receive frame (in process context) | ||
1718 | * | ||
1719 | * Like ieee80211_rx() but can be called in process context | ||
1720 | * (internally disables bottom halves). | ||
1721 | * | ||
1722 | * Calls to this function, ieee80211_rx() and ieee80211_rx_irqsafe() may | ||
1723 | * not be mixed for a single hardware. | ||
1724 | * | ||
1725 | * @hw: the hardware this frame came in on | ||
1726 | * @skb: the buffer to receive, owned by mac80211 after this call | ||
1727 | */ | ||
1728 | static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | ||
1729 | struct sk_buff *skb) | ||
1730 | { | ||
1731 | local_bh_disable(); | ||
1732 | ieee80211_rx(hw, skb); | ||
1733 | local_bh_enable(); | ||
1734 | } | ||
1735 | |||
1736 | /** | ||
1700 | * ieee80211_tx_status - transmit status callback | 1737 | * ieee80211_tx_status - transmit status callback |
1701 | * | 1738 | * |
1702 | * Call this function for all transmitted frames after they have been | 1739 | * Call this function for all transmitted frames after they have been |
@@ -1730,19 +1767,45 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
1730 | struct sk_buff *skb); | 1767 | struct sk_buff *skb); |
1731 | 1768 | ||
1732 | /** | 1769 | /** |
1733 | * ieee80211_beacon_get - beacon generation function | 1770 | * ieee80211_beacon_get_tim - beacon generation function |
1734 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1771 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1735 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1772 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1773 | * @tim_offset: pointer to variable that will receive the TIM IE offset. | ||
1774 | * Set to 0 if invalid (in non-AP modes). | ||
1775 | * @tim_length: pointer to variable that will receive the TIM IE length, | ||
1776 | * (including the ID and length bytes!). | ||
1777 | * Set to 0 if invalid (in non-AP modes). | ||
1778 | * | ||
1779 | * If the driver implements beaconing modes, it must use this function to | ||
1780 | * obtain the beacon frame/template. | ||
1736 | * | 1781 | * |
1737 | * If the beacon frames are generated by the host system (i.e., not in | 1782 | * If the beacon frames are generated by the host system (i.e., not in |
1738 | * hardware/firmware), the low-level driver uses this function to receive | 1783 | * hardware/firmware), the driver uses this function to get each beacon |
1739 | * the next beacon frame from the 802.11 code. The low-level is responsible | 1784 | * frame from mac80211 -- it is responsible for calling this function |
1740 | * for calling this function before beacon data is needed (e.g., based on | 1785 | * before the beacon is needed (e.g. based on hardware interrupt). |
1741 | * hardware interrupt). Returned skb is used only once and low-level driver | 1786 | * |
1742 | * is responsible for freeing it. | 1787 | * If the beacon frames are generated by the device, then the driver |
1788 | * must use the returned beacon as the template and change the TIM IE | ||
1789 | * according to the current DTIM parameters/TIM bitmap. | ||
1790 | * | ||
1791 | * The driver is responsible for freeing the returned skb. | ||
1743 | */ | 1792 | */ |
1744 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 1793 | struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, |
1745 | struct ieee80211_vif *vif); | 1794 | struct ieee80211_vif *vif, |
1795 | u16 *tim_offset, u16 *tim_length); | ||
1796 | |||
1797 | /** | ||
1798 | * ieee80211_beacon_get - beacon generation function | ||
1799 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
1800 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | ||
1801 | * | ||
1802 | * See ieee80211_beacon_get_tim(). | ||
1803 | */ | ||
1804 | static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | ||
1805 | struct ieee80211_vif *vif) | ||
1806 | { | ||
1807 | return ieee80211_beacon_get_tim(hw, vif, NULL, NULL); | ||
1808 | } | ||
1746 | 1809 | ||
1747 | /** | 1810 | /** |
1748 | * ieee80211_rts_get - RTS frame generation function | 1811 | * ieee80211_rts_get - RTS frame generation function |
@@ -1987,8 +2050,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
1987 | 2050 | ||
1988 | /** | 2051 | /** |
1989 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2052 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
1990 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2053 | * @sta: the station for which to start a BA session |
1991 | * @ra: receiver address of the BA session recipient | ||
1992 | * @tid: the TID to BA on. | 2054 | * @tid: the TID to BA on. |
1993 | * | 2055 | * |
1994 | * Return: success if addBA request was sent, failure otherwise | 2056 | * Return: success if addBA request was sent, failure otherwise |
@@ -1997,22 +2059,22 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
1997 | * the need to start aggregation on a certain RA/TID, the session level | 2059 | * the need to start aggregation on a certain RA/TID, the session level |
1998 | * will be managed by the mac80211. | 2060 | * will be managed by the mac80211. |
1999 | */ | 2061 | */ |
2000 | int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid); | 2062 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
2001 | 2063 | ||
2002 | /** | 2064 | /** |
2003 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | 2065 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. |
2004 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2066 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2005 | * @ra: receiver address of the BA session recipient. | 2067 | * @ra: receiver address of the BA session recipient. |
2006 | * @tid: the TID to BA on. | 2068 | * @tid: the TID to BA on. |
2007 | * | 2069 | * |
2008 | * This function must be called by low level driver once it has | 2070 | * This function must be called by low level driver once it has |
2009 | * finished with preparations for the BA session. | 2071 | * finished with preparations for the BA session. |
2010 | */ | 2072 | */ |
2011 | void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | 2073 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); |
2012 | 2074 | ||
2013 | /** | 2075 | /** |
2014 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2076 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
2015 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2077 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2016 | * @ra: receiver address of the BA session recipient. | 2078 | * @ra: receiver address of the BA session recipient. |
2017 | * @tid: the TID to BA on. | 2079 | * @tid: the TID to BA on. |
2018 | * | 2080 | * |
@@ -2020,13 +2082,12 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | |||
2020 | * finished with preparations for the BA session. | 2082 | * finished with preparations for the BA session. |
2021 | * This version of the function is IRQ-safe. | 2083 | * This version of the function is IRQ-safe. |
2022 | */ | 2084 | */ |
2023 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 2085 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2024 | u16 tid); | 2086 | u16 tid); |
2025 | 2087 | ||
2026 | /** | 2088 | /** |
2027 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. | 2089 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. |
2028 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2090 | * @sta: the station whose BA session to stop |
2029 | * @ra: receiver address of the BA session recipient | ||
2030 | * @tid: the TID to stop BA. | 2091 | * @tid: the TID to stop BA. |
2031 | * @initiator: if indicates initiator DELBA frame will be sent. | 2092 | * @initiator: if indicates initiator DELBA frame will be sent. |
2032 | * | 2093 | * |
@@ -2036,24 +2097,23 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
2036 | * the need to stop aggregation on a certain RA/TID, the session level | 2097 | * the need to stop aggregation on a certain RA/TID, the session level |
2037 | * will be managed by the mac80211. | 2098 | * will be managed by the mac80211. |
2038 | */ | 2099 | */ |
2039 | int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, | 2100 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
2040 | u8 *ra, u16 tid, | ||
2041 | enum ieee80211_back_parties initiator); | 2101 | enum ieee80211_back_parties initiator); |
2042 | 2102 | ||
2043 | /** | 2103 | /** |
2044 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | 2104 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. |
2045 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2105 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2046 | * @ra: receiver address of the BA session recipient. | 2106 | * @ra: receiver address of the BA session recipient. |
2047 | * @tid: the desired TID to BA on. | 2107 | * @tid: the desired TID to BA on. |
2048 | * | 2108 | * |
2049 | * This function must be called by low level driver once it has | 2109 | * This function must be called by low level driver once it has |
2050 | * finished with preparations for the BA session tear down. | 2110 | * finished with preparations for the BA session tear down. |
2051 | */ | 2111 | */ |
2052 | void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | 2112 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); |
2053 | 2113 | ||
2054 | /** | 2114 | /** |
2055 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | 2115 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. |
2056 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2116 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2057 | * @ra: receiver address of the BA session recipient. | 2117 | * @ra: receiver address of the BA session recipient. |
2058 | * @tid: the desired TID to BA on. | 2118 | * @tid: the desired TID to BA on. |
2059 | * | 2119 | * |
@@ -2061,22 +2121,75 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | |||
2061 | * finished with preparations for the BA session tear down. | 2121 | * finished with preparations for the BA session tear down. |
2062 | * This version of the function is IRQ-safe. | 2122 | * This version of the function is IRQ-safe. |
2063 | */ | 2123 | */ |
2064 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 2124 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2065 | u16 tid); | 2125 | u16 tid); |
2066 | 2126 | ||
2067 | /** | 2127 | /** |
2068 | * ieee80211_find_sta - find a station | 2128 | * ieee80211_find_sta - find a station |
2069 | * | 2129 | * |
2070 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 2130 | * @vif: virtual interface to look for station on |
2071 | * @addr: station's address | 2131 | * @addr: station's address |
2072 | * | 2132 | * |
2073 | * This function must be called under RCU lock and the | 2133 | * This function must be called under RCU lock and the |
2074 | * resulting pointer is only valid under RCU lock as well. | 2134 | * resulting pointer is only valid under RCU lock as well. |
2075 | */ | 2135 | */ |
2076 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, | 2136 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, |
2077 | const u8 *addr); | 2137 | const u8 *addr); |
2078 | 2138 | ||
2079 | /** | 2139 | /** |
2140 | * ieee80211_find_sta_by_hw - find a station on hardware | ||
2141 | * | ||
2142 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2143 | * @addr: station's address | ||
2144 | * | ||
2145 | * This function must be called under RCU lock and the | ||
2146 | * resulting pointer is only valid under RCU lock as well. | ||
2147 | * | ||
2148 | * NOTE: This function should not be used! When mac80211 is converted | ||
2149 | * internally to properly keep track of stations on multiple | ||
2150 | * virtual interfaces, it will not always know which station to | ||
2151 | * return here since a single address might be used by multiple | ||
2152 | * logical stations (e.g. consider a station connecting to another | ||
2153 | * BSSID on the same AP hardware without disconnecting first). | ||
2154 | * | ||
2155 | * DO NOT USE THIS FUNCTION. | ||
2156 | */ | ||
2157 | struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, | ||
2158 | const u8 *addr); | ||
2159 | |||
2160 | /** | ||
2161 | * ieee80211_sta_block_awake - block station from waking up | ||
2162 | * @hw: the hardware | ||
2163 | * @pubsta: the station | ||
2164 | * @block: whether to block or unblock | ||
2165 | * | ||
2166 | * Some devices require that all frames that are on the queues | ||
2167 | * for a specific station that went to sleep are flushed before | ||
2168 | * a poll response or frames after the station woke up can be | ||
2169 | * delivered to that it. Note that such frames must be rejected | ||
2170 | * by the driver as filtered, with the appropriate status flag. | ||
2171 | * | ||
2172 | * This function allows implementing this mode in a race-free | ||
2173 | * manner. | ||
2174 | * | ||
2175 | * To do this, a driver must keep track of the number of frames | ||
2176 | * still enqueued for a specific station. If this number is not | ||
2177 | * zero when the station goes to sleep, the driver must call | ||
2178 | * this function to force mac80211 to consider the station to | ||
2179 | * be asleep regardless of the station's actual state. Once the | ||
2180 | * number of outstanding frames reaches zero, the driver must | ||
2181 | * call this function again to unblock the station. That will | ||
2182 | * cause mac80211 to be able to send ps-poll responses, and if | ||
2183 | * the station queried in the meantime then frames will also | ||
2184 | * be sent out as a result of this. Additionally, the driver | ||
2185 | * will be notified that the station woke up some time after | ||
2186 | * it is unblocked, regardless of whether the station actually | ||
2187 | * woke up while blocked or not. | ||
2188 | */ | ||
2189 | void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | ||
2190 | struct ieee80211_sta *pubsta, bool block); | ||
2191 | |||
2192 | /** | ||
2080 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2193 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
2081 | * | 2194 | * |
2082 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2195 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 3817fda82a80..db8e96dd114e 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -37,8 +37,7 @@ | |||
37 | 37 | ||
38 | struct neighbour; | 38 | struct neighbour; |
39 | 39 | ||
40 | struct neigh_parms | 40 | struct neigh_parms { |
41 | { | ||
42 | #ifdef CONFIG_NET_NS | 41 | #ifdef CONFIG_NET_NS |
43 | struct net *net; | 42 | struct net *net; |
44 | #endif | 43 | #endif |
@@ -70,8 +69,7 @@ struct neigh_parms | |||
70 | int locktime; | 69 | int locktime; |
71 | }; | 70 | }; |
72 | 71 | ||
73 | struct neigh_statistics | 72 | struct neigh_statistics { |
74 | { | ||
75 | unsigned long allocs; /* number of allocated neighs */ | 73 | unsigned long allocs; /* number of allocated neighs */ |
76 | unsigned long destroys; /* number of destroyed neighs */ | 74 | unsigned long destroys; /* number of destroyed neighs */ |
77 | unsigned long hash_grows; /* number of hash resizes */ | 75 | unsigned long hash_grows; /* number of hash resizes */ |
@@ -97,8 +95,7 @@ struct neigh_statistics | |||
97 | preempt_enable(); \ | 95 | preempt_enable(); \ |
98 | } while (0) | 96 | } while (0) |
99 | 97 | ||
100 | struct neighbour | 98 | struct neighbour { |
101 | { | ||
102 | struct neighbour *next; | 99 | struct neighbour *next; |
103 | struct neigh_table *tbl; | 100 | struct neigh_table *tbl; |
104 | struct neigh_parms *parms; | 101 | struct neigh_parms *parms; |
@@ -122,8 +119,7 @@ struct neighbour | |||
122 | u8 primary_key[0]; | 119 | u8 primary_key[0]; |
123 | }; | 120 | }; |
124 | 121 | ||
125 | struct neigh_ops | 122 | struct neigh_ops { |
126 | { | ||
127 | int family; | 123 | int family; |
128 | void (*solicit)(struct neighbour *, struct sk_buff*); | 124 | void (*solicit)(struct neighbour *, struct sk_buff*); |
129 | void (*error_report)(struct neighbour *, struct sk_buff*); | 125 | void (*error_report)(struct neighbour *, struct sk_buff*); |
@@ -133,8 +129,7 @@ struct neigh_ops | |||
133 | int (*queue_xmit)(struct sk_buff*); | 129 | int (*queue_xmit)(struct sk_buff*); |
134 | }; | 130 | }; |
135 | 131 | ||
136 | struct pneigh_entry | 132 | struct pneigh_entry { |
137 | { | ||
138 | struct pneigh_entry *next; | 133 | struct pneigh_entry *next; |
139 | #ifdef CONFIG_NET_NS | 134 | #ifdef CONFIG_NET_NS |
140 | struct net *net; | 135 | struct net *net; |
@@ -149,8 +144,7 @@ struct pneigh_entry | |||
149 | */ | 144 | */ |
150 | 145 | ||
151 | 146 | ||
152 | struct neigh_table | 147 | struct neigh_table { |
153 | { | ||
154 | struct neigh_table *next; | 148 | struct neigh_table *next; |
155 | int family; | 149 | int family; |
156 | int entry_size; | 150 | int entry_size; |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index a1202841aadd..24a8c5591f63 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -28,6 +28,10 @@ struct ctl_table_header; | |||
28 | struct net_generic; | 28 | struct net_generic; |
29 | struct sock; | 29 | struct sock; |
30 | 30 | ||
31 | |||
32 | #define NETDEV_HASHBITS 8 | ||
33 | #define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) | ||
34 | |||
31 | struct net { | 35 | struct net { |
32 | atomic_t count; /* To decided when the network | 36 | atomic_t count; /* To decided when the network |
33 | * namespace should be freed. | 37 | * namespace should be freed. |
@@ -38,7 +42,7 @@ struct net { | |||
38 | */ | 42 | */ |
39 | #endif | 43 | #endif |
40 | struct list_head list; /* list of network namespaces */ | 44 | struct list_head list; /* list of network namespaces */ |
41 | struct work_struct work; /* work struct for freeing */ | 45 | struct list_head cleanup_list; /* namespaces on death row */ |
42 | 46 | ||
43 | struct proc_dir_entry *proc_net; | 47 | struct proc_dir_entry *proc_net; |
44 | struct proc_dir_entry *proc_net_stat; | 48 | struct proc_dir_entry *proc_net_stat; |
@@ -80,7 +84,7 @@ struct net { | |||
80 | #ifdef CONFIG_XFRM | 84 | #ifdef CONFIG_XFRM |
81 | struct netns_xfrm xfrm; | 85 | struct netns_xfrm xfrm; |
82 | #endif | 86 | #endif |
83 | #ifdef CONFIG_WIRELESS_EXT | 87 | #ifdef CONFIG_WEXT_CORE |
84 | struct sk_buff_head wext_nlevents; | 88 | struct sk_buff_head wext_nlevents; |
85 | #endif | 89 | #endif |
86 | struct net_generic *gen; | 90 | struct net_generic *gen; |
@@ -232,6 +236,8 @@ struct pernet_operations { | |||
232 | struct list_head list; | 236 | struct list_head list; |
233 | int (*init)(struct net *net); | 237 | int (*init)(struct net *net); |
234 | void (*exit)(struct net *net); | 238 | void (*exit)(struct net *net); |
239 | int *id; | ||
240 | size_t size; | ||
235 | }; | 241 | }; |
236 | 242 | ||
237 | /* | 243 | /* |
@@ -255,12 +261,8 @@ struct pernet_operations { | |||
255 | */ | 261 | */ |
256 | extern int register_pernet_subsys(struct pernet_operations *); | 262 | extern int register_pernet_subsys(struct pernet_operations *); |
257 | extern void unregister_pernet_subsys(struct pernet_operations *); | 263 | extern void unregister_pernet_subsys(struct pernet_operations *); |
258 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); | ||
259 | extern void unregister_pernet_gen_subsys(int id, struct pernet_operations *); | ||
260 | extern int register_pernet_device(struct pernet_operations *); | 264 | extern int register_pernet_device(struct pernet_operations *); |
261 | extern void unregister_pernet_device(struct pernet_operations *); | 265 | extern void unregister_pernet_device(struct pernet_operations *); |
262 | extern int register_pernet_gen_device(int *id, struct pernet_operations *); | ||
263 | extern void unregister_pernet_gen_device(int id, struct pernet_operations *); | ||
264 | 266 | ||
265 | struct ctl_path; | 267 | struct ctl_path; |
266 | struct ctl_table; | 268 | struct ctl_table; |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 4f20d58e2ab7..475facc3051a 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -13,8 +13,7 @@ | |||
13 | #include <net/netfilter/nf_conntrack_extend.h> | 13 | #include <net/netfilter/nf_conntrack_extend.h> |
14 | 14 | ||
15 | /* Connection tracking event types */ | 15 | /* Connection tracking event types */ |
16 | enum ip_conntrack_events | 16 | enum ip_conntrack_events { |
17 | { | ||
18 | IPCT_NEW = 0, /* new conntrack */ | 17 | IPCT_NEW = 0, /* new conntrack */ |
19 | IPCT_RELATED = 1, /* related conntrack */ | 18 | IPCT_RELATED = 1, /* related conntrack */ |
20 | IPCT_DESTROY = 2, /* destroyed conntrack */ | 19 | IPCT_DESTROY = 2, /* destroyed conntrack */ |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index a9652806d0df..9a2b9cb52271 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -9,8 +9,7 @@ | |||
9 | extern unsigned int nf_ct_expect_hsize; | 9 | extern unsigned int nf_ct_expect_hsize; |
10 | extern unsigned int nf_ct_expect_max; | 10 | extern unsigned int nf_ct_expect_max; |
11 | 11 | ||
12 | struct nf_conntrack_expect | 12 | struct nf_conntrack_expect { |
13 | { | ||
14 | /* Conntrack expectation list member */ | 13 | /* Conntrack expectation list member */ |
15 | struct hlist_node lnode; | 14 | struct hlist_node lnode; |
16 | 15 | ||
@@ -64,8 +63,7 @@ static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) | |||
64 | #endif | 63 | #endif |
65 | } | 64 | } |
66 | 65 | ||
67 | struct nf_conntrack_expect_policy | 66 | struct nf_conntrack_expect_policy { |
68 | { | ||
69 | unsigned int max_expected; | 67 | unsigned int max_expected; |
70 | unsigned int timeout; | 68 | unsigned int timeout; |
71 | }; | 69 | }; |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 7f8fc5d123c5..e192dc17c583 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -3,8 +3,7 @@ | |||
3 | 3 | ||
4 | #include <net/netfilter/nf_conntrack.h> | 4 | #include <net/netfilter/nf_conntrack.h> |
5 | 5 | ||
6 | enum nf_ct_ext_id | 6 | enum nf_ct_ext_id { |
7 | { | ||
8 | NF_CT_EXT_HELPER, | 7 | NF_CT_EXT_HELPER, |
9 | NF_CT_EXT_NAT, | 8 | NF_CT_EXT_NAT, |
10 | NF_CT_EXT_ACCT, | 9 | NF_CT_EXT_ACCT, |
@@ -65,8 +64,7 @@ __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp); | |||
65 | 64 | ||
66 | #define NF_CT_EXT_F_PREALLOC 0x0001 | 65 | #define NF_CT_EXT_F_PREALLOC 0x0001 |
67 | 66 | ||
68 | struct nf_ct_ext_type | 67 | struct nf_ct_ext_type { |
69 | { | ||
70 | /* Destroys relationships (can be NULL). */ | 68 | /* Destroys relationships (can be NULL). */ |
71 | void (*destroy)(struct nf_conn *ct); | 69 | void (*destroy)(struct nf_conn *ct); |
72 | /* Called when realloacted (can be NULL). | 70 | /* Called when realloacted (can be NULL). |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 1b7068000927..d015de92e03f 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -16,8 +16,7 @@ struct module; | |||
16 | 16 | ||
17 | #define NF_CT_HELPER_NAME_LEN 16 | 17 | #define NF_CT_HELPER_NAME_LEN 16 |
18 | 18 | ||
19 | struct nf_conntrack_helper | 19 | struct nf_conntrack_helper { |
20 | { | ||
21 | struct hlist_node hnode; /* Internal use. */ | 20 | struct hlist_node hnode; /* Internal use. */ |
22 | 21 | ||
23 | const char *name; /* name of the module */ | 22 | const char *name; /* name of the module */ |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 9f99d36d5de9..a7547611e8f1 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -16,8 +16,7 @@ | |||
16 | #include <linux/seq_file.h> | 16 | #include <linux/seq_file.h> |
17 | #include <net/netfilter/nf_conntrack.h> | 17 | #include <net/netfilter/nf_conntrack.h> |
18 | 18 | ||
19 | struct nf_conntrack_l3proto | 19 | struct nf_conntrack_l3proto { |
20 | { | ||
21 | /* L3 Protocol Family number. ex) PF_INET */ | 20 | /* L3 Protocol Family number. ex) PF_INET */ |
22 | u_int16_t l3proto; | 21 | u_int16_t l3proto; |
23 | 22 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 3767fb41e541..ca6dcf3445ab 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -15,8 +15,7 @@ | |||
15 | 15 | ||
16 | struct seq_file; | 16 | struct seq_file; |
17 | 17 | ||
18 | struct nf_conntrack_l4proto | 18 | struct nf_conntrack_l4proto { |
19 | { | ||
20 | /* L3 Protocol number. */ | 19 | /* L3 Protocol number. */ |
21 | u_int16_t l3proto; | 20 | u_int16_t l3proto; |
22 | 21 | ||
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 2628c154d40e..4ee44c84a304 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -26,8 +26,7 @@ | |||
26 | 26 | ||
27 | /* The protocol-specific manipulable parts of the tuple: always in | 27 | /* The protocol-specific manipulable parts of the tuple: always in |
28 | network order! */ | 28 | network order! */ |
29 | union nf_conntrack_man_proto | 29 | union nf_conntrack_man_proto { |
30 | { | ||
31 | /* Add other protocols here. */ | 30 | /* Add other protocols here. */ |
32 | __be16 all; | 31 | __be16 all; |
33 | 32 | ||
@@ -52,8 +51,7 @@ union nf_conntrack_man_proto | |||
52 | }; | 51 | }; |
53 | 52 | ||
54 | /* The manipulable part of the tuple. */ | 53 | /* The manipulable part of the tuple. */ |
55 | struct nf_conntrack_man | 54 | struct nf_conntrack_man { |
56 | { | ||
57 | union nf_inet_addr u3; | 55 | union nf_inet_addr u3; |
58 | union nf_conntrack_man_proto u; | 56 | union nf_conntrack_man_proto u; |
59 | /* Layer 3 protocol */ | 57 | /* Layer 3 protocol */ |
@@ -61,8 +59,7 @@ struct nf_conntrack_man | |||
61 | }; | 59 | }; |
62 | 60 | ||
63 | /* This contains the information to distinguish a connection. */ | 61 | /* This contains the information to distinguish a connection. */ |
64 | struct nf_conntrack_tuple | 62 | struct nf_conntrack_tuple { |
65 | { | ||
66 | struct nf_conntrack_man src; | 63 | struct nf_conntrack_man src; |
67 | 64 | ||
68 | /* These are the parts of the tuple which are fixed. */ | 65 | /* These are the parts of the tuple which are fixed. */ |
@@ -100,8 +97,7 @@ struct nf_conntrack_tuple | |||
100 | } dst; | 97 | } dst; |
101 | }; | 98 | }; |
102 | 99 | ||
103 | struct nf_conntrack_tuple_mask | 100 | struct nf_conntrack_tuple_mask { |
104 | { | ||
105 | struct { | 101 | struct { |
106 | union nf_inet_addr u3; | 102 | union nf_inet_addr u3; |
107 | union nf_conntrack_man_proto u; | 103 | union nf_conntrack_man_proto u; |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index 8df0b7f7fc6e..f5f09f032a90 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -5,8 +5,7 @@ | |||
5 | 5 | ||
6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 | 6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 |
7 | 7 | ||
8 | enum nf_nat_manip_type | 8 | enum nf_nat_manip_type { |
9 | { | ||
10 | IP_NAT_MANIP_SRC, | 9 | IP_NAT_MANIP_SRC, |
11 | IP_NAT_MANIP_DST | 10 | IP_NAT_MANIP_DST |
12 | }; | 11 | }; |
@@ -30,8 +29,7 @@ struct nf_nat_seq { | |||
30 | }; | 29 | }; |
31 | 30 | ||
32 | /* Single range specification. */ | 31 | /* Single range specification. */ |
33 | struct nf_nat_range | 32 | struct nf_nat_range { |
34 | { | ||
35 | /* Set to OR of flags above. */ | 33 | /* Set to OR of flags above. */ |
36 | unsigned int flags; | 34 | unsigned int flags; |
37 | 35 | ||
@@ -43,8 +41,7 @@ struct nf_nat_range | |||
43 | }; | 41 | }; |
44 | 42 | ||
45 | /* For backwards compat: don't use in modern code. */ | 43 | /* For backwards compat: don't use in modern code. */ |
46 | struct nf_nat_multi_range_compat | 44 | struct nf_nat_multi_range_compat { |
47 | { | ||
48 | unsigned int rangesize; /* Must be 1. */ | 45 | unsigned int rangesize; /* Must be 1. */ |
49 | 46 | ||
50 | /* hangs off end. */ | 47 | /* hangs off end. */ |
@@ -57,8 +54,7 @@ struct nf_nat_multi_range_compat | |||
57 | #include <net/netfilter/nf_conntrack_extend.h> | 54 | #include <net/netfilter/nf_conntrack_extend.h> |
58 | 55 | ||
59 | /* per conntrack: nat application helper private data */ | 56 | /* per conntrack: nat application helper private data */ |
60 | union nf_conntrack_nat_help | 57 | union nf_conntrack_nat_help { |
61 | { | ||
62 | /* insert nat helper private data here */ | 58 | /* insert nat helper private data here */ |
63 | struct nf_nat_pptp nat_pptp_info; | 59 | struct nf_nat_pptp nat_pptp_info; |
64 | }; | 60 | }; |
@@ -66,8 +62,7 @@ union nf_conntrack_nat_help | |||
66 | struct nf_conn; | 62 | struct nf_conn; |
67 | 63 | ||
68 | /* The structure embedded in the conntrack structure. */ | 64 | /* The structure embedded in the conntrack structure. */ |
69 | struct nf_conn_nat | 65 | struct nf_conn_nat { |
70 | { | ||
71 | struct hlist_node bysource; | 66 | struct hlist_node bysource; |
72 | struct nf_nat_seq seq[IP_CT_DIR_MAX]; | 67 | struct nf_nat_seq seq[IP_CT_DIR_MAX]; |
73 | struct nf_conn *ct; | 68 | struct nf_conn *ct; |
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h index f3662c4394ef..c398017ccfa3 100644 --- a/include/net/netfilter/nf_nat_protocol.h +++ b/include/net/netfilter/nf_nat_protocol.h | |||
@@ -6,8 +6,7 @@ | |||
6 | 6 | ||
7 | struct nf_nat_range; | 7 | struct nf_nat_range; |
8 | 8 | ||
9 | struct nf_nat_protocol | 9 | struct nf_nat_protocol { |
10 | { | ||
11 | /* Protocol number. */ | 10 | /* Protocol number. */ |
12 | unsigned int protonum; | 11 | unsigned int protonum; |
13 | 12 | ||
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 0c04fd2a700b..ff4982ab84b6 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -12,9 +12,11 @@ | |||
12 | * stuff on the struct net without explicit struct net modification | 12 | * stuff on the struct net without explicit struct net modification |
13 | * | 13 | * |
14 | * The rules are simple: | 14 | * The rules are simple: |
15 | * 1. register the ops with register_pernet_gen_device to get the id | 15 | * 1. set pernet_operations->id. After register_pernet_device you |
16 | * of your private pointer; | 16 | * will have the id of your private pointer. |
17 | * 2. call net_assign_generic() to put the private data on the struct | 17 | * 2. Either set pernet_operations->size (to have the code allocate and |
18 | * free a private structure pointed to from struct net ) or | ||
19 | * call net_assign_generic() to put the private data on the struct | ||
18 | * net (most preferably this should be done in the ->init callback | 20 | * net (most preferably this should be done in the ->init callback |
19 | * of the ops registered); | 21 | * of the ops registered); |
20 | * 3. do not change this pointer while the net is alive; | 22 | * 3. do not change this pointer while the net is alive; |
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h index d43f71b5ec00..7b114079a51b 100644 --- a/include/net/phonet/phonet.h +++ b/include/net/phonet/phonet.h | |||
@@ -46,7 +46,9 @@ static inline struct pn_sock *pn_sk(struct sock *sk) | |||
46 | 46 | ||
47 | extern const struct proto_ops phonet_dgram_ops; | 47 | extern const struct proto_ops phonet_dgram_ops; |
48 | 48 | ||
49 | void pn_sock_init(void); | ||
49 | struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa); | 50 | struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa); |
51 | void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb); | ||
50 | void phonet_get_local_port_range(int *min, int *max); | 52 | void phonet_get_local_port_range(int *min, int *max); |
51 | void pn_sock_hash(struct sock *sk); | 53 | void pn_sock_hash(struct sock *sk); |
52 | void pn_sock_unhash(struct sock *sk); | 54 | void pn_sock_unhash(struct sock *sk); |
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 44c923c9e21d..d7b989ca3d63 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | struct phonet_device_list { | 26 | struct phonet_device_list { |
27 | struct list_head list; | 27 | struct list_head list; |
28 | spinlock_t lock; | 28 | struct mutex lock; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct phonet_device_list *phonet_device_list(struct net *net); | 31 | struct phonet_device_list *phonet_device_list(struct net *net); |
@@ -47,6 +47,12 @@ u8 phonet_address_get(struct net_device *dev, u8 addr); | |||
47 | int phonet_address_lookup(struct net *net, u8 addr); | 47 | int phonet_address_lookup(struct net *net, u8 addr); |
48 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); | 48 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); |
49 | 49 | ||
50 | int phonet_route_add(struct net_device *dev, u8 daddr); | ||
51 | int phonet_route_del(struct net_device *dev, u8 daddr); | ||
52 | void rtm_phonet_notify(int event, struct net_device *dev, u8 dst); | ||
53 | struct net_device *phonet_route_get(struct net *net, u8 daddr); | ||
54 | struct net_device *phonet_route_output(struct net *net, u8 daddr); | ||
55 | |||
50 | #define PN_NO_ADDR 0xff | 56 | #define PN_NO_ADDR 0xff |
51 | 57 | ||
52 | extern const struct file_operations pn_sock_seq_fops; | 58 | extern const struct file_operations pn_sock_seq_fops; |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index d1ca31444644..dd3031aed9d5 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -7,8 +7,7 @@ | |||
7 | 7 | ||
8 | /* Basic packet classifier frontend definitions. */ | 8 | /* Basic packet classifier frontend definitions. */ |
9 | 9 | ||
10 | struct tcf_walker | 10 | struct tcf_walker { |
11 | { | ||
12 | int stop; | 11 | int stop; |
13 | int skip; | 12 | int skip; |
14 | int count; | 13 | int count; |
@@ -61,8 +60,7 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r) | |||
61 | tp->q->ops->cl_ops->unbind_tcf(tp->q, cl); | 60 | tp->q->ops->cl_ops->unbind_tcf(tp->q, cl); |
62 | } | 61 | } |
63 | 62 | ||
64 | struct tcf_exts | 63 | struct tcf_exts { |
65 | { | ||
66 | #ifdef CONFIG_NET_CLS_ACT | 64 | #ifdef CONFIG_NET_CLS_ACT |
67 | struct tc_action *action; | 65 | struct tc_action *action; |
68 | #endif | 66 | #endif |
@@ -71,8 +69,7 @@ struct tcf_exts | |||
71 | /* Map to export classifier specific extension TLV types to the | 69 | /* Map to export classifier specific extension TLV types to the |
72 | * generic extensions API. Unsupported extensions must be set to 0. | 70 | * generic extensions API. Unsupported extensions must be set to 0. |
73 | */ | 71 | */ |
74 | struct tcf_ext_map | 72 | struct tcf_ext_map { |
75 | { | ||
76 | int action; | 73 | int action; |
77 | int police; | 74 | int police; |
78 | }; | 75 | }; |
@@ -143,8 +140,7 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, | |||
143 | /** | 140 | /** |
144 | * struct tcf_pkt_info - packet information | 141 | * struct tcf_pkt_info - packet information |
145 | */ | 142 | */ |
146 | struct tcf_pkt_info | 143 | struct tcf_pkt_info { |
147 | { | ||
148 | unsigned char * ptr; | 144 | unsigned char * ptr; |
149 | int nexthdr; | 145 | int nexthdr; |
150 | }; | 146 | }; |
@@ -162,8 +158,7 @@ struct tcf_ematch_ops; | |||
162 | * @datalen: length of the ematch specific configuration data | 158 | * @datalen: length of the ematch specific configuration data |
163 | * @data: ematch specific data | 159 | * @data: ematch specific data |
164 | */ | 160 | */ |
165 | struct tcf_ematch | 161 | struct tcf_ematch { |
166 | { | ||
167 | struct tcf_ematch_ops * ops; | 162 | struct tcf_ematch_ops * ops; |
168 | unsigned long data; | 163 | unsigned long data; |
169 | unsigned int datalen; | 164 | unsigned int datalen; |
@@ -211,8 +206,7 @@ static inline int tcf_em_early_end(struct tcf_ematch *em, int result) | |||
211 | * @hdr: ematch tree header supplied by userspace | 206 | * @hdr: ematch tree header supplied by userspace |
212 | * @matches: array of ematches | 207 | * @matches: array of ematches |
213 | */ | 208 | */ |
214 | struct tcf_ematch_tree | 209 | struct tcf_ematch_tree { |
215 | { | ||
216 | struct tcf_ematch_tree_hdr hdr; | 210 | struct tcf_ematch_tree_hdr hdr; |
217 | struct tcf_ematch * matches; | 211 | struct tcf_ematch * matches; |
218 | 212 | ||
@@ -230,8 +224,7 @@ struct tcf_ematch_tree | |||
230 | * @owner: owner, must be set to THIS_MODULE | 224 | * @owner: owner, must be set to THIS_MODULE |
231 | * @link: link to previous/next ematch module (internal use) | 225 | * @link: link to previous/next ematch module (internal use) |
232 | */ | 226 | */ |
233 | struct tcf_ematch_ops | 227 | struct tcf_ematch_ops { |
234 | { | ||
235 | int kind; | 228 | int kind; |
236 | int datalen; | 229 | int datalen; |
237 | int (*change)(struct tcf_proto *, void *, | 230 | int (*change)(struct tcf_proto *, void *, |
@@ -302,8 +295,7 @@ static inline int tcf_em_tree_match(struct sk_buff *skb, | |||
302 | 295 | ||
303 | #else /* CONFIG_NET_EMATCH */ | 296 | #else /* CONFIG_NET_EMATCH */ |
304 | 297 | ||
305 | struct tcf_ematch_tree | 298 | struct tcf_ematch_tree { |
306 | { | ||
307 | }; | 299 | }; |
308 | 300 | ||
309 | #define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) | 301 | #define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) |
@@ -351,9 +343,9 @@ tcf_match_indev(struct sk_buff *skb, char *indev) | |||
351 | struct net_device *dev; | 343 | struct net_device *dev; |
352 | 344 | ||
353 | if (indev[0]) { | 345 | if (indev[0]) { |
354 | if (!skb->iif) | 346 | if (!skb->skb_iif) |
355 | return 0; | 347 | return 0; |
356 | dev = __dev_get_by_index(dev_net(skb->dev), skb->iif); | 348 | dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif); |
357 | if (!dev || strcmp(indev, dev->name)) | 349 | if (!dev || strcmp(indev, dev->name)) |
358 | return 0; | 350 | return 0; |
359 | } | 351 | } |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index f911ec7598ef..2d567265363e 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -5,8 +5,7 @@ | |||
5 | #include <linux/ktime.h> | 5 | #include <linux/ktime.h> |
6 | #include <net/sch_generic.h> | 6 | #include <net/sch_generic.h> |
7 | 7 | ||
8 | struct qdisc_walker | 8 | struct qdisc_walker { |
9 | { | ||
10 | int stop; | 9 | int stop; |
11 | int skip; | 10 | int skip; |
12 | int count; | 11 | int count; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 60249e51b669..f1effdd3c265 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -47,8 +47,7 @@ struct net_protocol { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 49 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
50 | struct inet6_protocol | 50 | struct inet6_protocol { |
51 | { | ||
52 | int (*handler)(struct sk_buff *skb); | 51 | int (*handler)(struct sk_buff *skb); |
53 | 52 | ||
54 | void (*err_handler)(struct sk_buff *skb, | 53 | void (*err_handler)(struct sk_buff *skb, |
@@ -83,10 +82,6 @@ struct inet_protosw { | |||
83 | struct proto *prot; | 82 | struct proto *prot; |
84 | const struct proto_ops *ops; | 83 | const struct proto_ops *ops; |
85 | 84 | ||
86 | int capability; /* Which (if any) capability do | ||
87 | * we need to use this socket | ||
88 | * interface? | ||
89 | */ | ||
90 | char no_check; /* checksum on rcv/xmit/none? */ | 85 | char no_check; /* checksum on rcv/xmit/none? */ |
91 | unsigned char flags; /* See INET_PROTOSW_* below. */ | 86 | unsigned char flags; /* See INET_PROTOSW_* below. */ |
92 | }; | 87 | }; |
diff --git a/include/net/red.h b/include/net/red.h index 3cf31d466a81..995108e54d9f 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -90,8 +90,7 @@ | |||
90 | #define RED_STAB_SIZE 256 | 90 | #define RED_STAB_SIZE 256 |
91 | #define RED_STAB_MASK (RED_STAB_SIZE - 1) | 91 | #define RED_STAB_MASK (RED_STAB_SIZE - 1) |
92 | 92 | ||
93 | struct red_stats | 93 | struct red_stats { |
94 | { | ||
95 | u32 prob_drop; /* Early probability drops */ | 94 | u32 prob_drop; /* Early probability drops */ |
96 | u32 prob_mark; /* Early probability marks */ | 95 | u32 prob_mark; /* Early probability marks */ |
97 | u32 forced_drop; /* Forced drops, qavg > max_thresh */ | 96 | u32 forced_drop; /* Forced drops, qavg > max_thresh */ |
@@ -101,8 +100,7 @@ struct red_stats | |||
101 | u32 backlog; | 100 | u32 backlog; |
102 | }; | 101 | }; |
103 | 102 | ||
104 | struct red_parms | 103 | struct red_parms { |
105 | { | ||
106 | /* Parameters */ | 104 | /* Parameters */ |
107 | u32 qth_min; /* Min avg length threshold: A scaled */ | 105 | u32 qth_min; /* Min avg length threshold: A scaled */ |
108 | u32 qth_max; /* Max avg length threshold: A scaled */ | 106 | u32 qth_max; /* Max avg length threshold: A scaled */ |
diff --git a/include/net/route.h b/include/net/route.h index 40f6346ef496..bce6dd68d27b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -49,10 +49,8 @@ | |||
49 | 49 | ||
50 | struct fib_nh; | 50 | struct fib_nh; |
51 | struct inet_peer; | 51 | struct inet_peer; |
52 | struct rtable | 52 | struct rtable { |
53 | { | 53 | union { |
54 | union | ||
55 | { | ||
56 | struct dst_entry dst; | 54 | struct dst_entry dst; |
57 | } u; | 55 | } u; |
58 | 56 | ||
@@ -77,16 +75,14 @@ struct rtable | |||
77 | struct inet_peer *peer; /* long-living peer info */ | 75 | struct inet_peer *peer; /* long-living peer info */ |
78 | }; | 76 | }; |
79 | 77 | ||
80 | struct ip_rt_acct | 78 | struct ip_rt_acct { |
81 | { | ||
82 | __u32 o_bytes; | 79 | __u32 o_bytes; |
83 | __u32 o_packets; | 80 | __u32 o_packets; |
84 | __u32 i_bytes; | 81 | __u32 i_bytes; |
85 | __u32 i_packets; | 82 | __u32 i_packets; |
86 | }; | 83 | }; |
87 | 84 | ||
88 | struct rt_cache_stat | 85 | struct rt_cache_stat { |
89 | { | ||
90 | unsigned int in_hit; | 86 | unsigned int in_hit; |
91 | unsigned int in_slow_tot; | 87 | unsigned int in_slow_tot; |
92 | unsigned int in_slow_mc; | 88 | unsigned int in_slow_mc; |
@@ -112,6 +108,7 @@ extern int ip_rt_init(void); | |||
112 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 108 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
113 | __be32 src, struct net_device *dev); | 109 | __be32 src, struct net_device *dev); |
114 | extern void rt_cache_flush(struct net *net, int how); | 110 | extern void rt_cache_flush(struct net *net, int how); |
111 | extern void rt_cache_flush_batch(void); | ||
115 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 112 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
116 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 113 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
117 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 114 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index c3aa044d3fc3..48d3efcb0880 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -55,13 +55,15 @@ struct rtnl_link_ops { | |||
55 | int (*validate)(struct nlattr *tb[], | 55 | int (*validate)(struct nlattr *tb[], |
56 | struct nlattr *data[]); | 56 | struct nlattr *data[]); |
57 | 57 | ||
58 | int (*newlink)(struct net_device *dev, | 58 | int (*newlink)(struct net *src_net, |
59 | struct net_device *dev, | ||
59 | struct nlattr *tb[], | 60 | struct nlattr *tb[], |
60 | struct nlattr *data[]); | 61 | struct nlattr *data[]); |
61 | int (*changelink)(struct net_device *dev, | 62 | int (*changelink)(struct net_device *dev, |
62 | struct nlattr *tb[], | 63 | struct nlattr *tb[], |
63 | struct nlattr *data[]); | 64 | struct nlattr *data[]); |
64 | void (*dellink)(struct net_device *dev); | 65 | void (*dellink)(struct net_device *dev, |
66 | struct list_head *head); | ||
65 | 67 | ||
66 | size_t (*get_size)(const struct net_device *dev); | 68 | size_t (*get_size)(const struct net_device *dev); |
67 | int (*fill_info)(struct sk_buff *skb, | 69 | int (*fill_info)(struct sk_buff *skb, |
@@ -82,8 +84,9 @@ extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops); | |||
82 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 84 | extern int rtnl_link_register(struct rtnl_link_ops *ops); |
83 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 85 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); |
84 | 86 | ||
85 | extern struct net_device *rtnl_create_link(struct net *net, char *ifname, | 87 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); |
86 | const struct rtnl_link_ops *ops, struct nlattr *tb[]); | 88 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, |
89 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); | ||
87 | extern const struct nla_policy ifla_policy[IFLA_MAX+1]; | 90 | extern const struct nla_policy ifla_policy[IFLA_MAX+1]; |
88 | 91 | ||
89 | #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) | 92 | #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index c33180dd42b4..dad558bc06fa 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -15,16 +15,14 @@ struct qdisc_walker; | |||
15 | struct tcf_walker; | 15 | struct tcf_walker; |
16 | struct module; | 16 | struct module; |
17 | 17 | ||
18 | struct qdisc_rate_table | 18 | struct qdisc_rate_table { |
19 | { | ||
20 | struct tc_ratespec rate; | 19 | struct tc_ratespec rate; |
21 | u32 data[256]; | 20 | u32 data[256]; |
22 | struct qdisc_rate_table *next; | 21 | struct qdisc_rate_table *next; |
23 | int refcnt; | 22 | int refcnt; |
24 | }; | 23 | }; |
25 | 24 | ||
26 | enum qdisc_state_t | 25 | enum qdisc_state_t { |
27 | { | ||
28 | __QDISC_STATE_RUNNING, | 26 | __QDISC_STATE_RUNNING, |
29 | __QDISC_STATE_SCHED, | 27 | __QDISC_STATE_SCHED, |
30 | __QDISC_STATE_DEACTIVATED, | 28 | __QDISC_STATE_DEACTIVATED, |
@@ -37,8 +35,7 @@ struct qdisc_size_table { | |||
37 | u16 data[]; | 35 | u16 data[]; |
38 | }; | 36 | }; |
39 | 37 | ||
40 | struct Qdisc | 38 | struct Qdisc { |
41 | { | ||
42 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); | 39 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); |
43 | struct sk_buff * (*dequeue)(struct Qdisc *dev); | 40 | struct sk_buff * (*dequeue)(struct Qdisc *dev); |
44 | unsigned flags; | 41 | unsigned flags; |
@@ -78,8 +75,7 @@ struct Qdisc | |||
78 | struct gnet_stats_queue qstats; | 75 | struct gnet_stats_queue qstats; |
79 | }; | 76 | }; |
80 | 77 | ||
81 | struct Qdisc_class_ops | 78 | struct Qdisc_class_ops { |
82 | { | ||
83 | /* Child qdisc manipulation */ | 79 | /* Child qdisc manipulation */ |
84 | struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); | 80 | struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); |
85 | int (*graft)(struct Qdisc *, unsigned long cl, | 81 | int (*graft)(struct Qdisc *, unsigned long cl, |
@@ -108,8 +104,7 @@ struct Qdisc_class_ops | |||
108 | struct gnet_dump *); | 104 | struct gnet_dump *); |
109 | }; | 105 | }; |
110 | 106 | ||
111 | struct Qdisc_ops | 107 | struct Qdisc_ops { |
112 | { | ||
113 | struct Qdisc_ops *next; | 108 | struct Qdisc_ops *next; |
114 | const struct Qdisc_class_ops *cl_ops; | 109 | const struct Qdisc_class_ops *cl_ops; |
115 | char id[IFNAMSIZ]; | 110 | char id[IFNAMSIZ]; |
@@ -133,14 +128,12 @@ struct Qdisc_ops | |||
133 | }; | 128 | }; |
134 | 129 | ||
135 | 130 | ||
136 | struct tcf_result | 131 | struct tcf_result { |
137 | { | ||
138 | unsigned long class; | 132 | unsigned long class; |
139 | u32 classid; | 133 | u32 classid; |
140 | }; | 134 | }; |
141 | 135 | ||
142 | struct tcf_proto_ops | 136 | struct tcf_proto_ops { |
143 | { | ||
144 | struct tcf_proto_ops *next; | 137 | struct tcf_proto_ops *next; |
145 | char kind[IFNAMSIZ]; | 138 | char kind[IFNAMSIZ]; |
146 | 139 | ||
@@ -164,8 +157,7 @@ struct tcf_proto_ops | |||
164 | struct module *owner; | 157 | struct module *owner; |
165 | }; | 158 | }; |
166 | 159 | ||
167 | struct tcf_proto | 160 | struct tcf_proto { |
168 | { | ||
169 | /* Fast access part */ | 161 | /* Fast access part */ |
170 | struct tcf_proto *next; | 162 | struct tcf_proto *next; |
171 | void *root; | 163 | void *root; |
@@ -261,14 +253,12 @@ extern struct Qdisc_ops noop_qdisc_ops; | |||
261 | extern struct Qdisc_ops pfifo_fast_ops; | 253 | extern struct Qdisc_ops pfifo_fast_ops; |
262 | extern struct Qdisc_ops mq_qdisc_ops; | 254 | extern struct Qdisc_ops mq_qdisc_ops; |
263 | 255 | ||
264 | struct Qdisc_class_common | 256 | struct Qdisc_class_common { |
265 | { | ||
266 | u32 classid; | 257 | u32 classid; |
267 | struct hlist_node hnode; | 258 | struct hlist_node hnode; |
268 | }; | 259 | }; |
269 | 260 | ||
270 | struct Qdisc_class_hash | 261 | struct Qdisc_class_hash { |
271 | { | ||
272 | struct hlist_head *hash; | 262 | struct hlist_head *hash; |
273 | unsigned int hashsize; | 263 | unsigned int hashsize; |
274 | unsigned int hashmask; | 264 | unsigned int hashmask; |
diff --git a/include/net/scm.h b/include/net/scm.h index cf48c800e926..8360e47aa7e3 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -12,15 +12,13 @@ | |||
12 | */ | 12 | */ |
13 | #define SCM_MAX_FD 255 | 13 | #define SCM_MAX_FD 255 |
14 | 14 | ||
15 | struct scm_fp_list | 15 | struct scm_fp_list { |
16 | { | ||
17 | struct list_head list; | 16 | struct list_head list; |
18 | int count; | 17 | int count; |
19 | struct file *fp[SCM_MAX_FD]; | 18 | struct file *fp[SCM_MAX_FD]; |
20 | }; | 19 | }; |
21 | 20 | ||
22 | struct scm_cookie | 21 | struct scm_cookie { |
23 | { | ||
24 | struct ucred creds; /* Skb credentials */ | 22 | struct ucred creds; /* Skb credentials */ |
25 | struct scm_fp_list *fp; /* Passed files */ | 23 | struct scm_fp_list *fp; /* Passed files */ |
26 | #ifdef CONFIG_SECURITY_NETWORK | 24 | #ifdef CONFIG_SECURITY_NETWORK |
@@ -88,8 +86,7 @@ static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct sc | |||
88 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | 86 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, |
89 | struct scm_cookie *scm, int flags) | 87 | struct scm_cookie *scm, int flags) |
90 | { | 88 | { |
91 | if (!msg->msg_control) | 89 | if (!msg->msg_control) { |
92 | { | ||
93 | if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp) | 90 | if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp) |
94 | msg->msg_flags |= MSG_CTRUNC; | 91 | msg->msg_flags |= MSG_CTRUNC; |
95 | scm_destroy(scm); | 92 | scm_destroy(scm); |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 58f714a3b670..63908840eef0 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -308,6 +308,10 @@ enum { SCTP_MAX_GABS = 16 }; | |||
308 | 308 | ||
309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ | 309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ |
310 | #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ | 310 | #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ |
311 | #define SCTP_DEFAULT_RWND_SHIFT 4 /* by default, update on 1/16 of | ||
312 | * rcvbuf, which is 1/8 of initial | ||
313 | * window | ||
314 | */ | ||
311 | #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit | 315 | #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit |
312 | * to which we will raise the P-MTU. | 316 | * to which we will raise the P-MTU. |
313 | */ | 317 | */ |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 8a6d5297de16..78740ec57d5d 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -227,8 +227,7 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | |||
227 | #endif /* !TEST_FRAME */ | 227 | #endif /* !TEST_FRAME */ |
228 | 228 | ||
229 | /* sctp mib definitions */ | 229 | /* sctp mib definitions */ |
230 | enum | 230 | enum { |
231 | { | ||
232 | SCTP_MIB_NUM = 0, | 231 | SCTP_MIB_NUM = 0, |
233 | SCTP_MIB_CURRESTAB, /* CurrEstab */ | 232 | SCTP_MIB_CURRESTAB, /* CurrEstab */ |
234 | SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ | 233 | SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index c1dd89365833..851c813adb3a 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -243,7 +243,8 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *, | |||
243 | const struct sctp_chunk *chunk, | 243 | const struct sctp_chunk *chunk, |
244 | __be16 cause_code, | 244 | __be16 cause_code, |
245 | const void *payload, | 245 | const void *payload, |
246 | size_t paylen); | 246 | size_t paylen, |
247 | size_t reserve_tail); | ||
247 | 248 | ||
248 | struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, | 249 | struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, |
249 | union sctp_addr *, | 250 | union sctp_addr *, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 0a474568b003..7571e32723bf 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -231,6 +231,11 @@ extern struct sctp_globals { | |||
231 | /* Flag to indicate whether computing and verifying checksum | 231 | /* Flag to indicate whether computing and verifying checksum |
232 | * is disabled. */ | 232 | * is disabled. */ |
233 | int checksum_disable; | 233 | int checksum_disable; |
234 | |||
235 | /* Threshold for rwnd update SACKS. Receive buffer shifted this many | ||
236 | * bits is an indicator of when to send and window update SACK. | ||
237 | */ | ||
238 | int rwnd_update_shift; | ||
234 | } sctp_globals; | 239 | } sctp_globals; |
235 | 240 | ||
236 | #define sctp_rto_initial (sctp_globals.rto_initial) | 241 | #define sctp_rto_initial (sctp_globals.rto_initial) |
@@ -267,6 +272,7 @@ extern struct sctp_globals { | |||
267 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 272 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
268 | #define sctp_auth_enable (sctp_globals.auth_enable) | 273 | #define sctp_auth_enable (sctp_globals.auth_enable) |
269 | #define sctp_checksum_disable (sctp_globals.checksum_disable) | 274 | #define sctp_checksum_disable (sctp_globals.checksum_disable) |
275 | #define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift) | ||
270 | 276 | ||
271 | /* SCTP Socket type: UDP or TCP style. */ | 277 | /* SCTP Socket type: UDP or TCP style. */ |
272 | typedef enum { | 278 | typedef enum { |
@@ -935,6 +941,8 @@ struct sctp_transport { | |||
935 | /* Data that has been sent, but not acknowledged. */ | 941 | /* Data that has been sent, but not acknowledged. */ |
936 | __u32 flight_size; | 942 | __u32 flight_size; |
937 | 943 | ||
944 | __u32 burst_limited; /* Holds old cwnd when max.burst is applied */ | ||
945 | |||
938 | /* TSN marking the fast recovery exit point */ | 946 | /* TSN marking the fast recovery exit point */ |
939 | __u32 fast_recovery_exit; | 947 | __u32 fast_recovery_exit; |
940 | 948 | ||
@@ -943,12 +951,6 @@ struct sctp_transport { | |||
943 | /* Source address. */ | 951 | /* Source address. */ |
944 | union sctp_addr saddr; | 952 | union sctp_addr saddr; |
945 | 953 | ||
946 | /* When was the last time(in jiffies) that a data packet was sent on | ||
947 | * this transport? This is used to adjust the cwnd when the transport | ||
948 | * becomes inactive. | ||
949 | */ | ||
950 | unsigned long last_time_used; | ||
951 | |||
952 | /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to | 954 | /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to |
953 | * the destination address every heartbeat interval. | 955 | * the destination address every heartbeat interval. |
954 | */ | 956 | */ |
@@ -1069,6 +1071,8 @@ void sctp_transport_put(struct sctp_transport *); | |||
1069 | void sctp_transport_update_rto(struct sctp_transport *, __u32); | 1071 | void sctp_transport_update_rto(struct sctp_transport *, __u32); |
1070 | void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); | 1072 | void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); |
1071 | void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); | 1073 | void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); |
1074 | void sctp_transport_burst_limited(struct sctp_transport *); | ||
1075 | void sctp_transport_burst_reset(struct sctp_transport *); | ||
1072 | unsigned long sctp_transport_timeout(struct sctp_transport *); | 1076 | unsigned long sctp_transport_timeout(struct sctp_transport *); |
1073 | void sctp_transport_reset(struct sctp_transport *); | 1077 | void sctp_transport_reset(struct sctp_transport *); |
1074 | void sctp_transport_update_pmtu(struct sctp_transport *, u32); | 1078 | void sctp_transport_update_pmtu(struct sctp_transport *, u32); |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index be2334aaf52e..2b2769c5ca9f 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -60,96 +60,49 @@ typedef __s32 sctp_assoc_t; | |||
60 | /* The following symbols come from the Sockets API Extensions for | 60 | /* The following symbols come from the Sockets API Extensions for |
61 | * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. | 61 | * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. |
62 | */ | 62 | */ |
63 | enum sctp_optname { | 63 | #define SCTP_RTOINFO 0 |
64 | SCTP_RTOINFO, | 64 | #define SCTP_ASSOCINFO 1 |
65 | #define SCTP_RTOINFO SCTP_RTOINFO | 65 | #define SCTP_INITMSG 2 |
66 | SCTP_ASSOCINFO, | 66 | #define SCTP_NODELAY 3 /* Get/set nodelay option. */ |
67 | #define SCTP_ASSOCINFO SCTP_ASSOCINFO | 67 | #define SCTP_AUTOCLOSE 4 |
68 | SCTP_INITMSG, | 68 | #define SCTP_SET_PEER_PRIMARY_ADDR 5 |
69 | #define SCTP_INITMSG SCTP_INITMSG | 69 | #define SCTP_PRIMARY_ADDR 6 |
70 | SCTP_NODELAY, /* Get/set nodelay option. */ | 70 | #define SCTP_ADAPTATION_LAYER 7 |
71 | #define SCTP_NODELAY SCTP_NODELAY | 71 | #define SCTP_DISABLE_FRAGMENTS 8 |
72 | SCTP_AUTOCLOSE, | 72 | #define SCTP_PEER_ADDR_PARAMS 9 |
73 | #define SCTP_AUTOCLOSE SCTP_AUTOCLOSE | 73 | #define SCTP_DEFAULT_SEND_PARAM 10 |
74 | SCTP_SET_PEER_PRIMARY_ADDR, | 74 | #define SCTP_EVENTS 11 |
75 | #define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR | 75 | #define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */ |
76 | SCTP_PRIMARY_ADDR, | 76 | #define SCTP_MAXSEG 13 /* Get/set maximum fragment. */ |
77 | #define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR | 77 | #define SCTP_STATUS 14 |
78 | SCTP_ADAPTATION_LAYER, | 78 | #define SCTP_GET_PEER_ADDR_INFO 15 |
79 | #define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER | 79 | #define SCTP_DELAYED_ACK_TIME 16 |
80 | SCTP_DISABLE_FRAGMENTS, | 80 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME |
81 | #define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS | 81 | #define SCTP_CONTEXT 17 |
82 | SCTP_PEER_ADDR_PARAMS, | 82 | #define SCTP_FRAGMENT_INTERLEAVE 18 |
83 | #define SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS | 83 | #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */ |
84 | SCTP_DEFAULT_SEND_PARAM, | 84 | #define SCTP_MAX_BURST 20 /* Set/Get max burst */ |
85 | #define SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM | 85 | #define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */ |
86 | SCTP_EVENTS, | 86 | #define SCTP_HMAC_IDENT 22 |
87 | #define SCTP_EVENTS SCTP_EVENTS | 87 | #define SCTP_AUTH_KEY 23 |
88 | SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ | 88 | #define SCTP_AUTH_ACTIVE_KEY 24 |
89 | #define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR | 89 | #define SCTP_AUTH_DELETE_KEY 25 |
90 | SCTP_MAXSEG, /* Get/set maximum fragment. */ | 90 | #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */ |
91 | #define SCTP_MAXSEG SCTP_MAXSEG | 91 | #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */ |
92 | SCTP_STATUS, | 92 | #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ |
93 | #define SCTP_STATUS SCTP_STATUS | 93 | |
94 | SCTP_GET_PEER_ADDR_INFO, | 94 | /* Internal Socket Options. Some of the sctp library functions are |
95 | #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO | 95 | * implemented using these socket options. |
96 | SCTP_DELAYED_ACK, | 96 | */ |
97 | #define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK | 97 | #define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */ |
98 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK | 98 | #define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */ |
99 | SCTP_CONTEXT, /* Receive Context */ | 99 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ |
100 | #define SCTP_CONTEXT SCTP_CONTEXT | 100 | /* Options 104-106 are deprecated and removed. Do not use this space */ |
101 | SCTP_FRAGMENT_INTERLEAVE, | 101 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ |
102 | #define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE | 102 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ |
103 | SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */ | 103 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ |
104 | #define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT | 104 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ |
105 | SCTP_MAX_BURST, /* Set/Get max burst */ | 105 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
106 | #define SCTP_MAX_BURST SCTP_MAX_BURST | ||
107 | SCTP_AUTH_CHUNK, /* Set only: add a chunk type to authenticat */ | ||
108 | #define SCTP_AUTH_CHUNK SCTP_AUTH_CHUNK | ||
109 | SCTP_HMAC_IDENT, | ||
110 | #define SCTP_HMAC_IDENT SCTP_HMAC_IDENT | ||
111 | SCTP_AUTH_KEY, | ||
112 | #define SCTP_AUTH_KEY SCTP_AUTH_KEY | ||
113 | SCTP_AUTH_ACTIVE_KEY, | ||
114 | #define SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY | ||
115 | SCTP_AUTH_DELETE_KEY, | ||
116 | #define SCTP_AUTH_DELETE_KEY SCTP_AUTH_DELETE_KEY | ||
117 | SCTP_PEER_AUTH_CHUNKS, /* Read only */ | ||
118 | #define SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS | ||
119 | SCTP_LOCAL_AUTH_CHUNKS, /* Read only */ | ||
120 | #define SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS | ||
121 | SCTP_GET_ASSOC_NUMBER, /* Read only */ | ||
122 | #define SCTP_GET_ASSOC_NUMBER SCTP_GET_ASSOC_NUMBER | ||
123 | |||
124 | |||
125 | /* Internal Socket Options. Some of the sctp library functions are | ||
126 | * implemented using these socket options. | ||
127 | */ | ||
128 | SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */ | ||
129 | #define SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_ADD | ||
130 | SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */ | ||
131 | #define SCTP_SOCKOPT_BINDX_REM SCTP_SOCKOPT_BINDX_REM | ||
132 | SCTP_SOCKOPT_PEELOFF, /* peel off association. */ | ||
133 | #define SCTP_SOCKOPT_PEELOFF SCTP_SOCKOPT_PEELOFF | ||
134 | SCTP_GET_PEER_ADDRS_NUM_OLD, /* Get number of peer addresss. */ | ||
135 | #define SCTP_GET_PEER_ADDRS_NUM_OLD SCTP_GET_PEER_ADDRS_NUM_OLD | ||
136 | SCTP_GET_PEER_ADDRS_OLD, /* Get all peer addresss. */ | ||
137 | #define SCTP_GET_PEER_ADDRS_OLD SCTP_GET_PEER_ADDRS_OLD | ||
138 | SCTP_GET_LOCAL_ADDRS_NUM_OLD, /* Get number of local addresss. */ | ||
139 | #define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD | ||
140 | SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ | ||
141 | #define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD | ||
142 | SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */ | ||
143 | #define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD | ||
144 | SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ | ||
145 | #define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS | ||
146 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ | ||
147 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS | ||
148 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | ||
149 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | ||
150 | SCTP_SOCKOPT_CONNECTX3, /* CONNECTX requests. (new implementation) */ | ||
151 | #define SCTP_SOCKOPT_CONNECTX3 SCTP_SOCKOPT_CONNECTX3 | ||
152 | }; | ||
153 | 106 | ||
154 | /* | 107 | /* |
155 | * 5.2.1 SCTP Initiation Structure (SCTP_INIT) | 108 | * 5.2.1 SCTP Initiation Structure (SCTP_INIT) |
@@ -206,6 +159,7 @@ enum sctp_sinfo_flags { | |||
206 | SCTP_UNORDERED = 1, /* Send/receive message unordered. */ | 159 | SCTP_UNORDERED = 1, /* Send/receive message unordered. */ |
207 | SCTP_ADDR_OVER = 2, /* Override the primary destination. */ | 160 | SCTP_ADDR_OVER = 2, /* Override the primary destination. */ |
208 | SCTP_ABORT=4, /* Send an ABORT message to the peer. */ | 161 | SCTP_ABORT=4, /* Send an ABORT message to the peer. */ |
162 | SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */ | ||
209 | SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ | 163 | SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ |
210 | }; | 164 | }; |
211 | 165 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index 9f96394f694e..3f1a4804bb3f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -105,14 +105,17 @@ struct net; | |||
105 | /** | 105 | /** |
106 | * struct sock_common - minimal network layer representation of sockets | 106 | * struct sock_common - minimal network layer representation of sockets |
107 | * @skc_node: main hash linkage for various protocol lookup tables | 107 | * @skc_node: main hash linkage for various protocol lookup tables |
108 | * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol | 108 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol |
109 | * @skc_refcnt: reference count | 109 | * @skc_refcnt: reference count |
110 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
110 | * @skc_hash: hash value used with various protocol lookup tables | 111 | * @skc_hash: hash value used with various protocol lookup tables |
112 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables | ||
111 | * @skc_family: network address family | 113 | * @skc_family: network address family |
112 | * @skc_state: Connection state | 114 | * @skc_state: Connection state |
113 | * @skc_reuse: %SO_REUSEADDR setting | 115 | * @skc_reuse: %SO_REUSEADDR setting |
114 | * @skc_bound_dev_if: bound device index if != 0 | 116 | * @skc_bound_dev_if: bound device index if != 0 |
115 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 117 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
118 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol | ||
116 | * @skc_prot: protocol handlers inside a network family | 119 | * @skc_prot: protocol handlers inside a network family |
117 | * @skc_net: reference to the network namespace of this socket | 120 | * @skc_net: reference to the network namespace of this socket |
118 | * | 121 | * |
@@ -128,13 +131,20 @@ struct sock_common { | |||
128 | struct hlist_nulls_node skc_nulls_node; | 131 | struct hlist_nulls_node skc_nulls_node; |
129 | }; | 132 | }; |
130 | atomic_t skc_refcnt; | 133 | atomic_t skc_refcnt; |
134 | int skc_tx_queue_mapping; | ||
131 | 135 | ||
132 | unsigned int skc_hash; | 136 | union { |
137 | unsigned int skc_hash; | ||
138 | __u16 skc_u16hashes[2]; | ||
139 | }; | ||
133 | unsigned short skc_family; | 140 | unsigned short skc_family; |
134 | volatile unsigned char skc_state; | 141 | volatile unsigned char skc_state; |
135 | unsigned char skc_reuse; | 142 | unsigned char skc_reuse; |
136 | int skc_bound_dev_if; | 143 | int skc_bound_dev_if; |
137 | struct hlist_node skc_bind_node; | 144 | union { |
145 | struct hlist_node skc_bind_node; | ||
146 | struct hlist_nulls_node skc_portaddr_node; | ||
147 | }; | ||
138 | struct proto *skc_prot; | 148 | struct proto *skc_prot; |
139 | #ifdef CONFIG_NET_NS | 149 | #ifdef CONFIG_NET_NS |
140 | struct net *skc_net; | 150 | struct net *skc_net; |
@@ -215,6 +225,7 @@ struct sock { | |||
215 | #define sk_node __sk_common.skc_node | 225 | #define sk_node __sk_common.skc_node |
216 | #define sk_nulls_node __sk_common.skc_nulls_node | 226 | #define sk_nulls_node __sk_common.skc_nulls_node |
217 | #define sk_refcnt __sk_common.skc_refcnt | 227 | #define sk_refcnt __sk_common.skc_refcnt |
228 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping | ||
218 | 229 | ||
219 | #define sk_copy_start __sk_common.skc_hash | 230 | #define sk_copy_start __sk_common.skc_hash |
220 | #define sk_hash __sk_common.skc_hash | 231 | #define sk_hash __sk_common.skc_hash |
@@ -504,6 +515,8 @@ enum sock_flags { | |||
504 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ | 515 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ |
505 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ | 516 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ |
506 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ | 517 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ |
518 | SOCK_FASYNC, /* fasync() active */ | ||
519 | SOCK_RXQ_OVFL, | ||
507 | }; | 520 | }; |
508 | 521 | ||
509 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | 522 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) |
@@ -1092,8 +1105,29 @@ static inline void sock_put(struct sock *sk) | |||
1092 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, | 1105 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, |
1093 | const int nested); | 1106 | const int nested); |
1094 | 1107 | ||
1108 | static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) | ||
1109 | { | ||
1110 | sk->sk_tx_queue_mapping = tx_queue; | ||
1111 | } | ||
1112 | |||
1113 | static inline void sk_tx_queue_clear(struct sock *sk) | ||
1114 | { | ||
1115 | sk->sk_tx_queue_mapping = -1; | ||
1116 | } | ||
1117 | |||
1118 | static inline int sk_tx_queue_get(const struct sock *sk) | ||
1119 | { | ||
1120 | return sk->sk_tx_queue_mapping; | ||
1121 | } | ||
1122 | |||
1123 | static inline bool sk_tx_queue_recorded(const struct sock *sk) | ||
1124 | { | ||
1125 | return (sk && sk->sk_tx_queue_mapping >= 0); | ||
1126 | } | ||
1127 | |||
1095 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) | 1128 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) |
1096 | { | 1129 | { |
1130 | sk_tx_queue_clear(sk); | ||
1097 | sk->sk_socket = sock; | 1131 | sk->sk_socket = sock; |
1098 | } | 1132 | } |
1099 | 1133 | ||
@@ -1150,6 +1184,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst) | |||
1150 | { | 1184 | { |
1151 | struct dst_entry *old_dst; | 1185 | struct dst_entry *old_dst; |
1152 | 1186 | ||
1187 | sk_tx_queue_clear(sk); | ||
1153 | old_dst = sk->sk_dst_cache; | 1188 | old_dst = sk->sk_dst_cache; |
1154 | sk->sk_dst_cache = dst; | 1189 | sk->sk_dst_cache = dst; |
1155 | dst_release(old_dst); | 1190 | dst_release(old_dst); |
@@ -1168,6 +1203,7 @@ __sk_dst_reset(struct sock *sk) | |||
1168 | { | 1203 | { |
1169 | struct dst_entry *old_dst; | 1204 | struct dst_entry *old_dst; |
1170 | 1205 | ||
1206 | sk_tx_queue_clear(sk); | ||
1171 | old_dst = sk->sk_dst_cache; | 1207 | old_dst = sk->sk_dst_cache; |
1172 | sk->sk_dst_cache = NULL; | 1208 | sk->sk_dst_cache = NULL; |
1173 | dst_release(old_dst); | 1209 | dst_release(old_dst); |
@@ -1396,7 +1432,7 @@ static inline unsigned long sock_wspace(struct sock *sk) | |||
1396 | 1432 | ||
1397 | static inline void sk_wake_async(struct sock *sk, int how, int band) | 1433 | static inline void sk_wake_async(struct sock *sk, int how, int band) |
1398 | { | 1434 | { |
1399 | if (sk->sk_socket && sk->sk_socket->fasync_list) | 1435 | if (sock_flag(sk, SOCK_FASYNC)) |
1400 | sock_wake_async(sk->sk_socket, how, band); | 1436 | sock_wake_async(sk->sk_socket, how, band); |
1401 | } | 1437 | } |
1402 | 1438 | ||
@@ -1492,6 +1528,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
1492 | sk->sk_stamp = kt; | 1528 | sk->sk_stamp = kt; |
1493 | } | 1529 | } |
1494 | 1530 | ||
1531 | extern void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, struct sk_buff *skb); | ||
1532 | |||
1495 | /** | 1533 | /** |
1496 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | 1534 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped |
1497 | * @msg: outgoing packet | 1535 | * @msg: outgoing packet |
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h index 6abb3ed3ebf7..e103fe02f375 100644 --- a/include/net/tc_act/tc_skbedit.h +++ b/include/net/tc_act/tc_skbedit.h | |||
@@ -26,7 +26,9 @@ struct tcf_skbedit { | |||
26 | struct tcf_common common; | 26 | struct tcf_common common; |
27 | u32 flags; | 27 | u32 flags; |
28 | u32 priority; | 28 | u32 priority; |
29 | u32 mark; | ||
29 | u16 queue_mapping; | 30 | u16 queue_mapping; |
31 | /* XXX: 16-bit pad here? */ | ||
30 | }; | 32 | }; |
31 | #define to_skbedit(pc) \ | 33 | #define to_skbedit(pc) \ |
32 | container_of(pc, struct tcf_skbedit, common) | 34 | container_of(pc, struct tcf_skbedit, common) |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 03a49c703377..325bfcf5c934 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -62,9 +62,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
62 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 62 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
63 | #define TCP_MIN_MSS 88U | 63 | #define TCP_MIN_MSS 88U |
64 | 64 | ||
65 | /* Minimal RCV_MSS. */ | ||
66 | #define TCP_MIN_RCVMSS 536U | ||
67 | |||
68 | /* The least MTU to use for probing */ | 65 | /* The least MTU to use for probing */ |
69 | #define TCP_BASE_MSS 512 | 66 | #define TCP_BASE_MSS 512 |
70 | 67 | ||
@@ -359,8 +356,7 @@ TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) | |||
359 | inet_rsk(req)->ecn_ok = 1; | 356 | inet_rsk(req)->ecn_ok = 1; |
360 | } | 357 | } |
361 | 358 | ||
362 | enum tcp_tw_status | 359 | enum tcp_tw_status { |
363 | { | ||
364 | TCP_TW_SUCCESS = 0, | 360 | TCP_TW_SUCCESS = 0, |
365 | TCP_TW_RST = 1, | 361 | TCP_TW_RST = 1, |
366 | TCP_TW_ACK = 2, | 362 | TCP_TW_ACK = 2, |
@@ -409,7 +405,8 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
409 | 405 | ||
410 | extern void tcp_parse_options(struct sk_buff *skb, | 406 | extern void tcp_parse_options(struct sk_buff *skb, |
411 | struct tcp_options_received *opt_rx, | 407 | struct tcp_options_received *opt_rx, |
412 | int estab); | 408 | int estab, |
409 | struct dst_entry *dst); | ||
413 | 410 | ||
414 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | 411 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); |
415 | 412 | ||
diff --git a/include/net/udp.h b/include/net/udp.h index f98abd2ce709..5348d80b25bb 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -50,16 +50,49 @@ struct udp_skb_cb { | |||
50 | }; | 50 | }; |
51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) | 51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) |
52 | 52 | ||
53 | /** | ||
54 | * struct udp_hslot - UDP hash slot | ||
55 | * | ||
56 | * @head: head of list of sockets | ||
57 | * @count: number of sockets in 'head' list | ||
58 | * @lock: spinlock protecting changes to head/count | ||
59 | */ | ||
53 | struct udp_hslot { | 60 | struct udp_hslot { |
54 | struct hlist_nulls_head head; | 61 | struct hlist_nulls_head head; |
62 | int count; | ||
55 | spinlock_t lock; | 63 | spinlock_t lock; |
56 | } __attribute__((aligned(2 * sizeof(long)))); | 64 | } __attribute__((aligned(2 * sizeof(long)))); |
65 | |||
66 | /** | ||
67 | * struct udp_table - UDP table | ||
68 | * | ||
69 | * @hash: hash table, sockets are hashed on (local port) | ||
70 | * @hash2: hash table, sockets are hashed on (local port, local address) | ||
71 | * @mask: number of slots in hash tables, minus 1 | ||
72 | * @log: log2(number of slots in hash table) | ||
73 | */ | ||
57 | struct udp_table { | 74 | struct udp_table { |
58 | struct udp_hslot hash[UDP_HTABLE_SIZE]; | 75 | struct udp_hslot *hash; |
76 | struct udp_hslot *hash2; | ||
77 | unsigned int mask; | ||
78 | unsigned int log; | ||
59 | }; | 79 | }; |
60 | extern struct udp_table udp_table; | 80 | extern struct udp_table udp_table; |
61 | extern void udp_table_init(struct udp_table *); | 81 | extern void udp_table_init(struct udp_table *, const char *); |
62 | 82 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, | |
83 | struct net *net, unsigned num) | ||
84 | { | ||
85 | return &table->hash[udp_hashfn(net, num, table->mask)]; | ||
86 | } | ||
87 | /* | ||
88 | * For secondary hash, net_hash_mix() is performed before calling | ||
89 | * udp_hashslot2(), this explains difference with udp_hashslot() | ||
90 | */ | ||
91 | static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, | ||
92 | unsigned int hash) | ||
93 | { | ||
94 | return &table->hash2[hash & table->mask]; | ||
95 | } | ||
63 | 96 | ||
64 | /* Note: this must match 'valbool' in sock_setsockopt */ | 97 | /* Note: this must match 'valbool' in sock_setsockopt */ |
65 | #define UDP_CSUM_NOXMIT 1 | 98 | #define UDP_CSUM_NOXMIT 1 |
@@ -125,7 +158,8 @@ static inline void udp_lib_close(struct sock *sk, long timeout) | |||
125 | } | 158 | } |
126 | 159 | ||
127 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, | 160 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, |
128 | int (*)(const struct sock*,const struct sock*)); | 161 | int (*)(const struct sock *,const struct sock *), |
162 | unsigned int hash2_nulladdr); | ||
129 | 163 | ||
130 | /* net/ipv4/udp.c */ | 164 | /* net/ipv4/udp.c */ |
131 | extern int udp_get_port(struct sock *sk, unsigned short snum, | 165 | extern int udp_get_port(struct sock *sk, unsigned short snum, |
diff --git a/include/net/wext.h b/include/net/wext.h index 3f2b94de2cfa..4f6e7423174c 100644 --- a/include/net/wext.h +++ b/include/net/wext.h | |||
@@ -1,29 +1,19 @@ | |||
1 | #ifndef __NET_WEXT_H | 1 | #ifndef __NET_WEXT_H |
2 | #define __NET_WEXT_H | 2 | #define __NET_WEXT_H |
3 | 3 | ||
4 | /* | 4 | #include <net/iw_handler.h> |
5 | * wireless extensions interface to the core code | ||
6 | */ | ||
7 | 5 | ||
8 | struct net; | 6 | struct net; |
9 | 7 | ||
10 | #ifdef CONFIG_WIRELESS_EXT | 8 | #ifdef CONFIG_WEXT_CORE |
11 | extern int wext_proc_init(struct net *net); | ||
12 | extern void wext_proc_exit(struct net *net); | ||
13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 9 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
14 | void __user *arg); | 10 | void __user *arg); |
15 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | 11 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, |
16 | unsigned long arg); | 12 | unsigned long arg); |
13 | |||
17 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); | 14 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); |
15 | extern int call_commit_handler(struct net_device *dev); | ||
18 | #else | 16 | #else |
19 | static inline int wext_proc_init(struct net *net) | ||
20 | { | ||
21 | return 0; | ||
22 | } | ||
23 | static inline void wext_proc_exit(struct net *net) | ||
24 | { | ||
25 | return; | ||
26 | } | ||
27 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 17 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
28 | void __user *arg) | 18 | void __user *arg) |
29 | { | 19 | { |
@@ -36,4 +26,35 @@ static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | |||
36 | } | 26 | } |
37 | #endif | 27 | #endif |
38 | 28 | ||
29 | #ifdef CONFIG_WEXT_PROC | ||
30 | extern int wext_proc_init(struct net *net); | ||
31 | extern void wext_proc_exit(struct net *net); | ||
32 | #else | ||
33 | static inline int wext_proc_init(struct net *net) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | static inline void wext_proc_exit(struct net *net) | ||
38 | { | ||
39 | return; | ||
40 | } | ||
41 | #endif | ||
42 | |||
43 | #ifdef CONFIG_WEXT_PRIV | ||
44 | int ioctl_private_call(struct net_device *dev, struct iwreq *iwr, | ||
45 | unsigned int cmd, struct iw_request_info *info, | ||
46 | iw_handler handler); | ||
47 | int compat_private_call(struct net_device *dev, struct iwreq *iwr, | ||
48 | unsigned int cmd, struct iw_request_info *info, | ||
49 | iw_handler handler); | ||
50 | int iw_handler_get_private(struct net_device * dev, | ||
51 | struct iw_request_info * info, | ||
52 | union iwreq_data * wrqu, | ||
53 | char * extra); | ||
54 | #else | ||
55 | #define ioctl_private_call NULL | ||
56 | #define compat_private_call NULL | ||
57 | #endif | ||
58 | |||
59 | |||
39 | #endif /* __NET_WEXT_H */ | 60 | #endif /* __NET_WEXT_H */ |
diff --git a/include/net/wimax.h b/include/net/wimax.h index 2af7bf839f23..d69c4a7a1267 100644 --- a/include/net/wimax.h +++ b/include/net/wimax.h | |||
@@ -195,6 +195,12 @@ | |||
195 | * defining the `struct nla_policy` for each message, it has to have | 195 | * defining the `struct nla_policy` for each message, it has to have |
196 | * an array size of WIMAX_GNL_ATTR_MAX+1. | 196 | * an array size of WIMAX_GNL_ATTR_MAX+1. |
197 | * | 197 | * |
198 | * The op_*() function pointers will not be called if the wimax_dev is | ||
199 | * in a state <= %WIMAX_ST_UNINITIALIZED. The exception is: | ||
200 | * | ||
201 | * - op_reset: can be called at any time after wimax_dev_add() has | ||
202 | * been called. | ||
203 | * | ||
198 | * THE PIPE INTERFACE: | 204 | * THE PIPE INTERFACE: |
199 | * | 205 | * |
200 | * This interface is kept intentionally simple. The driver can send | 206 | * This interface is kept intentionally simple. The driver can send |
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 547b1e271ac9..85926231c07a 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h | |||
@@ -34,20 +34,32 @@ struct wpan_phy { | |||
34 | */ | 34 | */ |
35 | u8 current_channel; | 35 | u8 current_channel; |
36 | u8 current_page; | 36 | u8 current_page; |
37 | u32 channels_supported; | 37 | u32 channels_supported[32]; |
38 | u8 transmit_power; | 38 | u8 transmit_power; |
39 | u8 cca_mode; | 39 | u8 cca_mode; |
40 | 40 | ||
41 | struct device dev; | 41 | struct device dev; |
42 | int idx; | 42 | int idx; |
43 | 43 | ||
44 | struct net_device *(*add_iface)(struct wpan_phy *phy, | ||
45 | const char *name); | ||
46 | void (*del_iface)(struct wpan_phy *phy, struct net_device *dev); | ||
47 | |||
44 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 48 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
45 | }; | 49 | }; |
46 | 50 | ||
51 | #define to_phy(_dev) container_of(_dev, struct wpan_phy, dev) | ||
52 | |||
47 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); | 53 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); |
48 | int wpan_phy_register(struct device *parent, struct wpan_phy *phy); | 54 | static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) |
55 | { | ||
56 | phy->dev.parent = dev; | ||
57 | } | ||
58 | int wpan_phy_register(struct wpan_phy *phy); | ||
49 | void wpan_phy_unregister(struct wpan_phy *phy); | 59 | void wpan_phy_unregister(struct wpan_phy *phy); |
50 | void wpan_phy_free(struct wpan_phy *phy); | 60 | void wpan_phy_free(struct wpan_phy *phy); |
61 | /* Same semantics as for class_for_each_device */ | ||
62 | int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data), void *data); | ||
51 | 63 | ||
52 | static inline void *wpan_phy_priv(struct wpan_phy *phy) | 64 | static inline void *wpan_phy_priv(struct wpan_phy *phy) |
53 | { | 65 | { |
@@ -56,6 +68,12 @@ static inline void *wpan_phy_priv(struct wpan_phy *phy) | |||
56 | } | 68 | } |
57 | 69 | ||
58 | struct wpan_phy *wpan_phy_find(const char *str); | 70 | struct wpan_phy *wpan_phy_find(const char *str); |
71 | |||
72 | static inline void wpan_phy_put(struct wpan_phy *phy) | ||
73 | { | ||
74 | put_device(&phy->dev); | ||
75 | } | ||
76 | |||
59 | static inline const char *wpan_phy_name(struct wpan_phy *phy) | 77 | static inline const char *wpan_phy_name(struct wpan_phy *phy) |
60 | { | 78 | { |
61 | return dev_name(&phy->dev); | 79 | return dev_name(&phy->dev); |
diff --git a/include/net/x25.h b/include/net/x25.h index 2cda04011568..9baa07dc7d17 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -287,8 +287,14 @@ extern unsigned long x25_display_timer(struct sock *); | |||
287 | extern void x25_check_rbuf(struct sock *); | 287 | extern void x25_check_rbuf(struct sock *); |
288 | 288 | ||
289 | /* sysctl_net_x25.c */ | 289 | /* sysctl_net_x25.c */ |
290 | #ifdef CONFIG_SYSCTL | ||
290 | extern void x25_register_sysctl(void); | 291 | extern void x25_register_sysctl(void); |
291 | extern void x25_unregister_sysctl(void); | 292 | extern void x25_unregister_sysctl(void); |
293 | #else | ||
294 | static inline void x25_register_sysctl(void) {}; | ||
295 | static inline void x25_unregister_sysctl(void) {}; | ||
296 | #endif /* CONFIG_SYSCTL */ | ||
297 | |||
292 | struct x25_skb_cb { | 298 | struct x25_skb_cb { |
293 | unsigned flags; | 299 | unsigned flags; |
294 | }; | 300 | }; |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 223e90a44824..6d85861ab990 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #include <net/route.h> | 19 | #include <net/route.h> |
20 | #include <net/ipv6.h> | 20 | #include <net/ipv6.h> |
21 | #include <net/ip6_fib.h> | 21 | #include <net/ip6_fib.h> |
22 | |||
23 | #include <linux/interrupt.h> | ||
24 | |||
22 | #ifdef CONFIG_XFRM_STATISTICS | 25 | #ifdef CONFIG_XFRM_STATISTICS |
23 | #include <net/snmp.h> | 26 | #include <net/snmp.h> |
24 | #endif | 27 | #endif |
@@ -121,8 +124,7 @@ struct xfrm_state_walk { | |||
121 | }; | 124 | }; |
122 | 125 | ||
123 | /* Full description of state of transformer. */ | 126 | /* Full description of state of transformer. */ |
124 | struct xfrm_state | 127 | struct xfrm_state { |
125 | { | ||
126 | #ifdef CONFIG_NET_NS | 128 | #ifdef CONFIG_NET_NS |
127 | struct net *xs_net; | 129 | struct net *xs_net; |
128 | #endif | 130 | #endif |
@@ -160,7 +162,7 @@ struct xfrm_state | |||
160 | struct xfrm_lifetime_cfg lft; | 162 | struct xfrm_lifetime_cfg lft; |
161 | 163 | ||
162 | /* Data for transformer */ | 164 | /* Data for transformer */ |
163 | struct xfrm_algo *aalg; | 165 | struct xfrm_algo_auth *aalg; |
164 | struct xfrm_algo *ealg; | 166 | struct xfrm_algo *ealg; |
165 | struct xfrm_algo *calg; | 167 | struct xfrm_algo *calg; |
166 | struct xfrm_algo_aead *aead; | 168 | struct xfrm_algo_aead *aead; |
@@ -199,7 +201,7 @@ struct xfrm_state | |||
199 | struct xfrm_stats stats; | 201 | struct xfrm_stats stats; |
200 | 202 | ||
201 | struct xfrm_lifetime_cur curlft; | 203 | struct xfrm_lifetime_cur curlft; |
202 | struct timer_list timer; | 204 | struct tasklet_hrtimer mtimer; |
203 | 205 | ||
204 | /* Last used time */ | 206 | /* Last used time */ |
205 | unsigned long lastused; | 207 | unsigned long lastused; |
@@ -237,8 +239,7 @@ enum { | |||
237 | }; | 239 | }; |
238 | 240 | ||
239 | /* callback structure passed from either netlink or pfkey */ | 241 | /* callback structure passed from either netlink or pfkey */ |
240 | struct km_event | 242 | struct km_event { |
241 | { | ||
242 | union { | 243 | union { |
243 | u32 hard; | 244 | u32 hard; |
244 | u32 proto; | 245 | u32 proto; |
@@ -313,8 +314,7 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | |||
313 | 314 | ||
314 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | 315 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); |
315 | 316 | ||
316 | struct xfrm_type | 317 | struct xfrm_type { |
317 | { | ||
318 | char *description; | 318 | char *description; |
319 | struct module *owner; | 319 | struct module *owner; |
320 | __u8 proto; | 320 | __u8 proto; |
@@ -420,8 +420,7 @@ static inline struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ipp | |||
420 | return x->inner_mode_iaf; | 420 | return x->inner_mode_iaf; |
421 | } | 421 | } |
422 | 422 | ||
423 | struct xfrm_tmpl | 423 | struct xfrm_tmpl { |
424 | { | ||
425 | /* id in template is interpreted as: | 424 | /* id in template is interpreted as: |
426 | * daddr - destination of tunnel, may be zero for transport mode. | 425 | * daddr - destination of tunnel, may be zero for transport mode. |
427 | * spi - zero to acquire spi. Not zero if spi is static, then | 426 | * spi - zero to acquire spi. Not zero if spi is static, then |
@@ -468,8 +467,7 @@ struct xfrm_policy_walk { | |||
468 | u32 seq; | 467 | u32 seq; |
469 | }; | 468 | }; |
470 | 469 | ||
471 | struct xfrm_policy | 470 | struct xfrm_policy { |
472 | { | ||
473 | #ifdef CONFIG_NET_NS | 471 | #ifdef CONFIG_NET_NS |
474 | struct net *xp_net; | 472 | struct net *xp_net; |
475 | #endif | 473 | #endif |
@@ -538,8 +536,7 @@ struct xfrm_migrate { | |||
538 | /* default seq threshold size */ | 536 | /* default seq threshold size */ |
539 | #define XFRM_AE_SEQT_SIZE 2 | 537 | #define XFRM_AE_SEQT_SIZE 2 |
540 | 538 | ||
541 | struct xfrm_mgr | 539 | struct xfrm_mgr { |
542 | { | ||
543 | struct list_head list; | 540 | struct list_head list; |
544 | char *id; | 541 | char *id; |
545 | int (*notify)(struct xfrm_state *x, struct km_event *c); | 542 | int (*notify)(struct xfrm_state *x, struct km_event *c); |
@@ -626,8 +623,7 @@ struct xfrm_spi_skb_cb { | |||
626 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) | 623 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) |
627 | 624 | ||
628 | /* Audit Information */ | 625 | /* Audit Information */ |
629 | struct xfrm_audit | 626 | struct xfrm_audit { |
630 | { | ||
631 | u32 secid; | 627 | u32 secid; |
632 | uid_t loginuid; | 628 | uid_t loginuid; |
633 | u32 sessionid; | 629 | u32 sessionid; |
@@ -871,8 +867,7 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct | |||
871 | * bundles differing by session id. All the bundles grow from a parent | 867 | * bundles differing by session id. All the bundles grow from a parent |
872 | * policy rule. | 868 | * policy rule. |
873 | */ | 869 | */ |
874 | struct xfrm_dst | 870 | struct xfrm_dst { |
875 | { | ||
876 | union { | 871 | union { |
877 | struct dst_entry dst; | 872 | struct dst_entry dst; |
878 | struct rtable rt; | 873 | struct rtable rt; |
@@ -907,8 +902,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | |||
907 | 902 | ||
908 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 903 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); |
909 | 904 | ||
910 | struct sec_path | 905 | struct sec_path { |
911 | { | ||
912 | atomic_t refcnt; | 906 | atomic_t refcnt; |
913 | int len; | 907 | int len; |
914 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; | 908 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; |
@@ -1500,9 +1494,6 @@ struct scatterlist; | |||
1500 | typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, | 1494 | typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, |
1501 | unsigned int); | 1495 | unsigned int); |
1502 | 1496 | ||
1503 | extern int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *tfm, | ||
1504 | int offset, int len, icv_update_fn_t icv_update); | ||
1505 | |||
1506 | static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, | 1497 | static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, |
1507 | int family) | 1498 | int family) |
1508 | { | 1499 | { |
@@ -1541,12 +1532,22 @@ static inline int xfrm_alg_len(struct xfrm_algo *alg) | |||
1541 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); | 1532 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); |
1542 | } | 1533 | } |
1543 | 1534 | ||
1535 | static inline int xfrm_alg_auth_len(struct xfrm_algo_auth *alg) | ||
1536 | { | ||
1537 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); | ||
1538 | } | ||
1539 | |||
1544 | #ifdef CONFIG_XFRM_MIGRATE | 1540 | #ifdef CONFIG_XFRM_MIGRATE |
1545 | static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) | 1541 | static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) |
1546 | { | 1542 | { |
1547 | return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); | 1543 | return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); |
1548 | } | 1544 | } |
1549 | 1545 | ||
1546 | static inline struct xfrm_algo_auth *xfrm_algo_auth_clone(struct xfrm_algo_auth *orig) | ||
1547 | { | ||
1548 | return kmemdup(orig, xfrm_alg_auth_len(orig), GFP_KERNEL); | ||
1549 | } | ||
1550 | |||
1550 | static inline void xfrm_states_put(struct xfrm_state **states, int n) | 1551 | static inline void xfrm_states_put(struct xfrm_state **states, int n) |
1551 | { | 1552 | { |
1552 | int i; | 1553 | int i; |