diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-07-13 16:23:51 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-07-13 16:23:51 -0400 |
commit | 327309e899662b482c58cf25f574513d38b5788c (patch) | |
tree | 069de438aa0e92dd9b6ba28e6b207e2cd07151a5 /include/net | |
parent | 0c168775709faa74c1b87f1e61046e0c51ade7f3 (diff) | |
parent | c32511e2718618f0b53479eb36e07439aa363a74 (diff) |
Merge upstream 2.6.13-rc3 into ieee80211 branch of netdev-2.6.
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/irda/irda_device.h | 2 | ||||
-rw-r--r-- | include/net/pkt_sched.h | 17 | ||||
-rw-r--r-- | include/net/sch_generic.h | 13 | ||||
-rw-r--r-- | include/net/sctp/sctp.h | 3 | ||||
-rw-r--r-- | include/net/sctp/sm.h | 11 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 50 | ||||
-rw-r--r-- | include/net/sctp/ulpevent.h | 16 | ||||
-rw-r--r-- | include/net/sctp/ulpqueue.h | 11 | ||||
-rw-r--r-- | include/net/slhc_vj.h | 21 | ||||
-rw-r--r-- | include/net/sock.h | 25 | ||||
-rw-r--r-- | include/net/tcp.h | 161 | ||||
-rw-r--r-- | include/net/x25device.h | 3 |
12 files changed, 110 insertions, 223 deletions
diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 71d6af83b631..92c828029cd8 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h | |||
@@ -224,7 +224,7 @@ int irda_device_is_receiving(struct net_device *dev); | |||
224 | /* Interface for internal use */ | 224 | /* Interface for internal use */ |
225 | static inline int irda_device_txqueue_empty(const struct net_device *dev) | 225 | static inline int irda_device_txqueue_empty(const struct net_device *dev) |
226 | { | 226 | { |
227 | return (skb_queue_len(&dev->qdisc->q) == 0); | 227 | return skb_queue_empty(&dev->qdisc->q); |
228 | } | 228 | } |
229 | int irda_device_set_raw_mode(struct net_device* self, int status); | 229 | int irda_device_set_raw_mode(struct net_device* self, int status); |
230 | struct net_device *alloc_irdadev(int sizeof_priv); | 230 | struct net_device *alloc_irdadev(int sizeof_priv); |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index fcb05a387dbe..6492e7363d84 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -13,13 +13,12 @@ struct qdisc_walker | |||
13 | 13 | ||
14 | extern rwlock_t qdisc_tree_lock; | 14 | extern rwlock_t qdisc_tree_lock; |
15 | 15 | ||
16 | #define QDISC_ALIGN 32 | 16 | #define QDISC_ALIGNTO 32 |
17 | #define QDISC_ALIGN_CONST (QDISC_ALIGN - 1) | 17 | #define QDISC_ALIGN(len) (((len) + QDISC_ALIGNTO-1) & ~(QDISC_ALIGNTO-1)) |
18 | 18 | ||
19 | static inline void *qdisc_priv(struct Qdisc *q) | 19 | static inline void *qdisc_priv(struct Qdisc *q) |
20 | { | 20 | { |
21 | return (char *)q + ((sizeof(struct Qdisc) + QDISC_ALIGN_CONST) | 21 | return (char *) q + QDISC_ALIGN(sizeof(struct Qdisc)); |
22 | & ~QDISC_ALIGN_CONST); | ||
23 | } | 22 | } |
24 | 23 | ||
25 | /* | 24 | /* |
@@ -207,8 +206,6 @@ psched_tod_diff(int delta_sec, int bound) | |||
207 | 206 | ||
208 | #endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */ | 207 | #endif /* !CONFIG_NET_SCH_CLK_GETTIMEOFDAY */ |
209 | 208 | ||
210 | extern struct Qdisc noop_qdisc; | ||
211 | extern struct Qdisc_ops noop_qdisc_ops; | ||
212 | extern struct Qdisc_ops pfifo_qdisc_ops; | 209 | extern struct Qdisc_ops pfifo_qdisc_ops; |
213 | extern struct Qdisc_ops bfifo_qdisc_ops; | 210 | extern struct Qdisc_ops bfifo_qdisc_ops; |
214 | 211 | ||
@@ -216,14 +213,6 @@ extern int register_qdisc(struct Qdisc_ops *qops); | |||
216 | extern int unregister_qdisc(struct Qdisc_ops *qops); | 213 | extern int unregister_qdisc(struct Qdisc_ops *qops); |
217 | extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); | 214 | extern struct Qdisc *qdisc_lookup(struct net_device *dev, u32 handle); |
218 | extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); | 215 | extern struct Qdisc *qdisc_lookup_class(struct net_device *dev, u32 handle); |
219 | extern void dev_init_scheduler(struct net_device *dev); | ||
220 | extern void dev_shutdown(struct net_device *dev); | ||
221 | extern void dev_activate(struct net_device *dev); | ||
222 | extern void dev_deactivate(struct net_device *dev); | ||
223 | extern void qdisc_reset(struct Qdisc *qdisc); | ||
224 | extern void qdisc_destroy(struct Qdisc *qdisc); | ||
225 | extern struct Qdisc * qdisc_create_dflt(struct net_device *dev, | ||
226 | struct Qdisc_ops *ops); | ||
227 | extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, | 216 | extern struct qdisc_rate_table *qdisc_get_rtab(struct tc_ratespec *r, |
228 | struct rtattr *tab); | 217 | struct rtattr *tab); |
229 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); | 218 | extern void qdisc_put_rtab(struct qdisc_rate_table *tab); |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index 7b97405e2dbf..7b6ec9986715 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -164,6 +164,19 @@ extern void qdisc_unlock_tree(struct net_device *dev); | |||
164 | #define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) | 164 | #define tcf_tree_lock(tp) qdisc_lock_tree((tp)->q->dev) |
165 | #define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) | 165 | #define tcf_tree_unlock(tp) qdisc_unlock_tree((tp)->q->dev) |
166 | 166 | ||
167 | extern struct Qdisc noop_qdisc; | ||
168 | extern struct Qdisc_ops noop_qdisc_ops; | ||
169 | |||
170 | extern void dev_init_scheduler(struct net_device *dev); | ||
171 | extern void dev_shutdown(struct net_device *dev); | ||
172 | extern void dev_activate(struct net_device *dev); | ||
173 | extern void dev_deactivate(struct net_device *dev); | ||
174 | extern void qdisc_reset(struct Qdisc *qdisc); | ||
175 | extern void qdisc_destroy(struct Qdisc *qdisc); | ||
176 | extern struct Qdisc *qdisc_alloc(struct net_device *dev, struct Qdisc_ops *ops); | ||
177 | extern struct Qdisc *qdisc_create_dflt(struct net_device *dev, | ||
178 | struct Qdisc_ops *ops); | ||
179 | |||
167 | static inline void | 180 | static inline void |
168 | tcf_destroy(struct tcf_proto *tp) | 181 | tcf_destroy(struct tcf_proto *tp) |
169 | { | 182 | { |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index ef2738159ab3..4a26adfaed71 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -125,7 +125,8 @@ | |||
125 | */ | 125 | */ |
126 | extern struct sock *sctp_get_ctl_sock(void); | 126 | extern struct sock *sctp_get_ctl_sock(void); |
127 | extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, | 127 | extern int sctp_copy_local_addr_list(struct sctp_bind_addr *, |
128 | sctp_scope_t, int gfp, int flags); | 128 | sctp_scope_t, unsigned int __nocast gfp, |
129 | int flags); | ||
129 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); | 130 | extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); |
130 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); | 131 | extern int sctp_register_pf(struct sctp_pf *, sa_family_t); |
131 | 132 | ||
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index 88d9fe5975d5..58462164d960 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -181,17 +181,17 @@ const sctp_sm_table_entry_t *sctp_sm_lookup_event(sctp_event_t, | |||
181 | int sctp_chunk_iif(const struct sctp_chunk *); | 181 | int sctp_chunk_iif(const struct sctp_chunk *); |
182 | struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *, | 182 | struct sctp_association *sctp_make_temp_asoc(const struct sctp_endpoint *, |
183 | struct sctp_chunk *, | 183 | struct sctp_chunk *, |
184 | int gfp); | 184 | unsigned int __nocast gfp); |
185 | __u32 sctp_generate_verification_tag(void); | 185 | __u32 sctp_generate_verification_tag(void); |
186 | void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); | 186 | void sctp_populate_tie_tags(__u8 *cookie, __u32 curTag, __u32 hisTag); |
187 | 187 | ||
188 | /* Prototypes for chunk-building functions. */ | 188 | /* Prototypes for chunk-building functions. */ |
189 | struct sctp_chunk *sctp_make_init(const struct sctp_association *, | 189 | struct sctp_chunk *sctp_make_init(const struct sctp_association *, |
190 | const struct sctp_bind_addr *, | 190 | const struct sctp_bind_addr *, |
191 | int gfp, int vparam_len); | 191 | unsigned int __nocast gfp, int vparam_len); |
192 | struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *, | 192 | struct sctp_chunk *sctp_make_init_ack(const struct sctp_association *, |
193 | const struct sctp_chunk *, | 193 | const struct sctp_chunk *, |
194 | const int gfp, | 194 | const unsigned int __nocast gfp, |
195 | const int unkparam_len); | 195 | const int unkparam_len); |
196 | struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *, | 196 | struct sctp_chunk *sctp_make_cookie_echo(const struct sctp_association *, |
197 | const struct sctp_chunk *); | 197 | const struct sctp_chunk *); |
@@ -265,7 +265,7 @@ int sctp_do_sm(sctp_event_t event_type, sctp_subtype_t subtype, | |||
265 | struct sctp_endpoint *, | 265 | struct sctp_endpoint *, |
266 | struct sctp_association *asoc, | 266 | struct sctp_association *asoc, |
267 | void *event_arg, | 267 | void *event_arg, |
268 | int gfp); | 268 | unsigned int __nocast gfp); |
269 | 269 | ||
270 | /* 2nd level prototypes */ | 270 | /* 2nd level prototypes */ |
271 | void sctp_generate_t3_rtx_event(unsigned long peer); | 271 | void sctp_generate_t3_rtx_event(unsigned long peer); |
@@ -275,7 +275,8 @@ void sctp_ootb_pkt_free(struct sctp_packet *); | |||
275 | 275 | ||
276 | struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *, | 276 | struct sctp_association *sctp_unpack_cookie(const struct sctp_endpoint *, |
277 | const struct sctp_association *, | 277 | const struct sctp_association *, |
278 | struct sctp_chunk *, int gfp, int *err, | 278 | struct sctp_chunk *, |
279 | unsigned int __nocast gfp, int *err, | ||
279 | struct sctp_chunk **err_chk_p); | 280 | struct sctp_chunk **err_chk_p); |
280 | int sctp_addip_addr_config(struct sctp_association *, sctp_param_t, | 281 | int sctp_addip_addr_config(struct sctp_association *, sctp_param_t, |
281 | struct sockaddr_storage*, int); | 282 | struct sockaddr_storage*, int); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 47727c7cc628..994009bbe3b4 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -445,7 +445,8 @@ struct sctp_ssnmap { | |||
445 | int malloced; | 445 | int malloced; |
446 | }; | 446 | }; |
447 | 447 | ||
448 | struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, int gfp); | 448 | struct sctp_ssnmap *sctp_ssnmap_new(__u16 in, __u16 out, |
449 | unsigned int __nocast gfp); | ||
449 | void sctp_ssnmap_free(struct sctp_ssnmap *map); | 450 | void sctp_ssnmap_free(struct sctp_ssnmap *map); |
450 | void sctp_ssnmap_clear(struct sctp_ssnmap *map); | 451 | void sctp_ssnmap_clear(struct sctp_ssnmap *map); |
451 | 452 | ||
@@ -582,7 +583,6 @@ void sctp_datamsg_track(struct sctp_chunk *); | |||
582 | void sctp_chunk_fail(struct sctp_chunk *, int error); | 583 | void sctp_chunk_fail(struct sctp_chunk *, int error); |
583 | int sctp_chunk_abandoned(struct sctp_chunk *); | 584 | int sctp_chunk_abandoned(struct sctp_chunk *); |
584 | 585 | ||
585 | |||
586 | /* RFC2960 1.4 Key Terms | 586 | /* RFC2960 1.4 Key Terms |
587 | * | 587 | * |
588 | * o Chunk: A unit of information within an SCTP packet, consisting of | 588 | * o Chunk: A unit of information within an SCTP packet, consisting of |
@@ -592,13 +592,8 @@ int sctp_chunk_abandoned(struct sctp_chunk *); | |||
592 | * each chunk as well as a few other header pointers... | 592 | * each chunk as well as a few other header pointers... |
593 | */ | 593 | */ |
594 | struct sctp_chunk { | 594 | struct sctp_chunk { |
595 | /* These first three elements MUST PRECISELY match the first | 595 | struct list_head list; |
596 | * three elements of struct sk_buff. This allows us to reuse | 596 | |
597 | * all the skb_* queue management functions. | ||
598 | */ | ||
599 | struct sctp_chunk *next; | ||
600 | struct sctp_chunk *prev; | ||
601 | struct sk_buff_head *list; | ||
602 | atomic_t refcnt; | 597 | atomic_t refcnt; |
603 | 598 | ||
604 | /* This is our link to the per-transport transmitted list. */ | 599 | /* This is our link to the per-transport transmitted list. */ |
@@ -717,7 +712,7 @@ struct sctp_packet { | |||
717 | __u32 vtag; | 712 | __u32 vtag; |
718 | 713 | ||
719 | /* This contains the payload chunks. */ | 714 | /* This contains the payload chunks. */ |
720 | struct sk_buff_head chunks; | 715 | struct list_head chunk_list; |
721 | 716 | ||
722 | /* This is the overhead of the sctp and ip headers. */ | 717 | /* This is the overhead of the sctp and ip headers. */ |
723 | size_t overhead; | 718 | size_t overhead; |
@@ -951,7 +946,8 @@ struct sctp_transport { | |||
951 | } cacc; | 946 | } cacc; |
952 | }; | 947 | }; |
953 | 948 | ||
954 | struct sctp_transport *sctp_transport_new(const union sctp_addr *, int); | 949 | struct sctp_transport *sctp_transport_new(const union sctp_addr *, |
950 | unsigned int __nocast); | ||
955 | void sctp_transport_set_owner(struct sctp_transport *, | 951 | void sctp_transport_set_owner(struct sctp_transport *, |
956 | struct sctp_association *); | 952 | struct sctp_association *); |
957 | void sctp_transport_route(struct sctp_transport *, union sctp_addr *, | 953 | void sctp_transport_route(struct sctp_transport *, union sctp_addr *, |
@@ -974,7 +970,7 @@ struct sctp_inq { | |||
974 | /* This is actually a queue of sctp_chunk each | 970 | /* This is actually a queue of sctp_chunk each |
975 | * containing a partially decoded packet. | 971 | * containing a partially decoded packet. |
976 | */ | 972 | */ |
977 | struct sk_buff_head in; | 973 | struct list_head in_chunk_list; |
978 | /* This is the packet which is currently off the in queue and is | 974 | /* This is the packet which is currently off the in queue and is |
979 | * being worked on through the inbound chunk processing. | 975 | * being worked on through the inbound chunk processing. |
980 | */ | 976 | */ |
@@ -1017,7 +1013,7 @@ struct sctp_outq { | |||
1017 | struct sctp_association *asoc; | 1013 | struct sctp_association *asoc; |
1018 | 1014 | ||
1019 | /* Data pending that has never been transmitted. */ | 1015 | /* Data pending that has never been transmitted. */ |
1020 | struct sk_buff_head out; | 1016 | struct list_head out_chunk_list; |
1021 | 1017 | ||
1022 | unsigned out_qlen; /* Total length of queued data chunks. */ | 1018 | unsigned out_qlen; /* Total length of queued data chunks. */ |
1023 | 1019 | ||
@@ -1025,7 +1021,7 @@ struct sctp_outq { | |||
1025 | unsigned error; | 1021 | unsigned error; |
1026 | 1022 | ||
1027 | /* These are control chunks we want to send. */ | 1023 | /* These are control chunks we want to send. */ |
1028 | struct sk_buff_head control; | 1024 | struct list_head control_chunk_list; |
1029 | 1025 | ||
1030 | /* These are chunks that have been sacked but are above the | 1026 | /* These are chunks that have been sacked but are above the |
1031 | * CTSN, or cumulative tsn ack point. | 1027 | * CTSN, or cumulative tsn ack point. |
@@ -1099,9 +1095,10 @@ void sctp_bind_addr_init(struct sctp_bind_addr *, __u16 port); | |||
1099 | void sctp_bind_addr_free(struct sctp_bind_addr *); | 1095 | void sctp_bind_addr_free(struct sctp_bind_addr *); |
1100 | int sctp_bind_addr_copy(struct sctp_bind_addr *dest, | 1096 | int sctp_bind_addr_copy(struct sctp_bind_addr *dest, |
1101 | const struct sctp_bind_addr *src, | 1097 | const struct sctp_bind_addr *src, |
1102 | sctp_scope_t scope, int gfp,int flags); | 1098 | sctp_scope_t scope, unsigned int __nocast gfp, |
1099 | int flags); | ||
1103 | int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, | 1100 | int sctp_add_bind_addr(struct sctp_bind_addr *, union sctp_addr *, |
1104 | int gfp); | 1101 | unsigned int __nocast gfp); |
1105 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); | 1102 | int sctp_del_bind_addr(struct sctp_bind_addr *, union sctp_addr *); |
1106 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, | 1103 | int sctp_bind_addr_match(struct sctp_bind_addr *, const union sctp_addr *, |
1107 | struct sctp_sock *); | 1104 | struct sctp_sock *); |
@@ -1110,9 +1107,10 @@ union sctp_addr *sctp_find_unmatch_addr(struct sctp_bind_addr *bp, | |||
1110 | int addrcnt, | 1107 | int addrcnt, |
1111 | struct sctp_sock *opt); | 1108 | struct sctp_sock *opt); |
1112 | union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, | 1109 | union sctp_params sctp_bind_addrs_to_raw(const struct sctp_bind_addr *bp, |
1113 | int *addrs_len, int gfp); | 1110 | int *addrs_len, |
1111 | unsigned int __nocast gfp); | ||
1114 | int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, | 1112 | int sctp_raw_to_bind_addrs(struct sctp_bind_addr *bp, __u8 *raw, int len, |
1115 | __u16 port, int gfp); | 1113 | __u16 port, unsigned int __nocast gfp); |
1116 | 1114 | ||
1117 | sctp_scope_t sctp_scope(const union sctp_addr *); | 1115 | sctp_scope_t sctp_scope(const union sctp_addr *); |
1118 | int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); | 1116 | int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); |
@@ -1241,7 +1239,7 @@ static inline struct sctp_endpoint *sctp_ep(struct sctp_ep_common *base) | |||
1241 | } | 1239 | } |
1242 | 1240 | ||
1243 | /* These are function signatures for manipulating endpoints. */ | 1241 | /* These are function signatures for manipulating endpoints. */ |
1244 | struct sctp_endpoint *sctp_endpoint_new(struct sock *, int); | 1242 | struct sctp_endpoint *sctp_endpoint_new(struct sock *, unsigned int __nocast); |
1245 | void sctp_endpoint_free(struct sctp_endpoint *); | 1243 | void sctp_endpoint_free(struct sctp_endpoint *); |
1246 | void sctp_endpoint_put(struct sctp_endpoint *); | 1244 | void sctp_endpoint_put(struct sctp_endpoint *); |
1247 | void sctp_endpoint_hold(struct sctp_endpoint *); | 1245 | void sctp_endpoint_hold(struct sctp_endpoint *); |
@@ -1262,7 +1260,7 @@ int sctp_verify_init(const struct sctp_association *asoc, sctp_cid_t, | |||
1262 | struct sctp_chunk **err_chunk); | 1260 | struct sctp_chunk **err_chunk); |
1263 | int sctp_process_init(struct sctp_association *, sctp_cid_t cid, | 1261 | int sctp_process_init(struct sctp_association *, sctp_cid_t cid, |
1264 | const union sctp_addr *peer, | 1262 | const union sctp_addr *peer, |
1265 | sctp_init_chunk_t *init, int gfp); | 1263 | sctp_init_chunk_t *init, unsigned int __nocast gfp); |
1266 | __u32 sctp_generate_tag(const struct sctp_endpoint *); | 1264 | __u32 sctp_generate_tag(const struct sctp_endpoint *); |
1267 | __u32 sctp_generate_tsn(const struct sctp_endpoint *); | 1265 | __u32 sctp_generate_tsn(const struct sctp_endpoint *); |
1268 | 1266 | ||
@@ -1672,7 +1670,7 @@ struct sctp_association { | |||
1672 | * which already resides in sctp_outq. Please move this | 1670 | * which already resides in sctp_outq. Please move this |
1673 | * queue and its supporting logic down there. --piggy] | 1671 | * queue and its supporting logic down there. --piggy] |
1674 | */ | 1672 | */ |
1675 | struct sk_buff_head addip_chunks; | 1673 | struct list_head addip_chunk_list; |
1676 | 1674 | ||
1677 | /* ADDIP Section 4.1 ASCONF Chunk Procedures | 1675 | /* ADDIP Section 4.1 ASCONF Chunk Procedures |
1678 | * | 1676 | * |
@@ -1725,7 +1723,7 @@ static inline struct sctp_association *sctp_assoc(struct sctp_ep_common *base) | |||
1725 | 1723 | ||
1726 | struct sctp_association * | 1724 | struct sctp_association * |
1727 | sctp_association_new(const struct sctp_endpoint *, const struct sock *, | 1725 | sctp_association_new(const struct sctp_endpoint *, const struct sock *, |
1728 | sctp_scope_t scope, int gfp); | 1726 | sctp_scope_t scope, unsigned int __nocast gfp); |
1729 | void sctp_association_free(struct sctp_association *); | 1727 | void sctp_association_free(struct sctp_association *); |
1730 | void sctp_association_put(struct sctp_association *); | 1728 | void sctp_association_put(struct sctp_association *); |
1731 | void sctp_association_hold(struct sctp_association *); | 1729 | void sctp_association_hold(struct sctp_association *); |
@@ -1741,7 +1739,7 @@ int sctp_assoc_lookup_laddr(struct sctp_association *asoc, | |||
1741 | const union sctp_addr *laddr); | 1739 | const union sctp_addr *laddr); |
1742 | struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, | 1740 | struct sctp_transport *sctp_assoc_add_peer(struct sctp_association *, |
1743 | const union sctp_addr *address, | 1741 | const union sctp_addr *address, |
1744 | const int gfp, | 1742 | const unsigned int __nocast gfp, |
1745 | const int peer_state); | 1743 | const int peer_state); |
1746 | void sctp_assoc_del_peer(struct sctp_association *asoc, | 1744 | void sctp_assoc_del_peer(struct sctp_association *asoc, |
1747 | const union sctp_addr *addr); | 1745 | const union sctp_addr *addr); |
@@ -1765,9 +1763,11 @@ void sctp_assoc_rwnd_increase(struct sctp_association *, unsigned); | |||
1765 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned); | 1763 | void sctp_assoc_rwnd_decrease(struct sctp_association *, unsigned); |
1766 | void sctp_assoc_set_primary(struct sctp_association *, | 1764 | void sctp_assoc_set_primary(struct sctp_association *, |
1767 | struct sctp_transport *); | 1765 | struct sctp_transport *); |
1768 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, int); | 1766 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, |
1767 | unsigned int __nocast); | ||
1769 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, | 1768 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, |
1770 | struct sctp_cookie*, int gfp); | 1769 | struct sctp_cookie*, |
1770 | unsigned int __nocast gfp); | ||
1771 | 1771 | ||
1772 | int sctp_cmp_addr_exact(const union sctp_addr *ss1, | 1772 | int sctp_cmp_addr_exact(const union sctp_addr *ss1, |
1773 | const union sctp_addr *ss2); | 1773 | const union sctp_addr *ss2); |
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h index 1019d83a580a..90fe4bf6754f 100644 --- a/include/net/sctp/ulpevent.h +++ b/include/net/sctp/ulpevent.h | |||
@@ -88,7 +88,7 @@ struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( | |||
88 | __u16 error, | 88 | __u16 error, |
89 | __u16 outbound, | 89 | __u16 outbound, |
90 | __u16 inbound, | 90 | __u16 inbound, |
91 | int gfp); | 91 | unsigned int __nocast gfp); |
92 | 92 | ||
93 | struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( | 93 | struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( |
94 | const struct sctp_association *asoc, | 94 | const struct sctp_association *asoc, |
@@ -96,35 +96,35 @@ struct sctp_ulpevent *sctp_ulpevent_make_peer_addr_change( | |||
96 | int flags, | 96 | int flags, |
97 | int state, | 97 | int state, |
98 | int error, | 98 | int error, |
99 | int gfp); | 99 | unsigned int __nocast gfp); |
100 | 100 | ||
101 | struct sctp_ulpevent *sctp_ulpevent_make_remote_error( | 101 | struct sctp_ulpevent *sctp_ulpevent_make_remote_error( |
102 | const struct sctp_association *asoc, | 102 | const struct sctp_association *asoc, |
103 | struct sctp_chunk *chunk, | 103 | struct sctp_chunk *chunk, |
104 | __u16 flags, | 104 | __u16 flags, |
105 | int gfp); | 105 | unsigned int __nocast gfp); |
106 | struct sctp_ulpevent *sctp_ulpevent_make_send_failed( | 106 | struct sctp_ulpevent *sctp_ulpevent_make_send_failed( |
107 | const struct sctp_association *asoc, | 107 | const struct sctp_association *asoc, |
108 | struct sctp_chunk *chunk, | 108 | struct sctp_chunk *chunk, |
109 | __u16 flags, | 109 | __u16 flags, |
110 | __u32 error, | 110 | __u32 error, |
111 | int gfp); | 111 | unsigned int __nocast gfp); |
112 | 112 | ||
113 | struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( | 113 | struct sctp_ulpevent *sctp_ulpevent_make_shutdown_event( |
114 | const struct sctp_association *asoc, | 114 | const struct sctp_association *asoc, |
115 | __u16 flags, | 115 | __u16 flags, |
116 | int gfp); | 116 | unsigned int __nocast gfp); |
117 | 117 | ||
118 | struct sctp_ulpevent *sctp_ulpevent_make_pdapi( | 118 | struct sctp_ulpevent *sctp_ulpevent_make_pdapi( |
119 | const struct sctp_association *asoc, | 119 | const struct sctp_association *asoc, |
120 | __u32 indication, int gfp); | 120 | __u32 indication, unsigned int __nocast gfp); |
121 | 121 | ||
122 | struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( | 122 | struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication( |
123 | const struct sctp_association *asoc, int gfp); | 123 | const struct sctp_association *asoc, unsigned int __nocast gfp); |
124 | 124 | ||
125 | struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, | 125 | struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc, |
126 | struct sctp_chunk *chunk, | 126 | struct sctp_chunk *chunk, |
127 | int gfp); | 127 | unsigned int __nocast gfp); |
128 | 128 | ||
129 | void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, | 129 | void sctp_ulpevent_read_sndrcvinfo(const struct sctp_ulpevent *event, |
130 | struct msghdr *); | 130 | struct msghdr *); |
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index 961736d29d21..1a60c6d943c1 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h | |||
@@ -62,19 +62,22 @@ struct sctp_ulpq *sctp_ulpq_init(struct sctp_ulpq *, | |||
62 | void sctp_ulpq_free(struct sctp_ulpq *); | 62 | void sctp_ulpq_free(struct sctp_ulpq *); |
63 | 63 | ||
64 | /* Add a new DATA chunk for processing. */ | 64 | /* Add a new DATA chunk for processing. */ |
65 | int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, int); | 65 | int sctp_ulpq_tail_data(struct sctp_ulpq *, struct sctp_chunk *, |
66 | unsigned int __nocast); | ||
66 | 67 | ||
67 | /* Add a new event for propagation to the ULP. */ | 68 | /* Add a new event for propagation to the ULP. */ |
68 | int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); | 69 | int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); |
69 | 70 | ||
70 | /* Renege previously received chunks. */ | 71 | /* Renege previously received chunks. */ |
71 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, int); | 72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, |
73 | unsigned int __nocast); | ||
72 | 74 | ||
73 | /* Perform partial delivery. */ | 75 | /* Perform partial delivery. */ |
74 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, int); | 76 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, |
77 | unsigned int __nocast); | ||
75 | 78 | ||
76 | /* Abort the partial delivery. */ | 79 | /* Abort the partial delivery. */ |
77 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, int); | 80 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, unsigned int __nocast); |
78 | 81 | ||
79 | /* Clear the partial data delivery condition on this socket. */ | 82 | /* Clear the partial data delivery condition on this socket. */ |
80 | int sctp_clear_pd(struct sock *sk); | 83 | int sctp_clear_pd(struct sock *sk); |
diff --git a/include/net/slhc_vj.h b/include/net/slhc_vj.h index 0b2c2784f333..8716d5942b65 100644 --- a/include/net/slhc_vj.h +++ b/include/net/slhc_vj.h | |||
@@ -170,19 +170,14 @@ struct slcompress { | |||
170 | }; | 170 | }; |
171 | #define NULLSLCOMPR (struct slcompress *)0 | 171 | #define NULLSLCOMPR (struct slcompress *)0 |
172 | 172 | ||
173 | #define __ARGS(x) x | ||
174 | |||
175 | /* In slhc.c: */ | 173 | /* In slhc.c: */ |
176 | struct slcompress *slhc_init __ARGS((int rslots, int tslots)); | 174 | struct slcompress *slhc_init(int rslots, int tslots); |
177 | void slhc_free __ARGS((struct slcompress *comp)); | 175 | void slhc_free(struct slcompress *comp); |
178 | 176 | ||
179 | int slhc_compress __ARGS((struct slcompress *comp, unsigned char *icp, | 177 | int slhc_compress(struct slcompress *comp, unsigned char *icp, int isize, |
180 | int isize, unsigned char *ocp, unsigned char **cpp, | 178 | unsigned char *ocp, unsigned char **cpp, int compress_cid); |
181 | int compress_cid)); | 179 | int slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize); |
182 | int slhc_uncompress __ARGS((struct slcompress *comp, unsigned char *icp, | 180 | int slhc_remember(struct slcompress *comp, unsigned char *icp, int isize); |
183 | int isize)); | 181 | int slhc_toss(struct slcompress *comp); |
184 | int slhc_remember __ARGS((struct slcompress *comp, unsigned char *icp, | ||
185 | int isize)); | ||
186 | int slhc_toss __ARGS((struct slcompress *comp)); | ||
187 | 182 | ||
188 | #endif /* _SLHC_H */ | 183 | #endif /* _SLHC_H */ |
diff --git a/include/net/sock.h b/include/net/sock.h index e593af5b1ecc..a1042d08becd 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -684,16 +684,17 @@ extern void FASTCALL(release_sock(struct sock *sk)); | |||
684 | #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) | 684 | #define bh_lock_sock(__sk) spin_lock(&((__sk)->sk_lock.slock)) |
685 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) | 685 | #define bh_unlock_sock(__sk) spin_unlock(&((__sk)->sk_lock.slock)) |
686 | 686 | ||
687 | extern struct sock *sk_alloc(int family, int priority, | 687 | extern struct sock *sk_alloc(int family, |
688 | unsigned int __nocast priority, | ||
688 | struct proto *prot, int zero_it); | 689 | struct proto *prot, int zero_it); |
689 | extern void sk_free(struct sock *sk); | 690 | extern void sk_free(struct sock *sk); |
690 | 691 | ||
691 | extern struct sk_buff *sock_wmalloc(struct sock *sk, | 692 | extern struct sk_buff *sock_wmalloc(struct sock *sk, |
692 | unsigned long size, int force, | 693 | unsigned long size, int force, |
693 | int priority); | 694 | unsigned int __nocast priority); |
694 | extern struct sk_buff *sock_rmalloc(struct sock *sk, | 695 | extern struct sk_buff *sock_rmalloc(struct sock *sk, |
695 | unsigned long size, int force, | 696 | unsigned long size, int force, |
696 | int priority); | 697 | unsigned int __nocast priority); |
697 | extern void sock_wfree(struct sk_buff *skb); | 698 | extern void sock_wfree(struct sk_buff *skb); |
698 | extern void sock_rfree(struct sk_buff *skb); | 699 | extern void sock_rfree(struct sk_buff *skb); |
699 | 700 | ||
@@ -708,7 +709,8 @@ extern struct sk_buff *sock_alloc_send_skb(struct sock *sk, | |||
708 | unsigned long size, | 709 | unsigned long size, |
709 | int noblock, | 710 | int noblock, |
710 | int *errcode); | 711 | int *errcode); |
711 | extern void *sock_kmalloc(struct sock *sk, int size, int priority); | 712 | extern void *sock_kmalloc(struct sock *sk, int size, |
713 | unsigned int __nocast priority); | ||
712 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); | 714 | extern void sock_kfree_s(struct sock *sk, void *mem, int size); |
713 | extern void sk_send_sigurg(struct sock *sk); | 715 | extern void sk_send_sigurg(struct sock *sk); |
714 | 716 | ||
@@ -1132,15 +1134,19 @@ static inline void sk_stream_moderate_sndbuf(struct sock *sk) | |||
1132 | } | 1134 | } |
1133 | 1135 | ||
1134 | static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | 1136 | static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, |
1135 | int size, int mem, int gfp) | 1137 | int size, int mem, |
1138 | unsigned int __nocast gfp) | ||
1136 | { | 1139 | { |
1137 | struct sk_buff *skb = alloc_skb(size + sk->sk_prot->max_header, gfp); | 1140 | struct sk_buff *skb; |
1141 | int hdr_len; | ||
1138 | 1142 | ||
1143 | hdr_len = SKB_DATA_ALIGN(sk->sk_prot->max_header); | ||
1144 | skb = alloc_skb(size + hdr_len, gfp); | ||
1139 | if (skb) { | 1145 | if (skb) { |
1140 | skb->truesize += mem; | 1146 | skb->truesize += mem; |
1141 | if (sk->sk_forward_alloc >= (int)skb->truesize || | 1147 | if (sk->sk_forward_alloc >= (int)skb->truesize || |
1142 | sk_stream_mem_schedule(sk, skb->truesize, 0)) { | 1148 | sk_stream_mem_schedule(sk, skb->truesize, 0)) { |
1143 | skb_reserve(skb, sk->sk_prot->max_header); | 1149 | skb_reserve(skb, hdr_len); |
1144 | return skb; | 1150 | return skb; |
1145 | } | 1151 | } |
1146 | __kfree_skb(skb); | 1152 | __kfree_skb(skb); |
@@ -1152,7 +1158,8 @@ static inline struct sk_buff *sk_stream_alloc_pskb(struct sock *sk, | |||
1152 | } | 1158 | } |
1153 | 1159 | ||
1154 | static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk, | 1160 | static inline struct sk_buff *sk_stream_alloc_skb(struct sock *sk, |
1155 | int size, int gfp) | 1161 | int size, |
1162 | unsigned int __nocast gfp) | ||
1156 | { | 1163 | { |
1157 | return sk_stream_alloc_pskb(sk, size, 0, gfp); | 1164 | return sk_stream_alloc_pskb(sk, size, 0, gfp); |
1158 | } | 1165 | } |
@@ -1185,7 +1192,7 @@ static inline int sock_writeable(const struct sock *sk) | |||
1185 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); | 1192 | return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf / 2); |
1186 | } | 1193 | } |
1187 | 1194 | ||
1188 | static inline int gfp_any(void) | 1195 | static inline unsigned int __nocast gfp_any(void) |
1189 | { | 1196 | { |
1190 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; | 1197 | return in_softirq() ? GFP_ATOMIC : GFP_KERNEL; |
1191 | } | 1198 | } |
diff --git a/include/net/tcp.h b/include/net/tcp.h index ec9e20c27179..f4f9aba07ac2 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -721,11 +721,16 @@ static inline int tcp_ack_scheduled(struct tcp_sock *tp) | |||
721 | return tp->ack.pending&TCP_ACK_SCHED; | 721 | return tp->ack.pending&TCP_ACK_SCHED; |
722 | } | 722 | } |
723 | 723 | ||
724 | static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp) | 724 | static __inline__ void tcp_dec_quickack_mode(struct tcp_sock *tp, unsigned int pkts) |
725 | { | 725 | { |
726 | if (tp->ack.quick && --tp->ack.quick == 0) { | 726 | if (tp->ack.quick) { |
727 | /* Leaving quickack mode we deflate ATO. */ | 727 | if (pkts >= tp->ack.quick) { |
728 | tp->ack.ato = TCP_ATO_MIN; | 728 | tp->ack.quick = 0; |
729 | |||
730 | /* Leaving quickack mode we deflate ATO. */ | ||
731 | tp->ack.ato = TCP_ATO_MIN; | ||
732 | } else | ||
733 | tp->ack.quick -= pkts; | ||
729 | } | 734 | } |
730 | } | 735 | } |
731 | 736 | ||
@@ -843,7 +848,9 @@ extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, | |||
843 | 848 | ||
844 | /* tcp_output.c */ | 849 | /* tcp_output.c */ |
845 | 850 | ||
846 | extern int tcp_write_xmit(struct sock *, int nonagle); | 851 | extern void __tcp_push_pending_frames(struct sock *sk, struct tcp_sock *tp, |
852 | unsigned int cur_mss, int nonagle); | ||
853 | extern int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp); | ||
847 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); | 854 | extern int tcp_retransmit_skb(struct sock *, struct sk_buff *); |
848 | extern void tcp_xmit_retransmit_queue(struct sock *); | 855 | extern void tcp_xmit_retransmit_queue(struct sock *); |
849 | extern void tcp_simple_retransmit(struct sock *); | 856 | extern void tcp_simple_retransmit(struct sock *); |
@@ -853,12 +860,16 @@ extern void tcp_send_probe0(struct sock *); | |||
853 | extern void tcp_send_partial(struct sock *); | 860 | extern void tcp_send_partial(struct sock *); |
854 | extern int tcp_write_wakeup(struct sock *); | 861 | extern int tcp_write_wakeup(struct sock *); |
855 | extern void tcp_send_fin(struct sock *sk); | 862 | extern void tcp_send_fin(struct sock *sk); |
856 | extern void tcp_send_active_reset(struct sock *sk, int priority); | 863 | extern void tcp_send_active_reset(struct sock *sk, |
864 | unsigned int __nocast priority); | ||
857 | extern int tcp_send_synack(struct sock *); | 865 | extern int tcp_send_synack(struct sock *); |
858 | extern void tcp_push_one(struct sock *, unsigned mss_now); | 866 | extern void tcp_push_one(struct sock *, unsigned int mss_now); |
859 | extern void tcp_send_ack(struct sock *sk); | 867 | extern void tcp_send_ack(struct sock *sk); |
860 | extern void tcp_send_delayed_ack(struct sock *sk); | 868 | extern void tcp_send_delayed_ack(struct sock *sk); |
861 | 869 | ||
870 | /* tcp_input.c */ | ||
871 | extern void tcp_cwnd_application_limited(struct sock *sk); | ||
872 | |||
862 | /* tcp_timer.c */ | 873 | /* tcp_timer.c */ |
863 | extern void tcp_init_xmit_timers(struct sock *); | 874 | extern void tcp_init_xmit_timers(struct sock *); |
864 | extern void tcp_clear_xmit_timers(struct sock *); | 875 | extern void tcp_clear_xmit_timers(struct sock *); |
@@ -958,7 +969,7 @@ static inline void tcp_reset_xmit_timer(struct sock *sk, int what, unsigned long | |||
958 | static inline void tcp_initialize_rcv_mss(struct sock *sk) | 969 | static inline void tcp_initialize_rcv_mss(struct sock *sk) |
959 | { | 970 | { |
960 | struct tcp_sock *tp = tcp_sk(sk); | 971 | struct tcp_sock *tp = tcp_sk(sk); |
961 | unsigned int hint = min(tp->advmss, tp->mss_cache_std); | 972 | unsigned int hint = min_t(unsigned int, tp->advmss, tp->mss_cache); |
962 | 973 | ||
963 | hint = min(hint, tp->rcv_wnd/2); | 974 | hint = min(hint, tp->rcv_wnd/2); |
964 | hint = min(hint, TCP_MIN_RCVMSS); | 975 | hint = min(hint, TCP_MIN_RCVMSS); |
@@ -981,7 +992,7 @@ static __inline__ void tcp_fast_path_on(struct tcp_sock *tp) | |||
981 | 992 | ||
982 | static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp) | 993 | static inline void tcp_fast_path_check(struct sock *sk, struct tcp_sock *tp) |
983 | { | 994 | { |
984 | if (skb_queue_len(&tp->out_of_order_queue) == 0 && | 995 | if (skb_queue_empty(&tp->out_of_order_queue) && |
985 | tp->rcv_wnd && | 996 | tp->rcv_wnd && |
986 | atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && | 997 | atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && |
987 | !tp->urg_data) | 998 | !tp->urg_data) |
@@ -1225,28 +1236,6 @@ static inline void tcp_sync_left_out(struct tcp_sock *tp) | |||
1225 | tp->left_out = tp->sacked_out + tp->lost_out; | 1236 | tp->left_out = tp->sacked_out + tp->lost_out; |
1226 | } | 1237 | } |
1227 | 1238 | ||
1228 | extern void tcp_cwnd_application_limited(struct sock *sk); | ||
1229 | |||
1230 | /* Congestion window validation. (RFC2861) */ | ||
1231 | |||
1232 | static inline void tcp_cwnd_validate(struct sock *sk, struct tcp_sock *tp) | ||
1233 | { | ||
1234 | __u32 packets_out = tp->packets_out; | ||
1235 | |||
1236 | if (packets_out >= tp->snd_cwnd) { | ||
1237 | /* Network is feed fully. */ | ||
1238 | tp->snd_cwnd_used = 0; | ||
1239 | tp->snd_cwnd_stamp = tcp_time_stamp; | ||
1240 | } else { | ||
1241 | /* Network starves. */ | ||
1242 | if (tp->packets_out > tp->snd_cwnd_used) | ||
1243 | tp->snd_cwnd_used = tp->packets_out; | ||
1244 | |||
1245 | if ((s32)(tcp_time_stamp - tp->snd_cwnd_stamp) >= tp->rto) | ||
1246 | tcp_cwnd_application_limited(sk); | ||
1247 | } | ||
1248 | } | ||
1249 | |||
1250 | /* Set slow start threshould and cwnd not falling to slow start */ | 1239 | /* Set slow start threshould and cwnd not falling to slow start */ |
1251 | static inline void __tcp_enter_cwr(struct tcp_sock *tp) | 1240 | static inline void __tcp_enter_cwr(struct tcp_sock *tp) |
1252 | { | 1241 | { |
@@ -1279,12 +1268,6 @@ static __inline__ __u32 tcp_max_burst(const struct tcp_sock *tp) | |||
1279 | return 3; | 1268 | return 3; |
1280 | } | 1269 | } |
1281 | 1270 | ||
1282 | static __inline__ int tcp_minshall_check(const struct tcp_sock *tp) | ||
1283 | { | ||
1284 | return after(tp->snd_sml,tp->snd_una) && | ||
1285 | !after(tp->snd_sml, tp->snd_nxt); | ||
1286 | } | ||
1287 | |||
1288 | static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss, | 1271 | static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss, |
1289 | const struct sk_buff *skb) | 1272 | const struct sk_buff *skb) |
1290 | { | 1273 | { |
@@ -1292,122 +1275,18 @@ static __inline__ void tcp_minshall_update(struct tcp_sock *tp, int mss, | |||
1292 | tp->snd_sml = TCP_SKB_CB(skb)->end_seq; | 1275 | tp->snd_sml = TCP_SKB_CB(skb)->end_seq; |
1293 | } | 1276 | } |
1294 | 1277 | ||
1295 | /* Return 0, if packet can be sent now without violation Nagle's rules: | ||
1296 | 1. It is full sized. | ||
1297 | 2. Or it contains FIN. | ||
1298 | 3. Or TCP_NODELAY was set. | ||
1299 | 4. Or TCP_CORK is not set, and all sent packets are ACKed. | ||
1300 | With Minshall's modification: all sent small packets are ACKed. | ||
1301 | */ | ||
1302 | |||
1303 | static __inline__ int | ||
1304 | tcp_nagle_check(const struct tcp_sock *tp, const struct sk_buff *skb, | ||
1305 | unsigned mss_now, int nonagle) | ||
1306 | { | ||
1307 | return (skb->len < mss_now && | ||
1308 | !(TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN) && | ||
1309 | ((nonagle&TCP_NAGLE_CORK) || | ||
1310 | (!nonagle && | ||
1311 | tp->packets_out && | ||
1312 | tcp_minshall_check(tp)))); | ||
1313 | } | ||
1314 | |||
1315 | extern void tcp_set_skb_tso_segs(struct sock *, struct sk_buff *); | ||
1316 | |||
1317 | /* This checks if the data bearing packet SKB (usually sk->sk_send_head) | ||
1318 | * should be put on the wire right now. | ||
1319 | */ | ||
1320 | static __inline__ int tcp_snd_test(struct sock *sk, | ||
1321 | struct sk_buff *skb, | ||
1322 | unsigned cur_mss, int nonagle) | ||
1323 | { | ||
1324 | struct tcp_sock *tp = tcp_sk(sk); | ||
1325 | int pkts = tcp_skb_pcount(skb); | ||
1326 | |||
1327 | if (!pkts) { | ||
1328 | tcp_set_skb_tso_segs(sk, skb); | ||
1329 | pkts = tcp_skb_pcount(skb); | ||
1330 | } | ||
1331 | |||
1332 | /* RFC 1122 - section 4.2.3.4 | ||
1333 | * | ||
1334 | * We must queue if | ||
1335 | * | ||
1336 | * a) The right edge of this frame exceeds the window | ||
1337 | * b) There are packets in flight and we have a small segment | ||
1338 | * [SWS avoidance and Nagle algorithm] | ||
1339 | * (part of SWS is done on packetization) | ||
1340 | * Minshall version sounds: there are no _small_ | ||
1341 | * segments in flight. (tcp_nagle_check) | ||
1342 | * c) We have too many packets 'in flight' | ||
1343 | * | ||
1344 | * Don't use the nagle rule for urgent data (or | ||
1345 | * for the final FIN -DaveM). | ||
1346 | * | ||
1347 | * Also, Nagle rule does not apply to frames, which | ||
1348 | * sit in the middle of queue (they have no chances | ||
1349 | * to get new data) and if room at tail of skb is | ||
1350 | * not enough to save something seriously (<32 for now). | ||
1351 | */ | ||
1352 | |||
1353 | /* Don't be strict about the congestion window for the | ||
1354 | * final FIN frame. -DaveM | ||
1355 | */ | ||
1356 | return (((nonagle&TCP_NAGLE_PUSH) || tp->urg_mode | ||
1357 | || !tcp_nagle_check(tp, skb, cur_mss, nonagle)) && | ||
1358 | (((tcp_packets_in_flight(tp) + (pkts-1)) < tp->snd_cwnd) || | ||
1359 | (TCP_SKB_CB(skb)->flags & TCPCB_FLAG_FIN)) && | ||
1360 | !after(TCP_SKB_CB(skb)->end_seq, tp->snd_una + tp->snd_wnd)); | ||
1361 | } | ||
1362 | |||
1363 | static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) | 1278 | static __inline__ void tcp_check_probe_timer(struct sock *sk, struct tcp_sock *tp) |
1364 | { | 1279 | { |
1365 | if (!tp->packets_out && !tp->pending) | 1280 | if (!tp->packets_out && !tp->pending) |
1366 | tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto); | 1281 | tcp_reset_xmit_timer(sk, TCP_TIME_PROBE0, tp->rto); |
1367 | } | 1282 | } |
1368 | 1283 | ||
1369 | static __inline__ int tcp_skb_is_last(const struct sock *sk, | ||
1370 | const struct sk_buff *skb) | ||
1371 | { | ||
1372 | return skb->next == (struct sk_buff *)&sk->sk_write_queue; | ||
1373 | } | ||
1374 | |||
1375 | /* Push out any pending frames which were held back due to | ||
1376 | * TCP_CORK or attempt at coalescing tiny packets. | ||
1377 | * The socket must be locked by the caller. | ||
1378 | */ | ||
1379 | static __inline__ void __tcp_push_pending_frames(struct sock *sk, | ||
1380 | struct tcp_sock *tp, | ||
1381 | unsigned cur_mss, | ||
1382 | int nonagle) | ||
1383 | { | ||
1384 | struct sk_buff *skb = sk->sk_send_head; | ||
1385 | |||
1386 | if (skb) { | ||
1387 | if (!tcp_skb_is_last(sk, skb)) | ||
1388 | nonagle = TCP_NAGLE_PUSH; | ||
1389 | if (!tcp_snd_test(sk, skb, cur_mss, nonagle) || | ||
1390 | tcp_write_xmit(sk, nonagle)) | ||
1391 | tcp_check_probe_timer(sk, tp); | ||
1392 | } | ||
1393 | tcp_cwnd_validate(sk, tp); | ||
1394 | } | ||
1395 | |||
1396 | static __inline__ void tcp_push_pending_frames(struct sock *sk, | 1284 | static __inline__ void tcp_push_pending_frames(struct sock *sk, |
1397 | struct tcp_sock *tp) | 1285 | struct tcp_sock *tp) |
1398 | { | 1286 | { |
1399 | __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 1), tp->nonagle); | 1287 | __tcp_push_pending_frames(sk, tp, tcp_current_mss(sk, 1), tp->nonagle); |
1400 | } | 1288 | } |
1401 | 1289 | ||
1402 | static __inline__ int tcp_may_send_now(struct sock *sk, struct tcp_sock *tp) | ||
1403 | { | ||
1404 | struct sk_buff *skb = sk->sk_send_head; | ||
1405 | |||
1406 | return (skb && | ||
1407 | tcp_snd_test(sk, skb, tcp_current_mss(sk, 1), | ||
1408 | tcp_skb_is_last(sk, skb) ? TCP_NAGLE_PUSH : tp->nonagle)); | ||
1409 | } | ||
1410 | |||
1411 | static __inline__ void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) | 1290 | static __inline__ void tcp_init_wl(struct tcp_sock *tp, u32 ack, u32 seq) |
1412 | { | 1291 | { |
1413 | tp->snd_wl1 = seq; | 1292 | tp->snd_wl1 = seq; |
diff --git a/include/net/x25device.h b/include/net/x25device.h index cf36a20ea3c5..d45ae883bd1d 100644 --- a/include/net/x25device.h +++ b/include/net/x25device.h | |||
@@ -5,8 +5,7 @@ | |||
5 | #include <linux/if_packet.h> | 5 | #include <linux/if_packet.h> |
6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
7 | 7 | ||
8 | static inline unsigned short x25_type_trans(struct sk_buff *skb, | 8 | static inline __be16 x25_type_trans(struct sk_buff *skb, struct net_device *dev) |
9 | struct net_device *dev) | ||
10 | { | 9 | { |
11 | skb->mac.raw = skb->data; | 10 | skb->mac.raw = skb->data; |
12 | skb->input_dev = skb->dev = dev; | 11 | skb->input_dev = skb->dev = dev; |