aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/addrconf.h28
-rw-r--r--include/net/cfg80211.h159
-rw-r--r--include/net/icmp.h2
-rw-r--r--include/net/ieee80211.h1
-rw-r--r--include/net/ieee80211softmac.h373
-rw-r--r--include/net/ieee80211softmac_wx.h99
-rw-r--r--include/net/inet_hashtables.h2
-rw-r--r--include/net/inet_sock.h5
-rw-r--r--include/net/ip6_fib.h18
-rw-r--r--include/net/ip6_route.h30
-rw-r--r--include/net/ipv6.h23
-rw-r--r--include/net/llc_if.h5
-rw-r--r--include/net/mac80211.h482
-rw-r--r--include/net/ndisc.h4
-rw-r--r--include/net/neighbour.h6
-rw-r--r--include/net/netns/ipv4.h2
-rw-r--r--include/net/netns/ipv6.h18
-rw-r--r--include/net/raw.h4
-rw-r--r--include/net/request_sock.h7
-rw-r--r--include/net/sctp/sctp.h17
-rw-r--r--include/net/sctp/structs.h8
-rw-r--r--include/net/sock.h28
-rw-r--r--include/net/tcp.h16
-rw-r--r--include/net/tipc/tipc_bearer.h9
-rw-r--r--include/net/tipc/tipc_port.h7
-rw-r--r--include/net/udp.h7
-rw-r--r--include/net/wireless.h168
-rw-r--r--include/net/xfrm.h54
28 files changed, 777 insertions, 805 deletions
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 496503c03846..232da20e7171 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -55,9 +55,12 @@ struct prefix_info {
55extern int addrconf_init(void); 55extern int addrconf_init(void);
56extern void addrconf_cleanup(void); 56extern void addrconf_cleanup(void);
57 57
58extern int addrconf_add_ifaddr(void __user *arg); 58extern int addrconf_add_ifaddr(struct net *net,
59extern int addrconf_del_ifaddr(void __user *arg); 59 void __user *arg);
60extern int addrconf_set_dstaddr(void __user *arg); 60extern int addrconf_del_ifaddr(struct net *net,
61 void __user *arg);
62extern int addrconf_set_dstaddr(struct net *net,
63 void __user *arg);
61 64
62extern int ipv6_chk_addr(struct net *net, 65extern int ipv6_chk_addr(struct net *net,
63 struct in6_addr *addr, 66 struct in6_addr *addr,
@@ -73,9 +76,6 @@ extern struct inet6_ifaddr *ipv6_get_ifaddr(struct net *net,
73 struct net_device *dev, 76 struct net_device *dev,
74 int strict); 77 int strict);
75 78
76extern int ipv6_get_saddr(struct dst_entry *dst,
77 struct in6_addr *daddr,
78 struct in6_addr *saddr);
79extern int ipv6_dev_get_saddr(struct net_device *dev, 79extern int ipv6_dev_get_saddr(struct net_device *dev,
80 struct in6_addr *daddr, 80 struct in6_addr *daddr,
81 struct in6_addr *saddr); 81 struct in6_addr *saddr);
@@ -214,29 +214,25 @@ static inline void addrconf_addr_solict_mult(const struct in6_addr *addr,
214 struct in6_addr *solicited) 214 struct in6_addr *solicited)
215{ 215{
216 ipv6_addr_set(solicited, 216 ipv6_addr_set(solicited,
217 __constant_htonl(0xFF020000), 0, 217 htonl(0xFF020000), 0,
218 __constant_htonl(0x1), 218 htonl(0x1),
219 __constant_htonl(0xFF000000) | addr->s6_addr32[3]); 219 htonl(0xFF000000) | addr->s6_addr32[3]);
220} 220}
221 221
222 222
223static inline void ipv6_addr_all_nodes(struct in6_addr *addr) 223static inline void ipv6_addr_all_nodes(struct in6_addr *addr)
224{ 224{
225 ipv6_addr_set(addr, 225 ipv6_addr_set(addr, htonl(0xFF020000), 0, 0, htonl(0x1));
226 __constant_htonl(0xFF020000), 0, 0,
227 __constant_htonl(0x1));
228} 226}
229 227
230static inline void ipv6_addr_all_routers(struct in6_addr *addr) 228static inline void ipv6_addr_all_routers(struct in6_addr *addr)
231{ 229{
232 ipv6_addr_set(addr, 230 ipv6_addr_set(addr, htonl(0xFF020000), 0, 0, htonl(0x2));
233 __constant_htonl(0xFF020000), 0, 0,
234 __constant_htonl(0x2));
235} 231}
236 232
237static inline int ipv6_addr_is_multicast(const struct in6_addr *addr) 233static inline int ipv6_addr_is_multicast(const struct in6_addr *addr)
238{ 234{
239 return (addr->s6_addr32[0] & __constant_htonl(0xFF000000)) == __constant_htonl(0xFF000000); 235 return (addr->s6_addr32[0] & htonl(0xFF000000)) == htonl(0xFF000000);
240} 236}
241 237
242static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr) 238static inline int ipv6_addr_is_ll_all_nodes(const struct in6_addr *addr)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bcc480b8892a..e00750836ba5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -12,6 +12,16 @@
12 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net> 12 * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net>
13 */ 13 */
14 14
15/**
16 * struct vif_params - describes virtual interface parameters
17 * @mesh_id: mesh ID to use
18 * @mesh_id_len: length of the mesh ID
19 */
20struct vif_params {
21 u8 *mesh_id;
22 int mesh_id_len;
23};
24
15/* Radiotap header iteration 25/* Radiotap header iteration
16 * implemented in net/wireless/radiotap.c 26 * implemented in net/wireless/radiotap.c
17 * docs in Documentation/networking/radiotap-headers.txt 27 * docs in Documentation/networking/radiotap-headers.txt
@@ -109,6 +119,19 @@ enum station_flags {
109}; 119};
110 120
111/** 121/**
122 * enum plink_action - actions to perform in mesh peers
123 *
124 * @PLINK_ACTION_INVALID: action 0 is reserved
125 * @PLINK_ACTION_OPEN: start mesh peer link establishment
126 * @PLINK_ACTION_BLOCL: block traffic from this mesh peer
127 */
128enum plink_actions {
129 PLINK_ACTION_INVALID,
130 PLINK_ACTION_OPEN,
131 PLINK_ACTION_BLOCK,
132};
133
134/**
112 * struct station_parameters - station parameters 135 * struct station_parameters - station parameters
113 * 136 *
114 * Used to change and create a new station. 137 * Used to change and create a new station.
@@ -128,41 +151,124 @@ struct station_parameters {
128 int listen_interval; 151 int listen_interval;
129 u16 aid; 152 u16 aid;
130 u8 supported_rates_len; 153 u8 supported_rates_len;
154 u8 plink_action;
131}; 155};
132 156
133/** 157/**
134 * enum station_stats_flags - station statistics flags 158 * enum station_info_flags - station information flags
135 * 159 *
136 * Used by the driver to indicate which info in &struct station_stats 160 * Used by the driver to indicate which info in &struct station_info
137 * it has filled in during get_station(). 161 * it has filled in during get_station() or dump_station().
138 * 162 *
139 * @STATION_STAT_INACTIVE_TIME: @inactive_time filled 163 * @STATION_INFO_INACTIVE_TIME: @inactive_time filled
140 * @STATION_STAT_RX_BYTES: @rx_bytes filled 164 * @STATION_INFO_RX_BYTES: @rx_bytes filled
141 * @STATION_STAT_TX_BYTES: @tx_bytes filled 165 * @STATION_INFO_TX_BYTES: @tx_bytes filled
166 * @STATION_INFO_LLID: @llid filled
167 * @STATION_INFO_PLID: @plid filled
168 * @STATION_INFO_PLINK_STATE: @plink_state filled
142 */ 169 */
143enum station_stats_flags { 170enum station_info_flags {
144 STATION_STAT_INACTIVE_TIME = 1<<0, 171 STATION_INFO_INACTIVE_TIME = 1<<0,
145 STATION_STAT_RX_BYTES = 1<<1, 172 STATION_INFO_RX_BYTES = 1<<1,
146 STATION_STAT_TX_BYTES = 1<<2, 173 STATION_INFO_TX_BYTES = 1<<2,
174 STATION_INFO_LLID = 1<<3,
175 STATION_INFO_PLID = 1<<4,
176 STATION_INFO_PLINK_STATE = 1<<5,
147}; 177};
148 178
149/** 179/**
150 * struct station_stats - station statistics 180 * struct station_info - station information
151 * 181 *
152 * Station information filled by driver for get_station(). 182 * Station information filled by driver for get_station() and dump_station.
153 * 183 *
154 * @filled: bitflag of flags from &enum station_stats_flags 184 * @filled: bitflag of flags from &enum station_info_flags
155 * @inactive_time: time since last station activity (tx/rx) in milliseconds 185 * @inactive_time: time since last station activity (tx/rx) in milliseconds
156 * @rx_bytes: bytes received from this station 186 * @rx_bytes: bytes received from this station
157 * @tx_bytes: bytes transmitted to this station 187 * @tx_bytes: bytes transmitted to this station
188 * @llid: mesh local link id
189 * @plid: mesh peer link id
190 * @plink_state: mesh peer link state
158 */ 191 */
159struct station_stats { 192struct station_info {
160 u32 filled; 193 u32 filled;
161 u32 inactive_time; 194 u32 inactive_time;
162 u32 rx_bytes; 195 u32 rx_bytes;
163 u32 tx_bytes; 196 u32 tx_bytes;
197 u16 llid;
198 u16 plid;
199 u8 plink_state;
200};
201
202/**
203 * enum monitor_flags - monitor flags
204 *
205 * Monitor interface configuration flags. Note that these must be the bits
206 * according to the nl80211 flags.
207 *
208 * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS
209 * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP
210 * @MONITOR_FLAG_CONTROL: pass control frames
211 * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
212 * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
213 */
214enum monitor_flags {
215 MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
216 MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL,
217 MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
218 MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
219 MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
164}; 220};
165 221
222/**
223 * enum mpath_info_flags - mesh path information flags
224 *
225 * Used by the driver to indicate which info in &struct mpath_info it has filled
226 * in during get_station() or dump_station().
227 *
228 * MPATH_INFO_FRAME_QLEN: @frame_qlen filled
229 * MPATH_INFO_DSN: @dsn filled
230 * MPATH_INFO_METRIC: @metric filled
231 * MPATH_INFO_EXPTIME: @exptime filled
232 * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled
233 * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled
234 * MPATH_INFO_FLAGS: @flags filled
235 */
236enum mpath_info_flags {
237 MPATH_INFO_FRAME_QLEN = BIT(0),
238 MPATH_INFO_DSN = BIT(1),
239 MPATH_INFO_METRIC = BIT(2),
240 MPATH_INFO_EXPTIME = BIT(3),
241 MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4),
242 MPATH_INFO_DISCOVERY_RETRIES = BIT(5),
243 MPATH_INFO_FLAGS = BIT(6),
244};
245
246/**
247 * struct mpath_info - mesh path information
248 *
249 * Mesh path information filled by driver for get_mpath() and dump_mpath().
250 *
251 * @filled: bitfield of flags from &enum mpath_info_flags
252 * @frame_qlen: number of queued frames for this destination
253 * @dsn: destination sequence number
254 * @metric: metric (cost) of this mesh path
255 * @exptime: expiration time for the mesh path from now, in msecs
256 * @flags: mesh path flags
257 * @discovery_timeout: total mesh path discovery timeout, in msecs
258 * @discovery_retries: mesh path discovery retries
259 */
260struct mpath_info {
261 u32 filled;
262 u32 frame_qlen;
263 u32 dsn;
264 u32 metric;
265 u32 exptime;
266 u32 discovery_timeout;
267 u8 discovery_retries;
268 u8 flags;
269};
270
271
166/* from net/wireless.h */ 272/* from net/wireless.h */
167struct wiphy; 273struct wiphy;
168 274
@@ -210,13 +316,17 @@ struct wiphy;
210 * @del_station: Remove a station; @mac may be NULL to remove all stations. 316 * @del_station: Remove a station; @mac may be NULL to remove all stations.
211 * 317 *
212 * @change_station: Modify a given station. 318 * @change_station: Modify a given station.
319 *
320 * @set_mesh_cfg: set mesh parameters (by now, just mesh id)
213 */ 321 */
214struct cfg80211_ops { 322struct cfg80211_ops {
215 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 323 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
216 enum nl80211_iftype type); 324 enum nl80211_iftype type, u32 *flags,
325 struct vif_params *params);
217 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); 326 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
218 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, 327 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
219 enum nl80211_iftype type); 328 enum nl80211_iftype type, u32 *flags,
329 struct vif_params *params);
220 330
221 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, 331 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
222 u8 key_index, u8 *mac_addr, 332 u8 key_index, u8 *mac_addr,
@@ -244,7 +354,22 @@ struct cfg80211_ops {
244 int (*change_station)(struct wiphy *wiphy, struct net_device *dev, 354 int (*change_station)(struct wiphy *wiphy, struct net_device *dev,
245 u8 *mac, struct station_parameters *params); 355 u8 *mac, struct station_parameters *params);
246 int (*get_station)(struct wiphy *wiphy, struct net_device *dev, 356 int (*get_station)(struct wiphy *wiphy, struct net_device *dev,
247 u8 *mac, struct station_stats *stats); 357 u8 *mac, struct station_info *sinfo);
358 int (*dump_station)(struct wiphy *wiphy, struct net_device *dev,
359 int idx, u8 *mac, struct station_info *sinfo);
360
361 int (*add_mpath)(struct wiphy *wiphy, struct net_device *dev,
362 u8 *dst, u8 *next_hop);
363 int (*del_mpath)(struct wiphy *wiphy, struct net_device *dev,
364 u8 *dst);
365 int (*change_mpath)(struct wiphy *wiphy, struct net_device *dev,
366 u8 *dst, u8 *next_hop);
367 int (*get_mpath)(struct wiphy *wiphy, struct net_device *dev,
368 u8 *dst, u8 *next_hop,
369 struct mpath_info *pinfo);
370 int (*dump_mpath)(struct wiphy *wiphy, struct net_device *dev,
371 int idx, u8 *dst, u8 *next_hop,
372 struct mpath_info *pinfo);
248}; 373};
249 374
250#endif /* __NET_CFG80211_H */ 375#endif /* __NET_CFG80211_H */
diff --git a/include/net/icmp.h b/include/net/icmp.h
index 9f7ef3c8baef..faba64db8ff0 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -48,7 +48,7 @@ struct sk_buff;
48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); 48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
49extern int icmp_rcv(struct sk_buff *skb); 49extern int icmp_rcv(struct sk_buff *skb);
50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); 50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
51extern void icmp_init(struct net_proto_family *ops); 51extern int icmp_init(void);
52extern void icmp_out_count(unsigned char type); 52extern void icmp_out_count(unsigned char type);
53 53
54/* Move into dst.h ? */ 54/* Move into dst.h ? */
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 285b2adfa648..529816bfbc52 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -183,7 +183,6 @@ const char *escape_essid(const char *essid, u8 essid_len);
183#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a) 183#define IEEE80211_DEBUG_RX(f, a...) IEEE80211_DEBUG(IEEE80211_DL_RX, f, ## a)
184#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a) 184#define IEEE80211_DEBUG_QOS(f, a...) IEEE80211_DEBUG(IEEE80211_DL_QOS, f, ## a)
185#include <linux/netdevice.h> 185#include <linux/netdevice.h>
186#include <linux/wireless.h>
187#include <linux/if_arp.h> /* ARPHRD_ETHER */ 186#include <linux/if_arp.h> /* ARPHRD_ETHER */
188 187
189#ifndef WIRELESS_SPY 188#ifndef WIRELESS_SPY
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h
deleted file mode 100644
index 1ef6282fdded..000000000000
--- a/include/net/ieee80211softmac.h
+++ /dev/null
@@ -1,373 +0,0 @@
1/*
2 * ieee80211softmac.h - public interface to the softmac
3 *
4 * Copyright (c) 2005 Johannes Berg <johannes@sipsolutions.net>
5 * Joseph Jezak <josejx@gentoo.org>
6 * Larry Finger <Larry.Finger@lwfinger.net>
7 * Danny van Dyk <kugelfang@gentoo.org>
8 * Michael Buesch <mbuesch@freenet.de>
9 *
10 * This program is free software; you can redistribute it and/or modify it
11 * under the terms of version 2 of the GNU General Public License as
12 * published by the Free Software Foundation.
13 *
14 * This program is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 * The full GNU General Public License is included in this distribution in the
24 * file called COPYING.
25 */
26
27#ifndef IEEE80211SOFTMAC_H_
28#define IEEE80211SOFTMAC_H_
29
30#include <linux/kernel.h>
31#include <linux/spinlock.h>
32#include <linux/workqueue.h>
33#include <linux/list.h>
34#include <net/ieee80211.h>
35
36/* Once the API is considered more or less stable,
37 * this should be incremented on API incompatible changes.
38 */
39#define IEEE80211SOFTMAC_API 0
40
41#define IEEE80211SOFTMAC_MAX_RATES_LEN 8
42#define IEEE80211SOFTMAC_MAX_EX_RATES_LEN 255
43
44struct ieee80211softmac_ratesinfo {
45 u8 count;
46 u8 rates[IEEE80211SOFTMAC_MAX_RATES_LEN + IEEE80211SOFTMAC_MAX_EX_RATES_LEN];
47};
48
49/* internal structures */
50struct ieee80211softmac_network;
51struct ieee80211softmac_scaninfo;
52
53struct ieee80211softmac_essid {
54 u8 len;
55 char data[IW_ESSID_MAX_SIZE+1];
56};
57
58struct ieee80211softmac_wpa {
59 char *IE;
60 int IElen;
61 int IEbuflen;
62};
63
64/*
65 * Information about association
66 */
67struct ieee80211softmac_assoc_info {
68
69 struct mutex mutex;
70
71 /*
72 * This is the requested ESSID. It is written
73 * only by the WX handlers.
74 *
75 */
76 struct ieee80211softmac_essid req_essid;
77 /*
78 * the ESSID of the network we're currently
79 * associated (or trying) to. This is
80 * updated to the network's actual ESSID
81 * even if the requested ESSID was 'ANY'
82 */
83 struct ieee80211softmac_essid associate_essid;
84
85 /* BSSID we're trying to associate to */
86 char bssid[ETH_ALEN];
87
88 /* some flags.
89 * static_essid is valid if the essid is constant,
90 * this is for use by the wx handlers only.
91 *
92 * associating is true, if the network has been
93 * auth'ed on and we are in the process of associating.
94 *
95 * bssvalid is true if we found a matching network
96 * and saved it's BSSID into the bssid above.
97 *
98 * bssfixed is used for SIOCSIWAP.
99 */
100 u8 static_essid;
101 u8 short_preamble_available;
102 u8 associating;
103 u8 associated;
104 u8 assoc_wait;
105 u8 bssvalid;
106 u8 bssfixed;
107
108 /* Scan retries remaining */
109 int scan_retry;
110
111 struct delayed_work work;
112 struct delayed_work timeout;
113};
114
115struct ieee80211softmac_bss_info {
116 /* Rates supported by the network */
117 struct ieee80211softmac_ratesinfo supported_rates;
118
119 /* This indicates whether frames can currently be transmitted with
120 * short preamble (only use this variable during TX at CCK rates) */
121 u8 short_preamble:1;
122
123 /* This indicates whether protection (e.g. self-CTS) should be used
124 * when transmitting with OFDM modulation */
125 u8 use_protection:1;
126};
127
128enum {
129 IEEE80211SOFTMAC_AUTH_OPEN_REQUEST = 1,
130 IEEE80211SOFTMAC_AUTH_OPEN_RESPONSE = 2,
131};
132
133enum {
134 IEEE80211SOFTMAC_AUTH_SHARED_REQUEST = 1,
135 IEEE80211SOFTMAC_AUTH_SHARED_CHALLENGE = 2,
136 IEEE80211SOFTMAC_AUTH_SHARED_RESPONSE = 3,
137 IEEE80211SOFTMAC_AUTH_SHARED_PASS = 4,
138};
139
140/* We should make these tunable
141 * AUTH_TIMEOUT seems really long, but that's what it is in BSD */
142#define IEEE80211SOFTMAC_AUTH_TIMEOUT (12 * HZ)
143#define IEEE80211SOFTMAC_AUTH_RETRY_LIMIT 5
144#define IEEE80211SOFTMAC_ASSOC_SCAN_RETRY_LIMIT 3
145
146struct ieee80211softmac_txrates {
147 /* The Bit-Rate to be used for multicast frames. */
148 u8 mcast_rate;
149
150 /* The Bit-Rate to be used for multicast management frames. */
151 u8 mgt_mcast_rate;
152
153 /* The Bit-Rate to be used for any other (normal) data packet. */
154 u8 default_rate;
155 /* The Bit-Rate to be used for default fallback
156 * (If the device supports fallback and hardware-retry)
157 */
158 u8 default_fallback;
159
160 /* This is the rate that the user asked for */
161 u8 user_rate;
162};
163
164/* Bits for txrates_change callback. */
165#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */
166#define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */
167#define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */
168#define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */
169
170#define IEEE80211SOFTMAC_BSSINFOCHG_RATES (1 << 0) /* supported_rates */
171#define IEEE80211SOFTMAC_BSSINFOCHG_SHORT_PREAMBLE (1 << 1) /* short_preamble */
172#define IEEE80211SOFTMAC_BSSINFOCHG_PROTECTION (1 << 2) /* use_protection */
173
174struct ieee80211softmac_device {
175 /* 802.11 structure for data stuff */
176 struct ieee80211_device *ieee;
177 struct net_device *dev;
178
179 /* only valid if associated, then holds the Association ID */
180 u16 association_id;
181
182 /* the following methods are callbacks that the driver
183 * using this framework has to assign
184 */
185
186 /* always assign these */
187 void (*set_bssid_filter)(struct net_device *dev, const u8 *bssid);
188 void (*set_channel)(struct net_device *dev, u8 channel);
189
190 /* assign if you need it, informational only */
191 void (*link_change)(struct net_device *dev);
192
193 /* If the hardware can do scanning, assign _all_ three of these callbacks.
194 * When the scan finishes, call ieee80211softmac_scan_finished().
195 */
196
197 /* when called, start_scan is guaranteed to not be called again
198 * until you call ieee80211softmac_scan_finished.
199 * Return 0 if scanning could start, error otherwise.
200 * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_start_scan */
201 int (*start_scan)(struct net_device *dev);
202 /* this should block until after ieee80211softmac_scan_finished was called
203 * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_wait_for_scan */
204 void (*wait_for_scan)(struct net_device *dev);
205 /* stop_scan aborts a scan, but is asynchronous.
206 * if you want to wait for it too, use wait_for_scan
207 * SOFTMAC AUTHORS: don't call this, use ieee80211softmac_stop_scan */
208 void (*stop_scan)(struct net_device *dev);
209
210 /* we'll need something about beacons here too, for AP or ad-hoc modes */
211
212 /* Transmission rates to be used by the driver.
213 * The SoftMAC figures out the best possible rates.
214 * The driver just needs to read them.
215 */
216 struct ieee80211softmac_txrates txrates;
217
218 /* If the driver needs to do stuff on TX rate changes, assign this
219 * callback. See IEEE80211SOFTMAC_TXRATECHG for change flags. */
220 void (*txrates_change)(struct net_device *dev,
221 u32 changes);
222
223 /* If the driver needs to do stuff when BSS properties change, assign
224 * this callback. see IEEE80211SOFTMAC_BSSINFOCHG for change flags. */
225 void (*bssinfo_change)(struct net_device *dev,
226 u32 changes);
227
228 /* private stuff follows */
229 /* this lock protects this structure */
230 spinlock_t lock;
231
232 struct workqueue_struct *wq;
233
234 u8 running; /* SoftMAC started? */
235 u8 scanning;
236
237 struct ieee80211softmac_scaninfo *scaninfo;
238 struct ieee80211softmac_assoc_info associnfo;
239 struct ieee80211softmac_bss_info bssinfo;
240
241 struct list_head auth_queue;
242 struct list_head events;
243
244 struct ieee80211softmac_ratesinfo ratesinfo;
245 int txrate_badness;
246
247 /* WPA stuff */
248 struct ieee80211softmac_wpa wpa;
249
250 /* we need to keep a list of network structs we copied */
251 struct list_head network_list;
252
253 /* This must be the last item so that it points to the data
254 * allocated beyond this structure by alloc_ieee80211 */
255 u8 priv[0];
256};
257
258extern void ieee80211softmac_scan_finished(struct ieee80211softmac_device *sm);
259
260static inline void * ieee80211softmac_priv(struct net_device *dev)
261{
262 return ((struct ieee80211softmac_device *)ieee80211_priv(dev))->priv;
263}
264
265extern struct net_device * alloc_ieee80211softmac(int sizeof_priv);
266extern void free_ieee80211softmac(struct net_device *dev);
267
268/* Call this function if you detect a lost TX fragment.
269 * (If the device indicates failure of ACK RX, for example.)
270 * It is wise to call this function if you are able to detect lost packets,
271 * because it contributes to the TX Rates auto adjustment.
272 */
273extern void ieee80211softmac_fragment_lost(struct net_device *dev,
274 u16 wireless_sequence_number);
275/* Call this function before _start to tell the softmac what rates
276 * the hw supports. The rates parameter is copied, so you can
277 * free it right after calling this function.
278 * Note that the rates need to be sorted. */
279extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates);
280
281/* Finds the highest rate which is:
282 * 1. Present in ri (optionally a basic rate)
283 * 2. Supported by the device
284 * 3. Less than or equal to the user-defined rate
285 */
286extern u8 ieee80211softmac_highest_supported_rate(struct ieee80211softmac_device *mac,
287 struct ieee80211softmac_ratesinfo *ri, int basic_only);
288
289/* Helper function which advises you the rate at which a frame should be
290 * transmitted at. */
291static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac,
292 int is_multicast,
293 int is_mgt)
294{
295 struct ieee80211softmac_txrates *txrates = &mac->txrates;
296
297 if (!mac->associnfo.associated)
298 return txrates->mgt_mcast_rate;
299
300 /* We are associated, sending unicast frame */
301 if (!is_multicast)
302 return txrates->default_rate;
303
304 /* We are associated, sending multicast frame */
305 if (is_mgt)
306 return txrates->mgt_mcast_rate;
307 else
308 return txrates->mcast_rate;
309}
310
311/* Helper function which advises you when it is safe to transmit with short
312 * preamble.
313 * You should only call this function when transmitting at CCK rates. */
314static inline int ieee80211softmac_short_preamble_ok(struct ieee80211softmac_device *mac,
315 int is_multicast,
316 int is_mgt)
317{
318 return (is_multicast && is_mgt) ? 0 : mac->bssinfo.short_preamble;
319}
320
321/* Helper function which advises you whether protection (e.g. self-CTS) is
322 * needed. 1 = protection needed, 0 = no protection needed
323 * Only use this function when transmitting with OFDM modulation. */
324static inline int ieee80211softmac_protection_needed(struct ieee80211softmac_device *mac)
325{
326 return mac->bssinfo.use_protection;
327}
328
329/* Start the SoftMAC. Call this after you initialized the device
330 * and it is ready to run.
331 */
332extern void ieee80211softmac_start(struct net_device *dev);
333/* Stop the SoftMAC. Call this before you shutdown the device. */
334extern void ieee80211softmac_stop(struct net_device *dev);
335
336/*
337 * Event system
338 */
339
340/* valid event types */
341#define IEEE80211SOFTMAC_EVENT_ANY -1 /*private use only*/
342#define IEEE80211SOFTMAC_EVENT_SCAN_FINISHED 0
343#define IEEE80211SOFTMAC_EVENT_ASSOCIATED 1
344#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_FAILED 2
345#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_TIMEOUT 3
346#define IEEE80211SOFTMAC_EVENT_AUTHENTICATED 4
347#define IEEE80211SOFTMAC_EVENT_AUTH_FAILED 5
348#define IEEE80211SOFTMAC_EVENT_AUTH_TIMEOUT 6
349#define IEEE80211SOFTMAC_EVENT_ASSOCIATE_NET_NOT_FOUND 7
350#define IEEE80211SOFTMAC_EVENT_DISASSOCIATED 8
351/* keep this updated! */
352#define IEEE80211SOFTMAC_EVENT_LAST 8
353/*
354 * If you want to be notified of certain events, you can call
355 * ieee80211softmac_notify[_atomic] with
356 * - event set to one of the constants below
357 * - fun set to a function pointer of the appropriate type
358 * - context set to the context data you want passed
359 * The return value is 0, or an error.
360 */
361typedef void (*notify_function_ptr)(struct net_device *dev, int event_type, void *context);
362
363#define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL);
364#define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC);
365
366extern int ieee80211softmac_notify_gfp(struct net_device *dev,
367 int event, notify_function_ptr fun, void *context, gfp_t gfp_mask);
368
369/* To clear pending work (for ifconfig down, etc.) */
370extern void
371ieee80211softmac_clear_pending_work(struct ieee80211softmac_device *sm);
372
373#endif /* IEEE80211SOFTMAC_H_ */
diff --git a/include/net/ieee80211softmac_wx.h b/include/net/ieee80211softmac_wx.h
deleted file mode 100644
index 4ee3ad57283f..000000000000
--- a/include/net/ieee80211softmac_wx.h
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * This file contains the prototypes for the wireless extension
3 * handlers that the softmac API provides. Include this file to
4 * use the wx handlers, you can assign these directly.
5 *
6 * Copyright (c) 2005 Johannes Berg <johannes@sipsolutions.net>
7 * Joseph Jezak <josejx@gentoo.org>
8 * Larry Finger <Larry.Finger@lwfinger.net>
9 * Danny van Dyk <kugelfang@gentoo.org>
10 * Michael Buesch <mbuesch@freenet.de>
11 *
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of version 2 of the GNU General Public License as
14 * published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but WITHOUT
17 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
19 * more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24 *
25 * The full GNU General Public License is included in this distribution in the
26 * file called COPYING.
27 */
28
29#ifndef _IEEE80211SOFTMAC_WX_H
30#define _IEEE80211SOFTMAC_WX_H
31
32#include <net/ieee80211softmac.h>
33#include <net/iw_handler.h>
34
35extern int
36ieee80211softmac_wx_trigger_scan(struct net_device *net_dev,
37 struct iw_request_info *info,
38 union iwreq_data *data,
39 char *extra);
40
41extern int
42ieee80211softmac_wx_get_scan_results(struct net_device *net_dev,
43 struct iw_request_info *info,
44 union iwreq_data *data,
45 char *extra);
46
47extern int
48ieee80211softmac_wx_set_essid(struct net_device *net_dev,
49 struct iw_request_info *info,
50 union iwreq_data *data,
51 char *extra);
52
53extern int
54ieee80211softmac_wx_get_essid(struct net_device *net_dev,
55 struct iw_request_info *info,
56 union iwreq_data *data,
57 char *extra);
58
59extern int
60ieee80211softmac_wx_set_rate(struct net_device *net_dev,
61 struct iw_request_info *info,
62 union iwreq_data *data,
63 char *extra);
64
65extern int
66ieee80211softmac_wx_get_rate(struct net_device *net_dev,
67 struct iw_request_info *info,
68 union iwreq_data *data,
69 char *extra);
70
71extern int
72ieee80211softmac_wx_get_wap(struct net_device *net_dev,
73 struct iw_request_info *info,
74 union iwreq_data *data,
75 char *extra);
76
77extern int
78ieee80211softmac_wx_set_wap(struct net_device *net_dev,
79 struct iw_request_info *info,
80 union iwreq_data *data,
81 char *extra);
82
83extern int
84ieee80211softmac_wx_set_genie(struct net_device *dev,
85 struct iw_request_info *info,
86 union iwreq_data *wrqu,
87 char *extra);
88
89extern int
90ieee80211softmac_wx_get_genie(struct net_device *dev,
91 struct iw_request_info *info,
92 union iwreq_data *wrqu,
93 char *extra);
94extern int
95ieee80211softmac_wx_set_mlme(struct net_device *dev,
96 struct iw_request_info *info,
97 union iwreq_data *wrqu,
98 char *extra);
99#endif /* _IEEE80211SOFTMAC_WX */
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 97dc35ad09be..d99c1ba2ece0 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -223,7 +223,7 @@ static inline int inet_sk_listen_hashfn(const struct sock *sk)
223/* Caller must disable local BH processing. */ 223/* Caller must disable local BH processing. */
224static inline void __inet_inherit_port(struct sock *sk, struct sock *child) 224static inline void __inet_inherit_port(struct sock *sk, struct sock *child)
225{ 225{
226 struct inet_hashinfo *table = sk->sk_prot->hashinfo; 226 struct inet_hashinfo *table = sk->sk_prot->h.hashinfo;
227 const int bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size); 227 const int bhash = inet_bhashfn(inet_sk(child)->num, table->bhash_size);
228 struct inet_bind_hashbucket *head = &table->bhash[bhash]; 228 struct inet_bind_hashbucket *head = &table->bhash[bhash];
229 struct inet_bind_bucket *tb; 229 struct inet_bind_bucket *tb;
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 89cd011edb99..b6db16d2766a 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -43,8 +43,7 @@ struct ip_options {
43 unsigned char srr; 43 unsigned char srr;
44 unsigned char rr; 44 unsigned char rr;
45 unsigned char ts; 45 unsigned char ts;
46 unsigned char is_data:1, 46 unsigned char is_strictroute:1,
47 is_strictroute:1,
48 srr_is_hit:1, 47 srr_is_hit:1,
49 is_changed:1, 48 is_changed:1,
50 rr_needaddr:1, 49 rr_needaddr:1,
@@ -195,7 +194,7 @@ static inline int inet_sk_ehashfn(const struct sock *sk)
195 194
196static inline int inet_iif(const struct sk_buff *skb) 195static inline int inet_iif(const struct sk_buff *skb)
197{ 196{
198 return ((struct rtable *)skb->dst)->rt_iif; 197 return skb->rtable->rt_iif;
199} 198}
200 199
201#endif /* _INET_SOCK_H */ 200#endif /* _INET_SOCK_H */
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 953d6040ff50..7c5c0f79168a 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -174,17 +174,19 @@ struct fib6_table {
174#define RT6_TABLE_LOCAL RT6_TABLE_MAIN 174#define RT6_TABLE_LOCAL RT6_TABLE_MAIN
175#endif 175#endif
176 176
177typedef struct rt6_info *(*pol_lookup_t)(struct fib6_table *, 177typedef struct rt6_info *(*pol_lookup_t)(struct net *,
178 struct fib6_table *,
178 struct flowi *, int); 179 struct flowi *, int);
179 180
180/* 181/*
181 * exported functions 182 * exported functions
182 */ 183 */
183 184
184extern struct fib6_table * fib6_get_table(u32 id); 185extern struct fib6_table *fib6_get_table(struct net *net, u32 id);
185extern struct fib6_table * fib6_new_table(u32 id); 186extern struct fib6_table *fib6_new_table(struct net *net, u32 id);
186extern struct dst_entry * fib6_rule_lookup(struct flowi *fl, int flags, 187extern struct dst_entry *fib6_rule_lookup(struct net *net,
187 pol_lookup_t lookup); 188 struct flowi *fl, int flags,
189 pol_lookup_t lookup);
188 190
189extern struct fib6_node *fib6_lookup(struct fib6_node *root, 191extern struct fib6_node *fib6_lookup(struct fib6_node *root,
190 struct in6_addr *daddr, 192 struct in6_addr *daddr,
@@ -194,7 +196,8 @@ struct fib6_node *fib6_locate(struct fib6_node *root,
194 struct in6_addr *daddr, int dst_len, 196 struct in6_addr *daddr, int dst_len,
195 struct in6_addr *saddr, int src_len); 197 struct in6_addr *saddr, int src_len);
196 198
197extern void fib6_clean_all(int (*func)(struct rt6_info *, void *arg), 199extern void fib6_clean_all(struct net *net,
200 int (*func)(struct rt6_info *, void *arg),
198 int prune, void *arg); 201 int prune, void *arg);
199 202
200extern int fib6_add(struct fib6_node *root, 203extern int fib6_add(struct fib6_node *root,
@@ -207,7 +210,8 @@ extern int fib6_del(struct rt6_info *rt,
207extern void inet6_rt_notify(int event, struct rt6_info *rt, 210extern void inet6_rt_notify(int event, struct rt6_info *rt,
208 struct nl_info *info); 211 struct nl_info *info);
209 212
210extern void fib6_run_gc(unsigned long dummy); 213extern void fib6_run_gc(unsigned long expires,
214 struct net *net);
211 215
212extern void fib6_gc_cleanup(void); 216extern void fib6_gc_cleanup(void);
213 217
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index f99e4f0f568f..0e2895c8b270 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -34,22 +34,25 @@ struct route_info {
34#define RT6_LOOKUP_F_REACHABLE 0x2 34#define RT6_LOOKUP_F_REACHABLE 0x2
35#define RT6_LOOKUP_F_HAS_SADDR 0x4 35#define RT6_LOOKUP_F_HAS_SADDR 0x4
36 36
37extern struct rt6_info ip6_null_entry; 37extern struct rt6_info *ip6_null_entry;
38 38
39#ifdef CONFIG_IPV6_MULTIPLE_TABLES 39#ifdef CONFIG_IPV6_MULTIPLE_TABLES
40extern struct rt6_info ip6_prohibit_entry; 40extern struct rt6_info *ip6_prohibit_entry;
41extern struct rt6_info ip6_blk_hole_entry; 41extern struct rt6_info *ip6_blk_hole_entry;
42#endif 42#endif
43 43
44extern void ip6_route_input(struct sk_buff *skb); 44extern void ip6_route_input(struct sk_buff *skb);
45 45
46extern struct dst_entry * ip6_route_output(struct sock *sk, 46extern struct dst_entry * ip6_route_output(struct net *net,
47 struct sock *sk,
47 struct flowi *fl); 48 struct flowi *fl);
48 49
49extern int ip6_route_init(void); 50extern int ip6_route_init(void);
50extern void ip6_route_cleanup(void); 51extern void ip6_route_cleanup(void);
51 52
52extern int ipv6_route_ioctl(unsigned int cmd, void __user *arg); 53extern int ipv6_route_ioctl(struct net *net,
54 unsigned int cmd,
55 void __user *arg);
53 56
54extern int ip6_route_add(struct fib6_config *cfg); 57extern int ip6_route_add(struct fib6_config *cfg);
55extern int ip6_ins_rt(struct rt6_info *); 58extern int ip6_ins_rt(struct rt6_info *);
@@ -69,16 +72,17 @@ extern void rt6_sndmsg(int type, struct in6_addr *dst,
69 int dstlen, int srclen, 72 int dstlen, int srclen,
70 int metric, __u32 flags); 73 int metric, __u32 flags);
71 74
72extern struct rt6_info *rt6_lookup(struct in6_addr *daddr, 75extern struct rt6_info *rt6_lookup(struct net *net,
76 struct in6_addr *daddr,
73 struct in6_addr *saddr, 77 struct in6_addr *saddr,
74 int oif, int flags); 78 int oif, int flags);
75 79
76extern struct dst_entry *ndisc_dst_alloc(struct net_device *dev, 80extern struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
77 struct neighbour *neigh, 81 struct neighbour *neigh,
78 struct in6_addr *addr, 82 struct in6_addr *addr);
79 int (*output)(struct sk_buff *)); 83extern int icmp6_dst_gc(int *more);
80extern int ndisc_dst_gc(int *more); 84
81extern void fib6_force_start_gc(void); 85extern void fib6_force_start_gc(struct net *net);
82 86
83extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev, 87extern struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
84 const struct in6_addr *addr, 88 const struct in6_addr *addr,
@@ -94,7 +98,7 @@ extern struct rt6_info * rt6_add_dflt_router(struct in6_addr *gwaddr,
94 struct net_device *dev, 98 struct net_device *dev,
95 unsigned int pref); 99 unsigned int pref);
96 100
97extern void rt6_purge_dflt_routers(void); 101extern void rt6_purge_dflt_routers(struct net *net);
98 102
99extern int rt6_route_rcv(struct net_device *dev, 103extern int rt6_route_rcv(struct net_device *dev,
100 u8 *opt, int len, 104 u8 *opt, int len,
@@ -121,7 +125,7 @@ struct rt6_rtnl_dump_arg
121}; 125};
122 126
123extern int rt6_dump_route(struct rt6_info *rt, void *p_arg); 127extern int rt6_dump_route(struct rt6_info *rt, void *p_arg);
124extern void rt6_ifdown(struct net_device *dev); 128extern void rt6_ifdown(struct net *net, struct net_device *dev);
125extern void rt6_mtu_change(struct net_device *dev, unsigned mtu); 129extern void rt6_mtu_change(struct net_device *dev, unsigned mtu);
126 130
127extern rwlock_t rt6_lock; 131extern rwlock_t rt6_lock;
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index c0c019f72ba9..e82f1814d96b 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -384,6 +384,16 @@ static inline int ipv6_addr_v4mapped(const struct in6_addr *a)
384} 384}
385 385
386/* 386/*
387 * Check for a RFC 4843 ORCHID address
388 * (Overlay Routable Cryptographic Hash Identifiers)
389 */
390static inline int ipv6_addr_orchid(const struct in6_addr *a)
391{
392 return ((a->s6_addr32[0] & htonl(0xfffffff0))
393 == htonl(0x20010010));
394}
395
396/*
387 * find the first different bit between two addresses 397 * find the first different bit between two addresses
388 * length of address must be a multiple of 32bits 398 * length of address must be a multiple of 32bits
389 */ 399 */
@@ -545,10 +555,6 @@ extern int compat_ipv6_getsockopt(struct sock *sk,
545 char __user *optval, 555 char __user *optval,
546 int __user *optlen); 556 int __user *optlen);
547 557
548extern int ipv6_packet_init(void);
549
550extern void ipv6_packet_cleanup(void);
551
552extern int ip6_datagram_connect(struct sock *sk, 558extern int ip6_datagram_connect(struct sock *sk,
553 struct sockaddr *addr, int addr_len); 559 struct sockaddr *addr, int addr_len);
554 560
@@ -589,10 +595,10 @@ extern int ac6_proc_init(void);
589extern void ac6_proc_exit(void); 595extern void ac6_proc_exit(void);
590extern int raw6_proc_init(void); 596extern int raw6_proc_init(void);
591extern void raw6_proc_exit(void); 597extern void raw6_proc_exit(void);
592extern int tcp6_proc_init(void); 598extern int tcp6_proc_init(struct net *net);
593extern void tcp6_proc_exit(void); 599extern void tcp6_proc_exit(struct net *net);
594extern int udp6_proc_init(void); 600extern int udp6_proc_init(struct net *net);
595extern void udp6_proc_exit(void); 601extern void udp6_proc_exit(struct net *net);
596extern int udplite6_proc_init(void); 602extern int udplite6_proc_init(void);
597extern void udplite6_proc_exit(void); 603extern void udplite6_proc_exit(void);
598extern int ipv6_misc_proc_init(void); 604extern int ipv6_misc_proc_init(void);
@@ -600,7 +606,6 @@ extern void ipv6_misc_proc_exit(void);
600extern int snmp6_register_dev(struct inet6_dev *idev); 606extern int snmp6_register_dev(struct inet6_dev *idev);
601extern int snmp6_unregister_dev(struct inet6_dev *idev); 607extern int snmp6_unregister_dev(struct inet6_dev *idev);
602 608
603extern struct rt6_statistics rt6_stats;
604#else 609#else
605static inline int snmp6_register_dev(struct inet6_dev *idev) 610static inline int snmp6_register_dev(struct inet6_dev *idev)
606{ 611{
diff --git a/include/net/llc_if.h b/include/net/llc_if.h
index c608812a8e89..b595a004d31b 100644
--- a/include/net/llc_if.h
+++ b/include/net/llc_if.h
@@ -74,11 +74,6 @@ static inline int llc_mac_null(const u8 *mac)
74 return is_zero_ether_addr(mac); 74 return is_zero_ether_addr(mac);
75} 75}
76 76
77static inline int llc_addrany(const struct llc_addr *addr)
78{
79 return llc_mac_null(addr->mac) && !addr->lsap;
80}
81
82static inline int llc_mac_multicast(const u8 *mac) 77static inline int llc_mac_multicast(const u8 *mac)
83{ 78{
84 return is_multicast_ether_addr(mac); 79 return is_multicast_ether_addr(mac);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9083bafb63ca..5ab6a350ee6d 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -38,7 +38,11 @@
38 * called in hardware interrupt context. The low-level driver must not call any 38 * called in hardware interrupt context. The low-level driver must not call any
39 * other functions in hardware interrupt context. If there is a need for such 39 * other functions in hardware interrupt context. If there is a need for such
40 * call, the low-level driver should first ACK the interrupt and perform the 40 * call, the low-level driver should first ACK the interrupt and perform the
41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue function. 41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even
42 * tasklet function.
43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
45 * use the non-irqsafe functions!
42 */ 46 */
43 47
44/** 48/**
@@ -69,95 +73,6 @@
69 * not do so then mac80211 may add this under certain circumstances. 73 * not do so then mac80211 may add this under certain circumstances.
70 */ 74 */
71 75
72#define IEEE80211_CHAN_W_SCAN 0x00000001
73#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x00000002
74#define IEEE80211_CHAN_W_IBSS 0x00000004
75
76/* Channel information structure. Low-level driver is expected to fill in chan,
77 * freq, and val fields. Other fields will be filled in by 80211.o based on
78 * hostapd information and low-level driver does not need to use them. The
79 * limits for each channel will be provided in 'struct ieee80211_conf' when
80 * configuring the low-level driver with hw->config callback. If a device has
81 * a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED
82 * can be set to let the driver configure all fields */
83struct ieee80211_channel {
84 short chan; /* channel number (IEEE 802.11) */
85 short freq; /* frequency in MHz */
86 int val; /* hw specific value for the channel */
87 int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
88 unsigned char power_level;
89 unsigned char antenna_max;
90};
91
92#define IEEE80211_RATE_ERP 0x00000001
93#define IEEE80211_RATE_BASIC 0x00000002
94#define IEEE80211_RATE_PREAMBLE2 0x00000004
95#define IEEE80211_RATE_SUPPORTED 0x00000010
96#define IEEE80211_RATE_OFDM 0x00000020
97#define IEEE80211_RATE_CCK 0x00000040
98#define IEEE80211_RATE_MANDATORY 0x00000100
99
100#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
101#define IEEE80211_RATE_MODULATION(f) \
102 (f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
103
104/* Low-level driver should set PREAMBLE2, OFDM and CCK flags.
105 * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
106 * configuration. */
107struct ieee80211_rate {
108 int rate; /* rate in 100 kbps */
109 int val; /* hw specific value for the rate */
110 int flags; /* IEEE80211_RATE_ flags */
111 int val2; /* hw specific value for the rate when using short preamble
112 * (only when IEEE80211_RATE_PREAMBLE2 flag is set, i.e., for
113 * 2, 5.5, and 11 Mbps) */
114 signed char min_rssi_ack;
115 unsigned char min_rssi_ack_delta;
116
117 /* following fields are set by 80211.o and need not be filled by the
118 * low-level driver */
119 int rate_inv; /* inverse of the rate (LCM(all rates) / rate) for
120 * optimizing channel utilization estimates */
121};
122
123/**
124 * enum ieee80211_phymode - PHY modes
125 *
126 * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
127 * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
128 * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
129 * backwards compatible with 11b mode
130 * @NUM_IEEE80211_MODES: internal
131 */
132enum ieee80211_phymode {
133 MODE_IEEE80211A,
134 MODE_IEEE80211B,
135 MODE_IEEE80211G,
136
137 /* keep last */
138 NUM_IEEE80211_MODES
139};
140
141/**
142 * struct ieee80211_ht_info - describing STA's HT capabilities
143 *
144 * This structure describes most essential parameters needed
145 * to describe 802.11n HT capabilities for an STA.
146 *
147 * @ht_supported: is HT supported by STA, 0: no, 1: yes
148 * @cap: HT capabilities map as described in 802.11n spec
149 * @ampdu_factor: Maximum A-MPDU length factor
150 * @ampdu_density: Minimum A-MPDU spacing
151 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
152 */
153struct ieee80211_ht_info {
154 u8 ht_supported;
155 u16 cap; /* use IEEE80211_HT_CAP_ */
156 u8 ampdu_factor;
157 u8 ampdu_density;
158 u8 supp_mcs_set[16];
159};
160
161/** 76/**
162 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics 77 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
163 * 78 *
@@ -175,46 +90,22 @@ struct ieee80211_ht_bss_info {
175}; 90};
176 91
177/** 92/**
178 * struct ieee80211_hw_mode - PHY mode definition
179 *
180 * This structure describes the capabilities supported by the device
181 * in a single PHY mode.
182 *
183 * @list: internal
184 * @channels: pointer to array of supported channels
185 * @rates: pointer to array of supported bitrates
186 * @mode: the PHY mode for this definition
187 * @num_channels: number of supported channels
188 * @num_rates: number of supported bitrates
189 * @ht_info: PHY's 802.11n HT abilities for this mode
190 */
191struct ieee80211_hw_mode {
192 struct list_head list;
193 struct ieee80211_channel *channels;
194 struct ieee80211_rate *rates;
195 enum ieee80211_phymode mode;
196 int num_channels;
197 int num_rates;
198 struct ieee80211_ht_info ht_info;
199};
200
201/**
202 * struct ieee80211_tx_queue_params - transmit queue configuration 93 * struct ieee80211_tx_queue_params - transmit queue configuration
203 * 94 *
204 * The information provided in this structure is required for QoS 95 * The information provided in this structure is required for QoS
205 * transmit queue configuration. 96 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
206 * 97 *
207 * @aifs: arbitration interface space [0..255, -1: use default] 98 * @aifs: arbitration interface space [0..255, -1: use default]
208 * @cw_min: minimum contention window [will be a value of the form 99 * @cw_min: minimum contention window [will be a value of the form
209 * 2^n-1 in the range 1..1023; 0: use default] 100 * 2^n-1 in the range 1..1023; 0: use default]
210 * @cw_max: maximum contention window [like @cw_min] 101 * @cw_max: maximum contention window [like @cw_min]
211 * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled 102 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
212 */ 103 */
213struct ieee80211_tx_queue_params { 104struct ieee80211_tx_queue_params {
214 int aifs; 105 s16 aifs;
215 int cw_min; 106 u16 cw_min;
216 int cw_max; 107 u16 cw_max;
217 int burst_time; 108 u16 txop;
218}; 109};
219 110
220/** 111/**
@@ -246,6 +137,7 @@ struct ieee80211_tx_queue_stats_data {
246 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be 137 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
247 * sent after a beacon 138 * sent after a beacon
248 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames 139 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
140 * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
249 */ 141 */
250enum ieee80211_tx_queue { 142enum ieee80211_tx_queue {
251 IEEE80211_TX_QUEUE_DATA0, 143 IEEE80211_TX_QUEUE_DATA0,
@@ -261,11 +153,12 @@ enum ieee80211_tx_queue {
261 * this struct need to have fixed values. As soon as it is removed, we can 153 * this struct need to have fixed values. As soon as it is removed, we can
262 * fix these entries. */ 154 * fix these entries. */
263 IEEE80211_TX_QUEUE_AFTER_BEACON = 6, 155 IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
264 IEEE80211_TX_QUEUE_BEACON = 7 156 IEEE80211_TX_QUEUE_BEACON = 7,
157 NUM_TX_DATA_QUEUES_AMPDU = 16
265}; 158};
266 159
267struct ieee80211_tx_queue_stats { 160struct ieee80211_tx_queue_stats {
268 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES]; 161 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
269}; 162};
270 163
271struct ieee80211_low_level_stats { 164struct ieee80211_low_level_stats {
@@ -312,63 +205,88 @@ struct ieee80211_bss_conf {
312 bool use_short_preamble; 205 bool use_short_preamble;
313}; 206};
314 207
208/**
209 * enum mac80211_tx_control_flags - flags to describe Tx configuration for
210 * the Tx frame
211 *
212 * These flags are used with the @flags member of &ieee80211_tx_control
213 *
214 * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame.
215 * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption;
216 * e.g., for EAPOL frame
217 * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame
218 * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g.,
219 * for combined 802.11g / 802.11b networks)
220 * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack
221 * @IEEE80211_TXCTL_RATE_CTRL_PROBE
222 * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter
223 * for destination station
224 * @IEEE80211_TXCTL_REQUEUE:
225 * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame
226 * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the
227 * through set_retry_limit configured long
228 * retry value
229 * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211
230 * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
231 * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU
232 * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number
233 * of streams when this flag is on can be extracted
234 * from antenna_sel_tx, so if 1 antenna is marked
235 * use SISO, 2 antennas marked use MIMO, n antennas
236 * marked use MIMO_n.
237 * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame
238 * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
239 * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
240 * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval
241 */
242enum mac80211_tx_control_flags {
243 IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0),
244 IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1),
245 IEEE80211_TXCTL_USE_RTS_CTS = (1<<2),
246 IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3),
247 IEEE80211_TXCTL_NO_ACK = (1<<4),
248 IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5),
249 IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6),
250 IEEE80211_TXCTL_REQUEUE = (1<<7),
251 IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8),
252 IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9),
253 IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10),
254 IEEE80211_TXCTL_EAPOL_FRAME = (1<<11),
255 IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12),
256 IEEE80211_TXCTL_AMPDU = (1<<13),
257 IEEE80211_TXCTL_OFDM_HT = (1<<14),
258 IEEE80211_TXCTL_GREEN_FIELD = (1<<15),
259 IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16),
260 IEEE80211_TXCTL_DUP_DATA = (1<<17),
261 IEEE80211_TXCTL_SHORT_GI = (1<<18),
262};
263
315/* Transmit control fields. This data structure is passed to low-level driver 264/* Transmit control fields. This data structure is passed to low-level driver
316 * with each TX frame. The low-level driver is responsible for configuring 265 * with each TX frame. The low-level driver is responsible for configuring
317 * the hardware to use given values (depending on what is supported). */ 266 * the hardware to use given values (depending on what is supported). */
318 267
319struct ieee80211_tx_control { 268struct ieee80211_tx_control {
320 struct ieee80211_vif *vif; 269 struct ieee80211_vif *vif;
321 int tx_rate; /* Transmit rate, given as the hw specific value for the 270 struct ieee80211_rate *tx_rate;
322 * rate (from struct ieee80211_rate) */ 271
323 int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw 272 /* Transmit rate for RTS/CTS frame */
324 * specific value for the rate (from 273 struct ieee80211_rate *rts_cts_rate;
325 * struct ieee80211_rate) */ 274
326 275 /* retry rate for the last retries */
327#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for 276 struct ieee80211_rate *alt_retry_rate;
328 * this frame */ 277
329#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (1<<1) /* send this frame without 278 u32 flags; /* tx control flags defined above */
330 * encryption; e.g., for EAPOL
331 * frames */
332#define IEEE80211_TXCTL_USE_RTS_CTS (1<<2) /* use RTS-CTS before sending
333 * frame */
334#define IEEE80211_TXCTL_USE_CTS_PROTECT (1<<3) /* use CTS protection for the
335 * frame (e.g., for combined
336 * 802.11g / 802.11b networks) */
337#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to
338 * wait for an ack */
339#define IEEE80211_TXCTL_RATE_CTRL_PROBE (1<<5)
340#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6)
341#define IEEE80211_TXCTL_REQUEUE (1<<7)
342#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of
343 * the frame */
344#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send
345 * using the through
346 * set_retry_limit configured
347 * long retry value */
348#define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */
349#define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM
350 * beacon */
351 u32 flags; /* tx control flags defined
352 * above */
353 u8 key_idx; /* keyidx from hw->set_key(), undefined if 279 u8 key_idx; /* keyidx from hw->set_key(), undefined if
354 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ 280 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */
355 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 281 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, ..
356 * This could be used when set_retry_limit 282 * This could be used when set_retry_limit
357 * is not implemented by the driver */ 283 * is not implemented by the driver */
358 u8 power_level; /* per-packet transmit power level, in dBm */ 284 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit
359 u8 antenna_sel_tx; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ 285 * position represents antenna number used */
360 u8 icv_len; /* length of the ICV/MIC field in octets */ 286 u8 icv_len; /* length of the ICV/MIC field in octets */
361 u8 iv_len; /* length of the IV field in octets */ 287 u8 iv_len; /* length of the IV field in octets */
362 u8 queue; /* hardware queue to use for this frame; 288 u8 queue; /* hardware queue to use for this frame;
363 * 0 = highest, hw->queues-1 = lowest */ 289 * 0 = highest, hw->queues-1 = lowest */
364 struct ieee80211_rate *rate; /* internal 80211.o rate */
365 struct ieee80211_rate *rts_rate; /* internal 80211.o rate
366 * for RTS/CTS */
367 int alt_retry_rate; /* retry rate for the last retries, given as the
368 * hw specific value for the rate (from
369 * struct ieee80211_rate). To be used to limit
370 * packet dropping when probing higher rates, if hw
371 * supports multiple retry rates. -1 = not used */
372 int type; /* internal */ 290 int type; /* internal */
373}; 291};
374 292
@@ -391,7 +309,8 @@ struct ieee80211_tx_control {
391 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on 309 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
392 * the frame. 310 * the frame.
393 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) 311 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field)
394 * is valid. 312 * is valid. This is useful in monitor mode and necessary for beacon frames
313 * to enable IBSS merging.
395 */ 314 */
396enum mac80211_rx_flags { 315enum mac80211_rx_flags {
397 RX_FLAG_MMIC_ERROR = 1<<0, 316 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -410,27 +329,26 @@ enum mac80211_rx_flags {
410 * The low-level driver should provide this information (the subset 329 * The low-level driver should provide this information (the subset
411 * supported by hardware) to the 802.11 code with each received 330 * supported by hardware) to the 802.11 code with each received
412 * frame. 331 * frame.
413 * @mactime: MAC timestamp as defined by 802.11 332 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
333 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
334 * @band: the active band when this frame was received
414 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 335 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
415 * @channel: channel the radio was tuned to
416 * @phymode: active PHY mode
417 * @ssi: signal strength when receiving this frame 336 * @ssi: signal strength when receiving this frame
418 * @signal: used as 'qual' in statistics reporting 337 * @signal: used as 'qual' in statistics reporting
419 * @noise: PHY noise when receiving this frame 338 * @noise: PHY noise when receiving this frame
420 * @antenna: antenna used 339 * @antenna: antenna used
421 * @rate: data rate 340 * @rate_idx: index of data rate into band's supported rates
422 * @flag: %RX_FLAG_* 341 * @flag: %RX_FLAG_*
423 */ 342 */
424struct ieee80211_rx_status { 343struct ieee80211_rx_status {
425 u64 mactime; 344 u64 mactime;
345 enum ieee80211_band band;
426 int freq; 346 int freq;
427 int channel;
428 enum ieee80211_phymode phymode;
429 int ssi; 347 int ssi;
430 int signal; 348 int signal;
431 int noise; 349 int noise;
432 int antenna; 350 int antenna;
433 int rate; 351 int rate_idx;
434 int flag; 352 int flag;
435}; 353};
436 354
@@ -441,12 +359,14 @@ struct ieee80211_rx_status {
441 * 359 *
442 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted 360 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
443 * because the destination STA was in powersave mode. 361 * because the destination STA was in powersave mode.
444 *
445 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged 362 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
363 * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status
364 * is for the whole aggregation.
446 */ 365 */
447enum ieee80211_tx_status_flags { 366enum ieee80211_tx_status_flags {
448 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, 367 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
449 IEEE80211_TX_STATUS_ACK = 1<<1, 368 IEEE80211_TX_STATUS_ACK = 1<<1,
369 IEEE80211_TX_STATUS_AMPDU = 1<<2,
450}; 370};
451 371
452/** 372/**
@@ -457,24 +377,25 @@ enum ieee80211_tx_status_flags {
457 * 377 *
458 * @control: a copy of the &struct ieee80211_tx_control passed to the driver 378 * @control: a copy of the &struct ieee80211_tx_control passed to the driver
459 * in the tx() callback. 379 * in the tx() callback.
460 *
461 * @flags: transmit status flags, defined above 380 * @flags: transmit status flags, defined above
462 * 381 * @retry_count: number of retries
463 * @ack_signal: signal strength of the ACK frame
464 *
465 * @excessive_retries: set to 1 if the frame was retried many times 382 * @excessive_retries: set to 1 if the frame was retried many times
466 * but not acknowledged 383 * but not acknowledged
467 * 384 * @ampdu_ack_len: number of aggregated frames.
468 * @retry_count: number of retries 385 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
469 * 386 * @ampdu_ack_map: block ack bit map for the aggregation.
387 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
388 * @ack_signal: signal strength of the ACK frame
470 * @queue_length: ?? REMOVE 389 * @queue_length: ?? REMOVE
471 * @queue_number: ?? REMOVE 390 * @queue_number: ?? REMOVE
472 */ 391 */
473struct ieee80211_tx_status { 392struct ieee80211_tx_status {
474 struct ieee80211_tx_control control; 393 struct ieee80211_tx_control control;
475 u8 flags; 394 u8 flags;
476 bool excessive_retries;
477 u8 retry_count; 395 u8 retry_count;
396 bool excessive_retries;
397 u8 ampdu_ack_len;
398 u64 ampdu_ack_map;
478 int ack_signal; 399 int ack_signal;
479 int queue_length; 400 int queue_length;
480 int queue_number; 401 int queue_number;
@@ -502,41 +423,29 @@ enum ieee80211_conf_flags {
502 * 423 *
503 * @radio_enabled: when zero, driver is required to switch off the radio. 424 * @radio_enabled: when zero, driver is required to switch off the radio.
504 * TODO make a flag 425 * TODO make a flag
505 * @channel: IEEE 802.11 channel number
506 * @freq: frequency in MHz
507 * @channel_val: hardware specific channel value for the channel
508 * @phymode: PHY mode to activate (REMOVE)
509 * @chan: channel to switch to, pointer to the channel information
510 * @mode: pointer to mode definition
511 * @regulatory_domain: ??
512 * @beacon_int: beacon interval (TODO make interface config) 426 * @beacon_int: beacon interval (TODO make interface config)
513 * @flags: configuration flags defined above 427 * @flags: configuration flags defined above
514 * @power_level: transmit power limit for current regulatory domain in dBm 428 * @power_level: requested transmit power (in dBm)
515 * @antenna_max: maximum antenna gain 429 * @max_antenna_gain: maximum antenna gain (in dBi)
516 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, 430 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
517 * 1/2: antenna 0/1 431 * 1/2: antenna 0/1
518 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx 432 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
519 * @ht_conf: describes current self configuration of 802.11n HT capabilies 433 * @ht_conf: describes current self configuration of 802.11n HT capabilies
520 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters 434 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
435 * @channel: the channel to tune to
521 */ 436 */
522struct ieee80211_conf { 437struct ieee80211_conf {
523 int channel; /* IEEE 802.11 channel number */
524 int freq; /* MHz */
525 int channel_val; /* hw specific value for the channel */
526
527 enum ieee80211_phymode phymode;
528 struct ieee80211_channel *chan;
529 struct ieee80211_hw_mode *mode;
530 unsigned int regulatory_domain;
531 int radio_enabled; 438 int radio_enabled;
532 439
533 int beacon_int; 440 int beacon_int;
534 u32 flags; 441 u32 flags;
535 u8 power_level; 442 int power_level;
536 u8 antenna_max; 443 int max_antenna_gain;
537 u8 antenna_sel_tx; 444 u8 antenna_sel_tx;
538 u8 antenna_sel_rx; 445 u8 antenna_sel_rx;
539 446
447 struct ieee80211_channel *channel;
448
540 struct ieee80211_ht_info ht_conf; 449 struct ieee80211_ht_info ht_conf;
541 struct ieee80211_ht_bss_info ht_bss_conf; 450 struct ieee80211_ht_bss_info ht_bss_conf;
542}; 451};
@@ -555,12 +464,14 @@ struct ieee80211_conf {
555 * @IEEE80211_IF_TYPE_WDS: interface in WDS mode. 464 * @IEEE80211_IF_TYPE_WDS: interface in WDS mode.
556 * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers 465 * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers
557 * will never see this type. 466 * will never see this type.
467 * @IEEE80211_IF_TYPE_MESH_POINT: 802.11s mesh point
558 */ 468 */
559enum ieee80211_if_types { 469enum ieee80211_if_types {
560 IEEE80211_IF_TYPE_INVALID, 470 IEEE80211_IF_TYPE_INVALID,
561 IEEE80211_IF_TYPE_AP, 471 IEEE80211_IF_TYPE_AP,
562 IEEE80211_IF_TYPE_STA, 472 IEEE80211_IF_TYPE_STA,
563 IEEE80211_IF_TYPE_IBSS, 473 IEEE80211_IF_TYPE_IBSS,
474 IEEE80211_IF_TYPE_MESH_POINT,
564 IEEE80211_IF_TYPE_MNTR, 475 IEEE80211_IF_TYPE_MNTR,
565 IEEE80211_IF_TYPE_WDS, 476 IEEE80211_IF_TYPE_WDS,
566 IEEE80211_IF_TYPE_VLAN, 477 IEEE80211_IF_TYPE_VLAN,
@@ -582,6 +493,14 @@ struct ieee80211_vif {
582 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 493 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
583}; 494};
584 495
496static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
497{
498#ifdef CONFIG_MAC80211_MESH
499 return vif->type == IEEE80211_IF_TYPE_MESH_POINT;
500#endif
501 return false;
502}
503
585/** 504/**
586 * struct ieee80211_if_init_conf - initial configuration of an interface 505 * struct ieee80211_if_init_conf - initial configuration of an interface
587 * 506 *
@@ -757,15 +676,19 @@ enum sta_notify_cmd {
757 * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because 676 * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because
758 * otherwise the stack will not know when the DTIM beacon was sent. 677 * otherwise the stack will not know when the DTIM beacon was sent.
759 * 678 *
760 * @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED: 679 * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE:
761 * Channels are already configured to the default regulatory domain 680 * Hardware is not capable of short slot operation on the 2.4 GHz band.
762 * specified in the device's EEPROM 681 *
682 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
683 * Hardware is not capable of receiving frames with short preamble on
684 * the 2.4 GHz band.
763 */ 685 */
764enum ieee80211_hw_flags { 686enum ieee80211_hw_flags {
765 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 687 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
766 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 688 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
767 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 689 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
768 IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<3, 690 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
691 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
769}; 692};
770 693
771/** 694/**
@@ -777,7 +700,8 @@ enum ieee80211_hw_flags {
777 * @wiphy: This points to the &struct wiphy allocated for this 700 * @wiphy: This points to the &struct wiphy allocated for this
778 * 802.11 PHY. You must fill in the @perm_addr and @dev 701 * 802.11 PHY. You must fill in the @perm_addr and @dev
779 * members of this structure using SET_IEEE80211_DEV() 702 * members of this structure using SET_IEEE80211_DEV()
780 * and SET_IEEE80211_PERM_ADDR(). 703 * and SET_IEEE80211_PERM_ADDR(). Additionally, all supported
704 * bands (with channels, bitrates) are registered here.
781 * 705 *
782 * @conf: &struct ieee80211_conf, device configuration, don't use. 706 * @conf: &struct ieee80211_conf, device configuration, don't use.
783 * 707 *
@@ -913,8 +837,18 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
913 * parameter to see whether multicast frames should be accepted 837 * parameter to see whether multicast frames should be accepted
914 * or dropped. 838 * or dropped.
915 * 839 *
916 * All unsupported flags in @total_flags must be cleared, i.e. you 840 * All unsupported flags in @total_flags must be cleared.
917 * should clear all bits except those you honoured. 841 * Hardware does not support a flag if it is incapable of _passing_
842 * the frame to the stack. Otherwise the driver must ignore
843 * the flag, but not clear it.
844 * You must _only_ clear the flag (announce no support for the
845 * flag to mac80211) if you are not able to pass the packet type
846 * to the stack (so the hardware always filters it).
847 * So for example, you should clear @FIF_CONTROL, if your hardware
848 * always filters control frames. If your hardware always passes
849 * control frames to the kernel and is incapable of filtering them,
850 * you do _not_ clear the @FIF_CONTROL flag.
851 * This rule applies to all other FIF flags as well.
918 */ 852 */
919 853
920/** 854/**
@@ -967,10 +901,14 @@ enum ieee80211_filter_flags {
967 * &struct ieee80211_ops to indicate which action is needed. 901 * &struct ieee80211_ops to indicate which action is needed.
968 * @IEEE80211_AMPDU_RX_START: start Rx aggregation 902 * @IEEE80211_AMPDU_RX_START: start Rx aggregation
969 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 903 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
904 * @IEEE80211_AMPDU_TX_START: start Tx aggregation
905 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
970 */ 906 */
971enum ieee80211_ampdu_mlme_action { 907enum ieee80211_ampdu_mlme_action {
972 IEEE80211_AMPDU_RX_START, 908 IEEE80211_AMPDU_RX_START,
973 IEEE80211_AMPDU_RX_STOP, 909 IEEE80211_AMPDU_RX_STOP,
910 IEEE80211_AMPDU_TX_START,
911 IEEE80211_AMPDU_TX_STOP,
974}; 912};
975 913
976/** 914/**
@@ -1051,7 +989,9 @@ enum ieee80211_ampdu_mlme_action {
1051 * given local_address is enabled. 989 * given local_address is enabled.
1052 * 990 *
1053 * @hw_scan: Ask the hardware to service the scan request, no need to start 991 * @hw_scan: Ask the hardware to service the scan request, no need to start
1054 * the scan state machine in stack. 992 * the scan state machine in stack. The scan must honour the channel
993 * configuration done by the regulatory agent in the wiphy's registered
994 * bands.
1055 * 995 *
1056 * @get_stats: return low-level statistics 996 * @get_stats: return low-level statistics
1057 * 997 *
@@ -1111,7 +1051,8 @@ enum ieee80211_ampdu_mlme_action {
1111 * The RA/TID combination determines the destination and TID we want 1051 * The RA/TID combination determines the destination and TID we want
1112 * the ampdu action to be performed for. The action is defined through 1052 * the ampdu action to be performed for. The action is defined through
1113 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) 1053 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
1114 * is the first frame we expect to perform the action on. 1054 * is the first frame we expect to perform the action on. notice
1055 * that TX/RX_STOP can pass NULL for this parameter.
1115 */ 1056 */
1116struct ieee80211_ops { 1057struct ieee80211_ops {
1117 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1058 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
@@ -1162,7 +1103,7 @@ struct ieee80211_ops {
1162 int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1103 int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
1163 int (*ampdu_action)(struct ieee80211_hw *hw, 1104 int (*ampdu_action)(struct ieee80211_hw *hw,
1164 enum ieee80211_ampdu_mlme_action action, 1105 enum ieee80211_ampdu_mlme_action action,
1165 const u8 *ra, u16 tid, u16 ssn); 1106 const u8 *addr, u16 tid, u16 *ssn);
1166}; 1107};
1167 1108
1168/** 1109/**
@@ -1183,8 +1124,9 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
1183/** 1124/**
1184 * ieee80211_register_hw - Register hardware device 1125 * ieee80211_register_hw - Register hardware device
1185 * 1126 *
1186 * You must call this function before any other functions 1127 * You must call this function before any other functions in
1187 * except ieee80211_register_hwmode. 1128 * mac80211. Note that before a hardware can be registered, you
1129 * need to fill the contained wiphy's information.
1188 * 1130 *
1189 * @hw: the device to register as returned by ieee80211_alloc_hw() 1131 * @hw: the device to register as returned by ieee80211_alloc_hw()
1190 */ 1132 */
@@ -1272,10 +1214,6 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
1272#endif 1214#endif
1273} 1215}
1274 1216
1275/* Register a new hardware PHYMODE capability to the stack. */
1276int ieee80211_register_hwmode(struct ieee80211_hw *hw,
1277 struct ieee80211_hw_mode *mode);
1278
1279/** 1217/**
1280 * ieee80211_unregister_hw - Unregister a hardware device 1218 * ieee80211_unregister_hw - Unregister a hardware device
1281 * 1219 *
@@ -1308,7 +1246,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1308 * buffer in @skb must start with an IEEE 802.11 header or a radiotap 1246 * buffer in @skb must start with an IEEE 802.11 header or a radiotap
1309 * header if %RX_FLAG_RADIOTAP is set in the @status flags. 1247 * header if %RX_FLAG_RADIOTAP is set in the @status flags.
1310 * 1248 *
1311 * This function may not be called in IRQ context. 1249 * This function may not be called in IRQ context. Calls to this function
1250 * for a single hardware must be synchronized against each other. Calls
1251 * to this function and ieee80211_rx_irqsafe() may not be mixed for a
1252 * single hardware.
1312 * 1253 *
1313 * @hw: the hardware this frame came in on 1254 * @hw: the hardware this frame came in on
1314 * @skb: the buffer to receive, owned by mac80211 after this call 1255 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1325,7 +1266,10 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1325 * ieee80211_rx_irqsafe - receive frame 1266 * ieee80211_rx_irqsafe - receive frame
1326 * 1267 *
1327 * Like ieee80211_rx() but can be called in IRQ context 1268 * Like ieee80211_rx() but can be called in IRQ context
1328 * (internally defers to a workqueue.) 1269 * (internally defers to a tasklet.)
1270 *
1271 * Calls to this function and ieee80211_rx() may not be mixed for a
1272 * single hardware.
1329 * 1273 *
1330 * @hw: the hardware this frame came in on 1274 * @hw: the hardware this frame came in on
1331 * @skb: the buffer to receive, owned by mac80211 after this call 1275 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1344,6 +1288,11 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1344 * transmitted. It is permissible to not call this function for 1288 * transmitted. It is permissible to not call this function for
1345 * multicast frames but this can affect statistics. 1289 * multicast frames but this can affect statistics.
1346 * 1290 *
1291 * This function may not be called in IRQ context. Calls to this function
1292 * for a single hardware must be synchronized against each other. Calls
1293 * to this function and ieee80211_tx_status_irqsafe() may not be mixed
1294 * for a single hardware.
1295 *
1347 * @hw: the hardware the frame was transmitted by 1296 * @hw: the hardware the frame was transmitted by
1348 * @skb: the frame that was transmitted, owned by mac80211 after this call 1297 * @skb: the frame that was transmitted, owned by mac80211 after this call
1349 * @status: status information for this frame; the status pointer need not 1298 * @status: status information for this frame; the status pointer need not
@@ -1353,6 +1302,22 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1353void ieee80211_tx_status(struct ieee80211_hw *hw, 1302void ieee80211_tx_status(struct ieee80211_hw *hw,
1354 struct sk_buff *skb, 1303 struct sk_buff *skb,
1355 struct ieee80211_tx_status *status); 1304 struct ieee80211_tx_status *status);
1305
1306/**
1307 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback
1308 *
1309 * Like ieee80211_tx_status() but can be called in IRQ context
1310 * (internally defers to a tasklet.)
1311 *
1312 * Calls to this function and ieee80211_tx_status() may not be mixed for a
1313 * single hardware.
1314 *
1315 * @hw: the hardware the frame was transmitted by
1316 * @skb: the frame that was transmitted, owned by mac80211 after this call
1317 * @status: status information for this frame; the status pointer need not
1318 * be valid after this function returns and is not freed by mac80211,
1319 * it is recommended that it points to a stack area
1320 */
1356void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, 1321void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1357 struct sk_buff *skb, 1322 struct sk_buff *skb,
1358 struct ieee80211_tx_status *status); 1323 struct ieee80211_tx_status *status);
@@ -1449,7 +1414,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1449 * @hw: pointer obtained from ieee80211_alloc_hw(). 1414 * @hw: pointer obtained from ieee80211_alloc_hw().
1450 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1415 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1451 * @frame_len: the length of the frame. 1416 * @frame_len: the length of the frame.
1452 * @rate: the rate (in 100kbps) at which the frame is going to be transmitted. 1417 * @rate: the rate at which the frame is going to be transmitted.
1453 * 1418 *
1454 * Calculate the duration field of some generic frame, given its 1419 * Calculate the duration field of some generic frame, given its
1455 * length and transmission rate (in 100kbps). 1420 * length and transmission rate (in 100kbps).
@@ -1457,7 +1422,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1457__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, 1422__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1458 struct ieee80211_vif *vif, 1423 struct ieee80211_vif *vif,
1459 size_t frame_len, 1424 size_t frame_len,
1460 int rate); 1425 struct ieee80211_rate *rate);
1461 1426
1462/** 1427/**
1463 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 1428 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
@@ -1574,4 +1539,81 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
1574 struct ieee80211_vif *vif), 1539 struct ieee80211_vif *vif),
1575 void *data); 1540 void *data);
1576 1541
1542/**
1543 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
1544 * @hw: pointer as obtained from ieee80211_alloc_hw().
1545 * @ra: receiver address of the BA session recipient
1546 * @tid: the TID to BA on.
1547 * @return: success if addBA request was sent, failure otherwise
1548 *
1549 * Although mac80211/low level driver/user space application can estimate
1550 * the need to start aggregation on a certain RA/TID, the session level
1551 * will be managed by the mac80211.
1552 */
1553int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1554
1555/**
1556 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
1557 * @hw: pointer as obtained from ieee80211_alloc_hw().
1558 * @ra: receiver address of the BA session recipient.
1559 * @tid: the TID to BA on.
1560 *
1561 * This function must be called by low level driver once it has
1562 * finished with preparations for the BA session.
1563 */
1564void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1565
1566/**
1567 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
1568 * @hw: pointer as obtained from ieee80211_alloc_hw().
1569 * @ra: receiver address of the BA session recipient.
1570 * @tid: the TID to BA on.
1571 *
1572 * This function must be called by low level driver once it has
1573 * finished with preparations for the BA session.
1574 * This version of the function is irq safe.
1575 */
1576void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1577 u16 tid);
1578
1579/**
1580 * ieee80211_stop_tx_ba_session - Stop a Block Ack session.
1581 * @hw: pointer as obtained from ieee80211_alloc_hw().
1582 * @ra: receiver address of the BA session recipient
1583 * @tid: the TID to stop BA.
1584 * @initiator: if indicates initiator DELBA frame will be sent.
1585 * @return: error if no sta with matching da found, success otherwise
1586 *
1587 * Although mac80211/low level driver/user space application can estimate
1588 * the need to stop aggregation on a certain RA/TID, the session level
1589 * will be managed by the mac80211.
1590 */
1591int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
1592 u8 *ra, u16 tid,
1593 enum ieee80211_back_parties initiator);
1594
1595/**
1596 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
1597 * @hw: pointer as obtained from ieee80211_alloc_hw().
1598 * @ra: receiver address of the BA session recipient.
1599 * @tid: the desired TID to BA on.
1600 *
1601 * This function must be called by low level driver once it has
1602 * finished with preparations for the BA session tear down.
1603 */
1604void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
1605
1606/**
1607 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
1608 * @hw: pointer as obtained from ieee80211_alloc_hw().
1609 * @ra: receiver address of the BA session recipient.
1610 * @tid: the desired TID to BA on.
1611 *
1612 * This function must be called by low level driver once it has
1613 * finished with preparations for the BA session tear down.
1614 * This version of the function is irq safe.
1615 */
1616void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1617 u16 tid);
1618
1577#endif /* MAC80211_H */ 1619#endif /* MAC80211_H */
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 59b70624b056..5aedf324de66 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -77,7 +77,7 @@ struct nd_opt_hdr {
77} __attribute__((__packed__)); 77} __attribute__((__packed__));
78 78
79 79
80extern int ndisc_init(struct net_proto_family *ops); 80extern int ndisc_init(void);
81 81
82extern void ndisc_cleanup(void); 82extern void ndisc_cleanup(void);
83 83
@@ -107,7 +107,7 @@ extern int ndisc_mc_map(struct in6_addr *addr, char *buf, struct net_device *d
107/* 107/*
108 * IGMP 108 * IGMP
109 */ 109 */
110extern int igmp6_init(struct net_proto_family *ops); 110extern int igmp6_init(void);
111 111
112extern void igmp6_cleanup(void); 112extern void igmp6_cleanup(void);
113 113
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index ebbfb509822e..062281872064 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -284,12 +284,6 @@ static inline void neigh_confirm(struct neighbour *neigh)
284 neigh->confirmed = jiffies; 284 neigh->confirmed = jiffies;
285} 285}
286 286
287static inline int neigh_is_connected(struct neighbour *neigh)
288{
289 return neigh->nud_state&NUD_CONNECTED;
290}
291
292
293static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) 287static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
294{ 288{
295 neigh->used = jiffies; 289 neigh->used = jiffies;
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index a9b4f6086294..504fde174525 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -26,6 +26,8 @@ struct netns_ipv4 {
26 struct hlist_head *fib_table_hash; 26 struct hlist_head *fib_table_hash;
27 struct sock *fibnl; 27 struct sock *fibnl;
28 28
29 struct sock **icmp_sk;
30
29 struct netns_frags frags; 31 struct netns_frags frags;
30#ifdef CONFIG_NETFILTER 32#ifdef CONFIG_NETFILTER
31 struct xt_table *iptable_filter; 33 struct xt_table *iptable_filter;
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index 1dd7de4e4195..ac053be6c256 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -36,5 +36,23 @@ struct netns_ipv6 {
36 struct xt_table *ip6table_mangle; 36 struct xt_table *ip6table_mangle;
37 struct xt_table *ip6table_raw; 37 struct xt_table *ip6table_raw;
38#endif 38#endif
39 struct rt6_info *ip6_null_entry;
40 struct rt6_statistics *rt6_stats;
41 struct timer_list *ip6_fib_timer;
42 struct hlist_head *fib_table_hash;
43 struct fib6_table *fib6_main_tbl;
44 struct dst_ops *ip6_dst_ops;
45 unsigned int ip6_rt_gc_expire;
46 unsigned long ip6_rt_last_gc;
47#ifdef CONFIG_IPV6_MULTIPLE_TABLES
48 struct rt6_info *ip6_prohibit_entry;
49 struct rt6_info *ip6_blk_hole_entry;
50 struct fib6_table *fib6_local_tbl;
51 struct fib_rules_ops *fib6_rules_ops;
52#endif
53 struct sock **icmp_sk;
54 struct sock *ndisc_sk;
55 struct sock *tcp_sk;
56 struct sock *igmp_sk;
39}; 57};
40#endif 58#endif
diff --git a/include/net/raw.h b/include/net/raw.h
index 1828f81fe374..6c14a656357a 100644
--- a/include/net/raw.h
+++ b/include/net/raw.h
@@ -53,7 +53,7 @@ int raw_seq_open(struct inode *ino, struct file *file,
53 53
54#endif 54#endif
55 55
56void raw_hash_sk(struct sock *sk, struct raw_hashinfo *h); 56void raw_hash_sk(struct sock *sk);
57void raw_unhash_sk(struct sock *sk, struct raw_hashinfo *h); 57void raw_unhash_sk(struct sock *sk);
58 58
59#endif /* _RAW_H */ 59#endif /* _RAW_H */
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index cff4608179c1..0369f98e9f3a 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -31,8 +31,7 @@ struct request_sock_ops {
31 int obj_size; 31 int obj_size;
32 struct kmem_cache *slab; 32 struct kmem_cache *slab;
33 int (*rtx_syn_ack)(struct sock *sk, 33 int (*rtx_syn_ack)(struct sock *sk,
34 struct request_sock *req, 34 struct request_sock *req);
35 struct dst_entry *dst);
36 void (*send_ack)(struct sk_buff *skb, 35 void (*send_ack)(struct sk_buff *skb,
37 struct request_sock *req); 36 struct request_sock *req);
38 void (*send_reset)(struct sock *sk, 37 void (*send_reset)(struct sock *sk,
@@ -116,8 +115,8 @@ struct request_sock_queue {
116 struct request_sock *rskq_accept_head; 115 struct request_sock *rskq_accept_head;
117 struct request_sock *rskq_accept_tail; 116 struct request_sock *rskq_accept_tail;
118 rwlock_t syn_wait_lock; 117 rwlock_t syn_wait_lock;
119 u8 rskq_defer_accept; 118 u16 rskq_defer_accept;
120 /* 3 bytes hole, try to pack */ 119 /* 2 bytes hole, try to pack */
121 struct listen_sock *listen_opt; 120 struct listen_sock *listen_opt;
122}; 121};
123 122
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 57df27f19588..dbfde62f3608 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -368,11 +368,6 @@ void sctp_sysctl_unregister(void);
368#else 368#else
369static inline void sctp_sysctl_register(void) { return; } 369static inline void sctp_sysctl_register(void) { return; }
370static inline void sctp_sysctl_unregister(void) { return; } 370static inline void sctp_sysctl_unregister(void) { return; }
371static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int nlen,
372 void __user *oldval, size_t __user *oldlenp,
373 void __user *newval, size_t newlen) {
374 return -ENOSYS;
375}
376#endif 371#endif
377 372
378/* Size of Supported Address Parameter for 'x' address types. */ 373/* Size of Supported Address Parameter for 'x' address types. */
@@ -380,15 +375,19 @@ static inline int sctp_sysctl_jiffies_ms(ctl_table *table, int __user *name, int
380 375
381#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 376#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
382 377
383int sctp_v6_init(void); 378void sctp_v6_pf_init(void);
384void sctp_v6_exit(void); 379void sctp_v6_pf_exit(void);
380int sctp_v6_protosw_init(void);
381void sctp_v6_protosw_exit(void);
385int sctp_v6_add_protocol(void); 382int sctp_v6_add_protocol(void);
386void sctp_v6_del_protocol(void); 383void sctp_v6_del_protocol(void);
387 384
388#else /* #ifdef defined(CONFIG_IPV6) */ 385#else /* #ifdef defined(CONFIG_IPV6) */
389 386
390static inline int sctp_v6_init(void) { return 0; } 387static inline void sctp_v6_pf_init(void) { return 0; }
391static inline void sctp_v6_exit(void) { return; } 388static inline void sctp_v6_pf_exit(void) { return; }
389static inline int sctp_v6_protosw_init(void) { return 0; }
390static inline void sctp_v6_protosw_exit(void) { return; }
392static inline int sctp_v6_add_protocol(void) { return 0; } 391static inline int sctp_v6_add_protocol(void) { return 0; }
393static inline void sctp_v6_del_protocol(void) { return; } 392static inline void sctp_v6_del_protocol(void) { return; }
394 393
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 9c827a749b6f..8966599ddb9f 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1661,6 +1661,9 @@ struct sctp_association {
1661 /* Transport to which SHUTDOWN chunk was last sent. */ 1661 /* Transport to which SHUTDOWN chunk was last sent. */
1662 struct sctp_transport *shutdown_last_sent_to; 1662 struct sctp_transport *shutdown_last_sent_to;
1663 1663
1664 /* How many times have we resent a SHUTDOWN */
1665 int shutdown_retries;
1666
1664 /* Transport to which INIT chunk was last sent. */ 1667 /* Transport to which INIT chunk was last sent. */
1665 struct sctp_transport *init_last_sent_to; 1668 struct sctp_transport *init_last_sent_to;
1666 1669
@@ -1695,6 +1698,11 @@ struct sctp_association {
1695 */ 1698 */
1696 __u16 unack_data; 1699 __u16 unack_data;
1697 1700
1701 /* The total number of data chunks that we've had to retransmit
1702 * as the result of a T3 timer expiration
1703 */
1704 __u32 rtx_data_chunks;
1705
1698 /* This is the association's receive buffer space. This value is used 1706 /* This is the association's receive buffer space. This value is used
1699 * to set a_rwnd field in an INIT or a SACK chunk. 1707 * to set a_rwnd field in an INIT or a SACK chunk.
1700 */ 1708 */
diff --git a/include/net/sock.h b/include/net/sock.h
index fd9876087651..b433b1ed203d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -70,7 +70,11 @@
70#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \ 70#define SOCK_DEBUG(sk, msg...) do { if ((sk) && sock_flag((sk), SOCK_DBG)) \
71 printk(KERN_DEBUG msg); } while (0) 71 printk(KERN_DEBUG msg); } while (0)
72#else 72#else
73#define SOCK_DEBUG(sk, msg...) do { } while (0) 73/* Validate arguments and do nothing */
74static void inline int __attribute__ ((format (printf, 2, 3)))
75SOCK_DEBUG(struct sock *sk, const char *msg, ...)
76{
77}
74#endif 78#endif
75 79
76/* This is the per-socket lock. The spinlock provides a synchronization 80/* This is the per-socket lock. The spinlock provides a synchronization
@@ -151,6 +155,7 @@ struct sock_common {
151 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets 155 * @sk_no_check: %SO_NO_CHECK setting, wether or not checkup packets
152 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO) 156 * @sk_route_caps: route capabilities (e.g. %NETIF_F_TSO)
153 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4) 157 * @sk_gso_type: GSO type (e.g. %SKB_GSO_TCPV4)
158 * @sk_gso_max_size: Maximum GSO segment size to build
154 * @sk_lingertime: %SO_LINGER l_linger setting 159 * @sk_lingertime: %SO_LINGER l_linger setting
155 * @sk_backlog: always used with the per-socket spinlock held 160 * @sk_backlog: always used with the per-socket spinlock held
156 * @sk_callback_lock: used with the callbacks in the end of this struct 161 * @sk_callback_lock: used with the callbacks in the end of this struct
@@ -237,6 +242,7 @@ struct sock {
237 gfp_t sk_allocation; 242 gfp_t sk_allocation;
238 int sk_route_caps; 243 int sk_route_caps;
239 int sk_gso_type; 244 int sk_gso_type;
245 unsigned int sk_gso_max_size;
240 int sk_rcvlowat; 246 int sk_rcvlowat;
241 unsigned long sk_flags; 247 unsigned long sk_flags;
242 unsigned long sk_lingertime; 248 unsigned long sk_lingertime;
@@ -498,6 +504,7 @@ extern int sk_wait_data(struct sock *sk, long *timeo);
498struct request_sock_ops; 504struct request_sock_ops;
499struct timewait_sock_ops; 505struct timewait_sock_ops;
500struct inet_hashinfo; 506struct inet_hashinfo;
507struct raw_hashinfo;
501 508
502/* Networking protocol blocks we attach to sockets. 509/* Networking protocol blocks we attach to sockets.
503 * socket layer -> transport layer interface 510 * socket layer -> transport layer interface
@@ -580,7 +587,11 @@ struct proto {
580 struct request_sock_ops *rsk_prot; 587 struct request_sock_ops *rsk_prot;
581 struct timewait_sock_ops *twsk_prot; 588 struct timewait_sock_ops *twsk_prot;
582 589
583 struct inet_hashinfo *hashinfo; 590 union {
591 struct inet_hashinfo *hashinfo;
592 struct hlist_head *udp_hash;
593 struct raw_hashinfo *raw_hash;
594 } h;
584 595
585 struct module *owner; 596 struct module *owner;
586 597
@@ -850,6 +861,7 @@ extern struct sock *sk_alloc(struct net *net, int family,
850 gfp_t priority, 861 gfp_t priority,
851 struct proto *prot); 862 struct proto *prot);
852extern void sk_free(struct sock *sk); 863extern void sk_free(struct sock *sk);
864extern void sk_release_kernel(struct sock *sk);
853extern struct sock *sk_clone(const struct sock *sk, 865extern struct sock *sk_clone(const struct sock *sk,
854 const gfp_t priority); 866 const gfp_t priority);
855 867
@@ -1333,6 +1345,18 @@ static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_e
1333} 1345}
1334#endif 1346#endif
1335 1347
1348/*
1349 * Kernel sockets, f.e. rtnl or icmp_socket, are a part of a namespace.
1350 * They should not hold a referrence to a namespace in order to allow
1351 * to stop it.
1352 * Sockets after sk_change_net should be released using sk_release_kernel
1353 */
1354static inline void sk_change_net(struct sock *sk, struct net *net)
1355{
1356 put_net(sk->sk_net);
1357 sk->sk_net = net;
1358}
1359
1336extern void sock_enable_timestamp(struct sock *sk); 1360extern void sock_enable_timestamp(struct sock *sk);
1337extern int sock_get_timestamp(struct sock *, struct timeval __user *); 1361extern int sock_get_timestamp(struct sock *, struct timeval __user *);
1338extern int sock_get_timestampns(struct sock *, struct timespec __user *); 1362extern int sock_get_timestampns(struct sock *, struct timespec __user *);
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 7de4ea3a04d9..67cc3956d29c 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -29,6 +29,7 @@
29#include <linux/skbuff.h> 29#include <linux/skbuff.h>
30#include <linux/dmaengine.h> 30#include <linux/dmaengine.h>
31#include <linux/crypto.h> 31#include <linux/crypto.h>
32#include <linux/cryptohash.h>
32 33
33#include <net/inet_connection_sock.h> 34#include <net/inet_connection_sock.h>
34#include <net/inet_timewait_sock.h> 35#include <net/inet_timewait_sock.h>
@@ -138,6 +139,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
138#define MAX_TCP_KEEPINTVL 32767 139#define MAX_TCP_KEEPINTVL 32767
139#define MAX_TCP_KEEPCNT 127 140#define MAX_TCP_KEEPCNT 127
140#define MAX_TCP_SYNCNT 127 141#define MAX_TCP_SYNCNT 127
142#define MAX_TCP_ACCEPT_DEFERRED 65535
141 143
142#define TCP_SYNQ_INTERVAL (HZ/5) /* Period of SYNACK timer */ 144#define TCP_SYNQ_INTERVAL (HZ/5) /* Period of SYNACK timer */
143 145
@@ -434,11 +436,17 @@ extern int tcp_disconnect(struct sock *sk, int flags);
434extern void tcp_unhash(struct sock *sk); 436extern void tcp_unhash(struct sock *sk);
435 437
436/* From syncookies.c */ 438/* From syncookies.c */
439extern __u32 syncookie_secret[2][16-3+SHA_DIGEST_WORDS];
437extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 440extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
438 struct ip_options *opt); 441 struct ip_options *opt);
439extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 442extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
440 __u16 *mss); 443 __u16 *mss);
441 444
445/* From net/ipv6/syncookies.c */
446extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
447extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb,
448 __u16 *mss);
449
442/* tcp_output.c */ 450/* tcp_output.c */
443 451
444extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, 452extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -1321,6 +1329,7 @@ struct tcp_seq_afinfo {
1321}; 1329};
1322 1330
1323struct tcp_iter_state { 1331struct tcp_iter_state {
1332 struct net *net;
1324 sa_family_t family; 1333 sa_family_t family;
1325 enum tcp_seq_states state; 1334 enum tcp_seq_states state;
1326 struct sock *syn_wait_sk; 1335 struct sock *syn_wait_sk;
@@ -1328,10 +1337,11 @@ struct tcp_iter_state {
1328 struct seq_operations seq_ops; 1337 struct seq_operations seq_ops;
1329}; 1338};
1330 1339
1331extern int tcp_proc_register(struct tcp_seq_afinfo *afinfo); 1340extern int tcp_proc_register(struct net *net, struct tcp_seq_afinfo *afinfo);
1332extern void tcp_proc_unregister(struct tcp_seq_afinfo *afinfo); 1341extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
1333 1342
1334extern struct request_sock_ops tcp_request_sock_ops; 1343extern struct request_sock_ops tcp_request_sock_ops;
1344extern struct request_sock_ops tcp6_request_sock_ops;
1335 1345
1336extern int tcp_v4_destroy_sock(struct sock *sk); 1346extern int tcp_v4_destroy_sock(struct sock *sk);
1337 1347
@@ -1373,7 +1383,7 @@ struct tcp_request_sock_ops {
1373#endif 1383#endif
1374}; 1384};
1375 1385
1376extern void tcp_v4_init(struct net_proto_family *ops); 1386extern void tcp_v4_init(void);
1377extern void tcp_init(void); 1387extern void tcp_init(void);
1378 1388
1379#endif /* _TCP_H */ 1389#endif /* _TCP_H */
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h
index 2151a80cdf30..ee2f304e4919 100644
--- a/include/net/tipc/tipc_bearer.h
+++ b/include/net/tipc/tipc_bearer.h
@@ -99,6 +99,9 @@ struct tipc_bearer {
99 char name[TIPC_MAX_BEARER_NAME]; 99 char name[TIPC_MAX_BEARER_NAME];
100}; 100};
101 101
102/*
103 * TIPC routines available to supported media types
104 */
102 105
103int tipc_register_media(u32 media_type, 106int tipc_register_media(u32 media_type,
104 char *media_name, 107 char *media_name,
@@ -123,6 +126,12 @@ void tipc_continue(struct tipc_bearer *tb_ptr);
123int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority); 126int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority);
124int tipc_disable_bearer(const char *name); 127int tipc_disable_bearer(const char *name);
125 128
129/*
130 * Routines made available to TIPC by supported media types
131 */
132
133int tipc_eth_media_start(void);
134void tipc_eth_media_stop(void);
126 135
127#endif 136#endif
128 137
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index cfc4ba46de8f..c9b36b77a0b9 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -86,13 +86,6 @@ u32 tipc_createport_raw(void *usr_handle,
86 void (*wakeup)(struct tipc_port *), 86 void (*wakeup)(struct tipc_port *),
87 const u32 importance); 87 const u32 importance);
88 88
89/*
90 * tipc_set_msg_option(): port must be locked.
91 */
92int tipc_set_msg_option(struct tipc_port *tp_ptr,
93 const char *opt,
94 const u32 len);
95
96int tipc_reject_msg(struct sk_buff *buf, u32 err); 89int tipc_reject_msg(struct sk_buff *buf, u32 err);
97 90
98int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode); 91int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode);
diff --git a/include/net/udp.h b/include/net/udp.h
index c6669c0a74c7..635940d374ab 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -125,6 +125,8 @@ static inline void udp_lib_close(struct sock *sk, long timeout)
125 sk_common_release(sk); 125 sk_common_release(sk);
126} 126}
127 127
128extern int udp_lib_get_port(struct sock *sk, unsigned short snum,
129 int (*)(const struct sock*,const struct sock*));
128 130
129/* net/ipv4/udp.c */ 131/* net/ipv4/udp.c */
130extern int udp_get_port(struct sock *sk, unsigned short snum, 132extern int udp_get_port(struct sock *sk, unsigned short snum,
@@ -192,6 +194,7 @@ struct udp_seq_afinfo {
192}; 194};
193 195
194struct udp_iter_state { 196struct udp_iter_state {
197 struct net *net;
195 sa_family_t family; 198 sa_family_t family;
196 struct hlist_head *hashtable; 199 struct hlist_head *hashtable;
197 int bucket; 200 int bucket;
@@ -199,8 +202,8 @@ struct udp_iter_state {
199}; 202};
200 203
201#ifdef CONFIG_PROC_FS 204#ifdef CONFIG_PROC_FS
202extern int udp_proc_register(struct udp_seq_afinfo *afinfo); 205extern int udp_proc_register(struct net *net, struct udp_seq_afinfo *afinfo);
203extern void udp_proc_unregister(struct udp_seq_afinfo *afinfo); 206extern void udp_proc_unregister(struct net *net, struct udp_seq_afinfo *afinfo);
204 207
205extern int udp4_proc_init(void); 208extern int udp4_proc_init(void);
206extern void udp4_proc_exit(void); 209extern void udp4_proc_exit(void);
diff --git a/include/net/wireless.h b/include/net/wireless.h
index d30c4ba8fd99..c7f805ee5545 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -13,6 +13,162 @@
13#include <net/cfg80211.h> 13#include <net/cfg80211.h>
14 14
15/** 15/**
16 * enum ieee80211_band - supported frequency bands
17 *
18 * The bands are assigned this way because the supported
19 * bitrates differ in these bands.
20 *
21 * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band
22 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
23 */
24enum ieee80211_band {
25 IEEE80211_BAND_2GHZ,
26 IEEE80211_BAND_5GHZ,
27
28 /* keep last */
29 IEEE80211_NUM_BANDS
30};
31
32/**
33 * enum ieee80211_channel_flags - channel flags
34 *
35 * Channel flags set by the regulatory control code.
36 *
37 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
38 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted
39 * on this channel.
40 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
41 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
42 */
43enum ieee80211_channel_flags {
44 IEEE80211_CHAN_DISABLED = 1<<0,
45 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
46 IEEE80211_CHAN_NO_IBSS = 1<<2,
47 IEEE80211_CHAN_RADAR = 1<<3,
48};
49
50/**
51 * struct ieee80211_channel - channel definition
52 *
53 * This structure describes a single channel for use
54 * with cfg80211.
55 *
56 * @center_freq: center frequency in MHz
57 * @hw_value: hardware-specific value for the channel
58 * @flags: channel flags from &enum ieee80211_channel_flags.
59 * @orig_flags: channel flags at registration time, used by regulatory
60 * code to support devices with additional restrictions
61 * @band: band this channel belongs to.
62 * @max_antenna_gain: maximum antenna gain in dBi
63 * @max_power: maximum transmission power (in dBm)
64 * @orig_mag: internal use
65 * @orig_mpwr: internal use
66 */
67struct ieee80211_channel {
68 enum ieee80211_band band;
69 u16 center_freq;
70 u16 hw_value;
71 u32 flags;
72 int max_antenna_gain;
73 int max_power;
74 u32 orig_flags;
75 int orig_mag, orig_mpwr;
76};
77
78/**
79 * enum ieee80211_rate_flags - rate flags
80 *
81 * Hardware/specification flags for rates. These are structured
82 * in a way that allows using the same bitrate structure for
83 * different bands/PHY modes.
84 *
85 * @IEEE80211_RATE_SHORT_PREAMBLE: Hardware can send with short
86 * preamble on this bitrate; only relevant in 2.4GHz band and
87 * with CCK rates.
88 * @IEEE80211_RATE_MANDATORY_A: This bitrate is a mandatory rate
89 * when used with 802.11a (on the 5 GHz band); filled by the
90 * core code when registering the wiphy.
91 * @IEEE80211_RATE_MANDATORY_B: This bitrate is a mandatory rate
92 * when used with 802.11b (on the 2.4 GHz band); filled by the
93 * core code when registering the wiphy.
94 * @IEEE80211_RATE_MANDATORY_G: This bitrate is a mandatory rate
95 * when used with 802.11g (on the 2.4 GHz band); filled by the
96 * core code when registering the wiphy.
97 * @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode.
98 */
99enum ieee80211_rate_flags {
100 IEEE80211_RATE_SHORT_PREAMBLE = 1<<0,
101 IEEE80211_RATE_MANDATORY_A = 1<<1,
102 IEEE80211_RATE_MANDATORY_B = 1<<2,
103 IEEE80211_RATE_MANDATORY_G = 1<<3,
104 IEEE80211_RATE_ERP_G = 1<<4,
105};
106
107/**
108 * struct ieee80211_rate - bitrate definition
109 *
110 * This structure describes a bitrate that an 802.11 PHY can
111 * operate with. The two values @hw_value and @hw_value_short
112 * are only for driver use when pointers to this structure are
113 * passed around.
114 *
115 * @flags: rate-specific flags
116 * @bitrate: bitrate in units of 100 Kbps
117 * @hw_value: driver/hardware value for this rate
118 * @hw_value_short: driver/hardware value for this rate when
119 * short preamble is used
120 */
121struct ieee80211_rate {
122 u32 flags;
123 u16 bitrate;
124 u16 hw_value, hw_value_short;
125};
126
127/**
128 * struct ieee80211_ht_info - describing STA's HT capabilities
129 *
130 * This structure describes most essential parameters needed
131 * to describe 802.11n HT capabilities for an STA.
132 *
133 * @ht_supported: is HT supported by STA, 0: no, 1: yes
134 * @cap: HT capabilities map as described in 802.11n spec
135 * @ampdu_factor: Maximum A-MPDU length factor
136 * @ampdu_density: Minimum A-MPDU spacing
137 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
138 */
139struct ieee80211_ht_info {
140 u16 cap; /* use IEEE80211_HT_CAP_ */
141 u8 ht_supported;
142 u8 ampdu_factor;
143 u8 ampdu_density;
144 u8 supp_mcs_set[16];
145};
146
147/**
148 * struct ieee80211_supported_band - frequency band definition
149 *
150 * This structure describes a frequency band a wiphy
151 * is able to operate in.
152 *
153 * @channels: Array of channels the hardware can operate in
154 * in this band.
155 * @band: the band this structure represents
156 * @n_channels: Number of channels in @channels
157 * @bitrates: Array of bitrates the hardware can operate with
158 * in this band. Must be sorted to give a valid "supported
159 * rates" IE, i.e. CCK rates first, then OFDM.
160 * @n_bitrates: Number of bitrates in @bitrates
161 */
162struct ieee80211_supported_band {
163 struct ieee80211_channel *channels;
164 struct ieee80211_rate *bitrates;
165 enum ieee80211_band band;
166 int n_channels;
167 int n_bitrates;
168 struct ieee80211_ht_info ht_info;
169};
170
171/**
16 * struct wiphy - wireless hardware description 172 * struct wiphy - wireless hardware description
17 * @idx: the wiphy index assigned to this item 173 * @idx: the wiphy index assigned to this item
18 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 174 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
@@ -30,6 +186,8 @@ struct wiphy {
30 * help determine whether you own this wiphy or not. */ 186 * help determine whether you own this wiphy or not. */
31 void *privid; 187 void *privid;
32 188
189 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
190
33 /* fields below are read-only, assigned by cfg80211 */ 191 /* fields below are read-only, assigned by cfg80211 */
34 192
35 /* the item in /sys/class/ieee80211/ points to this, 193 /* the item in /sys/class/ieee80211/ points to this,
@@ -136,4 +294,14 @@ extern void wiphy_unregister(struct wiphy *wiphy);
136 */ 294 */
137extern void wiphy_free(struct wiphy *wiphy); 295extern void wiphy_free(struct wiphy *wiphy);
138 296
297/**
298 * ieee80211_channel_to_frequency - convert channel number to frequency
299 */
300extern int ieee80211_channel_to_frequency(int chan);
301
302/**
303 * ieee80211_frequency_to_channel - convert frequency to channel number
304 */
305extern int ieee80211_frequency_to_channel(int freq);
306
139#endif /* __NET_WIRELESS_H */ 307#endif /* __NET_WIRELESS_H */
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index eea7785cc757..c435620dbb37 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -121,6 +121,7 @@ extern struct mutex xfrm_cfg_mutex;
121struct xfrm_state 121struct xfrm_state
122{ 122{
123 /* Note: bydst is re-used during gc */ 123 /* Note: bydst is re-used during gc */
124 struct list_head all;
124 struct hlist_node bydst; 125 struct hlist_node bydst;
125 struct hlist_node bysrc; 126 struct hlist_node bysrc;
126 struct hlist_node byspi; 127 struct hlist_node byspi;
@@ -277,7 +278,7 @@ extern int __xfrm_state_delete(struct xfrm_state *x);
277struct xfrm_state_afinfo { 278struct xfrm_state_afinfo {
278 unsigned int family; 279 unsigned int family;
279 unsigned int proto; 280 unsigned int proto;
280 unsigned int eth_proto; 281 __be16 eth_proto;
281 struct module *owner; 282 struct module *owner;
282 const struct xfrm_type *type_map[IPPROTO_MAX]; 283 const struct xfrm_type *type_map[IPPROTO_MAX];
283 struct xfrm_mode *mode_map[XFRM_MODE_MAX]; 284 struct xfrm_mode *mode_map[XFRM_MODE_MAX];
@@ -424,6 +425,7 @@ struct xfrm_tmpl
424struct xfrm_policy 425struct xfrm_policy
425{ 426{
426 struct xfrm_policy *next; 427 struct xfrm_policy *next;
428 struct list_head bytype;
427 struct hlist_node bydst; 429 struct hlist_node bydst;
428 struct hlist_node byidx; 430 struct hlist_node byidx;
429 431
@@ -1160,6 +1162,18 @@ struct xfrm6_tunnel {
1160 int priority; 1162 int priority;
1161}; 1163};
1162 1164
1165struct xfrm_state_walk {
1166 struct xfrm_state *state;
1167 int count;
1168 u8 proto;
1169};
1170
1171struct xfrm_policy_walk {
1172 struct xfrm_policy *policy;
1173 int count;
1174 u8 type, cur_type;
1175};
1176
1163extern void xfrm_init(void); 1177extern void xfrm_init(void);
1164extern void xfrm4_init(void); 1178extern void xfrm4_init(void);
1165extern void xfrm_state_init(void); 1179extern void xfrm_state_init(void);
@@ -1184,7 +1198,23 @@ static inline void xfrm6_fini(void)
1184extern int xfrm_proc_init(void); 1198extern int xfrm_proc_init(void);
1185#endif 1199#endif
1186 1200
1187extern int xfrm_state_walk(u8 proto, int (*func)(struct xfrm_state *, int, void*), void *); 1201static inline void xfrm_state_walk_init(struct xfrm_state_walk *walk, u8 proto)
1202{
1203 walk->proto = proto;
1204 walk->state = NULL;
1205 walk->count = 0;
1206}
1207
1208static inline void xfrm_state_walk_done(struct xfrm_state_walk *walk)
1209{
1210 if (walk->state != NULL) {
1211 xfrm_state_put(walk->state);
1212 walk->state = NULL;
1213 }
1214}
1215
1216extern int xfrm_state_walk(struct xfrm_state_walk *walk,
1217 int (*func)(struct xfrm_state *, int, void*), void *);
1188extern struct xfrm_state *xfrm_state_alloc(void); 1218extern struct xfrm_state *xfrm_state_alloc(void);
1189extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr, 1219extern struct xfrm_state *xfrm_state_find(xfrm_address_t *daddr, xfrm_address_t *saddr,
1190 struct flowi *fl, struct xfrm_tmpl *tmpl, 1220 struct flowi *fl, struct xfrm_tmpl *tmpl,
@@ -1306,7 +1336,25 @@ static inline int xfrm4_udp_encap_rcv(struct sock *sk, struct sk_buff *skb)
1306#endif 1336#endif
1307 1337
1308struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp); 1338struct xfrm_policy *xfrm_policy_alloc(gfp_t gfp);
1309extern int xfrm_policy_walk(u8 type, int (*func)(struct xfrm_policy *, int, int, void*), void *); 1339
1340static inline void xfrm_policy_walk_init(struct xfrm_policy_walk *walk, u8 type)
1341{
1342 walk->cur_type = XFRM_POLICY_TYPE_MAIN;
1343 walk->type = type;
1344 walk->policy = NULL;
1345 walk->count = 0;
1346}
1347
1348static inline void xfrm_policy_walk_done(struct xfrm_policy_walk *walk)
1349{
1350 if (walk->policy != NULL) {
1351 xfrm_pol_put(walk->policy);
1352 walk->policy = NULL;
1353 }
1354}
1355
1356extern int xfrm_policy_walk(struct xfrm_policy_walk *walk,
1357 int (*func)(struct xfrm_policy *, int, int, void*), void *);
1310int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl); 1358int xfrm_policy_insert(int dir, struct xfrm_policy *policy, int excl);
1311struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir, 1359struct xfrm_policy *xfrm_policy_bysel_ctx(u8 type, int dir,
1312 struct xfrm_selector *sel, 1360 struct xfrm_selector *sel,