aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/brcmphy.h6
-rw-r--r--include/linux/dm9000.h1
-rw-r--r--include/linux/ethtool.h33
-rw-r--r--include/linux/hdlc.h7
-rw-r--r--include/linux/ieee80211.h499
-rw-r--r--include/linux/if_bridge.h2
-rw-r--r--include/linux/if_ppp.h2
-rw-r--r--include/linux/if_tun.h12
-rw-r--r--include/linux/if_vlan.h223
-rw-r--r--include/linux/igmp.h1
-rw-r--r--include/linux/ip6_tunnel.h4
-rw-r--r--include/linux/ipv6.h4
-rw-r--r--include/linux/mroute.h28
-rw-r--r--include/linux/mroute6.h35
-rw-r--r--include/linux/mv643xx_eth.h65
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h186
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h10
-rw-r--r--include/linux/netfilter/xt_string.h15
-rw-r--r--include/linux/netfilter_bridge/ebt_ip6.h40
-rw-r--r--include/linux/netfilter_bridge/ebt_log.h3
-rw-r--r--include/linux/netfilter_ipv4.h1
-rw-r--r--include/linux/netfilter_ipv6.h5
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nl80211.h13
-rw-r--r--include/linux/notifier.h1
-rw-r--r--include/linux/pci_ids.h3
-rw-r--r--include/linux/ppp-comp.h2
-rw-r--r--include/linux/ppp_defs.h2
-rw-r--r--include/linux/rfkill.h46
-rw-r--r--include/linux/skbuff.h24
-rw-r--r--include/linux/smc911x.h12
-rw-r--r--include/linux/sonet.h2
-rw-r--r--include/linux/ssb/ssb.h143
-rw-r--r--include/linux/sunrpc/auth_gss.h2
-rw-r--r--include/linux/sunrpc/gss_api.h2
-rw-r--r--include/linux/sunrpc/svcauth_gss.h3
-rw-r--r--include/linux/tcp.h50
-rw-r--r--include/linux/textsearch.h13
-rw-r--r--include/linux/tipc_config.h10
-rw-r--r--include/linux/udp.h6
-rw-r--r--include/linux/usb/rndis_host.h3
-rw-r--r--include/linux/wanrouter.h2
-rw-r--r--include/linux/wireless.h30
-rw-r--r--include/net/addrconf.h3
-rw-r--r--include/net/fib_rules.h2
-rw-r--r--include/net/garp.h128
-rw-r--r--include/net/ieee80211.h11
-rw-r--r--include/net/if_inet6.h1
-rw-r--r--include/net/inet6_hashtables.h10
-rw-r--r--include/net/inet_hashtables.h12
-rw-r--r--include/net/inet_sock.h9
-rw-r--r--include/net/inetpeer.h2
-rw-r--r--include/net/ip6_tunnel.h5
-rw-r--r--include/net/ipconfig.h2
-rw-r--r--include/net/ipip.h1
-rw-r--r--include/net/ipv6.h2
-rw-r--r--include/net/irda/irda_device.h2
-rw-r--r--include/net/iw_handler.h151
-rw-r--r--include/net/mac80211.h528
-rw-r--r--include/net/net_namespace.h3
-rw-r--r--include/net/netfilter/ipv4/nf_conntrack_ipv4.h2
-rw-r--r--include/net/netfilter/nf_conntrack.h22
-rw-r--r--include/net/netns/hash.h21
-rw-r--r--include/net/netns/ipv4.h5
-rw-r--r--include/net/netns/ipv6.h1
-rw-r--r--include/net/pkt_sched.h14
-rw-r--r--include/net/rose.h2
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/sch_generic.h92
-rw-r--r--include/net/sctp/sctp.h4
-rw-r--r--include/net/sctp/structs.h6
-rw-r--r--include/net/sctp/user.h34
-rw-r--r--include/net/snmp.h2
-rw-r--r--include/net/sock.h37
-rw-r--r--include/net/stp.h14
-rw-r--r--include/net/tcp.h23
-rw-r--r--include/net/tipc/tipc_port.h3
-rw-r--r--include/net/transp_v6.h2
-rw-r--r--include/net/udp.h16
-rw-r--r--include/net/wext.h7
-rw-r--r--include/net/wireless.h6
82 files changed, 1914 insertions, 830 deletions
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
new file mode 100644
index 000000000000..9b64b6d67873
--- /dev/null
+++ b/include/linux/brcmphy.h
@@ -0,0 +1,6 @@
1#define PHY_BRCM_WIRESPEED_ENABLE 0x00000001
2#define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002
3#define PHY_BRCM_APD_CLK125_ENABLE 0x00000004
4#define PHY_BRCM_STD_IBND_DISABLE 0x00000008
5#define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010
6#define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
index a3750462f9e3..fc82446b6425 100644
--- a/include/linux/dm9000.h
+++ b/include/linux/dm9000.h
@@ -21,6 +21,7 @@
21#define DM9000_PLATF_32BITONLY (0x0004) 21#define DM9000_PLATF_32BITONLY (0x0004)
22#define DM9000_PLATF_EXT_PHY (0x0008) 22#define DM9000_PLATF_EXT_PHY (0x0008)
23#define DM9000_PLATF_NO_EEPROM (0x0010) 23#define DM9000_PLATF_NO_EEPROM (0x0010)
24#define DM9000_PLATF_SIMPLE_PHY (0x0020) /* Use NSR to find LinkStatus */
24 25
25/* platfrom data for platfrom device structure's platfrom_data field */ 26/* platfrom data for platfrom device structure's platfrom_data field */
26 27
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c8d216357865..8bb5e87df365 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -272,6 +272,12 @@ enum ethtool_flags {
272 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ 272 ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */
273}; 273};
274 274
275struct ethtool_rxnfc {
276 __u32 cmd;
277 __u32 flow_type;
278 __u64 data;
279};
280
275#ifdef __KERNEL__ 281#ifdef __KERNEL__
276 282
277struct net_device; 283struct net_device;
@@ -396,6 +402,8 @@ struct ethtool_ops {
396 /* the following hooks are obsolete */ 402 /* the following hooks are obsolete */
397 int (*self_test_count)(struct net_device *);/* use get_sset_count */ 403 int (*self_test_count)(struct net_device *);/* use get_sset_count */
398 int (*get_stats_count)(struct net_device *);/* use get_sset_count */ 404 int (*get_stats_count)(struct net_device *);/* use get_sset_count */
405 int (*get_rxhash)(struct net_device *, struct ethtool_rxnfc *);
406 int (*set_rxhash)(struct net_device *, struct ethtool_rxnfc *);
399}; 407};
400#endif /* __KERNEL__ */ 408#endif /* __KERNEL__ */
401 409
@@ -442,6 +450,9 @@ struct ethtool_ops {
442#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */ 450#define ETHTOOL_GPFLAGS 0x00000027 /* Get driver-private flags bitmap */
443#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */ 451#define ETHTOOL_SPFLAGS 0x00000028 /* Set driver-private flags bitmap */
444 452
453#define ETHTOOL_GRXFH 0x00000029 /* Get RX flow hash configuration */
454#define ETHTOOL_SRXFH 0x0000002a /* Set RX flow hash configuration */
455
445/* compatibility with older code */ 456/* compatibility with older code */
446#define SPARC_ETH_GSET ETHTOOL_GSET 457#define SPARC_ETH_GSET ETHTOOL_GSET
447#define SPARC_ETH_SSET ETHTOOL_SSET 458#define SPARC_ETH_SSET ETHTOOL_SSET
@@ -528,4 +539,26 @@ struct ethtool_ops {
528#define WAKE_MAGIC (1 << 5) 539#define WAKE_MAGIC (1 << 5)
529#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */ 540#define WAKE_MAGICSECURE (1 << 6) /* only meaningful if WAKE_MAGIC */
530 541
542/* L3-L4 network traffic flow types */
543#define TCP_V4_FLOW 0x01
544#define UDP_V4_FLOW 0x02
545#define SCTP_V4_FLOW 0x03
546#define AH_ESP_V4_FLOW 0x04
547#define TCP_V6_FLOW 0x05
548#define UDP_V6_FLOW 0x06
549#define SCTP_V6_FLOW 0x07
550#define AH_ESP_V6_FLOW 0x08
551
552/* L3-L4 network traffic flow hash options */
553#define RXH_DEV_PORT (1 << 0)
554#define RXH_L2DA (1 << 1)
555#define RXH_VLAN (1 << 2)
556#define RXH_L3_PROTO (1 << 3)
557#define RXH_IP_SRC (1 << 4)
558#define RXH_IP_DST (1 << 5)
559#define RXH_L4_B_0_1 (1 << 6) /* src port in case of TCP/UDP/SCTP */
560#define RXH_L4_B_2_3 (1 << 7) /* dst port in case of TCP/UDP/SCTP */
561#define RXH_DISCARD (1 << 31)
562
563
531#endif /* _LINUX_ETHTOOL_H */ 564#endif /* _LINUX_ETHTOOL_H */
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 6115545a5b9c..c59769693bee 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -45,7 +45,6 @@ struct hdlc_proto {
45 45
46/* Pointed to by dev->priv */ 46/* Pointed to by dev->priv */
47typedef struct hdlc_device { 47typedef struct hdlc_device {
48 struct net_device_stats stats;
49 /* used by HDLC layer to take control over HDLC device from hw driver*/ 48 /* used by HDLC layer to take control over HDLC device from hw driver*/
50 int (*attach)(struct net_device *dev, 49 int (*attach)(struct net_device *dev,
51 unsigned short encoding, unsigned short parity); 50 unsigned short encoding, unsigned short parity);
@@ -109,12 +108,6 @@ int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto,
109/* May be used by hardware driver to gain control over HDLC device */ 108/* May be used by hardware driver to gain control over HDLC device */
110void detach_hdlc_protocol(struct net_device *dev); 109void detach_hdlc_protocol(struct net_device *dev);
111 110
112static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev)
113{
114 return &dev_to_hdlc(dev)->stats;
115}
116
117
118static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, 111static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb,
119 struct net_device *dev) 112 struct net_device *dev)
120{ 113{
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 0b5e03eae6d2..a1630ba0b87c 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -98,6 +98,9 @@
98 98
99#define IEEE80211_MAX_SSID_LEN 32 99#define IEEE80211_MAX_SSID_LEN 32
100#define IEEE80211_MAX_MESH_ID_LEN 32 100#define IEEE80211_MAX_MESH_ID_LEN 32
101#define IEEE80211_QOS_CTL_LEN 2
102#define IEEE80211_QOS_CTL_TID_MASK 0x000F
103#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
101 104
102struct ieee80211_hdr { 105struct ieee80211_hdr {
103 __le16 frame_control; 106 __le16 frame_control;
@@ -109,6 +112,355 @@ struct ieee80211_hdr {
109 u8 addr4[6]; 112 u8 addr4[6];
110} __attribute__ ((packed)); 113} __attribute__ ((packed));
111 114
115/**
116 * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set
117 * @fc: frame control bytes in little-endian byteorder
118 */
119static inline int ieee80211_has_tods(__le16 fc)
120{
121 return (fc & cpu_to_le16(IEEE80211_FCTL_TODS)) != 0;
122}
123
124/**
125 * ieee80211_has_fromds - check if IEEE80211_FCTL_FROMDS is set
126 * @fc: frame control bytes in little-endian byteorder
127 */
128static inline int ieee80211_has_fromds(__le16 fc)
129{
130 return (fc & cpu_to_le16(IEEE80211_FCTL_FROMDS)) != 0;
131}
132
133/**
134 * ieee80211_has_a4 - check if IEEE80211_FCTL_TODS and IEEE80211_FCTL_FROMDS are set
135 * @fc: frame control bytes in little-endian byteorder
136 */
137static inline int ieee80211_has_a4(__le16 fc)
138{
139 __le16 tmp = cpu_to_le16(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS);
140 return (fc & tmp) == tmp;
141}
142
143/**
144 * ieee80211_has_morefrags - check if IEEE80211_FCTL_MOREFRAGS is set
145 * @fc: frame control bytes in little-endian byteorder
146 */
147static inline int ieee80211_has_morefrags(__le16 fc)
148{
149 return (fc & cpu_to_le16(IEEE80211_FCTL_MOREFRAGS)) != 0;
150}
151
152/**
153 * ieee80211_has_retry - check if IEEE80211_FCTL_RETRY is set
154 * @fc: frame control bytes in little-endian byteorder
155 */
156static inline int ieee80211_has_retry(__le16 fc)
157{
158 return (fc & cpu_to_le16(IEEE80211_FCTL_RETRY)) != 0;
159}
160
161/**
162 * ieee80211_has_pm - check if IEEE80211_FCTL_PM is set
163 * @fc: frame control bytes in little-endian byteorder
164 */
165static inline int ieee80211_has_pm(__le16 fc)
166{
167 return (fc & cpu_to_le16(IEEE80211_FCTL_PM)) != 0;
168}
169
170/**
171 * ieee80211_has_moredata - check if IEEE80211_FCTL_MOREDATA is set
172 * @fc: frame control bytes in little-endian byteorder
173 */
174static inline int ieee80211_has_moredata(__le16 fc)
175{
176 return (fc & cpu_to_le16(IEEE80211_FCTL_MOREDATA)) != 0;
177}
178
179/**
180 * ieee80211_has_protected - check if IEEE80211_FCTL_PROTECTED is set
181 * @fc: frame control bytes in little-endian byteorder
182 */
183static inline int ieee80211_has_protected(__le16 fc)
184{
185 return (fc & cpu_to_le16(IEEE80211_FCTL_PROTECTED)) != 0;
186}
187
188/**
189 * ieee80211_has_order - check if IEEE80211_FCTL_ORDER is set
190 * @fc: frame control bytes in little-endian byteorder
191 */
192static inline int ieee80211_has_order(__le16 fc)
193{
194 return (fc & cpu_to_le16(IEEE80211_FCTL_ORDER)) != 0;
195}
196
197/**
198 * ieee80211_is_mgmt - check if type is IEEE80211_FTYPE_MGMT
199 * @fc: frame control bytes in little-endian byteorder
200 */
201static inline int ieee80211_is_mgmt(__le16 fc)
202{
203 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
204 cpu_to_le16(IEEE80211_FTYPE_MGMT);
205}
206
207/**
208 * ieee80211_is_ctl - check if type is IEEE80211_FTYPE_CTL
209 * @fc: frame control bytes in little-endian byteorder
210 */
211static inline int ieee80211_is_ctl(__le16 fc)
212{
213 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
214 cpu_to_le16(IEEE80211_FTYPE_CTL);
215}
216
217/**
218 * ieee80211_is_data - check if type is IEEE80211_FTYPE_DATA
219 * @fc: frame control bytes in little-endian byteorder
220 */
221static inline int ieee80211_is_data(__le16 fc)
222{
223 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE)) ==
224 cpu_to_le16(IEEE80211_FTYPE_DATA);
225}
226
227/**
228 * ieee80211_is_data_qos - check if type is IEEE80211_FTYPE_DATA and IEEE80211_STYPE_QOS_DATA is set
229 * @fc: frame control bytes in little-endian byteorder
230 */
231static inline int ieee80211_is_data_qos(__le16 fc)
232{
233 /*
234 * mask with QOS_DATA rather than IEEE80211_FCTL_STYPE as we just need
235 * to check the one bit
236 */
237 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_STYPE_QOS_DATA)) ==
238 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_DATA);
239}
240
241/**
242 * ieee80211_is_data_present - check if type is IEEE80211_FTYPE_DATA and has data
243 * @fc: frame control bytes in little-endian byteorder
244 */
245static inline int ieee80211_is_data_present(__le16 fc)
246{
247 /*
248 * mask with 0x40 and test that that bit is clear to only return true
249 * for the data-containing substypes.
250 */
251 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | 0x40)) ==
252 cpu_to_le16(IEEE80211_FTYPE_DATA);
253}
254
255/**
256 * ieee80211_is_assoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_REQ
257 * @fc: frame control bytes in little-endian byteorder
258 */
259static inline int ieee80211_is_assoc_req(__le16 fc)
260{
261 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
262 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_REQ);
263}
264
265/**
266 * ieee80211_is_assoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ASSOC_RESP
267 * @fc: frame control bytes in little-endian byteorder
268 */
269static inline int ieee80211_is_assoc_resp(__le16 fc)
270{
271 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
272 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ASSOC_RESP);
273}
274
275/**
276 * ieee80211_is_reassoc_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_REQ
277 * @fc: frame control bytes in little-endian byteorder
278 */
279static inline int ieee80211_is_reassoc_req(__le16 fc)
280{
281 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
282 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_REQ);
283}
284
285/**
286 * ieee80211_is_reassoc_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_REASSOC_RESP
287 * @fc: frame control bytes in little-endian byteorder
288 */
289static inline int ieee80211_is_reassoc_resp(__le16 fc)
290{
291 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
292 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_REASSOC_RESP);
293}
294
295/**
296 * ieee80211_is_probe_req - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_REQ
297 * @fc: frame control bytes in little-endian byteorder
298 */
299static inline int ieee80211_is_probe_req(__le16 fc)
300{
301 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
302 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_REQ);
303}
304
305/**
306 * ieee80211_is_probe_resp - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_PROBE_RESP
307 * @fc: frame control bytes in little-endian byteorder
308 */
309static inline int ieee80211_is_probe_resp(__le16 fc)
310{
311 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
312 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_PROBE_RESP);
313}
314
315/**
316 * ieee80211_is_beacon - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_BEACON
317 * @fc: frame control bytes in little-endian byteorder
318 */
319static inline int ieee80211_is_beacon(__le16 fc)
320{
321 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
322 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON);
323}
324
325/**
326 * ieee80211_is_atim - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ATIM
327 * @fc: frame control bytes in little-endian byteorder
328 */
329static inline int ieee80211_is_atim(__le16 fc)
330{
331 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
332 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ATIM);
333}
334
335/**
336 * ieee80211_is_disassoc - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DISASSOC
337 * @fc: frame control bytes in little-endian byteorder
338 */
339static inline int ieee80211_is_disassoc(__le16 fc)
340{
341 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
342 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DISASSOC);
343}
344
345/**
346 * ieee80211_is_auth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_AUTH
347 * @fc: frame control bytes in little-endian byteorder
348 */
349static inline int ieee80211_is_auth(__le16 fc)
350{
351 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
352 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_AUTH);
353}
354
355/**
356 * ieee80211_is_deauth - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_DEAUTH
357 * @fc: frame control bytes in little-endian byteorder
358 */
359static inline int ieee80211_is_deauth(__le16 fc)
360{
361 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
362 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_DEAUTH);
363}
364
365/**
366 * ieee80211_is_action - check if IEEE80211_FTYPE_MGMT && IEEE80211_STYPE_ACTION
367 * @fc: frame control bytes in little-endian byteorder
368 */
369static inline int ieee80211_is_action(__le16 fc)
370{
371 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
372 cpu_to_le16(IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_ACTION);
373}
374
375/**
376 * ieee80211_is_back_req - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK_REQ
377 * @fc: frame control bytes in little-endian byteorder
378 */
379static inline int ieee80211_is_back_req(__le16 fc)
380{
381 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
382 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK_REQ);
383}
384
385/**
386 * ieee80211_is_back - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_BACK
387 * @fc: frame control bytes in little-endian byteorder
388 */
389static inline int ieee80211_is_back(__le16 fc)
390{
391 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
392 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_BACK);
393}
394
395/**
396 * ieee80211_is_pspoll - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_PSPOLL
397 * @fc: frame control bytes in little-endian byteorder
398 */
399static inline int ieee80211_is_pspoll(__le16 fc)
400{
401 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
402 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_PSPOLL);
403}
404
405/**
406 * ieee80211_is_rts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_RTS
407 * @fc: frame control bytes in little-endian byteorder
408 */
409static inline int ieee80211_is_rts(__le16 fc)
410{
411 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
412 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
413}
414
415/**
416 * ieee80211_is_cts - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CTS
417 * @fc: frame control bytes in little-endian byteorder
418 */
419static inline int ieee80211_is_cts(__le16 fc)
420{
421 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
422 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CTS);
423}
424
425/**
426 * ieee80211_is_ack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_ACK
427 * @fc: frame control bytes in little-endian byteorder
428 */
429static inline int ieee80211_is_ack(__le16 fc)
430{
431 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
432 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_ACK);
433}
434
435/**
436 * ieee80211_is_cfend - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFEND
437 * @fc: frame control bytes in little-endian byteorder
438 */
439static inline int ieee80211_is_cfend(__le16 fc)
440{
441 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
442 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFEND);
443}
444
445/**
446 * ieee80211_is_cfendack - check if IEEE80211_FTYPE_CTL && IEEE80211_STYPE_CFENDACK
447 * @fc: frame control bytes in little-endian byteorder
448 */
449static inline int ieee80211_is_cfendack(__le16 fc)
450{
451 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
452 cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_CFENDACK);
453}
454
455/**
456 * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC
457 * @fc: frame control bytes in little-endian byteorder
458 */
459static inline int ieee80211_is_nullfunc(__le16 fc)
460{
461 return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) ==
462 cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC);
463}
112 464
113struct ieee80211s_hdr { 465struct ieee80211s_hdr {
114 u8 flags; 466 u8 flags;
@@ -119,6 +471,40 @@ struct ieee80211s_hdr {
119 u8 eaddr3[6]; 471 u8 eaddr3[6];
120} __attribute__ ((packed)); 472} __attribute__ ((packed));
121 473
474/**
475 * struct ieee80211_quiet_ie
476 *
477 * This structure refers to "Quiet information element"
478 */
479struct ieee80211_quiet_ie {
480 u8 count;
481 u8 period;
482 __le16 duration;
483 __le16 offset;
484} __attribute__ ((packed));
485
486/**
487 * struct ieee80211_msrment_ie
488 *
489 * This structure refers to "Measurement Request/Report information element"
490 */
491struct ieee80211_msrment_ie {
492 u8 token;
493 u8 mode;
494 u8 type;
495 u8 request[0];
496} __attribute__ ((packed));
497
498/**
499 * struct ieee80211_channel_sw_ie
500 *
501 * This structure refers to "Channel Switch Announcement information element"
502 */
503struct ieee80211_channel_sw_ie {
504 u8 mode;
505 u8 new_ch_num;
506 u8 count;
507} __attribute__ ((packed));
122 508
123struct ieee80211_mgmt { 509struct ieee80211_mgmt {
124 __le16 frame_control; 510 __le16 frame_control;
@@ -194,13 +580,18 @@ struct ieee80211_mgmt {
194 u8 action_code; 580 u8 action_code;
195 u8 element_id; 581 u8 element_id;
196 u8 length; 582 u8 length;
197 u8 switch_mode; 583 struct ieee80211_channel_sw_ie sw_elem;
198 u8 new_chan;
199 u8 switch_count;
200 } __attribute__((packed)) chan_switch; 584 } __attribute__((packed)) chan_switch;
201 struct{ 585 struct{
202 u8 action_code; 586 u8 action_code;
203 u8 dialog_token; 587 u8 dialog_token;
588 u8 element_id;
589 u8 length;
590 struct ieee80211_msrment_ie msr_elem;
591 } __attribute__((packed)) measurement;
592 struct{
593 u8 action_code;
594 u8 dialog_token;
204 __le16 capab; 595 __le16 capab;
205 __le16 timeout; 596 __le16 timeout;
206 __le16 start_seq_num; 597 __le16 start_seq_num;
@@ -269,6 +660,10 @@ struct ieee80211_bar {
269 __le16 start_seq_num; 660 __le16 start_seq_num;
270} __attribute__((packed)); 661} __attribute__((packed));
271 662
663/* 802.11 BAR control masks */
664#define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL 0x0000
665#define IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA 0x0004
666
272/** 667/**
273 * struct ieee80211_ht_cap - HT capabilities 668 * struct ieee80211_ht_cap - HT capabilities
274 * 669 *
@@ -306,20 +701,33 @@ struct ieee80211_ht_addt_info {
306#define IEEE80211_HT_CAP_SGI_40 0x0040 701#define IEEE80211_HT_CAP_SGI_40 0x0040
307#define IEEE80211_HT_CAP_DELAY_BA 0x0400 702#define IEEE80211_HT_CAP_DELAY_BA 0x0400
308#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 703#define IEEE80211_HT_CAP_MAX_AMSDU 0x0800
704/* 802.11n HT capability AMPDU settings */
309#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 705#define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03
310#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C 706#define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C
707/* 802.11n HT capability MSC set */
708#define IEEE80211_SUPP_MCS_SET_UEQM 4
709#define IEEE80211_HT_CAP_MAX_STREAMS 4
710#define IEEE80211_SUPP_MCS_SET_LEN 10
711/* maximum streams the spec allows */
712#define IEEE80211_HT_CAP_MCS_TX_DEFINED 0x01
713#define IEEE80211_HT_CAP_MCS_TX_RX_DIFF 0x02
714#define IEEE80211_HT_CAP_MCS_TX_STREAMS 0x0C
715#define IEEE80211_HT_CAP_MCS_TX_UEQM 0x10
311/* 802.11n HT IE masks */ 716/* 802.11n HT IE masks */
312#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03 717#define IEEE80211_HT_IE_CHA_SEC_OFFSET 0x03
718#define IEEE80211_HT_IE_CHA_SEC_NONE 0x00
719#define IEEE80211_HT_IE_CHA_SEC_ABOVE 0x01
720#define IEEE80211_HT_IE_CHA_SEC_BELOW 0x03
313#define IEEE80211_HT_IE_CHA_WIDTH 0x04 721#define IEEE80211_HT_IE_CHA_WIDTH 0x04
314#define IEEE80211_HT_IE_HT_PROTECTION 0x0003 722#define IEEE80211_HT_IE_HT_PROTECTION 0x0003
315#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 723#define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004
316#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 724#define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010
317 725
318/* MIMO Power Save Modes */ 726/* MIMO Power Save Modes */
319#define WLAN_HT_CAP_MIMO_PS_STATIC 0 727#define WLAN_HT_CAP_MIMO_PS_STATIC 0
320#define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 728#define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1
321#define WLAN_HT_CAP_MIMO_PS_INVALID 2 729#define WLAN_HT_CAP_MIMO_PS_INVALID 2
322#define WLAN_HT_CAP_MIMO_PS_DISABLED 3 730#define WLAN_HT_CAP_MIMO_PS_DISABLED 3
323 731
324/* Authentication algorithms */ 732/* Authentication algorithms */
325#define WLAN_AUTH_OPEN 0 733#define WLAN_AUTH_OPEN 0
@@ -337,11 +745,21 @@ struct ieee80211_ht_addt_info {
337#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5) 745#define WLAN_CAPABILITY_SHORT_PREAMBLE (1<<5)
338#define WLAN_CAPABILITY_PBCC (1<<6) 746#define WLAN_CAPABILITY_PBCC (1<<6)
339#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7) 747#define WLAN_CAPABILITY_CHANNEL_AGILITY (1<<7)
748
340/* 802.11h */ 749/* 802.11h */
341#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8) 750#define WLAN_CAPABILITY_SPECTRUM_MGMT (1<<8)
342#define WLAN_CAPABILITY_QOS (1<<9) 751#define WLAN_CAPABILITY_QOS (1<<9)
343#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 752#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
344#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 753#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
754/* measurement */
755#define IEEE80211_SPCT_MSR_RPRT_MODE_LATE (1<<0)
756#define IEEE80211_SPCT_MSR_RPRT_MODE_INCAPABLE (1<<1)
757#define IEEE80211_SPCT_MSR_RPRT_MODE_REFUSED (1<<2)
758
759#define IEEE80211_SPCT_MSR_RPRT_TYPE_BASIC 0
760#define IEEE80211_SPCT_MSR_RPRT_TYPE_CCA 1
761#define IEEE80211_SPCT_MSR_RPRT_TYPE_RPI 2
762
345 763
346/* 802.11g ERP information element */ 764/* 802.11g ERP information element */
347#define WLAN_ERP_NON_ERP_PRESENT (1<<0) 765#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
@@ -512,6 +930,15 @@ enum ieee80211_category {
512 WLAN_CATEGORY_WMM = 17, 930 WLAN_CATEGORY_WMM = 17,
513}; 931};
514 932
933/* SPECTRUM_MGMT action code */
934enum ieee80211_spectrum_mgmt_actioncode {
935 WLAN_ACTION_SPCT_MSR_REQ = 0,
936 WLAN_ACTION_SPCT_MSR_RPRT = 1,
937 WLAN_ACTION_SPCT_TPC_REQ = 2,
938 WLAN_ACTION_SPCT_TPC_RPRT = 3,
939 WLAN_ACTION_SPCT_CHL_SWITCH = 4,
940};
941
515/* BACK action code */ 942/* BACK action code */
516enum ieee80211_back_actioncode { 943enum ieee80211_back_actioncode {
517 WLAN_ACTION_ADDBA_REQ = 0, 944 WLAN_ACTION_ADDBA_REQ = 0,
@@ -540,63 +967,57 @@ enum ieee80211_back_parties {
540#define WLAN_MAX_KEY_LEN 32 967#define WLAN_MAX_KEY_LEN 32
541 968
542/** 969/**
970 * ieee80211_get_qos_ctl - get pointer to qos control bytes
971 * @hdr: the frame
972 *
973 * The qos ctrl bytes come after the frame_control, duration, seq_num
974 * and 3 or 4 addresses of length ETH_ALEN.
975 * 3 addr: 2 + 2 + 2 + 3*6 = 24
976 * 4 addr: 2 + 2 + 2 + 4*6 = 30
977 */
978static inline u8 *ieee80211_get_qos_ctl(struct ieee80211_hdr *hdr)
979{
980 if (ieee80211_has_a4(hdr->frame_control))
981 return (u8 *)hdr + 30;
982 else
983 return (u8 *)hdr + 24;
984}
985
986/**
543 * ieee80211_get_SA - get pointer to SA 987 * ieee80211_get_SA - get pointer to SA
988 * @hdr: the frame
544 * 989 *
545 * Given an 802.11 frame, this function returns the offset 990 * Given an 802.11 frame, this function returns the offset
546 * to the source address (SA). It does not verify that the 991 * to the source address (SA). It does not verify that the
547 * header is long enough to contain the address, and the 992 * header is long enough to contain the address, and the
548 * header must be long enough to contain the frame control 993 * header must be long enough to contain the frame control
549 * field. 994 * field.
550 *
551 * @hdr: the frame
552 */ 995 */
553static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr) 996static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
554{ 997{
555 u8 *raw = (u8 *) hdr; 998 if (ieee80211_has_a4(hdr->frame_control))
556 u8 tofrom = (*(raw+1)) & 3; /* get the TODS and FROMDS bits */ 999 return hdr->addr4;
557 1000 if (ieee80211_has_fromds(hdr->frame_control))
558 switch (tofrom) { 1001 return hdr->addr3;
559 case 2:
560 return hdr->addr3;
561 case 3:
562 return hdr->addr4;
563 }
564 return hdr->addr2; 1002 return hdr->addr2;
565} 1003}
566 1004
567/** 1005/**
568 * ieee80211_get_DA - get pointer to DA 1006 * ieee80211_get_DA - get pointer to DA
1007 * @hdr: the frame
569 * 1008 *
570 * Given an 802.11 frame, this function returns the offset 1009 * Given an 802.11 frame, this function returns the offset
571 * to the destination address (DA). It does not verify that 1010 * to the destination address (DA). It does not verify that
572 * the header is long enough to contain the address, and the 1011 * the header is long enough to contain the address, and the
573 * header must be long enough to contain the frame control 1012 * header must be long enough to contain the frame control
574 * field. 1013 * field.
575 *
576 * @hdr: the frame
577 */ 1014 */
578static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr) 1015static inline u8 *ieee80211_get_DA(struct ieee80211_hdr *hdr)
579{ 1016{
580 u8 *raw = (u8 *) hdr; 1017 if (ieee80211_has_tods(hdr->frame_control))
581 u8 to_ds = (*(raw+1)) & 1; /* get the TODS bit */
582
583 if (to_ds)
584 return hdr->addr3; 1018 return hdr->addr3;
585 return hdr->addr1; 1019 else
586} 1020 return hdr->addr1;
587
588/**
589 * ieee80211_get_morefrag - determine whether the MOREFRAGS bit is set
590 *
591 * This function determines whether the "more fragments" bit is set
592 * in the frame.
593 *
594 * @hdr: the frame
595 */
596static inline int ieee80211_get_morefrag(struct ieee80211_hdr *hdr)
597{
598 return (le16_to_cpu(hdr->frame_control) &
599 IEEE80211_FCTL_MOREFRAGS) != 0;
600} 1021}
601 1022
602#endif /* IEEE80211_H */ 1023#endif /* IEEE80211_H */
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 950e13d09e06..6badb3e2c4e4 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -4,8 +4,6 @@
4 * Authors: 4 * Authors:
5 * Lennert Buytenhek <buytenh@gnu.org> 5 * Lennert Buytenhek <buytenh@gnu.org>
6 * 6 *
7 * $Id: if_bridge.h,v 1.1 2000/02/18 16:47:01 davem Exp $
8 *
9 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index 0f2f70d4e48c..c3b1f8562709 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -1,5 +1,3 @@
1/* $Id: if_ppp.h,v 1.21 2000/03/27 06:03:36 paulus Exp $ */
2
3/* 1/*
4 * if_ppp.h - Point-to-Point Protocol definitions. 2 * if_ppp.h - Point-to-Point Protocol definitions.
5 * 3 *
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 8c71fe2fb1f5..563fae542da6 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -11,8 +11,6 @@
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details. 13 * GNU General Public License for more details.
14 *
15 * $Id: if_tun.h,v 1.2 2001/06/01 18:39:47 davem Exp $
16 */ 14 */
17 15
18#ifndef __IF_TUN_H 16#ifndef __IF_TUN_H
@@ -33,6 +31,7 @@
33#define TUN_NO_PI 0x0040 31#define TUN_NO_PI 0x0040
34#define TUN_ONE_QUEUE 0x0080 32#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100 33#define TUN_PERSIST 0x0100
34#define TUN_VNET_HDR 0x0200
36 35
37/* Ioctl defines */ 36/* Ioctl defines */
38#define TUNSETNOCSUM _IOW('T', 200, int) 37#define TUNSETNOCSUM _IOW('T', 200, int)
@@ -42,12 +41,21 @@
42#define TUNSETOWNER _IOW('T', 204, int) 41#define TUNSETOWNER _IOW('T', 204, int)
43#define TUNSETLINK _IOW('T', 205, int) 42#define TUNSETLINK _IOW('T', 205, int)
44#define TUNSETGROUP _IOW('T', 206, int) 43#define TUNSETGROUP _IOW('T', 206, int)
44#define TUNGETFEATURES _IOR('T', 207, unsigned int)
45#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
45 46
46/* TUNSETIFF ifr flags */ 47/* TUNSETIFF ifr flags */
47#define IFF_TUN 0x0001 48#define IFF_TUN 0x0001
48#define IFF_TAP 0x0002 49#define IFF_TAP 0x0002
49#define IFF_NO_PI 0x1000 50#define IFF_NO_PI 0x1000
50#define IFF_ONE_QUEUE 0x2000 51#define IFF_ONE_QUEUE 0x2000
52#define IFF_VNET_HDR 0x4000
53
54/* Features for GSO (TUNSETOFFLOAD). */
55#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
56#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
57#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
58#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
51 59
52struct tun_pi { 60struct tun_pi {
53 unsigned short flags; 61 unsigned short flags;
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 15ace02b7b24..93f5d9b0e9f9 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -14,10 +14,6 @@
14#define _LINUX_IF_VLAN_H_ 14#define _LINUX_IF_VLAN_H_
15 15
16#ifdef __KERNEL__ 16#ifdef __KERNEL__
17
18/* externally defined structs */
19struct hlist_node;
20
21#include <linux/netdevice.h> 17#include <linux/netdevice.h>
22#include <linux/etherdevice.h> 18#include <linux/etherdevice.h>
23 19
@@ -91,7 +87,7 @@ struct vlan_group {
91}; 87};
92 88
93static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, 89static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
94 unsigned int vlan_id) 90 u16 vlan_id)
95{ 91{
96 struct net_device **array; 92 struct net_device **array;
97 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; 93 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
@@ -99,7 +95,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
99} 95}
100 96
101static inline void vlan_group_set_device(struct vlan_group *vg, 97static inline void vlan_group_set_device(struct vlan_group *vg,
102 unsigned int vlan_id, 98 u16 vlan_id,
103 struct net_device *dev) 99 struct net_device *dev)
104{ 100{
105 struct net_device **array; 101 struct net_device **array;
@@ -109,56 +105,6 @@ static inline void vlan_group_set_device(struct vlan_group *vg,
109 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; 105 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
110} 106}
111 107
112struct vlan_priority_tci_mapping {
113 u32 priority;
114 unsigned short vlan_qos; /* This should be shifted when first set, so we only do it
115 * at provisioning time.
116 * ((skb->priority << 13) & 0xE000)
117 */
118 struct vlan_priority_tci_mapping *next;
119};
120
121/* Holds information that makes sense if this device is a VLAN device. */
122struct vlan_dev_info {
123 /** This will be the mapping that correlates skb->priority to
124 * 3 bits of VLAN QOS tags...
125 */
126 unsigned int nr_ingress_mappings;
127 u32 ingress_priority_map[8];
128
129 unsigned int nr_egress_mappings;
130 struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */
131
132 unsigned short vlan_id; /* The VLAN Identifier for this interface. */
133 unsigned short flags; /* (1 << 0) re_order_header This option will cause the
134 * VLAN code to move around the ethernet header on
135 * ingress to make the skb look **exactly** like it
136 * came in from an ethernet port. This destroys some of
137 * the VLAN information in the skb, but it fixes programs
138 * like DHCP that use packet-filtering and don't understand
139 * 802.1Q
140 */
141 struct net_device *real_dev; /* the underlying device/interface */
142 unsigned char real_dev_addr[ETH_ALEN];
143 struct proc_dir_entry *dent; /* Holds the proc data */
144 unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */
145 unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */
146};
147
148static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev)
149{
150 return netdev_priv(dev);
151}
152
153/* inline functions */
154static inline __u32 vlan_get_ingress_priority(struct net_device *dev,
155 unsigned short vlan_tag)
156{
157 struct vlan_dev_info *vip = vlan_dev_info(dev);
158
159 return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7];
160}
161
162/* VLAN tx hw acceleration helpers. */ 108/* VLAN tx hw acceleration helpers. */
163struct vlan_skb_tx_cookie { 109struct vlan_skb_tx_cookie {
164 u32 magic; 110 u32 magic;
@@ -171,102 +117,78 @@ struct vlan_skb_tx_cookie {
171 (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC) 117 (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC)
172#define vlan_tx_tag_get(__skb) (VLAN_TX_SKB_CB(__skb)->vlan_tag) 118#define vlan_tx_tag_get(__skb) (VLAN_TX_SKB_CB(__skb)->vlan_tag)
173 119
174/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */ 120#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
175static inline int __vlan_hwaccel_rx(struct sk_buff *skb, 121extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
176 struct vlan_group *grp, 122extern u16 vlan_dev_vlan_id(const struct net_device *dev);
177 unsigned short vlan_tag, int polling)
178{
179 struct net_device_stats *stats;
180 123
181 if (skb_bond_should_drop(skb)) { 124extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
182 dev_kfree_skb_any(skb); 125 u16 vlan_tci, int polling);
183 return NET_RX_DROP; 126#else
184 } 127static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
185 128{
186 skb->dev = vlan_group_get_device(grp, vlan_tag & VLAN_VID_MASK); 129 BUG();
187 if (skb->dev == NULL) { 130 return NULL;
188 dev_kfree_skb_any(skb); 131}
189 132
190 /* Not NET_RX_DROP, this is not being dropped 133static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
191 * due to congestion. 134{
192 */ 135 BUG();
193 return 0; 136 return 0;
194 } 137}
195 138
196 skb->dev->last_rx = jiffies; 139static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
197 140 u16 vlan_tci, int polling)
198 stats = &skb->dev->stats; 141{
199 stats->rx_packets++; 142 BUG();
200 stats->rx_bytes += skb->len; 143 return NET_XMIT_SUCCESS;
201
202 skb->priority = vlan_get_ingress_priority(skb->dev, vlan_tag);
203 switch (skb->pkt_type) {
204 case PACKET_BROADCAST:
205 break;
206
207 case PACKET_MULTICAST:
208 stats->multicast++;
209 break;
210
211 case PACKET_OTHERHOST:
212 /* Our lower layer thinks this is not local, let's make sure.
213 * This allows the VLAN to have a different MAC than the underlying
214 * device, and still route correctly.
215 */
216 if (!compare_ether_addr(eth_hdr(skb)->h_dest,
217 skb->dev->dev_addr))
218 skb->pkt_type = PACKET_HOST;
219 break;
220 };
221
222 return (polling ? netif_receive_skb(skb) : netif_rx(skb));
223} 144}
145#endif
224 146
147/**
148 * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration
149 * @skb: buffer
150 * @grp: vlan group
151 * @vlan_tci: VLAN TCI as received from the card
152 */
225static inline int vlan_hwaccel_rx(struct sk_buff *skb, 153static inline int vlan_hwaccel_rx(struct sk_buff *skb,
226 struct vlan_group *grp, 154 struct vlan_group *grp,
227 unsigned short vlan_tag) 155 u16 vlan_tci)
228{ 156{
229 return __vlan_hwaccel_rx(skb, grp, vlan_tag, 0); 157 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
230} 158}
231 159
160/**
161 * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
162 * @skb: buffer
163 * @grp: vlan group
164 * @vlan_tci: VLAN TCI as received from the card
165 */
232static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, 166static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
233 struct vlan_group *grp, 167 struct vlan_group *grp,
234 unsigned short vlan_tag) 168 u16 vlan_tci)
235{ 169{
236 return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); 170 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
237} 171}
238 172
239/** 173/**
240 * __vlan_put_tag - regular VLAN tag inserting 174 * __vlan_put_tag - regular VLAN tag inserting
241 * @skb: skbuff to tag 175 * @skb: skbuff to tag
242 * @tag: VLAN tag to insert 176 * @vlan_tci: VLAN TCI to insert
243 * 177 *
244 * Inserts the VLAN tag into @skb as part of the payload 178 * Inserts the VLAN tag into @skb as part of the payload
245 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed. 179 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
246 * 180 *
247 * Following the skb_unshare() example, in case of error, the calling function 181 * Following the skb_unshare() example, in case of error, the calling function
248 * doesn't have to worry about freeing the original skb. 182 * doesn't have to worry about freeing the original skb.
249 */ 183 */
250static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) 184static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
251{ 185{
252 struct vlan_ethhdr *veth; 186 struct vlan_ethhdr *veth;
253 187
254 if (skb_headroom(skb) < VLAN_HLEN) { 188 if (skb_cow_head(skb, VLAN_HLEN) < 0) {
255 struct sk_buff *sk_tmp = skb; 189 kfree_skb(skb);
256 skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); 190 return NULL;
257 kfree_skb(sk_tmp);
258 if (!skb) {
259 printk(KERN_ERR "vlan: failed to realloc headroom\n");
260 return NULL;
261 }
262 } else {
263 skb = skb_unshare(skb, GFP_ATOMIC);
264 if (!skb) {
265 printk(KERN_ERR "vlan: failed to unshare skbuff\n");
266 return NULL;
267 }
268 } 191 }
269
270 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); 192 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
271 193
272 /* Move the mac addresses to the beginning of the new header. */ 194 /* Move the mac addresses to the beginning of the new header. */
@@ -275,12 +197,10 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
275 /* first, the ethernet type */ 197 /* first, the ethernet type */
276 veth->h_vlan_proto = htons(ETH_P_8021Q); 198 veth->h_vlan_proto = htons(ETH_P_8021Q);
277 199
278 /* now, the tag */ 200 /* now, the TCI */
279 veth->h_vlan_TCI = htons(tag); 201 veth->h_vlan_TCI = htons(vlan_tci);
280 202
281 skb->protocol = htons(ETH_P_8021Q); 203 skb->protocol = htons(ETH_P_8021Q);
282 skb->mac_header -= VLAN_HLEN;
283 skb->network_header -= VLAN_HLEN;
284 204
285 return skb; 205 return skb;
286} 206}
@@ -288,17 +208,18 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
288/** 208/**
289 * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting 209 * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting
290 * @skb: skbuff to tag 210 * @skb: skbuff to tag
291 * @tag: VLAN tag to insert 211 * @vlan_tci: VLAN TCI to insert
292 * 212 *
293 * Puts the VLAN tag in @skb->cb[] and lets the device do the rest 213 * Puts the VLAN TCI in @skb->cb[] and lets the device do the rest
294 */ 214 */
295static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) 215static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
216 u16 vlan_tci)
296{ 217{
297 struct vlan_skb_tx_cookie *cookie; 218 struct vlan_skb_tx_cookie *cookie;
298 219
299 cookie = VLAN_TX_SKB_CB(skb); 220 cookie = VLAN_TX_SKB_CB(skb);
300 cookie->magic = VLAN_TX_COOKIE_MAGIC; 221 cookie->magic = VLAN_TX_COOKIE_MAGIC;
301 cookie->vlan_tag = tag; 222 cookie->vlan_tag = vlan_tci;
302 223
303 return skb; 224 return skb;
304} 225}
@@ -308,28 +229,28 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsign
308/** 229/**
309 * vlan_put_tag - inserts VLAN tag according to device features 230 * vlan_put_tag - inserts VLAN tag according to device features
310 * @skb: skbuff to tag 231 * @skb: skbuff to tag
311 * @tag: VLAN tag to insert 232 * @vlan_tci: VLAN TCI to insert
312 * 233 *
313 * Assumes skb->dev is the target that will xmit this frame. 234 * Assumes skb->dev is the target that will xmit this frame.
314 * Returns a VLAN tagged skb. 235 * Returns a VLAN tagged skb.
315 */ 236 */
316static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) 237static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
317{ 238{
318 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 239 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
319 return __vlan_hwaccel_put_tag(skb, tag); 240 return __vlan_hwaccel_put_tag(skb, vlan_tci);
320 } else { 241 } else {
321 return __vlan_put_tag(skb, tag); 242 return __vlan_put_tag(skb, vlan_tci);
322 } 243 }
323} 244}
324 245
325/** 246/**
326 * __vlan_get_tag - get the VLAN ID that is part of the payload 247 * __vlan_get_tag - get the VLAN ID that is part of the payload
327 * @skb: skbuff to query 248 * @skb: skbuff to query
328 * @tag: buffer to store vlaue 249 * @vlan_tci: buffer to store vlaue
329 * 250 *
330 * Returns error if the skb is not of VLAN type 251 * Returns error if the skb is not of VLAN type
331 */ 252 */
332static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) 253static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
333{ 254{
334 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; 255 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
335 256
@@ -337,29 +258,28 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
337 return -EINVAL; 258 return -EINVAL;
338 } 259 }
339 260
340 *tag = ntohs(veth->h_vlan_TCI); 261 *vlan_tci = ntohs(veth->h_vlan_TCI);
341
342 return 0; 262 return 0;
343} 263}
344 264
345/** 265/**
346 * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] 266 * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[]
347 * @skb: skbuff to query 267 * @skb: skbuff to query
348 * @tag: buffer to store vlaue 268 * @vlan_tci: buffer to store vlaue
349 * 269 *
350 * Returns error if @skb->cb[] is not set correctly 270 * Returns error if @skb->cb[] is not set correctly
351 */ 271 */
352static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, 272static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
353 unsigned short *tag) 273 u16 *vlan_tci)
354{ 274{
355 struct vlan_skb_tx_cookie *cookie; 275 struct vlan_skb_tx_cookie *cookie;
356 276
357 cookie = VLAN_TX_SKB_CB(skb); 277 cookie = VLAN_TX_SKB_CB(skb);
358 if (cookie->magic == VLAN_TX_COOKIE_MAGIC) { 278 if (cookie->magic == VLAN_TX_COOKIE_MAGIC) {
359 *tag = cookie->vlan_tag; 279 *vlan_tci = cookie->vlan_tag;
360 return 0; 280 return 0;
361 } else { 281 } else {
362 *tag = 0; 282 *vlan_tci = 0;
363 return -EINVAL; 283 return -EINVAL;
364 } 284 }
365} 285}
@@ -369,16 +289,16 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
369/** 289/**
370 * vlan_get_tag - get the VLAN ID from the skb 290 * vlan_get_tag - get the VLAN ID from the skb
371 * @skb: skbuff to query 291 * @skb: skbuff to query
372 * @tag: buffer to store vlaue 292 * @vlan_tci: buffer to store vlaue
373 * 293 *
374 * Returns error if the skb is not VLAN tagged 294 * Returns error if the skb is not VLAN tagged
375 */ 295 */
376static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) 296static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
377{ 297{
378 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 298 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
379 return __vlan_hwaccel_get_tag(skb, tag); 299 return __vlan_hwaccel_get_tag(skb, vlan_tci);
380 } else { 300 } else {
381 return __vlan_get_tag(skb, tag); 301 return __vlan_get_tag(skb, vlan_tci);
382 } 302 }
383} 303}
384 304
@@ -402,6 +322,7 @@ enum vlan_ioctl_cmds {
402 322
403enum vlan_flags { 323enum vlan_flags {
404 VLAN_FLAG_REORDER_HDR = 0x1, 324 VLAN_FLAG_REORDER_HDR = 0x1,
325 VLAN_FLAG_GVRP = 0x2,
405}; 326};
406 327
407enum vlan_name_types { 328enum vlan_name_types {
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index f5a1a0db2e8e..7bb3c095c15b 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -228,7 +228,6 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf,
228extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, 228extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf,
229 struct group_filter __user *optval, int __user *optlen); 229 struct group_filter __user *optval, int __user *optlen);
230extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); 230extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif);
231extern void ip_mr_init(void);
232extern void ip_mc_init_dev(struct in_device *); 231extern void ip_mc_init_dev(struct in_device *);
233extern void ip_mc_destroy_dev(struct in_device *); 232extern void ip_mc_destroy_dev(struct in_device *);
234extern void ip_mc_up(struct in_device *); 233extern void ip_mc_up(struct in_device *);
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index af3f4a70f3df..1e7cc4af40de 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -1,7 +1,3 @@
1/*
2 * $Id$
3 */
4
5#ifndef _IP6_TUNNEL_H 1#ifndef _IP6_TUNNEL_H
6#define _IP6_TUNNEL_H 2#define _IP6_TUNNEL_H
7 3
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index cde056e08181..391ad0843a46 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -163,6 +163,8 @@ struct ipv6_devconf {
163#ifdef CONFIG_IPV6_MROUTE 163#ifdef CONFIG_IPV6_MROUTE
164 __s32 mc_forwarding; 164 __s32 mc_forwarding;
165#endif 165#endif
166 __s32 disable_ipv6;
167 __s32 accept_dad;
166 void *sysctl; 168 void *sysctl;
167}; 169};
168 170
@@ -194,6 +196,8 @@ enum {
194 DEVCONF_OPTIMISTIC_DAD, 196 DEVCONF_OPTIMISTIC_DAD,
195 DEVCONF_ACCEPT_SOURCE_ROUTE, 197 DEVCONF_ACCEPT_SOURCE_ROUTE,
196 DEVCONF_MC_FORWARDING, 198 DEVCONF_MC_FORWARDING,
199 DEVCONF_DISABLE_IPV6,
200 DEVCONF_ACCEPT_DAD,
197 DEVCONF_MAX 201 DEVCONF_MAX
198}; 202};
199 203
diff --git a/include/linux/mroute.h b/include/linux/mroute.h
index de4decfa1bfc..07112ee9293a 100644
--- a/include/linux/mroute.h
+++ b/include/linux/mroute.h
@@ -144,11 +144,37 @@ static inline int ip_mroute_opt(int opt)
144} 144}
145#endif 145#endif
146 146
147#ifdef CONFIG_IP_MROUTE
147extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int); 148extern int ip_mroute_setsockopt(struct sock *, int, char __user *, int);
148extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *); 149extern int ip_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
149extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg); 150extern int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg);
150extern void ip_mr_init(void); 151extern int ip_mr_init(void);
152#else
153static inline
154int ip_mroute_setsockopt(struct sock *sock,
155 int optname, char __user *optval, int optlen)
156{
157 return -ENOPROTOOPT;
158}
159
160static inline
161int ip_mroute_getsockopt(struct sock *sock,
162 int optname, char __user *optval, int __user *optlen)
163{
164 return -ENOPROTOOPT;
165}
151 166
167static inline
168int ipmr_ioctl(struct sock *sk, int cmd, void __user *arg)
169{
170 return -ENOIOCTLCMD;
171}
172
173static inline int ip_mr_init(void)
174{
175 return 0;
176}
177#endif
152 178
153struct vif_device 179struct vif_device
154{ 180{
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index e7989593142b..5cf50473a10f 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -131,11 +131,44 @@ static inline int ip6_mroute_opt(int opt)
131 131
132struct sock; 132struct sock;
133 133
134#ifdef CONFIG_IPV6_MROUTE
134extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); 135extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int);
135extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); 136extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *);
136extern int ip6_mr_input(struct sk_buff *skb); 137extern int ip6_mr_input(struct sk_buff *skb);
137extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); 138extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg);
138extern void ip6_mr_init(void); 139extern int ip6_mr_init(void);
140extern void ip6_mr_cleanup(void);
141#else
142static inline
143int ip6_mroute_setsockopt(struct sock *sock,
144 int optname, char __user *optval, int optlen)
145{
146 return -ENOPROTOOPT;
147}
148
149static inline
150int ip6_mroute_getsockopt(struct sock *sock,
151 int optname, char __user *optval, int __user *optlen)
152{
153 return -ENOPROTOOPT;
154}
155
156static inline
157int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg)
158{
159 return -ENOIOCTLCMD;
160}
161
162static inline int ip6_mr_init(void)
163{
164 return 0;
165}
166
167static inline void ip6_mr_cleanup(void)
168{
169 return;
170}
171#endif
139 172
140struct mif_device 173struct mif_device
141{ 174{
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h
index a15cdd4a8e58..12078577aef6 100644
--- a/include/linux/mv643xx_eth.h
+++ b/include/linux/mv643xx_eth.h
@@ -17,30 +17,59 @@
17 17
18struct mv643xx_eth_shared_platform_data { 18struct mv643xx_eth_shared_platform_data {
19 struct mbus_dram_target_info *dram; 19 struct mbus_dram_target_info *dram;
20 unsigned int t_clk; 20 unsigned int t_clk;
21}; 21};
22 22
23struct mv643xx_eth_platform_data { 23struct mv643xx_eth_platform_data {
24 /*
25 * Pointer back to our parent instance, and our port number.
26 */
24 struct platform_device *shared; 27 struct platform_device *shared;
25 int port_number; 28 int port_number;
26 29
30 /*
31 * Whether a PHY is present, and if yes, at which address.
32 */
27 struct platform_device *shared_smi; 33 struct platform_device *shared_smi;
34 int force_phy_addr;
35 int phy_addr;
28 36
29 u16 force_phy_addr; /* force override if phy_addr == 0 */ 37 /*
30 u16 phy_addr; 38 * Use this MAC address if it is valid, overriding the
31 39 * address that is already in the hardware.
32 /* If speed is 0, then speed and duplex are autonegotiated. */ 40 */
33 int speed; /* 0, SPEED_10, SPEED_100, SPEED_1000 */ 41 u8 mac_addr[6];
34 int duplex; /* DUPLEX_HALF or DUPLEX_FULL */ 42
35 43 /*
36 /* non-zero values of the following fields override defaults */ 44 * If speed is 0, autonegotiation is enabled.
37 u32 tx_queue_size; 45 * Valid values for speed: 0, SPEED_10, SPEED_100, SPEED_1000.
38 u32 rx_queue_size; 46 * Valid values for duplex: DUPLEX_HALF, DUPLEX_FULL.
39 u32 tx_sram_addr; 47 */
40 u32 tx_sram_size; 48 int speed;
41 u32 rx_sram_addr; 49 int duplex;
42 u32 rx_sram_size; 50
43 u8 mac_addr[6]; /* mac address if non-zero*/ 51 /*
52 * Which RX/TX queues to use.
53 */
54 int rx_queue_mask;
55 int tx_queue_mask;
56
57 /*
58 * Override default RX/TX queue sizes if nonzero.
59 */
60 int rx_queue_size;
61 int tx_queue_size;
62
63 /*
64 * Use on-chip SRAM for RX/TX descriptors if size is nonzero
65 * and sufficient to contain all descriptors for the requested
66 * ring sizes.
67 */
68 unsigned long rx_sram_addr;
69 int rx_sram_size;
70 unsigned long tx_sram_addr;
71 int tx_sram_size;
44}; 72};
45 73
46#endif /* __LINUX_MV643XX_ETH_H */ 74
75#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index 71f7dd559285..150a48c68d52 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -106,23 +106,23 @@ enum sock_shutdown_cmd {
106/** 106/**
107 * struct socket - general BSD socket 107 * struct socket - general BSD socket
108 * @state: socket state (%SS_CONNECTED, etc) 108 * @state: socket state (%SS_CONNECTED, etc)
109 * @type: socket type (%SOCK_STREAM, etc)
109 * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc) 110 * @flags: socket flags (%SOCK_ASYNC_NOSPACE, etc)
110 * @ops: protocol specific socket operations 111 * @ops: protocol specific socket operations
111 * @fasync_list: Asynchronous wake up list 112 * @fasync_list: Asynchronous wake up list
112 * @file: File back pointer for gc 113 * @file: File back pointer for gc
113 * @sk: internal networking protocol agnostic socket representation 114 * @sk: internal networking protocol agnostic socket representation
114 * @wait: wait queue for several uses 115 * @wait: wait queue for several uses
115 * @type: socket type (%SOCK_STREAM, etc)
116 */ 116 */
117struct socket { 117struct socket {
118 socket_state state; 118 socket_state state;
119 short type;
119 unsigned long flags; 120 unsigned long flags;
120 const struct proto_ops *ops; 121 const struct proto_ops *ops;
121 struct fasync_struct *fasync_list; 122 struct fasync_struct *fasync_list;
122 struct file *file; 123 struct file *file;
123 struct sock *sk; 124 struct sock *sk;
124 wait_queue_head_t wait; 125 wait_queue_head_t wait;
125 short type;
126}; 126};
127 127
128struct vm_area_struct; 128struct vm_area_struct;
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 25f87102ab66..203c5504fe43 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -281,14 +281,12 @@ struct header_ops {
281 281
282enum netdev_state_t 282enum netdev_state_t
283{ 283{
284 __LINK_STATE_XOFF=0,
285 __LINK_STATE_START, 284 __LINK_STATE_START,
286 __LINK_STATE_PRESENT, 285 __LINK_STATE_PRESENT,
287 __LINK_STATE_SCHED, 286 __LINK_STATE_SCHED,
288 __LINK_STATE_NOCARRIER, 287 __LINK_STATE_NOCARRIER,
289 __LINK_STATE_LINKWATCH_PENDING, 288 __LINK_STATE_LINKWATCH_PENDING,
290 __LINK_STATE_DORMANT, 289 __LINK_STATE_DORMANT,
291 __LINK_STATE_QDISC_RUNNING,
292}; 290};
293 291
294 292
@@ -448,6 +446,25 @@ static inline void napi_synchronize(const struct napi_struct *n)
448# define napi_synchronize(n) barrier() 446# define napi_synchronize(n) barrier()
449#endif 447#endif
450 448
449enum netdev_queue_state_t
450{
451 __QUEUE_STATE_XOFF,
452 __QUEUE_STATE_QDISC_RUNNING,
453};
454
455struct netdev_queue {
456 spinlock_t lock;
457 struct net_device *dev;
458 struct Qdisc *qdisc;
459 unsigned long state;
460 struct sk_buff *gso_skb;
461 spinlock_t _xmit_lock;
462 int xmit_lock_owner;
463 struct Qdisc *qdisc_sleeping;
464 struct list_head qdisc_list;
465 struct netdev_queue *next_sched;
466};
467
451/* 468/*
452 * The DEVICE structure. 469 * The DEVICE structure.
453 * Actually, this whole structure is a big mistake. It mixes I/O 470 * Actually, this whole structure is a big mistake. It mixes I/O
@@ -537,8 +554,6 @@ struct net_device
537#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) 554#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
538#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM) 555#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
539 556
540 struct net_device *next_sched;
541
542 /* Interface index. Unique device identifier */ 557 /* Interface index. Unique device identifier */
543 int ifindex; 558 int ifindex;
544 int iflink; 559 int iflink;
@@ -599,8 +614,8 @@ struct net_device
599 int uc_promisc; 614 int uc_promisc;
600 struct dev_addr_list *mc_list; /* Multicast mac addresses */ 615 struct dev_addr_list *mc_list; /* Multicast mac addresses */
601 int mc_count; /* Number of installed mcasts */ 616 int mc_count; /* Number of installed mcasts */
602 int promiscuity; 617 unsigned int promiscuity;
603 int allmulti; 618 unsigned int allmulti;
604 619
605 620
606 /* Protocol specific pointers */ 621 /* Protocol specific pointers */
@@ -624,32 +639,13 @@ struct net_device
624 639
625 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 640 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
626 641
627 /* ingress path synchronizer */ 642 struct netdev_queue rx_queue;
628 spinlock_t ingress_lock; 643 struct netdev_queue tx_queue ____cacheline_aligned_in_smp;
629 struct Qdisc *qdisc_ingress;
630
631/*
632 * Cache line mostly used on queue transmit path (qdisc)
633 */
634 /* device queue lock */
635 spinlock_t queue_lock ____cacheline_aligned_in_smp;
636 struct Qdisc *qdisc;
637 struct Qdisc *qdisc_sleeping;
638 struct list_head qdisc_list;
639 unsigned long tx_queue_len; /* Max frames per queue allowed */ 644 unsigned long tx_queue_len; /* Max frames per queue allowed */
640 645
641 /* Partially transmitted GSO packet. */
642 struct sk_buff *gso_skb;
643
644/* 646/*
645 * One part is mostly used on xmit path (device) 647 * One part is mostly used on xmit path (device)
646 */ 648 */
647 /* hard_start_xmit synchronizer */
648 spinlock_t _xmit_lock ____cacheline_aligned_in_smp;
649 /* cpu id of processor entered to hard_start_xmit or -1,
650 if nobody entered there.
651 */
652 int xmit_lock_owner;
653 void *priv; /* pointer to private data */ 649 void *priv; /* pointer to private data */
654 int (*hard_start_xmit) (struct sk_buff *skb, 650 int (*hard_start_xmit) (struct sk_buff *skb,
655 struct net_device *dev); 651 struct net_device *dev);
@@ -740,6 +736,8 @@ struct net_device
740 struct net_bridge_port *br_port; 736 struct net_bridge_port *br_port;
741 /* macvlan */ 737 /* macvlan */
742 struct macvlan_port *macvlan_port; 738 struct macvlan_port *macvlan_port;
739 /* GARP */
740 struct garp_port *garp_port;
743 741
744 /* class/net/name entry */ 742 /* class/net/name entry */
745 struct device dev; 743 struct device dev;
@@ -890,6 +888,7 @@ extern struct net_device *__dev_get_by_name(struct net *net, const char *name);
890extern int dev_alloc_name(struct net_device *dev, const char *name); 888extern int dev_alloc_name(struct net_device *dev, const char *name);
891extern int dev_open(struct net_device *dev); 889extern int dev_open(struct net_device *dev);
892extern int dev_close(struct net_device *dev); 890extern int dev_close(struct net_device *dev);
891extern void dev_disable_lro(struct net_device *dev);
893extern int dev_queue_xmit(struct sk_buff *skb); 892extern int dev_queue_xmit(struct sk_buff *skb);
894extern int register_netdevice(struct net_device *dev); 893extern int register_netdevice(struct net_device *dev);
895extern void unregister_netdevice(struct net_device *dev); 894extern void unregister_netdevice(struct net_device *dev);
@@ -939,7 +938,7 @@ static inline int unregister_gifconf(unsigned int family)
939 */ 938 */
940struct softnet_data 939struct softnet_data
941{ 940{
942 struct net_device *output_queue; 941 struct netdev_queue *output_queue;
943 struct sk_buff_head input_pkt_queue; 942 struct sk_buff_head input_pkt_queue;
944 struct list_head poll_list; 943 struct list_head poll_list;
945 struct sk_buff *completion_queue; 944 struct sk_buff *completion_queue;
@@ -954,12 +953,17 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data);
954 953
955#define HAVE_NETIF_QUEUE 954#define HAVE_NETIF_QUEUE
956 955
957extern void __netif_schedule(struct net_device *dev); 956extern void __netif_schedule(struct netdev_queue *txq);
957
958static inline void netif_schedule_queue(struct netdev_queue *txq)
959{
960 if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
961 __netif_schedule(txq);
962}
958 963
959static inline void netif_schedule(struct net_device *dev) 964static inline void netif_schedule(struct net_device *dev)
960{ 965{
961 if (!test_bit(__LINK_STATE_XOFF, &dev->state)) 966 netif_schedule_queue(&dev->tx_queue);
962 __netif_schedule(dev);
963} 967}
964 968
965/** 969/**
@@ -968,9 +972,14 @@ static inline void netif_schedule(struct net_device *dev)
968 * 972 *
969 * Allow upper layers to call the device hard_start_xmit routine. 973 * Allow upper layers to call the device hard_start_xmit routine.
970 */ 974 */
975static inline void netif_tx_start_queue(struct netdev_queue *dev_queue)
976{
977 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
978}
979
971static inline void netif_start_queue(struct net_device *dev) 980static inline void netif_start_queue(struct net_device *dev)
972{ 981{
973 clear_bit(__LINK_STATE_XOFF, &dev->state); 982 netif_tx_start_queue(&dev->tx_queue);
974} 983}
975 984
976/** 985/**
@@ -980,16 +989,21 @@ static inline void netif_start_queue(struct net_device *dev)
980 * Allow upper layers to call the device hard_start_xmit routine. 989 * Allow upper layers to call the device hard_start_xmit routine.
981 * Used for flow control when transmit resources are available. 990 * Used for flow control when transmit resources are available.
982 */ 991 */
983static inline void netif_wake_queue(struct net_device *dev) 992static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue)
984{ 993{
985#ifdef CONFIG_NETPOLL_TRAP 994#ifdef CONFIG_NETPOLL_TRAP
986 if (netpoll_trap()) { 995 if (netpoll_trap()) {
987 clear_bit(__LINK_STATE_XOFF, &dev->state); 996 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
988 return; 997 return;
989 } 998 }
990#endif 999#endif
991 if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) 1000 if (test_and_clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state))
992 __netif_schedule(dev); 1001 __netif_schedule(dev_queue);
1002}
1003
1004static inline void netif_wake_queue(struct net_device *dev)
1005{
1006 netif_tx_wake_queue(&dev->tx_queue);
993} 1007}
994 1008
995/** 1009/**
@@ -999,9 +1013,14 @@ static inline void netif_wake_queue(struct net_device *dev)
999 * Stop upper layers calling the device hard_start_xmit routine. 1013 * Stop upper layers calling the device hard_start_xmit routine.
1000 * Used for flow control when transmit resources are unavailable. 1014 * Used for flow control when transmit resources are unavailable.
1001 */ 1015 */
1016static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue)
1017{
1018 set_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1019}
1020
1002static inline void netif_stop_queue(struct net_device *dev) 1021static inline void netif_stop_queue(struct net_device *dev)
1003{ 1022{
1004 set_bit(__LINK_STATE_XOFF, &dev->state); 1023 netif_tx_stop_queue(&dev->tx_queue);
1005} 1024}
1006 1025
1007/** 1026/**
@@ -1010,9 +1029,14 @@ static inline void netif_stop_queue(struct net_device *dev)
1010 * 1029 *
1011 * Test if transmit queue on device is currently unable to send. 1030 * Test if transmit queue on device is currently unable to send.
1012 */ 1031 */
1032static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1033{
1034 return test_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1035}
1036
1013static inline int netif_queue_stopped(const struct net_device *dev) 1037static inline int netif_queue_stopped(const struct net_device *dev)
1014{ 1038{
1015 return test_bit(__LINK_STATE_XOFF, &dev->state); 1039 return netif_tx_queue_stopped(&dev->tx_queue);
1016} 1040}
1017 1041
1018/** 1042/**
@@ -1042,9 +1066,7 @@ static inline int netif_running(const struct net_device *dev)
1042 */ 1066 */
1043static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) 1067static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1044{ 1068{
1045#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1069 clear_bit(__QUEUE_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
1046 clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
1047#endif
1048} 1070}
1049 1071
1050/** 1072/**
@@ -1056,13 +1078,11 @@ static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1056 */ 1078 */
1057static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) 1079static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
1058{ 1080{
1059#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1060#ifdef CONFIG_NETPOLL_TRAP 1081#ifdef CONFIG_NETPOLL_TRAP
1061 if (netpoll_trap()) 1082 if (netpoll_trap())
1062 return; 1083 return;
1063#endif 1084#endif
1064 set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); 1085 set_bit(__QUEUE_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
1065#endif
1066} 1086}
1067 1087
1068/** 1088/**
@@ -1075,12 +1095,8 @@ static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
1075static inline int __netif_subqueue_stopped(const struct net_device *dev, 1095static inline int __netif_subqueue_stopped(const struct net_device *dev,
1076 u16 queue_index) 1096 u16 queue_index)
1077{ 1097{
1078#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1098 return test_bit(__QUEUE_STATE_XOFF,
1079 return test_bit(__LINK_STATE_XOFF,
1080 &dev->egress_subqueue[queue_index].state); 1099 &dev->egress_subqueue[queue_index].state);
1081#else
1082 return 0;
1083#endif
1084} 1100}
1085 1101
1086static inline int netif_subqueue_stopped(const struct net_device *dev, 1102static inline int netif_subqueue_stopped(const struct net_device *dev,
@@ -1098,15 +1114,13 @@ static inline int netif_subqueue_stopped(const struct net_device *dev,
1098 */ 1114 */
1099static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) 1115static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1100{ 1116{
1101#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1102#ifdef CONFIG_NETPOLL_TRAP 1117#ifdef CONFIG_NETPOLL_TRAP
1103 if (netpoll_trap()) 1118 if (netpoll_trap())
1104 return; 1119 return;
1105#endif 1120#endif
1106 if (test_and_clear_bit(__LINK_STATE_XOFF, 1121 if (test_and_clear_bit(__QUEUE_STATE_XOFF,
1107 &dev->egress_subqueue[queue_index].state)) 1122 &dev->egress_subqueue[queue_index].state))
1108 __netif_schedule(dev); 1123 __netif_schedule(&dev->tx_queue);
1109#endif
1110} 1124}
1111 1125
1112/** 1126/**
@@ -1118,11 +1132,7 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1118 */ 1132 */
1119static inline int netif_is_multiqueue(const struct net_device *dev) 1133static inline int netif_is_multiqueue(const struct net_device *dev)
1120{ 1134{
1121#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1122 return (!!(NETIF_F_MULTI_QUEUE & dev->features)); 1135 return (!!(NETIF_F_MULTI_QUEUE & dev->features));
1123#else
1124 return 0;
1125#endif
1126} 1136}
1127 1137
1128/* Use this variant when it is known for sure that it 1138/* Use this variant when it is known for sure that it
@@ -1397,52 +1407,72 @@ static inline void netif_rx_complete(struct net_device *dev,
1397 * 1407 *
1398 * Get network device transmit lock 1408 * Get network device transmit lock
1399 */ 1409 */
1400static inline void __netif_tx_lock(struct net_device *dev, int cpu) 1410static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
1401{ 1411{
1402 spin_lock(&dev->_xmit_lock); 1412 spin_lock(&txq->_xmit_lock);
1403 dev->xmit_lock_owner = cpu; 1413 txq->xmit_lock_owner = cpu;
1404} 1414}
1405 1415
1406static inline void netif_tx_lock(struct net_device *dev) 1416static inline void netif_tx_lock(struct net_device *dev)
1407{ 1417{
1408 __netif_tx_lock(dev, smp_processor_id()); 1418 __netif_tx_lock(&dev->tx_queue, smp_processor_id());
1419}
1420
1421static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
1422{
1423 spin_lock_bh(&txq->_xmit_lock);
1424 txq->xmit_lock_owner = smp_processor_id();
1409} 1425}
1410 1426
1411static inline void netif_tx_lock_bh(struct net_device *dev) 1427static inline void netif_tx_lock_bh(struct net_device *dev)
1412{ 1428{
1413 spin_lock_bh(&dev->_xmit_lock); 1429 __netif_tx_lock_bh(&dev->tx_queue);
1414 dev->xmit_lock_owner = smp_processor_id();
1415} 1430}
1416 1431
1417static inline int netif_tx_trylock(struct net_device *dev) 1432static inline int __netif_tx_trylock(struct netdev_queue *txq)
1418{ 1433{
1419 int ok = spin_trylock(&dev->_xmit_lock); 1434 int ok = spin_trylock(&txq->_xmit_lock);
1420 if (likely(ok)) 1435 if (likely(ok))
1421 dev->xmit_lock_owner = smp_processor_id(); 1436 txq->xmit_lock_owner = smp_processor_id();
1422 return ok; 1437 return ok;
1423} 1438}
1424 1439
1440static inline int netif_tx_trylock(struct net_device *dev)
1441{
1442 return __netif_tx_trylock(&dev->tx_queue);
1443}
1444
1445static inline void __netif_tx_unlock(struct netdev_queue *txq)
1446{
1447 txq->xmit_lock_owner = -1;
1448 spin_unlock(&txq->_xmit_lock);
1449}
1450
1425static inline void netif_tx_unlock(struct net_device *dev) 1451static inline void netif_tx_unlock(struct net_device *dev)
1426{ 1452{
1427 dev->xmit_lock_owner = -1; 1453 __netif_tx_unlock(&dev->tx_queue);
1428 spin_unlock(&dev->_xmit_lock); 1454}
1455
1456static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
1457{
1458 txq->xmit_lock_owner = -1;
1459 spin_unlock_bh(&txq->_xmit_lock);
1429} 1460}
1430 1461
1431static inline void netif_tx_unlock_bh(struct net_device *dev) 1462static inline void netif_tx_unlock_bh(struct net_device *dev)
1432{ 1463{
1433 dev->xmit_lock_owner = -1; 1464 __netif_tx_unlock_bh(&dev->tx_queue);
1434 spin_unlock_bh(&dev->_xmit_lock);
1435} 1465}
1436 1466
1437#define HARD_TX_LOCK(dev, cpu) { \ 1467#define HARD_TX_LOCK(dev, txq, cpu) { \
1438 if ((dev->features & NETIF_F_LLTX) == 0) { \ 1468 if ((dev->features & NETIF_F_LLTX) == 0) { \
1439 __netif_tx_lock(dev, cpu); \ 1469 __netif_tx_lock(txq, cpu); \
1440 } \ 1470 } \
1441} 1471}
1442 1472
1443#define HARD_TX_UNLOCK(dev) { \ 1473#define HARD_TX_UNLOCK(dev, txq) { \
1444 if ((dev->features & NETIF_F_LLTX) == 0) { \ 1474 if ((dev->features & NETIF_F_LLTX) == 0) { \
1445 netif_tx_unlock(dev); \ 1475 __netif_tx_unlock(txq); \
1446 } \ 1476 } \
1447} 1477}
1448 1478
@@ -1480,9 +1510,10 @@ extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *ad
1480extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly); 1510extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
1481extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); 1511extern int __dev_addr_sync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
1482extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count); 1512extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct dev_addr_list **from, int *from_count);
1483extern void dev_set_promiscuity(struct net_device *dev, int inc); 1513extern int dev_set_promiscuity(struct net_device *dev, int inc);
1484extern void dev_set_allmulti(struct net_device *dev, int inc); 1514extern int dev_set_allmulti(struct net_device *dev, int inc);
1485extern void netdev_state_change(struct net_device *dev); 1515extern void netdev_state_change(struct net_device *dev);
1516extern void netdev_bonding_change(struct net_device *dev);
1486extern void netdev_features_change(struct net_device *dev); 1517extern void netdev_features_change(struct net_device *dev);
1487/* Load a device via the kmod */ 1518/* Load a device via the kmod */
1488extern void dev_load(struct net *net, const char *name); 1519extern void dev_load(struct net *net, const char *name);
@@ -1509,6 +1540,9 @@ extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos);
1509extern void dev_seq_stop(struct seq_file *seq, void *v); 1540extern void dev_seq_stop(struct seq_file *seq, void *v);
1510#endif 1541#endif
1511 1542
1543extern int netdev_class_create_file(struct class_attribute *class_attr);
1544extern void netdev_class_remove_file(struct class_attribute *class_attr);
1545
1512extern void linkwatch_run_queue(void); 1546extern void linkwatch_run_queue(void);
1513 1547
1514extern int netdev_compute_features(unsigned long all, unsigned long one); 1548extern int netdev_compute_features(unsigned long all, unsigned long one);
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 0a383ac083cb..759bc043dc65 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -81,6 +81,7 @@ enum ctattr_protoinfo {
81 CTA_PROTOINFO_UNSPEC, 81 CTA_PROTOINFO_UNSPEC,
82 CTA_PROTOINFO_TCP, 82 CTA_PROTOINFO_TCP,
83 CTA_PROTOINFO_DCCP, 83 CTA_PROTOINFO_DCCP,
84 CTA_PROTOINFO_SCTP,
84 __CTA_PROTOINFO_MAX 85 __CTA_PROTOINFO_MAX
85}; 86};
86#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) 87#define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1)
@@ -103,6 +104,15 @@ enum ctattr_protoinfo_dccp {
103}; 104};
104#define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) 105#define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1)
105 106
107enum ctattr_protoinfo_sctp {
108 CTA_PROTOINFO_SCTP_UNSPEC,
109 CTA_PROTOINFO_SCTP_STATE,
110 CTA_PROTOINFO_SCTP_VTAG_ORIGINAL,
111 CTA_PROTOINFO_SCTP_VTAG_REPLY,
112 __CTA_PROTOINFO_SCTP_MAX
113};
114#define CTA_PROTOINFO_SCTP_MAX (__CTA_PROTOINFO_SCTP_MAX - 1)
115
106enum ctattr_counters { 116enum ctattr_counters {
107 CTA_COUNTERS_UNSPEC, 117 CTA_COUNTERS_UNSPEC,
108 CTA_COUNTERS_PACKETS, /* old 64bit counters */ 118 CTA_COUNTERS_PACKETS, /* old 64bit counters */
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h
index bb21dd1aee2d..8a6ba7bbef9f 100644
--- a/include/linux/netfilter/xt_string.h
+++ b/include/linux/netfilter/xt_string.h
@@ -4,6 +4,11 @@
4#define XT_STRING_MAX_PATTERN_SIZE 128 4#define XT_STRING_MAX_PATTERN_SIZE 128
5#define XT_STRING_MAX_ALGO_NAME_SIZE 16 5#define XT_STRING_MAX_ALGO_NAME_SIZE 16
6 6
7enum {
8 XT_STRING_FLAG_INVERT = 0x01,
9 XT_STRING_FLAG_IGNORECASE = 0x02
10};
11
7struct xt_string_info 12struct xt_string_info
8{ 13{
9 u_int16_t from_offset; 14 u_int16_t from_offset;
@@ -11,7 +16,15 @@ struct xt_string_info
11 char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; 16 char algo[XT_STRING_MAX_ALGO_NAME_SIZE];
12 char pattern[XT_STRING_MAX_PATTERN_SIZE]; 17 char pattern[XT_STRING_MAX_PATTERN_SIZE];
13 u_int8_t patlen; 18 u_int8_t patlen;
14 u_int8_t invert; 19 union {
20 struct {
21 u_int8_t invert;
22 } v0;
23
24 struct {
25 u_int8_t flags;
26 } v1;
27 } u;
15 28
16 /* Used internally by the kernel */ 29 /* Used internally by the kernel */
17 struct ts_config __attribute__((aligned(8))) *config; 30 struct ts_config __attribute__((aligned(8))) *config;
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h
new file mode 100644
index 000000000000..2273c3ae33ca
--- /dev/null
+++ b/include/linux/netfilter_bridge/ebt_ip6.h
@@ -0,0 +1,40 @@
1/*
2 * ebt_ip6
3 *
4 * Authors:
5 * Kuo-Lang Tseng <kuo-lang.tseng@intel.com>
6 * Manohar Castelino <manohar.r.castelino@intel.com>
7 *
8 * Jan 11, 2008
9 *
10 */
11
12#ifndef __LINUX_BRIDGE_EBT_IP6_H
13#define __LINUX_BRIDGE_EBT_IP6_H
14
15#define EBT_IP6_SOURCE 0x01
16#define EBT_IP6_DEST 0x02
17#define EBT_IP6_TCLASS 0x04
18#define EBT_IP6_PROTO 0x08
19#define EBT_IP6_SPORT 0x10
20#define EBT_IP6_DPORT 0x20
21#define EBT_IP6_MASK (EBT_IP6_SOURCE | EBT_IP6_DEST | EBT_IP6_TCLASS |\
22 EBT_IP6_PROTO | EBT_IP6_SPORT | EBT_IP6_DPORT)
23#define EBT_IP6_MATCH "ip6"
24
25/* the same values are used for the invflags */
26struct ebt_ip6_info
27{
28 struct in6_addr saddr;
29 struct in6_addr daddr;
30 struct in6_addr smsk;
31 struct in6_addr dmsk;
32 uint8_t tclass;
33 uint8_t protocol;
34 uint8_t bitmask;
35 uint8_t invflags;
36 uint16_t sport[2];
37 uint16_t dport[2];
38};
39
40#endif
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h
index 96e231ae7554..b76e653157e5 100644
--- a/include/linux/netfilter_bridge/ebt_log.h
+++ b/include/linux/netfilter_bridge/ebt_log.h
@@ -4,7 +4,8 @@
4#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */ 4#define EBT_LOG_IP 0x01 /* if the frame is made by ip, log the ip information */
5#define EBT_LOG_ARP 0x02 5#define EBT_LOG_ARP 0x02
6#define EBT_LOG_NFLOG 0x04 6#define EBT_LOG_NFLOG 0x04
7#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP) 7#define EBT_LOG_IP6 0x08
8#define EBT_LOG_MASK (EBT_LOG_IP | EBT_LOG_ARP | EBT_LOG_IP6)
8#define EBT_LOG_PREFIX_SIZE 30 9#define EBT_LOG_PREFIX_SIZE 30
9#define EBT_LOG_WATCHER "log" 10#define EBT_LOG_WATCHER "log"
10 11
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 650318b0c405..29c7727ff0e8 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -60,6 +60,7 @@ enum nf_ip_hook_priorities {
60 NF_IP_PRI_MANGLE = -150, 60 NF_IP_PRI_MANGLE = -150,
61 NF_IP_PRI_NAT_DST = -100, 61 NF_IP_PRI_NAT_DST = -100,
62 NF_IP_PRI_FILTER = 0, 62 NF_IP_PRI_FILTER = 0,
63 NF_IP_PRI_SECURITY = 50,
63 NF_IP_PRI_NAT_SRC = 100, 64 NF_IP_PRI_NAT_SRC = 100,
64 NF_IP_PRI_SELINUX_LAST = 225, 65 NF_IP_PRI_SELINUX_LAST = 225,
65 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, 66 NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX,
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 3475a65dae9b..d654873aa25a 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -64,11 +64,14 @@ enum nf_ip6_hook_priorities {
64 NF_IP6_PRI_MANGLE = -150, 64 NF_IP6_PRI_MANGLE = -150,
65 NF_IP6_PRI_NAT_DST = -100, 65 NF_IP6_PRI_NAT_DST = -100,
66 NF_IP6_PRI_FILTER = 0, 66 NF_IP6_PRI_FILTER = 0,
67 NF_IP6_PRI_SECURITY = 50,
67 NF_IP6_PRI_NAT_SRC = 100, 68 NF_IP6_PRI_NAT_SRC = 100,
68 NF_IP6_PRI_SELINUX_LAST = 225, 69 NF_IP6_PRI_SELINUX_LAST = 225,
69 NF_IP6_PRI_LAST = INT_MAX, 70 NF_IP6_PRI_LAST = INT_MAX,
70}; 71};
71 72
73#ifdef __KERNEL__
74
72#ifdef CONFIG_NETFILTER 75#ifdef CONFIG_NETFILTER
73extern int ip6_route_me_harder(struct sk_buff *skb); 76extern int ip6_route_me_harder(struct sk_buff *skb);
74extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 77extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
@@ -81,4 +84,6 @@ static inline int ipv6_netfilter_init(void) { return 0; }
81static inline void ipv6_netfilter_fini(void) { return; } 84static inline void ipv6_netfilter_fini(void) { return; }
82#endif /* CONFIG_NETFILTER */ 85#endif /* CONFIG_NETFILTER */
83 86
87#endif /* __KERNEL__ */
88
84#endif /*__LINUX_IP6_NETFILTER_H*/ 89#endif /*__LINUX_IP6_NETFILTER_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index bec1062a25a1..9ff1b54908f3 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -193,7 +193,7 @@ extern int netlink_unregister_notifier(struct notifier_block *nb);
193 193
194/* finegrained unicast helpers: */ 194/* finegrained unicast helpers: */
195struct sock *netlink_getsockbyfilp(struct file *filp); 195struct sock *netlink_getsockbyfilp(struct file *filp);
196int netlink_attachskb(struct sock *sk, struct sk_buff *skb, int nonblock, 196int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
197 long *timeo, struct sock *ssk); 197 long *timeo, struct sock *ssk);
198void netlink_detachskb(struct sock *sk, struct sk_buff *skb); 198void netlink_detachskb(struct sock *sk, struct sk_buff *skb);
199int netlink_sendskb(struct sock *sk, struct sk_buff *skb); 199int netlink_sendskb(struct sock *sk, struct sk_buff *skb);
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index ea6517e58b04..2be7c63bc0f2 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -122,13 +122,13 @@ enum nl80211_commands {
122 NL80211_CMD_NEW_STATION, 122 NL80211_CMD_NEW_STATION,
123 NL80211_CMD_DEL_STATION, 123 NL80211_CMD_DEL_STATION,
124 124
125 /* add commands here */
126
127 NL80211_CMD_GET_MPATH, 125 NL80211_CMD_GET_MPATH,
128 NL80211_CMD_SET_MPATH, 126 NL80211_CMD_SET_MPATH,
129 NL80211_CMD_NEW_MPATH, 127 NL80211_CMD_NEW_MPATH,
130 NL80211_CMD_DEL_MPATH, 128 NL80211_CMD_DEL_MPATH,
131 129
130 /* add commands here */
131
132 /* used to define NL80211_CMD_MAX below */ 132 /* used to define NL80211_CMD_MAX below */
133 __NL80211_CMD_AFTER_LAST, 133 __NL80211_CMD_AFTER_LAST,
134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 134 NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1
@@ -230,18 +230,21 @@ enum nl80211_attrs {
230 230
231 NL80211_ATTR_MNTR_FLAGS, 231 NL80211_ATTR_MNTR_FLAGS,
232 232
233 /* add attributes here, update the policy in nl80211.c */
234
235 NL80211_ATTR_MESH_ID, 233 NL80211_ATTR_MESH_ID,
236 NL80211_ATTR_STA_PLINK_ACTION, 234 NL80211_ATTR_STA_PLINK_ACTION,
237 NL80211_ATTR_MPATH_NEXT_HOP, 235 NL80211_ATTR_MPATH_NEXT_HOP,
238 NL80211_ATTR_MPATH_INFO, 236 NL80211_ATTR_MPATH_INFO,
239 237
238 /* add attributes here, update the policy in nl80211.c */
239
240 __NL80211_ATTR_AFTER_LAST, 240 __NL80211_ATTR_AFTER_LAST,
241 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 241 NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1
242}; 242};
243 243
244#define NL80211_MAX_SUPP_RATES 32 244#define NL80211_MAX_SUPP_RATES 32
245#define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0
246#define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16
247#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
245 248
246/** 249/**
247 * enum nl80211_iftype - (virtual) interface types 250 * enum nl80211_iftype - (virtual) interface types
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 0ff6224d172a..bd3d72ddf333 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -197,6 +197,7 @@ static inline int notifier_to_errno(int ret)
197#define NETDEV_GOING_DOWN 0x0009 197#define NETDEV_GOING_DOWN 0x0009
198#define NETDEV_CHANGENAME 0x000A 198#define NETDEV_CHANGENAME 0x000A
199#define NETDEV_FEAT_CHANGE 0x000B 199#define NETDEV_FEAT_CHANGE 0x000B
200#define NETDEV_BONDING_FAILOVER 0x000C
200 201
201#define SYS_DOWN 0x0001 /* Notify of system down */ 202#define SYS_DOWN 0x0001 /* Notify of system down */
202#define SYS_RESTART SYS_DOWN 203#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index eafc9d6d2b35..e74b14acf8e0 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1949,6 +1949,8 @@
1949#define PCI_DEVICE_ID_NX2_5708 0x164c 1949#define PCI_DEVICE_ID_NX2_5708 0x164c
1950#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d 1950#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
1951#define PCI_DEVICE_ID_NX2_57710 0x164e 1951#define PCI_DEVICE_ID_NX2_57710 0x164e
1952#define PCI_DEVICE_ID_NX2_57711 0x164f
1953#define PCI_DEVICE_ID_NX2_57711E 0x1650
1952#define PCI_DEVICE_ID_TIGON3_5705 0x1653 1954#define PCI_DEVICE_ID_TIGON3_5705 0x1653
1953#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 1955#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
1954#define PCI_DEVICE_ID_TIGON3_5720 0x1658 1956#define PCI_DEVICE_ID_TIGON3_5720 0x1658
@@ -1981,6 +1983,7 @@
1981#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1983#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1982#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1984#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1983#define PCI_DEVICE_ID_TIGON3_5784 0x1698 1985#define PCI_DEVICE_ID_TIGON3_5784 0x1698
1986#define PCI_DEVICE_ID_TIGON3_5785 0x1699
1984#define PCI_DEVICE_ID_TIGON3_5786 0x169a 1987#define PCI_DEVICE_ID_TIGON3_5786 0x169a
1985#define PCI_DEVICE_ID_TIGON3_5787 0x169b 1988#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1986#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1989#define PCI_DEVICE_ID_TIGON3_5788 0x169c
diff --git a/include/linux/ppp-comp.h b/include/linux/ppp-comp.h
index e86a7a5cf355..b8d4ddd22736 100644
--- a/include/linux/ppp-comp.h
+++ b/include/linux/ppp-comp.h
@@ -23,8 +23,6 @@
23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO 23 * ON AN "AS IS" BASIS, AND THE AUSTRALIAN NATIONAL UNIVERSITY HAS NO
24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, 24 * OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
25 * OR MODIFICATIONS. 25 * OR MODIFICATIONS.
26 *
27 * $Id: ppp-comp.h,v 1.6 1997/11/27 06:04:44 paulus Exp $
28 */ 26 */
29 27
30/* 28/*
diff --git a/include/linux/ppp_defs.h b/include/linux/ppp_defs.h
index c6b13ff85028..6e8adc77522c 100644
--- a/include/linux/ppp_defs.h
+++ b/include/linux/ppp_defs.h
@@ -1,5 +1,3 @@
1/* $Id: ppp_defs.h,v 1.2 1994/09/21 01:31:06 paulus Exp $ */
2
3/* 1/*
4 * ppp_defs.h - PPP definitions. 2 * ppp_defs.h - PPP definitions.
5 * 3 *
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h
index e3ab21d7fc7f..c5f6e54ec6ae 100644
--- a/include/linux/rfkill.h
+++ b/include/linux/rfkill.h
@@ -34,26 +34,37 @@
34 * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. 34 * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device.
35 * RFKILL_TYPE_UWB: switch is on a ultra wideband device. 35 * RFKILL_TYPE_UWB: switch is on a ultra wideband device.
36 * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. 36 * RFKILL_TYPE_WIMAX: switch is on a WiMAX device.
37 * RFKILL_TYPE_WWAN: switch is on a wireless WAN device.
37 */ 38 */
38enum rfkill_type { 39enum rfkill_type {
39 RFKILL_TYPE_WLAN , 40 RFKILL_TYPE_WLAN ,
40 RFKILL_TYPE_BLUETOOTH, 41 RFKILL_TYPE_BLUETOOTH,
41 RFKILL_TYPE_UWB, 42 RFKILL_TYPE_UWB,
42 RFKILL_TYPE_WIMAX, 43 RFKILL_TYPE_WIMAX,
44 RFKILL_TYPE_WWAN,
43 RFKILL_TYPE_MAX, 45 RFKILL_TYPE_MAX,
44}; 46};
45 47
46enum rfkill_state { 48enum rfkill_state {
47 RFKILL_STATE_OFF = 0, 49 RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */
48 RFKILL_STATE_ON = 1, 50 RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */
51 RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */
49}; 52};
50 53
54/*
55 * These are DEPRECATED, drivers using them should be verified to
56 * comply with the rfkill usage guidelines in Documentation/rfkill.txt
57 * and then converted to use the new names for rfkill_state
58 */
59#define RFKILL_STATE_OFF RFKILL_STATE_SOFT_BLOCKED
60#define RFKILL_STATE_ON RFKILL_STATE_UNBLOCKED
61
51/** 62/**
52 * struct rfkill - rfkill control structure. 63 * struct rfkill - rfkill control structure.
53 * @name: Name of the switch. 64 * @name: Name of the switch.
54 * @type: Radio type which the button controls, the value stored 65 * @type: Radio type which the button controls, the value stored
55 * here should be a value from enum rfkill_type. 66 * here should be a value from enum rfkill_type.
56 * @state: State of the switch (on/off). 67 * @state: State of the switch, "UNBLOCKED" means radio can operate.
57 * @user_claim_unsupported: Whether the hardware supports exclusive 68 * @user_claim_unsupported: Whether the hardware supports exclusive
58 * RF-kill control by userspace. Set this before registering. 69 * RF-kill control by userspace. Set this before registering.
59 * @user_claim: Set when the switch is controlled exlusively by userspace. 70 * @user_claim: Set when the switch is controlled exlusively by userspace.
@@ -61,6 +72,12 @@ enum rfkill_state {
61 * @data: Pointer to the RF button drivers private data which will be 72 * @data: Pointer to the RF button drivers private data which will be
62 * passed along when toggling radio state. 73 * passed along when toggling radio state.
63 * @toggle_radio(): Mandatory handler to control state of the radio. 74 * @toggle_radio(): Mandatory handler to control state of the radio.
75 * only RFKILL_STATE_SOFT_BLOCKED and RFKILL_STATE_UNBLOCKED are
76 * valid parameters.
77 * @get_state(): handler to read current radio state from hardware,
78 * may be called from atomic context, should return 0 on success.
79 * Either this handler OR judicious use of rfkill_force_state() is
80 * MANDATORY for any driver capable of RFKILL_STATE_HARD_BLOCKED.
64 * @led_trigger: A LED trigger for this button's LED. 81 * @led_trigger: A LED trigger for this button's LED.
65 * @dev: Device structure integrating the switch into device tree. 82 * @dev: Device structure integrating the switch into device tree.
66 * @node: Used to place switch into list of all switches known to the 83 * @node: Used to place switch into list of all switches known to the
@@ -80,6 +97,7 @@ struct rfkill {
80 97
81 void *data; 98 void *data;
82 int (*toggle_radio)(void *data, enum rfkill_state state); 99 int (*toggle_radio)(void *data, enum rfkill_state state);
100 int (*get_state)(void *data, enum rfkill_state *state);
83 101
84#ifdef CONFIG_RFKILL_LEDS 102#ifdef CONFIG_RFKILL_LEDS
85 struct led_trigger led_trigger; 103 struct led_trigger led_trigger;
@@ -95,6 +113,21 @@ void rfkill_free(struct rfkill *rfkill);
95int rfkill_register(struct rfkill *rfkill); 113int rfkill_register(struct rfkill *rfkill);
96void rfkill_unregister(struct rfkill *rfkill); 114void rfkill_unregister(struct rfkill *rfkill);
97 115
116int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state);
117
118/**
119 * rfkill_state_complement - return complementar state
120 * @state: state to return the complement of
121 *
122 * Returns RFKILL_STATE_SOFT_BLOCKED if @state is RFKILL_STATE_UNBLOCKED,
123 * returns RFKILL_STATE_UNBLOCKED otherwise.
124 */
125static inline enum rfkill_state rfkill_state_complement(enum rfkill_state state)
126{
127 return (state == RFKILL_STATE_UNBLOCKED) ?
128 RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED;
129}
130
98/** 131/**
99 * rfkill_get_led_name - Get the LED trigger name for the button's LED. 132 * rfkill_get_led_name - Get the LED trigger name for the button's LED.
100 * This function might return a NULL pointer if registering of the 133 * This function might return a NULL pointer if registering of the
@@ -110,4 +143,11 @@ static inline char *rfkill_get_led_name(struct rfkill *rfkill)
110#endif 143#endif
111} 144}
112 145
146/* rfkill notification chain */
147#define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill
148 switch has changed */
149
150int register_rfkill_notifier(struct notifier_block *nb);
151int unregister_rfkill_notifier(struct notifier_block *nb);
152
113#endif /* RFKILL_H */ 153#endif /* RFKILL_H */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 299ec4b31412..8f10e3d08fd9 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -305,9 +305,7 @@ struct sk_buff {
305#endif 305#endif
306 306
307 int iif; 307 int iif;
308#ifdef CONFIG_NETDEVICES_MULTIQUEUE
309 __u16 queue_mapping; 308 __u16 queue_mapping;
310#endif
311#ifdef CONFIG_NET_SCHED 309#ifdef CONFIG_NET_SCHED
312 __u16 tc_index; /* traffic control index */ 310 __u16 tc_index; /* traffic control index */
313#ifdef CONFIG_NET_CLS_ACT 311#ifdef CONFIG_NET_CLS_ACT
@@ -1671,25 +1669,17 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1671 1669
1672static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) 1670static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
1673{ 1671{
1674#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1675 skb->queue_mapping = queue_mapping; 1672 skb->queue_mapping = queue_mapping;
1676#endif
1677} 1673}
1678 1674
1679static inline u16 skb_get_queue_mapping(struct sk_buff *skb) 1675static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
1680{ 1676{
1681#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1682 return skb->queue_mapping; 1677 return skb->queue_mapping;
1683#else
1684 return 0;
1685#endif
1686} 1678}
1687 1679
1688static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) 1680static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
1689{ 1681{
1690#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1691 to->queue_mapping = from->queue_mapping; 1682 to->queue_mapping = from->queue_mapping;
1692#endif
1693} 1683}
1694 1684
1695static inline int skb_is_gso(const struct sk_buff *skb) 1685static inline int skb_is_gso(const struct sk_buff *skb)
@@ -1702,6 +1692,20 @@ static inline int skb_is_gso_v6(const struct sk_buff *skb)
1702 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; 1692 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6;
1703} 1693}
1704 1694
1695extern void __skb_warn_lro_forwarding(const struct sk_buff *skb);
1696
1697static inline bool skb_warn_if_lro(const struct sk_buff *skb)
1698{
1699 /* LRO sets gso_size but not gso_type, whereas if GSO is really
1700 * wanted then gso_type will be set. */
1701 struct skb_shared_info *shinfo = skb_shinfo(skb);
1702 if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) {
1703 __skb_warn_lro_forwarding(skb);
1704 return true;
1705 }
1706 return false;
1707}
1708
1705static inline void skb_forward_csum(struct sk_buff *skb) 1709static inline void skb_forward_csum(struct sk_buff *skb)
1706{ 1710{
1707 /* Unfortunately we don't support this one. Any brave souls? */ 1711 /* Unfortunately we don't support this one. Any brave souls? */
diff --git a/include/linux/smc911x.h b/include/linux/smc911x.h
new file mode 100644
index 000000000000..b58f54c24183
--- /dev/null
+++ b/include/linux/smc911x.h
@@ -0,0 +1,12 @@
1#ifndef __SMC911X_H__
2#define __SMC911X_H__
3
4#define SMC911X_USE_16BIT (1 << 0)
5#define SMC911X_USE_32BIT (1 << 1)
6
7struct smc911x_platdata {
8 unsigned long flags;
9 unsigned long irq_flags; /* IRQF_... */
10};
11
12#endif /* __SMC911X_H__ */
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
index 753680296e17..67ad11fcf88b 100644
--- a/include/linux/sonet.h
+++ b/include/linux/sonet.h
@@ -34,7 +34,7 @@ struct sonet_stats {
34 /* clear error insertion */ 34 /* clear error insertion */
35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int) 35#define SONET_GETDIAG _IOR('a',ATMIOC_PHYTYP+4,int)
36 /* query error insertion */ 36 /* query error insertion */
37#define SONET_SETFRAMING _IO('a',ATMIOC_PHYTYP+5) 37#define SONET_SETFRAMING _IOW('a',ATMIOC_PHYTYP+5,int)
38 /* set framing mode (SONET/SDH) */ 38 /* set framing mode (SONET/SDH) */
39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int) 39#define SONET_GETFRAMING _IOR('a',ATMIOC_PHYTYP+6,int)
40 /* get framing mode */ 40 /* get framing mode */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 50dfd0dc4093..0fe5a0ded3ea 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -137,9 +137,6 @@ struct ssb_device {
137 const struct ssb_bus_ops *ops; 137 const struct ssb_bus_ops *ops;
138 138
139 struct device *dev; 139 struct device *dev;
140 /* Pointer to the device that has to be used for
141 * any DMA related operation. */
142 struct device *dma_dev;
143 140
144 struct ssb_bus *bus; 141 struct ssb_bus *bus;
145 struct ssb_device_id id; 142 struct ssb_device_id id;
@@ -399,13 +396,151 @@ static inline void ssb_block_write(struct ssb_device *dev, const void *buffer,
399#endif /* CONFIG_SSB_BLOCKIO */ 396#endif /* CONFIG_SSB_BLOCKIO */
400 397
401 398
399/* The SSB DMA API. Use this API for any DMA operation on the device.
400 * This API basically is a wrapper that calls the correct DMA API for
401 * the host device type the SSB device is attached to. */
402
402/* Translation (routing) bits that need to be ORed to DMA 403/* Translation (routing) bits that need to be ORed to DMA
403 * addresses before they are given to a device. */ 404 * addresses before they are given to a device. */
404extern u32 ssb_dma_translation(struct ssb_device *dev); 405extern u32 ssb_dma_translation(struct ssb_device *dev);
405#define SSB_DMA_TRANSLATION_MASK 0xC0000000 406#define SSB_DMA_TRANSLATION_MASK 0xC0000000
406#define SSB_DMA_TRANSLATION_SHIFT 30 407#define SSB_DMA_TRANSLATION_SHIFT 30
407 408
408extern int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask); 409extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask);
410
411extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size,
412 dma_addr_t *dma_handle, gfp_t gfp_flags);
413extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size,
414 void *vaddr, dma_addr_t dma_handle,
415 gfp_t gfp_flags);
416
417static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev)
418{
419#ifdef CONFIG_SSB_DEBUG
420 printk(KERN_ERR "SSB: BUG! Calling DMA API for "
421 "unsupported bustype %d\n", dev->bus->bustype);
422#endif /* DEBUG */
423}
424
425static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr)
426{
427 switch (dev->bus->bustype) {
428 case SSB_BUSTYPE_PCI:
429 return pci_dma_mapping_error(addr);
430 case SSB_BUSTYPE_SSB:
431 return dma_mapping_error(addr);
432 default:
433 __ssb_dma_not_implemented(dev);
434 }
435 return -ENOSYS;
436}
437
438static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p,
439 size_t size, enum dma_data_direction dir)
440{
441 switch (dev->bus->bustype) {
442 case SSB_BUSTYPE_PCI:
443 return pci_map_single(dev->bus->host_pci, p, size, dir);
444 case SSB_BUSTYPE_SSB:
445 return dma_map_single(dev->dev, p, size, dir);
446 default:
447 __ssb_dma_not_implemented(dev);
448 }
449 return 0;
450}
451
452static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr,
453 size_t size, enum dma_data_direction dir)
454{
455 switch (dev->bus->bustype) {
456 case SSB_BUSTYPE_PCI:
457 pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir);
458 return;
459 case SSB_BUSTYPE_SSB:
460 dma_unmap_single(dev->dev, dma_addr, size, dir);
461 return;
462 default:
463 __ssb_dma_not_implemented(dev);
464 }
465}
466
467static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
468 dma_addr_t dma_addr,
469 size_t size,
470 enum dma_data_direction dir)
471{
472 switch (dev->bus->bustype) {
473 case SSB_BUSTYPE_PCI:
474 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
475 size, dir);
476 return;
477 case SSB_BUSTYPE_SSB:
478 dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir);
479 return;
480 default:
481 __ssb_dma_not_implemented(dev);
482 }
483}
484
485static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
486 dma_addr_t dma_addr,
487 size_t size,
488 enum dma_data_direction dir)
489{
490 switch (dev->bus->bustype) {
491 case SSB_BUSTYPE_PCI:
492 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
493 size, dir);
494 return;
495 case SSB_BUSTYPE_SSB:
496 dma_sync_single_for_device(dev->dev, dma_addr, size, dir);
497 return;
498 default:
499 __ssb_dma_not_implemented(dev);
500 }
501}
502
503static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
504 dma_addr_t dma_addr,
505 unsigned long offset,
506 size_t size,
507 enum dma_data_direction dir)
508{
509 switch (dev->bus->bustype) {
510 case SSB_BUSTYPE_PCI:
511 /* Just sync everything. That's all the PCI API can do. */
512 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
513 offset + size, dir);
514 return;
515 case SSB_BUSTYPE_SSB:
516 dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset,
517 size, dir);
518 return;
519 default:
520 __ssb_dma_not_implemented(dev);
521 }
522}
523
524static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
525 dma_addr_t dma_addr,
526 unsigned long offset,
527 size_t size,
528 enum dma_data_direction dir)
529{
530 switch (dev->bus->bustype) {
531 case SSB_BUSTYPE_PCI:
532 /* Just sync everything. That's all the PCI API can do. */
533 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
534 offset + size, dir);
535 return;
536 case SSB_BUSTYPE_SSB:
537 dma_sync_single_range_for_device(dev->dev, dma_addr, offset,
538 size, dir);
539 return;
540 default:
541 __ssb_dma_not_implemented(dev);
542 }
543}
409 544
410 545
411#ifdef CONFIG_SSB_PCIHOST 546#ifdef CONFIG_SSB_PCIHOST
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index fec6899bf355..d48d4e605f74 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -7,8 +7,6 @@
7 * Andy Adamson <andros@umich.edu> 7 * Andy Adamson <andros@umich.edu>
8 * Bruce Fields <bfields@umich.edu> 8 * Bruce Fields <bfields@umich.edu>
9 * Copyright (c) 2000 The Regents of the University of Michigan 9 * Copyright (c) 2000 The Regents of the University of Michigan
10 *
11 * $Id$
12 */ 10 */
13 11
14#ifndef _LINUX_SUNRPC_AUTH_GSS_H 12#ifndef _LINUX_SUNRPC_AUTH_GSS_H
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 459c5fc11d51..03f33330ece2 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -7,8 +7,6 @@
7 * Andy Adamson <andros@umich.edu> 7 * Andy Adamson <andros@umich.edu>
8 * Bruce Fields <bfields@umich.edu> 8 * Bruce Fields <bfields@umich.edu>
9 * Copyright (c) 2000 The Regents of the University of Michigan 9 * Copyright (c) 2000 The Regents of the University of Michigan
10 *
11 * $Id$
12 */ 10 */
13 11
14#ifndef _LINUX_SUNRPC_GSS_API_H 12#ifndef _LINUX_SUNRPC_GSS_API_H
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h
index 417a1def56db..c9165d9771a8 100644
--- a/include/linux/sunrpc/svcauth_gss.h
+++ b/include/linux/sunrpc/svcauth_gss.h
@@ -3,9 +3,6 @@
3 * 3 *
4 * Bruce Fields <bfields@umich.edu> 4 * Bruce Fields <bfields@umich.edu>
5 * Copyright (c) 2002 The Regents of the Unviersity of Michigan 5 * Copyright (c) 2002 The Regents of the Unviersity of Michigan
6 *
7 * $Id$
8 *
9 */ 6 */
10 7
11#ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H 8#ifndef _LINUX_SUNRPC_SVCAUTH_GSS_H
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index b31b6b74aa28..07e79bdb9cdf 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -291,10 +291,9 @@ struct tcp_sock {
291 u32 rcv_ssthresh; /* Current window clamp */ 291 u32 rcv_ssthresh; /* Current window clamp */
292 292
293 u32 frto_highmark; /* snd_nxt when RTO occurred */ 293 u32 frto_highmark; /* snd_nxt when RTO occurred */
294 u8 reordering; /* Packet reordering metric. */ 294 u16 advmss; /* Advertised MSS */
295 u8 frto_counter; /* Number of new acks after RTO */ 295 u8 frto_counter; /* Number of new acks after RTO */
296 u8 nonagle; /* Disable Nagle algorithm? */ 296 u8 nonagle; /* Disable Nagle algorithm? */
297 u8 keepalive_probes; /* num of allowed keep alive probes */
298 297
299/* RTT measurement */ 298/* RTT measurement */
300 u32 srtt; /* smoothed round trip time << 3 */ 299 u32 srtt; /* smoothed round trip time << 3 */
@@ -305,6 +304,10 @@ struct tcp_sock {
305 304
306 u32 packets_out; /* Packets which are "in flight" */ 305 u32 packets_out; /* Packets which are "in flight" */
307 u32 retrans_out; /* Retransmitted packets out */ 306 u32 retrans_out; /* Retransmitted packets out */
307
308 u16 urg_data; /* Saved octet of OOB data and control flags */
309 u8 urg_mode; /* In urgent mode */
310 u8 ecn_flags; /* ECN status bits. */
308/* 311/*
309 * Options received (usually on last packet, some only on SYN packets). 312 * Options received (usually on last packet, some only on SYN packets).
310 */ 313 */
@@ -320,13 +323,24 @@ struct tcp_sock {
320 u32 snd_cwnd_used; 323 u32 snd_cwnd_used;
321 u32 snd_cwnd_stamp; 324 u32 snd_cwnd_stamp;
322 325
323 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
324
325 u32 rcv_wnd; /* Current receiver window */ 326 u32 rcv_wnd; /* Current receiver window */
326 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 327 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
327 u32 pushed_seq; /* Last pushed seq, required to talk to windows */ 328 u32 pushed_seq; /* Last pushed seq, required to talk to windows */
329 u32 lost_out; /* Lost packets */
330 u32 sacked_out; /* SACK'd packets */
331 u32 fackets_out; /* FACK'd packets */
332 u32 tso_deferred;
333 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
328 334
329/* SACKs data */ 335 /* from STCP, retrans queue hinting */
336 struct sk_buff* lost_skb_hint;
337 struct sk_buff *scoreboard_skb_hint;
338 struct sk_buff *retransmit_skb_hint;
339 struct sk_buff *forward_skb_hint;
340
341 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
342
343 /* SACKs data, these 2 need to be together (see tcp_build_and_update_options) */
330 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 344 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
331 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ 345 struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/
332 346
@@ -337,23 +351,14 @@ struct tcp_sock {
337 * sacked_out > 0) 351 * sacked_out > 0)
338 */ 352 */
339 353
340 /* from STCP, retrans queue hinting */
341 struct sk_buff* lost_skb_hint;
342
343 struct sk_buff *scoreboard_skb_hint;
344 struct sk_buff *retransmit_skb_hint;
345 struct sk_buff *forward_skb_hint;
346
347 int lost_cnt_hint; 354 int lost_cnt_hint;
348 int retransmit_cnt_hint; 355 int retransmit_cnt_hint;
349 356
350 u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ 357 u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */
351 358
352 u16 advmss; /* Advertised MSS */ 359 u8 reordering; /* Packet reordering metric. */
360 u8 keepalive_probes; /* num of allowed keep alive probes */
353 u32 prior_ssthresh; /* ssthresh saved at recovery start */ 361 u32 prior_ssthresh; /* ssthresh saved at recovery start */
354 u32 lost_out; /* Lost packets */
355 u32 sacked_out; /* SACK'd packets */
356 u32 fackets_out; /* FACK'd packets */
357 u32 high_seq; /* snd_nxt at onset of congestion */ 362 u32 high_seq; /* snd_nxt at onset of congestion */
358 363
359 u32 retrans_stamp; /* Timestamp of the last retransmit, 364 u32 retrans_stamp; /* Timestamp of the last retransmit,
@@ -361,23 +366,16 @@ struct tcp_sock {
361 * the first SYN. */ 366 * the first SYN. */
362 u32 undo_marker; /* tracking retrans started here. */ 367 u32 undo_marker; /* tracking retrans started here. */
363 int undo_retrans; /* number of undoable retransmissions. */ 368 int undo_retrans; /* number of undoable retransmissions. */
369 u32 total_retrans; /* Total retransmits for entire connection */
370
364 u32 urg_seq; /* Seq of received urgent pointer */ 371 u32 urg_seq; /* Seq of received urgent pointer */
365 u16 urg_data; /* Saved octet of OOB data and control flags */
366 u8 urg_mode; /* In urgent mode */
367 u8 ecn_flags; /* ECN status bits. */
368 u32 snd_up; /* Urgent pointer */ 372 u32 snd_up; /* Urgent pointer */
369 373
370 u32 total_retrans; /* Total retransmits for entire connection */
371 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
372
373 unsigned int keepalive_time; /* time before keep alive takes place */ 374 unsigned int keepalive_time; /* time before keep alive takes place */
374 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 375 unsigned int keepalive_intvl; /* time interval between keep alive probes */
375 int linger2;
376 376
377 unsigned long last_synq_overflow; 377 unsigned long last_synq_overflow;
378 378
379 u32 tso_deferred;
380
381/* Receiver side RTT estimation */ 379/* Receiver side RTT estimation */
382 struct { 380 struct {
383 u32 rtt; 381 u32 rtt;
@@ -405,6 +403,8 @@ struct tcp_sock {
405/* TCP MD5 Signagure Option information */ 403/* TCP MD5 Signagure Option information */
406 struct tcp_md5sig_info *md5sig_info; 404 struct tcp_md5sig_info *md5sig_info;
407#endif 405#endif
406
407 int linger2;
408}; 408};
409 409
410static inline struct tcp_sock *tcp_sk(const struct sock *sk) 410static inline struct tcp_sock *tcp_sk(const struct sock *sk)
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 6f371f24160b..d9a85d616385 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -10,10 +10,8 @@
10 10
11struct ts_config; 11struct ts_config;
12 12
13/** 13#define TS_AUTOLOAD 1 /* Automatically load textsearch modules when needed */
14 * TS_AUTOLOAD - Automatically load textsearch modules when needed 14#define TS_IGNORECASE 2 /* Searches string case insensitively */
15 */
16#define TS_AUTOLOAD 1
17 15
18/** 16/**
19 * struct ts_state - search state 17 * struct ts_state - search state
@@ -39,7 +37,7 @@ struct ts_state
39struct ts_ops 37struct ts_ops
40{ 38{
41 const char *name; 39 const char *name;
42 struct ts_config * (*init)(const void *, unsigned int, gfp_t); 40 struct ts_config * (*init)(const void *, unsigned int, gfp_t, int);
43 unsigned int (*find)(struct ts_config *, 41 unsigned int (*find)(struct ts_config *,
44 struct ts_state *); 42 struct ts_state *);
45 void (*destroy)(struct ts_config *); 43 void (*destroy)(struct ts_config *);
@@ -52,12 +50,14 @@ struct ts_ops
52/** 50/**
53 * struct ts_config - search configuration 51 * struct ts_config - search configuration
54 * @ops: operations of chosen algorithm 52 * @ops: operations of chosen algorithm
53 * @flags: flags
55 * @get_next_block: callback to fetch the next block to search in 54 * @get_next_block: callback to fetch the next block to search in
56 * @finish: callback to finalize a search 55 * @finish: callback to finalize a search
57 */ 56 */
58struct ts_config 57struct ts_config
59{ 58{
60 struct ts_ops *ops; 59 struct ts_ops *ops;
60 int flags;
61 61
62 /** 62 /**
63 * get_next_block - fetch next block of data 63 * get_next_block - fetch next block of data
@@ -162,11 +162,10 @@ static inline struct ts_config *alloc_ts_config(size_t payload,
162{ 162{
163 struct ts_config *conf; 163 struct ts_config *conf;
164 164
165 conf = kmalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask); 165 conf = kzalloc(TS_PRIV_ALIGN(sizeof(*conf)) + payload, gfp_mask);
166 if (conf == NULL) 166 if (conf == NULL)
167 return ERR_PTR(-ENOMEM); 167 return ERR_PTR(-ENOMEM);
168 168
169 memset(conf, 0, TS_PRIV_ALIGN(sizeof(*conf)) + payload);
170 return conf; 169 return conf;
171} 170}
172 171
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index b0c916d1f375..2bc6fa4adeb5 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -2,7 +2,7 @@
2 * include/linux/tipc_config.h: Include file for TIPC configuration interface 2 * include/linux/tipc_config.h: Include file for TIPC configuration interface
3 * 3 *
4 * Copyright (c) 2003-2006, Ericsson AB 4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems 5 * Copyright (c) 2005-2007, Wind River Systems
6 * All rights reserved. 6 * All rights reserved.
7 * 7 *
8 * Redistribution and use in source and binary forms, with or without 8 * Redistribution and use in source and binary forms, with or without
@@ -136,6 +136,14 @@
136#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */ 136#define TIPC_CMD_SET_NETID 0x800B /* tx unsigned, rx none */
137 137
138/* 138/*
139 * Reserved commands:
140 * May not be issued by any process.
141 * Used internally by TIPC.
142 */
143
144#define TIPC_CMD_NOT_NET_ADMIN 0xC001 /* tx none, rx none */
145
146/*
139 * TLV types defined for TIPC 147 * TLV types defined for TIPC
140 */ 148 */
141 149
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 581ca2c14c52..0cf5c4c0ec81 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -38,6 +38,7 @@ struct udphdr {
38#ifdef __KERNEL__ 38#ifdef __KERNEL__
39#include <net/inet_sock.h> 39#include <net/inet_sock.h>
40#include <linux/skbuff.h> 40#include <linux/skbuff.h>
41#include <net/netns/hash.h>
41 42
42static inline struct udphdr *udp_hdr(const struct sk_buff *skb) 43static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
43{ 44{
@@ -46,6 +47,11 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
46 47
47#define UDP_HTABLE_SIZE 128 48#define UDP_HTABLE_SIZE 128
48 49
50static inline int udp_hashfn(struct net *net, const unsigned num)
51{
52 return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1);
53}
54
49struct udp_sock { 55struct udp_sock {
50 /* inet_sock has to be the first member */ 56 /* inet_sock has to be the first member */
51 struct inet_sock inet; 57 struct inet_sock inet;
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 29d6458ecb8d..0a6e6d4b929a 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -260,7 +260,8 @@ struct rndis_keepalive_c { /* IN (optionally OUT) */
260 260
261 261
262extern void rndis_status(struct usbnet *dev, struct urb *urb); 262extern void rndis_status(struct usbnet *dev, struct urb *urb);
263extern int rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf); 263extern int
264rndis_command(struct usbnet *dev, struct rndis_msg_hdr *buf, int buflen);
264extern int 265extern int
265generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags); 266generic_rndis_bind(struct usbnet *dev, struct usb_interface *intf, int flags);
266extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf); 267extern void rndis_unbind(struct usbnet *dev, struct usb_interface *intf);
diff --git a/include/linux/wanrouter.h b/include/linux/wanrouter.h
index 3add87465b1f..e0aa39612eba 100644
--- a/include/linux/wanrouter.h
+++ b/include/linux/wanrouter.h
@@ -522,7 +522,7 @@ extern int wanrouter_proc_init(void);
522extern void wanrouter_proc_cleanup(void); 522extern void wanrouter_proc_cleanup(void);
523extern int wanrouter_proc_add(struct wan_device *wandev); 523extern int wanrouter_proc_add(struct wan_device *wandev);
524extern int wanrouter_proc_delete(struct wan_device *wandev); 524extern int wanrouter_proc_delete(struct wan_device *wandev);
525extern int wanrouter_ioctl( struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg); 525extern long wanrouter_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
526 526
527/* Public Data */ 527/* Public Data */
528/* list of registered devices */ 528/* list of registered devices */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 0a9b5b41ed67..d7958f9b52cb 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -611,6 +611,7 @@
611#define IW_ENCODE_ALG_WEP 1 611#define IW_ENCODE_ALG_WEP 1
612#define IW_ENCODE_ALG_TKIP 2 612#define IW_ENCODE_ALG_TKIP 2
613#define IW_ENCODE_ALG_CCMP 3 613#define IW_ENCODE_ALG_CCMP 3
614#define IW_ENCODE_ALG_PMK 4
614/* struct iw_encode_ext ->ext_flags */ 615/* struct iw_encode_ext ->ext_flags */
615#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001 616#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
616#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002 617#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
@@ -630,6 +631,7 @@
630#define IW_ENC_CAPA_WPA2 0x00000002 631#define IW_ENC_CAPA_WPA2 0x00000002
631#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004 632#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
632#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008 633#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
634#define IW_ENC_CAPA_4WAY_HANDSHAKE 0x00000010
633 635
634/* Event capability macros - in (struct iw_range *)->event_capa 636/* Event capability macros - in (struct iw_range *)->event_capa
635 * Because we have more than 32 possible events, we use an array of 637 * Because we have more than 32 possible events, we use an array of
@@ -675,6 +677,19 @@ struct iw_point
675 __u16 flags; /* Optional params */ 677 __u16 flags; /* Optional params */
676}; 678};
677 679
680#ifdef __KERNEL__
681#ifdef CONFIG_COMPAT
682
683#include <linux/compat.h>
684
685struct compat_iw_point {
686 compat_caddr_t pointer;
687 __u16 length;
688 __u16 flags;
689};
690#endif
691#endif
692
678/* 693/*
679 * A frequency 694 * A frequency
680 * For numbers lower than 10^9, we encode the number in 'm' and 695 * For numbers lower than 10^9, we encode the number in 'm' and
@@ -1098,6 +1113,21 @@ struct iw_event
1098#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ 1113#define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \
1099 IW_EV_POINT_OFF) 1114 IW_EV_POINT_OFF)
1100 1115
1116#ifdef __KERNEL__
1117#ifdef CONFIG_COMPAT
1118struct __compat_iw_event {
1119 __u16 len; /* Real length of this stuff */
1120 __u16 cmd; /* Wireless IOCTL */
1121 compat_caddr_t pointer;
1122};
1123#define IW_EV_COMPAT_LCP_LEN offsetof(struct __compat_iw_event, pointer)
1124#define IW_EV_COMPAT_POINT_OFF offsetof(struct compat_iw_point, length)
1125#define IW_EV_COMPAT_POINT_LEN \
1126 (IW_EV_COMPAT_LCP_LEN + sizeof(struct compat_iw_point) - \
1127 IW_EV_COMPAT_POINT_OFF)
1128#endif
1129#endif
1130
1101/* Size of the Event prefix when packed in stream */ 1131/* Size of the Event prefix when packed in stream */
1102#define IW_EV_LCP_PK_LEN (4) 1132#define IW_EV_LCP_PK_LEN (4)
1103/* Size of the various events when packed in stream */ 1133/* Size of the various events when packed in stream */
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index bbd3d583c6e6..06b28142b3ab 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -121,7 +121,8 @@ static inline int addrconf_finite_timeout(unsigned long timeout)
121 */ 121 */
122extern int ipv6_addr_label_init(void); 122extern int ipv6_addr_label_init(void);
123extern void ipv6_addr_label_rtnl_register(void); 123extern void ipv6_addr_label_rtnl_register(void);
124extern u32 ipv6_addr_label(const struct in6_addr *addr, 124extern u32 ipv6_addr_label(struct net *net,
125 const struct in6_addr *addr,
125 int type, int ifindex); 126 int type, int ifindex);
126 127
127/* 128/*
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h
index a5c6ccc5bb19..c2bb5cae6515 100644
--- a/include/net/fib_rules.h
+++ b/include/net/fib_rules.h
@@ -62,7 +62,7 @@ struct fib_rules_ops
62 62
63 /* Called after modifications to the rules set, must flush 63 /* Called after modifications to the rules set, must flush
64 * the route cache if one exists. */ 64 * the route cache if one exists. */
65 void (*flush_cache)(void); 65 void (*flush_cache)(struct fib_rules_ops *ops);
66 66
67 int nlgroup; 67 int nlgroup;
68 const struct nla_policy *policy; 68 const struct nla_policy *policy;
diff --git a/include/net/garp.h b/include/net/garp.h
new file mode 100644
index 000000000000..825f172caba9
--- /dev/null
+++ b/include/net/garp.h
@@ -0,0 +1,128 @@
1#ifndef _NET_GARP_H
2#define _NET_GARP_H
3
4#include <net/stp.h>
5
6#define GARP_PROTOCOL_ID 0x1
7#define GARP_END_MARK 0x0
8
9struct garp_pdu_hdr {
10 __be16 protocol;
11};
12
13struct garp_msg_hdr {
14 u8 attrtype;
15};
16
17enum garp_attr_event {
18 GARP_LEAVE_ALL,
19 GARP_JOIN_EMPTY,
20 GARP_JOIN_IN,
21 GARP_LEAVE_EMPTY,
22 GARP_LEAVE_IN,
23 GARP_EMPTY,
24};
25
26struct garp_attr_hdr {
27 u8 len;
28 u8 event;
29 u8 data[];
30};
31
32struct garp_skb_cb {
33 u8 cur_type;
34};
35
36static inline struct garp_skb_cb *garp_cb(struct sk_buff *skb)
37{
38 BUILD_BUG_ON(sizeof(struct garp_skb_cb) >
39 FIELD_SIZEOF(struct sk_buff, cb));
40 return (struct garp_skb_cb *)skb->cb;
41}
42
43enum garp_applicant_state {
44 GARP_APPLICANT_INVALID,
45 GARP_APPLICANT_VA,
46 GARP_APPLICANT_AA,
47 GARP_APPLICANT_QA,
48 GARP_APPLICANT_LA,
49 GARP_APPLICANT_VP,
50 GARP_APPLICANT_AP,
51 GARP_APPLICANT_QP,
52 GARP_APPLICANT_VO,
53 GARP_APPLICANT_AO,
54 GARP_APPLICANT_QO,
55 __GARP_APPLICANT_MAX
56};
57#define GARP_APPLICANT_MAX (__GARP_APPLICANT_MAX - 1)
58
59enum garp_event {
60 GARP_EVENT_REQ_JOIN,
61 GARP_EVENT_REQ_LEAVE,
62 GARP_EVENT_R_JOIN_IN,
63 GARP_EVENT_R_JOIN_EMPTY,
64 GARP_EVENT_R_EMPTY,
65 GARP_EVENT_R_LEAVE_IN,
66 GARP_EVENT_R_LEAVE_EMPTY,
67 GARP_EVENT_TRANSMIT_PDU,
68 __GARP_EVENT_MAX
69};
70#define GARP_EVENT_MAX (__GARP_EVENT_MAX - 1)
71
72enum garp_action {
73 GARP_ACTION_NONE,
74 GARP_ACTION_S_JOIN_IN,
75 GARP_ACTION_S_LEAVE_EMPTY,
76};
77
78struct garp_attr {
79 struct rb_node node;
80 enum garp_applicant_state state;
81 u8 type;
82 u8 dlen;
83 unsigned char data[];
84};
85
86enum garp_applications {
87 GARP_APPLICATION_GVRP,
88 __GARP_APPLICATION_MAX
89};
90#define GARP_APPLICATION_MAX (__GARP_APPLICATION_MAX - 1)
91
92struct garp_application {
93 enum garp_applications type;
94 unsigned int maxattr;
95 struct stp_proto proto;
96};
97
98struct garp_applicant {
99 struct garp_application *app;
100 struct net_device *dev;
101 struct timer_list join_timer;
102
103 spinlock_t lock;
104 struct sk_buff_head queue;
105 struct sk_buff *pdu;
106 struct rb_root gid;
107};
108
109struct garp_port {
110 struct garp_applicant *applicants[GARP_APPLICATION_MAX + 1];
111};
112
113extern int garp_register_application(struct garp_application *app);
114extern void garp_unregister_application(struct garp_application *app);
115
116extern int garp_init_applicant(struct net_device *dev,
117 struct garp_application *app);
118extern void garp_uninit_applicant(struct net_device *dev,
119 struct garp_application *app);
120
121extern int garp_request_join(const struct net_device *dev,
122 const struct garp_application *app,
123 const void *data, u8 len, u8 type);
124extern void garp_request_leave(const struct net_device *dev,
125 const struct garp_application *app,
126 const void *data, u8 len, u8 type);
127
128#endif /* _NET_GARP_H */
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
index 529816bfbc52..b31399e1fd83 100644
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -1262,9 +1262,6 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
1262/* ieee80211_tx.c */ 1262/* ieee80211_tx.c */
1263extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); 1263extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev);
1264extern void ieee80211_txb_free(struct ieee80211_txb *); 1264extern void ieee80211_txb_free(struct ieee80211_txb *);
1265extern int ieee80211_tx_frame(struct ieee80211_device *ieee,
1266 struct ieee80211_hdr *frame, int hdr_len,
1267 int total_len, int encrypt_mpdu);
1268 1265
1269/* ieee80211_rx.c */ 1266/* ieee80211_rx.c */
1270extern void ieee80211_rx_any(struct ieee80211_device *ieee, 1267extern void ieee80211_rx_any(struct ieee80211_device *ieee,
@@ -1312,14 +1309,6 @@ extern int ieee80211_wx_set_encodeext(struct ieee80211_device *ieee,
1312extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee, 1309extern int ieee80211_wx_get_encodeext(struct ieee80211_device *ieee,
1313 struct iw_request_info *info, 1310 struct iw_request_info *info,
1314 union iwreq_data *wrqu, char *extra); 1311 union iwreq_data *wrqu, char *extra);
1315extern int ieee80211_wx_set_auth(struct net_device *dev,
1316 struct iw_request_info *info,
1317 union iwreq_data *wrqu,
1318 char *extra);
1319extern int ieee80211_wx_get_auth(struct net_device *dev,
1320 struct iw_request_info *info,
1321 union iwreq_data *wrqu,
1322 char *extra);
1323 1312
1324static inline void ieee80211_increment_scans(struct ieee80211_device *ieee) 1313static inline void ieee80211_increment_scans(struct ieee80211_device *ieee)
1325{ 1314{
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index b2cfc4927257..db66c7927743 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -148,7 +148,6 @@ struct ifacaddr6
148#define IFA_HOST IPV6_ADDR_LOOPBACK 148#define IFA_HOST IPV6_ADDR_LOOPBACK
149#define IFA_LINK IPV6_ADDR_LINKLOCAL 149#define IFA_LINK IPV6_ADDR_LINKLOCAL
150#define IFA_SITE IPV6_ADDR_SITELOCAL 150#define IFA_SITE IPV6_ADDR_SITELOCAL
151#define IFA_GLOBAL 0x0000U
152 151
153struct ipv6_devstat { 152struct ipv6_devstat {
154 struct proc_dir_entry *proc_dir_entry; 153 struct proc_dir_entry *proc_dir_entry;
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h
index 62a5b691858e..e48989f04c24 100644
--- a/include/net/inet6_hashtables.h
+++ b/include/net/inet6_hashtables.h
@@ -24,18 +24,20 @@
24#include <net/inet_sock.h> 24#include <net/inet_sock.h>
25 25
26#include <net/ipv6.h> 26#include <net/ipv6.h>
27#include <net/netns/hash.h>
27 28
28struct inet_hashinfo; 29struct inet_hashinfo;
29 30
30/* I have no idea if this is a good hash for v6 or not. -DaveM */ 31/* I have no idea if this is a good hash for v6 or not. -DaveM */
31static inline unsigned int inet6_ehashfn(const struct in6_addr *laddr, const u16 lport, 32static inline unsigned int inet6_ehashfn(struct net *net,
33 const struct in6_addr *laddr, const u16 lport,
32 const struct in6_addr *faddr, const __be16 fport) 34 const struct in6_addr *faddr, const __be16 fport)
33{ 35{
34 u32 ports = (lport ^ (__force u16)fport); 36 u32 ports = (lport ^ (__force u16)fport);
35 37
36 return jhash_3words((__force u32)laddr->s6_addr32[3], 38 return jhash_3words((__force u32)laddr->s6_addr32[3],
37 (__force u32)faddr->s6_addr32[3], 39 (__force u32)faddr->s6_addr32[3],
38 ports, inet_ehash_secret); 40 ports, inet_ehash_secret + net_hash_mix(net));
39} 41}
40 42
41static inline int inet6_sk_ehashfn(const struct sock *sk) 43static inline int inet6_sk_ehashfn(const struct sock *sk)
@@ -46,7 +48,9 @@ static inline int inet6_sk_ehashfn(const struct sock *sk)
46 const struct in6_addr *faddr = &np->daddr; 48 const struct in6_addr *faddr = &np->daddr;
47 const __u16 lport = inet->num; 49 const __u16 lport = inet->num;
48 const __be16 fport = inet->dport; 50 const __be16 fport = inet->dport;
49 return inet6_ehashfn(laddr, lport, faddr, fport); 51 struct net *net = sock_net(sk);
52
53 return inet6_ehashfn(net, laddr, lport, faddr, fport);
50} 54}
51 55
52extern void __inet6_hash(struct sock *sk); 56extern void __inet6_hash(struct sock *sk);
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index 735b926a3497..bb619d80f2e2 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -29,6 +29,7 @@
29#include <net/inet_sock.h> 29#include <net/inet_sock.h>
30#include <net/sock.h> 30#include <net/sock.h>
31#include <net/tcp_states.h> 31#include <net/tcp_states.h>
32#include <net/netns/hash.h>
32 33
33#include <asm/atomic.h> 34#include <asm/atomic.h>
34#include <asm/byteorder.h> 35#include <asm/byteorder.h>
@@ -201,23 +202,24 @@ extern struct inet_bind_bucket *
201extern void inet_bind_bucket_destroy(struct kmem_cache *cachep, 202extern void inet_bind_bucket_destroy(struct kmem_cache *cachep,
202 struct inet_bind_bucket *tb); 203 struct inet_bind_bucket *tb);
203 204
204static inline int inet_bhashfn(const __u16 lport, const int bhash_size) 205static inline int inet_bhashfn(struct net *net,
206 const __u16 lport, const int bhash_size)
205{ 207{
206 return lport & (bhash_size - 1); 208 return (lport + net_hash_mix(net)) & (bhash_size - 1);
207} 209}
208 210
209extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb, 211extern void inet_bind_hash(struct sock *sk, struct inet_bind_bucket *tb,
210 const unsigned short snum); 212 const unsigned short snum);
211 213
212/* These can have wildcards, don't try too hard. */ 214/* These can have wildcards, don't try too hard. */
213static inline int inet_lhashfn(const unsigned short num) 215static inline int inet_lhashfn(struct net *net, const unsigned short num)
214{ 216{
215 return num & (INET_LHTABLE_SIZE - 1); 217 return (num + net_hash_mix(net)) & (INET_LHTABLE_SIZE - 1);
216} 218}
217 219
218static inline int inet_sk_listen_hashfn(const struct sock *sk) 220static inline int inet_sk_listen_hashfn(const struct sock *sk)
219{ 221{
220 return inet_lhashfn(inet_sk(sk)->num); 222 return inet_lhashfn(sock_net(sk), inet_sk(sk)->num);
221} 223}
222 224
223/* Caller must disable local BH processing. */ 225/* Caller must disable local BH processing. */
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 9fabe5b38912..643e26be058e 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -25,6 +25,7 @@
25#include <net/sock.h> 25#include <net/sock.h>
26#include <net/request_sock.h> 26#include <net/request_sock.h>
27#include <net/route.h> 27#include <net/route.h>
28#include <net/netns/hash.h>
28 29
29/** struct ip_options - IP Options 30/** struct ip_options - IP Options
30 * 31 *
@@ -171,13 +172,14 @@ extern int inet_sk_rebuild_header(struct sock *sk);
171extern u32 inet_ehash_secret; 172extern u32 inet_ehash_secret;
172extern void build_ehash_secret(void); 173extern void build_ehash_secret(void);
173 174
174static inline unsigned int inet_ehashfn(const __be32 laddr, const __u16 lport, 175static inline unsigned int inet_ehashfn(struct net *net,
176 const __be32 laddr, const __u16 lport,
175 const __be32 faddr, const __be16 fport) 177 const __be32 faddr, const __be16 fport)
176{ 178{
177 return jhash_3words((__force __u32) laddr, 179 return jhash_3words((__force __u32) laddr,
178 (__force __u32) faddr, 180 (__force __u32) faddr,
179 ((__u32) lport) << 16 | (__force __u32)fport, 181 ((__u32) lport) << 16 | (__force __u32)fport,
180 inet_ehash_secret); 182 inet_ehash_secret + net_hash_mix(net));
181} 183}
182 184
183static inline int inet_sk_ehashfn(const struct sock *sk) 185static inline int inet_sk_ehashfn(const struct sock *sk)
@@ -187,8 +189,9 @@ static inline int inet_sk_ehashfn(const struct sock *sk)
187 const __u16 lport = inet->num; 189 const __u16 lport = inet->num;
188 const __be32 faddr = inet->daddr; 190 const __be32 faddr = inet->daddr;
189 const __be16 fport = inet->dport; 191 const __be16 fport = inet->dport;
192 struct net *net = sock_net(sk);
190 193
191 return inet_ehashfn(laddr, lport, faddr, fport); 194 return inet_ehashfn(net, laddr, lport, faddr, fport);
192} 195}
193 196
194 197
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index ad8404b56113..15e1f8fe4c1f 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -1,8 +1,6 @@
1/* 1/*
2 * INETPEER - A storage for permanent information about peers 2 * INETPEER - A storage for permanent information about peers
3 * 3 *
4 * Version: $Id: inetpeer.h,v 1.2 2002/01/12 07:54:56 davem Exp $
5 *
6 * Authors: Andrey V. Savochkin <saw@msu.ru> 4 * Authors: Andrey V. Savochkin <saw@msu.ru>
7 */ 5 */
8 6
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
index 6512d85f11b3..83b4e008b16d 100644
--- a/include/net/ip6_tunnel.h
+++ b/include/net/ip6_tunnel.h
@@ -1,7 +1,3 @@
1/*
2 * $Id$
3 */
4
5#ifndef _NET_IP6_TUNNEL_H 1#ifndef _NET_IP6_TUNNEL_H
6#define _NET_IP6_TUNNEL_H 2#define _NET_IP6_TUNNEL_H
7 3
@@ -19,7 +15,6 @@
19struct ip6_tnl { 15struct ip6_tnl {
20 struct ip6_tnl *next; /* next tunnel in list */ 16 struct ip6_tnl *next; /* next tunnel in list */
21 struct net_device *dev; /* virtual device associated with tunnel */ 17 struct net_device *dev; /* virtual device associated with tunnel */
22 struct net_device_stats stat; /* statistics for tunnel device */
23 int recursion; /* depth of hard_start_xmit recursion */ 18 int recursion; /* depth of hard_start_xmit recursion */
24 struct ip6_tnl_parm parms; /* tunnel configuration parameters */ 19 struct ip6_tnl_parm parms; /* tunnel configuration parameters */
25 struct flowi fl; /* flowi template for xmit */ 20 struct flowi fl; /* flowi template for xmit */
diff --git a/include/net/ipconfig.h b/include/net/ipconfig.h
index 3924d7d2cb11..c74cc1bd5a02 100644
--- a/include/net/ipconfig.h
+++ b/include/net/ipconfig.h
@@ -1,6 +1,4 @@
1/* 1/*
2 * $Id: ipconfig.h,v 1.4 2001/04/30 04:51:46 davem Exp $
3 *
4 * Copyright (C) 1997 Martin Mares 2 * Copyright (C) 1997 Martin Mares
5 * 3 *
6 * Automatic IP Layer Configuration 4 * Automatic IP Layer Configuration
diff --git a/include/net/ipip.h b/include/net/ipip.h
index 633ed4def8e3..a85bda64b852 100644
--- a/include/net/ipip.h
+++ b/include/net/ipip.h
@@ -11,7 +11,6 @@ struct ip_tunnel
11{ 11{
12 struct ip_tunnel *next; 12 struct ip_tunnel *next;
13 struct net_device *dev; 13 struct net_device *dev;
14 struct net_device_stats stat;
15 14
16 int recursion; /* Depth of hard_start_xmit recursion */ 15 int recursion; /* Depth of hard_start_xmit recursion */
17 int err_count; /* Number of arrived ICMP errors */ 16 int err_count; /* Number of arrived ICMP errors */
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index f422f7218e1c..c2222ee74d66 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -4,8 +4,6 @@
4 * Authors: 4 * Authors:
5 * Pedro Roque <roque@di.fc.ul.pt> 5 * Pedro Roque <roque@di.fc.ul.pt>
6 * 6 *
7 * $Id: ipv6.h,v 1.1 2002/05/20 15:13:07 jgrimm Exp $
8 *
9 * This program is free software; you can redistribute it and/or 7 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License 8 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 9 * as published by the Free Software Foundation; either version
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h
index f70e9b39ebaf..3025ae17ddbe 100644
--- a/include/net/irda/irda_device.h
+++ b/include/net/irda/irda_device.h
@@ -223,7 +223,7 @@ int irda_device_is_receiving(struct net_device *dev);
223/* Interface for internal use */ 223/* Interface for internal use */
224static inline int irda_device_txqueue_empty(const struct net_device *dev) 224static inline int irda_device_txqueue_empty(const struct net_device *dev)
225{ 225{
226 return skb_queue_empty(&dev->qdisc->q); 226 return qdisc_all_tx_empty(dev);
227} 227}
228int irda_device_set_raw_mode(struct net_device* self, int status); 228int irda_device_set_raw_mode(struct net_device* self, int status);
229struct net_device *alloc_irdadev(int sizeof_priv); 229struct net_device *alloc_irdadev(int sizeof_priv);
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h
index 369d50e08b99..51b9a37de991 100644
--- a/include/net/iw_handler.h
+++ b/include/net/iw_handler.h
@@ -256,7 +256,7 @@
256#define EIWCOMMIT EINPROGRESS 256#define EIWCOMMIT EINPROGRESS
257 257
258/* Flags available in struct iw_request_info */ 258/* Flags available in struct iw_request_info */
259#define IW_REQUEST_FLAG_NONE 0x0000 /* No flag so far */ 259#define IW_REQUEST_FLAG_COMPAT 0x0001 /* Compat ioctl call */
260 260
261/* Type of headers we know about (basically union iwreq_data) */ 261/* Type of headers we know about (basically union iwreq_data) */
262#define IW_HEADER_TYPE_NULL 0 /* Not available */ 262#define IW_HEADER_TYPE_NULL 0 /* Not available */
@@ -478,105 +478,58 @@ extern void wireless_spy_update(struct net_device * dev,
478 * Function that are so simple that it's more efficient inlining them 478 * Function that are so simple that it's more efficient inlining them
479 */ 479 */
480 480
481/*------------------------------------------------------------------*/ 481static inline int iwe_stream_lcp_len(struct iw_request_info *info)
482/*
483 * Wrapper to add an Wireless Event to a stream of events.
484 */
485static inline char *
486iwe_stream_add_event(char * stream, /* Stream of events */
487 char * ends, /* End of stream */
488 struct iw_event *iwe, /* Payload */
489 int event_len) /* Real size of payload */
490{ 482{
491 /* Check if it's possible */ 483#ifdef CONFIG_COMPAT
492 if(likely((stream + event_len) < ends)) { 484 if (info->flags & IW_REQUEST_FLAG_COMPAT)
493 iwe->len = event_len; 485 return IW_EV_COMPAT_LCP_LEN;
494 /* Beware of alignement issues on 64 bits */ 486#endif
495 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 487 return IW_EV_LCP_LEN;
496 memcpy(stream + IW_EV_LCP_LEN,
497 ((char *) iwe) + IW_EV_LCP_LEN,
498 event_len - IW_EV_LCP_LEN);
499 stream += event_len;
500 }
501 return stream;
502} 488}
503 489
504/*------------------------------------------------------------------*/ 490static inline int iwe_stream_point_len(struct iw_request_info *info)
505/*
506 * Wrapper to add an short Wireless Event containing a pointer to a
507 * stream of events.
508 */
509static inline char *
510iwe_stream_add_point(char * stream, /* Stream of events */
511 char * ends, /* End of stream */
512 struct iw_event *iwe, /* Payload length + flags */
513 char * extra) /* More payload */
514{ 491{
515 int event_len = IW_EV_POINT_LEN + iwe->u.data.length; 492#ifdef CONFIG_COMPAT
516 /* Check if it's possible */ 493 if (info->flags & IW_REQUEST_FLAG_COMPAT)
517 if(likely((stream + event_len) < ends)) { 494 return IW_EV_COMPAT_POINT_LEN;
518 iwe->len = event_len; 495#endif
519 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 496 return IW_EV_POINT_LEN;
520 memcpy(stream + IW_EV_LCP_LEN,
521 ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF,
522 IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
523 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length);
524 stream += event_len;
525 }
526 return stream;
527} 497}
528 498
529/*------------------------------------------------------------------*/ 499static inline int iwe_stream_event_len_adjust(struct iw_request_info *info,
530/* 500 int event_len)
531 * Wrapper to add a value to a Wireless Event in a stream of events.
532 * Be careful, this one is tricky to use properly :
533 * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
534 */
535static inline char *
536iwe_stream_add_value(char * event, /* Event in the stream */
537 char * value, /* Value in event */
538 char * ends, /* End of stream */
539 struct iw_event *iwe, /* Payload */
540 int event_len) /* Real size of payload */
541{ 501{
542 /* Don't duplicate LCP */ 502#ifdef CONFIG_COMPAT
543 event_len -= IW_EV_LCP_LEN; 503 if (info->flags & IW_REQUEST_FLAG_COMPAT) {
544 504 event_len -= IW_EV_LCP_LEN;
545 /* Check if it's possible */ 505 event_len += IW_EV_COMPAT_LCP_LEN;
546 if(likely((value + event_len) < ends)) {
547 /* Add new value */
548 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len);
549 value += event_len;
550 /* Patch LCP */
551 iwe->len = value - event;
552 memcpy(event, (char *) iwe, IW_EV_LCP_LEN);
553 } 506 }
554 return value; 507#endif
508
509 return event_len;
555} 510}
556 511
557/*------------------------------------------------------------------*/ 512/*------------------------------------------------------------------*/
558/* 513/*
559 * Wrapper to add an Wireless Event to a stream of events. 514 * Wrapper to add an Wireless Event to a stream of events.
560 * Same as above, with explicit error check...
561 */ 515 */
562static inline char * 516static inline char *
563iwe_stream_check_add_event(char * stream, /* Stream of events */ 517iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends,
564 char * ends, /* End of stream */ 518 struct iw_event *iwe, int event_len)
565 struct iw_event *iwe, /* Payload */
566 int event_len, /* Size of payload */
567 int * perr) /* Error report */
568{ 519{
569 /* Check if it's possible, set error if not */ 520 int lcp_len = iwe_stream_lcp_len(info);
521
522 event_len = iwe_stream_event_len_adjust(info, event_len);
523
524 /* Check if it's possible */
570 if(likely((stream + event_len) < ends)) { 525 if(likely((stream + event_len) < ends)) {
571 iwe->len = event_len; 526 iwe->len = event_len;
572 /* Beware of alignement issues on 64 bits */ 527 /* Beware of alignement issues on 64 bits */
573 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 528 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN);
574 memcpy(stream + IW_EV_LCP_LEN, 529 memcpy(stream + lcp_len, &iwe->u,
575 ((char *) iwe) + IW_EV_LCP_LEN, 530 event_len - lcp_len);
576 event_len - IW_EV_LCP_LEN);
577 stream += event_len; 531 stream += event_len;
578 } else 532 }
579 *perr = -E2BIG;
580 return stream; 533 return stream;
581} 534}
582 535
@@ -584,27 +537,25 @@ iwe_stream_check_add_event(char * stream, /* Stream of events */
584/* 537/*
585 * Wrapper to add an short Wireless Event containing a pointer to a 538 * Wrapper to add an short Wireless Event containing a pointer to a
586 * stream of events. 539 * stream of events.
587 * Same as above, with explicit error check...
588 */ 540 */
589static inline char * 541static inline char *
590iwe_stream_check_add_point(char * stream, /* Stream of events */ 542iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends,
591 char * ends, /* End of stream */ 543 struct iw_event *iwe, char *extra)
592 struct iw_event *iwe, /* Payload length + flags */
593 char * extra, /* More payload */
594 int * perr) /* Error report */
595{ 544{
596 int event_len = IW_EV_POINT_LEN + iwe->u.data.length; 545 int event_len = iwe_stream_point_len(info) + iwe->u.data.length;
546 int point_len = iwe_stream_point_len(info);
547 int lcp_len = iwe_stream_lcp_len(info);
548
597 /* Check if it's possible */ 549 /* Check if it's possible */
598 if(likely((stream + event_len) < ends)) { 550 if(likely((stream + event_len) < ends)) {
599 iwe->len = event_len; 551 iwe->len = event_len;
600 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN); 552 memcpy(stream, (char *) iwe, IW_EV_LCP_PK_LEN);
601 memcpy(stream + IW_EV_LCP_LEN, 553 memcpy(stream + lcp_len,
602 ((char *) iwe) + IW_EV_LCP_LEN + IW_EV_POINT_OFF, 554 ((char *) &iwe->u) + IW_EV_POINT_OFF,
603 IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN); 555 IW_EV_POINT_PK_LEN - IW_EV_LCP_PK_LEN);
604 memcpy(stream + IW_EV_POINT_LEN, extra, iwe->u.data.length); 556 memcpy(stream + point_len, extra, iwe->u.data.length);
605 stream += event_len; 557 stream += event_len;
606 } else 558 }
607 *perr = -E2BIG;
608 return stream; 559 return stream;
609} 560}
610 561
@@ -613,29 +564,25 @@ iwe_stream_check_add_point(char * stream, /* Stream of events */
613 * Wrapper to add a value to a Wireless Event in a stream of events. 564 * Wrapper to add a value to a Wireless Event in a stream of events.
614 * Be careful, this one is tricky to use properly : 565 * Be careful, this one is tricky to use properly :
615 * At the first run, you need to have (value = event + IW_EV_LCP_LEN). 566 * At the first run, you need to have (value = event + IW_EV_LCP_LEN).
616 * Same as above, with explicit error check...
617 */ 567 */
618static inline char * 568static inline char *
619iwe_stream_check_add_value(char * event, /* Event in the stream */ 569iwe_stream_add_value(struct iw_request_info *info, char *event, char *value,
620 char * value, /* Value in event */ 570 char *ends, struct iw_event *iwe, int event_len)
621 char * ends, /* End of stream */
622 struct iw_event *iwe, /* Payload */
623 int event_len, /* Size of payload */
624 int * perr) /* Error report */
625{ 571{
572 int lcp_len = iwe_stream_lcp_len(info);
573
626 /* Don't duplicate LCP */ 574 /* Don't duplicate LCP */
627 event_len -= IW_EV_LCP_LEN; 575 event_len -= IW_EV_LCP_LEN;
628 576
629 /* Check if it's possible */ 577 /* Check if it's possible */
630 if(likely((value + event_len) < ends)) { 578 if(likely((value + event_len) < ends)) {
631 /* Add new value */ 579 /* Add new value */
632 memcpy(value, (char *) iwe + IW_EV_LCP_LEN, event_len); 580 memcpy(value, &iwe->u, event_len);
633 value += event_len; 581 value += event_len;
634 /* Patch LCP */ 582 /* Patch LCP */
635 iwe->len = value - event; 583 iwe->len = value - event;
636 memcpy(event, (char *) iwe, IW_EV_LCP_LEN); 584 memcpy(event, (char *) iwe, lcp_len);
637 } else 585 }
638 *perr = -E2BIG;
639 return value; 586 return value;
640} 587}
641 588
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index bcd1623245cb..656442c6b1c3 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -42,7 +42,7 @@
42 * tasklet function. 42 * tasklet function.
43 * 43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also 44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
45 * use the non-irqsafe functions! 45 * use the non-IRQ-safe functions!
46 */ 46 */
47 47
48/** 48/**
@@ -85,7 +85,7 @@ enum ieee80211_notification_types {
85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics 85 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
86 * 86 *
87 * This structure describes most essential parameters needed 87 * This structure describes most essential parameters needed
88 * to describe 802.11n HT characteristics in a BSS 88 * to describe 802.11n HT characteristics in a BSS.
89 * 89 *
90 * @primary_channel: channel number of primery channel 90 * @primary_channel: channel number of primery channel
91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width) 91 * @bss_cap: 802.11n's general BSS capabilities (e.g. channel width)
@@ -98,6 +98,18 @@ struct ieee80211_ht_bss_info {
98}; 98};
99 99
100/** 100/**
101 * enum ieee80211_max_queues - maximum number of queues
102 *
103 * @IEEE80211_MAX_QUEUES: Maximum number of regular device queues.
104 * @IEEE80211_MAX_AMPDU_QUEUES: Maximum number of queues usable
105 * for A-MPDU operation.
106 */
107enum ieee80211_max_queues {
108 IEEE80211_MAX_QUEUES = 16,
109 IEEE80211_MAX_AMPDU_QUEUES = 16,
110};
111
112/**
101 * struct ieee80211_tx_queue_params - transmit queue configuration 113 * struct ieee80211_tx_queue_params - transmit queue configuration
102 * 114 *
103 * The information provided in this structure is required for QoS 115 * The information provided in this structure is required for QoS
@@ -117,58 +129,18 @@ struct ieee80211_tx_queue_params {
117}; 129};
118 130
119/** 131/**
120 * struct ieee80211_tx_queue_stats_data - transmit queue statistics 132 * struct ieee80211_tx_queue_stats - transmit queue statistics
121 * 133 *
122 * @len: number of packets in queue 134 * @len: number of packets in queue
123 * @limit: queue length limit 135 * @limit: queue length limit
124 * @count: number of frames sent 136 * @count: number of frames sent
125 */ 137 */
126struct ieee80211_tx_queue_stats_data { 138struct ieee80211_tx_queue_stats {
127 unsigned int len; 139 unsigned int len;
128 unsigned int limit; 140 unsigned int limit;
129 unsigned int count; 141 unsigned int count;
130}; 142};
131 143
132/**
133 * enum ieee80211_tx_queue - transmit queue number
134 *
135 * These constants are used with some callbacks that take a
136 * queue number to set parameters for a queue.
137 *
138 * @IEEE80211_TX_QUEUE_DATA0: data queue 0
139 * @IEEE80211_TX_QUEUE_DATA1: data queue 1
140 * @IEEE80211_TX_QUEUE_DATA2: data queue 2
141 * @IEEE80211_TX_QUEUE_DATA3: data queue 3
142 * @IEEE80211_TX_QUEUE_DATA4: data queue 4
143 * @IEEE80211_TX_QUEUE_SVP: ??
144 * @NUM_TX_DATA_QUEUES: number of data queues
145 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
146 * sent after a beacon
147 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
148 * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
149 */
150enum ieee80211_tx_queue {
151 IEEE80211_TX_QUEUE_DATA0,
152 IEEE80211_TX_QUEUE_DATA1,
153 IEEE80211_TX_QUEUE_DATA2,
154 IEEE80211_TX_QUEUE_DATA3,
155 IEEE80211_TX_QUEUE_DATA4,
156 IEEE80211_TX_QUEUE_SVP,
157
158 NUM_TX_DATA_QUEUES,
159
160/* due to stupidity in the sub-ioctl userspace interface, the items in
161 * this struct need to have fixed values. As soon as it is removed, we can
162 * fix these entries. */
163 IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
164 IEEE80211_TX_QUEUE_BEACON = 7,
165 NUM_TX_DATA_QUEUES_AMPDU = 16
166};
167
168struct ieee80211_tx_queue_stats {
169 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
170};
171
172struct ieee80211_low_level_stats { 144struct ieee80211_low_level_stats {
173 unsigned int dot11ACKFailureCount; 145 unsigned int dot11ACKFailureCount;
174 unsigned int dot11RTSFailureCount; 146 unsigned int dot11RTSFailureCount;
@@ -229,91 +201,139 @@ struct ieee80211_bss_conf {
229}; 201};
230 202
231/** 203/**
232 * enum mac80211_tx_control_flags - flags to describe Tx configuration for 204 * enum mac80211_tx_control_flags - flags to describe transmission information/status
233 * the Tx frame 205 *
234 * 206 * These flags are used with the @flags member of &ieee80211_tx_info.
235 * These flags are used with the @flags member of &ieee80211_tx_control 207 *
236 * 208 * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame.
237 * @IEEE80211_TXCTL_REQ_TX_STATUS: request TX status callback for this frame. 209 * @IEEE80211_TX_CTL_DO_NOT_ENCRYPT: send this frame without encryption;
238 * @IEEE80211_TXCTL_DO_NOT_ENCRYPT: send this frame without encryption; 210 * e.g., for EAPOL frame
239 * e.g., for EAPOL frame 211 * @IEEE80211_TX_CTL_USE_RTS_CTS: use RTS-CTS before sending frame
240 * @IEEE80211_TXCTL_USE_RTS_CTS: use RTS-CTS before sending frame 212 * @IEEE80211_TX_CTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g.,
241 * @IEEE80211_TXCTL_USE_CTS_PROTECT: use CTS protection for the frame (e.g., 213 * for combined 802.11g / 802.11b networks)
242 * for combined 802.11g / 802.11b networks) 214 * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
243 * @IEEE80211_TXCTL_NO_ACK: tell the low level not to wait for an ack 215 * @IEEE80211_TX_CTL_RATE_CTRL_PROBE: TBD
244 * @IEEE80211_TXCTL_RATE_CTRL_PROBE 216 * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
245 * @EEE80211_TXCTL_CLEAR_PS_FILT: clear powersave filter 217 * station
246 * for destination station 218 * @IEEE80211_TX_CTL_REQUEUE: TBD
247 * @IEEE80211_TXCTL_REQUEUE: 219 * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
248 * @IEEE80211_TXCTL_FIRST_FRAGMENT: this is a first fragment of the frame 220 * @IEEE80211_TX_CTL_SHORT_PREAMBLE: TBD
249 * @IEEE80211_TXCTL_LONG_RETRY_LIMIT: this frame should be send using the 221 * @IEEE80211_TX_CTL_LONG_RETRY_LIMIT: this frame should be send using the
250 * through set_retry_limit configured long 222 * through set_retry_limit configured long retry value
251 * retry value 223 * @IEEE80211_TX_CTL_EAPOL_FRAME: internal to mac80211
252 * @IEEE80211_TXCTL_EAPOL_FRAME: internal to mac80211 224 * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
253 * @IEEE80211_TXCTL_SEND_AFTER_DTIM: send this frame after DTIM beacon 225 * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
254 * @IEEE80211_TXCTL_AMPDU: this frame should be sent as part of an A-MPDU 226 * @IEEE80211_TX_CTL_OFDM_HT: this frame can be sent in HT OFDM rates. number
255 * @IEEE80211_TXCTL_OFDM_HT: this frame can be sent in HT OFDM rates. number 227 * of streams when this flag is on can be extracted from antenna_sel_tx,
256 * of streams when this flag is on can be extracted 228 * so if 1 antenna is marked use SISO, 2 antennas marked use MIMO, n
257 * from antenna_sel_tx, so if 1 antenna is marked 229 * antennas marked use MIMO_n.
258 * use SISO, 2 antennas marked use MIMO, n antennas 230 * @IEEE80211_TX_CTL_GREEN_FIELD: use green field protection for this frame
259 * marked use MIMO_n. 231 * @IEEE80211_TX_CTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width
260 * @IEEE80211_TXCTL_GREEN_FIELD: use green field protection for this frame 232 * @IEEE80211_TX_CTL_DUP_DATA: duplicate data frame on both 20 Mhz channels
261 * @IEEE80211_TXCTL_40_MHZ_WIDTH: send this frame using 40 Mhz channel width 233 * @IEEE80211_TX_CTL_SHORT_GI: send this frame using short guard interval
262 * @IEEE80211_TXCTL_DUP_DATA: duplicate data frame on both 20 Mhz channels 234 * @IEEE80211_TX_CTL_INJECTED: TBD
263 * @IEEE80211_TXCTL_SHORT_GI: send this frame using short guard interval 235 * @IEEE80211_TX_STAT_TX_FILTERED: The frame was not transmitted
236 * because the destination STA was in powersave mode.
237 * @IEEE80211_TX_STAT_ACK: Frame was acknowledged
238 * @IEEE80211_TX_STAT_AMPDU: The frame was aggregated, so status
239 * is for the whole aggregation.
240 * @IEEE80211_TX_STAT_AMPDU_NO_BACK: no block ack was returned,
241 * so consider using block ack request (BAR).
264 */ 242 */
265enum mac80211_tx_control_flags { 243enum mac80211_tx_control_flags {
266 IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0), 244 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
267 IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1), 245 IEEE80211_TX_CTL_DO_NOT_ENCRYPT = BIT(1),
268 IEEE80211_TXCTL_USE_RTS_CTS = (1<<2), 246 IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2),
269 IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3), 247 IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3),
270 IEEE80211_TXCTL_NO_ACK = (1<<4), 248 IEEE80211_TX_CTL_NO_ACK = BIT(4),
271 IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5), 249 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5),
272 IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6), 250 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6),
273 IEEE80211_TXCTL_REQUEUE = (1<<7), 251 IEEE80211_TX_CTL_REQUEUE = BIT(7),
274 IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8), 252 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8),
275 IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9), 253 IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9),
276 IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10), 254 IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10),
277 IEEE80211_TXCTL_EAPOL_FRAME = (1<<11), 255 IEEE80211_TX_CTL_EAPOL_FRAME = BIT(11),
278 IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12), 256 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12),
279 IEEE80211_TXCTL_AMPDU = (1<<13), 257 IEEE80211_TX_CTL_AMPDU = BIT(13),
280 IEEE80211_TXCTL_OFDM_HT = (1<<14), 258 IEEE80211_TX_CTL_OFDM_HT = BIT(14),
281 IEEE80211_TXCTL_GREEN_FIELD = (1<<15), 259 IEEE80211_TX_CTL_GREEN_FIELD = BIT(15),
282 IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16), 260 IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16),
283 IEEE80211_TXCTL_DUP_DATA = (1<<17), 261 IEEE80211_TX_CTL_DUP_DATA = BIT(17),
284 IEEE80211_TXCTL_SHORT_GI = (1<<18), 262 IEEE80211_TX_CTL_SHORT_GI = BIT(18),
263 IEEE80211_TX_CTL_INJECTED = BIT(19),
264 IEEE80211_TX_STAT_TX_FILTERED = BIT(20),
265 IEEE80211_TX_STAT_ACK = BIT(21),
266 IEEE80211_TX_STAT_AMPDU = BIT(22),
267 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23),
285}; 268};
286 269
287/* Transmit control fields. This data structure is passed to low-level driver
288 * with each TX frame. The low-level driver is responsible for configuring
289 * the hardware to use given values (depending on what is supported). */
290 270
291struct ieee80211_tx_control { 271#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \
292 struct ieee80211_vif *vif; 272 (sizeof(((struct sk_buff *)0)->cb) - 8)
293 struct ieee80211_rate *tx_rate; 273#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
294 274 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
295 /* Transmit rate for RTS/CTS frame */ 275
296 struct ieee80211_rate *rts_cts_rate; 276/**
297 277 * struct ieee80211_tx_info - skb transmit information
298 /* retry rate for the last retries */ 278 *
299 struct ieee80211_rate *alt_retry_rate; 279 * This structure is placed in skb->cb for three uses:
300 280 * (1) mac80211 TX control - mac80211 tells the driver what to do
301 u32 flags; /* tx control flags defined above */ 281 * (2) driver internal use (if applicable)
302 u8 key_idx; /* keyidx from hw->set_key(), undefined if 282 * (3) TX status information - driver tells mac80211 what happened
303 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ 283 *
304 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 284 * @flags: transmit info flags, defined above
305 * This could be used when set_retry_limit 285 * @band: TBD
306 * is not implemented by the driver */ 286 * @tx_rate_idx: TBD
307 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit 287 * @antenna_sel_tx: TBD
308 * position represents antenna number used */ 288 * @control: union for control data
309 u8 icv_len; /* length of the ICV/MIC field in octets */ 289 * @status: union for status data
310 u8 iv_len; /* length of the IV field in octets */ 290 * @driver_data: array of driver_data pointers
311 u8 queue; /* hardware queue to use for this frame; 291 * @retry_count: number of retries
312 * 0 = highest, hw->queues-1 = lowest */ 292 * @excessive_retries: set to 1 if the frame was retried many times
313 u16 aid; /* Station AID */ 293 * but not acknowledged
314 int type; /* internal */ 294 * @ampdu_ack_len: number of aggregated frames.
295 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
296 * @ampdu_ack_map: block ack bit map for the aggregation.
297 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
298 * @ack_signal: signal strength of the ACK frame
299 */
300struct ieee80211_tx_info {
301 /* common information */
302 u32 flags;
303 u8 band;
304 s8 tx_rate_idx;
305 u8 antenna_sel_tx;
306
307 /* 1 byte hole */
308
309 union {
310 struct {
311 struct ieee80211_vif *vif;
312 struct ieee80211_key_conf *hw_key;
313 unsigned long jiffies;
314 int ifindex;
315 u16 aid;
316 s8 rts_cts_rate_idx, alt_retry_rate_idx;
317 u8 retry_limit;
318 u8 icv_len;
319 u8 iv_len;
320 } control;
321 struct {
322 u64 ampdu_ack_map;
323 int ack_signal;
324 u8 retry_count;
325 bool excessive_retries;
326 u8 ampdu_ack_len;
327 } status;
328 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS];
329 };
315}; 330};
316 331
332static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
333{
334 return (struct ieee80211_tx_info *)skb->cb;
335}
336
317 337
318/** 338/**
319 * enum mac80211_rx_flags - receive flags 339 * enum mac80211_rx_flags - receive flags
@@ -353,13 +373,16 @@ enum mac80211_rx_flags {
353 * The low-level driver should provide this information (the subset 373 * The low-level driver should provide this information (the subset
354 * supported by hardware) to the 802.11 code with each received 374 * supported by hardware) to the 802.11 code with each received
355 * frame. 375 * frame.
376 *
356 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 377 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
357 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 378 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
358 * @band: the active band when this frame was received 379 * @band: the active band when this frame was received
359 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 380 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
360 * @ssi: signal strength when receiving this frame 381 * @signal: signal strength when receiving this frame, either in dBm, in dB or
361 * @signal: used as 'qual' in statistics reporting 382 * unspecified depending on the hardware capabilities flags
362 * @noise: PHY noise when receiving this frame 383 * @IEEE80211_HW_SIGNAL_*
384 * @noise: noise when receiving this frame, in dBm.
385 * @qual: overall signal quality indication, in percent (0-100).
363 * @antenna: antenna used 386 * @antenna: antenna used
364 * @rate_idx: index of data rate into band's supported rates 387 * @rate_idx: index of data rate into band's supported rates
365 * @flag: %RX_FLAG_* 388 * @flag: %RX_FLAG_*
@@ -368,64 +391,15 @@ struct ieee80211_rx_status {
368 u64 mactime; 391 u64 mactime;
369 enum ieee80211_band band; 392 enum ieee80211_band band;
370 int freq; 393 int freq;
371 int ssi;
372 int signal; 394 int signal;
373 int noise; 395 int noise;
396 int qual;
374 int antenna; 397 int antenna;
375 int rate_idx; 398 int rate_idx;
376 int flag; 399 int flag;
377}; 400};
378 401
379/** 402/**
380 * enum ieee80211_tx_status_flags - transmit status flags
381 *
382 * Status flags to indicate various transmit conditions.
383 *
384 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
385 * because the destination STA was in powersave mode.
386 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
387 * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status
388 * is for the whole aggregation.
389 */
390enum ieee80211_tx_status_flags {
391 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
392 IEEE80211_TX_STATUS_ACK = 1<<1,
393 IEEE80211_TX_STATUS_AMPDU = 1<<2,
394};
395
396/**
397 * struct ieee80211_tx_status - transmit status
398 *
399 * As much information as possible should be provided for each transmitted
400 * frame with ieee80211_tx_status().
401 *
402 * @control: a copy of the &struct ieee80211_tx_control passed to the driver
403 * in the tx() callback.
404 * @flags: transmit status flags, defined above
405 * @retry_count: number of retries
406 * @excessive_retries: set to 1 if the frame was retried many times
407 * but not acknowledged
408 * @ampdu_ack_len: number of aggregated frames.
409 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
410 * @ampdu_ack_map: block ack bit map for the aggregation.
411 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
412 * @ack_signal: signal strength of the ACK frame
413 * @queue_length: ?? REMOVE
414 * @queue_number: ?? REMOVE
415 */
416struct ieee80211_tx_status {
417 struct ieee80211_tx_control control;
418 u8 flags;
419 u8 retry_count;
420 bool excessive_retries;
421 u8 ampdu_ack_len;
422 u64 ampdu_ack_map;
423 int ack_signal;
424 int queue_length;
425 int queue_number;
426};
427
428/**
429 * enum ieee80211_conf_flags - configuration flags 403 * enum ieee80211_conf_flags - configuration flags
430 * 404 *
431 * Flags to define PHY configuration options 405 * Flags to define PHY configuration options
@@ -580,7 +554,6 @@ struct ieee80211_if_conf {
580 u8 *ssid; 554 u8 *ssid;
581 size_t ssid_len; 555 size_t ssid_len;
582 struct sk_buff *beacon; 556 struct sk_buff *beacon;
583 struct ieee80211_tx_control *beacon_control;
584}; 557};
585 558
586/** 559/**
@@ -597,8 +570,8 @@ enum ieee80211_key_alg {
597 570
598/** 571/**
599 * enum ieee80211_key_len - key length 572 * enum ieee80211_key_len - key length
600 * @WEP40: WEP 5 byte long key 573 * @LEN_WEP40: WEP 5-byte long key
601 * @WEP104: WEP 13 byte long key 574 * @LEN_WEP104: WEP 13-byte long key
602 */ 575 */
603enum ieee80211_key_len { 576enum ieee80211_key_len {
604 LEN_WEP40 = 5, 577 LEN_WEP40 = 5,
@@ -619,11 +592,14 @@ enum ieee80211_key_len {
619 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by 592 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
620 * the driver for a TKIP key if it requires Michael MIC 593 * the driver for a TKIP key if it requires Michael MIC
621 * generation in software. 594 * generation in software.
595 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
596 * that the key is pairwise rather then a shared key.
622 */ 597 */
623enum ieee80211_key_flags { 598enum ieee80211_key_flags {
624 IEEE80211_KEY_FLAG_WMM_STA = 1<<0, 599 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
625 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 600 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
626 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 601 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
602 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
627}; 603};
628 604
629/** 605/**
@@ -639,7 +615,12 @@ enum ieee80211_key_flags {
639 * @flags: key flags, see &enum ieee80211_key_flags. 615 * @flags: key flags, see &enum ieee80211_key_flags.
640 * @keyidx: the key index (0-3) 616 * @keyidx: the key index (0-3)
641 * @keylen: key material length 617 * @keylen: key material length
642 * @key: key material 618 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte)
619 * data block:
620 * - Temporal Encryption Key (128 bits)
621 * - Temporal Authenticator Tx MIC Key (64 bits)
622 * - Temporal Authenticator Rx MIC Key (64 bits)
623 *
643 */ 624 */
644struct ieee80211_key_conf { 625struct ieee80211_key_conf {
645 enum ieee80211_key_alg alg; 626 enum ieee80211_key_alg alg;
@@ -667,7 +648,7 @@ enum set_key_cmd {
667 * enum sta_notify_cmd - sta notify command 648 * enum sta_notify_cmd - sta notify command
668 * 649 *
669 * Used with the sta_notify() callback in &struct ieee80211_ops, this 650 * Used with the sta_notify() callback in &struct ieee80211_ops, this
670 * indicates addition and removal of a station to station table 651 * indicates addition and removal of a station to station table.
671 * 652 *
672 * @STA_NOTIFY_ADD: a station was added to the station table 653 * @STA_NOTIFY_ADD: a station was added to the station table
673 * @STA_NOTIFY_REMOVE: a station being removed from the station table 654 * @STA_NOTIFY_REMOVE: a station being removed from the station table
@@ -730,6 +711,29 @@ enum ieee80211_tkip_key_type {
730 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: 711 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
731 * Hardware is not capable of receiving frames with short preamble on 712 * Hardware is not capable of receiving frames with short preamble on
732 * the 2.4 GHz band. 713 * the 2.4 GHz band.
714 *
715 * @IEEE80211_HW_SIGNAL_UNSPEC:
716 * Hardware can provide signal values but we don't know its units. We
717 * expect values between 0 and @max_signal.
718 * If possible please provide dB or dBm instead.
719 *
720 * @IEEE80211_HW_SIGNAL_DB:
721 * Hardware gives signal values in dB, decibel difference from an
722 * arbitrary, fixed reference. We expect values between 0 and @max_signal.
723 * If possible please provide dBm instead.
724 *
725 * @IEEE80211_HW_SIGNAL_DBM:
726 * Hardware gives signal values in dBm, decibel difference from
727 * one milliwatt. This is the preferred method since it is standardized
728 * between different devices. @max_signal does not need to be set.
729 *
730 * @IEEE80211_HW_NOISE_DBM:
731 * Hardware can provide noise (radio interference) values in units dBm,
732 * decibel difference from one milliwatt.
733 *
734 * @IEEE80211_HW_SPECTRUM_MGMT:
735 * Hardware supports spectrum management defined in 802.11h
736 * Measurement, Channel Switch, Quieting, TPC
733 */ 737 */
734enum ieee80211_hw_flags { 738enum ieee80211_hw_flags {
735 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 739 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
@@ -737,6 +741,11 @@ enum ieee80211_hw_flags {
737 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 741 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
738 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, 742 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
739 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 743 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
744 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
745 IEEE80211_HW_SIGNAL_DB = 1<<6,
746 IEEE80211_HW_SIGNAL_DBM = 1<<7,
747 IEEE80211_HW_NOISE_DBM = 1<<8,
748 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
740}; 749};
741 750
742/** 751/**
@@ -754,8 +763,11 @@ enum ieee80211_hw_flags {
754 * @conf: &struct ieee80211_conf, device configuration, don't use. 763 * @conf: &struct ieee80211_conf, device configuration, don't use.
755 * 764 *
756 * @workqueue: single threaded workqueue available for driver use, 765 * @workqueue: single threaded workqueue available for driver use,
757 * allocated by mac80211 on registration and flushed on 766 * allocated by mac80211 on registration and flushed when an
758 * unregistration. 767 * interface is removed.
768 * NOTICE: All work performed on this workqueue should NEVER
769 * acquire the RTNL lock (i.e. Don't use the function
770 * ieee80211_iterate_active_interfaces())
759 * 771 *
760 * @priv: pointer to private area that was allocated for driver use 772 * @priv: pointer to private area that was allocated for driver use
761 * along with this structure. 773 * along with this structure.
@@ -767,15 +779,18 @@ enum ieee80211_hw_flags {
767 * 779 *
768 * @channel_change_time: time (in microseconds) it takes to change channels. 780 * @channel_change_time: time (in microseconds) it takes to change channels.
769 * 781 *
770 * @max_rssi: Maximum value for ssi in RX information, use 782 * @max_signal: Maximum value for signal (rssi) in RX information, used
771 * negative numbers for dBm and 0 to indicate no support. 783 * only when @IEEE80211_HW_SIGNAL_UNSPEC or @IEEE80211_HW_SIGNAL_DB
772 *
773 * @max_signal: like @max_rssi, but for the signal value.
774 *
775 * @max_noise: like @max_rssi, but for the noise value.
776 * 784 *
777 * @queues: number of available hardware transmit queues for 785 * @queues: number of available hardware transmit queues for
778 * data packets. WMM/QoS requires at least four. 786 * data packets. WMM/QoS requires at least four, these
787 * queues need to have configurable access parameters.
788 *
789 * @ampdu_queues: number of available hardware transmit queues
790 * for A-MPDU packets, these have no access parameters
791 * because they're used only for A-MPDU frames. Note that
792 * mac80211 will not currently use any of the regular queues
793 * for aggregation.
779 * 794 *
780 * @rate_control_algorithm: rate control algorithm for this hardware. 795 * @rate_control_algorithm: rate control algorithm for this hardware.
781 * If unset (NULL), the default algorithm will be used. Must be 796 * If unset (NULL), the default algorithm will be used. Must be
@@ -794,10 +809,8 @@ struct ieee80211_hw {
794 unsigned int extra_tx_headroom; 809 unsigned int extra_tx_headroom;
795 int channel_change_time; 810 int channel_change_time;
796 int vif_data_size; 811 int vif_data_size;
797 u8 queues; 812 u16 queues, ampdu_queues;
798 s8 max_rssi;
799 s8 max_signal; 813 s8 max_signal;
800 s8 max_noise;
801}; 814};
802 815
803/** 816/**
@@ -822,6 +835,51 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
822 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); 835 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
823} 836}
824 837
838static inline int ieee80211_num_regular_queues(struct ieee80211_hw *hw)
839{
840#ifdef CONFIG_MAC80211_QOS
841 return hw->queues;
842#else
843 return 1;
844#endif
845}
846
847static inline int ieee80211_num_queues(struct ieee80211_hw *hw)
848{
849#ifdef CONFIG_MAC80211_QOS
850 return hw->queues + hw->ampdu_queues;
851#else
852 return 1;
853#endif
854}
855
856static inline struct ieee80211_rate *
857ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
858 const struct ieee80211_tx_info *c)
859{
860 if (WARN_ON(c->tx_rate_idx < 0))
861 return NULL;
862 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx];
863}
864
865static inline struct ieee80211_rate *
866ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,
867 const struct ieee80211_tx_info *c)
868{
869 if (c->control.rts_cts_rate_idx < 0)
870 return NULL;
871 return &hw->wiphy->bands[c->band]->bitrates[c->control.rts_cts_rate_idx];
872}
873
874static inline struct ieee80211_rate *
875ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
876 const struct ieee80211_tx_info *c)
877{
878 if (c->control.alt_retry_rate_idx < 0)
879 return NULL;
880 return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx];
881}
882
825/** 883/**
826 * DOC: Hardware crypto acceleration 884 * DOC: Hardware crypto acceleration
827 * 885 *
@@ -979,8 +1037,10 @@ enum ieee80211_ampdu_mlme_action {
979 * @tx: Handler that 802.11 module calls for each transmitted frame. 1037 * @tx: Handler that 802.11 module calls for each transmitted frame.
980 * skb contains the buffer starting from the IEEE 802.11 header. 1038 * skb contains the buffer starting from the IEEE 802.11 header.
981 * The low-level driver should send the frame out based on 1039 * The low-level driver should send the frame out based on
982 * configuration in the TX control data. Must be implemented and 1040 * configuration in the TX control data. This handler should,
983 * atomic. 1041 * preferably, never fail and stop queues appropriately, more
1042 * importantly, however, it must never fail for A-MPDU-queues.
1043 * Must be implemented and atomic.
984 * 1044 *
985 * @start: Called before the first netdevice attached to the hardware 1045 * @start: Called before the first netdevice attached to the hardware
986 * is enabled. This should turn on the hardware and must turn on 1046 * is enabled. This should turn on the hardware and must turn on
@@ -1072,15 +1132,13 @@ enum ieee80211_ampdu_mlme_action {
1072 * of assocaited station or AP. 1132 * of assocaited station or AP.
1073 * 1133 *
1074 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1134 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1075 * bursting) for a hardware TX queue. The @queue parameter uses the 1135 * bursting) for a hardware TX queue. Must be atomic.
1076 * %IEEE80211_TX_QUEUE_* constants. Must be atomic.
1077 * 1136 *
1078 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1137 * @get_tx_stats: Get statistics of the current TX queue status. This is used
1079 * to get number of currently queued packets (queue length), maximum queue 1138 * to get number of currently queued packets (queue length), maximum queue
1080 * size (limit), and total number of packets sent using each TX queue 1139 * size (limit), and total number of packets sent using each TX queue
1081 * (count). This information is used for WMM to find out which TX 1140 * (count). The 'stats' pointer points to an array that has hw->queues +
1082 * queues have room for more packets and by hostapd to provide 1141 * hw->ampdu_queues items.
1083 * statistics about the current queueing state to external programs.
1084 * 1142 *
1085 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1143 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1086 * this is only used for IBSS mode debugging and, as such, is not a 1144 * this is only used for IBSS mode debugging and, as such, is not a
@@ -1116,8 +1174,7 @@ enum ieee80211_ampdu_mlme_action {
1116 * that TX/RX_STOP can pass NULL for this parameter. 1174 * that TX/RX_STOP can pass NULL for this parameter.
1117 */ 1175 */
1118struct ieee80211_ops { 1176struct ieee80211_ops {
1119 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1177 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
1120 struct ieee80211_tx_control *control);
1121 int (*start)(struct ieee80211_hw *hw); 1178 int (*start)(struct ieee80211_hw *hw);
1122 void (*stop)(struct ieee80211_hw *hw); 1179 void (*stop)(struct ieee80211_hw *hw);
1123 int (*add_interface)(struct ieee80211_hw *hw, 1180 int (*add_interface)(struct ieee80211_hw *hw,
@@ -1154,15 +1211,14 @@ struct ieee80211_ops {
1154 u32 short_retry, u32 long_retr); 1211 u32 short_retry, u32 long_retr);
1155 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1212 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1156 enum sta_notify_cmd, const u8 *addr); 1213 enum sta_notify_cmd, const u8 *addr);
1157 int (*conf_tx)(struct ieee80211_hw *hw, int queue, 1214 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1158 const struct ieee80211_tx_queue_params *params); 1215 const struct ieee80211_tx_queue_params *params);
1159 int (*get_tx_stats)(struct ieee80211_hw *hw, 1216 int (*get_tx_stats)(struct ieee80211_hw *hw,
1160 struct ieee80211_tx_queue_stats *stats); 1217 struct ieee80211_tx_queue_stats *stats);
1161 u64 (*get_tsf)(struct ieee80211_hw *hw); 1218 u64 (*get_tsf)(struct ieee80211_hw *hw);
1162 void (*reset_tsf)(struct ieee80211_hw *hw); 1219 void (*reset_tsf)(struct ieee80211_hw *hw);
1163 int (*beacon_update)(struct ieee80211_hw *hw, 1220 int (*beacon_update)(struct ieee80211_hw *hw,
1164 struct sk_buff *skb, 1221 struct sk_buff *skb);
1165 struct ieee80211_tx_control *control);
1166 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1222 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1167 int (*ampdu_action)(struct ieee80211_hw *hw, 1223 int (*ampdu_action)(struct ieee80211_hw *hw,
1168 enum ieee80211_ampdu_mlme_action action, 1224 enum ieee80211_ampdu_mlme_action action,
@@ -1292,7 +1348,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw);
1292 * 1348 *
1293 * This function frees everything that was allocated, including the 1349 * This function frees everything that was allocated, including the
1294 * private data for the driver. You must call ieee80211_unregister_hw() 1350 * private data for the driver. You must call ieee80211_unregister_hw()
1295 * before calling this function 1351 * before calling this function.
1296 * 1352 *
1297 * @hw: the hardware to free 1353 * @hw: the hardware to free
1298 */ 1354 */
@@ -1358,16 +1414,12 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1358 * 1414 *
1359 * @hw: the hardware the frame was transmitted by 1415 * @hw: the hardware the frame was transmitted by
1360 * @skb: the frame that was transmitted, owned by mac80211 after this call 1416 * @skb: the frame that was transmitted, owned by mac80211 after this call
1361 * @status: status information for this frame; the status pointer need not
1362 * be valid after this function returns and is not freed by mac80211,
1363 * it is recommended that it points to a stack area
1364 */ 1417 */
1365void ieee80211_tx_status(struct ieee80211_hw *hw, 1418void ieee80211_tx_status(struct ieee80211_hw *hw,
1366 struct sk_buff *skb, 1419 struct sk_buff *skb);
1367 struct ieee80211_tx_status *status);
1368 1420
1369/** 1421/**
1370 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback 1422 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback
1371 * 1423 *
1372 * Like ieee80211_tx_status() but can be called in IRQ context 1424 * Like ieee80211_tx_status() but can be called in IRQ context
1373 * (internally defers to a tasklet.) 1425 * (internally defers to a tasklet.)
@@ -1377,13 +1429,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw,
1377 * 1429 *
1378 * @hw: the hardware the frame was transmitted by 1430 * @hw: the hardware the frame was transmitted by
1379 * @skb: the frame that was transmitted, owned by mac80211 after this call 1431 * @skb: the frame that was transmitted, owned by mac80211 after this call
1380 * @status: status information for this frame; the status pointer need not
1381 * be valid after this function returns and is not freed by mac80211,
1382 * it is recommended that it points to a stack area
1383 */ 1432 */
1384void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, 1433void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1385 struct sk_buff *skb, 1434 struct sk_buff *skb);
1386 struct ieee80211_tx_status *status);
1387 1435
1388/** 1436/**
1389 * ieee80211_beacon_get - beacon generation function 1437 * ieee80211_beacon_get - beacon generation function
@@ -1399,8 +1447,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1399 * is responsible of freeing it. 1447 * is responsible of freeing it.
1400 */ 1448 */
1401struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1449struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1402 struct ieee80211_vif *vif, 1450 struct ieee80211_vif *vif);
1403 struct ieee80211_tx_control *control);
1404 1451
1405/** 1452/**
1406 * ieee80211_rts_get - RTS frame generation function 1453 * ieee80211_rts_get - RTS frame generation function
@@ -1408,7 +1455,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1408 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1455 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1409 * @frame: pointer to the frame that is going to be protected by the RTS. 1456 * @frame: pointer to the frame that is going to be protected by the RTS.
1410 * @frame_len: the frame length (in octets). 1457 * @frame_len: the frame length (in octets).
1411 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1458 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1412 * @rts: The buffer where to store the RTS frame. 1459 * @rts: The buffer where to store the RTS frame.
1413 * 1460 *
1414 * If the RTS frames are generated by the host system (i.e., not in 1461 * If the RTS frames are generated by the host system (i.e., not in
@@ -1418,7 +1465,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1418 */ 1465 */
1419void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1466void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1420 const void *frame, size_t frame_len, 1467 const void *frame, size_t frame_len,
1421 const struct ieee80211_tx_control *frame_txctl, 1468 const struct ieee80211_tx_info *frame_txctl,
1422 struct ieee80211_rts *rts); 1469 struct ieee80211_rts *rts);
1423 1470
1424/** 1471/**
@@ -1426,7 +1473,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1426 * @hw: pointer obtained from ieee80211_alloc_hw(). 1473 * @hw: pointer obtained from ieee80211_alloc_hw().
1427 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1474 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1428 * @frame_len: the length of the frame that is going to be protected by the RTS. 1475 * @frame_len: the length of the frame that is going to be protected by the RTS.
1429 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1476 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1430 * 1477 *
1431 * If the RTS is generated in firmware, but the host system must provide 1478 * If the RTS is generated in firmware, but the host system must provide
1432 * the duration field, the low-level driver uses this function to receive 1479 * the duration field, the low-level driver uses this function to receive
@@ -1434,7 +1481,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1434 */ 1481 */
1435__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, 1482__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1436 struct ieee80211_vif *vif, size_t frame_len, 1483 struct ieee80211_vif *vif, size_t frame_len,
1437 const struct ieee80211_tx_control *frame_txctl); 1484 const struct ieee80211_tx_info *frame_txctl);
1438 1485
1439/** 1486/**
1440 * ieee80211_ctstoself_get - CTS-to-self frame generation function 1487 * ieee80211_ctstoself_get - CTS-to-self frame generation function
@@ -1442,7 +1489,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1442 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1489 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1443 * @frame: pointer to the frame that is going to be protected by the CTS-to-self. 1490 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1444 * @frame_len: the frame length (in octets). 1491 * @frame_len: the frame length (in octets).
1445 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1492 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1446 * @cts: The buffer where to store the CTS-to-self frame. 1493 * @cts: The buffer where to store the CTS-to-self frame.
1447 * 1494 *
1448 * If the CTS-to-self frames are generated by the host system (i.e., not in 1495 * If the CTS-to-self frames are generated by the host system (i.e., not in
@@ -1453,7 +1500,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1453void ieee80211_ctstoself_get(struct ieee80211_hw *hw, 1500void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1454 struct ieee80211_vif *vif, 1501 struct ieee80211_vif *vif,
1455 const void *frame, size_t frame_len, 1502 const void *frame, size_t frame_len,
1456 const struct ieee80211_tx_control *frame_txctl, 1503 const struct ieee80211_tx_info *frame_txctl,
1457 struct ieee80211_cts *cts); 1504 struct ieee80211_cts *cts);
1458 1505
1459/** 1506/**
@@ -1461,7 +1508,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1461 * @hw: pointer obtained from ieee80211_alloc_hw(). 1508 * @hw: pointer obtained from ieee80211_alloc_hw().
1462 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1509 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1463 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self. 1510 * @frame_len: the length of the frame that is going to be protected by the CTS-to-self.
1464 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1511 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1465 * 1512 *
1466 * If the CTS-to-self is generated in firmware, but the host system must provide 1513 * If the CTS-to-self is generated in firmware, but the host system must provide
1467 * the duration field, the low-level driver uses this function to receive 1514 * the duration field, the low-level driver uses this function to receive
@@ -1470,7 +1517,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1470__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, 1517__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1471 struct ieee80211_vif *vif, 1518 struct ieee80211_vif *vif,
1472 size_t frame_len, 1519 size_t frame_len,
1473 const struct ieee80211_tx_control *frame_txctl); 1520 const struct ieee80211_tx_info *frame_txctl);
1474 1521
1475/** 1522/**
1476 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 1523 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
@@ -1509,8 +1556,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1509 * use common code for all beacons. 1556 * use common code for all beacons.
1510 */ 1557 */
1511struct sk_buff * 1558struct sk_buff *
1512ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1559ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1513 struct ieee80211_tx_control *control);
1514 1560
1515/** 1561/**
1516 * ieee80211_get_hdrlen_from_skb - get header length from data 1562 * ieee80211_get_hdrlen_from_skb - get header length from data
@@ -1522,7 +1568,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1522 * 1568 *
1523 * @skb: the frame 1569 * @skb: the frame
1524 */ 1570 */
1525int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); 1571unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1526 1572
1527/** 1573/**
1528 * ieee80211_get_hdrlen - get header length from frame control 1574 * ieee80211_get_hdrlen - get header length from frame control
@@ -1535,6 +1581,12 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1535int ieee80211_get_hdrlen(u16 fc); 1581int ieee80211_get_hdrlen(u16 fc);
1536 1582
1537/** 1583/**
1584 * ieee80211_hdrlen - get header length in bytes from frame control
1585 * @fc: frame control field in little-endian format
1586 */
1587unsigned int ieee80211_hdrlen(__le16 fc);
1588
1589/**
1538 * ieee80211_get_tkip_key - get a TKIP rc4 for skb 1590 * ieee80211_get_tkip_key - get a TKIP rc4 for skb
1539 * 1591 *
1540 * This function computes a TKIP rc4 key for an skb. It computes 1592 * This function computes a TKIP rc4 key for an skb. It computes
@@ -1545,6 +1597,8 @@ int ieee80211_get_hdrlen(u16 fc);
1545 * @keyconf: the parameter passed with the set key 1597 * @keyconf: the parameter passed with the set key
1546 * @skb: the skb for which the key is needed 1598 * @skb: the skb for which the key is needed
1547 * @rc4key: a buffer to which the key will be written 1599 * @rc4key: a buffer to which the key will be written
1600 * @type: TBD
1601 * @key: TBD
1548 */ 1602 */
1549void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 1603void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
1550 struct sk_buff *skb, 1604 struct sk_buff *skb,
@@ -1568,14 +1622,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue);
1568void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); 1622void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
1569 1623
1570/** 1624/**
1571 * ieee80211_start_queues - start all queues
1572 * @hw: pointer to as obtained from ieee80211_alloc_hw().
1573 *
1574 * Drivers should use this function instead of netif_start_queue.
1575 */
1576void ieee80211_start_queues(struct ieee80211_hw *hw);
1577
1578/**
1579 * ieee80211_stop_queues - stop all queues 1625 * ieee80211_stop_queues - stop all queues
1580 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1626 * @hw: pointer as obtained from ieee80211_alloc_hw().
1581 * 1627 *
@@ -1603,7 +1649,7 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
1603void ieee80211_scan_completed(struct ieee80211_hw *hw); 1649void ieee80211_scan_completed(struct ieee80211_hw *hw);
1604 1650
1605/** 1651/**
1606 * ieee80211_iterate_active_interfaces- iterate active interfaces 1652 * ieee80211_iterate_active_interfaces - iterate active interfaces
1607 * 1653 *
1608 * This function iterates over the interfaces associated with a given 1654 * This function iterates over the interfaces associated with a given
1609 * hardware that are currently active and calls the callback for them. 1655 * hardware that are currently active and calls the callback for them.
@@ -1670,7 +1716,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1670 * 1716 *
1671 * This function must be called by low level driver once it has 1717 * This function must be called by low level driver once it has
1672 * finished with preparations for the BA session. 1718 * finished with preparations for the BA session.
1673 * This version of the function is irq safe. 1719 * This version of the function is IRQ-safe.
1674 */ 1720 */
1675void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1721void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1676 u16 tid); 1722 u16 tid);
@@ -1710,7 +1756,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
1710 * 1756 *
1711 * This function must be called by low level driver once it has 1757 * This function must be called by low level driver once it has
1712 * finished with preparations for the BA session tear down. 1758 * finished with preparations for the BA session tear down.
1713 * This version of the function is irq safe. 1759 * This version of the function is IRQ-safe.
1714 */ 1760 */
1715void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1761void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1716 u16 tid); 1762 u16 tid);
@@ -1718,7 +1764,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1718/** 1764/**
1719 * ieee80211_notify_mac - low level driver notification 1765 * ieee80211_notify_mac - low level driver notification
1720 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1766 * @hw: pointer as obtained from ieee80211_alloc_hw().
1721 * @notification_types: enum ieee80211_notification_types 1767 * @notif_type: enum ieee80211_notification_types
1722 * 1768 *
1723 * This function must be called by low level driver to inform mac80211 of 1769 * This function must be called by low level driver to inform mac80211 of
1724 * low level driver status change or force mac80211 to re-assoc for low 1770 * low level driver status change or force mac80211 to re-assoc for low
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index d9dd0f707296..f90443045c70 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -212,8 +212,11 @@ extern void unregister_pernet_gen_device(int id, struct pernet_operations *);
212struct ctl_path; 212struct ctl_path;
213struct ctl_table; 213struct ctl_table;
214struct ctl_table_header; 214struct ctl_table_header;
215
215extern struct ctl_table_header *register_net_sysctl_table(struct net *net, 216extern struct ctl_table_header *register_net_sysctl_table(struct net *net,
216 const struct ctl_path *path, struct ctl_table *table); 217 const struct ctl_path *path, struct ctl_table *table);
218extern struct ctl_table_header *register_net_sysctl_rotable(
219 const struct ctl_path *path, struct ctl_table *table);
217extern void unregister_net_sysctl_table(struct ctl_table_header *header); 220extern void unregister_net_sysctl_table(struct ctl_table_header *header);
218 221
219#endif /* __NET_NET_NAMESPACE_H */ 222#endif /* __NET_NET_NAMESPACE_H */
diff --git a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
index 9bf059817aec..7573d52a4346 100644
--- a/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
+++ b/include/net/netfilter/ipv4/nf_conntrack_ipv4.h
@@ -9,8 +9,6 @@
9#ifndef _NF_CONNTRACK_IPV4_H 9#ifndef _NF_CONNTRACK_IPV4_H
10#define _NF_CONNTRACK_IPV4_H 10#define _NF_CONNTRACK_IPV4_H
11 11
12/* Returns new sk_buff, or NULL */
13struct sk_buff *nf_ct_ipv4_ct_gather_frags(struct sk_buff *skb);
14 12
15extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4; 13extern struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4;
16 14
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index 2dbd6c015b94..8f5b75734dd0 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -223,6 +223,25 @@ static inline void nf_ct_refresh(struct nf_conn *ct,
223 __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); 223 __nf_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0);
224} 224}
225 225
226extern bool __nf_ct_kill_acct(struct nf_conn *ct,
227 enum ip_conntrack_info ctinfo,
228 const struct sk_buff *skb,
229 int do_acct);
230
231/* kill conntrack and do accounting */
232static inline bool nf_ct_kill_acct(struct nf_conn *ct,
233 enum ip_conntrack_info ctinfo,
234 const struct sk_buff *skb)
235{
236 return __nf_ct_kill_acct(ct, ctinfo, skb, 1);
237}
238
239/* kill conntrack without accounting */
240static inline bool nf_ct_kill(struct nf_conn *ct)
241{
242 return __nf_ct_kill_acct(ct, 0, NULL, 0);
243}
244
226/* These are for NAT. Icky. */ 245/* These are for NAT. Icky. */
227/* Update TCP window tracking data when NAT mangles the packet */ 246/* Update TCP window tracking data when NAT mangles the packet */
228extern void nf_conntrack_tcp_update(const struct sk_buff *skb, 247extern void nf_conntrack_tcp_update(const struct sk_buff *skb,
@@ -239,7 +258,8 @@ nf_ct_iterate_cleanup(int (*iter)(struct nf_conn *i, void *data), void *data);
239extern void nf_conntrack_free(struct nf_conn *ct); 258extern void nf_conntrack_free(struct nf_conn *ct);
240extern struct nf_conn * 259extern struct nf_conn *
241nf_conntrack_alloc(const struct nf_conntrack_tuple *orig, 260nf_conntrack_alloc(const struct nf_conntrack_tuple *orig,
242 const struct nf_conntrack_tuple *repl); 261 const struct nf_conntrack_tuple *repl,
262 gfp_t gfp);
243 263
244/* It's confirmed if it is, or has been in the hash table. */ 264/* It's confirmed if it is, or has been in the hash table. */
245static inline int nf_ct_is_confirmed(struct nf_conn *ct) 265static inline int nf_ct_is_confirmed(struct nf_conn *ct)
diff --git a/include/net/netns/hash.h b/include/net/netns/hash.h
new file mode 100644
index 000000000000..548d78f2cc47
--- /dev/null
+++ b/include/net/netns/hash.h
@@ -0,0 +1,21 @@
1#ifndef __NET_NS_HASH_H__
2#define __NET_NS_HASH_H__
3
4#include <asm/cache.h>
5
6struct net;
7
8static inline unsigned net_hash_mix(struct net *net)
9{
10#ifdef CONFIG_NET_NS
11 /*
12 * shift this right to eliminate bits, that are
13 * always zeroed
14 */
15
16 return (unsigned)(((unsigned long)net) >> L1_CACHE_SHIFT);
17#else
18 return 0;
19#endif
20}
21#endif
diff --git a/include/net/netns/ipv4.h b/include/net/netns/ipv4.h
index 34ee348a2cf2..a6ed83853dcc 100644
--- a/include/net/netns/ipv4.h
+++ b/include/net/netns/ipv4.h
@@ -18,6 +18,7 @@ struct netns_ipv4 {
18 struct ctl_table_header *forw_hdr; 18 struct ctl_table_header *forw_hdr;
19 struct ctl_table_header *frags_hdr; 19 struct ctl_table_header *frags_hdr;
20 struct ctl_table_header *ipv4_hdr; 20 struct ctl_table_header *ipv4_hdr;
21 struct ctl_table_header *route_hdr;
21#endif 22#endif
22 struct ipv4_devconf *devconf_all; 23 struct ipv4_devconf *devconf_all;
23 struct ipv4_devconf *devconf_dflt; 24 struct ipv4_devconf *devconf_dflt;
@@ -36,6 +37,7 @@ struct netns_ipv4 {
36 struct xt_table *iptable_mangle; 37 struct xt_table *iptable_mangle;
37 struct xt_table *iptable_raw; 38 struct xt_table *iptable_raw;
38 struct xt_table *arptable_filter; 39 struct xt_table *arptable_filter;
40 struct xt_table *iptable_security;
39#endif 41#endif
40 42
41 int sysctl_icmp_echo_ignore_all; 43 int sysctl_icmp_echo_ignore_all;
@@ -44,5 +46,8 @@ struct netns_ipv4 {
44 int sysctl_icmp_ratelimit; 46 int sysctl_icmp_ratelimit;
45 int sysctl_icmp_ratemask; 47 int sysctl_icmp_ratemask;
46 int sysctl_icmp_errors_use_inbound_ifaddr; 48 int sysctl_icmp_errors_use_inbound_ifaddr;
49
50 struct timer_list rt_secret_timer;
51 atomic_t rt_genid;
47}; 52};
48#endif 53#endif
diff --git a/include/net/netns/ipv6.h b/include/net/netns/ipv6.h
index ac053be6c256..5bacd838e88b 100644
--- a/include/net/netns/ipv6.h
+++ b/include/net/netns/ipv6.h
@@ -35,6 +35,7 @@ struct netns_ipv6 {
35 struct xt_table *ip6table_filter; 35 struct xt_table *ip6table_filter;
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 struct xt_table *ip6table_security;
38#endif 39#endif
39 struct rt6_info *ip6_null_entry; 40 struct rt6_info *ip6_null_entry;
40 struct rt6_statistics *rt6_stats; 41 struct rt6_statistics *rt6_stats;
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 46fb4d80c74a..d58c1a5eb845 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -72,6 +72,10 @@ extern void qdisc_watchdog_cancel(struct qdisc_watchdog *wd);
72extern struct Qdisc_ops pfifo_qdisc_ops; 72extern struct Qdisc_ops pfifo_qdisc_ops;
73extern struct Qdisc_ops bfifo_qdisc_ops; 73extern struct Qdisc_ops bfifo_qdisc_ops;
74 74
75extern int fifo_set_limit(struct Qdisc *q, unsigned int limit);
76extern struct Qdisc *fifo_create_dflt(struct Qdisc *sch, struct Qdisc_ops *ops,
77 unsigned int limit);
78
75extern int register_qdisc(struct Qdisc_ops *qops); 79extern int register_qdisc(struct Qdisc_ops *qops);
76extern int unregister_qdisc(struct Qdisc_ops *qops); 80extern int unregister_qdisc(struct Qdisc_ops *qops);
77extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); 81extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle);
@@ -80,13 +84,15 @@ extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r,
80 struct nlattr *tab); 84 struct nlattr *tab);
81extern void qdisc_put_rtab(struct qdisc_rate_table *tab); 85extern void qdisc_put_rtab(struct qdisc_rate_table *tab);
82 86
83extern void __qdisc_run(struct net_device *dev); 87extern void __qdisc_run(struct netdev_queue *txq);
84 88
85static inline void qdisc_run(struct net_device *dev) 89static inline void qdisc_run(struct netdev_queue *txq)
86{ 90{
91 struct net_device *dev = txq->dev;
92
87 if (!netif_queue_stopped(dev) && 93 if (!netif_queue_stopped(dev) &&
88 !test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state)) 94 !test_and_set_bit(__QUEUE_STATE_QDISC_RUNNING, &txq->state))
89 __qdisc_run(dev); 95 __qdisc_run(txq);
90} 96}
91 97
92extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, 98extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp,
diff --git a/include/net/rose.h b/include/net/rose.h
index e5bb084d8754..cbd5364b2c8a 100644
--- a/include/net/rose.h
+++ b/include/net/rose.h
@@ -201,7 +201,7 @@ extern void rose_link_device_down(struct net_device *);
201extern struct net_device *rose_dev_first(void); 201extern struct net_device *rose_dev_first(void);
202extern struct net_device *rose_dev_get(rose_address *); 202extern struct net_device *rose_dev_get(rose_address *);
203extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *); 203extern struct rose_route *rose_route_free_lci(unsigned int, struct rose_neigh *);
204extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *); 204extern struct rose_neigh *rose_get_neigh(rose_address *, unsigned char *, unsigned char *, int);
205extern int rose_rt_ioctl(unsigned int, void __user *); 205extern int rose_rt_ioctl(unsigned int, void __user *);
206extern void rose_link_failed(ax25_cb *, int); 206extern void rose_link_failed(ax25_cb *, int);
207extern int rose_route_frame(struct sk_buff *, ax25_cb *); 207extern int rose_route_frame(struct sk_buff *, ax25_cb *);
diff --git a/include/net/route.h b/include/net/route.h
index fc836ff824cc..3140cc500854 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -111,7 +111,7 @@ struct in_device;
111extern int ip_rt_init(void); 111extern int ip_rt_init(void);
112extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, 112extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw,
113 __be32 src, struct net_device *dev); 113 __be32 src, struct net_device *dev);
114extern void rt_cache_flush(int how); 114extern void rt_cache_flush(struct net *net, int how);
115extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); 115extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
116extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); 116extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
117extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); 117extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index a87fc0312edc..5ba66b555578 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -37,13 +37,12 @@ struct Qdisc
37 u32 parent; 37 u32 parent;
38 atomic_t refcnt; 38 atomic_t refcnt;
39 struct sk_buff_head q; 39 struct sk_buff_head q;
40 struct net_device *dev; 40 struct netdev_queue *dev_queue;
41 struct list_head list; 41 struct list_head list;
42 42
43 struct gnet_stats_basic bstats; 43 struct gnet_stats_basic bstats;
44 struct gnet_stats_queue qstats; 44 struct gnet_stats_queue qstats;
45 struct gnet_stats_rate_est rate_est; 45 struct gnet_stats_rate_est rate_est;
46 spinlock_t *stats_lock;
47 struct rcu_head q_rcu; 46 struct rcu_head q_rcu;
48 int (*reshape_fail)(struct sk_buff *skb, 47 int (*reshape_fail)(struct sk_buff *skb,
49 struct Qdisc *q); 48 struct Qdisc *q);
@@ -155,18 +154,64 @@ struct tcf_proto
155 struct tcf_proto_ops *ops; 154 struct tcf_proto_ops *ops;
156}; 155};
157 156
157static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
158{
159 return qdisc->dev_queue->dev;
160}
158 161
159extern void qdisc_lock_tree(struct net_device *dev); 162extern void qdisc_lock_tree(struct net_device *dev);
160extern void qdisc_unlock_tree(struct net_device *dev); 163extern void qdisc_unlock_tree(struct net_device *dev);
161 164
162#define sch_tree_lock(q) qdisc_lock_tree((q)->dev) 165#define sch_tree_lock(q) qdisc_lock_tree(qdisc_dev(q))
163#define sch_tree_unlock(q) qdisc_unlock_tree((q)->dev) 166#define sch_tree_unlock(q) qdisc_unlock_tree(qdisc_dev(q))
164#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) 167#define tcf_tree_lock(tp) qdisc_lock_tree(qdisc_dev((tp)->q))
165#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) 168#define tcf_tree_unlock(tp) qdisc_unlock_tree(qdisc_dev((tp)->q))
166 169
167extern struct Qdisc noop_qdisc; 170extern struct Qdisc noop_qdisc;
168extern struct Qdisc_ops noop_qdisc_ops; 171extern struct Qdisc_ops noop_qdisc_ops;
169 172
173struct Qdisc_class_common
174{
175 u32 classid;
176 struct hlist_node hnode;
177};
178
179struct Qdisc_class_hash
180{
181 struct hlist_head *hash;
182 unsigned int hashsize;
183 unsigned int hashmask;
184 unsigned int hashelems;
185};
186
187static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
188{
189 id ^= id >> 8;
190 id ^= id >> 4;
191 return id & mask;
192}
193
194static inline struct Qdisc_class_common *
195qdisc_class_find(struct Qdisc_class_hash *hash, u32 id)
196{
197 struct Qdisc_class_common *cl;
198 struct hlist_node *n;
199 unsigned int h;
200
201 h = qdisc_class_hash(id, hash->hashmask);
202 hlist_for_each_entry(cl, n, &hash->hash[h], hnode) {
203 if (cl->classid == id)
204 return cl;
205 }
206 return NULL;
207}
208
209extern int qdisc_class_hash_init(struct Qdisc_class_hash *);
210extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *);
211extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *);
212extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
213extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
214
170extern void dev_init_scheduler(struct net_device *dev); 215extern void dev_init_scheduler(struct net_device *dev);
171extern void dev_shutdown(struct net_device *dev); 216extern void dev_shutdown(struct net_device *dev);
172extern void dev_activate(struct net_device *dev); 217extern void dev_activate(struct net_device *dev);
@@ -174,12 +219,45 @@ extern void dev_deactivate(struct net_device *dev);
174extern void qdisc_reset(struct Qdisc *qdisc); 219extern void qdisc_reset(struct Qdisc *qdisc);
175extern void qdisc_destroy(struct Qdisc *qdisc); 220extern void qdisc_destroy(struct Qdisc *qdisc);
176extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 221extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
177extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); 222extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
223 struct Qdisc_ops *ops);
178extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, 224extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
225 struct netdev_queue *dev_queue,
179 struct Qdisc_ops *ops, u32 parentid); 226 struct Qdisc_ops *ops, u32 parentid);
180extern void tcf_destroy(struct tcf_proto *tp); 227extern void tcf_destroy(struct tcf_proto *tp);
181extern void tcf_destroy_chain(struct tcf_proto **fl); 228extern void tcf_destroy_chain(struct tcf_proto **fl);
182 229
230/* Reset all TX qdiscs of a device. */
231static inline void qdisc_reset_all_tx(struct net_device *dev)
232{
233 qdisc_reset(dev->tx_queue.qdisc);
234}
235
236/* Are all TX queues of the device empty? */
237static inline bool qdisc_all_tx_empty(const struct net_device *dev)
238{
239 const struct netdev_queue *txq = &dev->tx_queue;
240 const struct Qdisc *q = txq->qdisc;
241
242 return (q->q.qlen == 0);
243}
244
245/* Are any of the TX qdiscs changing? */
246static inline bool qdisc_tx_changing(struct net_device *dev)
247{
248 struct netdev_queue *txq = &dev->tx_queue;
249
250 return (txq->qdisc != txq->qdisc_sleeping);
251}
252
253/* Is the device using the noop qdisc? */
254static inline bool qdisc_tx_is_noop(const struct net_device *dev)
255{
256 const struct netdev_queue *txq = &dev->tx_queue;
257
258 return (txq->qdisc == &noop_qdisc);
259}
260
183static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 261static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
184 struct sk_buff_head *list) 262 struct sk_buff_head *list)
185{ 263{
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index 90b1e8d23b16..17b932b8a55a 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -179,6 +179,8 @@ int sctp_eps_proc_init(void);
179void sctp_eps_proc_exit(void); 179void sctp_eps_proc_exit(void);
180int sctp_assocs_proc_init(void); 180int sctp_assocs_proc_init(void);
181void sctp_assocs_proc_exit(void); 181void sctp_assocs_proc_exit(void);
182int sctp_remaddr_proc_init(void);
183void sctp_remaddr_proc_exit(void);
182 184
183 185
184/* 186/*
@@ -218,8 +220,6 @@ extern struct kmem_cache *sctp_bucket_cachep __read_mostly;
218#define sctp_release_sock(sk) release_sock(sk) 220#define sctp_release_sock(sk) release_sock(sk)
219#define sctp_bh_lock_sock(sk) bh_lock_sock(sk) 221#define sctp_bh_lock_sock(sk) bh_lock_sock(sk)
220#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk) 222#define sctp_bh_unlock_sock(sk) bh_unlock_sock(sk)
221#define SCTP_SOCK_SLEEP_PRE(sk) SOCK_SLEEP_PRE(sk)
222#define SCTP_SOCK_SLEEP_POST(sk) SOCK_SLEEP_POST(sk)
223 223
224/* SCTP SNMP MIB stats handlers */ 224/* SCTP SNMP MIB stats handlers */
225DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); 225DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics);
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7f25195f9855..82116e84ee34 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -300,6 +300,7 @@ struct sctp_sock {
300 300
301 /* The default SACK delay timeout for new associations. */ 301 /* The default SACK delay timeout for new associations. */
302 __u32 sackdelay; 302 __u32 sackdelay;
303 __u32 sackfreq;
303 304
304 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */ 305 /* Flags controlling Heartbeat, SACK delay, and Path MTU Discovery. */
305 __u32 param_flags; 306 __u32 param_flags;
@@ -826,7 +827,7 @@ struct sctp_packet *sctp_packet_init(struct sctp_packet *,
826 __u16 sport, __u16 dport); 827 __u16 sport, __u16 dport);
827struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int); 828struct sctp_packet *sctp_packet_config(struct sctp_packet *, __u32 vtag, int);
828sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *, 829sctp_xmit_t sctp_packet_transmit_chunk(struct sctp_packet *,
829 struct sctp_chunk *); 830 struct sctp_chunk *, int);
830sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *, 831sctp_xmit_t sctp_packet_append_chunk(struct sctp_packet *,
831 struct sctp_chunk *); 832 struct sctp_chunk *);
832int sctp_packet_transmit(struct sctp_packet *); 833int sctp_packet_transmit(struct sctp_packet *);
@@ -946,6 +947,7 @@ struct sctp_transport {
946 947
947 /* SACK delay timeout */ 948 /* SACK delay timeout */
948 unsigned long sackdelay; 949 unsigned long sackdelay;
950 __u32 sackfreq;
949 951
950 /* When was the last time (in jiffies) that we heard from this 952 /* When was the last time (in jiffies) that we heard from this
951 * transport? We use this to pick new active and retran paths. 953 * transport? We use this to pick new active and retran paths.
@@ -1553,6 +1555,7 @@ struct sctp_association {
1553 * : SACK's are not delayed (see Section 6). 1555 * : SACK's are not delayed (see Section 6).
1554 */ 1556 */
1555 __u8 sack_needed; /* Do we need to sack the peer? */ 1557 __u8 sack_needed; /* Do we need to sack the peer? */
1558 __u32 sack_cnt;
1556 1559
1557 /* These are capabilities which our peer advertised. */ 1560 /* These are capabilities which our peer advertised. */
1558 __u8 ecn_capable; /* Can peer do ECN? */ 1561 __u8 ecn_capable; /* Can peer do ECN? */
@@ -1662,6 +1665,7 @@ struct sctp_association {
1662 1665
1663 /* SACK delay timeout */ 1666 /* SACK delay timeout */
1664 unsigned long sackdelay; 1667 unsigned long sackdelay;
1668 __u32 sackfreq;
1665 1669
1666 1670
1667 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES]; 1671 unsigned long timeouts[SCTP_NUM_TIMEOUT_TYPES];
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 9619b9d35c9e..f205b10f0ab9 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -93,8 +93,9 @@ enum sctp_optname {
93#define SCTP_STATUS SCTP_STATUS 93#define SCTP_STATUS SCTP_STATUS
94 SCTP_GET_PEER_ADDR_INFO, 94 SCTP_GET_PEER_ADDR_INFO,
95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO 95#define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO
96 SCTP_DELAYED_ACK_TIME, 96 SCTP_DELAYED_ACK,
97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK_TIME 97#define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK
98#define SCTP_DELAYED_ACK SCTP_DELAYED_ACK
98 SCTP_CONTEXT, /* Receive Context */ 99 SCTP_CONTEXT, /* Receive Context */
99#define SCTP_CONTEXT SCTP_CONTEXT 100#define SCTP_CONTEXT SCTP_CONTEXT
100 SCTP_FRAGMENT_INTERLEAVE, 101 SCTP_FRAGMENT_INTERLEAVE,
@@ -136,12 +137,14 @@ enum sctp_optname {
136#define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD 137#define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD
137 SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ 138 SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */
138#define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD 139#define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD
139 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ 140 SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */
140#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX 141#define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD
141 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ 142 SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */
142#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS 143#define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS
143 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ 144 SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */
144#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS 145#define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS
146 SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */
147#define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX
145}; 148};
146 149
147/* 150/*
@@ -618,13 +621,26 @@ struct sctp_authkeyid {
618}; 621};
619 622
620 623
621/* 7.1.23. Delayed Ack Timer (SCTP_DELAYED_ACK_TIME) 624/*
625 * 7.1.23. Get or set delayed ack timer (SCTP_DELAYED_SACK)
622 * 626 *
623 * This options will get or set the delayed ack timer. The time is set 627 * This option will effect the way delayed acks are performed. This
624 * in milliseconds. If the assoc_id is 0, then this sets or gets the 628 * option allows you to get or set the delayed ack time, in
625 * endpoints default delayed ack timer value. If the assoc_id field is 629 * milliseconds. It also allows changing the delayed ack frequency.
626 * non-zero, then the set or get effects the specified association. 630 * Changing the frequency to 1 disables the delayed sack algorithm. If
631 * the assoc_id is 0, then this sets or gets the endpoints default
632 * values. If the assoc_id field is non-zero, then the set or get
633 * effects the specified association for the one to many model (the
634 * assoc_id field is ignored by the one to one model). Note that if
635 * sack_delay or sack_freq are 0 when setting this option, then the
636 * current values will remain unchanged.
627 */ 637 */
638struct sctp_sack_info {
639 sctp_assoc_t sack_assoc_id;
640 uint32_t sack_delay;
641 uint32_t sack_freq;
642};
643
628struct sctp_assoc_value { 644struct sctp_assoc_value {
629 sctp_assoc_t assoc_id; 645 sctp_assoc_t assoc_id;
630 uint32_t assoc_value; 646 uint32_t assoc_value;
diff --git a/include/net/snmp.h b/include/net/snmp.h
index ce2f48507510..57c93628695f 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -14,8 +14,6 @@
14 * as published by the Free Software Foundation; either version 14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version. 15 * 2 of the License, or (at your option) any later version.
16 * 16 *
17 * $Id: snmp.h,v 1.19 2001/06/14 13:40:46 davem Exp $
18 *
19 */ 17 */
20 18
21#ifndef _SNMP_H 19#ifndef _SNMP_H
diff --git a/include/net/sock.h b/include/net/sock.h
index dc42b44c2aa1..3f4897ab432e 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -166,7 +166,7 @@ struct sock_common {
166 * @sk_err: last error 166 * @sk_err: last error
167 * @sk_err_soft: errors that don't cause failure but are the cause of a 167 * @sk_err_soft: errors that don't cause failure but are the cause of a
168 * persistent failure not just 'timed out' 168 * persistent failure not just 'timed out'
169 * @sk_drops: raw drops counter 169 * @sk_drops: raw/udp drops counter
170 * @sk_ack_backlog: current listen backlog 170 * @sk_ack_backlog: current listen backlog
171 * @sk_max_ack_backlog: listen backlog set in listen() 171 * @sk_max_ack_backlog: listen backlog set in listen()
172 * @sk_priority: %SO_PRIORITY setting 172 * @sk_priority: %SO_PRIORITY setting
@@ -524,7 +524,7 @@ struct proto {
524 int (*ioctl)(struct sock *sk, int cmd, 524 int (*ioctl)(struct sock *sk, int cmd,
525 unsigned long arg); 525 unsigned long arg);
526 int (*init)(struct sock *sk); 526 int (*init)(struct sock *sk);
527 int (*destroy)(struct sock *sk); 527 void (*destroy)(struct sock *sk);
528 void (*shutdown)(struct sock *sk, int how); 528 void (*shutdown)(struct sock *sk, int how);
529 int (*setsockopt)(struct sock *sk, int level, 529 int (*setsockopt)(struct sock *sk, int level,
530 int optname, char __user *optval, 530 int optname, char __user *optval,
@@ -990,6 +990,11 @@ static inline void sock_put(struct sock *sk)
990extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, 990extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb,
991 const int nested); 991 const int nested);
992 992
993static inline void sk_set_socket(struct sock *sk, struct socket *sock)
994{
995 sk->sk_socket = sock;
996}
997
993/* Detach socket from process context. 998/* Detach socket from process context.
994 * Announce socket dead, detach it from wait queue and inode. 999 * Announce socket dead, detach it from wait queue and inode.
995 * Note that parent inode held reference count on this struct sock, 1000 * Note that parent inode held reference count on this struct sock,
@@ -1001,7 +1006,7 @@ static inline void sock_orphan(struct sock *sk)
1001{ 1006{
1002 write_lock_bh(&sk->sk_callback_lock); 1007 write_lock_bh(&sk->sk_callback_lock);
1003 sock_set_flag(sk, SOCK_DEAD); 1008 sock_set_flag(sk, SOCK_DEAD);
1004 sk->sk_socket = NULL; 1009 sk_set_socket(sk, NULL);
1005 sk->sk_sleep = NULL; 1010 sk->sk_sleep = NULL;
1006 write_unlock_bh(&sk->sk_callback_lock); 1011 write_unlock_bh(&sk->sk_callback_lock);
1007} 1012}
@@ -1011,7 +1016,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent)
1011 write_lock_bh(&sk->sk_callback_lock); 1016 write_lock_bh(&sk->sk_callback_lock);
1012 sk->sk_sleep = &parent->wait; 1017 sk->sk_sleep = &parent->wait;
1013 parent->sk = sk; 1018 parent->sk = sk;
1014 sk->sk_socket = parent; 1019 sk_set_socket(sk, parent);
1015 security_sock_graft(sk, parent); 1020 security_sock_graft(sk, parent);
1016 write_unlock_bh(&sk->sk_callback_lock); 1021 write_unlock_bh(&sk->sk_callback_lock);
1017} 1022}
@@ -1331,30 +1336,6 @@ extern int net_msg_warn;
1331#define LIMIT_NETDEBUG(fmt, args...) \ 1336#define LIMIT_NETDEBUG(fmt, args...) \
1332 do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0) 1337 do { if (net_msg_warn && net_ratelimit()) printk(fmt,##args); } while(0)
1333 1338
1334/*
1335 * Macros for sleeping on a socket. Use them like this:
1336 *
1337 * SOCK_SLEEP_PRE(sk)
1338 * if (condition)
1339 * schedule();
1340 * SOCK_SLEEP_POST(sk)
1341 *
1342 * N.B. These are now obsolete and were, afaik, only ever used in DECnet
1343 * and when the last use of them in DECnet has gone, I'm intending to
1344 * remove them.
1345 */
1346
1347#define SOCK_SLEEP_PRE(sk) { struct task_struct *tsk = current; \
1348 DECLARE_WAITQUEUE(wait, tsk); \
1349 tsk->state = TASK_INTERRUPTIBLE; \
1350 add_wait_queue((sk)->sk_sleep, &wait); \
1351 release_sock(sk);
1352
1353#define SOCK_SLEEP_POST(sk) tsk->state = TASK_RUNNING; \
1354 remove_wait_queue((sk)->sk_sleep, &wait); \
1355 lock_sock(sk); \
1356 }
1357
1358extern __u32 sysctl_wmem_max; 1339extern __u32 sysctl_wmem_max;
1359extern __u32 sysctl_rmem_max; 1340extern __u32 sysctl_rmem_max;
1360 1341
diff --git a/include/net/stp.h b/include/net/stp.h
new file mode 100644
index 000000000000..ad447f105417
--- /dev/null
+++ b/include/net/stp.h
@@ -0,0 +1,14 @@
1#ifndef _NET_STP_H
2#define _NET_STP_H
3
4struct stp_proto {
5 unsigned char group_address[ETH_ALEN];
6 void (*rcv)(const struct stp_proto *, struct sk_buff *,
7 struct net_device *);
8 void *data;
9};
10
11extern int stp_proto_register(const struct stp_proto *proto);
12extern void stp_proto_unregister(const struct stp_proto *proto);
13
14#endif /* _NET_STP_H */
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cf54034019d9..6b827cc6c52f 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -398,6 +398,8 @@ extern void tcp_parse_options(struct sk_buff *skb,
398 struct tcp_options_received *opt_rx, 398 struct tcp_options_received *opt_rx,
399 int estab); 399 int estab);
400 400
401extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
402
401/* 403/*
402 * TCP v4 functions exported for the inet6 API 404 * TCP v4 functions exported for the inet6 API
403 */ 405 */
@@ -1113,13 +1115,19 @@ struct tcp_md5sig_pool {
1113#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ 1115#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
1114 1116
1115/* - functions */ 1117/* - functions */
1118extern int tcp_calc_md5_hash(char *md5_hash,
1119 struct tcp_md5sig_key *key,
1120 int bplen,
1121 struct tcphdr *th,
1122 unsigned int tcplen,
1123 struct tcp_md5sig_pool *hp);
1124
1116extern int tcp_v4_calc_md5_hash(char *md5_hash, 1125extern int tcp_v4_calc_md5_hash(char *md5_hash,
1117 struct tcp_md5sig_key *key, 1126 struct tcp_md5sig_key *key,
1118 struct sock *sk, 1127 struct sock *sk,
1119 struct dst_entry *dst, 1128 struct dst_entry *dst,
1120 struct request_sock *req, 1129 struct request_sock *req,
1121 struct tcphdr *th, 1130 struct tcphdr *th,
1122 int protocol,
1123 unsigned int tcplen); 1131 unsigned int tcplen);
1124extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1132extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1125 struct sock *addr_sk); 1133 struct sock *addr_sk);
@@ -1132,6 +1140,16 @@ extern int tcp_v4_md5_do_add(struct sock *sk,
1132extern int tcp_v4_md5_do_del(struct sock *sk, 1140extern int tcp_v4_md5_do_del(struct sock *sk,
1133 __be32 addr); 1141 __be32 addr);
1134 1142
1143#ifdef CONFIG_TCP_MD5SIG
1144#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
1145 &(struct tcp_md5sig_key) { \
1146 .key = (twsk)->tw_md5_key, \
1147 .keylen = (twsk)->tw_md5_keylen, \
1148 } : NULL)
1149#else
1150#define tcp_twsk_md5_key(twsk) NULL
1151#endif
1152
1135extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); 1153extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void);
1136extern void tcp_free_md5sig_pool(void); 1154extern void tcp_free_md5sig_pool(void);
1137 1155
@@ -1348,7 +1366,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
1348extern struct request_sock_ops tcp_request_sock_ops; 1366extern struct request_sock_ops tcp_request_sock_ops;
1349extern struct request_sock_ops tcp6_request_sock_ops; 1367extern struct request_sock_ops tcp6_request_sock_ops;
1350 1368
1351extern int tcp_v4_destroy_sock(struct sock *sk); 1369extern void tcp_v4_destroy_sock(struct sock *sk);
1352 1370
1353extern int tcp_v4_gso_send_check(struct sk_buff *skb); 1371extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1354extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); 1372extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
@@ -1369,7 +1387,6 @@ struct tcp_sock_af_ops {
1369 struct dst_entry *dst, 1387 struct dst_entry *dst,
1370 struct request_sock *req, 1388 struct request_sock *req,
1371 struct tcphdr *th, 1389 struct tcphdr *th,
1372 int protocol,
1373 unsigned int len); 1390 unsigned int len);
1374 int (*md5_add) (struct sock *sk, 1391 int (*md5_add) (struct sock *sk,
1375 struct sock *addr_sk, 1392 struct sock *addr_sk,
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 11105bcc4457..9923e41a8215 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -84,7 +84,8 @@ struct tipc_port {
84u32 tipc_createport_raw(void *usr_handle, 84u32 tipc_createport_raw(void *usr_handle,
85 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), 85 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *),
86 void (*wakeup)(struct tipc_port *), 86 void (*wakeup)(struct tipc_port *),
87 const u32 importance); 87 const u32 importance,
88 struct tipc_port **tp_ptr);
88 89
89int tipc_reject_msg(struct sk_buff *buf, u32 err); 90int tipc_reject_msg(struct sk_buff *buf, u32 err);
90 91
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 112934a3288d..876b6f2bb4fd 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -53,7 +53,7 @@ extern int datagram_send_ctl(struct net *net,
53 */ 53 */
54extern struct inet_connection_sock_af_ops ipv4_specific; 54extern struct inet_connection_sock_af_ops ipv4_specific;
55 55
56extern int inet6_destroy_sock(struct sock *sk); 56extern void inet6_destroy_sock(struct sock *sk);
57 57
58#endif 58#endif
59 59
diff --git a/include/net/udp.h b/include/net/udp.h
index ccce83707046..3e551592aa76 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -158,17 +158,17 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
158/* 158/*
159 * SNMP statistics for UDP and UDP-Lite 159 * SNMP statistics for UDP and UDP-Lite
160 */ 160 */
161#define UDP_INC_STATS_USER(field, is_udplite) do { \ 161#define UDP_INC_STATS_USER(net, field, is_udplite) do { (void)net; \
162 if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ 162 if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \
163 else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) 163 else SNMP_INC_STATS_USER(udp_statistics, field); } while(0)
164#define UDP_INC_STATS_BH(field, is_udplite) do { \ 164#define UDP_INC_STATS_BH(net, field, is_udplite) do { (void)net; \
165 if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ 165 if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \
166 else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) 166 else SNMP_INC_STATS_BH(udp_statistics, field); } while(0)
167 167
168#define UDP6_INC_STATS_BH(field, is_udplite) do { \ 168#define UDP6_INC_STATS_BH(net, field, is_udplite) do { (void)net; \
169 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ 169 if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \
170 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) 170 else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0)
171#define UDP6_INC_STATS_USER(field, is_udplite) do { \ 171#define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \
172 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ 172 if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \
173 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) 173 else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0)
174 174
@@ -176,12 +176,12 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
176#define UDPX_INC_STATS_BH(sk, field) \ 176#define UDPX_INC_STATS_BH(sk, field) \
177 do { \ 177 do { \
178 if ((sk)->sk_family == AF_INET) \ 178 if ((sk)->sk_family == AF_INET) \
179 UDP_INC_STATS_BH(field, 0); \ 179 UDP_INC_STATS_BH(sock_net(sk), field, 0); \
180 else \ 180 else \
181 UDP6_INC_STATS_BH(field, 0); \ 181 UDP6_INC_STATS_BH(sock_net(sk), field, 0); \
182 } while (0); 182 } while (0);
183#else 183#else
184#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0) 184#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0)
185#endif 185#endif
186 186
187/* /proc */ 187/* /proc */
@@ -196,8 +196,8 @@ struct udp_seq_afinfo {
196struct udp_iter_state { 196struct udp_iter_state {
197 struct seq_net_private p; 197 struct seq_net_private p;
198 sa_family_t family; 198 sa_family_t family;
199 struct hlist_head *hashtable;
200 int bucket; 199 int bucket;
200 struct hlist_head *hashtable;
201}; 201};
202 202
203#ifdef CONFIG_PROC_FS 203#ifdef CONFIG_PROC_FS
diff --git a/include/net/wext.h b/include/net/wext.h
index 80b31d826b7a..6d76a39a9c5b 100644
--- a/include/net/wext.h
+++ b/include/net/wext.h
@@ -12,6 +12,8 @@ extern int wext_proc_init(struct net *net);
12extern void wext_proc_exit(struct net *net); 12extern void wext_proc_exit(struct net *net);
13extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, 13extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd,
14 void __user *arg); 14 void __user *arg);
15extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
16 unsigned long arg);
15#else 17#else
16static inline int wext_proc_init(struct net *net) 18static inline int wext_proc_init(struct net *net)
17{ 19{
@@ -26,6 +28,11 @@ static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned
26{ 28{
27 return -EINVAL; 29 return -EINVAL;
28} 30}
31static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd,
32 unsigned long arg)
33{
34 return -EINVAL;
35}
29#endif 36#endif
30 37
31#endif /* __NET_WEXT_H */ 38#endif /* __NET_WEXT_H */
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 667b4080d30f..9324f8dd183e 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -39,12 +39,18 @@ enum ieee80211_band {
39 * on this channel. 39 * on this channel.
40 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed 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. 41 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
42 * @IEEE80211_CHAN_NO_FAT_ABOVE: extension channel above this channel
43 * is not permitted.
44 * @IEEE80211_CHAN_NO_FAT_BELOW: extension channel below this channel
45 * is not permitted.
42 */ 46 */
43enum ieee80211_channel_flags { 47enum ieee80211_channel_flags {
44 IEEE80211_CHAN_DISABLED = 1<<0, 48 IEEE80211_CHAN_DISABLED = 1<<0,
45 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1, 49 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
46 IEEE80211_CHAN_NO_IBSS = 1<<2, 50 IEEE80211_CHAN_NO_IBSS = 1<<2,
47 IEEE80211_CHAN_RADAR = 1<<3, 51 IEEE80211_CHAN_RADAR = 1<<3,
52 IEEE80211_CHAN_NO_FAT_ABOVE = 1<<4,
53 IEEE80211_CHAN_NO_FAT_BELOW = 1<<5,
48}; 54};
49 55
50/** 56/**