aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2006-12-03 23:59:07 -0500
committerPaul Mackerras <paulus@samba.org>2006-12-03 23:59:07 -0500
commit79acbb3ff2d8095b692e1502b9eb2ccec348de26 (patch)
tree6ab773e5a8f9de2cd6443362b21d0d6fffe3b35e /include/linux
parent19a79859e168640f8e16d7b216d211c1c52b687a (diff)
parent2b5f6dcce5bf94b9b119e9ed8d537098ec61c3d2 (diff)
Merge branch 'linux-2.6' into for-linus
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild2
-rw-r--r--include/linux/atmarp.h2
-rw-r--r--include/linux/atmbr2684.h4
-rw-r--r--include/linux/atmmpc.h16
-rw-r--r--include/linux/backing-dev.h7
-rw-r--r--include/linux/blkdev.h29
-rw-r--r--include/linux/blktrace_api.h12
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/compat.h6
-rw-r--r--include/linux/compat_ioctl.h1
-rw-r--r--include/linux/crypto.h2
-rw-r--r--include/linux/dccp.h63
-rw-r--r--include/linux/device.h37
-rw-r--r--include/linux/divert.h132
-rw-r--r--include/linux/dmi.h2
-rw-r--r--include/linux/elevator.h4
-rw-r--r--include/linux/fb.h8
-rw-r--r--include/linux/fib_rules.h3
-rw-r--r--include/linux/fs.h13
-rw-r--r--include/linux/htirq.h16
-rw-r--r--include/linux/hugetlb.h10
-rw-r--r--include/linux/icmp.h2
-rw-r--r--include/linux/icmpv6.h12
-rw-r--r--include/linux/if_packet.h6
-rw-r--r--include/linux/if_tunnel.h8
-rw-r--r--include/linux/igmp.h4
-rw-r--r--include/linux/in.h1
-rw-r--r--include/linux/in6.h16
-rw-r--r--include/linux/inet.h4
-rw-r--r--include/linux/inetdevice.h14
-rw-r--r--include/linux/init.h36
-rw-r--r--include/linux/ioport.h1
-rw-r--r--include/linux/ip.h2
-rw-r--r--include/linux/ip6_tunnel.h2
-rw-r--r--include/linux/ipmi_msgdefs.h2
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/ipx.h14
-rw-r--r--include/linux/irq.h21
-rw-r--r--include/linux/ixjuser.h2
-rw-r--r--include/linux/jiffies.h2
-rw-r--r--include/linux/kernel.h8
-rw-r--r--include/linux/kexec.h2
-rw-r--r--include/linux/kobject.h8
-rw-r--r--include/linux/libata.h3
-rw-r--r--include/linux/lockd/bind.h5
-rw-r--r--include/linux/lockd/lockd.h12
-rw-r--r--include/linux/lockd/share.h4
-rw-r--r--include/linux/lockd/xdr.h30
-rw-r--r--include/linux/lockd/xdr4.h26
-rw-r--r--include/linux/lockdep.h17
-rw-r--r--include/linux/mempolicy.h2
-rw-r--r--include/linux/miscdevice.h5
-rw-r--r--include/linux/mm.h3
-rw-r--r--include/linux/mmc/card.h13
-rw-r--r--include/linux/mmc/host.h8
-rw-r--r--include/linux/mmc/protocol.h74
-rw-r--r--include/linux/mmzone.h12
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/mqueue.h2
-rw-r--r--include/linux/msdos_fs.h2
-rw-r--r--include/linux/mtd/nand.h2
-rw-r--r--include/linux/mv643xx.h4
-rw-r--r--include/linux/net.h7
-rw-r--r--include/linux/netdevice.h18
-rw-r--r--include/linux/netfilter.h44
-rw-r--r--include/linux/netfilter/Kbuild2
-rw-r--r--include/linux/netfilter/nf_conntrack_amanda.h10
-rw-r--r--include/linux/netfilter/nf_conntrack_ftp.h20
-rw-r--r--include/linux/netfilter/nf_conntrack_h323.h92
-rw-r--r--include/linux/netfilter/nf_conntrack_h323_asn1.h (renamed from include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h)10
-rw-r--r--include/linux/netfilter/nf_conntrack_h323_types.h (renamed from include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h)12
-rw-r--r--include/linux/netfilter/nf_conntrack_irc.h15
-rw-r--r--include/linux/netfilter/nf_conntrack_pptp.h321
-rw-r--r--include/linux/netfilter/nf_conntrack_proto_gre.h112
-rw-r--r--include/linux/netfilter/nf_conntrack_sctp.h2
-rw-r--r--include/linux/netfilter/nf_conntrack_sip.h41
-rw-r--r--include/linux/netfilter/nf_conntrack_tftp.h20
-rw-r--r--include/linux/netfilter/nfnetlink.h2
-rw-r--r--include/linux/netfilter/nfnetlink_log.h12
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h19
-rw-r--r--include/linux/netfilter/x_tables.h16
-rw-r--r--include/linux/netfilter/xt_NFLOG.h18
-rw-r--r--include/linux/netfilter/xt_conntrack.h4
-rw-r--r--include/linux/netfilter/xt_hashlimit.h40
-rw-r--r--include/linux/netfilter/xt_policy.h2
-rw-r--r--include/linux/netfilter_arp/arp_tables.h25
-rw-r--r--include/linux/netfilter_bridge.h2
-rw-r--r--include/linux/netfilter_bridge/ebt_802_3.h10
-rw-r--r--include/linux/netfilter_bridge/ebt_among.h2
-rw-r--r--include/linux/netfilter_bridge/ebt_arp.h14
-rw-r--r--include/linux/netfilter_bridge/ebt_ip.h8
-rw-r--r--include/linux/netfilter_bridge/ebt_nat.h1
-rw-r--r--include/linux/netfilter_bridge/ebt_vlan.h2
-rw-r--r--include/linux/netfilter_bridge/ebtables.h25
-rw-r--r--include/linux/netfilter_ipv4.h2
-rw-r--r--include/linux/netfilter_ipv4/Kbuild2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_ftp.h40
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_h323.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_sip.h34
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_tftp.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h27
-rw-r--r--include/linux/netfilter_ipv4/ipt_LOG.h2
-rw-r--r--include/linux/netfilter_ipv4/ipt_hashlimit.h42
-rw-r--r--include/linux/netfilter_ipv6.h2
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h27
-rw-r--r--include/linux/netfilter_ipv6/ip6t_LOG.h2
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/netpoll.h15
-rw-r--r--include/linux/nfs_fs.h5
-rw-r--r--include/linux/nfs_xdr.h10
-rw-r--r--include/linux/nfsd/cache.h6
-rw-r--r--include/linux/nfsd/export.h4
-rw-r--r--include/linux/nfsd/nfsd.h45
-rw-r--r--include/linux/nfsd/nfsfh.h8
-rw-r--r--include/linux/nfsd/state.h12
-rw-r--r--include/linux/nfsd/xdr.h50
-rw-r--r--include/linux/nfsd/xdr3.h114
-rw-r--r--include/linux/nfsd/xdr4.h54
-rw-r--r--include/linux/nsproxy.h4
-rw-r--r--include/linux/oom.h10
-rw-r--r--include/linux/pagemap.h14
-rw-r--r--include/linux/pci.h20
-rw-r--r--include/linux/pci_hotplug.h236
-rw-r--r--include/linux/pci_ids.h15
-rw-r--r--include/linux/pci_regs.h7
-rw-r--r--include/linux/personality.h9
-rw-r--r--include/linux/pfkeyv2.h4
-rw-r--r--include/linux/phy.h29
-rw-r--r--include/linux/platform_device.h6
-rw-r--r--include/linux/pm.h4
-rw-r--r--include/linux/raid/bitmap.h20
-rw-r--r--include/linux/raid/md_p.h56
-rw-r--r--include/linux/random.h23
-rw-r--r--include/linux/reiserfs_fs_sb.h2
-rw-r--r--include/linux/rtnetlink.h5
-rw-r--r--include/linux/sched.h1
-rw-r--r--include/linux/sctp.h72
-rw-r--r--include/linux/security.h56
-rw-r--r--include/linux/serio.h1
-rw-r--r--include/linux/skbuff.h26
-rw-r--r--include/linux/socket.h3
-rw-r--r--include/linux/sockios.h4
-rw-r--r--include/linux/spinlock.h14
-rw-r--r--include/linux/spinlock_api_smp.h2
-rw-r--r--include/linux/sunrpc/msg_prot.h4
-rw-r--r--include/linux/sunrpc/svc.h2
-rw-r--r--include/linux/sunrpc/xdr.h3
-rw-r--r--include/linux/sysctl.h35
-rw-r--r--include/linux/sysfs.h8
-rw-r--r--include/linux/taskstats_kern.h31
-rw-r--r--include/linux/tcp.h190
-rw-r--r--include/linux/textsearch.h4
-rw-r--r--include/linux/tfrc.h20
-rw-r--r--include/linux/tipc.h1
-rw-r--r--include/linux/tipc_config.h32
-rw-r--r--include/linux/tty.h5
-rw-r--r--include/linux/types.h4
-rw-r--r--include/linux/udp.h14
-rw-r--r--include/linux/ufs_fs.h2
-rw-r--r--include/linux/unwind.h2
-rw-r--r--include/linux/usb.h181
-rw-r--r--include/linux/vmalloc.h6
-rw-r--r--include/linux/wait.h9
-rw-r--r--include/linux/wireless.h2
-rw-r--r--include/linux/writeback.h1
-rw-r--r--include/linux/xfrm.h6
168 files changed, 2427 insertions, 986 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 5114ff18101d..d7e04689304c 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -120,6 +120,7 @@ header-y += netrom.h
120header-y += nfs2.h 120header-y += nfs2.h
121header-y += nfs4_mount.h 121header-y += nfs4_mount.h
122header-y += nfs_mount.h 122header-y += nfs_mount.h
123header-y += oom.h
123header-y += param.h 124header-y += param.h
124header-y += pci_ids.h 125header-y += pci_ids.h
125header-y += pci_regs.h 126header-y += pci_regs.h
@@ -192,7 +193,6 @@ unifdef-y += cuda.h
192unifdef-y += cyclades.h 193unifdef-y += cyclades.h
193unifdef-y += dccp.h 194unifdef-y += dccp.h
194unifdef-y += dirent.h 195unifdef-y += dirent.h
195unifdef-y += divert.h
196unifdef-y += dlm.h 196unifdef-y += dlm.h
197unifdef-y += elfcore.h 197unifdef-y += elfcore.h
198unifdef-y += errno.h 198unifdef-y += errno.h
diff --git a/include/linux/atmarp.h b/include/linux/atmarp.h
index 24f82338f59a..ee108f9e9cb7 100644
--- a/include/linux/atmarp.h
+++ b/include/linux/atmarp.h
@@ -37,7 +37,7 @@ enum atmarp_ctrl_type {
37struct atmarp_ctrl { 37struct atmarp_ctrl {
38 enum atmarp_ctrl_type type; /* message type */ 38 enum atmarp_ctrl_type type; /* message type */
39 int itf_num;/* interface number (if present) */ 39 int itf_num;/* interface number (if present) */
40 uint32_t ip; /* IP address (act_need only) */ 40 __be32 ip; /* IP address (act_need only) */
41}; 41};
42 42
43#endif 43#endif
diff --git a/include/linux/atmbr2684.h b/include/linux/atmbr2684.h
index 7981b733f1ef..969fb6c9e1cc 100644
--- a/include/linux/atmbr2684.h
+++ b/include/linux/atmbr2684.h
@@ -86,8 +86,8 @@ struct atm_backend_br2684 {
86 * efficient per-if in/out filters, this support will be removed 86 * efficient per-if in/out filters, this support will be removed
87 */ 87 */
88struct br2684_filter { 88struct br2684_filter {
89 __u32 prefix; /* network byte order */ 89 __be32 prefix; /* network byte order */
90 __u32 netmask; /* 0 = disable filter */ 90 __be32 netmask; /* 0 = disable filter */
91}; 91};
92 92
93struct br2684_filter_set { 93struct br2684_filter_set {
diff --git a/include/linux/atmmpc.h b/include/linux/atmmpc.h
index 5fbfa68136d3..ea1650425a12 100644
--- a/include/linux/atmmpc.h
+++ b/include/linux/atmmpc.h
@@ -13,7 +13,7 @@
13 13
14struct atmmpc_ioc { 14struct atmmpc_ioc {
15 int dev_num; 15 int dev_num;
16 uint32_t ipaddr; /* the IP address of the shortcut */ 16 __be32 ipaddr; /* the IP address of the shortcut */
17 int type; /* ingress or egress */ 17 int type; /* ingress or egress */
18}; 18};
19 19
@@ -21,8 +21,8 @@ typedef struct in_ctrl_info {
21 uint8_t Last_NHRP_CIE_code; 21 uint8_t Last_NHRP_CIE_code;
22 uint8_t Last_Q2931_cause_value; 22 uint8_t Last_Q2931_cause_value;
23 uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN]; 23 uint8_t eg_MPC_ATM_addr[ATM_ESA_LEN];
24 uint32_t tag; 24 __be32 tag;
25 uint32_t in_dst_ip; /* IP address this ingress MPC sends packets to */ 25 __be32 in_dst_ip; /* IP address this ingress MPC sends packets to */
26 uint16_t holding_time; 26 uint16_t holding_time;
27 uint32_t request_id; 27 uint32_t request_id;
28} in_ctrl_info; 28} in_ctrl_info;
@@ -30,10 +30,10 @@ typedef struct in_ctrl_info {
30typedef struct eg_ctrl_info { 30typedef struct eg_ctrl_info {
31 uint8_t DLL_header[256]; 31 uint8_t DLL_header[256];
32 uint8_t DH_length; 32 uint8_t DH_length;
33 uint32_t cache_id; 33 __be32 cache_id;
34 uint32_t tag; 34 __be32 tag;
35 uint32_t mps_ip; 35 __be32 mps_ip;
36 uint32_t eg_dst_ip; /* IP address to which ingress MPC sends packets */ 36 __be32 eg_dst_ip; /* IP address to which ingress MPC sends packets */
37 uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN]; 37 uint8_t in_MPC_data_ATM_addr[ATM_ESA_LEN];
38 uint16_t holding_time; 38 uint16_t holding_time;
39} eg_ctrl_info; 39} eg_ctrl_info;
@@ -49,7 +49,7 @@ struct mpc_parameters {
49 49
50struct k_message { 50struct k_message {
51 uint16_t type; 51 uint16_t type;
52 uint32_t ip_mask; 52 __be32 ip_mask;
53 uint8_t MPS_ctrl[ATM_ESA_LEN]; 53 uint8_t MPS_ctrl[ATM_ESA_LEN];
54 union { 54 union {
55 in_ctrl_info in_info; 55 in_ctrl_info in_info;
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index f7a1390d67f5..7011d6255593 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -10,6 +10,8 @@
10 10
11#include <asm/atomic.h> 11#include <asm/atomic.h>
12 12
13struct page;
14
13/* 15/*
14 * Bits in backing_dev_info.state 16 * Bits in backing_dev_info.state
15 */ 17 */
@@ -88,6 +90,11 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
88 (1 << BDI_write_congested)); 90 (1 << BDI_write_congested));
89} 91}
90 92
93void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
94void set_bdi_congested(struct backing_dev_info *bdi, int rw);
95long congestion_wait(int rw, long timeout);
96void congestion_end(int rw);
97
91#define bdi_cap_writeback_dirty(bdi) \ 98#define bdi_cap_writeback_dirty(bdi) \
92 (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK)) 99 (!((bdi)->capabilities & BDI_CAP_NO_WRITEBACK))
93 100
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index d370d2cfe138..e1c7286165ff 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -651,6 +651,26 @@ extern void blk_recount_segments(request_queue_t *, struct bio *);
651extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); 651extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *);
652extern int sg_scsi_ioctl(struct file *, struct request_queue *, 652extern int sg_scsi_ioctl(struct file *, struct request_queue *,
653 struct gendisk *, struct scsi_ioctl_command __user *); 653 struct gendisk *, struct scsi_ioctl_command __user *);
654
655/*
656 * A queue has just exitted congestion. Note this in the global counter of
657 * congested queues, and wake up anyone who was waiting for requests to be
658 * put back.
659 */
660static inline void blk_clear_queue_congested(request_queue_t *q, int rw)
661{
662 clear_bdi_congested(&q->backing_dev_info, rw);
663}
664
665/*
666 * A queue has just entered congestion. Flag that in the queue's VM-visible
667 * state flags and increment the global gounter of congested queues.
668 */
669static inline void blk_set_queue_congested(request_queue_t *q, int rw)
670{
671 set_bdi_congested(&q->backing_dev_info, rw);
672}
673
654extern void blk_start_queue(request_queue_t *q); 674extern void blk_start_queue(request_queue_t *q);
655extern void blk_stop_queue(request_queue_t *q); 675extern void blk_stop_queue(request_queue_t *q);
656extern void blk_sync_queue(struct request_queue *q); 676extern void blk_sync_queue(struct request_queue *q);
@@ -658,10 +678,11 @@ extern void __blk_stop_queue(request_queue_t *q);
658extern void blk_run_queue(request_queue_t *); 678extern void blk_run_queue(request_queue_t *);
659extern void blk_start_queueing(request_queue_t *); 679extern void blk_start_queueing(request_queue_t *);
660extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); 680extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *);
661extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); 681extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned long);
662extern int blk_rq_unmap_user(struct bio *, unsigned int); 682extern int blk_rq_unmap_user(struct request *);
663extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t); 683extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned int, gfp_t);
664extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); 684extern int blk_rq_map_user_iov(request_queue_t *, struct request *,
685 struct sg_iovec *, int, unsigned int);
665extern int blk_execute_rq(request_queue_t *, struct gendisk *, 686extern int blk_execute_rq(request_queue_t *, struct gendisk *,
666 struct request *, int); 687 struct request *, int);
667extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 688extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *,
@@ -765,10 +786,8 @@ extern int blk_queue_init_tags(request_queue_t *, int, struct blk_queue_tag *);
765extern void blk_queue_free_tags(request_queue_t *); 786extern void blk_queue_free_tags(request_queue_t *);
766extern int blk_queue_resize_tags(request_queue_t *, int); 787extern int blk_queue_resize_tags(request_queue_t *, int);
767extern void blk_queue_invalidate_tags(request_queue_t *); 788extern void blk_queue_invalidate_tags(request_queue_t *);
768extern long blk_congestion_wait(int rw, long timeout);
769extern struct blk_queue_tag *blk_init_tags(int); 789extern struct blk_queue_tag *blk_init_tags(int);
770extern void blk_free_tags(struct blk_queue_tag *); 790extern void blk_free_tags(struct blk_queue_tag *);
771extern void blk_congestion_end(int rw);
772 791
773static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, 792static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
774 int tag) 793 int tag)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index b99a714fcac6..3680ff9a30ed 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -50,6 +50,15 @@ enum blktrace_act {
50}; 50};
51 51
52/* 52/*
53 * Notify events.
54 */
55enum blktrace_notify {
56 __BLK_TN_PROCESS = 0, /* establish pid/name mapping */
57 __BLK_TN_TIMESTAMP, /* include system clock */
58};
59
60
61/*
53 * Trace actions in full. Additionally, read or write is masked 62 * Trace actions in full. Additionally, read or write is masked
54 */ 63 */
55#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) 64#define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE))
@@ -68,6 +77,9 @@ enum blktrace_act {
68#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) 77#define BLK_TA_BOUNCE (__BLK_TA_BOUNCE)
69#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) 78#define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE))
70 79
80#define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY))
81#define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY))
82
71#define BLK_IO_TRACE_MAGIC 0x65617400 83#define BLK_IO_TRACE_MAGIC 0x65617400
72#define BLK_IO_TRACE_VERSION 0x07 84#define BLK_IO_TRACE_VERSION 0x07
73 85
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 131ffd37e716..5d9fb0e94156 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -69,6 +69,8 @@ struct buffer_head {
69 bh_end_io_t *b_end_io; /* I/O completion */ 69 bh_end_io_t *b_end_io; /* I/O completion */
70 void *b_private; /* reserved for b_end_io */ 70 void *b_private; /* reserved for b_end_io */
71 struct list_head b_assoc_buffers; /* associated with another mapping */ 71 struct list_head b_assoc_buffers; /* associated with another mapping */
72 struct address_space *b_assoc_map; /* mapping this buffer is
73 associated with */
72 atomic_t b_count; /* users using this buffer_head */ 74 atomic_t b_count; /* users using this buffer_head */
73}; 75};
74 76
diff --git a/include/linux/compat.h b/include/linux/compat.h
index f4ebf96f5308..80b17f440ec1 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -196,7 +196,7 @@ asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp,
196#define BITS_TO_COMPAT_LONGS(bits) \ 196#define BITS_TO_COMPAT_LONGS(bits) \
197 (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG) 197 (((bits)+BITS_PER_COMPAT_LONG-1)/BITS_PER_COMPAT_LONG)
198 198
199long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, 199long compat_get_bitmap(unsigned long *mask, const compat_ulong_t __user *umask,
200 unsigned long bitmap_size); 200 unsigned long bitmap_size);
201long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask, 201long compat_put_bitmap(compat_ulong_t __user *umask, unsigned long *mask,
202 unsigned long bitmap_size); 202 unsigned long bitmap_size);
@@ -230,5 +230,9 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);
230extern int compat_printk(const char *fmt, ...); 230extern int compat_printk(const char *fmt, ...);
231extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); 231extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat);
232 232
233asmlinkage long compat_sys_migrate_pages(compat_pid_t pid,
234 compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes,
235 const compat_ulong_t __user *new_nodes);
236
233#endif /* CONFIG_COMPAT */ 237#endif /* CONFIG_COMPAT */
234#endif /* _LINUX_COMPAT_H */ 238#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h
index cfdb4f6a89d4..c26c3adcfacf 100644
--- a/include/linux/compat_ioctl.h
+++ b/include/linux/compat_ioctl.h
@@ -131,6 +131,7 @@ COMPATIBLE_IOCTL(RUN_ARRAY)
131COMPATIBLE_IOCTL(STOP_ARRAY) 131COMPATIBLE_IOCTL(STOP_ARRAY)
132COMPATIBLE_IOCTL(STOP_ARRAY_RO) 132COMPATIBLE_IOCTL(STOP_ARRAY_RO)
133COMPATIBLE_IOCTL(RESTART_ARRAY_RW) 133COMPATIBLE_IOCTL(RESTART_ARRAY_RW)
134COMPATIBLE_IOCTL(GET_BITMAP_FILE)
134ULONG_IOCTL(SET_BITMAP_FILE) 135ULONG_IOCTL(SET_BITMAP_FILE)
135/* DM */ 136/* DM */
136COMPATIBLE_IOCTL(DM_VERSION_32) 137COMPATIBLE_IOCTL(DM_VERSION_32)
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 8f2ffa4caabf..6485e9716b36 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -245,7 +245,7 @@ int crypto_alg_available(const char *name, u32 flags)
245 __deprecated_for_modules; 245 __deprecated_for_modules;
246int crypto_has_alg(const char *name, u32 type, u32 mask); 246int crypto_has_alg(const char *name, u32 type, u32 mask);
247#else 247#else
248static int crypto_alg_available(const char *name, u32 flags); 248static int crypto_alg_available(const char *name, u32 flags)
249 __deprecated_for_modules; 249 __deprecated_for_modules;
250static inline int crypto_alg_available(const char *name, u32 flags) 250static inline int crypto_alg_available(const char *name, u32 flags)
251{ 251{
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 53553c99cad6..ed6cc8962d87 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -30,7 +30,7 @@ struct dccp_hdr {
30#else 30#else
31#error "Adjust your <asm/byteorder.h> defines" 31#error "Adjust your <asm/byteorder.h> defines"
32#endif 32#endif
33 __u16 dccph_checksum; 33 __sum16 dccph_checksum;
34#if defined(__LITTLE_ENDIAN_BITFIELD) 34#if defined(__LITTLE_ENDIAN_BITFIELD)
35 __u8 dccph_x:1, 35 __u8 dccph_x:1,
36 dccph_type:4, 36 dccph_type:4,
@@ -175,17 +175,21 @@ enum {
175 DCCPC_CCID3 = 3, 175 DCCPC_CCID3 = 3,
176}; 176};
177 177
178/* DCCP features */ 178/* DCCP features (RFC 4340 section 6.4) */
179enum { 179 enum {
180 DCCPF_RESERVED = 0, 180 DCCPF_RESERVED = 0,
181 DCCPF_CCID = 1, 181 DCCPF_CCID = 1,
182 DCCPF_SEQUENCE_WINDOW = 3, 182 DCCPF_SHORT_SEQNOS = 2, /* XXX: not yet implemented */
183 DCCPF_ACK_RATIO = 5, 183 DCCPF_SEQUENCE_WINDOW = 3,
184 DCCPF_SEND_ACK_VECTOR = 6, 184 DCCPF_ECN_INCAPABLE = 4, /* XXX: not yet implemented */
185 DCCPF_SEND_NDP_COUNT = 7, 185 DCCPF_ACK_RATIO = 5,
186 /* 10-127 reserved */ 186 DCCPF_SEND_ACK_VECTOR = 6,
187 DCCPF_MIN_CCID_SPECIFIC = 128, 187 DCCPF_SEND_NDP_COUNT = 7,
188 DCCPF_MAX_CCID_SPECIFIC = 255, 188 DCCPF_MIN_CSUM_COVER = 8,
189 DCCPF_DATA_CHECKSUM = 9, /* XXX: not yet implemented */
190 /* 10-127 reserved */
191 DCCPF_MIN_CCID_SPECIFIC = 128,
192 DCCPF_MAX_CCID_SPECIFIC = 255,
189}; 193};
190 194
191/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ 195/* this structure is argument to DCCP_SOCKOPT_CHANGE_X */
@@ -196,13 +200,16 @@ struct dccp_so_feat {
196}; 200};
197 201
198/* DCCP socket options */ 202/* DCCP socket options */
199#define DCCP_SOCKOPT_PACKET_SIZE 1 203#define DCCP_SOCKOPT_PACKET_SIZE 1 /* XXX deprecated, without effect */
200#define DCCP_SOCKOPT_SERVICE 2 204#define DCCP_SOCKOPT_SERVICE 2
201#define DCCP_SOCKOPT_CHANGE_L 3 205#define DCCP_SOCKOPT_CHANGE_L 3
202#define DCCP_SOCKOPT_CHANGE_R 4 206#define DCCP_SOCKOPT_CHANGE_R 4
207#define DCCP_SOCKOPT_SEND_CSCOV 10
208#define DCCP_SOCKOPT_RECV_CSCOV 11
203#define DCCP_SOCKOPT_CCID_RX_INFO 128 209#define DCCP_SOCKOPT_CCID_RX_INFO 128
204#define DCCP_SOCKOPT_CCID_TX_INFO 192 210#define DCCP_SOCKOPT_CCID_TX_INFO 192
205 211
212/* maximum number of services provided on the same listening port */
206#define DCCP_SERVICE_LIST_MAX_LEN 32 213#define DCCP_SERVICE_LIST_MAX_LEN 32
207 214
208#ifdef __KERNEL__ 215#ifdef __KERNEL__
@@ -256,6 +263,13 @@ static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb)
256 return (struct dccp_hdr *)skb->h.raw; 263 return (struct dccp_hdr *)skb->h.raw;
257} 264}
258 265
266static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen)
267{
268 skb->h.raw = skb_push(skb, headlen);
269 memset(skb->h.raw, 0, headlen);
270 return dccp_hdr(skb);
271}
272
259static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) 273static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb)
260{ 274{
261 return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); 275 return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr));
@@ -342,6 +356,9 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb)
342 * @dccpms_ccid - Congestion Control Id (CCID) (section 10) 356 * @dccpms_ccid - Congestion Control Id (CCID) (section 10)
343 * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) 357 * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5)
344 * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) 358 * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2)
359 * @dccpms_ack_ratio - Ack Ratio Feature (section 11.3)
360 * @dccpms_pending - List of features being negotiated
361 * @dccpms_conf -
345 */ 362 */
346struct dccp_minisock { 363struct dccp_minisock {
347 __u64 dccpms_sequence_window; 364 __u64 dccpms_sequence_window;
@@ -439,12 +456,25 @@ struct dccp_ackvec;
439 * @dccps_gss - greatest sequence number sent 456 * @dccps_gss - greatest sequence number sent
440 * @dccps_gsr - greatest valid sequence number received 457 * @dccps_gsr - greatest valid sequence number received
441 * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss 458 * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss
459 * @dccps_service - first (passive sock) or unique (active sock) service code
460 * @dccps_service_list - second .. last service code on passive socket
442 * @dccps_timestamp_time - time of latest TIMESTAMP option 461 * @dccps_timestamp_time - time of latest TIMESTAMP option
443 * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option 462 * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option
444 * @dccps_packet_size - Set thru setsockopt 463 * @dccps_l_ack_ratio -
445 * @dccps_role - Role of this sock, one of %dccp_role 464 * @dccps_r_ack_ratio -
465 * @dccps_pcslen - sender partial checksum coverage (via sockopt)
466 * @dccps_pcrlen - receiver partial checksum coverage (via sockopt)
446 * @dccps_ndp_count - number of Non Data Packets since last data packet 467 * @dccps_ndp_count - number of Non Data Packets since last data packet
468 * @dccps_mss_cache -
469 * @dccps_minisock -
447 * @dccps_hc_rx_ackvec - rx half connection ack vector 470 * @dccps_hc_rx_ackvec - rx half connection ack vector
471 * @dccps_hc_rx_ccid -
472 * @dccps_hc_tx_ccid -
473 * @dccps_options_received -
474 * @dccps_epoch -
475 * @dccps_role - Role of this sock, one of %dccp_role
476 * @dccps_hc_rx_insert_options -
477 * @dccps_hc_tx_insert_options -
448 * @dccps_xmit_timer - timer for when CCID is not ready to send 478 * @dccps_xmit_timer - timer for when CCID is not ready to send
449 */ 479 */
450struct dccp_sock { 480struct dccp_sock {
@@ -464,9 +494,10 @@ struct dccp_sock {
464 struct dccp_service_list *dccps_service_list; 494 struct dccp_service_list *dccps_service_list;
465 struct timeval dccps_timestamp_time; 495 struct timeval dccps_timestamp_time;
466 __u32 dccps_timestamp_echo; 496 __u32 dccps_timestamp_echo;
467 __u32 dccps_packet_size;
468 __u16 dccps_l_ack_ratio; 497 __u16 dccps_l_ack_ratio;
469 __u16 dccps_r_ack_ratio; 498 __u16 dccps_r_ack_ratio;
499 __u16 dccps_pcslen;
500 __u16 dccps_pcrlen;
470 unsigned long dccps_ndp_count; 501 unsigned long dccps_ndp_count;
471 __u32 dccps_mss_cache; 502 __u32 dccps_mss_cache;
472 struct dccp_minisock dccps_minisock; 503 struct dccp_minisock dccps_minisock;
diff --git a/include/linux/device.h b/include/linux/device.h
index 662e6a10144e..583a341e016c 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -21,6 +21,7 @@
21#include <linux/pm.h> 21#include <linux/pm.h>
22#include <asm/semaphore.h> 22#include <asm/semaphore.h>
23#include <asm/atomic.h> 23#include <asm/atomic.h>
24#include <asm/device.h>
24 25
25#define DEVICE_NAME_SIZE 50 26#define DEVICE_NAME_SIZE 50
26#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */ 27#define DEVICE_NAME_HALF __stringify(20) /* Less than half to accommodate slop */
@@ -42,6 +43,8 @@ struct bus_type {
42 struct klist klist_devices; 43 struct klist klist_devices;
43 struct klist klist_drivers; 44 struct klist klist_drivers;
44 45
46 struct blocking_notifier_head bus_notifier;
47
45 struct bus_attribute * bus_attrs; 48 struct bus_attribute * bus_attrs;
46 struct device_attribute * dev_attrs; 49 struct device_attribute * dev_attrs;
47 struct driver_attribute * drv_attrs; 50 struct driver_attribute * drv_attrs;
@@ -75,6 +78,29 @@ int __must_check bus_for_each_drv(struct bus_type *bus,
75 struct device_driver *start, void *data, 78 struct device_driver *start, void *data,
76 int (*fn)(struct device_driver *, void *)); 79 int (*fn)(struct device_driver *, void *));
77 80
81/*
82 * Bus notifiers: Get notified of addition/removal of devices
83 * and binding/unbinding of drivers to devices.
84 * In the long run, it should be a replacement for the platform
85 * notify hooks.
86 */
87struct notifier_block;
88
89extern int bus_register_notifier(struct bus_type *bus,
90 struct notifier_block *nb);
91extern int bus_unregister_notifier(struct bus_type *bus,
92 struct notifier_block *nb);
93
94/* All 4 notifers below get called with the target struct device *
95 * as an argument. Note that those functions are likely to be called
96 * with the device semaphore held in the core, so be careful.
97 */
98#define BUS_NOTIFY_ADD_DEVICE 0x00000001 /* device added */
99#define BUS_NOTIFY_DEL_DEVICE 0x00000002 /* device removed */
100#define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */
101#define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be
102 unbound */
103
78/* driverfs interface for exporting bus attributes */ 104/* driverfs interface for exporting bus attributes */
79 105
80struct bus_attribute { 106struct bus_attribute {
@@ -343,8 +369,6 @@ struct device {
343 void *driver_data; /* data private to the driver */ 369 void *driver_data; /* data private to the driver */
344 void *platform_data; /* Platform specific data, device 370 void *platform_data; /* Platform specific data, device
345 core doesn't touch it */ 371 core doesn't touch it */
346 void *firmware_data; /* Firmware specific data (e.g. ACPI,
347 BIOS data),reserved for device core*/
348 struct dev_pm_info power; 372 struct dev_pm_info power;
349 373
350 u64 *dma_mask; /* dma mask (if dma'able device) */ 374 u64 *dma_mask; /* dma mask (if dma'able device) */
@@ -358,6 +382,8 @@ struct device {
358 382
359 struct dma_coherent_mem *dma_mem; /* internal for coherent mem 383 struct dma_coherent_mem *dma_mem; /* internal for coherent mem
360 override */ 384 override */
385 /* arch specific additions */
386 struct dev_archdata archdata;
361 387
362 /* class_device migration path */ 388 /* class_device migration path */
363 struct list_head node; 389 struct list_head node;
@@ -393,9 +419,12 @@ extern void device_unregister(struct device * dev);
393extern void device_initialize(struct device * dev); 419extern void device_initialize(struct device * dev);
394extern int __must_check device_add(struct device * dev); 420extern int __must_check device_add(struct device * dev);
395extern void device_del(struct device * dev); 421extern void device_del(struct device * dev);
396extern int __must_check device_for_each_child(struct device *, void *, 422extern int device_for_each_child(struct device *, void *,
397 int (*fn)(struct device *, void *)); 423 int (*fn)(struct device *, void *));
424extern struct device *device_find_child(struct device *, void *data,
425 int (*match)(struct device *, void *));
398extern int device_rename(struct device *dev, char *new_name); 426extern int device_rename(struct device *dev, char *new_name);
427extern int device_move(struct device *dev, struct device *new_parent);
399 428
400/* 429/*
401 * Manual binding of a device to driver. See drivers/base/bus.c 430 * Manual binding of a device to driver. See drivers/base/bus.c
@@ -415,8 +444,6 @@ extern struct device *device_create(struct class *cls, struct device *parent,
415 __attribute__((format(printf,4,5))); 444 __attribute__((format(printf,4,5)));
416extern void device_destroy(struct class *cls, dev_t devt); 445extern void device_destroy(struct class *cls, dev_t devt);
417 446
418extern int virtual_device_parent(struct device *dev);
419
420/* 447/*
421 * Platform "fixup" functions - allow the platform to have their say 448 * Platform "fixup" functions - allow the platform to have their say
422 * about devices and actions that the general device layer doesn't 449 * about devices and actions that the general device layer doesn't
diff --git a/include/linux/divert.h b/include/linux/divert.h
deleted file mode 100644
index 8fb4e9de6843..000000000000
--- a/include/linux/divert.h
+++ /dev/null
@@ -1,132 +0,0 @@
1/*
2 * Frame Diversion, Benoit Locher <Benoit.Locher@skf.com>
3 *
4 * Changes:
5 * 06/09/2000 BL: initial version
6 *
7 */
8
9#ifndef _LINUX_DIVERT_H
10#define _LINUX_DIVERT_H
11
12#include <asm/types.h>
13
14#define MAX_DIVERT_PORTS 8 /* Max number of ports to divert (tcp, udp) */
15
16/* Divertable protocols */
17#define DIVERT_PROTO_NONE 0x0000
18#define DIVERT_PROTO_IP 0x0001
19#define DIVERT_PROTO_ICMP 0x0002
20#define DIVERT_PROTO_TCP 0x0004
21#define DIVERT_PROTO_UDP 0x0008
22
23/*
24 * This is an Ethernet Frame Diverter option block
25 */
26struct divert_blk
27{
28 int divert; /* are we active */
29 unsigned int protos; /* protocols */
30 __u16 tcp_dst[MAX_DIVERT_PORTS]; /* specific tcp dst ports to divert */
31 __u16 tcp_src[MAX_DIVERT_PORTS]; /* specific tcp src ports to divert */
32 __u16 udp_dst[MAX_DIVERT_PORTS]; /* specific udp dst ports to divert */
33 __u16 udp_src[MAX_DIVERT_PORTS]; /* specific udp src ports to divert */
34};
35
36/*
37 * Diversion control block, for configuration with the userspace tool
38 * divert
39 */
40
41typedef union _divert_cf_arg
42{
43 __s16 int16;
44 __u16 uint16;
45 __s32 int32;
46 __u32 uint32;
47 __s64 int64;
48 __u64 uint64;
49 void __user *ptr;
50} divert_cf_arg;
51
52
53struct divert_cf
54{
55 int cmd; /* Command */
56 divert_cf_arg arg1,
57 arg2,
58 arg3;
59 int dev_index; /* device index (eth0=0, etc...) */
60};
61
62
63/* Diversion commands */
64#define DIVCMD_DIVERT 1 /* ENABLE/DISABLE diversion */
65#define DIVCMD_IP 2 /* ENABLE/DISABLE whold IP diversion */
66#define DIVCMD_TCP 3 /* ENABLE/DISABLE whold TCP diversion */
67#define DIVCMD_TCPDST 4 /* ADD/REMOVE TCP DST port for diversion */
68#define DIVCMD_TCPSRC 5 /* ADD/REMOVE TCP SRC port for diversion */
69#define DIVCMD_UDP 6 /* ENABLE/DISABLE whole UDP diversion */
70#define DIVCMD_UDPDST 7 /* ADD/REMOVE UDP DST port for diversion */
71#define DIVCMD_UDPSRC 8 /* ADD/REMOVE UDP SRC port for diversion */
72#define DIVCMD_ICMP 9 /* ENABLE/DISABLE whole ICMP diversion */
73#define DIVCMD_GETSTATUS 10 /* GET the status of the diverter */
74#define DIVCMD_RESET 11 /* Reset the diverter on the specified dev */
75#define DIVCMD_GETVERSION 12 /* Retrieve the diverter code version (char[32]) */
76
77/* General syntax of the commands:
78 *
79 * DIVCMD_xxxxxx(arg1, arg2, arg3, dev_index)
80 *
81 * SIOCSIFDIVERT:
82 * DIVCMD_DIVERT(DIVARG1_ENABLE|DIVARG1_DISABLE, , ,ifindex)
83 * DIVCMD_IP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
84 * DIVCMD_TCP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
85 * DIVCMD_TCPDST(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
86 * DIVCMD_TCPSRC(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
87 * DIVCMD_UDP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
88 * DIVCMD_UDPDST(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
89 * DIVCMD_UDPSRC(DIVARG1_ADD|DIVARG1_REMOVE, port, , ifindex)
90 * DIVCMD_ICMP(DIVARG1_ENABLE|DIVARG1_DISABLE, , , ifindex)
91 * DIVCMD_RESET(, , , ifindex)
92 *
93 * SIOGIFDIVERT:
94 * DIVCMD_GETSTATUS(divert_blk, , , ifindex)
95 * DIVCMD_GETVERSION(string[3])
96 */
97
98
99/* Possible values for arg1 */
100#define DIVARG1_ENABLE 0 /* ENABLE something */
101#define DIVARG1_DISABLE 1 /* DISABLE something */
102#define DIVARG1_ADD 2 /* ADD something */
103#define DIVARG1_REMOVE 3 /* REMOVE something */
104
105
106#ifdef __KERNEL__
107
108/* diverter functions */
109#include <linux/skbuff.h>
110
111#ifdef CONFIG_NET_DIVERT
112#include <linux/netdevice.h>
113
114int alloc_divert_blk(struct net_device *);
115void free_divert_blk(struct net_device *);
116int divert_ioctl(unsigned int cmd, struct divert_cf __user *arg);
117void divert_frame(struct sk_buff *skb);
118static inline void handle_diverter(struct sk_buff *skb)
119{
120 /* if diversion is supported on device, then divert */
121 if (skb->dev->divert && skb->dev->divert->divert)
122 divert_frame(skb);
123}
124
125#else
126# define alloc_divert_blk(dev) (0)
127# define free_divert_blk(dev) do {} while (0)
128# define divert_ioctl(cmd, arg) (-ENOPKG)
129# define handle_diverter(skb) do {} while (0)
130#endif
131#endif
132#endif /* _LINUX_DIVERT_H */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 38dc403be70b..904bf3d2d90b 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -69,6 +69,7 @@ extern struct dmi_device * dmi_find_device(int type, const char *name,
69 struct dmi_device *from); 69 struct dmi_device *from);
70extern void dmi_scan_machine(void); 70extern void dmi_scan_machine(void);
71extern int dmi_get_year(int field); 71extern int dmi_get_year(int field);
72extern int dmi_name_in_vendors(char *str);
72 73
73#else 74#else
74 75
@@ -77,6 +78,7 @@ static inline char * dmi_get_system_info(int field) { return NULL; }
77static inline struct dmi_device * dmi_find_device(int type, const char *name, 78static inline struct dmi_device * dmi_find_device(int type, const char *name,
78 struct dmi_device *from) { return NULL; } 79 struct dmi_device *from) { return NULL; }
79static inline int dmi_get_year(int year) { return 0; } 80static inline int dmi_get_year(int year) { return 0; }
81static inline int dmi_name_in_vendors(char *s) { return 0; }
80 82
81#endif 83#endif
82 84
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 2fa9f1144228..a24931d24404 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -21,11 +21,11 @@ typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
21typedef int (elevator_may_queue_fn) (request_queue_t *, int); 21typedef int (elevator_may_queue_fn) (request_queue_t *, int);
22 22
23typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); 23typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t);
24typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); 24typedef void (elevator_put_req_fn) (struct request *);
25typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); 25typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *);
26typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); 26typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
27 27
28typedef void *(elevator_init_fn) (request_queue_t *, elevator_t *); 28typedef void *(elevator_init_fn) (request_queue_t *);
29typedef void (elevator_exit_fn) (elevator_t *); 29typedef void (elevator_exit_fn) (elevator_t *);
30 30
31struct elevator_ops 31struct elevator_ops
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 3e69241e6a81..fa23e0671bb3 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -774,8 +774,8 @@ struct fb_info {
774#endif 774#endif
775 775
776 struct fb_ops *fbops; 776 struct fb_ops *fbops;
777 struct device *device; 777 struct device *device; /* This is the parent */
778 struct class_device *class_device; /* sysfs per device attrs */ 778 struct device *dev; /* This is this fb device */
779 int class_flag; /* private sysfs flags */ 779 int class_flag; /* private sysfs flags */
780#ifdef CONFIG_FB_TILEBLITTING 780#ifdef CONFIG_FB_TILEBLITTING
781 struct fb_tile_ops *tileops; /* Tile Blitting */ 781 struct fb_tile_ops *tileops; /* Tile Blitting */
@@ -910,8 +910,8 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch,
910/* drivers/video/fbsysfs.c */ 910/* drivers/video/fbsysfs.c */
911extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev); 911extern struct fb_info *framebuffer_alloc(size_t size, struct device *dev);
912extern void framebuffer_release(struct fb_info *info); 912extern void framebuffer_release(struct fb_info *info);
913extern int fb_init_class_device(struct fb_info *fb_info); 913extern int fb_init_device(struct fb_info *fb_info);
914extern void fb_cleanup_class_device(struct fb_info *head); 914extern void fb_cleanup_device(struct fb_info *head);
915extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max); 915extern void fb_bl_default_curve(struct fb_info *fb_info, u8 off, u8 min, u8 max);
916 916
917/* drivers/video/fbmon.c */ 917/* drivers/video/fbmon.c */
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 4418c8d9d479..8270aac2aa5d 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -6,6 +6,7 @@
6 6
7/* rule is permanent, and cannot be deleted */ 7/* rule is permanent, and cannot be deleted */
8#define FIB_RULE_PERMANENT 1 8#define FIB_RULE_PERMANENT 1
9#define FIB_RULE_INVERT 2
9 10
10struct fib_rule_hdr 11struct fib_rule_hdr
11{ 12{
@@ -34,7 +35,7 @@ enum
34 FRA_UNUSED3, 35 FRA_UNUSED3,
35 FRA_UNUSED4, 36 FRA_UNUSED4,
36 FRA_UNUSED5, 37 FRA_UNUSED5,
37 FRA_FWMARK, /* netfilter mark */ 38 FRA_FWMARK, /* mark */
38 FRA_FLOW, /* flow/class id */ 39 FRA_FLOW, /* flow/class id */
39 FRA_UNUSED6, 40 FRA_UNUSED6,
40 FRA_UNUSED7, 41 FRA_UNUSED7,
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 34406ed467c3..2fe6e3f900ba 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -623,6 +623,9 @@ enum inode_i_mutex_lock_class
623 I_MUTEX_QUOTA 623 I_MUTEX_QUOTA
624}; 624};
625 625
626extern void inode_double_lock(struct inode *inode1, struct inode *inode2);
627extern void inode_double_unlock(struct inode *inode1, struct inode *inode2);
628
626/* 629/*
627 * NOTE: in a 32bit arch with a preemptable kernel and 630 * NOTE: in a 32bit arch with a preemptable kernel and
628 * an UP compile the i_size_read/write must be atomic 631 * an UP compile the i_size_read/write must be atomic
@@ -656,7 +659,11 @@ static inline loff_t i_size_read(struct inode *inode)
656#endif 659#endif
657} 660}
658 661
659 662/*
663 * NOTE: unlike i_size_read(), i_size_write() does need locking around it
664 * (normally i_mutex), otherwise on 32bit/SMP an update of i_size_seqcount
665 * can be lost, resulting in subsequent i_size_read() calls spinning forever.
666 */
660static inline void i_size_write(struct inode *inode, loff_t i_size) 667static inline void i_size_write(struct inode *inode, loff_t i_size)
661{ 668{
662#if BITS_PER_LONG==32 && defined(CONFIG_SMP) 669#if BITS_PER_LONG==32 && defined(CONFIG_SMP)
@@ -1705,6 +1712,8 @@ extern void __iget(struct inode * inode);
1705extern void clear_inode(struct inode *); 1712extern void clear_inode(struct inode *);
1706extern void destroy_inode(struct inode *); 1713extern void destroy_inode(struct inode *);
1707extern struct inode *new_inode(struct super_block *); 1714extern struct inode *new_inode(struct super_block *);
1715extern int __remove_suid(struct dentry *, int);
1716extern int should_remove_suid(struct dentry *);
1708extern int remove_suid(struct dentry *); 1717extern int remove_suid(struct dentry *);
1709extern void remove_dquot_ref(struct super_block *, int, struct list_head *); 1718extern void remove_dquot_ref(struct super_block *, int, struct list_head *);
1710 1719
@@ -1751,6 +1760,8 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *,
1751 struct pipe_inode_info *, size_t, unsigned int); 1760 struct pipe_inode_info *, size_t, unsigned int);
1752extern ssize_t generic_file_splice_write(struct pipe_inode_info *, 1761extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
1753 struct file *, loff_t *, size_t, unsigned int); 1762 struct file *, loff_t *, size_t, unsigned int);
1763extern ssize_t generic_file_splice_write_nolock(struct pipe_inode_info *,
1764 struct file *, loff_t *, size_t, unsigned int);
1754extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, 1765extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
1755 struct file *out, loff_t *, size_t len, unsigned int flags); 1766 struct file *out, loff_t *, size_t len, unsigned int flags);
1756extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, 1767extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
diff --git a/include/linux/htirq.h b/include/linux/htirq.h
index 1f15ce279a23..c96ea46737d0 100644
--- a/include/linux/htirq.h
+++ b/include/linux/htirq.h
@@ -1,15 +1,23 @@
1#ifndef LINUX_HTIRQ_H 1#ifndef LINUX_HTIRQ_H
2#define LINUX_HTIRQ_H 2#define LINUX_HTIRQ_H
3 3
4struct ht_irq_msg {
5 u32 address_lo; /* low 32 bits of the ht irq message */
6 u32 address_hi; /* high 32 bits of the it irq message */
7};
8
4/* Helper functions.. */ 9/* Helper functions.. */
5void write_ht_irq_low(unsigned int irq, u32 data); 10void fetch_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
6void write_ht_irq_high(unsigned int irq, u32 data); 11void write_ht_irq_msg(unsigned int irq, struct ht_irq_msg *msg);
7u32 read_ht_irq_low(unsigned int irq);
8u32 read_ht_irq_high(unsigned int irq);
9void mask_ht_irq(unsigned int irq); 12void mask_ht_irq(unsigned int irq);
10void unmask_ht_irq(unsigned int irq); 13void unmask_ht_irq(unsigned int irq);
11 14
12/* The arch hook for getting things started */ 15/* The arch hook for getting things started */
13int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev); 16int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev);
14 17
18/* For drivers of buggy hardware */
19typedef void (ht_irq_update_t)(struct pci_dev *dev, int irq,
20 struct ht_irq_msg *msg);
21int __ht_create_irq(struct pci_dev *dev, int idx, ht_irq_update_t *update);
22
15#endif /* LINUX_HTIRQ_H */ 23#endif /* LINUX_HTIRQ_H */
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 5081d27bfa27..ace64e57e17f 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -60,8 +60,11 @@ void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr,
60 * If the arch doesn't supply something else, assume that hugepage 60 * If the arch doesn't supply something else, assume that hugepage
61 * size aligned regions are ok without further preparation. 61 * size aligned regions are ok without further preparation.
62 */ 62 */
63static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) 63static inline int prepare_hugepage_range(unsigned long addr, unsigned long len,
64 pgoff_t pgoff)
64{ 65{
66 if (pgoff & (~HPAGE_MASK >> PAGE_SHIFT))
67 return -EINVAL;
65 if (len & ~HPAGE_MASK) 68 if (len & ~HPAGE_MASK)
66 return -EINVAL; 69 return -EINVAL;
67 if (addr & ~HPAGE_MASK) 70 if (addr & ~HPAGE_MASK)
@@ -69,7 +72,8 @@ static inline int prepare_hugepage_range(unsigned long addr, unsigned long len)
69 return 0; 72 return 0;
70} 73}
71#else 74#else
72int prepare_hugepage_range(unsigned long addr, unsigned long len); 75int prepare_hugepage_range(unsigned long addr, unsigned long len,
76 pgoff_t pgoff);
73#endif 77#endif
74 78
75#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE 79#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
@@ -107,7 +111,7 @@ static inline unsigned long hugetlb_total_pages(void)
107#define hugetlb_report_meminfo(buf) 0 111#define hugetlb_report_meminfo(buf) 0
108#define hugetlb_report_node_meminfo(n, buf) 0 112#define hugetlb_report_node_meminfo(n, buf) 0
109#define follow_huge_pmd(mm, addr, pmd, write) NULL 113#define follow_huge_pmd(mm, addr, pmd, write) NULL
110#define prepare_hugepage_range(addr, len) (-EINVAL) 114#define prepare_hugepage_range(addr,len,pgoff) (-EINVAL)
111#define pmd_huge(x) 0 115#define pmd_huge(x) 0
112#define is_hugepage_only_range(mm, addr, len) 0 116#define is_hugepage_only_range(mm, addr, len) 0
113#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) 117#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; })
diff --git a/include/linux/icmp.h b/include/linux/icmp.h
index 878cfe4e587f..24da4fbc1a2f 100644
--- a/include/linux/icmp.h
+++ b/include/linux/icmp.h
@@ -68,7 +68,7 @@
68struct icmphdr { 68struct icmphdr {
69 __u8 type; 69 __u8 type;
70 __u8 code; 70 __u8 code;
71 __be16 checksum; 71 __sum16 checksum;
72 union { 72 union {
73 struct { 73 struct {
74 __be16 id; 74 __be16 id;
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h
index c771a7db9871..68d3526c3a05 100644
--- a/include/linux/icmpv6.h
+++ b/include/linux/icmpv6.h
@@ -7,17 +7,17 @@ struct icmp6hdr {
7 7
8 __u8 icmp6_type; 8 __u8 icmp6_type;
9 __u8 icmp6_code; 9 __u8 icmp6_code;
10 __u16 icmp6_cksum; 10 __sum16 icmp6_cksum;
11 11
12 12
13 union { 13 union {
14 __u32 un_data32[1]; 14 __be32 un_data32[1];
15 __u16 un_data16[2]; 15 __be16 un_data16[2];
16 __u8 un_data8[4]; 16 __u8 un_data8[4];
17 17
18 struct icmpv6_echo { 18 struct icmpv6_echo {
19 __u16 identifier; 19 __be16 identifier;
20 __u16 sequence; 20 __be16 sequence;
21 } u_echo; 21 } u_echo;
22 22
23 struct icmpv6_nd_advt { 23 struct icmpv6_nd_advt {
@@ -53,7 +53,7 @@ struct icmp6hdr {
53#else 53#else
54#error "Please fix <asm/byteorder.h>" 54#error "Please fix <asm/byteorder.h>"
55#endif 55#endif
56 __u16 rt_lifetime; 56 __be16 rt_lifetime;
57 } u_nd_ra; 57 } u_nd_ra;
58 58
59 } icmp6_dataun; 59 } icmp6_dataun;
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index b92558549d27..99393ef3af39 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -1,17 +1,19 @@
1#ifndef __LINUX_IF_PACKET_H 1#ifndef __LINUX_IF_PACKET_H
2#define __LINUX_IF_PACKET_H 2#define __LINUX_IF_PACKET_H
3 3
4#include <linux/types.h>
5
4struct sockaddr_pkt 6struct sockaddr_pkt
5{ 7{
6 unsigned short spkt_family; 8 unsigned short spkt_family;
7 unsigned char spkt_device[14]; 9 unsigned char spkt_device[14];
8 unsigned short spkt_protocol; 10 __be16 spkt_protocol;
9}; 11};
10 12
11struct sockaddr_ll 13struct sockaddr_ll
12{ 14{
13 unsigned short sll_family; 15 unsigned short sll_family;
14 unsigned short sll_protocol; 16 __be16 sll_protocol;
15 int sll_ifindex; 17 int sll_ifindex;
16 unsigned short sll_hatype; 18 unsigned short sll_hatype;
17 unsigned char sll_pkttype; 19 unsigned char sll_pkttype;
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h
index bef9f8fd93b3..8de079ba1107 100644
--- a/include/linux/if_tunnel.h
+++ b/include/linux/if_tunnel.h
@@ -19,10 +19,10 @@ struct ip_tunnel_parm
19{ 19{
20 char name[IFNAMSIZ]; 20 char name[IFNAMSIZ];
21 int link; 21 int link;
22 __u16 i_flags; 22 __be16 i_flags;
23 __u16 o_flags; 23 __be16 o_flags;
24 __u32 i_key; 24 __be32 i_key;
25 __u32 o_key; 25 __be32 o_key;
26 struct iphdr iph; 26 struct iphdr iph;
27}; 27};
28 28
diff --git a/include/linux/igmp.h b/include/linux/igmp.h
index 03f43e2893a4..6e7ea2f0a57c 100644
--- a/include/linux/igmp.h
+++ b/include/linux/igmp.h
@@ -30,7 +30,7 @@ struct igmphdr
30{ 30{
31 __u8 type; 31 __u8 type;
32 __u8 code; /* For newer IGMP */ 32 __u8 code; /* For newer IGMP */
33 __be16 csum; 33 __sum16 csum;
34 __be32 group; 34 __be32 group;
35}; 35};
36 36
@@ -191,7 +191,7 @@ struct ip_mc_list
191#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value)) 191#define IGMPV3_MASK(value, nb) ((nb)>=32 ? (value) : ((1<<(nb))-1) & (value))
192#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \ 192#define IGMPV3_EXP(thresh, nbmant, nbexp, value) \
193 ((value) < (thresh) ? (value) : \ 193 ((value) < (thresh) ? (value) : \
194 ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant+nbexp))) << \ 194 ((IGMPV3_MASK(value, nbmant) | (1<<(nbmant))) << \
195 (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp)))) 195 (IGMPV3_MASK((value) >> (nbmant), nbexp) + (nbexp))))
196 196
197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) 197#define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value)
diff --git a/include/linux/in.h b/include/linux/in.h
index 2619859f6e1b..1912e7c0bc26 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -45,6 +45,7 @@ enum {
45 45
46 IPPROTO_COMP = 108, /* Compression Header protocol */ 46 IPPROTO_COMP = 108, /* Compression Header protocol */
47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */ 47 IPPROTO_SCTP = 132, /* Stream Control Transport Protocol */
48 IPPROTO_UDPLITE = 136, /* UDP-Lite (RFC 3828) */
48 49
49 IPPROTO_RAW = 255, /* Raw IP packets */ 50 IPPROTO_RAW = 255, /* Raw IP packets */
50 IPPROTO_MAX 51 IPPROTO_MAX
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 9be6a4756f0b..4e8350ae8869 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -54,7 +54,7 @@ extern const struct in6_addr in6addr_loopback;
54struct sockaddr_in6 { 54struct sockaddr_in6 {
55 unsigned short int sin6_family; /* AF_INET6 */ 55 unsigned short int sin6_family; /* AF_INET6 */
56 __be16 sin6_port; /* Transport layer port # */ 56 __be16 sin6_port; /* Transport layer port # */
57 __u32 sin6_flowinfo; /* IPv6 flow information */ 57 __be32 sin6_flowinfo; /* IPv6 flow information */
58 struct in6_addr sin6_addr; /* IPv6 address */ 58 struct in6_addr sin6_addr; /* IPv6 address */
59 __u32 sin6_scope_id; /* scope id (new in RFC2553) */ 59 __u32 sin6_scope_id; /* scope id (new in RFC2553) */
60}; 60};
@@ -72,7 +72,7 @@ struct ipv6_mreq {
72struct in6_flowlabel_req 72struct in6_flowlabel_req
73{ 73{
74 struct in6_addr flr_dst; 74 struct in6_addr flr_dst;
75 __u32 flr_label; 75 __be32 flr_label;
76 __u8 flr_action; 76 __u8 flr_action;
77 __u8 flr_share; 77 __u8 flr_share;
78 __u16 flr_flags; 78 __u16 flr_flags;
@@ -225,7 +225,7 @@ struct in6_flowlabel_req
225#endif 225#endif
226 226
227/* 227/*
228 * Netfilter 228 * Netfilter (1)
229 * 229 *
230 * Following socket options are used in ip6_tables; 230 * Following socket options are used in ip6_tables;
231 * see include/linux/netfilter_ipv6/ip6_tables.h. 231 * see include/linux/netfilter_ipv6/ip6_tables.h.
@@ -240,4 +240,14 @@ struct in6_flowlabel_req
240#define IPV6_RECVTCLASS 66 240#define IPV6_RECVTCLASS 66
241#define IPV6_TCLASS 67 241#define IPV6_TCLASS 67
242 242
243/*
244 * Netfilter (2)
245 *
246 * Following socket options are used in ip6_tables;
247 * see include/linux/netfilter_ipv6/ip6_tables.h.
248 *
249 * IP6T_SO_GET_REVISION_MATCH 68
250 * IP6T_SO_GET_REVISION_TARGET 69
251 */
252
243#endif 253#endif
diff --git a/include/linux/inet.h b/include/linux/inet.h
index b7c6da7d6d32..675a7dbe86f8 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -46,7 +46,7 @@
46#include <linux/types.h> 46#include <linux/types.h>
47 47
48extern __be32 in_aton(const char *str); 48extern __be32 in_aton(const char *str);
49extern int in4_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); 49extern int in4_pton(const char *src, int srclen, u8 *dst, int delim, const char **end);
50extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end); 50extern int in6_pton(const char *src, int srclen, u8 *dst, int delim, const char **end);
51#endif 51#endif
52#endif /* _LINUX_INET_H */ 52#endif /* _LINUX_INET_H */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 5a0ab04627bc..c0f7aec331c2 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -124,12 +124,13 @@ static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa)
124 * Check if a mask is acceptable. 124 * Check if a mask is acceptable.
125 */ 125 */
126 126
127static __inline__ int bad_mask(u32 mask, u32 addr) 127static __inline__ int bad_mask(__be32 mask, __be32 addr)
128{ 128{
129 __u32 hmask;
129 if (addr & (mask = ~mask)) 130 if (addr & (mask = ~mask))
130 return 1; 131 return 1;
131 mask = ntohl(mask); 132 hmask = ntohl(mask);
132 if (mask & (mask+1)) 133 if (hmask & (hmask+1))
133 return 1; 134 return 1;
134 return 0; 135 return 0;
135} 136}
@@ -190,11 +191,12 @@ static __inline__ __be32 inet_make_mask(int logmask)
190 return 0; 191 return 0;
191} 192}
192 193
193static __inline__ int inet_mask_len(__u32 mask) 194static __inline__ int inet_mask_len(__be32 mask)
194{ 195{
195 if (!(mask = ntohl(mask))) 196 __u32 hmask = ntohl(mask);
197 if (!hmask)
196 return 0; 198 return 0;
197 return 32 - ffz(~mask); 199 return 32 - ffz(~hmask);
198} 200}
199 201
200 202
diff --git a/include/linux/init.h b/include/linux/init.h
index e92b1455d7af..5eb5d24b7680 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -84,19 +84,37 @@ extern void setup_arch(char **);
84 * by link order. 84 * by link order.
85 * For backwards compatibility, initcall() puts the call in 85 * For backwards compatibility, initcall() puts the call in
86 * the device init subsection. 86 * the device init subsection.
87 *
88 * The `id' arg to __define_initcall() is needed so that multiple initcalls
89 * can point at the same handler without causing duplicate-symbol build errors.
87 */ 90 */
88 91
89#define __define_initcall(level,fn) \ 92#define __define_initcall(level,fn,id) \
90 static initcall_t __initcall_##fn __attribute_used__ \ 93 static initcall_t __initcall_##fn##id __attribute_used__ \
91 __attribute__((__section__(".initcall" level ".init"))) = fn 94 __attribute__((__section__(".initcall" level ".init"))) = fn
92 95
93#define core_initcall(fn) __define_initcall("1",fn) 96/*
94#define postcore_initcall(fn) __define_initcall("2",fn) 97 * A "pure" initcall has no dependencies on anything else, and purely
95#define arch_initcall(fn) __define_initcall("3",fn) 98 * initializes variables that couldn't be statically initialized.
96#define subsys_initcall(fn) __define_initcall("4",fn) 99 *
97#define fs_initcall(fn) __define_initcall("5",fn) 100 * This only exists for built-in code, not for modules.
98#define device_initcall(fn) __define_initcall("6",fn) 101 */
99#define late_initcall(fn) __define_initcall("7",fn) 102#define pure_initcall(fn) __define_initcall("0",fn,1)
103
104#define core_initcall(fn) __define_initcall("1",fn,1)
105#define core_initcall_sync(fn) __define_initcall("1s",fn,1s)
106#define postcore_initcall(fn) __define_initcall("2",fn,2)
107#define postcore_initcall_sync(fn) __define_initcall("2s",fn,2s)
108#define arch_initcall(fn) __define_initcall("3",fn,3)
109#define arch_initcall_sync(fn) __define_initcall("3s",fn,3s)
110#define subsys_initcall(fn) __define_initcall("4",fn,4)
111#define subsys_initcall_sync(fn) __define_initcall("4s",fn,4s)
112#define fs_initcall(fn) __define_initcall("5",fn,5)
113#define fs_initcall_sync(fn) __define_initcall("5s",fn,5s)
114#define device_initcall(fn) __define_initcall("6",fn,6)
115#define device_initcall_sync(fn) __define_initcall("6s",fn,6s)
116#define late_initcall(fn) __define_initcall("7",fn,7)
117#define late_initcall_sync(fn) __define_initcall("7s",fn,7s)
100 118
101#define __initcall(fn) device_initcall(fn) 119#define __initcall(fn) device_initcall(fn)
102 120
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index d42c83399071..cf8696d4a138 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -89,6 +89,7 @@ struct resource_list {
89#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */ 89#define IORESOURCE_ROM_ENABLE (1<<0) /* ROM is enabled, same as PCI_ROM_ADDRESS_ENABLE */
90#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */ 90#define IORESOURCE_ROM_SHADOW (1<<1) /* ROM is copy at C000:0 */
91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */ 91#define IORESOURCE_ROM_COPY (1<<2) /* ROM is alloc'd copy, resource field overlaid */
92#define IORESOURCE_ROM_BIOS_COPY (1<<3) /* ROM is BIOS copy, resource field overlaid */
92 93
93/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 94/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
94extern struct resource ioport_resource; 95extern struct resource ioport_resource;
diff --git a/include/linux/ip.h b/include/linux/ip.h
index ecee9bb27d0e..1d36b971a8b5 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -98,7 +98,7 @@ struct iphdr {
98 __be16 frag_off; 98 __be16 frag_off;
99 __u8 ttl; 99 __u8 ttl;
100 __u8 protocol; 100 __u8 protocol;
101 __be16 check; 101 __sum16 check;
102 __be32 saddr; 102 __be32 saddr;
103 __be32 daddr; 103 __be32 daddr;
104 /*The options start here. */ 104 /*The options start here. */
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index 5c23aeb104ca..af3f4a70f3df 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -25,7 +25,7 @@ struct ip6_tnl_parm {
25 __u8 proto; /* tunnel protocol */ 25 __u8 proto; /* tunnel protocol */
26 __u8 encap_limit; /* encapsulation limit for tunnel */ 26 __u8 encap_limit; /* encapsulation limit for tunnel */
27 __u8 hop_limit; /* hop limit for tunnel */ 27 __u8 hop_limit; /* hop limit for tunnel */
28 __u32 flowinfo; /* traffic class and flowlabel for tunnel */ 28 __be32 flowinfo; /* traffic class and flowlabel for tunnel */
29 __u32 flags; /* tunnel flags */ 29 __u32 flags; /* tunnel flags */
30 struct in6_addr laddr; /* local tunnel end-point address */ 30 struct in6_addr laddr; /* local tunnel end-point address */
31 struct in6_addr raddr; /* remote tunnel end-point address */ 31 struct in6_addr raddr; /* remote tunnel end-point address */
diff --git a/include/linux/ipmi_msgdefs.h b/include/linux/ipmi_msgdefs.h
index 22f5e2afda4f..4d04d8b58a0a 100644
--- a/include/linux/ipmi_msgdefs.h
+++ b/include/linux/ipmi_msgdefs.h
@@ -75,6 +75,8 @@
75#define IPMI_INVALID_COMMAND_ERR 0xc1 75#define IPMI_INVALID_COMMAND_ERR 0xc1
76#define IPMI_ERR_MSG_TRUNCATED 0xc6 76#define IPMI_ERR_MSG_TRUNCATED 0xc6
77#define IPMI_LOST_ARBITRATION_ERR 0x81 77#define IPMI_LOST_ARBITRATION_ERR 0x81
78#define IPMI_BUS_ERR 0x82
79#define IPMI_NAK_ON_WRITE_ERR 0x83
78#define IPMI_ERR_UNSPECIFIED 0xff 80#define IPMI_ERR_UNSPECIFIED 0xff
79 81
80#define IPMI_CHANNEL_PROTOCOL_IPMB 1 82#define IPMI_CHANNEL_PROTOCOL_IPMB 1
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 4f435c59de06..f8241130f5ea 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -274,7 +274,7 @@ struct ipv6_pinfo {
274 struct in6_addr *saddr_cache; 274 struct in6_addr *saddr_cache;
275#endif 275#endif
276 276
277 __u32 flow_label; 277 __be32 flow_label;
278 __u32 frag_size; 278 __u32 frag_size;
279 __s16 hop_limit; 279 __s16 hop_limit;
280 __s16 mcast_hops; 280 __s16 mcast_hops;
diff --git a/include/linux/ipx.h b/include/linux/ipx.h
index 4f29c60964c4..eb19b4ea84f4 100644
--- a/include/linux/ipx.h
+++ b/include/linux/ipx.h
@@ -7,8 +7,8 @@
7 7
8struct sockaddr_ipx { 8struct sockaddr_ipx {
9 sa_family_t sipx_family; 9 sa_family_t sipx_family;
10 __u16 sipx_port; 10 __be16 sipx_port;
11 __u32 sipx_network; 11 __be32 sipx_network;
12 unsigned char sipx_node[IPX_NODE_LEN]; 12 unsigned char sipx_node[IPX_NODE_LEN];
13 __u8 sipx_type; 13 __u8 sipx_type;
14 unsigned char sipx_zero; /* 16 byte fill */ 14 unsigned char sipx_zero; /* 16 byte fill */
@@ -23,13 +23,13 @@ struct sockaddr_ipx {
23#define IPX_CRTITF 1 23#define IPX_CRTITF 1
24 24
25struct ipx_route_definition { 25struct ipx_route_definition {
26 __u32 ipx_network; 26 __be32 ipx_network;
27 __u32 ipx_router_network; 27 __be32 ipx_router_network;
28 unsigned char ipx_router_node[IPX_NODE_LEN]; 28 unsigned char ipx_router_node[IPX_NODE_LEN];
29}; 29};
30 30
31struct ipx_interface_definition { 31struct ipx_interface_definition {
32 __u32 ipx_network; 32 __be32 ipx_network;
33 unsigned char ipx_device[16]; 33 unsigned char ipx_device[16];
34 unsigned char ipx_dlink_type; 34 unsigned char ipx_dlink_type;
35#define IPX_FRAME_NONE 0 35#define IPX_FRAME_NONE 0
@@ -55,8 +55,8 @@ struct ipx_config_data {
55 */ 55 */
56 56
57struct ipx_route_def { 57struct ipx_route_def {
58 __u32 ipx_network; 58 __be32 ipx_network;
59 __u32 ipx_router_network; 59 __be32 ipx_router_network;
60#define IPX_ROUTE_NO_ROUTER 0 60#define IPX_ROUTE_NO_ROUTER 0
61 unsigned char ipx_router_node[IPX_NODE_LEN]; 61 unsigned char ipx_router_node[IPX_NODE_LEN];
62 unsigned char ipx_device[16]; 62 unsigned char ipx_device[16];
diff --git a/include/linux/irq.h b/include/linux/irq.h
index c64f3cc7e870..52fc4052a0ae 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -141,6 +141,7 @@ struct irq_chip {
141 * @pending_mask: pending rebalanced interrupts 141 * @pending_mask: pending rebalanced interrupts
142 * @dir: /proc/irq/ procfs entry 142 * @dir: /proc/irq/ procfs entry
143 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP 143 * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP
144 * @name: flow handler name for /proc/interrupts output
144 * 145 *
145 * Pad this out to 32 bytes for cache and indexing reasons. 146 * Pad this out to 32 bytes for cache and indexing reasons.
146 */ 147 */
@@ -165,8 +166,9 @@ struct irq_desc {
165 cpumask_t pending_mask; 166 cpumask_t pending_mask;
166#endif 167#endif
167#ifdef CONFIG_PROC_FS 168#ifdef CONFIG_PROC_FS
168 struct proc_dir_entry *dir; 169 struct proc_dir_entry *dir;
169#endif 170#endif
171 const char *name;
170} ____cacheline_aligned; 172} ____cacheline_aligned;
171 173
172extern struct irq_desc irq_desc[NR_IRQS]; 174extern struct irq_desc irq_desc[NR_IRQS];
@@ -272,12 +274,6 @@ extern void fastcall handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
272extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc); 274extern void fastcall handle_bad_irq(unsigned int irq, struct irq_desc *desc);
273 275
274/* 276/*
275 * Get a descriptive string for the highlevel handler, for
276 * /proc/interrupts output:
277 */
278extern const char *handle_irq_name(irq_flow_handler_t handle);
279
280/*
281 * Monolithic do_IRQ implementation. 277 * Monolithic do_IRQ implementation.
282 * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly) 278 * (is an explicit fastcall, because i386 4KSTACKS calls it from assembly)
283 */ 279 */
@@ -329,7 +325,12 @@ extern void
329set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip, 325set_irq_chip_and_handler(unsigned int irq, struct irq_chip *chip,
330 irq_flow_handler_t handle); 326 irq_flow_handler_t handle);
331extern void 327extern void
332__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained); 328set_irq_chip_and_handler_name(unsigned int irq, struct irq_chip *chip,
329 irq_flow_handler_t handle, const char *name);
330
331extern void
332__set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
333 const char *name);
333 334
334/* 335/*
335 * Set a highlevel flow handler for a given IRQ: 336 * Set a highlevel flow handler for a given IRQ:
@@ -337,7 +338,7 @@ __set_irq_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained);
337static inline void 338static inline void
338set_irq_handler(unsigned int irq, irq_flow_handler_t handle) 339set_irq_handler(unsigned int irq, irq_flow_handler_t handle)
339{ 340{
340 __set_irq_handler(irq, handle, 0); 341 __set_irq_handler(irq, handle, 0, NULL);
341} 342}
342 343
343/* 344/*
@@ -349,7 +350,7 @@ static inline void
349set_irq_chained_handler(unsigned int irq, 350set_irq_chained_handler(unsigned int irq,
350 irq_flow_handler_t handle) 351 irq_flow_handler_t handle)
351{ 352{
352 __set_irq_handler(irq, handle, 1); 353 __set_irq_handler(irq, handle, 1, NULL);
353} 354}
354 355
355/* Handle dynamic irq creation and destruction */ 356/* Handle dynamic irq creation and destruction */
diff --git a/include/linux/ixjuser.h b/include/linux/ixjuser.h
index fd1756d3a47e..88b45895746d 100644
--- a/include/linux/ixjuser.h
+++ b/include/linux/ixjuser.h
@@ -315,7 +315,7 @@ typedef struct {
315* structures. If the freq0 variable is non-zero, the tone table contents 315* structures. If the freq0 variable is non-zero, the tone table contents
316* for the tone_index are updated to the frequencies and gains defined. It 316* for the tone_index are updated to the frequencies and gains defined. It
317* should be noted that DTMF tones cannot be reassigned, so if DTMF tone 317* should be noted that DTMF tones cannot be reassigned, so if DTMF tone
318* table indexs are used in a cadence the frequency and gain variables will 318* table indexes are used in a cadence the frequency and gain variables will
319* be ignored. 319* be ignored.
320* 320*
321* If the array elements contain frequency parameters the driver will 321* If the array elements contain frequency parameters the driver will
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index c8d5f207c3d4..0ec6e28bccd2 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -74,7 +74,7 @@
74#define __jiffy_data __attribute__((section(".data"))) 74#define __jiffy_data __attribute__((section(".data")))
75 75
76/* 76/*
77 * The 64-bit value is not volatile - you MUST NOT read it 77 * The 64-bit value is not atomic - you MUST NOT read it
78 * without sampling the sequence number in xtime_lock. 78 * without sampling the sequence number in xtime_lock.
79 * get_jiffies_64() will do this for you as appropriate. 79 * get_jiffies_64() will do this for you as appropriate.
80 */ 80 */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 80f39cab470a..6738283ac385 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -30,8 +30,10 @@ extern const char linux_banner[];
30 30
31#define STACK_MAGIC 0xdeadbeef 31#define STACK_MAGIC 0xdeadbeef
32 32
33#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
34#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask))
35
33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 36#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
34#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 37#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
36#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 38#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
37#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 39#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
@@ -63,7 +65,7 @@ struct user;
63 * context (spinlock, irq-handler, ...). 65 * context (spinlock, irq-handler, ...).
64 * 66 *
65 * This is a useful debugging help to be able to catch problems early and not 67 * This is a useful debugging help to be able to catch problems early and not
66 * be biten later when the calling function happens to sleep when it is not 68 * be bitten later when the calling function happens to sleep when it is not
67 * supposed to. 69 * supposed to.
68 */ 70 */
69#ifdef CONFIG_PREEMPT_VOLUNTARY 71#ifdef CONFIG_PREEMPT_VOLUNTARY
@@ -171,6 +173,8 @@ __attribute_const__ roundup_pow_of_two(unsigned long x)
171 173
172extern int printk_ratelimit(void); 174extern int printk_ratelimit(void);
173extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst); 175extern int __printk_ratelimit(int ratelimit_jiffies, int ratelimit_burst);
176extern bool printk_timed_ratelimit(unsigned long *caller_jiffies,
177 unsigned int interval_msec);
174 178
175static inline void console_silent(void) 179static inline void console_silent(void)
176{ 180{
diff --git a/include/linux/kexec.h b/include/linux/kexec.h
index 6427949ddf99..a4ede62b339d 100644
--- a/include/linux/kexec.h
+++ b/include/linux/kexec.h
@@ -122,6 +122,8 @@ extern struct kimage *kexec_crash_image;
122#define KEXEC_ARCH_IA_64 (50 << 16) 122#define KEXEC_ARCH_IA_64 (50 << 16)
123#define KEXEC_ARCH_S390 (22 << 16) 123#define KEXEC_ARCH_S390 (22 << 16)
124#define KEXEC_ARCH_SH (42 << 16) 124#define KEXEC_ARCH_SH (42 << 16)
125#define KEXEC_ARCH_MIPS_LE (10 << 16)
126#define KEXEC_ARCH_MIPS ( 8 << 16)
125 127
126#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */ 128#define KEXEC_FLAGS (KEXEC_ON_CRASH) /* List of defined/legal kexec flags */
127 129
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index bcd9cd173c2c..d1c8d28fa92e 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -47,6 +47,7 @@ enum kobject_action {
47 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ 47 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */
48 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ 48 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */
49 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ 49 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */
50 KOBJ_MOVE = (__force kobject_action_t) 0x08, /* device move */
50}; 51};
51 52
52struct kobject { 53struct kobject {
@@ -76,6 +77,7 @@ extern int __must_check kobject_add(struct kobject *);
76extern void kobject_del(struct kobject *); 77extern void kobject_del(struct kobject *);
77 78
78extern int __must_check kobject_rename(struct kobject *, const char *new_name); 79extern int __must_check kobject_rename(struct kobject *, const char *new_name);
80extern int __must_check kobject_move(struct kobject *, struct kobject *);
79 81
80extern int __must_check kobject_register(struct kobject *); 82extern int __must_check kobject_register(struct kobject *);
81extern void kobject_unregister(struct kobject *); 83extern void kobject_unregister(struct kobject *);
@@ -264,6 +266,8 @@ extern int __must_check subsys_create_file(struct subsystem * ,
264 266
265#if defined(CONFIG_HOTPLUG) 267#if defined(CONFIG_HOTPLUG)
266void kobject_uevent(struct kobject *kobj, enum kobject_action action); 268void kobject_uevent(struct kobject *kobj, enum kobject_action action);
269void kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
270 char *envp[]);
267 271
268int add_uevent_var(char **envp, int num_envp, int *cur_index, 272int add_uevent_var(char **envp, int num_envp, int *cur_index,
269 char *buffer, int buffer_size, int *cur_len, 273 char *buffer, int buffer_size, int *cur_len,
@@ -271,6 +275,10 @@ int add_uevent_var(char **envp, int num_envp, int *cur_index,
271 __attribute__((format (printf, 7, 8))); 275 __attribute__((format (printf, 7, 8)));
272#else 276#else
273static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { } 277static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { }
278static inline void kobject_uevent_env(struct kobject *kobj,
279 enum kobject_action action,
280 char *envp[])
281{ }
274 282
275static inline int add_uevent_var(char **envp, int num_envp, int *cur_index, 283static inline int add_uevent_var(char **envp, int num_envp, int *cur_index,
276 char *buffer, int buffer_size, int *cur_len, 284 char *buffer, int buffer_size, int *cur_len,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index d0a7ad5ed518..abd2debebca2 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -143,7 +143,7 @@ enum {
143 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 143 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
144 144
145 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 145 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
146 ATA_DFLAG_NCQ_OFF = (1 << 9), /* devied limited to non-NCQ mode */ 146 ATA_DFLAG_NCQ_OFF = (1 << 9), /* device limited to non-NCQ mode */
147 ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */ 147 ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */
148 ATA_DFLAG_INIT_MASK = (1 << 16) - 1, 148 ATA_DFLAG_INIT_MASK = (1 << 16) - 1,
149 149
@@ -702,7 +702,6 @@ extern int ata_std_prereset(struct ata_port *ap);
702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 702extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 703extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 704extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
705extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
706extern void ata_port_disable(struct ata_port *); 705extern void ata_port_disable(struct ata_port *);
707extern void ata_std_ports(struct ata_ioports *ioaddr); 706extern void ata_std_ports(struct ata_ioports *ioaddr);
708#ifdef CONFIG_PCI 707#ifdef CONFIG_PCI
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 81e3a185f951..aa50d89eacd7 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -10,6 +10,11 @@
10#define LINUX_LOCKD_BIND_H 10#define LINUX_LOCKD_BIND_H
11 11
12#include <linux/lockd/nlm.h> 12#include <linux/lockd/nlm.h>
13/* need xdr-encoded error codes too, so... */
14#include <linux/lockd/xdr.h>
15#ifdef CONFIG_LOCKD_V4
16#include <linux/lockd/xdr4.h>
17#endif
13 18
14/* Dummy declarations */ 19/* Dummy declarations */
15struct svc_rqst; 20struct svc_rqst;
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 2909619c0295..862d9730a60d 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -154,7 +154,7 @@ int nlm_async_reply(struct nlm_rqst *, u32, const struct rpc_call_ops *);
154struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl); 154struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock *fl);
155void nlmclnt_finish_block(struct nlm_wait *block); 155void nlmclnt_finish_block(struct nlm_wait *block);
156int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); 156int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout);
157u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); 157__be32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *);
158void nlmclnt_recovery(struct nlm_host *); 158void nlmclnt_recovery(struct nlm_host *);
159int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); 159int nlmclnt_reclaim(struct nlm_host *, struct file_lock *);
160void nlmclnt_next_cookie(struct nlm_cookie *); 160void nlmclnt_next_cookie(struct nlm_cookie *);
@@ -184,12 +184,12 @@ typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref)
184/* 184/*
185 * Server-side lock handling 185 * Server-side lock handling
186 */ 186 */
187u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 187__be32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
188 struct nlm_lock *, int, struct nlm_cookie *); 188 struct nlm_lock *, int, struct nlm_cookie *);
189u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 189__be32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
190u32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, 190__be32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *,
191 struct nlm_lock *); 191 struct nlm_lock *);
192u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); 192__be32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *);
193unsigned long nlmsvc_retry_blocked(void); 193unsigned long nlmsvc_retry_blocked(void);
194void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, 194void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *,
195 nlm_host_match_fn_t match); 195 nlm_host_match_fn_t match);
@@ -198,7 +198,7 @@ void nlmsvc_grant_reply(struct nlm_cookie *, u32);
198/* 198/*
199 * File handling for the server personality 199 * File handling for the server personality
200 */ 200 */
201u32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **, 201__be32 nlm_lookup_file(struct svc_rqst *, struct nlm_file **,
202 struct nfs_fh *); 202 struct nfs_fh *);
203void nlm_release_file(struct nlm_file *); 203void nlm_release_file(struct nlm_file *);
204void nlmsvc_mark_resources(void); 204void nlmsvc_mark_resources(void);
diff --git a/include/linux/lockd/share.h b/include/linux/lockd/share.h
index cd7816e74c05..630c5bf69b07 100644
--- a/include/linux/lockd/share.h
+++ b/include/linux/lockd/share.h
@@ -21,9 +21,9 @@ struct nlm_share {
21 u32 s_mode; /* deny mode */ 21 u32 s_mode; /* deny mode */
22}; 22};
23 23
24u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, 24__be32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *,
25 struct nlm_args *); 25 struct nlm_args *);
26u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, 26__be32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *,
27 struct nlm_args *); 27 struct nlm_args *);
28void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, 28void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *,
29 nlm_host_match_fn_t); 29 nlm_host_match_fn_t);
diff --git a/include/linux/lockd/xdr.h b/include/linux/lockd/xdr.h
index bb0a0f1caa91..29e7d9fc9dad 100644
--- a/include/linux/lockd/xdr.h
+++ b/include/linux/lockd/xdr.h
@@ -13,6 +13,8 @@
13#include <linux/nfs.h> 13#include <linux/nfs.h>
14#include <linux/sunrpc/xdr.h> 14#include <linux/sunrpc/xdr.h>
15 15
16struct svc_rqst;
17
16#define NLM_MAXCOOKIELEN 32 18#define NLM_MAXCOOKIELEN 32
17#define NLM_MAXSTRLEN 1024 19#define NLM_MAXSTRLEN 1024
18 20
@@ -22,6 +24,8 @@
22#define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED) 24#define nlm_lck_blocked __constant_htonl(NLM_LCK_BLOCKED)
23#define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD) 25#define nlm_lck_denied_grace_period __constant_htonl(NLM_LCK_DENIED_GRACE_PERIOD)
24 26
27#define nlm_drop_reply __constant_htonl(30000)
28
25/* Lock info passed via NLM */ 29/* Lock info passed via NLM */
26struct nlm_lock { 30struct nlm_lock {
27 char * caller; 31 char * caller;
@@ -86,19 +90,19 @@ struct nlm_reboot {
86 */ 90 */
87#define NLMSVC_XDRSIZE sizeof(struct nlm_args) 91#define NLMSVC_XDRSIZE sizeof(struct nlm_args)
88 92
89int nlmsvc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); 93int nlmsvc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *);
90int nlmsvc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); 94int nlmsvc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
91int nlmsvc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); 95int nlmsvc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
92int nlmsvc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); 96int nlmsvc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *);
93int nlmsvc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); 97int nlmsvc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
94int nlmsvc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); 98int nlmsvc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
95int nlmsvc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); 99int nlmsvc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
96int nlmsvc_encode_void(struct svc_rqst *, u32 *, void *); 100int nlmsvc_encode_void(struct svc_rqst *, __be32 *, void *);
97int nlmsvc_decode_void(struct svc_rqst *, u32 *, void *); 101int nlmsvc_decode_void(struct svc_rqst *, __be32 *, void *);
98int nlmsvc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); 102int nlmsvc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *);
99int nlmsvc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); 103int nlmsvc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
100int nlmsvc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); 104int nlmsvc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *);
101int nlmsvc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); 105int nlmsvc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *);
102/* 106/*
103int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); 107int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
104int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); 108int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h
index 3cc1ae25009b..dd12b4c9e613 100644
--- a/include/linux/lockd/xdr4.h
+++ b/include/linux/lockd/xdr4.h
@@ -23,19 +23,19 @@
23 23
24 24
25 25
26int nlm4svc_decode_testargs(struct svc_rqst *, u32 *, struct nlm_args *); 26int nlm4svc_decode_testargs(struct svc_rqst *, __be32 *, struct nlm_args *);
27int nlm4svc_encode_testres(struct svc_rqst *, u32 *, struct nlm_res *); 27int nlm4svc_encode_testres(struct svc_rqst *, __be32 *, struct nlm_res *);
28int nlm4svc_decode_lockargs(struct svc_rqst *, u32 *, struct nlm_args *); 28int nlm4svc_decode_lockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
29int nlm4svc_decode_cancargs(struct svc_rqst *, u32 *, struct nlm_args *); 29int nlm4svc_decode_cancargs(struct svc_rqst *, __be32 *, struct nlm_args *);
30int nlm4svc_decode_unlockargs(struct svc_rqst *, u32 *, struct nlm_args *); 30int nlm4svc_decode_unlockargs(struct svc_rqst *, __be32 *, struct nlm_args *);
31int nlm4svc_encode_res(struct svc_rqst *, u32 *, struct nlm_res *); 31int nlm4svc_encode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
32int nlm4svc_decode_res(struct svc_rqst *, u32 *, struct nlm_res *); 32int nlm4svc_decode_res(struct svc_rqst *, __be32 *, struct nlm_res *);
33int nlm4svc_encode_void(struct svc_rqst *, u32 *, void *); 33int nlm4svc_encode_void(struct svc_rqst *, __be32 *, void *);
34int nlm4svc_decode_void(struct svc_rqst *, u32 *, void *); 34int nlm4svc_decode_void(struct svc_rqst *, __be32 *, void *);
35int nlm4svc_decode_shareargs(struct svc_rqst *, u32 *, struct nlm_args *); 35int nlm4svc_decode_shareargs(struct svc_rqst *, __be32 *, struct nlm_args *);
36int nlm4svc_encode_shareres(struct svc_rqst *, u32 *, struct nlm_res *); 36int nlm4svc_encode_shareres(struct svc_rqst *, __be32 *, struct nlm_res *);
37int nlm4svc_decode_notify(struct svc_rqst *, u32 *, struct nlm_args *); 37int nlm4svc_decode_notify(struct svc_rqst *, __be32 *, struct nlm_args *);
38int nlm4svc_decode_reboot(struct svc_rqst *, u32 *, struct nlm_reboot *); 38int nlm4svc_decode_reboot(struct svc_rqst *, __be32 *, struct nlm_reboot *);
39/* 39/*
40int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *); 40int nlmclt_encode_testargs(struct rpc_rqst *, u32 *, struct nlm_args *);
41int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *); 41int nlmclt_encode_lockargs(struct rpc_rqst *, u32 *, struct nlm_args *);
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index 1314ca0f29be..819f08f1310d 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -202,7 +202,7 @@ extern int lockdep_internal(void);
202 */ 202 */
203 203
204extern void lockdep_init_map(struct lockdep_map *lock, const char *name, 204extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
205 struct lock_class_key *key); 205 struct lock_class_key *key, int subclass);
206 206
207/* 207/*
208 * Reinitialize a lock key - for cases where there is special locking or 208 * Reinitialize a lock key - for cases where there is special locking or
@@ -211,9 +211,14 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
211 * or they are too narrow (they suffer from a false class-split): 211 * or they are too narrow (they suffer from a false class-split):
212 */ 212 */
213#define lockdep_set_class(lock, key) \ 213#define lockdep_set_class(lock, key) \
214 lockdep_init_map(&(lock)->dep_map, #key, key) 214 lockdep_init_map(&(lock)->dep_map, #key, key, 0)
215#define lockdep_set_class_and_name(lock, key, name) \ 215#define lockdep_set_class_and_name(lock, key, name) \
216 lockdep_init_map(&(lock)->dep_map, name, key) 216 lockdep_init_map(&(lock)->dep_map, name, key, 0)
217#define lockdep_set_class_and_subclass(lock, key, sub) \
218 lockdep_init_map(&(lock)->dep_map, #key, key, sub)
219#define lockdep_set_subclass(lock, sub) \
220 lockdep_init_map(&(lock)->dep_map, #lock, \
221 (lock)->dep_map.key, sub)
217 222
218/* 223/*
219 * Acquire a lock. 224 * Acquire a lock.
@@ -257,10 +262,14 @@ static inline int lockdep_internal(void)
257# define lock_release(l, n, i) do { } while (0) 262# define lock_release(l, n, i) do { } while (0)
258# define lockdep_init() do { } while (0) 263# define lockdep_init() do { } while (0)
259# define lockdep_info() do { } while (0) 264# define lockdep_info() do { } while (0)
260# define lockdep_init_map(lock, name, key) do { (void)(key); } while (0) 265# define lockdep_init_map(lock, name, key, sub) do { (void)(key); } while (0)
261# define lockdep_set_class(lock, key) do { (void)(key); } while (0) 266# define lockdep_set_class(lock, key) do { (void)(key); } while (0)
262# define lockdep_set_class_and_name(lock, key, name) \ 267# define lockdep_set_class_and_name(lock, key, name) \
263 do { (void)(key); } while (0) 268 do { (void)(key); } while (0)
269#define lockdep_set_class_and_subclass(lock, key, sub) \
270 do { (void)(key); } while (0)
271#define lockdep_set_subclass(lock, sub) do { } while (0)
272
264# define INIT_LOCKDEP 273# define INIT_LOCKDEP
265# define lockdep_reset() do { debug_locks = 1; } while (0) 274# define lockdep_reset() do { debug_locks = 1; } while (0)
266# define lockdep_free_key_range(start, size) do { } while (0) 275# define lockdep_free_key_range(start, size) do { } while (0)
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 09f0f575ddff..daabb3aa1ec6 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -150,7 +150,7 @@ extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
150extern void mpol_fix_fork_child_flag(struct task_struct *p); 150extern void mpol_fix_fork_child_flag(struct task_struct *p);
151#define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x)) 151#define set_cpuset_being_rebound(x) (cpuset_being_rebound = (x))
152 152
153#ifdef CONFIG_CPUSET 153#ifdef CONFIG_CPUSETS
154#define current_cpuset_is_being_rebound() \ 154#define current_cpuset_is_being_rebound() \
155 (cpuset_being_rebound == current->cpuset) 155 (cpuset_being_rebound == current->cpuset)
156#else 156#else
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index b03cfb91e228..326da7d500c7 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -31,15 +31,14 @@
31#define HPET_MINOR 228 31#define HPET_MINOR 228
32 32
33struct device; 33struct device;
34struct class_device;
35 34
36struct miscdevice { 35struct miscdevice {
37 int minor; 36 int minor;
38 const char *name; 37 const char *name;
39 const struct file_operations *fops; 38 const struct file_operations *fops;
40 struct list_head list; 39 struct list_head list;
41 struct device *dev; 40 struct device *parent;
42 struct class_device *class; 41 struct device *this_device;
43}; 42};
44 43
45extern int misc_register(struct miscdevice * misc); 44extern int misc_register(struct miscdevice * misc);
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 5a6068ff5556..d538de901965 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1115,9 +1115,6 @@ int in_gate_area_no_task(unsigned long addr);
1115#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);}) 1115#define in_gate_area(task, addr) ({(void)task; in_gate_area_no_task(addr);})
1116#endif /* __HAVE_ARCH_GATE_AREA */ 1116#endif /* __HAVE_ARCH_GATE_AREA */
1117 1117
1118/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
1119#define OOM_DISABLE -17
1120
1121int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, 1118int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *,
1122 void __user *, size_t *, loff_t *); 1119 void __user *, size_t *, loff_t *);
1123unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, 1120unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask,
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 991a37382a22..d0e6a5497614 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -39,6 +39,10 @@ struct mmc_csd {
39 write_misalign:1; 39 write_misalign:1;
40}; 40};
41 41
42struct mmc_ext_csd {
43 unsigned int hs_max_dtr;
44};
45
42struct sd_scr { 46struct sd_scr {
43 unsigned char sda_vsn; 47 unsigned char sda_vsn;
44 unsigned char bus_widths; 48 unsigned char bus_widths;
@@ -46,6 +50,10 @@ struct sd_scr {
46#define SD_SCR_BUS_WIDTH_4 (1<<2) 50#define SD_SCR_BUS_WIDTH_4 (1<<2)
47}; 51};
48 52
53struct sd_switch_caps {
54 unsigned int hs_max_dtr;
55};
56
49struct mmc_host; 57struct mmc_host;
50 58
51/* 59/*
@@ -62,12 +70,15 @@ struct mmc_card {
62#define MMC_STATE_BAD (1<<2) /* unrecognised device */ 70#define MMC_STATE_BAD (1<<2) /* unrecognised device */
63#define MMC_STATE_SDCARD (1<<3) /* is an SD card */ 71#define MMC_STATE_SDCARD (1<<3) /* is an SD card */
64#define MMC_STATE_READONLY (1<<4) /* card is read-only */ 72#define MMC_STATE_READONLY (1<<4) /* card is read-only */
73#define MMC_STATE_HIGHSPEED (1<<5) /* card is in high speed mode */
65 u32 raw_cid[4]; /* raw card CID */ 74 u32 raw_cid[4]; /* raw card CID */
66 u32 raw_csd[4]; /* raw card CSD */ 75 u32 raw_csd[4]; /* raw card CSD */
67 u32 raw_scr[2]; /* raw card SCR */ 76 u32 raw_scr[2]; /* raw card SCR */
68 struct mmc_cid cid; /* card identification */ 77 struct mmc_cid cid; /* card identification */
69 struct mmc_csd csd; /* card specific */ 78 struct mmc_csd csd; /* card specific */
79 struct mmc_ext_csd ext_csd; /* mmc v4 extended card specific */
70 struct sd_scr scr; /* extra SD information */ 80 struct sd_scr scr; /* extra SD information */
81 struct sd_switch_caps sw_caps; /* switch (CMD6) caps */
71}; 82};
72 83
73#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) 84#define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT)
@@ -75,12 +86,14 @@ struct mmc_card {
75#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) 86#define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD)
76#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) 87#define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD)
77#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) 88#define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY)
89#define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED)
78 90
79#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) 91#define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT)
80#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) 92#define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD)
81#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) 93#define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD)
82#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) 94#define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD)
83#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) 95#define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY)
96#define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED)
84 97
85#define mmc_card_name(c) ((c)->cid.prod_name) 98#define mmc_card_name(c) ((c)->cid.prod_name)
86#define mmc_card_id(c) ((c)->dev.bus_id) 99#define mmc_card_id(c) ((c)->dev.bus_id)
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 587264a58d56..528e7d3fecb1 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -74,8 +74,8 @@ struct mmc_card;
74struct device; 74struct device;
75 75
76struct mmc_host { 76struct mmc_host {
77 struct device *dev; 77 struct device *parent;
78 struct class_device class_dev; 78 struct device class_dev;
79 int index; 79 int index;
80 const struct mmc_host_ops *ops; 80 const struct mmc_host_ops *ops;
81 unsigned int f_min; 81 unsigned int f_min;
@@ -125,8 +125,8 @@ static inline void *mmc_priv(struct mmc_host *host)
125 return (void *)host->private; 125 return (void *)host->private;
126} 126}
127 127
128#define mmc_dev(x) ((x)->dev) 128#define mmc_dev(x) ((x)->parent)
129#define mmc_hostname(x) ((x)->class_dev.class_id) 129#define mmc_hostname(x) ((x)->class_dev.bus_id)
130 130
131extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 131extern int mmc_suspend_host(struct mmc_host *, pm_message_t);
132extern int mmc_resume_host(struct mmc_host *); 132extern int mmc_resume_host(struct mmc_host *);
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 08dec8d9e703..2dce60c43f4b 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -25,14 +25,16 @@
25#ifndef MMC_MMC_PROTOCOL_H 25#ifndef MMC_MMC_PROTOCOL_H
26#define MMC_MMC_PROTOCOL_H 26#define MMC_MMC_PROTOCOL_H
27 27
28/* Standard MMC commands (3.1) type argument response */ 28/* Standard MMC commands (4.1) type argument response */
29 /* class 1 */ 29 /* class 1 */
30#define MMC_GO_IDLE_STATE 0 /* bc */ 30#define MMC_GO_IDLE_STATE 0 /* bc */
31#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ 31#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
32#define MMC_ALL_SEND_CID 2 /* bcr R2 */ 32#define MMC_ALL_SEND_CID 2 /* bcr R2 */
33#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ 33#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
34#define MMC_SET_DSR 4 /* bc [31:16] RCA */ 34#define MMC_SET_DSR 4 /* bc [31:16] RCA */
35#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
35#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ 36#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */
37#define MMC_SEND_EXT_CSD 8 /* adtc R1 */
36#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ 38#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */
37#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ 39#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */
38#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ 40#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */
@@ -80,6 +82,7 @@
80 /* class 8 */ 82 /* class 8 */
81/* This is basically the same command as for MMC with some quirks. */ 83/* This is basically the same command as for MMC with some quirks. */
82#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */ 84#define SD_SEND_RELATIVE_ADDR 3 /* bcr R6 */
85#define SD_SWITCH 6 /* adtc [31:0] See below R1 */
83 86
84 /* Application commands */ 87 /* Application commands */
85#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */ 88#define SD_APP_SET_BUS_WIDTH 6 /* ac [1:0] bus width R1 */
@@ -88,6 +91,30 @@
88#define SD_APP_SEND_SCR 51 /* adtc R1 */ 91#define SD_APP_SEND_SCR 51 /* adtc R1 */
89 92
90/* 93/*
94 * MMC_SWITCH argument format:
95 *
96 * [31:26] Always 0
97 * [25:24] Access Mode
98 * [23:16] Location of target Byte in EXT_CSD
99 * [15:08] Value Byte
100 * [07:03] Always 0
101 * [02:00] Command Set
102 */
103
104/*
105 * SD_SWITCH argument format:
106 *
107 * [31] Check (0) or switch (1)
108 * [30:24] Reserved (0)
109 * [23:20] Function group 6
110 * [19:16] Function group 5
111 * [15:12] Function group 4
112 * [11:8] Function group 3
113 * [7:4] Function group 2
114 * [3:0] Function group 1
115 */
116
117/*
91 MMC status in R1 118 MMC status in R1
92 Type 119 Type
93 e : error bit 120 e : error bit
@@ -230,13 +257,54 @@ struct _mmc_csd {
230 257
231#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ 258#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */
232#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ 259#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */
233#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 */ 260#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */
261#define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */
234 262
235#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ 263#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */
236#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ 264#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */
237#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ 265#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */
238#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ 266#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */
267#define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */
268
269/*
270 * EXT_CSD fields
271 */
272
273#define EXT_CSD_BUS_WIDTH 183 /* R/W */
274#define EXT_CSD_HS_TIMING 185 /* R/W */
275#define EXT_CSD_CARD_TYPE 196 /* RO */
276
277/*
278 * EXT_CSD field definitions
279 */
280
281#define EXT_CSD_CMD_SET_NORMAL (1<<0)
282#define EXT_CSD_CMD_SET_SECURE (1<<1)
283#define EXT_CSD_CMD_SET_CPSECURE (1<<2)
284
285#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
286#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
287
288#define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */
289#define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */
290#define EXT_CSD_BUS_WIDTH_8 2 /* Card is in 8 bit mode */
291
292/*
293 * MMC_SWITCH access modes
294 */
295
296#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */
297#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */
298#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
299#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
300
301/*
302 * SCR field definitions
303 */
239 304
305#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
306#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
307#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */
240 308
241/* 309/*
242 * SD bus widths 310 * SD bus widths
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 59855b8718a0..e06683e2bea3 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -218,13 +218,9 @@ struct zone {
218 * under - it drives the swappiness decision: whether to unmap mapped 218 * under - it drives the swappiness decision: whether to unmap mapped
219 * pages. 219 * pages.
220 * 220 *
221 * temp_priority is used to remember the scanning priority at which 221 * Access to both this field is quite racy even on uniprocessor. But
222 * this zone was successfully refilled to free_pages == pages_high.
223 *
224 * Access to both these fields is quite racy even on uniprocessor. But
225 * it is expected to average out OK. 222 * it is expected to average out OK.
226 */ 223 */
227 int temp_priority;
228 int prev_priority; 224 int prev_priority;
229 225
230 226
@@ -674,6 +670,12 @@ void sparse_init(void);
674#define sparse_index_init(_sec, _nid) do {} while (0) 670#define sparse_index_init(_sec, _nid) do {} while (0)
675#endif /* CONFIG_SPARSEMEM */ 671#endif /* CONFIG_SPARSEMEM */
676 672
673#ifdef CONFIG_NODES_SPAN_OTHER_NODES
674#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid))
675#else
676#define early_pfn_in_nid(pfn, nid) (1)
677#endif
678
677#ifndef early_pfn_valid 679#ifndef early_pfn_valid
678#define early_pfn_valid(pfn) (1) 680#define early_pfn_valid(pfn) (1)
679#endif 681#endif
diff --git a/include/linux/module.h b/include/linux/module.h
index d1d00ce8f4ed..9258ffd8a7f0 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -264,6 +264,7 @@ struct module
264 struct module_attribute *modinfo_attrs; 264 struct module_attribute *modinfo_attrs;
265 const char *version; 265 const char *version;
266 const char *srcversion; 266 const char *srcversion;
267 struct kobject *drivers_dir;
267 268
268 /* Exported symbols */ 269 /* Exported symbols */
269 const struct kernel_symbol *syms; 270 const struct kernel_symbol *syms;
diff --git a/include/linux/mqueue.h b/include/linux/mqueue.h
index 8db9d75541a6..8b5a79615fbf 100644
--- a/include/linux/mqueue.h
+++ b/include/linux/mqueue.h
@@ -18,8 +18,6 @@
18#ifndef _LINUX_MQUEUE_H 18#ifndef _LINUX_MQUEUE_H
19#define _LINUX_MQUEUE_H 19#define _LINUX_MQUEUE_H
20 20
21#include <linux/types.h>
22
23#define MQ_PRIO_MAX 32768 21#define MQ_PRIO_MAX 32768
24/* per-uid limit of kernel memory used by mqueue, in bytes */ 22/* per-uid limit of kernel memory used by mqueue, in bytes */
25#define MQ_BYTES_MAX 819200 23#define MQ_BYTES_MAX 819200
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index ce6c85815cbd..24a9ef1506b6 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -402,6 +402,8 @@ extern const struct file_operations fat_file_operations;
402extern struct inode_operations fat_file_inode_operations; 402extern struct inode_operations fat_file_inode_operations;
403extern int fat_notify_change(struct dentry * dentry, struct iattr * attr); 403extern int fat_notify_change(struct dentry * dentry, struct iattr * attr);
404extern void fat_truncate(struct inode *inode); 404extern void fat_truncate(struct inode *inode);
405extern int fat_getattr(struct vfsmount *mnt, struct dentry *dentry,
406 struct kstat *stat);
405 407
406/* fat/inode.c */ 408/* fat/inode.c */
407extern void fat_attach(struct inode *inode, loff_t i_pos); 409extern void fat_attach(struct inode *inode, loff_t i_pos);
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 70420bbae82b..8b3ef4187219 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -355,7 +355,7 @@ struct nand_buffers {
355 * @priv: [OPTIONAL] pointer to private chip date 355 * @priv: [OPTIONAL] pointer to private chip date
356 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks 356 * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks
357 * (determine if errors are correctable) 357 * (determine if errors are correctable)
358 * @write_page [REPLACEABLE] High-level page write function 358 * @write_page: [REPLACEABLE] High-level page write function
359 */ 359 */
360 360
361struct nand_chip { 361struct nand_chip {
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index edfa012fad3a..aff25c000abf 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -724,7 +724,7 @@
724#define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10)) 724#define MV643XX_ETH_RX_FIFO_URGENT_THRESHOLD_REG(port) (0x2470 + (port<<10))
725#define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10)) 725#define MV643XX_ETH_TX_FIFO_URGENT_THRESHOLD_REG(port) (0x2474 + (port<<10))
726#define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10)) 726#define MV643XX_ETH_RX_MINIMAL_FRAME_SIZE_REG(port) (0x247c + (port<<10))
727#define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10) 727#define MV643XX_ETH_RX_DISCARDED_FRAMES_COUNTER(port) (0x2484 + (port<<10))
728#define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10)) 728#define MV643XX_ETH_PORT_DEBUG_0_REG(port) (0x248c + (port<<10))
729#define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10)) 729#define MV643XX_ETH_PORT_DEBUG_1_REG(port) (0x2490 + (port<<10))
730#define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10)) 730#define MV643XX_ETH_PORT_INTERNAL_ADDR_ERROR_REG(port) (0x2494 + (port<<10))
@@ -1135,7 +1135,7 @@ struct mv64xxx_i2c_pdata {
1135#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19) 1135#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_1 (1<<19)
1136#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20) 1136#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_2 (1<<20)
1137#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19)) 1137#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_3 ((1<<20) | (1<<19))
1138#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 ((1<<21) 1138#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_4 (1<<21)
1139#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19)) 1139#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_5 ((1<<21) | (1<<19))
1140#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20)) 1140#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_6 ((1<<21) | (1<<20))
1141#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19)) 1141#define MV643XX_ETH_DEFAULT_RX_UDP_QUEUE_7 ((1<<21) | (1<<20) | (1<<19))
diff --git a/include/linux/net.h b/include/linux/net.h
index c257f716e00f..6f0dfeba509a 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -19,6 +19,7 @@
19#define _LINUX_NET_H 19#define _LINUX_NET_H
20 20
21#include <linux/wait.h> 21#include <linux/wait.h>
22#include <linux/random.h>
22#include <asm/socket.h> 23#include <asm/socket.h>
23 24
24struct poll_table_struct; 25struct poll_table_struct;
@@ -193,9 +194,9 @@ extern int sock_map_fd(struct socket *sock);
193extern struct socket *sockfd_lookup(int fd, int *err); 194extern struct socket *sockfd_lookup(int fd, int *err);
194#define sockfd_put(sock) fput(sock->file) 195#define sockfd_put(sock) fput(sock->file)
195extern int net_ratelimit(void); 196extern int net_ratelimit(void);
196extern unsigned long net_random(void); 197
197extern void net_srandom(unsigned long); 198#define net_random() random32()
198extern void net_random_init(void); 199#define net_srandom(seed) srandom32((__force u32)seed)
199 200
200extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg, 201extern int kernel_sendmsg(struct socket *sock, struct msghdr *msg,
201 struct kvec *vec, size_t num, size_t len); 202 struct kvec *vec, size_t num, size_t len);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 9264139bd8df..949eada46ce1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -38,7 +38,6 @@
38#include <linux/percpu.h> 38#include <linux/percpu.h>
39#include <linux/dmaengine.h> 39#include <linux/dmaengine.h>
40 40
41struct divert_blk;
42struct vlan_group; 41struct vlan_group;
43struct ethtool_ops; 42struct ethtool_ops;
44struct netpoll_info; 43struct netpoll_info;
@@ -67,6 +66,10 @@ struct netpoll_info;
67#define NET_RX_CN_HIGH 4 /* The storm is here */ 66#define NET_RX_CN_HIGH 4 /* The storm is here */
68#define NET_RX_BAD 5 /* packet dropped due to kernel error */ 67#define NET_RX_BAD 5 /* packet dropped due to kernel error */
69 68
69/* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It
70 * indicates that the device will soon be dropping packets, or already drops
71 * some packets of the same priority; prompting us to send less aggressively. */
72#define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e))
70#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) 73#define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0)
71 74
72#endif 75#endif
@@ -93,8 +96,10 @@ struct netpoll_info;
93#endif 96#endif
94#endif 97#endif
95 98
96#if !defined(CONFIG_NET_IPIP) && \ 99#if !defined(CONFIG_NET_IPIP) && !defined(CONFIG_NET_IPIP_MODULE) && \
97 !defined(CONFIG_IPV6) && !defined(CONFIG_IPV6_MODULE) 100 !defined(CONFIG_NET_IPGRE) && !defined(CONFIG_NET_IPGRE_MODULE) && \
101 !defined(CONFIG_IPV6_SIT) && !defined(CONFIG_IPV6_SIT_MODULE) && \
102 !defined(CONFIG_IPV6_TUNNEL) && !defined(CONFIG_IPV6_TUNNEL_MODULE)
98#define MAX_HEADER LL_MAX_HEADER 103#define MAX_HEADER LL_MAX_HEADER
99#else 104#else
100#define MAX_HEADER (LL_MAX_HEADER + 48) 105#define MAX_HEADER (LL_MAX_HEADER + 48)
@@ -191,7 +196,7 @@ struct hh_cache
191 * NOTE: For VLANs, this will be the 196 * NOTE: For VLANs, this will be the
192 * encapuslated type. --BLG 197 * encapuslated type. --BLG
193 */ 198 */
194 int hh_len; /* length of header */ 199 u16 hh_len; /* length of header */
195 int (*hh_output)(struct sk_buff *skb); 200 int (*hh_output)(struct sk_buff *skb);
196 rwlock_t hh_lock; 201 rwlock_t hh_lock;
197 202
@@ -515,11 +520,6 @@ struct net_device
515 /* bridge stuff */ 520 /* bridge stuff */
516 struct net_bridge_port *br_port; 521 struct net_bridge_port *br_port;
517 522
518#ifdef CONFIG_NET_DIVERT
519 /* this will get initialized at each interface type init routine */
520 struct divert_blk *divert;
521#endif /* CONFIG_NET_DIVERT */
522
523 /* class/net/name entry */ 523 /* class/net/name entry */
524 struct class_device class_dev; 524 struct class_device class_dev;
525 /* space for optional statistics and wireless sysfs groups */ 525 /* space for optional statistics and wireless sysfs groups */
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index b7e67d1d4382..d4c4c5120bc0 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -117,6 +117,16 @@ void nf_unregister_hooks(struct nf_hook_ops *reg, unsigned int n);
117int nf_register_sockopt(struct nf_sockopt_ops *reg); 117int nf_register_sockopt(struct nf_sockopt_ops *reg);
118void nf_unregister_sockopt(struct nf_sockopt_ops *reg); 118void nf_unregister_sockopt(struct nf_sockopt_ops *reg);
119 119
120#ifdef CONFIG_SYSCTL
121/* Sysctl registration */
122struct ctl_table_header *nf_register_sysctl_table(struct ctl_table *path,
123 struct ctl_table *table);
124void nf_unregister_sysctl_table(struct ctl_table_header *header,
125 struct ctl_table *table);
126extern struct ctl_table nf_net_netfilter_sysctl_path[];
127extern struct ctl_table nf_net_ipv4_netfilter_sysctl_path[];
128#endif /* CONFIG_SYSCTL */
129
120extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; 130extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS];
121 131
122/* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will 132/* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will
@@ -282,15 +292,31 @@ extern void nf_invalidate_cache(int pf);
282 Returns true or false. */ 292 Returns true or false. */
283extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); 293extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len);
284 294
285extern u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval, 295static inline void nf_csum_replace4(__sum16 *sum, __be32 from, __be32 to)
286 u_int32_t csum); 296{
287extern u_int16_t nf_proto_csum_update(struct sk_buff *skb, 297 __be32 diff[] = { ~from, to };
288 u_int32_t oldval, u_int32_t newval, 298
289 u_int16_t csum, int pseudohdr); 299 *sum = csum_fold(csum_partial((char *)diff, sizeof(diff), ~csum_unfold(*sum)));
300}
301
302static inline void nf_csum_replace2(__sum16 *sum, __be16 from, __be16 to)
303{
304 nf_csum_replace4(sum, (__force __be32)from, (__force __be32)to);
305}
306
307extern void nf_proto_csum_replace4(__sum16 *sum, struct sk_buff *skb,
308 __be32 from, __be32 to, int pseudohdr);
309
310static inline void nf_proto_csum_replace2(__sum16 *sum, struct sk_buff *skb,
311 __be16 from, __be16 to, int pseudohdr)
312{
313 nf_proto_csum_replace4(sum, skb, (__force __be32)from,
314 (__force __be32)to, pseudohdr);
315}
290 316
291struct nf_afinfo { 317struct nf_afinfo {
292 unsigned short family; 318 unsigned short family;
293 unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, 319 __sum16 (*checksum)(struct sk_buff *skb, unsigned int hook,
294 unsigned int dataoff, u_int8_t protocol); 320 unsigned int dataoff, u_int8_t protocol);
295 void (*saveroute)(const struct sk_buff *skb, 321 void (*saveroute)(const struct sk_buff *skb,
296 struct nf_info *info); 322 struct nf_info *info);
@@ -305,12 +331,12 @@ static inline struct nf_afinfo *nf_get_afinfo(unsigned short family)
305 return rcu_dereference(nf_afinfo[family]); 331 return rcu_dereference(nf_afinfo[family]);
306} 332}
307 333
308static inline unsigned int 334static inline __sum16
309nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff, 335nf_checksum(struct sk_buff *skb, unsigned int hook, unsigned int dataoff,
310 u_int8_t protocol, unsigned short family) 336 u_int8_t protocol, unsigned short family)
311{ 337{
312 struct nf_afinfo *afinfo; 338 struct nf_afinfo *afinfo;
313 unsigned int csum = 0; 339 __sum16 csum = 0;
314 340
315 rcu_read_lock(); 341 rcu_read_lock();
316 afinfo = nf_get_afinfo(family); 342 afinfo = nf_get_afinfo(family);
@@ -331,7 +357,7 @@ extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *);
331static inline void 357static inline void
332nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) 358nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family)
333{ 359{
334#ifdef CONFIG_IP_NF_NAT_NEEDED 360#if defined(CONFIG_IP_NF_NAT_NEEDED) || defined(CONFIG_NF_NAT_NEEDED)
335 void (*decodefn)(struct sk_buff *, struct flowi *); 361 void (*decodefn)(struct sk_buff *, struct flowi *);
336 362
337 if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL) 363 if (family == AF_INET && (decodefn = ip_nat_decode_session) != NULL)
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index 312bd2ffee33..6328175a1c3a 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -14,6 +14,7 @@ header-y += xt_dscp.h
14header-y += xt_DSCP.h 14header-y += xt_DSCP.h
15header-y += xt_esp.h 15header-y += xt_esp.h
16header-y += xt_helper.h 16header-y += xt_helper.h
17header-y += xt_hashlimit.h
17header-y += xt_length.h 18header-y += xt_length.h
18header-y += xt_limit.h 19header-y += xt_limit.h
19header-y += xt_mac.h 20header-y += xt_mac.h
@@ -21,6 +22,7 @@ header-y += xt_mark.h
21header-y += xt_MARK.h 22header-y += xt_MARK.h
22header-y += xt_multiport.h 23header-y += xt_multiport.h
23header-y += xt_NFQUEUE.h 24header-y += xt_NFQUEUE.h
25header-y += xt_NFLOG.h
24header-y += xt_pkttype.h 26header-y += xt_pkttype.h
25header-y += xt_policy.h 27header-y += xt_policy.h
26header-y += xt_realm.h 28header-y += xt_realm.h
diff --git a/include/linux/netfilter/nf_conntrack_amanda.h b/include/linux/netfilter/nf_conntrack_amanda.h
new file mode 100644
index 000000000000..26c223544ae8
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_amanda.h
@@ -0,0 +1,10 @@
1#ifndef _NF_CONNTRACK_AMANDA_H
2#define _NF_CONNTRACK_AMANDA_H
3/* AMANDA tracking. */
4
5extern unsigned int (*nf_nat_amanda_hook)(struct sk_buff **pskb,
6 enum ip_conntrack_info ctinfo,
7 unsigned int matchoff,
8 unsigned int matchlen,
9 struct nf_conntrack_expect *exp);
10#endif /* _NF_CONNTRACK_AMANDA_H */
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h
index ad4a41c9ce93..81453ea7e4c2 100644
--- a/include/linux/netfilter/nf_conntrack_ftp.h
+++ b/include/linux/netfilter/nf_conntrack_ftp.h
@@ -3,16 +3,16 @@
3/* FTP tracking. */ 3/* FTP tracking. */
4 4
5/* This enum is exposed to userspace */ 5/* This enum is exposed to userspace */
6enum ip_ct_ftp_type 6enum nf_ct_ftp_type
7{ 7{
8 /* PORT command from client */ 8 /* PORT command from client */
9 IP_CT_FTP_PORT, 9 NF_CT_FTP_PORT,
10 /* PASV response from server */ 10 /* PASV response from server */
11 IP_CT_FTP_PASV, 11 NF_CT_FTP_PASV,
12 /* EPRT command from client */ 12 /* EPRT command from client */
13 IP_CT_FTP_EPRT, 13 NF_CT_FTP_EPRT,
14 /* EPSV response from server */ 14 /* EPSV response from server */
15 IP_CT_FTP_EPSV, 15 NF_CT_FTP_EPSV,
16}; 16};
17 17
18#ifdef __KERNEL__ 18#ifdef __KERNEL__
@@ -21,23 +21,23 @@ enum ip_ct_ftp_type
21 21
22#define NUM_SEQ_TO_REMEMBER 2 22#define NUM_SEQ_TO_REMEMBER 2
23/* This structure exists only once per master */ 23/* This structure exists only once per master */
24struct ip_ct_ftp_master { 24struct nf_ct_ftp_master {
25 /* Valid seq positions for cmd matching after newline */ 25 /* Valid seq positions for cmd matching after newline */
26 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; 26 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
27 /* 0 means seq_match_aft_nl not set */ 27 /* 0 means seq_match_aft_nl not set */
28 int seq_aft_nl_num[IP_CT_DIR_MAX]; 28 int seq_aft_nl_num[IP_CT_DIR_MAX];
29}; 29};
30 30
31struct ip_conntrack_expect; 31struct nf_conntrack_expect;
32 32
33/* For NAT to hook in when we find a packet which describes what other 33/* For NAT to hook in when we find a packet which describes what other
34 * connection we should expect. */ 34 * connection we should expect. */
35extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, 35extern unsigned int (*nf_nat_ftp_hook)(struct sk_buff **pskb,
36 enum ip_conntrack_info ctinfo, 36 enum ip_conntrack_info ctinfo,
37 enum ip_ct_ftp_type type, 37 enum nf_ct_ftp_type type,
38 unsigned int matchoff, 38 unsigned int matchoff,
39 unsigned int matchlen, 39 unsigned int matchlen,
40 struct ip_conntrack_expect *exp, 40 struct nf_conntrack_expect *exp,
41 u32 *seq); 41 u32 *seq);
42#endif /* __KERNEL__ */ 42#endif /* __KERNEL__ */
43 43
diff --git a/include/linux/netfilter/nf_conntrack_h323.h b/include/linux/netfilter/nf_conntrack_h323.h
new file mode 100644
index 000000000000..08e2f4977c2e
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_h323.h
@@ -0,0 +1,92 @@
1#ifndef _NF_CONNTRACK_H323_H
2#define _NF_CONNTRACK_H323_H
3
4#ifdef __KERNEL__
5
6#include <linux/netfilter/nf_conntrack_h323_asn1.h>
7
8#define RAS_PORT 1719
9#define Q931_PORT 1720
10#define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */
11
12/* This structure exists only once per master */
13struct nf_ct_h323_master {
14
15 /* Original and NATed Q.931 or H.245 signal ports */
16 __be16 sig_port[IP_CT_DIR_MAX];
17
18 /* Original and NATed RTP ports */
19 __be16 rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX];
20
21 union {
22 /* RAS connection timeout */
23 u_int32_t timeout;
24
25 /* Next TPKT length (for separate TPKT header and data) */
26 u_int16_t tpkt_len[IP_CT_DIR_MAX];
27 };
28};
29
30struct nf_conn;
31
32extern int get_h225_addr(struct nf_conn *ct, unsigned char *data,
33 TransportAddress *taddr,
34 union nf_conntrack_address *addr, __be16 *port);
35extern void nf_conntrack_h245_expect(struct nf_conn *new,
36 struct nf_conntrack_expect *this);
37extern void nf_conntrack_q931_expect(struct nf_conn *new,
38 struct nf_conntrack_expect *this);
39extern int (*set_h245_addr_hook) (struct sk_buff **pskb,
40 unsigned char **data, int dataoff,
41 H245_TransportAddress *taddr,
42 union nf_conntrack_address *addr,
43 __be16 port);
44extern int (*set_h225_addr_hook) (struct sk_buff **pskb,
45 unsigned char **data, int dataoff,
46 TransportAddress *taddr,
47 union nf_conntrack_address *addr,
48 __be16 port);
49extern int (*set_sig_addr_hook) (struct sk_buff **pskb,
50 struct nf_conn *ct,
51 enum ip_conntrack_info ctinfo,
52 unsigned char **data,
53 TransportAddress *taddr, int count);
54extern int (*set_ras_addr_hook) (struct sk_buff **pskb,
55 struct nf_conn *ct,
56 enum ip_conntrack_info ctinfo,
57 unsigned char **data,
58 TransportAddress *taddr, int count);
59extern int (*nat_rtp_rtcp_hook) (struct sk_buff **pskb,
60 struct nf_conn *ct,
61 enum ip_conntrack_info ctinfo,
62 unsigned char **data, int dataoff,
63 H245_TransportAddress *taddr,
64 __be16 port, __be16 rtp_port,
65 struct nf_conntrack_expect *rtp_exp,
66 struct nf_conntrack_expect *rtcp_exp);
67extern int (*nat_t120_hook) (struct sk_buff **pskb, struct nf_conn *ct,
68 enum ip_conntrack_info ctinfo,
69 unsigned char **data, int dataoff,
70 H245_TransportAddress *taddr, __be16 port,
71 struct nf_conntrack_expect *exp);
72extern int (*nat_h245_hook) (struct sk_buff **pskb, struct nf_conn *ct,
73 enum ip_conntrack_info ctinfo,
74 unsigned char **data, int dataoff,
75 TransportAddress *taddr, __be16 port,
76 struct nf_conntrack_expect *exp);
77extern int (*nat_callforwarding_hook) (struct sk_buff **pskb,
78 struct nf_conn *ct,
79 enum ip_conntrack_info ctinfo,
80 unsigned char **data, int dataoff,
81 TransportAddress *taddr,
82 __be16 port,
83 struct nf_conntrack_expect *exp);
84extern int (*nat_q931_hook) (struct sk_buff **pskb, struct nf_conn *ct,
85 enum ip_conntrack_info ctinfo,
86 unsigned char **data, TransportAddress *taddr,
87 int idx, __be16 port,
88 struct nf_conntrack_expect *exp);
89
90#endif
91
92#endif
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter/nf_conntrack_h323_asn1.h
index c6e9a0b6d30b..8dab5968fc7e 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
+++ b/include/linux/netfilter/nf_conntrack_h323_asn1.h
@@ -1,6 +1,6 @@
1/**************************************************************************** 1/****************************************************************************
2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 2 * ip_conntrack_h323_asn1.h - BER and PER decoding library for H.323
3 * conntrack/NAT module. 3 * conntrack/NAT module.
4 * 4 *
5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net> 5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
6 * 6 *
@@ -34,13 +34,13 @@
34 * 34 *
35 ****************************************************************************/ 35 ****************************************************************************/
36 36
37#ifndef _IP_CONNTRACK_HELPER_H323_ASN1_H_ 37#ifndef _NF_CONNTRACK_HELPER_H323_ASN1_H_
38#define _IP_CONNTRACK_HELPER_H323_ASN1_H_ 38#define _NF_CONNTRACK_HELPER_H323_ASN1_H_
39 39
40/***************************************************************************** 40/*****************************************************************************
41 * H.323 Types 41 * H.323 Types
42 ****************************************************************************/ 42 ****************************************************************************/
43#include "ip_conntrack_helper_h323_types.h" 43#include "nf_conntrack_h323_types.h"
44 44
45typedef struct { 45typedef struct {
46 enum { 46 enum {
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h b/include/linux/netfilter/nf_conntrack_h323_types.h
index 3d4a773799fc..38d74d5c9700 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_types.h
+++ b/include/linux/netfilter/nf_conntrack_h323_types.h
@@ -10,6 +10,11 @@ typedef struct TransportAddress_ipAddress { /* SEQUENCE */
10 unsigned ip; 10 unsigned ip;
11} TransportAddress_ipAddress; 11} TransportAddress_ipAddress;
12 12
13typedef struct TransportAddress_ip6Address { /* SEQUENCE */
14 int options; /* No use */
15 unsigned ip6;
16} TransportAddress_ip6Address;
17
13typedef struct TransportAddress { /* CHOICE */ 18typedef struct TransportAddress { /* CHOICE */
14 enum { 19 enum {
15 eTransportAddress_ipAddress, 20 eTransportAddress_ipAddress,
@@ -22,6 +27,7 @@ typedef struct TransportAddress { /* CHOICE */
22 } choice; 27 } choice;
23 union { 28 union {
24 TransportAddress_ipAddress ipAddress; 29 TransportAddress_ipAddress ipAddress;
30 TransportAddress_ip6Address ip6Address;
25 }; 31 };
26} TransportAddress; 32} TransportAddress;
27 33
@@ -93,6 +99,11 @@ typedef struct UnicastAddress_iPAddress { /* SEQUENCE */
93 unsigned network; 99 unsigned network;
94} UnicastAddress_iPAddress; 100} UnicastAddress_iPAddress;
95 101
102typedef struct UnicastAddress_iP6Address { /* SEQUENCE */
103 int options; /* No use */
104 unsigned network;
105} UnicastAddress_iP6Address;
106
96typedef struct UnicastAddress { /* CHOICE */ 107typedef struct UnicastAddress { /* CHOICE */
97 enum { 108 enum {
98 eUnicastAddress_iPAddress, 109 eUnicastAddress_iPAddress,
@@ -105,6 +116,7 @@ typedef struct UnicastAddress { /* CHOICE */
105 } choice; 116 } choice;
106 union { 117 union {
107 UnicastAddress_iPAddress iPAddress; 118 UnicastAddress_iPAddress iPAddress;
119 UnicastAddress_iP6Address iP6Address;
108 }; 120 };
109} UnicastAddress; 121} UnicastAddress;
110 122
diff --git a/include/linux/netfilter/nf_conntrack_irc.h b/include/linux/netfilter/nf_conntrack_irc.h
new file mode 100644
index 000000000000..2ab6b8255911
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_irc.h
@@ -0,0 +1,15 @@
1#ifndef _NF_CONNTRACK_IRC_H
2#define _NF_CONNTRACK_IRC_H
3
4#ifdef __KERNEL__
5
6#define IRC_PORT 6667
7
8extern unsigned int (*nf_nat_irc_hook)(struct sk_buff **pskb,
9 enum ip_conntrack_info ctinfo,
10 unsigned int matchoff,
11 unsigned int matchlen,
12 struct nf_conntrack_expect *exp);
13
14#endif /* __KERNEL__ */
15#endif /* _NF_CONNTRACK_IRC_H */
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
new file mode 100644
index 000000000000..fb049ec11ff2
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_pptp.h
@@ -0,0 +1,321 @@
1/* PPTP constants and structs */
2#ifndef _NF_CONNTRACK_PPTP_H
3#define _NF_CONNTRACK_PPTP_H
4
5/* state of the control session */
6enum pptp_ctrlsess_state {
7 PPTP_SESSION_NONE, /* no session present */
8 PPTP_SESSION_ERROR, /* some session error */
9 PPTP_SESSION_STOPREQ, /* stop_sess request seen */
10 PPTP_SESSION_REQUESTED, /* start_sess request seen */
11 PPTP_SESSION_CONFIRMED, /* session established */
12};
13
14/* state of the call inside the control session */
15enum pptp_ctrlcall_state {
16 PPTP_CALL_NONE,
17 PPTP_CALL_ERROR,
18 PPTP_CALL_OUT_REQ,
19 PPTP_CALL_OUT_CONF,
20 PPTP_CALL_IN_REQ,
21 PPTP_CALL_IN_REP,
22 PPTP_CALL_IN_CONF,
23 PPTP_CALL_CLEAR_REQ,
24};
25
26/* conntrack private data */
27struct nf_ct_pptp_master {
28 enum pptp_ctrlsess_state sstate; /* session state */
29 enum pptp_ctrlcall_state cstate; /* call state */
30 __be16 pac_call_id; /* call id of PAC */
31 __be16 pns_call_id; /* call id of PNS */
32
33 /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack
34 * and therefore imposes a fixed limit on the number of maps */
35 struct nf_ct_gre_keymap *keymap[IP_CT_DIR_MAX];
36};
37
38struct nf_nat_pptp {
39 __be16 pns_call_id; /* NAT'ed PNS call id */
40 __be16 pac_call_id; /* NAT'ed PAC call id */
41};
42
43#ifdef __KERNEL__
44
45#define PPTP_CONTROL_PORT 1723
46
47#define PPTP_PACKET_CONTROL 1
48#define PPTP_PACKET_MGMT 2
49
50#define PPTP_MAGIC_COOKIE 0x1a2b3c4d
51
52struct pptp_pkt_hdr {
53 __u16 packetLength;
54 __be16 packetType;
55 __be32 magicCookie;
56};
57
58/* PptpControlMessageType values */
59#define PPTP_START_SESSION_REQUEST 1
60#define PPTP_START_SESSION_REPLY 2
61#define PPTP_STOP_SESSION_REQUEST 3
62#define PPTP_STOP_SESSION_REPLY 4
63#define PPTP_ECHO_REQUEST 5
64#define PPTP_ECHO_REPLY 6
65#define PPTP_OUT_CALL_REQUEST 7
66#define PPTP_OUT_CALL_REPLY 8
67#define PPTP_IN_CALL_REQUEST 9
68#define PPTP_IN_CALL_REPLY 10
69#define PPTP_IN_CALL_CONNECT 11
70#define PPTP_CALL_CLEAR_REQUEST 12
71#define PPTP_CALL_DISCONNECT_NOTIFY 13
72#define PPTP_WAN_ERROR_NOTIFY 14
73#define PPTP_SET_LINK_INFO 15
74
75#define PPTP_MSG_MAX 15
76
77/* PptpGeneralError values */
78#define PPTP_ERROR_CODE_NONE 0
79#define PPTP_NOT_CONNECTED 1
80#define PPTP_BAD_FORMAT 2
81#define PPTP_BAD_VALUE 3
82#define PPTP_NO_RESOURCE 4
83#define PPTP_BAD_CALLID 5
84#define PPTP_REMOVE_DEVICE_ERROR 6
85
86struct PptpControlHeader {
87 __be16 messageType;
88 __u16 reserved;
89};
90
91/* FramingCapability Bitmap Values */
92#define PPTP_FRAME_CAP_ASYNC 0x1
93#define PPTP_FRAME_CAP_SYNC 0x2
94
95/* BearerCapability Bitmap Values */
96#define PPTP_BEARER_CAP_ANALOG 0x1
97#define PPTP_BEARER_CAP_DIGITAL 0x2
98
99struct PptpStartSessionRequest {
100 __be16 protocolVersion;
101 __u16 reserved1;
102 __be32 framingCapability;
103 __be32 bearerCapability;
104 __be16 maxChannels;
105 __be16 firmwareRevision;
106 __u8 hostName[64];
107 __u8 vendorString[64];
108};
109
110/* PptpStartSessionResultCode Values */
111#define PPTP_START_OK 1
112#define PPTP_START_GENERAL_ERROR 2
113#define PPTP_START_ALREADY_CONNECTED 3
114#define PPTP_START_NOT_AUTHORIZED 4
115#define PPTP_START_UNKNOWN_PROTOCOL 5
116
117struct PptpStartSessionReply {
118 __be16 protocolVersion;
119 __u8 resultCode;
120 __u8 generalErrorCode;
121 __be32 framingCapability;
122 __be32 bearerCapability;
123 __be16 maxChannels;
124 __be16 firmwareRevision;
125 __u8 hostName[64];
126 __u8 vendorString[64];
127};
128
129/* PptpStopReasons */
130#define PPTP_STOP_NONE 1
131#define PPTP_STOP_PROTOCOL 2
132#define PPTP_STOP_LOCAL_SHUTDOWN 3
133
134struct PptpStopSessionRequest {
135 __u8 reason;
136 __u8 reserved1;
137 __u16 reserved2;
138};
139
140/* PptpStopSessionResultCode */
141#define PPTP_STOP_OK 1
142#define PPTP_STOP_GENERAL_ERROR 2
143
144struct PptpStopSessionReply {
145 __u8 resultCode;
146 __u8 generalErrorCode;
147 __u16 reserved1;
148};
149
150struct PptpEchoRequest {
151 __be32 identNumber;
152};
153
154/* PptpEchoReplyResultCode */
155#define PPTP_ECHO_OK 1
156#define PPTP_ECHO_GENERAL_ERROR 2
157
158struct PptpEchoReply {
159 __be32 identNumber;
160 __u8 resultCode;
161 __u8 generalErrorCode;
162 __u16 reserved;
163};
164
165/* PptpFramingType */
166#define PPTP_ASYNC_FRAMING 1
167#define PPTP_SYNC_FRAMING 2
168#define PPTP_DONT_CARE_FRAMING 3
169
170/* PptpCallBearerType */
171#define PPTP_ANALOG_TYPE 1
172#define PPTP_DIGITAL_TYPE 2
173#define PPTP_DONT_CARE_BEARER_TYPE 3
174
175struct PptpOutCallRequest {
176 __be16 callID;
177 __be16 callSerialNumber;
178 __be32 minBPS;
179 __be32 maxBPS;
180 __be32 bearerType;
181 __be32 framingType;
182 __be16 packetWindow;
183 __be16 packetProcDelay;
184 __be16 phoneNumberLength;
185 __u16 reserved1;
186 __u8 phoneNumber[64];
187 __u8 subAddress[64];
188};
189
190/* PptpCallResultCode */
191#define PPTP_OUTCALL_CONNECT 1
192#define PPTP_OUTCALL_GENERAL_ERROR 2
193#define PPTP_OUTCALL_NO_CARRIER 3
194#define PPTP_OUTCALL_BUSY 4
195#define PPTP_OUTCALL_NO_DIAL_TONE 5
196#define PPTP_OUTCALL_TIMEOUT 6
197#define PPTP_OUTCALL_DONT_ACCEPT 7
198
199struct PptpOutCallReply {
200 __be16 callID;
201 __be16 peersCallID;
202 __u8 resultCode;
203 __u8 generalErrorCode;
204 __be16 causeCode;
205 __be32 connectSpeed;
206 __be16 packetWindow;
207 __be16 packetProcDelay;
208 __be32 physChannelID;
209};
210
211struct PptpInCallRequest {
212 __be16 callID;
213 __be16 callSerialNumber;
214 __be32 callBearerType;
215 __be32 physChannelID;
216 __be16 dialedNumberLength;
217 __be16 dialingNumberLength;
218 __u8 dialedNumber[64];
219 __u8 dialingNumber[64];
220 __u8 subAddress[64];
221};
222
223/* PptpInCallResultCode */
224#define PPTP_INCALL_ACCEPT 1
225#define PPTP_INCALL_GENERAL_ERROR 2
226#define PPTP_INCALL_DONT_ACCEPT 3
227
228struct PptpInCallReply {
229 __be16 callID;
230 __be16 peersCallID;
231 __u8 resultCode;
232 __u8 generalErrorCode;
233 __be16 packetWindow;
234 __be16 packetProcDelay;
235 __u16 reserved;
236};
237
238struct PptpInCallConnected {
239 __be16 peersCallID;
240 __u16 reserved;
241 __be32 connectSpeed;
242 __be16 packetWindow;
243 __be16 packetProcDelay;
244 __be32 callFramingType;
245};
246
247struct PptpClearCallRequest {
248 __be16 callID;
249 __u16 reserved;
250};
251
252struct PptpCallDisconnectNotify {
253 __be16 callID;
254 __u8 resultCode;
255 __u8 generalErrorCode;
256 __be16 causeCode;
257 __u16 reserved;
258 __u8 callStatistics[128];
259};
260
261struct PptpWanErrorNotify {
262 __be16 peersCallID;
263 __u16 reserved;
264 __be32 crcErrors;
265 __be32 framingErrors;
266 __be32 hardwareOverRuns;
267 __be32 bufferOverRuns;
268 __be32 timeoutErrors;
269 __be32 alignmentErrors;
270};
271
272struct PptpSetLinkInfo {
273 __be16 peersCallID;
274 __u16 reserved;
275 __be32 sendAccm;
276 __be32 recvAccm;
277};
278
279union pptp_ctrl_union {
280 struct PptpStartSessionRequest sreq;
281 struct PptpStartSessionReply srep;
282 struct PptpStopSessionRequest streq;
283 struct PptpStopSessionReply strep;
284 struct PptpOutCallRequest ocreq;
285 struct PptpOutCallReply ocack;
286 struct PptpInCallRequest icreq;
287 struct PptpInCallReply icack;
288 struct PptpInCallConnected iccon;
289 struct PptpClearCallRequest clrreq;
290 struct PptpCallDisconnectNotify disc;
291 struct PptpWanErrorNotify wanerr;
292 struct PptpSetLinkInfo setlink;
293};
294
295/* crap needed for nf_conntrack_compat.h */
296struct nf_conn;
297struct nf_conntrack_expect;
298enum ip_conntrack_info;
299
300extern int
301(*nf_nat_pptp_hook_outbound)(struct sk_buff **pskb,
302 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
303 struct PptpControlHeader *ctlh,
304 union pptp_ctrl_union *pptpReq);
305
306extern int
307(*nf_nat_pptp_hook_inbound)(struct sk_buff **pskb,
308 struct nf_conn *ct, enum ip_conntrack_info ctinfo,
309 struct PptpControlHeader *ctlh,
310 union pptp_ctrl_union *pptpReq);
311
312extern void
313(*nf_nat_pptp_hook_exp_gre)(struct nf_conntrack_expect *exp_orig,
314 struct nf_conntrack_expect *exp_reply);
315
316extern void
317(*nf_nat_pptp_hook_expectfn)(struct nf_conn *ct,
318 struct nf_conntrack_expect *exp);
319
320#endif /* __KERNEL__ */
321#endif /* _NF_CONNTRACK_PPTP_H */
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h
new file mode 100644
index 000000000000..4e6bbce04ff8
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_proto_gre.h
@@ -0,0 +1,112 @@
1#ifndef _CONNTRACK_PROTO_GRE_H
2#define _CONNTRACK_PROTO_GRE_H
3#include <asm/byteorder.h>
4
5/* GRE PROTOCOL HEADER */
6
7/* GRE Version field */
8#define GRE_VERSION_1701 0x0
9#define GRE_VERSION_PPTP 0x1
10
11/* GRE Protocol field */
12#define GRE_PROTOCOL_PPTP 0x880B
13
14/* GRE Flags */
15#define GRE_FLAG_C 0x80
16#define GRE_FLAG_R 0x40
17#define GRE_FLAG_K 0x20
18#define GRE_FLAG_S 0x10
19#define GRE_FLAG_A 0x80
20
21#define GRE_IS_C(f) ((f)&GRE_FLAG_C)
22#define GRE_IS_R(f) ((f)&GRE_FLAG_R)
23#define GRE_IS_K(f) ((f)&GRE_FLAG_K)
24#define GRE_IS_S(f) ((f)&GRE_FLAG_S)
25#define GRE_IS_A(f) ((f)&GRE_FLAG_A)
26
27/* GRE is a mess: Four different standards */
28struct gre_hdr {
29#if defined(__LITTLE_ENDIAN_BITFIELD)
30 __u16 rec:3,
31 srr:1,
32 seq:1,
33 key:1,
34 routing:1,
35 csum:1,
36 version:3,
37 reserved:4,
38 ack:1;
39#elif defined(__BIG_ENDIAN_BITFIELD)
40 __u16 csum:1,
41 routing:1,
42 key:1,
43 seq:1,
44 srr:1,
45 rec:3,
46 ack:1,
47 reserved:4,
48 version:3;
49#else
50#error "Adjust your <asm/byteorder.h> defines"
51#endif
52 __be16 protocol;
53};
54
55/* modified GRE header for PPTP */
56struct gre_hdr_pptp {
57 __u8 flags; /* bitfield */
58 __u8 version; /* should be GRE_VERSION_PPTP */
59 __be16 protocol; /* should be GRE_PROTOCOL_PPTP */
60 __be16 payload_len; /* size of ppp payload, not inc. gre header */
61 __be16 call_id; /* peer's call_id for this session */
62 __be32 seq; /* sequence number. Present if S==1 */
63 __be32 ack; /* seq number of highest packet recieved by */
64 /* sender in this session */
65};
66
67struct nf_ct_gre {
68 unsigned int stream_timeout;
69 unsigned int timeout;
70};
71
72#ifdef __KERNEL__
73#include <net/netfilter/nf_conntrack_tuple.h>
74
75struct nf_conn;
76
77/* structure for original <-> reply keymap */
78struct nf_ct_gre_keymap {
79 struct list_head list;
80 struct nf_conntrack_tuple tuple;
81};
82
83/* add new tuple->key_reply pair to keymap */
84int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir,
85 struct nf_conntrack_tuple *t);
86
87/* delete keymap entries */
88void nf_ct_gre_keymap_destroy(struct nf_conn *ct);
89
90/* get pointer to gre key, if present */
91static inline __be32 *gre_key(struct gre_hdr *greh)
92{
93 if (!greh->key)
94 return NULL;
95 if (greh->csum || greh->routing)
96 return (__be32 *)(greh+sizeof(*greh)+4);
97 return (__be32 *)(greh+sizeof(*greh));
98}
99
100/* get pointer ot gre csum, if present */
101static inline __sum16 *gre_csum(struct gre_hdr *greh)
102{
103 if (!greh->csum)
104 return NULL;
105 return (__sum16 *)(greh+sizeof(*greh));
106}
107
108extern void nf_ct_gre_keymap_flush(void);
109extern void nf_nat_need_gre(void);
110
111#endif /* __KERNEL__ */
112#endif /* _CONNTRACK_PROTO_GRE_H */
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h
index b8994d9fd1a9..5cf2c115cce4 100644
--- a/include/linux/netfilter/nf_conntrack_sctp.h
+++ b/include/linux/netfilter/nf_conntrack_sctp.h
@@ -20,7 +20,7 @@ struct ip_ct_sctp
20{ 20{
21 enum sctp_conntrack state; 21 enum sctp_conntrack state;
22 22
23 u_int32_t vtag[IP_CT_DIR_MAX]; 23 __be32 vtag[IP_CT_DIR_MAX];
24 u_int32_t ttag[IP_CT_DIR_MAX]; 24 u_int32_t ttag[IP_CT_DIR_MAX];
25}; 25};
26 26
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h
new file mode 100644
index 000000000000..bb7f2041db74
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_sip.h
@@ -0,0 +1,41 @@
1#ifndef __NF_CONNTRACK_SIP_H__
2#define __NF_CONNTRACK_SIP_H__
3#ifdef __KERNEL__
4
5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600
7
8enum sip_header_pos {
9 POS_REG_REQ_URI,
10 POS_REQ_URI,
11 POS_FROM,
12 POS_TO,
13 POS_VIA,
14 POS_CONTACT,
15 POS_CONTENT,
16 POS_MEDIA,
17 POS_OWNER_IP4,
18 POS_CONNECTION_IP4,
19 POS_OWNER_IP6,
20 POS_CONNECTION_IP6,
21 POS_SDP_HEADER,
22};
23
24extern unsigned int (*nf_nat_sip_hook)(struct sk_buff **pskb,
25 enum ip_conntrack_info ctinfo,
26 struct nf_conn *ct,
27 const char **dptr);
28extern unsigned int (*nf_nat_sdp_hook)(struct sk_buff **pskb,
29 enum ip_conntrack_info ctinfo,
30 struct nf_conntrack_expect *exp,
31 const char *dptr);
32
33extern int ct_sip_get_info(struct nf_conn *ct, const char *dptr, size_t dlen,
34 unsigned int *matchoff, unsigned int *matchlen,
35 enum sip_header_pos pos);
36extern int ct_sip_lnlen(const char *line, const char *limit);
37extern const char *ct_sip_search(const char *needle, const char *haystack,
38 size_t needle_len, size_t haystack_len,
39 int case_sensitive);
40#endif /* __KERNEL__ */
41#endif /* __NF_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netfilter/nf_conntrack_tftp.h b/include/linux/netfilter/nf_conntrack_tftp.h
new file mode 100644
index 000000000000..0d79b7ae051f
--- /dev/null
+++ b/include/linux/netfilter/nf_conntrack_tftp.h
@@ -0,0 +1,20 @@
1#ifndef _NF_CONNTRACK_TFTP_H
2#define _NF_CONNTRACK_TFTP_H
3
4#define TFTP_PORT 69
5
6struct tftphdr {
7 __be16 opcode;
8};
9
10#define TFTP_OPCODE_READ 1
11#define TFTP_OPCODE_WRITE 2
12#define TFTP_OPCODE_DATA 3
13#define TFTP_OPCODE_ACK 4
14#define TFTP_OPCODE_ERROR 5
15
16extern unsigned int (*nf_nat_tftp_hook)(struct sk_buff **pskb,
17 enum ip_conntrack_info ctinfo,
18 struct nf_conntrack_expect *exp);
19
20#endif /* _NF_CONNTRACK_TFTP_H */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 6d8e3e5a80e9..1e9c821f152d 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -78,7 +78,7 @@ struct nfattr
78struct nfgenmsg { 78struct nfgenmsg {
79 u_int8_t nfgen_family; /* AF_xxx */ 79 u_int8_t nfgen_family; /* AF_xxx */
80 u_int8_t version; /* nfnetlink version */ 80 u_int8_t version; /* nfnetlink version */
81 u_int16_t res_id; /* resource id */ 81 __be16 res_id; /* resource id */
82}; 82};
83 83
84#define NFNETLINK_V0 0 84#define NFNETLINK_V0 0
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
index 87b92f8b988f..5966afa026e9 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -16,24 +16,22 @@ enum nfulnl_msg_types {
16}; 16};
17 17
18struct nfulnl_msg_packet_hdr { 18struct nfulnl_msg_packet_hdr {
19 u_int16_t hw_protocol; /* hw protocol (network order) */ 19 __be16 hw_protocol; /* hw protocol (network order) */
20 u_int8_t hook; /* netfilter hook */ 20 u_int8_t hook; /* netfilter hook */
21 u_int8_t _pad; 21 u_int8_t _pad;
22}; 22};
23 23
24struct nfulnl_msg_packet_hw { 24struct nfulnl_msg_packet_hw {
25 u_int16_t hw_addrlen; 25 __be16 hw_addrlen;
26 u_int16_t _pad; 26 u_int16_t _pad;
27 u_int8_t hw_addr[8]; 27 u_int8_t hw_addr[8];
28}; 28};
29 29
30struct nfulnl_msg_packet_timestamp { 30struct nfulnl_msg_packet_timestamp {
31 aligned_u64 sec; 31 aligned_be64 sec;
32 aligned_u64 usec; 32 aligned_be64 usec;
33}; 33};
34 34
35#define NFULNL_PREFIXLEN 30 /* just like old log target */
36
37enum nfulnl_attr_type { 35enum nfulnl_attr_type {
38 NFULA_UNSPEC, 36 NFULA_UNSPEC,
39 NFULA_PACKET_HDR, 37 NFULA_PACKET_HDR,
@@ -67,7 +65,7 @@ struct nfulnl_msg_config_cmd {
67} __attribute__ ((packed)); 65} __attribute__ ((packed));
68 66
69struct nfulnl_msg_config_mode { 67struct nfulnl_msg_config_mode {
70 u_int32_t copy_range; 68 __be32 copy_range;
71 u_int8_t copy_mode; 69 u_int8_t copy_mode;
72 u_int8_t _pad; 70 u_int8_t _pad;
73} __attribute__ ((packed)); 71} __attribute__ ((packed));
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 36af0360b56d..83e789633e35 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -13,20 +13,20 @@ enum nfqnl_msg_types {
13}; 13};
14 14
15struct nfqnl_msg_packet_hdr { 15struct nfqnl_msg_packet_hdr {
16 u_int32_t packet_id; /* unique ID of packet in queue */ 16 __be32 packet_id; /* unique ID of packet in queue */
17 u_int16_t hw_protocol; /* hw protocol (network order) */ 17 __be16 hw_protocol; /* hw protocol (network order) */
18 u_int8_t hook; /* netfilter hook */ 18 u_int8_t hook; /* netfilter hook */
19} __attribute__ ((packed)); 19} __attribute__ ((packed));
20 20
21struct nfqnl_msg_packet_hw { 21struct nfqnl_msg_packet_hw {
22 u_int16_t hw_addrlen; 22 __be16 hw_addrlen;
23 u_int16_t _pad; 23 u_int16_t _pad;
24 u_int8_t hw_addr[8]; 24 u_int8_t hw_addr[8];
25}; 25};
26 26
27struct nfqnl_msg_packet_timestamp { 27struct nfqnl_msg_packet_timestamp {
28 aligned_u64 sec; 28 aligned_be64 sec;
29 aligned_u64 usec; 29 aligned_be64 usec;
30}; 30};
31 31
32enum nfqnl_attr_type { 32enum nfqnl_attr_type {
@@ -47,8 +47,8 @@ enum nfqnl_attr_type {
47#define NFQA_MAX (__NFQA_MAX - 1) 47#define NFQA_MAX (__NFQA_MAX - 1)
48 48
49struct nfqnl_msg_verdict_hdr { 49struct nfqnl_msg_verdict_hdr {
50 u_int32_t verdict; 50 __be32 verdict;
51 u_int32_t id; 51 __be32 id;
52}; 52};
53 53
54 54
@@ -63,7 +63,7 @@ enum nfqnl_msg_config_cmds {
63struct nfqnl_msg_config_cmd { 63struct nfqnl_msg_config_cmd {
64 u_int8_t command; /* nfqnl_msg_config_cmds */ 64 u_int8_t command; /* nfqnl_msg_config_cmds */
65 u_int8_t _pad; 65 u_int8_t _pad;
66 u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ 66 __be16 pf; /* AF_xxx for PF_[UN]BIND */
67}; 67};
68 68
69enum nfqnl_config_mode { 69enum nfqnl_config_mode {
@@ -73,7 +73,7 @@ enum nfqnl_config_mode {
73}; 73};
74 74
75struct nfqnl_msg_config_params { 75struct nfqnl_msg_config_params {
76 u_int32_t copy_range; 76 __be32 copy_range;
77 u_int8_t copy_mode; /* enum nfqnl_config_mode */ 77 u_int8_t copy_mode; /* enum nfqnl_config_mode */
78} __attribute__ ((packed)); 78} __attribute__ ((packed));
79 79
@@ -82,6 +82,7 @@ enum nfqnl_attr_config {
82 NFQA_CFG_UNSPEC, 82 NFQA_CFG_UNSPEC,
83 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ 83 NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */
84 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ 84 NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */
85 NFQA_CFG_QUEUE_MAXLEN, /* u_int32_t */
85 __NFQA_CFG_MAX 86 __NFQA_CFG_MAX
86}; 87};
87#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) 88#define NFQA_CFG_MAX (__NFQA_CFG_MAX-1)
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 04319a76103a..022edfa97ed9 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -96,22 +96,6 @@ struct _xt_align
96/* Error verdict. */ 96/* Error verdict. */
97#define XT_ERROR_TARGET "ERROR" 97#define XT_ERROR_TARGET "ERROR"
98 98
99/*
100 * New IP firewall options for [gs]etsockopt at the RAW IP level.
101 * Unlike BSD Linux inherits IP options so you don't have to use a raw
102 * socket for this. Instead we check rights in the calls. */
103#define XT_BASE_CTL 64 /* base for firewall socket options */
104
105#define XT_SO_SET_REPLACE (XT_BASE_CTL)
106#define XT_SO_SET_ADD_COUNTERS (XT_BASE_CTL + 1)
107#define XT_SO_SET_MAX XT_SO_SET_ADD_COUNTERS
108
109#define XT_SO_GET_INFO (XT_BASE_CTL)
110#define XT_SO_GET_ENTRIES (XT_BASE_CTL + 1)
111#define XT_SO_GET_REVISION_MATCH (XT_BASE_CTL + 2)
112#define XT_SO_GET_REVISION_TARGET (XT_BASE_CTL + 3)
113#define XT_SO_GET_MAX XT_SO_GET_REVISION_TARGET
114
115#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) 99#define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0)
116#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) 100#define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0)
117 101
diff --git a/include/linux/netfilter/xt_NFLOG.h b/include/linux/netfilter/xt_NFLOG.h
new file mode 100644
index 000000000000..cdcd0ed58f7a
--- /dev/null
+++ b/include/linux/netfilter/xt_NFLOG.h
@@ -0,0 +1,18 @@
1#ifndef _XT_NFLOG_TARGET
2#define _XT_NFLOG_TARGET
3
4#define XT_NFLOG_DEFAULT_GROUP 0x1
5#define XT_NFLOG_DEFAULT_THRESHOLD 1
6
7#define XT_NFLOG_MASK 0x0
8
9struct xt_nflog_info {
10 u_int32_t len;
11 u_int16_t group;
12 u_int16_t threshold;
13 u_int16_t flags;
14 u_int16_t pad;
15 char prefix[64];
16};
17
18#endif /* _XT_NFLOG_TARGET */
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 4c2d9945ca54..70b6f718cf4c 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -29,14 +29,14 @@
29struct ip_conntrack_old_tuple 29struct ip_conntrack_old_tuple
30{ 30{
31 struct { 31 struct {
32 __u32 ip; 32 __be32 ip;
33 union { 33 union {
34 __u16 all; 34 __u16 all;
35 } u; 35 } u;
36 } src; 36 } src;
37 37
38 struct { 38 struct {
39 __u32 ip; 39 __be32 ip;
40 union { 40 union {
41 __u16 all; 41 __u16 all;
42 } u; 42 } u;
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h
new file mode 100644
index 000000000000..b4556b8edbfd
--- /dev/null
+++ b/include/linux/netfilter/xt_hashlimit.h
@@ -0,0 +1,40 @@
1#ifndef _XT_HASHLIMIT_H
2#define _XT_HASHLIMIT_H
3
4/* timings are in milliseconds. */
5#define XT_HASHLIMIT_SCALE 10000
6/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
7 seconds, or one every 59 hours. */
8
9/* details of this structure hidden by the implementation */
10struct xt_hashlimit_htable;
11
12#define XT_HASHLIMIT_HASH_DIP 0x0001
13#define XT_HASHLIMIT_HASH_DPT 0x0002
14#define XT_HASHLIMIT_HASH_SIP 0x0004
15#define XT_HASHLIMIT_HASH_SPT 0x0008
16
17struct hashlimit_cfg {
18 u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */
19 u_int32_t avg; /* Average secs between packets * scale */
20 u_int32_t burst; /* Period multiplier for upper limit. */
21
22 /* user specified */
23 u_int32_t size; /* how many buckets */
24 u_int32_t max; /* max number of entries */
25 u_int32_t gc_interval; /* gc interval */
26 u_int32_t expire; /* when do entries expire? */
27};
28
29struct xt_hashlimit_info {
30 char name [IFNAMSIZ]; /* name */
31 struct hashlimit_cfg cfg;
32 struct xt_hashlimit_htable *hinfo;
33
34 /* Used internally by the kernel */
35 union {
36 void *ptr;
37 struct xt_hashlimit_info *master;
38 } u;
39};
40#endif /*_XT_HASHLIMIT_H*/
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h
index a8132ec076fb..45654d359a68 100644
--- a/include/linux/netfilter/xt_policy.h
+++ b/include/linux/netfilter/xt_policy.h
@@ -39,7 +39,7 @@ struct xt_policy_elem
39 union xt_policy_addr smask; 39 union xt_policy_addr smask;
40 union xt_policy_addr daddr; 40 union xt_policy_addr daddr;
41 union xt_policy_addr dmask; 41 union xt_policy_addr dmask;
42 u_int32_t spi; 42 __be32 spi;
43 u_int32_t reqid; 43 u_int32_t reqid;
44 u_int8_t proto; 44 u_int8_t proto;
45 u_int8_t mode; 45 u_int8_t mode;
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 44e39b61d9e7..0be235418a2f 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -112,19 +112,20 @@ struct arpt_entry
112 * New IP firewall options for [gs]etsockopt at the RAW IP level. 112 * New IP firewall options for [gs]etsockopt at the RAW IP level.
113 * Unlike BSD Linux inherits IP options so you don't have to use a raw 113 * Unlike BSD Linux inherits IP options so you don't have to use a raw
114 * socket for this. Instead we check rights in the calls. 114 * socket for this. Instead we check rights in the calls.
115 *
116 * ATTENTION: check linux/in.h before adding new number here.
115 */ 117 */
116#define ARPT_CTL_OFFSET 32 118#define ARPT_BASE_CTL 96
117#define ARPT_BASE_CTL (XT_BASE_CTL+ARPT_CTL_OFFSET) 119
118 120#define ARPT_SO_SET_REPLACE (ARPT_BASE_CTL)
119#define ARPT_SO_SET_REPLACE (XT_SO_SET_REPLACE+ARPT_CTL_OFFSET) 121#define ARPT_SO_SET_ADD_COUNTERS (ARPT_BASE_CTL + 1)
120#define ARPT_SO_SET_ADD_COUNTERS (XT_SO_SET_ADD_COUNTERS+ARPT_CTL_OFFSET) 122#define ARPT_SO_SET_MAX ARPT_SO_SET_ADD_COUNTERS
121#define ARPT_SO_SET_MAX (XT_SO_SET_MAX+ARPT_CTL_OFFSET) 123
122 124#define ARPT_SO_GET_INFO (ARPT_BASE_CTL)
123#define ARPT_SO_GET_INFO (XT_SO_GET_INFO+ARPT_CTL_OFFSET) 125#define ARPT_SO_GET_ENTRIES (ARPT_BASE_CTL + 1)
124#define ARPT_SO_GET_ENTRIES (XT_SO_GET_ENTRIES+ARPT_CTL_OFFSET) 126/* #define ARPT_SO_GET_REVISION_MATCH (APRT_BASE_CTL + 2) */
125/* #define ARPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH */ 127#define ARPT_SO_GET_REVISION_TARGET (ARPT_BASE_CTL + 3)
126#define ARPT_SO_GET_REVISION_TARGET (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET) 128#define ARPT_SO_GET_MAX (ARPT_SO_GET_REVISION_TARGET)
127#define ARPT_SO_GET_MAX (XT_SO_GET_REVISION_TARGET+ARPT_CTL_OFFSET)
128 129
129/* CONTINUE verdict for targets */ 130/* CONTINUE verdict for targets */
130#define ARPT_CONTINUE XT_CONTINUE 131#define ARPT_CONTINUE XT_CONTINUE
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 9a4dd11af86e..6c4613f8ad75 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -64,7 +64,7 @@ static inline int nf_bridge_pad(const struct sk_buff *skb)
64 64
65struct bridge_skb_cb { 65struct bridge_skb_cb {
66 union { 66 union {
67 __u32 ipv4; 67 __be32 ipv4;
68 } daddr; 68 } daddr;
69}; 69};
70 70
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h
index b9f712c14a0a..07f044ff1a6b 100644
--- a/include/linux/netfilter_bridge/ebt_802_3.h
+++ b/include/linux/netfilter_bridge/ebt_802_3.h
@@ -28,21 +28,21 @@ struct hdr_ui {
28 uint8_t ssap; 28 uint8_t ssap;
29 uint8_t ctrl; 29 uint8_t ctrl;
30 uint8_t orig[3]; 30 uint8_t orig[3];
31 uint16_t type; 31 __be16 type;
32}; 32};
33 33
34struct hdr_ni { 34struct hdr_ni {
35 uint8_t dsap; 35 uint8_t dsap;
36 uint8_t ssap; 36 uint8_t ssap;
37 uint16_t ctrl; 37 __be16 ctrl;
38 uint8_t orig[3]; 38 uint8_t orig[3];
39 uint16_t type; 39 __be16 type;
40}; 40};
41 41
42struct ebt_802_3_hdr { 42struct ebt_802_3_hdr {
43 uint8_t daddr[6]; 43 uint8_t daddr[6];
44 uint8_t saddr[6]; 44 uint8_t saddr[6];
45 uint16_t len; 45 __be16 len;
46 union { 46 union {
47 struct hdr_ui ui; 47 struct hdr_ui ui;
48 struct hdr_ni ni; 48 struct hdr_ni ni;
@@ -61,7 +61,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb)
61struct ebt_802_3_info 61struct ebt_802_3_info
62{ 62{
63 uint8_t sap; 63 uint8_t sap;
64 uint16_t type; 64 __be16 type;
65 uint8_t bitmask; 65 uint8_t bitmask;
66 uint8_t invflags; 66 uint8_t invflags;
67}; 67};
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/linux/netfilter_bridge/ebt_among.h
index 307c1fed8511..7654069233ca 100644
--- a/include/linux/netfilter_bridge/ebt_among.h
+++ b/include/linux/netfilter_bridge/ebt_among.h
@@ -32,7 +32,7 @@
32struct ebt_mac_wormhash_tuple 32struct ebt_mac_wormhash_tuple
33{ 33{
34 uint32_t cmp[2]; 34 uint32_t cmp[2];
35 uint32_t ip; 35 __be32 ip;
36}; 36};
37 37
38struct ebt_mac_wormhash 38struct ebt_mac_wormhash
diff --git a/include/linux/netfilter_bridge/ebt_arp.h b/include/linux/netfilter_bridge/ebt_arp.h
index 537ec6b487a2..97e4dbde1f89 100644
--- a/include/linux/netfilter_bridge/ebt_arp.h
+++ b/include/linux/netfilter_bridge/ebt_arp.h
@@ -14,13 +14,13 @@
14 14
15struct ebt_arp_info 15struct ebt_arp_info
16{ 16{
17 uint16_t htype; 17 __be16 htype;
18 uint16_t ptype; 18 __be16 ptype;
19 uint16_t opcode; 19 __be16 opcode;
20 uint32_t saddr; 20 __be32 saddr;
21 uint32_t smsk; 21 __be32 smsk;
22 uint32_t daddr; 22 __be32 daddr;
23 uint32_t dmsk; 23 __be32 dmsk;
24 unsigned char smaddr[ETH_ALEN]; 24 unsigned char smaddr[ETH_ALEN];
25 unsigned char smmsk[ETH_ALEN]; 25 unsigned char smmsk[ETH_ALEN];
26 unsigned char dmaddr[ETH_ALEN]; 26 unsigned char dmaddr[ETH_ALEN];
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/linux/netfilter_bridge/ebt_ip.h
index 7247385cdcb1..d6847475bf2e 100644
--- a/include/linux/netfilter_bridge/ebt_ip.h
+++ b/include/linux/netfilter_bridge/ebt_ip.h
@@ -28,10 +28,10 @@
28/* the same values are used for the invflags */ 28/* the same values are used for the invflags */
29struct ebt_ip_info 29struct ebt_ip_info
30{ 30{
31 uint32_t saddr; 31 __be32 saddr;
32 uint32_t daddr; 32 __be32 daddr;
33 uint32_t smsk; 33 __be32 smsk;
34 uint32_t dmsk; 34 __be32 dmsk;
35 uint8_t tos; 35 uint8_t tos;
36 uint8_t protocol; 36 uint8_t protocol;
37 uint8_t bitmask; 37 uint8_t bitmask;
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/linux/netfilter_bridge/ebt_nat.h
index 26fd90da4cd6..435b886a51aa 100644
--- a/include/linux/netfilter_bridge/ebt_nat.h
+++ b/include/linux/netfilter_bridge/ebt_nat.h
@@ -1,6 +1,7 @@
1#ifndef __LINUX_BRIDGE_EBT_NAT_H 1#ifndef __LINUX_BRIDGE_EBT_NAT_H
2#define __LINUX_BRIDGE_EBT_NAT_H 2#define __LINUX_BRIDGE_EBT_NAT_H
3 3
4#define NAT_ARP_BIT (0x00000010)
4struct ebt_nat_info 5struct ebt_nat_info
5{ 6{
6 unsigned char mac[ETH_ALEN]; 7 unsigned char mac[ETH_ALEN];
diff --git a/include/linux/netfilter_bridge/ebt_vlan.h b/include/linux/netfilter_bridge/ebt_vlan.h
index cb1fcc41565f..1d98be4031e7 100644
--- a/include/linux/netfilter_bridge/ebt_vlan.h
+++ b/include/linux/netfilter_bridge/ebt_vlan.h
@@ -10,7 +10,7 @@
10struct ebt_vlan_info { 10struct ebt_vlan_info {
11 uint16_t id; /* VLAN ID {1-4095} */ 11 uint16_t id; /* VLAN ID {1-4095} */
12 uint8_t prio; /* VLAN User Priority {0-7} */ 12 uint8_t prio; /* VLAN User Priority {0-7} */
13 uint16_t encap; /* VLAN Encapsulated frame code {0-65535} */ 13 __be16 encap; /* VLAN Encapsulated frame code {0-65535} */
14 uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg, 14 uint8_t bitmask; /* Args bitmask bit 1=1 - ID arg,
15 bit 2=1 User-Priority arg, bit 3=1 encap*/ 15 bit 2=1 User-Priority arg, bit 3=1 encap*/
16 uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg, 16 uint8_t invflags; /* Inverse bitmask bit 1=1 - inversed ID arg,
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h
index b1a7cc90877b..94e0a7dc0cb2 100644
--- a/include/linux/netfilter_bridge/ebtables.h
+++ b/include/linux/netfilter_bridge/ebtables.h
@@ -26,6 +26,10 @@
26#define EBT_CONTINUE -3 26#define EBT_CONTINUE -3
27#define EBT_RETURN -4 27#define EBT_RETURN -4
28#define NUM_STANDARD_TARGETS 4 28#define NUM_STANDARD_TARGETS 4
29/* ebtables target modules store the verdict inside an int. We can
30 * reclaim a part of this int for backwards compatible extensions.
31 * The 4 lsb are more than enough to store the verdict. */
32#define EBT_VERDICT_BITS 0x0000000F
29 33
30struct ebt_counter 34struct ebt_counter
31{ 35{
@@ -42,6 +46,23 @@ struct ebt_replace
42 /* total size of the entries */ 46 /* total size of the entries */
43 unsigned int entries_size; 47 unsigned int entries_size;
44 /* start of the chains */ 48 /* start of the chains */
49 struct ebt_entries __user *hook_entry[NF_BR_NUMHOOKS];
50 /* nr of counters userspace expects back */
51 unsigned int num_counters;
52 /* where the kernel will put the old counters */
53 struct ebt_counter __user *counters;
54 char __user *entries;
55};
56
57struct ebt_replace_kernel
58{
59 char name[EBT_TABLE_MAXNAMELEN];
60 unsigned int valid_hooks;
61 /* nr of rules in the table */
62 unsigned int nentries;
63 /* total size of the entries */
64 unsigned int entries_size;
65 /* start of the chains */
45 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS]; 66 struct ebt_entries *hook_entry[NF_BR_NUMHOOKS];
46 /* nr of counters userspace expects back */ 67 /* nr of counters userspace expects back */
47 unsigned int num_counters; 68 unsigned int num_counters;
@@ -141,7 +162,7 @@ struct ebt_entry {
141 /* this needs to be the first field */ 162 /* this needs to be the first field */
142 unsigned int bitmask; 163 unsigned int bitmask;
143 unsigned int invflags; 164 unsigned int invflags;
144 uint16_t ethproto; 165 __be16 ethproto;
145 /* the physical in-dev */ 166 /* the physical in-dev */
146 char in[IFNAMSIZ]; 167 char in[IFNAMSIZ];
147 /* the logical in-dev */ 168 /* the logical in-dev */
@@ -251,7 +272,7 @@ struct ebt_table
251{ 272{
252 struct list_head list; 273 struct list_head list;
253 char name[EBT_TABLE_MAXNAMELEN]; 274 char name[EBT_TABLE_MAXNAMELEN];
254 struct ebt_replace *table; 275 struct ebt_replace_kernel *table;
255 unsigned int valid_hooks; 276 unsigned int valid_hooks;
256 rwlock_t lock; 277 rwlock_t lock;
257 /* e.g. could be the table explicitly only allows certain 278 /* e.g. could be the table explicitly only allows certain
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 5b63a231a76b..5821eb5a0a3e 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -79,7 +79,7 @@ enum nf_ip_hook_priorities {
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); 80extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type);
81extern int ip_xfrm_me_harder(struct sk_buff **pskb); 81extern int ip_xfrm_me_harder(struct sk_buff **pskb);
82extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, 82extern __sum16 nf_ip_checksum(struct sk_buff *skb, unsigned int hook,
83 unsigned int dataoff, u_int8_t protocol); 83 unsigned int dataoff, u_int8_t protocol);
84#endif /*__KERNEL__*/ 84#endif /*__KERNEL__*/
85 85
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild
index 591c1a809c00..180337801a86 100644
--- a/include/linux/netfilter_ipv4/Kbuild
+++ b/include/linux/netfilter_ipv4/Kbuild
@@ -1,6 +1,4 @@
1header-y += ip_conntrack_helper.h 1header-y += ip_conntrack_helper.h
2header-y += ip_conntrack_helper_h323_asn1.h
3header-y += ip_conntrack_helper_h323_types.h
4header-y += ip_conntrack_protocol.h 2header-y += ip_conntrack_protocol.h
5header-y += ip_conntrack_sctp.h 3header-y += ip_conntrack_sctp.h
6header-y += ip_conntrack_tcp.h 4header-y += ip_conntrack_tcp.h
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h
index 64e868034c4a..61da56941dce 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack.h
@@ -277,7 +277,7 @@ extern struct ip_conntrack_expect *
277__ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); 277__ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple);
278 278
279extern struct ip_conntrack_expect * 279extern struct ip_conntrack_expect *
280ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); 280ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple);
281 281
282extern struct ip_conntrack_tuple_hash * 282extern struct ip_conntrack_tuple_hash *
283__ip_conntrack_find(const struct ip_conntrack_tuple *tuple, 283__ip_conntrack_find(const struct ip_conntrack_tuple *tuple,
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
index 63811934de4d..2129fc3972ac 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h
@@ -1,6 +1,44 @@
1#ifndef _IP_CONNTRACK_FTP_H 1#ifndef _IP_CONNTRACK_FTP_H
2#define _IP_CONNTRACK_FTP_H 2#define _IP_CONNTRACK_FTP_H
3/* FTP tracking. */
3 4
4#include <linux/netfilter/nf_conntrack_ftp.h> 5/* This enum is exposed to userspace */
6enum ip_ct_ftp_type
7{
8 /* PORT command from client */
9 IP_CT_FTP_PORT,
10 /* PASV response from server */
11 IP_CT_FTP_PASV,
12 /* EPRT command from client */
13 IP_CT_FTP_EPRT,
14 /* EPSV response from server */
15 IP_CT_FTP_EPSV,
16};
17
18#ifdef __KERNEL__
19
20#define FTP_PORT 21
21
22#define NUM_SEQ_TO_REMEMBER 2
23/* This structure exists only once per master */
24struct ip_ct_ftp_master {
25 /* Valid seq positions for cmd matching after newline */
26 u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER];
27 /* 0 means seq_match_aft_nl not set */
28 int seq_aft_nl_num[IP_CT_DIR_MAX];
29};
30
31struct ip_conntrack_expect;
32
33/* For NAT to hook in when we find a packet which describes what other
34 * connection we should expect. */
35extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb,
36 enum ip_conntrack_info ctinfo,
37 enum ip_ct_ftp_type type,
38 unsigned int matchoff,
39 unsigned int matchlen,
40 struct ip_conntrack_expect *exp,
41 u32 *seq);
42#endif /* __KERNEL__ */
5 43
6#endif /* _IP_CONNTRACK_FTP_H */ 44#endif /* _IP_CONNTRACK_FTP_H */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
index 943cc6a4871d..18f769818f4e 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h
@@ -3,7 +3,7 @@
3 3
4#ifdef __KERNEL__ 4#ifdef __KERNEL__
5 5
6#include <linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h> 6#include <linux/netfilter/nf_conntrack_h323_asn1.h>
7 7
8#define RAS_PORT 1719 8#define RAS_PORT 1719
9#define Q931_PORT 1720 9#define Q931_PORT 1720
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
index 1d853aa873eb..e371e0fc1672 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
@@ -102,11 +102,11 @@ static inline __be32 *gre_key(struct gre_hdr *greh)
102} 102}
103 103
104/* get pointer ot gre csum, if present */ 104/* get pointer ot gre csum, if present */
105static inline u_int16_t *gre_csum(struct gre_hdr *greh) 105static inline __sum16 *gre_csum(struct gre_hdr *greh)
106{ 106{
107 if (!greh->csum) 107 if (!greh->csum)
108 return NULL; 108 return NULL;
109 return (u_int16_t *) (greh+sizeof(*greh)); 109 return (__sum16 *) (greh+sizeof(*greh));
110} 110}
111 111
112#endif /* __KERNEL__ */ 112#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
index 913dad66c0fb..bef6c646defa 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_sip.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_sip.h
@@ -5,23 +5,18 @@
5#define SIP_PORT 5060 5#define SIP_PORT 5060
6#define SIP_TIMEOUT 3600 6#define SIP_TIMEOUT 3600
7 7
8#define POS_VIA 0 8enum sip_header_pos {
9#define POS_CONTACT 1 9 POS_REG_REQ_URI,
10#define POS_CONTENT 2 10 POS_REQ_URI,
11#define POS_MEDIA 3 11 POS_FROM,
12#define POS_OWNER 4 12 POS_TO,
13#define POS_CONNECTION 5 13 POS_VIA,
14#define POS_REQ_HEADER 6 14 POS_CONTACT,
15#define POS_SDP_HEADER 7 15 POS_CONTENT,
16 16 POS_MEDIA,
17struct sip_header_nfo { 17 POS_OWNER,
18 const char *lname; 18 POS_CONNECTION,
19 const char *sname; 19 POS_SDP_HEADER,
20 const char *ln_str;
21 size_t lnlen;
22 size_t snlen;
23 size_t ln_strlen;
24 int (*match_len)(const char *, const char *, int *);
25}; 20};
26 21
27extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, 22extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb,
@@ -36,9 +31,10 @@ extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb,
36extern int ct_sip_get_info(const char *dptr, size_t dlen, 31extern int ct_sip_get_info(const char *dptr, size_t dlen,
37 unsigned int *matchoff, 32 unsigned int *matchoff,
38 unsigned int *matchlen, 33 unsigned int *matchlen,
39 struct sip_header_nfo *hnfo); 34 enum sip_header_pos pos);
40extern int ct_sip_lnlen(const char *line, const char *limit); 35extern int ct_sip_lnlen(const char *line, const char *limit);
41extern const char *ct_sip_search(const char *needle, const char *haystack, 36extern const char *ct_sip_search(const char *needle, const char *haystack,
42 size_t needle_len, size_t haystack_len); 37 size_t needle_len, size_t haystack_len,
38 int case_sensitive);
43#endif /* __KERNEL__ */ 39#endif /* __KERNEL__ */
44#endif /* __IP_CONNTRACK_SIP_H__ */ 40#endif /* __IP_CONNTRACK_SIP_H__ */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
index cde9729aa173..a404fc0abf0e 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h
@@ -4,7 +4,7 @@
4#define TFTP_PORT 69 4#define TFTP_PORT 69
5 5
6struct tftphdr { 6struct tftphdr {
7 u_int16_t opcode; 7 __be16 opcode;
8}; 8};
9 9
10#define TFTP_OPCODE_READ 1 10#define TFTP_OPCODE_READ 1
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index a536bbdef145..4f06dad0bde9 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -101,18 +101,21 @@ struct ipt_entry
101/* 101/*
102 * New IP firewall options for [gs]etsockopt at the RAW IP level. 102 * New IP firewall options for [gs]etsockopt at the RAW IP level.
103 * Unlike BSD Linux inherits IP options so you don't have to use a raw 103 * Unlike BSD Linux inherits IP options so you don't have to use a raw
104 * socket for this. Instead we check rights in the calls. */ 104 * socket for this. Instead we check rights in the calls.
105#define IPT_BASE_CTL XT_BASE_CTL 105 *
106 106 * ATTENTION: check linux/in.h before adding new number here.
107#define IPT_SO_SET_REPLACE XT_SO_SET_REPLACE 107 */
108#define IPT_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS 108#define IPT_BASE_CTL 64
109#define IPT_SO_SET_MAX XT_SO_SET_MAX 109
110 110#define IPT_SO_SET_REPLACE (IPT_BASE_CTL)
111#define IPT_SO_GET_INFO XT_SO_GET_INFO 111#define IPT_SO_SET_ADD_COUNTERS (IPT_BASE_CTL + 1)
112#define IPT_SO_GET_ENTRIES XT_SO_GET_ENTRIES 112#define IPT_SO_SET_MAX IPT_SO_SET_ADD_COUNTERS
113#define IPT_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH 113
114#define IPT_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET 114#define IPT_SO_GET_INFO (IPT_BASE_CTL)
115#define IPT_SO_GET_MAX XT_SO_GET_REVISION_TARGET 115#define IPT_SO_GET_ENTRIES (IPT_BASE_CTL + 1)
116#define IPT_SO_GET_REVISION_MATCH (IPT_BASE_CTL + 2)
117#define IPT_SO_GET_REVISION_TARGET (IPT_BASE_CTL + 3)
118#define IPT_SO_GET_MAX IPT_SO_GET_REVISION_TARGET
116 119
117#define IPT_CONTINUE XT_CONTINUE 120#define IPT_CONTINUE XT_CONTINUE
118#define IPT_RETURN XT_RETURN 121#define IPT_RETURN XT_RETURN
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h
index 892f9a33fea8..90fa6525ef9c 100644
--- a/include/linux/netfilter_ipv4/ipt_LOG.h
+++ b/include/linux/netfilter_ipv4/ipt_LOG.h
@@ -6,7 +6,7 @@
6#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ 6#define IPT_LOG_TCPOPT 0x02 /* Log TCP options */
7#define IPT_LOG_IPOPT 0x04 /* Log IP options */ 7#define IPT_LOG_IPOPT 0x04 /* Log IP options */
8#define IPT_LOG_UID 0x08 /* Log UID owning local socket */ 8#define IPT_LOG_UID 0x08 /* Log UID owning local socket */
9#define IPT_LOG_NFLOG 0x10 /* Log using nf_log backend */ 9#define IPT_LOG_NFLOG 0x10 /* Unsupported, don't reuse */
10#define IPT_LOG_MASK 0x1f 10#define IPT_LOG_MASK 0x1f
11 11
12struct ipt_log_info { 12struct ipt_log_info {
diff --git a/include/linux/netfilter_ipv4/ipt_hashlimit.h b/include/linux/netfilter_ipv4/ipt_hashlimit.h
index ac2cb64ecd76..5662120a3d7b 100644
--- a/include/linux/netfilter_ipv4/ipt_hashlimit.h
+++ b/include/linux/netfilter_ipv4/ipt_hashlimit.h
@@ -1,40 +1,14 @@
1#ifndef _IPT_HASHLIMIT_H 1#ifndef _IPT_HASHLIMIT_H
2#define _IPT_HASHLIMIT_H 2#define _IPT_HASHLIMIT_H
3 3
4/* timings are in milliseconds. */ 4#include <linux/netfilter/xt_hashlimit.h>
5#define IPT_HASHLIMIT_SCALE 10000
6/* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490
7 seconds, or one every 59 hours. */
8 5
9/* details of this structure hidden by the implementation */ 6#define IPT_HASHLIMIT_SCALE XT_HASHLIMIT_SCALE
10struct ipt_hashlimit_htable; 7#define IPT_HASHLIMIT_HASH_DIP XT_HASHLIMIT_HASH_DIP
8#define IPT_HASHLIMIT_HASH_DPT XT_HASHLIMIT_HASH_DPT
9#define IPT_HASHLIMIT_HASH_SIP XT_HASHLIMIT_HASH_SIP
10#define IPT_HASHLIMIT_HASH_SPT XT_HASHLIMIT_HASH_SPT
11 11
12#define IPT_HASHLIMIT_HASH_DIP 0x0001 12#define ipt_hashlimit_info xt_hashlimit_info
13#define IPT_HASHLIMIT_HASH_DPT 0x0002
14#define IPT_HASHLIMIT_HASH_SIP 0x0004
15#define IPT_HASHLIMIT_HASH_SPT 0x0008
16 13
17struct hashlimit_cfg { 14#endif /* _IPT_HASHLIMIT_H */
18 u_int32_t mode; /* bitmask of IPT_HASHLIMIT_HASH_* */
19 u_int32_t avg; /* Average secs between packets * scale */
20 u_int32_t burst; /* Period multiplier for upper limit. */
21
22 /* user specified */
23 u_int32_t size; /* how many buckets */
24 u_int32_t max; /* max number of entries */
25 u_int32_t gc_interval; /* gc interval */
26 u_int32_t expire; /* when do entries expire? */
27};
28
29struct ipt_hashlimit_info {
30 char name [IFNAMSIZ]; /* name */
31 struct hashlimit_cfg cfg;
32 struct ipt_hashlimit_htable *hinfo;
33
34 /* Used internally by the kernel */
35 union {
36 void *ptr;
37 struct ipt_hashlimit_info *master;
38 } u;
39};
40#endif /*_IPT_HASHLIMIT_H*/
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index d97e268cdfe5..ab81a6dc94ea 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -74,7 +74,7 @@ enum nf_ip6_hook_priorities {
74 74
75#ifdef CONFIG_NETFILTER 75#ifdef CONFIG_NETFILTER
76extern int ip6_route_me_harder(struct sk_buff *skb); 76extern int ip6_route_me_harder(struct sk_buff *skb);
77extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 77extern __sum16 nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
78 unsigned int dataoff, u_int8_t protocol); 78 unsigned int dataoff, u_int8_t protocol);
79 79
80extern int ipv6_netfilter_init(void); 80extern int ipv6_netfilter_init(void);
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index d7a8e9c0dad0..4aed340401db 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -107,18 +107,21 @@ struct ip6t_entry
107/* 107/*
108 * New IP firewall options for [gs]etsockopt at the RAW IP level. 108 * New IP firewall options for [gs]etsockopt at the RAW IP level.
109 * Unlike BSD Linux inherits IP options so you don't have to use 109 * Unlike BSD Linux inherits IP options so you don't have to use
110 * a raw socket for this. Instead we check rights in the calls. */ 110 * a raw socket for this. Instead we check rights in the calls.
111#define IP6T_BASE_CTL XT_BASE_CTL 111 *
112 112 * ATTENTION: check linux/in6.h before adding new number here.
113#define IP6T_SO_SET_REPLACE XT_SO_SET_REPLACE 113 */
114#define IP6T_SO_SET_ADD_COUNTERS XT_SO_SET_ADD_COUNTERS 114#define IP6T_BASE_CTL 64
115#define IP6T_SO_SET_MAX XT_SO_SET_MAX 115
116 116#define IP6T_SO_SET_REPLACE (IP6T_BASE_CTL)
117#define IP6T_SO_GET_INFO XT_SO_GET_INFO 117#define IP6T_SO_SET_ADD_COUNTERS (IP6T_BASE_CTL + 1)
118#define IP6T_SO_GET_ENTRIES XT_SO_GET_ENTRIES 118#define IP6T_SO_SET_MAX IP6T_SO_SET_ADD_COUNTERS
119#define IP6T_SO_GET_REVISION_MATCH XT_SO_GET_REVISION_MATCH 119
120#define IP6T_SO_GET_REVISION_TARGET XT_SO_GET_REVISION_TARGET 120#define IP6T_SO_GET_INFO (IP6T_BASE_CTL)
121#define IP6T_SO_GET_MAX XT_SO_GET_REVISION_TARGET 121#define IP6T_SO_GET_ENTRIES (IP6T_BASE_CTL + 1)
122#define IP6T_SO_GET_REVISION_MATCH (IP6T_BASE_CTL + 4)
123#define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5)
124#define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET
122 125
123/* CONTINUE verdict for targets */ 126/* CONTINUE verdict for targets */
124#define IP6T_CONTINUE XT_CONTINUE 127#define IP6T_CONTINUE XT_CONTINUE
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h
index 060c1a1c6c60..0d0119b0458c 100644
--- a/include/linux/netfilter_ipv6/ip6t_LOG.h
+++ b/include/linux/netfilter_ipv6/ip6t_LOG.h
@@ -6,7 +6,7 @@
6#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ 6#define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */
7#define IP6T_LOG_IPOPT 0x04 /* Log IP options */ 7#define IP6T_LOG_IPOPT 0x04 /* Log IP options */
8#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */ 8#define IP6T_LOG_UID 0x08 /* Log UID owning local socket */
9#define IP6T_LOG_NFLOG 0x10 /* Log using nf_log backend */ 9#define IP6T_LOG_NFLOG 0x10 /* Unsupported, don't use */
10#define IP6T_LOG_MASK 0x1f 10#define IP6T_LOG_MASK 0x1f
11 11
12struct ip6t_log_info { 12struct ip6t_log_info {
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 66411622e06e..b3b9b609ee89 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -141,7 +141,6 @@ struct netlink_skb_parms
141{ 141{
142 struct ucred creds; /* Skb credentials */ 142 struct ucred creds; /* Skb credentials */
143 __u32 pid; 143 __u32 pid;
144 __u32 dst_pid;
145 __u32 dst_group; 144 __u32 dst_group;
146 kernel_cap_t eff_cap; 145 kernel_cap_t eff_cap;
147 __u32 loginuid; /* Login (audit) uid */ 146 __u32 loginuid; /* Login (audit) uid */
@@ -174,6 +173,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol);
174 */ 173 */
175#define NLMSG_GOODORDER 0 174#define NLMSG_GOODORDER 0
176#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) 175#define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER))
176#define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN)
177 177
178 178
179struct netlink_callback 179struct netlink_callback
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 1efe60c5c00c..2cc9867b1626 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -12,26 +12,27 @@
12#include <linux/rcupdate.h> 12#include <linux/rcupdate.h>
13#include <linux/list.h> 13#include <linux/list.h>
14 14
15struct netpoll;
16
17struct netpoll { 15struct netpoll {
18 struct net_device *dev; 16 struct net_device *dev;
19 char dev_name[16], *name; 17 char dev_name[IFNAMSIZ];
18 const char *name;
20 void (*rx_hook)(struct netpoll *, int, char *, int); 19 void (*rx_hook)(struct netpoll *, int, char *, int);
21 void (*drop)(struct sk_buff *skb); 20
22 u32 local_ip, remote_ip; 21 u32 local_ip, remote_ip;
23 u16 local_port, remote_port; 22 u16 local_port, remote_port;
24 unsigned char local_mac[6], remote_mac[6]; 23 u8 local_mac[ETH_ALEN], remote_mac[ETH_ALEN];
25}; 24};
26 25
27struct netpoll_info { 26struct netpoll_info {
27 atomic_t refcnt;
28 spinlock_t poll_lock; 28 spinlock_t poll_lock;
29 int poll_owner; 29 int poll_owner;
30 int tries;
31 int rx_flags; 30 int rx_flags;
32 spinlock_t rx_lock; 31 spinlock_t rx_lock;
33 struct netpoll *rx_np; /* netpoll that registered an rx_hook */ 32 struct netpoll *rx_np; /* netpoll that registered an rx_hook */
34 struct sk_buff_head arp_tx; /* list of arp requests to reply to */ 33 struct sk_buff_head arp_tx; /* list of arp requests to reply to */
34 struct sk_buff_head txq;
35 struct work_struct tx_work;
35}; 36};
36 37
37void netpoll_poll(struct netpoll *np); 38void netpoll_poll(struct netpoll *np);
@@ -42,7 +43,7 @@ int netpoll_trap(void);
42void netpoll_set_trap(int trap); 43void netpoll_set_trap(int trap);
43void netpoll_cleanup(struct netpoll *np); 44void netpoll_cleanup(struct netpoll *np);
44int __netpoll_rx(struct sk_buff *skb); 45int __netpoll_rx(struct sk_buff *skb);
45void netpoll_queue(struct sk_buff *skb); 46
46 47
47#ifdef CONFIG_NETPOLL 48#ifdef CONFIG_NETPOLL
48static inline int netpoll_rx(struct sk_buff *skb) 49static inline int netpoll_rx(struct sk_buff *skb)
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 76ff54846ada..625ffea98561 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -157,7 +157,7 @@ struct nfs_inode {
157 * This is the cookie verifier used for NFSv3 readdir 157 * This is the cookie verifier used for NFSv3 readdir
158 * operations 158 * operations
159 */ 159 */
160 __u32 cookieverf[2]; 160 __be32 cookieverf[2];
161 161
162 /* 162 /*
163 * This is the list of dirty unwritten pages. 163 * This is the list of dirty unwritten pages.
@@ -290,6 +290,7 @@ static inline int nfs_verify_change_attribute(struct inode *inode, unsigned long
290 * linux/fs/nfs/inode.c 290 * linux/fs/nfs/inode.c
291 */ 291 */
292extern int nfs_sync_mapping(struct address_space *mapping); 292extern int nfs_sync_mapping(struct address_space *mapping);
293extern void nfs_zap_mapping(struct inode *inode, struct address_space *mapping);
293extern void nfs_zap_caches(struct inode *); 294extern void nfs_zap_caches(struct inode *);
294extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *, 295extern struct inode *nfs_fhget(struct super_block *, struct nfs_fh *,
295 struct nfs_fattr *); 296 struct nfs_fattr *);
@@ -317,7 +318,7 @@ extern void put_nfs_open_context(struct nfs_open_context *ctx);
317extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); 318extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode);
318 319
319/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 320/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
320extern u32 root_nfs_parse_addr(char *name); /*__init*/ 321extern __be32 root_nfs_parse_addr(char *name); /*__init*/
321 322
322static inline void nfs_fattr_init(struct nfs_fattr *fattr) 323static inline void nfs_fattr_init(struct nfs_fattr *fattr)
323{ 324{
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index dc5397d9d23c..768c1ad5ff6f 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -266,7 +266,7 @@ struct nfs_writeargs {
266 266
267struct nfs_writeverf { 267struct nfs_writeverf {
268 enum nfs3_stable_how committed; 268 enum nfs3_stable_how committed;
269 __u32 verifier[2]; 269 __be32 verifier[2];
270}; 270};
271 271
272struct nfs_writeres { 272struct nfs_writeres {
@@ -420,7 +420,7 @@ struct nfs3_createargs {
420 unsigned int len; 420 unsigned int len;
421 struct iattr * sattr; 421 struct iattr * sattr;
422 enum nfs3_createmode createmode; 422 enum nfs3_createmode createmode;
423 __u32 verifier[2]; 423 __be32 verifier[2];
424}; 424};
425 425
426struct nfs3_mkdirargs { 426struct nfs3_mkdirargs {
@@ -467,7 +467,7 @@ struct nfs3_linkargs {
467struct nfs3_readdirargs { 467struct nfs3_readdirargs {
468 struct nfs_fh * fh; 468 struct nfs_fh * fh;
469 __u64 cookie; 469 __u64 cookie;
470 __u32 verf[2]; 470 __be32 verf[2];
471 int plus; 471 int plus;
472 unsigned int count; 472 unsigned int count;
473 struct page ** pages; 473 struct page ** pages;
@@ -503,7 +503,7 @@ struct nfs3_linkres {
503 503
504struct nfs3_readdirres { 504struct nfs3_readdirres {
505 struct nfs_fattr * dir_attr; 505 struct nfs_fattr * dir_attr;
506 __u32 * verf; 506 __be32 * verf;
507 int plus; 507 int plus;
508}; 508};
509 509
@@ -811,7 +811,7 @@ struct nfs_rpc_ops {
811 int (*pathconf) (struct nfs_server *, struct nfs_fh *, 811 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
812 struct nfs_pathconf *); 812 struct nfs_pathconf *);
813 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *); 813 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
814 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); 814 __be32 *(*decode_dirent)(__be32 *, struct nfs_entry *, int plus);
815 void (*read_setup) (struct nfs_read_data *); 815 void (*read_setup) (struct nfs_read_data *);
816 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 816 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
817 void (*write_setup) (struct nfs_write_data *, int how); 817 void (*write_setup) (struct nfs_write_data *, int how);
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h
index c3a3557c2a5b..007480cd6a60 100644
--- a/include/linux/nfsd/cache.h
+++ b/include/linux/nfsd/cache.h
@@ -26,14 +26,14 @@ struct svc_cacherep {
26 c_type, /* status, buffer */ 26 c_type, /* status, buffer */
27 c_secure : 1; /* req came from port < 1024 */ 27 c_secure : 1; /* req came from port < 1024 */
28 struct sockaddr_in c_addr; 28 struct sockaddr_in c_addr;
29 u32 c_xid; 29 __be32 c_xid;
30 u32 c_prot; 30 u32 c_prot;
31 u32 c_proc; 31 u32 c_proc;
32 u32 c_vers; 32 u32 c_vers;
33 unsigned long c_timestamp; 33 unsigned long c_timestamp;
34 union { 34 union {
35 struct kvec u_vec; 35 struct kvec u_vec;
36 u32 u_status; 36 __be32 u_status;
37 } c_u; 37 } c_u;
38}; 38};
39 39
@@ -75,7 +75,7 @@ enum {
75void nfsd_cache_init(void); 75void nfsd_cache_init(void);
76void nfsd_cache_shutdown(void); 76void nfsd_cache_shutdown(void);
77int nfsd_cache_lookup(struct svc_rqst *, int); 77int nfsd_cache_lookup(struct svc_rqst *, int);
78void nfsd_cache_update(struct svc_rqst *, int, u32 *); 78void nfsd_cache_update(struct svc_rqst *, int, __be32 *);
79 79
80#endif /* __KERNEL__ */ 80#endif /* __KERNEL__ */
81#endif /* NFSCACHE_H */ 81#endif /* NFSCACHE_H */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 6e78ea969f49..045e38cdbe64 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -117,8 +117,8 @@ struct svc_export * exp_parent(struct auth_domain *clp,
117 struct cache_req *reqp); 117 struct cache_req *reqp);
118int exp_rootfh(struct auth_domain *, 118int exp_rootfh(struct auth_domain *,
119 char *path, struct knfsd_fh *, int maxsize); 119 char *path, struct knfsd_fh *, int maxsize);
120int exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); 120__be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq);
121int nfserrno(int errno); 121__be32 nfserrno(int errno);
122 122
123extern struct cache_detail svc_export_cache; 123extern struct cache_detail svc_export_cache;
124 124
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index d0d4aae7085f..edb54c3171b3 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -50,7 +50,7 @@
50 * Callback function for readdir 50 * Callback function for readdir
51 */ 51 */
52struct readdir_cd { 52struct readdir_cd {
53 int err; /* 0, nfserr, or nfserr_eof */ 53 __be32 err; /* 0, nfserr, or nfserr_eof */
54}; 54};
55typedef int (*encode_dent_fn)(struct readdir_cd *, const char *, 55typedef int (*encode_dent_fn)(struct readdir_cd *, const char *,
56 int, loff_t, ino_t, unsigned int); 56 int, loff_t, ino_t, unsigned int);
@@ -64,7 +64,7 @@ extern struct svc_serv *nfsd_serv;
64 * Function prototypes. 64 * Function prototypes.
65 */ 65 */
66int nfsd_svc(unsigned short port, int nrservs); 66int nfsd_svc(unsigned short port, int nrservs);
67int nfsd_dispatch(struct svc_rqst *rqstp, u32 *statp); 67int nfsd_dispatch(struct svc_rqst *rqstp, __be32 *statp);
68 68
69/* nfsd/vfs.c */ 69/* nfsd/vfs.c */
70int fh_lock_parent(struct svc_fh *, struct dentry *); 70int fh_lock_parent(struct svc_fh *, struct dentry *);
@@ -72,57 +72,57 @@ int nfsd_racache_init(int);
72void nfsd_racache_shutdown(void); 72void nfsd_racache_shutdown(void);
73int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp, 73int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
74 struct svc_export **expp); 74 struct svc_export **expp);
75int nfsd_lookup(struct svc_rqst *, struct svc_fh *, 75__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
76 const char *, int, struct svc_fh *); 76 const char *, int, struct svc_fh *);
77int nfsd_setattr(struct svc_rqst *, struct svc_fh *, 77__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
78 struct iattr *, int, time_t); 78 struct iattr *, int, time_t);
79#ifdef CONFIG_NFSD_V4 79#ifdef CONFIG_NFSD_V4
80int nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *, 80__be32 nfsd4_set_nfs4_acl(struct svc_rqst *, struct svc_fh *,
81 struct nfs4_acl *); 81 struct nfs4_acl *);
82int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **); 82int nfsd4_get_nfs4_acl(struct svc_rqst *, struct dentry *, struct nfs4_acl **);
83#endif /* CONFIG_NFSD_V4 */ 83#endif /* CONFIG_NFSD_V4 */
84int nfsd_create(struct svc_rqst *, struct svc_fh *, 84__be32 nfsd_create(struct svc_rqst *, struct svc_fh *,
85 char *name, int len, struct iattr *attrs, 85 char *name, int len, struct iattr *attrs,
86 int type, dev_t rdev, struct svc_fh *res); 86 int type, dev_t rdev, struct svc_fh *res);
87#ifdef CONFIG_NFSD_V3 87#ifdef CONFIG_NFSD_V3
88int nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *); 88__be32 nfsd_access(struct svc_rqst *, struct svc_fh *, u32 *, u32 *);
89int nfsd_create_v3(struct svc_rqst *, struct svc_fh *, 89__be32 nfsd_create_v3(struct svc_rqst *, struct svc_fh *,
90 char *name, int len, struct iattr *attrs, 90 char *name, int len, struct iattr *attrs,
91 struct svc_fh *res, int createmode, 91 struct svc_fh *res, int createmode,
92 u32 *verifier, int *truncp); 92 u32 *verifier, int *truncp, int *created);
93int nfsd_commit(struct svc_rqst *, struct svc_fh *, 93__be32 nfsd_commit(struct svc_rqst *, struct svc_fh *,
94 loff_t, unsigned long); 94 loff_t, unsigned long);
95#endif /* CONFIG_NFSD_V3 */ 95#endif /* CONFIG_NFSD_V3 */
96int nfsd_open(struct svc_rqst *, struct svc_fh *, int, 96__be32 nfsd_open(struct svc_rqst *, struct svc_fh *, int,
97 int, struct file **); 97 int, struct file **);
98void nfsd_close(struct file *); 98void nfsd_close(struct file *);
99int nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *, 99__be32 nfsd_read(struct svc_rqst *, struct svc_fh *, struct file *,
100 loff_t, struct kvec *, int, unsigned long *); 100 loff_t, struct kvec *, int, unsigned long *);
101int nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *, 101__be32 nfsd_write(struct svc_rqst *, struct svc_fh *,struct file *,
102 loff_t, struct kvec *,int, unsigned long, int *); 102 loff_t, struct kvec *,int, unsigned long, int *);
103int nfsd_readlink(struct svc_rqst *, struct svc_fh *, 103__be32 nfsd_readlink(struct svc_rqst *, struct svc_fh *,
104 char *, int *); 104 char *, int *);
105int nfsd_symlink(struct svc_rqst *, struct svc_fh *, 105__be32 nfsd_symlink(struct svc_rqst *, struct svc_fh *,
106 char *name, int len, char *path, int plen, 106 char *name, int len, char *path, int plen,
107 struct svc_fh *res, struct iattr *); 107 struct svc_fh *res, struct iattr *);
108int nfsd_link(struct svc_rqst *, struct svc_fh *, 108__be32 nfsd_link(struct svc_rqst *, struct svc_fh *,
109 char *, int, struct svc_fh *); 109 char *, int, struct svc_fh *);
110int nfsd_rename(struct svc_rqst *, 110__be32 nfsd_rename(struct svc_rqst *,
111 struct svc_fh *, char *, int, 111 struct svc_fh *, char *, int,
112 struct svc_fh *, char *, int); 112 struct svc_fh *, char *, int);
113int nfsd_remove(struct svc_rqst *, 113__be32 nfsd_remove(struct svc_rqst *,
114 struct svc_fh *, char *, int); 114 struct svc_fh *, char *, int);
115int nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type, 115__be32 nfsd_unlink(struct svc_rqst *, struct svc_fh *, int type,
116 char *name, int len); 116 char *name, int len);
117int nfsd_truncate(struct svc_rqst *, struct svc_fh *, 117int nfsd_truncate(struct svc_rqst *, struct svc_fh *,
118 unsigned long size); 118 unsigned long size);
119int nfsd_readdir(struct svc_rqst *, struct svc_fh *, 119__be32 nfsd_readdir(struct svc_rqst *, struct svc_fh *,
120 loff_t *, struct readdir_cd *, encode_dent_fn); 120 loff_t *, struct readdir_cd *, encode_dent_fn);
121int nfsd_statfs(struct svc_rqst *, struct svc_fh *, 121__be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
122 struct kstatfs *); 122 struct kstatfs *);
123 123
124int nfsd_notify_change(struct inode *, struct iattr *); 124int nfsd_notify_change(struct inode *, struct iattr *);
125int nfsd_permission(struct svc_export *, struct dentry *, int); 125__be32 nfsd_permission(struct svc_export *, struct dentry *, int);
126int nfsd_sync_dir(struct dentry *dp); 126int nfsd_sync_dir(struct dentry *dp);
127 127
128#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 128#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
@@ -238,6 +238,7 @@ void nfsd_lockd_shutdown(void);
238#define nfserr_badname __constant_htonl(NFSERR_BADNAME) 238#define nfserr_badname __constant_htonl(NFSERR_BADNAME)
239#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) 239#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
240#define nfserr_locked __constant_htonl(NFSERR_LOCKED) 240#define nfserr_locked __constant_htonl(NFSERR_LOCKED)
241#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME)
241 242
242/* error codes for internal use */ 243/* error codes for internal use */
243/* if a request fails due to kmalloc failure, it gets dropped. 244/* if a request fails due to kmalloc failure, it gets dropped.
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 069257ea99a0..f3b51d62ec7d 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -157,7 +157,7 @@ typedef struct svc_fh {
157 __u64 fh_post_size; /* i_size */ 157 __u64 fh_post_size; /* i_size */
158 unsigned long fh_post_blocks; /* i_blocks */ 158 unsigned long fh_post_blocks; /* i_blocks */
159 unsigned long fh_post_blksize;/* i_blksize */ 159 unsigned long fh_post_blksize;/* i_blksize */
160 __u32 fh_post_rdev[2];/* i_rdev */ 160 __be32 fh_post_rdev[2];/* i_rdev */
161 struct timespec fh_post_atime; /* i_atime */ 161 struct timespec fh_post_atime; /* i_atime */
162 struct timespec fh_post_mtime; /* i_mtime */ 162 struct timespec fh_post_mtime; /* i_mtime */
163 struct timespec fh_post_ctime; /* i_ctime */ 163 struct timespec fh_post_ctime; /* i_ctime */
@@ -209,9 +209,9 @@ extern char * SVCFH_fmt(struct svc_fh *fhp);
209/* 209/*
210 * Function prototypes 210 * Function prototypes
211 */ 211 */
212u32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int); 212__be32 fh_verify(struct svc_rqst *, struct svc_fh *, int, int);
213int fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *); 213__be32 fh_compose(struct svc_fh *, struct svc_export *, struct dentry *, struct svc_fh *);
214int fh_update(struct svc_fh *); 214__be32 fh_update(struct svc_fh *);
215void fh_put(struct svc_fh *); 215void fh_put(struct svc_fh *);
216 216
217static __inline__ struct svc_fh * 217static __inline__ struct svc_fh *
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index 8bf23cf8b603..c3673f487e84 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -125,7 +125,7 @@ struct nfs4_client {
125 char cl_recdir[HEXDIR_LEN]; /* recovery dir */ 125 char cl_recdir[HEXDIR_LEN]; /* recovery dir */
126 nfs4_verifier cl_verifier; /* generated by client */ 126 nfs4_verifier cl_verifier; /* generated by client */
127 time_t cl_time; /* time of last lease renewal */ 127 time_t cl_time; /* time of last lease renewal */
128 u32 cl_addr; /* client ipaddress */ 128 __be32 cl_addr; /* client ipaddress */
129 struct svc_cred cl_cred; /* setclientid principal */ 129 struct svc_cred cl_cred; /* setclientid principal */
130 clientid_t cl_clientid; /* generated by server */ 130 clientid_t cl_clientid; /* generated by server */
131 nfs4_verifier cl_confirm; /* generated by server */ 131 nfs4_verifier cl_confirm; /* generated by server */
@@ -164,7 +164,7 @@ update_stateid(stateid_t *stateid)
164 * is cached. 164 * is cached.
165 */ 165 */
166struct nfs4_replay { 166struct nfs4_replay {
167 u32 rp_status; 167 __be32 rp_status;
168 unsigned int rp_buflen; 168 unsigned int rp_buflen;
169 char *rp_buf; 169 char *rp_buf;
170 unsigned intrp_allocated; 170 unsigned intrp_allocated;
@@ -273,19 +273,19 @@ struct nfs4_stateid {
273 ((err) != nfserr_stale_stateid) && \ 273 ((err) != nfserr_stale_stateid) && \
274 ((err) != nfserr_bad_stateid)) 274 ((err) != nfserr_bad_stateid))
275 275
276extern int nfsd4_renew(clientid_t *clid); 276extern __be32 nfsd4_renew(clientid_t *clid);
277extern int nfs4_preprocess_stateid_op(struct svc_fh *current_fh, 277extern __be32 nfs4_preprocess_stateid_op(struct svc_fh *current_fh,
278 stateid_t *stateid, int flags, struct file **filp); 278 stateid_t *stateid, int flags, struct file **filp);
279extern void nfs4_lock_state(void); 279extern void nfs4_lock_state(void);
280extern void nfs4_unlock_state(void); 280extern void nfs4_unlock_state(void);
281extern int nfs4_in_grace(void); 281extern int nfs4_in_grace(void);
282extern int nfs4_check_open_reclaim(clientid_t *clid); 282extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
283extern void put_nfs4_client(struct nfs4_client *clp); 283extern void put_nfs4_client(struct nfs4_client *clp);
284extern void nfs4_free_stateowner(struct kref *kref); 284extern void nfs4_free_stateowner(struct kref *kref);
285extern void nfsd4_probe_callback(struct nfs4_client *clp); 285extern void nfsd4_probe_callback(struct nfs4_client *clp);
286extern void nfsd4_cb_recall(struct nfs4_delegation *dp); 286extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
287extern void nfs4_put_delegation(struct nfs4_delegation *dp); 287extern void nfs4_put_delegation(struct nfs4_delegation *dp);
288extern int nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); 288extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname);
289extern void nfsd4_init_recdir(char *recdir_name); 289extern void nfsd4_init_recdir(char *recdir_name);
290extern int nfsd4_recdir_load(void); 290extern int nfsd4_recdir_load(void);
291extern void nfsd4_shutdown_recdir(void); 291extern void nfsd4_shutdown_recdir(void);
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index 0e53de87d886..877192d3ae79 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -81,7 +81,7 @@ struct nfsd_readdirargs {
81 struct svc_fh fh; 81 struct svc_fh fh;
82 __u32 cookie; 82 __u32 cookie;
83 __u32 count; 83 __u32 count;
84 u32 * buffer; 84 __be32 * buffer;
85}; 85};
86 86
87struct nfsd_attrstat { 87struct nfsd_attrstat {
@@ -108,9 +108,9 @@ struct nfsd_readdirres {
108 int count; 108 int count;
109 109
110 struct readdir_cd common; 110 struct readdir_cd common;
111 u32 * buffer; 111 __be32 * buffer;
112 int buflen; 112 int buflen;
113 u32 * offset; 113 __be32 * offset;
114}; 114};
115 115
116struct nfsd_statfsres { 116struct nfsd_statfsres {
@@ -135,43 +135,43 @@ union nfsd_xdrstore {
135#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore) 135#define NFS2_SVC_XDRSIZE sizeof(union nfsd_xdrstore)
136 136
137 137
138int nfssvc_decode_void(struct svc_rqst *, u32 *, void *); 138int nfssvc_decode_void(struct svc_rqst *, __be32 *, void *);
139int nfssvc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); 139int nfssvc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
140int nfssvc_decode_sattrargs(struct svc_rqst *, u32 *, 140int nfssvc_decode_sattrargs(struct svc_rqst *, __be32 *,
141 struct nfsd_sattrargs *); 141 struct nfsd_sattrargs *);
142int nfssvc_decode_diropargs(struct svc_rqst *, u32 *, 142int nfssvc_decode_diropargs(struct svc_rqst *, __be32 *,
143 struct nfsd_diropargs *); 143 struct nfsd_diropargs *);
144int nfssvc_decode_readargs(struct svc_rqst *, u32 *, 144int nfssvc_decode_readargs(struct svc_rqst *, __be32 *,
145 struct nfsd_readargs *); 145 struct nfsd_readargs *);
146int nfssvc_decode_writeargs(struct svc_rqst *, u32 *, 146int nfssvc_decode_writeargs(struct svc_rqst *, __be32 *,
147 struct nfsd_writeargs *); 147 struct nfsd_writeargs *);
148int nfssvc_decode_createargs(struct svc_rqst *, u32 *, 148int nfssvc_decode_createargs(struct svc_rqst *, __be32 *,
149 struct nfsd_createargs *); 149 struct nfsd_createargs *);
150int nfssvc_decode_renameargs(struct svc_rqst *, u32 *, 150int nfssvc_decode_renameargs(struct svc_rqst *, __be32 *,
151 struct nfsd_renameargs *); 151 struct nfsd_renameargs *);
152int nfssvc_decode_readlinkargs(struct svc_rqst *, u32 *, 152int nfssvc_decode_readlinkargs(struct svc_rqst *, __be32 *,
153 struct nfsd_readlinkargs *); 153 struct nfsd_readlinkargs *);
154int nfssvc_decode_linkargs(struct svc_rqst *, u32 *, 154int nfssvc_decode_linkargs(struct svc_rqst *, __be32 *,
155 struct nfsd_linkargs *); 155 struct nfsd_linkargs *);
156int nfssvc_decode_symlinkargs(struct svc_rqst *, u32 *, 156int nfssvc_decode_symlinkargs(struct svc_rqst *, __be32 *,
157 struct nfsd_symlinkargs *); 157 struct nfsd_symlinkargs *);
158int nfssvc_decode_readdirargs(struct svc_rqst *, u32 *, 158int nfssvc_decode_readdirargs(struct svc_rqst *, __be32 *,
159 struct nfsd_readdirargs *); 159 struct nfsd_readdirargs *);
160int nfssvc_encode_void(struct svc_rqst *, u32 *, void *); 160int nfssvc_encode_void(struct svc_rqst *, __be32 *, void *);
161int nfssvc_encode_attrstat(struct svc_rqst *, u32 *, struct nfsd_attrstat *); 161int nfssvc_encode_attrstat(struct svc_rqst *, __be32 *, struct nfsd_attrstat *);
162int nfssvc_encode_diropres(struct svc_rqst *, u32 *, struct nfsd_diropres *); 162int nfssvc_encode_diropres(struct svc_rqst *, __be32 *, struct nfsd_diropres *);
163int nfssvc_encode_readlinkres(struct svc_rqst *, u32 *, struct nfsd_readlinkres *); 163int nfssvc_encode_readlinkres(struct svc_rqst *, __be32 *, struct nfsd_readlinkres *);
164int nfssvc_encode_readres(struct svc_rqst *, u32 *, struct nfsd_readres *); 164int nfssvc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd_readres *);
165int nfssvc_encode_statfsres(struct svc_rqst *, u32 *, struct nfsd_statfsres *); 165int nfssvc_encode_statfsres(struct svc_rqst *, __be32 *, struct nfsd_statfsres *);
166int nfssvc_encode_readdirres(struct svc_rqst *, u32 *, struct nfsd_readdirres *); 166int nfssvc_encode_readdirres(struct svc_rqst *, __be32 *, struct nfsd_readdirres *);
167 167
168int nfssvc_encode_entry(struct readdir_cd *, const char *name, 168int nfssvc_encode_entry(struct readdir_cd *, const char *name,
169 int namlen, loff_t offset, ino_t ino, unsigned int); 169 int namlen, loff_t offset, ino_t ino, unsigned int);
170 170
171int nfssvc_release_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); 171int nfssvc_release_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
172 172
173/* Helper functions for NFSv2 ACL code */ 173/* Helper functions for NFSv2 ACL code */
174u32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, u32 *p, struct svc_fh *fhp); 174__be32 *nfs2svc_encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp);
175u32 *nfs2svc_decode_fh(u32 *p, struct svc_fh *fhp); 175__be32 *nfs2svc_decode_fh(__be32 *p, struct svc_fh *fhp);
176 176
177#endif /* LINUX_NFSD_H */ 177#endif /* LINUX_NFSD_H */
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 474d882dc2f3..79963867b0d7 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -51,7 +51,7 @@ struct nfsd3_createargs {
51 int len; 51 int len;
52 int createmode; 52 int createmode;
53 struct iattr attrs; 53 struct iattr attrs;
54 __u32 * verf; 54 __be32 * verf;
55}; 55};
56 56
57struct nfsd3_mknodargs { 57struct nfsd3_mknodargs {
@@ -98,8 +98,8 @@ struct nfsd3_readdirargs {
98 __u64 cookie; 98 __u64 cookie;
99 __u32 dircount; 99 __u32 dircount;
100 __u32 count; 100 __u32 count;
101 __u32 * verf; 101 __be32 * verf;
102 u32 * buffer; 102 __be32 * buffer;
103}; 103};
104 104
105struct nfsd3_commitargs { 105struct nfsd3_commitargs {
@@ -122,79 +122,79 @@ struct nfsd3_setaclargs {
122}; 122};
123 123
124struct nfsd3_attrstat { 124struct nfsd3_attrstat {
125 __u32 status; 125 __be32 status;
126 struct svc_fh fh; 126 struct svc_fh fh;
127 struct kstat stat; 127 struct kstat stat;
128}; 128};
129 129
130/* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ 130/* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */
131struct nfsd3_diropres { 131struct nfsd3_diropres {
132 __u32 status; 132 __be32 status;
133 struct svc_fh dirfh; 133 struct svc_fh dirfh;
134 struct svc_fh fh; 134 struct svc_fh fh;
135}; 135};
136 136
137struct nfsd3_accessres { 137struct nfsd3_accessres {
138 __u32 status; 138 __be32 status;
139 struct svc_fh fh; 139 struct svc_fh fh;
140 __u32 access; 140 __u32 access;
141}; 141};
142 142
143struct nfsd3_readlinkres { 143struct nfsd3_readlinkres {
144 __u32 status; 144 __be32 status;
145 struct svc_fh fh; 145 struct svc_fh fh;
146 __u32 len; 146 __u32 len;
147}; 147};
148 148
149struct nfsd3_readres { 149struct nfsd3_readres {
150 __u32 status; 150 __be32 status;
151 struct svc_fh fh; 151 struct svc_fh fh;
152 unsigned long count; 152 unsigned long count;
153 int eof; 153 int eof;
154}; 154};
155 155
156struct nfsd3_writeres { 156struct nfsd3_writeres {
157 __u32 status; 157 __be32 status;
158 struct svc_fh fh; 158 struct svc_fh fh;
159 unsigned long count; 159 unsigned long count;
160 int committed; 160 int committed;
161}; 161};
162 162
163struct nfsd3_renameres { 163struct nfsd3_renameres {
164 __u32 status; 164 __be32 status;
165 struct svc_fh ffh; 165 struct svc_fh ffh;
166 struct svc_fh tfh; 166 struct svc_fh tfh;
167}; 167};
168 168
169struct nfsd3_linkres { 169struct nfsd3_linkres {
170 __u32 status; 170 __be32 status;
171 struct svc_fh tfh; 171 struct svc_fh tfh;
172 struct svc_fh fh; 172 struct svc_fh fh;
173}; 173};
174 174
175struct nfsd3_readdirres { 175struct nfsd3_readdirres {
176 __u32 status; 176 __be32 status;
177 struct svc_fh fh; 177 struct svc_fh fh;
178 int count; 178 int count;
179 __u32 verf[2]; 179 __be32 verf[2];
180 180
181 struct readdir_cd common; 181 struct readdir_cd common;
182 u32 * buffer; 182 __be32 * buffer;
183 int buflen; 183 int buflen;
184 u32 * offset; 184 __be32 * offset;
185 u32 * offset1; 185 __be32 * offset1;
186 struct svc_rqst * rqstp; 186 struct svc_rqst * rqstp;
187 187
188}; 188};
189 189
190struct nfsd3_fsstatres { 190struct nfsd3_fsstatres {
191 __u32 status; 191 __be32 status;
192 struct kstatfs stats; 192 struct kstatfs stats;
193 __u32 invarsec; 193 __u32 invarsec;
194}; 194};
195 195
196struct nfsd3_fsinfores { 196struct nfsd3_fsinfores {
197 __u32 status; 197 __be32 status;
198 __u32 f_rtmax; 198 __u32 f_rtmax;
199 __u32 f_rtpref; 199 __u32 f_rtpref;
200 __u32 f_rtmult; 200 __u32 f_rtmult;
@@ -207,7 +207,7 @@ struct nfsd3_fsinfores {
207}; 207};
208 208
209struct nfsd3_pathconfres { 209struct nfsd3_pathconfres {
210 __u32 status; 210 __be32 status;
211 __u32 p_link_max; 211 __u32 p_link_max;
212 __u32 p_name_max; 212 __u32 p_name_max;
213 __u32 p_no_trunc; 213 __u32 p_no_trunc;
@@ -217,12 +217,12 @@ struct nfsd3_pathconfres {
217}; 217};
218 218
219struct nfsd3_commitres { 219struct nfsd3_commitres {
220 __u32 status; 220 __be32 status;
221 struct svc_fh fh; 221 struct svc_fh fh;
222}; 222};
223 223
224struct nfsd3_getaclres { 224struct nfsd3_getaclres {
225 __u32 status; 225 __be32 status;
226 struct svc_fh fh; 226 struct svc_fh fh;
227 int mask; 227 int mask;
228 struct posix_acl *acl_access; 228 struct posix_acl *acl_access;
@@ -266,70 +266,70 @@ union nfsd3_xdrstore {
266 266
267#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore) 267#define NFS3_SVC_XDRSIZE sizeof(union nfsd3_xdrstore)
268 268
269int nfs3svc_decode_fhandle(struct svc_rqst *, u32 *, struct nfsd_fhandle *); 269int nfs3svc_decode_fhandle(struct svc_rqst *, __be32 *, struct nfsd_fhandle *);
270int nfs3svc_decode_sattrargs(struct svc_rqst *, u32 *, 270int nfs3svc_decode_sattrargs(struct svc_rqst *, __be32 *,
271 struct nfsd3_sattrargs *); 271 struct nfsd3_sattrargs *);
272int nfs3svc_decode_diropargs(struct svc_rqst *, u32 *, 272int nfs3svc_decode_diropargs(struct svc_rqst *, __be32 *,
273 struct nfsd3_diropargs *); 273 struct nfsd3_diropargs *);
274int nfs3svc_decode_accessargs(struct svc_rqst *, u32 *, 274int nfs3svc_decode_accessargs(struct svc_rqst *, __be32 *,
275 struct nfsd3_accessargs *); 275 struct nfsd3_accessargs *);
276int nfs3svc_decode_readargs(struct svc_rqst *, u32 *, 276int nfs3svc_decode_readargs(struct svc_rqst *, __be32 *,
277 struct nfsd3_readargs *); 277 struct nfsd3_readargs *);
278int nfs3svc_decode_writeargs(struct svc_rqst *, u32 *, 278int nfs3svc_decode_writeargs(struct svc_rqst *, __be32 *,
279 struct nfsd3_writeargs *); 279 struct nfsd3_writeargs *);
280int nfs3svc_decode_createargs(struct svc_rqst *, u32 *, 280int nfs3svc_decode_createargs(struct svc_rqst *, __be32 *,
281 struct nfsd3_createargs *); 281 struct nfsd3_createargs *);
282int nfs3svc_decode_mkdirargs(struct svc_rqst *, u32 *, 282int nfs3svc_decode_mkdirargs(struct svc_rqst *, __be32 *,
283 struct nfsd3_createargs *); 283 struct nfsd3_createargs *);
284int nfs3svc_decode_mknodargs(struct svc_rqst *, u32 *, 284int nfs3svc_decode_mknodargs(struct svc_rqst *, __be32 *,
285 struct nfsd3_mknodargs *); 285 struct nfsd3_mknodargs *);
286int nfs3svc_decode_renameargs(struct svc_rqst *, u32 *, 286int nfs3svc_decode_renameargs(struct svc_rqst *, __be32 *,
287 struct nfsd3_renameargs *); 287 struct nfsd3_renameargs *);
288int nfs3svc_decode_readlinkargs(struct svc_rqst *, u32 *, 288int nfs3svc_decode_readlinkargs(struct svc_rqst *, __be32 *,
289 struct nfsd3_readlinkargs *); 289 struct nfsd3_readlinkargs *);
290int nfs3svc_decode_linkargs(struct svc_rqst *, u32 *, 290int nfs3svc_decode_linkargs(struct svc_rqst *, __be32 *,
291 struct nfsd3_linkargs *); 291 struct nfsd3_linkargs *);
292int nfs3svc_decode_symlinkargs(struct svc_rqst *, u32 *, 292int nfs3svc_decode_symlinkargs(struct svc_rqst *, __be32 *,
293 struct nfsd3_symlinkargs *); 293 struct nfsd3_symlinkargs *);
294int nfs3svc_decode_readdirargs(struct svc_rqst *, u32 *, 294int nfs3svc_decode_readdirargs(struct svc_rqst *, __be32 *,
295 struct nfsd3_readdirargs *); 295 struct nfsd3_readdirargs *);
296int nfs3svc_decode_readdirplusargs(struct svc_rqst *, u32 *, 296int nfs3svc_decode_readdirplusargs(struct svc_rqst *, __be32 *,
297 struct nfsd3_readdirargs *); 297 struct nfsd3_readdirargs *);
298int nfs3svc_decode_commitargs(struct svc_rqst *, u32 *, 298int nfs3svc_decode_commitargs(struct svc_rqst *, __be32 *,
299 struct nfsd3_commitargs *); 299 struct nfsd3_commitargs *);
300int nfs3svc_encode_voidres(struct svc_rqst *, u32 *, void *); 300int nfs3svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
301int nfs3svc_encode_attrstat(struct svc_rqst *, u32 *, 301int nfs3svc_encode_attrstat(struct svc_rqst *, __be32 *,
302 struct nfsd3_attrstat *); 302 struct nfsd3_attrstat *);
303int nfs3svc_encode_wccstat(struct svc_rqst *, u32 *, 303int nfs3svc_encode_wccstat(struct svc_rqst *, __be32 *,
304 struct nfsd3_attrstat *); 304 struct nfsd3_attrstat *);
305int nfs3svc_encode_diropres(struct svc_rqst *, u32 *, 305int nfs3svc_encode_diropres(struct svc_rqst *, __be32 *,
306 struct nfsd3_diropres *); 306 struct nfsd3_diropres *);
307int nfs3svc_encode_accessres(struct svc_rqst *, u32 *, 307int nfs3svc_encode_accessres(struct svc_rqst *, __be32 *,
308 struct nfsd3_accessres *); 308 struct nfsd3_accessres *);
309int nfs3svc_encode_readlinkres(struct svc_rqst *, u32 *, 309int nfs3svc_encode_readlinkres(struct svc_rqst *, __be32 *,
310 struct nfsd3_readlinkres *); 310 struct nfsd3_readlinkres *);
311int nfs3svc_encode_readres(struct svc_rqst *, u32 *, struct nfsd3_readres *); 311int nfs3svc_encode_readres(struct svc_rqst *, __be32 *, struct nfsd3_readres *);
312int nfs3svc_encode_writeres(struct svc_rqst *, u32 *, struct nfsd3_writeres *); 312int nfs3svc_encode_writeres(struct svc_rqst *, __be32 *, struct nfsd3_writeres *);
313int nfs3svc_encode_createres(struct svc_rqst *, u32 *, 313int nfs3svc_encode_createres(struct svc_rqst *, __be32 *,
314 struct nfsd3_diropres *); 314 struct nfsd3_diropres *);
315int nfs3svc_encode_renameres(struct svc_rqst *, u32 *, 315int nfs3svc_encode_renameres(struct svc_rqst *, __be32 *,
316 struct nfsd3_renameres *); 316 struct nfsd3_renameres *);
317int nfs3svc_encode_linkres(struct svc_rqst *, u32 *, 317int nfs3svc_encode_linkres(struct svc_rqst *, __be32 *,
318 struct nfsd3_linkres *); 318 struct nfsd3_linkres *);
319int nfs3svc_encode_readdirres(struct svc_rqst *, u32 *, 319int nfs3svc_encode_readdirres(struct svc_rqst *, __be32 *,
320 struct nfsd3_readdirres *); 320 struct nfsd3_readdirres *);
321int nfs3svc_encode_fsstatres(struct svc_rqst *, u32 *, 321int nfs3svc_encode_fsstatres(struct svc_rqst *, __be32 *,
322 struct nfsd3_fsstatres *); 322 struct nfsd3_fsstatres *);
323int nfs3svc_encode_fsinfores(struct svc_rqst *, u32 *, 323int nfs3svc_encode_fsinfores(struct svc_rqst *, __be32 *,
324 struct nfsd3_fsinfores *); 324 struct nfsd3_fsinfores *);
325int nfs3svc_encode_pathconfres(struct svc_rqst *, u32 *, 325int nfs3svc_encode_pathconfres(struct svc_rqst *, __be32 *,
326 struct nfsd3_pathconfres *); 326 struct nfsd3_pathconfres *);
327int nfs3svc_encode_commitres(struct svc_rqst *, u32 *, 327int nfs3svc_encode_commitres(struct svc_rqst *, __be32 *,
328 struct nfsd3_commitres *); 328 struct nfsd3_commitres *);
329 329
330int nfs3svc_release_fhandle(struct svc_rqst *, u32 *, 330int nfs3svc_release_fhandle(struct svc_rqst *, __be32 *,
331 struct nfsd3_attrstat *); 331 struct nfsd3_attrstat *);
332int nfs3svc_release_fhandle2(struct svc_rqst *, u32 *, 332int nfs3svc_release_fhandle2(struct svc_rqst *, __be32 *,
333 struct nfsd3_fhandle_pair *); 333 struct nfsd3_fhandle_pair *);
334int nfs3svc_encode_entry(struct readdir_cd *, const char *name, 334int nfs3svc_encode_entry(struct readdir_cd *, const char *name,
335 int namlen, loff_t offset, ino_t ino, 335 int namlen, loff_t offset, ino_t ino,
@@ -338,9 +338,9 @@ int nfs3svc_encode_entry_plus(struct readdir_cd *, const char *name,
338 int namlen, loff_t offset, ino_t ino, 338 int namlen, loff_t offset, ino_t ino,
339 unsigned int); 339 unsigned int);
340/* Helper functions for NFSv3 ACL code */ 340/* Helper functions for NFSv3 ACL code */
341u32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, u32 *p, 341__be32 *nfs3svc_encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p,
342 struct svc_fh *fhp); 342 struct svc_fh *fhp);
343u32 *nfs3svc_decode_fh(u32 *p, struct svc_fh *fhp); 343__be32 *nfs3svc_decode_fh(__be32 *p, struct svc_fh *fhp);
344 344
345 345
346#endif /* _LINUX_NFSD_XDR3_H */ 346#endif /* _LINUX_NFSD_XDR3_H */
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 66e642762a07..45ca01b5f844 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -258,9 +258,9 @@ struct nfsd4_readdir {
258 struct svc_fh * rd_fhp; /* response */ 258 struct svc_fh * rd_fhp; /* response */
259 259
260 struct readdir_cd common; 260 struct readdir_cd common;
261 u32 * buffer; 261 __be32 * buffer;
262 int buflen; 262 int buflen;
263 u32 * offset; 263 __be32 * offset;
264}; 264};
265 265
266struct nfsd4_release_lockowner { 266struct nfsd4_release_lockowner {
@@ -334,7 +334,7 @@ struct nfsd4_write {
334 334
335struct nfsd4_op { 335struct nfsd4_op {
336 int opnum; 336 int opnum;
337 int status; 337 __be32 status;
338 union { 338 union {
339 struct nfsd4_access access; 339 struct nfsd4_access access;
340 struct nfsd4_close close; 340 struct nfsd4_close close;
@@ -371,12 +371,12 @@ struct nfsd4_op {
371 371
372struct nfsd4_compoundargs { 372struct nfsd4_compoundargs {
373 /* scratch variables for XDR decode */ 373 /* scratch variables for XDR decode */
374 u32 * p; 374 __be32 * p;
375 u32 * end; 375 __be32 * end;
376 struct page ** pagelist; 376 struct page ** pagelist;
377 int pagelen; 377 int pagelen;
378 u32 tmp[8]; 378 __be32 tmp[8];
379 u32 * tmpp; 379 __be32 * tmpp;
380 struct tmpbuf { 380 struct tmpbuf {
381 struct tmpbuf *next; 381 struct tmpbuf *next;
382 void (*release)(const void *); 382 void (*release)(const void *);
@@ -395,15 +395,15 @@ struct nfsd4_compoundargs {
395 395
396struct nfsd4_compoundres { 396struct nfsd4_compoundres {
397 /* scratch variables for XDR encode */ 397 /* scratch variables for XDR encode */
398 u32 * p; 398 __be32 * p;
399 u32 * end; 399 __be32 * end;
400 struct xdr_buf * xbuf; 400 struct xdr_buf * xbuf;
401 struct svc_rqst * rqstp; 401 struct svc_rqst * rqstp;
402 402
403 u32 taglen; 403 u32 taglen;
404 char * tag; 404 char * tag;
405 u32 opcnt; 405 u32 opcnt;
406 u32 * tagp; /* where to encode tag and opcount */ 406 __be32 * tagp; /* where to encode tag and opcount */
407}; 407};
408 408
409#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs) 409#define NFS4_SVC_XDRSIZE sizeof(struct nfsd4_compoundargs)
@@ -419,45 +419,45 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp)
419 cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec; 419 cinfo->after_ctime_nsec = fhp->fh_post_ctime.tv_nsec;
420} 420}
421 421
422int nfs4svc_encode_voidres(struct svc_rqst *, u32 *, void *); 422int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *);
423int nfs4svc_decode_compoundargs(struct svc_rqst *, u32 *, 423int nfs4svc_decode_compoundargs(struct svc_rqst *, __be32 *,
424 struct nfsd4_compoundargs *); 424 struct nfsd4_compoundargs *);
425int nfs4svc_encode_compoundres(struct svc_rqst *, u32 *, 425int nfs4svc_encode_compoundres(struct svc_rqst *, __be32 *,
426 struct nfsd4_compoundres *); 426 struct nfsd4_compoundres *);
427void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *); 427void nfsd4_encode_operation(struct nfsd4_compoundres *, struct nfsd4_op *);
428void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op); 428void nfsd4_encode_replay(struct nfsd4_compoundres *resp, struct nfsd4_op *op);
429int nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp, 429__be32 nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
430 struct dentry *dentry, u32 *buffer, int *countp, 430 struct dentry *dentry, __be32 *buffer, int *countp,
431 u32 *bmval, struct svc_rqst *); 431 u32 *bmval, struct svc_rqst *);
432extern int nfsd4_setclientid(struct svc_rqst *rqstp, 432extern __be32 nfsd4_setclientid(struct svc_rqst *rqstp,
433 struct nfsd4_setclientid *setclid); 433 struct nfsd4_setclientid *setclid);
434extern int nfsd4_setclientid_confirm(struct svc_rqst *rqstp, 434extern __be32 nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
435 struct nfsd4_setclientid_confirm *setclientid_confirm); 435 struct nfsd4_setclientid_confirm *setclientid_confirm);
436extern int nfsd4_process_open1(struct nfsd4_open *open); 436extern __be32 nfsd4_process_open1(struct nfsd4_open *open);
437extern int nfsd4_process_open2(struct svc_rqst *rqstp, 437extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp,
438 struct svc_fh *current_fh, struct nfsd4_open *open); 438 struct svc_fh *current_fh, struct nfsd4_open *open);
439extern int nfsd4_open_confirm(struct svc_rqst *rqstp, 439extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp,
440 struct svc_fh *current_fh, struct nfsd4_open_confirm *oc, 440 struct svc_fh *current_fh, struct nfsd4_open_confirm *oc,
441 struct nfs4_stateowner **); 441 struct nfs4_stateowner **);
442extern int nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh, 442extern __be32 nfsd4_close(struct svc_rqst *rqstp, struct svc_fh *current_fh,
443 struct nfsd4_close *close, 443 struct nfsd4_close *close,
444 struct nfs4_stateowner **replay_owner); 444 struct nfs4_stateowner **replay_owner);
445extern int nfsd4_open_downgrade(struct svc_rqst *rqstp, 445extern __be32 nfsd4_open_downgrade(struct svc_rqst *rqstp,
446 struct svc_fh *current_fh, struct nfsd4_open_downgrade *od, 446 struct svc_fh *current_fh, struct nfsd4_open_downgrade *od,
447 struct nfs4_stateowner **replay_owner); 447 struct nfs4_stateowner **replay_owner);
448extern int nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh, 448extern __be32 nfsd4_lock(struct svc_rqst *rqstp, struct svc_fh *current_fh,
449 struct nfsd4_lock *lock, 449 struct nfsd4_lock *lock,
450 struct nfs4_stateowner **replay_owner); 450 struct nfs4_stateowner **replay_owner);
451extern int nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh, 451extern __be32 nfsd4_lockt(struct svc_rqst *rqstp, struct svc_fh *current_fh,
452 struct nfsd4_lockt *lockt); 452 struct nfsd4_lockt *lockt);
453extern int nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh, 453extern __be32 nfsd4_locku(struct svc_rqst *rqstp, struct svc_fh *current_fh,
454 struct nfsd4_locku *locku, 454 struct nfsd4_locku *locku,
455 struct nfs4_stateowner **replay_owner); 455 struct nfs4_stateowner **replay_owner);
456extern int 456extern __be32
457nfsd4_release_lockowner(struct svc_rqst *rqstp, 457nfsd4_release_lockowner(struct svc_rqst *rqstp,
458 struct nfsd4_release_lockowner *rlockowner); 458 struct nfsd4_release_lockowner *rlockowner);
459extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *); 459extern void nfsd4_release_compoundargs(struct nfsd4_compoundargs *);
460extern int nfsd4_delegreturn(struct svc_rqst *rqstp, 460extern __be32 nfsd4_delegreturn(struct svc_rqst *rqstp,
461 struct svc_fh *current_fh, struct nfsd4_delegreturn *dr); 461 struct svc_fh *current_fh, struct nfsd4_delegreturn *dr);
462#endif 462#endif
463 463
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index f6baecdeecd6..971d1c6dfc4b 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -45,8 +45,10 @@ static inline void exit_task_namespaces(struct task_struct *p)
45{ 45{
46 struct nsproxy *ns = p->nsproxy; 46 struct nsproxy *ns = p->nsproxy;
47 if (ns) { 47 if (ns) {
48 put_nsproxy(ns); 48 task_lock(p);
49 p->nsproxy = NULL; 49 p->nsproxy = NULL;
50 task_unlock(p);
51 put_nsproxy(ns);
50 } 52 }
51} 53}
52#endif 54#endif
diff --git a/include/linux/oom.h b/include/linux/oom.h
new file mode 100644
index 000000000000..ad76463629a0
--- /dev/null
+++ b/include/linux/oom.h
@@ -0,0 +1,10 @@
1#ifndef __INCLUDE_LINUX_OOM_H
2#define __INCLUDE_LINUX_OOM_H
3
4/* /proc/<pid>/oom_adj set to -17 protects from the oom-killer */
5#define OOM_DISABLE (-17)
6/* inclusive */
7#define OOM_ADJUST_MIN (-16)
8#define OOM_ADJUST_MAX 15
9
10#endif
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 64f950925151..c3e255bf8594 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -52,19 +52,23 @@ static inline void mapping_set_gfp_mask(struct address_space *m, gfp_t mask)
52void release_pages(struct page **pages, int nr, int cold); 52void release_pages(struct page **pages, int nr, int cold);
53 53
54#ifdef CONFIG_NUMA 54#ifdef CONFIG_NUMA
55extern struct page *page_cache_alloc(struct address_space *x); 55extern struct page *__page_cache_alloc(gfp_t gfp);
56extern struct page *page_cache_alloc_cold(struct address_space *x);
57#else 56#else
57static inline struct page *__page_cache_alloc(gfp_t gfp)
58{
59 return alloc_pages(gfp, 0);
60}
61#endif
62
58static inline struct page *page_cache_alloc(struct address_space *x) 63static inline struct page *page_cache_alloc(struct address_space *x)
59{ 64{
60 return alloc_pages(mapping_gfp_mask(x), 0); 65 return __page_cache_alloc(mapping_gfp_mask(x));
61} 66}
62 67
63static inline struct page *page_cache_alloc_cold(struct address_space *x) 68static inline struct page *page_cache_alloc_cold(struct address_space *x)
64{ 69{
65 return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); 70 return __page_cache_alloc(mapping_gfp_mask(x)|__GFP_COLD);
66} 71}
67#endif
68 72
69typedef int filler_t(void *, struct page *); 73typedef int filler_t(void *, struct page *);
70 74
diff --git a/include/linux/pci.h b/include/linux/pci.h
index 5c604f5fad67..01c707261f9c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -51,6 +51,7 @@
51#include <linux/list.h> 51#include <linux/list.h>
52#include <linux/compiler.h> 52#include <linux/compiler.h>
53#include <linux/errno.h> 53#include <linux/errno.h>
54#include <asm/atomic.h>
54#include <linux/device.h> 55#include <linux/device.h>
55 56
56/* File state for mmap()s on /proc/bus/pci/X/Y */ 57/* File state for mmap()s on /proc/bus/pci/X/Y */
@@ -159,7 +160,6 @@ struct pci_dev {
159 unsigned int transparent:1; /* Transparent PCI bridge */ 160 unsigned int transparent:1; /* Transparent PCI bridge */
160 unsigned int multifunction:1;/* Part of multi-function device */ 161 unsigned int multifunction:1;/* Part of multi-function device */
161 /* keep track of device state */ 162 /* keep track of device state */
162 unsigned int is_enabled:1; /* pci_enable_device has been called */
163 unsigned int is_busmaster:1; /* device is busmaster */ 163 unsigned int is_busmaster:1; /* device is busmaster */
164 unsigned int no_msi:1; /* device may not use msi */ 164 unsigned int no_msi:1; /* device may not use msi */
165 unsigned int no_d1d2:1; /* only allow d0 or d3 */ 165 unsigned int no_d1d2:1; /* only allow d0 or d3 */
@@ -167,6 +167,7 @@ struct pci_dev {
167 unsigned int broken_parity_status:1; /* Device generates false positive parity */ 167 unsigned int broken_parity_status:1; /* Device generates false positive parity */
168 unsigned int msi_enabled:1; 168 unsigned int msi_enabled:1;
169 unsigned int msix_enabled:1; 169 unsigned int msix_enabled:1;
170 atomic_t enable_cnt; /* pci_enable_device has been called */
170 171
171 u32 saved_config_space[16]; /* config space saved at suspend time */ 172 u32 saved_config_space[16]; /* config space saved at suspend time */
172 struct hlist_head saved_cap_space; 173 struct hlist_head saved_cap_space;
@@ -443,6 +444,7 @@ extern void pci_remove_bus(struct pci_bus *b);
443extern void pci_remove_bus_device(struct pci_dev *dev); 444extern void pci_remove_bus_device(struct pci_dev *dev);
444extern void pci_stop_bus_device(struct pci_dev *dev); 445extern void pci_stop_bus_device(struct pci_dev *dev);
445void pci_setup_cardbus(struct pci_bus *bus); 446void pci_setup_cardbus(struct pci_bus *bus);
447extern void pci_sort_breadthfirst(void);
446 448
447/* Generic PCI functions exported to card drivers */ 449/* Generic PCI functions exported to card drivers */
448 450
@@ -452,13 +454,18 @@ struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn);
452int pci_find_capability (struct pci_dev *dev, int cap); 454int pci_find_capability (struct pci_dev *dev, int cap);
453int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 455int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
454int pci_find_ext_capability (struct pci_dev *dev, int cap); 456int pci_find_ext_capability (struct pci_dev *dev, int cap);
455struct pci_bus * pci_find_next_bus(const struct pci_bus *from); 457struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
458
459struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
460 struct pci_dev *from);
461struct pci_dev *pci_get_device_reverse(unsigned int vendor, unsigned int device,
462 struct pci_dev *from);
456 463
457struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from);
458struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, 464struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
459 unsigned int ss_vendor, unsigned int ss_device, 465 unsigned int ss_vendor, unsigned int ss_device,
460 struct pci_dev *from); 466 struct pci_dev *from);
461struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn); 467struct pci_dev *pci_get_slot (struct pci_bus *bus, unsigned int devfn);
468struct pci_dev *pci_get_bus_and_slot (unsigned int bus, unsigned int devfn);
462struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from); 469struct pci_dev *pci_get_class (unsigned int class, struct pci_dev *from);
463int pci_dev_present(const struct pci_device_id *ids); 470int pci_dev_present(const struct pci_device_id *ids);
464 471
@@ -658,7 +665,12 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, unsigned int
658static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn) 665static inline struct pci_dev *pci_find_slot(unsigned int bus, unsigned int devfn)
659{ return NULL; } 666{ return NULL; }
660 667
661static inline struct pci_dev *pci_get_device (unsigned int vendor, unsigned int device, struct pci_dev *from) 668static inline struct pci_dev *pci_get_device(unsigned int vendor,
669 unsigned int device, struct pci_dev *from)
670{ return NULL; }
671
672static inline struct pci_dev *pci_get_device_reverse(unsigned int vendor,
673 unsigned int device, struct pci_dev *from)
662{ return NULL; } 674{ return NULL; }
663 675
664static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device, 676static inline struct pci_dev *pci_get_subsys (unsigned int vendor, unsigned int device,
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h
new file mode 100644
index 000000000000..a675a05c4091
--- /dev/null
+++ b/include/linux/pci_hotplug.h
@@ -0,0 +1,236 @@
1/*
2 * PCI HotPlug Core Functions
3 *
4 * Copyright (C) 1995,2001 Compaq Computer Corporation
5 * Copyright (C) 2001 Greg Kroah-Hartman (greg@kroah.com)
6 * Copyright (C) 2001 IBM Corp.
7 *
8 * All rights reserved.
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or (at
13 * your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
18 * NON INFRINGEMENT. See the GNU General Public License for more
19 * details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 *
25 * Send feedback to <kristen.c.accardi@intel.com>
26 *
27 */
28#ifndef _PCI_HOTPLUG_H
29#define _PCI_HOTPLUG_H
30
31
32/* These values come from the PCI Hotplug Spec */
33enum pci_bus_speed {
34 PCI_SPEED_33MHz = 0x00,
35 PCI_SPEED_66MHz = 0x01,
36 PCI_SPEED_66MHz_PCIX = 0x02,
37 PCI_SPEED_100MHz_PCIX = 0x03,
38 PCI_SPEED_133MHz_PCIX = 0x04,
39 PCI_SPEED_66MHz_PCIX_ECC = 0x05,
40 PCI_SPEED_100MHz_PCIX_ECC = 0x06,
41 PCI_SPEED_133MHz_PCIX_ECC = 0x07,
42 PCI_SPEED_66MHz_PCIX_266 = 0x09,
43 PCI_SPEED_100MHz_PCIX_266 = 0x0a,
44 PCI_SPEED_133MHz_PCIX_266 = 0x0b,
45 PCI_SPEED_66MHz_PCIX_533 = 0x11,
46 PCI_SPEED_100MHz_PCIX_533 = 0x12,
47 PCI_SPEED_133MHz_PCIX_533 = 0x13,
48 PCI_SPEED_UNKNOWN = 0xff,
49};
50
51/* These values come from the PCI Express Spec */
52enum pcie_link_width {
53 PCIE_LNK_WIDTH_RESRV = 0x00,
54 PCIE_LNK_X1 = 0x01,
55 PCIE_LNK_X2 = 0x02,
56 PCIE_LNK_X4 = 0x04,
57 PCIE_LNK_X8 = 0x08,
58 PCIE_LNK_X12 = 0x0C,
59 PCIE_LNK_X16 = 0x10,
60 PCIE_LNK_X32 = 0x20,
61 PCIE_LNK_WIDTH_UNKNOWN = 0xFF,
62};
63
64enum pcie_link_speed {
65 PCIE_2PT5GB = 0x14,
66 PCIE_LNK_SPEED_UNKNOWN = 0xFF,
67};
68
69struct hotplug_slot;
70struct hotplug_slot_attribute {
71 struct attribute attr;
72 ssize_t (*show)(struct hotplug_slot *, char *);
73 ssize_t (*store)(struct hotplug_slot *, const char *, size_t);
74};
75#define to_hotplug_attr(n) container_of(n, struct hotplug_slot_attribute, attr);
76
77/**
78 * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use
79 * @owner: The module owner of this structure
80 * @enable_slot: Called when the user wants to enable a specific pci slot
81 * @disable_slot: Called when the user wants to disable a specific pci slot
82 * @set_attention_status: Called to set the specific slot's attention LED to
83 * the specified value
84 * @hardware_test: Called to run a specified hardware test on the specified
85 * slot.
86 * @get_power_status: Called to get the current power status of a slot.
87 * If this field is NULL, the value passed in the struct hotplug_slot_info
88 * will be used when this value is requested by a user.
89 * @get_attention_status: Called to get the current attention status of a slot.
90 * If this field is NULL, the value passed in the struct hotplug_slot_info
91 * will be used when this value is requested by a user.
92 * @get_latch_status: Called to get the current latch status of a slot.
93 * If this field is NULL, the value passed in the struct hotplug_slot_info
94 * will be used when this value is requested by a user.
95 * @get_adapter_status: Called to get see if an adapter is present in the slot or not.
96 * If this field is NULL, the value passed in the struct hotplug_slot_info
97 * will be used when this value is requested by a user.
98 * @get_address: Called to get pci address of a slot.
99 * If this field is NULL, the value passed in the struct hotplug_slot_info
100 * will be used when this value is requested by a user.
101 * @get_max_bus_speed: Called to get the max bus speed for a slot.
102 * If this field is NULL, the value passed in the struct hotplug_slot_info
103 * will be used when this value is requested by a user.
104 * @get_cur_bus_speed: Called to get the current bus speed for a slot.
105 * If this field is NULL, the value passed in the struct hotplug_slot_info
106 * will be used when this value is requested by a user.
107 *
108 * The table of function pointers that is passed to the hotplug pci core by a
109 * hotplug pci driver. These functions are called by the hotplug pci core when
110 * the user wants to do something to a specific slot (query it for information,
111 * set an LED, enable / disable power, etc.)
112 */
113struct hotplug_slot_ops {
114 struct module *owner;
115 int (*enable_slot) (struct hotplug_slot *slot);
116 int (*disable_slot) (struct hotplug_slot *slot);
117 int (*set_attention_status) (struct hotplug_slot *slot, u8 value);
118 int (*hardware_test) (struct hotplug_slot *slot, u32 value);
119 int (*get_power_status) (struct hotplug_slot *slot, u8 *value);
120 int (*get_attention_status) (struct hotplug_slot *slot, u8 *value);
121 int (*get_latch_status) (struct hotplug_slot *slot, u8 *value);
122 int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value);
123 int (*get_address) (struct hotplug_slot *slot, u32 *value);
124 int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
125 int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value);
126};
127
128/**
129 * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot
130 * @power: if power is enabled or not (1/0)
131 * @attention_status: if the attention light is enabled or not (1/0)
132 * @latch_status: if the latch (if any) is open or closed (1/0)
133 * @adapter_present: if there is a pci board present in the slot or not (1/0)
134 * @address: (domain << 16 | bus << 8 | dev)
135 *
136 * Used to notify the hotplug pci core of the status of a specific slot.
137 */
138struct hotplug_slot_info {
139 u8 power_status;
140 u8 attention_status;
141 u8 latch_status;
142 u8 adapter_status;
143 u32 address;
144 enum pci_bus_speed max_bus_speed;
145 enum pci_bus_speed cur_bus_speed;
146};
147
148/**
149 * struct hotplug_slot - used to register a physical slot with the hotplug pci core
150 * @name: the name of the slot being registered. This string must
151 * be unique amoung slots registered on this system.
152 * @ops: pointer to the &struct hotplug_slot_ops to be used for this slot
153 * @info: pointer to the &struct hotplug_slot_info for the initial values for
154 * this slot.
155 * @release: called during pci_hp_deregister to free memory allocated in a
156 * hotplug_slot structure.
157 * @private: used by the hotplug pci controller driver to store whatever it
158 * needs.
159 */
160struct hotplug_slot {
161 char *name;
162 struct hotplug_slot_ops *ops;
163 struct hotplug_slot_info *info;
164 void (*release) (struct hotplug_slot *slot);
165 void *private;
166
167 /* Variables below this are for use only by the hotplug pci core. */
168 struct list_head slot_list;
169 struct kobject kobj;
170};
171#define to_hotplug_slot(n) container_of(n, struct hotplug_slot, kobj)
172
173extern int pci_hp_register (struct hotplug_slot *slot);
174extern int pci_hp_deregister (struct hotplug_slot *slot);
175extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot,
176 struct hotplug_slot_info *info);
177extern struct subsystem pci_hotplug_slots_subsys;
178
179/* PCI Setting Record (Type 0) */
180struct hpp_type0 {
181 u32 revision;
182 u8 cache_line_size;
183 u8 latency_timer;
184 u8 enable_serr;
185 u8 enable_perr;
186};
187
188/* PCI-X Setting Record (Type 1) */
189struct hpp_type1 {
190 u32 revision;
191 u8 max_mem_read;
192 u8 avg_max_split;
193 u16 tot_max_split;
194};
195
196/* PCI Express Setting Record (Type 2) */
197struct hpp_type2 {
198 u32 revision;
199 u32 unc_err_mask_and;
200 u32 unc_err_mask_or;
201 u32 unc_err_sever_and;
202 u32 unc_err_sever_or;
203 u32 cor_err_mask_and;
204 u32 cor_err_mask_or;
205 u32 adv_err_cap_and;
206 u32 adv_err_cap_or;
207 u16 pci_exp_devctl_and;
208 u16 pci_exp_devctl_or;
209 u16 pci_exp_lnkctl_and;
210 u16 pci_exp_lnkctl_or;
211 u32 sec_unc_err_sever_and;
212 u32 sec_unc_err_sever_or;
213 u32 sec_unc_err_mask_and;
214 u32 sec_unc_err_mask_or;
215};
216
217struct hotplug_params {
218 struct hpp_type0 *t0; /* Type0: NULL if not available */
219 struct hpp_type1 *t1; /* Type1: NULL if not available */
220 struct hpp_type2 *t2; /* Type2: NULL if not available */
221 struct hpp_type0 type0_data;
222 struct hpp_type1 type1_data;
223 struct hpp_type2 type2_data;
224};
225
226#ifdef CONFIG_ACPI
227#include <acpi/acpi.h>
228#include <acpi/acpi_bus.h>
229#include <acpi/actypes.h>
230extern acpi_status acpi_run_oshp(acpi_handle handle);
231extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus,
232 struct hotplug_params *hpp);
233int acpi_root_bridge(acpi_handle handle);
234#endif
235#endif
236
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f069df245469..c09da1e30c54 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1213,6 +1213,11 @@
1213#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 1213#define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451
1214#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 1214#define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452
1215#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 1215#define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453
1216#define PCI_DEVICE_ID_NVIDIA_NVENET_24 0x054C
1217#define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D
1218#define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E
1219#define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F
1220#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560
1216 1221
1217#define PCI_VENDOR_ID_IMS 0x10e0 1222#define PCI_VENDOR_ID_IMS 0x10e0
1218#define PCI_DEVICE_ID_IMS_TT128 0x9128 1223#define PCI_DEVICE_ID_IMS_TT128 0x9128
@@ -1892,6 +1897,7 @@
1892#define PCI_VENDOR_ID_BROADCOM 0x14e4 1897#define PCI_VENDOR_ID_BROADCOM 0x14e4
1893#define PCI_DEVICE_ID_TIGON3_5752 0x1600 1898#define PCI_DEVICE_ID_TIGON3_5752 0x1600
1894#define PCI_DEVICE_ID_TIGON3_5752M 0x1601 1899#define PCI_DEVICE_ID_TIGON3_5752M 0x1601
1900#define PCI_DEVICE_ID_NX2_5709 0x1639
1895#define PCI_DEVICE_ID_TIGON3_5700 0x1644 1901#define PCI_DEVICE_ID_TIGON3_5700 0x1644
1896#define PCI_DEVICE_ID_TIGON3_5701 0x1645 1902#define PCI_DEVICE_ID_TIGON3_5701 0x1645
1897#define PCI_DEVICE_ID_TIGON3_5702 0x1646 1903#define PCI_DEVICE_ID_TIGON3_5702 0x1646
@@ -2210,6 +2216,13 @@
2210#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815 2216#define PCI_DEVICE_ID_INTEL_ICH8_4 0x2815
2211#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e 2217#define PCI_DEVICE_ID_INTEL_ICH8_5 0x283e
2212#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850 2218#define PCI_DEVICE_ID_INTEL_ICH8_6 0x2850
2219#define PCI_DEVICE_ID_INTEL_ICH9_0 0x2910
2220#define PCI_DEVICE_ID_INTEL_ICH9_1 0x2911
2221#define PCI_DEVICE_ID_INTEL_ICH9_2 0x2912
2222#define PCI_DEVICE_ID_INTEL_ICH9_3 0x2913
2223#define PCI_DEVICE_ID_INTEL_ICH9_4 0x2914
2224#define PCI_DEVICE_ID_INTEL_ICH9_5 0x2915
2225#define PCI_DEVICE_ID_INTEL_ICH9_6 0x2930
2213#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340 2226#define PCI_DEVICE_ID_INTEL_82855PM_HB 0x3340
2214#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575 2227#define PCI_DEVICE_ID_INTEL_82830_HB 0x3575
2215#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577 2228#define PCI_DEVICE_ID_INTEL_82830_CGC 0x3577
@@ -2351,3 +2364,5 @@
2351#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 2364#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897
2352#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 2365#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898
2353 2366
2367#define PCI_VENDOR_ID_QUICKNET 0x15E2
2368#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c312a12ad2d6..064b1dc71c22 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -292,6 +292,12 @@
292#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ 292#define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */
293#define PCI_MSI_MASK_BIT 16 /* Mask bits register */ 293#define PCI_MSI_MASK_BIT 16 /* Mask bits register */
294 294
295/* MSI-X registers (these are at offset PCI_MSI_FLAGS) */
296#define PCI_MSIX_FLAGS_QSIZE 0x7FF
297#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
298#define PCI_MSIX_FLAGS_BIRMASK (7 << 0)
299#define PCI_MSIX_FLAGS_BITMASK (1 << 0)
300
295/* CompactPCI Hotswap Register */ 301/* CompactPCI Hotswap Register */
296 302
297#define PCI_CHSWP_CSR 2 /* Control and Status Register */ 303#define PCI_CHSWP_CSR 2 /* Control and Status Register */
@@ -371,6 +377,7 @@
371#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */ 377#define PCI_EXP_DEVSTA_TRPND 0x20 /* Transactions Pending */
372#define PCI_EXP_LNKCAP 12 /* Link Capabilities */ 378#define PCI_EXP_LNKCAP 12 /* Link Capabilities */
373#define PCI_EXP_LNKCTL 16 /* Link Control */ 379#define PCI_EXP_LNKCTL 16 /* Link Control */
380#define PCI_EXP_LNKCTL_CLKREQ_EN 0x100 /* Enable clkreq */
374#define PCI_EXP_LNKSTA 18 /* Link Status */ 381#define PCI_EXP_LNKSTA 18 /* Link Status */
375#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */ 382#define PCI_EXP_SLTCAP 20 /* Slot Capabilities */
376#define PCI_EXP_SLTCTL 24 /* Slot Control */ 383#define PCI_EXP_SLTCTL 24 /* Slot Control */
diff --git a/include/linux/personality.h b/include/linux/personality.h
index 80d780e5a8f5..012cd558189b 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_PERSONALITY_H 1#ifndef _LINUX_PERSONALITY_H
2#define _LINUX_PERSONALITY_H 2#define _LINUX_PERSONALITY_H
3 3
4#ifdef __KERNEL__
5
4/* 6/*
5 * Handling of different ABIs (personalities). 7 * Handling of different ABIs (personalities).
6 */ 8 */
@@ -12,6 +14,8 @@ extern int register_exec_domain(struct exec_domain *);
12extern int unregister_exec_domain(struct exec_domain *); 14extern int unregister_exec_domain(struct exec_domain *);
13extern int __set_personality(unsigned long); 15extern int __set_personality(unsigned long);
14 16
17#endif /* __KERNEL__ */
18
15/* 19/*
16 * Flags for bug emulation. 20 * Flags for bug emulation.
17 * 21 *
@@ -71,6 +75,7 @@ enum {
71 PER_MASK = 0x00ff, 75 PER_MASK = 0x00ff,
72}; 76};
73 77
78#ifdef __KERNEL__
74 79
75/* 80/*
76 * Description of an execution domain. 81 * Description of an execution domain.
@@ -109,6 +114,8 @@ struct exec_domain {
109 * Change personality of the currently running process. 114 * Change personality of the currently running process.
110 */ 115 */
111#define set_personality(pers) \ 116#define set_personality(pers) \
112 ((current->personality == pers) ? 0 : __set_personality(pers)) 117 ((current->personality == (pers)) ? 0 : __set_personality(pers))
118
119#endif /* __KERNEL__ */
113 120
114#endif /* _LINUX_PERSONALITY_H */ 121#endif /* _LINUX_PERSONALITY_H */
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index d5dd471da225..0f0b880c4280 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -32,7 +32,7 @@ struct sadb_ext {
32struct sadb_sa { 32struct sadb_sa {
33 uint16_t sadb_sa_len; 33 uint16_t sadb_sa_len;
34 uint16_t sadb_sa_exttype; 34 uint16_t sadb_sa_exttype;
35 uint32_t sadb_sa_spi; 35 __be32 sadb_sa_spi;
36 uint8_t sadb_sa_replay; 36 uint8_t sadb_sa_replay;
37 uint8_t sadb_sa_state; 37 uint8_t sadb_sa_state;
38 uint8_t sadb_sa_auth; 38 uint8_t sadb_sa_auth;
@@ -211,7 +211,7 @@ struct sadb_x_nat_t_type {
211struct sadb_x_nat_t_port { 211struct sadb_x_nat_t_port {
212 uint16_t sadb_x_nat_t_port_len; 212 uint16_t sadb_x_nat_t_port_len;
213 uint16_t sadb_x_nat_t_port_exttype; 213 uint16_t sadb_x_nat_t_port_exttype;
214 uint16_t sadb_x_nat_t_port_port; 214 __be16 sadb_x_nat_t_port_port;
215 uint16_t sadb_x_nat_t_port_reserved; 215 uint16_t sadb_x_nat_t_port_reserved;
216} __attribute__((packed)); 216} __attribute__((packed));
217/* sizeof(struct sadb_x_nat_t_port) == 8 */ 217/* sizeof(struct sadb_x_nat_t_port) == 8 */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 892d6abe57e5..edd4c88ca7d8 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -22,7 +22,8 @@
22#include <linux/device.h> 22#include <linux/device.h>
23#include <linux/ethtool.h> 23#include <linux/ethtool.h>
24#include <linux/mii.h> 24#include <linux/mii.h>
25#include <asm/irq.h> 25#include <linux/timer.h>
26#include <linux/workqueue.h>
26 27
27#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 28#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
28 SUPPORTED_10baseT_Full | \ 29 SUPPORTED_10baseT_Full | \
@@ -46,15 +47,26 @@
46#define PHY_HAS_INTERRUPT 0x00000001 47#define PHY_HAS_INTERRUPT 0x00000001
47#define PHY_HAS_MAGICANEG 0x00000002 48#define PHY_HAS_MAGICANEG 0x00000002
48 49
50/* Interface Mode definitions */
51typedef enum {
52 PHY_INTERFACE_MODE_MII,
53 PHY_INTERFACE_MODE_GMII,
54 PHY_INTERFACE_MODE_SGMII,
55 PHY_INTERFACE_MODE_TBI,
56 PHY_INTERFACE_MODE_RMII,
57 PHY_INTERFACE_MODE_RGMII,
58 PHY_INTERFACE_MODE_RTBI
59} phy_interface_t;
60
49#define MII_BUS_MAX 4 61#define MII_BUS_MAX 4
50 62
51 63
52#define PHY_INIT_TIMEOUT 100000 64#define PHY_INIT_TIMEOUT 100000
53#define PHY_STATE_TIME 1 65#define PHY_STATE_TIME 1
54#define PHY_FORCE_TIMEOUT 10 66#define PHY_FORCE_TIMEOUT 10
55#define PHY_AN_TIMEOUT 10 67#define PHY_AN_TIMEOUT 10
56 68
57#define PHY_MAX_ADDR 32 69#define PHY_MAX_ADDR 32
58 70
59/* Used when trying to connect to a specific phy (mii bus id:phy device id) */ 71/* Used when trying to connect to a specific phy (mii bus id:phy device id) */
60#define PHY_ID_FMT "%x:%02x" 72#define PHY_ID_FMT "%x:%02x"
@@ -86,8 +98,8 @@ struct mii_bus {
86 int *irq; 98 int *irq;
87}; 99};
88 100
89#define PHY_INTERRUPT_DISABLED 0x0 101#define PHY_INTERRUPT_DISABLED 0x0
90#define PHY_INTERRUPT_ENABLED 0x80000000 102#define PHY_INTERRUPT_ENABLED 0x80000000
91 103
92/* PHY state machine states: 104/* PHY state machine states:
93 * 105 *
@@ -229,6 +241,8 @@ struct phy_device {
229 241
230 u32 dev_flags; 242 u32 dev_flags;
231 243
244 phy_interface_t interface;
245
232 /* Bus address of the PHY (0-32) */ 246 /* Bus address of the PHY (0-32) */
233 int addr; 247 int addr;
234 248
@@ -344,9 +358,10 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
344int phy_clear_interrupt(struct phy_device *phydev); 358int phy_clear_interrupt(struct phy_device *phydev);
345int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); 359int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
346struct phy_device * phy_attach(struct net_device *dev, 360struct phy_device * phy_attach(struct net_device *dev,
347 const char *phy_id, u32 flags); 361 const char *phy_id, u32 flags, phy_interface_t interface);
348struct phy_device * phy_connect(struct net_device *dev, const char *phy_id, 362struct phy_device * phy_connect(struct net_device *dev, const char *phy_id,
349 void (*handler)(struct net_device *), u32 flags); 363 void (*handler)(struct net_device *), u32 flags,
364 phy_interface_t interface);
350void phy_disconnect(struct phy_device *phydev); 365void phy_disconnect(struct phy_device *phydev);
351void phy_detach(struct phy_device *phydev); 366void phy_detach(struct phy_device *phydev);
352void phy_start(struct phy_device *phydev); 367void phy_start(struct phy_device *phydev);
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 29cd6dee13db..20f47b81d3fa 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -58,6 +58,12 @@ struct platform_driver {
58extern int platform_driver_register(struct platform_driver *); 58extern int platform_driver_register(struct platform_driver *);
59extern void platform_driver_unregister(struct platform_driver *); 59extern void platform_driver_unregister(struct platform_driver *);
60 60
61/* non-hotpluggable platform devices may use this so that probe() and
62 * its support may live in __init sections, conserving runtime memory.
63 */
64extern int platform_driver_probe(struct platform_driver *driver,
65 int (*probe)(struct platform_device *));
66
61#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) 67#define platform_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev)
62#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) 68#define platform_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data))
63 69
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 6b27e07aef19..070394e846d0 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -116,7 +116,9 @@ typedef int __bitwise suspend_disk_method_t;
116#define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2) 116#define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2)
117#define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3) 117#define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3)
118#define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4) 118#define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4)
119#define PM_DISK_MAX ((__force suspend_disk_method_t) 5) 119#define PM_DISK_TEST ((__force suspend_disk_method_t) 5)
120#define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 6)
121#define PM_DISK_MAX ((__force suspend_disk_method_t) 7)
120 122
121struct pm_ops { 123struct pm_ops {
122 suspend_disk_method_t pm_disk_mode; 124 suspend_disk_method_t pm_disk_mode;
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 84d887751855..ebd42a3710b4 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -146,16 +146,16 @@ enum bitmap_state {
146 146
147/* the superblock at the front of the bitmap file -- little endian */ 147/* the superblock at the front of the bitmap file -- little endian */
148typedef struct bitmap_super_s { 148typedef struct bitmap_super_s {
149 __u32 magic; /* 0 BITMAP_MAGIC */ 149 __le32 magic; /* 0 BITMAP_MAGIC */
150 __u32 version; /* 4 the bitmap major for now, could change... */ 150 __le32 version; /* 4 the bitmap major for now, could change... */
151 __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */ 151 __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */
152 __u64 events; /* 24 event counter for the bitmap (1)*/ 152 __le64 events; /* 24 event counter for the bitmap (1)*/
153 __u64 events_cleared;/*32 event counter when last bit cleared (2) */ 153 __le64 events_cleared;/*32 event counter when last bit cleared (2) */
154 __u64 sync_size; /* 40 the size of the md device's sync range(3) */ 154 __le64 sync_size; /* 40 the size of the md device's sync range(3) */
155 __u32 state; /* 48 bitmap state information */ 155 __le32 state; /* 48 bitmap state information */
156 __u32 chunksize; /* 52 the bitmap chunk size in bytes */ 156 __le32 chunksize; /* 52 the bitmap chunk size in bytes */
157 __u32 daemon_sleep; /* 56 seconds between disk flushes */ 157 __le32 daemon_sleep; /* 56 seconds between disk flushes */
158 __u32 write_behind; /* 60 number of outstanding write-behind writes */ 158 __le32 write_behind; /* 60 number of outstanding write-behind writes */
159 159
160 __u8 pad[256 - 64]; /* set to zero */ 160 __u8 pad[256 - 64]; /* set to zero */
161} bitmap_super_t; 161} bitmap_super_t;
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index b6ebc69bae54..3f2cd98c508b 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -206,52 +206,52 @@ static inline __u64 md_event(mdp_super_t *sb) {
206 */ 206 */
207struct mdp_superblock_1 { 207struct mdp_superblock_1 {
208 /* constant array information - 128 bytes */ 208 /* constant array information - 128 bytes */
209 __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ 209 __le32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
210 __u32 major_version; /* 1 */ 210 __le32 major_version; /* 1 */
211 __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */ 211 __le32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
212 __u32 pad0; /* always set to 0 when writing */ 212 __le32 pad0; /* always set to 0 when writing */
213 213
214 __u8 set_uuid[16]; /* user-space generated. */ 214 __u8 set_uuid[16]; /* user-space generated. */
215 char set_name[32]; /* set and interpreted by user-space */ 215 char set_name[32]; /* set and interpreted by user-space */
216 216
217 __u64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/ 217 __le64 ctime; /* lo 40 bits are seconds, top 24 are microseconds or 0*/
218 __u32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */ 218 __le32 level; /* -4 (multipath), -1 (linear), 0,1,4,5 */
219 __u32 layout; /* only for raid5 and raid10 currently */ 219 __le32 layout; /* only for raid5 and raid10 currently */
220 __u64 size; /* used size of component devices, in 512byte sectors */ 220 __le64 size; /* used size of component devices, in 512byte sectors */
221 221
222 __u32 chunksize; /* in 512byte sectors */ 222 __le32 chunksize; /* in 512byte sectors */
223 __u32 raid_disks; 223 __le32 raid_disks;
224 __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts 224 __le32 bitmap_offset; /* sectors after start of superblock that bitmap starts
225 * NOTE: signed, so bitmap can be before superblock 225 * NOTE: signed, so bitmap can be before superblock
226 * only meaningful of feature_map[0] is set. 226 * only meaningful of feature_map[0] is set.
227 */ 227 */
228 228
229 /* These are only valid with feature bit '4' */ 229 /* These are only valid with feature bit '4' */
230 __u32 new_level; /* new level we are reshaping to */ 230 __le32 new_level; /* new level we are reshaping to */
231 __u64 reshape_position; /* next address in array-space for reshape */ 231 __le64 reshape_position; /* next address in array-space for reshape */
232 __u32 delta_disks; /* change in number of raid_disks */ 232 __le32 delta_disks; /* change in number of raid_disks */
233 __u32 new_layout; /* new layout */ 233 __le32 new_layout; /* new layout */
234 __u32 new_chunk; /* new chunk size (bytes) */ 234 __le32 new_chunk; /* new chunk size (bytes) */
235 __u8 pad1[128-124]; /* set to 0 when written */ 235 __u8 pad1[128-124]; /* set to 0 when written */
236 236
237 /* constant this-device information - 64 bytes */ 237 /* constant this-device information - 64 bytes */
238 __u64 data_offset; /* sector start of data, often 0 */ 238 __le64 data_offset; /* sector start of data, often 0 */
239 __u64 data_size; /* sectors in this device that can be used for data */ 239 __le64 data_size; /* sectors in this device that can be used for data */
240 __u64 super_offset; /* sector start of this superblock */ 240 __le64 super_offset; /* sector start of this superblock */
241 __u64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */ 241 __le64 recovery_offset;/* sectors before this offset (from data_offset) have been recovered */
242 __u32 dev_number; /* permanent identifier of this device - not role in raid */ 242 __le32 dev_number; /* permanent identifier of this device - not role in raid */
243 __u32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */ 243 __le32 cnt_corrected_read; /* number of read errors that were corrected by re-writing */
244 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 244 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
245 __u8 devflags; /* per-device flags. Only one defined...*/ 245 __u8 devflags; /* per-device flags. Only one defined...*/
246#define WriteMostly1 1 /* mask for writemostly flag in above */ 246#define WriteMostly1 1 /* mask for writemostly flag in above */
247 __u8 pad2[64-57]; /* set to 0 when writing */ 247 __u8 pad2[64-57]; /* set to 0 when writing */
248 248
249 /* array state information - 64 bytes */ 249 /* array state information - 64 bytes */
250 __u64 utime; /* 40 bits second, 24 btes microseconds */ 250 __le64 utime; /* 40 bits second, 24 btes microseconds */
251 __u64 events; /* incremented when superblock updated */ 251 __le64 events; /* incremented when superblock updated */
252 __u64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ 252 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
253 __u32 sb_csum; /* checksum upto devs[max_dev] */ 253 __le32 sb_csum; /* checksum upto devs[max_dev] */
254 __u32 max_dev; /* size of devs[] array to consider */ 254 __le32 max_dev; /* size of devs[] array to consider */
255 __u8 pad3[64-32]; /* set to 0 when writing */ 255 __u8 pad3[64-32]; /* set to 0 when writing */
256 256
257 /* device state information. Indexed by dev_number. 257 /* device state information. Indexed by dev_number.
@@ -260,7 +260,7 @@ struct mdp_superblock_1 {
260 * into the 'roles' value. If a device is spare or faulty, then it doesn't 260 * into the 'roles' value. If a device is spare or faulty, then it doesn't
261 * have a meaningful role. 261 * have a meaningful role.
262 */ 262 */
263 __u16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */ 263 __le16 dev_roles[0]; /* role in array, or 0xffff for a spare, or 0xfffe for faulty */
264}; 264};
265 265
266/* feature_map bits */ 266/* feature_map bits */
diff --git a/include/linux/random.h b/include/linux/random.h
index 5d6456bcdeba..01ad71033d65 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -51,16 +51,16 @@ extern void add_interrupt_randomness(int irq);
51extern void get_random_bytes(void *buf, int nbytes); 51extern void get_random_bytes(void *buf, int nbytes);
52void generate_random_uuid(unsigned char uuid_out[16]); 52void generate_random_uuid(unsigned char uuid_out[16]);
53 53
54extern __u32 secure_ip_id(__u32 daddr); 54extern __u32 secure_ip_id(__be32 daddr);
55extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); 55extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
56extern u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, 56extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
57 __u16 dport); 57 __be16 dport);
58extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, 58extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
59 __u16 sport, __u16 dport); 59 __be16 sport, __be16 dport);
60extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, 60extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
61 __u16 sport, __u16 dport); 61 __be16 sport, __be16 dport);
62extern u64 secure_dccp_sequence_number(__u32 saddr, __u32 daddr, 62extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
63 __u16 sport, __u16 dport); 63 __be16 sport, __be16 dport);
64 64
65#ifndef MODULE 65#ifndef MODULE
66extern struct file_operations random_fops, urandom_fops; 66extern struct file_operations random_fops, urandom_fops;
@@ -69,6 +69,9 @@ extern struct file_operations random_fops, urandom_fops;
69unsigned int get_random_int(void); 69unsigned int get_random_int(void);
70unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len); 70unsigned long randomize_range(unsigned long start, unsigned long end, unsigned long len);
71 71
72u32 random32(void);
73void srandom32(u32 seed);
74
72#endif /* __KERNEL___ */ 75#endif /* __KERNEL___ */
73 76
74#endif /* _LINUX_RANDOM_H */ 77#endif /* _LINUX_RANDOM_H */
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h
index 73e0becec086..62a7169aed8b 100644
--- a/include/linux/reiserfs_fs_sb.h
+++ b/include/linux/reiserfs_fs_sb.h
@@ -429,7 +429,7 @@ enum reiserfs_mount_options {
429/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting 429/* -o hash={tea, rupasov, r5, detect} is meant for properly mounting
430** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option 430** reiserfs disks from 3.5.19 or earlier. 99% of the time, this option
431** is not required. If the normal autodection code can't determine which 431** is not required. If the normal autodection code can't determine which
432** hash to use (because both hases had the same value for a file) 432** hash to use (because both hashes had the same value for a file)
433** use this option to force a specific hash. It won't allow you to override 433** use this option to force a specific hash. It won't allow you to override
434** the existing hash on the FS, so if you have a tea hash disk, and mount 434** the existing hash on the FS, so if you have a tea hash disk, and mount
435** with -o hash=rupasov, the mount will fail. 435** with -o hash=rupasov, the mount will fail.
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 3a18addaed4c..493297acdae8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -81,8 +81,6 @@ enum {
81 81
82 RTM_NEWPREFIX = 52, 82 RTM_NEWPREFIX = 52,
83#define RTM_NEWPREFIX RTM_NEWPREFIX 83#define RTM_NEWPREFIX RTM_NEWPREFIX
84 RTM_GETPREFIX = 54,
85#define RTM_GETPREFIX RTM_GETPREFIX
86 84
87 RTM_GETMULTICAST = 58, 85 RTM_GETMULTICAST = 58,
88#define RTM_GETMULTICAST RTM_GETMULTICAST 86#define RTM_GETMULTICAST RTM_GETMULTICAST
@@ -587,6 +585,9 @@ extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
587 struct nlmsghdr *nlh, gfp_t flags); 585 struct nlmsghdr *nlh, gfp_t flags);
588extern void rtnl_set_sk_err(u32 group, int error); 586extern void rtnl_set_sk_err(u32 group, int error);
589extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); 587extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
588extern int rtnl_put_cacheinfo(struct sk_buff *skb, struct dst_entry *dst,
589 u32 id, u32 ts, u32 tsage, long expires,
590 u32 error);
590 591
591extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); 592extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
592 593
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6735c1cf334c..eafe4a7b8237 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -466,7 +466,6 @@ struct signal_struct {
466 struct pacct_struct pacct; /* per-process accounting information */ 466 struct pacct_struct pacct; /* per-process accounting information */
467#endif 467#endif
468#ifdef CONFIG_TASKSTATS 468#ifdef CONFIG_TASKSTATS
469 spinlock_t stats_lock;
470 struct taskstats *stats; 469 struct taskstats *stats;
471#endif 470#endif
472}; 471};
diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 6ec66dec29f7..35108fe7a686 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -57,17 +57,17 @@
57 57
58/* Section 3.1. SCTP Common Header Format */ 58/* Section 3.1. SCTP Common Header Format */
59typedef struct sctphdr { 59typedef struct sctphdr {
60 __u16 source; 60 __be16 source;
61 __u16 dest; 61 __be16 dest;
62 __u32 vtag; 62 __be32 vtag;
63 __u32 checksum; 63 __be32 checksum;
64} __attribute__((packed)) sctp_sctphdr_t; 64} __attribute__((packed)) sctp_sctphdr_t;
65 65
66/* Section 3.2. Chunk Field Descriptions. */ 66/* Section 3.2. Chunk Field Descriptions. */
67typedef struct sctp_chunkhdr { 67typedef struct sctp_chunkhdr {
68 __u8 type; 68 __u8 type;
69 __u8 flags; 69 __u8 flags;
70 __u16 length; 70 __be16 length;
71} __attribute__((packed)) sctp_chunkhdr_t; 71} __attribute__((packed)) sctp_chunkhdr_t;
72 72
73 73
@@ -153,8 +153,8 @@ enum { SCTP_CHUNK_FLAG_T = 0x01 };
153 */ 153 */
154 154
155typedef struct sctp_paramhdr { 155typedef struct sctp_paramhdr {
156 __u16 type; 156 __be16 type;
157 __u16 length; 157 __be16 length;
158} __attribute__((packed)) sctp_paramhdr_t; 158} __attribute__((packed)) sctp_paramhdr_t;
159 159
160typedef enum { 160typedef enum {
@@ -203,10 +203,10 @@ enum { SCTP_PARAM_ACTION_MASK = __constant_htons(0xc000), };
203/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */ 203/* RFC 2960 Section 3.3.1 Payload Data (DATA) (0) */
204 204
205typedef struct sctp_datahdr { 205typedef struct sctp_datahdr {
206 __u32 tsn; 206 __be32 tsn;
207 __u16 stream; 207 __be16 stream;
208 __u16 ssn; 208 __be16 ssn;
209 __u32 ppid; 209 __be32 ppid;
210 __u8 payload[0]; 210 __u8 payload[0];
211} __attribute__((packed)) sctp_datahdr_t; 211} __attribute__((packed)) sctp_datahdr_t;
212 212
@@ -232,11 +232,11 @@ enum { SCTP_DATA_FRAG_MASK = 0x03, };
232 * endpoints. 232 * endpoints.
233 */ 233 */
234typedef struct sctp_inithdr { 234typedef struct sctp_inithdr {
235 __u32 init_tag; 235 __be32 init_tag;
236 __u32 a_rwnd; 236 __be32 a_rwnd;
237 __u16 num_outbound_streams; 237 __be16 num_outbound_streams;
238 __u16 num_inbound_streams; 238 __be16 num_inbound_streams;
239 __u32 initial_tsn; 239 __be32 initial_tsn;
240 __u8 params[0]; 240 __u8 params[0];
241} __attribute__((packed)) sctp_inithdr_t; 241} __attribute__((packed)) sctp_inithdr_t;
242 242
@@ -261,7 +261,7 @@ typedef struct sctp_ipv6addr_param {
261/* Section 3.3.2.1 Cookie Preservative (9) */ 261/* Section 3.3.2.1 Cookie Preservative (9) */
262typedef struct sctp_cookie_preserve_param { 262typedef struct sctp_cookie_preserve_param {
263 sctp_paramhdr_t param_hdr; 263 sctp_paramhdr_t param_hdr;
264 uint32_t lifespan_increment; 264 __be32 lifespan_increment;
265} __attribute__((packed)) sctp_cookie_preserve_param_t; 265} __attribute__((packed)) sctp_cookie_preserve_param_t;
266 266
267/* Section 3.3.2.1 Host Name Address (11) */ 267/* Section 3.3.2.1 Host Name Address (11) */
@@ -273,7 +273,7 @@ typedef struct sctp_hostname_param {
273/* Section 3.3.2.1 Supported Address Types (12) */ 273/* Section 3.3.2.1 Supported Address Types (12) */
274typedef struct sctp_supported_addrs_param { 274typedef struct sctp_supported_addrs_param {
275 sctp_paramhdr_t param_hdr; 275 sctp_paramhdr_t param_hdr;
276 uint16_t types[0]; 276 __be16 types[0];
277} __attribute__((packed)) sctp_supported_addrs_param_t; 277} __attribute__((packed)) sctp_supported_addrs_param_t;
278 278
279/* Appendix A. ECN Capable (32768) */ 279/* Appendix A. ECN Capable (32768) */
@@ -284,7 +284,7 @@ typedef struct sctp_ecn_capable_param {
284/* ADDIP Section 3.2.6 Adaption Layer Indication */ 284/* ADDIP Section 3.2.6 Adaption Layer Indication */
285typedef struct sctp_adaption_ind_param { 285typedef struct sctp_adaption_ind_param {
286 struct sctp_paramhdr param_hdr; 286 struct sctp_paramhdr param_hdr;
287 __u32 adaption_ind; 287 __be32 adaption_ind;
288} __attribute__((packed)) sctp_adaption_ind_param_t; 288} __attribute__((packed)) sctp_adaption_ind_param_t;
289 289
290/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2): 290/* RFC 2960. Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
@@ -316,11 +316,11 @@ typedef struct sctp_unrecognized_param {
316 */ 316 */
317 317
318typedef struct sctp_gap_ack_block { 318typedef struct sctp_gap_ack_block {
319 __u16 start; 319 __be16 start;
320 __u16 end; 320 __be16 end;
321} __attribute__((packed)) sctp_gap_ack_block_t; 321} __attribute__((packed)) sctp_gap_ack_block_t;
322 322
323typedef uint32_t sctp_dup_tsn_t; 323typedef __be32 sctp_dup_tsn_t;
324 324
325typedef union { 325typedef union {
326 sctp_gap_ack_block_t gab; 326 sctp_gap_ack_block_t gab;
@@ -328,10 +328,10 @@ typedef union {
328} sctp_sack_variable_t; 328} sctp_sack_variable_t;
329 329
330typedef struct sctp_sackhdr { 330typedef struct sctp_sackhdr {
331 __u32 cum_tsn_ack; 331 __be32 cum_tsn_ack;
332 __u32 a_rwnd; 332 __be32 a_rwnd;
333 __u16 num_gap_ack_blocks; 333 __be16 num_gap_ack_blocks;
334 __u16 num_dup_tsns; 334 __be16 num_dup_tsns;
335 sctp_sack_variable_t variable[0]; 335 sctp_sack_variable_t variable[0];
336} __attribute__((packed)) sctp_sackhdr_t; 336} __attribute__((packed)) sctp_sackhdr_t;
337 337
@@ -371,7 +371,7 @@ typedef struct sctp_abort_chunk {
371 * and the highest consecutive acking value. 371 * and the highest consecutive acking value.
372 */ 372 */
373typedef struct sctp_shutdownhdr { 373typedef struct sctp_shutdownhdr {
374 __u32 cum_tsn_ack; 374 __be32 cum_tsn_ack;
375} __attribute__((packed)) sctp_shutdownhdr_t; 375} __attribute__((packed)) sctp_shutdownhdr_t;
376 376
377struct sctp_shutdown_chunk_t { 377struct sctp_shutdown_chunk_t {
@@ -382,8 +382,8 @@ struct sctp_shutdown_chunk_t {
382/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */ 382/* RFC 2960. Section 3.3.10 Operation Error (ERROR) (9) */
383 383
384typedef struct sctp_errhdr { 384typedef struct sctp_errhdr {
385 __u16 cause; 385 __be16 cause;
386 __u16 length; 386 __be16 length;
387 __u8 variable[0]; 387 __u8 variable[0];
388} __attribute__((packed)) sctp_errhdr_t; 388} __attribute__((packed)) sctp_errhdr_t;
389 389
@@ -462,7 +462,7 @@ typedef enum {
462 * Explicit Congestion Notification Echo (ECNE) (12) 462 * Explicit Congestion Notification Echo (ECNE) (12)
463 */ 463 */
464typedef struct sctp_ecnehdr { 464typedef struct sctp_ecnehdr {
465 __u32 lowest_tsn; 465 __be32 lowest_tsn;
466} sctp_ecnehdr_t; 466} sctp_ecnehdr_t;
467 467
468typedef struct sctp_ecne_chunk { 468typedef struct sctp_ecne_chunk {
@@ -474,7 +474,7 @@ typedef struct sctp_ecne_chunk {
474 * Congestion Window Reduced (CWR) (13) 474 * Congestion Window Reduced (CWR) (13)
475 */ 475 */
476typedef struct sctp_cwrhdr { 476typedef struct sctp_cwrhdr {
477 __u32 lowest_tsn; 477 __be32 lowest_tsn;
478} sctp_cwrhdr_t; 478} sctp_cwrhdr_t;
479 479
480typedef struct sctp_cwr_chunk { 480typedef struct sctp_cwr_chunk {
@@ -529,12 +529,12 @@ typedef struct sctp_cwr_chunk {
529 * chunks this field MUST be filled in. 529 * chunks this field MUST be filled in.
530 */ 530 */
531struct sctp_fwdtsn_skip { 531struct sctp_fwdtsn_skip {
532 __u16 stream; 532 __be16 stream;
533 __u16 ssn; 533 __be16 ssn;
534} __attribute__((packed)); 534} __attribute__((packed));
535 535
536struct sctp_fwdtsn_hdr { 536struct sctp_fwdtsn_hdr {
537 __u32 new_cum_tsn; 537 __be32 new_cum_tsn;
538 struct sctp_fwdtsn_skip skip[0]; 538 struct sctp_fwdtsn_skip skip[0];
539} __attribute((packed)); 539} __attribute((packed));
540 540
@@ -578,11 +578,11 @@ struct sctp_fwdtsn_chunk {
578 */ 578 */
579typedef struct sctp_addip_param { 579typedef struct sctp_addip_param {
580 sctp_paramhdr_t param_hdr; 580 sctp_paramhdr_t param_hdr;
581 __u32 crr_id; 581 __be32 crr_id;
582} __attribute__((packed)) sctp_addip_param_t; 582} __attribute__((packed)) sctp_addip_param_t;
583 583
584typedef struct sctp_addiphdr { 584typedef struct sctp_addiphdr {
585 __u32 serial; 585 __be32 serial;
586 __u8 params[0]; 586 __u8 params[0];
587} __attribute__((packed)) sctp_addiphdr_t; 587} __attribute__((packed)) sctp_addiphdr_t;
588 588
diff --git a/include/linux/security.h b/include/linux/security.h
index b200b9856f32..83cdefae9931 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -826,6 +826,8 @@ struct request_sock;
826 * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid. 826 * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid.
827 * @inet_csk_clone: 827 * @inet_csk_clone:
828 * Sets the new child socket's sid to the openreq sid. 828 * Sets the new child socket's sid to the openreq sid.
829 * @inet_conn_established:
830 * Sets the connection's peersid to the secmark on skb.
829 * @req_classify_flow: 831 * @req_classify_flow:
830 * Sets the flow's sid to the openreq sid. 832 * Sets the flow's sid to the openreq sid.
831 * 833 *
@@ -836,10 +838,8 @@ struct request_sock;
836 * used by the XFRM system. 838 * used by the XFRM system.
837 * @sec_ctx contains the security context information being provided by 839 * @sec_ctx contains the security context information being provided by
838 * the user-level policy update program (e.g., setkey). 840 * the user-level policy update program (e.g., setkey).
839 * @sk refers to the sock from which to derive the security context.
840 * Allocate a security structure to the xp->security field; the security 841 * Allocate a security structure to the xp->security field; the security
841 * field is initialized to NULL when the xfrm_policy is allocated. Only 842 * field is initialized to NULL when the xfrm_policy is allocated.
842 * one of sec_ctx or sock can be specified.
843 * Return 0 if operation was successful (memory to allocate, legal context) 843 * Return 0 if operation was successful (memory to allocate, legal context)
844 * @xfrm_policy_clone_security: 844 * @xfrm_policy_clone_security:
845 * @old contains an existing xfrm_policy in the SPD. 845 * @old contains an existing xfrm_policy in the SPD.
@@ -858,9 +858,6 @@ struct request_sock;
858 * Database by the XFRM system. 858 * Database by the XFRM system.
859 * @sec_ctx contains the security context information being provided by 859 * @sec_ctx contains the security context information being provided by
860 * the user-level SA generation program (e.g., setkey or racoon). 860 * the user-level SA generation program (e.g., setkey or racoon).
861 * @polsec contains the security context information associated with a xfrm
862 * policy rule from which to take the base context. polsec must be NULL
863 * when sec_ctx is specified.
864 * @secid contains the secid from which to take the mls portion of the context. 861 * @secid contains the secid from which to take the mls portion of the context.
865 * Allocate a security structure to the x->security field; the security 862 * Allocate a security structure to the x->security field; the security
866 * field is initialized to NULL when the xfrm_state is allocated. Set the 863 * field is initialized to NULL when the xfrm_state is allocated. Set the
@@ -889,11 +886,6 @@ struct request_sock;
889 * @xp contains the policy to check for a match. 886 * @xp contains the policy to check for a match.
890 * @fl contains the flow to check for a match. 887 * @fl contains the flow to check for a match.
891 * Return 1 if there is a match. 888 * Return 1 if there is a match.
892 * @xfrm_flow_state_match:
893 * @fl contains the flow key to match.
894 * @xfrm points to the xfrm_state to match.
895 * @xp points to the xfrm_policy to match.
896 * Return 1 if there is a match.
897 * @xfrm_decode_session: 889 * @xfrm_decode_session:
898 * @skb points to skb to decode. 890 * @skb points to skb to decode.
899 * @secid points to the flow key secid to set. 891 * @secid points to the flow key secid to set.
@@ -1373,25 +1365,24 @@ struct security_operations {
1373 int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb, 1365 int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb,
1374 struct request_sock *req); 1366 struct request_sock *req);
1375 void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req); 1367 void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req);
1368 void (*inet_conn_established)(struct sock *sk, struct sk_buff *skb);
1376 void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl); 1369 void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl);
1377#endif /* CONFIG_SECURITY_NETWORK */ 1370#endif /* CONFIG_SECURITY_NETWORK */
1378 1371
1379#ifdef CONFIG_SECURITY_NETWORK_XFRM 1372#ifdef CONFIG_SECURITY_NETWORK_XFRM
1380 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, 1373 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp,
1381 struct xfrm_user_sec_ctx *sec_ctx, struct sock *sk); 1374 struct xfrm_user_sec_ctx *sec_ctx);
1382 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1375 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1383 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1376 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1384 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); 1377 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
1385 int (*xfrm_state_alloc_security) (struct xfrm_state *x, 1378 int (*xfrm_state_alloc_security) (struct xfrm_state *x,
1386 struct xfrm_user_sec_ctx *sec_ctx, struct xfrm_sec_ctx *polsec, 1379 struct xfrm_user_sec_ctx *sec_ctx,
1387 u32 secid); 1380 u32 secid);
1388 void (*xfrm_state_free_security) (struct xfrm_state *x); 1381 void (*xfrm_state_free_security) (struct xfrm_state *x);
1389 int (*xfrm_state_delete_security) (struct xfrm_state *x); 1382 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1390 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir); 1383 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir);
1391 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x, 1384 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x,
1392 struct xfrm_policy *xp, struct flowi *fl); 1385 struct xfrm_policy *xp, struct flowi *fl);
1393 int (*xfrm_flow_state_match)(struct flowi *fl, struct xfrm_state *xfrm,
1394 struct xfrm_policy *xp);
1395 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall); 1386 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall);
1396#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1387#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1397 1388
@@ -2966,9 +2957,15 @@ static inline void security_inet_csk_clone(struct sock *newsk,
2966{ 2957{
2967 security_ops->inet_csk_clone(newsk, req); 2958 security_ops->inet_csk_clone(newsk, req);
2968} 2959}
2960
2961static inline void security_inet_conn_established(struct sock *sk,
2962 struct sk_buff *skb)
2963{
2964 security_ops->inet_conn_established(sk, skb);
2965}
2969#else /* CONFIG_SECURITY_NETWORK */ 2966#else /* CONFIG_SECURITY_NETWORK */
2970static inline int security_unix_stream_connect(struct socket * sock, 2967static inline int security_unix_stream_connect(struct socket * sock,
2971 struct socket * other, 2968 struct socket * other,
2972 struct sock * newsk) 2969 struct sock * newsk)
2973{ 2970{
2974 return 0; 2971 return 0;
@@ -3115,12 +3112,17 @@ static inline void security_inet_csk_clone(struct sock *newsk,
3115 const struct request_sock *req) 3112 const struct request_sock *req)
3116{ 3113{
3117} 3114}
3115
3116static inline void security_inet_conn_established(struct sock *sk,
3117 struct sk_buff *skb)
3118{
3119}
3118#endif /* CONFIG_SECURITY_NETWORK */ 3120#endif /* CONFIG_SECURITY_NETWORK */
3119 3121
3120#ifdef CONFIG_SECURITY_NETWORK_XFRM 3122#ifdef CONFIG_SECURITY_NETWORK_XFRM
3121static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) 3123static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
3122{ 3124{
3123 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx, NULL); 3125 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx);
3124} 3126}
3125 3127
3126static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) 3128static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
@@ -3141,7 +3143,7 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
3141static inline int security_xfrm_state_alloc(struct xfrm_state *x, 3143static inline int security_xfrm_state_alloc(struct xfrm_state *x,
3142 struct xfrm_user_sec_ctx *sec_ctx) 3144 struct xfrm_user_sec_ctx *sec_ctx)
3143{ 3145{
3144 return security_ops->xfrm_state_alloc_security(x, sec_ctx, NULL, 0); 3146 return security_ops->xfrm_state_alloc_security(x, sec_ctx, 0);
3145} 3147}
3146 3148
3147static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x, 3149static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
@@ -3149,7 +3151,11 @@ static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
3149{ 3151{
3150 if (!polsec) 3152 if (!polsec)
3151 return 0; 3153 return 0;
3152 return security_ops->xfrm_state_alloc_security(x, NULL, polsec, secid); 3154 /*
3155 * We want the context to be taken from secid which is usually
3156 * from the sock.
3157 */
3158 return security_ops->xfrm_state_alloc_security(x, NULL, secid);
3153} 3159}
3154 3160
3155static inline int security_xfrm_state_delete(struct xfrm_state *x) 3161static inline int security_xfrm_state_delete(struct xfrm_state *x)
@@ -3173,12 +3179,6 @@ static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3173 return security_ops->xfrm_state_pol_flow_match(x, xp, fl); 3179 return security_ops->xfrm_state_pol_flow_match(x, xp, fl);
3174} 3180}
3175 3181
3176static inline int security_xfrm_flow_state_match(struct flowi *fl,
3177 struct xfrm_state *xfrm, struct xfrm_policy *xp)
3178{
3179 return security_ops->xfrm_flow_state_match(fl, xfrm, xp);
3180}
3181
3182static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) 3182static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3183{ 3183{
3184 return security_ops->xfrm_decode_session(skb, secid, 1); 3184 return security_ops->xfrm_decode_session(skb, secid, 1);
@@ -3242,12 +3242,6 @@ static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3242 return 1; 3242 return 1;
3243} 3243}
3244 3244
3245static inline int security_xfrm_flow_state_match(struct flowi *fl,
3246 struct xfrm_state *xfrm, struct xfrm_policy *xp)
3247{
3248 return 1;
3249}
3250
3251static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid) 3245static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3252{ 3246{
3253 return 0; 3247 return 0;
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 3a697cc6ecae..b99c5ca9708d 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -41,6 +41,7 @@ struct serio {
41 void (*stop)(struct serio *); 41 void (*stop)(struct serio *);
42 42
43 struct serio *parent, *child; 43 struct serio *parent, *child;
44 unsigned int depth; /* level of nesting in serio hierarchy */
44 45
45 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */ 46 struct serio_driver *drv; /* accessed from interrupt, must be protected by serio->lock and serio->sem */
46 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ 47 struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 85577a4ffa61..14ec16d2d9ba 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -139,7 +139,7 @@ struct skb_shared_info {
139 /* Warning: this field is not always filled in (UFO)! */ 139 /* Warning: this field is not always filled in (UFO)! */
140 unsigned short gso_segs; 140 unsigned short gso_segs;
141 unsigned short gso_type; 141 unsigned short gso_type;
142 unsigned int ip6_frag_id; 142 __be32 ip6_frag_id;
143 struct sk_buff *frag_list; 143 struct sk_buff *frag_list;
144 skb_frag_t frags[MAX_SKB_FRAGS]; 144 skb_frag_t frags[MAX_SKB_FRAGS];
145}; 145};
@@ -216,7 +216,7 @@ enum {
216 * @tail: Tail pointer 216 * @tail: Tail pointer
217 * @end: End pointer 217 * @end: End pointer
218 * @destructor: Destruct function 218 * @destructor: Destruct function
219 * @nfmark: Can be used for communication between hooks 219 * @mark: Generic packet mark
220 * @nfct: Associated connection, if any 220 * @nfct: Associated connection, if any
221 * @ipvs_property: skbuff is owned by ipvs 221 * @ipvs_property: skbuff is owned by ipvs
222 * @nfctinfo: Relationship of this skb to the connection 222 * @nfctinfo: Relationship of this skb to the connection
@@ -273,8 +273,11 @@ struct sk_buff {
273 273
274 unsigned int len, 274 unsigned int len,
275 data_len, 275 data_len,
276 mac_len, 276 mac_len;
277 csum; 277 union {
278 __wsum csum;
279 __u32 csum_offset;
280 };
278 __u32 priority; 281 __u32 priority;
279 __u8 local_df:1, 282 __u8 local_df:1,
280 cloned:1, 283 cloned:1,
@@ -295,7 +298,6 @@ struct sk_buff {
295#ifdef CONFIG_BRIDGE_NETFILTER 298#ifdef CONFIG_BRIDGE_NETFILTER
296 struct nf_bridge_info *nf_bridge; 299 struct nf_bridge_info *nf_bridge;
297#endif 300#endif
298 __u32 nfmark;
299#endif /* CONFIG_NETFILTER */ 301#endif /* CONFIG_NETFILTER */
300#ifdef CONFIG_NET_SCHED 302#ifdef CONFIG_NET_SCHED
301 __u16 tc_index; /* traffic control index */ 303 __u16 tc_index; /* traffic control index */
@@ -310,6 +312,7 @@ struct sk_buff {
310 __u32 secmark; 312 __u32 secmark;
311#endif 313#endif
312 314
315 __u32 mark;
313 316
314 /* These elements must be at the end, see alloc_skb() for details. */ 317 /* These elements must be at the end, see alloc_skb() for details. */
315 unsigned int truesize; 318 unsigned int truesize;
@@ -1199,8 +1202,7 @@ static inline int skb_add_data(struct sk_buff *skb,
1199 1202
1200 if (skb->ip_summed == CHECKSUM_NONE) { 1203 if (skb->ip_summed == CHECKSUM_NONE) {
1201 int err = 0; 1204 int err = 0;
1202 unsigned int csum = csum_and_copy_from_user(from, 1205 __wsum csum = csum_and_copy_from_user(from, skb_put(skb, copy),
1203 skb_put(skb, copy),
1204 copy, 0, &err); 1206 copy, 0, &err);
1205 if (!err) { 1207 if (!err) {
1206 skb->csum = csum_block_add(skb->csum, csum, off); 1208 skb->csum = csum_block_add(skb->csum, csum, off);
@@ -1335,15 +1337,15 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1335extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1337extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
1336extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb, 1338extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb,
1337 unsigned int flags); 1339 unsigned int flags);
1338extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, 1340extern __wsum skb_checksum(const struct sk_buff *skb, int offset,
1339 int len, unsigned int csum); 1341 int len, __wsum csum);
1340extern int skb_copy_bits(const struct sk_buff *skb, int offset, 1342extern int skb_copy_bits(const struct sk_buff *skb, int offset,
1341 void *to, int len); 1343 void *to, int len);
1342extern int skb_store_bits(const struct sk_buff *skb, int offset, 1344extern int skb_store_bits(const struct sk_buff *skb, int offset,
1343 void *from, int len); 1345 void *from, int len);
1344extern unsigned int skb_copy_and_csum_bits(const struct sk_buff *skb, 1346extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb,
1345 int offset, u8 *to, int len, 1347 int offset, u8 *to, int len,
1346 unsigned int csum); 1348 __wsum csum);
1347extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); 1349extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to);
1348extern void skb_split(struct sk_buff *skb, 1350extern void skb_split(struct sk_buff *skb,
1349 struct sk_buff *skb1, const u32 len); 1351 struct sk_buff *skb1, const u32 len);
@@ -1399,7 +1401,7 @@ static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *
1399 1401
1400extern void __net_timestamp(struct sk_buff *skb); 1402extern void __net_timestamp(struct sk_buff *skb);
1401 1403
1402extern unsigned int __skb_checksum_complete(struct sk_buff *skb); 1404extern __sum16 __skb_checksum_complete(struct sk_buff *skb);
1403 1405
1404/** 1406/**
1405 * skb_checksum_complete - Calculate checksum of an entire packet 1407 * skb_checksum_complete - Calculate checksum of an entire packet
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 361409094649..92cd38efad7f 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -264,6 +264,7 @@ struct ucred {
264#define SOL_IPV6 41 264#define SOL_IPV6 41
265#define SOL_ICMPV6 58 265#define SOL_ICMPV6 58
266#define SOL_SCTP 132 266#define SOL_SCTP 132
267#define SOL_UDPLITE 136 /* UDP-Lite (RFC 3828) */
267#define SOL_RAW 255 268#define SOL_RAW 255
268#define SOL_IPX 256 269#define SOL_IPX 256
269#define SOL_AX25 257 270#define SOL_AX25 257
@@ -292,7 +293,7 @@ extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov,
292extern int csum_partial_copy_fromiovecend(unsigned char *kdata, 293extern int csum_partial_copy_fromiovecend(unsigned char *kdata,
293 struct iovec *iov, 294 struct iovec *iov,
294 int offset, 295 int offset,
295 unsigned int len, int *csump); 296 unsigned int len, __wsum *csump);
296 297
297extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode); 298extern int verify_iovec(struct msghdr *m, struct iovec *iov, char *address, int mode);
298extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); 299extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len);
diff --git a/include/linux/sockios.h b/include/linux/sockios.h
index e6b9d1d36ea2..abef7596655a 100644
--- a/include/linux/sockios.h
+++ b/include/linux/sockios.h
@@ -72,8 +72,8 @@
72#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */ 72#define SIOCGIFTXQLEN 0x8942 /* Get the tx queue length */
73#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */ 73#define SIOCSIFTXQLEN 0x8943 /* Set the tx queue length */
74 74
75#define SIOCGIFDIVERT 0x8944 /* Frame diversion support */ 75/* SIOCGIFDIVERT was: 0x8944 Frame diversion support */
76#define SIOCSIFDIVERT 0x8945 /* Set frame diversion options */ 76/* SIOCSIFDIVERT was: 0x8945 Set frame diversion options */
77 77
78#define SIOCETHTOOL 0x8946 /* Ethtool interface */ 78#define SIOCETHTOOL 0x8946 /* Ethtool interface */
79 79
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index b800d2d68b32..8451052ca66f 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -183,13 +183,27 @@ do { \
183#define read_lock(lock) _read_lock(lock) 183#define read_lock(lock) _read_lock(lock)
184 184
185#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 185#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
186
186#define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock) 187#define spin_lock_irqsave(lock, flags) flags = _spin_lock_irqsave(lock)
187#define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock) 188#define read_lock_irqsave(lock, flags) flags = _read_lock_irqsave(lock)
188#define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock) 189#define write_lock_irqsave(lock, flags) flags = _write_lock_irqsave(lock)
190
191#ifdef CONFIG_DEBUG_LOCK_ALLOC
192#define spin_lock_irqsave_nested(lock, flags, subclass) \
193 flags = _spin_lock_irqsave_nested(lock, subclass)
194#else
195#define spin_lock_irqsave_nested(lock, flags, subclass) \
196 flags = _spin_lock_irqsave(lock)
197#endif
198
189#else 199#else
200
190#define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags) 201#define spin_lock_irqsave(lock, flags) _spin_lock_irqsave(lock, flags)
191#define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags) 202#define read_lock_irqsave(lock, flags) _read_lock_irqsave(lock, flags)
192#define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags) 203#define write_lock_irqsave(lock, flags) _write_lock_irqsave(lock, flags)
204#define spin_lock_irqsave_nested(lock, flags, subclass) \
205 spin_lock_irqsave(lock, flags)
206
193#endif 207#endif
194 208
195#define spin_lock_irq(lock) _spin_lock_irq(lock) 209#define spin_lock_irq(lock) _spin_lock_irq(lock)
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h
index 8828b8155e9c..8a2307ce7296 100644
--- a/include/linux/spinlock_api_smp.h
+++ b/include/linux/spinlock_api_smp.h
@@ -32,6 +32,8 @@ void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock);
32void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); 32void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock);
33unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) 33unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock)
34 __acquires(lock); 34 __acquires(lock);
35unsigned long __lockfunc _spin_lock_irqsave_nested(spinlock_t *lock, int subclass)
36 __acquires(lock);
35unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) 37unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock)
36 __acquires(lock); 38 __acquires(lock);
37unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) 39unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock)
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h
index 1e65f2dd80e5..606cb2165232 100644
--- a/include/linux/sunrpc/msg_prot.h
+++ b/include/linux/sunrpc/msg_prot.h
@@ -56,7 +56,9 @@ enum rpc_accept_stat {
56 RPC_PROG_MISMATCH = 2, 56 RPC_PROG_MISMATCH = 2,
57 RPC_PROC_UNAVAIL = 3, 57 RPC_PROC_UNAVAIL = 3,
58 RPC_GARBAGE_ARGS = 4, 58 RPC_GARBAGE_ARGS = 4,
59 RPC_SYSTEM_ERR = 5 59 RPC_SYSTEM_ERR = 5,
60 /* internal use only */
61 RPC_DROP_REPLY = 60000,
60}; 62};
61 63
62enum rpc_reject_stat { 64enum rpc_reject_stat {
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 9c9a8ad92477..965d6c20086e 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -335,7 +335,7 @@ struct svc_version {
335/* 335/*
336 * RPC procedure info 336 * RPC procedure info
337 */ 337 */
338typedef int (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp); 338typedef __be32 (*svc_procfunc)(struct svc_rqst *, void *argp, void *resp);
339struct svc_procedure { 339struct svc_procedure {
340 svc_procfunc pc_func; /* process the request */ 340 svc_procfunc pc_func; /* process the request */
341 kxdrproc_t pc_decode; /* XDR decode args */ 341 kxdrproc_t pc_decode; /* XDR decode args */
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 953723b09bc6..9a527c364394 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -74,6 +74,7 @@ struct xdr_buf {
74#define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL) 74#define rpc_proc_unavail __constant_htonl(RPC_PROC_UNAVAIL)
75#define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS) 75#define rpc_garbage_args __constant_htonl(RPC_GARBAGE_ARGS)
76#define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR) 76#define rpc_system_err __constant_htonl(RPC_SYSTEM_ERR)
77#define rpc_drop_reply __constant_htonl(RPC_DROP_REPLY)
77 78
78#define rpc_auth_ok __constant_htonl(RPC_AUTH_OK) 79#define rpc_auth_ok __constant_htonl(RPC_AUTH_OK)
79#define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED) 80#define rpc_autherr_badcred __constant_htonl(RPC_AUTH_BADCRED)
@@ -150,7 +151,7 @@ typedef struct {
150 struct sk_buff *skb; 151 struct sk_buff *skb;
151 unsigned int offset; 152 unsigned int offset;
152 size_t count; 153 size_t count;
153 unsigned int csum; 154 __wsum csum;
154} skb_reader_t; 155} skb_reader_t;
155 156
156typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len); 157typedef size_t (*skb_read_actor_t)(skb_reader_t *desc, void *to, size_t len);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 1b24bd45e080..94316a98e0d0 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -6,10 +6,17 @@
6 **************************************************************** 6 ****************************************************************
7 **************************************************************** 7 ****************************************************************
8 ** 8 **
9 ** WARNING:
9 ** The values in this file are exported to user space via 10 ** The values in this file are exported to user space via
10 ** the sysctl() binary interface. However this interface 11 ** the sysctl() binary interface. Do *NOT* change the
11 ** is unstable and deprecated and will be removed in the future. 12 ** numbering of any existing values here, and do not change
12 ** For a stable interface use /proc/sys. 13 ** any numbers within any one set of values. If you have to
14 ** have to redefine an existing interface, use a new number for it.
15 ** The kernel will then return -ENOTDIR to any application using
16 ** the old binary interface.
17 **
18 ** For new interfaces unless you really need a binary number
19 ** please use CTL_UNNUMBERED.
13 ** 20 **
14 **************************************************************** 21 ****************************************************************
15 **************************************************************** 22 ****************************************************************
@@ -48,6 +55,7 @@ struct __sysctl_args {
48#ifdef __KERNEL__ 55#ifdef __KERNEL__
49#define CTL_ANY -1 /* Matches any name */ 56#define CTL_ANY -1 /* Matches any name */
50#define CTL_NONE 0 57#define CTL_NONE 0
58#define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */
51#endif 59#endif
52 60
53enum 61enum
@@ -418,6 +426,8 @@ enum
418 NET_CIPSOV4_CACHE_BUCKET_SIZE=119, 426 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
419 NET_CIPSOV4_RBM_OPTFMT=120, 427 NET_CIPSOV4_RBM_OPTFMT=120,
420 NET_CIPSOV4_RBM_STRICTVALID=121, 428 NET_CIPSOV4_RBM_STRICTVALID=121,
429 NET_TCP_AVAIL_CONG_CONTROL=122,
430 NET_TCP_ALLOWED_CONG_CONTROL=123,
421}; 431};
422 432
423enum { 433enum {
@@ -596,16 +606,6 @@ enum {
596 NET_DCCP_DEFAULT=1, 606 NET_DCCP_DEFAULT=1,
597}; 607};
598 608
599/* /proc/sys/net/dccp/default */
600enum {
601 NET_DCCP_DEFAULT_SEQ_WINDOW = 1,
602 NET_DCCP_DEFAULT_RX_CCID = 2,
603 NET_DCCP_DEFAULT_TX_CCID = 3,
604 NET_DCCP_DEFAULT_ACK_RATIO = 4,
605 NET_DCCP_DEFAULT_SEND_ACKVEC = 5,
606 NET_DCCP_DEFAULT_SEND_NDP = 6,
607};
608
609/* /proc/sys/net/ipx */ 609/* /proc/sys/net/ipx */
610enum { 610enum {
611 NET_IPX_PPROP_BROADCASTING=1, 611 NET_IPX_PPROP_BROADCASTING=1,
@@ -961,8 +961,8 @@ extern ctl_handler sysctl_ms_jiffies;
961/* 961/*
962 * Register a set of sysctl names by calling register_sysctl_table 962 * Register a set of sysctl names by calling register_sysctl_table
963 * with an initialised array of ctl_table's. An entry with zero 963 * with an initialised array of ctl_table's. An entry with zero
964 * ctl_name terminates the table. table->de will be set up by the 964 * ctl_name and NULL procname terminates the table. table->de will be
965 * registration and need not be initialised in advance. 965 * set up by the registration and need not be initialised in advance.
966 * 966 *
967 * sysctl names can be mirrored automatically under /proc/sys. The 967 * sysctl names can be mirrored automatically under /proc/sys. The
968 * procname supplied controls /proc naming. 968 * procname supplied controls /proc naming.
@@ -973,7 +973,10 @@ extern ctl_handler sysctl_ms_jiffies;
973 * Leaf nodes in the sysctl tree will be represented by a single file 973 * Leaf nodes in the sysctl tree will be represented by a single file
974 * under /proc; non-leaf nodes will be represented by directories. A 974 * under /proc; non-leaf nodes will be represented by directories. A
975 * null procname disables /proc mirroring at this node. 975 * null procname disables /proc mirroring at this node.
976 * 976 *
977 * sysctl entries with a zero ctl_name will not be available through
978 * the binary sysctl interface.
979 *
977 * sysctl(2) can automatically manage read and write requests through 980 * sysctl(2) can automatically manage read and write requests through
978 * the sysctl table. The data and maxlen fields of the ctl_table 981 * the sysctl table. The data and maxlen fields of the ctl_table
979 * struct enable minimal validation of the values being written to be 982 * struct enable minimal validation of the values being written to be
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 6d5c43d31dec..2129d1b6c874 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -97,6 +97,9 @@ extern int __must_check
97sysfs_rename_dir(struct kobject *, const char *new_name); 97sysfs_rename_dir(struct kobject *, const char *new_name);
98 98
99extern int __must_check 99extern int __must_check
100sysfs_move_dir(struct kobject *, struct kobject *);
101
102extern int __must_check
100sysfs_create_file(struct kobject *, const struct attribute *); 103sysfs_create_file(struct kobject *, const struct attribute *);
101 104
102extern int __must_check 105extern int __must_check
@@ -142,6 +145,11 @@ static inline int sysfs_rename_dir(struct kobject * k, const char *new_name)
142 return 0; 145 return 0;
143} 146}
144 147
148static inline int sysfs_move_dir(struct kobject * k, struct kobject * new_parent)
149{
150 return 0;
151}
152
145static inline int sysfs_create_file(struct kobject * k, const struct attribute * a) 153static inline int sysfs_create_file(struct kobject * k, const struct attribute * a)
146{ 154{
147 return 0; 155 return 0;
diff --git a/include/linux/taskstats_kern.h b/include/linux/taskstats_kern.h
index 16894b7edcc8..6562a2050a25 100644
--- a/include/linux/taskstats_kern.h
+++ b/include/linux/taskstats_kern.h
@@ -23,25 +23,26 @@ static inline void taskstats_exit_free(struct taskstats *tidstats)
23 23
24static inline void taskstats_tgid_init(struct signal_struct *sig) 24static inline void taskstats_tgid_init(struct signal_struct *sig)
25{ 25{
26 spin_lock_init(&sig->stats_lock);
27 sig->stats = NULL; 26 sig->stats = NULL;
28} 27}
29 28
30static inline void taskstats_tgid_alloc(struct signal_struct *sig) 29static inline void taskstats_tgid_alloc(struct task_struct *tsk)
31{ 30{
31 struct signal_struct *sig = tsk->signal;
32 struct taskstats *stats; 32 struct taskstats *stats;
33 unsigned long flags;
34 33
35 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL); 34 if (sig->stats != NULL)
36 if (!stats)
37 return; 35 return;
38 36
39 spin_lock_irqsave(&sig->stats_lock, flags); 37 /* No problem if kmem_cache_zalloc() fails */
38 stats = kmem_cache_zalloc(taskstats_cache, SLAB_KERNEL);
39
40 spin_lock_irq(&tsk->sighand->siglock);
40 if (!sig->stats) { 41 if (!sig->stats) {
41 sig->stats = stats; 42 sig->stats = stats;
42 stats = NULL; 43 stats = NULL;
43 } 44 }
44 spin_unlock_irqrestore(&sig->stats_lock, flags); 45 spin_unlock_irq(&tsk->sighand->siglock);
45 46
46 if (stats) 47 if (stats)
47 kmem_cache_free(taskstats_cache, stats); 48 kmem_cache_free(taskstats_cache, stats);
@@ -49,23 +50,13 @@ static inline void taskstats_tgid_alloc(struct signal_struct *sig)
49 50
50static inline void taskstats_tgid_free(struct signal_struct *sig) 51static inline void taskstats_tgid_free(struct signal_struct *sig)
51{ 52{
52 struct taskstats *stats = NULL; 53 if (sig->stats)
53 unsigned long flags; 54 kmem_cache_free(taskstats_cache, sig->stats);
54
55 spin_lock_irqsave(&sig->stats_lock, flags);
56 if (sig->stats) {
57 stats = sig->stats;
58 sig->stats = NULL;
59 }
60 spin_unlock_irqrestore(&sig->stats_lock, flags);
61 if (stats)
62 kmem_cache_free(taskstats_cache, stats);
63} 55}
64 56
65extern void taskstats_exit_alloc(struct taskstats **, unsigned int *); 57extern void taskstats_exit_alloc(struct taskstats **, unsigned int *);
66extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int); 58extern void taskstats_exit_send(struct task_struct *, struct taskstats *, int, unsigned int);
67extern void taskstats_init_early(void); 59extern void taskstats_init_early(void);
68extern void taskstats_tgid_alloc(struct signal_struct *);
69#else 60#else
70static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu) 61static inline void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu)
71{} 62{}
@@ -77,7 +68,7 @@ static inline void taskstats_exit_send(struct task_struct *tsk,
77{} 68{}
78static inline void taskstats_tgid_init(struct signal_struct *sig) 69static inline void taskstats_tgid_init(struct signal_struct *sig)
79{} 70{}
80static inline void taskstats_tgid_alloc(struct signal_struct *sig) 71static inline void taskstats_tgid_alloc(struct task_struct *tsk)
81{} 72{}
82static inline void taskstats_tgid_free(struct signal_struct *sig) 73static inline void taskstats_tgid_free(struct signal_struct *sig)
83{} 74{}
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 0e058a2d1c6d..3cc70d1a3504 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -19,6 +19,7 @@
19 19
20#include <linux/types.h> 20#include <linux/types.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22#include <linux/socket.h>
22 23
23struct tcphdr { 24struct tcphdr {
24 __be16 source; 25 __be16 source;
@@ -51,7 +52,7 @@ struct tcphdr {
51#error "Adjust your <asm/byteorder.h> defines" 52#error "Adjust your <asm/byteorder.h> defines"
52#endif 53#endif
53 __be16 window; 54 __be16 window;
54 __be16 check; 55 __sum16 check;
55 __be16 urg_ptr; 56 __be16 urg_ptr;
56}; 57};
57 58
@@ -94,6 +95,7 @@ enum {
94#define TCP_INFO 11 /* Information about this connection. */ 95#define TCP_INFO 11 /* Information about this connection. */
95#define TCP_QUICKACK 12 /* Block/reenable quick acks */ 96#define TCP_QUICKACK 12 /* Block/reenable quick acks */
96#define TCP_CONGESTION 13 /* Congestion control algorithm */ 97#define TCP_CONGESTION 13 /* Congestion control algorithm */
98#define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */
97 99
98#define TCPI_OPT_TIMESTAMPS 1 100#define TCPI_OPT_TIMESTAMPS 1
99#define TCPI_OPT_SACK 2 101#define TCPI_OPT_SACK 2
@@ -157,6 +159,17 @@ struct tcp_info
157 __u32 tcpi_total_retrans; 159 __u32 tcpi_total_retrans;
158}; 160};
159 161
162/* for TCP_MD5SIG socket option */
163#define TCP_MD5SIG_MAXKEYLEN 80
164
165struct tcp_md5sig {
166 struct __kernel_sockaddr_storage tcpm_addr; /* address associated */
167 __u16 __tcpm_pad1; /* zero */
168 __u16 tcpm_keylen; /* key length */
169 __u32 __tcpm_pad2; /* zero */
170 __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */
171};
172
160#ifdef __KERNEL__ 173#ifdef __KERNEL__
161 174
162#include <linux/skbuff.h> 175#include <linux/skbuff.h>
@@ -172,17 +185,17 @@ struct tcp_sack_block_wire {
172}; 185};
173 186
174struct tcp_sack_block { 187struct tcp_sack_block {
175 __u32 start_seq; 188 u32 start_seq;
176 __u32 end_seq; 189 u32 end_seq;
177}; 190};
178 191
179struct tcp_options_received { 192struct tcp_options_received {
180/* PAWS/RTTM data */ 193/* PAWS/RTTM data */
181 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */ 194 long ts_recent_stamp;/* Time we stored ts_recent (for aging) */
182 __u32 ts_recent; /* Time stamp to echo next */ 195 u32 ts_recent; /* Time stamp to echo next */
183 __u32 rcv_tsval; /* Time stamp value */ 196 u32 rcv_tsval; /* Time stamp value */
184 __u32 rcv_tsecr; /* Time stamp echo reply */ 197 u32 rcv_tsecr; /* Time stamp echo reply */
185 __u16 saw_tstamp : 1, /* Saw TIMESTAMP on last packet */ 198 u16 saw_tstamp : 1, /* Saw TIMESTAMP on last packet */
186 tstamp_ok : 1, /* TIMESTAMP seen on SYN packet */ 199 tstamp_ok : 1, /* TIMESTAMP seen on SYN packet */
187 dsack : 1, /* D-SACK is scheduled */ 200 dsack : 1, /* D-SACK is scheduled */
188 wscale_ok : 1, /* Wscale seen on SYN packet */ 201 wscale_ok : 1, /* Wscale seen on SYN packet */
@@ -190,16 +203,20 @@ struct tcp_options_received {
190 snd_wscale : 4, /* Window scaling received from sender */ 203 snd_wscale : 4, /* Window scaling received from sender */
191 rcv_wscale : 4; /* Window scaling to send to receiver */ 204 rcv_wscale : 4; /* Window scaling to send to receiver */
192/* SACKs data */ 205/* SACKs data */
193 __u8 eff_sacks; /* Size of SACK array to send with next packet */ 206 u8 eff_sacks; /* Size of SACK array to send with next packet */
194 __u8 num_sacks; /* Number of SACK blocks */ 207 u8 num_sacks; /* Number of SACK blocks */
195 __u16 user_mss; /* mss requested by user in ioctl */ 208 u16 user_mss; /* mss requested by user in ioctl */
196 __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ 209 u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
197}; 210};
198 211
199struct tcp_request_sock { 212struct tcp_request_sock {
200 struct inet_request_sock req; 213 struct inet_request_sock req;
201 __u32 rcv_isn; 214#ifdef CONFIG_TCP_MD5SIG
202 __u32 snt_isn; 215 /* Only used by TCP MD5 Signature so far. */
216 struct tcp_request_sock_ops *af_specific;
217#endif
218 u32 rcv_isn;
219 u32 snt_isn;
203}; 220};
204 221
205static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 222static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
@@ -210,7 +227,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
210struct tcp_sock { 227struct tcp_sock {
211 /* inet_connection_sock has to be the first member of tcp_sock */ 228 /* inet_connection_sock has to be the first member of tcp_sock */
212 struct inet_connection_sock inet_conn; 229 struct inet_connection_sock inet_conn;
213 int tcp_header_len; /* Bytes of tcp header to send */ 230 u16 tcp_header_len; /* Bytes of tcp header to send */
231 u16 xmit_size_goal; /* Goal for segmenting output packets */
214 232
215/* 233/*
216 * Header prediction flags 234 * Header prediction flags
@@ -223,13 +241,13 @@ struct tcp_sock {
223 * read the code and the spec side by side (and laugh ...) 241 * read the code and the spec side by side (and laugh ...)
224 * See RFC793 and RFC1122. The RFC writes these in capitals. 242 * See RFC793 and RFC1122. The RFC writes these in capitals.
225 */ 243 */
226 __u32 rcv_nxt; /* What we want to receive next */ 244 u32 rcv_nxt; /* What we want to receive next */
227 __u32 snd_nxt; /* Next sequence we send */ 245 u32 snd_nxt; /* Next sequence we send */
228 246
229 __u32 snd_una; /* First byte we want an ack for */ 247 u32 snd_una; /* First byte we want an ack for */
230 __u32 snd_sml; /* Last byte of the most recently transmitted small packet */ 248 u32 snd_sml; /* Last byte of the most recently transmitted small packet */
231 __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ 249 u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */
232 __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ 250 u32 lsndtime; /* timestamp of last sent data packet (for restart window) */
233 251
234 /* Data for direct copy to user */ 252 /* Data for direct copy to user */
235 struct { 253 struct {
@@ -247,32 +265,30 @@ struct tcp_sock {
247#endif 265#endif
248 } ucopy; 266 } ucopy;
249 267
250 __u32 snd_wl1; /* Sequence for window update */ 268 u32 snd_wl1; /* Sequence for window update */
251 __u32 snd_wnd; /* The window we expect to receive */ 269 u32 snd_wnd; /* The window we expect to receive */
252 __u32 max_window; /* Maximal window ever seen from peer */ 270 u32 max_window; /* Maximal window ever seen from peer */
253 __u32 mss_cache; /* Cached effective mss, not including SACKS */ 271 u32 mss_cache; /* Cached effective mss, not including SACKS */
254 __u16 xmit_size_goal; /* Goal for segmenting output packets */
255 /* XXX Two bytes hole, try to pack */
256 272
257 __u32 window_clamp; /* Maximal window to advertise */ 273 u32 window_clamp; /* Maximal window to advertise */
258 __u32 rcv_ssthresh; /* Current window clamp */ 274 u32 rcv_ssthresh; /* Current window clamp */
259 275
260 __u32 frto_highmark; /* snd_nxt when RTO occurred */ 276 u32 frto_highmark; /* snd_nxt when RTO occurred */
261 __u8 reordering; /* Packet reordering metric. */ 277 u8 reordering; /* Packet reordering metric. */
262 __u8 frto_counter; /* Number of new acks after RTO */ 278 u8 frto_counter; /* Number of new acks after RTO */
263 __u8 nonagle; /* Disable Nagle algorithm? */ 279 u8 nonagle; /* Disable Nagle algorithm? */
264 __u8 keepalive_probes; /* num of allowed keep alive probes */ 280 u8 keepalive_probes; /* num of allowed keep alive probes */
265 281
266/* RTT measurement */ 282/* RTT measurement */
267 __u32 srtt; /* smoothed round trip time << 3 */ 283 u32 srtt; /* smoothed round trip time << 3 */
268 __u32 mdev; /* medium deviation */ 284 u32 mdev; /* medium deviation */
269 __u32 mdev_max; /* maximal mdev for the last rtt period */ 285 u32 mdev_max; /* maximal mdev for the last rtt period */
270 __u32 rttvar; /* smoothed mdev_max */ 286 u32 rttvar; /* smoothed mdev_max */
271 __u32 rtt_seq; /* sequence number to update rttvar */ 287 u32 rtt_seq; /* sequence number to update rttvar */
272 288
273 __u32 packets_out; /* Packets which are "in flight" */ 289 u32 packets_out; /* Packets which are "in flight" */
274 __u32 left_out; /* Packets which leaved network */ 290 u32 left_out; /* Packets which leaved network */
275 __u32 retrans_out; /* Retransmitted packets out */ 291 u32 retrans_out; /* Retransmitted packets out */
276/* 292/*
277 * Options received (usually on last packet, some only on SYN packets). 293 * Options received (usually on last packet, some only on SYN packets).
278 */ 294 */
@@ -281,20 +297,20 @@ struct tcp_sock {
281/* 297/*
282 * Slow start and congestion control (see also Nagle, and Karn & Partridge) 298 * Slow start and congestion control (see also Nagle, and Karn & Partridge)
283 */ 299 */
284 __u32 snd_ssthresh; /* Slow start size threshold */ 300 u32 snd_ssthresh; /* Slow start size threshold */
285 __u32 snd_cwnd; /* Sending congestion window */ 301 u32 snd_cwnd; /* Sending congestion window */
286 __u16 snd_cwnd_cnt; /* Linear increase counter */ 302 u16 snd_cwnd_cnt; /* Linear increase counter */
287 __u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ 303 u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
288 __u32 snd_cwnd_used; 304 u32 snd_cwnd_used;
289 __u32 snd_cwnd_stamp; 305 u32 snd_cwnd_stamp;
290 306
291 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 307 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
292 308
293 __u32 rcv_wnd; /* Current receiver window */ 309 u32 rcv_wnd; /* Current receiver window */
294 __u32 rcv_wup; /* rcv_nxt on last window update sent */ 310 u32 rcv_wup; /* rcv_nxt on last window update sent */
295 __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 311 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
296 __u32 pushed_seq; /* Last pushed seq, required to talk to windows */ 312 u32 pushed_seq; /* Last pushed seq, required to talk to windows */
297 __u32 copied_seq; /* Head of yet unread data */ 313 u32 copied_seq; /* Head of yet unread data */
298 314
299/* SACKs data */ 315/* SACKs data */
300 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ 316 struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */
@@ -315,26 +331,26 @@ struct tcp_sock {
315 int retransmit_cnt_hint; 331 int retransmit_cnt_hint;
316 int forward_cnt_hint; 332 int forward_cnt_hint;
317 333
318 __u16 advmss; /* Advertised MSS */ 334 u16 advmss; /* Advertised MSS */
319 __u16 prior_ssthresh; /* ssthresh saved at recovery start */ 335 u16 prior_ssthresh; /* ssthresh saved at recovery start */
320 __u32 lost_out; /* Lost packets */ 336 u32 lost_out; /* Lost packets */
321 __u32 sacked_out; /* SACK'd packets */ 337 u32 sacked_out; /* SACK'd packets */
322 __u32 fackets_out; /* FACK'd packets */ 338 u32 fackets_out; /* FACK'd packets */
323 __u32 high_seq; /* snd_nxt at onset of congestion */ 339 u32 high_seq; /* snd_nxt at onset of congestion */
324 340
325 __u32 retrans_stamp; /* Timestamp of the last retransmit, 341 u32 retrans_stamp; /* Timestamp of the last retransmit,
326 * also used in SYN-SENT to remember stamp of 342 * also used in SYN-SENT to remember stamp of
327 * the first SYN. */ 343 * the first SYN. */
328 __u32 undo_marker; /* tracking retrans started here. */ 344 u32 undo_marker; /* tracking retrans started here. */
329 int undo_retrans; /* number of undoable retransmissions. */ 345 int undo_retrans; /* number of undoable retransmissions. */
330 __u32 urg_seq; /* Seq of received urgent pointer */ 346 u32 urg_seq; /* Seq of received urgent pointer */
331 __u16 urg_data; /* Saved octet of OOB data and control flags */ 347 u16 urg_data; /* Saved octet of OOB data and control flags */
332 __u8 urg_mode; /* In urgent mode */ 348 u8 urg_mode; /* In urgent mode */
333 __u8 ecn_flags; /* ECN status bits. */ 349 u8 ecn_flags; /* ECN status bits. */
334 __u32 snd_up; /* Urgent pointer */ 350 u32 snd_up; /* Urgent pointer */
335 351
336 __u32 total_retrans; /* Total retransmits for entire connection */ 352 u32 total_retrans; /* Total retransmits for entire connection */
337 __u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ 353 u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */
338 354
339 unsigned int keepalive_time; /* time before keep alive takes place */ 355 unsigned int keepalive_time; /* time before keep alive takes place */
340 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 356 unsigned int keepalive_intvl; /* time interval between keep alive probes */
@@ -342,25 +358,35 @@ struct tcp_sock {
342 358
343 unsigned long last_synq_overflow; 359 unsigned long last_synq_overflow;
344 360
361 u32 tso_deferred;
362
345/* Receiver side RTT estimation */ 363/* Receiver side RTT estimation */
346 struct { 364 struct {
347 __u32 rtt; 365 u32 rtt;
348 __u32 seq; 366 u32 seq;
349 __u32 time; 367 u32 time;
350 } rcv_rtt_est; 368 } rcv_rtt_est;
351 369
352/* Receiver queue space */ 370/* Receiver queue space */
353 struct { 371 struct {
354 int space; 372 int space;
355 __u32 seq; 373 u32 seq;
356 __u32 time; 374 u32 time;
357 } rcvq_space; 375 } rcvq_space;
358 376
359/* TCP-specific MTU probe information. */ 377/* TCP-specific MTU probe information. */
360 struct { 378 struct {
361 __u32 probe_seq_start; 379 u32 probe_seq_start;
362 __u32 probe_seq_end; 380 u32 probe_seq_end;
363 } mtu_probe; 381 } mtu_probe;
382
383#ifdef CONFIG_TCP_MD5SIG
384/* TCP AF-Specific parts; only used by MD5 Signature support so far */
385 struct tcp_sock_af_ops *af_specific;
386
387/* TCP MD5 Signagure Option information */
388 struct tcp_md5sig_info *md5sig_info;
389#endif
364}; 390};
365 391
366static inline struct tcp_sock *tcp_sk(const struct sock *sk) 392static inline struct tcp_sock *tcp_sk(const struct sock *sk)
@@ -370,11 +396,15 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk)
370 396
371struct tcp_timewait_sock { 397struct tcp_timewait_sock {
372 struct inet_timewait_sock tw_sk; 398 struct inet_timewait_sock tw_sk;
373 __u32 tw_rcv_nxt; 399 u32 tw_rcv_nxt;
374 __u32 tw_snd_nxt; 400 u32 tw_snd_nxt;
375 __u32 tw_rcv_wnd; 401 u32 tw_rcv_wnd;
376 __u32 tw_ts_recent; 402 u32 tw_ts_recent;
377 long tw_ts_recent_stamp; 403 long tw_ts_recent_stamp;
404#ifdef CONFIG_TCP_MD5SIG
405 u16 tw_md5_keylen;
406 u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN];
407#endif
378}; 408};
379 409
380static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) 410static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk)
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 7dac8f04d28e..004808a6df1d 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -20,7 +20,7 @@ struct ts_config;
20/** 20/**
21 * struct ts_state - search state 21 * struct ts_state - search state
22 * @offset: offset for next match 22 * @offset: offset for next match
23 * @cb: control buffer, for persistant variables of get_next_block() 23 * @cb: control buffer, for persistent variables of get_next_block()
24 */ 24 */
25struct ts_state 25struct ts_state
26{ 26{
@@ -71,7 +71,7 @@ struct ts_config
71 * Called repeatedly until 0 is returned. Must assign the 71 * Called repeatedly until 0 is returned. Must assign the
72 * head of the next block of data to &*dst and return the length 72 * head of the next block of data to &*dst and return the length
73 * of the block or 0 if at the end. consumed == 0 indicates 73 * of the block or 0 if at the end. consumed == 0 indicates
74 * a new search. May store/read persistant values in state->cb. 74 * a new search. May store/read persistent values in state->cb.
75 */ 75 */
76 unsigned int (*get_next_block)(unsigned int consumed, 76 unsigned int (*get_next_block)(unsigned int consumed,
77 const u8 **dst, 77 const u8 **dst,
diff --git a/include/linux/tfrc.h b/include/linux/tfrc.h
index 7dab7831c3cb..31a9b25276fe 100644
--- a/include/linux/tfrc.h
+++ b/include/linux/tfrc.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_TFRC_H_ 1#ifndef _LINUX_TFRC_H_
2#define _LINUX_TFRC_H_ 2#define _LINUX_TFRC_H_
3/* 3/*
4 * include/linux/tfrc.h 4 * TFRC - Data Structures for the TCP-Friendly Rate Control congestion
5 * control mechanism as specified in RFC 3448.
5 * 6 *
6 * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand. 7 * Copyright (c) 2005 The University of Waikato, Hamilton, New Zealand.
7 * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz> 8 * Copyright (c) 2005 Ian McDonald <iam4@cs.waikato.ac.nz>
@@ -13,15 +14,30 @@
13 * the Free Software Foundation; either version 2 of the License, or 14 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version. 15 * (at your option) any later version.
15 */ 16 */
16
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19/** tfrc_rx_info - TFRC Receiver Data Structure
20 *
21 * @tfrcrx_x_recv: receiver estimate of sending rate (3.2.2)
22 * @tfrcrx_rtt: round-trip-time (communicated by sender)
23 * @tfrcrx_p: current estimate of loss event rate (3.2.2)
24 */
19struct tfrc_rx_info { 25struct tfrc_rx_info {
20 __u32 tfrcrx_x_recv; 26 __u32 tfrcrx_x_recv;
21 __u32 tfrcrx_rtt; 27 __u32 tfrcrx_rtt;
22 __u32 tfrcrx_p; 28 __u32 tfrcrx_p;
23}; 29};
24 30
31/** tfrc_tx_info - TFRC Sender Data Structure
32 *
33 * @tfrctx_x: computed transmit rate (4.3 (4))
34 * @tfrctx_x_recv: receiver estimate of send rate (4.3)
35 * @tfrctx_x_calc: return value of throughput equation (3.1)
36 * @tfrctx_rtt: (moving average) estimate of RTT (4.3)
37 * @tfrctx_p: current loss event rate (5.4)
38 * @tfrctx_rto: estimate of RTO, equals 4*RTT (4.3)
39 * @tfrctx_ipi: inter-packet interval (4.6)
40 */
25struct tfrc_tx_info { 41struct tfrc_tx_info {
26 __u32 tfrctx_x; 42 __u32 tfrctx_x;
27 __u32 tfrctx_x_recv; 43 __u32 tfrctx_x_recv;
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 243a15f54002..bea469455a0c 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -129,6 +129,7 @@ static inline unsigned int tipc_node(__u32 addr)
129 129
130#define TIPC_SUB_PORTS 0x01 /* filter for port availability */ 130#define TIPC_SUB_PORTS 0x01 /* filter for port availability */
131#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */ 131#define TIPC_SUB_SERVICE 0x02 /* filter for service availability */
132#define TIPC_SUB_CANCEL 0x04 /* cancel a subscription */
132#if 0 133#if 0
133/* The following filter options are not currently implemented */ 134/* The following filter options are not currently implemented */
134#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */ 135#define TIPC_SUB_NO_BIND_EVTS 0x04 /* filter out "publish" events */
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 33a653913d94..b0c916d1f375 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -194,34 +194,34 @@
194 194
195 195
196struct tipc_node_info { 196struct tipc_node_info {
197 __u32 addr; /* network address of node */ 197 __be32 addr; /* network address of node */
198 __u32 up; /* 0=down, 1= up */ 198 __be32 up; /* 0=down, 1= up */
199}; 199};
200 200
201struct tipc_link_info { 201struct tipc_link_info {
202 __u32 dest; /* network address of peer node */ 202 __be32 dest; /* network address of peer node */
203 __u32 up; /* 0=down, 1=up */ 203 __be32 up; /* 0=down, 1=up */
204 char str[TIPC_MAX_LINK_NAME]; /* link name */ 204 char str[TIPC_MAX_LINK_NAME]; /* link name */
205}; 205};
206 206
207struct tipc_bearer_config { 207struct tipc_bearer_config {
208 __u32 priority; /* Range [1,31]. Override per link */ 208 __be32 priority; /* Range [1,31]. Override per link */
209 __u32 detect_scope; 209 __be32 detect_scope;
210 char name[TIPC_MAX_BEARER_NAME]; 210 char name[TIPC_MAX_BEARER_NAME];
211}; 211};
212 212
213struct tipc_link_config { 213struct tipc_link_config {
214 __u32 value; 214 __be32 value;
215 char name[TIPC_MAX_LINK_NAME]; 215 char name[TIPC_MAX_LINK_NAME];
216}; 216};
217 217
218#define TIPC_NTQ_ALLTYPES 0x80000000 218#define TIPC_NTQ_ALLTYPES 0x80000000
219 219
220struct tipc_name_table_query { 220struct tipc_name_table_query {
221 __u32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */ 221 __be32 depth; /* 1:type, 2:+name info, 3:+port info, 4+:+debug info */
222 __u32 type; /* {t,l,u} info ignored if high bit of "depth" is set */ 222 __be32 type; /* {t,l,u} info ignored if high bit of "depth" is set */
223 __u32 lowbound; /* (i.e. displays all entries of name table) */ 223 __be32 lowbound; /* (i.e. displays all entries of name table) */
224 __u32 upbound; 224 __be32 upbound;
225}; 225};
226 226
227/* 227/*
@@ -262,8 +262,8 @@ struct tipc_route_info {
262 */ 262 */
263 263
264struct tlv_desc { 264struct tlv_desc {
265 __u16 tlv_len; /* TLV length (descriptor + value) */ 265 __be16 tlv_len; /* TLV length (descriptor + value) */
266 __u16 tlv_type; /* TLV identifier */ 266 __be16 tlv_type; /* TLV identifier */
267}; 267};
268 268
269#define TLV_ALIGNTO 4 269#define TLV_ALIGNTO 4
@@ -377,9 +377,9 @@ struct tipc_genlmsghdr {
377 377
378struct tipc_cfg_msg_hdr 378struct tipc_cfg_msg_hdr
379{ 379{
380 __u32 tcm_len; /* Message length (including header) */ 380 __be32 tcm_len; /* Message length (including header) */
381 __u16 tcm_type; /* Command type */ 381 __be16 tcm_type; /* Command type */
382 __u16 tcm_flags; /* Additional flags */ 382 __be16 tcm_flags; /* Additional flags */
383 char tcm_reserved[8]; /* Unused */ 383 char tcm_reserved[8]; /* Unused */
384}; 384};
385 385
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 44091c0db0b4..65321f911c1e 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -276,9 +276,8 @@ extern int tty_register_ldisc(int disc, struct tty_ldisc *new_ldisc);
276extern int tty_unregister_ldisc(int disc); 276extern int tty_unregister_ldisc(int disc);
277extern int tty_register_driver(struct tty_driver *driver); 277extern int tty_register_driver(struct tty_driver *driver);
278extern int tty_unregister_driver(struct tty_driver *driver); 278extern int tty_unregister_driver(struct tty_driver *driver);
279extern struct class_device *tty_register_device(struct tty_driver *driver, 279extern struct device *tty_register_device(struct tty_driver *driver,
280 unsigned index, 280 unsigned index, struct device *dev);
281 struct device *dev);
282extern void tty_unregister_device(struct tty_driver *driver, unsigned index); 281extern void tty_unregister_device(struct tty_driver *driver, unsigned index);
283extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp, 282extern int tty_read_raw_data(struct tty_struct *tty, unsigned char *bufp,
284 int buflen); 283 int buflen);
diff --git a/include/linux/types.h b/include/linux/types.h
index 750f085fa564..745c409ebbb5 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -128,6 +128,8 @@ typedef __s64 int64_t;
128 128
129/* this is a special 64bit data type that is 8-byte aligned */ 129/* this is a special 64bit data type that is 8-byte aligned */
130#define aligned_u64 unsigned long long __attribute__((aligned(8))) 130#define aligned_u64 unsigned long long __attribute__((aligned(8)))
131#define aligned_be64 __be64 __attribute__((aligned(8)))
132#define aligned_le64 __le64 __attribute__((aligned(8)))
131 133
132/** 134/**
133 * The type used for indexing onto a disc or disc partition. 135 * The type used for indexing onto a disc or disc partition.
@@ -180,6 +182,8 @@ typedef __u32 __bitwise __be32;
180typedef __u64 __bitwise __le64; 182typedef __u64 __bitwise __le64;
181typedef __u64 __bitwise __be64; 183typedef __u64 __bitwise __be64;
182#endif 184#endif
185typedef __u16 __bitwise __sum16;
186typedef __u32 __bitwise __wsum;
183 187
184#ifdef __KERNEL__ 188#ifdef __KERNEL__
185typedef unsigned __bitwise__ gfp_t; 189typedef unsigned __bitwise__ gfp_t;
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 014b41d1e308..7e08c07efe0f 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -23,7 +23,7 @@ struct udphdr {
23 __be16 source; 23 __be16 source;
24 __be16 dest; 24 __be16 dest;
25 __be16 len; 25 __be16 len;
26 __be16 check; 26 __sum16 check;
27}; 27};
28 28
29/* UDP socket options */ 29/* UDP socket options */
@@ -38,6 +38,7 @@ struct udphdr {
38#include <linux/types.h> 38#include <linux/types.h>
39 39
40#include <net/inet_sock.h> 40#include <net/inet_sock.h>
41#define UDP_HTABLE_SIZE 128
41 42
42struct udp_sock { 43struct udp_sock {
43 /* inet_sock has to be the first member */ 44 /* inet_sock has to be the first member */
@@ -50,12 +51,23 @@ struct udp_sock {
50 * when the socket is uncorked. 51 * when the socket is uncorked.
51 */ 52 */
52 __u16 len; /* total length of pending frames */ 53 __u16 len; /* total length of pending frames */
54 /*
55 * Fields specific to UDP-Lite.
56 */
57 __u16 pcslen;
58 __u16 pcrlen;
59/* indicator bits used by pcflag: */
60#define UDPLITE_BIT 0x1 /* set by udplite proto init function */
61#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
62#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
63 __u8 pcflag; /* marks socket as UDP-Lite if > 0 */
53}; 64};
54 65
55static inline struct udp_sock *udp_sk(const struct sock *sk) 66static inline struct udp_sock *udp_sk(const struct sock *sk)
56{ 67{
57 return (struct udp_sock *)sk; 68 return (struct udp_sock *)sk;
58} 69}
70#define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag)
59 71
60#endif 72#endif
61 73
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h
index 61eef508b041..28967eda9d7b 100644
--- a/include/linux/ufs_fs.h
+++ b/include/linux/ufs_fs.h
@@ -908,7 +908,7 @@ struct ufs_super_block_third {
908 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */ 908 __fs64 fs_csaddr; /* blk addr of cyl grp summary area */
909 __fs64 fs_pendingblocks;/* blocks in process of being freed */ 909 __fs64 fs_pendingblocks;/* blocks in process of being freed */
910 __fs32 fs_pendinginodes;/*inodes in process of being freed */ 910 __fs32 fs_pendinginodes;/*inodes in process of being freed */
911 } fs_u2; 911 } __attribute__ ((packed)) fs_u2;
912 } fs_un1; 912 } fs_un1;
913 union { 913 union {
914 struct { 914 struct {
diff --git a/include/linux/unwind.h b/include/linux/unwind.h
index 73e1751d03dd..749928c161fb 100644
--- a/include/linux/unwind.h
+++ b/include/linux/unwind.h
@@ -26,6 +26,7 @@ struct module;
26 * Initialize unwind support. 26 * Initialize unwind support.
27 */ 27 */
28extern void unwind_init(void); 28extern void unwind_init(void);
29extern void unwind_setup(void);
29 30
30#ifdef CONFIG_MODULES 31#ifdef CONFIG_MODULES
31 32
@@ -73,6 +74,7 @@ extern int unwind_to_user(struct unwind_frame_info *);
73struct unwind_frame_info {}; 74struct unwind_frame_info {};
74 75
75static inline void unwind_init(void) {} 76static inline void unwind_init(void) {}
77static inline void unwind_setup(void) {}
76 78
77#ifdef CONFIG_MODULES 79#ifdef CONFIG_MODULES
78 80
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 5482bfb3303d..0cd73edeef13 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -313,8 +313,13 @@ struct usb_bus {
313/* This is arbitrary. 313/* This is arbitrary.
314 * From USB 2.0 spec Table 11-13, offset 7, a hub can 314 * From USB 2.0 spec Table 11-13, offset 7, a hub can
315 * have up to 255 ports. The most yet reported is 10. 315 * have up to 255 ports. The most yet reported is 10.
316 *
317 * Current Wireless USB host hardware (Intel i1480 for example) allows
318 * up to 22 devices to connect. Upcoming hardware might raise that
319 * limit. Because the arrays need to add a bit for hub status data, we
320 * do 31, so plus one evens out to four bytes.
316 */ 321 */
317#define USB_MAXCHILDREN (16) 322#define USB_MAXCHILDREN (31)
318 323
319struct usb_tt; 324struct usb_tt;
320 325
@@ -357,7 +362,8 @@ struct usb_device {
357 u8 portnum; /* Parent port number (origin 1) */ 362 u8 portnum; /* Parent port number (origin 1) */
358 u8 level; /* Number of USB hub ancestors */ 363 u8 level; /* Number of USB hub ancestors */
359 364
360 int have_langid; /* whether string_langid is valid */ 365 unsigned discon_suspended:1; /* Disconnected while suspended */
366 unsigned have_langid:1; /* whether string_langid is valid */
361 int string_langid; /* language ID for strings */ 367 int string_langid; /* language ID for strings */
362 368
363 /* static strings from the device */ 369 /* static strings from the device */
@@ -410,14 +416,37 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
410 416
411/* USB autosuspend and autoresume */ 417/* USB autosuspend and autoresume */
412#ifdef CONFIG_USB_SUSPEND 418#ifdef CONFIG_USB_SUSPEND
419extern int usb_autopm_set_interface(struct usb_interface *intf);
413extern int usb_autopm_get_interface(struct usb_interface *intf); 420extern int usb_autopm_get_interface(struct usb_interface *intf);
414extern void usb_autopm_put_interface(struct usb_interface *intf); 421extern void usb_autopm_put_interface(struct usb_interface *intf);
415 422
423static inline void usb_autopm_enable(struct usb_interface *intf)
424{
425 intf->pm_usage_cnt = 0;
426 usb_autopm_set_interface(intf);
427}
428
429static inline void usb_autopm_disable(struct usb_interface *intf)
430{
431 intf->pm_usage_cnt = 1;
432 usb_autopm_set_interface(intf);
433}
434
416#else 435#else
417#define usb_autopm_get_interface(intf) 0
418#define usb_autopm_put_interface(intf) do {} while (0)
419#endif
420 436
437static inline int usb_autopm_set_interface(struct usb_interface *intf)
438{ return 0; }
439
440static inline int usb_autopm_get_interface(struct usb_interface *intf)
441{ return 0; }
442
443static inline void usb_autopm_put_interface(struct usb_interface *intf)
444{ }
445static inline void usb_autopm_enable(struct usb_interface *intf)
446{ }
447static inline void usb_autopm_disable(struct usb_interface *intf)
448{ }
449#endif
421 450
422/*-------------------------------------------------------------------------*/ 451/*-------------------------------------------------------------------------*/
423 452
@@ -490,17 +519,137 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
490 519
491/*-------------------------------------------------------------------------*/ 520/*-------------------------------------------------------------------------*/
492 521
493extern int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd); 522/**
494extern int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd); 523 * usb_endpoint_dir_in - check if the endpoint has IN direction
495extern int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd); 524 * @epd: endpoint to be checked
496extern int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd); 525 *
497extern int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd); 526 * Returns true if the endpoint is of type IN, otherwise it returns false.
498extern int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd); 527 */
499extern int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd); 528static inline int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd)
500extern int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd); 529{
501extern int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd); 530 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_IN);
502extern int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd); 531}
503extern int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd); 532
533/**
534 * usb_endpoint_dir_out - check if the endpoint has OUT direction
535 * @epd: endpoint to be checked
536 *
537 * Returns true if the endpoint is of type OUT, otherwise it returns false.
538 */
539static inline int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd)
540{
541 return ((epd->bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT);
542}
543
544/**
545 * usb_endpoint_xfer_bulk - check if the endpoint has bulk transfer type
546 * @epd: endpoint to be checked
547 *
548 * Returns true if the endpoint is of type bulk, otherwise it returns false.
549 */
550static inline int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd)
551{
552 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
553 USB_ENDPOINT_XFER_BULK);
554}
555
556/**
557 * usb_endpoint_xfer_int - check if the endpoint has interrupt transfer type
558 * @epd: endpoint to be checked
559 *
560 * Returns true if the endpoint is of type interrupt, otherwise it returns
561 * false.
562 */
563static inline int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd)
564{
565 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
566 USB_ENDPOINT_XFER_INT);
567}
568
569/**
570 * usb_endpoint_xfer_isoc - check if the endpoint has isochronous transfer type
571 * @epd: endpoint to be checked
572 *
573 * Returns true if the endpoint is of type isochronous, otherwise it returns
574 * false.
575 */
576static inline int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd)
577{
578 return ((epd->bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) ==
579 USB_ENDPOINT_XFER_ISOC);
580}
581
582/**
583 * usb_endpoint_is_bulk_in - check if the endpoint is bulk IN
584 * @epd: endpoint to be checked
585 *
586 * Returns true if the endpoint has bulk transfer type and IN direction,
587 * otherwise it returns false.
588 */
589static inline int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd)
590{
591 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd));
592}
593
594/**
595 * usb_endpoint_is_bulk_out - check if the endpoint is bulk OUT
596 * @epd: endpoint to be checked
597 *
598 * Returns true if the endpoint has bulk transfer type and OUT direction,
599 * otherwise it returns false.
600 */
601static inline int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd)
602{
603 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd));
604}
605
606/**
607 * usb_endpoint_is_int_in - check if the endpoint is interrupt IN
608 * @epd: endpoint to be checked
609 *
610 * Returns true if the endpoint has interrupt transfer type and IN direction,
611 * otherwise it returns false.
612 */
613static inline int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd)
614{
615 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd));
616}
617
618/**
619 * usb_endpoint_is_int_out - check if the endpoint is interrupt OUT
620 * @epd: endpoint to be checked
621 *
622 * Returns true if the endpoint has interrupt transfer type and OUT direction,
623 * otherwise it returns false.
624 */
625static inline int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd)
626{
627 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd));
628}
629
630/**
631 * usb_endpoint_is_isoc_in - check if the endpoint is isochronous IN
632 * @epd: endpoint to be checked
633 *
634 * Returns true if the endpoint has isochronous transfer type and IN direction,
635 * otherwise it returns false.
636 */
637static inline int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd)
638{
639 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd));
640}
641
642/**
643 * usb_endpoint_is_isoc_out - check if the endpoint is isochronous OUT
644 * @epd: endpoint to be checked
645 *
646 * Returns true if the endpoint has isochronous transfer type and OUT direction,
647 * otherwise it returns false.
648 */
649static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd)
650{
651 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd));
652}
504 653
505/*-------------------------------------------------------------------------*/ 654/*-------------------------------------------------------------------------*/
506 655
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index ce5f1482e6be..924e502905d4 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -23,13 +23,14 @@ struct vm_area_struct;
23#endif 23#endif
24 24
25struct vm_struct { 25struct vm_struct {
26 /* keep next,addr,size together to speedup lookups */
27 struct vm_struct *next;
26 void *addr; 28 void *addr;
27 unsigned long size; 29 unsigned long size;
28 unsigned long flags; 30 unsigned long flags;
29 struct page **pages; 31 struct page **pages;
30 unsigned int nr_pages; 32 unsigned int nr_pages;
31 unsigned long phys_addr; 33 unsigned long phys_addr;
32 struct vm_struct *next;
33}; 34};
34 35
35/* 36/*
@@ -60,7 +61,8 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags);
60extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, 61extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags,
61 unsigned long start, unsigned long end); 62 unsigned long start, unsigned long end);
62extern struct vm_struct *get_vm_area_node(unsigned long size, 63extern struct vm_struct *get_vm_area_node(unsigned long size,
63 unsigned long flags, int node); 64 unsigned long flags, int node,
65 gfp_t gfp_mask);
64extern struct vm_struct *remove_vm_area(void *addr); 66extern struct vm_struct *remove_vm_area(void *addr);
65extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 67extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
66 struct page ***pages); 68 struct page ***pages);
diff --git a/include/linux/wait.h b/include/linux/wait.h
index b3b9048421d8..e820d00e1383 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -79,6 +79,15 @@ struct task_struct;
79 79
80extern void init_waitqueue_head(wait_queue_head_t *q); 80extern void init_waitqueue_head(wait_queue_head_t *q);
81 81
82#ifdef CONFIG_LOCKDEP
83# define __WAIT_QUEUE_HEAD_INIT_ONSTACK(name) \
84 ({ init_waitqueue_head(&name); name; })
85# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) \
86 wait_queue_head_t name = __WAIT_QUEUE_HEAD_INIT_ONSTACK(name)
87#else
88# define DECLARE_WAIT_QUEUE_HEAD_ONSTACK(name) DECLARE_WAIT_QUEUE_HEAD(name)
89#endif
90
82static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p) 91static inline void init_waitqueue_entry(wait_queue_t *q, struct task_struct *p)
83{ 92{
84 q->flags = 0; 93 q->flags = 0;
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index a50a0130fd9e..7c269f4992eb 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -546,6 +546,8 @@
546/* MLME requests (SIOCSIWMLME / struct iw_mlme) */ 546/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
547#define IW_MLME_DEAUTH 0 547#define IW_MLME_DEAUTH 0
548#define IW_MLME_DISASSOC 1 548#define IW_MLME_DISASSOC 1
549#define IW_MLME_AUTH 2
550#define IW_MLME_ASSOC 3
549 551
550/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */ 552/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
551#define IW_AUTH_INDEX 0x0FFF 553#define IW_AUTH_INDEX 0x0FFF
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index a341c8032866..fc35e6bdfb93 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -85,7 +85,6 @@ int wakeup_pdflush(long nr_pages);
85void laptop_io_completion(void); 85void laptop_io_completion(void);
86void laptop_sync_completion(void); 86void laptop_sync_completion(void);
87void throttle_vm_writeout(void); 87void throttle_vm_writeout(void);
88void writeback_congestion_end(void);
89 88
90/* These are exported to sysctl. */ 89/* These are exported to sysctl. */
91extern int dirty_background_ratio; 90extern int dirty_background_ratio;
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 8ae7f744917b..088ba8113f7e 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -211,8 +211,8 @@ struct xfrm_user_tmpl {
211 211
212struct xfrm_encap_tmpl { 212struct xfrm_encap_tmpl {
213 __u16 encap_type; 213 __u16 encap_type;
214 __u16 encap_sport; 214 __be16 encap_sport;
215 __u16 encap_dport; 215 __be16 encap_dport;
216 xfrm_address_t encap_oa; 216 xfrm_address_t encap_oa;
217}; 217};
218 218
@@ -289,7 +289,9 @@ struct xfrm_usersa_id {
289 289
290struct xfrm_aevent_id { 290struct xfrm_aevent_id {
291 struct xfrm_usersa_id sa_id; 291 struct xfrm_usersa_id sa_id;
292 xfrm_address_t saddr;
292 __u32 flags; 293 __u32 flags;
294 __u32 reqid;
293}; 295};
294 296
295struct xfrm_userspi_info { 297struct xfrm_userspi_info {