diff options
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/compat.h | 3 | ||||
-rw-r--r-- | include/net/ieee80211.h | 9 | ||||
-rw-r--r-- | include/net/ieee80211softmac.h | 40 | ||||
-rw-r--r-- | include/net/ieee80211softmac_wx.h | 5 | ||||
-rw-r--r-- | include/net/ip.h | 1 | ||||
-rw-r--r-- | include/net/llc_if.h | 17 | ||||
-rw-r--r-- | include/net/netdma.h | 44 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack.h | 5 | ||||
-rw-r--r-- | include/net/netfilter/nf_conntrack_compat.h | 26 | ||||
-rw-r--r-- | include/net/raw.h | 2 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 2 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 3 | ||||
-rw-r--r-- | include/net/sock.h | 20 | ||||
-rw-r--r-- | include/net/tcp.h | 15 | ||||
-rw-r--r-- | include/net/xfrm.h | 26 |
15 files changed, 183 insertions, 35 deletions
diff --git a/include/net/compat.h b/include/net/compat.h index da680272cf6e..9859b60280d5 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -2,6 +2,8 @@ | |||
2 | #define NET_COMPAT_H | 2 | #define NET_COMPAT_H |
3 | 3 | ||
4 | 4 | ||
5 | struct sock; | ||
6 | |||
5 | #if defined(CONFIG_COMPAT) | 7 | #if defined(CONFIG_COMPAT) |
6 | 8 | ||
7 | #include <linux/compat.h> | 9 | #include <linux/compat.h> |
@@ -22,7 +24,6 @@ struct compat_cmsghdr { | |||
22 | compat_int_t cmsg_type; | 24 | compat_int_t cmsg_type; |
23 | }; | 25 | }; |
24 | 26 | ||
25 | struct sock; | ||
26 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | 27 | extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); |
27 | 28 | ||
28 | #else /* defined(CONFIG_COMPAT) */ | 29 | #else /* defined(CONFIG_COMPAT) */ |
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h index d5926bfb1fc9..d5147770ad47 100644 --- a/include/net/ieee80211.h +++ b/include/net/ieee80211.h | |||
@@ -29,7 +29,7 @@ | |||
29 | #include <linux/kernel.h> /* ARRAY_SIZE */ | 29 | #include <linux/kernel.h> /* ARRAY_SIZE */ |
30 | #include <linux/wireless.h> | 30 | #include <linux/wireless.h> |
31 | 31 | ||
32 | #define IEEE80211_VERSION "git-1.1.7" | 32 | #define IEEE80211_VERSION "git-1.1.13" |
33 | 33 | ||
34 | #define IEEE80211_DATA_LEN 2304 | 34 | #define IEEE80211_DATA_LEN 2304 |
35 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section | 35 | /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section |
@@ -104,6 +104,9 @@ | |||
104 | #define IEEE80211_SCTL_FRAG 0x000F | 104 | #define IEEE80211_SCTL_FRAG 0x000F |
105 | #define IEEE80211_SCTL_SEQ 0xFFF0 | 105 | #define IEEE80211_SCTL_SEQ 0xFFF0 |
106 | 106 | ||
107 | /* QOS control */ | ||
108 | #define IEEE80211_QCTL_TID 0x000F | ||
109 | |||
107 | /* debug macros */ | 110 | /* debug macros */ |
108 | 111 | ||
109 | #ifdef CONFIG_IEEE80211_DEBUG | 112 | #ifdef CONFIG_IEEE80211_DEBUG |
@@ -1075,6 +1078,7 @@ struct ieee80211_device { | |||
1075 | 1078 | ||
1076 | int (*handle_management) (struct net_device * dev, | 1079 | int (*handle_management) (struct net_device * dev, |
1077 | struct ieee80211_network * network, u16 type); | 1080 | struct ieee80211_network * network, u16 type); |
1081 | int (*is_qos_active) (struct net_device *dev, struct sk_buff *skb); | ||
1078 | 1082 | ||
1079 | /* Typical STA methods */ | 1083 | /* Typical STA methods */ |
1080 | int (*handle_auth) (struct net_device * dev, | 1084 | int (*handle_auth) (struct net_device * dev, |
@@ -1243,7 +1247,8 @@ extern int ieee80211_set_encryption(struct ieee80211_device *ieee); | |||
1243 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); | 1247 | extern int ieee80211_xmit(struct sk_buff *skb, struct net_device *dev); |
1244 | extern void ieee80211_txb_free(struct ieee80211_txb *); | 1248 | extern void ieee80211_txb_free(struct ieee80211_txb *); |
1245 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, | 1249 | extern int ieee80211_tx_frame(struct ieee80211_device *ieee, |
1246 | struct ieee80211_hdr *frame, int len); | 1250 | struct ieee80211_hdr *frame, int hdr_len, |
1251 | int total_len, int encrypt_mpdu); | ||
1247 | 1252 | ||
1248 | /* ieee80211_rx.c */ | 1253 | /* ieee80211_rx.c */ |
1249 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, | 1254 | extern int ieee80211_rx(struct ieee80211_device *ieee, struct sk_buff *skb, |
diff --git a/include/net/ieee80211softmac.h b/include/net/ieee80211softmac.h index 052ed596a4e4..7a483ab4022f 100644 --- a/include/net/ieee80211softmac.h +++ b/include/net/ieee80211softmac.h | |||
@@ -86,6 +86,9 @@ struct ieee80211softmac_assoc_info { | |||
86 | 86 | ||
87 | /* BSSID we're trying to associate to */ | 87 | /* BSSID we're trying to associate to */ |
88 | char bssid[ETH_ALEN]; | 88 | char bssid[ETH_ALEN]; |
89 | |||
90 | /* Rates supported by the network */ | ||
91 | struct ieee80211softmac_ratesinfo supported_rates; | ||
89 | 92 | ||
90 | /* some flags. | 93 | /* some flags. |
91 | * static_essid is valid if the essid is constant, | 94 | * static_essid is valid if the essid is constant, |
@@ -132,23 +135,26 @@ enum { | |||
132 | struct ieee80211softmac_txrates { | 135 | struct ieee80211softmac_txrates { |
133 | /* The Bit-Rate to be used for multicast frames. */ | 136 | /* The Bit-Rate to be used for multicast frames. */ |
134 | u8 mcast_rate; | 137 | u8 mcast_rate; |
135 | /* The Bit-Rate to be used for multicast fallback | 138 | |
136 | * (If the device supports fallback and hardware-retry) | 139 | /* The Bit-Rate to be used for multicast management frames. */ |
137 | */ | 140 | u8 mgt_mcast_rate; |
138 | u8 mcast_fallback; | 141 | |
139 | /* The Bit-Rate to be used for any other (normal) data packet. */ | 142 | /* The Bit-Rate to be used for any other (normal) data packet. */ |
140 | u8 default_rate; | 143 | u8 default_rate; |
141 | /* The Bit-Rate to be used for default fallback | 144 | /* The Bit-Rate to be used for default fallback |
142 | * (If the device supports fallback and hardware-retry) | 145 | * (If the device supports fallback and hardware-retry) |
143 | */ | 146 | */ |
144 | u8 default_fallback; | 147 | u8 default_fallback; |
148 | |||
149 | /* This is the rate that the user asked for */ | ||
150 | u8 user_rate; | ||
145 | }; | 151 | }; |
146 | 152 | ||
147 | /* Bits for txrates_change callback. */ | 153 | /* Bits for txrates_change callback. */ |
148 | #define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */ | 154 | #define IEEE80211SOFTMAC_TXRATECHG_DEFAULT (1 << 0) /* default_rate */ |
149 | #define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */ | 155 | #define IEEE80211SOFTMAC_TXRATECHG_DEFAULT_FBACK (1 << 1) /* default_fallback */ |
150 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ | 156 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST (1 << 2) /* mcast_rate */ |
151 | #define IEEE80211SOFTMAC_TXRATECHG_MCAST_FBACK (1 << 3) /* mcast_fallback */ | 157 | #define IEEE80211SOFTMAC_TXRATECHG_MGT_MCAST (1 << 3) /* mgt_mcast_rate */ |
152 | 158 | ||
153 | struct ieee80211softmac_device { | 159 | struct ieee80211softmac_device { |
154 | /* 802.11 structure for data stuff */ | 160 | /* 802.11 structure for data stuff */ |
@@ -250,6 +256,28 @@ extern void ieee80211softmac_fragment_lost(struct net_device *dev, | |||
250 | * Note that the rates need to be sorted. */ | 256 | * Note that the rates need to be sorted. */ |
251 | extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); | 257 | extern void ieee80211softmac_set_rates(struct net_device *dev, u8 count, u8 *rates); |
252 | 258 | ||
259 | /* Helper function which advises you the rate at which a frame should be | ||
260 | * transmitted at. */ | ||
261 | static inline u8 ieee80211softmac_suggest_txrate(struct ieee80211softmac_device *mac, | ||
262 | int is_multicast, | ||
263 | int is_mgt) | ||
264 | { | ||
265 | struct ieee80211softmac_txrates *txrates = &mac->txrates; | ||
266 | |||
267 | if (!mac->associated) | ||
268 | return txrates->mgt_mcast_rate; | ||
269 | |||
270 | /* We are associated, sending unicast frame */ | ||
271 | if (!is_multicast) | ||
272 | return txrates->default_rate; | ||
273 | |||
274 | /* We are associated, sending multicast frame */ | ||
275 | if (is_mgt) | ||
276 | return txrates->mgt_mcast_rate; | ||
277 | else | ||
278 | return txrates->mcast_rate; | ||
279 | } | ||
280 | |||
253 | /* Start the SoftMAC. Call this after you initialized the device | 281 | /* Start the SoftMAC. Call this after you initialized the device |
254 | * and it is ready to run. | 282 | * and it is ready to run. |
255 | */ | 283 | */ |
@@ -282,7 +310,7 @@ extern void ieee80211softmac_stop(struct net_device *dev); | |||
282 | * - context set to the context data you want passed | 310 | * - context set to the context data you want passed |
283 | * The return value is 0, or an error. | 311 | * The return value is 0, or an error. |
284 | */ | 312 | */ |
285 | typedef void (*notify_function_ptr)(struct net_device *dev, void *context); | 313 | typedef void (*notify_function_ptr)(struct net_device *dev, int event_type, void *context); |
286 | 314 | ||
287 | #define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL); | 315 | #define ieee80211softmac_notify(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_KERNEL); |
288 | #define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC); | 316 | #define ieee80211softmac_notify_atomic(dev, event, fun, context) ieee80211softmac_notify_gfp(dev, event, fun, context, GFP_ATOMIC); |
diff --git a/include/net/ieee80211softmac_wx.h b/include/net/ieee80211softmac_wx.h index 3e0be453ecea..4ee3ad57283f 100644 --- a/include/net/ieee80211softmac_wx.h +++ b/include/net/ieee80211softmac_wx.h | |||
@@ -91,4 +91,9 @@ ieee80211softmac_wx_get_genie(struct net_device *dev, | |||
91 | struct iw_request_info *info, | 91 | struct iw_request_info *info, |
92 | union iwreq_data *wrqu, | 92 | union iwreq_data *wrqu, |
93 | char *extra); | 93 | char *extra); |
94 | extern int | ||
95 | ieee80211softmac_wx_set_mlme(struct net_device *dev, | ||
96 | struct iw_request_info *info, | ||
97 | union iwreq_data *wrqu, | ||
98 | char *extra); | ||
94 | #endif /* _IEEE80211SOFTMAC_WX */ | 99 | #endif /* _IEEE80211SOFTMAC_WX */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 3900fccf60c7..98f908400771 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -146,7 +146,6 @@ void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *ar | |||
146 | struct ipv4_config | 146 | struct ipv4_config |
147 | { | 147 | { |
148 | int log_martians; | 148 | int log_martians; |
149 | int autoconfig; | ||
150 | int no_pmtu_disc; | 149 | int no_pmtu_disc; |
151 | }; | 150 | }; |
152 | 151 | ||
diff --git a/include/net/llc_if.h b/include/net/llc_if.h index 090eaa0d71f9..c608812a8e89 100644 --- a/include/net/llc_if.h +++ b/include/net/llc_if.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/if.h> | 16 | #include <linux/if.h> |
17 | #include <linux/if_arp.h> | 17 | #include <linux/if_arp.h> |
18 | #include <linux/llc.h> | 18 | #include <linux/llc.h> |
19 | #include <linux/etherdevice.h> | ||
19 | #include <net/llc.h> | 20 | #include <net/llc.h> |
20 | 21 | ||
21 | #define LLC_DATAUNIT_PRIM 1 | 22 | #define LLC_DATAUNIT_PRIM 1 |
@@ -61,8 +62,6 @@ | |||
61 | #define LLC_STATUS_CONFLICT 7 /* disconnect conn */ | 62 | #define LLC_STATUS_CONFLICT 7 /* disconnect conn */ |
62 | #define LLC_STATUS_RESET_DONE 8 /* */ | 63 | #define LLC_STATUS_RESET_DONE 8 /* */ |
63 | 64 | ||
64 | extern u8 llc_mac_null_var[IFHWADDRLEN]; | ||
65 | |||
66 | /** | 65 | /** |
67 | * llc_mac_null - determines if a address is a null mac address | 66 | * llc_mac_null - determines if a address is a null mac address |
68 | * @mac: Mac address to test if null. | 67 | * @mac: Mac address to test if null. |
@@ -70,16 +69,20 @@ extern u8 llc_mac_null_var[IFHWADDRLEN]; | |||
70 | * Determines if a given address is a null mac address. Returns 0 if the | 69 | * Determines if a given address is a null mac address. Returns 0 if the |
71 | * address is not a null mac, 1 if the address is a null mac. | 70 | * address is not a null mac, 1 if the address is a null mac. |
72 | */ | 71 | */ |
73 | static __inline__ int llc_mac_null(u8 *mac) | 72 | static inline int llc_mac_null(const u8 *mac) |
74 | { | 73 | { |
75 | return !memcmp(mac, llc_mac_null_var, IFHWADDRLEN); | 74 | return is_zero_ether_addr(mac); |
76 | } | 75 | } |
77 | 76 | ||
78 | static __inline__ int llc_addrany(struct llc_addr *addr) | 77 | static inline int llc_addrany(const struct llc_addr *addr) |
79 | { | 78 | { |
80 | return llc_mac_null(addr->mac) && !addr->lsap; | 79 | return llc_mac_null(addr->mac) && !addr->lsap; |
81 | } | 80 | } |
82 | 81 | ||
82 | static inline int llc_mac_multicast(const u8 *mac) | ||
83 | { | ||
84 | return is_multicast_ether_addr(mac); | ||
85 | } | ||
83 | /** | 86 | /** |
84 | * llc_mac_match - determines if two mac addresses are the same | 87 | * llc_mac_match - determines if two mac addresses are the same |
85 | * @mac1: First mac address to compare. | 88 | * @mac1: First mac address to compare. |
@@ -89,9 +92,9 @@ static __inline__ int llc_addrany(struct llc_addr *addr) | |||
89 | * is not a complete match up to len, 1 if a complete match up to len is | 92 | * is not a complete match up to len, 1 if a complete match up to len is |
90 | * found. | 93 | * found. |
91 | */ | 94 | */ |
92 | static __inline__ int llc_mac_match(u8 *mac1, u8 *mac2) | 95 | static inline int llc_mac_match(const u8 *mac1, const u8 *mac2) |
93 | { | 96 | { |
94 | return !memcmp(mac1, mac2, IFHWADDRLEN); | 97 | return !compare_ether_addr(mac1, mac2); |
95 | } | 98 | } |
96 | 99 | ||
97 | extern int llc_establish_connection(struct sock *sk, u8 *lmac, | 100 | extern int llc_establish_connection(struct sock *sk, u8 *lmac, |
diff --git a/include/net/netdma.h b/include/net/netdma.h new file mode 100644 index 000000000000..19760eb131aa --- /dev/null +++ b/include/net/netdma.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright(c) 2004 - 2006 Intel Corporation. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms of the GNU General Public License as published by the Free | ||
6 | * Software Foundation; either version 2 of the License, or (at your option) | ||
7 | * any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., 59 | ||
16 | * Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | * | ||
18 | * The full GNU General Public License is included in this distribution in the | ||
19 | * file called COPYING. | ||
20 | */ | ||
21 | #ifndef NETDMA_H | ||
22 | #define NETDMA_H | ||
23 | #include <linux/config.h> | ||
24 | #ifdef CONFIG_NET_DMA | ||
25 | #include <linux/dmaengine.h> | ||
26 | #include <linux/skbuff.h> | ||
27 | |||
28 | static inline struct dma_chan *get_softnet_dma(void) | ||
29 | { | ||
30 | struct dma_chan *chan; | ||
31 | rcu_read_lock(); | ||
32 | chan = rcu_dereference(__get_cpu_var(softnet_data.net_dma)); | ||
33 | if (chan) | ||
34 | dma_chan_get(chan); | ||
35 | rcu_read_unlock(); | ||
36 | return chan; | ||
37 | } | ||
38 | |||
39 | int dma_skb_copy_datagram_iovec(struct dma_chan* chan, | ||
40 | const struct sk_buff *skb, int offset, struct iovec *to, | ||
41 | size_t len, struct dma_pinned_list *pinned_list); | ||
42 | |||
43 | #endif /* CONFIG_NET_DMA */ | ||
44 | #endif /* NETDMA_H */ | ||
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h index fc00aa31e282..1fbd8193d5f1 100644 --- a/include/net/netfilter/nf_conntrack.h +++ b/include/net/netfilter/nf_conntrack.h | |||
@@ -113,6 +113,10 @@ struct nf_conn | |||
113 | u_int32_t mark; | 113 | u_int32_t mark; |
114 | #endif | 114 | #endif |
115 | 115 | ||
116 | #ifdef CONFIG_NF_CONNTRACK_SECMARK | ||
117 | u_int32_t secmark; | ||
118 | #endif | ||
119 | |||
116 | /* Storage reserved for other modules: */ | 120 | /* Storage reserved for other modules: */ |
117 | union nf_conntrack_proto proto; | 121 | union nf_conntrack_proto proto; |
118 | 122 | ||
@@ -284,6 +288,7 @@ static inline int nf_ct_is_dying(struct nf_conn *ct) | |||
284 | } | 288 | } |
285 | 289 | ||
286 | extern unsigned int nf_conntrack_htable_size; | 290 | extern unsigned int nf_conntrack_htable_size; |
291 | extern int nf_conntrack_checksum; | ||
287 | 292 | ||
288 | #define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) | 293 | #define NF_CT_STAT_INC(count) (__get_cpu_var(nf_conntrack_stat).count++) |
289 | 294 | ||
diff --git a/include/net/netfilter/nf_conntrack_compat.h b/include/net/netfilter/nf_conntrack_compat.h index 3cac19fb3648..f1b1482d7200 100644 --- a/include/net/netfilter/nf_conntrack_compat.h +++ b/include/net/netfilter/nf_conntrack_compat.h | |||
@@ -20,6 +20,19 @@ static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb, | |||
20 | } | 20 | } |
21 | #endif /* CONFIG_IP_NF_CONNTRACK_MARK */ | 21 | #endif /* CONFIG_IP_NF_CONNTRACK_MARK */ |
22 | 22 | ||
23 | #ifdef CONFIG_IP_NF_CONNTRACK_SECMARK | ||
24 | static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb, | ||
25 | u_int32_t *ctinfo) | ||
26 | { | ||
27 | struct ip_conntrack *ct = ip_conntrack_get(skb, ctinfo); | ||
28 | |||
29 | if (ct) | ||
30 | return &ct->secmark; | ||
31 | else | ||
32 | return NULL; | ||
33 | } | ||
34 | #endif /* CONFIG_IP_NF_CONNTRACK_SECMARK */ | ||
35 | |||
23 | #ifdef CONFIG_IP_NF_CT_ACCT | 36 | #ifdef CONFIG_IP_NF_CT_ACCT |
24 | static inline struct ip_conntrack_counter * | 37 | static inline struct ip_conntrack_counter * |
25 | nf_ct_get_counters(const struct sk_buff *skb) | 38 | nf_ct_get_counters(const struct sk_buff *skb) |
@@ -70,6 +83,19 @@ static inline u_int32_t *nf_ct_get_mark(const struct sk_buff *skb, | |||
70 | } | 83 | } |
71 | #endif /* CONFIG_NF_CONNTRACK_MARK */ | 84 | #endif /* CONFIG_NF_CONNTRACK_MARK */ |
72 | 85 | ||
86 | #ifdef CONFIG_NF_CONNTRACK_SECMARK | ||
87 | static inline u_int32_t *nf_ct_get_secmark(const struct sk_buff *skb, | ||
88 | u_int32_t *ctinfo) | ||
89 | { | ||
90 | struct nf_conn *ct = nf_ct_get(skb, ctinfo); | ||
91 | |||
92 | if (ct) | ||
93 | return &ct->secmark; | ||
94 | else | ||
95 | return NULL; | ||
96 | } | ||
97 | #endif /* CONFIG_NF_CONNTRACK_MARK */ | ||
98 | |||
73 | #ifdef CONFIG_NF_CT_ACCT | 99 | #ifdef CONFIG_NF_CT_ACCT |
74 | static inline struct ip_conntrack_counter * | 100 | static inline struct ip_conntrack_counter * |
75 | nf_ct_get_counters(const struct sk_buff *skb) | 101 | nf_ct_get_counters(const struct sk_buff *skb) |
diff --git a/include/net/raw.h b/include/net/raw.h index 481b20190b12..e4af59781949 100644 --- a/include/net/raw.h +++ b/include/net/raw.h | |||
@@ -35,7 +35,7 @@ extern rwlock_t raw_v4_lock; | |||
35 | 35 | ||
36 | 36 | ||
37 | extern struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num, | 37 | extern struct sock *__raw_v4_lookup(struct sock *sk, unsigned short num, |
38 | unsigned long raddr, unsigned long laddr, | 38 | __be32 raddr, __be32 laddr, |
39 | int dif); | 39 | int dif); |
40 | 40 | ||
41 | extern int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash); | 41 | extern int raw_v4_input(struct sk_buff *skb, struct iphdr *iph, int hash); |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index a9663b49ea54..237f82b05e40 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -254,7 +254,7 @@ extern int sctp_debug_flag; | |||
254 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) | 254 | #define SCTP_DEBUG_PRINTK_IPADDR(whatever...) |
255 | #define SCTP_ENABLE_DEBUG | 255 | #define SCTP_ENABLE_DEBUG |
256 | #define SCTP_DISABLE_DEBUG | 256 | #define SCTP_DISABLE_DEBUG |
257 | #define SCTP_ASSERT(expr, str, func) | 257 | #define SCTP_ASSERT(expr, str, func) BUG_ON(!(expr)) |
258 | 258 | ||
259 | #endif /* SCTP_DEBUG */ | 259 | #endif /* SCTP_DEBUG */ |
260 | 260 | ||
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 7f4fea173fb1..5f69158c1006 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -555,7 +555,8 @@ struct sctp_af { | |||
555 | int (*to_addr_param) (const union sctp_addr *, | 555 | int (*to_addr_param) (const union sctp_addr *, |
556 | union sctp_addr_param *); | 556 | union sctp_addr_param *); |
557 | int (*addr_valid) (union sctp_addr *, | 557 | int (*addr_valid) (union sctp_addr *, |
558 | struct sctp_sock *); | 558 | struct sctp_sock *, |
559 | const struct sk_buff *); | ||
559 | sctp_scope_t (*scope) (union sctp_addr *); | 560 | sctp_scope_t (*scope) (union sctp_addr *); |
560 | void (*inaddr_any) (union sctp_addr *, unsigned short); | 561 | void (*inaddr_any) (union sctp_addr *, unsigned short); |
561 | int (*is_any) (const union sctp_addr *); | 562 | int (*is_any) (const union sctp_addr *); |
diff --git a/include/net/sock.h b/include/net/sock.h index d27e748a8259..d10dfecb6cbd 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -131,6 +131,7 @@ struct sock_common { | |||
131 | * @sk_receive_queue: incoming packets | 131 | * @sk_receive_queue: incoming packets |
132 | * @sk_wmem_alloc: transmit queue bytes committed | 132 | * @sk_wmem_alloc: transmit queue bytes committed |
133 | * @sk_write_queue: Packet sending queue | 133 | * @sk_write_queue: Packet sending queue |
134 | * @sk_async_wait_queue: DMA copied packets | ||
134 | * @sk_omem_alloc: "o" is "option" or "other" | 135 | * @sk_omem_alloc: "o" is "option" or "other" |
135 | * @sk_wmem_queued: persistent queue size | 136 | * @sk_wmem_queued: persistent queue size |
136 | * @sk_forward_alloc: space allocated forward | 137 | * @sk_forward_alloc: space allocated forward |
@@ -204,6 +205,7 @@ struct sock { | |||
204 | atomic_t sk_omem_alloc; | 205 | atomic_t sk_omem_alloc; |
205 | struct sk_buff_head sk_receive_queue; | 206 | struct sk_buff_head sk_receive_queue; |
206 | struct sk_buff_head sk_write_queue; | 207 | struct sk_buff_head sk_write_queue; |
208 | struct sk_buff_head sk_async_wait_queue; | ||
207 | int sk_wmem_queued; | 209 | int sk_wmem_queued; |
208 | int sk_forward_alloc; | 210 | int sk_forward_alloc; |
209 | gfp_t sk_allocation; | 211 | gfp_t sk_allocation; |
@@ -870,10 +872,7 @@ static inline int sk_filter(struct sock *sk, struct sk_buff *skb, int needlock) | |||
870 | if (filter) { | 872 | if (filter) { |
871 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, | 873 | unsigned int pkt_len = sk_run_filter(skb, filter->insns, |
872 | filter->len); | 874 | filter->len); |
873 | if (!pkt_len) | 875 | err = pkt_len ? pskb_trim(skb, pkt_len) : -EPERM; |
874 | err = -EPERM; | ||
875 | else | ||
876 | skb_trim(skb, pkt_len); | ||
877 | } | 876 | } |
878 | 877 | ||
879 | if (needlock) | 878 | if (needlock) |
@@ -1270,11 +1269,22 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
1270 | * This routine must be called with interrupts disabled or with the socket | 1269 | * This routine must be called with interrupts disabled or with the socket |
1271 | * locked so that the sk_buff queue operation is ok. | 1270 | * locked so that the sk_buff queue operation is ok. |
1272 | */ | 1271 | */ |
1273 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) | 1272 | #ifdef CONFIG_NET_DMA |
1273 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | ||
1274 | { | ||
1275 | __skb_unlink(skb, &sk->sk_receive_queue); | ||
1276 | if (!copied_early) | ||
1277 | __kfree_skb(skb); | ||
1278 | else | ||
1279 | __skb_queue_tail(&sk->sk_async_wait_queue, skb); | ||
1280 | } | ||
1281 | #else | ||
1282 | static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early) | ||
1274 | { | 1283 | { |
1275 | __skb_unlink(skb, &sk->sk_receive_queue); | 1284 | __skb_unlink(skb, &sk->sk_receive_queue); |
1276 | __kfree_skb(skb); | 1285 | __kfree_skb(skb); |
1277 | } | 1286 | } |
1287 | #endif | ||
1278 | 1288 | ||
1279 | extern void sock_enable_timestamp(struct sock *sk); | 1289 | extern void sock_enable_timestamp(struct sock *sk); |
1280 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); | 1290 | extern int sock_get_timestamp(struct sock *, struct timeval __user *); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 9e88dcd5f134..5f4eb5c79689 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #include <linux/cache.h> | 27 | #include <linux/cache.h> |
28 | #include <linux/percpu.h> | 28 | #include <linux/percpu.h> |
29 | #include <linux/skbuff.h> | 29 | #include <linux/skbuff.h> |
30 | #include <linux/dmaengine.h> | ||
30 | 31 | ||
31 | #include <net/inet_connection_sock.h> | 32 | #include <net/inet_connection_sock.h> |
32 | #include <net/inet_timewait_sock.h> | 33 | #include <net/inet_timewait_sock.h> |
@@ -217,6 +218,7 @@ extern int sysctl_tcp_adv_win_scale; | |||
217 | extern int sysctl_tcp_tw_reuse; | 218 | extern int sysctl_tcp_tw_reuse; |
218 | extern int sysctl_tcp_frto; | 219 | extern int sysctl_tcp_frto; |
219 | extern int sysctl_tcp_low_latency; | 220 | extern int sysctl_tcp_low_latency; |
221 | extern int sysctl_tcp_dma_copybreak; | ||
220 | extern int sysctl_tcp_nometrics_save; | 222 | extern int sysctl_tcp_nometrics_save; |
221 | extern int sysctl_tcp_moderate_rcvbuf; | 223 | extern int sysctl_tcp_moderate_rcvbuf; |
222 | extern int sysctl_tcp_tso_win_divisor; | 224 | extern int sysctl_tcp_tso_win_divisor; |
@@ -224,6 +226,7 @@ extern int sysctl_tcp_abc; | |||
224 | extern int sysctl_tcp_mtu_probing; | 226 | extern int sysctl_tcp_mtu_probing; |
225 | extern int sysctl_tcp_base_mss; | 227 | extern int sysctl_tcp_base_mss; |
226 | extern int sysctl_tcp_workaround_signed_windows; | 228 | extern int sysctl_tcp_workaround_signed_windows; |
229 | extern int sysctl_tcp_slow_start_after_idle; | ||
227 | 230 | ||
228 | extern atomic_t tcp_memory_allocated; | 231 | extern atomic_t tcp_memory_allocated; |
229 | extern atomic_t tcp_sockets_allocated; | 232 | extern atomic_t tcp_sockets_allocated; |
@@ -292,6 +295,8 @@ extern int tcp_rcv_established(struct sock *sk, | |||
292 | 295 | ||
293 | extern void tcp_rcv_space_adjust(struct sock *sk); | 296 | extern void tcp_rcv_space_adjust(struct sock *sk); |
294 | 297 | ||
298 | extern void tcp_cleanup_rbuf(struct sock *sk, int copied); | ||
299 | |||
295 | extern int tcp_twsk_unique(struct sock *sk, | 300 | extern int tcp_twsk_unique(struct sock *sk, |
296 | struct sock *sktw, void *twp); | 301 | struct sock *sktw, void *twp); |
297 | 302 | ||
@@ -627,7 +632,7 @@ struct tcp_congestion_ops { | |||
627 | /* return slow start threshold (required) */ | 632 | /* return slow start threshold (required) */ |
628 | u32 (*ssthresh)(struct sock *sk); | 633 | u32 (*ssthresh)(struct sock *sk); |
629 | /* lower bound for congestion window (optional) */ | 634 | /* lower bound for congestion window (optional) */ |
630 | u32 (*min_cwnd)(struct sock *sk); | 635 | u32 (*min_cwnd)(const struct sock *sk); |
631 | /* do new cwnd calculation (required) */ | 636 | /* do new cwnd calculation (required) */ |
632 | void (*cong_avoid)(struct sock *sk, u32 ack, | 637 | void (*cong_avoid)(struct sock *sk, u32 ack, |
633 | u32 rtt, u32 in_flight, int good_ack); | 638 | u32 rtt, u32 in_flight, int good_ack); |
@@ -662,7 +667,7 @@ extern struct tcp_congestion_ops tcp_init_congestion_ops; | |||
662 | extern u32 tcp_reno_ssthresh(struct sock *sk); | 667 | extern u32 tcp_reno_ssthresh(struct sock *sk); |
663 | extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, | 668 | extern void tcp_reno_cong_avoid(struct sock *sk, u32 ack, |
664 | u32 rtt, u32 in_flight, int flag); | 669 | u32 rtt, u32 in_flight, int flag); |
665 | extern u32 tcp_reno_min_cwnd(struct sock *sk); | 670 | extern u32 tcp_reno_min_cwnd(const struct sock *sk); |
666 | extern struct tcp_congestion_ops tcp_reno; | 671 | extern struct tcp_congestion_ops tcp_reno; |
667 | 672 | ||
668 | static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) | 673 | static inline void tcp_set_ca_state(struct sock *sk, const u8 ca_state) |
@@ -816,6 +821,12 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp) | |||
816 | tp->ucopy.len = 0; | 821 | tp->ucopy.len = 0; |
817 | tp->ucopy.memory = 0; | 822 | tp->ucopy.memory = 0; |
818 | skb_queue_head_init(&tp->ucopy.prequeue); | 823 | skb_queue_head_init(&tp->ucopy.prequeue); |
824 | #ifdef CONFIG_NET_DMA | ||
825 | tp->ucopy.dma_chan = NULL; | ||
826 | tp->ucopy.wakeup = 0; | ||
827 | tp->ucopy.pinned_list = NULL; | ||
828 | tp->ucopy.dma_cookie = 0; | ||
829 | #endif | ||
819 | } | 830 | } |
820 | 831 | ||
821 | /* Packet is added to VJ-style prequeue for processing in process | 832 | /* Packet is added to VJ-style prequeue for processing in process |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index afa508d92c93..9c5ee9f20b65 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #include <net/ip6_fib.h> | 20 | #include <net/ip6_fib.h> |
21 | 21 | ||
22 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) | 22 | #define XFRM_ALIGN8(len) (((len) + 7) & ~7) |
23 | #define MODULE_ALIAS_XFRM_MODE(family, encap) \ | ||
24 | MODULE_ALIAS("xfrm-mode-" __stringify(family) "-" __stringify(encap)) | ||
23 | 25 | ||
24 | extern struct sock *xfrm_nl; | 26 | extern struct sock *xfrm_nl; |
25 | extern u32 sysctl_xfrm_aevent_etime; | 27 | extern u32 sysctl_xfrm_aevent_etime; |
@@ -164,6 +166,7 @@ struct xfrm_state | |||
164 | /* Reference to data common to all the instances of this | 166 | /* Reference to data common to all the instances of this |
165 | * transformer. */ | 167 | * transformer. */ |
166 | struct xfrm_type *type; | 168 | struct xfrm_type *type; |
169 | struct xfrm_mode *mode; | ||
167 | 170 | ||
168 | /* Security context */ | 171 | /* Security context */ |
169 | struct xfrm_sec_ctx *security; | 172 | struct xfrm_sec_ctx *security; |
@@ -204,8 +207,8 @@ struct xfrm_type; | |||
204 | struct xfrm_dst; | 207 | struct xfrm_dst; |
205 | struct xfrm_policy_afinfo { | 208 | struct xfrm_policy_afinfo { |
206 | unsigned short family; | 209 | unsigned short family; |
207 | rwlock_t lock; | 210 | struct xfrm_type *type_map[IPPROTO_MAX]; |
208 | struct xfrm_type_map *type_map; | 211 | struct xfrm_mode *mode_map[XFRM_MODE_MAX]; |
209 | struct dst_ops *dst_ops; | 212 | struct dst_ops *dst_ops; |
210 | void (*garbage_collect)(void); | 213 | void (*garbage_collect)(void); |
211 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); | 214 | int (*dst_lookup)(struct xfrm_dst **dst, struct flowi *fl); |
@@ -232,7 +235,6 @@ extern int __xfrm_state_delete(struct xfrm_state *x); | |||
232 | 235 | ||
233 | struct xfrm_state_afinfo { | 236 | struct xfrm_state_afinfo { |
234 | unsigned short family; | 237 | unsigned short family; |
235 | rwlock_t lock; | ||
236 | struct list_head *state_bydst; | 238 | struct list_head *state_bydst; |
237 | struct list_head *state_byspi; | 239 | struct list_head *state_byspi; |
238 | int (*init_flags)(struct xfrm_state *x); | 240 | int (*init_flags)(struct xfrm_state *x); |
@@ -264,16 +266,24 @@ struct xfrm_type | |||
264 | u32 (*get_max_size)(struct xfrm_state *, int size); | 266 | u32 (*get_max_size)(struct xfrm_state *, int size); |
265 | }; | 267 | }; |
266 | 268 | ||
267 | struct xfrm_type_map { | ||
268 | rwlock_t lock; | ||
269 | struct xfrm_type *map[256]; | ||
270 | }; | ||
271 | |||
272 | extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); | 269 | extern int xfrm_register_type(struct xfrm_type *type, unsigned short family); |
273 | extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); | 270 | extern int xfrm_unregister_type(struct xfrm_type *type, unsigned short family); |
274 | extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family); | 271 | extern struct xfrm_type *xfrm_get_type(u8 proto, unsigned short family); |
275 | extern void xfrm_put_type(struct xfrm_type *type); | 272 | extern void xfrm_put_type(struct xfrm_type *type); |
276 | 273 | ||
274 | struct xfrm_mode { | ||
275 | int (*input)(struct xfrm_state *x, struct sk_buff *skb); | ||
276 | int (*output)(struct sk_buff *skb); | ||
277 | |||
278 | struct module *owner; | ||
279 | unsigned int encap; | ||
280 | }; | ||
281 | |||
282 | extern int xfrm_register_mode(struct xfrm_mode *mode, int family); | ||
283 | extern int xfrm_unregister_mode(struct xfrm_mode *mode, int family); | ||
284 | extern struct xfrm_mode *xfrm_get_mode(unsigned int encap, int family); | ||
285 | extern void xfrm_put_mode(struct xfrm_mode *mode); | ||
286 | |||
277 | struct xfrm_tmpl | 287 | struct xfrm_tmpl |
278 | { | 288 | { |
279 | /* id in template is interpreted as: | 289 | /* id in template is interpreted as: |