diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/if_ether.h | 4 | ||||
-rw-r--r-- | include/linux/isdn_ppp.h | 2 | ||||
-rw-r--r-- | include/linux/netdevice.h | 77 | ||||
-rw-r--r-- | include/linux/notifier.h | 1 | ||||
-rw-r--r-- | include/linux/tcp.h | 6 | ||||
-rw-r--r-- | include/net/inet_hashtables.h | 4 | ||||
-rw-r--r-- | include/net/inetpeer.h | 16 | ||||
-rw-r--r-- | include/net/phonet/pn_dev.h | 2 | ||||
-rw-r--r-- | include/net/sctp/structs.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 3 |
10 files changed, 81 insertions, 36 deletions
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 580b6004d00e..005e1525ab86 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -136,10 +136,6 @@ extern struct ctl_table ether_table[]; | |||
136 | 136 | ||
137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
138 | 138 | ||
139 | /* | ||
140 | * Display a 6 byte device address (MAC) in a readable format. | ||
141 | */ | ||
142 | extern char *print_mac(char *buf, const unsigned char *addr) __deprecated; | ||
143 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 139 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
144 | #define MAC_BUF_SIZE 18 | 140 | #define MAC_BUF_SIZE 18 |
145 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] | 141 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] |
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 4c218ee7587a..8687a7dc0632 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
@@ -157,7 +157,7 @@ typedef struct { | |||
157 | 157 | ||
158 | typedef struct { | 158 | typedef struct { |
159 | int mp_mrru; /* unused */ | 159 | int mp_mrru; /* unused */ |
160 | struct sk_buff_head frags; /* fragments sl list */ | 160 | struct sk_buff * frags; /* fragments sl list -- use skb->next */ |
161 | long frames; /* number of frames in the frame list */ | 161 | long frames; /* number of frames in the frame list */ |
162 | unsigned int seq; /* last processed packet seq #: any packets | 162 | unsigned int seq; /* last processed packet seq #: any packets |
163 | * with smaller seq # will be dropped | 163 | * with smaller seq # will be dropped |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 083b5989cecb..97873e31661c 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -63,30 +63,69 @@ struct wireless_dev; | |||
63 | #define HAVE_FREE_NETDEV /* free_netdev() */ | 63 | #define HAVE_FREE_NETDEV /* free_netdev() */ |
64 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ | 64 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ |
65 | 65 | ||
66 | #define NET_XMIT_SUCCESS 0 | ||
67 | #define NET_XMIT_DROP 1 /* skb dropped */ | ||
68 | #define NET_XMIT_CN 2 /* congestion notification */ | ||
69 | #define NET_XMIT_POLICED 3 /* skb is shot by police */ | ||
70 | #define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */ | ||
71 | |||
72 | /* Backlog congestion levels */ | 66 | /* Backlog congestion levels */ |
73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 67 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
74 | #define NET_RX_DROP 1 /* packet dropped */ | 68 | #define NET_RX_DROP 1 /* packet dropped */ |
69 | |||
70 | /* | ||
71 | * Transmit return codes: transmit return codes originate from three different | ||
72 | * namespaces: | ||
73 | * | ||
74 | * - qdisc return codes | ||
75 | * - driver transmit return codes | ||
76 | * - errno values | ||
77 | * | ||
78 | * Drivers are allowed to return any one of those in their hard_start_xmit() | ||
79 | * function. Real network devices commonly used with qdiscs should only return | ||
80 | * the driver transmit return codes though - when qdiscs are used, the actual | ||
81 | * transmission happens asynchronously, so the value is not propagated to | ||
82 | * higher layers. Virtual network devices transmit synchronously, in this case | ||
83 | * the driver transmit return codes are consumed by dev_queue_xmit(), all | ||
84 | * others are propagated to higher layers. | ||
85 | */ | ||
86 | |||
87 | /* qdisc ->enqueue() return codes. */ | ||
88 | #define NET_XMIT_SUCCESS 0x00 | ||
89 | #define NET_XMIT_DROP 0x01 /* skb dropped */ | ||
90 | #define NET_XMIT_CN 0x02 /* congestion notification */ | ||
91 | #define NET_XMIT_POLICED 0x03 /* skb is shot by police */ | ||
92 | #define NET_XMIT_MASK 0x0f /* qdisc flags in net/sch_generic.h */ | ||
75 | 93 | ||
76 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | 94 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It |
77 | * indicates that the device will soon be dropping packets, or already drops | 95 | * indicates that the device will soon be dropping packets, or already drops |
78 | * some packets of the same priority; prompting us to send less aggressively. */ | 96 | * some packets of the same priority; prompting us to send less aggressively. */ |
79 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | 97 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN ? 0 : (e)) |
80 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 98 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
81 | 99 | ||
82 | /* Driver transmit return codes */ | 100 | /* Driver transmit return codes */ |
101 | #define NETDEV_TX_MASK 0xf0 | ||
102 | |||
83 | enum netdev_tx { | 103 | enum netdev_tx { |
84 | NETDEV_TX_OK = 0, /* driver took care of packet */ | 104 | __NETDEV_TX_MIN = INT_MIN, /* make sure enum is signed */ |
85 | NETDEV_TX_BUSY, /* driver tx path was busy*/ | 105 | NETDEV_TX_OK = 0x00, /* driver took care of packet */ |
86 | NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ | 106 | NETDEV_TX_BUSY = 0x10, /* driver tx path was busy*/ |
107 | NETDEV_TX_LOCKED = 0x20, /* driver tx lock was already taken */ | ||
87 | }; | 108 | }; |
88 | typedef enum netdev_tx netdev_tx_t; | 109 | typedef enum netdev_tx netdev_tx_t; |
89 | 110 | ||
111 | /* | ||
112 | * Current order: NETDEV_TX_MASK > NET_XMIT_MASK >= 0 is significant; | ||
113 | * hard_start_xmit() return < NET_XMIT_MASK means skb was consumed. | ||
114 | */ | ||
115 | static inline bool dev_xmit_complete(int rc) | ||
116 | { | ||
117 | /* | ||
118 | * Positive cases with an skb consumed by a driver: | ||
119 | * - successful transmission (rc == NETDEV_TX_OK) | ||
120 | * - error while transmitting (rc < 0) | ||
121 | * - error while queueing to a different device (rc & NET_XMIT_MASK) | ||
122 | */ | ||
123 | if (likely(rc < NET_XMIT_MASK)) | ||
124 | return true; | ||
125 | |||
126 | return false; | ||
127 | } | ||
128 | |||
90 | #endif | 129 | #endif |
91 | 130 | ||
92 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ | 131 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ |
@@ -857,7 +896,7 @@ struct net_device { | |||
857 | /* device index hash chain */ | 896 | /* device index hash chain */ |
858 | struct hlist_node index_hlist; | 897 | struct hlist_node index_hlist; |
859 | 898 | ||
860 | struct net_device *link_watch_next; | 899 | struct list_head link_watch_list; |
861 | 900 | ||
862 | /* register/unregister state machine */ | 901 | /* register/unregister state machine */ |
863 | enum { NETREG_UNINITIALIZED=0, | 902 | enum { NETREG_UNINITIALIZED=0, |
@@ -1093,6 +1132,16 @@ static inline struct net_device *next_net_device(struct net_device *dev) | |||
1093 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | 1132 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); |
1094 | } | 1133 | } |
1095 | 1134 | ||
1135 | static inline struct net_device *next_net_device_rcu(struct net_device *dev) | ||
1136 | { | ||
1137 | struct list_head *lh; | ||
1138 | struct net *net; | ||
1139 | |||
1140 | net = dev_net(dev); | ||
1141 | lh = rcu_dereference(dev->dev_list.next); | ||
1142 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | ||
1143 | } | ||
1144 | |||
1096 | static inline struct net_device *first_net_device(struct net *net) | 1145 | static inline struct net_device *first_net_device(struct net *net) |
1097 | { | 1146 | { |
1098 | return list_empty(&net->dev_base_head) ? NULL : | 1147 | return list_empty(&net->dev_base_head) ? NULL : |
@@ -1551,6 +1600,7 @@ static inline void dev_hold(struct net_device *dev) | |||
1551 | */ | 1600 | */ |
1552 | 1601 | ||
1553 | extern void linkwatch_fire_event(struct net_device *dev); | 1602 | extern void linkwatch_fire_event(struct net_device *dev); |
1603 | extern void linkwatch_forget_dev(struct net_device *dev); | ||
1554 | 1604 | ||
1555 | /** | 1605 | /** |
1556 | * netif_carrier_ok - test if carrier present | 1606 | * netif_carrier_ok - test if carrier present |
@@ -1892,6 +1942,7 @@ extern void netdev_features_change(struct net_device *dev); | |||
1892 | extern void dev_load(struct net *net, const char *name); | 1942 | extern void dev_load(struct net *net, const char *name); |
1893 | extern void dev_mcast_init(void); | 1943 | extern void dev_mcast_init(void); |
1894 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | 1944 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); |
1945 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); | ||
1895 | 1946 | ||
1896 | extern int netdev_max_backlog; | 1947 | extern int netdev_max_backlog; |
1897 | extern int weight_p; | 1948 | extern int weight_p; |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 29714b8441b1..b0c3671d463c 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -202,6 +202,7 @@ static inline int notifier_to_errno(int ret) | |||
202 | #define NETDEV_BONDING_OLDTYPE 0x000E | 202 | #define NETDEV_BONDING_OLDTYPE 0x000E |
203 | #define NETDEV_BONDING_NEWTYPE 0x000F | 203 | #define NETDEV_BONDING_NEWTYPE 0x000F |
204 | #define NETDEV_POST_INIT 0x0010 | 204 | #define NETDEV_POST_INIT 0x0010 |
205 | #define NETDEV_UNREGISTER_PERNET 0x0011 | ||
205 | 206 | ||
206 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 207 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
207 | #define SYS_RESTART SYS_DOWN | 208 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index eeecb8547a2a..32d7d77b4a01 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -81,6 +81,12 @@ enum { | |||
81 | TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000) | 81 | TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000) |
82 | }; | 82 | }; |
83 | 83 | ||
84 | /* | ||
85 | * TCP general constants | ||
86 | */ | ||
87 | #define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */ | ||
88 | #define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */ | ||
89 | |||
84 | /* TCP socket options */ | 90 | /* TCP socket options */ |
85 | #define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */ | 91 | #define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */ |
86 | #define TCP_MAXSEG 2 /* Limit MSS */ | 92 | #define TCP_MAXSEG 2 /* Limit MSS */ |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index 5b698b3b463d..41cbddd25b70 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -92,8 +92,8 @@ static inline struct net *ib_net(struct inet_bind_bucket *ib) | |||
92 | return read_pnet(&ib->ib_net); | 92 | return read_pnet(&ib->ib_net); |
93 | } | 93 | } |
94 | 94 | ||
95 | #define inet_bind_bucket_for_each(tb, node, head) \ | 95 | #define inet_bind_bucket_for_each(tb, pos, head) \ |
96 | hlist_for_each_entry(tb, node, head, node) | 96 | hlist_for_each_entry(tb, pos, head, node) |
97 | 97 | ||
98 | struct inet_bind_hashbucket { | 98 | struct inet_bind_hashbucket { |
99 | spinlock_t lock; | 99 | spinlock_t lock; |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 35ad7b930467..87b1df0d4d8c 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -17,15 +17,15 @@ struct inet_peer { | |||
17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | 17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ |
18 | struct inet_peer *avl_left, *avl_right; | 18 | struct inet_peer *avl_left, *avl_right; |
19 | __be32 v4daddr; /* peer's address */ | 19 | __be32 v4daddr; /* peer's address */ |
20 | __u16 avl_height; | 20 | __u32 avl_height; |
21 | __u16 ip_id_count; /* IP ID for the next packet */ | ||
22 | struct list_head unused; | 21 | struct list_head unused; |
23 | __u32 dtime; /* the time of last use of not | 22 | __u32 dtime; /* the time of last use of not |
24 | * referenced entries */ | 23 | * referenced entries */ |
25 | atomic_t refcnt; | 24 | atomic_t refcnt; |
26 | atomic_t rid; /* Frag reception counter */ | 25 | atomic_t rid; /* Frag reception counter */ |
26 | atomic_t ip_id_count; /* IP ID for the next packet */ | ||
27 | __u32 tcp_ts; | 27 | __u32 tcp_ts; |
28 | unsigned long tcp_ts_stamp; | 28 | __u32 tcp_ts_stamp; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | void inet_initpeers(void) __init; | 31 | void inet_initpeers(void) __init; |
@@ -36,17 +36,11 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create); | |||
36 | /* can be called from BH context or outside */ | 36 | /* can be called from BH context or outside */ |
37 | extern void inet_putpeer(struct inet_peer *p); | 37 | extern void inet_putpeer(struct inet_peer *p); |
38 | 38 | ||
39 | extern spinlock_t inet_peer_idlock; | ||
40 | /* can be called with or without local BH being disabled */ | 39 | /* can be called with or without local BH being disabled */ |
41 | static inline __u16 inet_getid(struct inet_peer *p, int more) | 40 | static inline __u16 inet_getid(struct inet_peer *p, int more) |
42 | { | 41 | { |
43 | __u16 id; | 42 | more++; |
44 | 43 | return atomic_add_return(more, &p->ip_id_count) - more; | |
45 | spin_lock_bh(&inet_peer_idlock); | ||
46 | id = p->ip_id_count; | ||
47 | p->ip_id_count += 1 + more; | ||
48 | spin_unlock_bh(&inet_peer_idlock); | ||
49 | return id; | ||
50 | } | 44 | } |
51 | 45 | ||
52 | #endif /* _NET_INETPEER_H */ | 46 | #endif /* _NET_INETPEER_H */ |
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index afa7defceb14..d7b989ca3d63 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | struct phonet_device_list { | 26 | struct phonet_device_list { |
27 | struct list_head list; | 27 | struct list_head list; |
28 | spinlock_t lock; | 28 | struct mutex lock; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct phonet_device_list *phonet_device_list(struct net *net); | 31 | struct phonet_device_list *phonet_device_list(struct net *net); |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 6e5f0e0c7967..cd2e18778f81 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -1980,7 +1980,7 @@ void sctp_assoc_set_primary(struct sctp_association *, | |||
1980 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, | 1980 | void sctp_assoc_del_nonprimary_peers(struct sctp_association *, |
1981 | struct sctp_transport *); | 1981 | struct sctp_transport *); |
1982 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, | 1982 | int sctp_assoc_set_bind_addr_from_ep(struct sctp_association *, |
1983 | gfp_t); | 1983 | sctp_scope_t, gfp_t); |
1984 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, | 1984 | int sctp_assoc_set_bind_addr_from_cookie(struct sctp_association *, |
1985 | struct sctp_cookie*, | 1985 | struct sctp_cookie*, |
1986 | gfp_t gfp); | 1986 | gfp_t gfp); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index bf20f88fd033..325bfcf5c934 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -62,9 +62,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
62 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 62 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
63 | #define TCP_MIN_MSS 88U | 63 | #define TCP_MIN_MSS 88U |
64 | 64 | ||
65 | /* Minimal RCV_MSS. */ | ||
66 | #define TCP_MIN_RCVMSS 536U | ||
67 | |||
68 | /* The least MTU to use for probing */ | 65 | /* The least MTU to use for probing */ |
69 | #define TCP_BASE_MSS 512 | 66 | #define TCP_BASE_MSS 512 |
70 | 67 | ||