aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-generic/stat.h14
-rw-r--r--include/drm/ttm/ttm_bo_api.h4
-rw-r--r--include/drm/ttm/ttm_bo_driver.h79
-rw-r--r--include/linux/atomic.h37
-rw-r--r--include/linux/bio.h4
-rw-r--r--include/linux/blk_types.h6
-rw-r--r--include/linux/blkdev.h3
-rw-r--r--include/linux/dccp.h23
-rw-r--r--include/linux/drbd.h2
-rw-r--r--include/linux/ethtool.h4
-rw-r--r--include/linux/filter.h56
-rw-r--r--include/linux/hardirq.h8
-rw-r--r--include/linux/highmem.h1
-rw-r--r--include/linux/i2c/adp5588.h15
-rw-r--r--include/linux/if_bridge.h4
-rw-r--r--include/linux/if_link.h28
-rw-r--r--include/linux/if_macvlan.h34
-rw-r--r--include/linux/if_vlan.h25
-rw-r--r--include/linux/igmp.h14
-rw-r--r--include/linux/inetdevice.h15
-rw-r--r--include/linux/input.h4
-rw-r--r--include/linux/iocontext.h1
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/jhash.h183
-rw-r--r--include/linux/kernel.h3
-rw-r--r--include/linux/leds-lp5521.h47
-rw-r--r--include/linux/leds-lp5523.h47
-rw-r--r--include/linux/leds.h47
-rw-r--r--include/linux/marvell_phy.h1
-rw-r--r--include/linux/mdio.h5
-rw-r--r--include/linux/mmc/sh_mmcif.h18
-rw-r--r--include/linux/netdevice.h82
-rw-r--r--include/linux/netfilter.h4
-rw-r--r--include/linux/perf_event.h10
-rw-r--r--include/linux/pwm_backlight.h1
-rw-r--r--include/linux/radix-tree.h39
-rw-r--r--include/linux/resource.h1
-rw-r--r--include/linux/rtnetlink.h2
-rw-r--r--include/linux/sh_clk.h4
-rw-r--r--include/linux/sh_timer.h1
-rw-r--r--include/linux/skbuff.h3
-rw-r--r--include/linux/snmp.h1
-rw-r--r--include/linux/stmmac.h6
-rw-r--r--include/linux/sunrpc/svc_xprt.h18
-rw-r--r--include/linux/tty.h2
-rw-r--r--include/linux/usb.h2
-rw-r--r--include/linux/usb/musb.h2
-rw-r--r--include/linux/usb/usbnet.h6
-rw-r--r--include/linux/xfrm.h1
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/af_unix.h2
-rw-r--r--include/net/caif/caif_dev.h4
-rw-r--r--include/net/caif/caif_spi.h2
-rw-r--r--include/net/caif/cfcnfg.h8
-rw-r--r--include/net/caif/cfctrl.h2
-rw-r--r--include/net/dn.h2
-rw-r--r--include/net/dn_dev.h27
-rw-r--r--include/net/dn_route.h10
-rw-r--r--include/net/dst.h43
-rw-r--r--include/net/flow.h2
-rw-r--r--include/net/if_inet6.h3
-rw-r--r--include/net/inet6_connection_sock.h3
-rw-r--r--include/net/inet_connection_sock.h2
-rw-r--r--include/net/inet_sock.h7
-rw-r--r--include/net/inet_timewait_sock.h20
-rw-r--r--include/net/inetpeer.h32
-rw-r--r--include/net/ip.h10
-rw-r--r--include/net/ip6_fib.h2
-rw-r--r--include/net/ip6_route.h13
-rw-r--r--include/net/ndisc.h3
-rw-r--r--include/net/neighbour.h12
-rw-r--r--include/net/netlink.h23
-rw-r--r--include/net/netns/generic.h2
-rw-r--r--include/net/route.h35
-rw-r--r--include/net/rtnetlink.h35
-rw-r--r--include/net/scm.h5
-rw-r--r--include/net/sctp/command.h3
-rw-r--r--include/net/sctp/constants.h14
-rw-r--r--include/net/sctp/structs.h2
-rw-r--r--include/net/snmp.h4
-rw-r--r--include/net/sock.h105
-rw-r--r--include/net/tcp.h15
-rw-r--r--include/net/timewait_sock.h8
-rw-r--r--include/net/tipc/tipc.h186
-rw-r--r--include/net/tipc/tipc_bearer.h138
-rw-r--r--include/net/tipc/tipc_msg.h207
-rw-r--r--include/net/tipc/tipc_port.h101
-rw-r--r--include/net/udp.h4
-rw-r--r--include/net/x25.h2
-rw-r--r--include/net/xfrm.h7
-rw-r--r--include/trace/events/ext4.h97
91 files changed, 1083 insertions, 1040 deletions
diff --git a/include/asm-generic/stat.h b/include/asm-generic/stat.h
index 47e64170305d..bd8cad21998e 100644
--- a/include/asm-generic/stat.h
+++ b/include/asm-generic/stat.h
@@ -33,18 +33,18 @@ struct stat {
33 int st_blksize; /* Optimal block size for I/O. */ 33 int st_blksize; /* Optimal block size for I/O. */
34 int __pad2; 34 int __pad2;
35 long st_blocks; /* Number 512-byte blocks allocated. */ 35 long st_blocks; /* Number 512-byte blocks allocated. */
36 int st_atime; /* Time of last access. */ 36 long st_atime; /* Time of last access. */
37 unsigned int st_atime_nsec; 37 unsigned long st_atime_nsec;
38 int st_mtime; /* Time of last modification. */ 38 long st_mtime; /* Time of last modification. */
39 unsigned int st_mtime_nsec; 39 unsigned long st_mtime_nsec;
40 int st_ctime; /* Time of last status change. */ 40 long st_ctime; /* Time of last status change. */
41 unsigned int st_ctime_nsec; 41 unsigned long st_ctime_nsec;
42 unsigned int __unused4; 42 unsigned int __unused4;
43 unsigned int __unused5; 43 unsigned int __unused5;
44}; 44};
45 45
46#if __BITS_PER_LONG != 64
47/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */ 46/* This matches struct stat64 in glibc2.1. Only used for 32 bit. */
47#if __BITS_PER_LONG != 64 || defined(__ARCH_WANT_STAT64)
48struct stat64 { 48struct stat64 {
49 unsigned long long st_dev; /* Device. */ 49 unsigned long long st_dev; /* Device. */
50 unsigned long long st_ino; /* File serial number. */ 50 unsigned long long st_ino; /* File serial number. */
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 5afa5b52063e..beafc156a535 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -432,6 +432,10 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo);
432 * together with the @destroy function, 432 * together with the @destroy function,
433 * enables driver-specific objects derived from a ttm_buffer_object. 433 * enables driver-specific objects derived from a ttm_buffer_object.
434 * On successful return, the object kref and list_kref are set to 1. 434 * On successful return, the object kref and list_kref are set to 1.
435 * If a failure occurs, the function will call the @destroy function, or
436 * kfree() if @destroy is NULL. Thus, after a failure, dereferencing @bo is
437 * illegal and will likely cause memory corruption.
438 *
435 * Returns 439 * Returns
436 * -ENOMEM: Out of memory. 440 * -ENOMEM: Out of memory.
437 * -EINVAL: Invalid placement flags. 441 * -EINVAL: Invalid placement flags.
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index d01b4ddbdc56..8e0c848326b6 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -206,14 +206,84 @@ struct ttm_tt {
206struct ttm_mem_type_manager; 206struct ttm_mem_type_manager;
207 207
208struct ttm_mem_type_manager_func { 208struct ttm_mem_type_manager_func {
209 /**
210 * struct ttm_mem_type_manager member init
211 *
212 * @man: Pointer to a memory type manager.
213 * @p_size: Implementation dependent, but typically the size of the
214 * range to be managed in pages.
215 *
216 * Called to initialize a private range manager. The function is
217 * expected to initialize the man::priv member.
218 * Returns 0 on success, negative error code on failure.
219 */
209 int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size); 220 int (*init)(struct ttm_mem_type_manager *man, unsigned long p_size);
221
222 /**
223 * struct ttm_mem_type_manager member takedown
224 *
225 * @man: Pointer to a memory type manager.
226 *
227 * Called to undo the setup done in init. All allocated resources
228 * should be freed.
229 */
210 int (*takedown)(struct ttm_mem_type_manager *man); 230 int (*takedown)(struct ttm_mem_type_manager *man);
231
232 /**
233 * struct ttm_mem_type_manager member get_node
234 *
235 * @man: Pointer to a memory type manager.
236 * @bo: Pointer to the buffer object we're allocating space for.
237 * @placement: Placement details.
238 * @mem: Pointer to a struct ttm_mem_reg to be filled in.
239 *
240 * This function should allocate space in the memory type managed
241 * by @man. Placement details if
242 * applicable are given by @placement. If successful,
243 * @mem::mm_node should be set to a non-null value, and
244 * @mem::start should be set to a value identifying the beginning
245 * of the range allocated, and the function should return zero.
246 * If the memory region accomodate the buffer object, @mem::mm_node
247 * should be set to NULL, and the function should return 0.
248 * If a system error occured, preventing the request to be fulfilled,
249 * the function should return a negative error code.
250 *
251 * Note that @mem::mm_node will only be dereferenced by
252 * struct ttm_mem_type_manager functions and optionally by the driver,
253 * which has knowledge of the underlying type.
254 *
255 * This function may not be called from within atomic context, so
256 * an implementation can and must use either a mutex or a spinlock to
257 * protect any data structures managing the space.
258 */
211 int (*get_node)(struct ttm_mem_type_manager *man, 259 int (*get_node)(struct ttm_mem_type_manager *man,
212 struct ttm_buffer_object *bo, 260 struct ttm_buffer_object *bo,
213 struct ttm_placement *placement, 261 struct ttm_placement *placement,
214 struct ttm_mem_reg *mem); 262 struct ttm_mem_reg *mem);
263
264 /**
265 * struct ttm_mem_type_manager member put_node
266 *
267 * @man: Pointer to a memory type manager.
268 * @mem: Pointer to a struct ttm_mem_reg to be filled in.
269 *
270 * This function frees memory type resources previously allocated
271 * and that are identified by @mem::mm_node and @mem::start. May not
272 * be called from within atomic context.
273 */
215 void (*put_node)(struct ttm_mem_type_manager *man, 274 void (*put_node)(struct ttm_mem_type_manager *man,
216 struct ttm_mem_reg *mem); 275 struct ttm_mem_reg *mem);
276
277 /**
278 * struct ttm_mem_type_manager member debug
279 *
280 * @man: Pointer to a memory type manager.
281 * @prefix: Prefix to be used in printout to identify the caller.
282 *
283 * This function is called to print out the state of the memory
284 * type manager to aid debugging of out-of-memory conditions.
285 * It may not be called from within atomic context.
286 */
217 void (*debug)(struct ttm_mem_type_manager *man, const char *prefix); 287 void (*debug)(struct ttm_mem_type_manager *man, const char *prefix);
218}; 288};
219 289
@@ -231,14 +301,13 @@ struct ttm_mem_type_manager {
231 uint64_t size; 301 uint64_t size;
232 uint32_t available_caching; 302 uint32_t available_caching;
233 uint32_t default_caching; 303 uint32_t default_caching;
304 const struct ttm_mem_type_manager_func *func;
305 void *priv;
234 306
235 /* 307 /*
236 * Protected by the bdev->lru_lock. 308 * Protected by the global->lru_lock.
237 * TODO: Consider one lru_lock per ttm_mem_type_manager.
238 * Plays ill with list removal, though.
239 */ 309 */
240 const struct ttm_mem_type_manager_func *func; 310
241 void *priv;
242 struct list_head lru; 311 struct list_head lru;
243}; 312};
244 313
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
new file mode 100644
index 000000000000..96c038e43d66
--- /dev/null
+++ b/include/linux/atomic.h
@@ -0,0 +1,37 @@
1#ifndef _LINUX_ATOMIC_H
2#define _LINUX_ATOMIC_H
3#include <asm/atomic.h>
4
5/**
6 * atomic_inc_not_zero_hint - increment if not null
7 * @v: pointer of type atomic_t
8 * @hint: probable value of the atomic before the increment
9 *
10 * This version of atomic_inc_not_zero() gives a hint of probable
11 * value of the atomic. This helps processor to not read the memory
12 * before doing the atomic read/modify/write cycle, lowering
13 * number of bus transactions on some arches.
14 *
15 * Returns: 0 if increment was not done, 1 otherwise.
16 */
17#ifndef atomic_inc_not_zero_hint
18static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
19{
20 int val, c = hint;
21
22 /* sanity test, should be removed by compiler if hint is a constant */
23 if (!hint)
24 return atomic_inc_not_zero(v);
25
26 do {
27 val = atomic_cmpxchg(v, c, c + 1);
28 if (val == c)
29 return 1;
30 c = val;
31 } while (c);
32
33 return 0;
34}
35#endif
36
37#endif /* _LINUX_ATOMIC_H */
diff --git a/include/linux/bio.h b/include/linux/bio.h
index ba679992d39b..35dcdb3589bc 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -66,10 +66,6 @@
66#define bio_offset(bio) bio_iovec((bio))->bv_offset 66#define bio_offset(bio) bio_iovec((bio))->bv_offset
67#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx) 67#define bio_segments(bio) ((bio)->bi_vcnt - (bio)->bi_idx)
68#define bio_sectors(bio) ((bio)->bi_size >> 9) 68#define bio_sectors(bio) ((bio)->bi_size >> 9)
69#define bio_empty_barrier(bio) \
70 ((bio->bi_rw & REQ_HARDBARRIER) && \
71 !bio_has_data(bio) && \
72 !(bio->bi_rw & REQ_DISCARD))
73 69
74static inline unsigned int bio_cur_bytes(struct bio *bio) 70static inline unsigned int bio_cur_bytes(struct bio *bio)
75{ 71{
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 0437ab6bb54c..46ad5197537a 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -122,7 +122,6 @@ enum rq_flag_bits {
122 __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */ 122 __REQ_FAILFAST_TRANSPORT, /* no driver retries of transport errors */
123 __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */ 123 __REQ_FAILFAST_DRIVER, /* no driver retries of driver errors */
124 124
125 __REQ_HARDBARRIER, /* may not be passed by drive either */
126 __REQ_SYNC, /* request is sync (sync write or read) */ 125 __REQ_SYNC, /* request is sync (sync write or read) */
127 __REQ_META, /* metadata io request */ 126 __REQ_META, /* metadata io request */
128 __REQ_DISCARD, /* request to discard sectors */ 127 __REQ_DISCARD, /* request to discard sectors */
@@ -159,7 +158,6 @@ enum rq_flag_bits {
159#define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV) 158#define REQ_FAILFAST_DEV (1 << __REQ_FAILFAST_DEV)
160#define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT) 159#define REQ_FAILFAST_TRANSPORT (1 << __REQ_FAILFAST_TRANSPORT)
161#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) 160#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER)
162#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
163#define REQ_SYNC (1 << __REQ_SYNC) 161#define REQ_SYNC (1 << __REQ_SYNC)
164#define REQ_META (1 << __REQ_META) 162#define REQ_META (1 << __REQ_META)
165#define REQ_DISCARD (1 << __REQ_DISCARD) 163#define REQ_DISCARD (1 << __REQ_DISCARD)
@@ -168,8 +166,8 @@ enum rq_flag_bits {
168#define REQ_FAILFAST_MASK \ 166#define REQ_FAILFAST_MASK \
169 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
170#define REQ_COMMON_MASK \ 168#define REQ_COMMON_MASK \
171 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_HARDBARRIER | REQ_SYNC | \ 169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \
172 REQ_META | REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) 170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
173#define REQ_CLONE_MASK REQ_COMMON_MASK 171#define REQ_CLONE_MASK REQ_COMMON_MASK
174 172
175#define REQ_UNPLUG (1 << __REQ_UNPLUG) 173#define REQ_UNPLUG (1 << __REQ_UNPLUG)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 5027a599077d..aae86fd10c4f 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -552,8 +552,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int sync)
552 * it already be started by driver. 552 * it already be started by driver.
553 */ 553 */
554#define RQ_NOMERGE_FLAGS \ 554#define RQ_NOMERGE_FLAGS \
555 (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER | \ 555 (REQ_NOMERGE | REQ_STARTED | REQ_SOFTBARRIER | REQ_FLUSH | REQ_FUA)
556 REQ_FLUSH | REQ_FUA)
557#define rq_mergeable(rq) \ 556#define rq_mergeable(rq) \
558 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ 557 (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \
559 (((rq)->cmd_flags & REQ_DISCARD) || \ 558 (((rq)->cmd_flags & REQ_DISCARD) || \
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 749f01ccd26e..010e2d87ed75 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -197,6 +197,21 @@ enum dccp_feature_numbers {
197 DCCPF_MAX_CCID_SPECIFIC = 255, 197 DCCPF_MAX_CCID_SPECIFIC = 255,
198}; 198};
199 199
200/* DCCP socket control message types for cmsg */
201enum dccp_cmsg_type {
202 DCCP_SCM_PRIORITY = 1,
203 DCCP_SCM_QPOLICY_MAX = 0xFFFF,
204 /* ^-- Up to here reserved exclusively for qpolicy parameters */
205 DCCP_SCM_MAX
206};
207
208/* DCCP priorities for outgoing/queued packets */
209enum dccp_packet_dequeueing_policy {
210 DCCPQ_POLICY_SIMPLE,
211 DCCPQ_POLICY_PRIO,
212 DCCPQ_POLICY_MAX
213};
214
200/* DCCP socket options */ 215/* DCCP socket options */
201#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */ 216#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
202#define DCCP_SOCKOPT_SERVICE 2 217#define DCCP_SOCKOPT_SERVICE 2
@@ -210,6 +225,8 @@ enum dccp_feature_numbers {
210#define DCCP_SOCKOPT_CCID 13 225#define DCCP_SOCKOPT_CCID 13
211#define DCCP_SOCKOPT_TX_CCID 14 226#define DCCP_SOCKOPT_TX_CCID 14
212#define DCCP_SOCKOPT_RX_CCID 15 227#define DCCP_SOCKOPT_RX_CCID 15
228#define DCCP_SOCKOPT_QPOLICY_ID 16
229#define DCCP_SOCKOPT_QPOLICY_TXQLEN 17
213#define DCCP_SOCKOPT_CCID_RX_INFO 128 230#define DCCP_SOCKOPT_CCID_RX_INFO 128
214#define DCCP_SOCKOPT_CCID_TX_INFO 192 231#define DCCP_SOCKOPT_CCID_TX_INFO 192
215 232
@@ -458,10 +475,13 @@ struct dccp_ackvec;
458 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) 475 * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection)
459 * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) 476 * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection)
460 * @dccps_options_received - parsed set of retrieved options 477 * @dccps_options_received - parsed set of retrieved options
478 * @dccps_qpolicy - TX dequeueing policy, one of %dccp_packet_dequeueing_policy
479 * @dccps_tx_qlen - maximum length of the TX queue
461 * @dccps_role - role of this sock, one of %dccp_role 480 * @dccps_role - role of this sock, one of %dccp_role
462 * @dccps_hc_rx_insert_options - receiver wants to add options when acking 481 * @dccps_hc_rx_insert_options - receiver wants to add options when acking
463 * @dccps_hc_tx_insert_options - sender wants to add options when sending 482 * @dccps_hc_tx_insert_options - sender wants to add options when sending
464 * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3) 483 * @dccps_server_timewait - server holds timewait state on close (RFC 4340, 8.3)
484 * @dccps_sync_scheduled - flag which signals "send out-of-band message soon"
465 * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets 485 * @dccps_xmitlet - tasklet scheduled by the TX CCID to dequeue data packets
466 * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing) 486 * @dccps_xmit_timer - used by the TX CCID to delay sending (rate-based pacing)
467 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) 487 * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs)
@@ -499,10 +519,13 @@ struct dccp_sock {
499 struct ccid *dccps_hc_rx_ccid; 519 struct ccid *dccps_hc_rx_ccid;
500 struct ccid *dccps_hc_tx_ccid; 520 struct ccid *dccps_hc_tx_ccid;
501 struct dccp_options_received dccps_options_received; 521 struct dccp_options_received dccps_options_received;
522 __u8 dccps_qpolicy;
523 __u32 dccps_tx_qlen;
502 enum dccp_role dccps_role:2; 524 enum dccp_role dccps_role:2;
503 __u8 dccps_hc_rx_insert_options:1; 525 __u8 dccps_hc_rx_insert_options:1;
504 __u8 dccps_hc_tx_insert_options:1; 526 __u8 dccps_hc_tx_insert_options:1;
505 __u8 dccps_server_timewait:1; 527 __u8 dccps_server_timewait:1;
528 __u8 dccps_sync_scheduled:1;
506 struct tasklet_struct dccps_xmitlet; 529 struct tasklet_struct dccps_xmitlet;
507 struct timer_list dccps_xmit_timer; 530 struct timer_list dccps_xmit_timer;
508}; 531};
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 9b2a0158f399..ef44c7a0638c 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -53,7 +53,7 @@
53 53
54 54
55extern const char *drbd_buildtag(void); 55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.9rc2" 56#define REL_VERSION "8.3.9"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 95 59#define PRO_VERSION_MAX 95
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 6628a507fd3b..1908929204a9 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -691,7 +691,9 @@ struct ethtool_ops {
691#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */ 691#define ETHTOOL_GMSGLVL 0x00000007 /* Get driver message level */
692#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */ 692#define ETHTOOL_SMSGLVL 0x00000008 /* Set driver msg level. */
693#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */ 693#define ETHTOOL_NWAY_RST 0x00000009 /* Restart autonegotiation. */
694#define ETHTOOL_GLINK 0x0000000a /* Get link status (ethtool_value) */ 694/* Get link status for host, i.e. whether the interface *and* the
695 * physical port (if there is one) are up (ethtool_value). */
696#define ETHTOOL_GLINK 0x0000000a
695#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */ 697#define ETHTOOL_GEEPROM 0x0000000b /* Get EEPROM data */
696#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */ 698#define ETHTOOL_SEEPROM 0x0000000c /* Set EEPROM data. */
697#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */ 699#define ETHTOOL_GCOALESCE 0x0000000e /* Get coalesce config */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 69b43dbea6c6..45266b75409a 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -91,54 +91,6 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */
91#define BPF_TAX 0x00 91#define BPF_TAX 0x00
92#define BPF_TXA 0x80 92#define BPF_TXA 0x80
93 93
94enum {
95 BPF_S_RET_K = 0,
96 BPF_S_RET_A,
97 BPF_S_ALU_ADD_K,
98 BPF_S_ALU_ADD_X,
99 BPF_S_ALU_SUB_K,
100 BPF_S_ALU_SUB_X,
101 BPF_S_ALU_MUL_K,
102 BPF_S_ALU_MUL_X,
103 BPF_S_ALU_DIV_X,
104 BPF_S_ALU_AND_K,
105 BPF_S_ALU_AND_X,
106 BPF_S_ALU_OR_K,
107 BPF_S_ALU_OR_X,
108 BPF_S_ALU_LSH_K,
109 BPF_S_ALU_LSH_X,
110 BPF_S_ALU_RSH_K,
111 BPF_S_ALU_RSH_X,
112 BPF_S_ALU_NEG,
113 BPF_S_LD_W_ABS,
114 BPF_S_LD_H_ABS,
115 BPF_S_LD_B_ABS,
116 BPF_S_LD_W_LEN,
117 BPF_S_LD_W_IND,
118 BPF_S_LD_H_IND,
119 BPF_S_LD_B_IND,
120 BPF_S_LD_IMM,
121 BPF_S_LDX_W_LEN,
122 BPF_S_LDX_B_MSH,
123 BPF_S_LDX_IMM,
124 BPF_S_MISC_TAX,
125 BPF_S_MISC_TXA,
126 BPF_S_ALU_DIV_K,
127 BPF_S_LD_MEM,
128 BPF_S_LDX_MEM,
129 BPF_S_ST,
130 BPF_S_STX,
131 BPF_S_JMP_JA,
132 BPF_S_JMP_JEQ_K,
133 BPF_S_JMP_JEQ_X,
134 BPF_S_JMP_JGE_K,
135 BPF_S_JMP_JGE_X,
136 BPF_S_JMP_JGT_K,
137 BPF_S_JMP_JGT_X,
138 BPF_S_JMP_JSET_K,
139 BPF_S_JMP_JSET_X,
140};
141
142#ifndef BPF_MAXINSNS 94#ifndef BPF_MAXINSNS
143#define BPF_MAXINSNS 4096 95#define BPF_MAXINSNS 4096
144#endif 96#endif
@@ -172,7 +124,9 @@ enum {
172#define SKF_AD_MARK 20 124#define SKF_AD_MARK 20
173#define SKF_AD_QUEUE 24 125#define SKF_AD_QUEUE 24
174#define SKF_AD_HATYPE 28 126#define SKF_AD_HATYPE 28
175#define SKF_AD_MAX 32 127#define SKF_AD_RXHASH 32
128#define SKF_AD_CPU 36
129#define SKF_AD_MAX 40
176#define SKF_NET_OFF (-0x100000) 130#define SKF_NET_OFF (-0x100000)
177#define SKF_LL_OFF (-0x200000) 131#define SKF_LL_OFF (-0x200000)
178 132
@@ -194,8 +148,8 @@ struct sk_buff;
194struct sock; 148struct sock;
195 149
196extern int sk_filter(struct sock *sk, struct sk_buff *skb); 150extern int sk_filter(struct sock *sk, struct sk_buff *skb);
197extern unsigned int sk_run_filter(struct sk_buff *skb, 151extern unsigned int sk_run_filter(const struct sk_buff *skb,
198 struct sock_filter *filter, int flen); 152 const struct sock_filter *filter);
199extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 153extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
200extern int sk_detach_filter(struct sock *sk); 154extern int sk_detach_filter(struct sock *sk);
201extern int sk_chk_filter(struct sock_filter *filter, int flen); 155extern int sk_chk_filter(struct sock_filter *filter, int flen);
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 8a389b608ce3..41cb31f14ee3 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -96,11 +96,15 @@
96 */ 96 */
97#define in_nmi() (preempt_count() & NMI_MASK) 97#define in_nmi() (preempt_count() & NMI_MASK)
98 98
99#if defined(CONFIG_PREEMPT) 99#if defined(CONFIG_PREEMPT) && defined(CONFIG_BKL)
100# define PREEMPT_INATOMIC_BASE kernel_locked() 100# define PREEMPT_INATOMIC_BASE kernel_locked()
101# define PREEMPT_CHECK_OFFSET 1
102#else 101#else
103# define PREEMPT_INATOMIC_BASE 0 102# define PREEMPT_INATOMIC_BASE 0
103#endif
104
105#if defined(CONFIG_PREEMPT)
106# define PREEMPT_CHECK_OFFSET 1
107#else
104# define PREEMPT_CHECK_OFFSET 0 108# define PREEMPT_CHECK_OFFSET 0
105#endif 109#endif
106 110
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index e9138198e823..b676c585574e 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -5,6 +5,7 @@
5#include <linux/kernel.h> 5#include <linux/kernel.h>
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/uaccess.h> 7#include <linux/uaccess.h>
8#include <linux/hardirq.h>
8 9
9#include <asm/cacheflush.h> 10#include <asm/cacheflush.h>
10 11
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h
index 3c5d6b6e765c..cec17cf6cac2 100644
--- a/include/linux/i2c/adp5588.h
+++ b/include/linux/i2c/adp5588.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller 2 * Analog Devices ADP5588 I/O Expander and QWERTY Keypad Controller
3 * 3 *
4 * Copyright 2009 Analog Devices Inc. 4 * Copyright 2009-2010 Analog Devices Inc.
5 * 5 *
6 * Licensed under the GPL-2 or later. 6 * Licensed under the GPL-2 or later.
7 */ 7 */
@@ -77,13 +77,26 @@
77 /* Configuration Register1 */ 77 /* Configuration Register1 */
78#define ADP5588_AUTO_INC (1 << 7) 78#define ADP5588_AUTO_INC (1 << 7)
79#define ADP5588_GPIEM_CFG (1 << 6) 79#define ADP5588_GPIEM_CFG (1 << 6)
80#define ADP5588_OVR_FLOW_M (1 << 5)
80#define ADP5588_INT_CFG (1 << 4) 81#define ADP5588_INT_CFG (1 << 4)
82#define ADP5588_OVR_FLOW_IEN (1 << 3)
83#define ADP5588_K_LCK_IM (1 << 2)
81#define ADP5588_GPI_IEN (1 << 1) 84#define ADP5588_GPI_IEN (1 << 1)
85#define ADP5588_KE_IEN (1 << 0)
82 86
83/* Interrupt Status Register */ 87/* Interrupt Status Register */
88#define ADP5588_CMP2_INT (1 << 5)
89#define ADP5588_CMP1_INT (1 << 4)
90#define ADP5588_OVR_FLOW_INT (1 << 3)
91#define ADP5588_K_LCK_INT (1 << 2)
84#define ADP5588_GPI_INT (1 << 1) 92#define ADP5588_GPI_INT (1 << 1)
85#define ADP5588_KE_INT (1 << 0) 93#define ADP5588_KE_INT (1 << 0)
86 94
95/* Key Lock and Event Counter Register */
96#define ADP5588_K_LCK_EN (1 << 6)
97#define ADP5588_LCK21 0x30
98#define ADP5588_KEC 0xF
99
87#define ADP5588_MAXGPIO 18 100#define ADP5588_MAXGPIO 18
88#define ADP5588_BANK(offs) ((offs) >> 3) 101#define ADP5588_BANK(offs) ((offs) >> 3)
89#define ADP5588_BIT(offs) (1u << ((offs) & 0x7)) 102#define ADP5588_BIT(offs) (1u << ((offs) & 0x7))
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h
index 0d241a5c4909..f7e73c338c40 100644
--- a/include/linux/if_bridge.h
+++ b/include/linux/if_bridge.h
@@ -102,7 +102,9 @@ struct __fdb_entry {
102#include <linux/netdevice.h> 102#include <linux/netdevice.h>
103 103
104extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); 104extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *));
105extern int (*br_should_route_hook)(struct sk_buff *skb); 105
106typedef int (*br_should_route_hook_t)(struct sk_buff *skb);
107extern br_should_route_hook_t __rcu *br_should_route_hook;
106 108
107#endif 109#endif
108 110
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 2fc66dd783ee..6485d2a89bec 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -80,6 +80,24 @@ struct rtnl_link_ifmap {
80 __u8 port; 80 __u8 port;
81}; 81};
82 82
83/*
84 * IFLA_AF_SPEC
85 * Contains nested attributes for address family specific attributes.
86 * Each address family may create a attribute with the address family
87 * number as type and create its own attribute structure in it.
88 *
89 * Example:
90 * [IFLA_AF_SPEC] = {
91 * [AF_INET] = {
92 * [IFLA_INET_CONF] = ...,
93 * },
94 * [AF_INET6] = {
95 * [IFLA_INET6_FLAGS] = ...,
96 * [IFLA_INET6_CONF] = ...,
97 * }
98 * }
99 */
100
83enum { 101enum {
84 IFLA_UNSPEC, 102 IFLA_UNSPEC,
85 IFLA_ADDRESS, 103 IFLA_ADDRESS,
@@ -116,6 +134,7 @@ enum {
116 IFLA_STATS64, 134 IFLA_STATS64,
117 IFLA_VF_PORTS, 135 IFLA_VF_PORTS,
118 IFLA_PORT_SELF, 136 IFLA_PORT_SELF,
137 IFLA_AF_SPEC,
119 __IFLA_MAX 138 __IFLA_MAX
120}; 139};
121 140
@@ -128,6 +147,14 @@ enum {
128#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg)) 147#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
129#endif 148#endif
130 149
150enum {
151 IFLA_INET_UNSPEC,
152 IFLA_INET_CONF,
153 __IFLA_INET_MAX,
154};
155
156#define IFLA_INET_MAX (__IFLA_INET_MAX - 1)
157
131/* ifi_flags. 158/* ifi_flags.
132 159
133 IFF_* flags. 160 IFF_* flags.
@@ -232,6 +259,7 @@ enum macvlan_mode {
232 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */ 259 MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */
233 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */ 260 MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */
234 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ 261 MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */
262 MACVLAN_MODE_PASSTHRU = 8,/* take over the underlying device */
235}; 263};
236 264
237/* SR-IOV virtual function management section */ 265/* SR-IOV virtual function management section */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index 8a2fd66a8b5f..e28b2e4959d4 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -25,19 +25,25 @@ struct macvlan_port;
25struct macvtap_queue; 25struct macvtap_queue;
26 26
27/** 27/**
28 * struct macvlan_rx_stats - MACVLAN percpu rx stats 28 * struct macvlan_pcpu_stats - MACVLAN percpu stats
29 * @rx_packets: number of received packets 29 * @rx_packets: number of received packets
30 * @rx_bytes: number of received bytes 30 * @rx_bytes: number of received bytes
31 * @rx_multicast: number of received multicast packets 31 * @rx_multicast: number of received multicast packets
32 * @tx_packets: number of transmitted packets
33 * @tx_bytes: number of transmitted bytes
32 * @syncp: synchronization point for 64bit counters 34 * @syncp: synchronization point for 64bit counters
33 * @rx_errors: number of errors 35 * @rx_errors: number of rx errors
36 * @tx_dropped: number of tx dropped packets
34 */ 37 */
35struct macvlan_rx_stats { 38struct macvlan_pcpu_stats {
36 u64 rx_packets; 39 u64 rx_packets;
37 u64 rx_bytes; 40 u64 rx_bytes;
38 u64 rx_multicast; 41 u64 rx_multicast;
42 u64 tx_packets;
43 u64 tx_bytes;
39 struct u64_stats_sync syncp; 44 struct u64_stats_sync syncp;
40 unsigned long rx_errors; 45 u32 rx_errors;
46 u32 tx_dropped;
41}; 47};
42 48
43/* 49/*
@@ -52,7 +58,7 @@ struct macvlan_dev {
52 struct hlist_node hlist; 58 struct hlist_node hlist;
53 struct macvlan_port *port; 59 struct macvlan_port *port;
54 struct net_device *lowerdev; 60 struct net_device *lowerdev;
55 struct macvlan_rx_stats __percpu *rx_stats; 61 struct macvlan_pcpu_stats __percpu *pcpu_stats;
56 enum macvlan_mode mode; 62 enum macvlan_mode mode;
57 int (*receive)(struct sk_buff *skb); 63 int (*receive)(struct sk_buff *skb);
58 int (*forward)(struct net_device *dev, struct sk_buff *skb); 64 int (*forward)(struct net_device *dev, struct sk_buff *skb);
@@ -64,18 +70,18 @@ static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
64 unsigned int len, bool success, 70 unsigned int len, bool success,
65 bool multicast) 71 bool multicast)
66{ 72{
67 struct macvlan_rx_stats *rx_stats;
68
69 rx_stats = this_cpu_ptr(vlan->rx_stats);
70 if (likely(success)) { 73 if (likely(success)) {
71 u64_stats_update_begin(&rx_stats->syncp); 74 struct macvlan_pcpu_stats *pcpu_stats;
72 rx_stats->rx_packets++;; 75
73 rx_stats->rx_bytes += len; 76 pcpu_stats = this_cpu_ptr(vlan->pcpu_stats);
77 u64_stats_update_begin(&pcpu_stats->syncp);
78 pcpu_stats->rx_packets++;
79 pcpu_stats->rx_bytes += len;
74 if (multicast) 80 if (multicast)
75 rx_stats->rx_multicast++; 81 pcpu_stats->rx_multicast++;
76 u64_stats_update_end(&rx_stats->syncp); 82 u64_stats_update_end(&pcpu_stats->syncp);
77 } else { 83 } else {
78 rx_stats->rx_errors++; 84 this_cpu_inc(vlan->pcpu_stats->rx_errors);
79 } 85 }
80} 86}
81 87
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index c2f3a72712ce..635e1faec412 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -339,6 +339,31 @@ static inline int vlan_get_tag(const struct sk_buff *skb, u16 *vlan_tci)
339 } 339 }
340} 340}
341 341
342/**
343 * vlan_get_protocol - get protocol EtherType.
344 * @skb: skbuff to query
345 *
346 * Returns the EtherType of the packet, regardless of whether it is
347 * vlan encapsulated (normal or hardware accelerated) or not.
348 */
349static inline __be16 vlan_get_protocol(const struct sk_buff *skb)
350{
351 __be16 protocol = 0;
352
353 if (vlan_tx_tag_present(skb) ||
354 skb->protocol != cpu_to_be16(ETH_P_8021Q))
355 protocol = skb->protocol;
356 else {
357 __be16 proto, *protop;
358 protop = skb_header_pointer(skb, offsetof(struct vlan_ethhdr,
359 h_vlan_encapsulated_proto),
360 sizeof(proto), &proto);
361 if (likely(protop))
362 protocol = *protop;
363 }
364
365 return protocol;
366}
342#endif /* __KERNEL__ */ 367#endif /* __KERNEL__ */
343 368
344/* VLAN IOCTLs are found in sockios.h */ 369/* VLAN IOCTLs are found in sockios.h */
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 93fc2449af10..c4987f265109 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -167,10 +167,10 @@ struct ip_sf_socklist {
167 */ 167 */
168 168
169struct ip_mc_socklist { 169struct ip_mc_socklist {
170 struct ip_mc_socklist *next; 170 struct ip_mc_socklist __rcu *next_rcu;
171 struct ip_mreqn multi; 171 struct ip_mreqn multi;
172 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 172 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
173 struct ip_sf_socklist *sflist; 173 struct ip_sf_socklist __rcu *sflist;
174 struct rcu_head rcu; 174 struct rcu_head rcu;
175}; 175};
176 176
@@ -186,11 +186,14 @@ struct ip_sf_list {
186struct ip_mc_list { 186struct ip_mc_list {
187 struct in_device *interface; 187 struct in_device *interface;
188 __be32 multiaddr; 188 __be32 multiaddr;
189 unsigned int sfmode;
189 struct ip_sf_list *sources; 190 struct ip_sf_list *sources;
190 struct ip_sf_list *tomb; 191 struct ip_sf_list *tomb;
191 unsigned int sfmode;
192 unsigned long sfcount[2]; 192 unsigned long sfcount[2];
193 struct ip_mc_list *next; 193 union {
194 struct ip_mc_list *next;
195 struct ip_mc_list __rcu *next_rcu;
196 };
194 struct timer_list timer; 197 struct timer_list timer;
195 int users; 198 int users;
196 atomic_t refcnt; 199 atomic_t refcnt;
@@ -201,6 +204,7 @@ struct ip_mc_list {
201 char loaded; 204 char loaded;
202 unsigned char gsquery; /* check source marks? */ 205 unsigned char gsquery; /* check source marks? */
203 unsigned char crcount; 206 unsigned char crcount;
207 struct rcu_head rcu;
204}; 208};
205 209
206/* V3 exponential field decoding */ 210/* V3 exponential field decoding */
@@ -234,7 +238,7 @@ extern void ip_mc_unmap(struct in_device *);
234extern void ip_mc_remap(struct in_device *); 238extern void ip_mc_remap(struct in_device *);
235extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); 239extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr);
236extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); 240extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr);
237extern void ip_mc_rejoin_group(struct ip_mc_list *im); 241extern void ip_mc_rejoin_groups(struct in_device *in_dev);
238 242
239#endif 243#endif
240#endif 244#endif
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index ccd5b07d678d..ae8fdc54e0c0 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -41,10 +41,12 @@ enum
41 __IPV4_DEVCONF_MAX 41 __IPV4_DEVCONF_MAX
42}; 42};
43 43
44#define IPV4_DEVCONF_MAX (__IPV4_DEVCONF_MAX - 1)
45
44struct ipv4_devconf { 46struct ipv4_devconf {
45 void *sysctl; 47 void *sysctl;
46 int data[__IPV4_DEVCONF_MAX - 1]; 48 int data[IPV4_DEVCONF_MAX];
47 DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); 49 DECLARE_BITMAP(state, IPV4_DEVCONF_MAX);
48}; 50};
49 51
50struct in_device { 52struct in_device {
@@ -52,9 +54,8 @@ struct in_device {
52 atomic_t refcnt; 54 atomic_t refcnt;
53 int dead; 55 int dead;
54 struct in_ifaddr *ifa_list; /* IP ifaddr chain */ 56 struct in_ifaddr *ifa_list; /* IP ifaddr chain */
55 rwlock_t mc_list_lock; 57 struct ip_mc_list __rcu *mc_list; /* IP multicast filter chain */
56 struct ip_mc_list *mc_list; /* IP multicast filter chain */ 58 int mc_count; /* Number of installed mcasts */
57 int mc_count; /* Number of installed mcasts */
58 spinlock_t mc_tomb_lock; 59 spinlock_t mc_tomb_lock;
59 struct ip_mc_list *mc_tomb; 60 struct ip_mc_list *mc_tomb;
60 unsigned long mr_v1_seen; 61 unsigned long mr_v1_seen;
@@ -91,7 +92,7 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index,
91 92
92static inline void ipv4_devconf_setall(struct in_device *in_dev) 93static inline void ipv4_devconf_setall(struct in_device *in_dev)
93{ 94{
94 bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); 95 bitmap_fill(in_dev->cnf.state, IPV4_DEVCONF_MAX);
95} 96}
96 97
97#define IN_DEV_CONF_GET(in_dev, attr) \ 98#define IN_DEV_CONF_GET(in_dev, attr) \
@@ -221,7 +222,7 @@ static inline struct in_device *in_dev_get(const struct net_device *dev)
221 222
222static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev) 223static inline struct in_device *__in_dev_get_rtnl(const struct net_device *dev)
223{ 224{
224 return rcu_dereference_check(dev->ip_ptr, lockdep_rtnl_is_held()); 225 return rtnl_dereference(dev->ip_ptr);
225} 226}
226 227
227extern void in_dev_finish_destroy(struct in_device *idev); 228extern void in_dev_finish_destroy(struct in_device *idev);
diff --git a/include/linux/input.h b/include/linux/input.h
index 51af441f3a21..6ef44465db8d 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1406,6 +1406,8 @@ static inline void input_set_drvdata(struct input_dev *dev, void *data)
1406int __must_check input_register_device(struct input_dev *); 1406int __must_check input_register_device(struct input_dev *);
1407void input_unregister_device(struct input_dev *); 1407void input_unregister_device(struct input_dev *);
1408 1408
1409void input_reset_device(struct input_dev *);
1410
1409int __must_check input_register_handler(struct input_handler *); 1411int __must_check input_register_handler(struct input_handler *);
1410void input_unregister_handler(struct input_handler *); 1412void input_unregister_handler(struct input_handler *);
1411 1413
@@ -1421,7 +1423,7 @@ void input_release_device(struct input_handle *);
1421int input_open_device(struct input_handle *); 1423int input_open_device(struct input_handle *);
1422void input_close_device(struct input_handle *); 1424void input_close_device(struct input_handle *);
1423 1425
1424int input_flush_device(struct input_handle* handle, struct file* file); 1426int input_flush_device(struct input_handle *handle, struct file *file);
1425 1427
1426void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); 1428void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value);
1427void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value); 1429void input_inject_event(struct input_handle *handle, unsigned int type, unsigned int code, int value);
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index 3e70b21884a9..b2eee896dcbc 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -76,7 +76,6 @@ int put_io_context(struct io_context *ioc);
76void exit_io_context(struct task_struct *task); 76void exit_io_context(struct task_struct *task);
77struct io_context *get_io_context(gfp_t gfp_flags, int node); 77struct io_context *get_io_context(gfp_t gfp_flags, int node);
78struct io_context *alloc_io_context(gfp_t gfp_flags, int node); 78struct io_context *alloc_io_context(gfp_t gfp_flags, int node);
79void copy_io_context(struct io_context **pdst, struct io_context **psrc);
80#else 79#else
81static inline void exit_io_context(struct task_struct *task) 80static inline void exit_io_context(struct task_struct *task)
82{ 81{
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 8e429d0e0405..0c997767429a 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -364,7 +364,7 @@ struct ipv6_pinfo {
364 364
365 __u32 dst_cookie; 365 __u32 dst_cookie;
366 366
367 struct ipv6_mc_socklist *ipv6_mc_list; 367 struct ipv6_mc_socklist __rcu *ipv6_mc_list;
368 struct ipv6_ac_socklist *ipv6_ac_list; 368 struct ipv6_ac_socklist *ipv6_ac_list;
369 struct ipv6_fl_socklist *ipv6_fl_list; 369 struct ipv6_fl_socklist *ipv6_fl_list;
370 370
diff --git a/include/linux/jhash.h b/include/linux/jhash.h
index ced1159fa4f2..47cb09edec1a 100644
--- a/include/linux/jhash.h
+++ b/include/linux/jhash.h
@@ -3,129 +3,156 @@
3 3
4/* jhash.h: Jenkins hash support. 4/* jhash.h: Jenkins hash support.
5 * 5 *
6 * Copyright (C) 1996 Bob Jenkins (bob_jenkins@burtleburtle.net) 6 * Copyright (C) 2006. Bob Jenkins (bob_jenkins@burtleburtle.net)
7 * 7 *
8 * http://burtleburtle.net/bob/hash/ 8 * http://burtleburtle.net/bob/hash/
9 * 9 *
10 * These are the credits from Bob's sources: 10 * These are the credits from Bob's sources:
11 * 11 *
12 * lookup2.c, by Bob Jenkins, December 1996, Public Domain. 12 * lookup3.c, by Bob Jenkins, May 2006, Public Domain.
13 * hash(), hash2(), hash3, and mix() are externally useful functions.
14 * Routines to test the hash are included if SELF_TEST is defined.
15 * You can use this free for any purpose. It has no warranty.
16 * 13 *
17 * Copyright (C) 2003 David S. Miller (davem@redhat.com) 14 * These are functions for producing 32-bit hashes for hash table lookup.
15 * hashword(), hashlittle(), hashlittle2(), hashbig(), mix(), and final()
16 * are externally useful functions. Routines to test the hash are included
17 * if SELF_TEST is defined. You can use this free for any purpose. It's in
18 * the public domain. It has no warranty.
19 *
20 * Copyright (C) 2009-2010 Jozsef Kadlecsik (kadlec@blackhole.kfki.hu)
18 * 21 *
19 * I've modified Bob's hash to be useful in the Linux kernel, and 22 * I've modified Bob's hash to be useful in the Linux kernel, and
20 * any bugs present are surely my fault. -DaveM 23 * any bugs present are my fault.
24 * Jozsef
21 */ 25 */
26#include <linux/bitops.h>
27#include <linux/unaligned/packed_struct.h>
28
29/* Best hash sizes are of power of two */
30#define jhash_size(n) ((u32)1<<(n))
31/* Mask the hash value, i.e (value & jhash_mask(n)) instead of (value % n) */
32#define jhash_mask(n) (jhash_size(n)-1)
33
34/* __jhash_mix -- mix 3 32-bit values reversibly. */
35#define __jhash_mix(a, b, c) \
36{ \
37 a -= c; a ^= rol32(c, 4); c += b; \
38 b -= a; b ^= rol32(a, 6); a += c; \
39 c -= b; c ^= rol32(b, 8); b += a; \
40 a -= c; a ^= rol32(c, 16); c += b; \
41 b -= a; b ^= rol32(a, 19); a += c; \
42 c -= b; c ^= rol32(b, 4); b += a; \
43}
22 44
23/* NOTE: Arguments are modified. */ 45/* __jhash_final - final mixing of 3 32-bit values (a,b,c) into c */
24#define __jhash_mix(a, b, c) \ 46#define __jhash_final(a, b, c) \
25{ \ 47{ \
26 a -= b; a -= c; a ^= (c>>13); \ 48 c ^= b; c -= rol32(b, 14); \
27 b -= c; b -= a; b ^= (a<<8); \ 49 a ^= c; a -= rol32(c, 11); \
28 c -= a; c -= b; c ^= (b>>13); \ 50 b ^= a; b -= rol32(a, 25); \
29 a -= b; a -= c; a ^= (c>>12); \ 51 c ^= b; c -= rol32(b, 16); \
30 b -= c; b -= a; b ^= (a<<16); \ 52 a ^= c; a -= rol32(c, 4); \
31 c -= a; c -= b; c ^= (b>>5); \ 53 b ^= a; b -= rol32(a, 14); \
32 a -= b; a -= c; a ^= (c>>3); \ 54 c ^= b; c -= rol32(b, 24); \
33 b -= c; b -= a; b ^= (a<<10); \
34 c -= a; c -= b; c ^= (b>>15); \
35} 55}
36 56
37/* The golden ration: an arbitrary value */ 57/* An arbitrary initial parameter */
38#define JHASH_GOLDEN_RATIO 0x9e3779b9 58#define JHASH_INITVAL 0xdeadbeef
39 59
40/* The most generic version, hashes an arbitrary sequence 60/* jhash - hash an arbitrary key
41 * of bytes. No alignment or length assumptions are made about 61 * @k: sequence of bytes as key
42 * the input key. 62 * @length: the length of the key
63 * @initval: the previous hash, or an arbitray value
64 *
65 * The generic version, hashes an arbitrary sequence of bytes.
66 * No alignment or length assumptions are made about the input key.
67 *
68 * Returns the hash value of the key. The result depends on endianness.
43 */ 69 */
44static inline u32 jhash(const void *key, u32 length, u32 initval) 70static inline u32 jhash(const void *key, u32 length, u32 initval)
45{ 71{
46 u32 a, b, c, len; 72 u32 a, b, c;
47 const u8 *k = key; 73 const u8 *k = key;
48 74
49 len = length; 75 /* Set up the internal state */
50 a = b = JHASH_GOLDEN_RATIO; 76 a = b = c = JHASH_INITVAL + length + initval;
51 c = initval;
52
53 while (len >= 12) {
54 a += (k[0] +((u32)k[1]<<8) +((u32)k[2]<<16) +((u32)k[3]<<24));
55 b += (k[4] +((u32)k[5]<<8) +((u32)k[6]<<16) +((u32)k[7]<<24));
56 c += (k[8] +((u32)k[9]<<8) +((u32)k[10]<<16)+((u32)k[11]<<24));
57
58 __jhash_mix(a,b,c);
59 77
78 /* All but the last block: affect some 32 bits of (a,b,c) */
79 while (length > 12) {
80 a += __get_unaligned_cpu32(k);
81 b += __get_unaligned_cpu32(k + 4);
82 c += __get_unaligned_cpu32(k + 8);
83 __jhash_mix(a, b, c);
84 length -= 12;
60 k += 12; 85 k += 12;
61 len -= 12;
62 } 86 }
63 87 /* Last block: affect all 32 bits of (c) */
64 c += length; 88 /* All the case statements fall through */
65 switch (len) { 89 switch (length) {
66 case 11: c += ((u32)k[10]<<24); 90 case 12: c += (u32)k[11]<<24;
67 case 10: c += ((u32)k[9]<<16); 91 case 11: c += (u32)k[10]<<16;
68 case 9 : c += ((u32)k[8]<<8); 92 case 10: c += (u32)k[9]<<8;
69 case 8 : b += ((u32)k[7]<<24); 93 case 9: c += k[8];
70 case 7 : b += ((u32)k[6]<<16); 94 case 8: b += (u32)k[7]<<24;
71 case 6 : b += ((u32)k[5]<<8); 95 case 7: b += (u32)k[6]<<16;
72 case 5 : b += k[4]; 96 case 6: b += (u32)k[5]<<8;
73 case 4 : a += ((u32)k[3]<<24); 97 case 5: b += k[4];
74 case 3 : a += ((u32)k[2]<<16); 98 case 4: a += (u32)k[3]<<24;
75 case 2 : a += ((u32)k[1]<<8); 99 case 3: a += (u32)k[2]<<16;
76 case 1 : a += k[0]; 100 case 2: a += (u32)k[1]<<8;
77 }; 101 case 1: a += k[0];
78 102 __jhash_final(a, b, c);
79 __jhash_mix(a,b,c); 103 case 0: /* Nothing left to add */
104 break;
105 }
80 106
81 return c; 107 return c;
82} 108}
83 109
84/* A special optimized version that handles 1 or more of u32s. 110/* jhash2 - hash an array of u32's
85 * The length parameter here is the number of u32s in the key. 111 * @k: the key which must be an array of u32's
112 * @length: the number of u32's in the key
113 * @initval: the previous hash, or an arbitray value
114 *
115 * Returns the hash value of the key.
86 */ 116 */
87static inline u32 jhash2(const u32 *k, u32 length, u32 initval) 117static inline u32 jhash2(const u32 *k, u32 length, u32 initval)
88{ 118{
89 u32 a, b, c, len; 119 u32 a, b, c;
90 120
91 a = b = JHASH_GOLDEN_RATIO; 121 /* Set up the internal state */
92 c = initval; 122 a = b = c = JHASH_INITVAL + (length<<2) + initval;
93 len = length;
94 123
95 while (len >= 3) { 124 /* Handle most of the key */
125 while (length > 3) {
96 a += k[0]; 126 a += k[0];
97 b += k[1]; 127 b += k[1];
98 c += k[2]; 128 c += k[2];
99 __jhash_mix(a, b, c); 129 __jhash_mix(a, b, c);
100 k += 3; len -= 3; 130 length -= 3;
131 k += 3;
101 } 132 }
102 133
103 c += length * 4; 134 /* Handle the last 3 u32's: all the case statements fall through */
104 135 switch (length) {
105 switch (len) { 136 case 3: c += k[2];
106 case 2 : b += k[1]; 137 case 2: b += k[1];
107 case 1 : a += k[0]; 138 case 1: a += k[0];
108 }; 139 __jhash_final(a, b, c);
109 140 case 0: /* Nothing left to add */
110 __jhash_mix(a,b,c); 141 break;
142 }
111 143
112 return c; 144 return c;
113} 145}
114 146
115 147
116/* A special ultra-optimized versions that knows they are hashing exactly 148/* jhash_3words - hash exactly 3, 2 or 1 word(s) */
117 * 3, 2 or 1 word(s).
118 *
119 * NOTE: In particular the "c += length; __jhash_mix(a,b,c);" normally
120 * done at the end is not done here.
121 */
122static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval) 149static inline u32 jhash_3words(u32 a, u32 b, u32 c, u32 initval)
123{ 150{
124 a += JHASH_GOLDEN_RATIO; 151 a += JHASH_INITVAL;
125 b += JHASH_GOLDEN_RATIO; 152 b += JHASH_INITVAL;
126 c += initval; 153 c += initval;
127 154
128 __jhash_mix(a, b, c); 155 __jhash_final(a, b, c);
129 156
130 return c; 157 return c;
131} 158}
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 450092c1e35f..fc3da9e4da19 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -60,7 +60,7 @@ extern const char linux_proc_banner[];
60#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 60#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
61#define roundup(x, y) ( \ 61#define roundup(x, y) ( \
62{ \ 62{ \
63 typeof(y) __y = y; \ 63 const typeof(y) __y = y; \
64 (((x) + (__y - 1)) / __y) * __y; \ 64 (((x) + (__y - 1)) / __y) * __y; \
65} \ 65} \
66) 66)
@@ -293,6 +293,7 @@ extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
293 unsigned int interval_msec); 293 unsigned int interval_msec);
294 294
295extern int printk_delay_msec; 295extern int printk_delay_msec;
296extern int dmesg_restrict;
296 297
297/* 298/*
298 * Print a one-time message (analogous to WARN_ONCE() et al): 299 * Print a one-time message (analogous to WARN_ONCE() et al):
diff --git a/include/linux/leds-lp5521.h b/include/linux/leds-lp5521.h
new file mode 100644
index 000000000000..38368d785f08
--- /dev/null
+++ b/include/linux/leds-lp5521.h
@@ -0,0 +1,47 @@
1/*
2 * LP5521 LED chip driver.
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef __LINUX_LP5521_H
24#define __LINUX_LP5521_H
25
26/* See Documentation/leds/leds-lp5521.txt */
27
28struct lp5521_led_config {
29 u8 chan_nr;
30 u8 led_current; /* mA x10, 0 if led is not connected */
31 u8 max_current;
32};
33
34#define LP5521_CLOCK_AUTO 0
35#define LP5521_CLOCK_INT 1
36#define LP5521_CLOCK_EXT 2
37
38struct lp5521_platform_data {
39 struct lp5521_led_config *led_config;
40 u8 num_channels;
41 u8 clock_mode;
42 int (*setup_resources)(void);
43 void (*release_resources)(void);
44 void (*enable)(bool state);
45};
46
47#endif /* __LINUX_LP5521_H */
diff --git a/include/linux/leds-lp5523.h b/include/linux/leds-lp5523.h
new file mode 100644
index 000000000000..796747637b80
--- /dev/null
+++ b/include/linux/leds-lp5523.h
@@ -0,0 +1,47 @@
1/*
2 * LP5523 LED Driver
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * Contact: Samu Onkalo <samu.p.onkalo@nokia.com>
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
11 *
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
20 * 02110-1301 USA
21 */
22
23#ifndef __LINUX_LP5523_H
24#define __LINUX_LP5523_H
25
26/* See Documentation/leds/leds-lp5523.txt */
27
28struct lp5523_led_config {
29 u8 chan_nr;
30 u8 led_current; /* mA x10, 0 if led is not connected */
31 u8 max_current;
32};
33
34#define LP5523_CLOCK_AUTO 0
35#define LP5523_CLOCK_INT 1
36#define LP5523_CLOCK_EXT 2
37
38struct lp5523_platform_data {
39 struct lp5523_led_config *led_config;
40 u8 num_channels;
41 u8 clock_mode;
42 int (*setup_resources)(void);
43 void (*release_resources)(void);
44 void (*enable)(bool state);
45};
46
47#endif /* __LINUX_LP5523_H */
diff --git a/include/linux/leds.h b/include/linux/leds.h
index ba6986a11663..0f19df9e37b0 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -15,6 +15,7 @@
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/rwsem.h> 17#include <linux/rwsem.h>
18#include <linux/timer.h>
18 19
19struct device; 20struct device;
20/* 21/*
@@ -45,10 +46,14 @@ struct led_classdev {
45 /* Get LED brightness level */ 46 /* Get LED brightness level */
46 enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); 47 enum led_brightness (*brightness_get)(struct led_classdev *led_cdev);
47 48
48 /* Activate hardware accelerated blink, delays are in 49 /*
49 * miliseconds and if none is provided then a sensible default 50 * Activate hardware accelerated blink, delays are in milliseconds
50 * should be chosen. The call can adjust the timings if it can't 51 * and if both are zero then a sensible default should be chosen.
51 * match the values specified exactly. */ 52 * The call should adjust the timings in that case and if it can't
53 * match the values specified exactly.
54 * Deactivate blinking again when the brightness is set to a fixed
55 * value via the brightness_set() callback.
56 */
52 int (*blink_set)(struct led_classdev *led_cdev, 57 int (*blink_set)(struct led_classdev *led_cdev,
53 unsigned long *delay_on, 58 unsigned long *delay_on,
54 unsigned long *delay_off); 59 unsigned long *delay_off);
@@ -57,6 +62,10 @@ struct led_classdev {
57 struct list_head node; /* LED Device list */ 62 struct list_head node; /* LED Device list */
58 const char *default_trigger; /* Trigger to use */ 63 const char *default_trigger; /* Trigger to use */
59 64
65 unsigned long blink_delay_on, blink_delay_off;
66 struct timer_list blink_timer;
67 int blink_brightness;
68
60#ifdef CONFIG_LEDS_TRIGGERS 69#ifdef CONFIG_LEDS_TRIGGERS
61 /* Protects the trigger data below */ 70 /* Protects the trigger data below */
62 struct rw_semaphore trigger_lock; 71 struct rw_semaphore trigger_lock;
@@ -73,6 +82,36 @@ extern void led_classdev_unregister(struct led_classdev *led_cdev);
73extern void led_classdev_suspend(struct led_classdev *led_cdev); 82extern void led_classdev_suspend(struct led_classdev *led_cdev);
74extern void led_classdev_resume(struct led_classdev *led_cdev); 83extern void led_classdev_resume(struct led_classdev *led_cdev);
75 84
85/**
86 * led_blink_set - set blinking with software fallback
87 * @led_cdev: the LED to start blinking
88 * @delay_on: the time it should be on (in ms)
89 * @delay_off: the time it should ble off (in ms)
90 *
91 * This function makes the LED blink, attempting to use the
92 * hardware acceleration if possible, but falling back to
93 * software blinking if there is no hardware blinking or if
94 * the LED refuses the passed values.
95 *
96 * Note that if software blinking is active, simply calling
97 * led_cdev->brightness_set() will not stop the blinking,
98 * use led_classdev_brightness_set() instead.
99 */
100extern void led_blink_set(struct led_classdev *led_cdev,
101 unsigned long *delay_on,
102 unsigned long *delay_off);
103/**
104 * led_brightness_set - set LED brightness
105 * @led_cdev: the LED to set
106 * @brightness: the brightness to set it to
107 *
108 * Set an LED's brightness, and, if necessary, cancel the
109 * software blink timer that implements blinking when the
110 * hardware doesn't.
111 */
112extern void led_brightness_set(struct led_classdev *led_cdev,
113 enum led_brightness brightness);
114
76/* 115/*
77 * LED Triggers 116 * LED Triggers
78 */ 117 */
diff --git a/include/linux/marvell_phy.h b/include/linux/marvell_phy.h
index 1ff81b51b656..dd3c34ebca9a 100644
--- a/include/linux/marvell_phy.h
+++ b/include/linux/marvell_phy.h
@@ -11,6 +11,7 @@
11#define MARVELL_PHY_ID_88E1118 0x01410e10 11#define MARVELL_PHY_ID_88E1118 0x01410e10
12#define MARVELL_PHY_ID_88E1121R 0x01410cb0 12#define MARVELL_PHY_ID_88E1121R 0x01410cb0
13#define MARVELL_PHY_ID_88E1145 0x01410cd0 13#define MARVELL_PHY_ID_88E1145 0x01410cd0
14#define MARVELL_PHY_ID_88E1149R 0x01410e50
14#define MARVELL_PHY_ID_88E1240 0x01410e30 15#define MARVELL_PHY_ID_88E1240 0x01410e30
15#define MARVELL_PHY_ID_88E1318S 0x01410e90 16#define MARVELL_PHY_ID_88E1318S 0x01410e90
16 17
diff --git a/include/linux/mdio.h b/include/linux/mdio.h
index c779b49a1fda..b1494aced217 100644
--- a/include/linux/mdio.h
+++ b/include/linux/mdio.h
@@ -55,6 +55,7 @@
55#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ 55#define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */
56#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ 56#define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */
57#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ 57#define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */
58#define MDIO_AN_EEE_ADV 60 /* EEE advertisement */
58 59
59/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ 60/* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */
60#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ 61#define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */
@@ -235,6 +236,10 @@
235#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ 236#define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */
236#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ 237#define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */
237 238
239/* AN EEE Advertisement register. */
240#define MDIO_AN_EEE_ADV_100TX 0x0002 /* Advertise 100TX EEE cap */
241#define MDIO_AN_EEE_ADV_1000T 0x0004 /* Advertise 1000T EEE cap */
242
238/* LASI RX_ALARM control/status registers. */ 243/* LASI RX_ALARM control/status registers. */
239#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ 244#define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */
240#define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ 245#define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index d19e2114fd86..5c99da1078aa 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -59,19 +59,19 @@ struct sh_mmcif_plat_data {
59#define MMCIF_CE_HOST_STS2 0x0000004C 59#define MMCIF_CE_HOST_STS2 0x0000004C
60#define MMCIF_CE_VERSION 0x0000007C 60#define MMCIF_CE_VERSION 0x0000007C
61 61
62extern inline u32 sh_mmcif_readl(void __iomem *addr, int reg) 62static inline u32 sh_mmcif_readl(void __iomem *addr, int reg)
63{ 63{
64 return readl(addr + reg); 64 return readl(addr + reg);
65} 65}
66 66
67extern inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val) 67static inline void sh_mmcif_writel(void __iomem *addr, int reg, u32 val)
68{ 68{
69 writel(val, addr + reg); 69 writel(val, addr + reg);
70} 70}
71 71
72#define SH_MMCIF_BBS 512 /* boot block size */ 72#define SH_MMCIF_BBS 512 /* boot block size */
73 73
74extern inline void sh_mmcif_boot_cmd_send(void __iomem *base, 74static inline void sh_mmcif_boot_cmd_send(void __iomem *base,
75 unsigned long cmd, unsigned long arg) 75 unsigned long cmd, unsigned long arg)
76{ 76{
77 sh_mmcif_writel(base, MMCIF_CE_INT, 0); 77 sh_mmcif_writel(base, MMCIF_CE_INT, 0);
@@ -79,7 +79,7 @@ extern inline void sh_mmcif_boot_cmd_send(void __iomem *base,
79 sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd); 79 sh_mmcif_writel(base, MMCIF_CE_CMD_SET, cmd);
80} 80}
81 81
82extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask) 82static inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask)
83{ 83{
84 unsigned long tmp; 84 unsigned long tmp;
85 int cnt; 85 int cnt;
@@ -95,14 +95,14 @@ extern inline int sh_mmcif_boot_cmd_poll(void __iomem *base, unsigned long mask)
95 return -1; 95 return -1;
96} 96}
97 97
98extern inline int sh_mmcif_boot_cmd(void __iomem *base, 98static inline int sh_mmcif_boot_cmd(void __iomem *base,
99 unsigned long cmd, unsigned long arg) 99 unsigned long cmd, unsigned long arg)
100{ 100{
101 sh_mmcif_boot_cmd_send(base, cmd, arg); 101 sh_mmcif_boot_cmd_send(base, cmd, arg);
102 return sh_mmcif_boot_cmd_poll(base, 0x00010000); 102 return sh_mmcif_boot_cmd_poll(base, 0x00010000);
103} 103}
104 104
105extern inline int sh_mmcif_boot_do_read_single(void __iomem *base, 105static inline int sh_mmcif_boot_do_read_single(void __iomem *base,
106 unsigned int block_nr, 106 unsigned int block_nr,
107 unsigned long *buf) 107 unsigned long *buf)
108{ 108{
@@ -125,7 +125,7 @@ extern inline int sh_mmcif_boot_do_read_single(void __iomem *base,
125 return 0; 125 return 0;
126} 126}
127 127
128extern inline int sh_mmcif_boot_do_read(void __iomem *base, 128static inline int sh_mmcif_boot_do_read(void __iomem *base,
129 unsigned long first_block, 129 unsigned long first_block,
130 unsigned long nr_blocks, 130 unsigned long nr_blocks,
131 void *buf) 131 void *buf)
@@ -143,7 +143,7 @@ extern inline int sh_mmcif_boot_do_read(void __iomem *base,
143 return ret; 143 return ret;
144} 144}
145 145
146extern inline void sh_mmcif_boot_init(void __iomem *base) 146static inline void sh_mmcif_boot_init(void __iomem *base)
147{ 147{
148 unsigned long tmp; 148 unsigned long tmp;
149 149
@@ -177,7 +177,7 @@ extern inline void sh_mmcif_boot_init(void __iomem *base)
177 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); 177 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
178} 178}
179 179
180extern inline void sh_mmcif_boot_slurp(void __iomem *base, 180static inline void sh_mmcif_boot_slurp(void __iomem *base,
181 unsigned char *buf, 181 unsigned char *buf,
182 unsigned long no_bytes) 182 unsigned long no_bytes)
183{ 183{
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 072652d94d9f..d31bc3c94717 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -493,6 +493,8 @@ static inline void napi_synchronize(const struct napi_struct *n)
493enum netdev_queue_state_t { 493enum netdev_queue_state_t {
494 __QUEUE_STATE_XOFF, 494 __QUEUE_STATE_XOFF,
495 __QUEUE_STATE_FROZEN, 495 __QUEUE_STATE_FROZEN,
496#define QUEUE_STATE_XOFF_OR_FROZEN ((1 << __QUEUE_STATE_XOFF) | \
497 (1 << __QUEUE_STATE_FROZEN))
496}; 498};
497 499
498struct netdev_queue { 500struct netdev_queue {
@@ -503,6 +505,12 @@ struct netdev_queue {
503 struct Qdisc *qdisc; 505 struct Qdisc *qdisc;
504 unsigned long state; 506 unsigned long state;
505 struct Qdisc *qdisc_sleeping; 507 struct Qdisc *qdisc_sleeping;
508#ifdef CONFIG_RPS
509 struct kobject kobj;
510#endif
511#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
512 int numa_node;
513#endif
506/* 514/*
507 * write mostly part 515 * write mostly part
508 */ 516 */
@@ -517,6 +525,22 @@ struct netdev_queue {
517 u64 tx_dropped; 525 u64 tx_dropped;
518} ____cacheline_aligned_in_smp; 526} ____cacheline_aligned_in_smp;
519 527
528static inline int netdev_queue_numa_node_read(const struct netdev_queue *q)
529{
530#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
531 return q->numa_node;
532#else
533 return -1;
534#endif
535}
536
537static inline void netdev_queue_numa_node_write(struct netdev_queue *q, int node)
538{
539#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
540 q->numa_node = node;
541#endif
542}
543
520#ifdef CONFIG_RPS 544#ifdef CONFIG_RPS
521/* 545/*
522 * This structure holds an RPS map which can be of variable length. The 546 * This structure holds an RPS map which can be of variable length. The
@@ -592,11 +616,36 @@ struct netdev_rx_queue {
592 struct rps_map __rcu *rps_map; 616 struct rps_map __rcu *rps_map;
593 struct rps_dev_flow_table __rcu *rps_flow_table; 617 struct rps_dev_flow_table __rcu *rps_flow_table;
594 struct kobject kobj; 618 struct kobject kobj;
595 struct netdev_rx_queue *first; 619 struct net_device *dev;
596 atomic_t count;
597} ____cacheline_aligned_in_smp; 620} ____cacheline_aligned_in_smp;
598#endif /* CONFIG_RPS */ 621#endif /* CONFIG_RPS */
599 622
623#ifdef CONFIG_XPS
624/*
625 * This structure holds an XPS map which can be of variable length. The
626 * map is an array of queues.
627 */
628struct xps_map {
629 unsigned int len;
630 unsigned int alloc_len;
631 struct rcu_head rcu;
632 u16 queues[0];
633};
634#define XPS_MAP_SIZE(_num) (sizeof(struct xps_map) + (_num * sizeof(u16)))
635#define XPS_MIN_MAP_ALLOC ((L1_CACHE_BYTES - sizeof(struct xps_map)) \
636 / sizeof(u16))
637
638/*
639 * This structure holds all XPS maps for device. Maps are indexed by CPU.
640 */
641struct xps_dev_maps {
642 struct rcu_head rcu;
643 struct xps_map __rcu *cpu_map[0];
644};
645#define XPS_DEV_MAPS_SIZE (sizeof(struct xps_dev_maps) + \
646 (nr_cpu_ids * sizeof(struct xps_map *)))
647#endif /* CONFIG_XPS */
648
600/* 649/*
601 * This structure defines the management hooks for network devices. 650 * This structure defines the management hooks for network devices.
602 * The following hooks can be defined; unless noted otherwise, they are 651 * The following hooks can be defined; unless noted otherwise, they are
@@ -951,7 +1000,7 @@ struct net_device {
951#endif 1000#endif
952 void *atalk_ptr; /* AppleTalk link */ 1001 void *atalk_ptr; /* AppleTalk link */
953 struct in_device __rcu *ip_ptr; /* IPv4 specific data */ 1002 struct in_device __rcu *ip_ptr; /* IPv4 specific data */
954 void *dn_ptr; /* DECnet specific data */ 1003 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */
955 struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ 1004 struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */
956 void *ec_ptr; /* Econet specific data */ 1005 void *ec_ptr; /* Econet specific data */
957 void *ax25_ptr; /* AX.25 specific data */ 1006 void *ax25_ptr; /* AX.25 specific data */
@@ -995,8 +1044,8 @@ struct net_device {
995 unsigned int real_num_rx_queues; 1044 unsigned int real_num_rx_queues;
996#endif 1045#endif
997 1046
998 rx_handler_func_t *rx_handler; 1047 rx_handler_func_t __rcu *rx_handler;
999 void *rx_handler_data; 1048 void __rcu *rx_handler_data;
1000 1049
1001 struct netdev_queue __rcu *ingress_queue; 1050 struct netdev_queue __rcu *ingress_queue;
1002 1051
@@ -1017,6 +1066,10 @@ struct net_device {
1017 unsigned long tx_queue_len; /* Max frames per queue allowed */ 1066 unsigned long tx_queue_len; /* Max frames per queue allowed */
1018 spinlock_t tx_global_lock; 1067 spinlock_t tx_global_lock;
1019 1068
1069#ifdef CONFIG_XPS
1070 struct xps_dev_maps __rcu *xps_maps;
1071#endif
1072
1020 /* These may be needed for future network-power-down code. */ 1073 /* These may be needed for future network-power-down code. */
1021 1074
1022 /* 1075 /*
@@ -1307,7 +1360,8 @@ static inline struct net_device *first_net_device(struct net *net)
1307 1360
1308extern int netdev_boot_setup_check(struct net_device *dev); 1361extern int netdev_boot_setup_check(struct net_device *dev);
1309extern unsigned long netdev_boot_base(const char *prefix, int unit); 1362extern unsigned long netdev_boot_base(const char *prefix, int unit);
1310extern struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type, char *hwaddr); 1363extern struct net_device *dev_getbyhwaddr_rcu(struct net *net, unsigned short type,
1364 const char *hwaddr);
1311extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type); 1365extern struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type);
1312extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type); 1366extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type);
1313extern void dev_add_pack(struct packet_type *pt); 1367extern void dev_add_pack(struct packet_type *pt);
@@ -1554,6 +1608,11 @@ static inline void netif_tx_wake_all_queues(struct net_device *dev)
1554 1608
1555static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue) 1609static inline void netif_tx_stop_queue(struct netdev_queue *dev_queue)
1556{ 1610{
1611 if (WARN_ON(!dev_queue)) {
1612 printk(KERN_INFO "netif_stop_queue() cannot be called before "
1613 "register_netdev()");
1614 return;
1615 }
1557 set_bit(__QUEUE_STATE_XOFF, &dev_queue->state); 1616 set_bit(__QUEUE_STATE_XOFF, &dev_queue->state);
1558} 1617}
1559 1618
@@ -1595,9 +1654,9 @@ static inline int netif_queue_stopped(const struct net_device *dev)
1595 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0)); 1654 return netif_tx_queue_stopped(netdev_get_tx_queue(dev, 0));
1596} 1655}
1597 1656
1598static inline int netif_tx_queue_frozen(const struct netdev_queue *dev_queue) 1657static inline int netif_tx_queue_frozen_or_stopped(const struct netdev_queue *dev_queue)
1599{ 1658{
1600 return test_bit(__QUEUE_STATE_FROZEN, &dev_queue->state); 1659 return dev_queue->state & QUEUE_STATE_XOFF_OR_FROZEN;
1601} 1660}
1602 1661
1603/** 1662/**
@@ -2234,6 +2293,8 @@ unsigned long netdev_fix_features(unsigned long features, const char *name);
2234void netif_stacked_transfer_operstate(const struct net_device *rootdev, 2293void netif_stacked_transfer_operstate(const struct net_device *rootdev,
2235 struct net_device *dev); 2294 struct net_device *dev);
2236 2295
2296int netif_get_vlan_features(struct sk_buff *skb, struct net_device *dev);
2297
2237static inline int net_gso_ok(int features, int gso_type) 2298static inline int net_gso_ok(int features, int gso_type)
2238{ 2299{
2239 int feature = gso_type << NETIF_F_GSO_SHIFT; 2300 int feature = gso_type << NETIF_F_GSO_SHIFT;
@@ -2249,10 +2310,7 @@ static inline int skb_gso_ok(struct sk_buff *skb, int features)
2249static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) 2310static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
2250{ 2311{
2251 if (skb_is_gso(skb)) { 2312 if (skb_is_gso(skb)) {
2252 int features = dev->features; 2313 int features = netif_get_vlan_features(skb, dev);
2253
2254 if (skb->protocol == htons(ETH_P_8021Q) || skb->vlan_tci)
2255 features &= dev->vlan_features;
2256 2314
2257 return (!skb_gso_ok(skb, features) || 2315 return (!skb_gso_ok(skb, features) ||
2258 unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); 2316 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 89341c32631a..1893837b3966 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -33,6 +33,8 @@
33 33
34#define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE) 34#define NF_QUEUE_NR(x) ((((x) << NF_VERDICT_BITS) & NF_VERDICT_QMASK) | NF_QUEUE)
35 35
36#define NF_DROP_ERR(x) (((-x) << NF_VERDICT_BITS) | NF_DROP)
37
36/* only for userspace compatibility */ 38/* only for userspace compatibility */
37#ifndef __KERNEL__ 39#ifndef __KERNEL__
38/* Generic cache responses from hook functions. 40/* Generic cache responses from hook functions.
@@ -215,7 +217,7 @@ NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb,
215 int ret; 217 int ret;
216 218
217 if (!cond || 219 if (!cond ||
218 (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) 220 ((ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN)) == 1))
219 ret = okfn(skb); 221 ret = okfn(skb);
220 return ret; 222 return ret;
221} 223}
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 057bf22a8323..40150f345982 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -747,6 +747,16 @@ struct perf_event {
747 u64 tstamp_running; 747 u64 tstamp_running;
748 u64 tstamp_stopped; 748 u64 tstamp_stopped;
749 749
750 /*
751 * timestamp shadows the actual context timing but it can
752 * be safely used in NMI interrupt context. It reflects the
753 * context time as it was when the event was last scheduled in.
754 *
755 * ctx_time already accounts for ctx->timestamp. Therefore to
756 * compute ctx_time for a sample, simply add perf_clock().
757 */
758 u64 shadow_ctx_time;
759
750 struct perf_event_attr attr; 760 struct perf_event_attr attr;
751 struct hw_perf_event hw; 761 struct hw_perf_event hw;
752 762
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 01b3d759f1fc..e031e1a486d9 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -8,6 +8,7 @@ struct platform_pwm_backlight_data {
8 int pwm_id; 8 int pwm_id;
9 unsigned int max_brightness; 9 unsigned int max_brightness;
10 unsigned int dft_brightness; 10 unsigned int dft_brightness;
11 unsigned int lth_brightness;
11 unsigned int pwm_period_ns; 12 unsigned int pwm_period_ns;
12 int (*init)(struct device *dev); 13 int (*init)(struct device *dev);
13 int (*notify)(struct device *dev, int brightness); 14 int (*notify)(struct device *dev, int brightness);
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index a39cbed9ee17..ab2baa5c4884 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -34,19 +34,13 @@
34 * needed for RCU lookups (because root->height is unreliable). The only 34 * needed for RCU lookups (because root->height is unreliable). The only
35 * time callers need worry about this is when doing a lookup_slot under 35 * time callers need worry about this is when doing a lookup_slot under
36 * RCU. 36 * RCU.
37 *
38 * Indirect pointer in fact is also used to tag the last pointer of a node
39 * when it is shrunk, before we rcu free the node. See shrink code for
40 * details.
37 */ 41 */
38#define RADIX_TREE_INDIRECT_PTR 1 42#define RADIX_TREE_INDIRECT_PTR 1
39#define RADIX_TREE_RETRY ((void *)-1UL)
40
41static inline void *radix_tree_ptr_to_indirect(void *ptr)
42{
43 return (void *)((unsigned long)ptr | RADIX_TREE_INDIRECT_PTR);
44}
45 43
46static inline void *radix_tree_indirect_to_ptr(void *ptr)
47{
48 return (void *)((unsigned long)ptr & ~RADIX_TREE_INDIRECT_PTR);
49}
50#define radix_tree_indirect_to_ptr(ptr) \ 44#define radix_tree_indirect_to_ptr(ptr) \
51 radix_tree_indirect_to_ptr((void __force *)(ptr)) 45 radix_tree_indirect_to_ptr((void __force *)(ptr))
52 46
@@ -140,16 +134,29 @@ do { \
140 * removed. 134 * removed.
141 * 135 *
142 * For use with radix_tree_lookup_slot(). Caller must hold tree at least read 136 * For use with radix_tree_lookup_slot(). Caller must hold tree at least read
143 * locked across slot lookup and dereference. More likely, will be used with 137 * locked across slot lookup and dereference. Not required if write lock is
144 * radix_tree_replace_slot(), as well, so caller will hold tree write locked. 138 * held (ie. items cannot be concurrently inserted).
139 *
140 * radix_tree_deref_retry must be used to confirm validity of the pointer if
141 * only the read lock is held.
145 */ 142 */
146static inline void *radix_tree_deref_slot(void **pslot) 143static inline void *radix_tree_deref_slot(void **pslot)
147{ 144{
148 void *ret = rcu_dereference(*pslot); 145 return rcu_dereference(*pslot);
149 if (unlikely(radix_tree_is_indirect_ptr(ret)))
150 ret = RADIX_TREE_RETRY;
151 return ret;
152} 146}
147
148/**
149 * radix_tree_deref_retry - check radix_tree_deref_slot
150 * @arg: pointer returned by radix_tree_deref_slot
151 * Returns: 0 if retry is not required, otherwise retry is required
152 *
153 * radix_tree_deref_retry must be used with radix_tree_deref_slot.
154 */
155static inline int radix_tree_deref_retry(void *arg)
156{
157 return unlikely((unsigned long)arg & RADIX_TREE_INDIRECT_PTR);
158}
159
153/** 160/**
154 * radix_tree_replace_slot - replace item in a slot 161 * radix_tree_replace_slot - replace item in a slot
155 * @pslot: pointer to slot, returned by radix_tree_lookup_slot 162 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
diff --git a/include/linux/resource.h b/include/linux/resource.h
index 88d36f9145ba..d01c96c1966e 100644
--- a/include/linux/resource.h
+++ b/include/linux/resource.h
@@ -2,6 +2,7 @@
2#define _LINUX_RESOURCE_H 2#define _LINUX_RESOURCE_H
3 3
4#include <linux/time.h> 4#include <linux/time.h>
5#include <linux/types.h>
5 6
6/* 7/*
7 * Resource control/accounting header file for linux 8 * Resource control/accounting header file for linux
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index d42f274418b8..bbad657a3725 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -6,7 +6,6 @@
6#include <linux/if_link.h> 6#include <linux/if_link.h>
7#include <linux/if_addr.h> 7#include <linux/if_addr.h>
8#include <linux/neighbour.h> 8#include <linux/neighbour.h>
9#include <linux/netdevice.h>
10 9
11/* rtnetlink families. Values up to 127 are reserved for real address 10/* rtnetlink families. Values up to 127 are reserved for real address
12 * families, values above 128 may be used arbitrarily. 11 * families, values above 128 may be used arbitrarily.
@@ -606,6 +605,7 @@ struct tcamsg {
606#ifdef __KERNEL__ 605#ifdef __KERNEL__
607 606
608#include <linux/mutex.h> 607#include <linux/mutex.h>
608#include <linux/netdevice.h>
609 609
610static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) 610static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
611{ 611{
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 4dca992f3093..cea0c38e7a63 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -122,6 +122,10 @@ int clk_rate_table_find(struct clk *clk,
122long clk_rate_div_range_round(struct clk *clk, unsigned int div_min, 122long clk_rate_div_range_round(struct clk *clk, unsigned int div_min,
123 unsigned int div_max, unsigned long rate); 123 unsigned int div_max, unsigned long rate);
124 124
125long clk_round_parent(struct clk *clk, unsigned long target,
126 unsigned long *best_freq, unsigned long *parent_freq,
127 unsigned int div_min, unsigned int div_max);
128
125#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \ 129#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \
126{ \ 130{ \
127 .parent = _parent, \ 131 .parent = _parent, \
diff --git a/include/linux/sh_timer.h b/include/linux/sh_timer.h
index 864bd56bd3b0..4d9dcd138315 100644
--- a/include/linux/sh_timer.h
+++ b/include/linux/sh_timer.h
@@ -5,7 +5,6 @@ struct sh_timer_config {
5 char *name; 5 char *name;
6 long channel_offset; 6 long channel_offset;
7 int timer_bit; 7 int timer_bit;
8 char *clk;
9 unsigned long clockevent_rating; 8 unsigned long clockevent_rating;
10 unsigned long clocksource_rating; 9 unsigned long clocksource_rating;
11}; 10};
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e6ba898de61c..19f37a6ee6c4 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -386,9 +386,10 @@ struct sk_buff {
386#else 386#else
387 __u8 deliver_no_wcard:1; 387 __u8 deliver_no_wcard:1;
388#endif 388#endif
389 __u8 ooo_okay:1;
389 kmemcheck_bitfield_end(flags2); 390 kmemcheck_bitfield_end(flags2);
390 391
391 /* 0/14 bit hole */ 392 /* 0/13 bit hole */
392 393
393#ifdef CONFIG_NET_DMA 394#ifdef CONFIG_NET_DMA
394 dma_cookie_t dma_cookie; 395 dma_cookie_t dma_cookie;
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index ebb0c80ffd6e..12b2b18e50c1 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -230,6 +230,7 @@ enum
230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */ 230 LINUX_MIB_TCPMINTTLDROP, /* RFC 5082 */
231 LINUX_MIB_TCPDEFERACCEPTDROP, 231 LINUX_MIB_TCPDEFERACCEPTDROP,
232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ 232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
233 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
233 __LINUX_MIB_MAX 234 __LINUX_MIB_MAX
234}; 235};
235 236
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index d66c61774d95..e10352915698 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -40,9 +40,9 @@ struct plat_stmmacenet_data {
40 int pmt; 40 int pmt;
41 void (*fix_mac_speed)(void *priv, unsigned int speed); 41 void (*fix_mac_speed)(void *priv, unsigned int speed);
42 void (*bus_setup)(void __iomem *ioaddr); 42 void (*bus_setup)(void __iomem *ioaddr);
43#ifdef CONFIG_STM_DRIVERS 43 int (*init)(struct platform_device *pdev);
44 struct stm_pad_config *pad_config; 44 void (*exit)(struct platform_device *pdev);
45#endif 45 void *custom_cfg;
46 void *bsp_priv; 46 void *bsp_priv;
47}; 47};
48 48
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h
index bbdb680ffbe9..aea0d438e3c7 100644
--- a/include/linux/sunrpc/svc_xprt.h
+++ b/include/linux/sunrpc/svc_xprt.h
@@ -82,18 +82,28 @@ struct svc_xprt {
82 struct net *xpt_net; 82 struct net *xpt_net;
83}; 83};
84 84
85static inline void register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) 85static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
86{ 86{
87 spin_lock(&xpt->xpt_lock); 87 spin_lock(&xpt->xpt_lock);
88 list_add(&u->list, &xpt->xpt_users); 88 list_del_init(&u->list);
89 spin_unlock(&xpt->xpt_lock); 89 spin_unlock(&xpt->xpt_lock);
90} 90}
91 91
92static inline void unregister_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u) 92static inline int register_xpt_user(struct svc_xprt *xpt, struct svc_xpt_user *u)
93{ 93{
94 spin_lock(&xpt->xpt_lock); 94 spin_lock(&xpt->xpt_lock);
95 list_del_init(&u->list); 95 if (test_bit(XPT_CLOSE, &xpt->xpt_flags)) {
96 /*
97 * The connection is about to be deleted soon (or,
98 * worse, may already be deleted--in which case we've
99 * already notified the xpt_users).
100 */
101 spin_unlock(&xpt->xpt_lock);
102 return -ENOTCONN;
103 }
104 list_add(&u->list, &xpt->xpt_users);
96 spin_unlock(&xpt->xpt_lock); 105 spin_unlock(&xpt->xpt_lock);
106 return 0;
97} 107}
98 108
99int svc_reg_xprt_class(struct svc_xprt_class *); 109int svc_reg_xprt_class(struct svc_xprt_class *);
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 2a754748dd5f..c7ea9bc8897c 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -50,7 +50,7 @@
50#define N_V253 19 /* Codec control over voice modem */ 50#define N_V253 19 /* Codec control over voice modem */
51#define N_CAIF 20 /* CAIF protocol for talking to modems */ 51#define N_CAIF 20 /* CAIF protocol for talking to modems */
52#define N_GSM0710 21 /* GSM 0710 Mux */ 52#define N_GSM0710 21 /* GSM 0710 Mux */
53#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */ 53#define N_TI_WL 22 /* for TI's WL BT, FM, GPS combo chips */
54 54
55/* 55/*
56 * This character is the same as _POSIX_VDISABLE: it cannot be used as 56 * This character is the same as _POSIX_VDISABLE: it cannot be used as
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 35fe6ab222bb..24300d8a1bc1 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -797,7 +797,7 @@ struct usbdrv_wrap {
797 * @disconnect: Called when the interface is no longer accessible, usually 797 * @disconnect: Called when the interface is no longer accessible, usually
798 * because its device has been (or is being) disconnected or the 798 * because its device has been (or is being) disconnected or the
799 * driver module is being unloaded. 799 * driver module is being unloaded.
800 * @ioctl: Used for drivers that want to talk to userspace through 800 * @unlocked_ioctl: Used for drivers that want to talk to userspace through
801 * the "usbfs" filesystem. This lets devices provide ways to 801 * the "usbfs" filesystem. This lets devices provide ways to
802 * expose information to user space regardless of where they 802 * expose information to user space regardless of where they
803 * do (or don't) show up otherwise in the filesystem. 803 * do (or don't) show up otherwise in the filesystem.
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index ee2dd1d506ed..2387f9fc8138 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -89,6 +89,8 @@ struct musb_hdrc_config {
89 /* A GPIO controlling VRSEL in Blackfin */ 89 /* A GPIO controlling VRSEL in Blackfin */
90 unsigned int gpio_vrsel; 90 unsigned int gpio_vrsel;
91 unsigned int gpio_vrsel_active; 91 unsigned int gpio_vrsel_active;
92 /* musb CLKIN in Blackfin in MHZ */
93 unsigned char clkin;
92#endif 94#endif
93 95
94}; 96};
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index 7ae27a473818..44842c8d38c0 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -97,6 +97,12 @@ struct driver_info {
97 97
98#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ 98#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */
99 99
100/*
101 * Indicates to usbnet, that USB driver accumulates multiple IP packets.
102 * Affects statistic (counters) and short packet handling.
103 */
104#define FLAG_MULTI_PACKET 0x1000
105
100 /* init device ... can sleep, or cause probe() failure */ 106 /* init device ... can sleep, or cause probe() failure */
101 int (*bind)(struct usbnet *, struct usb_interface *); 107 int (*bind)(struct usbnet *, struct usb_interface *);
102 108
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index b971e3848493..930fdd2de79c 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -283,6 +283,7 @@ enum xfrm_attr_type_t {
283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ 283 XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */
284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ 284 XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */
285 XFRMA_MARK, /* struct xfrm_mark */ 285 XFRMA_MARK, /* struct xfrm_mark */
286 XFRMA_TFCPAD, /* __u32 */
286 __XFRMA_MAX 287 __XFRMA_MAX
287 288
288#define XFRMA_MAX (__XFRMA_MAX - 1) 289#define XFRMA_MAX (__XFRMA_MAX - 1)
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index a9441249306c..23710aa6a181 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -1,8 +1,6 @@
1#ifndef _ADDRCONF_H 1#ifndef _ADDRCONF_H
2#define _ADDRCONF_H 2#define _ADDRCONF_H
3 3
4#define RETRANS_TIMER HZ
5
6#define MAX_RTR_SOLICITATIONS 3 4#define MAX_RTR_SOLICITATIONS 3
7#define RTR_SOLICITATION_INTERVAL (4*HZ) 5#define RTR_SOLICITATION_INTERVAL (4*HZ)
8 6
diff --git a/include/net/af_unix.h b/include/net/af_unix.h
index 90c9e2872f27..18e5c3f67580 100644
--- a/include/net/af_unix.h
+++ b/include/net/af_unix.h
@@ -10,6 +10,7 @@ extern void unix_inflight(struct file *fp);
10extern void unix_notinflight(struct file *fp); 10extern void unix_notinflight(struct file *fp);
11extern void unix_gc(void); 11extern void unix_gc(void);
12extern void wait_for_unix_gc(void); 12extern void wait_for_unix_gc(void);
13extern struct sock *unix_get_socket(struct file *filp);
13 14
14#define UNIX_HASH_SIZE 256 15#define UNIX_HASH_SIZE 256
15 16
@@ -56,6 +57,7 @@ struct unix_sock {
56 spinlock_t lock; 57 spinlock_t lock;
57 unsigned int gc_candidate : 1; 58 unsigned int gc_candidate : 1;
58 unsigned int gc_maybe_cycle : 1; 59 unsigned int gc_maybe_cycle : 1;
60 unsigned char recursion_level;
59 struct socket_wq peer_wq; 61 struct socket_wq peer_wq;
60}; 62};
61#define unix_sk(__sk) ((struct unix_sock *)__sk) 63#define unix_sk(__sk) ((struct unix_sock *)__sk)
diff --git a/include/net/caif/caif_dev.h b/include/net/caif/caif_dev.h
index 6da573c75d54..8eff83b95366 100644
--- a/include/net/caif/caif_dev.h
+++ b/include/net/caif/caif_dev.h
@@ -28,7 +28,7 @@ struct caif_param {
28 * @sockaddr: Socket address to connect. 28 * @sockaddr: Socket address to connect.
29 * @priority: Priority of the connection. 29 * @priority: Priority of the connection.
30 * @link_selector: Link selector (high bandwidth or low latency) 30 * @link_selector: Link selector (high bandwidth or low latency)
31 * @link_name: Name of the CAIF Link Layer to use. 31 * @ifindex: kernel index of the interface.
32 * @param: Connect Request parameters (CAIF_SO_REQ_PARAM). 32 * @param: Connect Request parameters (CAIF_SO_REQ_PARAM).
33 * 33 *
34 * This struct is used when connecting a CAIF channel. 34 * This struct is used when connecting a CAIF channel.
@@ -39,7 +39,7 @@ struct caif_connect_request {
39 struct sockaddr_caif sockaddr; 39 struct sockaddr_caif sockaddr;
40 enum caif_channel_priority priority; 40 enum caif_channel_priority priority;
41 enum caif_link_selector link_selector; 41 enum caif_link_selector link_selector;
42 char link_name[16]; 42 int ifindex;
43 struct caif_param param; 43 struct caif_param param;
44}; 44};
45 45
diff --git a/include/net/caif/caif_spi.h b/include/net/caif/caif_spi.h
index ce4570dff020..87c3d11b8e55 100644
--- a/include/net/caif/caif_spi.h
+++ b/include/net/caif/caif_spi.h
@@ -121,6 +121,8 @@ struct cfspi {
121 wait_queue_head_t wait; 121 wait_queue_head_t wait;
122 spinlock_t lock; 122 spinlock_t lock;
123 bool flow_stop; 123 bool flow_stop;
124 bool slave;
125 bool slave_talked;
124#ifdef CONFIG_DEBUG_FS 126#ifdef CONFIG_DEBUG_FS
125 enum cfspi_state dbg_state; 127 enum cfspi_state dbg_state;
126 u16 pcmd; 128 u16 pcmd;
diff --git a/include/net/caif/cfcnfg.h b/include/net/caif/cfcnfg.h
index bd646faffa47..f688478bfb84 100644
--- a/include/net/caif/cfcnfg.h
+++ b/include/net/caif/cfcnfg.h
@@ -139,10 +139,10 @@ struct dev_info *cfcnfg_get_phyid(struct cfcnfg *cnfg,
139 enum cfcnfg_phy_preference phy_pref); 139 enum cfcnfg_phy_preference phy_pref);
140 140
141/** 141/**
142 * cfcnfg_get_named() - Get the Physical Identifier of CAIF Link Layer 142 * cfcnfg_get_id_from_ifi() - Get the Physical Identifier of ifindex,
143 * it matches caif physical id with the kernel interface id.
143 * @cnfg: Configuration object 144 * @cnfg: Configuration object
144 * @name: Name of the Physical Layer (Caif Link Layer) 145 * @ifi: ifindex obtained from socket.c bindtodevice.
145 */ 146 */
146int cfcnfg_get_named(struct cfcnfg *cnfg, char *name); 147int cfcnfg_get_id_from_ifi(struct cfcnfg *cnfg, int ifi);
147
148#endif /* CFCNFG_H_ */ 148#endif /* CFCNFG_H_ */
diff --git a/include/net/caif/cfctrl.h b/include/net/caif/cfctrl.h
index 9402543fc20d..e54f6396fa4c 100644
--- a/include/net/caif/cfctrl.h
+++ b/include/net/caif/cfctrl.h
@@ -51,7 +51,7 @@ struct cfctrl_rsp {
51 void (*restart_rsp)(void); 51 void (*restart_rsp)(void);
52 void (*radioset_rsp)(void); 52 void (*radioset_rsp)(void);
53 void (*reject_rsp)(struct cflayer *layer, u8 linkid, 53 void (*reject_rsp)(struct cflayer *layer, u8 linkid,
54 struct cflayer *client_layer);; 54 struct cflayer *client_layer);
55}; 55};
56 56
57/* Link Setup Parameters for CAIF-Links. */ 57/* Link Setup Parameters for CAIF-Links. */
diff --git a/include/net/dn.h b/include/net/dn.h
index e5469f7b67a3..a514a3cf4573 100644
--- a/include/net/dn.h
+++ b/include/net/dn.h
@@ -225,7 +225,7 @@ extern int decnet_di_count;
225extern int decnet_dr_count; 225extern int decnet_dr_count;
226extern int decnet_no_fc_max_cwnd; 226extern int decnet_no_fc_max_cwnd;
227 227
228extern int sysctl_decnet_mem[3]; 228extern long sysctl_decnet_mem[3];
229extern int sysctl_decnet_wmem[3]; 229extern int sysctl_decnet_wmem[3];
230extern int sysctl_decnet_rmem[3]; 230extern int sysctl_decnet_rmem[3];
231 231
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h
index 0916bbf3bdff..b9e32db03f20 100644
--- a/include/net/dn_dev.h
+++ b/include/net/dn_dev.h
@@ -5,13 +5,14 @@
5struct dn_dev; 5struct dn_dev;
6 6
7struct dn_ifaddr { 7struct dn_ifaddr {
8 struct dn_ifaddr *ifa_next; 8 struct dn_ifaddr __rcu *ifa_next;
9 struct dn_dev *ifa_dev; 9 struct dn_dev *ifa_dev;
10 __le16 ifa_local; 10 __le16 ifa_local;
11 __le16 ifa_address; 11 __le16 ifa_address;
12 __u8 ifa_flags; 12 __u8 ifa_flags;
13 __u8 ifa_scope; 13 __u8 ifa_scope;
14 char ifa_label[IFNAMSIZ]; 14 char ifa_label[IFNAMSIZ];
15 struct rcu_head rcu;
15}; 16};
16 17
17#define DN_DEV_S_RU 0 /* Run - working normally */ 18#define DN_DEV_S_RU 0 /* Run - working normally */
@@ -83,7 +84,7 @@ struct dn_dev_parms {
83 84
84 85
85struct dn_dev { 86struct dn_dev {
86 struct dn_ifaddr *ifa_list; 87 struct dn_ifaddr __rcu *ifa_list;
87 struct net_device *dev; 88 struct net_device *dev;
88 struct dn_dev_parms parms; 89 struct dn_dev_parms parms;
89 char use_long; 90 char use_long;
@@ -171,19 +172,27 @@ extern int unregister_dnaddr_notifier(struct notifier_block *nb);
171 172
172static inline int dn_dev_islocal(struct net_device *dev, __le16 addr) 173static inline int dn_dev_islocal(struct net_device *dev, __le16 addr)
173{ 174{
174 struct dn_dev *dn_db = dev->dn_ptr; 175 struct dn_dev *dn_db;
175 struct dn_ifaddr *ifa; 176 struct dn_ifaddr *ifa;
177 int res = 0;
176 178
179 rcu_read_lock();
180 dn_db = rcu_dereference(dev->dn_ptr);
177 if (dn_db == NULL) { 181 if (dn_db == NULL) {
178 printk(KERN_DEBUG "dn_dev_islocal: Called for non DECnet device\n"); 182 printk(KERN_DEBUG "dn_dev_islocal: Called for non DECnet device\n");
179 return 0; 183 goto out;
180 } 184 }
181 185
182 for(ifa = dn_db->ifa_list; ifa; ifa = ifa->ifa_next) 186 for (ifa = rcu_dereference(dn_db->ifa_list);
183 if ((addr ^ ifa->ifa_local) == 0) 187 ifa != NULL;
184 return 1; 188 ifa = rcu_dereference(ifa->ifa_next))
185 189 if ((addr ^ ifa->ifa_local) == 0) {
186 return 0; 190 res = 1;
191 break;
192 }
193out:
194 rcu_read_unlock();
195 return res;
187} 196}
188 197
189#endif /* _NET_DN_DEV_H */ 198#endif /* _NET_DN_DEV_H */
diff --git a/include/net/dn_route.h b/include/net/dn_route.h
index ccadab3aa3f6..9b185df265fb 100644
--- a/include/net/dn_route.h
+++ b/include/net/dn_route.h
@@ -80,6 +80,16 @@ struct dn_route {
80 unsigned rt_type; 80 unsigned rt_type;
81}; 81};
82 82
83static inline bool dn_is_input_route(struct dn_route *rt)
84{
85 return rt->fl.iif != 0;
86}
87
88static inline bool dn_is_output_route(struct dn_route *rt)
89{
90 return rt->fl.iif == 0;
91}
92
83extern void dn_route_init(void); 93extern void dn_route_init(void);
84extern void dn_route_cleanup(void); 94extern void dn_route_cleanup(void);
85 95
diff --git a/include/net/dst.h b/include/net/dst.h
index ffe9cb719c0e..755ac6c1aa03 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -70,7 +70,7 @@ struct dst_entry {
70 70
71 struct dst_ops *ops; 71 struct dst_ops *ops;
72 72
73 u32 metrics[RTAX_MAX]; 73 u32 _metrics[RTAX_MAX];
74 74
75#ifdef CONFIG_NET_CLS_ROUTE 75#ifdef CONFIG_NET_CLS_ROUTE
76 __u32 tclassid; 76 __u32 tclassid;
@@ -94,19 +94,46 @@ struct dst_entry {
94 int __use; 94 int __use;
95 unsigned long lastuse; 95 unsigned long lastuse;
96 union { 96 union {
97 struct dst_entry *next; 97 struct dst_entry *next;
98 struct rtable __rcu *rt_next; 98 struct rtable __rcu *rt_next;
99 struct rt6_info *rt6_next; 99 struct rt6_info *rt6_next;
100 struct dn_route *dn_next; 100 struct dn_route __rcu *dn_next;
101 }; 101 };
102}; 102};
103 103
104#ifdef __KERNEL__ 104#ifdef __KERNEL__
105 105
106static inline u32 106static inline u32
107dst_metric(const struct dst_entry *dst, int metric) 107dst_metric_raw(const struct dst_entry *dst, const int metric)
108{ 108{
109 return dst->metrics[metric-1]; 109 return dst->_metrics[metric-1];
110}
111
112static inline u32
113dst_metric(const struct dst_entry *dst, const int metric)
114{
115 WARN_ON_ONCE(metric == RTAX_HOPLIMIT);
116 return dst_metric_raw(dst, metric);
117}
118
119static inline void dst_metric_set(struct dst_entry *dst, int metric, u32 val)
120{
121 dst->_metrics[metric-1] = val;
122}
123
124static inline void dst_import_metrics(struct dst_entry *dst, const u32 *src_metrics)
125{
126 memcpy(dst->_metrics, src_metrics, RTAX_MAX * sizeof(u32));
127}
128
129static inline void dst_copy_metrics(struct dst_entry *dest, const struct dst_entry *src)
130{
131 dst_import_metrics(dest, src->_metrics);
132}
133
134static inline u32 *dst_metrics_ptr(struct dst_entry *dst)
135{
136 return dst->_metrics;
110} 137}
111 138
112static inline u32 139static inline u32
@@ -134,7 +161,7 @@ static inline unsigned long dst_metric_rtt(const struct dst_entry *dst, int metr
134static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, 161static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric,
135 unsigned long rtt) 162 unsigned long rtt)
136{ 163{
137 dst->metrics[metric-1] = jiffies_to_msecs(rtt); 164 dst_metric_set(dst, metric, jiffies_to_msecs(rtt));
138} 165}
139 166
140static inline u32 167static inline u32
diff --git a/include/net/flow.h b/include/net/flow.h
index 0ac3fb5e0973..7196e6864b8d 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -67,6 +67,7 @@ struct flowi {
67 } dnports; 67 } dnports;
68 68
69 __be32 spi; 69 __be32 spi;
70 __be32 gre_key;
70 71
71 struct { 72 struct {
72 __u8 type; 73 __u8 type;
@@ -78,6 +79,7 @@ struct flowi {
78#define fl_icmp_code uli_u.icmpt.code 79#define fl_icmp_code uli_u.icmpt.code
79#define fl_ipsec_spi uli_u.spi 80#define fl_ipsec_spi uli_u.spi
80#define fl_mh_type uli_u.mht.type 81#define fl_mh_type uli_u.mht.type
82#define fl_gre_key uli_u.gre_key
81 __u32 secid; /* used by xfrm; see secid.txt */ 83 __u32 secid; /* used by xfrm; see secid.txt */
82} __attribute__((__aligned__(BITS_PER_LONG/8))); 84} __attribute__((__aligned__(BITS_PER_LONG/8)));
83 85
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index f95ff8d9aa47..04977eefb0ee 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -89,10 +89,11 @@ struct ip6_sf_socklist {
89struct ipv6_mc_socklist { 89struct ipv6_mc_socklist {
90 struct in6_addr addr; 90 struct in6_addr addr;
91 int ifindex; 91 int ifindex;
92 struct ipv6_mc_socklist *next; 92 struct ipv6_mc_socklist __rcu *next;
93 rwlock_t sflock; 93 rwlock_t sflock;
94 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ 94 unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */
95 struct ip6_sf_socklist *sflist; 95 struct ip6_sf_socklist *sflist;
96 struct rcu_head rcu;
96}; 97};
97 98
98struct ip6_sf_list { 99struct ip6_sf_list {
diff --git a/include/net/inet6_connection_sock.h b/include/net/inet6_connection_sock.h
index aae08f686633..ff013505236b 100644
--- a/include/net/inet6_connection_sock.h
+++ b/include/net/inet6_connection_sock.h
@@ -25,6 +25,9 @@ struct sockaddr;
25extern int inet6_csk_bind_conflict(const struct sock *sk, 25extern int inet6_csk_bind_conflict(const struct sock *sk,
26 const struct inet_bind_bucket *tb); 26 const struct inet_bind_bucket *tb);
27 27
28extern struct dst_entry* inet6_csk_route_req(struct sock *sk,
29 const struct request_sock *req);
30
28extern struct request_sock *inet6_csk_search_req(const struct sock *sk, 31extern struct request_sock *inet6_csk_search_req(const struct sock *sk,
29 struct request_sock ***prevp, 32 struct request_sock ***prevp,
30 const __be16 rport, 33 const __be16 rport,
diff --git a/include/net/inet_connection_sock.h b/include/net/inet_connection_sock.h
index e4f494b42e06..6c93a56cc958 100644
--- a/include/net/inet_connection_sock.h
+++ b/include/net/inet_connection_sock.h
@@ -43,7 +43,7 @@ struct inet_connection_sock_af_ops {
43 struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb, 43 struct sock *(*syn_recv_sock)(struct sock *sk, struct sk_buff *skb,
44 struct request_sock *req, 44 struct request_sock *req,
45 struct dst_entry *dst); 45 struct dst_entry *dst);
46 int (*remember_stamp)(struct sock *sk); 46 struct inet_peer *(*get_peer)(struct sock *sk, bool *release_it);
47 u16 net_header_len; 47 u16 net_header_len;
48 u16 sockaddr_len; 48 u16 sockaddr_len;
49 int (*setsockopt)(struct sock *sk, int level, int optname, 49 int (*setsockopt)(struct sock *sk, int level, int optname,
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index 1989cfd7405f..8181498fa96c 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -116,8 +116,9 @@ struct inet_sock {
116 struct ipv6_pinfo *pinet6; 116 struct ipv6_pinfo *pinet6;
117#endif 117#endif
118 /* Socket demultiplex comparisons on incoming packets. */ 118 /* Socket demultiplex comparisons on incoming packets. */
119 __be32 inet_daddr; 119#define inet_daddr sk.__sk_common.skc_daddr
120 __be32 inet_rcv_saddr; 120#define inet_rcv_saddr sk.__sk_common.skc_rcv_saddr
121
121 __be16 inet_dport; 122 __be16 inet_dport;
122 __u16 inet_num; 123 __u16 inet_num;
123 __be32 inet_saddr; 124 __be32 inet_saddr;
@@ -141,7 +142,7 @@ struct inet_sock {
141 nodefrag:1; 142 nodefrag:1;
142 int mc_index; 143 int mc_index;
143 __be32 mc_addr; 144 __be32 mc_addr;
144 struct ip_mc_socklist *mc_list; 145 struct ip_mc_socklist __rcu *mc_list;
145 struct { 146 struct {
146 unsigned int flags; 147 unsigned int flags;
147 unsigned int fragsize; 148 unsigned int fragsize;
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index a066fdd50da6..17404b5388a7 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -88,12 +88,6 @@ extern void inet_twdr_hangman(unsigned long data);
88extern void inet_twdr_twkill_work(struct work_struct *work); 88extern void inet_twdr_twkill_work(struct work_struct *work);
89extern void inet_twdr_twcal_tick(unsigned long data); 89extern void inet_twdr_twcal_tick(unsigned long data);
90 90
91#if (BITS_PER_LONG == 64)
92#define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 8
93#else
94#define INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES 4
95#endif
96
97struct inet_bind_bucket; 91struct inet_bind_bucket;
98 92
99/* 93/*
@@ -117,15 +111,15 @@ struct inet_timewait_sock {
117#define tw_hash __tw_common.skc_hash 111#define tw_hash __tw_common.skc_hash
118#define tw_prot __tw_common.skc_prot 112#define tw_prot __tw_common.skc_prot
119#define tw_net __tw_common.skc_net 113#define tw_net __tw_common.skc_net
114#define tw_daddr __tw_common.skc_daddr
115#define tw_rcv_saddr __tw_common.skc_rcv_saddr
120 int tw_timeout; 116 int tw_timeout;
121 volatile unsigned char tw_substate; 117 volatile unsigned char tw_substate;
122 /* 3 bits hole, try to pack */
123 unsigned char tw_rcv_wscale; 118 unsigned char tw_rcv_wscale;
119
124 /* Socket demultiplex comparisons on incoming packets. */ 120 /* Socket demultiplex comparisons on incoming packets. */
125 /* these five are in inet_sock */ 121 /* these three are in inet_sock */
126 __be16 tw_sport; 122 __be16 tw_sport;
127 __be32 tw_daddr __attribute__((aligned(INET_TIMEWAIT_ADDRCMP_ALIGN_BYTES)));
128 __be32 tw_rcv_saddr;
129 __be16 tw_dport; 123 __be16 tw_dport;
130 __u16 tw_num; 124 __u16 tw_num;
131 kmemcheck_bitfield_begin(flags); 125 kmemcheck_bitfield_begin(flags);
@@ -191,10 +185,10 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk)
191 return (struct inet_timewait_sock *)sk; 185 return (struct inet_timewait_sock *)sk;
192} 186}
193 187
194static inline __be32 inet_rcv_saddr(const struct sock *sk) 188static inline __be32 sk_rcv_saddr(const struct sock *sk)
195{ 189{
196 return likely(sk->sk_state != TCP_TIME_WAIT) ? 190/* both inet_sk() and inet_twsk() store rcv_saddr in skc_rcv_saddr */
197 inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; 191 return sk->__sk_common.skc_rcv_saddr;
198} 192}
199 193
200extern void inet_twsk_put(struct inet_timewait_sock *tw); 194extern void inet_twsk_put(struct inet_timewait_sock *tw);
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index fe239bfe5f7f..599d96e74114 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -11,12 +11,21 @@
11#include <linux/init.h> 11#include <linux/init.h>
12#include <linux/jiffies.h> 12#include <linux/jiffies.h>
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <net/ipv6.h>
14#include <asm/atomic.h> 15#include <asm/atomic.h>
15 16
17struct inetpeer_addr {
18 union {
19 __be32 a4;
20 __be32 a6[4];
21 };
22 __u16 family;
23};
24
16struct inet_peer { 25struct inet_peer {
17 /* group together avl_left,avl_right,v4daddr to speedup lookups */ 26 /* group together avl_left,avl_right,v4daddr to speedup lookups */
18 struct inet_peer __rcu *avl_left, *avl_right; 27 struct inet_peer __rcu *avl_left, *avl_right;
19 __be32 v4daddr; /* peer's address */ 28 struct inetpeer_addr daddr;
20 __u32 avl_height; 29 __u32 avl_height;
21 struct list_head unused; 30 struct list_head unused;
22 __u32 dtime; /* the time of last use of not 31 __u32 dtime; /* the time of last use of not
@@ -26,7 +35,6 @@ struct inet_peer {
26 * Once inet_peer is queued for deletion (refcnt == -1), following fields 35 * Once inet_peer is queued for deletion (refcnt == -1), following fields
27 * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp 36 * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp
28 * We can share memory with rcu_head to keep inet_peer small 37 * We can share memory with rcu_head to keep inet_peer small
29 * (less then 64 bytes)
30 */ 38 */
31 union { 39 union {
32 struct { 40 struct {
@@ -42,7 +50,25 @@ struct inet_peer {
42void inet_initpeers(void) __init; 50void inet_initpeers(void) __init;
43 51
44/* can be called with or without local BH being disabled */ 52/* can be called with or without local BH being disabled */
45struct inet_peer *inet_getpeer(__be32 daddr, int create); 53struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create);
54
55static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
56{
57 struct inetpeer_addr daddr;
58
59 daddr.a4 = v4daddr;
60 daddr.family = AF_INET;
61 return inet_getpeer(&daddr, create);
62}
63
64static inline struct inet_peer *inet_getpeer_v6(struct in6_addr *v6daddr, int create)
65{
66 struct inetpeer_addr daddr;
67
68 ipv6_addr_copy((struct in6_addr *)daddr.a6, v6daddr);
69 daddr.family = AF_INET6;
70 return inet_getpeer(&daddr, create);
71}
46 72
47/* can be called from BH context or outside */ 73/* can be called from BH context or outside */
48extern void inet_putpeer(struct inet_peer *p); 74extern void inet_putpeer(struct inet_peer *p);
diff --git a/include/net/ip.h b/include/net/ip.h
index 86e2b182a0c0..67fac78a186b 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -201,7 +201,6 @@ static inline int inet_is_reserved_local_port(int port)
201 return test_bit(port, sysctl_local_reserved_ports); 201 return test_bit(port, sysctl_local_reserved_ports);
202} 202}
203 203
204extern int sysctl_ip_default_ttl;
205extern int sysctl_ip_nonlocal_bind; 204extern int sysctl_ip_nonlocal_bind;
206 205
207extern struct ctl_path net_core_path[]; 206extern struct ctl_path net_core_path[];
@@ -428,15 +427,6 @@ extern void ip_icmp_error(struct sock *sk, struct sk_buff *skb, int err,
428extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport, 427extern void ip_local_error(struct sock *sk, int err, __be32 daddr, __be16 dport,
429 u32 info); 428 u32 info);
430 429
431/* sysctl helpers - any sysctl which holds a value that ends up being
432 * fed into the routing cache should use these handlers.
433 */
434int ipv4_doint_and_flush(ctl_table *ctl, int write,
435 void __user *buffer,
436 size_t *lenp, loff_t *ppos);
437int ipv4_doint_and_flush_strategy(ctl_table *table,
438 void __user *oldval, size_t __user *oldlenp,
439 void __user *newval, size_t newlen);
440#ifdef CONFIG_PROC_FS 430#ifdef CONFIG_PROC_FS
441extern int ip_misc_proc_init(void); 431extern int ip_misc_proc_init(void);
442#endif 432#endif
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 062a823d311c..708ff7cb8806 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -21,6 +21,7 @@
21#include <net/dst.h> 21#include <net/dst.h>
22#include <net/flow.h> 22#include <net/flow.h>
23#include <net/netlink.h> 23#include <net/netlink.h>
24#include <net/inetpeer.h>
24 25
25#ifdef CONFIG_IPV6_MULTIPLE_TABLES 26#ifdef CONFIG_IPV6_MULTIPLE_TABLES
26#define FIB6_TABLE_HASHSZ 256 27#define FIB6_TABLE_HASHSZ 256
@@ -109,6 +110,7 @@ struct rt6_info {
109 u32 rt6i_metric; 110 u32 rt6i_metric;
110 111
111 struct inet6_dev *rt6i_idev; 112 struct inet6_dev *rt6i_idev;
113 struct inet_peer *rt6i_peer;
112 114
113#ifdef CONFIG_XFRM 115#ifdef CONFIG_XFRM
114 u32 rt6i_flow_cache_genid; 116 u32 rt6i_flow_cache_genid;
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h
index 278312c95f96..e06e0ca1e91b 100644
--- a/include/net/ip6_route.h
+++ b/include/net/ip6_route.h
@@ -3,7 +3,6 @@
3 3
4#define IP6_RT_PRIO_USER 1024 4#define IP6_RT_PRIO_USER 1024
5#define IP6_RT_PRIO_ADDRCONF 256 5#define IP6_RT_PRIO_ADDRCONF 256
6#define IP6_RT_PRIO_KERN 512
7 6
8struct route_info { 7struct route_info {
9 __u8 type; 8 __u8 type;
@@ -56,6 +55,18 @@ static inline unsigned int rt6_flags2srcprefs(int flags)
56 return (flags >> 3) & 7; 55 return (flags >> 3) & 7;
57} 56}
58 57
58extern void rt6_bind_peer(struct rt6_info *rt,
59 int create);
60
61static inline struct inet_peer *rt6_get_peer(struct rt6_info *rt)
62{
63 if (rt->rt6i_peer)
64 return rt->rt6i_peer;
65
66 rt6_bind_peer(rt, 0);
67 return rt->rt6i_peer;
68}
69
59extern void ip6_route_input(struct sk_buff *skb); 70extern void ip6_route_input(struct sk_buff *skb);
60 71
61extern struct dst_entry * ip6_route_output(struct net *net, 72extern struct dst_entry * ip6_route_output(struct net *net,
diff --git a/include/net/ndisc.h b/include/net/ndisc.h
index 895997bc2ead..e0e594f8e9d9 100644
--- a/include/net/ndisc.h
+++ b/include/net/ndisc.h
@@ -42,9 +42,6 @@ enum {
42#define ND_REACHABLE_TIME (30*HZ) 42#define ND_REACHABLE_TIME (30*HZ)
43#define ND_RETRANS_TIMER HZ 43#define ND_RETRANS_TIMER HZ
44 44
45#define ND_MIN_RANDOM_FACTOR (1/2)
46#define ND_MAX_RANDOM_FACTOR (3/2)
47
48#ifdef __KERNEL__ 45#ifdef __KERNEL__
49 46
50#include <linux/compiler.h> 47#include <linux/compiler.h>
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 55590ab16b3e..4014b623880c 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -96,16 +96,16 @@ struct neighbour {
96 struct neigh_parms *parms; 96 struct neigh_parms *parms;
97 unsigned long confirmed; 97 unsigned long confirmed;
98 unsigned long updated; 98 unsigned long updated;
99 __u8 flags; 99 rwlock_t lock;
100 __u8 nud_state;
101 __u8 type;
102 __u8 dead;
103 atomic_t refcnt; 100 atomic_t refcnt;
104 struct sk_buff_head arp_queue; 101 struct sk_buff_head arp_queue;
105 struct timer_list timer; 102 struct timer_list timer;
106 unsigned long used; 103 unsigned long used;
107 atomic_t probes; 104 atomic_t probes;
108 rwlock_t lock; 105 __u8 flags;
106 __u8 nud_state;
107 __u8 type;
108 __u8 dead;
109 seqlock_t ha_lock; 109 seqlock_t ha_lock;
110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; 110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
111 struct hh_cache *hh; 111 struct hh_cache *hh;
@@ -303,7 +303,7 @@ static inline void neigh_confirm(struct neighbour *neigh)
303 303
304static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb) 304static inline int neigh_event_send(struct neighbour *neigh, struct sk_buff *skb)
305{ 305{
306 unsigned long now = ACCESS_ONCE(jiffies); 306 unsigned long now = jiffies;
307 307
308 if (neigh->used != now) 308 if (neigh->used != now)
309 neigh->used = now; 309 neigh->used = now;
diff --git a/include/net/netlink.h b/include/net/netlink.h
index f3b201d335b3..373f1a900cf4 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -225,13 +225,15 @@ extern int nlmsg_notify(struct sock *sk, struct sk_buff *skb,
225 u32 pid, unsigned int group, int report, 225 u32 pid, unsigned int group, int report,
226 gfp_t flags); 226 gfp_t flags);
227 227
228extern int nla_validate(struct nlattr *head, int len, int maxtype, 228extern int nla_validate(const struct nlattr *head,
229 int len, int maxtype,
229 const struct nla_policy *policy); 230 const struct nla_policy *policy);
230extern int nla_parse(struct nlattr *tb[], int maxtype, 231extern int nla_parse(struct nlattr **tb, int maxtype,
231 struct nlattr *head, int len, 232 const struct nlattr *head, int len,
232 const struct nla_policy *policy); 233 const struct nla_policy *policy);
233extern int nla_policy_len(const struct nla_policy *, int); 234extern int nla_policy_len(const struct nla_policy *, int);
234extern struct nlattr * nla_find(struct nlattr *head, int len, int attrtype); 235extern struct nlattr * nla_find(const struct nlattr *head,
236 int len, int attrtype);
235extern size_t nla_strlcpy(char *dst, const struct nlattr *nla, 237extern size_t nla_strlcpy(char *dst, const struct nlattr *nla,
236 size_t dstsize); 238 size_t dstsize);
237extern int nla_memcpy(void *dest, const struct nlattr *src, int count); 239extern int nla_memcpy(void *dest, const struct nlattr *src, int count);
@@ -346,7 +348,8 @@ static inline int nlmsg_ok(const struct nlmsghdr *nlh, int remaining)
346 * Returns the next netlink message in the message stream and 348 * Returns the next netlink message in the message stream and
347 * decrements remaining by the size of the current message. 349 * decrements remaining by the size of the current message.
348 */ 350 */
349static inline struct nlmsghdr *nlmsg_next(struct nlmsghdr *nlh, int *remaining) 351static inline struct nlmsghdr *
352nlmsg_next(const struct nlmsghdr *nlh, int *remaining)
350{ 353{
351 int totlen = NLMSG_ALIGN(nlh->nlmsg_len); 354 int totlen = NLMSG_ALIGN(nlh->nlmsg_len);
352 355
@@ -384,7 +387,7 @@ static inline int nlmsg_parse(const struct nlmsghdr *nlh, int hdrlen,
384 * 387 *
385 * Returns the first attribute which matches the specified type. 388 * Returns the first attribute which matches the specified type.
386 */ 389 */
387static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh, 390static inline struct nlattr *nlmsg_find_attr(const struct nlmsghdr *nlh,
388 int hdrlen, int attrtype) 391 int hdrlen, int attrtype)
389{ 392{
390 return nla_find(nlmsg_attrdata(nlh, hdrlen), 393 return nla_find(nlmsg_attrdata(nlh, hdrlen),
@@ -398,7 +401,8 @@ static inline struct nlattr *nlmsg_find_attr(struct nlmsghdr *nlh,
398 * @maxtype: maximum attribute type to be expected 401 * @maxtype: maximum attribute type to be expected
399 * @policy: validation policy 402 * @policy: validation policy
400 */ 403 */
401static inline int nlmsg_validate(struct nlmsghdr *nlh, int hdrlen, int maxtype, 404static inline int nlmsg_validate(const struct nlmsghdr *nlh,
405 int hdrlen, int maxtype,
402 const struct nla_policy *policy) 406 const struct nla_policy *policy)
403{ 407{
404 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen)) 408 if (nlh->nlmsg_len < nlmsg_msg_size(hdrlen))
@@ -727,7 +731,8 @@ static inline struct nlattr *nla_next(const struct nlattr *nla, int *remaining)
727 * 731 *
728 * Returns the first attribute which matches the specified type. 732 * Returns the first attribute which matches the specified type.
729 */ 733 */
730static inline struct nlattr *nla_find_nested(struct nlattr *nla, int attrtype) 734static inline struct nlattr *
735nla_find_nested(const struct nlattr *nla, int attrtype)
731{ 736{
732 return nla_find(nla_data(nla), nla_len(nla), attrtype); 737 return nla_find(nla_data(nla), nla_len(nla), attrtype);
733} 738}
@@ -1032,7 +1037,7 @@ static inline void nla_nest_cancel(struct sk_buff *skb, struct nlattr *start)
1032 * 1037 *
1033 * Returns 0 on success or a negative error code. 1038 * Returns 0 on success or a negative error code.
1034 */ 1039 */
1035static inline int nla_validate_nested(struct nlattr *start, int maxtype, 1040static inline int nla_validate_nested(const struct nlattr *start, int maxtype,
1036 const struct nla_policy *policy) 1041 const struct nla_policy *policy)
1037{ 1042{
1038 return nla_validate(nla_data(start), nla_len(start), maxtype, policy); 1043 return nla_validate(nla_data(start), nla_len(start), maxtype, policy);
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h
index 81a31c0db3e7..3419bf5cd154 100644
--- a/include/net/netns/generic.h
+++ b/include/net/netns/generic.h
@@ -30,7 +30,7 @@ struct net_generic {
30 void *ptr[0]; 30 void *ptr[0];
31}; 31};
32 32
33static inline void *net_generic(struct net *net, int id) 33static inline void *net_generic(const struct net *net, int id)
34{ 34{
35 struct net_generic *ng; 35 struct net_generic *ng;
36 void *ptr; 36 void *ptr;
diff --git a/include/net/route.h b/include/net/route.h
index 7e5e73bfa4de..27002362944a 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -55,8 +55,6 @@ struct rtable {
55 /* Cache lookup keys */ 55 /* Cache lookup keys */
56 struct flowi fl; 56 struct flowi fl;
57 57
58 struct in_device *idev;
59
60 int rt_genid; 58 int rt_genid;
61 unsigned rt_flags; 59 unsigned rt_flags;
62 __u16 rt_type; 60 __u16 rt_type;
@@ -73,6 +71,16 @@ struct rtable {
73 struct inet_peer *peer; /* long-living peer info */ 71 struct inet_peer *peer; /* long-living peer info */
74}; 72};
75 73
74static inline bool rt_is_input_route(struct rtable *rt)
75{
76 return rt->fl.iif != 0;
77}
78
79static inline bool rt_is_output_route(struct rtable *rt)
80{
81 return rt->fl.iif == 0;
82}
83
76struct ip_rt_acct { 84struct ip_rt_acct {
77 __u32 o_bytes; 85 __u32 o_bytes;
78 __u32 o_packets; 86 __u32 o_packets;
@@ -161,14 +169,12 @@ static inline int ip_route_connect(struct rtable **rp, __be32 dst,
161{ 169{
162 struct flowi fl = { .oif = oif, 170 struct flowi fl = { .oif = oif,
163 .mark = sk->sk_mark, 171 .mark = sk->sk_mark,
164 .nl_u = { .ip4_u = { .daddr = dst, 172 .fl4_dst = dst,
165 .saddr = src, 173 .fl4_src = src,
166 .tos = tos } }, 174 .fl4_tos = tos,
167 .proto = protocol, 175 .proto = protocol,
168 .uli_u = { .ports = 176 .fl_ip_sport = sport,
169 { .sport = sport, 177 .fl_ip_dport = dport };
170 .dport = dport } } };
171
172 int err; 178 int err;
173 struct net *net = sock_net(sk); 179 struct net *net = sock_net(sk);
174 180
@@ -225,4 +231,15 @@ static inline int inet_iif(const struct sk_buff *skb)
225 return skb_rtable(skb)->rt_iif; 231 return skb_rtable(skb)->rt_iif;
226} 232}
227 233
234extern int sysctl_ip_default_ttl;
235
236static inline int ip4_dst_hoplimit(const struct dst_entry *dst)
237{
238 int hoplimit = dst_metric_raw(dst, RTAX_HOPLIMIT);
239
240 if (hoplimit == 0)
241 hoplimit = sysctl_ip_default_ttl;
242 return hoplimit;
243}
244
228#endif /* _ROUTE_H */ 245#endif /* _ROUTE_H */
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index e013c68bfb00..4093ca78cf60 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -83,6 +83,41 @@ extern void __rtnl_link_unregister(struct rtnl_link_ops *ops);
83extern int rtnl_link_register(struct rtnl_link_ops *ops); 83extern int rtnl_link_register(struct rtnl_link_ops *ops);
84extern void rtnl_link_unregister(struct rtnl_link_ops *ops); 84extern void rtnl_link_unregister(struct rtnl_link_ops *ops);
85 85
86/**
87 * struct rtnl_af_ops - rtnetlink address family operations
88 *
89 * @list: Used internally
90 * @family: Address family
91 * @fill_link_af: Function to fill IFLA_AF_SPEC with address family
92 * specific netlink attributes.
93 * @get_link_af_size: Function to calculate size of address family specific
94 * netlink attributes exlusive the container attribute.
95 * @validate_link_af: Validate a IFLA_AF_SPEC attribute, must check attr
96 * for invalid configuration settings.
97 * @set_link_af: Function to parse a IFLA_AF_SPEC attribute and modify
98 * net_device accordingly.
99 */
100struct rtnl_af_ops {
101 struct list_head list;
102 int family;
103
104 int (*fill_link_af)(struct sk_buff *skb,
105 const struct net_device *dev);
106 size_t (*get_link_af_size)(const struct net_device *dev);
107
108 int (*validate_link_af)(const struct net_device *dev,
109 const struct nlattr *attr);
110 int (*set_link_af)(struct net_device *dev,
111 const struct nlattr *attr);
112};
113
114extern int __rtnl_af_register(struct rtnl_af_ops *ops);
115extern void __rtnl_af_unregister(struct rtnl_af_ops *ops);
116
117extern int rtnl_af_register(struct rtnl_af_ops *ops);
118extern void rtnl_af_unregister(struct rtnl_af_ops *ops);
119
120
86extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); 121extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]);
87extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, 122extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net,
88 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); 123 char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]);
diff --git a/include/net/scm.h b/include/net/scm.h
index 31656506d967..745460fa2f02 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -10,11 +10,12 @@
10/* Well, we should have at least one descriptor open 10/* Well, we should have at least one descriptor open
11 * to accept passed FDs 8) 11 * to accept passed FDs 8)
12 */ 12 */
13#define SCM_MAX_FD 255 13#define SCM_MAX_FD 253
14 14
15struct scm_fp_list { 15struct scm_fp_list {
16 struct list_head list; 16 struct list_head list;
17 int count; 17 short count;
18 short max;
18 struct file *fp[SCM_MAX_FD]; 19 struct file *fp[SCM_MAX_FD];
19}; 20};
20 21
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 2c55a7ea20af..c01dc99def07 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -111,9 +111,6 @@ typedef enum {
111 SCTP_CMD_LAST 111 SCTP_CMD_LAST
112} sctp_verb_t; 112} sctp_verb_t;
113 113
114#define SCTP_CMD_MAX (SCTP_CMD_LAST - 1)
115#define SCTP_CMD_NUM_VERBS (SCTP_CMD_MAX + 1)
116
117/* How many commands can you put in an sctp_cmd_seq_t? 114/* How many commands can you put in an sctp_cmd_seq_t?
118 * This is a rather arbitrary number, ideally derived from a careful 115 * This is a rather arbitrary number, ideally derived from a careful
119 * analysis of the state functions, but in reality just taken from 116 * analysis of the state functions, but in reality just taken from
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h
index 63908840eef0..c70d8ccc55cb 100644
--- a/include/net/sctp/constants.h
+++ b/include/net/sctp/constants.h
@@ -61,7 +61,6 @@ enum { SCTP_DEFAULT_INSTREAMS = SCTP_MAX_STREAM };
61 * symbols. CIDs are dense through SCTP_CID_BASE_MAX. 61 * symbols. CIDs are dense through SCTP_CID_BASE_MAX.
62 */ 62 */
63#define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE 63#define SCTP_CID_BASE_MAX SCTP_CID_SHUTDOWN_COMPLETE
64#define SCTP_CID_MAX SCTP_CID_ASCONF_ACK
65 64
66#define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1) 65#define SCTP_NUM_BASE_CHUNK_TYPES (SCTP_CID_BASE_MAX + 1)
67 66
@@ -86,9 +85,6 @@ typedef enum {
86 85
87} sctp_event_t; 86} sctp_event_t;
88 87
89#define SCTP_EVENT_T_MAX SCTP_EVENT_T_PRIMITIVE
90#define SCTP_EVENT_T_NUM (SCTP_EVENT_T_MAX + 1)
91
92/* As a convenience for the state machine, we append SCTP_EVENT_* and 88/* As a convenience for the state machine, we append SCTP_EVENT_* and
93 * SCTP_ULP_* to the list of possible chunks. 89 * SCTP_ULP_* to the list of possible chunks.
94 */ 90 */
@@ -162,9 +158,6 @@ SCTP_SUBTYPE_CONSTRUCTOR(PRIMITIVE, sctp_event_primitive_t, primitive)
162 - (unsigned long)(c->chunk_hdr)\ 158 - (unsigned long)(c->chunk_hdr)\
163 - sizeof(sctp_data_chunk_t))) 159 - sizeof(sctp_data_chunk_t)))
164 160
165#define SCTP_MAX_ERROR_CAUSE SCTP_ERROR_NONEXIST_IP
166#define SCTP_NUM_ERROR_CAUSE 10
167
168/* Internal error codes */ 161/* Internal error codes */
169typedef enum { 162typedef enum {
170 163
@@ -266,7 +259,6 @@ enum { SCTP_ARBITRARY_COOKIE_ECHO_LEN = 200 };
266#define SCTP_TSN_MAP_INITIAL BITS_PER_LONG 259#define SCTP_TSN_MAP_INITIAL BITS_PER_LONG
267#define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL 260#define SCTP_TSN_MAP_INCREMENT SCTP_TSN_MAP_INITIAL
268#define SCTP_TSN_MAP_SIZE 4096 261#define SCTP_TSN_MAP_SIZE 4096
269#define SCTP_TSN_MAX_GAP 65535
270 262
271/* We will not record more than this many duplicate TSNs between two 263/* We will not record more than this many duplicate TSNs between two
272 * SACKs. The minimum PMTU is 576. Remove all the headers and there 264 * SACKs. The minimum PMTU is 576. Remove all the headers and there
@@ -301,9 +293,6 @@ enum { SCTP_MAX_GABS = 16 };
301 293
302#define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */ 294#define SCTP_CLOCK_GRANULARITY 1 /* 1 jiffy */
303 295
304#define SCTP_DEF_MAX_INIT 6
305#define SCTP_DEF_MAX_SEND 10
306
307#define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */ 296#define SCTP_DEFAULT_COOKIE_LIFE (60 * 1000) /* 60 seconds */
308 297
309#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ 298#define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */
@@ -317,9 +306,6 @@ enum { SCTP_MAX_GABS = 16 };
317 */ 306 */
318#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */ 307#define SCTP_DEFAULT_MINSEGMENT 512 /* MTU size ... if no mtu disc */
319#define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */ 308#define SCTP_HOW_MANY_SECRETS 2 /* How many secrets I keep */
320#define SCTP_HOW_LONG_COOKIE_LIVE 3600 /* How many seconds the current
321 * secret will live?
322 */
323#define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */ 309#define SCTP_SECRET_SIZE 32 /* Number of octets in a 256 bits. */
324 310
325#define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */ 311#define SCTP_SIGNATURE_SIZE 20 /* size of a SLA-1 signature */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 69fef4fb79c0..cc9185ca8fd1 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -261,8 +261,6 @@ extern struct sctp_globals {
261#define sctp_assoc_hashsize (sctp_globals.assoc_hashsize) 261#define sctp_assoc_hashsize (sctp_globals.assoc_hashsize)
262#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable) 262#define sctp_assoc_hashtable (sctp_globals.assoc_hashtable)
263#define sctp_port_hashsize (sctp_globals.port_hashsize) 263#define sctp_port_hashsize (sctp_globals.port_hashsize)
264#define sctp_port_rover (sctp_globals.port_rover)
265#define sctp_port_alloc_lock (sctp_globals.port_alloc_lock)
266#define sctp_port_hashtable (sctp_globals.port_hashtable) 264#define sctp_port_hashtable (sctp_globals.port_hashtable)
267#define sctp_local_addr_list (sctp_globals.local_addr_list) 265#define sctp_local_addr_list (sctp_globals.local_addr_list)
268#define sctp_local_addr_lock (sctp_globals.addr_list_lock) 266#define sctp_local_addr_lock (sctp_globals.addr_list_lock)
diff --git a/include/net/snmp.h b/include/net/snmp.h
index a0e61806d480..762e2abce889 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -60,9 +60,7 @@ struct ipstats_mib {
60}; 60};
61 61
62/* ICMP */ 62/* ICMP */
63#define ICMP_MIB_DUMMY __ICMP_MIB_MAX 63#define ICMP_MIB_MAX __ICMP_MIB_MAX
64#define ICMP_MIB_MAX (__ICMP_MIB_MAX + 1)
65
66struct icmp_mib { 64struct icmp_mib {
67 unsigned long mibs[ICMP_MIB_MAX]; 65 unsigned long mibs[ICMP_MIB_MAX];
68}; 66};
diff --git a/include/net/sock.h b/include/net/sock.h
index c7a736228ca2..82e86034702f 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -57,7 +57,7 @@
57#include <linux/rculist_nulls.h> 57#include <linux/rculist_nulls.h>
58#include <linux/poll.h> 58#include <linux/poll.h>
59 59
60#include <asm/atomic.h> 60#include <linux/atomic.h>
61#include <net/dst.h> 61#include <net/dst.h>
62#include <net/checksum.h> 62#include <net/checksum.h>
63 63
@@ -105,10 +105,8 @@ struct net;
105 105
106/** 106/**
107 * struct sock_common - minimal network layer representation of sockets 107 * struct sock_common - minimal network layer representation of sockets
108 * @skc_node: main hash linkage for various protocol lookup tables 108 * @skc_daddr: Foreign IPv4 addr
109 * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol 109 * @skc_rcv_saddr: Bound local IPv4 addr
110 * @skc_refcnt: reference count
111 * @skc_tx_queue_mapping: tx queue number for this connection
112 * @skc_hash: hash value used with various protocol lookup tables 110 * @skc_hash: hash value used with various protocol lookup tables
113 * @skc_u16hashes: two u16 hash values used by UDP lookup tables 111 * @skc_u16hashes: two u16 hash values used by UDP lookup tables
114 * @skc_family: network address family 112 * @skc_family: network address family
@@ -119,20 +117,20 @@ struct net;
119 * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol 117 * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol
120 * @skc_prot: protocol handlers inside a network family 118 * @skc_prot: protocol handlers inside a network family
121 * @skc_net: reference to the network namespace of this socket 119 * @skc_net: reference to the network namespace of this socket
120 * @skc_node: main hash linkage for various protocol lookup tables
121 * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol
122 * @skc_tx_queue_mapping: tx queue number for this connection
123 * @skc_refcnt: reference count
122 * 124 *
123 * This is the minimal network layer representation of sockets, the header 125 * This is the minimal network layer representation of sockets, the header
124 * for struct sock and struct inet_timewait_sock. 126 * for struct sock and struct inet_timewait_sock.
125 */ 127 */
126struct sock_common { 128struct sock_common {
127 /* 129 /* skc_daddr and skc_rcv_saddr must be grouped :
128 * first fields are not copied in sock_copy() 130 * cf INET_MATCH() and INET_TW_MATCH()
129 */ 131 */
130 union { 132 __be32 skc_daddr;
131 struct hlist_node skc_node; 133 __be32 skc_rcv_saddr;
132 struct hlist_nulls_node skc_nulls_node;
133 };
134 atomic_t skc_refcnt;
135 int skc_tx_queue_mapping;
136 134
137 union { 135 union {
138 unsigned int skc_hash; 136 unsigned int skc_hash;
@@ -150,6 +148,18 @@ struct sock_common {
150#ifdef CONFIG_NET_NS 148#ifdef CONFIG_NET_NS
151 struct net *skc_net; 149 struct net *skc_net;
152#endif 150#endif
151 /*
152 * fields between dontcopy_begin/dontcopy_end
153 * are not copied in sock_copy()
154 */
155 int skc_dontcopy_begin[0];
156 union {
157 struct hlist_node skc_node;
158 struct hlist_nulls_node skc_nulls_node;
159 };
160 int skc_tx_queue_mapping;
161 atomic_t skc_refcnt;
162 int skc_dontcopy_end[0];
153}; 163};
154 164
155/** 165/**
@@ -232,7 +242,8 @@ struct sock {
232#define sk_refcnt __sk_common.skc_refcnt 242#define sk_refcnt __sk_common.skc_refcnt
233#define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping 243#define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping
234 244
235#define sk_copy_start __sk_common.skc_hash 245#define sk_dontcopy_begin __sk_common.skc_dontcopy_begin
246#define sk_dontcopy_end __sk_common.skc_dontcopy_end
236#define sk_hash __sk_common.skc_hash 247#define sk_hash __sk_common.skc_hash
237#define sk_family __sk_common.skc_family 248#define sk_family __sk_common.skc_family
238#define sk_state __sk_common.skc_state 249#define sk_state __sk_common.skc_state
@@ -241,59 +252,67 @@ struct sock {
241#define sk_bind_node __sk_common.skc_bind_node 252#define sk_bind_node __sk_common.skc_bind_node
242#define sk_prot __sk_common.skc_prot 253#define sk_prot __sk_common.skc_prot
243#define sk_net __sk_common.skc_net 254#define sk_net __sk_common.skc_net
244 kmemcheck_bitfield_begin(flags);
245 unsigned int sk_shutdown : 2,
246 sk_no_check : 2,
247 sk_userlocks : 4,
248 sk_protocol : 8,
249 sk_type : 16;
250 kmemcheck_bitfield_end(flags);
251 int sk_rcvbuf;
252 socket_lock_t sk_lock; 255 socket_lock_t sk_lock;
256 struct sk_buff_head sk_receive_queue;
253 /* 257 /*
254 * The backlog queue is special, it is always used with 258 * The backlog queue is special, it is always used with
255 * the per-socket spinlock held and requires low latency 259 * the per-socket spinlock held and requires low latency
256 * access. Therefore we special case it's implementation. 260 * access. Therefore we special case it's implementation.
261 * Note : rmem_alloc is in this structure to fill a hole
262 * on 64bit arches, not because its logically part of
263 * backlog.
257 */ 264 */
258 struct { 265 struct {
259 struct sk_buff *head; 266 atomic_t rmem_alloc;
260 struct sk_buff *tail; 267 int len;
261 int len; 268 struct sk_buff *head;
269 struct sk_buff *tail;
262 } sk_backlog; 270 } sk_backlog;
271#define sk_rmem_alloc sk_backlog.rmem_alloc
272 int sk_forward_alloc;
273#ifdef CONFIG_RPS
274 __u32 sk_rxhash;
275#endif
276 atomic_t sk_drops;
277 int sk_rcvbuf;
278
279 struct sk_filter __rcu *sk_filter;
263 struct socket_wq *sk_wq; 280 struct socket_wq *sk_wq;
264 struct dst_entry *sk_dst_cache; 281
282#ifdef CONFIG_NET_DMA
283 struct sk_buff_head sk_async_wait_queue;
284#endif
285
265#ifdef CONFIG_XFRM 286#ifdef CONFIG_XFRM
266 struct xfrm_policy *sk_policy[2]; 287 struct xfrm_policy *sk_policy[2];
267#endif 288#endif
289 unsigned long sk_flags;
290 struct dst_entry *sk_dst_cache;
268 spinlock_t sk_dst_lock; 291 spinlock_t sk_dst_lock;
269 atomic_t sk_rmem_alloc;
270 atomic_t sk_wmem_alloc; 292 atomic_t sk_wmem_alloc;
271 atomic_t sk_omem_alloc; 293 atomic_t sk_omem_alloc;
272 int sk_sndbuf; 294 int sk_sndbuf;
273 struct sk_buff_head sk_receive_queue;
274 struct sk_buff_head sk_write_queue; 295 struct sk_buff_head sk_write_queue;
275#ifdef CONFIG_NET_DMA 296 kmemcheck_bitfield_begin(flags);
276 struct sk_buff_head sk_async_wait_queue; 297 unsigned int sk_shutdown : 2,
277#endif 298 sk_no_check : 2,
299 sk_userlocks : 4,
300 sk_protocol : 8,
301 sk_type : 16;
302 kmemcheck_bitfield_end(flags);
278 int sk_wmem_queued; 303 int sk_wmem_queued;
279 int sk_forward_alloc;
280 gfp_t sk_allocation; 304 gfp_t sk_allocation;
281 int sk_route_caps; 305 int sk_route_caps;
282 int sk_route_nocaps; 306 int sk_route_nocaps;
283 int sk_gso_type; 307 int sk_gso_type;
284 unsigned int sk_gso_max_size; 308 unsigned int sk_gso_max_size;
285 int sk_rcvlowat; 309 int sk_rcvlowat;
286#ifdef CONFIG_RPS
287 __u32 sk_rxhash;
288#endif
289 unsigned long sk_flags;
290 unsigned long sk_lingertime; 310 unsigned long sk_lingertime;
291 struct sk_buff_head sk_error_queue; 311 struct sk_buff_head sk_error_queue;
292 struct proto *sk_prot_creator; 312 struct proto *sk_prot_creator;
293 rwlock_t sk_callback_lock; 313 rwlock_t sk_callback_lock;
294 int sk_err, 314 int sk_err,
295 sk_err_soft; 315 sk_err_soft;
296 atomic_t sk_drops;
297 unsigned short sk_ack_backlog; 316 unsigned short sk_ack_backlog;
298 unsigned short sk_max_ack_backlog; 317 unsigned short sk_max_ack_backlog;
299 __u32 sk_priority; 318 __u32 sk_priority;
@@ -301,7 +320,6 @@ struct sock {
301 const struct cred *sk_peer_cred; 320 const struct cred *sk_peer_cred;
302 long sk_rcvtimeo; 321 long sk_rcvtimeo;
303 long sk_sndtimeo; 322 long sk_sndtimeo;
304 struct sk_filter __rcu *sk_filter;
305 void *sk_protinfo; 323 void *sk_protinfo;
306 struct timer_list sk_timer; 324 struct timer_list sk_timer;
307 ktime_t sk_stamp; 325 ktime_t sk_stamp;
@@ -509,9 +527,6 @@ static __inline__ void sk_add_bind_node(struct sock *sk,
509#define sk_nulls_for_each_from(__sk, node) \ 527#define sk_nulls_for_each_from(__sk, node) \
510 if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \ 528 if (__sk && ({ node = &(__sk)->sk_nulls_node; 1; })) \
511 hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node) 529 hlist_nulls_for_each_entry_from(__sk, node, sk_nulls_node)
512#define sk_for_each_continue(__sk, node) \
513 if (__sk && ({ node = &(__sk)->sk_node; 1; })) \
514 hlist_for_each_entry_continue(__sk, node, sk_node)
515#define sk_for_each_safe(__sk, node, tmp, list) \ 530#define sk_for_each_safe(__sk, node, tmp, list) \
516 hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node) 531 hlist_for_each_entry_safe(__sk, node, tmp, list, sk_node)
517#define sk_for_each_bound(__sk, node, list) \ 532#define sk_for_each_bound(__sk, node, list) \
@@ -762,7 +777,7 @@ struct proto {
762 777
763 /* Memory pressure */ 778 /* Memory pressure */
764 void (*enter_memory_pressure)(struct sock *sk); 779 void (*enter_memory_pressure)(struct sock *sk);
765 atomic_t *memory_allocated; /* Current allocated memory. */ 780 atomic_long_t *memory_allocated; /* Current allocated memory. */
766 struct percpu_counter *sockets_allocated; /* Current number of sockets. */ 781 struct percpu_counter *sockets_allocated; /* Current number of sockets. */
767 /* 782 /*
768 * Pressure flag: try to collapse. 783 * Pressure flag: try to collapse.
@@ -771,7 +786,7 @@ struct proto {
771 * is strict, actions are advisory and have some latency. 786 * is strict, actions are advisory and have some latency.
772 */ 787 */
773 int *memory_pressure; 788 int *memory_pressure;
774 int *sysctl_mem; 789 long *sysctl_mem;
775 int *sysctl_wmem; 790 int *sysctl_wmem;
776 int *sysctl_rmem; 791 int *sysctl_rmem;
777 int max_header; 792 int max_header;
@@ -1155,6 +1170,8 @@ extern void sk_common_release(struct sock *sk);
1155/* Initialise core socket variables */ 1170/* Initialise core socket variables */
1156extern void sock_init_data(struct socket *sock, struct sock *sk); 1171extern void sock_init_data(struct socket *sock, struct sock *sk);
1157 1172
1173extern void sk_filter_release_rcu(struct rcu_head *rcu);
1174
1158/** 1175/**
1159 * sk_filter_release - release a socket filter 1176 * sk_filter_release - release a socket filter
1160 * @fp: filter to remove 1177 * @fp: filter to remove
@@ -1165,7 +1182,7 @@ extern void sock_init_data(struct socket *sock, struct sock *sk);
1165static inline void sk_filter_release(struct sk_filter *fp) 1182static inline void sk_filter_release(struct sk_filter *fp)
1166{ 1183{
1167 if (atomic_dec_and_test(&fp->refcnt)) 1184 if (atomic_dec_and_test(&fp->refcnt))
1168 kfree(fp); 1185 call_rcu_bh(&fp->rcu, sk_filter_release_rcu);
1169} 1186}
1170 1187
1171static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp) 1188static inline void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 4fee0424af7e..3f227baee4be 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -100,12 +100,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
100#define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a 100#define TCP_SYNACK_RETRIES 5 /* number of times to retry passive opening a
101 * connection: ~180sec is RFC minimum */ 101 * connection: ~180sec is RFC minimum */
102 102
103
104#define TCP_ORPHAN_RETRIES 7 /* number of times to retry on an orphaned
105 * socket. 7 is ~50sec-16min.
106 */
107
108
109#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT 103#define TCP_TIMEWAIT_LEN (60*HZ) /* how long to wait to destroy TIME-WAIT
110 * state, about 60 seconds */ 104 * state, about 60 seconds */
111#define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN 105#define TCP_FIN_TIMEOUT TCP_TIMEWAIT_LEN
@@ -224,7 +218,7 @@ extern int sysctl_tcp_fack;
224extern int sysctl_tcp_reordering; 218extern int sysctl_tcp_reordering;
225extern int sysctl_tcp_ecn; 219extern int sysctl_tcp_ecn;
226extern int sysctl_tcp_dsack; 220extern int sysctl_tcp_dsack;
227extern int sysctl_tcp_mem[3]; 221extern long sysctl_tcp_mem[3];
228extern int sysctl_tcp_wmem[3]; 222extern int sysctl_tcp_wmem[3];
229extern int sysctl_tcp_rmem[3]; 223extern int sysctl_tcp_rmem[3];
230extern int sysctl_tcp_app_win; 224extern int sysctl_tcp_app_win;
@@ -247,7 +241,7 @@ extern int sysctl_tcp_cookie_size;
247extern int sysctl_tcp_thin_linear_timeouts; 241extern int sysctl_tcp_thin_linear_timeouts;
248extern int sysctl_tcp_thin_dupack; 242extern int sysctl_tcp_thin_dupack;
249 243
250extern atomic_t tcp_memory_allocated; 244extern atomic_long_t tcp_memory_allocated;
251extern struct percpu_counter tcp_sockets_allocated; 245extern struct percpu_counter tcp_sockets_allocated;
252extern int tcp_memory_pressure; 246extern int tcp_memory_pressure;
253 247
@@ -280,7 +274,7 @@ static inline bool tcp_too_many_orphans(struct sock *sk, int shift)
280 } 274 }
281 275
282 if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF && 276 if (sk->sk_wmem_queued > SOCK_MIN_SNDBUF &&
283 atomic_read(&tcp_memory_allocated) > sysctl_tcp_mem[2]) 277 atomic_long_read(&tcp_memory_allocated) > sysctl_tcp_mem[2])
284 return true; 278 return true;
285 return false; 279 return false;
286} 280}
@@ -312,7 +306,8 @@ extern void tcp_shutdown (struct sock *sk, int how);
312 306
313extern int tcp_v4_rcv(struct sk_buff *skb); 307extern int tcp_v4_rcv(struct sk_buff *skb);
314 308
315extern int tcp_v4_remember_stamp(struct sock *sk); 309extern struct inet_peer *tcp_v4_get_peer(struct sock *sk, bool *release_it);
310extern void *tcp_v4_tw_get_peer(struct sock *sk);
316extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); 311extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw);
317extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 312extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
318 size_t size); 313 size_t size);
diff --git a/include/net/timewait_sock.h b/include/net/timewait_sock.h
index 97c3b14da55d..053b3cf2c66a 100644
--- a/include/net/timewait_sock.h
+++ b/include/net/timewait_sock.h
@@ -21,6 +21,7 @@ struct timewait_sock_ops {
21 int (*twsk_unique)(struct sock *sk, 21 int (*twsk_unique)(struct sock *sk,
22 struct sock *sktw, void *twp); 22 struct sock *sktw, void *twp);
23 void (*twsk_destructor)(struct sock *sk); 23 void (*twsk_destructor)(struct sock *sk);
24 void *(*twsk_getpeer)(struct sock *sk);
24}; 25};
25 26
26static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp) 27static inline int twsk_unique(struct sock *sk, struct sock *sktw, void *twp)
@@ -39,4 +40,11 @@ static inline void twsk_destructor(struct sock *sk)
39 sk->sk_prot->twsk_prot->twsk_destructor(sk); 40 sk->sk_prot->twsk_prot->twsk_destructor(sk);
40} 41}
41 42
43static inline void *twsk_getpeer(struct sock *sk)
44{
45 if (sk->sk_prot->twsk_prot->twsk_getpeer)
46 return sk->sk_prot->twsk_prot->twsk_getpeer(sk);
47 return NULL;
48}
49
42#endif /* _TIMEWAIT_SOCK_H */ 50#endif /* _TIMEWAIT_SOCK_H */
diff --git a/include/net/tipc/tipc.h b/include/net/tipc/tipc.h
deleted file mode 100644
index 1e0645e1eed2..000000000000
--- a/include/net/tipc/tipc.h
+++ /dev/null
@@ -1,186 +0,0 @@
1/*
2 * include/net/tipc/tipc.h: Main include file for TIPC users
3 *
4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005,2010 Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _NET_TIPC_H_
38#define _NET_TIPC_H_
39
40#ifdef __KERNEL__
41
42#include <linux/tipc.h>
43#include <linux/skbuff.h>
44
45/*
46 * Native API
47 */
48
49/*
50 * TIPC operating mode routines
51 */
52
53#define TIPC_NOT_RUNNING 0
54#define TIPC_NODE_MODE 1
55#define TIPC_NET_MODE 2
56
57typedef void (*tipc_mode_event)(void *usr_handle, int mode, u32 addr);
58
59int tipc_attach(unsigned int *userref, tipc_mode_event, void *usr_handle);
60
61void tipc_detach(unsigned int userref);
62
63/*
64 * TIPC port manipulation routines
65 */
66
67typedef void (*tipc_msg_err_event) (void *usr_handle,
68 u32 portref,
69 struct sk_buff **buf,
70 unsigned char const *data,
71 unsigned int size,
72 int reason,
73 struct tipc_portid const *attmpt_destid);
74
75typedef void (*tipc_named_msg_err_event) (void *usr_handle,
76 u32 portref,
77 struct sk_buff **buf,
78 unsigned char const *data,
79 unsigned int size,
80 int reason,
81 struct tipc_name_seq const *attmpt_dest);
82
83typedef void (*tipc_conn_shutdown_event) (void *usr_handle,
84 u32 portref,
85 struct sk_buff **buf,
86 unsigned char const *data,
87 unsigned int size,
88 int reason);
89
90typedef void (*tipc_msg_event) (void *usr_handle,
91 u32 portref,
92 struct sk_buff **buf,
93 unsigned char const *data,
94 unsigned int size,
95 unsigned int importance,
96 struct tipc_portid const *origin);
97
98typedef void (*tipc_named_msg_event) (void *usr_handle,
99 u32 portref,
100 struct sk_buff **buf,
101 unsigned char const *data,
102 unsigned int size,
103 unsigned int importance,
104 struct tipc_portid const *orig,
105 struct tipc_name_seq const *dest);
106
107typedef void (*tipc_conn_msg_event) (void *usr_handle,
108 u32 portref,
109 struct sk_buff **buf,
110 unsigned char const *data,
111 unsigned int size);
112
113typedef void (*tipc_continue_event) (void *usr_handle,
114 u32 portref);
115
116int tipc_createport(unsigned int tipc_user,
117 void *usr_handle,
118 unsigned int importance,
119 tipc_msg_err_event error_cb,
120 tipc_named_msg_err_event named_error_cb,
121 tipc_conn_shutdown_event conn_error_cb,
122 tipc_msg_event message_cb,
123 tipc_named_msg_event named_message_cb,
124 tipc_conn_msg_event conn_message_cb,
125 tipc_continue_event continue_event_cb,
126 u32 *portref);
127
128int tipc_deleteport(u32 portref);
129
130int tipc_ownidentity(u32 portref, struct tipc_portid *port);
131
132int tipc_portimportance(u32 portref, unsigned int *importance);
133int tipc_set_portimportance(u32 portref, unsigned int importance);
134
135int tipc_portunreliable(u32 portref, unsigned int *isunreliable);
136int tipc_set_portunreliable(u32 portref, unsigned int isunreliable);
137
138int tipc_portunreturnable(u32 portref, unsigned int *isunreturnable);
139int tipc_set_portunreturnable(u32 portref, unsigned int isunreturnable);
140
141int tipc_publish(u32 portref, unsigned int scope,
142 struct tipc_name_seq const *name_seq);
143int tipc_withdraw(u32 portref, unsigned int scope,
144 struct tipc_name_seq const *name_seq);
145
146int tipc_connect2port(u32 portref, struct tipc_portid const *port);
147
148int tipc_disconnect(u32 portref);
149
150int tipc_shutdown(u32 ref);
151
152/*
153 * TIPC messaging routines
154 */
155
156#define TIPC_PORT_IMPORTANCE 100 /* send using current port setting */
157
158
159int tipc_send(u32 portref,
160 unsigned int num_sect,
161 struct iovec const *msg_sect);
162
163int tipc_send2name(u32 portref,
164 struct tipc_name const *name,
165 u32 domain,
166 unsigned int num_sect,
167 struct iovec const *msg_sect);
168
169int tipc_send2port(u32 portref,
170 struct tipc_portid const *dest,
171 unsigned int num_sect,
172 struct iovec const *msg_sect);
173
174int tipc_send_buf2port(u32 portref,
175 struct tipc_portid const *dest,
176 struct sk_buff *buf,
177 unsigned int dsz);
178
179int tipc_multicast(u32 portref,
180 struct tipc_name_seq const *seq,
181 u32 domain, /* currently unused */
182 unsigned int section_count,
183 struct iovec const *msg);
184#endif
185
186#endif
diff --git a/include/net/tipc/tipc_bearer.h b/include/net/tipc/tipc_bearer.h
deleted file mode 100644
index ee2f304e4919..000000000000
--- a/include/net/tipc/tipc_bearer.h
+++ /dev/null
@@ -1,138 +0,0 @@
1/*
2 * include/net/tipc/tipc_bearer.h: Include file for privileged access to TIPC bearers
3 *
4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _NET_TIPC_BEARER_H_
38#define _NET_TIPC_BEARER_H_
39
40#ifdef __KERNEL__
41
42#include <linux/tipc_config.h>
43#include <linux/skbuff.h>
44#include <linux/spinlock.h>
45
46/*
47 * Identifiers of supported TIPC media types
48 */
49
50#define TIPC_MEDIA_TYPE_ETH 1
51
52/*
53 * Destination address structure used by TIPC bearers when sending messages
54 *
55 * IMPORTANT: The fields of this structure MUST be stored using the specified
56 * byte order indicated below, as the structure is exchanged between nodes
57 * as part of a link setup process.
58 */
59
60struct tipc_media_addr {
61 __be32 type; /* bearer type (network byte order) */
62 union {
63 __u8 eth_addr[6]; /* 48 bit Ethernet addr (byte array) */
64#if 0
65 /* Prototypes for other possible bearer types */
66
67 struct {
68 __u16 sin_family;
69 __u16 sin_port;
70 struct {
71 __u32 s_addr;
72 } sin_addr;
73 char pad[4];
74 } addr_in; /* IP-based bearer */
75 __u16 sock_descr; /* generic socket bearer */
76#endif
77 } dev_addr;
78};
79
80/**
81 * struct tipc_bearer - TIPC bearer info available to privileged users
82 * @usr_handle: pointer to additional user-defined information about bearer
83 * @mtu: max packet size bearer can support
84 * @blocked: non-zero if bearer is blocked
85 * @lock: spinlock for controlling access to bearer
86 * @addr: media-specific address associated with bearer
87 * @name: bearer name (format = media:interface)
88 *
89 * Note: TIPC initializes "name" and "lock" fields; user is responsible for
90 * initialization all other fields when a bearer is enabled.
91 */
92
93struct tipc_bearer {
94 void *usr_handle;
95 u32 mtu;
96 int blocked;
97 spinlock_t lock;
98 struct tipc_media_addr addr;
99 char name[TIPC_MAX_BEARER_NAME];
100};
101
102/*
103 * TIPC routines available to supported media types
104 */
105
106int tipc_register_media(u32 media_type,
107 char *media_name,
108 int (*enable)(struct tipc_bearer *),
109 void (*disable)(struct tipc_bearer *),
110 int (*send_msg)(struct sk_buff *,
111 struct tipc_bearer *,
112 struct tipc_media_addr *),
113 char *(*addr2str)(struct tipc_media_addr *a,
114 char *str_buf,
115 int str_size),
116 struct tipc_media_addr *bcast_addr,
117 const u32 bearer_priority,
118 const u32 link_tolerance, /* [ms] */
119 const u32 send_window_limit);
120
121void tipc_recv_msg(struct sk_buff *buf, struct tipc_bearer *tb_ptr);
122
123int tipc_block_bearer(const char *name);
124void tipc_continue(struct tipc_bearer *tb_ptr);
125
126int tipc_enable_bearer(const char *bearer_name, u32 bcast_scope, u32 priority);
127int tipc_disable_bearer(const char *name);
128
129/*
130 * Routines made available to TIPC by supported media types
131 */
132
133int tipc_eth_media_start(void);
134void tipc_eth_media_stop(void);
135
136#endif
137
138#endif
diff --git a/include/net/tipc/tipc_msg.h b/include/net/tipc/tipc_msg.h
deleted file mode 100644
index ffe50b4e7b93..000000000000
--- a/include/net/tipc/tipc_msg.h
+++ /dev/null
@@ -1,207 +0,0 @@
1/*
2 * include/net/tipc/tipc_msg.h: Include file for privileged access to TIPC message headers
3 *
4 * Copyright (c) 2003-2006, Ericsson AB
5 * Copyright (c) 2005, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _NET_TIPC_MSG_H_
38#define _NET_TIPC_MSG_H_
39
40#ifdef __KERNEL__
41
42struct tipc_msg {
43 __be32 hdr[15];
44};
45
46
47/*
48 TIPC user data message header format, version 2:
49
50
51 1 0 9 8 7 6 5 4|3 2 1 0 9 8 7 6|5 4 3 2 1 0 9 8|7 6 5 4 3 2 1 0
52 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
53 w0:|vers | user |hdr sz |n|d|s|-| message size |
54 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
55 w1:|mstyp| error |rer cnt|lsc|opt p| broadcast ack no |
56 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
57 w2:| link level ack no | broadcast/link level seq no |
58 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
59 w3:| previous node |
60 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
61 w4:| originating port |
62 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
63 w5:| destination port |
64 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
65 w6:| originating node |
66 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
67 w7:| destination node |
68 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
69 w8:| name type / transport sequence number |
70 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
71 w9:| name instance/multicast lower bound |
72 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
73 wA:| multicast upper bound |
74 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
75 / /
76 \ options \
77 / /
78 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
79
80*/
81
82#define TIPC_CONN_MSG 0
83#define TIPC_MCAST_MSG 1
84#define TIPC_NAMED_MSG 2
85#define TIPC_DIRECT_MSG 3
86
87
88static inline u32 msg_word(struct tipc_msg *m, u32 pos)
89{
90 return ntohl(m->hdr[pos]);
91}
92
93static inline u32 msg_bits(struct tipc_msg *m, u32 w, u32 pos, u32 mask)
94{
95 return (msg_word(m, w) >> pos) & mask;
96}
97
98static inline u32 msg_importance(struct tipc_msg *m)
99{
100 return msg_bits(m, 0, 25, 0xf);
101}
102
103static inline u32 msg_hdr_sz(struct tipc_msg *m)
104{
105 return msg_bits(m, 0, 21, 0xf) << 2;
106}
107
108static inline int msg_short(struct tipc_msg *m)
109{
110 return msg_hdr_sz(m) == 24;
111}
112
113static inline u32 msg_size(struct tipc_msg *m)
114{
115 return msg_bits(m, 0, 0, 0x1ffff);
116}
117
118static inline u32 msg_data_sz(struct tipc_msg *m)
119{
120 return msg_size(m) - msg_hdr_sz(m);
121}
122
123static inline unchar *msg_data(struct tipc_msg *m)
124{
125 return ((unchar *)m) + msg_hdr_sz(m);
126}
127
128static inline u32 msg_type(struct tipc_msg *m)
129{
130 return msg_bits(m, 1, 29, 0x7);
131}
132
133static inline u32 msg_named(struct tipc_msg *m)
134{
135 return msg_type(m) == TIPC_NAMED_MSG;
136}
137
138static inline u32 msg_mcast(struct tipc_msg *m)
139{
140 return msg_type(m) == TIPC_MCAST_MSG;
141}
142
143static inline u32 msg_connected(struct tipc_msg *m)
144{
145 return msg_type(m) == TIPC_CONN_MSG;
146}
147
148static inline u32 msg_errcode(struct tipc_msg *m)
149{
150 return msg_bits(m, 1, 25, 0xf);
151}
152
153static inline u32 msg_prevnode(struct tipc_msg *m)
154{
155 return msg_word(m, 3);
156}
157
158static inline u32 msg_origport(struct tipc_msg *m)
159{
160 return msg_word(m, 4);
161}
162
163static inline u32 msg_destport(struct tipc_msg *m)
164{
165 return msg_word(m, 5);
166}
167
168static inline u32 msg_mc_netid(struct tipc_msg *m)
169{
170 return msg_word(m, 5);
171}
172
173static inline u32 msg_orignode(struct tipc_msg *m)
174{
175 if (likely(msg_short(m)))
176 return msg_prevnode(m);
177 return msg_word(m, 6);
178}
179
180static inline u32 msg_destnode(struct tipc_msg *m)
181{
182 return msg_word(m, 7);
183}
184
185static inline u32 msg_nametype(struct tipc_msg *m)
186{
187 return msg_word(m, 8);
188}
189
190static inline u32 msg_nameinst(struct tipc_msg *m)
191{
192 return msg_word(m, 9);
193}
194
195static inline u32 msg_namelower(struct tipc_msg *m)
196{
197 return msg_nameinst(m);
198}
199
200static inline u32 msg_nameupper(struct tipc_msg *m)
201{
202 return msg_word(m, 10);
203}
204
205#endif
206
207#endif
diff --git a/include/net/tipc/tipc_port.h b/include/net/tipc/tipc_port.h
deleted file mode 100644
index 1893aaf49426..000000000000
--- a/include/net/tipc/tipc_port.h
+++ /dev/null
@@ -1,101 +0,0 @@
1/*
2 * include/net/tipc/tipc_port.h: Include file for privileged access to TIPC ports
3 *
4 * Copyright (c) 1994-2007, Ericsson AB
5 * Copyright (c) 2005-2008, Wind River Systems
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are met:
10 *
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. Neither the names of the copyright holders nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * Alternatively, this software may be distributed under the terms of the
21 * GNU General Public License ("GPL") version 2 as published by the Free
22 * Software Foundation.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _NET_TIPC_PORT_H_
38#define _NET_TIPC_PORT_H_
39
40#ifdef __KERNEL__
41
42#include <linux/tipc.h>
43#include <linux/skbuff.h>
44#include <net/tipc/tipc_msg.h>
45
46#define TIPC_FLOW_CONTROL_WIN 512
47
48/**
49 * struct tipc_port - native TIPC port info available to privileged users
50 * @usr_handle: pointer to additional user-defined information about port
51 * @lock: pointer to spinlock for controlling access to port
52 * @connected: non-zero if port is currently connected to a peer port
53 * @conn_type: TIPC type used when connection was established
54 * @conn_instance: TIPC instance used when connection was established
55 * @conn_unacked: number of unacknowledged messages received from peer port
56 * @published: non-zero if port has one or more associated names
57 * @congested: non-zero if cannot send because of link or port congestion
58 * @max_pkt: maximum packet size "hint" used when building messages sent by port
59 * @ref: unique reference to port in TIPC object registry
60 * @phdr: preformatted message header used when sending messages
61 */
62
63struct tipc_port {
64 void *usr_handle;
65 spinlock_t *lock;
66 int connected;
67 u32 conn_type;
68 u32 conn_instance;
69 u32 conn_unacked;
70 int published;
71 u32 congested;
72 u32 max_pkt;
73 u32 ref;
74 struct tipc_msg phdr;
75};
76
77
78struct tipc_port *tipc_createport_raw(void *usr_handle,
79 u32 (*dispatcher)(struct tipc_port *, struct sk_buff *),
80 void (*wakeup)(struct tipc_port *),
81 const u32 importance);
82
83int tipc_reject_msg(struct sk_buff *buf, u32 err);
84
85int tipc_send_buf_fast(struct sk_buff *buf, u32 destnode);
86
87void tipc_acknowledge(u32 port_ref,u32 ack);
88
89struct tipc_port *tipc_get_port(const u32 ref);
90
91/*
92 * The following routines require that the port be locked on entry
93 */
94
95int tipc_disconnect_port(struct tipc_port *tp_ptr);
96
97
98#endif
99
100#endif
101
diff --git a/include/net/udp.h b/include/net/udp.h
index 200b82848c9a..bb967dd59bf7 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -105,10 +105,10 @@ static inline struct udp_hslot *udp_hashslot2(struct udp_table *table,
105 105
106extern struct proto udp_prot; 106extern struct proto udp_prot;
107 107
108extern atomic_t udp_memory_allocated; 108extern atomic_long_t udp_memory_allocated;
109 109
110/* sysctl variables for udp */ 110/* sysctl variables for udp */
111extern int sysctl_udp_mem[3]; 111extern long sysctl_udp_mem[3];
112extern int sysctl_udp_rmem_min; 112extern int sysctl_udp_rmem_min;
113extern int sysctl_udp_wmem_min; 113extern int sysctl_udp_wmem_min;
114 114
diff --git a/include/net/x25.h b/include/net/x25.h
index 1479cb4a41fc..a06119a05129 100644
--- a/include/net/x25.h
+++ b/include/net/x25.h
@@ -315,6 +315,8 @@ extern struct list_head x25_route_list;
315extern rwlock_t x25_route_list_lock; 315extern rwlock_t x25_route_list_lock;
316extern struct list_head x25_forward_list; 316extern struct list_head x25_forward_list;
317extern rwlock_t x25_forward_list_lock; 317extern rwlock_t x25_forward_list_lock;
318extern struct list_head x25_neigh_list;
319extern rwlock_t x25_neigh_list_lock;
318 320
319extern int x25_proc_init(void); 321extern int x25_proc_init(void);
320extern void x25_proc_exit(void); 322extern void x25_proc_exit(void);
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index bcfb6b24b019..b9f385da758e 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -143,6 +143,7 @@ struct xfrm_state {
143 struct xfrm_id id; 143 struct xfrm_id id;
144 struct xfrm_selector sel; 144 struct xfrm_selector sel;
145 struct xfrm_mark mark; 145 struct xfrm_mark mark;
146 u32 tfcpad;
146 147
147 u32 genid; 148 u32 genid;
148 149
@@ -805,6 +806,9 @@ __be16 xfrm_flowi_sport(struct flowi *fl)
805 case IPPROTO_MH: 806 case IPPROTO_MH:
806 port = htons(fl->fl_mh_type); 807 port = htons(fl->fl_mh_type);
807 break; 808 break;
809 case IPPROTO_GRE:
810 port = htons(ntohl(fl->fl_gre_key) >> 16);
811 break;
808 default: 812 default:
809 port = 0; /*XXX*/ 813 port = 0; /*XXX*/
810 } 814 }
@@ -826,6 +830,9 @@ __be16 xfrm_flowi_dport(struct flowi *fl)
826 case IPPROTO_ICMPV6: 830 case IPPROTO_ICMPV6:
827 port = htons(fl->fl_icmp_code); 831 port = htons(fl->fl_icmp_code);
828 break; 832 break;
833 case IPPROTO_GRE:
834 port = htons(ntohl(fl->fl_gre_key) & 0xffff);
835 break;
829 default: 836 default:
830 port = 0; /*XXX*/ 837 port = 0; /*XXX*/
831 } 838 }
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 289010d3270b..e5e345fb2a5c 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -98,6 +98,103 @@ TRACE_EVENT(ext4_allocate_inode,
98 (unsigned long) __entry->dir, __entry->mode) 98 (unsigned long) __entry->dir, __entry->mode)
99); 99);
100 100
101TRACE_EVENT(ext4_evict_inode,
102 TP_PROTO(struct inode *inode),
103
104 TP_ARGS(inode),
105
106 TP_STRUCT__entry(
107 __field( int, dev_major )
108 __field( int, dev_minor )
109 __field( ino_t, ino )
110 __field( int, nlink )
111 ),
112
113 TP_fast_assign(
114 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
115 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
116 __entry->ino = inode->i_ino;
117 __entry->nlink = inode->i_nlink;
118 ),
119
120 TP_printk("dev %d,%d ino %lu nlink %d",
121 __entry->dev_major, __entry->dev_minor,
122 (unsigned long) __entry->ino, __entry->nlink)
123);
124
125TRACE_EVENT(ext4_drop_inode,
126 TP_PROTO(struct inode *inode, int drop),
127
128 TP_ARGS(inode, drop),
129
130 TP_STRUCT__entry(
131 __field( int, dev_major )
132 __field( int, dev_minor )
133 __field( ino_t, ino )
134 __field( int, drop )
135 ),
136
137 TP_fast_assign(
138 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
139 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
140 __entry->ino = inode->i_ino;
141 __entry->drop = drop;
142 ),
143
144 TP_printk("dev %d,%d ino %lu drop %d",
145 __entry->dev_major, __entry->dev_minor,
146 (unsigned long) __entry->ino, __entry->drop)
147);
148
149TRACE_EVENT(ext4_mark_inode_dirty,
150 TP_PROTO(struct inode *inode, unsigned long IP),
151
152 TP_ARGS(inode, IP),
153
154 TP_STRUCT__entry(
155 __field( int, dev_major )
156 __field( int, dev_minor )
157 __field( ino_t, ino )
158 __field(unsigned long, ip )
159 ),
160
161 TP_fast_assign(
162 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
163 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
164 __entry->ino = inode->i_ino;
165 __entry->ip = IP;
166 ),
167
168 TP_printk("dev %d,%d ino %lu caller %pF",
169 __entry->dev_major, __entry->dev_minor,
170 (unsigned long) __entry->ino, (void *)__entry->ip)
171);
172
173TRACE_EVENT(ext4_begin_ordered_truncate,
174 TP_PROTO(struct inode *inode, loff_t new_size),
175
176 TP_ARGS(inode, new_size),
177
178 TP_STRUCT__entry(
179 __field( int, dev_major )
180 __field( int, dev_minor )
181 __field( ino_t, ino )
182 __field( loff_t, new_size )
183 ),
184
185 TP_fast_assign(
186 __entry->dev_major = MAJOR(inode->i_sb->s_dev);
187 __entry->dev_minor = MINOR(inode->i_sb->s_dev);
188 __entry->ino = inode->i_ino;
189 __entry->new_size = new_size;
190 ),
191
192 TP_printk("dev %d,%d ino %lu new_size %lld",
193 __entry->dev_major, __entry->dev_minor,
194 (unsigned long) __entry->ino,
195 (long long) __entry->new_size)
196);
197
101DECLARE_EVENT_CLASS(ext4__write_begin, 198DECLARE_EVENT_CLASS(ext4__write_begin,
102 199
103 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, 200 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,