aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/cfg80211.h82
-rw-r--r--include/net/checksum.h2
-rw-r--r--include/net/dst.h23
-rw-r--r--include/net/ieee80211.h133
-rw-r--r--include/net/inet_hashtables.h56
-rw-r--r--include/net/inet_timewait_sock.h10
-rw-r--r--include/net/ip_vs.h17
-rw-r--r--include/net/lib80211.h18
-rw-r--r--include/net/mac80211.h411
-rw-r--r--include/net/ndisc.h14
-rw-r--r--include/net/neighbour.h15
-rw-r--r--include/net/net_namespace.h18
-rw-r--r--include/net/netfilter/nf_conntrack_tuple.h12
-rw-r--r--include/net/netlink.h22
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/pkt_cls.h2
-rw-r--r--include/net/sch_generic.h38
-rw-r--r--include/net/sctp/sctp.h8
-rw-r--r--include/net/sock.h82
-rw-r--r--include/net/tcp.h1
-rw-r--r--include/net/udp.h25
-rw-r--r--include/net/udplite.h2
-rw-r--r--include/net/wireless.h70
-rw-r--r--include/net/xfrm.h5
24 files changed, 604 insertions, 464 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0e85ec39b638..1d57835d73f2 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -280,11 +280,16 @@ struct mpath_info {
280 * (0 = no, 1 = yes, -1 = do not change) 280 * (0 = no, 1 = yes, -1 = do not change)
281 * @use_short_slot_time: Whether the use of short slot time is allowed 281 * @use_short_slot_time: Whether the use of short slot time is allowed
282 * (0 = no, 1 = yes, -1 = do not change) 282 * (0 = no, 1 = yes, -1 = do not change)
283 * @basic_rates: basic rates in IEEE 802.11 format
284 * (or NULL for no change)
285 * @basic_rates_len: number of basic rates
283 */ 286 */
284struct bss_parameters { 287struct bss_parameters {
285 int use_cts_prot; 288 int use_cts_prot;
286 int use_short_preamble; 289 int use_short_preamble;
287 int use_short_slot_time; 290 int use_short_slot_time;
291 u8 *basic_rates;
292 u8 basic_rates_len;
288}; 293};
289 294
290/** 295/**
@@ -331,22 +336,59 @@ struct ieee80211_regdomain {
331 struct ieee80211_reg_rule reg_rules[]; 336 struct ieee80211_reg_rule reg_rules[];
332}; 337};
333 338
334#define MHZ_TO_KHZ(freq) (freq * 1000) 339#define MHZ_TO_KHZ(freq) ((freq) * 1000)
335#define KHZ_TO_MHZ(freq) (freq / 1000) 340#define KHZ_TO_MHZ(freq) ((freq) / 1000)
336#define DBI_TO_MBI(gain) (gain * 100) 341#define DBI_TO_MBI(gain) ((gain) * 100)
337#define MBI_TO_DBI(gain) (gain / 100) 342#define MBI_TO_DBI(gain) ((gain) / 100)
338#define DBM_TO_MBM(gain) (gain * 100) 343#define DBM_TO_MBM(gain) ((gain) * 100)
339#define MBM_TO_DBM(gain) (gain / 100) 344#define MBM_TO_DBM(gain) ((gain) / 100)
340 345
341#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ 346#define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \
342 .freq_range.start_freq_khz = (start) * 1000, \ 347 .freq_range.start_freq_khz = MHZ_TO_KHZ(start), \
343 .freq_range.end_freq_khz = (end) * 1000, \ 348 .freq_range.end_freq_khz = MHZ_TO_KHZ(end), \
344 .freq_range.max_bandwidth_khz = (bw) * 1000, \ 349 .freq_range.max_bandwidth_khz = MHZ_TO_KHZ(bw), \
345 .power_rule.max_antenna_gain = (gain) * 100, \ 350 .power_rule.max_antenna_gain = DBI_TO_MBI(gain), \
346 .power_rule.max_eirp = (eirp) * 100, \ 351 .power_rule.max_eirp = DBM_TO_MBM(eirp), \
347 .flags = reg_flags, \ 352 .flags = reg_flags, \
348 } 353 }
349 354
355struct mesh_config {
356 /* Timeouts in ms */
357 /* Mesh plink management parameters */
358 u16 dot11MeshRetryTimeout;
359 u16 dot11MeshConfirmTimeout;
360 u16 dot11MeshHoldingTimeout;
361 u16 dot11MeshMaxPeerLinks;
362 u8 dot11MeshMaxRetries;
363 u8 dot11MeshTTL;
364 bool auto_open_plinks;
365 /* HWMP parameters */
366 u8 dot11MeshHWMPmaxPREQretries;
367 u32 path_refresh_time;
368 u16 min_discovery_timeout;
369 u32 dot11MeshHWMPactivePathTimeout;
370 u16 dot11MeshHWMPpreqMinInterval;
371 u16 dot11MeshHWMPnetDiameterTraversalTime;
372};
373
374/**
375 * struct ieee80211_txq_params - TX queue parameters
376 * @queue: TX queue identifier (NL80211_TXQ_Q_*)
377 * @txop: Maximum burst time in units of 32 usecs, 0 meaning disabled
378 * @cwmin: Minimum contention window [a value of the form 2^n-1 in the range
379 * 1..32767]
380 * @cwmax: Maximum contention window [a value of the form 2^n-1 in the range
381 * 1..32767]
382 * @aifs: Arbitration interframe space [0..255]
383 */
384struct ieee80211_txq_params {
385 enum nl80211_txq_q queue;
386 u16 txop;
387 u16 cwmin;
388 u16 cwmax;
389 u8 aifs;
390};
391
350/* from net/wireless.h */ 392/* from net/wireless.h */
351struct wiphy; 393struct wiphy;
352 394
@@ -397,9 +439,17 @@ struct wiphy;
397 * 439 *
398 * @change_station: Modify a given station. 440 * @change_station: Modify a given station.
399 * 441 *
442 * @get_mesh_params: Put the current mesh parameters into *params
443 *
444 * @set_mesh_params: Set mesh parameters.
445 * The mask is a bitfield which tells us which parameters to
446 * set, and which to leave alone.
447 *
400 * @set_mesh_cfg: set mesh parameters (by now, just mesh id) 448 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
401 * 449 *
402 * @change_bss: Modify parameters for a given BSS. 450 * @change_bss: Modify parameters for a given BSS.
451 *
452 * @set_txq_params: Set TX queue parameters
403 */ 453 */
404struct cfg80211_ops { 454struct cfg80211_ops {
405 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 455 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
@@ -452,9 +502,17 @@ struct cfg80211_ops {
452 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev, 502 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
453 int idx, u8 *dst, u8 *next_hop, 503 int idx, u8 *dst, u8 *next_hop,
454 struct mpath_info *pinfo); 504 struct mpath_info *pinfo);
455 505 int (*get_mesh_params)(struct wiphy *wiphy,
506 struct net_device *dev,
507 struct mesh_config *conf);
508 int (*set_mesh_params)(struct wiphy *wiphy,
509 struct net_device *dev,
510 const struct mesh_config *nconf, u32 mask);
456 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, 511 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
457 struct bss_parameters *params); 512 struct bss_parameters *params);
513
514 int (*set_txq_params)(struct wiphy *wiphy,
515 struct ieee80211_txq_params *params);
458}; 516};
459 517
460#endif /* __NET_CFG80211_H */ 518#endif /* __NET_CFG80211_H */
diff --git a/include/net/checksum.h b/include/net/checksum.h
index 07602b7fa218..ba55d8b8c87c 100644
--- a/include/net/checksum.h
+++ b/include/net/checksum.h
@@ -98,7 +98,7 @@ static inline void csum_replace4(__sum16 *sum, __be32 from, __be32 to)
98{ 98{
99 __be32 diff[] = { ~from, to }; 99 __be32 diff[] = { ~from, to };
100 100
101 *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum))); 101 *sum = csum_fold(csum_partial(diff, sizeof(diff), ~csum_unfold(*sum)));
102} 102}
103 103
104static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to) 104static inline void csum_replace2(__sum16 *sum, __be16 from, __be16 to)
diff --git a/include/net/dst.h b/include/net/dst.h
index 8a8b71e5f3f1..6c778799bf10 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -59,8 +59,11 @@ struct dst_entry
59 59
60 struct neighbour *neighbour; 60 struct neighbour *neighbour;
61 struct hh_cache *hh; 61 struct hh_cache *hh;
62#ifdef CONFIG_XFRM
62 struct xfrm_state *xfrm; 63 struct xfrm_state *xfrm;
63 64#else
65 void *__pad1;
66#endif
64 int (*input)(struct sk_buff*); 67 int (*input)(struct sk_buff*);
65 int (*output)(struct sk_buff*); 68 int (*output)(struct sk_buff*);
66 69
@@ -70,8 +73,20 @@ struct dst_entry
70 73
71#ifdef CONFIG_NET_CLS_ROUTE 74#ifdef CONFIG_NET_CLS_ROUTE
72 __u32 tclassid; 75 __u32 tclassid;
76#else
77 __u32 __pad2;
73#endif 78#endif
74 79
80
81 /*
82 * Align __refcnt to a 64 bytes alignment
83 * (L1_CACHE_SIZE would be too much)
84 */
85#ifdef CONFIG_64BIT
86 long __pad_to_align_refcnt[2];
87#else
88 long __pad_to_align_refcnt[1];
89#endif
75 /* 90 /*
76 * __refcnt wants to be on a different cache line from 91 * __refcnt wants to be on a different cache line from
77 * input/output/ops or performance tanks badly 92 * input/output/ops or performance tanks badly
@@ -103,7 +118,6 @@ struct dst_ops
103 void (*link_failure)(struct sk_buff *); 118 void (*link_failure)(struct sk_buff *);
104 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 119 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
105 int (*local_out)(struct sk_buff *skb); 120 int (*local_out)(struct sk_buff *skb);
106 int entry_size;
107 121
108 atomic_t entries; 122 atomic_t entries;
109 struct kmem_cache *kmem_cachep; 123 struct kmem_cache *kmem_cachep;
@@ -157,6 +171,11 @@ dst_metric_locked(struct dst_entry *dst, int metric)
157 171
158static inline void dst_hold(struct dst_entry * dst) 172static inline void dst_hold(struct dst_entry * dst)
159{ 173{
174 /*
175 * If your kernel compilation stops here, please check
176 * __pad_to_align_refcnt declaration in struct dst_entry
177 */
178 BUILD_BUG_ON(offsetof(struct dst_entry, __refcnt) & 63);
160 atomic_inc(&dst->__refcnt); 179 atomic_inc(&dst->__refcnt);
161} 180}
162 181
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 93a56de3594b..738734a4653b 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -28,6 +28,7 @@
28#include <linux/if_ether.h> /* ETH_ALEN */ 28#include <linux/if_ether.h> /* ETH_ALEN */
29#include <linux/kernel.h> /* ARRAY_SIZE */ 29#include <linux/kernel.h> /* ARRAY_SIZE */
30#include <linux/wireless.h> 30#include <linux/wireless.h>
31#include <linux/ieee80211.h>
31 32
32#define IEEE80211_VERSION "git-1.1.13" 33#define IEEE80211_VERSION "git-1.1.13"
33 34
@@ -127,10 +128,6 @@ static inline bool ieee80211_ratelimit_debug(u32 level)
127} 128}
128#endif /* CONFIG_IEEE80211_DEBUG */ 129#endif /* CONFIG_IEEE80211_DEBUG */
129 130
130/* escape_essid() is intended to be used in debug (and possibly error)
131 * messages. It should never be used for passing essid to user space. */
132const char *escape_essid(const char *essid, u8 essid_len);
133
134/* 131/*
135 * To use the debug system: 132 * To use the debug system:
136 * 133 *
@@ -218,94 +215,6 @@ struct ieee80211_snap_hdr {
218#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG) 215#define WLAN_GET_SEQ_FRAG(seq) ((seq) & IEEE80211_SCTL_FRAG)
219#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4) 216#define WLAN_GET_SEQ_SEQ(seq) (((seq) & IEEE80211_SCTL_SEQ) >> 4)
220 217
221/* Authentication algorithms */
222#define WLAN_AUTH_OPEN 0
223#define WLAN_AUTH_SHARED_KEY 1
224#define WLAN_AUTH_LEAP 2
225
226#define WLAN_AUTH_CHALLENGE_LEN 128
227
228#define WLAN_CAPABILITY_ESS (1<<0)
229#define WLAN_CAPABILITY_IBSS (1<<1)
230#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
231#define WLAN_CAPABILITY_CF_POLL_REQUEST (1<<3)
232#define WLAN_CAPABILITY_PRIVACY (1<<4)
233#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
234#define WLAN_CAPABILITY_PBCC (1<<6)
235#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
236#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
237#define WLAN_CAPABILITY_QOS (1<<9)
238#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
239#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
240
241/* 802.11g ERP information element */
242#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
243#define WLAN_ERP_USE_PROTECTION (1<<1)
244#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
245
246/* Status codes */
247enum ieee80211_statuscode {
248 WLAN_STATUS_SUCCESS = 0,
249 WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
250 WLAN_STATUS_CAPS_UNSUPPORTED = 10,
251 WLAN_STATUS_REASSOC_NO_ASSOC = 11,
252 WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
253 WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
254 WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
255 WLAN_STATUS_CHALLENGE_FAIL = 15,
256 WLAN_STATUS_AUTH_TIMEOUT = 16,
257 WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
258 WLAN_STATUS_ASSOC_DENIED_RATES = 18,
259 /* 802.11b */
260 WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
261 WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
262 WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
263 /* 802.11h */
264 WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
265 WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
266 WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
267 /* 802.11g */
268 WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
269 WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
270 /* 802.11i */
271 WLAN_STATUS_INVALID_IE = 40,
272 WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
273 WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
274 WLAN_STATUS_INVALID_AKMP = 43,
275 WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
276 WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
277 WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
278};
279
280/* Reason codes */
281enum ieee80211_reasoncode {
282 WLAN_REASON_UNSPECIFIED = 1,
283 WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
284 WLAN_REASON_DEAUTH_LEAVING = 3,
285 WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
286 WLAN_REASON_DISASSOC_AP_BUSY = 5,
287 WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
288 WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
289 WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
290 WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
291 /* 802.11h */
292 WLAN_REASON_DISASSOC_BAD_POWER = 10,
293 WLAN_REASON_DISASSOC_BAD_SUPP_CHAN = 11,
294 /* 802.11i */
295 WLAN_REASON_INVALID_IE = 13,
296 WLAN_REASON_MIC_FAILURE = 14,
297 WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT = 15,
298 WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT = 16,
299 WLAN_REASON_IE_DIFFERENT = 17,
300 WLAN_REASON_INVALID_GROUP_CIPHER = 18,
301 WLAN_REASON_INVALID_PAIRWISE_CIPHER = 19,
302 WLAN_REASON_INVALID_AKMP = 20,
303 WLAN_REASON_UNSUPP_RSN_VERSION = 21,
304 WLAN_REASON_INVALID_RSN_IE_CAP = 22,
305 WLAN_REASON_IEEE8021X_FAILED = 23,
306 WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
307};
308
309/* Action categories - 802.11h */ 218/* Action categories - 802.11h */
310enum ieee80211_actioncategories { 219enum ieee80211_actioncategories {
311 WLAN_ACTION_SPECTRUM_MGMT = 0, 220 WLAN_ACTION_SPECTRUM_MGMT = 0,
@@ -534,15 +443,6 @@ enum ieee80211_mfie {
534 MFIE_TYPE_QOS_PARAMETER = 222, 443 MFIE_TYPE_QOS_PARAMETER = 222,
535}; 444};
536 445
537/* Minimal header; can be used for passing 802.11 frames with sufficient
538 * information to determine what type of underlying data type is actually
539 * stored in the data. */
540struct ieee80211_hdr {
541 __le16 frame_ctl;
542 __le16 duration_id;
543 u8 payload[0];
544} __attribute__ ((packed));
545
546struct ieee80211_hdr_1addr { 446struct ieee80211_hdr_1addr {
547 __le16 frame_ctl; 447 __le16 frame_ctl;
548 __le16 duration_id; 448 __le16 duration_id;
@@ -590,18 +490,6 @@ struct ieee80211_hdr_3addrqos {
590 __le16 qos_ctl; 490 __le16 qos_ctl;
591} __attribute__ ((packed)); 491} __attribute__ ((packed));
592 492
593struct ieee80211_hdr_4addrqos {
594 __le16 frame_ctl;
595 __le16 duration_id;
596 u8 addr1[ETH_ALEN];
597 u8 addr2[ETH_ALEN];
598 u8 addr3[ETH_ALEN];
599 __le16 seq_ctl;
600 u8 addr4[ETH_ALEN];
601 u8 payload[0];
602 __le16 qos_ctl;
603} __attribute__ ((packed));
604
605struct ieee80211_info_element { 493struct ieee80211_info_element {
606 u8 id; 494 u8 id;
607 u8 len; 495 u8 len;
@@ -733,7 +621,6 @@ struct ieee80211_txb {
733 621
734#define MAX_WPA_IE_LEN 64 622#define MAX_WPA_IE_LEN 64
735 623
736#define NETWORK_EMPTY_ESSID (1<<0)
737#define NETWORK_HAS_OFDM (1<<1) 624#define NETWORK_HAS_OFDM (1<<1)
738#define NETWORK_HAS_CCK (1<<2) 625#define NETWORK_HAS_CCK (1<<2)
739 626
@@ -1135,22 +1022,6 @@ static inline void *ieee80211_priv(struct net_device *dev)
1135 return ((struct ieee80211_device *)netdev_priv(dev))->priv; 1022 return ((struct ieee80211_device *)netdev_priv(dev))->priv;
1136} 1023}
1137 1024
1138static inline int ieee80211_is_empty_essid(const char *essid, int essid_len)
1139{
1140 /* Single white space is for Linksys APs */
1141 if (essid_len == 1 && essid[0] == ' ')
1142 return 1;
1143
1144 /* Otherwise, if the entire essid is 0, we assume it is hidden */
1145 while (essid_len) {
1146 essid_len--;
1147 if (essid[essid_len] != '\0')
1148 return 0;
1149 }
1150
1151 return 1;
1152}
1153
1154static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee, 1025static inline int ieee80211_is_valid_mode(struct ieee80211_device *ieee,
1155 int mode) 1026 int mode)
1156{ 1027{
@@ -1208,7 +1079,7 @@ static inline int ieee80211_get_hdrlen(u16 fc)
1208 1079
1209static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr) 1080static inline u8 *ieee80211_get_payload(struct ieee80211_hdr *hdr)
1210{ 1081{
1211 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_ctl))) { 1082 switch (ieee80211_get_hdrlen(le16_to_cpu(hdr->frame_control))) {
1212 case IEEE80211_1ADDR_LEN: 1083 case IEEE80211_1ADDR_LEN:
1213 return ((struct ieee80211_hdr_1addr *)hdr)->payload; 1084 return ((struct ieee80211_hdr_1addr *)hdr)->payload;
1214 case IEEE80211_2ADDR_LEN: 1085 case IEEE80211_2ADDR_LEN:
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 5cc182f9ecae..62d2dd0d7860 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -41,8 +41,8 @@
41 * I'll experiment with dynamic table growth later. 41 * I'll experiment with dynamic table growth later.
42 */ 42 */
43struct inet_ehash_bucket { 43struct inet_ehash_bucket {
44 struct hlist_head chain; 44 struct hlist_nulls_head chain;
45 struct hlist_head twchain; 45 struct hlist_nulls_head twchain;
46}; 46};
47 47
48/* There are a few simple rules, which allow for local port reuse by 48/* There are a few simple rules, which allow for local port reuse by
@@ -77,13 +77,20 @@ struct inet_ehash_bucket {
77 * ports are created in O(1) time? I thought so. ;-) -DaveM 77 * ports are created in O(1) time? I thought so. ;-) -DaveM
78 */ 78 */
79struct inet_bind_bucket { 79struct inet_bind_bucket {
80#ifdef CONFIG_NET_NS
80 struct net *ib_net; 81 struct net *ib_net;
82#endif
81 unsigned short port; 83 unsigned short port;
82 signed short fastreuse; 84 signed short fastreuse;
83 struct hlist_node node; 85 struct hlist_node node;
84 struct hlist_head owners; 86 struct hlist_head owners;
85}; 87};
86 88
89static inline struct net *ib_net(struct inet_bind_bucket *ib)
90{
91 return read_pnet(&ib->ib_net);
92}
93
87#define inet_bind_bucket_for_each(tb, node, head) \ 94#define inet_bind_bucket_for_each(tb, node, head) \
88 hlist_for_each_entry(tb, node, head, node) 95 hlist_for_each_entry(tb, node, head, node)
89 96
@@ -92,6 +99,11 @@ struct inet_bind_hashbucket {
92 struct hlist_head chain; 99 struct hlist_head chain;
93}; 100};
94 101
102struct inet_listen_hashbucket {
103 spinlock_t lock;
104 struct hlist_head head;
105};
106
95/* This is for listening sockets, thus all sockets which possess wildcards. */ 107/* This is for listening sockets, thus all sockets which possess wildcards. */
96#define INET_LHTABLE_SIZE 32 /* Yes, really, this is all you need. */ 108#define INET_LHTABLE_SIZE 32 /* Yes, really, this is all you need. */
97 109
@@ -116,22 +128,21 @@ struct inet_hashinfo {
116 unsigned int bhash_size; 128 unsigned int bhash_size;
117 /* Note : 4 bytes padding on 64 bit arches */ 129 /* Note : 4 bytes padding on 64 bit arches */
118 130
119 /* All sockets in TCP_LISTEN state will be in here. This is the only 131 struct kmem_cache *bind_bucket_cachep;
120 * table where wildcard'd TCP sockets can exist. Hash function here
121 * is just local port number.
122 */
123 struct hlist_head listening_hash[INET_LHTABLE_SIZE];
124 132
125 /* All the above members are written once at bootup and 133 /* All the above members are written once at bootup and
126 * never written again _or_ are predominantly read-access. 134 * never written again _or_ are predominantly read-access.
127 * 135 *
128 * Now align to a new cache line as all the following members 136 * Now align to a new cache line as all the following members
129 * are often dirty. 137 * might be often dirty.
138 */
139 /* All sockets in TCP_LISTEN state will be in here. This is the only
140 * table where wildcard'd TCP sockets can exist. Hash function here
141 * is just local port number.
130 */ 142 */
131 rwlock_t lhash_lock ____cacheline_aligned; 143 struct inet_listen_hashbucket listening_hash[INET_LHTABLE_SIZE]
132 atomic_t lhash_users; 144 ____cacheline_aligned_in_smp;
133 wait_queue_head_t lhash_wait; 145
134 struct kmem_cache *bind_bucket_cachep;
135}; 146};
136 147
137static inline struct inet_ehash_bucket *inet_ehash_bucket( 148static inline struct inet_ehash_bucket *inet_ehash_bucket(
@@ -229,26 +240,7 @@ extern void __inet_inherit_port(struct sock *sk, struct sock *child);
229 240
230extern void inet_put_port(struct sock *sk); 241extern void inet_put_port(struct sock *sk);
231 242
232extern void inet_listen_wlock(struct inet_hashinfo *hashinfo); 243void inet_hashinfo_init(struct inet_hashinfo *h);
233
234/*
235 * - We may sleep inside this lock.
236 * - If sleeping is not required (or called from BH),
237 * use plain read_(un)lock(&inet_hashinfo.lhash_lock).
238 */
239static inline void inet_listen_lock(struct inet_hashinfo *hashinfo)
240{
241 /* read_lock synchronizes to candidates to writers */
242 read_lock(&hashinfo->lhash_lock);
243 atomic_inc(&hashinfo->lhash_users);
244 read_unlock(&hashinfo->lhash_lock);
245}
246
247static inline void inet_listen_unlock(struct inet_hashinfo *hashinfo)
248{
249 if (atomic_dec_and_test(&hashinfo->lhash_users))
250 wake_up(&hashinfo->lhash_wait);
251}
252 244
253extern void __inet_hash_nolisten(struct sock *sk); 245extern void __inet_hash_nolisten(struct sock *sk);
254extern void inet_hash(struct sock *sk); 246extern void inet_hash(struct sock *sk);
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 80e4977631b8..4b8ece22b8e9 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -110,7 +110,7 @@ struct inet_timewait_sock {
110#define tw_state __tw_common.skc_state 110#define tw_state __tw_common.skc_state
111#define tw_reuse __tw_common.skc_reuse 111#define tw_reuse __tw_common.skc_reuse
112#define tw_bound_dev_if __tw_common.skc_bound_dev_if 112#define tw_bound_dev_if __tw_common.skc_bound_dev_if
113#define tw_node __tw_common.skc_node 113#define tw_node __tw_common.skc_nulls_node
114#define tw_bind_node __tw_common.skc_bind_node 114#define tw_bind_node __tw_common.skc_bind_node
115#define tw_refcnt __tw_common.skc_refcnt 115#define tw_refcnt __tw_common.skc_refcnt
116#define tw_hash __tw_common.skc_hash 116#define tw_hash __tw_common.skc_hash
@@ -137,10 +137,10 @@ struct inet_timewait_sock {
137 struct hlist_node tw_death_node; 137 struct hlist_node tw_death_node;
138}; 138};
139 139
140static inline void inet_twsk_add_node(struct inet_timewait_sock *tw, 140static inline void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw,
141 struct hlist_head *list) 141 struct hlist_nulls_head *list)
142{ 142{
143 hlist_add_head(&tw->tw_node, list); 143 hlist_nulls_add_head_rcu(&tw->tw_node, list);
144} 144}
145 145
146static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw, 146static inline void inet_twsk_add_bind_node(struct inet_timewait_sock *tw,
@@ -175,7 +175,7 @@ static inline int inet_twsk_del_dead_node(struct inet_timewait_sock *tw)
175} 175}
176 176
177#define inet_twsk_for_each(tw, node, head) \ 177#define inet_twsk_for_each(tw, node, head) \
178 hlist_for_each_entry(tw, node, head, tw_node) 178 hlist_nulls_for_each_entry(tw, node, head, tw_node)
179 179
180#define inet_twsk_for_each_inmate(tw, node, jail) \ 180#define inet_twsk_for_each_inmate(tw, node, jail) \
181 hlist_for_each_entry(tw, node, jail, tw_death_node) 181 hlist_for_each_entry(tw, node, jail, tw_death_node)
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index fe9fcf73c85e..ab9b003ab671 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -87,12 +87,12 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len,
87 int len; 87 int len;
88#ifdef CONFIG_IP_VS_IPV6 88#ifdef CONFIG_IP_VS_IPV6
89 if (af == AF_INET6) 89 if (af == AF_INET6)
90 len = snprintf(&buf[*idx], buf_len - *idx, "[" NIP6_FMT "]", 90 len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]",
91 NIP6(addr->in6)) + 1; 91 &addr->in6) + 1;
92 else 92 else
93#endif 93#endif
94 len = snprintf(&buf[*idx], buf_len - *idx, NIPQUAD_FMT, 94 len = snprintf(&buf[*idx], buf_len - *idx, "%pI4",
95 NIPQUAD(addr->ip)) + 1; 95 &addr->ip) + 1;
96 96
97 *idx += len; 97 *idx += len;
98 BUG_ON(*idx > buf_len + 1); 98 BUG_ON(*idx > buf_len + 1);
@@ -503,9 +503,6 @@ struct ip_vs_scheduler {
503 char *name; /* scheduler name */ 503 char *name; /* scheduler name */
504 atomic_t refcnt; /* reference counter */ 504 atomic_t refcnt; /* reference counter */
505 struct module *module; /* THIS_MODULE/NULL */ 505 struct module *module; /* THIS_MODULE/NULL */
506#ifdef CONFIG_IP_VS_IPV6
507 int supports_ipv6; /* scheduler has IPv6 support */
508#endif
509 506
510 /* scheduler initializing service */ 507 /* scheduler initializing service */
511 int (*init_service)(struct ip_vs_service *svc); 508 int (*init_service)(struct ip_vs_service *svc);
@@ -916,7 +913,7 @@ static inline __wsum ip_vs_check_diff4(__be32 old, __be32 new, __wsum oldsum)
916{ 913{
917 __be32 diff[2] = { ~old, new }; 914 __be32 diff[2] = { ~old, new };
918 915
919 return csum_partial((char *) diff, sizeof(diff), oldsum); 916 return csum_partial(diff, sizeof(diff), oldsum);
920} 917}
921 918
922#ifdef CONFIG_IP_VS_IPV6 919#ifdef CONFIG_IP_VS_IPV6
@@ -926,7 +923,7 @@ static inline __wsum ip_vs_check_diff16(const __be32 *old, const __be32 *new,
926 __be32 diff[8] = { ~old[3], ~old[2], ~old[1], ~old[0], 923 __be32 diff[8] = { ~old[3], ~old[2], ~old[1], ~old[0],
927 new[3], new[2], new[1], new[0] }; 924 new[3], new[2], new[1], new[0] };
928 925
929 return csum_partial((char *) diff, sizeof(diff), oldsum); 926 return csum_partial(diff, sizeof(diff), oldsum);
930} 927}
931#endif 928#endif
932 929
@@ -934,7 +931,7 @@ static inline __wsum ip_vs_check_diff2(__be16 old, __be16 new, __wsum oldsum)
934{ 931{
935 __be16 diff[2] = { ~old, new }; 932 __be16 diff[2] = { ~old, new };
936 933
937 return csum_partial((char *) diff, sizeof(diff), oldsum); 934 return csum_partial(diff, sizeof(diff), oldsum);
938} 935}
939 936
940#endif /* __KERNEL__ */ 937#endif /* __KERNEL__ */
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
new file mode 100644
index 000000000000..e1558a187ac0
--- /dev/null
+++ b/include/net/lib80211.h
@@ -0,0 +1,18 @@
1/*
2 * lib80211.h -- common bits for IEEE802.11 wireless drivers
3 *
4 * Copyright (c) 2008, John W. Linville <linville@tuxdriver.com>
5 *
6 */
7
8#ifndef LIB80211_H
9#define LIB80211_H
10
11#include <linux/ieee80211.h>
12
13/* print_ssid() is intended to be used in debug (and possibly error)
14 * messages. It should never be used for passing ssid to user space. */
15const char *print_ssid(char *buf, const char *ssid, u8 ssid_len);
16#define DECLARE_SSID_BUF(var) char var[IEEE80211_MAX_SSID_LEN * 4 + 1] __maybe_unused
17
18#endif /* LIB80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 73d81bc6aa75..1b8ed421feaa 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright 2002-2005, Devicescape Software, Inc. 4 * Copyright 2002-2005, Devicescape Software, Inc.
5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz> 5 * Copyright 2006-2007 Jiri Benc <jbenc@suse.cz>
6 * Copyright 2007 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2007-2008 Johannes Berg <johannes@sipsolutions.net>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -107,7 +107,7 @@ enum ieee80211_max_queues {
107 * The information provided in this structure is required for QoS 107 * The information provided in this structure is required for QoS
108 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. 108 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
109 * 109 *
110 * @aifs: arbitration interface space [0..255] 110 * @aifs: arbitration interframe space [0..255]
111 * @cw_min: minimum contention window [a value of the form 111 * @cw_min: minimum contention window [a value of the form
112 * 2^n-1 in the range 1..32767] 112 * 2^n-1 in the range 1..32767]
113 * @cw_max: maximum contention window [like @cw_min] 113 * @cw_max: maximum contention window [like @cw_min]
@@ -164,6 +164,19 @@ enum ieee80211_bss_change {
164}; 164};
165 165
166/** 166/**
167 * struct ieee80211_bss_ht_conf - BSS's changing HT configuration
168 * @secondary_channel_offset: secondary channel offset, uses
169 * %IEEE80211_HT_PARAM_CHA_SEC_ values
170 * @width_40_ok: indicates that 40 MHz bandwidth may be used for TX
171 * @operation_mode: HT operation mode (like in &struct ieee80211_ht_info)
172 */
173struct ieee80211_bss_ht_conf {
174 u8 secondary_channel_offset;
175 bool width_40_ok;
176 u16 operation_mode;
177};
178
179/**
167 * struct ieee80211_bss_conf - holds the BSS's changing parameters 180 * struct ieee80211_bss_conf - holds the BSS's changing parameters
168 * 181 *
169 * This structure keeps information about a BSS (and an association 182 * This structure keeps information about a BSS (and an association
@@ -172,15 +185,17 @@ enum ieee80211_bss_change {
172 * @assoc: association status 185 * @assoc: association status
173 * @aid: association ID number, valid only when @assoc is true 186 * @aid: association ID number, valid only when @assoc is true
174 * @use_cts_prot: use CTS protection 187 * @use_cts_prot: use CTS protection
175 * @use_short_preamble: use 802.11b short preamble 188 * @use_short_preamble: use 802.11b short preamble;
176 * @use_short_slot: use short slot time (only relevant for ERP) 189 * if the hardware cannot handle this it must set the
190 * IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE hardware flag
191 * @use_short_slot: use short slot time (only relevant for ERP);
192 * if the hardware cannot handle this it must set the
193 * IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE hardware flag
177 * @dtim_period: num of beacons before the next DTIM, for PSM 194 * @dtim_period: num of beacons before the next DTIM, for PSM
178 * @timestamp: beacon timestamp 195 * @timestamp: beacon timestamp
179 * @beacon_int: beacon interval 196 * @beacon_int: beacon interval
180 * @assoc_capability: capabilities taken from assoc resp 197 * @assoc_capability: capabilities taken from assoc resp
181 * @assoc_ht: association in HT mode 198 * @ht: BSS's HT configuration
182 * @ht_conf: ht capabilities
183 * @ht_bss_conf: ht extended capabilities
184 * @basic_rates: bitmap of basic rates, each bit stands for an 199 * @basic_rates: bitmap of basic rates, each bit stands for an
185 * index into the rate table configured by the driver in 200 * index into the rate table configured by the driver in
186 * the current band. 201 * the current band.
@@ -198,10 +213,7 @@ struct ieee80211_bss_conf {
198 u16 assoc_capability; 213 u16 assoc_capability;
199 u64 timestamp; 214 u64 timestamp;
200 u64 basic_rates; 215 u64 basic_rates;
201 /* ht related data */ 216 struct ieee80211_bss_ht_conf ht;
202 bool assoc_ht;
203 struct ieee80211_ht_info *ht_conf;
204 struct ieee80211_ht_bss_info *ht_bss_conf;
205}; 217};
206 218
207/** 219/**
@@ -210,29 +222,24 @@ struct ieee80211_bss_conf {
210 * These flags are used with the @flags member of &ieee80211_tx_info. 222 * These flags are used with the @flags member of &ieee80211_tx_info.
211 * 223 *
212 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. 224 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
213 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame 225 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
214 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., 226 * number to this frame, taking care of not overwriting the fragment
215 * for combined 802.11g / 802.11b networks) 227 * number and increasing the sequence number only when the
228 * IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
229 * assign sequence numbers to QoS-data frames but cannot do so correctly
230 * for non-QoS-data and management frames because beacons need them from
231 * that counter as well and mac80211 cannot guarantee proper sequencing.
232 * If this flag is set, the driver should instruct the hardware to
233 * assign a sequence number to the frame or assign one itself. Cf. IEEE
234 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
235 * beacons and always be clear for frames without a sequence number field.
216 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack 236 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
217 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD
218 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination 237 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
219 * station 238 * station
220 * @IEEE80211_TX_CTL_REQUEUE: TBD
221 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame 239 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
222 * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD
223 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
224 * through set_retry_limit configured long retry value
225 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon 240 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
226 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU 241 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
227 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number 242 * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211.
228 * of streams when this flag is on can be extracted from antenna_sel_tx,
229 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
230 * antennas marked use MIMO_n.
231 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
232 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
233 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
234 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
235 * @IEEE80211_TX_CTL_INJECTED: TBD
236 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted 243 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
237 * because the destination STA was in powersave mode. 244 * because the destination STA was in powersave mode.
238 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged 245 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
@@ -240,62 +247,66 @@ struct ieee80211_bss_conf {
240 * is for the whole aggregation. 247 * is for the whole aggregation.
241 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned, 248 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
242 * so consider using block ack request (BAR). 249 * so consider using block ack request (BAR).
243 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence 250 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: internal to mac80211, can be
244 * number to this frame, taking care of not overwriting the fragment 251 * set by rate control algorithms to indicate probe rate, will
245 * number and increasing the sequence number only when the 252 * be cleared for fragmented frames (except on the last fragment)
246 * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly
247 * assign sequence numbers to QoS-data frames but cannot do so correctly
248 * for non-QoS-data and management frames because beacons need them from
249 * that counter as well and mac80211 cannot guarantee proper sequencing.
250 * If this flag is set, the driver should instruct the hardware to
251 * assign a sequence number to the frame or assign one itself. Cf. IEEE
252 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
253 * beacons always be clear for frames without a sequence number field.
254 */ 253 */
255enum mac80211_tx_control_flags { 254enum mac80211_tx_control_flags {
256 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0), 255 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
257 IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2), 256 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(1),
258 IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3), 257 IEEE80211_TX_CTL_NO_ACK = BIT(2),
259 IEEE80211_TX_CTL_NO_ACK = BIT(4), 258 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(3),
260 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5), 259 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(4),
261 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6), 260 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(5),
262 IEEE80211_TX_CTL_REQUEUE = BIT(7), 261 IEEE80211_TX_CTL_AMPDU = BIT(6),
263 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8), 262 IEEE80211_TX_CTL_INJECTED = BIT(7),
264 IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9), 263 IEEE80211_TX_STAT_TX_FILTERED = BIT(8),
265 IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10), 264 IEEE80211_TX_STAT_ACK = BIT(9),
266 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12), 265 IEEE80211_TX_STAT_AMPDU = BIT(10),
267 IEEE80211_TX_CTL_AMPDU = BIT(13), 266 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
268 IEEE80211_TX_CTL_OFDM_HT = BIT(14), 267 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
269 IEEE80211_TX_CTL_GREEN_FIELD = BIT(15), 268};
270 IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16), 269
271 IEEE80211_TX_CTL_DUP_DATA = BIT(17), 270enum mac80211_rate_control_flags {
272 IEEE80211_TX_CTL_SHORT_GI = BIT(18), 271 IEEE80211_TX_RC_USE_RTS_CTS = BIT(0),
273 IEEE80211_TX_CTL_INJECTED = BIT(19), 272 IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1),
274 IEEE80211_TX_STAT_TX_FILTERED = BIT(20), 273 IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2),
275 IEEE80211_TX_STAT_ACK = BIT(21), 274
276 IEEE80211_TX_STAT_AMPDU = BIT(22), 275 /* rate index is an MCS rate number instead of an index */
277 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23), 276 IEEE80211_TX_RC_MCS = BIT(3),
278 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24), 277 IEEE80211_TX_RC_GREEN_FIELD = BIT(4),
278 IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5),
279 IEEE80211_TX_RC_DUP_DATA = BIT(6),
280 IEEE80211_TX_RC_SHORT_GI = BIT(7),
279}; 281};
280 282
281 283
282#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \ 284/* there are 40 bytes if you don't need the rateset to be kept */
283 (sizeof(((struct sk_buff *)0)->cb) - 8) 285#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE 40
284#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
285 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
286 286
287/* maximum number of alternate rate retry stages */ 287/* if you do need the rateset, then you have less space */
288#define IEEE80211_TX_MAX_ALTRATE 3 288#define IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE 24
289
290/* maximum number of rate stages */
291#define IEEE80211_TX_MAX_RATES 5
289 292
290/** 293/**
291 * struct ieee80211_tx_altrate - alternate rate selection/status 294 * struct ieee80211_tx_rate - rate selection/status
295 *
296 * @idx: rate index to attempt to send with
297 * @flags: rate control flags (&enum mac80211_rate_control_flags)
298 * @count: number of tries in this rate before going to the next rate
292 * 299 *
293 * @rate_idx: rate index to attempt to send with 300 * A value of -1 for @idx indicates an invalid rate and, if used
294 * @limit: number of retries before fallback 301 * in an array of retry rates, that no more rates should be tried.
302 *
303 * When used for transmit status reporting, the driver should
304 * always report the rate along with the flags it used.
295 */ 305 */
296struct ieee80211_tx_altrate { 306struct ieee80211_tx_rate {
297 s8 rate_idx; 307 s8 idx;
298 u8 limit; 308 u8 count;
309 u8 flags;
299}; 310};
300 311
301/** 312/**
@@ -310,15 +321,12 @@ struct ieee80211_tx_altrate {
310 * it may be NULL. 321 * it may be NULL.
311 * 322 *
312 * @flags: transmit info flags, defined above 323 * @flags: transmit info flags, defined above
313 * @band: TBD 324 * @band: the band to transmit on (use for checking for races)
314 * @tx_rate_idx: TBD 325 * @antenna_sel_tx: antenna to use, 0 for automatic diversity
315 * @antenna_sel_tx: TBD
316 * @control: union for control data 326 * @control: union for control data
317 * @status: union for status data 327 * @status: union for status data
318 * @driver_data: array of driver_data pointers 328 * @driver_data: array of driver_data pointers
319 * @retry_count: number of retries 329 * @retry_count: number of retries
320 * @excessive_retries: set to 1 if the frame was retried many times
321 * but not acknowledged
322 * @ampdu_ack_len: number of aggregated frames. 330 * @ampdu_ack_len: number of aggregated frames.
323 * relevant only if IEEE80211_TX_STATUS_AMPDU was set. 331 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
324 * @ampdu_ack_map: block ack bit map for the aggregation. 332 * @ampdu_ack_map: block ack bit map for the aggregation.
@@ -329,31 +337,43 @@ struct ieee80211_tx_info {
329 /* common information */ 337 /* common information */
330 u32 flags; 338 u32 flags;
331 u8 band; 339 u8 band;
332 s8 tx_rate_idx; 340
333 u8 antenna_sel_tx; 341 u8 antenna_sel_tx;
334 342
335 /* 1 byte hole */ 343 /* 2 byte hole */
336 344
337 union { 345 union {
338 struct { 346 struct {
347 union {
348 /* rate control */
349 struct {
350 struct ieee80211_tx_rate rates[
351 IEEE80211_TX_MAX_RATES];
352 s8 rts_cts_rate_idx;
353 };
354 /* only needed before rate control */
355 unsigned long jiffies;
356 };
339 /* NB: vif can be NULL for injected frames */ 357 /* NB: vif can be NULL for injected frames */
340 struct ieee80211_vif *vif; 358 struct ieee80211_vif *vif;
341 struct ieee80211_key_conf *hw_key; 359 struct ieee80211_key_conf *hw_key;
342 struct ieee80211_sta *sta; 360 struct ieee80211_sta *sta;
343 unsigned long jiffies;
344 s8 rts_cts_rate_idx;
345 u8 retry_limit;
346 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE];
347 } control; 361 } control;
348 struct { 362 struct {
363 struct ieee80211_tx_rate rates[IEEE80211_TX_MAX_RATES];
364 u8 ampdu_ack_len;
349 u64 ampdu_ack_map; 365 u64 ampdu_ack_map;
350 int ack_signal; 366 int ack_signal;
351 struct ieee80211_tx_altrate retries[IEEE80211_TX_MAX_ALTRATE + 1]; 367 /* 8 bytes free */
352 u8 retry_count;
353 bool excessive_retries;
354 u8 ampdu_ack_len;
355 } status; 368 } status;
356 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS]; 369 struct {
370 struct ieee80211_tx_rate driver_rates[
371 IEEE80211_TX_MAX_RATES];
372 void *rate_driver_data[
373 IEEE80211_TX_INFO_RATE_DRIVER_DATA_SIZE / sizeof(void *)];
374 };
375 void *driver_data[
376 IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *)];
357 }; 377 };
358}; 378};
359 379
@@ -362,6 +382,41 @@ static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
362 return (struct ieee80211_tx_info *)skb->cb; 382 return (struct ieee80211_tx_info *)skb->cb;
363} 383}
364 384
385/**
386 * ieee80211_tx_info_clear_status - clear TX status
387 *
388 * @info: The &struct ieee80211_tx_info to be cleared.
389 *
390 * When the driver passes an skb back to mac80211, it must report
391 * a number of things in TX status. This function clears everything
392 * in the TX status but the rate control information (it does clear
393 * the count since you need to fill that in anyway).
394 *
395 * NOTE: You can only use this function if you do NOT use
396 * info->driver_data! Use info->rate_driver_data
397 * instead if you need only the less space that allows.
398 */
399static inline void
400ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info)
401{
402 int i;
403
404 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) !=
405 offsetof(struct ieee80211_tx_info, control.rates));
406 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) !=
407 offsetof(struct ieee80211_tx_info, driver_rates));
408 BUILD_BUG_ON(offsetof(struct ieee80211_tx_info, status.rates) != 8);
409 /* clear the rate counts */
410 for (i = 0; i < IEEE80211_TX_MAX_RATES; i++)
411 info->status.rates[i].count = 0;
412
413 BUILD_BUG_ON(
414 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len) != 23);
415 memset(&info->status.ampdu_ack_len, 0,
416 sizeof(struct ieee80211_tx_info) -
417 offsetof(struct ieee80211_tx_info, status.ampdu_ack_len));
418}
419
365 420
366/** 421/**
367 * enum mac80211_rx_flags - receive flags 422 * enum mac80211_rx_flags - receive flags
@@ -434,21 +489,48 @@ struct ieee80211_rx_status {
434 * 489 *
435 * Flags to define PHY configuration options 490 * Flags to define PHY configuration options
436 * 491 *
437 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
438 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 492 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
439 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
440 * @IEEE80211_CONF_PS: Enable 802.11 power save mode 493 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
441 */ 494 */
442enum ieee80211_conf_flags { 495enum ieee80211_conf_flags {
443 /* 496 IEEE80211_CONF_RADIOTAP = (1<<0),
444 * TODO: IEEE80211_CONF_SHORT_SLOT_TIME will be removed once drivers 497 IEEE80211_CONF_PS = (1<<1),
445 * have been converted to use bss_info_changed() for slot time 498};
446 * configuration 499
447 */ 500/* XXX: remove all this once drivers stop trying to use it */
448 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 501static inline int __deprecated __IEEE80211_CONF_SHORT_SLOT_TIME(void)
449 IEEE80211_CONF_RADIOTAP = (1<<1), 502{
450 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 503 return 0;
451 IEEE80211_CONF_PS = (1<<3), 504}
505#define IEEE80211_CONF_SHORT_SLOT_TIME (__IEEE80211_CONF_SHORT_SLOT_TIME())
506
507struct ieee80211_ht_conf {
508 bool enabled;
509};
510
511/**
512 * enum ieee80211_conf_changed - denotes which configuration changed
513 *
514 * @IEEE80211_CONF_CHANGE_RADIO_ENABLED: the value of radio_enabled changed
515 * @IEEE80211_CONF_CHANGE_BEACON_INTERVAL: the beacon interval changed
516 * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed
517 * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed
518 * @IEEE80211_CONF_CHANGE_PS: the PS flag changed
519 * @IEEE80211_CONF_CHANGE_POWER: the TX power changed
520 * @IEEE80211_CONF_CHANGE_CHANNEL: the channel changed
521 * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed
522 * @IEEE80211_CONF_CHANGE_HT: HT configuration changed
523 */
524enum ieee80211_conf_changed {
525 IEEE80211_CONF_CHANGE_RADIO_ENABLED = BIT(0),
526 IEEE80211_CONF_CHANGE_BEACON_INTERVAL = BIT(1),
527 IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2),
528 IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3),
529 IEEE80211_CONF_CHANGE_PS = BIT(4),
530 IEEE80211_CONF_CHANGE_POWER = BIT(5),
531 IEEE80211_CONF_CHANGE_CHANNEL = BIT(6),
532 IEEE80211_CONF_CHANGE_RETRY_LIMITS = BIT(7),
533 IEEE80211_CONF_CHANGE_HT = BIT(8),
452}; 534};
453 535
454/** 536/**
@@ -457,34 +539,31 @@ enum ieee80211_conf_flags {
457 * This struct indicates how the driver shall configure the hardware. 539 * This struct indicates how the driver shall configure the hardware.
458 * 540 *
459 * @radio_enabled: when zero, driver is required to switch off the radio. 541 * @radio_enabled: when zero, driver is required to switch off the radio.
460 * TODO make a flag
461 * @beacon_int: beacon interval (TODO make interface config) 542 * @beacon_int: beacon interval (TODO make interface config)
462 * @listen_interval: listen interval in units of beacon interval 543 * @listen_interval: listen interval in units of beacon interval
463 * @flags: configuration flags defined above 544 * @flags: configuration flags defined above
464 * @power_level: requested transmit power (in dBm) 545 * @power_level: requested transmit power (in dBm)
465 * @max_antenna_gain: maximum antenna gain (in dBi)
466 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
467 * 1/2: antenna 0/1
468 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
469 * @ht_conf: describes current self configuration of 802.11n HT capabilies
470 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
471 * @channel: the channel to tune to 546 * @channel: the channel to tune to
547 * @ht: the HT configuration for the device
548 * @long_frame_max_tx_count: Maximum number of transmissions for a "long" frame
549 * (a frame not RTS protected), called "dot11LongRetryLimit" in 802.11,
550 * but actually means the number of transmissions not the number of retries
551 * @short_frame_max_tx_count: Maximum number of transmissions for a "short"
552 * frame, called "dot11ShortRetryLimit" in 802.11, but actually means the
553 * number of transmissions not the number of retries
472 */ 554 */
473struct ieee80211_conf { 555struct ieee80211_conf {
474 int radio_enabled;
475
476 int beacon_int; 556 int beacon_int;
477 u16 listen_interval;
478 u32 flags; 557 u32 flags;
479 int power_level; 558 int power_level;
480 int max_antenna_gain;
481 u8 antenna_sel_tx;
482 u8 antenna_sel_rx;
483 559
484 struct ieee80211_channel *channel; 560 u16 listen_interval;
561 bool radio_enabled;
485 562
486 struct ieee80211_ht_info ht_conf; 563 u8 long_frame_max_tx_count, short_frame_max_tx_count;
487 struct ieee80211_ht_bss_info ht_bss_conf; 564
565 struct ieee80211_channel *channel;
566 struct ieee80211_ht_conf ht;
488}; 567};
489 568
490/** 569/**
@@ -494,11 +573,14 @@ struct ieee80211_conf {
494 * use during the life of a virtual interface. 573 * use during the life of a virtual interface.
495 * 574 *
496 * @type: type of this virtual interface 575 * @type: type of this virtual interface
576 * @bss_conf: BSS configuration for this interface, either our own
577 * or the BSS we're associated to
497 * @drv_priv: data area for driver use, will always be aligned to 578 * @drv_priv: data area for driver use, will always be aligned to
498 * sizeof(void *). 579 * sizeof(void *).
499 */ 580 */
500struct ieee80211_vif { 581struct ieee80211_vif {
501 enum nl80211_iftype type; 582 enum nl80211_iftype type;
583 struct ieee80211_bss_conf bss_conf;
502 /* must be last */ 584 /* must be last */
503 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 585 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
504}; 586};
@@ -542,14 +624,12 @@ struct ieee80211_if_init_conf {
542 * enum ieee80211_if_conf_change - interface config change flags 624 * enum ieee80211_if_conf_change - interface config change flags
543 * 625 *
544 * @IEEE80211_IFCC_BSSID: The BSSID changed. 626 * @IEEE80211_IFCC_BSSID: The BSSID changed.
545 * @IEEE80211_IFCC_SSID: The SSID changed.
546 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed 627 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed
547 * (currently AP and MESH only), use ieee80211_beacon_get(). 628 * (currently AP and MESH only), use ieee80211_beacon_get().
548 */ 629 */
549enum ieee80211_if_conf_change { 630enum ieee80211_if_conf_change {
550 IEEE80211_IFCC_BSSID = BIT(0), 631 IEEE80211_IFCC_BSSID = BIT(0),
551 IEEE80211_IFCC_SSID = BIT(1), 632 IEEE80211_IFCC_BEACON = BIT(1),
552 IEEE80211_IFCC_BEACON = BIT(2),
553}; 633};
554 634
555/** 635/**
@@ -557,11 +637,6 @@ enum ieee80211_if_conf_change {
557 * 637 *
558 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change. 638 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change.
559 * @bssid: BSSID of the network we are associated to/creating. 639 * @bssid: BSSID of the network we are associated to/creating.
560 * @ssid: used (together with @ssid_len) by drivers for hardware that
561 * generate beacons independently. The pointer is valid only during the
562 * config_interface() call, so copy the value somewhere if you need
563 * it.
564 * @ssid_len: length of the @ssid field.
565 * 640 *
566 * This structure is passed to the config_interface() callback of 641 * This structure is passed to the config_interface() callback of
567 * &struct ieee80211_hw. 642 * &struct ieee80211_hw.
@@ -569,8 +644,6 @@ enum ieee80211_if_conf_change {
569struct ieee80211_if_conf { 644struct ieee80211_if_conf {
570 u32 changed; 645 u32 changed;
571 u8 *bssid; 646 u8 *bssid;
572 u8 *ssid;
573 size_t ssid_len;
574}; 647};
575 648
576/** 649/**
@@ -677,7 +750,7 @@ enum set_key_cmd {
677 * @addr: MAC address 750 * @addr: MAC address
678 * @aid: AID we assigned to the station if we're an AP 751 * @aid: AID we assigned to the station if we're an AP
679 * @supp_rates: Bitmap of supported rates (per band) 752 * @supp_rates: Bitmap of supported rates (per band)
680 * @ht_info: HT capabilities of this STA 753 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
681 * @drv_priv: data area for driver use, will always be aligned to 754 * @drv_priv: data area for driver use, will always be aligned to
682 * sizeof(void *), size is determined in hw information. 755 * sizeof(void *), size is determined in hw information.
683 */ 756 */
@@ -685,7 +758,7 @@ struct ieee80211_sta {
685 u64 supp_rates[IEEE80211_NUM_BANDS]; 758 u64 supp_rates[IEEE80211_NUM_BANDS];
686 u8 addr[ETH_ALEN]; 759 u8 addr[ETH_ALEN];
687 u16 aid; 760 u16 aid;
688 struct ieee80211_ht_info ht_info; 761 struct ieee80211_sta_ht_cap ht_cap;
689 762
690 /* must be last */ 763 /* must be last */
691 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 764 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -769,6 +842,9 @@ enum ieee80211_tkip_key_type {
769 * @IEEE80211_HW_SPECTRUM_MGMT: 842 * @IEEE80211_HW_SPECTRUM_MGMT:
770 * Hardware supports spectrum management defined in 802.11h 843 * Hardware supports spectrum management defined in 802.11h
771 * Measurement, Channel Switch, Quieting, TPC 844 * Measurement, Channel Switch, Quieting, TPC
845 *
846 * @IEEE80211_HW_AMPDU_AGGREGATION:
847 * Hardware supports 11n A-MPDU aggregation.
772 */ 848 */
773enum ieee80211_hw_flags { 849enum ieee80211_hw_flags {
774 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 850 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
@@ -780,6 +856,7 @@ enum ieee80211_hw_flags {
780 IEEE80211_HW_SIGNAL_DBM = 1<<7, 856 IEEE80211_HW_SIGNAL_DBM = 1<<7,
781 IEEE80211_HW_NOISE_DBM = 1<<8, 857 IEEE80211_HW_NOISE_DBM = 1<<8,
782 IEEE80211_HW_SPECTRUM_MGMT = 1<<9, 858 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
859 IEEE80211_HW_AMPDU_AGGREGATION = 1<<10,
783}; 860};
784 861
785/** 862/**
@@ -838,8 +915,8 @@ enum ieee80211_hw_flags {
838 * @sta_data_size: size (in bytes) of the drv_priv data area 915 * @sta_data_size: size (in bytes) of the drv_priv data area
839 * within &struct ieee80211_sta. 916 * within &struct ieee80211_sta.
840 * 917 *
841 * @max_altrates: maximum number of alternate rate retry stages 918 * @max_rates: maximum number of alternate rate retry stages
842 * @max_altrate_tries: maximum number of tries for each stage 919 * @max_rate_tries: maximum number of tries for each stage
843 */ 920 */
844struct ieee80211_hw { 921struct ieee80211_hw {
845 struct ieee80211_conf conf; 922 struct ieee80211_conf conf;
@@ -856,12 +933,10 @@ struct ieee80211_hw {
856 u16 ampdu_queues; 933 u16 ampdu_queues;
857 u16 max_listen_interval; 934 u16 max_listen_interval;
858 s8 max_signal; 935 s8 max_signal;
859 u8 max_altrates; 936 u8 max_rates;
860 u8 max_altrate_tries; 937 u8 max_rate_tries;
861}; 938};
862 939
863struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy);
864
865/** 940/**
866 * SET_IEEE80211_DEV - set device for 802.11 hardware 941 * SET_IEEE80211_DEV - set device for 802.11 hardware
867 * 942 *
@@ -874,7 +949,7 @@ static inline void SET_IEEE80211_DEV(struct ieee80211_hw *hw, struct device *dev
874} 949}
875 950
876/** 951/**
877 * SET_IEEE80211_PERM_ADDR - set the permanenet MAC address for 802.11 hardware 952 * SET_IEEE80211_PERM_ADDR - set the permanent MAC address for 802.11 hardware
878 * 953 *
879 * @hw: the &struct ieee80211_hw to set the MAC address for 954 * @hw: the &struct ieee80211_hw to set the MAC address for
880 * @addr: the address to set 955 * @addr: the address to set
@@ -898,9 +973,9 @@ static inline struct ieee80211_rate *
898ieee80211_get_tx_rate(const struct ieee80211_hw *hw, 973ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
899 const struct ieee80211_tx_info *c) 974 const struct ieee80211_tx_info *c)
900{ 975{
901 if (WARN_ON(c->tx_rate_idx < 0)) 976 if (WARN_ON(c->control.rates[0].idx < 0))
902 return NULL; 977 return NULL;
903 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx]; 978 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[0].idx];
904} 979}
905 980
906static inline struct ieee80211_rate * 981static inline struct ieee80211_rate *
@@ -916,9 +991,9 @@ static inline struct ieee80211_rate *
916ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw, 991ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
917 const struct ieee80211_tx_info *c, int idx) 992 const struct ieee80211_tx_info *c, int idx)
918{ 993{
919 if (c->control.retries[idx].rate_idx < 0) 994 if (c->control.rates[idx + 1].idx < 0)
920 return NULL; 995 return NULL;
921 return &hw->wiphy->bands[c->band]->bitrates[c->control.retries[idx].rate_idx]; 996 return &hw->wiphy->bands[c->band]->bitrates[c->control.rates[idx + 1].idx];
922} 997}
923 998
924/** 999/**
@@ -967,7 +1042,7 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
967 * This happens everytime the iv16 wraps around (every 65536 packets). The 1042 * This happens everytime the iv16 wraps around (every 65536 packets). The
968 * set_key() call will happen only once for each key (unless the AP did 1043 * set_key() call will happen only once for each key (unless the AP did
969 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is 1044 * rekeying), it will not include a valid phase 1 key. The valid phase 1 key is
970 * provided by udpate_tkip_key only. The trigger that makes mac80211 call this 1045 * provided by update_tkip_key only. The trigger that makes mac80211 call this
971 * handler is software decryption with wrap around of iv16. 1046 * handler is software decryption with wrap around of iv16.
972 */ 1047 */
973 1048
@@ -1060,12 +1135,14 @@ enum ieee80211_filter_flags {
1060 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 1135 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
1061 * @IEEE80211_AMPDU_TX_START: start Tx aggregation 1136 * @IEEE80211_AMPDU_TX_START: start Tx aggregation
1062 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation 1137 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
1138 * @IEEE80211_AMPDU_TX_RESUME: resume TX aggregation
1063 */ 1139 */
1064enum ieee80211_ampdu_mlme_action { 1140enum ieee80211_ampdu_mlme_action {
1065 IEEE80211_AMPDU_RX_START, 1141 IEEE80211_AMPDU_RX_START,
1066 IEEE80211_AMPDU_RX_STOP, 1142 IEEE80211_AMPDU_RX_STOP,
1067 IEEE80211_AMPDU_TX_START, 1143 IEEE80211_AMPDU_TX_START,
1068 IEEE80211_AMPDU_TX_STOP, 1144 IEEE80211_AMPDU_TX_STOP,
1145 IEEE80211_AMPDU_TX_RESUME,
1069}; 1146};
1070 1147
1071/** 1148/**
@@ -1101,7 +1178,7 @@ enum ieee80211_ampdu_mlme_action {
1101 * Must be implemented. 1178 * Must be implemented.
1102 * 1179 *
1103 * @add_interface: Called when a netdevice attached to the hardware is 1180 * @add_interface: Called when a netdevice attached to the hardware is
1104 * enabled. Because it is not called for monitor mode devices, @open 1181 * enabled. Because it is not called for monitor mode devices, @start
1105 * and @stop must be implemented. 1182 * and @stop must be implemented.
1106 * The driver should perform any initialization it needs before 1183 * The driver should perform any initialization it needs before
1107 * the device can be enabled. The initial configuration for the 1184 * the device can be enabled. The initial configuration for the
@@ -1167,10 +1244,8 @@ enum ieee80211_ampdu_mlme_action {
1167 * the device does fragmentation by itself; if this method is assigned then 1244 * the device does fragmentation by itself; if this method is assigned then
1168 * the stack will not do fragmentation. 1245 * the stack will not do fragmentation.
1169 * 1246 *
1170 * @set_retry_limit: Configuration of retry limits (if device needs it)
1171 *
1172 * @sta_notify: Notifies low level driver about addition or removal 1247 * @sta_notify: Notifies low level driver about addition or removal
1173 * of assocaited station or AP. 1248 * of associated station or AP.
1174 * 1249 *
1175 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1250 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1176 * bursting) for a hardware TX queue. 1251 * bursting) for a hardware TX queue.
@@ -1211,7 +1286,7 @@ struct ieee80211_ops {
1211 struct ieee80211_if_init_conf *conf); 1286 struct ieee80211_if_init_conf *conf);
1212 void (*remove_interface)(struct ieee80211_hw *hw, 1287 void (*remove_interface)(struct ieee80211_hw *hw,
1213 struct ieee80211_if_init_conf *conf); 1288 struct ieee80211_if_init_conf *conf);
1214 int (*config)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1289 int (*config)(struct ieee80211_hw *hw, u32 changed);
1215 int (*config_interface)(struct ieee80211_hw *hw, 1290 int (*config_interface)(struct ieee80211_hw *hw,
1216 struct ieee80211_vif *vif, 1291 struct ieee80211_vif *vif,
1217 struct ieee80211_if_conf *conf); 1292 struct ieee80211_if_conf *conf);
@@ -1238,8 +1313,6 @@ struct ieee80211_ops {
1238 u32 *iv32, u16 *iv16); 1313 u32 *iv32, u16 *iv16);
1239 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value); 1314 int (*set_rts_threshold)(struct ieee80211_hw *hw, u32 value);
1240 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value); 1315 int (*set_frag_threshold)(struct ieee80211_hw *hw, u32 value);
1241 int (*set_retry_limit)(struct ieee80211_hw *hw,
1242 u32 short_retry, u32 long_retr);
1243 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1316 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1244 enum sta_notify_cmd, struct ieee80211_sta *sta); 1317 enum sta_notify_cmd, struct ieee80211_sta *sta);
1245 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 1318 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
@@ -1472,7 +1545,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1472 * the next beacon frame from the 802.11 code. The low-level is responsible 1545 * the next beacon frame from the 802.11 code. The low-level is responsible
1473 * for calling this function before beacon data is needed (e.g., based on 1546 * for calling this function before beacon data is needed (e.g., based on
1474 * hardware interrupt). Returned skb is used only once and low-level driver 1547 * hardware interrupt). Returned skb is used only once and low-level driver
1475 * is responsible of freeing it. 1548 * is responsible for freeing it.
1476 */ 1549 */
1477struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1550struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1478 struct ieee80211_vif *vif); 1551 struct ieee80211_vif *vif);
@@ -1803,24 +1876,38 @@ struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw,
1803 1876
1804 1877
1805/* Rate control API */ 1878/* Rate control API */
1879
1806/** 1880/**
1807 * struct rate_selection - rate information for/from rate control algorithms 1881 * struct ieee80211_tx_rate_control - rate control information for/from RC algo
1808 * 1882 *
1809 * @rate_idx: selected transmission rate index 1883 * @hw: The hardware the algorithm is invoked for.
1810 * @nonerp_idx: Non-ERP rate to use instead if ERP cannot be used 1884 * @sband: The band this frame is being transmitted on.
1811 * @probe_idx: rate for probing (or -1) 1885 * @bss_conf: the current BSS configuration
1812 * @max_rate_idx: maximum rate index that can be used, this is 1886 * @reported_rate: The rate control algorithm can fill this in to indicate
1813 * input to the algorithm and will be enforced 1887 * which rate should be reported to userspace as the current rate and
1814 */ 1888 * used for rate calculations in the mesh network.
1815struct rate_selection { 1889 * @rts: whether RTS will be used for this frame because it is longer than the
1816 s8 rate_idx, nonerp_idx, probe_idx, max_rate_idx; 1890 * RTS threshold
1891 * @short_preamble: whether mac80211 will request short-preamble transmission
1892 * if the selected rate supports it
1893 * @max_rate_idx: user-requested maximum rate (not MCS for now)
1894 * @skb: the skb that will be transmitted, the control information in it needs
1895 * to be filled in
1896 */
1897struct ieee80211_tx_rate_control {
1898 struct ieee80211_hw *hw;
1899 struct ieee80211_supported_band *sband;
1900 struct ieee80211_bss_conf *bss_conf;
1901 struct sk_buff *skb;
1902 struct ieee80211_tx_rate reported_rate;
1903 bool rts, short_preamble;
1904 u8 max_rate_idx;
1817}; 1905};
1818 1906
1819struct rate_control_ops { 1907struct rate_control_ops {
1820 struct module *module; 1908 struct module *module;
1821 const char *name; 1909 const char *name;
1822 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir); 1910 void *(*alloc)(struct ieee80211_hw *hw, struct dentry *debugfsdir);
1823 void (*clear)(void *priv);
1824 void (*free)(void *priv); 1911 void (*free)(void *priv);
1825 1912
1826 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp); 1913 void *(*alloc_sta)(void *priv, struct ieee80211_sta *sta, gfp_t gfp);
@@ -1832,10 +1919,8 @@ struct rate_control_ops {
1832 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband, 1919 void (*tx_status)(void *priv, struct ieee80211_supported_band *sband,
1833 struct ieee80211_sta *sta, void *priv_sta, 1920 struct ieee80211_sta *sta, void *priv_sta,
1834 struct sk_buff *skb); 1921 struct sk_buff *skb);
1835 void (*get_rate)(void *priv, struct ieee80211_supported_band *sband, 1922 void (*get_rate)(void *priv, struct ieee80211_sta *sta, void *priv_sta,
1836 struct ieee80211_sta *sta, void *priv_sta, 1923 struct ieee80211_tx_rate_control *txrc);
1837 struct sk_buff *skb,
1838 struct rate_selection *sel);
1839 1924
1840 void (*add_sta_debugfs)(void *priv, void *priv_sta, 1925 void (*add_sta_debugfs)(void *priv, void *priv_sta,
1841 struct dentry *dir); 1926 struct dentry *dir);
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 11dd0137c6a5..ce532f2222ce 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -108,6 +108,20 @@ extern void ndisc_send_redirect(struct sk_buff *skb,
108 108
109extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir); 109extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *dev, int dir);
110 110
111extern struct sk_buff *ndisc_build_skb(struct net_device *dev,
112 const struct in6_addr *daddr,
113 const struct in6_addr *saddr,
114 struct icmp6hdr *icmp6h,
115 const struct in6_addr *target,
116 int llinfo);
117
118extern void ndisc_send_skb(struct sk_buff *skb,
119 struct net_device *dev,
120 struct neighbour *neigh,
121 const struct in6_addr *daddr,
122 const struct in6_addr *saddr,
123 struct icmp6hdr *icmp6h);
124
111 125
112 126
113/* 127/*
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index aa4b708654a4..d8d790e56d3d 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -180,9 +180,6 @@ struct neigh_table
180 __u32 hash_rnd; 180 __u32 hash_rnd;
181 unsigned int hash_chain_gc; 181 unsigned int hash_chain_gc;
182 struct pneigh_entry **phash_buckets; 182 struct pneigh_entry **phash_buckets;
183#ifdef CONFIG_PROC_FS
184 struct proc_dir_entry *pde;
185#endif
186}; 183};
187 184
188/* flags for neigh_update() */ 185/* flags for neigh_update() */
@@ -223,11 +220,7 @@ extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *p
223static inline 220static inline
224struct net *neigh_parms_net(const struct neigh_parms *parms) 221struct net *neigh_parms_net(const struct neigh_parms *parms)
225{ 222{
226#ifdef CONFIG_NET_NS 223 return read_pnet(&parms->net);
227 return parms->net;
228#else
229 return &init_net;
230#endif
231} 224}
232 225
233extern unsigned long neigh_rand_reach_time(unsigned long base); 226extern unsigned long neigh_rand_reach_time(unsigned long base);
@@ -244,11 +237,7 @@ extern int pneigh_delete(struct neigh_table *tbl, struct net *net, const void
244static inline 237static inline
245struct net *pneigh_net(const struct pneigh_entry *pneigh) 238struct net *pneigh_net(const struct pneigh_entry *pneigh)
246{ 239{
247#ifdef CONFIG_NET_NS 240 return read_pnet(&pneigh->net);
248 return pneigh->net;
249#else
250 return &init_net;
251#endif
252} 241}
253 242
254extern void neigh_app_ns(struct neighbour *n); 243extern void neigh_app_ns(struct neighbour *n);
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 700c53a3c6fa..319557789a40 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -192,6 +192,24 @@ static inline void release_net(struct net *net)
192} 192}
193#endif 193#endif
194 194
195#ifdef CONFIG_NET_NS
196
197static inline void write_pnet(struct net **pnet, struct net *net)
198{
199 *pnet = net;
200}
201
202static inline struct net *read_pnet(struct net * const *pnet)
203{
204 return *pnet;
205}
206
207#else
208
209#define write_pnet(pnet, net) do { (void)(net);} while (0)
210#define read_pnet(pnet) (&init_net)
211
212#endif
195 213
196#define for_each_net(VAR) \ 214#define for_each_net(VAR) \
197 list_for_each_entry(VAR, &net_namespace_list, list) 215 list_for_each_entry(VAR, &net_namespace_list, list)
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h
index a6874ba22d54..f2f6aa73dc10 100644
--- a/include/net/netfilter/nf_conntrack_tuple.h
+++ b/include/net/netfilter/nf_conntrack_tuple.h
@@ -112,20 +112,20 @@ struct nf_conntrack_tuple_mask
112static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t) 112static inline void nf_ct_dump_tuple_ip(const struct nf_conntrack_tuple *t)
113{ 113{
114#ifdef DEBUG 114#ifdef DEBUG
115 printk("tuple %p: %u " NIPQUAD_FMT ":%hu -> " NIPQUAD_FMT ":%hu\n", 115 printk("tuple %p: %u %pI4:%hu -> %pI4:%hu\n",
116 t, t->dst.protonum, 116 t, t->dst.protonum,
117 NIPQUAD(t->src.u3.ip), ntohs(t->src.u.all), 117 &t->src.u3.ip, ntohs(t->src.u.all),
118 NIPQUAD(t->dst.u3.ip), ntohs(t->dst.u.all)); 118 &t->dst.u3.ip, ntohs(t->dst.u.all));
119#endif 119#endif
120} 120}
121 121
122static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t) 122static inline void nf_ct_dump_tuple_ipv6(const struct nf_conntrack_tuple *t)
123{ 123{
124#ifdef DEBUG 124#ifdef DEBUG
125 printk("tuple %p: %u " NIP6_FMT " %hu -> " NIP6_FMT " %hu\n", 125 printk("tuple %p: %u %pI6 %hu -> %pI6 %hu\n",
126 t, t->dst.protonum, 126 t, t->dst.protonum,
127 NIP6(*(struct in6_addr *)t->src.u3.all), ntohs(t->src.u.all), 127 t->src.u3.all, ntohs(t->src.u.all),
128 NIP6(*(struct in6_addr *)t->dst.u3.all), ntohs(t->dst.u.all)); 128 t->dst.u3.all, ntohs(t->dst.u.all));
129#endif 129#endif
130} 130}
131 131
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 3643bbb8e585..46b7764f1774 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -233,7 +233,7 @@ extern int nla_parse(struct nlattr *tb[], int maxtype,
233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 233extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype);
234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 234extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
235 size_t dstsize); 235 size_t dstsize);
236extern int nla_memcpy(void *dest, struct nlattr *src, int count); 236extern int nla_memcpy(void *dest, const struct nlattr *src, int count);
237extern int nla_memcmp(const struct nlattr *nla, const void *data, 237extern int nla_memcmp(const struct nlattr *nla, const void *data,
238 size_t size); 238 size_t size);
239extern int nla_strcmp(const struct nlattr *nla, const char *str); 239extern int nla_strcmp(const struct nlattr *nla, const char *str);
@@ -741,7 +741,7 @@ static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype)
741 * See nla_parse() 741 * See nla_parse()
742 */ 742 */
743static inline int nla_parse_nested(struct nlattr *tb[], int maxtype, 743static inline int nla_parse_nested(struct nlattr *tb[], int maxtype,
744 struct nlattr *nla, 744 const struct nlattr *nla,
745 const struct nla_policy *policy) 745 const struct nla_policy *policy)
746{ 746{
747 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy); 747 return nla_parse(tb, maxtype, nla_data(nla), nla_len(nla), policy);
@@ -875,7 +875,7 @@ static inline int nla_put_msecs(struct sk_buff *skb, int attrtype,
875 * nla_get_u32 - return payload of u32 attribute 875 * nla_get_u32 - return payload of u32 attribute
876 * @nla: u32 netlink attribute 876 * @nla: u32 netlink attribute
877 */ 877 */
878static inline u32 nla_get_u32(struct nlattr *nla) 878static inline u32 nla_get_u32(const struct nlattr *nla)
879{ 879{
880 return *(u32 *) nla_data(nla); 880 return *(u32 *) nla_data(nla);
881} 881}
@@ -884,7 +884,7 @@ static inline u32 nla_get_u32(struct nlattr *nla)
884 * nla_get_be32 - return payload of __be32 attribute 884 * nla_get_be32 - return payload of __be32 attribute
885 * @nla: __be32 netlink attribute 885 * @nla: __be32 netlink attribute
886 */ 886 */
887static inline __be32 nla_get_be32(struct nlattr *nla) 887static inline __be32 nla_get_be32(const struct nlattr *nla)
888{ 888{
889 return *(__be32 *) nla_data(nla); 889 return *(__be32 *) nla_data(nla);
890} 890}
@@ -893,7 +893,7 @@ static inline __be32 nla_get_be32(struct nlattr *nla)
893 * nla_get_u16 - return payload of u16 attribute 893 * nla_get_u16 - return payload of u16 attribute
894 * @nla: u16 netlink attribute 894 * @nla: u16 netlink attribute
895 */ 895 */
896static inline u16 nla_get_u16(struct nlattr *nla) 896static inline u16 nla_get_u16(const struct nlattr *nla)
897{ 897{
898 return *(u16 *) nla_data(nla); 898 return *(u16 *) nla_data(nla);
899} 899}
@@ -902,7 +902,7 @@ static inline u16 nla_get_u16(struct nlattr *nla)
902 * nla_get_be16 - return payload of __be16 attribute 902 * nla_get_be16 - return payload of __be16 attribute
903 * @nla: __be16 netlink attribute 903 * @nla: __be16 netlink attribute
904 */ 904 */
905static inline __be16 nla_get_be16(struct nlattr *nla) 905static inline __be16 nla_get_be16(const struct nlattr *nla)
906{ 906{
907 return *(__be16 *) nla_data(nla); 907 return *(__be16 *) nla_data(nla);
908} 908}
@@ -911,7 +911,7 @@ static inline __be16 nla_get_be16(struct nlattr *nla)
911 * nla_get_le16 - return payload of __le16 attribute 911 * nla_get_le16 - return payload of __le16 attribute
912 * @nla: __le16 netlink attribute 912 * @nla: __le16 netlink attribute
913 */ 913 */
914static inline __le16 nla_get_le16(struct nlattr *nla) 914static inline __le16 nla_get_le16(const struct nlattr *nla)
915{ 915{
916 return *(__le16 *) nla_data(nla); 916 return *(__le16 *) nla_data(nla);
917} 917}
@@ -920,7 +920,7 @@ static inline __le16 nla_get_le16(struct nlattr *nla)
920 * nla_get_u8 - return payload of u8 attribute 920 * nla_get_u8 - return payload of u8 attribute
921 * @nla: u8 netlink attribute 921 * @nla: u8 netlink attribute
922 */ 922 */
923static inline u8 nla_get_u8(struct nlattr *nla) 923static inline u8 nla_get_u8(const struct nlattr *nla)
924{ 924{
925 return *(u8 *) nla_data(nla); 925 return *(u8 *) nla_data(nla);
926} 926}
@@ -929,7 +929,7 @@ static inline u8 nla_get_u8(struct nlattr *nla)
929 * nla_get_u64 - return payload of u64 attribute 929 * nla_get_u64 - return payload of u64 attribute
930 * @nla: u64 netlink attribute 930 * @nla: u64 netlink attribute
931 */ 931 */
932static inline u64 nla_get_u64(struct nlattr *nla) 932static inline u64 nla_get_u64(const struct nlattr *nla)
933{ 933{
934 u64 tmp; 934 u64 tmp;
935 935
@@ -942,7 +942,7 @@ static inline u64 nla_get_u64(struct nlattr *nla)
942 * nla_get_flag - return payload of flag attribute 942 * nla_get_flag - return payload of flag attribute
943 * @nla: flag netlink attribute 943 * @nla: flag netlink attribute
944 */ 944 */
945static inline int nla_get_flag(struct nlattr *nla) 945static inline int nla_get_flag(const struct nlattr *nla)
946{ 946{
947 return !!nla; 947 return !!nla;
948} 948}
@@ -953,7 +953,7 @@ static inline int nla_get_flag(struct nlattr *nla)
953 * 953 *
954 * Returns the number of milliseconds in jiffies. 954 * Returns the number of milliseconds in jiffies.
955 */ 955 */
956static inline unsigned long nla_get_msecs(struct nlattr *nla) 956static inline unsigned long nla_get_msecs(const struct nlattr *nla)
957{ 957{
958 u64 msecs = nla_get_u64(nla); 958 u64 msecs = nla_get_u64(nla);
959 959
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index ece1c926b5d1..977f482d97a9 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -49,6 +49,8 @@ struct netns_ipv4 {
49 int sysctl_icmp_ratelimit; 49 int sysctl_icmp_ratelimit;
50 int sysctl_icmp_ratemask; 50 int sysctl_icmp_ratemask;
51 int sysctl_icmp_errors_use_inbound_ifaddr; 51 int sysctl_icmp_errors_use_inbound_ifaddr;
52 int sysctl_rt_cache_rebuild_count;
53 int current_rt_cache_rebuild_count;
52 54
53 struct timer_list rt_secret_timer; 55 struct timer_list rt_secret_timer;
54 atomic_t rt_genid; 56 atomic_t rt_genid;
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h
index aa9e282db485..d1ca31444644 100644
--- a/include/net/pkt_cls.h
+++ b/include/net/pkt_cls.h
@@ -246,7 +246,7 @@ struct tcf_ematch_ops
246}; 246};
247 247
248extern int tcf_em_register(struct tcf_ematch_ops *); 248extern int tcf_em_register(struct tcf_ematch_ops *);
249extern int tcf_em_unregister(struct tcf_ematch_ops *); 249extern void tcf_em_unregister(struct tcf_ematch_ops *);
250extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *, 250extern int tcf_em_tree_validate(struct tcf_proto *, struct nlattr *,
251 struct tcf_ematch_tree *); 251 struct tcf_ematch_tree *);
252extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *); 252extern void tcf_em_tree_destroy(struct tcf_proto *, struct tcf_ematch_tree *);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 3fe49d808957..f8c47429044a 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -53,7 +53,6 @@ struct Qdisc
53 atomic_t refcnt; 53 atomic_t refcnt;
54 unsigned long state; 54 unsigned long state;
55 struct sk_buff *gso_skb; 55 struct sk_buff *gso_skb;
56 struct sk_buff_head requeue;
57 struct sk_buff_head q; 56 struct sk_buff_head q;
58 struct netdev_queue *dev_queue; 57 struct netdev_queue *dev_queue;
59 struct Qdisc *next_sched; 58 struct Qdisc *next_sched;
@@ -111,7 +110,7 @@ struct Qdisc_ops
111 110
112 int (*enqueue)(struct sk_buff *, struct Qdisc *); 111 int (*enqueue)(struct sk_buff *, struct Qdisc *);
113 struct sk_buff * (*dequeue)(struct Qdisc *); 112 struct sk_buff * (*dequeue)(struct Qdisc *);
114 int (*requeue)(struct sk_buff *, struct Qdisc *); 113 struct sk_buff * (*peek)(struct Qdisc *);
115 unsigned int (*drop)(struct Qdisc *); 114 unsigned int (*drop)(struct Qdisc *);
116 115
117 int (*init)(struct Qdisc *, struct nlattr *arg); 116 int (*init)(struct Qdisc *, struct nlattr *arg);
@@ -432,19 +431,38 @@ static inline struct sk_buff *qdisc_dequeue_tail(struct Qdisc *sch)
432 return __qdisc_dequeue_tail(sch, &sch->q); 431 return __qdisc_dequeue_tail(sch, &sch->q);
433} 432}
434 433
435static inline int __qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch, 434static inline struct sk_buff *qdisc_peek_head(struct Qdisc *sch)
436 struct sk_buff_head *list)
437{ 435{
438 __skb_queue_head(list, skb); 436 return skb_peek(&sch->q);
439 sch->qstats.backlog += qdisc_pkt_len(skb); 437}
440 sch->qstats.requeues++;
441 438
442 return NET_XMIT_SUCCESS; 439/* generic pseudo peek method for non-work-conserving qdisc */
440static inline struct sk_buff *qdisc_peek_dequeued(struct Qdisc *sch)
441{
442 /* we can reuse ->gso_skb because peek isn't called for root qdiscs */
443 if (!sch->gso_skb) {
444 sch->gso_skb = sch->dequeue(sch);
445 if (sch->gso_skb)
446 /* it's still part of the queue */
447 sch->q.qlen++;
448 }
449
450 return sch->gso_skb;
443} 451}
444 452
445static inline int qdisc_requeue(struct sk_buff *skb, struct Qdisc *sch) 453/* use instead of qdisc->dequeue() for all qdiscs queried with ->peek() */
454static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
446{ 455{
447 return __qdisc_requeue(skb, sch, &sch->q); 456 struct sk_buff *skb = sch->gso_skb;
457
458 if (skb) {
459 sch->gso_skb = NULL;
460 sch->q.qlen--;
461 } else {
462 skb = sch->dequeue(sch);
463 }
464
465 return skb;
448} 466}
449 467
450static inline void __qdisc_reset_queue(struct Qdisc *sch, 468static inline void __qdisc_reset_queue(struct Qdisc *sch,
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index ed71b110edf7..23797506f593 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -285,15 +285,15 @@ extern int sctp_debug_flag;
285 if (sctp_debug_flag) { \ 285 if (sctp_debug_flag) { \
286 if (saddr->sa.sa_family == AF_INET6) { \ 286 if (saddr->sa.sa_family == AF_INET6) { \
287 printk(KERN_DEBUG \ 287 printk(KERN_DEBUG \
288 lead NIP6_FMT trail, \ 288 lead "%pI6" trail, \
289 leadparm, \ 289 leadparm, \
290 NIP6(saddr->v6.sin6_addr), \ 290 &saddr->v6.sin6_addr, \
291 otherparms); \ 291 otherparms); \
292 } else { \ 292 } else { \
293 printk(KERN_DEBUG \ 293 printk(KERN_DEBUG \
294 lead NIPQUAD_FMT trail, \ 294 lead "%pI4" trail, \
295 leadparm, \ 295 leadparm, \
296 NIPQUAD(saddr->v4.sin_addr.s_addr), \ 296 &saddr->v4.sin_addr.s_addr, \
297 otherparms); \ 297 otherparms); \
298 } \ 298 } \
299 } 299 }
diff --git a/include/net/sock.h b/include/net/sock.h
index 2f47107f6d0f..00cd486d362f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -42,6 +42,7 @@
42 42
43#include <linux/kernel.h> 43#include <linux/kernel.h>
44#include <linux/list.h> 44#include <linux/list.h>
45#include <linux/list_nulls.h>
45#include <linux/timer.h> 46#include <linux/timer.h>
46#include <linux/cache.h> 47#include <linux/cache.h>
47#include <linux/module.h> 48#include <linux/module.h>
@@ -52,6 +53,7 @@
52#include <linux/security.h> 53#include <linux/security.h>
53 54
54#include <linux/filter.h> 55#include <linux/filter.h>
56#include <linux/rculist_nulls.h>
55 57
56#include <asm/atomic.h> 58#include <asm/atomic.h>
57#include <net/dst.h> 59#include <net/dst.h>
@@ -106,6 +108,7 @@ struct net;
106 * @skc_reuse: %SO_REUSEADDR setting 108 * @skc_reuse: %SO_REUSEADDR setting
107 * @skc_bound_dev_if: bound device index if != 0 109 * @skc_bound_dev_if: bound device index if != 0
108 * @skc_node: main hash linkage for various protocol lookup tables 110 * @skc_node: main hash linkage for various protocol lookup tables
111 * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol
109 * @skc_bind_node: bind hash linkage for various protocol lookup tables 112 * @skc_bind_node: bind hash linkage for various protocol lookup tables
110 * @skc_refcnt: reference count 113 * @skc_refcnt: reference count
111 * @skc_hash: hash value used with various protocol lookup tables 114 * @skc_hash: hash value used with various protocol lookup tables
@@ -120,7 +123,10 @@ struct sock_common {
120 volatile unsigned char skc_state; 123 volatile unsigned char skc_state;
121 unsigned char skc_reuse; 124 unsigned char skc_reuse;
122 int skc_bound_dev_if; 125 int skc_bound_dev_if;
123 struct hlist_node skc_node; 126 union {
127 struct hlist_node skc_node;
128 struct hlist_nulls_node skc_nulls_node;
129 };
124 struct hlist_node skc_bind_node; 130 struct hlist_node skc_bind_node;
125 atomic_t skc_refcnt; 131 atomic_t skc_refcnt;
126 unsigned int skc_hash; 132 unsigned int skc_hash;
@@ -206,6 +212,7 @@ struct sock {
206#define sk_reuse __sk_common.skc_reuse 212#define sk_reuse __sk_common.skc_reuse
207#define sk_bound_dev_if __sk_common.skc_bound_dev_if 213#define sk_bound_dev_if __sk_common.skc_bound_dev_if
208#define sk_node __sk_common.skc_node 214#define sk_node __sk_common.skc_node
215#define sk_nulls_node __sk_common.skc_nulls_node
209#define sk_bind_node __sk_common.skc_bind_node 216#define sk_bind_node __sk_common.skc_bind_node
210#define sk_refcnt __sk_common.skc_refcnt 217#define sk_refcnt __sk_common.skc_refcnt
211#define sk_hash __sk_common.skc_hash 218#define sk_hash __sk_common.skc_hash
@@ -229,7 +236,9 @@ struct sock {
229 } sk_backlog; 236 } sk_backlog;
230 wait_queue_head_t *sk_sleep; 237 wait_queue_head_t *sk_sleep;
231 struct dst_entry *sk_dst_cache; 238 struct dst_entry *sk_dst_cache;
239#ifdef CONFIG_XFRM
232 struct xfrm_policy *sk_policy[2]; 240 struct xfrm_policy *sk_policy[2];
241#endif
233 rwlock_t sk_dst_lock; 242 rwlock_t sk_dst_lock;
234 atomic_t sk_rmem_alloc; 243 atomic_t sk_rmem_alloc;
235 atomic_t sk_wmem_alloc; 244 atomic_t sk_wmem_alloc;
@@ -237,7 +246,9 @@ struct sock {
237 int sk_sndbuf; 246 int sk_sndbuf;
238 struct sk_buff_head sk_receive_queue; 247 struct sk_buff_head sk_receive_queue;
239 struct sk_buff_head sk_write_queue; 248 struct sk_buff_head sk_write_queue;
249#ifdef CONFIG_NET_DMA
240 struct sk_buff_head sk_async_wait_queue; 250 struct sk_buff_head sk_async_wait_queue;
251#endif
241 int sk_wmem_queued; 252 int sk_wmem_queued;
242 int sk_forward_alloc; 253 int sk_forward_alloc;
243 gfp_t sk_allocation; 254 gfp_t sk_allocation;
@@ -269,7 +280,9 @@ struct sock {
269 struct sk_buff *sk_send_head; 280 struct sk_buff *sk_send_head;
270 __u32 sk_sndmsg_off; 281 __u32 sk_sndmsg_off;
271 int sk_write_pending; 282 int sk_write_pending;
283#ifdef CONFIG_SECURITY
272 void *sk_security; 284 void *sk_security;
285#endif
273 __u32 sk_mark; 286 __u32 sk_mark;
274 /* XXX 4 bytes hole on 64 bit */ 287 /* XXX 4 bytes hole on 64 bit */
275 void (*sk_state_change)(struct sock *sk); 288 void (*sk_state_change)(struct sock *sk);
@@ -294,12 +307,30 @@ static inline struct sock *sk_head(const struct hlist_head *head)
294 return hlist_empty(head) ? NULL : __sk_head(head); 307 return hlist_empty(head) ? NULL : __sk_head(head);
295} 308}
296 309
310static inline struct sock *__sk_nulls_head(const struct hlist_nulls_head *head)
311{
312 return hlist_nulls_entry(head->first, struct sock, sk_nulls_node);
313}
314
315static inline struct sock *sk_nulls_head(const struct hlist_nulls_head *head)
316{
317 return hlist_nulls_empty(head) ? NULL : __sk_nulls_head(head);
318}
319
297static inline struct sock *sk_next(const struct sock *sk) 320static inline struct sock *sk_next(const struct sock *sk)
298{ 321{
299 return sk->sk_node.next ? 322 return sk->sk_node.next ?
300 hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL; 323 hlist_entry(sk->sk_node.next, struct sock, sk_node) : NULL;
301} 324}
302 325
326static inline struct sock *sk_nulls_next(const struct sock *sk)
327{
328 return (!is_a_nulls(sk->sk_nulls_node.next)) ?
329 hlist_nulls_entry(sk->sk_nulls_node.next,
330 struct sock, sk_nulls_node) :
331 NULL;
332}
333
303static inline int sk_unhashed(const struct sock *sk) 334static inline int sk_unhashed(const struct sock *sk)
304{ 335{
305 return hlist_unhashed(&sk->sk_node); 336 return hlist_unhashed(&sk->sk_node);
@@ -315,6 +346,11 @@ static __inline__ void sk_node_init(struct hlist_node *node)
315 node->pprev = NULL; 346 node->pprev = NULL;
316} 347}
317 348
349static __inline__ void sk_nulls_node_init(struct hlist_nulls_node *node)
350{
351 node->pprev = NULL;
352}
353
318static __inline__ void __sk_del_node(struct sock *sk) 354static __inline__ void __sk_del_node(struct sock *sk)
319{ 355{
320 __hlist_del(&sk->sk_node); 356 __hlist_del(&sk->sk_node);
@@ -361,6 +397,27 @@ static __inline__ int sk_del_node_init(struct sock *sk)
361 return rc; 397 return rc;
362} 398}
363 399
400static __inline__ int __sk_nulls_del_node_init_rcu(struct sock *sk)
401{
402 if (sk_hashed(sk)) {
403 hlist_nulls_del_init_rcu(&sk->sk_nulls_node);
404 return 1;
405 }
406 return 0;
407}
408
409static __inline__ int sk_nulls_del_node_init_rcu(struct sock *sk)
410{
411 int rc = __sk_nulls_del_node_init_rcu(sk);
412
413 if (rc) {
414 /* paranoid for a while -acme */
415 WARN_ON(atomic_read(&sk->sk_refcnt) == 1);
416 __sock_put(sk);
417 }
418 return rc;
419}
420
364static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list) 421static __inline__ void __sk_add_node(struct sock *sk, struct hlist_head *list)
365{ 422{
366 hlist_add_head(&sk->sk_node, list); 423 hlist_add_head(&sk->sk_node, list);
@@ -372,6 +429,17 @@ static __inline__ void sk_add_node(struct sock *sk, struct hlist_head *list)
372 __sk_add_node(sk, list); 429 __sk_add_node(sk, list);
373} 430}
374 431
432static __inline__ void __sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
433{
434 hlist_nulls_add_head_rcu(&sk->sk_nulls_node, list);
435}
436
437static __inline__ void sk_nulls_add_node_rcu(struct sock *sk, struct hlist_nulls_head *list)
438{
439 sock_hold(sk);
440 __sk_nulls_add_node_rcu(sk, list);
441}
442
375static __inline__ void __sk_del_bind_node(struct sock *sk) 443static __inline__ void __sk_del_bind_node(struct sock *sk)
376{ 444{
377 __hlist_del(&sk->sk_bind_node); 445 __hlist_del(&sk->sk_bind_node);
@@ -385,9 +453,16 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
385 453
386#define sk_for_each(__sk, node, list) \ 454#define sk_for_each(__sk, node, list) \
387 hlist_for_each_entry(__sk, node, list, sk_node) 455 hlist_for_each_entry(__sk, node, list, sk_node)
456#define sk_nulls_for_each(__sk, node, list) \
457 hlist_nulls_for_each_entry(__sk, node, list, sk_nulls_node)
458#define sk_nulls_for_each_rcu(__sk, node, list) \
459 hlist_nulls_for_each_entry_rcu(__sk, node, list, sk_nulls_node)
388#define sk_for_each_from(__sk, node) \ 460#define sk_for_each_from(__sk, node) \
389 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ 461 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
390 hlist_for_each_entry_from(__sk, node, sk_node) 462 hlist_for_each_entry_from(__sk, node, sk_node)
463#define sk_nulls_for_each_from(__sk, node) \
464 if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \
465 hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node)
391#define sk_for_each_continue(__sk, node) \ 466#define sk_for_each_continue(__sk, node) \
392 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \ 467 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
393 hlist_for_each_entry_continue(__sk, node, sk_node) 468 hlist_for_each_entry_continue(__sk, node, sk_node)
@@ -587,8 +662,9 @@ struct proto {
587 int *sysctl_rmem; 662 int *sysctl_rmem;
588 int max_header; 663 int max_header;
589 664
590 struct kmem_cache *slab; 665 struct kmem_cache *slab;
591 unsigned int obj_size; 666 unsigned int obj_size;
667 int slab_flags;
592 668
593 atomic_t *orphan_count; 669 atomic_t *orphan_count;
594 670
@@ -597,7 +673,7 @@ struct proto {
597 673
598 union { 674 union {
599 struct inet_hashinfo *hashinfo; 675 struct inet_hashinfo *hashinfo;
600 struct hlist_head *udp_hash; 676 struct udp_table *udp_table;
601 struct raw_hashinfo *raw_hash; 677 struct raw_hashinfo *raw_hash;
602 } h; 678 } h;
603 679
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 438014d57610..8f26b28fb407 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -590,7 +590,6 @@ struct tcp_skb_cb {
590#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ 590#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */
591#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) 591#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS)
592 592
593 __u16 urg_ptr; /* Valid w/URG flags is set. */
594 __u32 ack_seq; /* Sequence number ACK'd */ 593 __u32 ack_seq; /* Sequence number ACK'd */
595}; 594};
596 595
diff --git a/include/net/udp.h b/include/net/udp.h
index 1e205095ea68..90e6ce56be65 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -50,8 +50,15 @@ 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
53extern struct hlist_head udp_hash[UDP_HTABLE_SIZE]; 53struct udp_hslot {
54extern rwlock_t udp_hash_lock; 54 struct hlist_nulls_head head;
55 spinlock_t lock;
56} __attribute__((aligned(2 * sizeof(long))));
57struct udp_table {
58 struct udp_hslot hash[UDP_HTABLE_SIZE];
59};
60extern struct udp_table udp_table;
61extern void udp_table_init(struct udp_table *);
55 62
56 63
57/* Note: this must match 'valbool' in sock_setsockopt */ 64/* Note: this must match 'valbool' in sock_setsockopt */
@@ -110,15 +117,7 @@ static inline void udp_lib_hash(struct sock *sk)
110 BUG(); 117 BUG();
111} 118}
112 119
113static inline void udp_lib_unhash(struct sock *sk) 120extern void udp_lib_unhash(struct sock *sk);
114{
115 write_lock_bh(&udp_hash_lock);
116 if (sk_del_node_init(sk)) {
117 inet_sk(sk)->num = 0;
118 sock_prot_inuse_add(sock_net(sk), sk->sk_prot, -1);
119 }
120 write_unlock_bh(&udp_hash_lock);
121}
122 121
123static inline void udp_lib_close(struct sock *sk, long timeout) 122static inline void udp_lib_close(struct sock *sk, long timeout)
124{ 123{
@@ -187,7 +186,7 @@ extern struct sock *udp4_lib_lookup(struct net *net, __be32 saddr, __be16 sport,
187struct udp_seq_afinfo { 186struct udp_seq_afinfo {
188 char *name; 187 char *name;
189 sa_family_t family; 188 sa_family_t family;
190 struct hlist_head *hashtable; 189 struct udp_table *udp_table;
191 struct file_operations seq_fops; 190 struct file_operations seq_fops;
192 struct seq_operations seq_ops; 191 struct seq_operations seq_ops;
193}; 192};
@@ -196,7 +195,7 @@ struct udp_iter_state {
196 struct seq_net_private p; 195 struct seq_net_private p;
197 sa_family_t family; 196 sa_family_t family;
198 int bucket; 197 int bucket;
199 struct hlist_head *hashtable; 198 struct udp_table *udp_table;
200}; 199};
201 200
202#ifdef CONFIG_PROC_FS 201#ifdef CONFIG_PROC_FS
diff --git a/include/net/udplite.h b/include/net/udplite.h
index b76b2e377af4..afdffe607b24 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -11,7 +11,7 @@
11#define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */ 11#define UDPLITE_RECV_CSCOV 11 /* receiver partial coverage (threshold ) */
12 12
13extern struct proto udplite_prot; 13extern struct proto udplite_prot;
14extern struct hlist_head udplite_hash[UDP_HTABLE_SIZE]; 14extern struct udp_table udplite_table;
15 15
16/* 16/*
17 * Checksum computation is all in software, hence simpler getfrag. 17 * Checksum computation is all in software, hence simpler getfrag.
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 721efb363db7..412351560b76 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -10,6 +10,7 @@
10#include <linux/netdevice.h> 10#include <linux/netdevice.h>
11#include <linux/debugfs.h> 11#include <linux/debugfs.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/ieee80211.h>
13#include <net/cfg80211.h> 14#include <net/cfg80211.h>
14 15
15/** 16/**
@@ -133,23 +134,23 @@ struct ieee80211_rate {
133}; 134};
134 135
135/** 136/**
136 * struct ieee80211_ht_info - describing STA's HT capabilities 137 * struct ieee80211_sta_ht_cap - STA's HT capabilities
137 * 138 *
138 * This structure describes most essential parameters needed 139 * This structure describes most essential parameters needed
139 * to describe 802.11n HT capabilities for an STA. 140 * to describe 802.11n HT capabilities for an STA.
140 * 141 *
141 * @ht_supported: is HT supported by STA, 0: no, 1: yes 142 * @ht_supported: is HT supported by the STA
142 * @cap: HT capabilities map as described in 802.11n spec 143 * @cap: HT capabilities map as described in 802.11n spec
143 * @ampdu_factor: Maximum A-MPDU length factor 144 * @ampdu_factor: Maximum A-MPDU length factor
144 * @ampdu_density: Minimum A-MPDU spacing 145 * @ampdu_density: Minimum A-MPDU spacing
145 * @supp_mcs_set: Supported MCS set as described in 802.11n spec 146 * @mcs: Supported MCS rates
146 */ 147 */
147struct ieee80211_ht_info { 148struct ieee80211_sta_ht_cap {
148 u16 cap; /* use IEEE80211_HT_CAP_ */ 149 u16 cap; /* use IEEE80211_HT_CAP_ */
149 u8 ht_supported; 150 bool ht_supported;
150 u8 ampdu_factor; 151 u8 ampdu_factor;
151 u8 ampdu_density; 152 u8 ampdu_density;
152 u8 supp_mcs_set[16]; 153 struct ieee80211_mcs_info mcs;
153}; 154};
154 155
155/** 156/**
@@ -173,7 +174,7 @@ struct ieee80211_supported_band {
173 enum ieee80211_band band; 174 enum ieee80211_band band;
174 int n_channels; 175 int n_channels;
175 int n_bitrates; 176 int n_bitrates;
176 struct ieee80211_ht_info ht_info; 177 struct ieee80211_sta_ht_cap ht_cap;
177}; 178};
178 179
179/** 180/**
@@ -262,9 +263,9 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy)
262/** 263/**
263 * wiphy_name - get wiphy name 264 * wiphy_name - get wiphy name
264 */ 265 */
265static inline char *wiphy_name(struct wiphy *wiphy) 266static inline const char *wiphy_name(struct wiphy *wiphy)
266{ 267{
267 return wiphy->dev.bus_id; 268 return dev_name(&wiphy->dev);
268} 269}
269 270
270/** 271/**
@@ -340,55 +341,36 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
340} 341}
341 342
342/** 343/**
343 * __regulatory_hint - hint to the wireless core a regulatory domain 344 * ieee80211_get_response_rate - get basic rate for a given rate
344 * @wiphy: if a driver is providing the hint this is the driver's very
345 * own &struct wiphy
346 * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain
347 * should be in. If @rd is set this should be NULL
348 * @rd: a complete regulatory domain, if passed the caller need not worry
349 * about freeing it
350 * 345 *
351 * The Wireless subsystem can use this function to hint to the wireless core 346 * @sband: the band to look for rates in
352 * what it believes should be the current regulatory domain by 347 * @basic_rates: bitmap of basic rates
353 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory 348 * @bitrate: the bitrate for which to find the basic rate
354 * domain should be in or by providing a completely build regulatory domain.
355 *
356 * Returns -EALREADY if *a regulatory domain* has already been set. Note that
357 * this could be by another driver. It is safe for drivers to continue if
358 * -EALREADY is returned, if drivers are not capable of world roaming they
359 * should not register more channels than they support. Right now we only
360 * support listening to the first driver hint. If the driver is capable
361 * of world roaming but wants to respect its own EEPROM mappings for
362 * specific regulatory domains it should register the @reg_notifier callback
363 * on the &struct wiphy. Returns 0 if the hint went through fine or through an
364 * intersection operation. Otherwise a standard error code is returned.
365 * 349 *
350 * This function returns the basic rate corresponding to a given
351 * bitrate, that is the next lower bitrate contained in the basic
352 * rate map, which is, for this function, given as a bitmap of
353 * indices of rates in the band's bitrate table.
366 */ 354 */
367extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, 355struct ieee80211_rate *
368 const char *alpha2, struct ieee80211_regdomain *rd); 356ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
357 u64 basic_rates, int bitrate);
358
369/** 359/**
370 * regulatory_hint - driver hint to the wireless core a regulatory domain 360 * regulatory_hint - driver hint to the wireless core a regulatory domain
371 * @wiphy: the driver's very own &struct wiphy 361 * @wiphy: the wireless device giving the hint (used only for reporting
362 * conflicts)
372 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain 363 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain
373 * should be in. If @rd is set this should be NULL. Note that if you 364 * should be in. If @rd is set this should be NULL. Note that if you
374 * set this to NULL you should still set rd->alpha2 to some accepted 365 * set this to NULL you should still set rd->alpha2 to some accepted
375 * alpha2. 366 * alpha2.
376 * @rd: a complete regulatory domain provided by the driver. If passed
377 * the driver does not need to worry about freeing it.
378 * 367 *
379 * Wireless drivers can use this function to hint to the wireless core 368 * Wireless drivers can use this function to hint to the wireless core
380 * what it believes should be the current regulatory domain by 369 * what it believes should be the current regulatory domain by
381 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory 370 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory
382 * domain should be in or by providing a completely build regulatory domain. 371 * domain should be in or by providing a completely build regulatory domain.
383 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried 372 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
384 * for a regulatory domain structure for the respective country. If 373 * for a regulatory domain structure for the respective country.
385 * a regulatory domain is build and passed you should set the alpha2
386 * if possible, otherwise set it to the special value of "99" which tells
387 * the wireless core it is unknown. If you pass a built regulatory domain
388 * and we return non zero you are in charge of kfree()'ing the structure.
389 *
390 * See __regulatory_hint() documentation for possible return values.
391 */ 374 */
392extern int regulatory_hint(struct wiphy *wiphy, 375extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
393 const char *alpha2, struct ieee80211_regdomain *rd);
394#endif /* __NET_WIRELESS_H */ 376#endif /* __NET_WIRELESS_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 11c890ad8ebb..45e11b3631e4 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -467,7 +467,6 @@ struct xfrm_policy_walk {
467 467
468struct xfrm_policy 468struct xfrm_policy
469{ 469{
470 struct xfrm_policy *next;
471 struct hlist_node bydst; 470 struct hlist_node bydst;
472 struct hlist_node byidx; 471 struct hlist_node byidx;
473 472
@@ -882,6 +881,7 @@ struct xfrm_dst
882 u32 path_cookie; 881 u32 path_cookie;
883}; 882};
884 883
884#ifdef CONFIG_XFRM
885static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) 885static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
886{ 886{
887 dst_release(xdst->route); 887 dst_release(xdst->route);
@@ -894,6 +894,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst)
894 xdst->partner = NULL; 894 xdst->partner = NULL;
895#endif 895#endif
896} 896}
897#endif
897 898
898extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); 899extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev);
899 900
@@ -1536,9 +1537,11 @@ static inline void xfrm_states_delete(struct xfrm_state **states, int n)
1536} 1537}
1537#endif 1538#endif
1538 1539
1540#ifdef CONFIG_XFRM
1539static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb) 1541static inline struct xfrm_state *xfrm_input_state(struct sk_buff *skb)
1540{ 1542{
1541 return skb->sp->xvec[skb->sp->len - 1]; 1543 return skb->sp->xvec[skb->sp->len - 1];
1542} 1544}
1545#endif
1543 1546
1544#endif /* _NET_XFRM_H */ 1547#endif /* _NET_XFRM_H */