aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2005-11-10 17:46:07 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-10 17:46:07 -0500
commit985834a1c3a2e9639145bd8ea16af6e25f2143ad (patch)
tree3a37e487882d1c6b1b8101ef160afb26405b1647 /include
parentb8cbfa692485bf7568eda3d2f37545a76efb7c93 (diff)
parentf3b84ec2a67bbfbe44cf907203ee99b23b38fc30 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/if_ether.h4
-rw-r--r--include/linux/netdevice.h7
-rw-r--r--include/linux/skbuff.h27
-rw-r--r--include/net/tcp.h3
4 files changed, 37 insertions, 4 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index d21c305c6c64..fe26d431de87 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -21,6 +21,8 @@
21#ifndef _LINUX_IF_ETHER_H 21#ifndef _LINUX_IF_ETHER_H
22#define _LINUX_IF_ETHER_H 22#define _LINUX_IF_ETHER_H
23 23
24#include <linux/types.h>
25
24/* 26/*
25 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble 27 * IEEE 802.3 Ethernet magic constants. The frame sizes omit the preamble
26 * and FCS/CRC (frame check sequence). 28 * and FCS/CRC (frame check sequence).
@@ -100,7 +102,7 @@
100struct ethhdr { 102struct ethhdr {
101 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */ 103 unsigned char h_dest[ETH_ALEN]; /* destination eth addr */
102 unsigned char h_source[ETH_ALEN]; /* source ether addr */ 104 unsigned char h_source[ETH_ALEN]; /* source ether addr */
103 unsigned short h_proto; /* packet type ID field */ 105 __be16 h_proto; /* packet type ID field */
104} __attribute__((packed)); 106} __attribute__((packed));
105 107
106#ifdef __KERNEL__ 108#ifdef __KERNEL__
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index c6efce4a04a4..936f8b76114e 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -927,6 +927,13 @@ extern int netdev_max_backlog;
927extern int weight_p; 927extern int weight_p;
928extern int netdev_set_master(struct net_device *dev, struct net_device *master); 928extern int netdev_set_master(struct net_device *dev, struct net_device *master);
929extern int skb_checksum_help(struct sk_buff *skb, int inward); 929extern int skb_checksum_help(struct sk_buff *skb, int inward);
930#ifdef CONFIG_BUG
931extern void netdev_rx_csum_fault(struct net_device *dev);
932#else
933static inline void netdev_rx_csum_fault(struct net_device *dev)
934{
935}
936#endif
930/* rx skb timestamps */ 937/* rx skb timestamps */
931extern void net_enable_timestamp(void); 938extern void net_enable_timestamp(void);
932extern void net_disable_timestamp(void); 939extern void net_disable_timestamp(void);
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 83010231db99..0a8ea8b35816 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -1236,8 +1236,7 @@ extern unsigned int datagram_poll(struct file *file, struct socket *sock,
1236extern int skb_copy_datagram_iovec(const struct sk_buff *from, 1236extern int skb_copy_datagram_iovec(const struct sk_buff *from,
1237 int offset, struct iovec *to, 1237 int offset, struct iovec *to,
1238 int size); 1238 int size);
1239extern int skb_copy_and_csum_datagram_iovec(const 1239extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1240 struct sk_buff *skb,
1241 int hlen, 1240 int hlen,
1242 struct iovec *iov); 1241 struct iovec *iov);
1243extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1242extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
@@ -1305,6 +1304,30 @@ static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *
1305 1304
1306extern void __net_timestamp(struct sk_buff *skb); 1305extern void __net_timestamp(struct sk_buff *skb);
1307 1306
1307extern unsigned int __skb_checksum_complete(struct sk_buff *skb);
1308
1309/**
1310 * skb_checksum_complete - Calculate checksum of an entire packet
1311 * @skb: packet to process
1312 *
1313 * This function calculates the checksum over the entire packet plus
1314 * the value of skb->csum. The latter can be used to supply the
1315 * checksum of a pseudo header as used by TCP/UDP. It returns the
1316 * checksum.
1317 *
1318 * For protocols that contain complete checksums such as ICMP/TCP/UDP,
1319 * this function can be used to verify that checksum on received
1320 * packets. In that case the function should return zero if the
1321 * checksum is correct. In particular, this function will return zero
1322 * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the
1323 * hardware has already verified the correctness of the checksum.
1324 */
1325static inline unsigned int skb_checksum_complete(struct sk_buff *skb)
1326{
1327 return skb->ip_summed != CHECKSUM_UNNECESSARY &&
1328 __skb_checksum_complete(skb);
1329}
1330
1308#ifdef CONFIG_NETFILTER 1331#ifdef CONFIG_NETFILTER
1309static inline void nf_conntrack_put(struct nf_conntrack *nfct) 1332static inline void nf_conntrack_put(struct nf_conntrack *nfct)
1310{ 1333{
diff --git a/include/net/tcp.h b/include/net/tcp.h
index c24339c4e310..96cc3b434e40 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -27,6 +27,7 @@
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/cache.h> 28#include <linux/cache.h>
29#include <linux/percpu.h> 29#include <linux/percpu.h>
30#include <linux/skbuff.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>
@@ -852,7 +853,7 @@ static __inline__ u16 tcp_v4_check(struct tcphdr *th, int len,
852 853
853static __inline__ int __tcp_checksum_complete(struct sk_buff *skb) 854static __inline__ int __tcp_checksum_complete(struct sk_buff *skb)
854{ 855{
855 return (unsigned short)csum_fold(skb_checksum(skb, 0, skb->len, skb->csum)); 856 return __skb_checksum_complete(skb);
856} 857}
857 858
858static __inline__ int tcp_checksum_complete(struct sk_buff *skb) 859static __inline__ int tcp_checksum_complete(struct sk_buff *skb)