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/dccp.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_packet.h23
-rw-r--r--include/linux/if_ppp.h2
-rw-r--r--include/linux/if_tun.h34
-rw-r--r--include/linux/if_vlan.h238
-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.h332
-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/pkt_cls.h1
-rw-r--r--include/linux/pkt_sched.h9
-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.h27
-rw-r--r--include/linux/smc911x.h12
-rw-r--r--include/linux/sonet.h2
-rw-r--r--include/linux/ssb/ssb.h144
-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/icmp.h16
-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/ip.h17
-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.h591
-rw-r--r--include/net/neighbour.h4
-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.h13
-rw-r--r--include/net/rose.h2
-rw-r--r--include/net/route.h2
-rw-r--r--include/net/sch_generic.h144
-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.h41
-rw-r--r--include/net/stp.h14
-rw-r--r--include/net/tcp.h47
-rw-r--r--include/net/tipc/tipc_port.h10
-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
89 files changed, 2191 insertions, 965 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/dccp.h b/include/linux/dccp.h
index aa0737019e37..6080449fbec9 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -364,8 +364,6 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
364/* FIXME: for now we're default to 1 but it should really be 0 */ 364/* FIXME: for now we're default to 1 but it should really be 0 */
365#define DCCPF_INITIAL_SEND_NDP_COUNT 1 365#define DCCPF_INITIAL_SEND_NDP_COUNT 1
366 366
367#define DCCP_NDP_LIMIT 0xFFFFFF
368
369/** 367/**
370 * struct dccp_minisock - Minimal DCCP connection representation 368 * struct dccp_minisock - Minimal DCCP connection representation
371 * 369 *
@@ -437,7 +435,7 @@ extern int dccp_parse_options(struct sock *sk, struct dccp_request_sock *dreq,
437 struct sk_buff *skb); 435 struct sk_buff *skb);
438 436
439struct dccp_options_received { 437struct dccp_options_received {
440 u32 dccpor_ndp; /* only 24 bits */ 438 u64 dccpor_ndp:48;
441 u32 dccpor_timestamp; 439 u32 dccpor_timestamp;
442 u32 dccpor_timestamp_echo; 440 u32 dccpor_timestamp_echo;
443 u32 dccpor_elapsed_time; 441 u32 dccpor_elapsed_time;
@@ -533,7 +531,7 @@ struct dccp_sock {
533 __u16 dccps_r_ack_ratio; 531 __u16 dccps_r_ack_ratio;
534 __u16 dccps_pcslen; 532 __u16 dccps_pcslen;
535 __u16 dccps_pcrlen; 533 __u16 dccps_pcrlen;
536 unsigned long dccps_ndp_count; 534 __u64 dccps_ndp_count:48;
537 unsigned long dccps_rate_last; 535 unsigned long dccps_rate_last;
538 struct dccp_minisock dccps_minisock; 536 struct dccp_minisock dccps_minisock;
539 struct dccp_ackvec *dccps_hc_rx_ackvec; 537 struct dccp_ackvec *dccps_hc_rx_ackvec;
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_packet.h b/include/linux/if_packet.h
index ad09609227ff..a630295b255f 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -43,6 +43,8 @@ struct sockaddr_ll
43#define PACKET_COPY_THRESH 7 43#define PACKET_COPY_THRESH 7
44#define PACKET_AUXDATA 8 44#define PACKET_AUXDATA 8
45#define PACKET_ORIGDEV 9 45#define PACKET_ORIGDEV 9
46#define PACKET_VERSION 10
47#define PACKET_HDRLEN 11
46 48
47struct tpacket_stats 49struct tpacket_stats
48{ 50{
@@ -57,6 +59,7 @@ struct tpacket_auxdata
57 __u32 tp_snaplen; 59 __u32 tp_snaplen;
58 __u16 tp_mac; 60 __u16 tp_mac;
59 __u16 tp_net; 61 __u16 tp_net;
62 __u16 tp_vlan_tci;
60}; 63};
61 64
62struct tpacket_hdr 65struct tpacket_hdr
@@ -79,6 +82,26 @@ struct tpacket_hdr
79#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) 82#define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1))
80#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) 83#define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll))
81 84
85struct tpacket2_hdr
86{
87 __u32 tp_status;
88 __u32 tp_len;
89 __u32 tp_snaplen;
90 __u16 tp_mac;
91 __u16 tp_net;
92 __u32 tp_sec;
93 __u32 tp_nsec;
94 __u16 tp_vlan_tci;
95};
96
97#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
98
99enum tpacket_versions
100{
101 TPACKET_V1,
102 TPACKET_V2,
103};
104
82/* 105/*
83 Frame structure: 106 Frame structure:
84 107
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..4c6307ad9fdb 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -11,14 +11,13 @@
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
19#define __IF_TUN_H 17#define __IF_TUN_H
20 18
21#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/if_ether.h>
22 21
23/* Read queue size */ 22/* Read queue size */
24#define TUN_READQ_SIZE 500 23#define TUN_READQ_SIZE 500
@@ -33,6 +32,7 @@
33#define TUN_NO_PI 0x0040 32#define TUN_NO_PI 0x0040
34#define TUN_ONE_QUEUE 0x0080 33#define TUN_ONE_QUEUE 0x0080
35#define TUN_PERSIST 0x0100 34#define TUN_PERSIST 0x0100
35#define TUN_VNET_HDR 0x0200
36 36
37/* Ioctl defines */ 37/* Ioctl defines */
38#define TUNSETNOCSUM _IOW('T', 200, int) 38#define TUNSETNOCSUM _IOW('T', 200, int)
@@ -42,17 +42,43 @@
42#define TUNSETOWNER _IOW('T', 204, int) 42#define TUNSETOWNER _IOW('T', 204, int)
43#define TUNSETLINK _IOW('T', 205, int) 43#define TUNSETLINK _IOW('T', 205, int)
44#define TUNSETGROUP _IOW('T', 206, int) 44#define TUNSETGROUP _IOW('T', 206, int)
45#define TUNGETFEATURES _IOR('T', 207, unsigned int)
46#define TUNSETOFFLOAD _IOW('T', 208, unsigned int)
47#define TUNSETTXFILTER _IOW('T', 209, unsigned int)
45 48
46/* TUNSETIFF ifr flags */ 49/* TUNSETIFF ifr flags */
47#define IFF_TUN 0x0001 50#define IFF_TUN 0x0001
48#define IFF_TAP 0x0002 51#define IFF_TAP 0x0002
49#define IFF_NO_PI 0x1000 52#define IFF_NO_PI 0x1000
50#define IFF_ONE_QUEUE 0x2000 53#define IFF_ONE_QUEUE 0x2000
54#define IFF_VNET_HDR 0x4000
55
56/* Features for GSO (TUNSETOFFLOAD). */
57#define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */
58#define TUN_F_TSO4 0x02 /* I can handle TSO for IPv4 packets */
59#define TUN_F_TSO6 0x04 /* I can handle TSO for IPv6 packets */
60#define TUN_F_TSO_ECN 0x08 /* I can handle TSO with ECN bits. */
51 61
62/* Protocol info prepended to the packets (when IFF_NO_PI is not set) */
63#define TUN_PKT_STRIP 0x0001
52struct tun_pi { 64struct tun_pi {
53 unsigned short flags; 65 __u16 flags;
54 __be16 proto; 66 __be16 proto;
55}; 67};
56#define TUN_PKT_STRIP 0x0001 68
69/*
70 * Filter spec (used for SETXXFILTER ioctls)
71 * This stuff is applicable only to the TAP (Ethernet) devices.
72 * If the count is zero the filter is disabled and the driver accepts
73 * all packets (promisc mode).
74 * If the filter is enabled in order to accept broadcast packets
75 * broadcast addr must be explicitly included in the addr list.
76 */
77#define TUN_FLT_ALLMULTI 0x0001 /* Accept all multicast packets */
78struct tun_filter {
79 __u16 flags; /* TUN_FLT_ flags see above */
80 __u16 count; /* Number of addresses */
81 __u8 addr[0][ETH_ALEN];
82};
57 83
58#endif /* __IF_TUN_H */ 84#endif /* __IF_TUN_H */
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 15ace02b7b24..9e7b49b8062d 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,164 +105,81 @@ 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 { 108#define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci)
113 u32 priority; 109#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci)
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 110
121/* Holds information that makes sense if this device is a VLAN device. */ 111#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
122struct vlan_dev_info { 112extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
123 /** This will be the mapping that correlates skb->priority to 113extern u16 vlan_dev_vlan_id(const struct net_device *dev);
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 114
148static inline struct vlan_dev_info *vlan_dev_info(const struct net_device *dev) 115extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
116 u16 vlan_tci, int polling);
117#else
118static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev)
149{ 119{
150 return netdev_priv(dev); 120 BUG();
121 return NULL;
151} 122}
152 123
153/* inline functions */ 124static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
154static inline __u32 vlan_get_ingress_priority(struct net_device *dev,
155 unsigned short vlan_tag)
156{ 125{
157 struct vlan_dev_info *vip = vlan_dev_info(dev); 126 BUG();
158 127 return 0;
159 return vip->ingress_priority_map[(vlan_tag >> 13) & 0x7];
160} 128}
161 129
162/* VLAN tx hw acceleration helpers. */ 130static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
163struct vlan_skb_tx_cookie { 131 u16 vlan_tci, int polling)
164 u32 magic;
165 u32 vlan_tag;
166};
167
168#define VLAN_TX_COOKIE_MAGIC 0x564c414e /* "VLAN" in ascii. */
169#define VLAN_TX_SKB_CB(__skb) ((struct vlan_skb_tx_cookie *)&((__skb)->cb[0]))
170#define vlan_tx_tag_present(__skb) \
171 (VLAN_TX_SKB_CB(__skb)->magic == VLAN_TX_COOKIE_MAGIC)
172#define vlan_tx_tag_get(__skb) (VLAN_TX_SKB_CB(__skb)->vlan_tag)
173
174/* VLAN rx hw acceleration helper. This acts like netif_{rx,receive_skb}(). */
175static inline int __vlan_hwaccel_rx(struct sk_buff *skb,
176 struct vlan_group *grp,
177 unsigned short vlan_tag, int polling)
178{ 132{
179 struct net_device_stats *stats; 133 BUG();
180 134 return NET_XMIT_SUCCESS;
181 if (skb_bond_should_drop(skb)) {
182 dev_kfree_skb_any(skb);
183 return NET_RX_DROP;
184 }
185
186 skb->dev = vlan_group_get_device(grp, vlan_tag & VLAN_VID_MASK);
187 if (skb->dev == NULL) {
188 dev_kfree_skb_any(skb);
189
190 /* Not NET_RX_DROP, this is not being dropped
191 * due to congestion.
192 */
193 return 0;
194 }
195
196 skb->dev->last_rx = jiffies;
197
198 stats = &skb->dev->stats;
199 stats->rx_packets++;
200 stats->rx_bytes += skb->len;
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} 135}
136#endif
224 137
138/**
139 * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration
140 * @skb: buffer
141 * @grp: vlan group
142 * @vlan_tci: VLAN TCI as received from the card
143 */
225static inline int vlan_hwaccel_rx(struct sk_buff *skb, 144static inline int vlan_hwaccel_rx(struct sk_buff *skb,
226 struct vlan_group *grp, 145 struct vlan_group *grp,
227 unsigned short vlan_tag) 146 u16 vlan_tci)
228{ 147{
229 return __vlan_hwaccel_rx(skb, grp, vlan_tag, 0); 148 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
230} 149}
231 150
151/**
152 * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
153 * @skb: buffer
154 * @grp: vlan group
155 * @vlan_tci: VLAN TCI as received from the card
156 */
232static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb, 157static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
233 struct vlan_group *grp, 158 struct vlan_group *grp,
234 unsigned short vlan_tag) 159 u16 vlan_tci)
235{ 160{
236 return __vlan_hwaccel_rx(skb, grp, vlan_tag, 1); 161 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
237} 162}
238 163
239/** 164/**
240 * __vlan_put_tag - regular VLAN tag inserting 165 * __vlan_put_tag - regular VLAN tag inserting
241 * @skb: skbuff to tag 166 * @skb: skbuff to tag
242 * @tag: VLAN tag to insert 167 * @vlan_tci: VLAN TCI to insert
243 * 168 *
244 * Inserts the VLAN tag into @skb as part of the payload 169 * 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. 170 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
246 * 171 *
247 * Following the skb_unshare() example, in case of error, the calling function 172 * Following the skb_unshare() example, in case of error, the calling function
248 * doesn't have to worry about freeing the original skb. 173 * doesn't have to worry about freeing the original skb.
249 */ 174 */
250static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short tag) 175static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
251{ 176{
252 struct vlan_ethhdr *veth; 177 struct vlan_ethhdr *veth;
253 178
254 if (skb_headroom(skb) < VLAN_HLEN) { 179 if (skb_cow_head(skb, VLAN_HLEN) < 0) {
255 struct sk_buff *sk_tmp = skb; 180 kfree_skb(skb);
256 skb = skb_realloc_headroom(sk_tmp, VLAN_HLEN); 181 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 } 182 }
269
270 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN); 183 veth = (struct vlan_ethhdr *)skb_push(skb, VLAN_HLEN);
271 184
272 /* Move the mac addresses to the beginning of the new header. */ 185 /* Move the mac addresses to the beginning of the new header. */
@@ -275,12 +188,10 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
275 /* first, the ethernet type */ 188 /* first, the ethernet type */
276 veth->h_vlan_proto = htons(ETH_P_8021Q); 189 veth->h_vlan_proto = htons(ETH_P_8021Q);
277 190
278 /* now, the tag */ 191 /* now, the TCI */
279 veth->h_vlan_TCI = htons(tag); 192 veth->h_vlan_TCI = htons(vlan_tci);
280 193
281 skb->protocol = htons(ETH_P_8021Q); 194 skb->protocol = htons(ETH_P_8021Q);
282 skb->mac_header -= VLAN_HLEN;
283 skb->network_header -= VLAN_HLEN;
284 195
285 return skb; 196 return skb;
286} 197}
@@ -288,18 +199,14 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short
288/** 199/**
289 * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting 200 * __vlan_hwaccel_put_tag - hardware accelerated VLAN inserting
290 * @skb: skbuff to tag 201 * @skb: skbuff to tag
291 * @tag: VLAN tag to insert 202 * @vlan_tci: VLAN TCI to insert
292 * 203 *
293 * Puts the VLAN tag in @skb->cb[] and lets the device do the rest 204 * Puts the VLAN TCI in @skb->vlan_tci and lets the device do the rest
294 */ 205 */
295static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsigned short tag) 206static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb,
207 u16 vlan_tci)
296{ 208{
297 struct vlan_skb_tx_cookie *cookie; 209 skb->vlan_tci = vlan_tci;
298
299 cookie = VLAN_TX_SKB_CB(skb);
300 cookie->magic = VLAN_TX_COOKIE_MAGIC;
301 cookie->vlan_tag = tag;
302
303 return skb; 210 return skb;
304} 211}
305 212
@@ -308,28 +215,28 @@ static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, unsign
308/** 215/**
309 * vlan_put_tag - inserts VLAN tag according to device features 216 * vlan_put_tag - inserts VLAN tag according to device features
310 * @skb: skbuff to tag 217 * @skb: skbuff to tag
311 * @tag: VLAN tag to insert 218 * @vlan_tci: VLAN TCI to insert
312 * 219 *
313 * Assumes skb->dev is the target that will xmit this frame. 220 * Assumes skb->dev is the target that will xmit this frame.
314 * Returns a VLAN tagged skb. 221 * Returns a VLAN tagged skb.
315 */ 222 */
316static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, unsigned short tag) 223static inline struct sk_buff *vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
317{ 224{
318 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 225 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
319 return __vlan_hwaccel_put_tag(skb, tag); 226 return __vlan_hwaccel_put_tag(skb, vlan_tci);
320 } else { 227 } else {
321 return __vlan_put_tag(skb, tag); 228 return __vlan_put_tag(skb, vlan_tci);
322 } 229 }
323} 230}
324 231
325/** 232/**
326 * __vlan_get_tag - get the VLAN ID that is part of the payload 233 * __vlan_get_tag - get the VLAN ID that is part of the payload
327 * @skb: skbuff to query 234 * @skb: skbuff to query
328 * @tag: buffer to store vlaue 235 * @vlan_tci: buffer to store vlaue
329 * 236 *
330 * Returns error if the skb is not of VLAN type 237 * Returns error if the skb is not of VLAN type
331 */ 238 */
332static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) 239static inline int __vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
333{ 240{
334 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data; 241 struct vlan_ethhdr *veth = (struct vlan_ethhdr *)skb->data;
335 242
@@ -337,29 +244,25 @@ static inline int __vlan_get_tag(const struct sk_buff *skb, unsigned short *tag)
337 return -EINVAL; 244 return -EINVAL;
338 } 245 }
339 246
340 *tag = ntohs(veth->h_vlan_TCI); 247 *vlan_tci = ntohs(veth->h_vlan_TCI);
341
342 return 0; 248 return 0;
343} 249}
344 250
345/** 251/**
346 * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[] 252 * __vlan_hwaccel_get_tag - get the VLAN ID that is in @skb->cb[]
347 * @skb: skbuff to query 253 * @skb: skbuff to query
348 * @tag: buffer to store vlaue 254 * @vlan_tci: buffer to store vlaue
349 * 255 *
350 * Returns error if @skb->cb[] is not set correctly 256 * Returns error if @skb->vlan_tci is not set correctly
351 */ 257 */
352static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, 258static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
353 unsigned short *tag) 259 u16 *vlan_tci)
354{ 260{
355 struct vlan_skb_tx_cookie *cookie; 261 if (vlan_tx_tag_present(skb)) {
356 262 *vlan_tci = skb->vlan_tci;
357 cookie = VLAN_TX_SKB_CB(skb);
358 if (cookie->magic == VLAN_TX_COOKIE_MAGIC) {
359 *tag = cookie->vlan_tag;
360 return 0; 263 return 0;
361 } else { 264 } else {
362 *tag = 0; 265 *vlan_tci = 0;
363 return -EINVAL; 266 return -EINVAL;
364 } 267 }
365} 268}
@@ -369,16 +272,16 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb,
369/** 272/**
370 * vlan_get_tag - get the VLAN ID from the skb 273 * vlan_get_tag - get the VLAN ID from the skb
371 * @skb: skbuff to query 274 * @skb: skbuff to query
372 * @tag: buffer to store vlaue 275 * @vlan_tci: buffer to store vlaue
373 * 276 *
374 * Returns error if the skb is not VLAN tagged 277 * Returns error if the skb is not VLAN tagged
375 */ 278 */
376static inline int vlan_get_tag(const struct sk_buff *skb, unsigned short *tag) 279static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
377{ 280{
378 if (skb->dev->features & NETIF_F_HW_VLAN_TX) { 281 if (skb->dev->features & NETIF_F_HW_VLAN_TX) {
379 return __vlan_hwaccel_get_tag(skb, tag); 282 return __vlan_hwaccel_get_tag(skb, vlan_tci);
380 } else { 283 } else {
381 return __vlan_get_tag(skb, tag); 284 return __vlan_get_tag(skb, vlan_tci);
382 } 285 }
383} 286}
384 287
@@ -402,6 +305,7 @@ enum vlan_ioctl_cmds {
402 305
403enum vlan_flags { 306enum vlan_flags {
404 VLAN_FLAG_REORDER_HDR = 0x1, 307 VLAN_FLAG_REORDER_HDR = 0x1,
308 VLAN_FLAG_GVRP = 0x2,
405}; 309};
406 310
407enum vlan_name_types { 311enum 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..9c5a68850114 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -118,14 +118,6 @@ struct wireless_dev;
118 118
119#endif /* __KERNEL__ */ 119#endif /* __KERNEL__ */
120 120
121struct net_device_subqueue
122{
123 /* Give a control state for each queue. This struct may contain
124 * per-queue locks in the future.
125 */
126 unsigned long state;
127};
128
129/* 121/*
130 * Network device statistics. Akin to the 2.0 ether stats but 122 * Network device statistics. Akin to the 2.0 ether stats but
131 * with byte counters. 123 * with byte counters.
@@ -281,14 +273,11 @@ struct header_ops {
281 273
282enum netdev_state_t 274enum netdev_state_t
283{ 275{
284 __LINK_STATE_XOFF=0,
285 __LINK_STATE_START, 276 __LINK_STATE_START,
286 __LINK_STATE_PRESENT, 277 __LINK_STATE_PRESENT,
287 __LINK_STATE_SCHED,
288 __LINK_STATE_NOCARRIER, 278 __LINK_STATE_NOCARRIER,
289 __LINK_STATE_LINKWATCH_PENDING, 279 __LINK_STATE_LINKWATCH_PENDING,
290 __LINK_STATE_DORMANT, 280 __LINK_STATE_DORMANT,
291 __LINK_STATE_QDISC_RUNNING,
292}; 281};
293 282
294 283
@@ -448,6 +437,20 @@ static inline void napi_synchronize(const struct napi_struct *n)
448# define napi_synchronize(n) barrier() 437# define napi_synchronize(n) barrier()
449#endif 438#endif
450 439
440enum netdev_queue_state_t
441{
442 __QUEUE_STATE_XOFF,
443};
444
445struct netdev_queue {
446 struct net_device *dev;
447 struct Qdisc *qdisc;
448 unsigned long state;
449 spinlock_t _xmit_lock;
450 int xmit_lock_owner;
451 struct Qdisc *qdisc_sleeping;
452} ____cacheline_aligned_in_smp;
453
451/* 454/*
452 * The DEVICE structure. 455 * The DEVICE structure.
453 * Actually, this whole structure is a big mistake. It mixes I/O 456 * Actually, this whole structure is a big mistake. It mixes I/O
@@ -516,7 +519,6 @@ struct net_device
516#define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */ 519#define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */
517 /* do not use LLTX in new drivers */ 520 /* do not use LLTX in new drivers */
518#define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */ 521#define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */
519#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */
520#define NETIF_F_LRO 32768 /* large receive offload */ 522#define NETIF_F_LRO 32768 /* large receive offload */
521 523
522 /* Segmentation offload features */ 524 /* Segmentation offload features */
@@ -537,8 +539,6 @@ struct net_device
537#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM) 539#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) 540#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
539 541
540 struct net_device *next_sched;
541
542 /* Interface index. Unique device identifier */ 542 /* Interface index. Unique device identifier */
543 int ifindex; 543 int ifindex;
544 int iflink; 544 int iflink;
@@ -594,13 +594,14 @@ struct net_device
594 unsigned char addr_len; /* hardware address length */ 594 unsigned char addr_len; /* hardware address length */
595 unsigned short dev_id; /* for shared network cards */ 595 unsigned short dev_id; /* for shared network cards */
596 596
597 spinlock_t addr_list_lock;
597 struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ 598 struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */
598 int uc_count; /* Number of installed ucasts */ 599 int uc_count; /* Number of installed ucasts */
599 int uc_promisc; 600 int uc_promisc;
600 struct dev_addr_list *mc_list; /* Multicast mac addresses */ 601 struct dev_addr_list *mc_list; /* Multicast mac addresses */
601 int mc_count; /* Number of installed mcasts */ 602 int mc_count; /* Number of installed mcasts */
602 int promiscuity; 603 unsigned int promiscuity;
603 int allmulti; 604 unsigned int allmulti;
604 605
605 606
606 /* Protocol specific pointers */ 607 /* Protocol specific pointers */
@@ -624,32 +625,23 @@ struct net_device
624 625
625 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 626 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
626 627
627 /* ingress path synchronizer */ 628 struct netdev_queue rx_queue;
628 spinlock_t ingress_lock;
629 struct Qdisc *qdisc_ingress;
630 629
631/* 630 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
632 * Cache line mostly used on queue transmit path (qdisc) 631
633 */ 632 /* Number of TX queues allocated at alloc_netdev_mq() time */
634 /* device queue lock */ 633 unsigned int num_tx_queues;
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 */
640 634
641 /* Partially transmitted GSO packet. */ 635 /* Number of TX queues currently active in device */
642 struct sk_buff *gso_skb; 636 unsigned int real_num_tx_queues;
637
638 unsigned long tx_queue_len; /* Max frames per queue allowed */
639 spinlock_t qdisc_list_lock;
640 struct list_head qdisc_list;
643 641
644/* 642/*
645 * One part is mostly used on xmit path (device) 643 * One part is mostly used on xmit path (device)
646 */ 644 */
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 */ 645 void *priv; /* pointer to private data */
654 int (*hard_start_xmit) (struct sk_buff *skb, 646 int (*hard_start_xmit) (struct sk_buff *skb,
655 struct net_device *dev); 647 struct net_device *dev);
@@ -728,6 +720,9 @@ struct net_device
728 void (*poll_controller)(struct net_device *dev); 720 void (*poll_controller)(struct net_device *dev);
729#endif 721#endif
730 722
723 u16 (*select_queue)(struct net_device *dev,
724 struct sk_buff *skb);
725
731#ifdef CONFIG_NET_NS 726#ifdef CONFIG_NET_NS
732 /* Network namespace this network device is inside */ 727 /* Network namespace this network device is inside */
733 struct net *nd_net; 728 struct net *nd_net;
@@ -740,6 +735,8 @@ struct net_device
740 struct net_bridge_port *br_port; 735 struct net_bridge_port *br_port;
741 /* macvlan */ 736 /* macvlan */
742 struct macvlan_port *macvlan_port; 737 struct macvlan_port *macvlan_port;
738 /* GARP */
739 struct garp_port *garp_port;
743 740
744 /* class/net/name entry */ 741 /* class/net/name entry */
745 struct device dev; 742 struct device dev;
@@ -755,16 +752,31 @@ struct net_device
755 /* for setting kernel sock attribute on TCP connection setup */ 752 /* for setting kernel sock attribute on TCP connection setup */
756#define GSO_MAX_SIZE 65536 753#define GSO_MAX_SIZE 65536
757 unsigned int gso_max_size; 754 unsigned int gso_max_size;
758
759 /* The TX queue control structures */
760 unsigned int egress_subqueue_count;
761 struct net_device_subqueue egress_subqueue[1];
762}; 755};
763#define to_net_dev(d) container_of(d, struct net_device, dev) 756#define to_net_dev(d) container_of(d, struct net_device, dev)
764 757
765#define NETDEV_ALIGN 32 758#define NETDEV_ALIGN 32
766#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 759#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
767 760
761static inline
762struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev,
763 unsigned int index)
764{
765 return &dev->_tx[index];
766}
767
768static inline void netdev_for_each_tx_queue(struct net_device *dev,
769 void (*f)(struct net_device *,
770 struct netdev_queue *,
771 void *),
772 void *arg)
773{
774 unsigned int i;
775
776 for (i = 0; i < dev->num_tx_queues; i++)
777 f(dev, &dev->_tx[i], arg);
778}
779
768/* 780/*
769 * Net namespace inlines 781 * Net namespace inlines
770 */ 782 */
@@ -795,7 +807,9 @@ void dev_net_set(struct net_device *dev, struct net *net)
795 */ 807 */
796static inline void *netdev_priv(const struct net_device *dev) 808static inline void *netdev_priv(const struct net_device *dev)
797{ 809{
798 return dev->priv; 810 return (char *)dev + ((sizeof(struct net_device)
811 + NETDEV_ALIGN_CONST)
812 & ~NETDEV_ALIGN_CONST);
799} 813}
800 814
801/* Set the sysfs physical device reference for the network logical device 815/* Set the sysfs physical device reference for the network logical device
@@ -830,6 +844,19 @@ static inline void netif_napi_add(struct net_device *dev,
830 set_bit(NAPI_STATE_SCHED, &napi->state); 844 set_bit(NAPI_STATE_SCHED, &napi->state);
831} 845}
832 846
847/**
848 * netif_napi_del - remove a napi context
849 * @napi: napi context
850 *
851 * netif_napi_del() removes a napi context from the network device napi list
852 */
853static inline void netif_napi_del(struct napi_struct *napi)
854{
855#ifdef CONFIG_NETPOLL
856 list_del(&napi->dev_list);
857#endif
858}
859
833struct packet_type { 860struct packet_type {
834 __be16 type; /* This is really htons(ether_type). */ 861 __be16 type; /* This is really htons(ether_type). */
835 struct net_device *dev; /* NULL is wildcarded here */ 862 struct net_device *dev; /* NULL is wildcarded here */
@@ -890,6 +917,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); 917extern int dev_alloc_name(struct net_device *dev, const char *name);
891extern int dev_open(struct net_device *dev); 918extern int dev_open(struct net_device *dev);
892extern int dev_close(struct net_device *dev); 919extern int dev_close(struct net_device *dev);
920extern void dev_disable_lro(struct net_device *dev);
893extern int dev_queue_xmit(struct sk_buff *skb); 921extern int dev_queue_xmit(struct sk_buff *skb);
894extern int register_netdevice(struct net_device *dev); 922extern int register_netdevice(struct net_device *dev);
895extern void unregister_netdevice(struct net_device *dev); 923extern void unregister_netdevice(struct net_device *dev);
@@ -939,7 +967,7 @@ static inline int unregister_gifconf(unsigned int family)
939 */ 967 */
940struct softnet_data 968struct softnet_data
941{ 969{
942 struct net_device *output_queue; 970 struct Qdisc *output_queue;
943 struct sk_buff_head input_pkt_queue; 971 struct sk_buff_head input_pkt_queue;
944 struct list_head poll_list; 972 struct list_head poll_list;
945 struct sk_buff *completion_queue; 973 struct sk_buff *completion_queue;
@@ -954,12 +982,20 @@ DECLARE_PER_CPU(struct softnet_data,softnet_data);
954 982
955#define HAVE_NETIF_QUEUE 983#define HAVE_NETIF_QUEUE
956 984
957extern void __netif_schedule(struct net_device *dev); 985extern void __netif_schedule(struct Qdisc *q);
986
987static inline void netif_schedule_queue(struct netdev_queue *txq)
988{
989 if (!test_bit(__QUEUE_STATE_XOFF, &txq->state))
990 __netif_schedule(txq->qdisc);
991}
958 992
959static inline void netif_schedule(struct net_device *dev) 993static inline void netif_tx_schedule_all(struct net_device *dev)
960{ 994{
961 if (!test_bit(__LINK_STATE_XOFF, &dev->state)) 995 unsigned int i;
962 __netif_schedule(dev); 996
997 for (i = 0; i < dev->num_tx_queues; i++)
998 netif_schedule_queue(netdev_get_tx_queue(dev, i));
963} 999}
964 1000
965/** 1001/**
@@ -968,9 +1004,24 @@ static inline void netif_schedule(struct net_device *dev)
968 * 1004 *
969 * Allow upper layers to call the device hard_start_xmit routine. 1005 * Allow upper layers to call the device hard_start_xmit routine.
970 */ 1006 */
1007static inline void netif_tx_start_queue(struct netdev_queue *dev_queue)
1008{
1009 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1010}
1011
971static inline void netif_start_queue(struct net_device *dev) 1012static inline void netif_start_queue(struct net_device *dev)
972{ 1013{
973 clear_bit(__LINK_STATE_XOFF, &dev->state); 1014 netif_tx_start_queue(netdev_get_tx_queue(dev, 0));
1015}
1016
1017static inline void netif_tx_start_all_queues(struct net_device *dev)
1018{
1019 unsigned int i;
1020
1021 for (i = 0; i < dev->num_tx_queues; i++) {
1022 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1023 netif_tx_start_queue(txq);
1024 }
974} 1025}
975 1026
976/** 1027/**
@@ -980,16 +1031,31 @@ static inline void netif_start_queue(struct net_device *dev)
980 * Allow upper layers to call the device hard_start_xmit routine. 1031 * Allow upper layers to call the device hard_start_xmit routine.
981 * Used for flow control when transmit resources are available. 1032 * Used for flow control when transmit resources are available.
982 */ 1033 */
983static inline void netif_wake_queue(struct net_device *dev) 1034static inline void netif_tx_wake_queue(struct netdev_queue *dev_queue)
984{ 1035{
985#ifdef CONFIG_NETPOLL_TRAP 1036#ifdef CONFIG_NETPOLL_TRAP
986 if (netpoll_trap()) { 1037 if (netpoll_trap()) {
987 clear_bit(__LINK_STATE_XOFF, &dev->state); 1038 clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
988 return; 1039 return;
989 } 1040 }
990#endif 1041#endif
991 if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) 1042 if (test_and_clear_bit(__QUEUE_STATE_XOFF, &dev_queue->state))
992 __netif_schedule(dev); 1043 __netif_schedule(dev_queue->qdisc);
1044}
1045
1046static inline void netif_wake_queue(struct net_device *dev)
1047{
1048 netif_tx_wake_queue(netdev_get_tx_queue(dev, 0));
1049}
1050
1051static inline void netif_tx_wake_all_queues(struct net_device *dev)
1052{
1053 unsigned int i;
1054
1055 for (i = 0; i < dev->num_tx_queues; i++) {
1056 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1057 netif_tx_wake_queue(txq);
1058 }
993} 1059}
994 1060
995/** 1061/**
@@ -999,9 +1065,24 @@ static inline void netif_wake_queue(struct net_device *dev)
999 * Stop upper layers calling the device hard_start_xmit routine. 1065 * Stop upper layers calling the device hard_start_xmit routine.
1000 * Used for flow control when transmit resources are unavailable. 1066 * Used for flow control when transmit resources are unavailable.
1001 */ 1067 */
1068static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue)
1069{
1070 set_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1071}
1072
1002static inline void netif_stop_queue(struct net_device *dev) 1073static inline void netif_stop_queue(struct net_device *dev)
1003{ 1074{
1004 set_bit(__LINK_STATE_XOFF, &dev->state); 1075 netif_tx_stop_queue(netdev_get_tx_queue(dev, 0));
1076}
1077
1078static inline void netif_tx_stop_all_queues(struct net_device *dev)
1079{
1080 unsigned int i;
1081
1082 for (i = 0; i < dev->num_tx_queues; i++) {
1083 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1084 netif_tx_stop_queue(txq);
1085 }
1005} 1086}
1006 1087
1007/** 1088/**
@@ -1010,9 +1091,14 @@ static inline void netif_stop_queue(struct net_device *dev)
1010 * 1091 *
1011 * Test if transmit queue on device is currently unable to send. 1092 * Test if transmit queue on device is currently unable to send.
1012 */ 1093 */
1094static inline int netif_tx_queue_stopped(const struct netdev_queue *dev_queue)
1095{
1096 return test_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1097}
1098
1013static inline int netif_queue_stopped(const struct net_device *dev) 1099static inline int netif_queue_stopped(const struct net_device *dev)
1014{ 1100{
1015 return test_bit(__LINK_STATE_XOFF, &dev->state); 1101 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1016} 1102}
1017 1103
1018/** 1104/**
@@ -1042,9 +1128,8 @@ static inline int netif_running(const struct net_device *dev)
1042 */ 1128 */
1043static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index) 1129static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1044{ 1130{
1045#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1131 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1046 clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); 1132 clear_bit(__QUEUE_STATE_XOFF, &txq->state);
1047#endif
1048} 1133}
1049 1134
1050/** 1135/**
@@ -1056,13 +1141,12 @@ static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
1056 */ 1141 */
1057static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index) 1142static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
1058{ 1143{
1059#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1144 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1060#ifdef CONFIG_NETPOLL_TRAP 1145#ifdef CONFIG_NETPOLL_TRAP
1061 if (netpoll_trap()) 1146 if (netpoll_trap())
1062 return; 1147 return;
1063#endif 1148#endif
1064 set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state); 1149 set_bit(__QUEUE_STATE_XOFF, &txq->state);
1065#endif
1066} 1150}
1067 1151
1068/** 1152/**
@@ -1075,12 +1159,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, 1159static inline int __netif_subqueue_stopped(const struct net_device *dev,
1076 u16 queue_index) 1160 u16 queue_index)
1077{ 1161{
1078#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1162 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1079 return test_bit(__LINK_STATE_XOFF, 1163 return test_bit(__QUEUE_STATE_XOFF, &txq->state);
1080 &dev->egress_subqueue[queue_index].state);
1081#else
1082 return 0;
1083#endif
1084} 1164}
1085 1165
1086static inline int netif_subqueue_stopped(const struct net_device *dev, 1166static inline int netif_subqueue_stopped(const struct net_device *dev,
@@ -1098,15 +1178,13 @@ static inline int netif_subqueue_stopped(const struct net_device *dev,
1098 */ 1178 */
1099static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index) 1179static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1100{ 1180{
1101#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1181 struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
1102#ifdef CONFIG_NETPOLL_TRAP 1182#ifdef CONFIG_NETPOLL_TRAP
1103 if (netpoll_trap()) 1183 if (netpoll_trap())
1104 return; 1184 return;
1105#endif 1185#endif
1106 if (test_and_clear_bit(__LINK_STATE_XOFF, 1186 if (test_and_clear_bit(__QUEUE_STATE_XOFF, &txq->state))
1107 &dev->egress_subqueue[queue_index].state)) 1187 __netif_schedule(txq->qdisc);
1108 __netif_schedule(dev);
1109#endif
1110} 1188}
1111 1189
1112/** 1190/**
@@ -1114,15 +1192,10 @@ static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
1114 * @dev: network device 1192 * @dev: network device
1115 * 1193 *
1116 * Check if device has multiple transmit queues 1194 * Check if device has multiple transmit queues
1117 * Always falls if NETDEVICE_MULTIQUEUE is not configured
1118 */ 1195 */
1119static inline int netif_is_multiqueue(const struct net_device *dev) 1196static inline int netif_is_multiqueue(const struct net_device *dev)
1120{ 1197{
1121#ifdef CONFIG_NETDEVICES_MULTIQUEUE 1198 return (dev->num_tx_queues > 1);
1122 return (!!(NETIF_F_MULTI_QUEUE & dev->features));
1123#else
1124 return 0;
1125#endif
1126} 1199}
1127 1200
1128/* Use this variant when it is known for sure that it 1201/* Use this variant when it is known for sure that it
@@ -1142,6 +1215,7 @@ extern int netif_rx(struct sk_buff *skb);
1142extern int netif_rx_ni(struct sk_buff *skb); 1215extern int netif_rx_ni(struct sk_buff *skb);
1143#define HAVE_NETIF_RECEIVE_SKB 1 1216#define HAVE_NETIF_RECEIVE_SKB 1
1144extern int netif_receive_skb(struct sk_buff *skb); 1217extern int netif_receive_skb(struct sk_buff *skb);
1218extern void netif_nit_deliver(struct sk_buff *skb);
1145extern int dev_valid_name(const char *name); 1219extern int dev_valid_name(const char *name);
1146extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); 1220extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *);
1147extern int dev_ethtool(struct net *net, struct ifreq *); 1221extern int dev_ethtool(struct net *net, struct ifreq *);
@@ -1154,7 +1228,8 @@ extern int dev_set_mtu(struct net_device *, int);
1154extern int dev_set_mac_address(struct net_device *, 1228extern int dev_set_mac_address(struct net_device *,
1155 struct sockaddr *); 1229 struct sockaddr *);
1156extern int dev_hard_start_xmit(struct sk_buff *skb, 1230extern int dev_hard_start_xmit(struct sk_buff *skb,
1157 struct net_device *dev); 1231 struct net_device *dev,
1232 struct netdev_queue *txq);
1158 1233
1159extern int netdev_budget; 1234extern int netdev_budget;
1160 1235
@@ -1397,62 +1472,121 @@ static inline void netif_rx_complete(struct net_device *dev,
1397 * 1472 *
1398 * Get network device transmit lock 1473 * Get network device transmit lock
1399 */ 1474 */
1400static inline void __netif_tx_lock(struct net_device *dev, int cpu) 1475static inline void __netif_tx_lock(struct netdev_queue *txq, int cpu)
1401{ 1476{
1402 spin_lock(&dev->_xmit_lock); 1477 spin_lock(&txq->_xmit_lock);
1403 dev->xmit_lock_owner = cpu; 1478 txq->xmit_lock_owner = cpu;
1479}
1480
1481static inline void __netif_tx_lock_bh(struct netdev_queue *txq)
1482{
1483 spin_lock_bh(&txq->_xmit_lock);
1484 txq->xmit_lock_owner = smp_processor_id();
1404} 1485}
1405 1486
1406static inline void netif_tx_lock(struct net_device *dev) 1487static inline void netif_tx_lock(struct net_device *dev)
1407{ 1488{
1408 __netif_tx_lock(dev, smp_processor_id()); 1489 int cpu = smp_processor_id();
1490 unsigned int i;
1491
1492 for (i = 0; i < dev->num_tx_queues; i++) {
1493 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1494 __netif_tx_lock(txq, cpu);
1495 }
1409} 1496}
1410 1497
1411static inline void netif_tx_lock_bh(struct net_device *dev) 1498static inline void netif_tx_lock_bh(struct net_device *dev)
1412{ 1499{
1413 spin_lock_bh(&dev->_xmit_lock); 1500 local_bh_disable();
1414 dev->xmit_lock_owner = smp_processor_id(); 1501 netif_tx_lock(dev);
1415} 1502}
1416 1503
1417static inline int netif_tx_trylock(struct net_device *dev) 1504static inline int __netif_tx_trylock(struct netdev_queue *txq)
1418{ 1505{
1419 int ok = spin_trylock(&dev->_xmit_lock); 1506 int ok = spin_trylock(&txq->_xmit_lock);
1420 if (likely(ok)) 1507 if (likely(ok))
1421 dev->xmit_lock_owner = smp_processor_id(); 1508 txq->xmit_lock_owner = smp_processor_id();
1422 return ok; 1509 return ok;
1423} 1510}
1424 1511
1512static inline int netif_tx_trylock(struct net_device *dev)
1513{
1514 return __netif_tx_trylock(netdev_get_tx_queue(dev, 0));
1515}
1516
1517static inline void __netif_tx_unlock(struct netdev_queue *txq)
1518{
1519 txq->xmit_lock_owner = -1;
1520 spin_unlock(&txq->_xmit_lock);
1521}
1522
1523static inline void __netif_tx_unlock_bh(struct netdev_queue *txq)
1524{
1525 txq->xmit_lock_owner = -1;
1526 spin_unlock_bh(&txq->_xmit_lock);
1527}
1528
1425static inline void netif_tx_unlock(struct net_device *dev) 1529static inline void netif_tx_unlock(struct net_device *dev)
1426{ 1530{
1427 dev->xmit_lock_owner = -1; 1531 unsigned int i;
1428 spin_unlock(&dev->_xmit_lock); 1532
1533 for (i = 0; i < dev->num_tx_queues; i++) {
1534 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1535 __netif_tx_unlock(txq);
1536 }
1537
1429} 1538}
1430 1539
1431static inline void netif_tx_unlock_bh(struct net_device *dev) 1540static inline void netif_tx_unlock_bh(struct net_device *dev)
1432{ 1541{
1433 dev->xmit_lock_owner = -1; 1542 netif_tx_unlock(dev);
1434 spin_unlock_bh(&dev->_xmit_lock); 1543 local_bh_enable();
1435} 1544}
1436 1545
1437#define HARD_TX_LOCK(dev, cpu) { \ 1546#define HARD_TX_LOCK(dev, txq, cpu) { \
1438 if ((dev->features & NETIF_F_LLTX) == 0) { \ 1547 if ((dev->features & NETIF_F_LLTX) == 0) { \
1439 __netif_tx_lock(dev, cpu); \ 1548 __netif_tx_lock(txq, cpu); \
1440 } \ 1549 } \
1441} 1550}
1442 1551
1443#define HARD_TX_UNLOCK(dev) { \ 1552#define HARD_TX_UNLOCK(dev, txq) { \
1444 if ((dev->features & NETIF_F_LLTX) == 0) { \ 1553 if ((dev->features & NETIF_F_LLTX) == 0) { \
1445 netif_tx_unlock(dev); \ 1554 __netif_tx_unlock(txq); \
1446 } \ 1555 } \
1447} 1556}
1448 1557
1449static inline void netif_tx_disable(struct net_device *dev) 1558static inline void netif_tx_disable(struct net_device *dev)
1450{ 1559{
1560 unsigned int i;
1561
1451 netif_tx_lock_bh(dev); 1562 netif_tx_lock_bh(dev);
1452 netif_stop_queue(dev); 1563 for (i = 0; i < dev->num_tx_queues; i++) {
1564 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
1565 netif_tx_stop_queue(txq);
1566 }
1453 netif_tx_unlock_bh(dev); 1567 netif_tx_unlock_bh(dev);
1454} 1568}
1455 1569
1570static inline void netif_addr_lock(struct net_device *dev)
1571{
1572 spin_lock(&dev->addr_list_lock);
1573}
1574
1575static inline void netif_addr_lock_bh(struct net_device *dev)
1576{
1577 spin_lock_bh(&dev->addr_list_lock);
1578}
1579
1580static inline void netif_addr_unlock(struct net_device *dev)
1581{
1582 spin_unlock(&dev->addr_list_lock);
1583}
1584
1585static inline void netif_addr_unlock_bh(struct net_device *dev)
1586{
1587 spin_unlock_bh(&dev->addr_list_lock);
1588}
1589
1456/* These functions live elsewhere (drivers/net/net_init.c, but related) */ 1590/* These functions live elsewhere (drivers/net/net_init.c, but related) */
1457 1591
1458extern void ether_setup(struct net_device *dev); 1592extern void ether_setup(struct net_device *dev);
@@ -1480,9 +1614,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); 1614extern 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); 1615extern 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); 1616extern 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); 1617extern int dev_set_promiscuity(struct net_device *dev, int inc);
1484extern void dev_set_allmulti(struct net_device *dev, int inc); 1618extern int dev_set_allmulti(struct net_device *dev, int inc);
1485extern void netdev_state_change(struct net_device *dev); 1619extern void netdev_state_change(struct net_device *dev);
1620extern void netdev_bonding_change(struct net_device *dev);
1486extern void netdev_features_change(struct net_device *dev); 1621extern void netdev_features_change(struct net_device *dev);
1487/* Load a device via the kmod */ 1622/* Load a device via the kmod */
1488extern void dev_load(struct net *net, const char *name); 1623extern void dev_load(struct net *net, const char *name);
@@ -1509,6 +1644,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); 1644extern void dev_seq_stop(struct seq_file *seq, void *v);
1510#endif 1645#endif
1511 1646
1647extern int netdev_class_create_file(struct class_attribute *class_attr);
1648extern void netdev_class_remove_file(struct class_attribute *class_attr);
1649
1512extern void linkwatch_run_queue(void); 1650extern void linkwatch_run_queue(void);
1513 1651
1514extern int netdev_compute_features(unsigned long all, unsigned long one); 1652extern 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 6be6a7943d8b..d8507eb394cf 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1950,6 +1950,8 @@
1950#define PCI_DEVICE_ID_NX2_5708 0x164c 1950#define PCI_DEVICE_ID_NX2_5708 0x164c
1951#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d 1951#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
1952#define PCI_DEVICE_ID_NX2_57710 0x164e 1952#define PCI_DEVICE_ID_NX2_57710 0x164e
1953#define PCI_DEVICE_ID_NX2_57711 0x164f
1954#define PCI_DEVICE_ID_NX2_57711E 0x1650
1953#define PCI_DEVICE_ID_TIGON3_5705 0x1653 1955#define PCI_DEVICE_ID_TIGON3_5705 0x1653
1954#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 1956#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
1955#define PCI_DEVICE_ID_TIGON3_5720 0x1658 1957#define PCI_DEVICE_ID_TIGON3_5720 0x1658
@@ -1982,6 +1984,7 @@
1982#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 1984#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
1983#define PCI_DEVICE_ID_TIGON3_5782 0x1696 1985#define PCI_DEVICE_ID_TIGON3_5782 0x1696
1984#define PCI_DEVICE_ID_TIGON3_5784 0x1698 1986#define PCI_DEVICE_ID_TIGON3_5784 0x1698
1987#define PCI_DEVICE_ID_TIGON3_5785 0x1699
1985#define PCI_DEVICE_ID_TIGON3_5786 0x169a 1988#define PCI_DEVICE_ID_TIGON3_5786 0x169a
1986#define PCI_DEVICE_ID_TIGON3_5787 0x169b 1989#define PCI_DEVICE_ID_TIGON3_5787 0x169b
1987#define PCI_DEVICE_ID_TIGON3_5788 0x169c 1990#define PCI_DEVICE_ID_TIGON3_5788 0x169c
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index 99efbed81fa2..7cf7824df778 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -374,6 +374,7 @@ enum
374 TCA_FLOW_ACT, 374 TCA_FLOW_ACT,
375 TCA_FLOW_POLICE, 375 TCA_FLOW_POLICE,
376 TCA_FLOW_EMATCHES, 376 TCA_FLOW_EMATCHES,
377 TCA_FLOW_PERTURB,
377 __TCA_FLOW_MAX 378 __TCA_FLOW_MAX
378}; 379};
379 380
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index dbb7ac37960d..87f4e0fa8f27 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -103,15 +103,6 @@ struct tc_prio_qopt
103 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 103 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
104}; 104};
105 105
106enum
107{
108 TCA_PRIO_UNSPEC,
109 TCA_PRIO_MQ,
110 __TCA_PRIO_MAX
111};
112
113#define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
114
115/* TBF section */ 106/* TBF section */
116 107
117struct tc_tbf_qopt 108struct tc_tbf_qopt
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..7ea44f6621f2 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -246,6 +246,7 @@ typedef unsigned char *sk_buff_data_t;
246 * @dma_cookie: a cookie to one of several possible DMA operations 246 * @dma_cookie: a cookie to one of several possible DMA operations
247 * done by skb DMA functions 247 * done by skb DMA functions
248 * @secmark: security marking 248 * @secmark: security marking
249 * @vlan_tci: vlan tag control information
249 */ 250 */
250 251
251struct sk_buff { 252struct sk_buff {
@@ -305,9 +306,7 @@ struct sk_buff {
305#endif 306#endif
306 307
307 int iif; 308 int iif;
308#ifdef CONFIG_NETDEVICES_MULTIQUEUE
309 __u16 queue_mapping; 309 __u16 queue_mapping;
310#endif
311#ifdef CONFIG_NET_SCHED 310#ifdef CONFIG_NET_SCHED
312 __u16 tc_index; /* traffic control index */ 311 __u16 tc_index; /* traffic control index */
313#ifdef CONFIG_NET_CLS_ACT 312#ifdef CONFIG_NET_CLS_ACT
@@ -328,6 +327,8 @@ struct sk_buff {
328 327
329 __u32 mark; 328 __u32 mark;
330 329
330 __u16 vlan_tci;
331
331 sk_buff_data_t transport_header; 332 sk_buff_data_t transport_header;
332 sk_buff_data_t network_header; 333 sk_buff_data_t network_header;
333 sk_buff_data_t mac_header; 334 sk_buff_data_t mac_header;
@@ -1671,25 +1672,17 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1671 1672
1672static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping) 1673static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
1673{ 1674{
1674#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1675 skb->queue_mapping = queue_mapping; 1675 skb->queue_mapping = queue_mapping;
1676#endif
1677} 1676}
1678 1677
1679static inline u16 skb_get_queue_mapping(struct sk_buff *skb) 1678static inline u16 skb_get_queue_mapping(struct sk_buff *skb)
1680{ 1679{
1681#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1682 return skb->queue_mapping; 1680 return skb->queue_mapping;
1683#else
1684 return 0;
1685#endif
1686} 1681}
1687 1682
1688static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from) 1683static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
1689{ 1684{
1690#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1691 to->queue_mapping = from->queue_mapping; 1685 to->queue_mapping = from->queue_mapping;
1692#endif
1693} 1686}
1694 1687
1695static inline int skb_is_gso(const struct sk_buff *skb) 1688static inline int skb_is_gso(const struct sk_buff *skb)
@@ -1702,6 +1695,20 @@ static inline int skb_is_gso_v6(const struct sk_buff *skb)
1702 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6; 1695 return skb_shinfo(skb)->gso_type & SKB_GSO_TCPV6;
1703} 1696}
1704 1697
1698extern void __skb_warn_lro_forwarding(const struct sk_buff *skb);
1699
1700static inline bool skb_warn_if_lro(const struct sk_buff *skb)
1701{
1702 /* LRO sets gso_size but not gso_type, whereas if GSO is really
1703 * wanted then gso_type will be set. */
1704 struct skb_shared_info *shinfo = skb_shinfo(skb);
1705 if (shinfo->gso_size != 0 && unlikely(shinfo->gso_type == 0)) {
1706 __skb_warn_lro_forwarding(skb);
1707 return true;
1708 }
1709 return false;
1710}
1711
1705static inline void skb_forward_csum(struct sk_buff *skb) 1712static inline void skb_forward_csum(struct sk_buff *skb)
1706{ 1713{
1707 /* Unfortunately we don't support this one. Any brave souls? */ 1714 /* 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..4bf8cade9dbc 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -7,6 +7,7 @@
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/pci.h> 8#include <linux/pci.h>
9#include <linux/mod_devicetable.h> 9#include <linux/mod_devicetable.h>
10#include <linux/dma-mapping.h>
10 11
11#include <linux/ssb/ssb_regs.h> 12#include <linux/ssb/ssb_regs.h>
12 13
@@ -137,9 +138,6 @@ struct ssb_device {
137 const struct ssb_bus_ops *ops; 138 const struct ssb_bus_ops *ops;
138 139
139 struct device *dev; 140 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 141
144 struct ssb_bus *bus; 142 struct ssb_bus *bus;
145 struct ssb_device_id id; 143 struct ssb_device_id id;
@@ -399,13 +397,151 @@ static inline void ssb_block_write(struct ssb_device *dev, const void *buffer,
399#endif /* CONFIG_SSB_BLOCKIO */ 397#endif /* CONFIG_SSB_BLOCKIO */
400 398
401 399
400/* The SSB DMA API. Use this API for any DMA operation on the device.
401 * This API basically is a wrapper that calls the correct DMA API for
402 * the host device type the SSB device is attached to. */
403
402/* Translation (routing) bits that need to be ORed to DMA 404/* Translation (routing) bits that need to be ORed to DMA
403 * addresses before they are given to a device. */ 405 * addresses before they are given to a device. */
404extern u32 ssb_dma_translation(struct ssb_device *dev); 406extern u32 ssb_dma_translation(struct ssb_device *dev);
405#define SSB_DMA_TRANSLATION_MASK 0xC0000000 407#define SSB_DMA_TRANSLATION_MASK 0xC0000000
406#define SSB_DMA_TRANSLATION_SHIFT 30 408#define SSB_DMA_TRANSLATION_SHIFT 30
407 409
408extern int ssb_dma_set_mask(struct ssb_device *ssb_dev, u64 mask); 410extern int ssb_dma_set_mask(struct ssb_device *dev, u64 mask);
411
412extern void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size,
413 dma_addr_t *dma_handle, gfp_t gfp_flags);
414extern void ssb_dma_free_consistent(struct ssb_device *dev, size_t size,
415 void *vaddr, dma_addr_t dma_handle,
416 gfp_t gfp_flags);
417
418static inline void __cold __ssb_dma_not_implemented(struct ssb_device *dev)
419{
420#ifdef CONFIG_SSB_DEBUG
421 printk(KERN_ERR "SSB: BUG! Calling DMA API for "
422 "unsupported bustype %d\n", dev->bus->bustype);
423#endif /* DEBUG */
424}
425
426static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr)
427{
428 switch (dev->bus->bustype) {
429 case SSB_BUSTYPE_PCI:
430 return pci_dma_mapping_error(addr);
431 case SSB_BUSTYPE_SSB:
432 return dma_mapping_error(addr);
433 default:
434 __ssb_dma_not_implemented(dev);
435 }
436 return -ENOSYS;
437}
438
439static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p,
440 size_t size, enum dma_data_direction dir)
441{
442 switch (dev->bus->bustype) {
443 case SSB_BUSTYPE_PCI:
444 return pci_map_single(dev->bus->host_pci, p, size, dir);
445 case SSB_BUSTYPE_SSB:
446 return dma_map_single(dev->dev, p, size, dir);
447 default:
448 __ssb_dma_not_implemented(dev);
449 }
450 return 0;
451}
452
453static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_addr,
454 size_t size, enum dma_data_direction dir)
455{
456 switch (dev->bus->bustype) {
457 case SSB_BUSTYPE_PCI:
458 pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir);
459 return;
460 case SSB_BUSTYPE_SSB:
461 dma_unmap_single(dev->dev, dma_addr, size, dir);
462 return;
463 default:
464 __ssb_dma_not_implemented(dev);
465 }
466}
467
468static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
469 dma_addr_t dma_addr,
470 size_t size,
471 enum dma_data_direction dir)
472{
473 switch (dev->bus->bustype) {
474 case SSB_BUSTYPE_PCI:
475 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
476 size, dir);
477 return;
478 case SSB_BUSTYPE_SSB:
479 dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir);
480 return;
481 default:
482 __ssb_dma_not_implemented(dev);
483 }
484}
485
486static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
487 dma_addr_t dma_addr,
488 size_t size,
489 enum dma_data_direction dir)
490{
491 switch (dev->bus->bustype) {
492 case SSB_BUSTYPE_PCI:
493 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
494 size, dir);
495 return;
496 case SSB_BUSTYPE_SSB:
497 dma_sync_single_for_device(dev->dev, dma_addr, size, dir);
498 return;
499 default:
500 __ssb_dma_not_implemented(dev);
501 }
502}
503
504static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
505 dma_addr_t dma_addr,
506 unsigned long offset,
507 size_t size,
508 enum dma_data_direction dir)
509{
510 switch (dev->bus->bustype) {
511 case SSB_BUSTYPE_PCI:
512 /* Just sync everything. That's all the PCI API can do. */
513 pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
514 offset + size, dir);
515 return;
516 case SSB_BUSTYPE_SSB:
517 dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset,
518 size, dir);
519 return;
520 default:
521 __ssb_dma_not_implemented(dev);
522 }
523}
524
525static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
526 dma_addr_t dma_addr,
527 unsigned long offset,
528 size_t size,
529 enum dma_data_direction dir)
530{
531 switch (dev->bus->bustype) {
532 case SSB_BUSTYPE_PCI:
533 /* Just sync everything. That's all the PCI API can do. */
534 pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
535 offset + size, dir);
536 return;
537 case SSB_BUSTYPE_SSB:
538 dma_sync_single_range_for_device(dev->dev, dma_addr, offset,
539 size, dir);
540 return;
541 default:
542 __ssb_dma_not_implemented(dev);
543 }
544}
409 545
410 546
411#ifdef CONFIG_SSB_PCIHOST 547#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/icmp.h b/include/net/icmp.h
index dddb839ff4b5..03b9972b8754 100644
--- a/include/net/icmp.h
+++ b/include/net/icmp.h
@@ -31,25 +31,21 @@ struct icmp_err {
31extern struct icmp_err icmp_err_convert[]; 31extern struct icmp_err icmp_err_convert[];
32DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics); 32DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
33DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics); 33DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
34#define ICMP_INC_STATS(field) SNMP_INC_STATS(icmp_statistics, field) 34#define ICMP_INC_STATS(net, field) SNMP_INC_STATS(icmp_statistics, field)
35#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field) 35#define ICMP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH(icmp_statistics, field)
36#define ICMP_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmp_statistics, field) 36#define ICMPMSGOUT_INC_STATS(net, field) SNMP_INC_STATS(icmpmsg_statistics, field+256)
37#define ICMPMSGOUT_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field+256) 37#define ICMPMSGIN_INC_STATS_BH(net, field) SNMP_INC_STATS_BH(icmpmsg_statistics, field)
38#define ICMPMSGOUT_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field+256)
39#define ICMPMSGOUT_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field+256)
40#define ICMPMSGIN_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field)
41#define ICMPMSGIN_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field)
42#define ICMPMSGIN_INC_STATS_USER(field) SNMP_INC_STATS_USER(icmpmsg_statistics, field)
43 38
44struct dst_entry; 39struct dst_entry;
45struct net_proto_family; 40struct net_proto_family;
46struct sk_buff; 41struct sk_buff;
42struct net;
47 43
48extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info); 44extern void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info);
49extern int icmp_rcv(struct sk_buff *skb); 45extern int icmp_rcv(struct sk_buff *skb);
50extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg); 46extern int icmp_ioctl(struct sock *sk, int cmd, unsigned long arg);
51extern int icmp_init(void); 47extern int icmp_init(void);
52extern void icmp_out_count(unsigned char type); 48extern void icmp_out_count(struct net *net, unsigned char type);
53 49
54/* Move into dst.h ? */ 50/* Move into dst.h ? */
55extern int xrlim_allow(struct dst_entry *dst, int timeout); 51extern int xrlim_allow(struct dst_entry *dst, int timeout);
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/ip.h b/include/net/ip.h
index 3b40bc2234be..02924fb4bdbf 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -157,16 +157,15 @@ struct ipv4_config
157 157
158extern struct ipv4_config ipv4_config; 158extern struct ipv4_config ipv4_config;
159DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics); 159DECLARE_SNMP_STAT(struct ipstats_mib, ip_statistics);
160#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field) 160#define IP_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(ip_statistics, field); } while (0)
161#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field) 161#define IP_INC_STATS_BH(net, field) do { (void)net; SNMP_INC_STATS_BH(ip_statistics, field); } while (0)
162#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field) 162#define IP_ADD_STATS_BH(net, field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val)
163#define IP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(ip_statistics, field, val)
164DECLARE_SNMP_STAT(struct linux_mib, net_statistics); 163DECLARE_SNMP_STAT(struct linux_mib, net_statistics);
165#define NET_INC_STATS(field) SNMP_INC_STATS(net_statistics, field) 164#define NET_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(net_statistics, field); } while (0)
166#define NET_INC_STATS_BH(field) SNMP_INC_STATS_BH(net_statistics, field) 165#define NET_INC_STATS_BH(net, field) do { (void)net; SNMP_INC_STATS_BH(net_statistics, field); } while (0)
167#define NET_INC_STATS_USER(field) SNMP_INC_STATS_USER(net_statistics, field) 166#define NET_INC_STATS_USER(net, field) do { (void)net; SNMP_INC_STATS_USER(net_statistics, field); } while (0)
168#define NET_ADD_STATS_BH(field, adnd) SNMP_ADD_STATS_BH(net_statistics, field, adnd) 167#define NET_ADD_STATS_BH(net, field, adnd) do { (void)net; SNMP_ADD_STATS_BH(net_statistics, field, adnd); } while (0)
169#define NET_ADD_STATS_USER(field, adnd) SNMP_ADD_STATS_USER(net_statistics, field, adnd) 168#define NET_ADD_STATS_USER(net, field, adnd) do { (void)net; SNMP_ADD_STATS_USER(net_statistics, field, adnd); } while (0)
170 169
171extern unsigned long snmp_fold_field(void *mib[], int offt); 170extern unsigned long snmp_fold_field(void *mib[], int offt);
172extern int snmp_mib_init(void *ptr[2], size_t mibsize); 171extern int snmp_mib_init(void *ptr[2], size_t mibsize);
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..4dd3d93e1960 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,77 +98,49 @@ 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
104 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29. 116 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
105 * 117 *
106 * @aifs: arbitration interface space [0..255, -1: use default] 118 * @aifs: arbitration interface space [0..255]
107 * @cw_min: minimum contention window [will be a value of the form 119 * @cw_min: minimum contention window [a value of the form
108 * 2^n-1 in the range 1..1023; 0: use default] 120 * 2^n-1 in the range 1..32767]
109 * @cw_max: maximum contention window [like @cw_min] 121 * @cw_max: maximum contention window [like @cw_min]
110 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled 122 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
111 */ 123 */
112struct ieee80211_tx_queue_params { 124struct ieee80211_tx_queue_params {
113 s16 aifs; 125 u16 txop;
114 u16 cw_min; 126 u16 cw_min;
115 u16 cw_max; 127 u16 cw_max;
116 u16 txop; 128 u8 aifs;
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,151 @@ 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).
242 * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
243 * number to this frame, taking care of not overwriting the fragment
244 * number and increasing the sequence number only when the
245 * IEEE80211_TX_CTL_FIRST_FRAGMENT flags is set. mac80211 will properly
246 * assign sequence numbers to QoS-data frames but cannot do so correctly
247 * for non-QoS-data and management frames because beacons need them from
248 * that counter as well and mac80211 cannot guarantee proper sequencing.
249 * If this flag is set, the driver should instruct the hardware to
250 * assign a sequence number to the frame or assign one itself. Cf. IEEE
251 * 802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
252 * beacons always be clear for frames without a sequence number field.
264 */ 253 */
265enum mac80211_tx_control_flags { 254enum mac80211_tx_control_flags {
266 IEEE80211_TXCTL_REQ_TX_STATUS = (1<<0), 255 IEEE80211_TX_CTL_REQ_TX_STATUS = BIT(0),
267 IEEE80211_TXCTL_DO_NOT_ENCRYPT = (1<<1), 256 IEEE80211_TX_CTL_DO_NOT_ENCRYPT = BIT(1),
268 IEEE80211_TXCTL_USE_RTS_CTS = (1<<2), 257 IEEE80211_TX_CTL_USE_RTS_CTS = BIT(2),
269 IEEE80211_TXCTL_USE_CTS_PROTECT = (1<<3), 258 IEEE80211_TX_CTL_USE_CTS_PROTECT = BIT(3),
270 IEEE80211_TXCTL_NO_ACK = (1<<4), 259 IEEE80211_TX_CTL_NO_ACK = BIT(4),
271 IEEE80211_TXCTL_RATE_CTRL_PROBE = (1<<5), 260 IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(5),
272 IEEE80211_TXCTL_CLEAR_PS_FILT = (1<<6), 261 IEEE80211_TX_CTL_CLEAR_PS_FILT = BIT(6),
273 IEEE80211_TXCTL_REQUEUE = (1<<7), 262 IEEE80211_TX_CTL_REQUEUE = BIT(7),
274 IEEE80211_TXCTL_FIRST_FRAGMENT = (1<<8), 263 IEEE80211_TX_CTL_FIRST_FRAGMENT = BIT(8),
275 IEEE80211_TXCTL_SHORT_PREAMBLE = (1<<9), 264 IEEE80211_TX_CTL_SHORT_PREAMBLE = BIT(9),
276 IEEE80211_TXCTL_LONG_RETRY_LIMIT = (1<<10), 265 IEEE80211_TX_CTL_LONG_RETRY_LIMIT = BIT(10),
277 IEEE80211_TXCTL_EAPOL_FRAME = (1<<11), 266 IEEE80211_TX_CTL_EAPOL_FRAME = BIT(11),
278 IEEE80211_TXCTL_SEND_AFTER_DTIM = (1<<12), 267 IEEE80211_TX_CTL_SEND_AFTER_DTIM = BIT(12),
279 IEEE80211_TXCTL_AMPDU = (1<<13), 268 IEEE80211_TX_CTL_AMPDU = BIT(13),
280 IEEE80211_TXCTL_OFDM_HT = (1<<14), 269 IEEE80211_TX_CTL_OFDM_HT = BIT(14),
281 IEEE80211_TXCTL_GREEN_FIELD = (1<<15), 270 IEEE80211_TX_CTL_GREEN_FIELD = BIT(15),
282 IEEE80211_TXCTL_40_MHZ_WIDTH = (1<<16), 271 IEEE80211_TX_CTL_40_MHZ_WIDTH = BIT(16),
283 IEEE80211_TXCTL_DUP_DATA = (1<<17), 272 IEEE80211_TX_CTL_DUP_DATA = BIT(17),
284 IEEE80211_TXCTL_SHORT_GI = (1<<18), 273 IEEE80211_TX_CTL_SHORT_GI = BIT(18),
274 IEEE80211_TX_CTL_INJECTED = BIT(19),
275 IEEE80211_TX_STAT_TX_FILTERED = BIT(20),
276 IEEE80211_TX_STAT_ACK = BIT(21),
277 IEEE80211_TX_STAT_AMPDU = BIT(22),
278 IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(23),
279 IEEE80211_TX_CTL_ASSIGN_SEQ = BIT(24),
285}; 280};
286 281
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 282
291struct ieee80211_tx_control { 283#define IEEE80211_TX_INFO_DRIVER_DATA_SIZE \
292 struct ieee80211_vif *vif; 284 (sizeof(((struct sk_buff *)0)->cb) - 8)
293 struct ieee80211_rate *tx_rate; 285#define IEEE80211_TX_INFO_DRIVER_DATA_PTRS \
294 286 (IEEE80211_TX_INFO_DRIVER_DATA_SIZE / sizeof(void *))
295 /* Transmit rate for RTS/CTS frame */ 287
296 struct ieee80211_rate *rts_cts_rate; 288/**
297 289 * struct ieee80211_tx_info - skb transmit information
298 /* retry rate for the last retries */ 290 *
299 struct ieee80211_rate *alt_retry_rate; 291 * This structure is placed in skb->cb for three uses:
300 292 * (1) mac80211 TX control - mac80211 tells the driver what to do
301 u32 flags; /* tx control flags defined above */ 293 * (2) driver internal use (if applicable)
302 u8 key_idx; /* keyidx from hw->set_key(), undefined if 294 * (3) TX status information - driver tells mac80211 what happened
303 * IEEE80211_TXCTL_DO_NOT_ENCRYPT is set */ 295 *
304 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 296 * @flags: transmit info flags, defined above
305 * This could be used when set_retry_limit 297 * @band: TBD
306 * is not implemented by the driver */ 298 * @tx_rate_idx: TBD
307 u8 antenna_sel_tx; /* 0 = default/diversity, otherwise bit 299 * @antenna_sel_tx: TBD
308 * position represents antenna number used */ 300 * @control: union for control data
309 u8 icv_len; /* length of the ICV/MIC field in octets */ 301 * @status: union for status data
310 u8 iv_len; /* length of the IV field in octets */ 302 * @driver_data: array of driver_data pointers
311 u8 queue; /* hardware queue to use for this frame; 303 * @retry_count: number of retries
312 * 0 = highest, hw->queues-1 = lowest */ 304 * @excessive_retries: set to 1 if the frame was retried many times
313 u16 aid; /* Station AID */ 305 * but not acknowledged
314 int type; /* internal */ 306 * @ampdu_ack_len: number of aggregated frames.
307 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
308 * @ampdu_ack_map: block ack bit map for the aggregation.
309 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
310 * @ack_signal: signal strength of the ACK frame
311 */
312struct ieee80211_tx_info {
313 /* common information */
314 u32 flags;
315 u8 band;
316 s8 tx_rate_idx;
317 u8 antenna_sel_tx;
318
319 /* 1 byte hole */
320
321 union {
322 struct {
323 struct ieee80211_vif *vif;
324 struct ieee80211_key_conf *hw_key;
325 unsigned long jiffies;
326 int ifindex;
327 u16 aid;
328 s8 rts_cts_rate_idx, alt_retry_rate_idx;
329 u8 retry_limit;
330 u8 icv_len;
331 u8 iv_len;
332 } control;
333 struct {
334 u64 ampdu_ack_map;
335 int ack_signal;
336 u8 retry_count;
337 bool excessive_retries;
338 u8 ampdu_ack_len;
339 } status;
340 void *driver_data[IEEE80211_TX_INFO_DRIVER_DATA_PTRS];
341 };
315}; 342};
316 343
344static inline struct ieee80211_tx_info *IEEE80211_SKB_CB(struct sk_buff *skb)
345{
346 return (struct ieee80211_tx_info *)skb->cb;
347}
348
317 349
318/** 350/**
319 * enum mac80211_rx_flags - receive flags 351 * enum mac80211_rx_flags - receive flags
@@ -353,13 +385,16 @@ enum mac80211_rx_flags {
353 * The low-level driver should provide this information (the subset 385 * The low-level driver should provide this information (the subset
354 * supported by hardware) to the 802.11 code with each received 386 * supported by hardware) to the 802.11 code with each received
355 * frame. 387 * frame.
388 *
356 * @mactime: value in microseconds of the 64-bit Time Synchronization Function 389 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
357 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware. 390 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
358 * @band: the active band when this frame was received 391 * @band: the active band when this frame was received
359 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 392 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
360 * @ssi: signal strength when receiving this frame 393 * @signal: signal strength when receiving this frame, either in dBm, in dB or
361 * @signal: used as 'qual' in statistics reporting 394 * unspecified depending on the hardware capabilities flags
362 * @noise: PHY noise when receiving this frame 395 * @IEEE80211_HW_SIGNAL_*
396 * @noise: noise when receiving this frame, in dBm.
397 * @qual: overall signal quality indication, in percent (0-100).
363 * @antenna: antenna used 398 * @antenna: antenna used
364 * @rate_idx: index of data rate into band's supported rates 399 * @rate_idx: index of data rate into band's supported rates
365 * @flag: %RX_FLAG_* 400 * @flag: %RX_FLAG_*
@@ -368,64 +403,15 @@ struct ieee80211_rx_status {
368 u64 mactime; 403 u64 mactime;
369 enum ieee80211_band band; 404 enum ieee80211_band band;
370 int freq; 405 int freq;
371 int ssi;
372 int signal; 406 int signal;
373 int noise; 407 int noise;
408 int qual;
374 int antenna; 409 int antenna;
375 int rate_idx; 410 int rate_idx;
376 int flag; 411 int flag;
377}; 412};
378 413
379/** 414/**
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 415 * enum ieee80211_conf_flags - configuration flags
430 * 416 *
431 * Flags to define PHY configuration options 417 * Flags to define PHY configuration options
@@ -433,11 +419,13 @@ struct ieee80211_tx_status {
433 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time 419 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
434 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) 420 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
435 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported) 421 * @IEEE80211_CONF_SUPPORT_HT_MODE: use 802.11n HT capabilities (if supported)
422 * @IEEE80211_CONF_PS: Enable 802.11 power save mode
436 */ 423 */
437enum ieee80211_conf_flags { 424enum ieee80211_conf_flags {
438 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0), 425 IEEE80211_CONF_SHORT_SLOT_TIME = (1<<0),
439 IEEE80211_CONF_RADIOTAP = (1<<1), 426 IEEE80211_CONF_RADIOTAP = (1<<1),
440 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2), 427 IEEE80211_CONF_SUPPORT_HT_MODE = (1<<2),
428 IEEE80211_CONF_PS = (1<<3),
441}; 429};
442 430
443/** 431/**
@@ -553,34 +541,38 @@ struct ieee80211_if_init_conf {
553}; 541};
554 542
555/** 543/**
544 * enum ieee80211_if_conf_change - interface config change flags
545 *
546 * @IEEE80211_IFCC_BSSID: The BSSID changed.
547 * @IEEE80211_IFCC_SSID: The SSID changed.
548 * @IEEE80211_IFCC_BEACON: The beacon for this interface changed
549 * (currently AP and MESH only), use ieee80211_beacon_get().
550 */
551enum ieee80211_if_conf_change {
552 IEEE80211_IFCC_BSSID = BIT(0),
553 IEEE80211_IFCC_SSID = BIT(1),
554 IEEE80211_IFCC_BEACON = BIT(2),
555};
556
557/**
556 * struct ieee80211_if_conf - configuration of an interface 558 * struct ieee80211_if_conf - configuration of an interface
557 * 559 *
558 * @type: type of the interface. This is always the same as was specified in 560 * @changed: parameters that have changed, see &enum ieee80211_if_conf_change.
559 * &struct ieee80211_if_init_conf. The type of an interface never changes
560 * during the life of the interface; this field is present only for
561 * convenience.
562 * @bssid: BSSID of the network we are associated to/creating. 561 * @bssid: BSSID of the network we are associated to/creating.
563 * @ssid: used (together with @ssid_len) by drivers for hardware that 562 * @ssid: used (together with @ssid_len) by drivers for hardware that
564 * generate beacons independently. The pointer is valid only during the 563 * generate beacons independently. The pointer is valid only during the
565 * config_interface() call, so copy the value somewhere if you need 564 * config_interface() call, so copy the value somewhere if you need
566 * it. 565 * it.
567 * @ssid_len: length of the @ssid field. 566 * @ssid_len: length of the @ssid field.
568 * @beacon: beacon template. Valid only if @host_gen_beacon_template in
569 * &struct ieee80211_hw is set. The driver is responsible of freeing
570 * the sk_buff.
571 * @beacon_control: tx_control for the beacon template, this field is only
572 * valid when the @beacon field was set.
573 * 567 *
574 * This structure is passed to the config_interface() callback of 568 * This structure is passed to the config_interface() callback of
575 * &struct ieee80211_hw. 569 * &struct ieee80211_hw.
576 */ 570 */
577struct ieee80211_if_conf { 571struct ieee80211_if_conf {
578 int type; 572 u32 changed;
579 u8 *bssid; 573 u8 *bssid;
580 u8 *ssid; 574 u8 *ssid;
581 size_t ssid_len; 575 size_t ssid_len;
582 struct sk_buff *beacon;
583 struct ieee80211_tx_control *beacon_control;
584}; 576};
585 577
586/** 578/**
@@ -597,8 +589,8 @@ enum ieee80211_key_alg {
597 589
598/** 590/**
599 * enum ieee80211_key_len - key length 591 * enum ieee80211_key_len - key length
600 * @WEP40: WEP 5 byte long key 592 * @LEN_WEP40: WEP 5-byte long key
601 * @WEP104: WEP 13 byte long key 593 * @LEN_WEP104: WEP 13-byte long key
602 */ 594 */
603enum ieee80211_key_len { 595enum ieee80211_key_len {
604 LEN_WEP40 = 5, 596 LEN_WEP40 = 5,
@@ -619,11 +611,14 @@ enum ieee80211_key_len {
619 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by 611 * @IEEE80211_KEY_FLAG_GENERATE_MMIC: This flag should be set by
620 * the driver for a TKIP key if it requires Michael MIC 612 * the driver for a TKIP key if it requires Michael MIC
621 * generation in software. 613 * generation in software.
614 * @IEEE80211_KEY_FLAG_PAIRWISE: Set by mac80211, this flag indicates
615 * that the key is pairwise rather then a shared key.
622 */ 616 */
623enum ieee80211_key_flags { 617enum ieee80211_key_flags {
624 IEEE80211_KEY_FLAG_WMM_STA = 1<<0, 618 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
625 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1, 619 IEEE80211_KEY_FLAG_GENERATE_IV = 1<<1,
626 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 620 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
621 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
627}; 622};
628 623
629/** 624/**
@@ -639,7 +634,12 @@ enum ieee80211_key_flags {
639 * @flags: key flags, see &enum ieee80211_key_flags. 634 * @flags: key flags, see &enum ieee80211_key_flags.
640 * @keyidx: the key index (0-3) 635 * @keyidx: the key index (0-3)
641 * @keylen: key material length 636 * @keylen: key material length
642 * @key: key material 637 * @key: key material. For ALG_TKIP the key is encoded as a 256-bit (32 byte)
638 * data block:
639 * - Temporal Encryption Key (128 bits)
640 * - Temporal Authenticator Tx MIC Key (64 bits)
641 * - Temporal Authenticator Rx MIC Key (64 bits)
642 *
643 */ 643 */
644struct ieee80211_key_conf { 644struct ieee80211_key_conf {
645 enum ieee80211_key_alg alg; 645 enum ieee80211_key_alg alg;
@@ -667,7 +667,7 @@ enum set_key_cmd {
667 * enum sta_notify_cmd - sta notify command 667 * enum sta_notify_cmd - sta notify command
668 * 668 *
669 * Used with the sta_notify() callback in &struct ieee80211_ops, this 669 * Used with the sta_notify() callback in &struct ieee80211_ops, this
670 * indicates addition and removal of a station to station table 670 * indicates addition and removal of a station to station table.
671 * 671 *
672 * @STA_NOTIFY_ADD: a station was added to the station table 672 * @STA_NOTIFY_ADD: a station was added to the station table
673 * @STA_NOTIFY_REMOVE: a station being removed from the station table 673 * @STA_NOTIFY_REMOVE: a station being removed from the station table
@@ -700,15 +700,6 @@ enum ieee80211_tkip_key_type {
700 * any particular flags. There are some exceptions to this rule, 700 * any particular flags. There are some exceptions to this rule,
701 * however, so you are advised to review these flags carefully. 701 * however, so you are advised to review these flags carefully.
702 * 702 *
703 * @IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE:
704 * The device only needs to be supplied with a beacon template.
705 * If you need the host to generate each beacon then don't use
706 * this flag and call ieee80211_beacon_get() when you need the
707 * next beacon frame. Note that if you set this flag, you must
708 * implement the set_tim() callback for powersave mode to work
709 * properly.
710 * This flag is only relevant for access-point mode.
711 *
712 * @IEEE80211_HW_RX_INCLUDES_FCS: 703 * @IEEE80211_HW_RX_INCLUDES_FCS:
713 * Indicates that received frames passed to the stack include 704 * Indicates that received frames passed to the stack include
714 * the FCS at the end. 705 * the FCS at the end.
@@ -730,6 +721,29 @@ enum ieee80211_tkip_key_type {
730 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE: 721 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
731 * Hardware is not capable of receiving frames with short preamble on 722 * Hardware is not capable of receiving frames with short preamble on
732 * the 2.4 GHz band. 723 * the 2.4 GHz band.
724 *
725 * @IEEE80211_HW_SIGNAL_UNSPEC:
726 * Hardware can provide signal values but we don't know its units. We
727 * expect values between 0 and @max_signal.
728 * If possible please provide dB or dBm instead.
729 *
730 * @IEEE80211_HW_SIGNAL_DB:
731 * Hardware gives signal values in dB, decibel difference from an
732 * arbitrary, fixed reference. We expect values between 0 and @max_signal.
733 * If possible please provide dBm instead.
734 *
735 * @IEEE80211_HW_SIGNAL_DBM:
736 * Hardware gives signal values in dBm, decibel difference from
737 * one milliwatt. This is the preferred method since it is standardized
738 * between different devices. @max_signal does not need to be set.
739 *
740 * @IEEE80211_HW_NOISE_DBM:
741 * Hardware can provide noise (radio interference) values in units dBm,
742 * decibel difference from one milliwatt.
743 *
744 * @IEEE80211_HW_SPECTRUM_MGMT:
745 * Hardware supports spectrum management defined in 802.11h
746 * Measurement, Channel Switch, Quieting, TPC
733 */ 747 */
734enum ieee80211_hw_flags { 748enum ieee80211_hw_flags {
735 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 749 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
@@ -737,6 +751,11 @@ enum ieee80211_hw_flags {
737 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 751 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
738 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, 752 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
739 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4, 753 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
754 IEEE80211_HW_SIGNAL_UNSPEC = 1<<5,
755 IEEE80211_HW_SIGNAL_DB = 1<<6,
756 IEEE80211_HW_SIGNAL_DBM = 1<<7,
757 IEEE80211_HW_NOISE_DBM = 1<<8,
758 IEEE80211_HW_SPECTRUM_MGMT = 1<<9,
740}; 759};
741 760
742/** 761/**
@@ -754,8 +773,11 @@ enum ieee80211_hw_flags {
754 * @conf: &struct ieee80211_conf, device configuration, don't use. 773 * @conf: &struct ieee80211_conf, device configuration, don't use.
755 * 774 *
756 * @workqueue: single threaded workqueue available for driver use, 775 * @workqueue: single threaded workqueue available for driver use,
757 * allocated by mac80211 on registration and flushed on 776 * allocated by mac80211 on registration and flushed when an
758 * unregistration. 777 * interface is removed.
778 * NOTICE: All work performed on this workqueue should NEVER
779 * acquire the RTNL lock (i.e. Don't use the function
780 * ieee80211_iterate_active_interfaces())
759 * 781 *
760 * @priv: pointer to private area that was allocated for driver use 782 * @priv: pointer to private area that was allocated for driver use
761 * along with this structure. 783 * along with this structure.
@@ -767,15 +789,18 @@ enum ieee80211_hw_flags {
767 * 789 *
768 * @channel_change_time: time (in microseconds) it takes to change channels. 790 * @channel_change_time: time (in microseconds) it takes to change channels.
769 * 791 *
770 * @max_rssi: Maximum value for ssi in RX information, use 792 * @max_signal: Maximum value for signal (rssi) in RX information, used
771 * negative numbers for dBm and 0 to indicate no support. 793 * 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 * 794 *
777 * @queues: number of available hardware transmit queues for 795 * @queues: number of available hardware transmit queues for
778 * data packets. WMM/QoS requires at least four. 796 * data packets. WMM/QoS requires at least four, these
797 * queues need to have configurable access parameters.
798 *
799 * @ampdu_queues: number of available hardware transmit queues
800 * for A-MPDU packets, these have no access parameters
801 * because they're used only for A-MPDU frames. Note that
802 * mac80211 will not currently use any of the regular queues
803 * for aggregation.
779 * 804 *
780 * @rate_control_algorithm: rate control algorithm for this hardware. 805 * @rate_control_algorithm: rate control algorithm for this hardware.
781 * If unset (NULL), the default algorithm will be used. Must be 806 * If unset (NULL), the default algorithm will be used. Must be
@@ -794,10 +819,8 @@ struct ieee80211_hw {
794 unsigned int extra_tx_headroom; 819 unsigned int extra_tx_headroom;
795 int channel_change_time; 820 int channel_change_time;
796 int vif_data_size; 821 int vif_data_size;
797 u8 queues; 822 u16 queues, ampdu_queues;
798 s8 max_rssi;
799 s8 max_signal; 823 s8 max_signal;
800 s8 max_noise;
801}; 824};
802 825
803/** 826/**
@@ -822,6 +845,43 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
822 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN); 845 memcpy(hw->wiphy->perm_addr, addr, ETH_ALEN);
823} 846}
824 847
848static inline int ieee80211_num_regular_queues(struct ieee80211_hw *hw)
849{
850 return hw->queues;
851}
852
853static inline int ieee80211_num_queues(struct ieee80211_hw *hw)
854{
855 return hw->queues + hw->ampdu_queues;
856}
857
858static inline struct ieee80211_rate *
859ieee80211_get_tx_rate(const struct ieee80211_hw *hw,
860 const struct ieee80211_tx_info *c)
861{
862 if (WARN_ON(c->tx_rate_idx < 0))
863 return NULL;
864 return &hw->wiphy->bands[c->band]->bitrates[c->tx_rate_idx];
865}
866
867static inline struct ieee80211_rate *
868ieee80211_get_rts_cts_rate(const struct ieee80211_hw *hw,
869 const struct ieee80211_tx_info *c)
870{
871 if (c->control.rts_cts_rate_idx < 0)
872 return NULL;
873 return &hw->wiphy->bands[c->band]->bitrates[c->control.rts_cts_rate_idx];
874}
875
876static inline struct ieee80211_rate *
877ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
878 const struct ieee80211_tx_info *c)
879{
880 if (c->control.alt_retry_rate_idx < 0)
881 return NULL;
882 return &hw->wiphy->bands[c->band]->bitrates[c->control.alt_retry_rate_idx];
883}
884
825/** 885/**
826 * DOC: Hardware crypto acceleration 886 * DOC: Hardware crypto acceleration
827 * 887 *
@@ -979,8 +1039,10 @@ enum ieee80211_ampdu_mlme_action {
979 * @tx: Handler that 802.11 module calls for each transmitted frame. 1039 * @tx: Handler that 802.11 module calls for each transmitted frame.
980 * skb contains the buffer starting from the IEEE 802.11 header. 1040 * skb contains the buffer starting from the IEEE 802.11 header.
981 * The low-level driver should send the frame out based on 1041 * The low-level driver should send the frame out based on
982 * configuration in the TX control data. Must be implemented and 1042 * configuration in the TX control data. This handler should,
983 * atomic. 1043 * preferably, never fail and stop queues appropriately, more
1044 * importantly, however, it must never fail for A-MPDU-queues.
1045 * Must be implemented and atomic.
984 * 1046 *
985 * @start: Called before the first netdevice attached to the hardware 1047 * @start: Called before the first netdevice attached to the hardware
986 * is enabled. This should turn on the hardware and must turn on 1048 * is enabled. This should turn on the hardware and must turn on
@@ -1072,15 +1134,13 @@ enum ieee80211_ampdu_mlme_action {
1072 * of assocaited station or AP. 1134 * of assocaited station or AP.
1073 * 1135 *
1074 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max), 1136 * @conf_tx: Configure TX queue parameters (EDCF (aifs, cw_min, cw_max),
1075 * bursting) for a hardware TX queue. The @queue parameter uses the 1137 * bursting) for a hardware TX queue. Must be atomic.
1076 * %IEEE80211_TX_QUEUE_* constants. Must be atomic.
1077 * 1138 *
1078 * @get_tx_stats: Get statistics of the current TX queue status. This is used 1139 * @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 1140 * to get number of currently queued packets (queue length), maximum queue
1080 * size (limit), and total number of packets sent using each TX queue 1141 * 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 1142 * (count). The 'stats' pointer points to an array that has hw->queues +
1082 * queues have room for more packets and by hostapd to provide 1143 * hw->ampdu_queues items.
1083 * statistics about the current queueing state to external programs.
1084 * 1144 *
1085 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1145 * @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 1146 * this is only used for IBSS mode debugging and, as such, is not a
@@ -1091,17 +1151,6 @@ enum ieee80211_ampdu_mlme_action {
1091 * function is optional if the firmware/hardware takes full care of 1151 * function is optional if the firmware/hardware takes full care of
1092 * TSF synchronization. 1152 * TSF synchronization.
1093 * 1153 *
1094 * @beacon_update: Setup beacon data for IBSS beacons. Unlike access point,
1095 * IBSS uses a fixed beacon frame which is configured using this
1096 * function.
1097 * If the driver returns success (0) from this callback, it owns
1098 * the skb. That means the driver is responsible to kfree_skb() it.
1099 * The control structure is not dynamically allocated. That means the
1100 * driver does not own the pointer and if it needs it somewhere
1101 * outside of the context of this function, it must copy it
1102 * somewhere else.
1103 * This handler is required only for IBSS mode.
1104 *
1105 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us. 1154 * @tx_last_beacon: Determine whether the last IBSS beacon was sent by us.
1106 * This is needed only for IBSS mode and the result of this function is 1155 * This is needed only for IBSS mode and the result of this function is
1107 * used to determine whether to reply to Probe Requests. 1156 * used to determine whether to reply to Probe Requests.
@@ -1116,8 +1165,7 @@ enum ieee80211_ampdu_mlme_action {
1116 * that TX/RX_STOP can pass NULL for this parameter. 1165 * that TX/RX_STOP can pass NULL for this parameter.
1117 */ 1166 */
1118struct ieee80211_ops { 1167struct ieee80211_ops {
1119 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1168 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
1120 struct ieee80211_tx_control *control);
1121 int (*start)(struct ieee80211_hw *hw); 1169 int (*start)(struct ieee80211_hw *hw);
1122 void (*stop)(struct ieee80211_hw *hw); 1170 void (*stop)(struct ieee80211_hw *hw);
1123 int (*add_interface)(struct ieee80211_hw *hw, 1171 int (*add_interface)(struct ieee80211_hw *hw,
@@ -1154,15 +1202,12 @@ struct ieee80211_ops {
1154 u32 short_retry, u32 long_retr); 1202 u32 short_retry, u32 long_retr);
1155 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1203 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1156 enum sta_notify_cmd, const u8 *addr); 1204 enum sta_notify_cmd, const u8 *addr);
1157 int (*conf_tx)(struct ieee80211_hw *hw, int queue, 1205 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue,
1158 const struct ieee80211_tx_queue_params *params); 1206 const struct ieee80211_tx_queue_params *params);
1159 int (*get_tx_stats)(struct ieee80211_hw *hw, 1207 int (*get_tx_stats)(struct ieee80211_hw *hw,
1160 struct ieee80211_tx_queue_stats *stats); 1208 struct ieee80211_tx_queue_stats *stats);
1161 u64 (*get_tsf)(struct ieee80211_hw *hw); 1209 u64 (*get_tsf)(struct ieee80211_hw *hw);
1162 void (*reset_tsf)(struct ieee80211_hw *hw); 1210 void (*reset_tsf)(struct ieee80211_hw *hw);
1163 int (*beacon_update)(struct ieee80211_hw *hw,
1164 struct sk_buff *skb,
1165 struct ieee80211_tx_control *control);
1166 int (*tx_last_beacon)(struct ieee80211_hw *hw); 1211 int (*tx_last_beacon)(struct ieee80211_hw *hw);
1167 int (*ampdu_action)(struct ieee80211_hw *hw, 1212 int (*ampdu_action)(struct ieee80211_hw *hw,
1168 enum ieee80211_ampdu_mlme_action action, 1213 enum ieee80211_ampdu_mlme_action action,
@@ -1292,7 +1337,7 @@ void ieee80211_unregister_hw(struct ieee80211_hw *hw);
1292 * 1337 *
1293 * This function frees everything that was allocated, including the 1338 * This function frees everything that was allocated, including the
1294 * private data for the driver. You must call ieee80211_unregister_hw() 1339 * private data for the driver. You must call ieee80211_unregister_hw()
1295 * before calling this function 1340 * before calling this function.
1296 * 1341 *
1297 * @hw: the hardware to free 1342 * @hw: the hardware to free
1298 */ 1343 */
@@ -1358,16 +1403,12 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1358 * 1403 *
1359 * @hw: the hardware the frame was transmitted by 1404 * @hw: the hardware the frame was transmitted by
1360 * @skb: the frame that was transmitted, owned by mac80211 after this call 1405 * @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 */ 1406 */
1365void ieee80211_tx_status(struct ieee80211_hw *hw, 1407void ieee80211_tx_status(struct ieee80211_hw *hw,
1366 struct sk_buff *skb, 1408 struct sk_buff *skb);
1367 struct ieee80211_tx_status *status);
1368 1409
1369/** 1410/**
1370 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback 1411 * ieee80211_tx_status_irqsafe - IRQ-safe transmit status callback
1371 * 1412 *
1372 * Like ieee80211_tx_status() but can be called in IRQ context 1413 * Like ieee80211_tx_status() but can be called in IRQ context
1373 * (internally defers to a tasklet.) 1414 * (internally defers to a tasklet.)
@@ -1377,13 +1418,9 @@ void ieee80211_tx_status(struct ieee80211_hw *hw,
1377 * 1418 *
1378 * @hw: the hardware the frame was transmitted by 1419 * @hw: the hardware the frame was transmitted by
1379 * @skb: the frame that was transmitted, owned by mac80211 after this call 1420 * @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 */ 1421 */
1384void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, 1422void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1385 struct sk_buff *skb, 1423 struct sk_buff *skb);
1386 struct ieee80211_tx_status *status);
1387 1424
1388/** 1425/**
1389 * ieee80211_beacon_get - beacon generation function 1426 * ieee80211_beacon_get - beacon generation function
@@ -1399,8 +1436,7 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1399 * is responsible of freeing it. 1436 * is responsible of freeing it.
1400 */ 1437 */
1401struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, 1438struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1402 struct ieee80211_vif *vif, 1439 struct ieee80211_vif *vif);
1403 struct ieee80211_tx_control *control);
1404 1440
1405/** 1441/**
1406 * ieee80211_rts_get - RTS frame generation function 1442 * ieee80211_rts_get - RTS frame generation function
@@ -1408,7 +1444,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1408 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1444 * @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. 1445 * @frame: pointer to the frame that is going to be protected by the RTS.
1410 * @frame_len: the frame length (in octets). 1446 * @frame_len: the frame length (in octets).
1411 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1447 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1412 * @rts: The buffer where to store the RTS frame. 1448 * @rts: The buffer where to store the RTS frame.
1413 * 1449 *
1414 * If the RTS frames are generated by the host system (i.e., not in 1450 * If the RTS frames are generated by the host system (i.e., not in
@@ -1418,7 +1454,7 @@ struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw,
1418 */ 1454 */
1419void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1455void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1420 const void *frame, size_t frame_len, 1456 const void *frame, size_t frame_len,
1421 const struct ieee80211_tx_control *frame_txctl, 1457 const struct ieee80211_tx_info *frame_txctl,
1422 struct ieee80211_rts *rts); 1458 struct ieee80211_rts *rts);
1423 1459
1424/** 1460/**
@@ -1426,7 +1462,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1426 * @hw: pointer obtained from ieee80211_alloc_hw(). 1462 * @hw: pointer obtained from ieee80211_alloc_hw().
1427 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1463 * @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. 1464 * @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. 1465 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1430 * 1466 *
1431 * If the RTS is generated in firmware, but the host system must provide 1467 * 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 1468 * the duration field, the low-level driver uses this function to receive
@@ -1434,7 +1470,7 @@ void ieee80211_rts_get(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1434 */ 1470 */
1435__le16 ieee80211_rts_duration(struct ieee80211_hw *hw, 1471__le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1436 struct ieee80211_vif *vif, size_t frame_len, 1472 struct ieee80211_vif *vif, size_t frame_len,
1437 const struct ieee80211_tx_control *frame_txctl); 1473 const struct ieee80211_tx_info *frame_txctl);
1438 1474
1439/** 1475/**
1440 * ieee80211_ctstoself_get - CTS-to-self frame generation function 1476 * ieee80211_ctstoself_get - CTS-to-self frame generation function
@@ -1442,7 +1478,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1442 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1478 * @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. 1479 * @frame: pointer to the frame that is going to be protected by the CTS-to-self.
1444 * @frame_len: the frame length (in octets). 1480 * @frame_len: the frame length (in octets).
1445 * @frame_txctl: &struct ieee80211_tx_control of the frame. 1481 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1446 * @cts: The buffer where to store the CTS-to-self frame. 1482 * @cts: The buffer where to store the CTS-to-self frame.
1447 * 1483 *
1448 * If the CTS-to-self frames are generated by the host system (i.e., not in 1484 * If the CTS-to-self frames are generated by the host system (i.e., not in
@@ -1453,7 +1489,7 @@ __le16 ieee80211_rts_duration(struct ieee80211_hw *hw,
1453void ieee80211_ctstoself_get(struct ieee80211_hw *hw, 1489void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1454 struct ieee80211_vif *vif, 1490 struct ieee80211_vif *vif,
1455 const void *frame, size_t frame_len, 1491 const void *frame, size_t frame_len,
1456 const struct ieee80211_tx_control *frame_txctl, 1492 const struct ieee80211_tx_info *frame_txctl,
1457 struct ieee80211_cts *cts); 1493 struct ieee80211_cts *cts);
1458 1494
1459/** 1495/**
@@ -1461,7 +1497,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1461 * @hw: pointer obtained from ieee80211_alloc_hw(). 1497 * @hw: pointer obtained from ieee80211_alloc_hw().
1462 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1498 * @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. 1499 * @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. 1500 * @frame_txctl: &struct ieee80211_tx_info of the frame.
1465 * 1501 *
1466 * If the CTS-to-self is generated in firmware, but the host system must provide 1502 * 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 1503 * the duration field, the low-level driver uses this function to receive
@@ -1470,7 +1506,7 @@ void ieee80211_ctstoself_get(struct ieee80211_hw *hw,
1470__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw, 1506__le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1471 struct ieee80211_vif *vif, 1507 struct ieee80211_vif *vif,
1472 size_t frame_len, 1508 size_t frame_len,
1473 const struct ieee80211_tx_control *frame_txctl); 1509 const struct ieee80211_tx_info *frame_txctl);
1474 1510
1475/** 1511/**
1476 * ieee80211_generic_frame_duration - Calculate the duration field for a frame 1512 * ieee80211_generic_frame_duration - Calculate the duration field for a frame
@@ -1509,8 +1545,7 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1509 * use common code for all beacons. 1545 * use common code for all beacons.
1510 */ 1546 */
1511struct sk_buff * 1547struct sk_buff *
1512ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1548ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
1513 struct ieee80211_tx_control *control);
1514 1549
1515/** 1550/**
1516 * ieee80211_get_hdrlen_from_skb - get header length from data 1551 * ieee80211_get_hdrlen_from_skb - get header length from data
@@ -1522,7 +1557,7 @@ ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1522 * 1557 *
1523 * @skb: the frame 1558 * @skb: the frame
1524 */ 1559 */
1525int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb); 1560unsigned int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1526 1561
1527/** 1562/**
1528 * ieee80211_get_hdrlen - get header length from frame control 1563 * ieee80211_get_hdrlen - get header length from frame control
@@ -1535,6 +1570,12 @@ int ieee80211_get_hdrlen_from_skb(const struct sk_buff *skb);
1535int ieee80211_get_hdrlen(u16 fc); 1570int ieee80211_get_hdrlen(u16 fc);
1536 1571
1537/** 1572/**
1573 * ieee80211_hdrlen - get header length in bytes from frame control
1574 * @fc: frame control field in little-endian format
1575 */
1576unsigned int ieee80211_hdrlen(__le16 fc);
1577
1578/**
1538 * ieee80211_get_tkip_key - get a TKIP rc4 for skb 1579 * ieee80211_get_tkip_key - get a TKIP rc4 for skb
1539 * 1580 *
1540 * This function computes a TKIP rc4 key for an skb. It computes 1581 * This function computes a TKIP rc4 key for an skb. It computes
@@ -1545,6 +1586,8 @@ int ieee80211_get_hdrlen(u16 fc);
1545 * @keyconf: the parameter passed with the set key 1586 * @keyconf: the parameter passed with the set key
1546 * @skb: the skb for which the key is needed 1587 * @skb: the skb for which the key is needed
1547 * @rc4key: a buffer to which the key will be written 1588 * @rc4key: a buffer to which the key will be written
1589 * @type: TBD
1590 * @key: TBD
1548 */ 1591 */
1549void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 1592void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf,
1550 struct sk_buff *skb, 1593 struct sk_buff *skb,
@@ -1568,14 +1611,6 @@ void ieee80211_wake_queue(struct ieee80211_hw *hw, int queue);
1568void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue); 1611void ieee80211_stop_queue(struct ieee80211_hw *hw, int queue);
1569 1612
1570/** 1613/**
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 1614 * ieee80211_stop_queues - stop all queues
1580 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1615 * @hw: pointer as obtained from ieee80211_alloc_hw().
1581 * 1616 *
@@ -1603,7 +1638,7 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
1603void ieee80211_scan_completed(struct ieee80211_hw *hw); 1638void ieee80211_scan_completed(struct ieee80211_hw *hw);
1604 1639
1605/** 1640/**
1606 * ieee80211_iterate_active_interfaces- iterate active interfaces 1641 * ieee80211_iterate_active_interfaces - iterate active interfaces
1607 * 1642 *
1608 * This function iterates over the interfaces associated with a given 1643 * This function iterates over the interfaces associated with a given
1609 * hardware that are currently active and calls the callback for them. 1644 * hardware that are currently active and calls the callback for them.
@@ -1670,7 +1705,7 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1670 * 1705 *
1671 * This function must be called by low level driver once it has 1706 * This function must be called by low level driver once it has
1672 * finished with preparations for the BA session. 1707 * finished with preparations for the BA session.
1673 * This version of the function is irq safe. 1708 * This version of the function is IRQ-safe.
1674 */ 1709 */
1675void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1710void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1676 u16 tid); 1711 u16 tid);
@@ -1710,7 +1745,7 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
1710 * 1745 *
1711 * This function must be called by low level driver once it has 1746 * This function must be called by low level driver once it has
1712 * finished with preparations for the BA session tear down. 1747 * finished with preparations for the BA session tear down.
1713 * This version of the function is irq safe. 1748 * This version of the function is IRQ-safe.
1714 */ 1749 */
1715void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, 1750void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1716 u16 tid); 1751 u16 tid);
@@ -1718,7 +1753,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1718/** 1753/**
1719 * ieee80211_notify_mac - low level driver notification 1754 * ieee80211_notify_mac - low level driver notification
1720 * @hw: pointer as obtained from ieee80211_alloc_hw(). 1755 * @hw: pointer as obtained from ieee80211_alloc_hw().
1721 * @notification_types: enum ieee80211_notification_types 1756 * @notif_type: enum ieee80211_notification_types
1722 * 1757 *
1723 * This function must be called by low level driver to inform mac80211 of 1758 * 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 1759 * low level driver status change or force mac80211 to re-assoc for low
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index dc420fecafb9..aa4b708654a4 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -75,7 +75,7 @@ struct neigh_statistics
75 unsigned long destroys; /* number of destroyed neighs */ 75 unsigned long destroys; /* number of destroyed neighs */
76 unsigned long hash_grows; /* number of hash resizes */ 76 unsigned long hash_grows; /* number of hash resizes */
77 77
78 unsigned long res_failed; /* nomber of failed resolutions */ 78 unsigned long res_failed; /* number of failed resolutions */
79 79
80 unsigned long lookups; /* number of lookups */ 80 unsigned long lookups; /* number of lookups */
81 unsigned long hits; /* number of hits (among lookups) */ 81 unsigned long hits; /* number of hits (among lookups) */
@@ -85,6 +85,8 @@ struct neigh_statistics
85 85
86 unsigned long periodic_gc_runs; /* number of periodic GC runs */ 86 unsigned long periodic_gc_runs; /* number of periodic GC runs */
87 unsigned long forced_gc_runs; /* number of forced GC runs */ 87 unsigned long forced_gc_runs; /* number of forced GC runs */
88
89 unsigned long unres_discards; /* number of unresolved drops */
88}; 90};
89 91
90#define NEIGH_CACHE_STAT_INC(tbl, field) \ 92#define NEIGH_CACHE_STAT_INC(tbl, field) \
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..e4e30052e4e2 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,12 @@ 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 Qdisc *q);
84 88
85static inline void qdisc_run(struct net_device *dev) 89static inline void qdisc_run(struct Qdisc *q)
86{ 90{
87 if (!netif_queue_stopped(dev) && 91 if (!test_and_set_bit(__QDISC_STATE_RUNNING, &q->state))
88 !test_and_set_bit(__LINK_STATE_QDISC_RUNNING, &dev->state)) 92 __qdisc_run(q);
89 __qdisc_run(dev);
90} 93}
91 94
92extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, 95extern 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..0a158ff4de12 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -23,6 +23,12 @@ struct qdisc_rate_table
23 int refcnt; 23 int refcnt;
24}; 24};
25 25
26enum qdisc_state_t
27{
28 __QDISC_STATE_RUNNING,
29 __QDISC_STATE_SCHED,
30};
31
26struct Qdisc 32struct Qdisc
27{ 33{
28 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 34 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
@@ -36,14 +42,16 @@ struct Qdisc
36 u32 handle; 42 u32 handle;
37 u32 parent; 43 u32 parent;
38 atomic_t refcnt; 44 atomic_t refcnt;
45 unsigned long state;
46 struct sk_buff *gso_skb;
39 struct sk_buff_head q; 47 struct sk_buff_head q;
40 struct net_device *dev; 48 struct netdev_queue *dev_queue;
49 struct Qdisc *next_sched;
41 struct list_head list; 50 struct list_head list;
42 51
43 struct gnet_stats_basic bstats; 52 struct gnet_stats_basic bstats;
44 struct gnet_stats_queue qstats; 53 struct gnet_stats_queue qstats;
45 struct gnet_stats_rate_est rate_est; 54 struct gnet_stats_rate_est rate_est;
46 spinlock_t *stats_lock;
47 struct rcu_head q_rcu; 55 struct rcu_head q_rcu;
48 int (*reshape_fail)(struct sk_buff *skb, 56 int (*reshape_fail)(struct sk_buff *skb,
49 struct Qdisc *q); 57 struct Qdisc *q);
@@ -155,18 +163,86 @@ struct tcf_proto
155 struct tcf_proto_ops *ops; 163 struct tcf_proto_ops *ops;
156}; 164};
157 165
166static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
167{
168 return &qdisc->q.lock;
169}
170
171static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc)
172{
173 return qdisc->dev_queue->qdisc;
174}
175
176static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
177{
178 struct Qdisc *root = qdisc_root(qdisc);
179
180 return qdisc_lock(root);
181}
182
183static inline struct net_device *qdisc_dev(struct Qdisc *qdisc)
184{
185 return qdisc->dev_queue->dev;
186}
158 187
159extern void qdisc_lock_tree(struct net_device *dev); 188static inline void sch_tree_lock(struct Qdisc *q)
160extern void qdisc_unlock_tree(struct net_device *dev); 189{
190 spin_lock_bh(qdisc_root_lock(q));
191}
192
193static inline void sch_tree_unlock(struct Qdisc *q)
194{
195 spin_unlock_bh(qdisc_root_lock(q));
196}
161 197
162#define sch_tree_lock(q) qdisc_lock_tree((q)->dev) 198#define tcf_tree_lock(tp) sch_tree_lock((tp)->q)
163#define sch_tree_unlock(q) qdisc_unlock_tree((q)->dev) 199#define tcf_tree_unlock(tp) sch_tree_unlock((tp)->q)
164#define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev)
165#define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev)
166 200
167extern struct Qdisc noop_qdisc; 201extern struct Qdisc noop_qdisc;
168extern struct Qdisc_ops noop_qdisc_ops; 202extern struct Qdisc_ops noop_qdisc_ops;
169 203
204struct Qdisc_class_common
205{
206 u32 classid;
207 struct hlist_node hnode;
208};
209
210struct Qdisc_class_hash
211{
212 struct hlist_head *hash;
213 unsigned int hashsize;
214 unsigned int hashmask;
215 unsigned int hashelems;
216};
217
218static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
219{
220 id ^= id >> 8;
221 id ^= id >> 4;
222 return id & mask;
223}
224
225static inline struct Qdisc_class_common *
226qdisc_class_find(struct Qdisc_class_hash *hash, u32 id)
227{
228 struct Qdisc_class_common *cl;
229 struct hlist_node *n;
230 unsigned int h;
231
232 h = qdisc_class_hash(id, hash->hashmask);
233 hlist_for_each_entry(cl, n, &hash->hash[h], hnode) {
234 if (cl->classid == id)
235 return cl;
236 }
237 return NULL;
238}
239
240extern int qdisc_class_hash_init(struct Qdisc_class_hash *);
241extern void qdisc_class_hash_insert(struct Qdisc_class_hash *, struct Qdisc_class_common *);
242extern void qdisc_class_hash_remove(struct Qdisc_class_hash *, struct Qdisc_class_common *);
243extern void qdisc_class_hash_grow(struct Qdisc *, struct Qdisc_class_hash *);
244extern void qdisc_class_hash_destroy(struct Qdisc_class_hash *);
245
170extern void dev_init_scheduler(struct net_device *dev); 246extern void dev_init_scheduler(struct net_device *dev);
171extern void dev_shutdown(struct net_device *dev); 247extern void dev_shutdown(struct net_device *dev);
172extern void dev_activate(struct net_device *dev); 248extern void dev_activate(struct net_device *dev);
@@ -174,12 +250,60 @@ extern void dev_deactivate(struct net_device *dev);
174extern void qdisc_reset(struct Qdisc *qdisc); 250extern void qdisc_reset(struct Qdisc *qdisc);
175extern void qdisc_destroy(struct Qdisc *qdisc); 251extern void qdisc_destroy(struct Qdisc *qdisc);
176extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n); 252extern void qdisc_tree_decrease_qlen(struct Qdisc *qdisc, unsigned int n);
177extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); 253extern struct Qdisc *qdisc_alloc(struct netdev_queue *dev_queue,
254 struct Qdisc_ops *ops);
178extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, 255extern struct Qdisc *qdisc_create_dflt(struct net_device *dev,
256 struct netdev_queue *dev_queue,
179 struct Qdisc_ops *ops, u32 parentid); 257 struct Qdisc_ops *ops, u32 parentid);
180extern void tcf_destroy(struct tcf_proto *tp); 258extern void tcf_destroy(struct tcf_proto *tp);
181extern void tcf_destroy_chain(struct tcf_proto **fl); 259extern void tcf_destroy_chain(struct tcf_proto **fl);
182 260
261/* Reset all TX qdiscs of a device. */
262static inline void qdisc_reset_all_tx(struct net_device *dev)
263{
264 unsigned int i;
265 for (i = 0; i < dev->num_tx_queues; i++)
266 qdisc_reset(netdev_get_tx_queue(dev, i)->qdisc);
267}
268
269/* Are all TX queues of the device empty? */
270static inline bool qdisc_all_tx_empty(const struct net_device *dev)
271{
272 unsigned int i;
273 for (i = 0; i < dev->num_tx_queues; i++) {
274 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
275 const struct Qdisc *q = txq->qdisc;
276
277 if (q->q.qlen)
278 return false;
279 }
280 return true;
281}
282
283/* Are any of the TX qdiscs changing? */
284static inline bool qdisc_tx_changing(struct net_device *dev)
285{
286 unsigned int i;
287 for (i = 0; i < dev->num_tx_queues; i++) {
288 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
289 if (txq->qdisc != txq->qdisc_sleeping)
290 return true;
291 }
292 return false;
293}
294
295/* Is the device using the noop qdisc on all queues? */
296static inline bool qdisc_tx_is_noop(const struct net_device *dev)
297{
298 unsigned int i;
299 for (i = 0; i < dev->num_tx_queues; i++) {
300 struct netdev_queue *txq = netdev_get_tx_queue(dev, i);
301 if (txq->qdisc != &noop_qdisc)
302 return false;
303 }
304 return true;
305}
306
183static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch, 307static inline int __qdisc_enqueue_tail(struct sk_buff *skb, struct Qdisc *sch,
184 struct sk_buff_head *list) 308 struct sk_buff_head *list)
185{ 309{
@@ -250,7 +374,7 @@ static inline void __qdisc_reset_queue(struct Qdisc *sch,
250 * We do not know the backlog in bytes of this list, it 374 * We do not know the backlog in bytes of this list, it
251 * is up to the caller to correct it 375 * is up to the caller to correct it
252 */ 376 */
253 skb_queue_purge(list); 377 __skb_queue_purge(list);
254} 378}
255 379
256static inline void qdisc_reset_queue(struct Qdisc *sch) 380static inline void qdisc_reset_queue(struct Qdisc *sch)
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..06c5259aff30 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,
@@ -565,7 +565,7 @@ struct proto {
565#endif 565#endif
566 566
567 /* Memory pressure */ 567 /* Memory pressure */
568 void (*enter_memory_pressure)(void); 568 void (*enter_memory_pressure)(struct sock *sk);
569 atomic_t *memory_allocated; /* Current allocated memory. */ 569 atomic_t *memory_allocated; /* Current allocated memory. */
570 atomic_t *sockets_allocated; /* Current number of sockets. */ 570 atomic_t *sockets_allocated; /* Current number of sockets. */
571 /* 571 /*
@@ -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}
@@ -1205,7 +1210,7 @@ static inline struct page *sk_stream_alloc_page(struct sock *sk)
1205 1210
1206 page = alloc_pages(sk->sk_allocation, 0); 1211 page = alloc_pages(sk->sk_allocation, 0);
1207 if (!page) { 1212 if (!page) {
1208 sk->sk_prot->enter_memory_pressure(); 1213 sk->sk_prot->enter_memory_pressure(sk);
1209 sk_stream_moderate_sndbuf(sk); 1214 sk_stream_moderate_sndbuf(sk);
1210 } 1215 }
1211 return page; 1216 return page;
@@ -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..60e5be8b925b 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -266,12 +266,10 @@ static inline int tcp_too_many_orphans(struct sock *sk, int num)
266extern struct proto tcp_prot; 266extern struct proto tcp_prot;
267 267
268DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics); 268DECLARE_SNMP_STAT(struct tcp_mib, tcp_statistics);
269#define TCP_INC_STATS(field) SNMP_INC_STATS(tcp_statistics, field) 269#define TCP_INC_STATS(net, field) do { (void)net; SNMP_INC_STATS(tcp_statistics, field); } while (0)
270#define TCP_INC_STATS_BH(field) SNMP_INC_STATS_BH(tcp_statistics, field) 270#define TCP_INC_STATS_BH(net, field) do { (void)net; SNMP_INC_STATS_BH(tcp_statistics, field); } while (0)
271#define TCP_INC_STATS_USER(field) SNMP_INC_STATS_USER(tcp_statistics, field) 271#define TCP_DEC_STATS(net, field) do { (void)net; SNMP_DEC_STATS(tcp_statistics, field); } while (0)
272#define TCP_DEC_STATS(field) SNMP_DEC_STATS(tcp_statistics, field) 272#define TCP_ADD_STATS_USER(net, field, val) do { (void)net; SNMP_ADD_STATS_USER(tcp_statistics, field, val); } while (0)
273#define TCP_ADD_STATS_BH(field, val) SNMP_ADD_STATS_BH(tcp_statistics, field, val)
274#define TCP_ADD_STATS_USER(field, val) SNMP_ADD_STATS_USER(tcp_statistics, field, val)
275 273
276extern void tcp_v4_err(struct sk_buff *skb, u32); 274extern void tcp_v4_err(struct sk_buff *skb, u32);
277 275
@@ -398,6 +396,8 @@ extern void tcp_parse_options(struct sk_buff *skb,
398 struct tcp_options_received *opt_rx, 396 struct tcp_options_received *opt_rx,
399 int estab); 397 int estab);
400 398
399extern u8 *tcp_parse_md5sig_option(struct tcphdr *th);
400
401/* 401/*
402 * TCP v4 functions exported for the inet6 API 402 * TCP v4 functions exported for the inet6 API
403 */ 403 */
@@ -894,7 +894,7 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
894 894
895 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { 895 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
896 sk->sk_backlog_rcv(sk, skb1); 896 sk->sk_backlog_rcv(sk, skb1);
897 NET_INC_STATS_BH(LINUX_MIB_TCPPREQUEUEDROPPED); 897 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED);
898 } 898 }
899 899
900 tp->ucopy.memory = 0; 900 tp->ucopy.memory = 0;
@@ -975,7 +975,7 @@ static inline void tcp_openreq_init(struct request_sock *req,
975 ireq->rmt_port = tcp_hdr(skb)->source; 975 ireq->rmt_port = tcp_hdr(skb)->source;
976} 976}
977 977
978extern void tcp_enter_memory_pressure(void); 978extern void tcp_enter_memory_pressure(struct sock *sk);
979 979
980static inline int keepalive_intvl_when(const struct tcp_sock *tp) 980static inline int keepalive_intvl_when(const struct tcp_sock *tp)
981{ 981{
@@ -1024,13 +1024,13 @@ static inline int tcp_paws_check(const struct tcp_options_received *rx_opt, int
1024 1024
1025#define TCP_CHECK_TIMER(sk) do { } while (0) 1025#define TCP_CHECK_TIMER(sk) do { } while (0)
1026 1026
1027static inline void tcp_mib_init(void) 1027static inline void tcp_mib_init(struct net *net)
1028{ 1028{
1029 /* See RFC 2012 */ 1029 /* See RFC 2012 */
1030 TCP_ADD_STATS_USER(TCP_MIB_RTOALGORITHM, 1); 1030 TCP_ADD_STATS_USER(net, TCP_MIB_RTOALGORITHM, 1);
1031 TCP_ADD_STATS_USER(TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ); 1031 TCP_ADD_STATS_USER(net, TCP_MIB_RTOMIN, TCP_RTO_MIN*1000/HZ);
1032 TCP_ADD_STATS_USER(TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ); 1032 TCP_ADD_STATS_USER(net, TCP_MIB_RTOMAX, TCP_RTO_MAX*1000/HZ);
1033 TCP_ADD_STATS_USER(TCP_MIB_MAXCONN, -1); 1033 TCP_ADD_STATS_USER(net, TCP_MIB_MAXCONN, -1);
1034} 1034}
1035 1035
1036/* from STCP */ 1036/* from STCP */
@@ -1113,13 +1113,19 @@ struct tcp_md5sig_pool {
1113#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */ 1113#define TCP_MD5SIG_MAXKEYS (~(u32)0) /* really?! */
1114 1114
1115/* - functions */ 1115/* - functions */
1116extern int tcp_calc_md5_hash(char *md5_hash,
1117 struct tcp_md5sig_key *key,
1118 int bplen,
1119 struct tcphdr *th,
1120 unsigned int tcplen,
1121 struct tcp_md5sig_pool *hp);
1122
1116extern int tcp_v4_calc_md5_hash(char *md5_hash, 1123extern int tcp_v4_calc_md5_hash(char *md5_hash,
1117 struct tcp_md5sig_key *key, 1124 struct tcp_md5sig_key *key,
1118 struct sock *sk, 1125 struct sock *sk,
1119 struct dst_entry *dst, 1126 struct dst_entry *dst,
1120 struct request_sock *req, 1127 struct request_sock *req,
1121 struct tcphdr *th, 1128 struct tcphdr *th,
1122 int protocol,
1123 unsigned int tcplen); 1129 unsigned int tcplen);
1124extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1130extern struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk,
1125 struct sock *addr_sk); 1131 struct sock *addr_sk);
@@ -1132,6 +1138,16 @@ extern int tcp_v4_md5_do_add(struct sock *sk,
1132extern int tcp_v4_md5_do_del(struct sock *sk, 1138extern int tcp_v4_md5_do_del(struct sock *sk,
1133 __be32 addr); 1139 __be32 addr);
1134 1140
1141#ifdef CONFIG_TCP_MD5SIG
1142#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_keylen ? \
1143 &(struct tcp_md5sig_key) { \
1144 .key = (twsk)->tw_md5_key, \
1145 .keylen = (twsk)->tw_md5_keylen, \
1146 } : NULL)
1147#else
1148#define tcp_twsk_md5_key(twsk) NULL
1149#endif
1150
1135extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void); 1151extern struct tcp_md5sig_pool **tcp_alloc_md5sig_pool(void);
1136extern void tcp_free_md5sig_pool(void); 1152extern void tcp_free_md5sig_pool(void);
1137 1153
@@ -1348,7 +1364,7 @@ extern void tcp_proc_unregister(struct net *net, struct tcp_seq_afinfo *afinfo);
1348extern struct request_sock_ops tcp_request_sock_ops; 1364extern struct request_sock_ops tcp_request_sock_ops;
1349extern struct request_sock_ops tcp6_request_sock_ops; 1365extern struct request_sock_ops tcp6_request_sock_ops;
1350 1366
1351extern int tcp_v4_destroy_sock(struct sock *sk); 1367extern void tcp_v4_destroy_sock(struct sock *sk);
1352 1368
1353extern int tcp_v4_gso_send_check(struct sk_buff *skb); 1369extern int tcp_v4_gso_send_check(struct sk_buff *skb);
1354extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features); 1370extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
@@ -1369,7 +1385,6 @@ struct tcp_sock_af_ops {
1369 struct dst_entry *dst, 1385 struct dst_entry *dst,
1370 struct request_sock *req, 1386 struct request_sock *req,
1371 struct tcphdr *th, 1387 struct tcphdr *th,
1372 int protocol,
1373 unsigned int len); 1388 unsigned int len);
1374 int (*md5_add) (struct sock *sk, 1389 int (*md5_add) (struct sock *sk,
1375 struct sock *addr_sk, 1390 struct sock *addr_sk,
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
index 11105bcc4457..c54917cbfa48 100644
--- a/include/net/tipc/tipc_port.h
+++ b/include/net/tipc/tipc_port.h
@@ -2,7 +2,7 @@
2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports 2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports
3 * 3 *
4 * Copyright (c) 1994-2007, Ericsson AB 4 * Copyright (c) 1994-2007, Ericsson AB
5 * Copyright (c) 2005-2007, Wind River Systems 5 * Copyright (c) 2005-2008, 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
@@ -75,13 +75,7 @@ struct tipc_port {
75}; 75};
76 76
77 77
78/** 78struct tipc_port *tipc_createport_raw(void *usr_handle,
79 * tipc_createport_raw - create a native TIPC port and return it's reference
80 *
81 * Note: 'dispatcher' and 'wakeup' deliver a locked port.
82 */
83
84u32 tipc_createport_raw(void *usr_handle,
85 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *), 79 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *),
86 void (*wakeup)(struct tipc_port *), 80 void (*wakeup)(struct tipc_port *),
87 const u32 importance); 81 const u32 importance);
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/**