diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 21:02:35 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-18 21:02:35 -0400 |
commit | 334d094504c2fe1c44211ecb49146ae6bca8c321 (patch) | |
tree | d3c0f68e4b9f8e3d2ccc39e7dfe5de0534a5fad9 /include/linux | |
parent | d1a4be630fb068f251d64b62919f143c49ca8057 (diff) | |
parent | d1643d24c61b725bef399cc1cf2944b4c9c23177 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6.26: (1090 commits)
[NET]: Fix and allocate less memory for ->priv'less netdevices
[IPV6]: Fix dangling references on error in fib6_add().
[NETLABEL]: Fix NULL deref in netlbl_unlabel_staticlist_gen() if ifindex not found
[PKT_SCHED]: Fix datalen check in tcf_simp_init().
[INET]: Uninline the __inet_inherit_port call.
[INET]: Drop the inet_inherit_port() call.
SCTP: Initialize partial_bytes_acked to 0, when all of the data is acked.
[netdrvr] forcedeth: internal simplifications; changelog removal
phylib: factor out get_phy_id from within get_phy_device
PHY: add BCM5464 support to broadcom PHY driver
cxgb3: Fix __must_check warning with dev_dbg.
tc35815: Statistics cleanup
natsemi: fix MMIO for PPC 44x platforms
[TIPC]: Cleanup of TIPC reference table code
[TIPC]: Optimized initialization of TIPC reference table
[TIPC]: Remove inlining of reference table locking routines
e1000: convert uint16_t style integers to u16
ixgb: convert uint16_t style integers to u16
sb1000.c: make const arrays static
sb1000.c: stop inlining largish static functions
...
Diffstat (limited to 'include/linux')
46 files changed, 1472 insertions, 635 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index cedbbd806bf6..b3d9ccde0c27 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -231,7 +231,6 @@ unifdef-y += if_pppol2tp.h | |||
231 | unifdef-y += if_pppox.h | 231 | unifdef-y += if_pppox.h |
232 | unifdef-y += if_tr.h | 232 | unifdef-y += if_tr.h |
233 | unifdef-y += if_vlan.h | 233 | unifdef-y += if_vlan.h |
234 | unifdef-y += if_wanpipe.h | ||
235 | unifdef-y += igmp.h | 234 | unifdef-y += igmp.h |
236 | unifdef-y += inet_diag.h | 235 | unifdef-y += inet_diag.h |
237 | unifdef-y += in.h | 236 | unifdef-y += in.h |
@@ -261,6 +260,7 @@ unifdef-y += mempolicy.h | |||
261 | unifdef-y += mii.h | 260 | unifdef-y += mii.h |
262 | unifdef-y += mman.h | 261 | unifdef-y += mman.h |
263 | unifdef-y += mroute.h | 262 | unifdef-y += mroute.h |
263 | unifdef-y += mroute6.h | ||
264 | unifdef-y += msdos_fs.h | 264 | unifdef-y += msdos_fs.h |
265 | unifdef-y += msg.h | 265 | unifdef-y += msg.h |
266 | unifdef-y += nbd.h | 266 | unifdef-y += nbd.h |
@@ -289,6 +289,7 @@ unifdef-y += parport.h | |||
289 | unifdef-y += patchkey.h | 289 | unifdef-y += patchkey.h |
290 | unifdef-y += pci.h | 290 | unifdef-y += pci.h |
291 | unifdef-y += personality.h | 291 | unifdef-y += personality.h |
292 | unifdef-y += pim.h | ||
292 | unifdef-y += pktcdvd.h | 293 | unifdef-y += pktcdvd.h |
293 | unifdef-y += pmu.h | 294 | unifdef-y += pmu.h |
294 | unifdef-y += poll.h | 295 | unifdef-y += poll.h |
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h index fde675872c56..a1916078fd08 100644 --- a/include/linux/arcdevice.h +++ b/include/linux/arcdevice.h | |||
@@ -283,8 +283,8 @@ struct arcnet_local { | |||
283 | int next_buf, first_free_buf; | 283 | int next_buf, first_free_buf; |
284 | 284 | ||
285 | /* network "reconfiguration" handling */ | 285 | /* network "reconfiguration" handling */ |
286 | time_t first_recon, /* time of "first" RECON message to count */ | 286 | unsigned long first_recon; /* time of "first" RECON message to count */ |
287 | last_recon; /* time of most recent RECON */ | 287 | unsigned long last_recon; /* time of most recent RECON */ |
288 | int num_recons; /* number of RECONs between first and last. */ | 288 | int num_recons; /* number of RECONs between first and last. */ |
289 | bool network_down; /* do we think the network is down? */ | 289 | bool network_down; /* do we think the network is down? */ |
290 | 290 | ||
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index ced8a1ed080c..e9ebac2e2ecc 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
@@ -85,8 +85,6 @@ static inline struct atalk_sock *at_sk(struct sock *sk) | |||
85 | return (struct atalk_sock *)sk; | 85 | return (struct atalk_sock *)sk; |
86 | } | 86 | } |
87 | 87 | ||
88 | #include <asm/byteorder.h> | ||
89 | |||
90 | struct ddpehdr { | 88 | struct ddpehdr { |
91 | __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */ | 89 | __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */ |
92 | __be16 deh_sum; | 90 | __be16 deh_sum; |
diff --git a/include/linux/filter.h b/include/linux/filter.h index ddfa0372a3b7..b6ea9aa9e853 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -37,21 +37,6 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | |||
37 | struct sock_filter __user *filter; | 37 | struct sock_filter __user *filter; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | #ifdef __KERNEL__ | ||
41 | struct sk_filter | ||
42 | { | ||
43 | atomic_t refcnt; | ||
44 | unsigned int len; /* Number of filter blocks */ | ||
45 | struct rcu_head rcu; | ||
46 | struct sock_filter insns[0]; | ||
47 | }; | ||
48 | |||
49 | static inline unsigned int sk_filter_len(struct sk_filter *fp) | ||
50 | { | ||
51 | return fp->len*sizeof(struct sock_filter) + sizeof(*fp); | ||
52 | } | ||
53 | #endif | ||
54 | |||
55 | /* | 40 | /* |
56 | * Instruction classes | 41 | * Instruction classes |
57 | */ | 42 | */ |
@@ -136,15 +121,31 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp) | |||
136 | #define SKF_AD_PROTOCOL 0 | 121 | #define SKF_AD_PROTOCOL 0 |
137 | #define SKF_AD_PKTTYPE 4 | 122 | #define SKF_AD_PKTTYPE 4 |
138 | #define SKF_AD_IFINDEX 8 | 123 | #define SKF_AD_IFINDEX 8 |
139 | #define SKF_AD_MAX 12 | 124 | #define SKF_AD_NLATTR 12 |
125 | #define SKF_AD_MAX 16 | ||
140 | #define SKF_NET_OFF (-0x100000) | 126 | #define SKF_NET_OFF (-0x100000) |
141 | #define SKF_LL_OFF (-0x200000) | 127 | #define SKF_LL_OFF (-0x200000) |
142 | 128 | ||
143 | #ifdef __KERNEL__ | 129 | #ifdef __KERNEL__ |
130 | struct sk_filter | ||
131 | { | ||
132 | atomic_t refcnt; | ||
133 | unsigned int len; /* Number of filter blocks */ | ||
134 | struct rcu_head rcu; | ||
135 | struct sock_filter insns[0]; | ||
136 | }; | ||
137 | |||
138 | static inline unsigned int sk_filter_len(const struct sk_filter *fp) | ||
139 | { | ||
140 | return fp->len * sizeof(struct sock_filter) + sizeof(*fp); | ||
141 | } | ||
142 | |||
144 | struct sk_buff; | 143 | struct sk_buff; |
145 | struct sock; | 144 | struct sock; |
146 | 145 | ||
147 | extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); | 146 | extern int sk_filter(struct sock *sk, struct sk_buff *skb); |
147 | extern unsigned int sk_run_filter(struct sk_buff *skb, | ||
148 | struct sock_filter *filter, int flen); | ||
148 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 149 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
149 | extern int sk_detach_filter(struct sock *sk); | 150 | extern int sk_detach_filter(struct sock *sk); |
150 | extern int sk_chk_filter(struct sock_filter *filter, int flen); | 151 | extern int sk_chk_filter(struct sock_filter *filter, int flen); |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 1831b196c70a..2cad5c67397e 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -50,7 +50,7 @@ struct gianfar_platform_data { | |||
50 | u32 device_flags; | 50 | u32 device_flags; |
51 | /* board specific information */ | 51 | /* board specific information */ |
52 | u32 board_flags; | 52 | u32 board_flags; |
53 | u32 bus_id; | 53 | char bus_id[MII_BUS_ID_SIZE]; |
54 | u32 phy_id; | 54 | u32 phy_id; |
55 | u8 mac_addr[6]; | 55 | u8 mac_addr[6]; |
56 | phy_interface_t interface; | 56 | phy_interface_t interface; |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 7c5e9817e998..03067443198a 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -176,12 +176,21 @@ extern void icmpv6_send(struct sk_buff *skb, | |||
176 | __u32 info, | 176 | __u32 info, |
177 | struct net_device *dev); | 177 | struct net_device *dev); |
178 | 178 | ||
179 | extern int icmpv6_init(struct net_proto_family *ops); | 179 | extern int icmpv6_init(void); |
180 | extern int icmpv6_err_convert(int type, int code, | 180 | extern int icmpv6_err_convert(int type, int code, |
181 | int *err); | 181 | int *err); |
182 | extern void icmpv6_cleanup(void); | 182 | extern void icmpv6_cleanup(void); |
183 | extern void icmpv6_param_prob(struct sk_buff *skb, | 183 | extern void icmpv6_param_prob(struct sk_buff *skb, |
184 | int code, int pos); | 184 | int code, int pos); |
185 | |||
186 | struct flowi; | ||
187 | struct in6_addr; | ||
188 | extern void icmpv6_flow_init(struct sock *sk, | ||
189 | struct flowi *fl, | ||
190 | u8 type, | ||
191 | const struct in6_addr *saddr, | ||
192 | const struct in6_addr *daddr, | ||
193 | int oif); | ||
185 | #endif | 194 | #endif |
186 | 195 | ||
187 | #endif | 196 | #endif |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index f577c8f1c66d..f27d11ab418b 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -97,6 +97,7 @@ | |||
97 | #define IEEE80211_MAX_FRAME_LEN 2352 | 97 | #define IEEE80211_MAX_FRAME_LEN 2352 |
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 | 101 | ||
101 | struct ieee80211_hdr { | 102 | struct ieee80211_hdr { |
102 | __le16 frame_control; | 103 | __le16 frame_control; |
@@ -109,6 +110,16 @@ struct ieee80211_hdr { | |||
109 | } __attribute__ ((packed)); | 110 | } __attribute__ ((packed)); |
110 | 111 | ||
111 | 112 | ||
113 | struct ieee80211s_hdr { | ||
114 | u8 flags; | ||
115 | u8 ttl; | ||
116 | u8 seqnum[3]; | ||
117 | u8 eaddr1[6]; | ||
118 | u8 eaddr2[6]; | ||
119 | u8 eaddr3[6]; | ||
120 | } __attribute__ ((packed)); | ||
121 | |||
122 | |||
112 | struct ieee80211_mgmt { | 123 | struct ieee80211_mgmt { |
113 | __le16 frame_control; | 124 | __le16 frame_control; |
114 | __le16 duration; | 125 | __le16 duration; |
@@ -206,6 +217,23 @@ struct ieee80211_mgmt { | |||
206 | __le16 params; | 217 | __le16 params; |
207 | __le16 reason_code; | 218 | __le16 reason_code; |
208 | } __attribute__((packed)) delba; | 219 | } __attribute__((packed)) delba; |
220 | struct{ | ||
221 | u8 action_code; | ||
222 | /* capab_info for open and confirm, | ||
223 | * reason for close | ||
224 | */ | ||
225 | __le16 aux; | ||
226 | /* Followed in plink_confirm by status | ||
227 | * code, AID and supported rates, | ||
228 | * and directly by supported rates in | ||
229 | * plink_open and plink_close | ||
230 | */ | ||
231 | u8 variable[0]; | ||
232 | } __attribute__((packed)) plink_action; | ||
233 | struct{ | ||
234 | u8 action_code; | ||
235 | u8 variable[0]; | ||
236 | } __attribute__((packed)) mesh_action; | ||
209 | } u; | 237 | } u; |
210 | } __attribute__ ((packed)) action; | 238 | } __attribute__ ((packed)) action; |
211 | } u; | 239 | } u; |
@@ -437,6 +465,13 @@ enum ieee80211_eid { | |||
437 | WLAN_EID_TS_DELAY = 43, | 465 | WLAN_EID_TS_DELAY = 43, |
438 | WLAN_EID_TCLAS_PROCESSING = 44, | 466 | WLAN_EID_TCLAS_PROCESSING = 44, |
439 | WLAN_EID_QOS_CAPA = 46, | 467 | WLAN_EID_QOS_CAPA = 46, |
468 | /* 802.11s */ | ||
469 | WLAN_EID_MESH_CONFIG = 36, /* Pending IEEE 802.11 ANA approval */ | ||
470 | WLAN_EID_MESH_ID = 37, /* Pending IEEE 802.11 ANA approval */ | ||
471 | WLAN_EID_PEER_LINK = 40, /* Pending IEEE 802.11 ANA approval */ | ||
472 | WLAN_EID_PREQ = 53, /* Pending IEEE 802.11 ANA approval */ | ||
473 | WLAN_EID_PREP = 54, /* Pending IEEE 802.11 ANA approval */ | ||
474 | WLAN_EID_PERR = 55, /* Pending IEEE 802.11 ANA approval */ | ||
440 | /* 802.11h */ | 475 | /* 802.11h */ |
441 | WLAN_EID_PWR_CONSTRAINT = 32, | 476 | WLAN_EID_PWR_CONSTRAINT = 32, |
442 | WLAN_EID_PWR_CAPABILITY = 33, | 477 | WLAN_EID_PWR_CAPABILITY = 33, |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 296e8e86e91d..4d3401812e6c 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -156,6 +156,12 @@ static inline struct arphdr *arp_hdr(const struct sk_buff *skb) | |||
156 | { | 156 | { |
157 | return (struct arphdr *)skb_network_header(skb); | 157 | return (struct arphdr *)skb_network_header(skb); |
158 | } | 158 | } |
159 | |||
160 | static inline int arp_hdr_len(struct net_device *dev) | ||
161 | { | ||
162 | /* ARP header, plus 2 device addresses, plus 2 IP addresses. */ | ||
163 | return sizeof(struct arphdr) + (dev->addr_len + sizeof(u32)) * 2; | ||
164 | } | ||
159 | #endif | 165 | #endif |
160 | 166 | ||
161 | #endif /* _LINUX_IF_ARP_H */ | 167 | #endif /* _LINUX_IF_ARP_H */ |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 228eb4eb3129..f1fbe9c930d7 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -7,6 +7,10 @@ | |||
7 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) | 7 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) |
8 | #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2) | 8 | #define SIOCDELTUNNEL (SIOCDEVPRIVATE + 2) |
9 | #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3) | 9 | #define SIOCCHGTUNNEL (SIOCDEVPRIVATE + 3) |
10 | #define SIOCGETPRL (SIOCDEVPRIVATE + 4) | ||
11 | #define SIOCADDPRL (SIOCDEVPRIVATE + 5) | ||
12 | #define SIOCDELPRL (SIOCDEVPRIVATE + 6) | ||
13 | #define SIOCCHGPRL (SIOCDEVPRIVATE + 7) | ||
10 | 14 | ||
11 | #define GRE_CSUM __constant_htons(0x8000) | 15 | #define GRE_CSUM __constant_htons(0x8000) |
12 | #define GRE_ROUTING __constant_htons(0x4000) | 16 | #define GRE_ROUTING __constant_htons(0x4000) |
@@ -17,9 +21,6 @@ | |||
17 | #define GRE_FLAGS __constant_htons(0x00F8) | 21 | #define GRE_FLAGS __constant_htons(0x00F8) |
18 | #define GRE_VERSION __constant_htons(0x0007) | 22 | #define GRE_VERSION __constant_htons(0x0007) |
19 | 23 | ||
20 | /* i_flags values for SIT mode */ | ||
21 | #define SIT_ISATAP 0x0001 | ||
22 | |||
23 | struct ip_tunnel_parm | 24 | struct ip_tunnel_parm |
24 | { | 25 | { |
25 | char name[IFNAMSIZ]; | 26 | char name[IFNAMSIZ]; |
@@ -31,4 +32,19 @@ struct ip_tunnel_parm | |||
31 | struct iphdr iph; | 32 | struct iphdr iph; |
32 | }; | 33 | }; |
33 | 34 | ||
35 | /* SIT-mode i_flags */ | ||
36 | #define SIT_ISATAP 0x0001 | ||
37 | |||
38 | struct ip_tunnel_prl { | ||
39 | __be32 addr; | ||
40 | __u16 flags; | ||
41 | __u16 __reserved; | ||
42 | __u32 datalen; | ||
43 | __u32 __reserved2; | ||
44 | void __user *data; | ||
45 | }; | ||
46 | |||
47 | /* PRL flags */ | ||
48 | #define PRL_DEFAULT 0x0001 | ||
49 | |||
34 | #endif /* _IF_TUNNEL_H_ */ | 50 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 79504b22a932..15ace02b7b24 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -81,7 +81,9 @@ extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | |||
81 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) | 81 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) |
82 | 82 | ||
83 | struct vlan_group { | 83 | struct vlan_group { |
84 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ | 84 | struct net_device *real_dev; /* The ethernet(like) device |
85 | * the vlan is attached to. | ||
86 | */ | ||
85 | unsigned int nr_vlans; | 87 | unsigned int nr_vlans; |
86 | struct hlist_node hlist; /* linked list */ | 88 | struct hlist_node hlist; /* linked list */ |
87 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 89 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
@@ -93,7 +95,7 @@ static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, | |||
93 | { | 95 | { |
94 | struct net_device **array; | 96 | struct net_device **array; |
95 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | 97 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; |
96 | return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN]; | 98 | return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL; |
97 | } | 99 | } |
98 | 100 | ||
99 | static inline void vlan_group_set_device(struct vlan_group *vg, | 101 | static inline void vlan_group_set_device(struct vlan_group *vg, |
diff --git a/include/linux/if_wanpipe.h b/include/linux/if_wanpipe.h deleted file mode 100644 index e594ca6069e5..000000000000 --- a/include/linux/if_wanpipe.h +++ /dev/null | |||
@@ -1,124 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * if_wanpipe.h Header file for the Sangoma AF_WANPIPE Socket | ||
3 | * | ||
4 | * Author: Nenad Corbic | ||
5 | * | ||
6 | * Copyright: (c) 2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * | ||
14 | * Jan 28, 2000 Nenad Corbic Initial Version | ||
15 | * | ||
16 | *****************************************************************************/ | ||
17 | |||
18 | #ifndef __LINUX_IF_WAN_PACKET_H | ||
19 | #define __LINUX_IF_WAN_PACKET_H | ||
20 | |||
21 | struct wan_sockaddr_ll | ||
22 | { | ||
23 | unsigned short sll_family; | ||
24 | unsigned short sll_protocol; | ||
25 | int sll_ifindex; | ||
26 | unsigned short sll_hatype; | ||
27 | unsigned char sll_pkttype; | ||
28 | unsigned char sll_halen; | ||
29 | unsigned char sll_addr[8]; | ||
30 | unsigned char sll_device[14]; | ||
31 | unsigned char sll_card[14]; | ||
32 | }; | ||
33 | |||
34 | typedef struct | ||
35 | { | ||
36 | unsigned char free; | ||
37 | unsigned char state_sk; | ||
38 | int rcvbuf; | ||
39 | int sndbuf; | ||
40 | int rmem; | ||
41 | int wmem; | ||
42 | int sk_count; | ||
43 | unsigned char bound; | ||
44 | char name[14]; | ||
45 | unsigned char d_state; | ||
46 | unsigned char svc; | ||
47 | unsigned short lcn; | ||
48 | unsigned char mbox; | ||
49 | unsigned char cmd_busy; | ||
50 | unsigned char command; | ||
51 | unsigned poll; | ||
52 | unsigned poll_cnt; | ||
53 | int rblock; | ||
54 | } wan_debug_hdr_t; | ||
55 | |||
56 | #define MAX_NUM_DEBUG 10 | ||
57 | #define X25_PROT 0x16 | ||
58 | #define PVC_PROT 0x17 | ||
59 | |||
60 | typedef struct | ||
61 | { | ||
62 | wan_debug_hdr_t debug[MAX_NUM_DEBUG]; | ||
63 | }wan_debug_t; | ||
64 | |||
65 | #define SIOC_WANPIPE_GET_CALL_DATA (SIOCPROTOPRIVATE + 0) | ||
66 | #define SIOC_WANPIPE_SET_CALL_DATA (SIOCPROTOPRIVATE + 1) | ||
67 | #define SIOC_WANPIPE_ACCEPT_CALL (SIOCPROTOPRIVATE + 2) | ||
68 | #define SIOC_WANPIPE_CLEAR_CALL (SIOCPROTOPRIVATE + 3) | ||
69 | #define SIOC_WANPIPE_RESET_CALL (SIOCPROTOPRIVATE + 4) | ||
70 | #define SIOC_WANPIPE_DEBUG (SIOCPROTOPRIVATE + 5) | ||
71 | #define SIOC_WANPIPE_SET_NONBLOCK (SIOCPROTOPRIVATE + 6) | ||
72 | #define SIOC_WANPIPE_CHECK_TX (SIOCPROTOPRIVATE + 7) | ||
73 | #define SIOC_WANPIPE_SOCK_STATE (SIOCPROTOPRIVATE + 8) | ||
74 | |||
75 | /* Packet types */ | ||
76 | |||
77 | #define WAN_PACKET_HOST 0 /* To us */ | ||
78 | #define WAN_PACKET_BROADCAST 1 /* To all */ | ||
79 | #define WAN_PACKET_MULTICAST 2 /* To group */ | ||
80 | #define WAN_PACKET_OTHERHOST 3 /* To someone else */ | ||
81 | #define WAN_PACKET_OUTGOING 4 /* Outgoing of any type */ | ||
82 | /* These ones are invisible by user level */ | ||
83 | #define WAN_PACKET_LOOPBACK 5 /* MC/BRD frame looped back */ | ||
84 | #define WAN_PACKET_FASTROUTE 6 /* Fastrouted frame */ | ||
85 | |||
86 | |||
87 | /* X25 specific */ | ||
88 | #define WAN_PACKET_DATA 7 | ||
89 | #define WAN_PACKET_CMD 8 | ||
90 | #define WAN_PACKET_ASYNC 9 | ||
91 | #define WAN_PACKET_ERR 10 | ||
92 | |||
93 | /* Packet socket options */ | ||
94 | |||
95 | #define WAN_PACKET_ADD_MEMBERSHIP 1 | ||
96 | #define WAN_PACKET_DROP_MEMBERSHIP 2 | ||
97 | |||
98 | #define WAN_PACKET_MR_MULTICAST 0 | ||
99 | #define WAN_PACKET_MR_PROMISC 1 | ||
100 | #define WAN_PACKET_MR_ALLMULTI 2 | ||
101 | |||
102 | #ifdef __KERNEL__ | ||
103 | |||
104 | /* Private wanpipe socket structures. */ | ||
105 | struct wanpipe_opt | ||
106 | { | ||
107 | void *mbox; /* Mail box */ | ||
108 | void *card; /* Card bouded to */ | ||
109 | struct net_device *dev; /* Bounded device */ | ||
110 | unsigned short lcn; /* Binded LCN */ | ||
111 | unsigned char svc; /* 0=pvc, 1=svc */ | ||
112 | unsigned char timer; /* flag for delayed transmit*/ | ||
113 | struct timer_list tx_timer; | ||
114 | unsigned poll_cnt; | ||
115 | unsigned char force; /* Used to force sock release */ | ||
116 | atomic_t packet_sent; | ||
117 | unsigned short num; | ||
118 | }; | ||
119 | |||
120 | #define wp_sk(__sk) ((struct wanpipe_opt *)(__sk)->sk_protinfo) | ||
121 | |||
122 | #endif | ||
123 | |||
124 | #endif | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index f510e7e382a8..f5a1a0db2e8e 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -80,27 +80,6 @@ struct igmpv3_query { | |||
80 | __be32 srcs[0]; | 80 | __be32 srcs[0]; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | #ifdef __KERNEL__ | ||
84 | #include <linux/skbuff.h> | ||
85 | |||
86 | static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) | ||
87 | { | ||
88 | return (struct igmphdr *)skb_transport_header(skb); | ||
89 | } | ||
90 | |||
91 | static inline struct igmpv3_report * | ||
92 | igmpv3_report_hdr(const struct sk_buff *skb) | ||
93 | { | ||
94 | return (struct igmpv3_report *)skb_transport_header(skb); | ||
95 | } | ||
96 | |||
97 | static inline struct igmpv3_query * | ||
98 | igmpv3_query_hdr(const struct sk_buff *skb) | ||
99 | { | ||
100 | return (struct igmpv3_query *)skb_transport_header(skb); | ||
101 | } | ||
102 | #endif | ||
103 | |||
104 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ | 83 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ |
105 | #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ | 84 | #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ |
106 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ | 85 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ |
@@ -151,6 +130,23 @@ static inline struct igmpv3_query * | |||
151 | #include <linux/timer.h> | 130 | #include <linux/timer.h> |
152 | #include <linux/in.h> | 131 | #include <linux/in.h> |
153 | 132 | ||
133 | static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) | ||
134 | { | ||
135 | return (struct igmphdr *)skb_transport_header(skb); | ||
136 | } | ||
137 | |||
138 | static inline struct igmpv3_report * | ||
139 | igmpv3_report_hdr(const struct sk_buff *skb) | ||
140 | { | ||
141 | return (struct igmpv3_report *)skb_transport_header(skb); | ||
142 | } | ||
143 | |||
144 | static inline struct igmpv3_query * | ||
145 | igmpv3_query_hdr(const struct sk_buff *skb) | ||
146 | { | ||
147 | return (struct igmpv3_query *)skb_transport_header(skb); | ||
148 | } | ||
149 | |||
154 | extern int sysctl_igmp_max_memberships; | 150 | extern int sysctl_igmp_max_memberships; |
155 | extern int sysctl_igmp_max_msf; | 151 | extern int sysctl_igmp_max_msf; |
156 | 152 | ||
diff --git a/include/linux/in6.h b/include/linux/in6.h index 2a61c82af115..bc492048c349 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -48,6 +48,14 @@ extern const struct in6_addr in6addr_any; | |||
48 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } | 48 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } |
49 | extern const struct in6_addr in6addr_loopback; | 49 | extern const struct in6_addr in6addr_loopback; |
50 | #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } | 50 | #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } |
51 | #ifdef __KERNEL__ | ||
52 | extern const struct in6_addr in6addr_linklocal_allnodes; | ||
53 | #define IN6ADDR_LINKLOCAL_ALLNODES_INIT \ | ||
54 | { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } | ||
55 | extern const struct in6_addr in6addr_linklocal_allrouters; | ||
56 | #define IN6ADDR_LINKLOCAL_ALLROUTERS_INIT \ | ||
57 | { { { 0xff,2,0,0,0,0,0,0,0,0,0,0,0,0,0,2 } } } | ||
58 | #endif | ||
51 | 59 | ||
52 | struct sockaddr_in6 { | 60 | struct sockaddr_in6 { |
53 | unsigned short int sin6_family; /* AF_INET6 */ | 61 | unsigned short int sin6_family; /* AF_INET6 */ |
@@ -249,4 +257,30 @@ struct in6_flowlabel_req | |||
249 | * IP6T_SO_GET_REVISION_TARGET 69 | 257 | * IP6T_SO_GET_REVISION_TARGET 69 |
250 | */ | 258 | */ |
251 | 259 | ||
260 | /* RFC5014: Source address selection */ | ||
261 | #define IPV6_ADDR_PREFERENCES 72 | ||
262 | |||
263 | #define IPV6_PREFER_SRC_TMP 0x0001 | ||
264 | #define IPV6_PREFER_SRC_PUBLIC 0x0002 | ||
265 | #define IPV6_PREFER_SRC_PUBTMP_DEFAULT 0x0100 | ||
266 | #define IPV6_PREFER_SRC_COA 0x0004 | ||
267 | #define IPV6_PREFER_SRC_HOME 0x0400 | ||
268 | #define IPV6_PREFER_SRC_CGA 0x0008 | ||
269 | #define IPV6_PREFER_SRC_NONCGA 0x0800 | ||
270 | |||
271 | /* | ||
272 | * Multicast Routing: | ||
273 | * see include/linux/mroute6.h. | ||
274 | * | ||
275 | * MRT6_INIT 200 | ||
276 | * MRT6_DONE 201 | ||
277 | * MRT6_ADD_MIF 202 | ||
278 | * MRT6_DEL_MIF 203 | ||
279 | * MRT6_ADD_MFC 204 | ||
280 | * MRT6_DEL_MFC 205 | ||
281 | * MRT6_VERSION 206 | ||
282 | * MRT6_ASSERT 207 | ||
283 | * MRT6_PIM 208 | ||
284 | * (reserved) 209 | ||
285 | */ | ||
252 | #endif | 286 | #endif |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index fc4e3db649e8..7009b0cdd06f 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -70,13 +70,13 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
70 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) | 70 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) |
71 | 71 | ||
72 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 72 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
73 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) && \ | 73 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ |
74 | IN_DEV_CONF_GET((in_dev), attr)) | 74 | IN_DEV_CONF_GET((in_dev), attr)) |
75 | #define IN_DEV_ORCONF(in_dev, attr) \ | 75 | #define IN_DEV_ORCONF(in_dev, attr) \ |
76 | (IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr) || \ | 76 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) || \ |
77 | IN_DEV_CONF_GET((in_dev), attr)) | 77 | IN_DEV_CONF_GET((in_dev), attr)) |
78 | #define IN_DEV_MAXCONF(in_dev, attr) \ | 78 | #define IN_DEV_MAXCONF(in_dev, attr) \ |
79 | (max(IPV4_DEVCONF_ALL(in_dev->dev->nd_net, attr), \ | 79 | (max(IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr), \ |
80 | IN_DEV_CONF_GET((in_dev), attr))) | 80 | IN_DEV_CONF_GET((in_dev), attr))) |
81 | 81 | ||
82 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 82 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
@@ -129,7 +129,7 @@ extern int unregister_inetaddr_notifier(struct notifier_block *nb); | |||
129 | 129 | ||
130 | extern struct net_device *ip_dev_find(struct net *net, __be32 addr); | 130 | extern struct net_device *ip_dev_find(struct net *net, __be32 addr); |
131 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); | 131 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
132 | extern int devinet_ioctl(unsigned int cmd, void __user *); | 132 | extern int devinet_ioctl(struct net *net, unsigned int cmd, void __user *); |
133 | extern void devinet_init(void); | 133 | extern void devinet_init(void); |
134 | extern struct in_device *inetdev_by_index(struct net *, int); | 134 | extern struct in_device *inetdev_by_index(struct net *, int); |
135 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); | 135 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 134c8e5cf07c..10b666b61add 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -160,6 +160,9 @@ struct ipv6_devconf { | |||
160 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | 160 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD |
161 | __s32 optimistic_dad; | 161 | __s32 optimistic_dad; |
162 | #endif | 162 | #endif |
163 | #ifdef CONFIG_IPV6_MROUTE | ||
164 | __s32 mc_forwarding; | ||
165 | #endif | ||
163 | void *sysctl; | 166 | void *sysctl; |
164 | }; | 167 | }; |
165 | 168 | ||
@@ -190,6 +193,7 @@ enum { | |||
190 | DEVCONF_PROXY_NDP, | 193 | DEVCONF_PROXY_NDP, |
191 | DEVCONF_OPTIMISTIC_DAD, | 194 | DEVCONF_OPTIMISTIC_DAD, |
192 | DEVCONF_ACCEPT_SOURCE_ROUTE, | 195 | DEVCONF_ACCEPT_SOURCE_ROUTE, |
196 | DEVCONF_MC_FORWARDING, | ||
193 | DEVCONF_MAX | 197 | DEVCONF_MAX |
194 | }; | 198 | }; |
195 | 199 | ||
@@ -230,6 +234,7 @@ struct inet6_skb_parm { | |||
230 | #endif | 234 | #endif |
231 | 235 | ||
232 | #define IP6SKB_XFRM_TRANSFORMED 1 | 236 | #define IP6SKB_XFRM_TRANSFORMED 1 |
237 | #define IP6SKB_FORWARDED 2 | ||
233 | }; | 238 | }; |
234 | 239 | ||
235 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) | 240 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) |
@@ -274,8 +279,29 @@ struct ipv6_pinfo { | |||
274 | 279 | ||
275 | __be32 flow_label; | 280 | __be32 flow_label; |
276 | __u32 frag_size; | 281 | __u32 frag_size; |
277 | __s16 hop_limit; | 282 | |
278 | __s16 mcast_hops; | 283 | /* |
284 | * Packed in 16bits. | ||
285 | * Omit one shift by by putting the signed field at MSB. | ||
286 | */ | ||
287 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
288 | __s16 hop_limit:9; | ||
289 | __u16 __unused_1:7; | ||
290 | #else | ||
291 | __u16 __unused_1:7; | ||
292 | __s16 hop_limit:9; | ||
293 | #endif | ||
294 | |||
295 | #if defined(__BIG_ENDIAN_BITFIELD) | ||
296 | /* Packed in 16bits. */ | ||
297 | __s16 mcast_hops:9; | ||
298 | __u16 __unused_2:6, | ||
299 | mc_loop:1; | ||
300 | #else | ||
301 | __u16 mc_loop:1, | ||
302 | __unused_2:6; | ||
303 | __s16 mcast_hops:9; | ||
304 | #endif | ||
279 | int mcast_oif; | 305 | int mcast_oif; |
280 | 306 | ||
281 | /* pktoption flags */ | 307 | /* pktoption flags */ |
@@ -298,11 +324,14 @@ struct ipv6_pinfo { | |||
298 | } rxopt; | 324 | } rxopt; |
299 | 325 | ||
300 | /* sockopt flags */ | 326 | /* sockopt flags */ |
301 | __u8 mc_loop:1, | 327 | __u8 recverr:1, |
302 | recverr:1, | ||
303 | sndflow:1, | 328 | sndflow:1, |
304 | pmtudisc:2, | 329 | pmtudisc:2, |
305 | ipv6only:1; | 330 | ipv6only:1, |
331 | srcprefs:3; /* 001: prefer temporary address | ||
332 | * 010: prefer public address | ||
333 | * 100: prefer care-of address | ||
334 | */ | ||
306 | __u8 tclass; | 335 | __u8 tclass; |
307 | 336 | ||
308 | __u32 dst_cookie; | 337 | __u32 dst_cookie; |
@@ -315,9 +344,8 @@ struct ipv6_pinfo { | |||
315 | struct sk_buff *pktoptions; | 344 | struct sk_buff *pktoptions; |
316 | struct { | 345 | struct { |
317 | struct ipv6_txoptions *opt; | 346 | struct ipv6_txoptions *opt; |
318 | struct rt6_info *rt; | 347 | u8 hop_limit; |
319 | int hop_limit; | 348 | u8 tclass; |
320 | int tclass; | ||
321 | } cork; | 349 | } cork; |
322 | }; | 350 | }; |
323 | 351 | ||
@@ -458,7 +486,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
458 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 486 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |
459 | 487 | ||
460 | #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ | 488 | #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ |
461 | (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ | 489 | (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ |
462 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 490 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
463 | ((__sk)->sk_family == AF_INET6) && \ | 491 | ((__sk)->sk_family == AF_INET6) && \ |
464 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 492 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
@@ -466,7 +494,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
466 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 494 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
467 | 495 | ||
468 | #define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ | 496 | #define INET6_TW_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif) \ |
469 | (((__sk)->sk_hash == (__hash)) && ((__sk)->sk_net == (__net)) && \ | 497 | (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ |
470 | (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ | 498 | (*((__portpair *)&(inet_twsk(__sk)->tw_dport)) == (__ports)) && \ |
471 | ((__sk)->sk_family == PF_INET6) && \ | 499 | ((__sk)->sk_family == PF_INET6) && \ |
472 | (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ | 500 | (ipv6_addr_equal(&inet6_twsk(__sk)->tw_v6_daddr, (__saddr))) && \ |
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 9cb2855bb170..44cd663c53b6 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -16,14 +16,8 @@ | |||
16 | 16 | ||
17 | #include <linux/ioctl.h> | 17 | #include <linux/ioctl.h> |
18 | 18 | ||
19 | #ifdef CONFIG_COBALT_MICRO_SERVER | ||
20 | /* Save memory */ | ||
21 | #define ISDN_MAX_DRIVERS 2 | ||
22 | #define ISDN_MAX_CHANNELS 8 | ||
23 | #else | ||
24 | #define ISDN_MAX_DRIVERS 32 | 19 | #define ISDN_MAX_DRIVERS 32 |
25 | #define ISDN_MAX_CHANNELS 64 | 20 | #define ISDN_MAX_CHANNELS 64 |
26 | #endif | ||
27 | 21 | ||
28 | /* New ioctl-codes */ | 22 | /* New ioctl-codes */ |
29 | #define IIOCNETAIF _IO('I',1) | 23 | #define IIOCNETAIF _IO('I',1) |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 35a8277ec1bd..de4decfa1bfc 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -2,7 +2,11 @@ | |||
2 | #define __LINUX_MROUTE_H | 2 | #define __LINUX_MROUTE_H |
3 | 3 | ||
4 | #include <linux/sockios.h> | 4 | #include <linux/sockios.h> |
5 | #include <linux/types.h> | ||
6 | #ifdef __KERNEL__ | ||
5 | #include <linux/in.h> | 7 | #include <linux/in.h> |
8 | #endif | ||
9 | #include <linux/pim.h> | ||
6 | 10 | ||
7 | /* | 11 | /* |
8 | * Based on the MROUTING 3.5 defines primarily to keep | 12 | * Based on the MROUTING 3.5 defines primarily to keep |
@@ -210,27 +214,6 @@ struct mfc_cache | |||
210 | #define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */ | 214 | #define IGMPMSG_WHOLEPKT 3 /* For PIM Register processing */ |
211 | 215 | ||
212 | #ifdef __KERNEL__ | 216 | #ifdef __KERNEL__ |
213 | |||
214 | #define PIM_V1_VERSION __constant_htonl(0x10000000) | ||
215 | #define PIM_V1_REGISTER 1 | ||
216 | |||
217 | #define PIM_VERSION 2 | ||
218 | #define PIM_REGISTER 1 | ||
219 | |||
220 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) | ||
221 | |||
222 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ | ||
223 | |||
224 | struct pimreghdr | ||
225 | { | ||
226 | __u8 type; | ||
227 | __u8 reserved; | ||
228 | __be16 csum; | ||
229 | __be32 flags; | ||
230 | }; | ||
231 | |||
232 | extern int pim_rcv_v1(struct sk_buff *); | ||
233 | |||
234 | struct rtmsg; | 217 | struct rtmsg; |
235 | extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | 218 | extern int ipmr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); |
236 | #endif | 219 | #endif |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h new file mode 100644 index 000000000000..e7989593142b --- /dev/null +++ b/include/linux/mroute6.h | |||
@@ -0,0 +1,228 @@ | |||
1 | #ifndef __LINUX_MROUTE6_H | ||
2 | #define __LINUX_MROUTE6_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/sockios.h> | ||
6 | |||
7 | /* | ||
8 | * Based on the MROUTING 3.5 defines primarily to keep | ||
9 | * source compatibility with BSD. | ||
10 | * | ||
11 | * See the pim6sd code for the original history. | ||
12 | * | ||
13 | * Protocol Independent Multicast (PIM) data structures included | ||
14 | * Carlos Picoto (cap@di.fc.ul.pt) | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #define MRT6_BASE 200 | ||
19 | #define MRT6_INIT (MRT6_BASE) /* Activate the kernel mroute code */ | ||
20 | #define MRT6_DONE (MRT6_BASE+1) /* Shutdown the kernel mroute */ | ||
21 | #define MRT6_ADD_MIF (MRT6_BASE+2) /* Add a virtual interface */ | ||
22 | #define MRT6_DEL_MIF (MRT6_BASE+3) /* Delete a virtual interface */ | ||
23 | #define MRT6_ADD_MFC (MRT6_BASE+4) /* Add a multicast forwarding entry */ | ||
24 | #define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */ | ||
25 | #define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */ | ||
26 | #define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ | ||
27 | #define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ | ||
28 | |||
29 | #define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ | ||
30 | #define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) | ||
31 | #define SIOCGETRPF (SIOCPROTOPRIVATE+2) | ||
32 | |||
33 | #define MAXMIFS 32 | ||
34 | typedef unsigned long mifbitmap_t; /* User mode code depends on this lot */ | ||
35 | typedef unsigned short mifi_t; | ||
36 | #define ALL_MIFS ((mifi_t)(-1)) | ||
37 | |||
38 | #ifndef IF_SETSIZE | ||
39 | #define IF_SETSIZE 256 | ||
40 | #endif | ||
41 | |||
42 | typedef __u32 if_mask; | ||
43 | #define NIFBITS (sizeof(if_mask) * 8) /* bits per mask */ | ||
44 | |||
45 | #if !defined(__KERNEL__) && !defined(DIV_ROUND_UP) | ||
46 | #define DIV_ROUND_UP(x,y) (((x) + ((y) - 1)) / (y)) | ||
47 | #endif | ||
48 | |||
49 | typedef struct if_set { | ||
50 | if_mask ifs_bits[DIV_ROUND_UP(IF_SETSIZE, NIFBITS)]; | ||
51 | } if_set; | ||
52 | |||
53 | #define IF_SET(n, p) ((p)->ifs_bits[(n)/NIFBITS] |= (1 << ((n) % NIFBITS))) | ||
54 | #define IF_CLR(n, p) ((p)->ifs_bits[(n)/NIFBITS] &= ~(1 << ((n) % NIFBITS))) | ||
55 | #define IF_ISSET(n, p) ((p)->ifs_bits[(n)/NIFBITS] & (1 << ((n) % NIFBITS))) | ||
56 | #define IF_COPY(f, t) bcopy(f, t, sizeof(*(f))) | ||
57 | #define IF_ZERO(p) bzero(p, sizeof(*(p))) | ||
58 | |||
59 | /* | ||
60 | * Passed by mrouted for an MRT_ADD_MIF - again we use the | ||
61 | * mrouted 3.6 structures for compatibility | ||
62 | */ | ||
63 | |||
64 | struct mif6ctl { | ||
65 | mifi_t mif6c_mifi; /* Index of MIF */ | ||
66 | unsigned char mif6c_flags; /* MIFF_ flags */ | ||
67 | unsigned char vifc_threshold; /* ttl limit */ | ||
68 | u_short mif6c_pifi; /* the index of the physical IF */ | ||
69 | unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ | ||
70 | }; | ||
71 | |||
72 | #define MIFF_REGISTER 0x1 /* register vif */ | ||
73 | |||
74 | /* | ||
75 | * Cache manipulation structures for mrouted and PIMd | ||
76 | */ | ||
77 | |||
78 | struct mf6cctl | ||
79 | { | ||
80 | struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */ | ||
81 | struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */ | ||
82 | mifi_t mf6cc_parent; /* Where it arrived */ | ||
83 | struct if_set mf6cc_ifset; /* Where it is going */ | ||
84 | }; | ||
85 | |||
86 | /* | ||
87 | * Group count retrieval for pim6sd | ||
88 | */ | ||
89 | |||
90 | struct sioc_sg_req6 | ||
91 | { | ||
92 | struct sockaddr_in6 src; | ||
93 | struct sockaddr_in6 grp; | ||
94 | unsigned long pktcnt; | ||
95 | unsigned long bytecnt; | ||
96 | unsigned long wrong_if; | ||
97 | }; | ||
98 | |||
99 | /* | ||
100 | * To get vif packet counts | ||
101 | */ | ||
102 | |||
103 | struct sioc_mif_req6 | ||
104 | { | ||
105 | mifi_t mifi; /* Which iface */ | ||
106 | unsigned long icount; /* In packets */ | ||
107 | unsigned long ocount; /* Out packets */ | ||
108 | unsigned long ibytes; /* In bytes */ | ||
109 | unsigned long obytes; /* Out bytes */ | ||
110 | }; | ||
111 | |||
112 | /* | ||
113 | * That's all usermode folks | ||
114 | */ | ||
115 | |||
116 | #ifdef __KERNEL__ | ||
117 | |||
118 | #include <linux/skbuff.h> /* for struct sk_buff_head */ | ||
119 | |||
120 | #ifdef CONFIG_IPV6_MROUTE | ||
121 | static inline int ip6_mroute_opt(int opt) | ||
122 | { | ||
123 | return (opt >= MRT6_BASE) && (opt <= MRT6_BASE + 10); | ||
124 | } | ||
125 | #else | ||
126 | static inline int ip6_mroute_opt(int opt) | ||
127 | { | ||
128 | return 0; | ||
129 | } | ||
130 | #endif | ||
131 | |||
132 | struct sock; | ||
133 | |||
134 | extern int ip6_mroute_setsockopt(struct sock *, int, char __user *, int); | ||
135 | extern int ip6_mroute_getsockopt(struct sock *, int, char __user *, int __user *); | ||
136 | extern int ip6_mr_input(struct sk_buff *skb); | ||
137 | extern int ip6mr_ioctl(struct sock *sk, int cmd, void __user *arg); | ||
138 | extern void ip6_mr_init(void); | ||
139 | |||
140 | struct mif_device | ||
141 | { | ||
142 | struct net_device *dev; /* Device we are using */ | ||
143 | unsigned long bytes_in,bytes_out; | ||
144 | unsigned long pkt_in,pkt_out; /* Statistics */ | ||
145 | unsigned long rate_limit; /* Traffic shaping (NI) */ | ||
146 | unsigned char threshold; /* TTL threshold */ | ||
147 | unsigned short flags; /* Control flags */ | ||
148 | int link; /* Physical interface index */ | ||
149 | }; | ||
150 | |||
151 | #define VIFF_STATIC 0x8000 | ||
152 | |||
153 | struct mfc6_cache | ||
154 | { | ||
155 | struct mfc6_cache *next; /* Next entry on cache line */ | ||
156 | struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ | ||
157 | struct in6_addr mf6c_origin; /* Source of packet */ | ||
158 | mifi_t mf6c_parent; /* Source interface */ | ||
159 | int mfc_flags; /* Flags on line */ | ||
160 | |||
161 | union { | ||
162 | struct { | ||
163 | unsigned long expires; | ||
164 | struct sk_buff_head unresolved; /* Unresolved buffers */ | ||
165 | } unres; | ||
166 | struct { | ||
167 | unsigned long last_assert; | ||
168 | int minvif; | ||
169 | int maxvif; | ||
170 | unsigned long bytes; | ||
171 | unsigned long pkt; | ||
172 | unsigned long wrong_if; | ||
173 | unsigned char ttls[MAXMIFS]; /* TTL thresholds */ | ||
174 | } res; | ||
175 | } mfc_un; | ||
176 | }; | ||
177 | |||
178 | #define MFC_STATIC 1 | ||
179 | #define MFC_NOTIFY 2 | ||
180 | |||
181 | #define MFC6_LINES 64 | ||
182 | |||
183 | #define MFC6_HASH(a, g) (((__force u32)(a)->s6_addr32[0] ^ \ | ||
184 | (__force u32)(a)->s6_addr32[1] ^ \ | ||
185 | (__force u32)(a)->s6_addr32[2] ^ \ | ||
186 | (__force u32)(a)->s6_addr32[3] ^ \ | ||
187 | (__force u32)(g)->s6_addr32[0] ^ \ | ||
188 | (__force u32)(g)->s6_addr32[1] ^ \ | ||
189 | (__force u32)(g)->s6_addr32[2] ^ \ | ||
190 | (__force u32)(g)->s6_addr32[3]) % MFC6_LINES) | ||
191 | |||
192 | #define MFC_ASSERT_THRESH (3*HZ) /* Maximal freq. of asserts */ | ||
193 | |||
194 | #endif | ||
195 | |||
196 | #ifdef __KERNEL__ | ||
197 | struct rtmsg; | ||
198 | extern int ip6mr_get_route(struct sk_buff *skb, struct rtmsg *rtm, int nowait); | ||
199 | |||
200 | #ifdef CONFIG_IPV6_MROUTE | ||
201 | extern struct sock *mroute6_socket; | ||
202 | extern int ip6mr_sk_done(struct sock *sk); | ||
203 | #else | ||
204 | #define mroute6_socket NULL | ||
205 | static inline int ip6mr_sk_done(struct sock *sk) { return 0; } | ||
206 | #endif | ||
207 | #endif | ||
208 | |||
209 | /* | ||
210 | * Structure used to communicate from kernel to multicast router. | ||
211 | * We'll overlay the structure onto an MLD header (not an IPv6 heder like igmpmsg{} | ||
212 | * used for IPv4 implementation). This is because this structure will be passed via an | ||
213 | * IPv6 raw socket, on wich an application will only receiver the payload i.e the data after | ||
214 | * the IPv6 header and all the extension headers. (See section 3 of RFC 3542) | ||
215 | */ | ||
216 | |||
217 | struct mrt6msg { | ||
218 | #define MRT6MSG_NOCACHE 1 | ||
219 | #define MRT6MSG_WRONGMIF 2 | ||
220 | #define MRT6MSG_WHOLEPKT 3 /* used for use level encap */ | ||
221 | __u8 im6_mbz; /* must be zero */ | ||
222 | __u8 im6_msgtype; /* what type of message */ | ||
223 | __u16 im6_mif; /* mif rec'd on */ | ||
224 | __u32 im6_pad; /* padding for 64 bit arch */ | ||
225 | struct in6_addr im6_src, im6_dst; | ||
226 | }; | ||
227 | |||
228 | #endif | ||
diff --git a/include/linux/net.h b/include/linux/net.h index c414d90e647b..71f7dd559285 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define _LINUX_NET_H | 19 | #define _LINUX_NET_H |
20 | 20 | ||
21 | #include <linux/wait.h> | 21 | #include <linux/wait.h> |
22 | #include <linux/socket.h> | ||
22 | #include <asm/socket.h> | 23 | #include <asm/socket.h> |
23 | 24 | ||
24 | struct poll_table_struct; | 25 | struct poll_table_struct; |
@@ -26,7 +27,7 @@ struct pipe_inode_info; | |||
26 | struct inode; | 27 | struct inode; |
27 | struct net; | 28 | struct net; |
28 | 29 | ||
29 | #define NPROTO 34 /* should be enough for now.. */ | 30 | #define NPROTO AF_MAX |
30 | 31 | ||
31 | #define SYS_SOCKET 1 /* sys_socket(2) */ | 32 | #define SYS_SOCKET 1 /* sys_socket(2) */ |
32 | #define SYS_BIND 2 /* sys_bind(2) */ | 33 | #define SYS_BIND 2 /* sys_bind(2) */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ee81906b5164..7c1d4466583b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -710,8 +710,10 @@ struct net_device | |||
710 | void (*poll_controller)(struct net_device *dev); | 710 | void (*poll_controller)(struct net_device *dev); |
711 | #endif | 711 | #endif |
712 | 712 | ||
713 | #ifdef CONFIG_NET_NS | ||
713 | /* Network namespace this network device is inside */ | 714 | /* Network namespace this network device is inside */ |
714 | struct net *nd_net; | 715 | struct net *nd_net; |
716 | #endif | ||
715 | 717 | ||
716 | /* bridge stuff */ | 718 | /* bridge stuff */ |
717 | struct net_bridge_port *br_port; | 719 | struct net_bridge_port *br_port; |
@@ -726,6 +728,10 @@ struct net_device | |||
726 | /* rtnetlink link ops */ | 728 | /* rtnetlink link ops */ |
727 | const struct rtnl_link_ops *rtnl_link_ops; | 729 | const struct rtnl_link_ops *rtnl_link_ops; |
728 | 730 | ||
731 | /* for setting kernel sock attribute on TCP connection setup */ | ||
732 | #define GSO_MAX_SIZE 65536 | ||
733 | unsigned int gso_max_size; | ||
734 | |||
729 | /* The TX queue control structures */ | 735 | /* The TX queue control structures */ |
730 | unsigned int egress_subqueue_count; | 736 | unsigned int egress_subqueue_count; |
731 | struct net_device_subqueue egress_subqueue[1]; | 737 | struct net_device_subqueue egress_subqueue[1]; |
@@ -735,6 +741,28 @@ struct net_device | |||
735 | #define NETDEV_ALIGN 32 | 741 | #define NETDEV_ALIGN 32 |
736 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) | 742 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) |
737 | 743 | ||
744 | /* | ||
745 | * Net namespace inlines | ||
746 | */ | ||
747 | static inline | ||
748 | struct net *dev_net(const struct net_device *dev) | ||
749 | { | ||
750 | #ifdef CONFIG_NET_NS | ||
751 | return dev->nd_net; | ||
752 | #else | ||
753 | return &init_net; | ||
754 | #endif | ||
755 | } | ||
756 | |||
757 | static inline | ||
758 | void dev_net_set(struct net_device *dev, struct net *net) | ||
759 | { | ||
760 | #ifdef CONFIG_NET_NS | ||
761 | release_net(dev->nd_net); | ||
762 | dev->nd_net = hold_net(net); | ||
763 | #endif | ||
764 | } | ||
765 | |||
738 | /** | 766 | /** |
739 | * netdev_priv - access network device private data | 767 | * netdev_priv - access network device private data |
740 | * @dev: network device | 768 | * @dev: network device |
@@ -811,7 +839,7 @@ static inline struct net_device *next_net_device(struct net_device *dev) | |||
811 | struct list_head *lh; | 839 | struct list_head *lh; |
812 | struct net *net; | 840 | struct net *net; |
813 | 841 | ||
814 | net = dev->nd_net; | 842 | net = dev_net(dev); |
815 | lh = dev->dev_list.next; | 843 | lh = dev->dev_list.next; |
816 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | 844 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); |
817 | } | 845 | } |
@@ -1479,6 +1507,12 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
1479 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 1507 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
1480 | } | 1508 | } |
1481 | 1509 | ||
1510 | static inline void netif_set_gso_max_size(struct net_device *dev, | ||
1511 | unsigned int size) | ||
1512 | { | ||
1513 | dev->gso_max_size = size; | ||
1514 | } | ||
1515 | |||
1482 | /* On bonding slaves other than the currently active slave, suppress | 1516 | /* On bonding slaves other than the currently active slave, suppress |
1483 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 1517 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
1484 | * ARP on active-backup slaves with arp_validate enabled. | 1518 | * ARP on active-backup slaves with arp_validate enabled. |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index f0680c2bee73..e4c66593b5c6 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -6,11 +6,13 @@ | |||
6 | #include <linux/types.h> | 6 | #include <linux/types.h> |
7 | #include <linux/skbuff.h> | 7 | #include <linux/skbuff.h> |
8 | #include <linux/net.h> | 8 | #include <linux/net.h> |
9 | #include <linux/netdevice.h> | ||
9 | #include <linux/if.h> | 10 | #include <linux/if.h> |
10 | #include <linux/in.h> | 11 | #include <linux/in.h> |
11 | #include <linux/in6.h> | 12 | #include <linux/in6.h> |
12 | #include <linux/wait.h> | 13 | #include <linux/wait.h> |
13 | #include <linux/list.h> | 14 | #include <linux/list.h> |
15 | #include <net/net_namespace.h> | ||
14 | #endif | 16 | #endif |
15 | #include <linux/compiler.h> | 17 | #include <linux/compiler.h> |
16 | 18 | ||
@@ -61,13 +63,21 @@ union nf_inet_addr { | |||
61 | #ifdef __KERNEL__ | 63 | #ifdef __KERNEL__ |
62 | #ifdef CONFIG_NETFILTER | 64 | #ifdef CONFIG_NETFILTER |
63 | 65 | ||
66 | static inline int nf_inet_addr_cmp(const union nf_inet_addr *a1, | ||
67 | const union nf_inet_addr *a2) | ||
68 | { | ||
69 | return a1->all[0] == a2->all[0] && | ||
70 | a1->all[1] == a2->all[1] && | ||
71 | a1->all[2] == a2->all[2] && | ||
72 | a1->all[3] == a2->all[3]; | ||
73 | } | ||
74 | |||
64 | extern void netfilter_init(void); | 75 | extern void netfilter_init(void); |
65 | 76 | ||
66 | /* Largest hook number + 1 */ | 77 | /* Largest hook number + 1 */ |
67 | #define NF_MAX_HOOKS 8 | 78 | #define NF_MAX_HOOKS 8 |
68 | 79 | ||
69 | struct sk_buff; | 80 | struct sk_buff; |
70 | struct net_device; | ||
71 | 81 | ||
72 | typedef unsigned int nf_hookfn(unsigned int hooknum, | 82 | typedef unsigned int nf_hookfn(unsigned int hooknum, |
73 | struct sk_buff *skb, | 83 | struct sk_buff *skb, |
@@ -224,6 +234,11 @@ struct nf_afinfo { | |||
224 | unsigned short family; | 234 | unsigned short family; |
225 | __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, | 235 | __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook, |
226 | unsigned int dataoff, u_int8_t protocol); | 236 | unsigned int dataoff, u_int8_t protocol); |
237 | __sum16 (*checksum_partial)(struct sk_buff *skb, | ||
238 | unsigned int hook, | ||
239 | unsigned int dataoff, | ||
240 | unsigned int len, | ||
241 | u_int8_t protocol); | ||
227 | int (*route)(struct dst_entry **dst, struct flowi *fl); | 242 | int (*route)(struct dst_entry **dst, struct flowi *fl); |
228 | void (*saveroute)(const struct sk_buff *skb, | 243 | void (*saveroute)(const struct sk_buff *skb, |
229 | struct nf_queue_entry *entry); | 244 | struct nf_queue_entry *entry); |
@@ -253,6 +268,23 @@ nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, | |||
253 | return csum; | 268 | return csum; |
254 | } | 269 | } |
255 | 270 | ||
271 | static inline __sum16 | ||
272 | nf_checksum_partial(struct sk_buff *skb, unsigned int hook, | ||
273 | unsigned int dataoff, unsigned int len, | ||
274 | u_int8_t protocol, unsigned short family) | ||
275 | { | ||
276 | const struct nf_afinfo *afinfo; | ||
277 | __sum16 csum = 0; | ||
278 | |||
279 | rcu_read_lock(); | ||
280 | afinfo = nf_get_afinfo(family); | ||
281 | if (afinfo) | ||
282 | csum = afinfo->checksum_partial(skb, hook, dataoff, len, | ||
283 | protocol); | ||
284 | rcu_read_unlock(); | ||
285 | return csum; | ||
286 | } | ||
287 | |||
256 | extern int nf_register_afinfo(const struct nf_afinfo *afinfo); | 288 | extern int nf_register_afinfo(const struct nf_afinfo *afinfo); |
257 | extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); | 289 | extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); |
258 | 290 | ||
@@ -311,5 +343,56 @@ extern void (*nf_ct_destroy)(struct nf_conntrack *); | |||
311 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | 343 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
312 | #endif | 344 | #endif |
313 | 345 | ||
346 | static inline struct net *nf_pre_routing_net(const struct net_device *in, | ||
347 | const struct net_device *out) | ||
348 | { | ||
349 | #ifdef CONFIG_NET_NS | ||
350 | return in->nd_net; | ||
351 | #else | ||
352 | return &init_net; | ||
353 | #endif | ||
354 | } | ||
355 | |||
356 | static inline struct net *nf_local_in_net(const struct net_device *in, | ||
357 | const struct net_device *out) | ||
358 | { | ||
359 | #ifdef CONFIG_NET_NS | ||
360 | return in->nd_net; | ||
361 | #else | ||
362 | return &init_net; | ||
363 | #endif | ||
364 | } | ||
365 | |||
366 | static inline struct net *nf_forward_net(const struct net_device *in, | ||
367 | const struct net_device *out) | ||
368 | { | ||
369 | #ifdef CONFIG_NET_NS | ||
370 | BUG_ON(in->nd_net != out->nd_net); | ||
371 | return in->nd_net; | ||
372 | #else | ||
373 | return &init_net; | ||
374 | #endif | ||
375 | } | ||
376 | |||
377 | static inline struct net *nf_local_out_net(const struct net_device *in, | ||
378 | const struct net_device *out) | ||
379 | { | ||
380 | #ifdef CONFIG_NET_NS | ||
381 | return out->nd_net; | ||
382 | #else | ||
383 | return &init_net; | ||
384 | #endif | ||
385 | } | ||
386 | |||
387 | static inline struct net *nf_post_routing_net(const struct net_device *in, | ||
388 | const struct net_device *out) | ||
389 | { | ||
390 | #ifdef CONFIG_NET_NS | ||
391 | return out->nd_net; | ||
392 | #else | ||
393 | return &init_net; | ||
394 | #endif | ||
395 | } | ||
396 | |||
314 | #endif /*__KERNEL__*/ | 397 | #endif /*__KERNEL__*/ |
315 | #endif /*__LINUX_NETFILTER_H*/ | 398 | #endif /*__LINUX_NETFILTER_H*/ |
diff --git a/include/linux/netfilter/nf_conntrack_dccp.h b/include/linux/netfilter/nf_conntrack_dccp.h new file mode 100644 index 000000000000..40dcc82058d1 --- /dev/null +++ b/include/linux/netfilter/nf_conntrack_dccp.h | |||
@@ -0,0 +1,40 @@ | |||
1 | #ifndef _NF_CONNTRACK_DCCP_H | ||
2 | #define _NF_CONNTRACK_DCCP_H | ||
3 | |||
4 | /* Exposed to userspace over nfnetlink */ | ||
5 | enum ct_dccp_states { | ||
6 | CT_DCCP_NONE, | ||
7 | CT_DCCP_REQUEST, | ||
8 | CT_DCCP_RESPOND, | ||
9 | CT_DCCP_PARTOPEN, | ||
10 | CT_DCCP_OPEN, | ||
11 | CT_DCCP_CLOSEREQ, | ||
12 | CT_DCCP_CLOSING, | ||
13 | CT_DCCP_TIMEWAIT, | ||
14 | CT_DCCP_IGNORE, | ||
15 | CT_DCCP_INVALID, | ||
16 | __CT_DCCP_MAX | ||
17 | }; | ||
18 | #define CT_DCCP_MAX (__CT_DCCP_MAX - 1) | ||
19 | |||
20 | enum ct_dccp_roles { | ||
21 | CT_DCCP_ROLE_CLIENT, | ||
22 | CT_DCCP_ROLE_SERVER, | ||
23 | __CT_DCCP_ROLE_MAX | ||
24 | }; | ||
25 | #define CT_DCCP_ROLE_MAX (__CT_DCCP_ROLE_MAX - 1) | ||
26 | |||
27 | #ifdef __KERNEL__ | ||
28 | #include <net/netfilter/nf_conntrack_tuple.h> | ||
29 | |||
30 | struct nf_ct_dccp { | ||
31 | u_int8_t role[IP_CT_DIR_MAX]; | ||
32 | u_int8_t state; | ||
33 | u_int8_t last_pkt; | ||
34 | u_int8_t last_dir; | ||
35 | u_int64_t handshake_seq; | ||
36 | }; | ||
37 | |||
38 | #endif /* __KERNEL__ */ | ||
39 | |||
40 | #endif /* _NF_CONNTRACK_DCCP_H */ | ||
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 8e5ce1ca7bfc..5da04e586a3f 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
@@ -5,37 +5,164 @@ | |||
5 | #define SIP_PORT 5060 | 5 | #define SIP_PORT 5060 |
6 | #define SIP_TIMEOUT 3600 | 6 | #define SIP_TIMEOUT 3600 |
7 | 7 | ||
8 | enum sip_header_pos { | 8 | struct nf_ct_sip_master { |
9 | POS_REG_REQ_URI, | 9 | unsigned int register_cseq; |
10 | POS_REQ_URI, | 10 | }; |
11 | POS_FROM, | 11 | |
12 | POS_TO, | 12 | enum sip_expectation_classes { |
13 | POS_VIA, | 13 | SIP_EXPECT_SIGNALLING, |
14 | POS_CONTACT, | 14 | SIP_EXPECT_AUDIO, |
15 | POS_CONTENT, | 15 | SIP_EXPECT_VIDEO, |
16 | POS_MEDIA, | 16 | __SIP_EXPECT_MAX |
17 | POS_OWNER_IP4, | 17 | }; |
18 | POS_CONNECTION_IP4, | 18 | #define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) |
19 | POS_OWNER_IP6, | 19 | |
20 | POS_CONNECTION_IP6, | 20 | struct sdp_media_type { |
21 | POS_SDP_HEADER, | 21 | const char *name; |
22 | unsigned int len; | ||
23 | enum sip_expectation_classes class; | ||
24 | }; | ||
25 | |||
26 | #define SDP_MEDIA_TYPE(__name, __class) \ | ||
27 | { \ | ||
28 | .name = (__name), \ | ||
29 | .len = sizeof(__name) - 1, \ | ||
30 | .class = (__class), \ | ||
31 | } | ||
32 | |||
33 | struct sip_handler { | ||
34 | const char *method; | ||
35 | unsigned int len; | ||
36 | int (*request)(struct sk_buff *skb, | ||
37 | const char **dptr, unsigned int *datalen, | ||
38 | unsigned int cseq); | ||
39 | int (*response)(struct sk_buff *skb, | ||
40 | const char **dptr, unsigned int *datalen, | ||
41 | unsigned int cseq, unsigned int code); | ||
42 | }; | ||
43 | |||
44 | #define SIP_HANDLER(__method, __request, __response) \ | ||
45 | { \ | ||
46 | .method = (__method), \ | ||
47 | .len = sizeof(__method) - 1, \ | ||
48 | .request = (__request), \ | ||
49 | .response = (__response), \ | ||
50 | } | ||
51 | |||
52 | struct sip_header { | ||
53 | const char *name; | ||
54 | const char *cname; | ||
55 | const char *search; | ||
56 | unsigned int len; | ||
57 | unsigned int clen; | ||
58 | unsigned int slen; | ||
59 | int (*match_len)(const struct nf_conn *ct, | ||
60 | const char *dptr, const char *limit, | ||
61 | int *shift); | ||
62 | }; | ||
63 | |||
64 | #define __SIP_HDR(__name, __cname, __search, __match) \ | ||
65 | { \ | ||
66 | .name = (__name), \ | ||
67 | .len = sizeof(__name) - 1, \ | ||
68 | .cname = (__cname), \ | ||
69 | .clen = (__cname) ? sizeof(__cname) - 1 : 0, \ | ||
70 | .search = (__search), \ | ||
71 | .slen = (__search) ? sizeof(__search) - 1 : 0, \ | ||
72 | .match_len = (__match), \ | ||
73 | } | ||
74 | |||
75 | #define SIP_HDR(__name, __cname, __search, __match) \ | ||
76 | __SIP_HDR(__name, __cname, __search, __match) | ||
77 | |||
78 | #define SDP_HDR(__name, __search, __match) \ | ||
79 | __SIP_HDR(__name, NULL, __search, __match) | ||
80 | |||
81 | enum sip_header_types { | ||
82 | SIP_HDR_CSEQ, | ||
83 | SIP_HDR_FROM, | ||
84 | SIP_HDR_TO, | ||
85 | SIP_HDR_CONTACT, | ||
86 | SIP_HDR_VIA, | ||
87 | SIP_HDR_EXPIRES, | ||
88 | SIP_HDR_CONTENT_LENGTH, | ||
89 | }; | ||
90 | |||
91 | enum sdp_header_types { | ||
92 | SDP_HDR_UNSPEC, | ||
93 | SDP_HDR_VERSION, | ||
94 | SDP_HDR_OWNER_IP4, | ||
95 | SDP_HDR_CONNECTION_IP4, | ||
96 | SDP_HDR_OWNER_IP6, | ||
97 | SDP_HDR_CONNECTION_IP6, | ||
98 | SDP_HDR_MEDIA, | ||
22 | }; | 99 | }; |
23 | 100 | ||
24 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, | 101 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, |
25 | enum ip_conntrack_info ctinfo, | 102 | const char **dptr, |
26 | struct nf_conn *ct, | 103 | unsigned int *datalen); |
27 | const char **dptr); | 104 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, |
28 | extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff *skb, | 105 | const char **dptr, |
29 | enum ip_conntrack_info ctinfo, | 106 | unsigned int *datalen, |
30 | struct nf_conntrack_expect *exp, | 107 | struct nf_conntrack_expect *exp, |
31 | const char *dptr); | 108 | unsigned int matchoff, |
32 | 109 | unsigned int matchlen); | |
33 | extern int ct_sip_get_info(const struct nf_conn *ct, const char *dptr, | 110 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, |
34 | size_t dlen, unsigned int *matchoff, | 111 | const char **dptr, |
35 | unsigned int *matchlen, enum sip_header_pos pos); | 112 | unsigned int dataoff, |
36 | extern int ct_sip_lnlen(const char *line, const char *limit); | 113 | unsigned int *datalen, |
37 | extern const char *ct_sip_search(const char *needle, const char *haystack, | 114 | enum sdp_header_types type, |
38 | size_t needle_len, size_t haystack_len, | 115 | enum sdp_header_types term, |
39 | int case_sensitive); | 116 | const union nf_inet_addr *addr); |
117 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, | ||
118 | const char **dptr, | ||
119 | unsigned int *datalen, | ||
120 | unsigned int matchoff, | ||
121 | unsigned int matchlen, | ||
122 | u_int16_t port); | ||
123 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, | ||
124 | const char **dptr, | ||
125 | unsigned int dataoff, | ||
126 | unsigned int *datalen, | ||
127 | const union nf_inet_addr *addr); | ||
128 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, | ||
129 | const char **dptr, | ||
130 | unsigned int *datalen, | ||
131 | struct nf_conntrack_expect *rtp_exp, | ||
132 | struct nf_conntrack_expect *rtcp_exp, | ||
133 | unsigned int mediaoff, | ||
134 | unsigned int medialen, | ||
135 | union nf_inet_addr *rtp_addr); | ||
136 | |||
137 | extern int ct_sip_parse_request(const struct nf_conn *ct, | ||
138 | const char *dptr, unsigned int datalen, | ||
139 | unsigned int *matchoff, unsigned int *matchlen, | ||
140 | union nf_inet_addr *addr, __be16 *port); | ||
141 | extern int ct_sip_get_header(const struct nf_conn *ct, const char *dptr, | ||
142 | unsigned int dataoff, unsigned int datalen, | ||
143 | enum sip_header_types type, | ||
144 | unsigned int *matchoff, unsigned int *matchlen); | ||
145 | extern int ct_sip_parse_header_uri(const struct nf_conn *ct, const char *dptr, | ||
146 | unsigned int *dataoff, unsigned int datalen, | ||
147 | enum sip_header_types type, int *in_header, | ||
148 | unsigned int *matchoff, unsigned int *matchlen, | ||
149 | union nf_inet_addr *addr, __be16 *port); | ||
150 | extern int ct_sip_parse_address_param(const struct nf_conn *ct, const char *dptr, | ||
151 | unsigned int dataoff, unsigned int datalen, | ||
152 | const char *name, | ||
153 | unsigned int *matchoff, unsigned int *matchlen, | ||
154 | union nf_inet_addr *addr); | ||
155 | extern int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr, | ||
156 | unsigned int off, unsigned int datalen, | ||
157 | const char *name, | ||
158 | unsigned int *matchoff, unsigned int *matchen, | ||
159 | unsigned int *val); | ||
160 | |||
161 | extern int ct_sip_get_sdp_header(const struct nf_conn *ct, const char *dptr, | ||
162 | unsigned int dataoff, unsigned int datalen, | ||
163 | enum sdp_header_types type, | ||
164 | enum sdp_header_types term, | ||
165 | unsigned int *matchoff, unsigned int *matchlen); | ||
166 | |||
40 | #endif /* __KERNEL__ */ | 167 | #endif /* __KERNEL__ */ |
41 | #endif /* __NF_CONNTRACK_SIP_H__ */ | 168 | #endif /* __NF_CONNTRACK_SIP_H__ */ |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index e3e1533aba2d..0a383ac083cb 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -80,6 +80,7 @@ enum ctattr_l4proto { | |||
80 | enum ctattr_protoinfo { | 80 | 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_MAX | 84 | __CTA_PROTOINFO_MAX |
84 | }; | 85 | }; |
85 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | 86 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) |
@@ -95,6 +96,13 @@ enum ctattr_protoinfo_tcp { | |||
95 | }; | 96 | }; |
96 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | 97 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) |
97 | 98 | ||
99 | enum ctattr_protoinfo_dccp { | ||
100 | CTA_PROTOINFO_DCCP_UNSPEC, | ||
101 | CTA_PROTOINFO_DCCP_STATE, | ||
102 | __CTA_PROTOINFO_DCCP_MAX, | ||
103 | }; | ||
104 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) | ||
105 | |||
98 | enum ctattr_counters { | 106 | enum ctattr_counters { |
99 | CTA_COUNTERS_UNSPEC, | 107 | CTA_COUNTERS_UNSPEC, |
100 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ | 108 | CTA_COUNTERS_PACKETS, /* old 64bit counters */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index b2c62cc618f5..2326296b6f25 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -430,13 +430,13 @@ extern int xt_compat_add_offset(int af, unsigned int offset, short delta); | |||
430 | extern void xt_compat_flush_offsets(int af); | 430 | extern void xt_compat_flush_offsets(int af); |
431 | extern short xt_compat_calc_jump(int af, unsigned int offset); | 431 | extern short xt_compat_calc_jump(int af, unsigned int offset); |
432 | 432 | ||
433 | extern int xt_compat_match_offset(struct xt_match *match); | 433 | extern int xt_compat_match_offset(const struct xt_match *match); |
434 | extern int xt_compat_match_from_user(struct xt_entry_match *m, | 434 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
435 | void **dstptr, unsigned int *size); | 435 | void **dstptr, unsigned int *size); |
436 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | 436 | extern int xt_compat_match_to_user(struct xt_entry_match *m, |
437 | void __user **dstptr, unsigned int *size); | 437 | void __user **dstptr, unsigned int *size); |
438 | 438 | ||
439 | extern int xt_compat_target_offset(struct xt_target *target); | 439 | extern int xt_compat_target_offset(const struct xt_target *target); |
440 | extern void xt_compat_target_from_user(struct xt_entry_target *t, | 440 | extern void xt_compat_target_from_user(struct xt_entry_target *t, |
441 | void **dstptr, unsigned int *size); | 441 | void **dstptr, unsigned int *size); |
442 | extern int xt_compat_target_to_user(struct xt_entry_target *t, | 442 | extern int xt_compat_target_to_user(struct xt_entry_target *t, |
diff --git a/include/linux/netfilter/xt_sctp.h b/include/linux/netfilter/xt_sctp.h index dd5a4fd4cfd3..32000ba6ecef 100644 --- a/include/linux/netfilter/xt_sctp.h +++ b/include/linux/netfilter/xt_sctp.h | |||
@@ -37,68 +37,54 @@ struct xt_sctp_info { | |||
37 | 37 | ||
38 | #define SCTP_CHUNKMAP_SET(chunkmap, type) \ | 38 | #define SCTP_CHUNKMAP_SET(chunkmap, type) \ |
39 | do { \ | 39 | do { \ |
40 | chunkmap[type / bytes(u_int32_t)] |= \ | 40 | (chunkmap)[type / bytes(u_int32_t)] |= \ |
41 | 1 << (type % bytes(u_int32_t)); \ | 41 | 1 << (type % bytes(u_int32_t)); \ |
42 | } while (0) | 42 | } while (0) |
43 | 43 | ||
44 | #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ | 44 | #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \ |
45 | do { \ | 45 | do { \ |
46 | chunkmap[type / bytes(u_int32_t)] &= \ | 46 | (chunkmap)[type / bytes(u_int32_t)] &= \ |
47 | ~(1 << (type % bytes(u_int32_t))); \ | 47 | ~(1 << (type % bytes(u_int32_t))); \ |
48 | } while (0) | 48 | } while (0) |
49 | 49 | ||
50 | #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ | 50 | #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \ |
51 | ({ \ | 51 | ({ \ |
52 | (chunkmap[type / bytes (u_int32_t)] & \ | 52 | ((chunkmap)[type / bytes (u_int32_t)] & \ |
53 | (1 << (type % bytes (u_int32_t)))) ? 1: 0; \ | 53 | (1 << (type % bytes (u_int32_t)))) ? 1: 0; \ |
54 | }) | 54 | }) |
55 | 55 | ||
56 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ | 56 | #define SCTP_CHUNKMAP_RESET(chunkmap) \ |
57 | do { \ | 57 | memset((chunkmap), 0, sizeof(chunkmap)) |
58 | int i; \ | 58 | |
59 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | 59 | #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ |
60 | chunkmap[i] = 0; \ | 60 | memset((chunkmap), ~0U, sizeof(chunkmap)) |
61 | } while (0) | 61 | |
62 | 62 | #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ | |
63 | #define SCTP_CHUNKMAP_SET_ALL(chunkmap) \ | 63 | memcpy((destmap), (srcmap), sizeof(srcmap)) |
64 | do { \ | 64 | |
65 | int i; \ | 65 | #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \ |
66 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) \ | 66 | __sctp_chunkmap_is_clear((chunkmap), ARRAY_SIZE(chunkmap)) |
67 | chunkmap[i] = ~0; \ | 67 | static inline bool |
68 | } while (0) | 68 | __sctp_chunkmap_is_clear(const u_int32_t *chunkmap, unsigned int n) |
69 | 69 | { | |
70 | #define SCTP_CHUNKMAP_COPY(destmap, srcmap) \ | 70 | unsigned int i; |
71 | do { \ | 71 | for (i = 0; i < n; ++i) |
72 | int i; \ | 72 | if (chunkmap[i]) |
73 | for (i = 0; i < ARRAY_SIZE(srcmap); i++) \ | 73 | return false; |
74 | destmap[i] = srcmap[i]; \ | 74 | return true; |
75 | } while (0) | 75 | } |
76 | 76 | ||
77 | #define SCTP_CHUNKMAP_IS_CLEAR(chunkmap) \ | 77 | #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \ |
78 | ({ \ | 78 | __sctp_chunkmap_is_all_set((chunkmap), ARRAY_SIZE(chunkmap)) |
79 | int i; \ | 79 | static inline bool |
80 | int flag = 1; \ | 80 | __sctp_chunkmap_is_all_set(const u_int32_t *chunkmap, unsigned int n) |
81 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ | 81 | { |
82 | if (chunkmap[i]) { \ | 82 | unsigned int i; |
83 | flag = 0; \ | 83 | for (i = 0; i < n; ++i) |
84 | break; \ | 84 | if (chunkmap[i] != ~0U) |
85 | } \ | 85 | return false; |
86 | } \ | 86 | return true; |
87 | flag; \ | 87 | } |
88 | }) | ||
89 | |||
90 | #define SCTP_CHUNKMAP_IS_ALL_SET(chunkmap) \ | ||
91 | ({ \ | ||
92 | int i; \ | ||
93 | int flag = 1; \ | ||
94 | for (i = 0; i < ARRAY_SIZE(chunkmap); i++) { \ | ||
95 | if (chunkmap[i] != ~0) { \ | ||
96 | flag = 0; \ | ||
97 | break; \ | ||
98 | } \ | ||
99 | } \ | ||
100 | flag; \ | ||
101 | }) | ||
102 | 88 | ||
103 | #endif /* _XT_SCTP_H_ */ | 89 | #endif /* _XT_SCTP_H_ */ |
104 | 90 | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index db223ca92c8b..dd9c97f2d436 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -23,8 +23,6 @@ | |||
23 | 23 | ||
24 | #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN | 24 | #define ARPT_FUNCTION_MAXNAMELEN XT_FUNCTION_MAXNAMELEN |
25 | #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN | 25 | #define ARPT_TABLE_MAXNAMELEN XT_TABLE_MAXNAMELEN |
26 | #define arpt_target xt_target | ||
27 | #define arpt_table xt_table | ||
28 | 26 | ||
29 | #define ARPT_DEV_ADDR_LEN_MAX 16 | 27 | #define ARPT_DEV_ADDR_LEN_MAX 16 |
30 | 28 | ||
@@ -266,20 +264,15 @@ struct arpt_error | |||
266 | .target.errorname = "ERROR", \ | 264 | .target.errorname = "ERROR", \ |
267 | } | 265 | } |
268 | 266 | ||
269 | #define arpt_register_target(tgt) \ | 267 | extern struct xt_table *arpt_register_table(struct net *net, |
270 | ({ (tgt)->family = NF_ARP; \ | 268 | struct xt_table *table, |
271 | xt_register_target(tgt); }) | 269 | const struct arpt_replace *repl); |
272 | #define arpt_unregister_target(tgt) xt_unregister_target(tgt) | 270 | extern void arpt_unregister_table(struct xt_table *table); |
273 | |||
274 | extern struct arpt_table *arpt_register_table(struct net *net, | ||
275 | struct arpt_table *table, | ||
276 | const struct arpt_replace *repl); | ||
277 | extern void arpt_unregister_table(struct arpt_table *table); | ||
278 | extern unsigned int arpt_do_table(struct sk_buff *skb, | 271 | extern unsigned int arpt_do_table(struct sk_buff *skb, |
279 | unsigned int hook, | 272 | unsigned int hook, |
280 | const struct net_device *in, | 273 | const struct net_device *in, |
281 | const struct net_device *out, | 274 | const struct net_device *out, |
282 | struct arpt_table *table); | 275 | struct xt_table *table); |
283 | 276 | ||
284 | #define ARPT_ALIGN(s) XT_ALIGN(s) | 277 | #define ARPT_ALIGN(s) XT_ALIGN(s) |
285 | 278 | ||
diff --git a/include/linux/netfilter_bridge/ebt_nflog.h b/include/linux/netfilter_bridge/ebt_nflog.h new file mode 100644 index 000000000000..052817849b83 --- /dev/null +++ b/include/linux/netfilter_bridge/ebt_nflog.h | |||
@@ -0,0 +1,21 @@ | |||
1 | #ifndef __LINUX_BRIDGE_EBT_NFLOG_H | ||
2 | #define __LINUX_BRIDGE_EBT_NFLOG_H | ||
3 | |||
4 | #define EBT_NFLOG_MASK 0x0 | ||
5 | |||
6 | #define EBT_NFLOG_PREFIX_SIZE 64 | ||
7 | #define EBT_NFLOG_WATCHER "nflog" | ||
8 | |||
9 | #define EBT_NFLOG_DEFAULT_GROUP 0x1 | ||
10 | #define EBT_NFLOG_DEFAULT_THRESHOLD 1 | ||
11 | |||
12 | struct ebt_nflog_info { | ||
13 | u_int32_t len; | ||
14 | u_int16_t group; | ||
15 | u_int16_t threshold; | ||
16 | u_int16_t flags; | ||
17 | u_int16_t pad; | ||
18 | char prefix[EBT_NFLOG_PREFIX_SIZE]; | ||
19 | }; | ||
20 | |||
21 | #endif /* __LINUX_BRIDGE_EBT_NFLOG_H */ | ||
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 9a10092e358c..650318b0c405 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -62,8 +62,6 @@ enum nf_ip_hook_priorities { | |||
62 | NF_IP_PRI_FILTER = 0, | 62 | NF_IP_PRI_FILTER = 0, |
63 | NF_IP_PRI_NAT_SRC = 100, | 63 | NF_IP_PRI_NAT_SRC = 100, |
64 | NF_IP_PRI_SELINUX_LAST = 225, | 64 | NF_IP_PRI_SELINUX_LAST = 225, |
65 | NF_IP_PRI_CONNTRACK_HELPER = INT_MAX - 2, | ||
66 | NF_IP_PRI_NAT_SEQ_ADJUST = INT_MAX - 1, | ||
67 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, | 65 | NF_IP_PRI_CONNTRACK_CONFIRM = INT_MAX, |
68 | NF_IP_PRI_LAST = INT_MAX, | 66 | NF_IP_PRI_LAST = INT_MAX, |
69 | }; | 67 | }; |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 9fecf902419c..ea6517e58b04 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -78,6 +78,18 @@ | |||
78 | * or, if no MAC address given, all stations, on the interface identified | 78 | * or, if no MAC address given, all stations, on the interface identified |
79 | * by %NL80211_ATTR_IFINDEX. | 79 | * by %NL80211_ATTR_IFINDEX. |
80 | * | 80 | * |
81 | * @NL80211_CMD_GET_MPATH: Get mesh path attributes for mesh path to | ||
82 | * destination %NL80211_ATTR_MAC on the interface identified by | ||
83 | * %NL80211_ATTR_IFINDEX. | ||
84 | * @NL80211_CMD_SET_MPATH: Set mesh path attributes for mesh path to | ||
85 | * destination %NL80211_ATTR_MAC on the interface identified by | ||
86 | * %NL80211_ATTR_IFINDEX. | ||
87 | * @NL80211_CMD_NEW_PATH: Add a mesh path with given attributes to the | ||
88 | * the interface identified by %NL80211_ATTR_IFINDEX. | ||
89 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC | ||
90 | * or, if no MAC address given, all mesh paths, on the interface identified | ||
91 | * by %NL80211_ATTR_IFINDEX. | ||
92 | * | ||
81 | * @NL80211_CMD_MAX: highest used command number | 93 | * @NL80211_CMD_MAX: highest used command number |
82 | * @__NL80211_CMD_AFTER_LAST: internal use | 94 | * @__NL80211_CMD_AFTER_LAST: internal use |
83 | */ | 95 | */ |
@@ -112,6 +124,11 @@ enum nl80211_commands { | |||
112 | 124 | ||
113 | /* add commands here */ | 125 | /* add commands here */ |
114 | 126 | ||
127 | NL80211_CMD_GET_MPATH, | ||
128 | NL80211_CMD_SET_MPATH, | ||
129 | NL80211_CMD_NEW_MPATH, | ||
130 | NL80211_CMD_DEL_MPATH, | ||
131 | |||
115 | /* used to define NL80211_CMD_MAX below */ | 132 | /* used to define NL80211_CMD_MAX below */ |
116 | __NL80211_CMD_AFTER_LAST, | 133 | __NL80211_CMD_AFTER_LAST, |
117 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 | 134 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 |
@@ -157,9 +174,23 @@ enum nl80211_commands { | |||
157 | * restriction (at most %NL80211_MAX_SUPP_RATES). | 174 | * restriction (at most %NL80211_MAX_SUPP_RATES). |
158 | * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station | 175 | * @NL80211_ATTR_STA_VLAN: interface index of VLAN interface to move station |
159 | * to, or the AP interface the station was originally added to to. | 176 | * to, or the AP interface the station was originally added to to. |
160 | * @NL80211_ATTR_STA_STATS: statistics for a station, part of station info | 177 | * @NL80211_ATTR_STA_INFO: information about a station, part of station info |
161 | * given for %NL80211_CMD_GET_STATION, nested attribute containing | 178 | * given for %NL80211_CMD_GET_STATION, nested attribute containing |
162 | * info as possible, see &enum nl80211_sta_stats. | 179 | * info as possible, see &enum nl80211_sta_info. |
180 | * | ||
181 | * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands, | ||
182 | * consisting of a nested array. | ||
183 | * | ||
184 | * @NL80211_ATTR_MESH_ID: mesh id (1-32 bytes). | ||
185 | * @NL80211_ATTR_PLINK_ACTION: action to perform on the mesh peer link. | ||
186 | * @NL80211_ATTR_MPATH_NEXT_HOP: MAC address of the next hop for a mesh path. | ||
187 | * @NL80211_ATTR_MPATH_INFO: information about a mesh_path, part of mesh path | ||
188 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at | ||
189 | * &enum nl80211_mpath_info. | ||
190 | * | ||
191 | * | ||
192 | * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of | ||
193 | * &enum nl80211_mntr_flags. | ||
163 | * | 194 | * |
164 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 195 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
165 | * @__NL80211_ATTR_AFTER_LAST: internal use | 196 | * @__NL80211_ATTR_AFTER_LAST: internal use |
@@ -193,10 +224,19 @@ enum nl80211_attrs { | |||
193 | NL80211_ATTR_STA_LISTEN_INTERVAL, | 224 | NL80211_ATTR_STA_LISTEN_INTERVAL, |
194 | NL80211_ATTR_STA_SUPPORTED_RATES, | 225 | NL80211_ATTR_STA_SUPPORTED_RATES, |
195 | NL80211_ATTR_STA_VLAN, | 226 | NL80211_ATTR_STA_VLAN, |
196 | NL80211_ATTR_STA_STATS, | 227 | NL80211_ATTR_STA_INFO, |
228 | |||
229 | NL80211_ATTR_WIPHY_BANDS, | ||
230 | |||
231 | NL80211_ATTR_MNTR_FLAGS, | ||
197 | 232 | ||
198 | /* add attributes here, update the policy in nl80211.c */ | 233 | /* add attributes here, update the policy in nl80211.c */ |
199 | 234 | ||
235 | NL80211_ATTR_MESH_ID, | ||
236 | NL80211_ATTR_STA_PLINK_ACTION, | ||
237 | NL80211_ATTR_MPATH_NEXT_HOP, | ||
238 | NL80211_ATTR_MPATH_INFO, | ||
239 | |||
200 | __NL80211_ATTR_AFTER_LAST, | 240 | __NL80211_ATTR_AFTER_LAST, |
201 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
202 | }; | 242 | }; |
@@ -213,6 +253,7 @@ enum nl80211_attrs { | |||
213 | * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points | 253 | * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points |
214 | * @NL80211_IFTYPE_WDS: wireless distribution interface | 254 | * @NL80211_IFTYPE_WDS: wireless distribution interface |
215 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames | 255 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames |
256 | * @NL80211_IFTYPE_MESH_POINT: mesh point | ||
216 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined | 257 | * @NL80211_IFTYPE_MAX: highest interface type number currently defined |
217 | * @__NL80211_IFTYPE_AFTER_LAST: internal use | 258 | * @__NL80211_IFTYPE_AFTER_LAST: internal use |
218 | * | 259 | * |
@@ -228,6 +269,7 @@ enum nl80211_iftype { | |||
228 | NL80211_IFTYPE_AP_VLAN, | 269 | NL80211_IFTYPE_AP_VLAN, |
229 | NL80211_IFTYPE_WDS, | 270 | NL80211_IFTYPE_WDS, |
230 | NL80211_IFTYPE_MONITOR, | 271 | NL80211_IFTYPE_MONITOR, |
272 | NL80211_IFTYPE_MESH_POINT, | ||
231 | 273 | ||
232 | /* keep last */ | 274 | /* keep last */ |
233 | __NL80211_IFTYPE_AFTER_LAST, | 275 | __NL80211_IFTYPE_AFTER_LAST, |
@@ -257,27 +299,167 @@ enum nl80211_sta_flags { | |||
257 | }; | 299 | }; |
258 | 300 | ||
259 | /** | 301 | /** |
260 | * enum nl80211_sta_stats - station statistics | 302 | * enum nl80211_sta_info - station information |
261 | * | 303 | * |
262 | * These attribute types are used with %NL80211_ATTR_STA_STATS | 304 | * These attribute types are used with %NL80211_ATTR_STA_INFO |
263 | * when getting information about a station. | 305 | * when getting information about a station. |
264 | * | 306 | * |
265 | * @__NL80211_STA_STAT_INVALID: attribute number 0 is reserved | 307 | * @__NL80211_STA_INFO_INVALID: attribute number 0 is reserved |
266 | * @NL80211_STA_STAT_INACTIVE_TIME: time since last activity (u32, msecs) | 308 | * @NL80211_STA_INFO_INACTIVE_TIME: time since last activity (u32, msecs) |
267 | * @NL80211_STA_STAT_RX_BYTES: total received bytes (u32, from this station) | 309 | * @NL80211_STA_INFO_RX_BYTES: total received bytes (u32, from this station) |
268 | * @NL80211_STA_STAT_TX_BYTES: total transmitted bytes (u32, to this station) | 310 | * @NL80211_STA_INFO_TX_BYTES: total transmitted bytes (u32, to this station) |
269 | * @__NL80211_STA_STAT_AFTER_LAST: internal | 311 | * @__NL80211_STA_INFO_AFTER_LAST: internal |
270 | * @NL80211_STA_STAT_MAX: highest possible station stats attribute | 312 | * @NL80211_STA_INFO_MAX: highest possible station info attribute |
313 | */ | ||
314 | enum nl80211_sta_info { | ||
315 | __NL80211_STA_INFO_INVALID, | ||
316 | NL80211_STA_INFO_INACTIVE_TIME, | ||
317 | NL80211_STA_INFO_RX_BYTES, | ||
318 | NL80211_STA_INFO_TX_BYTES, | ||
319 | NL80211_STA_INFO_LLID, | ||
320 | NL80211_STA_INFO_PLID, | ||
321 | NL80211_STA_INFO_PLINK_STATE, | ||
322 | |||
323 | /* keep last */ | ||
324 | __NL80211_STA_INFO_AFTER_LAST, | ||
325 | NL80211_STA_INFO_MAX = __NL80211_STA_INFO_AFTER_LAST - 1 | ||
326 | }; | ||
327 | |||
328 | /** | ||
329 | * enum nl80211_mpath_flags - nl80211 mesh path flags | ||
330 | * | ||
331 | * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active | ||
332 | * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running | ||
333 | * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN | ||
334 | * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set | ||
335 | * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded | ||
336 | */ | ||
337 | enum nl80211_mpath_flags { | ||
338 | NL80211_MPATH_FLAG_ACTIVE = 1<<0, | ||
339 | NL80211_MPATH_FLAG_RESOLVING = 1<<1, | ||
340 | NL80211_MPATH_FLAG_DSN_VALID = 1<<2, | ||
341 | NL80211_MPATH_FLAG_FIXED = 1<<3, | ||
342 | NL80211_MPATH_FLAG_RESOLVED = 1<<4, | ||
343 | }; | ||
344 | |||
345 | /** | ||
346 | * enum nl80211_mpath_info - mesh path information | ||
347 | * | ||
348 | * These attribute types are used with %NL80211_ATTR_MPATH_INFO when getting | ||
349 | * information about a mesh path. | ||
350 | * | ||
351 | * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved | ||
352 | * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination | ||
353 | * @NL80211_ATTR_MPATH_DSN: destination sequence number | ||
354 | * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path | ||
355 | * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now | ||
356 | * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in | ||
357 | * &enum nl80211_mpath_flags; | ||
358 | * @NL80211_ATTR_MPATH_DISCOVERY_TIMEOUT: total path discovery timeout, in msec | ||
359 | * @NL80211_ATTR_MPATH_DISCOVERY_RETRIES: mesh path discovery retries | ||
360 | */ | ||
361 | enum nl80211_mpath_info { | ||
362 | __NL80211_MPATH_INFO_INVALID, | ||
363 | NL80211_MPATH_INFO_FRAME_QLEN, | ||
364 | NL80211_MPATH_INFO_DSN, | ||
365 | NL80211_MPATH_INFO_METRIC, | ||
366 | NL80211_MPATH_INFO_EXPTIME, | ||
367 | NL80211_MPATH_INFO_FLAGS, | ||
368 | NL80211_MPATH_INFO_DISCOVERY_TIMEOUT, | ||
369 | NL80211_MPATH_INFO_DISCOVERY_RETRIES, | ||
370 | |||
371 | /* keep last */ | ||
372 | __NL80211_MPATH_INFO_AFTER_LAST, | ||
373 | NL80211_MPATH_INFO_MAX = __NL80211_MPATH_INFO_AFTER_LAST - 1 | ||
374 | }; | ||
375 | |||
376 | /** | ||
377 | * enum nl80211_band_attr - band attributes | ||
378 | * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved | ||
379 | * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band, | ||
380 | * an array of nested frequency attributes | ||
381 | * @NL80211_BAND_ATTR_RATES: supported bitrates in this band, | ||
382 | * an array of nested bitrate attributes | ||
383 | */ | ||
384 | enum nl80211_band_attr { | ||
385 | __NL80211_BAND_ATTR_INVALID, | ||
386 | NL80211_BAND_ATTR_FREQS, | ||
387 | NL80211_BAND_ATTR_RATES, | ||
388 | |||
389 | /* keep last */ | ||
390 | __NL80211_BAND_ATTR_AFTER_LAST, | ||
391 | NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1 | ||
392 | }; | ||
393 | |||
394 | /** | ||
395 | * enum nl80211_frequency_attr - frequency attributes | ||
396 | * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz | ||
397 | * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current | ||
398 | * regulatory domain. | ||
399 | * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is | ||
400 | * permitted on this channel in current regulatory domain. | ||
401 | * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted | ||
402 | * on this channel in current regulatory domain. | ||
403 | * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory | ||
404 | * on this channel in current regulatory domain. | ||
405 | */ | ||
406 | enum nl80211_frequency_attr { | ||
407 | __NL80211_FREQUENCY_ATTR_INVALID, | ||
408 | NL80211_FREQUENCY_ATTR_FREQ, | ||
409 | NL80211_FREQUENCY_ATTR_DISABLED, | ||
410 | NL80211_FREQUENCY_ATTR_PASSIVE_SCAN, | ||
411 | NL80211_FREQUENCY_ATTR_NO_IBSS, | ||
412 | NL80211_FREQUENCY_ATTR_RADAR, | ||
413 | |||
414 | /* keep last */ | ||
415 | __NL80211_FREQUENCY_ATTR_AFTER_LAST, | ||
416 | NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1 | ||
417 | }; | ||
418 | |||
419 | /** | ||
420 | * enum nl80211_bitrate_attr - bitrate attributes | ||
421 | * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps | ||
422 | * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported | ||
423 | * in 2.4 GHz band. | ||
424 | */ | ||
425 | enum nl80211_bitrate_attr { | ||
426 | __NL80211_BITRATE_ATTR_INVALID, | ||
427 | NL80211_BITRATE_ATTR_RATE, | ||
428 | NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE, | ||
429 | |||
430 | /* keep last */ | ||
431 | __NL80211_BITRATE_ATTR_AFTER_LAST, | ||
432 | NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1 | ||
433 | }; | ||
434 | |||
435 | /** | ||
436 | * enum nl80211_mntr_flags - monitor configuration flags | ||
437 | * | ||
438 | * Monitor configuration flags. | ||
439 | * | ||
440 | * @__NL80211_MNTR_FLAG_INVALID: reserved | ||
441 | * | ||
442 | * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS | ||
443 | * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP | ||
444 | * @NL80211_MNTR_FLAG_CONTROL: pass control frames | ||
445 | * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering | ||
446 | * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing. | ||
447 | * overrides all other flags. | ||
448 | * | ||
449 | * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use | ||
450 | * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag | ||
271 | */ | 451 | */ |
272 | enum nl80211_sta_stats { | 452 | enum nl80211_mntr_flags { |
273 | __NL80211_STA_STAT_INVALID, | 453 | __NL80211_MNTR_FLAG_INVALID, |
274 | NL80211_STA_STAT_INACTIVE_TIME, | 454 | NL80211_MNTR_FLAG_FCSFAIL, |
275 | NL80211_STA_STAT_RX_BYTES, | 455 | NL80211_MNTR_FLAG_PLCPFAIL, |
276 | NL80211_STA_STAT_TX_BYTES, | 456 | NL80211_MNTR_FLAG_CONTROL, |
457 | NL80211_MNTR_FLAG_OTHER_BSS, | ||
458 | NL80211_MNTR_FLAG_COOK_FRAMES, | ||
277 | 459 | ||
278 | /* keep last */ | 460 | /* keep last */ |
279 | __NL80211_STA_STAT_AFTER_LAST, | 461 | __NL80211_MNTR_FLAG_AFTER_LAST, |
280 | NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1 | 462 | NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1 |
281 | }; | 463 | }; |
282 | 464 | ||
283 | #endif /* __LINUX_NL80211_H */ | 465 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/pcounter.h b/include/linux/pcounter.h deleted file mode 100644 index a82d9f2628ca..000000000000 --- a/include/linux/pcounter.h +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | #ifndef __LINUX_PCOUNTER_H | ||
2 | #define __LINUX_PCOUNTER_H | ||
3 | /* | ||
4 | * Using a dynamic percpu 'int' variable has a cost : | ||
5 | * 1) Extra dereference | ||
6 | * Current per_cpu_ptr() implementation uses an array per 'percpu variable'. | ||
7 | * 2) memory cost of NR_CPUS*(32+sizeof(void *)) instead of num_possible_cpus()*4 | ||
8 | * | ||
9 | * This pcounter implementation is an abstraction to be able to use | ||
10 | * either a static or a dynamic per cpu variable. | ||
11 | * One dynamic per cpu variable gets a fast & cheap implementation, we can | ||
12 | * change pcounter implementation too. | ||
13 | */ | ||
14 | struct pcounter { | ||
15 | #ifdef CONFIG_SMP | ||
16 | void (*add)(struct pcounter *self, int inc); | ||
17 | int (*getval)(const struct pcounter *self, int cpu); | ||
18 | int *per_cpu_values; | ||
19 | #else | ||
20 | int val; | ||
21 | #endif | ||
22 | }; | ||
23 | |||
24 | #ifdef CONFIG_SMP | ||
25 | #include <linux/percpu.h> | ||
26 | |||
27 | #define DEFINE_PCOUNTER(NAME) \ | ||
28 | static DEFINE_PER_CPU(int, NAME##_pcounter_values); \ | ||
29 | static void NAME##_pcounter_add(struct pcounter *self, int val) \ | ||
30 | { \ | ||
31 | __get_cpu_var(NAME##_pcounter_values) += val; \ | ||
32 | } \ | ||
33 | static int NAME##_pcounter_getval(const struct pcounter *self, int cpu) \ | ||
34 | { \ | ||
35 | return per_cpu(NAME##_pcounter_values, cpu); \ | ||
36 | } \ | ||
37 | |||
38 | #define PCOUNTER_MEMBER_INITIALIZER(NAME, MEMBER) \ | ||
39 | MEMBER = { \ | ||
40 | .add = NAME##_pcounter_add, \ | ||
41 | .getval = NAME##_pcounter_getval, \ | ||
42 | } | ||
43 | |||
44 | |||
45 | static inline void pcounter_add(struct pcounter *self, int inc) | ||
46 | { | ||
47 | self->add(self, inc); | ||
48 | } | ||
49 | |||
50 | extern int pcounter_getval(const struct pcounter *self); | ||
51 | extern int pcounter_alloc(struct pcounter *self); | ||
52 | extern void pcounter_free(struct pcounter *self); | ||
53 | |||
54 | |||
55 | #else /* CONFIG_SMP */ | ||
56 | |||
57 | static inline void pcounter_add(struct pcounter *self, int inc) | ||
58 | { | ||
59 | self->val += inc; | ||
60 | } | ||
61 | |||
62 | static inline int pcounter_getval(const struct pcounter *self) | ||
63 | { | ||
64 | return self->val; | ||
65 | } | ||
66 | |||
67 | #define DEFINE_PCOUNTER(NAME) | ||
68 | #define PCOUNTER_MEMBER_INITIALIZER(NAME, MEMBER) | ||
69 | #define pcounter_alloc(self) 0 | ||
70 | #define pcounter_free(self) | ||
71 | |||
72 | #endif /* CONFIG_SMP */ | ||
73 | |||
74 | #endif /* __LINUX_PCOUNTER_H */ | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index 5e43ae751412..779cbcd65f62 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -39,7 +39,8 @@ | |||
39 | SUPPORTED_1000baseT_Half | \ | 39 | SUPPORTED_1000baseT_Half | \ |
40 | SUPPORTED_1000baseT_Full) | 40 | SUPPORTED_1000baseT_Full) |
41 | 41 | ||
42 | /* Set phydev->irq to PHY_POLL if interrupts are not supported, | 42 | /* |
43 | * Set phydev->irq to PHY_POLL if interrupts are not supported, | ||
43 | * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if | 44 | * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if |
44 | * the attached driver handles the interrupt | 45 | * the attached driver handles the interrupt |
45 | */ | 46 | */ |
@@ -63,8 +64,6 @@ typedef enum { | |||
63 | PHY_INTERFACE_MODE_RTBI | 64 | PHY_INTERFACE_MODE_RTBI |
64 | } phy_interface_t; | 65 | } phy_interface_t; |
65 | 66 | ||
66 | #define MII_BUS_MAX 4 | ||
67 | |||
68 | 67 | ||
69 | #define PHY_INIT_TIMEOUT 100000 | 68 | #define PHY_INIT_TIMEOUT 100000 |
70 | #define PHY_STATE_TIME 1 | 69 | #define PHY_STATE_TIME 1 |
@@ -74,20 +73,30 @@ typedef enum { | |||
74 | #define PHY_MAX_ADDR 32 | 73 | #define PHY_MAX_ADDR 32 |
75 | 74 | ||
76 | /* Used when trying to connect to a specific phy (mii bus id:phy device id) */ | 75 | /* Used when trying to connect to a specific phy (mii bus id:phy device id) */ |
77 | #define PHY_ID_FMT "%x:%02x" | 76 | #define PHY_ID_FMT "%s:%02x" |
78 | 77 | ||
79 | /* The Bus class for PHYs. Devices which provide access to | 78 | /* |
80 | * PHYs should register using this structure */ | 79 | * Need to be a little smaller than phydev->dev.bus_id to leave room |
80 | * for the ":%02x" | ||
81 | */ | ||
82 | #define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3) | ||
83 | |||
84 | /* | ||
85 | * The Bus class for PHYs. Devices which provide access to | ||
86 | * PHYs should register using this structure | ||
87 | */ | ||
81 | struct mii_bus { | 88 | struct mii_bus { |
82 | const char *name; | 89 | const char *name; |
83 | int id; | 90 | char id[MII_BUS_ID_SIZE]; |
84 | void *priv; | 91 | void *priv; |
85 | int (*read)(struct mii_bus *bus, int phy_id, int regnum); | 92 | int (*read)(struct mii_bus *bus, int phy_id, int regnum); |
86 | int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val); | 93 | int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val); |
87 | int (*reset)(struct mii_bus *bus); | 94 | int (*reset)(struct mii_bus *bus); |
88 | 95 | ||
89 | /* A lock to ensure that only one thing can read/write | 96 | /* |
90 | * the MDIO bus at a time */ | 97 | * A lock to ensure that only one thing can read/write |
98 | * the MDIO bus at a time | ||
99 | */ | ||
91 | struct mutex mdio_lock; | 100 | struct mutex mdio_lock; |
92 | 101 | ||
93 | struct device *dev; | 102 | struct device *dev; |
@@ -98,8 +107,10 @@ struct mii_bus { | |||
98 | /* Phy addresses to be ignored when probing */ | 107 | /* Phy addresses to be ignored when probing */ |
99 | u32 phy_mask; | 108 | u32 phy_mask; |
100 | 109 | ||
101 | /* Pointer to an array of interrupts, each PHY's | 110 | /* |
102 | * interrupt at the index matching its address */ | 111 | * Pointer to an array of interrupts, each PHY's |
112 | * interrupt at the index matching its address | ||
113 | */ | ||
103 | int *irq; | 114 | int *irq; |
104 | }; | 115 | }; |
105 | 116 | ||
@@ -251,7 +262,8 @@ struct phy_device { | |||
251 | /* Bus address of the PHY (0-32) */ | 262 | /* Bus address of the PHY (0-32) */ |
252 | int addr; | 263 | int addr; |
253 | 264 | ||
254 | /* forced speed & duplex (no autoneg) | 265 | /* |
266 | * forced speed & duplex (no autoneg) | ||
255 | * partner speed & duplex & pause (autoneg) | 267 | * partner speed & duplex & pause (autoneg) |
256 | */ | 268 | */ |
257 | int speed; | 269 | int speed; |
@@ -274,8 +286,10 @@ struct phy_device { | |||
274 | 286 | ||
275 | int link_timeout; | 287 | int link_timeout; |
276 | 288 | ||
277 | /* Interrupt number for this PHY | 289 | /* |
278 | * -1 means no interrupt */ | 290 | * Interrupt number for this PHY |
291 | * -1 means no interrupt | ||
292 | */ | ||
279 | int irq; | 293 | int irq; |
280 | 294 | ||
281 | /* private data pointer */ | 295 | /* private data pointer */ |
@@ -325,22 +339,28 @@ struct phy_driver { | |||
325 | u32 features; | 339 | u32 features; |
326 | u32 flags; | 340 | u32 flags; |
327 | 341 | ||
328 | /* Called to initialize the PHY, | 342 | /* |
329 | * including after a reset */ | 343 | * Called to initialize the PHY, |
344 | * including after a reset | ||
345 | */ | ||
330 | int (*config_init)(struct phy_device *phydev); | 346 | int (*config_init)(struct phy_device *phydev); |
331 | 347 | ||
332 | /* Called during discovery. Used to set | 348 | /* |
333 | * up device-specific structures, if any */ | 349 | * Called during discovery. Used to set |
350 | * up device-specific structures, if any | ||
351 | */ | ||
334 | int (*probe)(struct phy_device *phydev); | 352 | int (*probe)(struct phy_device *phydev); |
335 | 353 | ||
336 | /* PHY Power Management */ | 354 | /* PHY Power Management */ |
337 | int (*suspend)(struct phy_device *phydev); | 355 | int (*suspend)(struct phy_device *phydev); |
338 | int (*resume)(struct phy_device *phydev); | 356 | int (*resume)(struct phy_device *phydev); |
339 | 357 | ||
340 | /* Configures the advertisement and resets | 358 | /* |
359 | * Configures the advertisement and resets | ||
341 | * autonegotiation if phydev->autoneg is on, | 360 | * autonegotiation if phydev->autoneg is on, |
342 | * forces the speed to the current settings in phydev | 361 | * forces the speed to the current settings in phydev |
343 | * if phydev->autoneg is off */ | 362 | * if phydev->autoneg is off |
363 | */ | ||
344 | int (*config_aneg)(struct phy_device *phydev); | 364 | int (*config_aneg)(struct phy_device *phydev); |
345 | 365 | ||
346 | /* Determines the negotiated speed and duplex */ | 366 | /* Determines the negotiated speed and duplex */ |
@@ -361,6 +381,7 @@ struct phy_driver { | |||
361 | 381 | ||
362 | int phy_read(struct phy_device *phydev, u16 regnum); | 382 | int phy_read(struct phy_device *phydev, u16 regnum); |
363 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val); | 383 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val); |
384 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); | ||
364 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 385 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); |
365 | int phy_clear_interrupt(struct phy_device *phydev); | 386 | int phy_clear_interrupt(struct phy_device *phydev); |
366 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | 387 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); |
diff --git a/include/linux/pim.h b/include/linux/pim.h new file mode 100644 index 000000000000..236ffd317394 --- /dev/null +++ b/include/linux/pim.h | |||
@@ -0,0 +1,45 @@ | |||
1 | #ifndef __LINUX_PIM_H | ||
2 | #define __LINUX_PIM_H | ||
3 | |||
4 | #include <asm/byteorder.h> | ||
5 | |||
6 | #ifndef __KERNEL__ | ||
7 | struct pim { | ||
8 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
9 | __u8 pim_type:4, /* PIM message type */ | ||
10 | pim_ver:4; /* PIM version */ | ||
11 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
12 | __u8 pim_ver:4; /* PIM version */ | ||
13 | pim_type:4; /* PIM message type */ | ||
14 | #endif | ||
15 | __u8 pim_rsv; /* Reserved */ | ||
16 | __be16 pim_cksum; /* Checksum */ | ||
17 | }; | ||
18 | |||
19 | #define PIM_MINLEN 8 | ||
20 | #endif | ||
21 | |||
22 | /* Message types - V1 */ | ||
23 | #define PIM_V1_VERSION __constant_htonl(0x10000000) | ||
24 | #define PIM_V1_REGISTER 1 | ||
25 | |||
26 | /* Message types - V2 */ | ||
27 | #define PIM_VERSION 2 | ||
28 | #define PIM_REGISTER 1 | ||
29 | |||
30 | #if defined(__KERNEL__) | ||
31 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) | ||
32 | |||
33 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ | ||
34 | struct pimreghdr | ||
35 | { | ||
36 | __u8 type; | ||
37 | __u8 reserved; | ||
38 | __be16 csum; | ||
39 | __be32 flags; | ||
40 | }; | ||
41 | |||
42 | struct sk_buff; | ||
43 | extern int pim_rcv_v1(struct sk_buff *); | ||
44 | #endif | ||
45 | #endif | ||
diff --git a/include/linux/security.h b/include/linux/security.h index c673dfd4dffc..f5eb9ff47ac5 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -910,24 +910,24 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
910 | * Security hooks for XFRM operations. | 910 | * Security hooks for XFRM operations. |
911 | * | 911 | * |
912 | * @xfrm_policy_alloc_security: | 912 | * @xfrm_policy_alloc_security: |
913 | * @xp contains the xfrm_policy being added to Security Policy Database | 913 | * @ctxp is a pointer to the xfrm_sec_ctx being added to Security Policy |
914 | * used by the XFRM system. | 914 | * Database used by the XFRM system. |
915 | * @sec_ctx contains the security context information being provided by | 915 | * @sec_ctx contains the security context information being provided by |
916 | * the user-level policy update program (e.g., setkey). | 916 | * the user-level policy update program (e.g., setkey). |
917 | * Allocate a security structure to the xp->security field; the security | 917 | * Allocate a security structure to the xp->security field; the security |
918 | * field is initialized to NULL when the xfrm_policy is allocated. | 918 | * field is initialized to NULL when the xfrm_policy is allocated. |
919 | * Return 0 if operation was successful (memory to allocate, legal context) | 919 | * Return 0 if operation was successful (memory to allocate, legal context) |
920 | * @xfrm_policy_clone_security: | 920 | * @xfrm_policy_clone_security: |
921 | * @old contains an existing xfrm_policy in the SPD. | 921 | * @old_ctx contains an existing xfrm_sec_ctx. |
922 | * @new contains a new xfrm_policy being cloned from old. | 922 | * @new_ctxp contains a new xfrm_sec_ctx being cloned from old. |
923 | * Allocate a security structure to the new->security field | 923 | * Allocate a security structure in new_ctxp that contains the |
924 | * that contains the information from the old->security field. | 924 | * information from the old_ctx structure. |
925 | * Return 0 if operation was successful (memory to allocate). | 925 | * Return 0 if operation was successful (memory to allocate). |
926 | * @xfrm_policy_free_security: | 926 | * @xfrm_policy_free_security: |
927 | * @xp contains the xfrm_policy | 927 | * @ctx contains the xfrm_sec_ctx |
928 | * Deallocate xp->security. | 928 | * Deallocate xp->security. |
929 | * @xfrm_policy_delete_security: | 929 | * @xfrm_policy_delete_security: |
930 | * @xp contains the xfrm_policy. | 930 | * @ctx contains the xfrm_sec_ctx. |
931 | * Authorize deletion of xp->security. | 931 | * Authorize deletion of xp->security. |
932 | * @xfrm_state_alloc_security: | 932 | * @xfrm_state_alloc_security: |
933 | * @x contains the xfrm_state being added to the Security Association | 933 | * @x contains the xfrm_state being added to the Security Association |
@@ -947,7 +947,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
947 | * @x contains the xfrm_state. | 947 | * @x contains the xfrm_state. |
948 | * Authorize deletion of x->security. | 948 | * Authorize deletion of x->security. |
949 | * @xfrm_policy_lookup: | 949 | * @xfrm_policy_lookup: |
950 | * @xp contains the xfrm_policy for which the access control is being | 950 | * @ctx contains the xfrm_sec_ctx for which the access control is being |
951 | * checked. | 951 | * checked. |
952 | * @fl_secid contains the flow security label that is used to authorize | 952 | * @fl_secid contains the flow security label that is used to authorize |
953 | * access to the policy xp. | 953 | * access to the policy xp. |
@@ -1454,17 +1454,17 @@ struct security_operations { | |||
1454 | #endif /* CONFIG_SECURITY_NETWORK */ | 1454 | #endif /* CONFIG_SECURITY_NETWORK */ |
1455 | 1455 | ||
1456 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 1456 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
1457 | int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, | 1457 | int (*xfrm_policy_alloc_security) (struct xfrm_sec_ctx **ctxp, |
1458 | struct xfrm_user_sec_ctx *sec_ctx); | 1458 | struct xfrm_user_sec_ctx *sec_ctx); |
1459 | int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); | 1459 | int (*xfrm_policy_clone_security) (struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctx); |
1460 | void (*xfrm_policy_free_security) (struct xfrm_policy *xp); | 1460 | void (*xfrm_policy_free_security) (struct xfrm_sec_ctx *ctx); |
1461 | int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); | 1461 | int (*xfrm_policy_delete_security) (struct xfrm_sec_ctx *ctx); |
1462 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, | 1462 | int (*xfrm_state_alloc_security) (struct xfrm_state *x, |
1463 | struct xfrm_user_sec_ctx *sec_ctx, | 1463 | struct xfrm_user_sec_ctx *sec_ctx, |
1464 | u32 secid); | 1464 | u32 secid); |
1465 | void (*xfrm_state_free_security) (struct xfrm_state *x); | 1465 | void (*xfrm_state_free_security) (struct xfrm_state *x); |
1466 | int (*xfrm_state_delete_security) (struct xfrm_state *x); | 1466 | int (*xfrm_state_delete_security) (struct xfrm_state *x); |
1467 | int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); | 1467 | int (*xfrm_policy_lookup)(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); |
1468 | int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, | 1468 | int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, |
1469 | struct xfrm_policy *xp, struct flowi *fl); | 1469 | struct xfrm_policy *xp, struct flowi *fl); |
1470 | int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); | 1470 | int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); |
@@ -2562,16 +2562,16 @@ static inline void security_inet_conn_established(struct sock *sk, | |||
2562 | 2562 | ||
2563 | #ifdef CONFIG_SECURITY_NETWORK_XFRM | 2563 | #ifdef CONFIG_SECURITY_NETWORK_XFRM |
2564 | 2564 | ||
2565 | int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); | 2565 | int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx); |
2566 | int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new); | 2566 | int security_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx, struct xfrm_sec_ctx **new_ctxp); |
2567 | void security_xfrm_policy_free(struct xfrm_policy *xp); | 2567 | void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx); |
2568 | int security_xfrm_policy_delete(struct xfrm_policy *xp); | 2568 | int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx); |
2569 | int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); | 2569 | int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); |
2570 | int security_xfrm_state_alloc_acquire(struct xfrm_state *x, | 2570 | int security_xfrm_state_alloc_acquire(struct xfrm_state *x, |
2571 | struct xfrm_sec_ctx *polsec, u32 secid); | 2571 | struct xfrm_sec_ctx *polsec, u32 secid); |
2572 | int security_xfrm_state_delete(struct xfrm_state *x); | 2572 | int security_xfrm_state_delete(struct xfrm_state *x); |
2573 | void security_xfrm_state_free(struct xfrm_state *x); | 2573 | void security_xfrm_state_free(struct xfrm_state *x); |
2574 | int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir); | 2574 | int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir); |
2575 | int security_xfrm_state_pol_flow_match(struct xfrm_state *x, | 2575 | int security_xfrm_state_pol_flow_match(struct xfrm_state *x, |
2576 | struct xfrm_policy *xp, struct flowi *fl); | 2576 | struct xfrm_policy *xp, struct flowi *fl); |
2577 | int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid); | 2577 | int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid); |
@@ -2579,21 +2579,21 @@ void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl); | |||
2579 | 2579 | ||
2580 | #else /* CONFIG_SECURITY_NETWORK_XFRM */ | 2580 | #else /* CONFIG_SECURITY_NETWORK_XFRM */ |
2581 | 2581 | ||
2582 | static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) | 2582 | static inline int security_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp, struct xfrm_user_sec_ctx *sec_ctx) |
2583 | { | 2583 | { |
2584 | return 0; | 2584 | return 0; |
2585 | } | 2585 | } |
2586 | 2586 | ||
2587 | static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) | 2587 | static inline int security_xfrm_policy_clone(struct xfrm_sec_ctx *old, struct xfrm_sec_ctx **new_ctxp) |
2588 | { | 2588 | { |
2589 | return 0; | 2589 | return 0; |
2590 | } | 2590 | } |
2591 | 2591 | ||
2592 | static inline void security_xfrm_policy_free(struct xfrm_policy *xp) | 2592 | static inline void security_xfrm_policy_free(struct xfrm_sec_ctx *ctx) |
2593 | { | 2593 | { |
2594 | } | 2594 | } |
2595 | 2595 | ||
2596 | static inline int security_xfrm_policy_delete(struct xfrm_policy *xp) | 2596 | static inline int security_xfrm_policy_delete(struct xfrm_sec_ctx *ctx) |
2597 | { | 2597 | { |
2598 | return 0; | 2598 | return 0; |
2599 | } | 2599 | } |
@@ -2619,7 +2619,7 @@ static inline int security_xfrm_state_delete(struct xfrm_state *x) | |||
2619 | return 0; | 2619 | return 0; |
2620 | } | 2620 | } |
2621 | 2621 | ||
2622 | static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir) | 2622 | static inline int security_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir) |
2623 | { | 2623 | { |
2624 | return 0; | 2624 | return 0; |
2625 | } | 2625 | } |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 67c2563961f3..1da1e6208a0a 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -62,18 +62,5 @@ extern struct list_head *seq_list_start_head(struct list_head *head, | |||
62 | extern struct list_head *seq_list_next(void *v, struct list_head *head, | 62 | extern struct list_head *seq_list_next(void *v, struct list_head *head, |
63 | loff_t *ppos); | 63 | loff_t *ppos); |
64 | 64 | ||
65 | struct net; | ||
66 | struct seq_net_private { | ||
67 | struct net *net; | ||
68 | }; | ||
69 | |||
70 | int seq_open_net(struct inode *, struct file *, | ||
71 | const struct seq_operations *, int); | ||
72 | int seq_release_net(struct inode *, struct file *); | ||
73 | static inline struct net *seq_file_net(struct seq_file *seq) | ||
74 | { | ||
75 | return ((struct seq_net_private *)seq->private)->net; | ||
76 | } | ||
77 | |||
78 | #endif | 65 | #endif |
79 | #endif | 66 | #endif |
diff --git a/include/linux/seq_file_net.h b/include/linux/seq_file_net.h new file mode 100644 index 000000000000..4ac52542a563 --- /dev/null +++ b/include/linux/seq_file_net.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef __SEQ_FILE_NET_H__ | ||
2 | #define __SEQ_FILE_NET_H__ | ||
3 | |||
4 | #include <linux/seq_file.h> | ||
5 | |||
6 | struct net; | ||
7 | extern struct net init_net; | ||
8 | |||
9 | struct seq_net_private { | ||
10 | #ifdef CONFIG_NET_NS | ||
11 | struct net *net; | ||
12 | #endif | ||
13 | }; | ||
14 | |||
15 | int seq_open_net(struct inode *, struct file *, | ||
16 | const struct seq_operations *, int); | ||
17 | int seq_release_net(struct inode *, struct file *); | ||
18 | static inline struct net *seq_file_net(struct seq_file *seq) | ||
19 | { | ||
20 | #ifdef CONFIG_NET_NS | ||
21 | return ((struct seq_net_private *)seq->private)->net; | ||
22 | #else | ||
23 | return &init_net; | ||
24 | #endif | ||
25 | } | ||
26 | |||
27 | #endif | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bbd8d0027e2f..11fd9f2c4093 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -256,7 +256,10 @@ struct sk_buff { | |||
256 | ktime_t tstamp; | 256 | ktime_t tstamp; |
257 | struct net_device *dev; | 257 | struct net_device *dev; |
258 | 258 | ||
259 | struct dst_entry *dst; | 259 | union { |
260 | struct dst_entry *dst; | ||
261 | struct rtable *rtable; | ||
262 | }; | ||
260 | struct sec_path *sp; | 263 | struct sec_path *sp; |
261 | 264 | ||
262 | /* | 265 | /* |
@@ -310,7 +313,10 @@ struct sk_buff { | |||
310 | __u16 tc_verd; /* traffic control verdict */ | 313 | __u16 tc_verd; /* traffic control verdict */ |
311 | #endif | 314 | #endif |
312 | #endif | 315 | #endif |
313 | /* 2 byte hole */ | 316 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
317 | __u8 ndisc_nodetype:2; | ||
318 | #endif | ||
319 | /* 14 bit hole */ | ||
314 | 320 | ||
315 | #ifdef CONFIG_NET_DMA | 321 | #ifdef CONFIG_NET_DMA |
316 | dma_cookie_t dma_cookie; | 322 | dma_cookie_t dma_cookie; |
@@ -657,11 +663,21 @@ static inline void skb_queue_head_init_class(struct sk_buff_head *list, | |||
657 | } | 663 | } |
658 | 664 | ||
659 | /* | 665 | /* |
660 | * Insert an sk_buff at the start of a list. | 666 | * Insert an sk_buff on a list. |
661 | * | 667 | * |
662 | * The "__skb_xxxx()" functions are the non-atomic ones that | 668 | * The "__skb_xxxx()" functions are the non-atomic ones that |
663 | * can only be called with interrupts disabled. | 669 | * can only be called with interrupts disabled. |
664 | */ | 670 | */ |
671 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); | ||
672 | static inline void __skb_insert(struct sk_buff *newsk, | ||
673 | struct sk_buff *prev, struct sk_buff *next, | ||
674 | struct sk_buff_head *list) | ||
675 | { | ||
676 | newsk->next = next; | ||
677 | newsk->prev = prev; | ||
678 | next->prev = prev->next = newsk; | ||
679 | list->qlen++; | ||
680 | } | ||
665 | 681 | ||
666 | /** | 682 | /** |
667 | * __skb_queue_after - queue a buffer at the list head | 683 | * __skb_queue_after - queue a buffer at the list head |
@@ -678,13 +694,17 @@ static inline void __skb_queue_after(struct sk_buff_head *list, | |||
678 | struct sk_buff *prev, | 694 | struct sk_buff *prev, |
679 | struct sk_buff *newsk) | 695 | struct sk_buff *newsk) |
680 | { | 696 | { |
681 | struct sk_buff *next; | 697 | __skb_insert(newsk, prev, prev->next, list); |
682 | list->qlen++; | 698 | } |
683 | 699 | ||
684 | next = prev->next; | 700 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, |
685 | newsk->next = next; | 701 | struct sk_buff_head *list); |
686 | newsk->prev = prev; | 702 | |
687 | next->prev = prev->next = newsk; | 703 | static inline void __skb_queue_before(struct sk_buff_head *list, |
704 | struct sk_buff *next, | ||
705 | struct sk_buff *newsk) | ||
706 | { | ||
707 | __skb_insert(newsk, next->prev, next, list); | ||
688 | } | 708 | } |
689 | 709 | ||
690 | /** | 710 | /** |
@@ -718,66 +738,7 @@ extern void skb_queue_tail(struct sk_buff_head *list, struct sk_buff *newsk); | |||
718 | static inline void __skb_queue_tail(struct sk_buff_head *list, | 738 | static inline void __skb_queue_tail(struct sk_buff_head *list, |
719 | struct sk_buff *newsk) | 739 | struct sk_buff *newsk) |
720 | { | 740 | { |
721 | struct sk_buff *prev, *next; | 741 | __skb_queue_before(list, (struct sk_buff *)list, newsk); |
722 | |||
723 | list->qlen++; | ||
724 | next = (struct sk_buff *)list; | ||
725 | prev = next->prev; | ||
726 | newsk->next = next; | ||
727 | newsk->prev = prev; | ||
728 | next->prev = prev->next = newsk; | ||
729 | } | ||
730 | |||
731 | |||
732 | /** | ||
733 | * __skb_dequeue - remove from the head of the queue | ||
734 | * @list: list to dequeue from | ||
735 | * | ||
736 | * Remove the head of the list. This function does not take any locks | ||
737 | * so must be used with appropriate locks held only. The head item is | ||
738 | * returned or %NULL if the list is empty. | ||
739 | */ | ||
740 | extern struct sk_buff *skb_dequeue(struct sk_buff_head *list); | ||
741 | static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | ||
742 | { | ||
743 | struct sk_buff *next, *prev, *result; | ||
744 | |||
745 | prev = (struct sk_buff *) list; | ||
746 | next = prev->next; | ||
747 | result = NULL; | ||
748 | if (next != prev) { | ||
749 | result = next; | ||
750 | next = next->next; | ||
751 | list->qlen--; | ||
752 | next->prev = prev; | ||
753 | prev->next = next; | ||
754 | result->next = result->prev = NULL; | ||
755 | } | ||
756 | return result; | ||
757 | } | ||
758 | |||
759 | |||
760 | /* | ||
761 | * Insert a packet on a list. | ||
762 | */ | ||
763 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); | ||
764 | static inline void __skb_insert(struct sk_buff *newsk, | ||
765 | struct sk_buff *prev, struct sk_buff *next, | ||
766 | struct sk_buff_head *list) | ||
767 | { | ||
768 | newsk->next = next; | ||
769 | newsk->prev = prev; | ||
770 | next->prev = prev->next = newsk; | ||
771 | list->qlen++; | ||
772 | } | ||
773 | |||
774 | /* | ||
775 | * Place a packet after a given packet in a list. | ||
776 | */ | ||
777 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); | ||
778 | static inline void __skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list) | ||
779 | { | ||
780 | __skb_insert(newsk, old, old->next, list); | ||
781 | } | 742 | } |
782 | 743 | ||
783 | /* | 744 | /* |
@@ -797,8 +758,22 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | |||
797 | prev->next = next; | 758 | prev->next = next; |
798 | } | 759 | } |
799 | 760 | ||
800 | 761 | /** | |
801 | /* XXX: more streamlined implementation */ | 762 | * __skb_dequeue - remove from the head of the queue |
763 | * @list: list to dequeue from | ||
764 | * | ||
765 | * Remove the head of the list. This function does not take any locks | ||
766 | * so must be used with appropriate locks held only. The head item is | ||
767 | * returned or %NULL if the list is empty. | ||
768 | */ | ||
769 | extern struct sk_buff *skb_dequeue(struct sk_buff_head *list); | ||
770 | static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | ||
771 | { | ||
772 | struct sk_buff *skb = skb_peek(list); | ||
773 | if (skb) | ||
774 | __skb_unlink(skb, list); | ||
775 | return skb; | ||
776 | } | ||
802 | 777 | ||
803 | /** | 778 | /** |
804 | * __skb_dequeue_tail - remove from the tail of the queue | 779 | * __skb_dequeue_tail - remove from the tail of the queue |
@@ -889,6 +864,7 @@ static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) | |||
889 | /* | 864 | /* |
890 | * Add data to an sk_buff | 865 | * Add data to an sk_buff |
891 | */ | 866 | */ |
867 | extern unsigned char *skb_put(struct sk_buff *skb, unsigned int len); | ||
892 | static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | 868 | static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) |
893 | { | 869 | { |
894 | unsigned char *tmp = skb_tail_pointer(skb); | 870 | unsigned char *tmp = skb_tail_pointer(skb); |
@@ -898,26 +874,7 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | |||
898 | return tmp; | 874 | return tmp; |
899 | } | 875 | } |
900 | 876 | ||
901 | /** | 877 | extern unsigned char *skb_push(struct sk_buff *skb, unsigned int len); |
902 | * skb_put - add data to a buffer | ||
903 | * @skb: buffer to use | ||
904 | * @len: amount of data to add | ||
905 | * | ||
906 | * This function extends the used data area of the buffer. If this would | ||
907 | * exceed the total buffer size the kernel will panic. A pointer to the | ||
908 | * first byte of the extra data is returned. | ||
909 | */ | ||
910 | static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len) | ||
911 | { | ||
912 | unsigned char *tmp = skb_tail_pointer(skb); | ||
913 | SKB_LINEAR_ASSERT(skb); | ||
914 | skb->tail += len; | ||
915 | skb->len += len; | ||
916 | if (unlikely(skb->tail > skb->end)) | ||
917 | skb_over_panic(skb, len, current_text_addr()); | ||
918 | return tmp; | ||
919 | } | ||
920 | |||
921 | static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) | 878 | static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) |
922 | { | 879 | { |
923 | skb->data -= len; | 880 | skb->data -= len; |
@@ -925,24 +882,7 @@ static inline unsigned char *__skb_push(struct sk_buff *skb, unsigned int len) | |||
925 | return skb->data; | 882 | return skb->data; |
926 | } | 883 | } |
927 | 884 | ||
928 | /** | 885 | extern unsigned char *skb_pull(struct sk_buff *skb, unsigned int len); |
929 | * skb_push - add data to the start of a buffer | ||
930 | * @skb: buffer to use | ||
931 | * @len: amount of data to add | ||
932 | * | ||
933 | * This function extends the used data area of the buffer at the buffer | ||
934 | * start. If this would exceed the total buffer headroom the kernel will | ||
935 | * panic. A pointer to the first byte of the extra data is returned. | ||
936 | */ | ||
937 | static inline unsigned char *skb_push(struct sk_buff *skb, unsigned int len) | ||
938 | { | ||
939 | skb->data -= len; | ||
940 | skb->len += len; | ||
941 | if (unlikely(skb->data<skb->head)) | ||
942 | skb_under_panic(skb, len, current_text_addr()); | ||
943 | return skb->data; | ||
944 | } | ||
945 | |||
946 | static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) | 886 | static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) |
947 | { | 887 | { |
948 | skb->len -= len; | 888 | skb->len -= len; |
@@ -950,21 +890,6 @@ static inline unsigned char *__skb_pull(struct sk_buff *skb, unsigned int len) | |||
950 | return skb->data += len; | 890 | return skb->data += len; |
951 | } | 891 | } |
952 | 892 | ||
953 | /** | ||
954 | * skb_pull - remove data from the start of a buffer | ||
955 | * @skb: buffer to use | ||
956 | * @len: amount of data to remove | ||
957 | * | ||
958 | * This function removes data from the start of a buffer, returning | ||
959 | * the memory to the headroom. A pointer to the next data in the buffer | ||
960 | * is returned. Once the data has been pulled future pushes will overwrite | ||
961 | * the old data. | ||
962 | */ | ||
963 | static inline unsigned char *skb_pull(struct sk_buff *skb, unsigned int len) | ||
964 | { | ||
965 | return unlikely(len > skb->len) ? NULL : __skb_pull(skb, len); | ||
966 | } | ||
967 | |||
968 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); | 893 | extern unsigned char *__pskb_pull_tail(struct sk_buff *skb, int delta); |
969 | 894 | ||
970 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) | 895 | static inline unsigned char *__pskb_pull(struct sk_buff *skb, unsigned int len) |
@@ -1205,21 +1130,7 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len) | |||
1205 | skb_set_tail_pointer(skb, len); | 1130 | skb_set_tail_pointer(skb, len); |
1206 | } | 1131 | } |
1207 | 1132 | ||
1208 | /** | 1133 | extern void skb_trim(struct sk_buff *skb, unsigned int len); |
1209 | * skb_trim - remove end from a buffer | ||
1210 | * @skb: buffer to alter | ||
1211 | * @len: new length | ||
1212 | * | ||
1213 | * Cut the length of a buffer down by removing data from the tail. If | ||
1214 | * the buffer is already under the length specified it is not modified. | ||
1215 | * The skb must be linear. | ||
1216 | */ | ||
1217 | static inline void skb_trim(struct sk_buff *skb, unsigned int len) | ||
1218 | { | ||
1219 | if (skb->len > len) | ||
1220 | __skb_trim(skb, len); | ||
1221 | } | ||
1222 | |||
1223 | 1134 | ||
1224 | static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) | 1135 | static inline int __pskb_trim(struct sk_buff *skb, unsigned int len) |
1225 | { | 1136 | { |
@@ -1302,22 +1213,7 @@ static inline struct sk_buff *__dev_alloc_skb(unsigned int length, | |||
1302 | return skb; | 1213 | return skb; |
1303 | } | 1214 | } |
1304 | 1215 | ||
1305 | /** | 1216 | extern struct sk_buff *dev_alloc_skb(unsigned int length); |
1306 | * dev_alloc_skb - allocate an skbuff for receiving | ||
1307 | * @length: length to allocate | ||
1308 | * | ||
1309 | * Allocate a new &sk_buff and assign it a usage count of one. The | ||
1310 | * buffer has unspecified headroom built in. Users should allocate | ||
1311 | * the headroom they think they need without accounting for the | ||
1312 | * built in space. The built in space is used for optimisations. | ||
1313 | * | ||
1314 | * %NULL is returned if there is no free memory. Although this function | ||
1315 | * allocates memory it can be called from an interrupt. | ||
1316 | */ | ||
1317 | static inline struct sk_buff *dev_alloc_skb(unsigned int length) | ||
1318 | { | ||
1319 | return __dev_alloc_skb(length, GFP_ATOMIC); | ||
1320 | } | ||
1321 | 1217 | ||
1322 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, | 1218 | extern struct sk_buff *__netdev_alloc_skb(struct net_device *dev, |
1323 | unsigned int length, gfp_t gfp_mask); | 1219 | unsigned int length, gfp_t gfp_mask); |
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h new file mode 100644 index 000000000000..8e0556b8781c --- /dev/null +++ b/include/linux/smc91x.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef __SMC91X_H__ | ||
2 | #define __SMC91X_H__ | ||
3 | |||
4 | #define SMC91X_USE_8BIT (1 << 0) | ||
5 | #define SMC91X_USE_16BIT (1 << 1) | ||
6 | #define SMC91X_USE_32BIT (1 << 2) | ||
7 | |||
8 | struct smc91x_platdata { | ||
9 | unsigned long flags; | ||
10 | unsigned long irq_flags; /* IRQF_... */ | ||
11 | }; | ||
12 | |||
13 | #endif /* __SMC91X_H__ */ | ||
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index db53defde5ee..50dfd0dc4093 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -72,10 +72,18 @@ struct ssb_device; | |||
72 | /* Lowlevel read/write operations on the device MMIO. | 72 | /* Lowlevel read/write operations on the device MMIO. |
73 | * Internal, don't use that outside of ssb. */ | 73 | * Internal, don't use that outside of ssb. */ |
74 | struct ssb_bus_ops { | 74 | struct ssb_bus_ops { |
75 | u8 (*read8)(struct ssb_device *dev, u16 offset); | ||
75 | u16 (*read16)(struct ssb_device *dev, u16 offset); | 76 | u16 (*read16)(struct ssb_device *dev, u16 offset); |
76 | u32 (*read32)(struct ssb_device *dev, u16 offset); | 77 | u32 (*read32)(struct ssb_device *dev, u16 offset); |
78 | void (*write8)(struct ssb_device *dev, u16 offset, u8 value); | ||
77 | void (*write16)(struct ssb_device *dev, u16 offset, u16 value); | 79 | void (*write16)(struct ssb_device *dev, u16 offset, u16 value); |
78 | void (*write32)(struct ssb_device *dev, u16 offset, u32 value); | 80 | void (*write32)(struct ssb_device *dev, u16 offset, u32 value); |
81 | #ifdef CONFIG_SSB_BLOCKIO | ||
82 | void (*block_read)(struct ssb_device *dev, void *buffer, | ||
83 | size_t count, u16 offset, u8 reg_width); | ||
84 | void (*block_write)(struct ssb_device *dev, const void *buffer, | ||
85 | size_t count, u16 offset, u8 reg_width); | ||
86 | #endif | ||
79 | }; | 87 | }; |
80 | 88 | ||
81 | 89 | ||
@@ -247,9 +255,9 @@ struct ssb_bus { | |||
247 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ | 255 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ |
248 | struct pcmcia_device *host_pcmcia; | 256 | struct pcmcia_device *host_pcmcia; |
249 | 257 | ||
250 | #ifdef CONFIG_SSB_PCIHOST | 258 | #ifdef CONFIG_SSB_SPROM |
251 | /* Mutex to protect the SPROM writing. */ | 259 | /* Mutex to protect the SPROM writing. */ |
252 | struct mutex pci_sprom_mutex; | 260 | struct mutex sprom_mutex; |
253 | #endif | 261 | #endif |
254 | 262 | ||
255 | /* ID information about the Chip. */ | 263 | /* ID information about the Chip. */ |
@@ -262,9 +270,6 @@ struct ssb_bus { | |||
262 | struct ssb_device devices[SSB_MAX_NR_CORES]; | 270 | struct ssb_device devices[SSB_MAX_NR_CORES]; |
263 | u8 nr_devices; | 271 | u8 nr_devices; |
264 | 272 | ||
265 | /* Reference count. Number of suspended devices. */ | ||
266 | u8 suspend_cnt; | ||
267 | |||
268 | /* Software ID number for this bus. */ | 273 | /* Software ID number for this bus. */ |
269 | unsigned int busnumber; | 274 | unsigned int busnumber; |
270 | 275 | ||
@@ -336,6 +341,13 @@ extern int ssb_bus_pcmciabus_register(struct ssb_bus *bus, | |||
336 | 341 | ||
337 | extern void ssb_bus_unregister(struct ssb_bus *bus); | 342 | extern void ssb_bus_unregister(struct ssb_bus *bus); |
338 | 343 | ||
344 | /* Suspend a SSB bus. | ||
345 | * Call this from the parent bus suspend routine. */ | ||
346 | extern int ssb_bus_suspend(struct ssb_bus *bus); | ||
347 | /* Resume a SSB bus. | ||
348 | * Call this from the parent bus resume routine. */ | ||
349 | extern int ssb_bus_resume(struct ssb_bus *bus); | ||
350 | |||
339 | extern u32 ssb_clockspeed(struct ssb_bus *bus); | 351 | extern u32 ssb_clockspeed(struct ssb_bus *bus); |
340 | 352 | ||
341 | /* Is the device enabled in hardware? */ | 353 | /* Is the device enabled in hardware? */ |
@@ -348,6 +360,10 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags); | |||
348 | 360 | ||
349 | 361 | ||
350 | /* Device MMIO register read/write functions. */ | 362 | /* Device MMIO register read/write functions. */ |
363 | static inline u8 ssb_read8(struct ssb_device *dev, u16 offset) | ||
364 | { | ||
365 | return dev->ops->read8(dev, offset); | ||
366 | } | ||
351 | static inline u16 ssb_read16(struct ssb_device *dev, u16 offset) | 367 | static inline u16 ssb_read16(struct ssb_device *dev, u16 offset) |
352 | { | 368 | { |
353 | return dev->ops->read16(dev, offset); | 369 | return dev->ops->read16(dev, offset); |
@@ -356,6 +372,10 @@ static inline u32 ssb_read32(struct ssb_device *dev, u16 offset) | |||
356 | { | 372 | { |
357 | return dev->ops->read32(dev, offset); | 373 | return dev->ops->read32(dev, offset); |
358 | } | 374 | } |
375 | static inline void ssb_write8(struct ssb_device *dev, u16 offset, u8 value) | ||
376 | { | ||
377 | dev->ops->write8(dev, offset, value); | ||
378 | } | ||
359 | static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value) | 379 | static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value) |
360 | { | 380 | { |
361 | dev->ops->write16(dev, offset, value); | 381 | dev->ops->write16(dev, offset, value); |
@@ -364,6 +384,19 @@ static inline void ssb_write32(struct ssb_device *dev, u16 offset, u32 value) | |||
364 | { | 384 | { |
365 | dev->ops->write32(dev, offset, value); | 385 | dev->ops->write32(dev, offset, value); |
366 | } | 386 | } |
387 | #ifdef CONFIG_SSB_BLOCKIO | ||
388 | static inline void ssb_block_read(struct ssb_device *dev, void *buffer, | ||
389 | size_t count, u16 offset, u8 reg_width) | ||
390 | { | ||
391 | dev->ops->block_read(dev, buffer, count, offset, reg_width); | ||
392 | } | ||
393 | |||
394 | static inline void ssb_block_write(struct ssb_device *dev, const void *buffer, | ||
395 | size_t count, u16 offset, u8 reg_width) | ||
396 | { | ||
397 | dev->ops->block_write(dev, buffer, count, offset, reg_width); | ||
398 | } | ||
399 | #endif /* CONFIG_SSB_BLOCKIO */ | ||
367 | 400 | ||
368 | 401 | ||
369 | /* Translation (routing) bits that need to be ORed to DMA | 402 | /* Translation (routing) bits that need to be ORed to DMA |
@@ -416,5 +449,12 @@ extern int ssb_bus_powerup(struct ssb_bus *bus, bool dynamic_pctl); | |||
416 | extern u32 ssb_admatch_base(u32 adm); | 449 | extern u32 ssb_admatch_base(u32 adm); |
417 | extern u32 ssb_admatch_size(u32 adm); | 450 | extern u32 ssb_admatch_size(u32 adm); |
418 | 451 | ||
452 | /* PCI device mapping and fixup routines. | ||
453 | * Called from the architecture pcibios init code. | ||
454 | * These are only available on SSB_EMBEDDED configurations. */ | ||
455 | #ifdef CONFIG_SSB_EMBEDDED | ||
456 | int ssb_pcibios_plat_dev_init(struct pci_dev *dev); | ||
457 | int ssb_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
458 | #endif /* CONFIG_SSB_EMBEDDED */ | ||
419 | 459 | ||
420 | #endif /* LINUX_SSB_H_ */ | 460 | #endif /* LINUX_SSB_H_ */ |
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 536851b946f6..7d7e03dcf77c 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
@@ -367,8 +367,7 @@ static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) | |||
367 | 367 | ||
368 | extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); | 368 | extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); |
369 | 369 | ||
370 | #include <linux/pm.h> | 370 | extern void ssb_chipco_suspend(struct ssb_chipcommon *cc); |
371 | extern void ssb_chipco_suspend(struct ssb_chipcommon *cc, pm_message_t state); | ||
372 | extern void ssb_chipco_resume(struct ssb_chipcommon *cc); | 371 | extern void ssb_chipco_resume(struct ssb_chipcommon *cc); |
373 | 372 | ||
374 | extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc, | 373 | extern void ssb_chipco_get_clockcpu(struct ssb_chipcommon *cc, |
@@ -390,6 +389,10 @@ extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, | |||
390 | extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, | 389 | extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, |
391 | u32 ticks); | 390 | u32 ticks); |
392 | 391 | ||
392 | void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value); | ||
393 | |||
394 | u32 ssb_chipco_irq_status(struct ssb_chipcommon *cc, u32 mask); | ||
395 | |||
393 | /* Chipcommon GPIO pin access. */ | 396 | /* Chipcommon GPIO pin access. */ |
394 | u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask); | 397 | u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask); |
395 | u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value); | 398 | u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value); |
diff --git a/include/linux/ssb/ssb_driver_gige.h b/include/linux/ssb/ssb_driver_gige.h new file mode 100644 index 000000000000..01fbdf5fef22 --- /dev/null +++ b/include/linux/ssb/ssb_driver_gige.h | |||
@@ -0,0 +1,174 @@ | |||
1 | #ifndef LINUX_SSB_DRIVER_GIGE_H_ | ||
2 | #define LINUX_SSB_DRIVER_GIGE_H_ | ||
3 | |||
4 | #include <linux/ssb/ssb.h> | ||
5 | #include <linux/pci.h> | ||
6 | #include <linux/spinlock.h> | ||
7 | |||
8 | |||
9 | #ifdef CONFIG_SSB_DRIVER_GIGE | ||
10 | |||
11 | |||
12 | #define SSB_GIGE_PCIIO 0x0000 /* PCI I/O Registers (1024 bytes) */ | ||
13 | #define SSB_GIGE_RESERVED 0x0400 /* Reserved (1024 bytes) */ | ||
14 | #define SSB_GIGE_PCICFG 0x0800 /* PCI config space (256 bytes) */ | ||
15 | #define SSB_GIGE_SHIM_FLUSHSTAT 0x0C00 /* PCI to OCP: Flush status control (32bit) */ | ||
16 | #define SSB_GIGE_SHIM_FLUSHRDA 0x0C04 /* PCI to OCP: Flush read address (32bit) */ | ||
17 | #define SSB_GIGE_SHIM_FLUSHTO 0x0C08 /* PCI to OCP: Flush timeout counter (32bit) */ | ||
18 | #define SSB_GIGE_SHIM_BARRIER 0x0C0C /* PCI to OCP: Barrier register (32bit) */ | ||
19 | #define SSB_GIGE_SHIM_MAOCPSI 0x0C10 /* PCI to OCP: MaocpSI Control (32bit) */ | ||
20 | #define SSB_GIGE_SHIM_SIOCPMA 0x0C14 /* PCI to OCP: SiocpMa Control (32bit) */ | ||
21 | |||
22 | /* TM Status High flags */ | ||
23 | #define SSB_GIGE_TMSHIGH_RGMII 0x00010000 /* Have an RGMII PHY-bus */ | ||
24 | /* TM Status Low flags */ | ||
25 | #define SSB_GIGE_TMSLOW_TXBYPASS 0x00080000 /* TX bypass (no delay) */ | ||
26 | #define SSB_GIGE_TMSLOW_RXBYPASS 0x00100000 /* RX bypass (no delay) */ | ||
27 | #define SSB_GIGE_TMSLOW_DLLEN 0x01000000 /* Enable DLL controls */ | ||
28 | |||
29 | /* Boardflags (low) */ | ||
30 | #define SSB_GIGE_BFL_ROBOSWITCH 0x0010 | ||
31 | |||
32 | |||
33 | #define SSB_GIGE_MEM_RES_NAME "SSB Broadcom 47xx GigE memory" | ||
34 | #define SSB_GIGE_IO_RES_NAME "SSB Broadcom 47xx GigE I/O" | ||
35 | |||
36 | struct ssb_gige { | ||
37 | struct ssb_device *dev; | ||
38 | |||
39 | spinlock_t lock; | ||
40 | |||
41 | /* True, if the device has an RGMII bus. | ||
42 | * False, if the device has a GMII bus. */ | ||
43 | bool has_rgmii; | ||
44 | |||
45 | /* The PCI controller device. */ | ||
46 | struct pci_controller pci_controller; | ||
47 | struct pci_ops pci_ops; | ||
48 | struct resource mem_resource; | ||
49 | struct resource io_resource; | ||
50 | }; | ||
51 | |||
52 | /* Check whether a PCI device is a SSB Gigabit Ethernet core. */ | ||
53 | extern bool pdev_is_ssb_gige_core(struct pci_dev *pdev); | ||
54 | |||
55 | /* Convert a pci_dev pointer to a ssb_gige pointer. */ | ||
56 | static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev) | ||
57 | { | ||
58 | if (!pdev_is_ssb_gige_core(pdev)) | ||
59 | return NULL; | ||
60 | return container_of(pdev->bus->ops, struct ssb_gige, pci_ops); | ||
61 | } | ||
62 | |||
63 | /* Returns whether the PHY is connected by an RGMII bus. */ | ||
64 | static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev) | ||
65 | { | ||
66 | struct ssb_gige *dev = pdev_to_ssb_gige(pdev); | ||
67 | return (dev ? dev->has_rgmii : 0); | ||
68 | } | ||
69 | |||
70 | /* Returns whether we have a Roboswitch. */ | ||
71 | static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev) | ||
72 | { | ||
73 | struct ssb_gige *dev = pdev_to_ssb_gige(pdev); | ||
74 | if (dev) | ||
75 | return !!(dev->dev->bus->sprom.boardflags_lo & | ||
76 | SSB_GIGE_BFL_ROBOSWITCH); | ||
77 | return 0; | ||
78 | } | ||
79 | |||
80 | /* Returns whether we can only do one DMA at once. */ | ||
81 | static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev) | ||
82 | { | ||
83 | struct ssb_gige *dev = pdev_to_ssb_gige(pdev); | ||
84 | if (dev) | ||
85 | return ((dev->dev->bus->chip_id == 0x4785) && | ||
86 | (dev->dev->bus->chip_rev < 2)); | ||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | /* Returns whether we must flush posted writes. */ | ||
91 | static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev) | ||
92 | { | ||
93 | struct ssb_gige *dev = pdev_to_ssb_gige(pdev); | ||
94 | if (dev) | ||
95 | return (dev->dev->bus->chip_id == 0x4785); | ||
96 | return 0; | ||
97 | } | ||
98 | |||
99 | extern char * nvram_get(const char *name); | ||
100 | /* Get the device MAC address */ | ||
101 | static inline void ssb_gige_get_macaddr(struct pci_dev *pdev, u8 *macaddr) | ||
102 | { | ||
103 | #ifdef CONFIG_BCM947XX | ||
104 | char *res = nvram_get("et0macaddr"); | ||
105 | if (res) | ||
106 | memcpy(macaddr, res, 6); | ||
107 | #endif | ||
108 | } | ||
109 | |||
110 | extern int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, | ||
111 | struct pci_dev *pdev); | ||
112 | extern int ssb_gige_map_irq(struct ssb_device *sdev, | ||
113 | const struct pci_dev *pdev); | ||
114 | |||
115 | /* The GigE driver is not a standalone module, because we don't have support | ||
116 | * for unregistering the driver. So we could not unload the module anyway. */ | ||
117 | extern int ssb_gige_init(void); | ||
118 | static inline void ssb_gige_exit(void) | ||
119 | { | ||
120 | /* Currently we can not unregister the GigE driver, | ||
121 | * because we can not unregister the PCI bridge. */ | ||
122 | BUG(); | ||
123 | } | ||
124 | |||
125 | |||
126 | #else /* CONFIG_SSB_DRIVER_GIGE */ | ||
127 | /* Gigabit Ethernet driver disabled */ | ||
128 | |||
129 | |||
130 | static inline int ssb_gige_pcibios_plat_dev_init(struct ssb_device *sdev, | ||
131 | struct pci_dev *pdev) | ||
132 | { | ||
133 | return -ENOSYS; | ||
134 | } | ||
135 | static inline int ssb_gige_map_irq(struct ssb_device *sdev, | ||
136 | const struct pci_dev *pdev) | ||
137 | { | ||
138 | return -ENOSYS; | ||
139 | } | ||
140 | static inline int ssb_gige_init(void) | ||
141 | { | ||
142 | return 0; | ||
143 | } | ||
144 | static inline void ssb_gige_exit(void) | ||
145 | { | ||
146 | } | ||
147 | |||
148 | static inline bool pdev_is_ssb_gige_core(struct pci_dev *pdev) | ||
149 | { | ||
150 | return 0; | ||
151 | } | ||
152 | static inline struct ssb_gige * pdev_to_ssb_gige(struct pci_dev *pdev) | ||
153 | { | ||
154 | return NULL; | ||
155 | } | ||
156 | static inline bool ssb_gige_is_rgmii(struct pci_dev *pdev) | ||
157 | { | ||
158 | return 0; | ||
159 | } | ||
160 | static inline bool ssb_gige_have_roboswitch(struct pci_dev *pdev) | ||
161 | { | ||
162 | return 0; | ||
163 | } | ||
164 | static inline bool ssb_gige_one_dma_at_once(struct pci_dev *pdev) | ||
165 | { | ||
166 | return 0; | ||
167 | } | ||
168 | static inline bool ssb_gige_must_flush_posted_writes(struct pci_dev *pdev) | ||
169 | { | ||
170 | return 0; | ||
171 | } | ||
172 | |||
173 | #endif /* CONFIG_SSB_DRIVER_GIGE */ | ||
174 | #endif /* LINUX_SSB_DRIVER_GIGE_H_ */ | ||
diff --git a/include/linux/ssb/ssb_driver_pci.h b/include/linux/ssb/ssb_driver_pci.h index 5e25bac4ed31..41e330e51c2a 100644 --- a/include/linux/ssb/ssb_driver_pci.h +++ b/include/linux/ssb/ssb_driver_pci.h | |||
@@ -1,6 +1,11 @@ | |||
1 | #ifndef LINUX_SSB_PCICORE_H_ | 1 | #ifndef LINUX_SSB_PCICORE_H_ |
2 | #define LINUX_SSB_PCICORE_H_ | 2 | #define LINUX_SSB_PCICORE_H_ |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
6 | struct pci_dev; | ||
7 | |||
8 | |||
4 | #ifdef CONFIG_SSB_DRIVER_PCICORE | 9 | #ifdef CONFIG_SSB_DRIVER_PCICORE |
5 | 10 | ||
6 | /* PCI core registers. */ | 11 | /* PCI core registers. */ |
@@ -88,6 +93,9 @@ extern void ssb_pcicore_init(struct ssb_pcicore *pc); | |||
88 | extern int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, | 93 | extern int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, |
89 | struct ssb_device *dev); | 94 | struct ssb_device *dev); |
90 | 95 | ||
96 | int ssb_pcicore_plat_dev_init(struct pci_dev *d); | ||
97 | int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin); | ||
98 | |||
91 | 99 | ||
92 | #else /* CONFIG_SSB_DRIVER_PCICORE */ | 100 | #else /* CONFIG_SSB_DRIVER_PCICORE */ |
93 | 101 | ||
@@ -107,5 +115,16 @@ int ssb_pcicore_dev_irqvecs_enable(struct ssb_pcicore *pc, | |||
107 | return 0; | 115 | return 0; |
108 | } | 116 | } |
109 | 117 | ||
118 | static inline | ||
119 | int ssb_pcicore_plat_dev_init(struct pci_dev *d) | ||
120 | { | ||
121 | return -ENODEV; | ||
122 | } | ||
123 | static inline | ||
124 | int ssb_pcicore_pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | ||
125 | { | ||
126 | return -ENODEV; | ||
127 | } | ||
128 | |||
110 | #endif /* CONFIG_SSB_DRIVER_PCICORE */ | 129 | #endif /* CONFIG_SSB_DRIVER_PCICORE */ |
111 | #endif /* LINUX_SSB_PCICORE_H_ */ | 130 | #endif /* LINUX_SSB_PCICORE_H_ */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 08027f1d7f31..d96d9b122304 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -239,6 +239,11 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | |||
239 | return (struct tcp_request_sock *)req; | 239 | return (struct tcp_request_sock *)req; |
240 | } | 240 | } |
241 | 241 | ||
242 | struct tcp_deferred_accept_info { | ||
243 | struct sock *listen_sk; | ||
244 | struct request_sock *request; | ||
245 | }; | ||
246 | |||
242 | struct tcp_sock { | 247 | struct tcp_sock { |
243 | /* inet_connection_sock has to be the first member of tcp_sock */ | 248 | /* inet_connection_sock has to be the first member of tcp_sock */ |
244 | struct inet_connection_sock inet_conn; | 249 | struct inet_connection_sock inet_conn; |
@@ -374,6 +379,8 @@ struct tcp_sock { | |||
374 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 379 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
375 | int linger2; | 380 | int linger2; |
376 | 381 | ||
382 | struct tcp_deferred_accept_info defer_tcp_accept; | ||
383 | |||
377 | unsigned long last_synq_overflow; | 384 | unsigned long last_synq_overflow; |
378 | 385 | ||
379 | u32 tso_deferred; | 386 | u32 tso_deferred; |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 8ec703f462da..581ca2c14c52 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -26,15 +26,6 @@ struct udphdr { | |||
26 | __sum16 check; | 26 | __sum16 check; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | #ifdef __KERNEL__ | ||
30 | #include <linux/skbuff.h> | ||
31 | |||
32 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | ||
33 | { | ||
34 | return (struct udphdr *)skb_transport_header(skb); | ||
35 | } | ||
36 | #endif | ||
37 | |||
38 | /* UDP socket options */ | 29 | /* UDP socket options */ |
39 | #define UDP_CORK 1 /* Never send partially complete segments */ | 30 | #define UDP_CORK 1 /* Never send partially complete segments */ |
40 | #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ | 31 | #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ |
@@ -45,9 +36,14 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | |||
45 | #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ | 36 | #define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */ |
46 | 37 | ||
47 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
48 | #include <linux/types.h> | ||
49 | |||
50 | #include <net/inet_sock.h> | 39 | #include <net/inet_sock.h> |
40 | #include <linux/skbuff.h> | ||
41 | |||
42 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | ||
43 | { | ||
44 | return (struct udphdr *)skb_transport_header(skb); | ||
45 | } | ||
46 | |||
51 | #define UDP_HTABLE_SIZE 128 | 47 | #define UDP_HTABLE_SIZE 128 |
52 | 48 | ||
53 | struct udp_sock { | 49 | struct udp_sock { |
@@ -82,6 +78,7 @@ static inline struct udp_sock *udp_sk(const struct sock *sk) | |||
82 | { | 78 | { |
83 | return (struct udp_sock *)sk; | 79 | return (struct udp_sock *)sk; |
84 | } | 80 | } |
81 | |||
85 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) | 82 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) |
86 | 83 | ||
87 | #endif | 84 | #endif |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 3160dfed73ca..2864b1699ecc 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -455,6 +455,7 @@ | |||
455 | #define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */ | 455 | #define IW_MODE_REPEAT 4 /* Wireless Repeater (forwarder) */ |
456 | #define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */ | 456 | #define IW_MODE_SECOND 5 /* Secondary master/repeater (backup) */ |
457 | #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ | 457 | #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ |
458 | #define IW_MODE_MESH 7 /* Mesh (IEEE 802.11s) network */ | ||
458 | 459 | ||
459 | /* Statistics flags (bitmask in updated) */ | 460 | /* Statistics flags (bitmask in updated) */ |
460 | #define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */ | 461 | #define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */ |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index e31b8c84f2c9..0c82c80b277f 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -113,7 +113,8 @@ enum | |||
113 | { | 113 | { |
114 | XFRM_POLICY_TYPE_MAIN = 0, | 114 | XFRM_POLICY_TYPE_MAIN = 0, |
115 | XFRM_POLICY_TYPE_SUB = 1, | 115 | XFRM_POLICY_TYPE_SUB = 1, |
116 | XFRM_POLICY_TYPE_MAX = 2 | 116 | XFRM_POLICY_TYPE_MAX = 2, |
117 | XFRM_POLICY_TYPE_ANY = 255 | ||
117 | }; | 118 | }; |
118 | 119 | ||
119 | enum | 120 | enum |