aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/adfs_fs.h2
-rw-r--r--include/linux/affs_fs.h7
-rw-r--r--include/linux/ata.h26
-rw-r--r--include/linux/blkdev.h3
-rw-r--r--include/linux/bootmem.h2
-rw-r--r--include/linux/coda_psdev.h4
-rw-r--r--include/linux/crypto.h689
-rw-r--r--include/linux/dcache.h1
-rw-r--r--include/linux/dccp.h2
-rw-r--r--include/linux/efs_fs_sb.h3
-rw-r--r--include/linux/ext2_fs.h6
-rw-r--r--include/linux/ext3_fs.h6
-rw-r--r--include/linux/fib_rules.h65
-rw-r--r--include/linux/filter.h13
-rw-r--r--include/linux/genetlink.h18
-rw-r--r--include/linux/hpfs_fs.h8
-rw-r--r--include/linux/if.h129
-rw-r--r--include/linux/if_addr.h55
-rw-r--r--include/linux/in.h4
-rw-r--r--include/linux/in6.h2
-rw-r--r--include/linux/inet.h2
-rw-r--r--include/linux/ip.h1
-rw-r--r--include/linux/ipv6.h31
-rw-r--r--include/linux/iso_fs.h6
-rw-r--r--include/linux/jffs2.h4
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/libata.h90
-rw-r--r--include/linux/magic.h37
-rw-r--r--include/linux/minix_fs.h6
-rw-r--r--include/linux/mm.h1
-rw-r--r--include/linux/mod_devicetable.h11
-rw-r--r--include/linux/module.h5
-rw-r--r--include/linux/msdos_fs.h4
-rw-r--r--include/linux/ncp_fs.h5
-rw-r--r--include/linux/neighbour.h159
-rw-r--r--include/linux/net.h28
-rw-r--r--include/linux/netdevice.h6
-rw-r--r--include/linux/netfilter.h6
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h4
-rw-r--r--include/linux/netfilter/nf_conntrack_tcp.h1
-rw-r--r--include/linux/netfilter/nfnetlink.h4
-rw-r--r--include/linux/netfilter/nfnetlink_log.h6
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h8
-rw-r--r--include/linux/netfilter/x_tables.h52
-rw-r--r--include/linux/netfilter/xt_DSCP.h20
-rw-r--r--include/linux/netfilter/xt_dscp.h23
-rw-r--r--include/linux/netfilter_arp/arp_tables.h3
-rw-r--r--include/linux/netfilter_bridge.h42
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper.h2
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_pptp.h45
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h22
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_core.h8
-rw-r--r--include/linux/netfilter_ipv4/ip_nat_pptp.h4
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h3
-rw-r--r--include/linux/netfilter_ipv4/ipt_DSCP.h6
-rw-r--r--include/linux/netfilter_ipv4/ipt_dscp.h14
-rw-r--r--include/linux/netfilter_ipv4/listhelp.h123
-rw-r--r--include/linux/netfilter_ipv6.h1
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h3
-rw-r--r--include/linux/netfilter_logging.h33
-rw-r--r--include/linux/netlink.h2
-rw-r--r--include/linux/nfs_fs.h20
-rw-r--r--include/linux/nfs_fs_sb.h89
-rw-r--r--include/linux/nfs_idmap.h14
-rw-r--r--include/linux/nfs_xdr.h29
-rw-r--r--include/linux/openprom_fs.h10
-rw-r--r--include/linux/pci_ids.h17
-rw-r--r--include/linux/pkt_cls.h1
-rw-r--r--include/linux/proc_fs.h3
-rw-r--r--include/linux/qnx4_fs.h2
-rw-r--r--include/linux/reiserfs_fs.h10
-rw-r--r--include/linux/rtnetlink.h376
-rw-r--r--include/linux/scatterlist.h4
-rw-r--r--include/linux/security.h239
-rw-r--r--include/linux/skbuff.h17
-rw-r--r--include/linux/smb.h3
-rw-r--r--include/linux/snmp.h35
-rw-r--r--include/linux/sunrpc/clnt.h57
-rw-r--r--include/linux/sunrpc/gss_krb5.h19
-rw-r--r--include/linux/sunrpc/gss_spkm3.h4
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/sched.h5
-rw-r--r--include/linux/sunrpc/xprt.h52
-rw-r--r--include/linux/sysctl.h5
-rw-r--r--include/linux/usbdevice_fs.h3
-rw-r--r--include/linux/writeback.h1
-rw-r--r--include/linux/xfrm.h36
89 files changed, 1920 insertions, 1019 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 10d2ca07562a..19a3664f1dfe 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -12,7 +12,6 @@ header-y += netfilter_bridge/
12header-y += netfilter_ipv4/ 12header-y += netfilter_ipv4/
13header-y += netfilter_ipv6/ 13header-y += netfilter_ipv6/
14 14
15header-y += affs_fs.h
16header-y += affs_hardblocks.h 15header-y += affs_hardblocks.h
17header-y += aio_abi.h 16header-y += aio_abi.h
18header-y += a.out.h 17header-y += a.out.h
@@ -67,7 +66,6 @@ header-y += genetlink.h
67header-y += gen_stats.h 66header-y += gen_stats.h
68header-y += gigaset_dev.h 67header-y += gigaset_dev.h
69header-y += hdsmart.h 68header-y += hdsmart.h
70header-y += hpfs_fs.h
71header-y += hysdn_if.h 69header-y += hysdn_if.h
72header-y += i2c-dev.h 70header-y += i2c-dev.h
73header-y += i8k.h 71header-y += i8k.h
@@ -103,6 +101,7 @@ header-y += ixjuser.h
103header-y += jffs2.h 101header-y += jffs2.h
104header-y += keyctl.h 102header-y += keyctl.h
105header-y += limits.h 103header-y += limits.h
104header-y += magic.h
106header-y += major.h 105header-y += major.h
107header-y += matroxfb.h 106header-y += matroxfb.h
108header-y += meye.h 107header-y += meye.h
@@ -116,7 +115,6 @@ header-y += netrom.h
116header-y += nfs2.h 115header-y += nfs2.h
117header-y += nfs4_mount.h 116header-y += nfs4_mount.h
118header-y += nfs_mount.h 117header-y += nfs_mount.h
119header-y += openprom_fs.h
120header-y += param.h 118header-y += param.h
121header-y += pci_ids.h 119header-y += pci_ids.h
122header-y += pci_regs.h 120header-y += pci_regs.h
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h
index 4a5d50c2bdbf..ef788c2085a1 100644
--- a/include/linux/adfs_fs.h
+++ b/include/linux/adfs_fs.h
@@ -2,6 +2,7 @@
2#define _ADFS_FS_H 2#define _ADFS_FS_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/magic.h>
5 6
6/* 7/*
7 * Disc Record at disc address 0xc00 8 * Disc Record at disc address 0xc00
@@ -38,7 +39,6 @@ struct adfs_discrecord {
38#define ADFS_DR_OFFSET (0x1c0) 39#define ADFS_DR_OFFSET (0x1c0)
39#define ADFS_DR_SIZE 60 40#define ADFS_DR_SIZE 60
40#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) 41#define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3)
41#define ADFS_SUPER_MAGIC 0xadf5
42 42
43#ifdef __KERNEL__ 43#ifdef __KERNEL__
44#include <linux/adfs_fs_i.h> 44#include <linux/adfs_fs_i.h>
diff --git a/include/linux/affs_fs.h b/include/linux/affs_fs.h
deleted file mode 100644
index c57b5ee87d55..000000000000
--- a/include/linux/affs_fs.h
+++ /dev/null
@@ -1,7 +0,0 @@
1#ifndef _AFFS_FS_H
2#define _AFFS_FS_H
3/*
4 * The affs filesystem constants/structures
5 */
6#define AFFS_SUPER_MAGIC 0xadff
7#endif
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 3671af869696..d89441907024 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -40,6 +40,8 @@ enum {
40 ATA_MAX_DEVICES = 2, /* per bus/port */ 40 ATA_MAX_DEVICES = 2, /* per bus/port */
41 ATA_MAX_PRD = 256, /* we could make these 256/256 */ 41 ATA_MAX_PRD = 256, /* we could make these 256/256 */
42 ATA_SECT_SIZE = 512, 42 ATA_SECT_SIZE = 512,
43 ATA_MAX_SECTORS = 256,
44 ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */
43 45
44 ATA_ID_WORDS = 256, 46 ATA_ID_WORDS = 256,
45 ATA_ID_SERNO_OFS = 10, 47 ATA_ID_SERNO_OFS = 10,
@@ -168,12 +170,16 @@ enum {
168 XFER_UDMA_2 = 0x42, 170 XFER_UDMA_2 = 0x42,
169 XFER_UDMA_1 = 0x41, 171 XFER_UDMA_1 = 0x41,
170 XFER_UDMA_0 = 0x40, 172 XFER_UDMA_0 = 0x40,
173 XFER_MW_DMA_4 = 0x24, /* CFA only */
174 XFER_MW_DMA_3 = 0x23, /* CFA only */
171 XFER_MW_DMA_2 = 0x22, 175 XFER_MW_DMA_2 = 0x22,
172 XFER_MW_DMA_1 = 0x21, 176 XFER_MW_DMA_1 = 0x21,
173 XFER_MW_DMA_0 = 0x20, 177 XFER_MW_DMA_0 = 0x20,
174 XFER_SW_DMA_2 = 0x12, 178 XFER_SW_DMA_2 = 0x12,
175 XFER_SW_DMA_1 = 0x11, 179 XFER_SW_DMA_1 = 0x11,
176 XFER_SW_DMA_0 = 0x10, 180 XFER_SW_DMA_0 = 0x10,
181 XFER_PIO_6 = 0x0E, /* CFA only */
182 XFER_PIO_5 = 0x0D, /* CFA only */
177 XFER_PIO_4 = 0x0C, 183 XFER_PIO_4 = 0x0C,
178 XFER_PIO_3 = 0x0B, 184 XFER_PIO_3 = 0x0B,
179 XFER_PIO_2 = 0x0A, 185 XFER_PIO_2 = 0x0A,
@@ -272,7 +278,6 @@ struct ata_taskfile {
272}; 278};
273 279
274#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) 280#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
275#define ata_id_is_cfa(id) ((id)[0] == 0x848A)
276#define ata_id_is_sata(id) ((id)[93] == 0) 281#define ata_id_is_sata(id) ((id)[93] == 0)
277#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) 282#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
278#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) 283#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
@@ -304,6 +309,9 @@ static inline unsigned int ata_id_major_version(const u16 *id)
304{ 309{
305 unsigned int mver; 310 unsigned int mver;
306 311
312 if (id[ATA_ID_MAJOR_VER] == 0xFFFF)
313 return 0;
314
307 for (mver = 14; mver >= 1; mver--) 315 for (mver = 14; mver >= 1; mver--)
308 if (id[ATA_ID_MAJOR_VER] & (1 << mver)) 316 if (id[ATA_ID_MAJOR_VER] & (1 << mver))
309 break; 317 break;
@@ -312,8 +320,8 @@ static inline unsigned int ata_id_major_version(const u16 *id)
312 320
313static inline int ata_id_current_chs_valid(const u16 *id) 321static inline int ata_id_current_chs_valid(const u16 *id)
314{ 322{
315 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 323 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
316 has not been issued to the device then the values of 324 has not been issued to the device then the values of
317 id[54] to id[56] are vendor specific. */ 325 id[54] to id[56] are vendor specific. */
318 return (id[53] & 0x01) && /* Current translation valid */ 326 return (id[53] & 0x01) && /* Current translation valid */
319 id[54] && /* cylinders in current translation */ 327 id[54] && /* cylinders in current translation */
@@ -322,6 +330,18 @@ static inline int ata_id_current_chs_valid(const u16 *id)
322 id[56]; /* sectors in current translation */ 330 id[56]; /* sectors in current translation */
323} 331}
324 332
333static inline int ata_id_is_cfa(const u16 *id)
334{
335 u16 v = id[0];
336 if (v == 0x848A) /* Standard CF */
337 return 1;
338 /* Could be CF hiding as standard ATA */
339 if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF &&
340 (id[82] & ( 1 << 2)))
341 return 1;
342 return 0;
343}
344
325static inline int atapi_cdb_len(const u16 *dev_id) 345static inline int atapi_cdb_len(const u16 *dev_id)
326{ 346{
327 u16 tmp = dev_id[0] & 0x3; 347 u16 tmp = dev_id[0] & 0x3;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index aafe82788b4e..c773ee545ebd 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -746,6 +746,9 @@ extern void blk_queue_free_tags(request_queue_t *);
746extern int blk_queue_resize_tags(request_queue_t *, int); 746extern int blk_queue_resize_tags(request_queue_t *, int);
747extern void blk_queue_invalidate_tags(request_queue_t *); 747extern void blk_queue_invalidate_tags(request_queue_t *);
748extern long blk_congestion_wait(int rw, long timeout); 748extern long blk_congestion_wait(int rw, long timeout);
749extern struct blk_queue_tag *blk_init_tags(int);
750extern void blk_free_tags(struct blk_queue_tag *);
751extern void blk_congestion_end(int rw);
749 752
750extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); 753extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *);
751extern int blkdev_issue_flush(struct block_device *, sector_t *); 754extern int blkdev_issue_flush(struct block_device *, sector_t *);
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 1021f508d82c..e319c649e4fd 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -114,7 +114,7 @@ extern void *__init alloc_large_system_hash(const char *tablename,
114#else 114#else
115#define HASHDIST_DEFAULT 0 115#define HASHDIST_DEFAULT 0
116#endif 116#endif
117extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ 117extern int hashdist; /* Distribute hashes across NUMA nodes? */
118 118
119 119
120#endif /* _LINUX_BOOTMEM_H */ 120#endif /* _LINUX_BOOTMEM_H */
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 98f6c52c152b..b541bb3d1f4b 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -1,11 +1,11 @@
1#ifndef __CODA_PSDEV_H 1#ifndef __CODA_PSDEV_H
2#define __CODA_PSDEV_H 2#define __CODA_PSDEV_H
3 3
4#include <linux/magic.h>
5
4#define CODA_PSDEV_MAJOR 67 6#define CODA_PSDEV_MAJOR 67
5#define MAX_CODADEVS 5 /* how many do we allow */ 7#define MAX_CODADEVS 5 /* how many do we allow */
6 8
7#define CODA_SUPER_MAGIC 0x73757245
8
9struct kstatfs; 9struct kstatfs;
10 10
11struct coda_sb_info 11struct coda_sb_info
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 7f946241b879..8f2ffa4caabf 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -17,20 +17,36 @@
17#ifndef _LINUX_CRYPTO_H 17#ifndef _LINUX_CRYPTO_H
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <asm/atomic.h>
20#include <linux/module.h> 21#include <linux/module.h>
21#include <linux/kernel.h> 22#include <linux/kernel.h>
22#include <linux/types.h>
23#include <linux/list.h> 23#include <linux/list.h>
24#include <linux/slab.h>
24#include <linux/string.h> 25#include <linux/string.h>
25#include <asm/page.h> 26#include <linux/uaccess.h>
26 27
27/* 28/*
28 * Algorithm masks and types. 29 * Algorithm masks and types.
29 */ 30 */
30#define CRYPTO_ALG_TYPE_MASK 0x000000ff 31#define CRYPTO_ALG_TYPE_MASK 0x0000000f
31#define CRYPTO_ALG_TYPE_CIPHER 0x00000001 32#define CRYPTO_ALG_TYPE_CIPHER 0x00000001
32#define CRYPTO_ALG_TYPE_DIGEST 0x00000002 33#define CRYPTO_ALG_TYPE_DIGEST 0x00000002
33#define CRYPTO_ALG_TYPE_COMPRESS 0x00000004 34#define CRYPTO_ALG_TYPE_HASH 0x00000003
35#define CRYPTO_ALG_TYPE_BLKCIPHER 0x00000004
36#define CRYPTO_ALG_TYPE_COMPRESS 0x00000005
37
38#define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e
39
40#define CRYPTO_ALG_LARVAL 0x00000010
41#define CRYPTO_ALG_DEAD 0x00000020
42#define CRYPTO_ALG_DYING 0x00000040
43#define CRYPTO_ALG_ASYNC 0x00000080
44
45/*
46 * Set this bit if and only if the algorithm requires another algorithm of
47 * the same type to handle corner cases.
48 */
49#define CRYPTO_ALG_NEED_FALLBACK 0x00000100
34 50
35/* 51/*
36 * Transform masks and values (for crt_flags). 52 * Transform masks and values (for crt_flags).
@@ -61,8 +77,37 @@
61#define CRYPTO_DIR_ENCRYPT 1 77#define CRYPTO_DIR_ENCRYPT 1
62#define CRYPTO_DIR_DECRYPT 0 78#define CRYPTO_DIR_DECRYPT 0
63 79
80/*
81 * The macro CRYPTO_MINALIGN_ATTR (along with the void * type in the actual
82 * declaration) is used to ensure that the crypto_tfm context structure is
83 * aligned correctly for the given architecture so that there are no alignment
84 * faults for C data types. In particular, this is required on platforms such
85 * as arm where pointers are 32-bit aligned but there are data types such as
86 * u64 which require 64-bit alignment.
87 */
88#if defined(ARCH_KMALLOC_MINALIGN)
89#define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
90#elif defined(ARCH_SLAB_MINALIGN)
91#define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN
92#endif
93
94#ifdef CRYPTO_MINALIGN
95#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
96#else
97#define CRYPTO_MINALIGN_ATTR
98#endif
99
64struct scatterlist; 100struct scatterlist;
101struct crypto_blkcipher;
102struct crypto_hash;
65struct crypto_tfm; 103struct crypto_tfm;
104struct crypto_type;
105
106struct blkcipher_desc {
107 struct crypto_blkcipher *tfm;
108 void *info;
109 u32 flags;
110};
66 111
67struct cipher_desc { 112struct cipher_desc {
68 struct crypto_tfm *tfm; 113 struct crypto_tfm *tfm;
@@ -72,30 +117,50 @@ struct cipher_desc {
72 void *info; 117 void *info;
73}; 118};
74 119
120struct hash_desc {
121 struct crypto_hash *tfm;
122 u32 flags;
123};
124
75/* 125/*
76 * Algorithms: modular crypto algorithm implementations, managed 126 * Algorithms: modular crypto algorithm implementations, managed
77 * via crypto_register_alg() and crypto_unregister_alg(). 127 * via crypto_register_alg() and crypto_unregister_alg().
78 */ 128 */
129struct blkcipher_alg {
130 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
131 unsigned int keylen);
132 int (*encrypt)(struct blkcipher_desc *desc,
133 struct scatterlist *dst, struct scatterlist *src,
134 unsigned int nbytes);
135 int (*decrypt)(struct blkcipher_desc *desc,
136 struct scatterlist *dst, struct scatterlist *src,
137 unsigned int nbytes);
138
139 unsigned int min_keysize;
140 unsigned int max_keysize;
141 unsigned int ivsize;
142};
143
79struct cipher_alg { 144struct cipher_alg {
80 unsigned int cia_min_keysize; 145 unsigned int cia_min_keysize;
81 unsigned int cia_max_keysize; 146 unsigned int cia_max_keysize;
82 int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key, 147 int (*cia_setkey)(struct crypto_tfm *tfm, const u8 *key,
83 unsigned int keylen, u32 *flags); 148 unsigned int keylen);
84 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 149 void (*cia_encrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
85 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 150 void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
86 151
87 unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc, 152 unsigned int (*cia_encrypt_ecb)(const struct cipher_desc *desc,
88 u8 *dst, const u8 *src, 153 u8 *dst, const u8 *src,
89 unsigned int nbytes); 154 unsigned int nbytes) __deprecated;
90 unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc, 155 unsigned int (*cia_decrypt_ecb)(const struct cipher_desc *desc,
91 u8 *dst, const u8 *src, 156 u8 *dst, const u8 *src,
92 unsigned int nbytes); 157 unsigned int nbytes) __deprecated;
93 unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc, 158 unsigned int (*cia_encrypt_cbc)(const struct cipher_desc *desc,
94 u8 *dst, const u8 *src, 159 u8 *dst, const u8 *src,
95 unsigned int nbytes); 160 unsigned int nbytes) __deprecated;
96 unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc, 161 unsigned int (*cia_decrypt_cbc)(const struct cipher_desc *desc,
97 u8 *dst, const u8 *src, 162 u8 *dst, const u8 *src,
98 unsigned int nbytes); 163 unsigned int nbytes) __deprecated;
99}; 164};
100 165
101struct digest_alg { 166struct digest_alg {
@@ -105,7 +170,20 @@ struct digest_alg {
105 unsigned int len); 170 unsigned int len);
106 void (*dia_final)(struct crypto_tfm *tfm, u8 *out); 171 void (*dia_final)(struct crypto_tfm *tfm, u8 *out);
107 int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, 172 int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key,
108 unsigned int keylen, u32 *flags); 173 unsigned int keylen);
174};
175
176struct hash_alg {
177 int (*init)(struct hash_desc *desc);
178 int (*update)(struct hash_desc *desc, struct scatterlist *sg,
179 unsigned int nbytes);
180 int (*final)(struct hash_desc *desc, u8 *out);
181 int (*digest)(struct hash_desc *desc, struct scatterlist *sg,
182 unsigned int nbytes, u8 *out);
183 int (*setkey)(struct crypto_hash *tfm, const u8 *key,
184 unsigned int keylen);
185
186 unsigned int digestsize;
109}; 187};
110 188
111struct compress_alg { 189struct compress_alg {
@@ -115,30 +193,40 @@ struct compress_alg {
115 unsigned int slen, u8 *dst, unsigned int *dlen); 193 unsigned int slen, u8 *dst, unsigned int *dlen);
116}; 194};
117 195
196#define cra_blkcipher cra_u.blkcipher
118#define cra_cipher cra_u.cipher 197#define cra_cipher cra_u.cipher
119#define cra_digest cra_u.digest 198#define cra_digest cra_u.digest
199#define cra_hash cra_u.hash
120#define cra_compress cra_u.compress 200#define cra_compress cra_u.compress
121 201
122struct crypto_alg { 202struct crypto_alg {
123 struct list_head cra_list; 203 struct list_head cra_list;
204 struct list_head cra_users;
205
124 u32 cra_flags; 206 u32 cra_flags;
125 unsigned int cra_blocksize; 207 unsigned int cra_blocksize;
126 unsigned int cra_ctxsize; 208 unsigned int cra_ctxsize;
127 unsigned int cra_alignmask; 209 unsigned int cra_alignmask;
128 210
129 int cra_priority; 211 int cra_priority;
212 atomic_t cra_refcnt;
130 213
131 char cra_name[CRYPTO_MAX_ALG_NAME]; 214 char cra_name[CRYPTO_MAX_ALG_NAME];
132 char cra_driver_name[CRYPTO_MAX_ALG_NAME]; 215 char cra_driver_name[CRYPTO_MAX_ALG_NAME];
133 216
217 const struct crypto_type *cra_type;
218
134 union { 219 union {
220 struct blkcipher_alg blkcipher;
135 struct cipher_alg cipher; 221 struct cipher_alg cipher;
136 struct digest_alg digest; 222 struct digest_alg digest;
223 struct hash_alg hash;
137 struct compress_alg compress; 224 struct compress_alg compress;
138 } cra_u; 225 } cra_u;
139 226
140 int (*cra_init)(struct crypto_tfm *tfm); 227 int (*cra_init)(struct crypto_tfm *tfm);
141 void (*cra_exit)(struct crypto_tfm *tfm); 228 void (*cra_exit)(struct crypto_tfm *tfm);
229 void (*cra_destroy)(struct crypto_alg *alg);
142 230
143 struct module *cra_module; 231 struct module *cra_module;
144}; 232};
@@ -153,20 +241,39 @@ int crypto_unregister_alg(struct crypto_alg *alg);
153 * Algorithm query interface. 241 * Algorithm query interface.
154 */ 242 */
155#ifdef CONFIG_CRYPTO 243#ifdef CONFIG_CRYPTO
156int crypto_alg_available(const char *name, u32 flags); 244int crypto_alg_available(const char *name, u32 flags)
245 __deprecated_for_modules;
246int crypto_has_alg(const char *name, u32 type, u32 mask);
157#else 247#else
248static int crypto_alg_available(const char *name, u32 flags);
249 __deprecated_for_modules;
158static inline int crypto_alg_available(const char *name, u32 flags) 250static inline int crypto_alg_available(const char *name, u32 flags)
159{ 251{
160 return 0; 252 return 0;
161} 253}
254
255static inline int crypto_has_alg(const char *name, u32 type, u32 mask)
256{
257 return 0;
258}
162#endif 259#endif
163 260
164/* 261/*
165 * Transforms: user-instantiated objects which encapsulate algorithms 262 * Transforms: user-instantiated objects which encapsulate algorithms
166 * and core processing logic. Managed via crypto_alloc_tfm() and 263 * and core processing logic. Managed via crypto_alloc_*() and
167 * crypto_free_tfm(), as well as the various helpers below. 264 * crypto_free_*(), as well as the various helpers below.
168 */ 265 */
169 266
267struct blkcipher_tfm {
268 void *iv;
269 int (*setkey)(struct crypto_tfm *tfm, const u8 *key,
270 unsigned int keylen);
271 int (*encrypt)(struct blkcipher_desc *desc, struct scatterlist *dst,
272 struct scatterlist *src, unsigned int nbytes);
273 int (*decrypt)(struct blkcipher_desc *desc, struct scatterlist *dst,
274 struct scatterlist *src, unsigned int nbytes);
275};
276
170struct cipher_tfm { 277struct cipher_tfm {
171 void *cit_iv; 278 void *cit_iv;
172 unsigned int cit_ivsize; 279 unsigned int cit_ivsize;
@@ -190,20 +297,20 @@ struct cipher_tfm {
190 struct scatterlist *src, 297 struct scatterlist *src,
191 unsigned int nbytes, u8 *iv); 298 unsigned int nbytes, u8 *iv);
192 void (*cit_xor_block)(u8 *dst, const u8 *src); 299 void (*cit_xor_block)(u8 *dst, const u8 *src);
300 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
301 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
193}; 302};
194 303
195struct digest_tfm { 304struct hash_tfm {
196 void (*dit_init)(struct crypto_tfm *tfm); 305 int (*init)(struct hash_desc *desc);
197 void (*dit_update)(struct crypto_tfm *tfm, 306 int (*update)(struct hash_desc *desc,
198 struct scatterlist *sg, unsigned int nsg); 307 struct scatterlist *sg, unsigned int nsg);
199 void (*dit_final)(struct crypto_tfm *tfm, u8 *out); 308 int (*final)(struct hash_desc *desc, u8 *out);
200 void (*dit_digest)(struct crypto_tfm *tfm, struct scatterlist *sg, 309 int (*digest)(struct hash_desc *desc, struct scatterlist *sg,
201 unsigned int nsg, u8 *out); 310 unsigned int nsg, u8 *out);
202 int (*dit_setkey)(struct crypto_tfm *tfm, 311 int (*setkey)(struct crypto_hash *tfm, const u8 *key,
203 const u8 *key, unsigned int keylen); 312 unsigned int keylen);
204#ifdef CONFIG_CRYPTO_HMAC 313 unsigned int digestsize;
205 void *dit_hmac_block;
206#endif
207}; 314};
208 315
209struct compress_tfm { 316struct compress_tfm {
@@ -215,8 +322,9 @@ struct compress_tfm {
215 u8 *dst, unsigned int *dlen); 322 u8 *dst, unsigned int *dlen);
216}; 323};
217 324
325#define crt_blkcipher crt_u.blkcipher
218#define crt_cipher crt_u.cipher 326#define crt_cipher crt_u.cipher
219#define crt_digest crt_u.digest 327#define crt_hash crt_u.hash
220#define crt_compress crt_u.compress 328#define crt_compress crt_u.compress
221 329
222struct crypto_tfm { 330struct crypto_tfm {
@@ -224,30 +332,43 @@ struct crypto_tfm {
224 u32 crt_flags; 332 u32 crt_flags;
225 333
226 union { 334 union {
335 struct blkcipher_tfm blkcipher;
227 struct cipher_tfm cipher; 336 struct cipher_tfm cipher;
228 struct digest_tfm digest; 337 struct hash_tfm hash;
229 struct compress_tfm compress; 338 struct compress_tfm compress;
230 } crt_u; 339 } crt_u;
231 340
232 struct crypto_alg *__crt_alg; 341 struct crypto_alg *__crt_alg;
233 342
234 char __crt_ctx[] __attribute__ ((__aligned__)); 343 void *__crt_ctx[] CRYPTO_MINALIGN_ATTR;
344};
345
346#define crypto_cipher crypto_tfm
347#define crypto_comp crypto_tfm
348
349struct crypto_blkcipher {
350 struct crypto_tfm base;
351};
352
353struct crypto_hash {
354 struct crypto_tfm base;
355};
356
357enum {
358 CRYPTOA_UNSPEC,
359 CRYPTOA_ALG,
360};
361
362struct crypto_attr_alg {
363 char name[CRYPTO_MAX_ALG_NAME];
235}; 364};
236 365
237/* 366/*
238 * Transform user interface. 367 * Transform user interface.
239 */ 368 */
240 369
241/*
242 * crypto_alloc_tfm() will first attempt to locate an already loaded algorithm.
243 * If that fails and the kernel supports dynamically loadable modules, it
244 * will then attempt to load a module of the same name or alias. A refcount
245 * is grabbed on the algorithm which is then associated with the new transform.
246 *
247 * crypto_free_tfm() frees up the transform and any associated resources,
248 * then drops the refcount on the associated algorithm.
249 */
250struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); 370struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags);
371struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask);
251void crypto_free_tfm(struct crypto_tfm *tfm); 372void crypto_free_tfm(struct crypto_tfm *tfm);
252 373
253/* 374/*
@@ -258,6 +379,16 @@ static inline const char *crypto_tfm_alg_name(struct crypto_tfm *tfm)
258 return tfm->__crt_alg->cra_name; 379 return tfm->__crt_alg->cra_name;
259} 380}
260 381
382static inline const char *crypto_tfm_alg_driver_name(struct crypto_tfm *tfm)
383{
384 return tfm->__crt_alg->cra_driver_name;
385}
386
387static inline int crypto_tfm_alg_priority(struct crypto_tfm *tfm)
388{
389 return tfm->__crt_alg->cra_priority;
390}
391
261static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm) 392static inline const char *crypto_tfm_alg_modname(struct crypto_tfm *tfm)
262{ 393{
263 return module_name(tfm->__crt_alg->cra_module); 394 return module_name(tfm->__crt_alg->cra_module);
@@ -268,18 +399,23 @@ static inline u32 crypto_tfm_alg_type(struct crypto_tfm *tfm)
268 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK; 399 return tfm->__crt_alg->cra_flags & CRYPTO_ALG_TYPE_MASK;
269} 400}
270 401
402static unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
403 __deprecated;
271static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm) 404static inline unsigned int crypto_tfm_alg_min_keysize(struct crypto_tfm *tfm)
272{ 405{
273 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 406 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
274 return tfm->__crt_alg->cra_cipher.cia_min_keysize; 407 return tfm->__crt_alg->cra_cipher.cia_min_keysize;
275} 408}
276 409
410static unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
411 __deprecated;
277static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm) 412static inline unsigned int crypto_tfm_alg_max_keysize(struct crypto_tfm *tfm)
278{ 413{
279 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 414 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
280 return tfm->__crt_alg->cra_cipher.cia_max_keysize; 415 return tfm->__crt_alg->cra_cipher.cia_max_keysize;
281} 416}
282 417
418static unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) __deprecated;
283static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm) 419static inline unsigned int crypto_tfm_alg_ivsize(struct crypto_tfm *tfm)
284{ 420{
285 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 421 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
@@ -302,6 +438,21 @@ static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm)
302 return tfm->__crt_alg->cra_alignmask; 438 return tfm->__crt_alg->cra_alignmask;
303} 439}
304 440
441static inline u32 crypto_tfm_get_flags(struct crypto_tfm *tfm)
442{
443 return tfm->crt_flags;
444}
445
446static inline void crypto_tfm_set_flags(struct crypto_tfm *tfm, u32 flags)
447{
448 tfm->crt_flags |= flags;
449}
450
451static inline void crypto_tfm_clear_flags(struct crypto_tfm *tfm, u32 flags)
452{
453 tfm->crt_flags &= ~flags;
454}
455
305static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) 456static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm)
306{ 457{
307 return tfm->__crt_ctx; 458 return tfm->__crt_ctx;
@@ -316,50 +467,374 @@ static inline unsigned int crypto_tfm_ctx_alignment(void)
316/* 467/*
317 * API wrappers. 468 * API wrappers.
318 */ 469 */
319static inline void crypto_digest_init(struct crypto_tfm *tfm) 470static inline struct crypto_blkcipher *__crypto_blkcipher_cast(
471 struct crypto_tfm *tfm)
320{ 472{
321 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); 473 return (struct crypto_blkcipher *)tfm;
322 tfm->crt_digest.dit_init(tfm);
323} 474}
324 475
325static inline void crypto_digest_update(struct crypto_tfm *tfm, 476static inline struct crypto_blkcipher *crypto_blkcipher_cast(
326 struct scatterlist *sg, 477 struct crypto_tfm *tfm)
327 unsigned int nsg)
328{ 478{
329 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); 479 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_BLKCIPHER);
330 tfm->crt_digest.dit_update(tfm, sg, nsg); 480 return __crypto_blkcipher_cast(tfm);
331} 481}
332 482
333static inline void crypto_digest_final(struct crypto_tfm *tfm, u8 *out) 483static inline struct crypto_blkcipher *crypto_alloc_blkcipher(
484 const char *alg_name, u32 type, u32 mask)
334{ 485{
335 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); 486 type &= ~CRYPTO_ALG_TYPE_MASK;
336 tfm->crt_digest.dit_final(tfm, out); 487 type |= CRYPTO_ALG_TYPE_BLKCIPHER;
488 mask |= CRYPTO_ALG_TYPE_MASK;
489
490 return __crypto_blkcipher_cast(crypto_alloc_base(alg_name, type, mask));
337} 491}
338 492
339static inline void crypto_digest_digest(struct crypto_tfm *tfm, 493static inline struct crypto_tfm *crypto_blkcipher_tfm(
340 struct scatterlist *sg, 494 struct crypto_blkcipher *tfm)
341 unsigned int nsg, u8 *out)
342{ 495{
343 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); 496 return &tfm->base;
344 tfm->crt_digest.dit_digest(tfm, sg, nsg, out);
345} 497}
346 498
347static inline int crypto_digest_setkey(struct crypto_tfm *tfm, 499static inline void crypto_free_blkcipher(struct crypto_blkcipher *tfm)
500{
501 crypto_free_tfm(crypto_blkcipher_tfm(tfm));
502}
503
504static inline int crypto_has_blkcipher(const char *alg_name, u32 type, u32 mask)
505{
506 type &= ~CRYPTO_ALG_TYPE_MASK;
507 type |= CRYPTO_ALG_TYPE_BLKCIPHER;
508 mask |= CRYPTO_ALG_TYPE_MASK;
509
510 return crypto_has_alg(alg_name, type, mask);
511}
512
513static inline const char *crypto_blkcipher_name(struct crypto_blkcipher *tfm)
514{
515 return crypto_tfm_alg_name(crypto_blkcipher_tfm(tfm));
516}
517
518static inline struct blkcipher_tfm *crypto_blkcipher_crt(
519 struct crypto_blkcipher *tfm)
520{
521 return &crypto_blkcipher_tfm(tfm)->crt_blkcipher;
522}
523
524static inline struct blkcipher_alg *crypto_blkcipher_alg(
525 struct crypto_blkcipher *tfm)
526{
527 return &crypto_blkcipher_tfm(tfm)->__crt_alg->cra_blkcipher;
528}
529
530static inline unsigned int crypto_blkcipher_ivsize(struct crypto_blkcipher *tfm)
531{
532 return crypto_blkcipher_alg(tfm)->ivsize;
533}
534
535static inline unsigned int crypto_blkcipher_blocksize(
536 struct crypto_blkcipher *tfm)
537{
538 return crypto_tfm_alg_blocksize(crypto_blkcipher_tfm(tfm));
539}
540
541static inline unsigned int crypto_blkcipher_alignmask(
542 struct crypto_blkcipher *tfm)
543{
544 return crypto_tfm_alg_alignmask(crypto_blkcipher_tfm(tfm));
545}
546
547static inline u32 crypto_blkcipher_get_flags(struct crypto_blkcipher *tfm)
548{
549 return crypto_tfm_get_flags(crypto_blkcipher_tfm(tfm));
550}
551
552static inline void crypto_blkcipher_set_flags(struct crypto_blkcipher *tfm,
553 u32 flags)
554{
555 crypto_tfm_set_flags(crypto_blkcipher_tfm(tfm), flags);
556}
557
558static inline void crypto_blkcipher_clear_flags(struct crypto_blkcipher *tfm,
559 u32 flags)
560{
561 crypto_tfm_clear_flags(crypto_blkcipher_tfm(tfm), flags);
562}
563
564static inline int crypto_blkcipher_setkey(struct crypto_blkcipher *tfm,
565 const u8 *key, unsigned int keylen)
566{
567 return crypto_blkcipher_crt(tfm)->setkey(crypto_blkcipher_tfm(tfm),
568 key, keylen);
569}
570
571static inline int crypto_blkcipher_encrypt(struct blkcipher_desc *desc,
572 struct scatterlist *dst,
573 struct scatterlist *src,
574 unsigned int nbytes)
575{
576 desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
577 return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
578}
579
580static inline int crypto_blkcipher_encrypt_iv(struct blkcipher_desc *desc,
581 struct scatterlist *dst,
582 struct scatterlist *src,
583 unsigned int nbytes)
584{
585 return crypto_blkcipher_crt(desc->tfm)->encrypt(desc, dst, src, nbytes);
586}
587
588static inline int crypto_blkcipher_decrypt(struct blkcipher_desc *desc,
589 struct scatterlist *dst,
590 struct scatterlist *src,
591 unsigned int nbytes)
592{
593 desc->info = crypto_blkcipher_crt(desc->tfm)->iv;
594 return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
595}
596
597static inline int crypto_blkcipher_decrypt_iv(struct blkcipher_desc *desc,
598 struct scatterlist *dst,
599 struct scatterlist *src,
600 unsigned int nbytes)
601{
602 return crypto_blkcipher_crt(desc->tfm)->decrypt(desc, dst, src, nbytes);
603}
604
605static inline void crypto_blkcipher_set_iv(struct crypto_blkcipher *tfm,
606 const u8 *src, unsigned int len)
607{
608 memcpy(crypto_blkcipher_crt(tfm)->iv, src, len);
609}
610
611static inline void crypto_blkcipher_get_iv(struct crypto_blkcipher *tfm,
612 u8 *dst, unsigned int len)
613{
614 memcpy(dst, crypto_blkcipher_crt(tfm)->iv, len);
615}
616
617static inline struct crypto_cipher *__crypto_cipher_cast(struct crypto_tfm *tfm)
618{
619 return (struct crypto_cipher *)tfm;
620}
621
622static inline struct crypto_cipher *crypto_cipher_cast(struct crypto_tfm *tfm)
623{
624 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
625 return __crypto_cipher_cast(tfm);
626}
627
628static inline struct crypto_cipher *crypto_alloc_cipher(const char *alg_name,
629 u32 type, u32 mask)
630{
631 type &= ~CRYPTO_ALG_TYPE_MASK;
632 type |= CRYPTO_ALG_TYPE_CIPHER;
633 mask |= CRYPTO_ALG_TYPE_MASK;
634
635 return __crypto_cipher_cast(crypto_alloc_base(alg_name, type, mask));
636}
637
638static inline struct crypto_tfm *crypto_cipher_tfm(struct crypto_cipher *tfm)
639{
640 return tfm;
641}
642
643static inline void crypto_free_cipher(struct crypto_cipher *tfm)
644{
645 crypto_free_tfm(crypto_cipher_tfm(tfm));
646}
647
648static inline int crypto_has_cipher(const char *alg_name, u32 type, u32 mask)
649{
650 type &= ~CRYPTO_ALG_TYPE_MASK;
651 type |= CRYPTO_ALG_TYPE_CIPHER;
652 mask |= CRYPTO_ALG_TYPE_MASK;
653
654 return crypto_has_alg(alg_name, type, mask);
655}
656
657static inline struct cipher_tfm *crypto_cipher_crt(struct crypto_cipher *tfm)
658{
659 return &crypto_cipher_tfm(tfm)->crt_cipher;
660}
661
662static inline unsigned int crypto_cipher_blocksize(struct crypto_cipher *tfm)
663{
664 return crypto_tfm_alg_blocksize(crypto_cipher_tfm(tfm));
665}
666
667static inline unsigned int crypto_cipher_alignmask(struct crypto_cipher *tfm)
668{
669 return crypto_tfm_alg_alignmask(crypto_cipher_tfm(tfm));
670}
671
672static inline u32 crypto_cipher_get_flags(struct crypto_cipher *tfm)
673{
674 return crypto_tfm_get_flags(crypto_cipher_tfm(tfm));
675}
676
677static inline void crypto_cipher_set_flags(struct crypto_cipher *tfm,
678 u32 flags)
679{
680 crypto_tfm_set_flags(crypto_cipher_tfm(tfm), flags);
681}
682
683static inline void crypto_cipher_clear_flags(struct crypto_cipher *tfm,
684 u32 flags)
685{
686 crypto_tfm_clear_flags(crypto_cipher_tfm(tfm), flags);
687}
688
689static inline int crypto_cipher_setkey(struct crypto_cipher *tfm,
348 const u8 *key, unsigned int keylen) 690 const u8 *key, unsigned int keylen)
349{ 691{
350 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_DIGEST); 692 return crypto_cipher_crt(tfm)->cit_setkey(crypto_cipher_tfm(tfm),
351 if (tfm->crt_digest.dit_setkey == NULL) 693 key, keylen);
352 return -ENOSYS; 694}
353 return tfm->crt_digest.dit_setkey(tfm, key, keylen); 695
696static inline void crypto_cipher_encrypt_one(struct crypto_cipher *tfm,
697 u8 *dst, const u8 *src)
698{
699 crypto_cipher_crt(tfm)->cit_encrypt_one(crypto_cipher_tfm(tfm),
700 dst, src);
701}
702
703static inline void crypto_cipher_decrypt_one(struct crypto_cipher *tfm,
704 u8 *dst, const u8 *src)
705{
706 crypto_cipher_crt(tfm)->cit_decrypt_one(crypto_cipher_tfm(tfm),
707 dst, src);
708}
709
710void crypto_digest_init(struct crypto_tfm *tfm) __deprecated_for_modules;
711void crypto_digest_update(struct crypto_tfm *tfm,
712 struct scatterlist *sg, unsigned int nsg)
713 __deprecated_for_modules;
714void crypto_digest_final(struct crypto_tfm *tfm, u8 *out)
715 __deprecated_for_modules;
716void crypto_digest_digest(struct crypto_tfm *tfm,
717 struct scatterlist *sg, unsigned int nsg, u8 *out)
718 __deprecated_for_modules;
719
720static inline struct crypto_hash *__crypto_hash_cast(struct crypto_tfm *tfm)
721{
722 return (struct crypto_hash *)tfm;
723}
724
725static inline struct crypto_hash *crypto_hash_cast(struct crypto_tfm *tfm)
726{
727 BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_HASH) &
728 CRYPTO_ALG_TYPE_HASH_MASK);
729 return __crypto_hash_cast(tfm);
354} 730}
355 731
356static inline int crypto_cipher_setkey(struct crypto_tfm *tfm, 732static int crypto_digest_setkey(struct crypto_tfm *tfm, const u8 *key,
733 unsigned int keylen) __deprecated;
734static inline int crypto_digest_setkey(struct crypto_tfm *tfm,
357 const u8 *key, unsigned int keylen) 735 const u8 *key, unsigned int keylen)
358{ 736{
359 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 737 return tfm->crt_hash.setkey(crypto_hash_cast(tfm), key, keylen);
360 return tfm->crt_cipher.cit_setkey(tfm, key, keylen); 738}
739
740static inline struct crypto_hash *crypto_alloc_hash(const char *alg_name,
741 u32 type, u32 mask)
742{
743 type &= ~CRYPTO_ALG_TYPE_MASK;
744 type |= CRYPTO_ALG_TYPE_HASH;
745 mask |= CRYPTO_ALG_TYPE_HASH_MASK;
746
747 return __crypto_hash_cast(crypto_alloc_base(alg_name, type, mask));
748}
749
750static inline struct crypto_tfm *crypto_hash_tfm(struct crypto_hash *tfm)
751{
752 return &tfm->base;
753}
754
755static inline void crypto_free_hash(struct crypto_hash *tfm)
756{
757 crypto_free_tfm(crypto_hash_tfm(tfm));
758}
759
760static inline int crypto_has_hash(const char *alg_name, u32 type, u32 mask)
761{
762 type &= ~CRYPTO_ALG_TYPE_MASK;
763 type |= CRYPTO_ALG_TYPE_HASH;
764 mask |= CRYPTO_ALG_TYPE_HASH_MASK;
765
766 return crypto_has_alg(alg_name, type, mask);
767}
768
769static inline struct hash_tfm *crypto_hash_crt(struct crypto_hash *tfm)
770{
771 return &crypto_hash_tfm(tfm)->crt_hash;
772}
773
774static inline unsigned int crypto_hash_blocksize(struct crypto_hash *tfm)
775{
776 return crypto_tfm_alg_blocksize(crypto_hash_tfm(tfm));
777}
778
779static inline unsigned int crypto_hash_alignmask(struct crypto_hash *tfm)
780{
781 return crypto_tfm_alg_alignmask(crypto_hash_tfm(tfm));
782}
783
784static inline unsigned int crypto_hash_digestsize(struct crypto_hash *tfm)
785{
786 return crypto_hash_crt(tfm)->digestsize;
787}
788
789static inline u32 crypto_hash_get_flags(struct crypto_hash *tfm)
790{
791 return crypto_tfm_get_flags(crypto_hash_tfm(tfm));
792}
793
794static inline void crypto_hash_set_flags(struct crypto_hash *tfm, u32 flags)
795{
796 crypto_tfm_set_flags(crypto_hash_tfm(tfm), flags);
361} 797}
362 798
799static inline void crypto_hash_clear_flags(struct crypto_hash *tfm, u32 flags)
800{
801 crypto_tfm_clear_flags(crypto_hash_tfm(tfm), flags);
802}
803
804static inline int crypto_hash_init(struct hash_desc *desc)
805{
806 return crypto_hash_crt(desc->tfm)->init(desc);
807}
808
809static inline int crypto_hash_update(struct hash_desc *desc,
810 struct scatterlist *sg,
811 unsigned int nbytes)
812{
813 return crypto_hash_crt(desc->tfm)->update(desc, sg, nbytes);
814}
815
816static inline int crypto_hash_final(struct hash_desc *desc, u8 *out)
817{
818 return crypto_hash_crt(desc->tfm)->final(desc, out);
819}
820
821static inline int crypto_hash_digest(struct hash_desc *desc,
822 struct scatterlist *sg,
823 unsigned int nbytes, u8 *out)
824{
825 return crypto_hash_crt(desc->tfm)->digest(desc, sg, nbytes, out);
826}
827
828static inline int crypto_hash_setkey(struct crypto_hash *hash,
829 const u8 *key, unsigned int keylen)
830{
831 return crypto_hash_crt(hash)->setkey(hash, key, keylen);
832}
833
834static int crypto_cipher_encrypt(struct crypto_tfm *tfm,
835 struct scatterlist *dst,
836 struct scatterlist *src,
837 unsigned int nbytes) __deprecated;
363static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm, 838static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
364 struct scatterlist *dst, 839 struct scatterlist *dst,
365 struct scatterlist *src, 840 struct scatterlist *src,
@@ -369,16 +844,23 @@ static inline int crypto_cipher_encrypt(struct crypto_tfm *tfm,
369 return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes); 844 return tfm->crt_cipher.cit_encrypt(tfm, dst, src, nbytes);
370} 845}
371 846
847static int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
848 struct scatterlist *dst,
849 struct scatterlist *src,
850 unsigned int nbytes, u8 *iv) __deprecated;
372static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm, 851static inline int crypto_cipher_encrypt_iv(struct crypto_tfm *tfm,
373 struct scatterlist *dst, 852 struct scatterlist *dst,
374 struct scatterlist *src, 853 struct scatterlist *src,
375 unsigned int nbytes, u8 *iv) 854 unsigned int nbytes, u8 *iv)
376{ 855{
377 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 856 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
378 BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
379 return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv); 857 return tfm->crt_cipher.cit_encrypt_iv(tfm, dst, src, nbytes, iv);
380} 858}
381 859
860static int crypto_cipher_decrypt(struct crypto_tfm *tfm,
861 struct scatterlist *dst,
862 struct scatterlist *src,
863 unsigned int nbytes) __deprecated;
382static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm, 864static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
383 struct scatterlist *dst, 865 struct scatterlist *dst,
384 struct scatterlist *src, 866 struct scatterlist *src,
@@ -388,16 +870,21 @@ static inline int crypto_cipher_decrypt(struct crypto_tfm *tfm,
388 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes); 870 return tfm->crt_cipher.cit_decrypt(tfm, dst, src, nbytes);
389} 871}
390 872
873static int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
874 struct scatterlist *dst,
875 struct scatterlist *src,
876 unsigned int nbytes, u8 *iv) __deprecated;
391static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm, 877static inline int crypto_cipher_decrypt_iv(struct crypto_tfm *tfm,
392 struct scatterlist *dst, 878 struct scatterlist *dst,
393 struct scatterlist *src, 879 struct scatterlist *src,
394 unsigned int nbytes, u8 *iv) 880 unsigned int nbytes, u8 *iv)
395{ 881{
396 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER); 882 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_CIPHER);
397 BUG_ON(tfm->crt_cipher.cit_mode == CRYPTO_TFM_MODE_ECB);
398 return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv); 883 return tfm->crt_cipher.cit_decrypt_iv(tfm, dst, src, nbytes, iv);
399} 884}
400 885
886static void crypto_cipher_set_iv(struct crypto_tfm *tfm,
887 const u8 *src, unsigned int len) __deprecated;
401static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm, 888static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
402 const u8 *src, unsigned int len) 889 const u8 *src, unsigned int len)
403{ 890{
@@ -405,6 +892,8 @@ static inline void crypto_cipher_set_iv(struct crypto_tfm *tfm,
405 memcpy(tfm->crt_cipher.cit_iv, src, len); 892 memcpy(tfm->crt_cipher.cit_iv, src, len);
406} 893}
407 894
895static void crypto_cipher_get_iv(struct crypto_tfm *tfm,
896 u8 *dst, unsigned int len) __deprecated;
408static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm, 897static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
409 u8 *dst, unsigned int len) 898 u8 *dst, unsigned int len)
410{ 899{
@@ -412,34 +901,70 @@ static inline void crypto_cipher_get_iv(struct crypto_tfm *tfm,
412 memcpy(dst, tfm->crt_cipher.cit_iv, len); 901 memcpy(dst, tfm->crt_cipher.cit_iv, len);
413} 902}
414 903
415static inline int crypto_comp_compress(struct crypto_tfm *tfm, 904static inline struct crypto_comp *__crypto_comp_cast(struct crypto_tfm *tfm)
905{
906 return (struct crypto_comp *)tfm;
907}
908
909static inline struct crypto_comp *crypto_comp_cast(struct crypto_tfm *tfm)
910{
911 BUG_ON((crypto_tfm_alg_type(tfm) ^ CRYPTO_ALG_TYPE_COMPRESS) &
912 CRYPTO_ALG_TYPE_MASK);
913 return __crypto_comp_cast(tfm);
914}
915
916static inline struct crypto_comp *crypto_alloc_comp(const char *alg_name,
917 u32 type, u32 mask)
918{
919 type &= ~CRYPTO_ALG_TYPE_MASK;
920 type |= CRYPTO_ALG_TYPE_COMPRESS;
921 mask |= CRYPTO_ALG_TYPE_MASK;
922
923 return __crypto_comp_cast(crypto_alloc_base(alg_name, type, mask));
924}
925
926static inline struct crypto_tfm *crypto_comp_tfm(struct crypto_comp *tfm)
927{
928 return tfm;
929}
930
931static inline void crypto_free_comp(struct crypto_comp *tfm)
932{
933 crypto_free_tfm(crypto_comp_tfm(tfm));
934}
935
936static inline int crypto_has_comp(const char *alg_name, u32 type, u32 mask)
937{
938 type &= ~CRYPTO_ALG_TYPE_MASK;
939 type |= CRYPTO_ALG_TYPE_COMPRESS;
940 mask |= CRYPTO_ALG_TYPE_MASK;
941
942 return crypto_has_alg(alg_name, type, mask);
943}
944
945static inline const char *crypto_comp_name(struct crypto_comp *tfm)
946{
947 return crypto_tfm_alg_name(crypto_comp_tfm(tfm));
948}
949
950static inline struct compress_tfm *crypto_comp_crt(struct crypto_comp *tfm)
951{
952 return &crypto_comp_tfm(tfm)->crt_compress;
953}
954
955static inline int crypto_comp_compress(struct crypto_comp *tfm,
416 const u8 *src, unsigned int slen, 956 const u8 *src, unsigned int slen,
417 u8 *dst, unsigned int *dlen) 957 u8 *dst, unsigned int *dlen)
418{ 958{
419 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); 959 return crypto_comp_crt(tfm)->cot_compress(tfm, src, slen, dst, dlen);
420 return tfm->crt_compress.cot_compress(tfm, src, slen, dst, dlen);
421} 960}
422 961
423static inline int crypto_comp_decompress(struct crypto_tfm *tfm, 962static inline int crypto_comp_decompress(struct crypto_comp *tfm,
424 const u8 *src, unsigned int slen, 963 const u8 *src, unsigned int slen,
425 u8 *dst, unsigned int *dlen) 964 u8 *dst, unsigned int *dlen)
426{ 965{
427 BUG_ON(crypto_tfm_alg_type(tfm) != CRYPTO_ALG_TYPE_COMPRESS); 966 return crypto_comp_crt(tfm)->cot_decompress(tfm, src, slen, dst, dlen);
428 return tfm->crt_compress.cot_decompress(tfm, src, slen, dst, dlen);
429} 967}
430 968
431/*
432 * HMAC support.
433 */
434#ifdef CONFIG_CRYPTO_HMAC
435void crypto_hmac_init(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen);
436void crypto_hmac_update(struct crypto_tfm *tfm,
437 struct scatterlist *sg, unsigned int nsg);
438void crypto_hmac_final(struct crypto_tfm *tfm, u8 *key,
439 unsigned int *keylen, u8 *out);
440void crypto_hmac(struct crypto_tfm *tfm, u8 *key, unsigned int *keylen,
441 struct scatterlist *sg, unsigned int nsg, u8 *out);
442#endif /* CONFIG_CRYPTO_HMAC */
443
444#endif /* _LINUX_CRYPTO_H */ 969#endif /* _LINUX_CRYPTO_H */
445 970
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 471781ffeab1..44605be59409 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -221,6 +221,7 @@ static inline int dname_external(struct dentry *dentry)
221 */ 221 */
222extern void d_instantiate(struct dentry *, struct inode *); 222extern void d_instantiate(struct dentry *, struct inode *);
223extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *); 223extern struct dentry * d_instantiate_unique(struct dentry *, struct inode *);
224extern struct dentry * d_materialise_unique(struct dentry *, struct inode *);
224extern void d_delete(struct dentry *); 225extern void d_delete(struct dentry *);
225 226
226/* allocate/de-allocate */ 227/* allocate/de-allocate */
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 676333b9fad0..2d7671c92c0b 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -438,6 +438,7 @@ struct dccp_ackvec;
438 * @dccps_role - Role of this sock, one of %dccp_role 438 * @dccps_role - Role of this sock, one of %dccp_role
439 * @dccps_ndp_count - number of Non Data Packets since last data packet 439 * @dccps_ndp_count - number of Non Data Packets since last data packet
440 * @dccps_hc_rx_ackvec - rx half connection ack vector 440 * @dccps_hc_rx_ackvec - rx half connection ack vector
441 * @dccps_xmit_timer - timer for when CCID is not ready to send
441 */ 442 */
442struct dccp_sock { 443struct dccp_sock {
443 /* inet_connection_sock has to be the first member of dccp_sock */ 444 /* inet_connection_sock has to be the first member of dccp_sock */
@@ -470,6 +471,7 @@ struct dccp_sock {
470 enum dccp_role dccps_role:2; 471 enum dccp_role dccps_role:2;
471 __u8 dccps_hc_rx_insert_options:1; 472 __u8 dccps_hc_rx_insert_options:1;
472 __u8 dccps_hc_tx_insert_options:1; 473 __u8 dccps_hc_tx_insert_options:1;
474 struct timer_list dccps_xmit_timer;
473}; 475};
474 476
475static inline struct dccp_sock *dccp_sk(const struct sock *sk) 477static inline struct dccp_sock *dccp_sk(const struct sock *sk)
diff --git a/include/linux/efs_fs_sb.h b/include/linux/efs_fs_sb.h
index c76088baef28..ff1945e37790 100644
--- a/include/linux/efs_fs_sb.h
+++ b/include/linux/efs_fs_sb.h
@@ -9,8 +9,7 @@
9#ifndef __EFS_FS_SB_H__ 9#ifndef __EFS_FS_SB_H__
10#define __EFS_FS_SB_H__ 10#define __EFS_FS_SB_H__
11 11
12/* statfs() magic number for EFS */ 12#include <linux/magic.h>
13#define EFS_SUPER_MAGIC 0x414A53
14 13
15/* EFS superblock magic numbers */ 14/* EFS superblock magic numbers */
16#define EFS_MAGIC 0x072959 15#define EFS_MAGIC 0x072959
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index facf34e98954..33a1aa107329 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -17,6 +17,7 @@
17#define _LINUX_EXT2_FS_H 17#define _LINUX_EXT2_FS_H
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/magic.h>
20 21
21/* 22/*
22 * The second extended filesystem constants/structures 23 * The second extended filesystem constants/structures
@@ -63,11 +64,6 @@
63/* First non-reserved inode for old ext2 filesystems */ 64/* First non-reserved inode for old ext2 filesystems */
64#define EXT2_GOOD_OLD_FIRST_INO 11 65#define EXT2_GOOD_OLD_FIRST_INO 11
65 66
66/*
67 * The second extended file system magic number
68 */
69#define EXT2_SUPER_MAGIC 0xEF53
70
71#ifdef __KERNEL__ 67#ifdef __KERNEL__
72#include <linux/ext2_fs_sb.h> 68#include <linux/ext2_fs_sb.h>
73static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb) 69static inline struct ext2_sb_info *EXT2_SB(struct super_block *sb)
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 9f9cce7bd86d..0eed918b3816 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -17,6 +17,7 @@
17#define _LINUX_EXT3_FS_H 17#define _LINUX_EXT3_FS_H
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/magic.h>
20 21
21/* 22/*
22 * The second extended filesystem constants/structures 23 * The second extended filesystem constants/structures
@@ -67,11 +68,6 @@
67#define EXT3_GOOD_OLD_FIRST_INO 11 68#define EXT3_GOOD_OLD_FIRST_INO 11
68 69
69/* 70/*
70 * The second extended file system magic number
71 */
72#define EXT3_SUPER_MAGIC 0xEF53
73
74/*
75 * Maximal count of links to a file 71 * Maximal count of links to a file
76 */ 72 */
77#define EXT3_LINK_MAX 32000 73#define EXT3_LINK_MAX 32000
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
new file mode 100644
index 000000000000..4418c8d9d479
--- /dev/null
+++ b/include/linux/fib_rules.h
@@ -0,0 +1,65 @@
1#ifndef __LINUX_FIB_RULES_H
2#define __LINUX_FIB_RULES_H
3
4#include <linux/types.h>
5#include <linux/rtnetlink.h>
6
7/* rule is permanent, and cannot be deleted */
8#define FIB_RULE_PERMANENT 1
9
10struct fib_rule_hdr
11{
12 __u8 family;
13 __u8 dst_len;
14 __u8 src_len;
15 __u8 tos;
16
17 __u8 table;
18 __u8 res1; /* reserved */
19 __u8 res2; /* reserved */
20 __u8 action;
21
22 __u32 flags;
23};
24
25enum
26{
27 FRA_UNSPEC,
28 FRA_DST, /* destination address */
29 FRA_SRC, /* source address */
30 FRA_IFNAME, /* interface name */
31 FRA_UNUSED1,
32 FRA_UNUSED2,
33 FRA_PRIORITY, /* priority/preference */
34 FRA_UNUSED3,
35 FRA_UNUSED4,
36 FRA_UNUSED5,
37 FRA_FWMARK, /* netfilter mark */
38 FRA_FLOW, /* flow/class id */
39 FRA_UNUSED6,
40 FRA_UNUSED7,
41 FRA_UNUSED8,
42 FRA_TABLE, /* Extended table id */
43 FRA_FWMASK, /* mask for netfilter mark */
44 __FRA_MAX
45};
46
47#define FRA_MAX (__FRA_MAX - 1)
48
49enum
50{
51 FR_ACT_UNSPEC,
52 FR_ACT_TO_TBL, /* Pass to fixed table */
53 FR_ACT_RES1,
54 FR_ACT_RES2,
55 FR_ACT_RES3,
56 FR_ACT_RES4,
57 FR_ACT_BLACKHOLE, /* Drop without notification */
58 FR_ACT_UNREACHABLE, /* Drop with ENETUNREACH */
59 FR_ACT_PROHIBIT, /* Drop with EACCES */
60 __FR_ACT_MAX,
61};
62
63#define FR_ACT_MAX (__FR_ACT_MAX - 1)
64
65#endif
diff --git a/include/linux/filter.h b/include/linux/filter.h
index c6cb8f095088..91b2e3b9251e 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -25,10 +25,10 @@
25 25
26struct sock_filter /* Filter block */ 26struct sock_filter /* Filter block */
27{ 27{
28 __u16 code; /* Actual filter code */ 28 __u16 code; /* Actual filter code */
29 __u8 jt; /* Jump true */ 29 __u8 jt; /* Jump true */
30 __u8 jf; /* Jump false */ 30 __u8 jf; /* Jump false */
31 __u32 k; /* Generic multiuse field */ 31 __u32 k; /* Generic multiuse field */
32}; 32};
33 33
34struct sock_fprog /* Required for SO_ATTACH_FILTER. */ 34struct sock_fprog /* Required for SO_ATTACH_FILTER. */
@@ -41,8 +41,9 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */
41struct sk_filter 41struct sk_filter
42{ 42{
43 atomic_t refcnt; 43 atomic_t refcnt;
44 unsigned int len; /* Number of filter blocks */ 44 unsigned int len; /* Number of filter blocks */
45 struct sock_filter insns[0]; 45 struct rcu_head rcu;
46 struct sock_filter insns[0];
46}; 47};
47 48
48static inline unsigned int sk_filter_len(struct sk_filter *fp) 49static inline unsigned int sk_filter_len(struct sk_filter *fp)
diff --git a/include/linux/genetlink.h b/include/linux/genetlink.h
index 84f12a41dc01..9049dc65ae51 100644
--- a/include/linux/genetlink.h
+++ b/include/linux/genetlink.h
@@ -16,6 +16,8 @@ struct genlmsghdr {
16 16
17#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr)) 17#define GENL_HDRLEN NLMSG_ALIGN(sizeof(struct genlmsghdr))
18 18
19#define GENL_ADMIN_PERM 0x01
20
19/* 21/*
20 * List of reserved static generic netlink identifiers: 22 * List of reserved static generic netlink identifiers:
21 */ 23 */
@@ -43,9 +45,25 @@ enum {
43 CTRL_ATTR_UNSPEC, 45 CTRL_ATTR_UNSPEC,
44 CTRL_ATTR_FAMILY_ID, 46 CTRL_ATTR_FAMILY_ID,
45 CTRL_ATTR_FAMILY_NAME, 47 CTRL_ATTR_FAMILY_NAME,
48 CTRL_ATTR_VERSION,
49 CTRL_ATTR_HDRSIZE,
50 CTRL_ATTR_MAXATTR,
51 CTRL_ATTR_OPS,
46 __CTRL_ATTR_MAX, 52 __CTRL_ATTR_MAX,
47}; 53};
48 54
49#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1) 55#define CTRL_ATTR_MAX (__CTRL_ATTR_MAX - 1)
50 56
57enum {
58 CTRL_ATTR_OP_UNSPEC,
59 CTRL_ATTR_OP_ID,
60 CTRL_ATTR_OP_FLAGS,
61 CTRL_ATTR_OP_POLICY,
62 CTRL_ATTR_OP_DOIT,
63 CTRL_ATTR_OP_DUMPIT,
64 __CTRL_ATTR_OP_MAX,
65};
66
67#define CTRL_ATTR_OP_MAX (__CTRL_ATTR_OP_MAX - 1)
68
51#endif /* __LINUX_GENERIC_NETLINK_H */ 69#endif /* __LINUX_GENERIC_NETLINK_H */
diff --git a/include/linux/hpfs_fs.h b/include/linux/hpfs_fs.h
deleted file mode 100644
index a5028dd94d31..000000000000
--- a/include/linux/hpfs_fs.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef _LINUX_HPFS_FS_H
2#define _LINUX_HPFS_FS_H
3
4/* HPFS magic number (word 0 of block 16) */
5
6#define HPFS_SUPER_MAGIC 0xf995e849
7
8#endif
diff --git a/include/linux/if.h b/include/linux/if.h
index 374e20ad8b0d..cd080d765324 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -212,5 +212,134 @@ struct ifconf
212#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ 212#define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */
213#define ifc_req ifc_ifcu.ifcu_req /* array of structures */ 213#define ifc_req ifc_ifcu.ifcu_req /* array of structures */
214 214
215/* The struct should be in sync with struct net_device_stats */
216struct rtnl_link_stats
217{
218 __u32 rx_packets; /* total packets received */
219 __u32 tx_packets; /* total packets transmitted */
220 __u32 rx_bytes; /* total bytes received */
221 __u32 tx_bytes; /* total bytes transmitted */
222 __u32 rx_errors; /* bad packets received */
223 __u32 tx_errors; /* packet transmit problems */
224 __u32 rx_dropped; /* no space in linux buffers */
225 __u32 tx_dropped; /* no space available in linux */
226 __u32 multicast; /* multicast packets received */
227 __u32 collisions;
228
229 /* detailed rx_errors: */
230 __u32 rx_length_errors;
231 __u32 rx_over_errors; /* receiver ring buff overflow */
232 __u32 rx_crc_errors; /* recved pkt with crc error */
233 __u32 rx_frame_errors; /* recv'd frame alignment error */
234 __u32 rx_fifo_errors; /* recv'r fifo overrun */
235 __u32 rx_missed_errors; /* receiver missed packet */
236
237 /* detailed tx_errors */
238 __u32 tx_aborted_errors;
239 __u32 tx_carrier_errors;
240 __u32 tx_fifo_errors;
241 __u32 tx_heartbeat_errors;
242 __u32 tx_window_errors;
243
244 /* for cslip etc */
245 __u32 rx_compressed;
246 __u32 tx_compressed;
247};
248
249/* The struct should be in sync with struct ifmap */
250struct rtnl_link_ifmap
251{
252 __u64 mem_start;
253 __u64 mem_end;
254 __u64 base_addr;
255 __u16 irq;
256 __u8 dma;
257 __u8 port;
258};
259
260enum
261{
262 IFLA_UNSPEC,
263 IFLA_ADDRESS,
264 IFLA_BROADCAST,
265 IFLA_IFNAME,
266 IFLA_MTU,
267 IFLA_LINK,
268 IFLA_QDISC,
269 IFLA_STATS,
270 IFLA_COST,
271#define IFLA_COST IFLA_COST
272 IFLA_PRIORITY,
273#define IFLA_PRIORITY IFLA_PRIORITY
274 IFLA_MASTER,
275#define IFLA_MASTER IFLA_MASTER
276 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
277#define IFLA_WIRELESS IFLA_WIRELESS
278 IFLA_PROTINFO, /* Protocol specific information for a link */
279#define IFLA_PROTINFO IFLA_PROTINFO
280 IFLA_TXQLEN,
281#define IFLA_TXQLEN IFLA_TXQLEN
282 IFLA_MAP,
283#define IFLA_MAP IFLA_MAP
284 IFLA_WEIGHT,
285#define IFLA_WEIGHT IFLA_WEIGHT
286 IFLA_OPERSTATE,
287 IFLA_LINKMODE,
288 __IFLA_MAX
289};
290
291
292#define IFLA_MAX (__IFLA_MAX - 1)
293
294/* ifi_flags.
295
296 IFF_* flags.
297
298 The only change is:
299 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
300 more not changeable by user. They describe link media
301 characteristics and set by device driver.
302
303 Comments:
304 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
305 - If neither of these three flags are set;
306 the interface is NBMA.
307
308 - IFF_MULTICAST does not mean anything special:
309 multicasts can be used on all not-NBMA links.
310 IFF_MULTICAST means that this media uses special encapsulation
311 for multicast frames. Apparently, all IFF_POINTOPOINT and
312 IFF_BROADCAST devices are able to use multicasts too.
313 */
314
315/* IFLA_LINK.
316 For usual devices it is equal ifi_index.
317 If it is a "virtual interface" (f.e. tunnel), ifi_link
318 can point to real physical interface (f.e. for bandwidth calculations),
319 or maybe 0, what means, that real media is unknown (usual
320 for IPIP tunnels, when route to endpoint is allowed to change)
321 */
322
323/* Subtype attributes for IFLA_PROTINFO */
324enum
325{
326 IFLA_INET6_UNSPEC,
327 IFLA_INET6_FLAGS, /* link flags */
328 IFLA_INET6_CONF, /* sysctl parameters */
329 IFLA_INET6_STATS, /* statistics */
330 IFLA_INET6_MCAST, /* MC things. What of them? */
331 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
332 __IFLA_INET6_MAX
333};
334
335#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
336
337struct ifla_cacheinfo
338{
339 __u32 max_reasm_len;
340 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
341 __u32 reachable_time;
342 __u32 retrans_time;
343};
215 344
216#endif /* _LINUX_IF_H */ 345#endif /* _LINUX_IF_H */
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h
new file mode 100644
index 000000000000..dbe8f6120a40
--- /dev/null
+++ b/include/linux/if_addr.h
@@ -0,0 +1,55 @@
1#ifndef __LINUX_IF_ADDR_H
2#define __LINUX_IF_ADDR_H
3
4#include <linux/netlink.h>
5
6struct ifaddrmsg
7{
8 __u8 ifa_family;
9 __u8 ifa_prefixlen; /* The prefix length */
10 __u8 ifa_flags; /* Flags */
11 __u8 ifa_scope; /* Address scope */
12 __u32 ifa_index; /* Link index */
13};
14
15/*
16 * Important comment:
17 * IFA_ADDRESS is prefix address, rather than local interface address.
18 * It makes no difference for normally configured broadcast interfaces,
19 * but for point-to-point IFA_ADDRESS is DESTINATION address,
20 * local address is supplied in IFA_LOCAL attribute.
21 */
22enum
23{
24 IFA_UNSPEC,
25 IFA_ADDRESS,
26 IFA_LOCAL,
27 IFA_LABEL,
28 IFA_BROADCAST,
29 IFA_ANYCAST,
30 IFA_CACHEINFO,
31 IFA_MULTICAST,
32 __IFA_MAX,
33};
34
35#define IFA_MAX (__IFA_MAX - 1)
36
37/* ifa_flags */
38#define IFA_F_SECONDARY 0x01
39#define IFA_F_TEMPORARY IFA_F_SECONDARY
40
41#define IFA_F_NODAD 0x02
42#define IFA_F_HOMEADDRESS 0x10
43#define IFA_F_DEPRECATED 0x20
44#define IFA_F_TENTATIVE 0x40
45#define IFA_F_PERMANENT 0x80
46
47struct ifa_cacheinfo
48{
49 __u32 ifa_prefered;
50 __u32 ifa_valid;
51 __u32 cstamp; /* created timestamp, hundredths of seconds */
52 __u32 tstamp; /* updated timestamp, hundredths of seconds */
53};
54
55#endif
diff --git a/include/linux/in.h b/include/linux/in.h
index 94f557fa4636..bcaca8399aed 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -52,7 +52,7 @@ enum {
52 52
53/* Internet address. */ 53/* Internet address. */
54struct in_addr { 54struct in_addr {
55 __u32 s_addr; 55 __be32 s_addr;
56}; 56};
57 57
58#define IP_TOS 1 58#define IP_TOS 1
@@ -177,7 +177,7 @@ struct in_pktinfo
177#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 177#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
178struct sockaddr_in { 178struct sockaddr_in {
179 sa_family_t sin_family; /* Address family */ 179 sa_family_t sin_family; /* Address family */
180 unsigned short int sin_port; /* Port number */ 180 __be16 sin_port; /* Port number */
181 struct in_addr sin_addr; /* Internet address */ 181 struct in_addr sin_addr; /* Internet address */
182 182
183 /* Pad to size of `struct sockaddr'. */ 183 /* Pad to size of `struct sockaddr'. */
diff --git a/include/linux/in6.h b/include/linux/in6.h
index 304aaedea305..d776829b443f 100644
--- a/include/linux/in6.h
+++ b/include/linux/in6.h
@@ -134,6 +134,7 @@ struct in6_flowlabel_req
134#define IPPROTO_ICMPV6 58 /* ICMPv6 */ 134#define IPPROTO_ICMPV6 58 /* ICMPv6 */
135#define IPPROTO_NONE 59 /* IPv6 no next header */ 135#define IPPROTO_NONE 59 /* IPv6 no next header */
136#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ 136#define IPPROTO_DSTOPTS 60 /* IPv6 destination options */
137#define IPPROTO_MH 135 /* IPv6 mobility header */
137 138
138/* 139/*
139 * IPv6 TLV options. 140 * IPv6 TLV options.
@@ -142,6 +143,7 @@ struct in6_flowlabel_req
142#define IPV6_TLV_PADN 1 143#define IPV6_TLV_PADN 1
143#define IPV6_TLV_ROUTERALERT 5 144#define IPV6_TLV_ROUTERALERT 5
144#define IPV6_TLV_JUMBO 194 145#define IPV6_TLV_JUMBO 194
146#define IPV6_TLV_HAO 201 /* home address option */
145 147
146/* 148/*
147 * IPV6 socket options 149 * IPV6 socket options
diff --git a/include/linux/inet.h b/include/linux/inet.h
index 6c5587af118d..b7c6da7d6d32 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -46,5 +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);
50extern int in6_pton(const char *src, int srclen, u8 *dst, char delim, const char **end);
49#endif 51#endif
50#endif /* _LINUX_INET_H */ 52#endif /* _LINUX_INET_H */
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 4b55cf1df732..2f4600146f83 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -57,6 +57,7 @@
57#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY) 57#define IPOPT_SEC (2 |IPOPT_CONTROL|IPOPT_COPY)
58#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY) 58#define IPOPT_LSRR (3 |IPOPT_CONTROL|IPOPT_COPY)
59#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT) 59#define IPOPT_TIMESTAMP (4 |IPOPT_MEASUREMENT)
60#define IPOPT_CIPSO (6 |IPOPT_CONTROL|IPOPT_COPY)
60#define IPOPT_RR (7 |IPOPT_CONTROL) 61#define IPOPT_RR (7 |IPOPT_CONTROL)
61#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY) 62#define IPOPT_SID (8 |IPOPT_CONTROL|IPOPT_COPY)
62#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY) 63#define IPOPT_SSRR (9 |IPOPT_CONTROL|IPOPT_COPY)
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 297853c841b4..caca57df0d7d 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -29,6 +29,7 @@ struct in6_ifreq {
29 29
30#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */ 30#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
31#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */ 31#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
32#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
32 33
33/* 34/*
34 * routing header 35 * routing header
@@ -73,6 +74,28 @@ struct rt0_hdr {
73#define rt0_type rt_hdr.type 74#define rt0_type rt_hdr.type
74}; 75};
75 76
77/*
78 * routing header type 2
79 */
80
81struct rt2_hdr {
82 struct ipv6_rt_hdr rt_hdr;
83 __u32 reserved;
84 struct in6_addr addr;
85
86#define rt2_type rt_hdr.type
87};
88
89/*
90 * home address option in destination options header
91 */
92
93struct ipv6_destopt_hao {
94 __u8 type;
95 __u8 length;
96 struct in6_addr addr;
97} __attribute__ ((__packed__));
98
76struct ipv6_auth_hdr { 99struct ipv6_auth_hdr {
77 __u8 nexthdr; 100 __u8 nexthdr;
78 __u8 hdrlen; /* This one is measured in 32 bit units! */ 101 __u8 hdrlen; /* This one is measured in 32 bit units! */
@@ -153,6 +176,7 @@ struct ipv6_devconf {
153 __s32 accept_ra_rt_info_max_plen; 176 __s32 accept_ra_rt_info_max_plen;
154#endif 177#endif
155#endif 178#endif
179 __s32 proxy_ndp;
156 void *sysctl; 180 void *sysctl;
157}; 181};
158 182
@@ -180,6 +204,7 @@ enum {
180 DEVCONF_ACCEPT_RA_RTR_PREF, 204 DEVCONF_ACCEPT_RA_RTR_PREF,
181 DEVCONF_RTR_PROBE_INTERVAL, 205 DEVCONF_RTR_PROBE_INTERVAL,
182 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, 206 DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
207 DEVCONF_PROXY_NDP,
183 DEVCONF_MAX 208 DEVCONF_MAX
184}; 209};
185 210
@@ -206,6 +231,9 @@ struct inet6_skb_parm {
206 __u16 lastopt; 231 __u16 lastopt;
207 __u32 nhoff; 232 __u32 nhoff;
208 __u16 flags; 233 __u16 flags;
234#ifdef CONFIG_IPV6_MIP6
235 __u16 dsthao;
236#endif
209 237
210#define IP6SKB_XFRM_TRANSFORMED 1 238#define IP6SKB_XFRM_TRANSFORMED 1
211}; 239};
@@ -242,6 +270,9 @@ struct ipv6_pinfo {
242 struct in6_addr rcv_saddr; 270 struct in6_addr rcv_saddr;
243 struct in6_addr daddr; 271 struct in6_addr daddr;
244 struct in6_addr *daddr_cache; 272 struct in6_addr *daddr_cache;
273#ifdef CONFIG_IPV6_SUBTREES
274 struct in6_addr *saddr_cache;
275#endif
245 276
246 __u32 flow_label; 277 __u32 flow_label;
247 __u32 frag_size; 278 __u32 frag_size;
diff --git a/include/linux/iso_fs.h b/include/linux/iso_fs.h
index 47967878bfef..4688ac4284e2 100644
--- a/include/linux/iso_fs.h
+++ b/include/linux/iso_fs.h
@@ -2,6 +2,8 @@
2#define _ISOFS_FS_H 2#define _ISOFS_FS_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/magic.h>
6
5/* 7/*
6 * The isofs filesystem constants/structures 8 * The isofs filesystem constants/structures
7 */ 9 */
@@ -160,6 +162,4 @@ struct iso_directory_record {
160#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize) 162#define ISOFS_BUFFER_SIZE(INODE) ((INODE)->i_sb->s_blocksize)
161#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits) 163#define ISOFS_BUFFER_BITS(INODE) ((INODE)->i_sb->s_blocksize_bits)
162 164
163#define ISOFS_SUPER_MAGIC 0x9660 165#endif /* _ISOFS_FS_H */
164
165#endif
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index c9c760700bc3..840631fa5ff1 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -15,12 +15,12 @@
15#ifndef __LINUX_JFFS2_H__ 15#ifndef __LINUX_JFFS2_H__
16#define __LINUX_JFFS2_H__ 16#define __LINUX_JFFS2_H__
17 17
18#include <linux/magic.h>
19
18/* You must include something which defines the C99 uintXX_t types. 20/* You must include something which defines the C99 uintXX_t types.
19 We don't do it from here because this file is used in too many 21 We don't do it from here because this file is used in too many
20 different environments. */ 22 different environments. */
21 23
22#define JFFS2_SUPER_MAGIC 0x72b6
23
24/* Values we may expect to find in the 'magic' field */ 24/* Values we may expect to find in the 'magic' field */
25#define JFFS2_OLD_MAGIC_BITMASK 0x1984 25#define JFFS2_OLD_MAGIC_BITMASK 0x1984
26#define JFFS2_MAGIC_BITMASK 0x1985 26#define JFFS2_MAGIC_BITMASK 0x1985
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 851aa1bcfc1a..2b2ae4fdce8b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -31,7 +31,7 @@ extern const char linux_banner[];
31#define STACK_MAGIC 0xdeadbeef 31#define STACK_MAGIC 0xdeadbeef
32 32
33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 33#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
34#define ALIGN(x,a) (((x)+(a)-1)&~((a)-1)) 34#define ALIGN(x,a) (((x)+(a)-1UL)&~((a)-1UL))
35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 35#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
36#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y)) 36#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
37 37
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 66c3100c2b94..1ef3d3901b47 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -36,6 +36,8 @@
36#include <linux/workqueue.h> 36#include <linux/workqueue.h>
37#include <scsi/scsi_host.h> 37#include <scsi/scsi_host.h>
38 38
39#include <asm/libata-portmap.h>
40
39/* 41/*
40 * compile-time options: to be removed as soon as all the drivers are 42 * compile-time options: to be removed as soon as all the drivers are
41 * converted to the new debugging mechanism 43 * converted to the new debugging mechanism
@@ -44,7 +46,7 @@
44#undef ATA_VERBOSE_DEBUG /* yet more debugging output */ 46#undef ATA_VERBOSE_DEBUG /* yet more debugging output */
45#undef ATA_IRQ_TRAP /* define to ack screaming irqs */ 47#undef ATA_IRQ_TRAP /* define to ack screaming irqs */
46#undef ATA_NDEBUG /* define to disable quick runtime checks */ 48#undef ATA_NDEBUG /* define to disable quick runtime checks */
47#undef ATA_ENABLE_PATA /* define to enable PATA support in some 49#define ATA_ENABLE_PATA /* define to enable PATA support in some
48 * low-level drivers */ 50 * low-level drivers */
49 51
50 52
@@ -112,8 +114,6 @@ enum {
112 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ 114 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
113 ATA_MAX_QUEUE = 32, 115 ATA_MAX_QUEUE = 32,
114 ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1, 116 ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1,
115 ATA_MAX_SECTORS = 200, /* FIXME */
116 ATA_MAX_SECTORS_LBA48 = 65535,
117 ATA_MAX_BUS = 2, 117 ATA_MAX_BUS = 2,
118 ATA_DEF_BUSY_WAIT = 10000, 118 ATA_DEF_BUSY_WAIT = 10000,
119 ATA_SHORT_PAUSE = (HZ >> 6) + 1, 119 ATA_SHORT_PAUSE = (HZ >> 6) + 1,
@@ -197,8 +197,8 @@ enum {
197 ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */ 197 ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
198 198
199 /* host set flags */ 199 /* host set flags */
200 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ 200 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */
201 201
202 /* various lengths of time */ 202 /* various lengths of time */
203 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 203 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
204 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 204 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
@@ -225,8 +225,8 @@ enum {
225 /* encoding various smaller bitmaps into a single 225 /* encoding various smaller bitmaps into a single
226 * unsigned int bitmap 226 * unsigned int bitmap
227 */ 227 */
228 ATA_BITS_PIO = 5, 228 ATA_BITS_PIO = 7,
229 ATA_BITS_MWDMA = 3, 229 ATA_BITS_MWDMA = 5,
230 ATA_BITS_UDMA = 8, 230 ATA_BITS_UDMA = 8,
231 231
232 ATA_SHIFT_PIO = 0, 232 ATA_SHIFT_PIO = 0,
@@ -289,6 +289,11 @@ enum {
289 * most devices. 289 * most devices.
290 */ 290 */
291 ATA_SPINUP_WAIT = 8000, 291 ATA_SPINUP_WAIT = 8000,
292
293 /* Horkage types. May be set by libata or controller on drives
294 (some horkage may be drive/controller pair dependant */
295
296 ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */
292}; 297};
293 298
294enum hsm_task_states { 299enum hsm_task_states {
@@ -350,23 +355,32 @@ struct ata_probe_ent {
350 struct scsi_host_template *sht; 355 struct scsi_host_template *sht;
351 struct ata_ioports port[ATA_MAX_PORTS]; 356 struct ata_ioports port[ATA_MAX_PORTS];
352 unsigned int n_ports; 357 unsigned int n_ports;
353 unsigned int hard_port_no; 358 unsigned int dummy_port_mask;
354 unsigned int pio_mask; 359 unsigned int pio_mask;
355 unsigned int mwdma_mask; 360 unsigned int mwdma_mask;
356 unsigned int udma_mask; 361 unsigned int udma_mask;
357 unsigned int legacy_mode;
358 unsigned long irq; 362 unsigned long irq;
363 unsigned long irq2;
359 unsigned int irq_flags; 364 unsigned int irq_flags;
360 unsigned long host_flags; 365 unsigned long port_flags;
361 unsigned long host_set_flags; 366 unsigned long _host_flags;
362 void __iomem *mmio_base; 367 void __iomem *mmio_base;
363 void *private_data; 368 void *private_data;
369
370 /* port_info for the secondary port. Together with irq2, it's
371 * used to implement non-uniform secondary port. Currently,
372 * the only user is ata_piix combined mode. This workaround
373 * will be removed together with ata_probe_ent when init model
374 * is updated.
375 */
376 const struct ata_port_info *pinfo2;
364}; 377};
365 378
366struct ata_host_set { 379struct ata_host {
367 spinlock_t lock; 380 spinlock_t lock;
368 struct device *dev; 381 struct device *dev;
369 unsigned long irq; 382 unsigned long irq;
383 unsigned long irq2;
370 void __iomem *mmio_base; 384 void __iomem *mmio_base;
371 unsigned int n_ports; 385 unsigned int n_ports;
372 void *private_data; 386 void *private_data;
@@ -374,7 +388,6 @@ struct ata_host_set {
374 unsigned long flags; 388 unsigned long flags;
375 int simplex_claimed; /* Keep seperate in case we 389 int simplex_claimed; /* Keep seperate in case we
376 ever need to do this locked */ 390 ever need to do this locked */
377 struct ata_host_set *next; /* for legacy mode */
378 struct ata_port *ports[0]; 391 struct ata_port *ports[0];
379}; 392};
380 393
@@ -420,7 +433,7 @@ struct ata_queued_cmd {
420 void *private_data; 433 void *private_data;
421}; 434};
422 435
423struct ata_host_stats { 436struct ata_port_stats {
424 unsigned long unhandled_irq; 437 unsigned long unhandled_irq;
425 unsigned long idle_irq; 438 unsigned long idle_irq;
426 unsigned long rw_reqbuf; 439 unsigned long rw_reqbuf;
@@ -468,6 +481,7 @@ struct ata_device {
468 481
469 /* error history */ 482 /* error history */
470 struct ata_ering ering; 483 struct ata_ering ering;
484 unsigned int horkage; /* List of broken features */
471}; 485};
472 486
473/* Offset into struct ata_device. Fields above it are maintained 487/* Offset into struct ata_device. Fields above it are maintained
@@ -498,14 +512,13 @@ struct ata_eh_context {
498}; 512};
499 513
500struct ata_port { 514struct ata_port {
501 struct Scsi_Host *host; /* our co-allocated scsi host */ 515 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
502 const struct ata_port_operations *ops; 516 const struct ata_port_operations *ops;
503 spinlock_t *lock; 517 spinlock_t *lock;
504 unsigned long flags; /* ATA_FLAG_xxx */ 518 unsigned long flags; /* ATA_FLAG_xxx */
505 unsigned int pflags; /* ATA_PFLAG_xxx */ 519 unsigned int pflags; /* ATA_PFLAG_xxx */
506 unsigned int id; /* unique id req'd by scsi midlyr */ 520 unsigned int id; /* unique id req'd by scsi midlyr */
507 unsigned int port_no; /* unique port #; from zero */ 521 unsigned int port_no; /* unique port #; from zero */
508 unsigned int hard_port_no; /* hardware port #; from zero */
509 522
510 struct ata_prd *prd; /* our SG list */ 523 struct ata_prd *prd; /* our SG list */
511 dma_addr_t prd_dma; /* and its DMA mapping */ 524 dma_addr_t prd_dma; /* and its DMA mapping */
@@ -524,7 +537,7 @@ struct ata_port {
524 unsigned int hw_sata_spd_limit; 537 unsigned int hw_sata_spd_limit;
525 unsigned int sata_spd_limit; /* SATA PHY speed limit */ 538 unsigned int sata_spd_limit; /* SATA PHY speed limit */
526 539
527 /* record runtime error info, protected by host_set lock */ 540 /* record runtime error info, protected by host lock */
528 struct ata_eh_info eh_info; 541 struct ata_eh_info eh_info;
529 /* EH context owned by EH */ 542 /* EH context owned by EH */
530 struct ata_eh_context eh_context; 543 struct ata_eh_context eh_context;
@@ -538,8 +551,8 @@ struct ata_port {
538 unsigned int active_tag; 551 unsigned int active_tag;
539 u32 sactive; 552 u32 sactive;
540 553
541 struct ata_host_stats stats; 554 struct ata_port_stats stats;
542 struct ata_host_set *host_set; 555 struct ata_host *host;
543 struct device *dev; 556 struct device *dev;
544 557
545 struct work_struct port_task; 558 struct work_struct port_task;
@@ -615,7 +628,7 @@ struct ata_port_operations {
615 int (*port_start) (struct ata_port *ap); 628 int (*port_start) (struct ata_port *ap);
616 void (*port_stop) (struct ata_port *ap); 629 void (*port_stop) (struct ata_port *ap);
617 630
618 void (*host_stop) (struct ata_host_set *host_set); 631 void (*host_stop) (struct ata_host *host);
619 632
620 void (*bmdma_stop) (struct ata_queued_cmd *qc); 633 void (*bmdma_stop) (struct ata_queued_cmd *qc);
621 u8 (*bmdma_status) (struct ata_port *ap); 634 u8 (*bmdma_status) (struct ata_port *ap);
@@ -623,7 +636,7 @@ struct ata_port_operations {
623 636
624struct ata_port_info { 637struct ata_port_info {
625 struct scsi_host_template *sht; 638 struct scsi_host_template *sht;
626 unsigned long host_flags; 639 unsigned long flags;
627 unsigned long pio_mask; 640 unsigned long pio_mask;
628 unsigned long mwdma_mask; 641 unsigned long mwdma_mask;
629 unsigned long udma_mask; 642 unsigned long udma_mask;
@@ -649,6 +662,8 @@ extern const unsigned long sata_deb_timing_normal[];
649extern const unsigned long sata_deb_timing_hotplug[]; 662extern const unsigned long sata_deb_timing_hotplug[];
650extern const unsigned long sata_deb_timing_long[]; 663extern const unsigned long sata_deb_timing_long[];
651 664
665extern const struct ata_port_operations ata_dummy_port_ops;
666
652static inline const unsigned long * 667static inline const unsigned long *
653sata_ehc_deb_timing(struct ata_eh_context *ehc) 668sata_ehc_deb_timing(struct ata_eh_context *ehc)
654{ 669{
@@ -658,6 +673,11 @@ sata_ehc_deb_timing(struct ata_eh_context *ehc)
658 return sata_deb_timing_normal; 673 return sata_deb_timing_normal;
659} 674}
660 675
676static inline int ata_port_is_dummy(struct ata_port *ap)
677{
678 return ap->ops == &ata_dummy_port_ops;
679}
680
661extern void ata_port_probe(struct ata_port *); 681extern void ata_port_probe(struct ata_port *);
662extern void __sata_phy_reset(struct ata_port *ap); 682extern void __sata_phy_reset(struct ata_port *ap);
663extern void sata_phy_reset(struct ata_port *ap); 683extern void sata_phy_reset(struct ata_port *ap);
@@ -676,19 +696,30 @@ extern void ata_std_ports(struct ata_ioports *ioaddr);
676extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, 696extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
677 unsigned int n_ports); 697 unsigned int n_ports);
678extern void ata_pci_remove_one (struct pci_dev *pdev); 698extern void ata_pci_remove_one (struct pci_dev *pdev);
679extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t state); 699extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg);
680extern void ata_pci_device_do_resume(struct pci_dev *pdev); 700extern void ata_pci_device_do_resume(struct pci_dev *pdev);
681extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); 701extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg);
682extern int ata_pci_device_resume(struct pci_dev *pdev); 702extern int ata_pci_device_resume(struct pci_dev *pdev);
683extern int ata_pci_clear_simplex(struct pci_dev *pdev); 703extern int ata_pci_clear_simplex(struct pci_dev *pdev);
684#endif /* CONFIG_PCI */ 704#endif /* CONFIG_PCI */
685extern int ata_device_add(const struct ata_probe_ent *ent); 705extern int ata_device_add(const struct ata_probe_ent *ent);
686extern void ata_port_detach(struct ata_port *ap); 706extern void ata_port_detach(struct ata_port *ap);
687extern void ata_host_set_remove(struct ata_host_set *host_set); 707extern void ata_host_init(struct ata_host *, struct device *,
708 unsigned long, const struct ata_port_operations *);
709extern void ata_host_remove(struct ata_host *host);
688extern int ata_scsi_detect(struct scsi_host_template *sht); 710extern int ata_scsi_detect(struct scsi_host_template *sht);
689extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 711extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
690extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 712extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
691extern int ata_scsi_release(struct Scsi_Host *host); 713extern int ata_scsi_release(struct Scsi_Host *host);
714extern void ata_sas_port_destroy(struct ata_port *);
715extern struct ata_port *ata_sas_port_alloc(struct ata_host *,
716 struct ata_port_info *, struct Scsi_Host *);
717extern int ata_sas_port_init(struct ata_port *);
718extern int ata_sas_port_start(struct ata_port *ap);
719extern void ata_sas_port_stop(struct ata_port *ap);
720extern int ata_sas_slave_configure(struct scsi_device *, struct ata_port *);
721extern int ata_sas_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *),
722 struct ata_port *ap);
692extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 723extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
693extern int sata_scr_valid(struct ata_port *ap); 724extern int sata_scr_valid(struct ata_port *ap);
694extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val); 725extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val);
@@ -697,10 +728,9 @@ extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
697extern int ata_port_online(struct ata_port *ap); 728extern int ata_port_online(struct ata_port *ap);
698extern int ata_port_offline(struct ata_port *ap); 729extern int ata_port_offline(struct ata_port *ap);
699extern int ata_scsi_device_resume(struct scsi_device *); 730extern int ata_scsi_device_resume(struct scsi_device *);
700extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 731extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg);
701extern int ata_host_set_suspend(struct ata_host_set *host_set, 732extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg);
702 pm_message_t mesg); 733extern void ata_host_resume(struct ata_host *host);
703extern void ata_host_set_resume(struct ata_host_set *host_set);
704extern int ata_ratelimit(void); 734extern int ata_ratelimit(void);
705extern unsigned int ata_busy_sleep(struct ata_port *ap, 735extern unsigned int ata_busy_sleep(struct ata_port *ap,
706 unsigned long timeout_pat, 736 unsigned long timeout_pat,
@@ -725,7 +755,7 @@ extern u8 ata_altstatus(struct ata_port *ap);
725extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); 755extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf);
726extern int ata_port_start (struct ata_port *ap); 756extern int ata_port_start (struct ata_port *ap);
727extern void ata_port_stop (struct ata_port *ap); 757extern void ata_port_stop (struct ata_port *ap);
728extern void ata_host_stop (struct ata_host_set *host_set); 758extern void ata_host_stop (struct ata_host *host);
729extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); 759extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
730extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf, 760extern void ata_mmio_data_xfer(struct ata_device *adev, unsigned char *buf,
731 unsigned int buflen, int write_data); 761 unsigned int buflen, int write_data);
@@ -811,7 +841,7 @@ struct pci_bits {
811 unsigned long val; 841 unsigned long val;
812}; 842};
813 843
814extern void ata_pci_host_stop (struct ata_host_set *host_set); 844extern void ata_pci_host_stop (struct ata_host *host);
815extern struct ata_probe_ent * 845extern struct ata_probe_ent *
816ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); 846ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
817extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); 847extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
diff --git a/include/linux/magic.h b/include/linux/magic.h
new file mode 100644
index 000000000000..22036dd2ba36
--- /dev/null
+++ b/include/linux/magic.h
@@ -0,0 +1,37 @@
1#ifndef __LINUX_MAGIC_H__
2#define __LINUX_MAGIC_H__
3
4#define ADFS_SUPER_MAGIC 0xadf5
5#define AFFS_SUPER_MAGIC 0xadff
6#define AUTOFS_SUPER_MAGIC 0x0187
7#define CODA_SUPER_MAGIC 0x73757245
8#define EFS_SUPER_MAGIC 0x414A53
9#define EXT2_SUPER_MAGIC 0xEF53
10#define EXT3_SUPER_MAGIC 0xEF53
11#define HPFS_SUPER_MAGIC 0xf995e849
12#define ISOFS_SUPER_MAGIC 0x9660
13#define JFFS2_SUPER_MAGIC 0x72b6
14
15#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
16#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
17#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
18#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
19
20#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
21#define NCP_SUPER_MAGIC 0x564c /* Guess, what 0x564c is :-) */
22#define NFS_SUPER_MAGIC 0x6969
23#define OPENPROM_SUPER_MAGIC 0x9fa1
24#define PROC_SUPER_MAGIC 0x9fa0
25#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
26
27#define REISERFS_SUPER_MAGIC 0x52654973 /* used by gcc */
28 /* used by file system utilities that
29 look at the superblock, etc. */
30#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
31#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
32#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
33
34#define SMB_SUPER_MAGIC 0x517B
35#define USBDEVICE_SUPER_MAGIC 0x9fa2
36
37#endif /* __LINUX_MAGIC_H__ */
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h
index 1ecc3cc8cef5..916e8f72c63d 100644
--- a/include/linux/minix_fs.h
+++ b/include/linux/minix_fs.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_MINIX_FS_H 1#ifndef _LINUX_MINIX_FS_H
2#define _LINUX_MINIX_FS_H 2#define _LINUX_MINIX_FS_H
3 3
4#include <linux/magic.h>
5
4/* 6/*
5 * The minix filesystem constants/structures 7 * The minix filesystem constants/structures
6 */ 8 */
@@ -19,10 +21,6 @@
19 21
20#define MINIX_I_MAP_SLOTS 8 22#define MINIX_I_MAP_SLOTS 8
21#define MINIX_Z_MAP_SLOTS 64 23#define MINIX_Z_MAP_SLOTS 64
22#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
23#define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */
24#define MINIX2_SUPER_MAGIC 0x2468 /* minix V2 fs */
25#define MINIX2_SUPER_MAGIC2 0x2478 /* minix V2 fs, 30 char names */
26#define MINIX_VALID_FS 0x0001 /* Clean fs. */ 24#define MINIX_VALID_FS 0x0001 /* Clean fs. */
27#define MINIX_ERROR_FS 0x0002 /* fs has errors. */ 25#define MINIX_ERROR_FS 0x0002 /* fs has errors. */
28 26
diff --git a/include/linux/mm.h b/include/linux/mm.h
index f0b135cd86da..224178a000d2 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1013,6 +1013,7 @@ static inline unsigned long vma_pages(struct vm_area_struct *vma)
1013 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; 1013 return (vma->vm_end - vma->vm_start) >> PAGE_SHIFT;
1014} 1014}
1015 1015
1016pgprot_t vm_get_page_prot(unsigned long vm_flags);
1016struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr); 1017struct vm_area_struct *find_extend_vma(struct mm_struct *, unsigned long addr);
1017struct page *vmalloc_to_page(void *addr); 1018struct page *vmalloc_to_page(void *addr);
1018unsigned long vmalloc_to_pfn(void *addr); 1019unsigned long vmalloc_to_pfn(void *addr);
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index f6977708585c..f7ca0b09075d 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -148,6 +148,17 @@ struct ccw_device_id {
148#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04 148#define CCW_DEVICE_ID_MATCH_DEVICE_TYPE 0x04
149#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08 149#define CCW_DEVICE_ID_MATCH_DEVICE_MODEL 0x08
150 150
151/* s390 AP bus devices */
152struct ap_device_id {
153 __u16 match_flags; /* which fields to match against */
154 __u8 dev_type; /* device type */
155 __u8 pad1;
156 __u32 pad2;
157 kernel_ulong_t driver_info;
158};
159
160#define AP_DEVICE_ID_MATCH_DEVICE_TYPE 0x01
161
151 162
152#define PNP_ID_LEN 8 163#define PNP_ID_LEN 8
153#define PNP_MAX_DEVICES 8 164#define PNP_MAX_DEVICES 8
diff --git a/include/linux/module.h b/include/linux/module.h
index 0dfb794c52d3..d4486cc2e7fe 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -156,6 +156,11 @@ extern struct module __this_module;
156*/ 156*/
157#define MODULE_VERSION(_version) MODULE_INFO(version, _version) 157#define MODULE_VERSION(_version) MODULE_INFO(version, _version)
158 158
159/* Optional firmware file (or files) needed by the module
160 * format is simply firmware file name. Multiple firmware
161 * files require multiple MODULE_FIRMWARE() specifiers */
162#define MODULE_FIRMWARE(_firmware) MODULE_INFO(firmware, _firmware)
163
159/* Given an address, look for it in the exception tables */ 164/* Given an address, look for it in the exception tables */
160const struct exception_table_entry *search_exception_tables(unsigned long add); 165const struct exception_table_entry *search_exception_tables(unsigned long add);
161 166
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index d9035c73e5d1..bae62d62dc3e 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -1,6 +1,8 @@
1#ifndef _LINUX_MSDOS_FS_H 1#ifndef _LINUX_MSDOS_FS_H
2#define _LINUX_MSDOS_FS_H 2#define _LINUX_MSDOS_FS_H
3 3
4#include <linux/magic.h>
5
4/* 6/*
5 * The MS-DOS filesystem constants/structures 7 * The MS-DOS filesystem constants/structures
6 */ 8 */
@@ -18,8 +20,6 @@
18#define CT_LE_L(v) cpu_to_le32(v) 20#define CT_LE_L(v) cpu_to_le32(v)
19 21
20 22
21#define MSDOS_SUPER_MAGIC 0x4d44 /* MD */
22
23#define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */ 23#define MSDOS_ROOT_INO 1 /* == MINIX_ROOT_INO */
24#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */ 24#define MSDOS_DIR_BITS 5 /* log2(sizeof(struct msdos_dir_entry)) */
25 25
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index b208f0cd556b..02e352be717e 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -11,6 +11,7 @@
11#include <linux/fs.h> 11#include <linux/fs.h>
12#include <linux/in.h> 12#include <linux/in.h>
13#include <linux/types.h> 13#include <linux/types.h>
14#include <linux/magic.h>
14 15
15#include <linux/ipx.h> 16#include <linux/ipx.h>
16#include <linux/ncp_no.h> 17#include <linux/ncp_no.h>
@@ -185,10 +186,6 @@ struct ncp_entry_info {
185 __u8 file_handle[6]; 186 __u8 file_handle[6];
186}; 187};
187 188
188/* Guess, what 0x564c is :-) */
189#define NCP_SUPER_MAGIC 0x564c
190
191
192static inline struct ncp_server *NCP_SBP(struct super_block *sb) 189static inline struct ncp_server *NCP_SBP(struct super_block *sb)
193{ 190{
194 return sb->s_fs_info; 191 return sb->s_fs_info;
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h
new file mode 100644
index 000000000000..bd3bbf668cdb
--- /dev/null
+++ b/include/linux/neighbour.h
@@ -0,0 +1,159 @@
1#ifndef __LINUX_NEIGHBOUR_H
2#define __LINUX_NEIGHBOUR_H
3
4#include <linux/netlink.h>
5
6struct ndmsg
7{
8 __u8 ndm_family;
9 __u8 ndm_pad1;
10 __u16 ndm_pad2;
11 __s32 ndm_ifindex;
12 __u16 ndm_state;
13 __u8 ndm_flags;
14 __u8 ndm_type;
15};
16
17enum
18{
19 NDA_UNSPEC,
20 NDA_DST,
21 NDA_LLADDR,
22 NDA_CACHEINFO,
23 NDA_PROBES,
24 __NDA_MAX
25};
26
27#define NDA_MAX (__NDA_MAX - 1)
28
29/*
30 * Neighbor Cache Entry Flags
31 */
32
33#define NTF_PROXY 0x08 /* == ATF_PUBL */
34#define NTF_ROUTER 0x80
35
36/*
37 * Neighbor Cache Entry States.
38 */
39
40#define NUD_INCOMPLETE 0x01
41#define NUD_REACHABLE 0x02
42#define NUD_STALE 0x04
43#define NUD_DELAY 0x08
44#define NUD_PROBE 0x10
45#define NUD_FAILED 0x20
46
47/* Dummy states */
48#define NUD_NOARP 0x40
49#define NUD_PERMANENT 0x80
50#define NUD_NONE 0x00
51
52/* NUD_NOARP & NUD_PERMANENT are pseudostates, they never change
53 and make no address resolution or NUD.
54 NUD_PERMANENT is also cannot be deleted by garbage collectors.
55 */
56
57struct nda_cacheinfo
58{
59 __u32 ndm_confirmed;
60 __u32 ndm_used;
61 __u32 ndm_updated;
62 __u32 ndm_refcnt;
63};
64
65/*****************************************************************
66 * Neighbour tables specific messages.
67 *
68 * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
69 * NLM_F_DUMP flag set. Every neighbour table configuration is
70 * spread over multiple messages to avoid running into message
71 * size limits on systems with many interfaces. The first message
72 * in the sequence transports all not device specific data such as
73 * statistics, configuration, and the default parameter set.
74 * This message is followed by 0..n messages carrying device
75 * specific parameter sets.
76 * Although the ordering should be sufficient, NDTA_NAME can be
77 * used to identify sequences. The initial message can be identified
78 * by checking for NDTA_CONFIG. The device specific messages do
79 * not contain this TLV but have NDTPA_IFINDEX set to the
80 * corresponding interface index.
81 *
82 * To change neighbour table attributes, send RTM_SETNEIGHTBL
83 * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
84 * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
85 * otherwise. Device specific parameter sets can be changed by
86 * setting NDTPA_IFINDEX to the interface index of the corresponding
87 * device.
88 ****/
89
90struct ndt_stats
91{
92 __u64 ndts_allocs;
93 __u64 ndts_destroys;
94 __u64 ndts_hash_grows;
95 __u64 ndts_res_failed;
96 __u64 ndts_lookups;
97 __u64 ndts_hits;
98 __u64 ndts_rcv_probes_mcast;
99 __u64 ndts_rcv_probes_ucast;
100 __u64 ndts_periodic_gc_runs;
101 __u64 ndts_forced_gc_runs;
102};
103
104enum {
105 NDTPA_UNSPEC,
106 NDTPA_IFINDEX, /* u32, unchangeable */
107 NDTPA_REFCNT, /* u32, read-only */
108 NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
109 NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
110 NDTPA_RETRANS_TIME, /* u64, msecs */
111 NDTPA_GC_STALETIME, /* u64, msecs */
112 NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
113 NDTPA_QUEUE_LEN, /* u32 */
114 NDTPA_APP_PROBES, /* u32 */
115 NDTPA_UCAST_PROBES, /* u32 */
116 NDTPA_MCAST_PROBES, /* u32 */
117 NDTPA_ANYCAST_DELAY, /* u64, msecs */
118 NDTPA_PROXY_DELAY, /* u64, msecs */
119 NDTPA_PROXY_QLEN, /* u32 */
120 NDTPA_LOCKTIME, /* u64, msecs */
121 __NDTPA_MAX
122};
123#define NDTPA_MAX (__NDTPA_MAX - 1)
124
125struct ndtmsg
126{
127 __u8 ndtm_family;
128 __u8 ndtm_pad1;
129 __u16 ndtm_pad2;
130};
131
132struct ndt_config
133{
134 __u16 ndtc_key_len;
135 __u16 ndtc_entry_size;
136 __u32 ndtc_entries;
137 __u32 ndtc_last_flush; /* delta to now in msecs */
138 __u32 ndtc_last_rand; /* delta to now in msecs */
139 __u32 ndtc_hash_rnd;
140 __u32 ndtc_hash_mask;
141 __u32 ndtc_hash_chain_gc;
142 __u32 ndtc_proxy_qlen;
143};
144
145enum {
146 NDTA_UNSPEC,
147 NDTA_NAME, /* char *, unchangeable */
148 NDTA_THRESH1, /* u32 */
149 NDTA_THRESH2, /* u32 */
150 NDTA_THRESH3, /* u32 */
151 NDTA_CONFIG, /* struct ndt_config, read-only */
152 NDTA_PARMS, /* nested TLV NDTPA_* */
153 NDTA_STATS, /* struct ndt_stats, read-only */
154 NDTA_GC_INTERVAL, /* u64, msecs */
155 __NDTA_MAX
156};
157#define NDTA_MAX (__NDTA_MAX - 1)
158
159#endif
diff --git a/include/linux/net.h b/include/linux/net.h
index b20c53c74413..c257f716e00f 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -169,11 +169,6 @@ struct proto_ops {
169struct net_proto_family { 169struct net_proto_family {
170 int family; 170 int family;
171 int (*create)(struct socket *sock, int protocol); 171 int (*create)(struct socket *sock, int protocol);
172 /* These are counters for the number of different methods of
173 each we support */
174 short authentication;
175 short encryption;
176 short encrypt_net;
177 struct module *owner; 172 struct module *owner;
178}; 173};
179 174
@@ -181,8 +176,8 @@ struct iovec;
181struct kvec; 176struct kvec;
182 177
183extern int sock_wake_async(struct socket *sk, int how, int band); 178extern int sock_wake_async(struct socket *sk, int how, int band);
184extern int sock_register(struct net_proto_family *fam); 179extern int sock_register(const struct net_proto_family *fam);
185extern int sock_unregister(int family); 180extern void sock_unregister(int family);
186extern int sock_create(int family, int type, int proto, 181extern int sock_create(int family, int type, int proto,
187 struct socket **res); 182 struct socket **res);
188extern int sock_create_kern(int family, int type, int proto, 183extern int sock_create_kern(int family, int type, int proto,
@@ -208,6 +203,25 @@ extern int kernel_recvmsg(struct socket *sock, struct msghdr *msg,
208 struct kvec *vec, size_t num, 203 struct kvec *vec, size_t num,
209 size_t len, int flags); 204 size_t len, int flags);
210 205
206extern int kernel_bind(struct socket *sock, struct sockaddr *addr,
207 int addrlen);
208extern int kernel_listen(struct socket *sock, int backlog);
209extern int kernel_accept(struct socket *sock, struct socket **newsock,
210 int flags);
211extern int kernel_connect(struct socket *sock, struct sockaddr *addr,
212 int addrlen, int flags);
213extern int kernel_getsockname(struct socket *sock, struct sockaddr *addr,
214 int *addrlen);
215extern int kernel_getpeername(struct socket *sock, struct sockaddr *addr,
216 int *addrlen);
217extern int kernel_getsockopt(struct socket *sock, int level, int optname,
218 char *optval, int *optlen);
219extern int kernel_setsockopt(struct socket *sock, int level, int optname,
220 char *optval, int optlen);
221extern int kernel_sendpage(struct socket *sock, struct page *page, int offset,
222 size_t size, int flags);
223extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg);
224
211#ifndef CONFIG_SMP 225#ifndef CONFIG_SMP
212#define SOCKOPS_WRAPPED(name) name 226#define SOCKOPS_WRAPPED(name) name
213#define SOCKOPS_WRAP(name, fam) 227#define SOCKOPS_WRAP(name, fam)
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 50a4719512ed..43289127b458 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -342,7 +342,7 @@ struct net_device
342 /* Instance data managed by the core of Wireless Extensions. */ 342 /* Instance data managed by the core of Wireless Extensions. */
343 struct iw_public_data * wireless_data; 343 struct iw_public_data * wireless_data;
344 344
345 struct ethtool_ops *ethtool_ops; 345 const struct ethtool_ops *ethtool_ops;
346 346
347 /* 347 /*
348 * This marks the end of the "visible" part of the structure. All 348 * This marks the end of the "visible" part of the structure. All
@@ -976,7 +976,7 @@ extern void dev_mcast_init(void);
976extern int netdev_max_backlog; 976extern int netdev_max_backlog;
977extern int weight_p; 977extern int weight_p;
978extern int netdev_set_master(struct net_device *dev, struct net_device *master); 978extern int netdev_set_master(struct net_device *dev, struct net_device *master);
979extern int skb_checksum_help(struct sk_buff *skb, int inward); 979extern int skb_checksum_help(struct sk_buff *skb);
980extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features); 980extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features);
981#ifdef CONFIG_BUG 981#ifdef CONFIG_BUG
982extern void netdev_rx_csum_fault(struct net_device *dev); 982extern void netdev_rx_csum_fault(struct net_device *dev);
@@ -1012,7 +1012,7 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb)
1012{ 1012{
1013 return skb_is_gso(skb) && 1013 return skb_is_gso(skb) &&
1014 (!skb_gso_ok(skb, dev->features) || 1014 (!skb_gso_ok(skb, dev->features) ||
1015 unlikely(skb->ip_summed != CHECKSUM_HW)); 1015 unlikely(skb->ip_summed != CHECKSUM_PARTIAL));
1016} 1016}
1017 1017
1018/* On bonding slaves other than the currently active slave, suppress 1018/* On bonding slaves other than the currently active slave, suppress
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 10168e26a846..b7e67d1d4382 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -282,6 +282,12 @@ extern void nf_invalidate_cache(int pf);
282 Returns true or false. */ 282 Returns true or false. */
283extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); 283extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len);
284 284
285extern u_int16_t nf_csum_update(u_int32_t oldval, u_int32_t newval,
286 u_int32_t csum);
287extern u_int16_t nf_proto_csum_update(struct sk_buff *skb,
288 u_int32_t oldval, u_int32_t newval,
289 u_int16_t csum, int pseudohdr);
290
285struct nf_afinfo { 291struct nf_afinfo {
286 unsigned short family; 292 unsigned short family;
287 unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook, 293 unsigned int (*checksum)(struct sk_buff *skb, unsigned int hook,
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index d2e4bd7a7a14..9e0dae07861e 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -125,6 +125,10 @@ enum ip_conntrack_events
125 /* Counter highest bit has been set */ 125 /* Counter highest bit has been set */
126 IPCT_COUNTER_FILLING_BIT = 11, 126 IPCT_COUNTER_FILLING_BIT = 11,
127 IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), 127 IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT),
128
129 /* Mark is set */
130 IPCT_MARK_BIT = 12,
131 IPCT_MARK = (1 << IPCT_MARK_BIT),
128}; 132};
129 133
130enum ip_conntrack_expect_events { 134enum ip_conntrack_expect_events {
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h
index b2feeffde384..6b01ba297727 100644
--- a/include/linux/netfilter/nf_conntrack_tcp.h
+++ b/include/linux/netfilter/nf_conntrack_tcp.h
@@ -49,6 +49,7 @@ struct ip_ct_tcp
49 u_int32_t last_seq; /* Last sequence number seen in dir */ 49 u_int32_t last_seq; /* Last sequence number seen in dir */
50 u_int32_t last_ack; /* Last sequence number seen in opposite dir */ 50 u_int32_t last_ack; /* Last sequence number seen in opposite dir */
51 u_int32_t last_end; /* Last seq + len */ 51 u_int32_t last_end; /* Last seq + len */
52 u_int16_t last_win; /* Last window advertisement seen in dir */
52}; 53};
53 54
54#endif /* __KERNEL__ */ 55#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 9f5b12cf489b..6d8e3e5a80e9 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -43,7 +43,7 @@ struct nfattr
43 u_int16_t nfa_len; 43 u_int16_t nfa_len;
44 u_int16_t nfa_type; /* we use 15 bits for the type, and the highest 44 u_int16_t nfa_type; /* we use 15 bits for the type, and the highest
45 * bit to indicate whether the payload is nested */ 45 * bit to indicate whether the payload is nested */
46} __attribute__ ((packed)); 46};
47 47
48/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from 48/* FIXME: Apart from NFNL_NFA_NESTED shamelessly copy and pasted from
49 * rtnetlink.h, it's time to put this in a generic file */ 49 * rtnetlink.h, it's time to put this in a generic file */
@@ -79,7 +79,7 @@ struct 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 u_int16_t res_id; /* resource id */
82} __attribute__ ((packed)); 82};
83 83
84#define NFNETLINK_V0 0 84#define NFNETLINK_V0 0
85 85
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h
index a7497c7436df..87b92f8b988f 100644
--- a/include/linux/netfilter/nfnetlink_log.h
+++ b/include/linux/netfilter/nfnetlink_log.h
@@ -19,18 +19,18 @@ struct nfulnl_msg_packet_hdr {
19 u_int16_t hw_protocol; /* hw protocol (network order) */ 19 u_int16_t 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} __attribute__ ((packed)); 22};
23 23
24struct nfulnl_msg_packet_hw { 24struct nfulnl_msg_packet_hw {
25 u_int16_t hw_addrlen; 25 u_int16_t 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} __attribute__ ((packed)); 28};
29 29
30struct nfulnl_msg_packet_timestamp { 30struct nfulnl_msg_packet_timestamp {
31 aligned_u64 sec; 31 aligned_u64 sec;
32 aligned_u64 usec; 32 aligned_u64 usec;
33} __attribute__ ((packed)); 33};
34 34
35#define NFULNL_PREFIXLEN 30 /* just like old log target */ 35#define NFULNL_PREFIXLEN 30 /* just like old log target */
36 36
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index 9e774373244c..36af0360b56d 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -22,12 +22,12 @@ struct nfqnl_msg_packet_hw {
22 u_int16_t hw_addrlen; 22 u_int16_t 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} __attribute__ ((packed)); 25};
26 26
27struct nfqnl_msg_packet_timestamp { 27struct nfqnl_msg_packet_timestamp {
28 aligned_u64 sec; 28 aligned_u64 sec;
29 aligned_u64 usec; 29 aligned_u64 usec;
30} __attribute__ ((packed)); 30};
31 31
32enum nfqnl_attr_type { 32enum nfqnl_attr_type {
33 NFQA_UNSPEC, 33 NFQA_UNSPEC,
@@ -49,7 +49,7 @@ enum nfqnl_attr_type {
49struct nfqnl_msg_verdict_hdr { 49struct nfqnl_msg_verdict_hdr {
50 u_int32_t verdict; 50 u_int32_t verdict;
51 u_int32_t id; 51 u_int32_t id;
52} __attribute__ ((packed)); 52};
53 53
54 54
55enum nfqnl_msg_config_cmds { 55enum nfqnl_msg_config_cmds {
@@ -64,7 +64,7 @@ struct 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 u_int16_t pf; /* AF_xxx for PF_[UN]BIND */
67} __attribute__ ((packed)); 67};
68 68
69enum nfqnl_config_mode { 69enum nfqnl_config_mode {
70 NFQNL_COPY_NONE, 70 NFQNL_COPY_NONE,
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 48cc32d83f77..739a98eebe2c 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -138,16 +138,6 @@ struct xt_counters_info
138 138
139#include <linux/netdevice.h> 139#include <linux/netdevice.h>
140 140
141#define ASSERT_READ_LOCK(x)
142#define ASSERT_WRITE_LOCK(x)
143#include <linux/netfilter_ipv4/listhelp.h>
144
145#ifdef CONFIG_COMPAT
146#define COMPAT_TO_USER 1
147#define COMPAT_FROM_USER -1
148#define COMPAT_CALC_SIZE 0
149#endif
150
151struct xt_match 141struct xt_match
152{ 142{
153 struct list_head list; 143 struct list_head list;
@@ -174,21 +164,24 @@ struct xt_match
174 const void *ip, 164 const void *ip,
175 const struct xt_match *match, 165 const struct xt_match *match,
176 void *matchinfo, 166 void *matchinfo,
177 unsigned int matchinfosize,
178 unsigned int hook_mask); 167 unsigned int hook_mask);
179 168
180 /* Called when entry of this type deleted. */ 169 /* Called when entry of this type deleted. */
181 void (*destroy)(const struct xt_match *match, void *matchinfo, 170 void (*destroy)(const struct xt_match *match, void *matchinfo);
182 unsigned int matchinfosize);
183 171
184 /* Called when userspace align differs from kernel space one */ 172 /* Called when userspace align differs from kernel space one */
185 int (*compat)(void *match, void **dstptr, int *size, int convert); 173 void (*compat_from_user)(void *dst, void *src);
174 int (*compat_to_user)(void __user *dst, void *src);
186 175
187 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 176 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
188 struct module *me; 177 struct module *me;
189 178
179 /* Free to use by each match */
180 unsigned long data;
181
190 char *table; 182 char *table;
191 unsigned int matchsize; 183 unsigned int matchsize;
184 unsigned int compatsize;
192 unsigned int hooks; 185 unsigned int hooks;
193 unsigned short proto; 186 unsigned short proto;
194 187
@@ -211,8 +204,7 @@ struct xt_target
211 const struct net_device *out, 204 const struct net_device *out,
212 unsigned int hooknum, 205 unsigned int hooknum,
213 const struct xt_target *target, 206 const struct xt_target *target,
214 const void *targinfo, 207 const void *targinfo);
215 void *userdata);
216 208
217 /* Called when user tries to insert an entry of this type: 209 /* Called when user tries to insert an entry of this type:
218 hook_mask is a bitmask of hooks from which it can be 210 hook_mask is a bitmask of hooks from which it can be
@@ -222,21 +214,21 @@ struct xt_target
222 const void *entry, 214 const void *entry,
223 const struct xt_target *target, 215 const struct xt_target *target,
224 void *targinfo, 216 void *targinfo,
225 unsigned int targinfosize,
226 unsigned int hook_mask); 217 unsigned int hook_mask);
227 218
228 /* Called when entry of this type deleted. */ 219 /* Called when entry of this type deleted. */
229 void (*destroy)(const struct xt_target *target, void *targinfo, 220 void (*destroy)(const struct xt_target *target, void *targinfo);
230 unsigned int targinfosize);
231 221
232 /* Called when userspace align differs from kernel space one */ 222 /* Called when userspace align differs from kernel space one */
233 int (*compat)(void *target, void **dstptr, int *size, int convert); 223 void (*compat_from_user)(void *dst, void *src);
224 int (*compat_to_user)(void __user *dst, void *src);
234 225
235 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 226 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
236 struct module *me; 227 struct module *me;
237 228
238 char *table; 229 char *table;
239 unsigned int targetsize; 230 unsigned int targetsize;
231 unsigned int compatsize;
240 unsigned int hooks; 232 unsigned int hooks;
241 unsigned short proto; 233 unsigned short proto;
242 234
@@ -290,8 +282,13 @@ struct xt_table_info
290 282
291extern int xt_register_target(struct xt_target *target); 283extern int xt_register_target(struct xt_target *target);
292extern void xt_unregister_target(struct xt_target *target); 284extern void xt_unregister_target(struct xt_target *target);
285extern int xt_register_targets(struct xt_target *target, unsigned int n);
286extern void xt_unregister_targets(struct xt_target *target, unsigned int n);
287
293extern int xt_register_match(struct xt_match *target); 288extern int xt_register_match(struct xt_match *target);
294extern void xt_unregister_match(struct xt_match *target); 289extern void xt_unregister_match(struct xt_match *target);
290extern int xt_register_matches(struct xt_match *match, unsigned int n);
291extern void xt_unregister_matches(struct xt_match *match, unsigned int n);
295 292
296extern int xt_check_match(const struct xt_match *match, unsigned short family, 293extern int xt_check_match(const struct xt_match *match, unsigned short family,
297 unsigned int size, const char *table, unsigned int hook, 294 unsigned int size, const char *table, unsigned int hook,
@@ -388,9 +385,18 @@ struct compat_xt_counters_info
388 385
389extern void xt_compat_lock(int af); 386extern void xt_compat_lock(int af);
390extern void xt_compat_unlock(int af); 387extern void xt_compat_unlock(int af);
391extern int xt_compat_match(void *match, void **dstptr, int *size, int convert); 388
392extern int xt_compat_target(void *target, void **dstptr, int *size, 389extern int xt_compat_match_offset(struct xt_match *match);
393 int convert); 390extern void xt_compat_match_from_user(struct xt_entry_match *m,
391 void **dstptr, int *size);
392extern int xt_compat_match_to_user(struct xt_entry_match *m,
393 void * __user *dstptr, int *size);
394
395extern int xt_compat_target_offset(struct xt_target *target);
396extern void xt_compat_target_from_user(struct xt_entry_target *t,
397 void **dstptr, int *size);
398extern int xt_compat_target_to_user(struct xt_entry_target *t,
399 void * __user *dstptr, int *size);
394 400
395#endif /* CONFIG_COMPAT */ 401#endif /* CONFIG_COMPAT */
396#endif /* __KERNEL__ */ 402#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter/xt_DSCP.h b/include/linux/netfilter/xt_DSCP.h
new file mode 100644
index 000000000000..3c7c963997bd
--- /dev/null
+++ b/include/linux/netfilter/xt_DSCP.h
@@ -0,0 +1,20 @@
1/* x_tables module for setting the IPv4/IPv6 DSCP field
2 *
3 * (C) 2002 Harald Welte <laforge@gnumonks.org>
4 * based on ipt_FTOS.c (C) 2000 by Matthew G. Marsh <mgm@paktronix.com>
5 * This software is distributed under GNU GPL v2, 1991
6 *
7 * See RFC2474 for a description of the DSCP field within the IP Header.
8 *
9 * xt_DSCP.h,v 1.7 2002/03/14 12:03:13 laforge Exp
10*/
11#ifndef _XT_DSCP_TARGET_H
12#define _XT_DSCP_TARGET_H
13#include <linux/netfilter/xt_dscp.h>
14
15/* target info */
16struct xt_DSCP_info {
17 u_int8_t dscp;
18};
19
20#endif /* _XT_DSCP_TARGET_H */
diff --git a/include/linux/netfilter/xt_dscp.h b/include/linux/netfilter/xt_dscp.h
new file mode 100644
index 000000000000..1da61e6acaf7
--- /dev/null
+++ b/include/linux/netfilter/xt_dscp.h
@@ -0,0 +1,23 @@
1/* x_tables module for matching the IPv4/IPv6 DSCP field
2 *
3 * (C) 2002 Harald Welte <laforge@gnumonks.org>
4 * This software is distributed under GNU GPL v2, 1991
5 *
6 * See RFC2474 for a description of the DSCP field within the IP Header.
7 *
8 * xt_dscp.h,v 1.3 2002/08/05 19:00:21 laforge Exp
9*/
10#ifndef _XT_DSCP_H
11#define _XT_DSCP_H
12
13#define XT_DSCP_MASK 0xfc /* 11111100 */
14#define XT_DSCP_SHIFT 2
15#define XT_DSCP_MAX 0x3f /* 00111111 */
16
17/* match info */
18struct xt_dscp_info {
19 u_int8_t dscp;
20 u_int8_t invert;
21};
22
23#endif /* _XT_DSCP_H */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index 62cc27daca4e..149e87c9ab13 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -248,8 +248,7 @@ extern unsigned int arpt_do_table(struct sk_buff **pskb,
248 unsigned int hook, 248 unsigned int hook,
249 const struct net_device *in, 249 const struct net_device *in,
250 const struct net_device *out, 250 const struct net_device *out,
251 struct arpt_table *table, 251 struct arpt_table *table);
252 void *userdata);
253 252
254#define ARPT_ALIGN(s) (((s) + (__alignof__(struct arpt_entry)-1)) & ~(__alignof__(struct arpt_entry)-1)) 253#define ARPT_ALIGN(s) (((s) + (__alignof__(struct arpt_entry)-1)) & ~(__alignof__(struct arpt_entry)-1))
255#endif /*__KERNEL__*/ 254#endif /*__KERNEL__*/
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index 427c67ff89e9..9a4dd11af86e 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -5,9 +5,8 @@
5 */ 5 */
6 6
7#include <linux/netfilter.h> 7#include <linux/netfilter.h>
8#if defined(__KERNEL__) && defined(CONFIG_BRIDGE_NETFILTER)
9#include <linux/if_ether.h> 8#include <linux/if_ether.h>
10#endif 9#include <linux/if_vlan.h>
11 10
12/* Bridge Hooks */ 11/* Bridge Hooks */
13/* After promisc drops, checksum checks. */ 12/* After promisc drops, checksum checks. */
@@ -47,40 +46,20 @@ enum nf_br_hook_priorities {
47 46
48 47
49/* Only used in br_forward.c */ 48/* Only used in br_forward.c */
50static inline 49extern int nf_bridge_copy_header(struct sk_buff *skb);
51int nf_bridge_maybe_copy_header(struct sk_buff *skb) 50static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb)
52{ 51{
53 int err; 52 if (skb->nf_bridge)
54 53 return nf_bridge_copy_header(skb);
55 if (skb->nf_bridge) { 54 return 0;
56 if (skb->protocol == __constant_htons(ETH_P_8021Q)) {
57 err = skb_cow(skb, 18);
58 if (err)
59 return err;
60 memcpy(skb->data - 18, skb->nf_bridge->data, 18);
61 skb_push(skb, 4);
62 } else {
63 err = skb_cow(skb, 16);
64 if (err)
65 return err;
66 memcpy(skb->data - 16, skb->nf_bridge->data, 16);
67 }
68 }
69 return 0;
70} 55}
71 56
72/* This is called by the IP fragmenting code and it ensures there is 57/* This is called by the IP fragmenting code and it ensures there is
73 * enough room for the encapsulating header (if there is one). */ 58 * enough room for the encapsulating header (if there is one). */
74static inline 59static inline int nf_bridge_pad(const struct sk_buff *skb)
75int nf_bridge_pad(struct sk_buff *skb)
76{ 60{
77 if (skb->protocol == __constant_htons(ETH_P_IP)) 61 return (skb->nf_bridge && skb->protocol == htons(ETH_P_8021Q))
78 return 0; 62 ? VLAN_HLEN : 0;
79 if (skb->nf_bridge) {
80 if (skb->protocol == __constant_htons(ETH_P_8021Q))
81 return 4;
82 }
83 return 0;
84} 63}
85 64
86struct bridge_skb_cb { 65struct bridge_skb_cb {
@@ -90,6 +69,9 @@ struct bridge_skb_cb {
90}; 69};
91 70
92extern int brnf_deferred_hooks; 71extern int brnf_deferred_hooks;
72#else
73#define nf_bridge_maybe_copy_header(skb) (0)
74#define nf_bridge_pad(skb) (0)
93#endif /* CONFIG_BRIDGE_NETFILTER */ 75#endif /* CONFIG_BRIDGE_NETFILTER */
94 76
95#endif /* __KERNEL__ */ 77#endif /* __KERNEL__ */
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper.h b/include/linux/netfilter_ipv4/ip_conntrack_helper.h
index 8d69279ccfe4..77fe868d36ff 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper.h
@@ -25,6 +25,8 @@ struct ip_conntrack_helper
25 struct ip_conntrack *ct, 25 struct ip_conntrack *ct,
26 enum ip_conntrack_info conntrackinfo); 26 enum ip_conntrack_info conntrackinfo);
27 27
28 void (*destroy)(struct ip_conntrack *ct);
29
28 int (*to_nfattr)(struct sk_buff *skb, const struct ip_conntrack *ct); 30 int (*to_nfattr)(struct sk_buff *skb, const struct ip_conntrack *ct);
29}; 31};
30 32
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
index 816144c75de0..2644b1faddd6 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h
@@ -31,8 +31,8 @@ struct ip_ct_pptp_master {
31 /* everything below is going to be per-expectation in newnat, 31 /* everything below is going to be per-expectation in newnat,
32 * since there could be more than one call within one session */ 32 * since there could be more than one call within one session */
33 enum pptp_ctrlcall_state cstate; /* call state */ 33 enum pptp_ctrlcall_state cstate; /* call state */
34 u_int16_t pac_call_id; /* call id of PAC, host byte order */ 34 __be16 pac_call_id; /* call id of PAC, host byte order */
35 u_int16_t pns_call_id; /* call id of PNS, host byte order */ 35 __be16 pns_call_id; /* call id of PNS, host byte order */
36 36
37 /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack 37 /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack
38 * and therefore imposes a fixed limit on the number of maps */ 38 * and therefore imposes a fixed limit on the number of maps */
@@ -42,8 +42,8 @@ struct ip_ct_pptp_master {
42/* conntrack_expect private member */ 42/* conntrack_expect private member */
43struct ip_ct_pptp_expect { 43struct ip_ct_pptp_expect {
44 enum pptp_ctrlcall_state cstate; /* call state */ 44 enum pptp_ctrlcall_state cstate; /* call state */
45 u_int16_t pac_call_id; /* call id of PAC */ 45 __be16 pac_call_id; /* call id of PAC */
46 u_int16_t pns_call_id; /* call id of PNS */ 46 __be16 pns_call_id; /* call id of PNS */
47}; 47};
48 48
49 49
@@ -107,8 +107,7 @@ struct PptpControlHeader {
107 107
108struct PptpStartSessionRequest { 108struct PptpStartSessionRequest {
109 __be16 protocolVersion; 109 __be16 protocolVersion;
110 __u8 reserved1; 110 __u16 reserved1;
111 __u8 reserved2;
112 __be32 framingCapability; 111 __be32 framingCapability;
113 __be32 bearerCapability; 112 __be32 bearerCapability;
114 __be16 maxChannels; 113 __be16 maxChannels;
@@ -143,6 +142,8 @@ struct PptpStartSessionReply {
143 142
144struct PptpStopSessionRequest { 143struct PptpStopSessionRequest {
145 __u8 reason; 144 __u8 reason;
145 __u8 reserved1;
146 __u16 reserved2;
146}; 147};
147 148
148/* PptpStopSessionResultCode */ 149/* PptpStopSessionResultCode */
@@ -152,6 +153,7 @@ struct PptpStopSessionRequest {
152struct PptpStopSessionReply { 153struct PptpStopSessionReply {
153 __u8 resultCode; 154 __u8 resultCode;
154 __u8 generalErrorCode; 155 __u8 generalErrorCode;
156 __u16 reserved1;
155}; 157};
156 158
157struct PptpEchoRequest { 159struct PptpEchoRequest {
@@ -188,9 +190,8 @@ struct PptpOutCallRequest {
188 __be32 framingType; 190 __be32 framingType;
189 __be16 packetWindow; 191 __be16 packetWindow;
190 __be16 packetProcDelay; 192 __be16 packetProcDelay;
191 __u16 reserved1;
192 __be16 phoneNumberLength; 193 __be16 phoneNumberLength;
193 __u16 reserved2; 194 __u16 reserved1;
194 __u8 phoneNumber[64]; 195 __u8 phoneNumber[64];
195 __u8 subAddress[64]; 196 __u8 subAddress[64];
196}; 197};
@@ -285,19 +286,19 @@ struct PptpSetLinkInfo {
285}; 286};
286 287
287union pptp_ctrl_union { 288union pptp_ctrl_union {
288 struct PptpStartSessionRequest sreq; 289 struct PptpStartSessionRequest sreq;
289 struct PptpStartSessionReply srep; 290 struct PptpStartSessionReply srep;
290 struct PptpStopSessionRequest streq; 291 struct PptpStopSessionRequest streq;
291 struct PptpStopSessionReply strep; 292 struct PptpStopSessionReply strep;
292 struct PptpOutCallRequest ocreq; 293 struct PptpOutCallRequest ocreq;
293 struct PptpOutCallReply ocack; 294 struct PptpOutCallReply ocack;
294 struct PptpInCallRequest icreq; 295 struct PptpInCallRequest icreq;
295 struct PptpInCallReply icack; 296 struct PptpInCallReply icack;
296 struct PptpInCallConnected iccon; 297 struct PptpInCallConnected iccon;
297 struct PptpClearCallRequest clrreq; 298 struct PptpClearCallRequest clrreq;
298 struct PptpCallDisconnectNotify disc; 299 struct PptpCallDisconnectNotify disc;
299 struct PptpWanErrorNotify wanerr; 300 struct PptpWanErrorNotify wanerr;
300 struct PptpSetLinkInfo setlink; 301 struct PptpSetLinkInfo setlink;
301}; 302};
302 303
303extern int 304extern int
@@ -314,7 +315,7 @@ extern int
314 struct PptpControlHeader *ctlh, 315 struct PptpControlHeader *ctlh,
315 union pptp_ctrl_union *pptpReq); 316 union pptp_ctrl_union *pptpReq);
316 317
317extern int 318extern void
318(*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig, 319(*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig,
319 struct ip_conntrack_expect *exp_reply); 320 struct ip_conntrack_expect *exp_reply);
320 321
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
index 8d090ef82f5f..1d853aa873eb 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h
@@ -49,18 +49,18 @@ struct gre_hdr {
49#else 49#else
50#error "Adjust your <asm/byteorder.h> defines" 50#error "Adjust your <asm/byteorder.h> defines"
51#endif 51#endif
52 __u16 protocol; 52 __be16 protocol;
53}; 53};
54 54
55/* modified GRE header for PPTP */ 55/* modified GRE header for PPTP */
56struct gre_hdr_pptp { 56struct gre_hdr_pptp {
57 __u8 flags; /* bitfield */ 57 __u8 flags; /* bitfield */
58 __u8 version; /* should be GRE_VERSION_PPTP */ 58 __u8 version; /* should be GRE_VERSION_PPTP */
59 __u16 protocol; /* should be GRE_PROTOCOL_PPTP */ 59 __be16 protocol; /* should be GRE_PROTOCOL_PPTP */
60 __u16 payload_len; /* size of ppp payload, not inc. gre header */ 60 __be16 payload_len; /* size of ppp payload, not inc. gre header */
61 __u16 call_id; /* peer's call_id for this session */ 61 __be16 call_id; /* peer's call_id for this session */
62 __u32 seq; /* sequence number. Present if S==1 */ 62 __be32 seq; /* sequence number. Present if S==1 */
63 __u32 ack; /* seq number of highest packet recieved by */ 63 __be32 ack; /* seq number of highest packet recieved by */
64 /* sender in this session */ 64 /* sender in this session */
65}; 65};
66 66
@@ -92,13 +92,13 @@ void ip_ct_gre_keymap_destroy(struct ip_conntrack *ct);
92 92
93 93
94/* get pointer to gre key, if present */ 94/* get pointer to gre key, if present */
95static inline u_int32_t *gre_key(struct gre_hdr *greh) 95static inline __be32 *gre_key(struct gre_hdr *greh)
96{ 96{
97 if (!greh->key) 97 if (!greh->key)
98 return NULL; 98 return NULL;
99 if (greh->csum || greh->routing) 99 if (greh->csum || greh->routing)
100 return (u_int32_t *) (greh+sizeof(*greh)+4); 100 return (__be32 *) (greh+sizeof(*greh)+4);
101 return (u_int32_t *) (greh+sizeof(*greh)); 101 return (__be32 *) (greh+sizeof(*greh));
102} 102}
103 103
104/* get pointer ot gre csum, if present */ 104/* get pointer ot gre csum, if present */
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index e9f5ed1d9f68..98f8407e4cb5 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -72,10 +72,6 @@ extern unsigned int ip_nat_setup_info(struct ip_conntrack *conntrack,
72extern int ip_nat_used_tuple(const struct ip_conntrack_tuple *tuple, 72extern int ip_nat_used_tuple(const struct ip_conntrack_tuple *tuple,
73 const struct ip_conntrack *ignored_conntrack); 73 const struct ip_conntrack *ignored_conntrack);
74 74
75/* Calculate relative checksum. */
76extern u_int16_t ip_nat_cheat_check(u_int32_t oldvalinv,
77 u_int32_t newval,
78 u_int16_t oldcheck);
79#else /* !__KERNEL__: iptables wants this to compile. */ 75#else /* !__KERNEL__: iptables wants this to compile. */
80#define ip_nat_multi_range ip_nat_multi_range_compat 76#define ip_nat_multi_range ip_nat_multi_range_compat
81#endif /*__KERNEL__*/ 77#endif /*__KERNEL__*/
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h
index 30db23f06b03..60566f9fd7b3 100644
--- a/include/linux/netfilter_ipv4/ip_nat_core.h
+++ b/include/linux/netfilter_ipv4/ip_nat_core.h
@@ -11,8 +11,8 @@ extern unsigned int ip_nat_packet(struct ip_conntrack *ct,
11 unsigned int hooknum, 11 unsigned int hooknum,
12 struct sk_buff **pskb); 12 struct sk_buff **pskb);
13 13
14extern int ip_nat_icmp_reply_translation(struct sk_buff **pskb, 14extern int ip_nat_icmp_reply_translation(struct ip_conntrack *ct,
15 struct ip_conntrack *ct, 15 enum ip_conntrack_info ctinfo,
16 enum ip_nat_manip_type manip, 16 unsigned int hooknum,
17 enum ip_conntrack_dir dir); 17 struct sk_buff **pskb);
18#endif /* _IP_NAT_CORE_H */ 18#endif /* _IP_NAT_CORE_H */
diff --git a/include/linux/netfilter_ipv4/ip_nat_pptp.h b/include/linux/netfilter_ipv4/ip_nat_pptp.h
index eaf66c2e8f93..36668bf0f373 100644
--- a/include/linux/netfilter_ipv4/ip_nat_pptp.h
+++ b/include/linux/netfilter_ipv4/ip_nat_pptp.h
@@ -4,8 +4,8 @@
4 4
5/* conntrack private data */ 5/* conntrack private data */
6struct ip_nat_pptp { 6struct ip_nat_pptp {
7 u_int16_t pns_call_id; /* NAT'ed PNS call id */ 7 __be16 pns_call_id; /* NAT'ed PNS call id */
8 u_int16_t pac_call_id; /* NAT'ed PAC call id */ 8 __be16 pac_call_id; /* NAT'ed PAC call id */
9}; 9};
10 10
11#endif /* _NAT_PPTP_H */ 11#endif /* _NAT_PPTP_H */
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index c0dac16e1902..a536bbdef145 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -312,8 +312,7 @@ extern unsigned int ipt_do_table(struct sk_buff **pskb,
312 unsigned int hook, 312 unsigned int hook,
313 const struct net_device *in, 313 const struct net_device *in,
314 const struct net_device *out, 314 const struct net_device *out,
315 struct ipt_table *table, 315 struct ipt_table *table);
316 void *userdata);
317 316
318#define IPT_ALIGN(s) XT_ALIGN(s) 317#define IPT_ALIGN(s) XT_ALIGN(s)
319 318
diff --git a/include/linux/netfilter_ipv4/ipt_DSCP.h b/include/linux/netfilter_ipv4/ipt_DSCP.h
index b30f510b5bef..3491e524d5ea 100644
--- a/include/linux/netfilter_ipv4/ipt_DSCP.h
+++ b/include/linux/netfilter_ipv4/ipt_DSCP.h
@@ -11,10 +11,8 @@
11#ifndef _IPT_DSCP_TARGET_H 11#ifndef _IPT_DSCP_TARGET_H
12#define _IPT_DSCP_TARGET_H 12#define _IPT_DSCP_TARGET_H
13#include <linux/netfilter_ipv4/ipt_dscp.h> 13#include <linux/netfilter_ipv4/ipt_dscp.h>
14#include <linux/netfilter/xt_DSCP.h>
14 15
15/* target info */ 16#define ipt_DSCP_info xt_DSCP_info
16struct ipt_DSCP_info {
17 u_int8_t dscp;
18};
19 17
20#endif /* _IPT_DSCP_TARGET_H */ 18#endif /* _IPT_DSCP_TARGET_H */
diff --git a/include/linux/netfilter_ipv4/ipt_dscp.h b/include/linux/netfilter_ipv4/ipt_dscp.h
index 2fa6dfe92894..4b82ca912b0e 100644
--- a/include/linux/netfilter_ipv4/ipt_dscp.h
+++ b/include/linux/netfilter_ipv4/ipt_dscp.h
@@ -10,14 +10,12 @@
10#ifndef _IPT_DSCP_H 10#ifndef _IPT_DSCP_H
11#define _IPT_DSCP_H 11#define _IPT_DSCP_H
12 12
13#define IPT_DSCP_MASK 0xfc /* 11111100 */ 13#include <linux/netfilter/xt_dscp.h>
14#define IPT_DSCP_SHIFT 2
15#define IPT_DSCP_MAX 0x3f /* 00111111 */
16 14
17/* match info */ 15#define IPT_DSCP_MASK XT_DSCP_MASK
18struct ipt_dscp_info { 16#define IPT_DSCP_SHIFT XT_DSCP_SHIFT
19 u_int8_t dscp; 17#define IPT_DSCP_MAX XT_DSCP_MAX
20 u_int8_t invert; 18
21}; 19#define ipt_dscp_info xt_dscp_info
22 20
23#endif /* _IPT_DSCP_H */ 21#endif /* _IPT_DSCP_H */
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h
deleted file mode 100644
index 5d92cf044d91..000000000000
--- a/include/linux/netfilter_ipv4/listhelp.h
+++ /dev/null
@@ -1,123 +0,0 @@
1#ifndef _LISTHELP_H
2#define _LISTHELP_H
3#include <linux/list.h>
4
5/* Header to do more comprehensive job than linux/list.h; assume list
6 is first entry in structure. */
7
8/* Return pointer to first true entry, if any, or NULL. A macro
9 required to allow inlining of cmpfn. */
10#define LIST_FIND(head, cmpfn, type, args...) \
11({ \
12 const struct list_head *__i, *__j = NULL; \
13 \
14 ASSERT_READ_LOCK(head); \
15 list_for_each(__i, (head)) \
16 if (cmpfn((const type)__i , ## args)) { \
17 __j = __i; \
18 break; \
19 } \
20 (type)__j; \
21})
22
23#define LIST_FIND_W(head, cmpfn, type, args...) \
24({ \
25 const struct list_head *__i, *__j = NULL; \
26 \
27 ASSERT_WRITE_LOCK(head); \
28 list_for_each(__i, (head)) \
29 if (cmpfn((type)__i , ## args)) { \
30 __j = __i; \
31 break; \
32 } \
33 (type)__j; \
34})
35
36/* Just like LIST_FIND but we search backwards */
37#define LIST_FIND_B(head, cmpfn, type, args...) \
38({ \
39 const struct list_head *__i, *__j = NULL; \
40 \
41 ASSERT_READ_LOCK(head); \
42 list_for_each_prev(__i, (head)) \
43 if (cmpfn((const type)__i , ## args)) { \
44 __j = __i; \
45 break; \
46 } \
47 (type)__j; \
48})
49
50static inline int
51__list_cmp_same(const void *p1, const void *p2) { return p1 == p2; }
52
53/* Is this entry in the list? */
54static inline int
55list_inlist(struct list_head *head, const void *entry)
56{
57 return LIST_FIND(head, __list_cmp_same, void *, entry) != NULL;
58}
59
60/* Delete from list. */
61#ifdef CONFIG_NETFILTER_DEBUG
62#define LIST_DELETE(head, oldentry) \
63do { \
64 ASSERT_WRITE_LOCK(head); \
65 if (!list_inlist(head, oldentry)) \
66 printk("LIST_DELETE: %s:%u `%s'(%p) not in %s.\n", \
67 __FILE__, __LINE__, #oldentry, oldentry, #head); \
68 else list_del((struct list_head *)oldentry); \
69} while(0)
70#else
71#define LIST_DELETE(head, oldentry) list_del((struct list_head *)oldentry)
72#endif
73
74/* Append. */
75static inline void
76list_append(struct list_head *head, void *new)
77{
78 ASSERT_WRITE_LOCK(head);
79 list_add((new), (head)->prev);
80}
81
82/* Prepend. */
83static inline void
84list_prepend(struct list_head *head, void *new)
85{
86 ASSERT_WRITE_LOCK(head);
87 list_add(new, head);
88}
89
90/* Insert according to ordering function; insert before first true. */
91#define LIST_INSERT(head, new, cmpfn) \
92do { \
93 struct list_head *__i; \
94 ASSERT_WRITE_LOCK(head); \
95 list_for_each(__i, (head)) \
96 if ((new), (typeof (new))__i) \
97 break; \
98 list_add((struct list_head *)(new), __i->prev); \
99} while(0)
100
101/* If the field after the list_head is a nul-terminated string, you
102 can use these functions. */
103static inline int __list_cmp_name(const void *i, const char *name)
104{
105 return strcmp(name, i+sizeof(struct list_head)) == 0;
106}
107
108/* Returns false if same name already in list, otherwise does insert. */
109static inline int
110list_named_insert(struct list_head *head, void *new)
111{
112 if (LIST_FIND(head, __list_cmp_name, void *,
113 new + sizeof(struct list_head)))
114 return 0;
115 list_prepend(head, new);
116 return 1;
117}
118
119/* Find this named element in the list. */
120#define list_named_find(head, name) \
121LIST_FIND(head, __list_cmp_name, void *, name)
122
123#endif /*_LISTHELP_H*/
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 52a7b9e76428..d97e268cdfe5 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -73,6 +73,7 @@ enum nf_ip6_hook_priorities {
73}; 73};
74 74
75#ifdef CONFIG_NETFILTER 75#ifdef CONFIG_NETFILTER
76extern int ip6_route_me_harder(struct sk_buff *skb);
76extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook, 77extern unsigned int nf_ip6_checksum(struct sk_buff *skb, unsigned int hook,
77 unsigned int dataoff, u_int8_t protocol); 78 unsigned int dataoff, u_int8_t protocol);
78 79
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index d0d5d1ee4be3..d7a8e9c0dad0 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -300,8 +300,7 @@ extern unsigned int ip6t_do_table(struct sk_buff **pskb,
300 unsigned int hook, 300 unsigned int hook,
301 const struct net_device *in, 301 const struct net_device *in,
302 const struct net_device *out, 302 const struct net_device *out,
303 struct ip6t_table *table, 303 struct ip6t_table *table);
304 void *userdata);
305 304
306/* Check for an extension */ 305/* Check for an extension */
307extern int ip6t_ext_hdr(u8 nexthdr); 306extern int ip6t_ext_hdr(u8 nexthdr);
diff --git a/include/linux/netfilter_logging.h b/include/linux/netfilter_logging.h
deleted file mode 100644
index 562bb6aad4e1..000000000000
--- a/include/linux/netfilter_logging.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/* Internal logging interface, which relies on the real
2 LOG target modules */
3#ifndef __LINUX_NETFILTER_LOGGING_H
4#define __LINUX_NETFILTER_LOGGING_H
5
6#ifdef __KERNEL__
7#include <asm/atomic.h>
8
9struct nf_logging_t {
10 void (*nf_log_packet)(struct sk_buff **pskb,
11 unsigned int hooknum,
12 const struct net_device *in,
13 const struct net_device *out,
14 const char *prefix);
15 void (*nf_log)(char *pfh, size_t len,
16 const char *prefix);
17};
18
19extern void nf_log_register(int pf, const struct nf_logging_t *logging);
20extern void nf_log_unregister(int pf, const struct nf_logging_t *logging);
21
22extern void nf_log_packet(int pf,
23 struct sk_buff **pskb,
24 unsigned int hooknum,
25 const struct net_device *in,
26 const struct net_device *out,
27 const char *fmt, ...);
28extern void nf_log(int pf,
29 char *pfh, size_t len,
30 const char *fmt, ...);
31#endif /*__KERNEL__*/
32
33#endif /*__LINUX_NETFILTER_LOGGING_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 855b44668caa..66411622e06e 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -21,6 +21,8 @@
21#define NETLINK_DNRTMSG 14 /* DECnet routing messages */ 21#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
22#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ 22#define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */
23#define NETLINK_GENERIC 16 23#define NETLINK_GENERIC 16
24/* leave room for NETLINK_DM (DM Events) */
25#define NETLINK_SCSITRANSPORT 18 /* SCSI Transports */
24 26
25#define MAX_LINKS 32 27#define MAX_LINKS 32
26 28
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 6c2066caeaab..36f5bcf513b0 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -9,6 +9,8 @@
9#ifndef _LINUX_NFS_FS_H 9#ifndef _LINUX_NFS_FS_H
10#define _LINUX_NFS_FS_H 10#define _LINUX_NFS_FS_H
11 11
12#include <linux/magic.h>
13
12/* 14/*
13 * Enable debugging support for nfs client. 15 * Enable debugging support for nfs client.
14 * Requires RPC_DEBUG. 16 * Requires RPC_DEBUG.
@@ -22,11 +24,6 @@
22#define NFS_MAX_TCP_TIMEOUT (600*HZ) 24#define NFS_MAX_TCP_TIMEOUT (600*HZ)
23 25
24/* 26/*
25 * superblock magic number for NFS
26 */
27#define NFS_SUPER_MAGIC 0x6969
28
29/*
30 * When flushing a cluster of dirty pages, there can be different 27 * When flushing a cluster of dirty pages, there can be different
31 * strategies: 28 * strategies:
32 */ 29 */
@@ -42,6 +39,7 @@
42#include <linux/in.h> 39#include <linux/in.h>
43#include <linux/mm.h> 40#include <linux/mm.h>
44#include <linux/pagemap.h> 41#include <linux/pagemap.h>
42#include <linux/rbtree.h>
45#include <linux/rwsem.h> 43#include <linux/rwsem.h>
46#include <linux/wait.h> 44#include <linux/wait.h>
47 45
@@ -69,6 +67,8 @@
69 * NFSv3/v4 Access mode cache entry 67 * NFSv3/v4 Access mode cache entry
70 */ 68 */
71struct nfs_access_entry { 69struct nfs_access_entry {
70 struct rb_node rb_node;
71 struct list_head lru;
72 unsigned long jiffies; 72 unsigned long jiffies;
73 struct rpc_cred * cred; 73 struct rpc_cred * cred;
74 int mask; 74 int mask;
@@ -145,7 +145,9 @@ struct nfs_inode {
145 */ 145 */
146 atomic_t data_updates; 146 atomic_t data_updates;
147 147
148 struct nfs_access_entry cache_access; 148 struct rb_root access_cache;
149 struct list_head access_cache_entry_lru;
150 struct list_head access_cache_inode_lru;
149#ifdef CONFIG_NFS_V3_ACL 151#ifdef CONFIG_NFS_V3_ACL
150 struct posix_acl *acl_access; 152 struct posix_acl *acl_access;
151 struct posix_acl *acl_default; 153 struct posix_acl *acl_default;
@@ -199,6 +201,7 @@ struct nfs_inode {
199#define NFS_INO_REVALIDATING (0) /* revalidating attrs */ 201#define NFS_INO_REVALIDATING (0) /* revalidating attrs */
200#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */ 202#define NFS_INO_ADVISE_RDPLUS (1) /* advise readdirplus */
201#define NFS_INO_STALE (2) /* possible stale inode */ 203#define NFS_INO_STALE (2) /* possible stale inode */
204#define NFS_INO_ACL_LRU_SET (3) /* Inode is on the LRU list */
202 205
203static inline struct nfs_inode *NFS_I(struct inode *inode) 206static inline struct nfs_inode *NFS_I(struct inode *inode)
204{ 207{
@@ -209,8 +212,7 @@ static inline struct nfs_inode *NFS_I(struct inode *inode)
209#define NFS_FH(inode) (&NFS_I(inode)->fh) 212#define NFS_FH(inode) (&NFS_I(inode)->fh)
210#define NFS_SERVER(inode) (NFS_SB(inode->i_sb)) 213#define NFS_SERVER(inode) (NFS_SB(inode->i_sb))
211#define NFS_CLIENT(inode) (NFS_SERVER(inode)->client) 214#define NFS_CLIENT(inode) (NFS_SERVER(inode)->client)
212#define NFS_PROTO(inode) (NFS_SERVER(inode)->rpc_ops) 215#define NFS_PROTO(inode) (NFS_SERVER(inode)->nfs_client->rpc_ops)
213#define NFS_ADDR(inode) (RPC_PEERADDR(NFS_CLIENT(inode)))
214#define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf) 216#define NFS_COOKIEVERF(inode) (NFS_I(inode)->cookieverf)
215#define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies) 217#define NFS_READTIME(inode) (NFS_I(inode)->read_cache_jiffies)
216#define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr) 218#define NFS_CHANGE_ATTR(inode) (NFS_I(inode)->change_attr)
@@ -297,6 +299,7 @@ extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
297extern int nfs_permission(struct inode *, int, struct nameidata *); 299extern int nfs_permission(struct inode *, int, struct nameidata *);
298extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *); 300extern int nfs_access_get_cached(struct inode *, struct rpc_cred *, struct nfs_access_entry *);
299extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *); 301extern void nfs_access_add_cache(struct inode *, struct nfs_access_entry *);
302extern void nfs_access_zap_cache(struct inode *inode);
300extern int nfs_open(struct inode *, struct file *); 303extern int nfs_open(struct inode *, struct file *);
301extern int nfs_release(struct inode *, struct file *); 304extern int nfs_release(struct inode *, struct file *);
302extern int nfs_attribute_timeout(struct inode *inode); 305extern int nfs_attribute_timeout(struct inode *inode);
@@ -579,6 +582,7 @@ extern void * nfs_root_data(void);
579#define NFSDBG_FILE 0x0040 582#define NFSDBG_FILE 0x0040
580#define NFSDBG_ROOT 0x0080 583#define NFSDBG_ROOT 0x0080
581#define NFSDBG_CALLBACK 0x0100 584#define NFSDBG_CALLBACK 0x0100
585#define NFSDBG_CLIENT 0x0200
582#define NFSDBG_ALL 0xFFFF 586#define NFSDBG_ALL 0xFFFF
583 587
584#ifdef __KERNEL__ 588#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 6b4a13c79474..7ccfc7ef0a83 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -7,13 +7,79 @@
7struct nfs_iostats; 7struct nfs_iostats;
8 8
9/* 9/*
10 * The nfs_client identifies our client state to the server.
11 */
12struct nfs_client {
13 atomic_t cl_count;
14 int cl_cons_state; /* current construction state (-ve: init error) */
15#define NFS_CS_READY 0 /* ready to be used */
16#define NFS_CS_INITING 1 /* busy initialising */
17 int cl_nfsversion; /* NFS protocol version */
18 unsigned long cl_res_state; /* NFS resources state */
19#define NFS_CS_RPCIOD 0 /* - rpciod started */
20#define NFS_CS_CALLBACK 1 /* - callback started */
21#define NFS_CS_IDMAP 2 /* - idmap started */
22#define NFS_CS_RENEWD 3 /* - renewd started */
23 struct sockaddr_in cl_addr; /* server identifier */
24 char * cl_hostname; /* hostname of server */
25 struct list_head cl_share_link; /* link in global client list */
26 struct list_head cl_superblocks; /* List of nfs_server structs */
27
28 struct rpc_clnt * cl_rpcclient;
29 const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */
30 unsigned long retrans_timeo; /* retransmit timeout */
31 unsigned int retrans_count; /* number of retransmit tries */
32
33#ifdef CONFIG_NFS_V4
34 u64 cl_clientid; /* constant */
35 nfs4_verifier cl_confirm;
36 unsigned long cl_state;
37
38 u32 cl_lockowner_id;
39
40 /*
41 * The following rwsem ensures exclusive access to the server
42 * while we recover the state following a lease expiration.
43 */
44 struct rw_semaphore cl_sem;
45
46 struct list_head cl_delegations;
47 struct list_head cl_state_owners;
48 struct list_head cl_unused;
49 int cl_nunused;
50 spinlock_t cl_lock;
51
52 unsigned long cl_lease_time;
53 unsigned long cl_last_renewal;
54 struct work_struct cl_renewd;
55
56 struct rpc_wait_queue cl_rpcwaitq;
57
58 /* used for the setclientid verifier */
59 struct timespec cl_boot_time;
60
61 /* idmapper */
62 struct idmap * cl_idmap;
63
64 /* Our own IP address, as a null-terminated string.
65 * This is used to generate the clientid, and the callback address.
66 */
67 char cl_ipaddr[16];
68 unsigned char cl_id_uniquifier;
69#endif
70};
71
72/*
10 * NFS client parameters stored in the superblock. 73 * NFS client parameters stored in the superblock.
11 */ 74 */
12struct nfs_server { 75struct nfs_server {
76 struct nfs_client * nfs_client; /* shared client and NFS4 state */
77 struct list_head client_link; /* List of other nfs_server structs
78 * that share the same client
79 */
80 struct list_head master_link; /* link in master servers list */
13 struct rpc_clnt * client; /* RPC client handle */ 81 struct rpc_clnt * client; /* RPC client handle */
14 struct rpc_clnt * client_sys; /* 2nd handle for FSINFO */
15 struct rpc_clnt * client_acl; /* ACL RPC client handle */ 82 struct rpc_clnt * client_acl; /* ACL RPC client handle */
16 struct nfs_rpc_ops * rpc_ops; /* NFS protocol vector */
17 struct nfs_iostats * io_stats; /* I/O statistics */ 83 struct nfs_iostats * io_stats; /* I/O statistics */
18 struct backing_dev_info backing_dev_info; 84 struct backing_dev_info backing_dev_info;
19 int flags; /* various flags */ 85 int flags; /* various flags */
@@ -29,24 +95,14 @@ struct nfs_server {
29 unsigned int acregmax; 95 unsigned int acregmax;
30 unsigned int acdirmin; 96 unsigned int acdirmin;
31 unsigned int acdirmax; 97 unsigned int acdirmax;
32 unsigned long retrans_timeo; /* retransmit timeout */
33 unsigned int retrans_count; /* number of retransmit tries */
34 unsigned int namelen; 98 unsigned int namelen;
35 char * hostname; /* remote hostname */ 99
36 struct nfs_fh fh;
37 struct sockaddr_in addr;
38 struct nfs_fsid fsid; 100 struct nfs_fsid fsid;
101 __u64 maxfilesize; /* maximum file size */
39 unsigned long mount_time; /* when this fs was mounted */ 102 unsigned long mount_time; /* when this fs was mounted */
103 dev_t s_dev; /* superblock dev numbers */
104
40#ifdef CONFIG_NFS_V4 105#ifdef CONFIG_NFS_V4
41 /* Our own IP address, as a null-terminated string.
42 * This is used to generate the clientid, and the callback address.
43 */
44 char ip_addr[16];
45 char * mnt_path;
46 struct nfs4_client * nfs4_state; /* all NFSv4 state starts here */
47 struct list_head nfs4_siblings; /* List of other nfs_server structs
48 * that share the same clientid
49 */
50 u32 attr_bitmask[2];/* V4 bitmask representing the set 106 u32 attr_bitmask[2];/* V4 bitmask representing the set
51 of attributes supported on this 107 of attributes supported on this
52 filesystem */ 108 filesystem */
@@ -54,6 +110,7 @@ struct nfs_server {
54 that are supported on this 110 that are supported on this
55 filesystem */ 111 filesystem */
56#endif 112#endif
113 void (*destroy)(struct nfs_server *);
57}; 114};
58 115
59/* Server capabilities */ 116/* Server capabilities */
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index 102e56094296..15a9f3b7289a 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -62,15 +62,15 @@ struct idmap_msg {
62#ifdef __KERNEL__ 62#ifdef __KERNEL__
63 63
64/* Forward declaration to make this header independent of others */ 64/* Forward declaration to make this header independent of others */
65struct nfs4_client; 65struct nfs_client;
66 66
67void nfs_idmap_new(struct nfs4_client *); 67int nfs_idmap_new(struct nfs_client *);
68void nfs_idmap_delete(struct nfs4_client *); 68void nfs_idmap_delete(struct nfs_client *);
69 69
70int nfs_map_name_to_uid(struct nfs4_client *, const char *, size_t, __u32 *); 70int nfs_map_name_to_uid(struct nfs_client *, const char *, size_t, __u32 *);
71int nfs_map_group_to_gid(struct nfs4_client *, const char *, size_t, __u32 *); 71int nfs_map_group_to_gid(struct nfs_client *, const char *, size_t, __u32 *);
72int nfs_map_uid_to_name(struct nfs4_client *, __u32, char *); 72int nfs_map_uid_to_name(struct nfs_client *, __u32, char *);
73int nfs_map_gid_to_group(struct nfs4_client *, __u32, char *); 73int nfs_map_gid_to_group(struct nfs_client *, __u32, char *);
74 74
75extern unsigned int nfs_idmap_cache_timeout; 75extern unsigned int nfs_idmap_cache_timeout;
76#endif /* __KERNEL__ */ 76#endif /* __KERNEL__ */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 41e5a19199e9..dc5397d9d23c 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -1,7 +1,6 @@
1#ifndef _LINUX_NFS_XDR_H 1#ifndef _LINUX_NFS_XDR_H
2#define _LINUX_NFS_XDR_H 2#define _LINUX_NFS_XDR_H
3 3
4#include <linux/sunrpc/xprt.h>
5#include <linux/nfsacl.h> 4#include <linux/nfsacl.h>
6 5
7/* 6/*
@@ -359,8 +358,8 @@ struct nfs_symlinkargs {
359 struct nfs_fh * fromfh; 358 struct nfs_fh * fromfh;
360 const char * fromname; 359 const char * fromname;
361 unsigned int fromlen; 360 unsigned int fromlen;
362 const char * topath; 361 struct page ** pages;
363 unsigned int tolen; 362 unsigned int pathlen;
364 struct iattr * sattr; 363 struct iattr * sattr;
365}; 364};
366 365
@@ -435,8 +434,8 @@ struct nfs3_symlinkargs {
435 struct nfs_fh * fromfh; 434 struct nfs_fh * fromfh;
436 const char * fromname; 435 const char * fromname;
437 unsigned int fromlen; 436 unsigned int fromlen;
438 const char * topath; 437 struct page ** pages;
439 unsigned int tolen; 438 unsigned int pathlen;
440 struct iattr * sattr; 439 struct iattr * sattr;
441}; 440};
442 441
@@ -534,7 +533,10 @@ struct nfs4_accessres {
534struct nfs4_create_arg { 533struct nfs4_create_arg {
535 u32 ftype; 534 u32 ftype;
536 union { 535 union {
537 struct qstr * symlink; /* NF4LNK */ 536 struct {
537 struct page ** pages;
538 unsigned int len;
539 } symlink; /* NF4LNK */
538 struct { 540 struct {
539 u32 specdata1; 541 u32 specdata1;
540 u32 specdata2; 542 u32 specdata2;
@@ -770,6 +772,9 @@ struct nfs_rpc_ops {
770 772
771 int (*getroot) (struct nfs_server *, struct nfs_fh *, 773 int (*getroot) (struct nfs_server *, struct nfs_fh *,
772 struct nfs_fsinfo *); 774 struct nfs_fsinfo *);
775 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
776 struct qstr *, struct nfs_fh *,
777 struct nfs_fattr *);
773 int (*getattr) (struct nfs_server *, struct nfs_fh *, 778 int (*getattr) (struct nfs_server *, struct nfs_fh *,
774 struct nfs_fattr *); 779 struct nfs_fattr *);
775 int (*setattr) (struct dentry *, struct nfs_fattr *, 780 int (*setattr) (struct dentry *, struct nfs_fattr *,
@@ -791,9 +796,8 @@ struct nfs_rpc_ops {
791 int (*rename) (struct inode *, struct qstr *, 796 int (*rename) (struct inode *, struct qstr *,
792 struct inode *, struct qstr *); 797 struct inode *, struct qstr *);
793 int (*link) (struct inode *, struct inode *, struct qstr *); 798 int (*link) (struct inode *, struct inode *, struct qstr *);
794 int (*symlink) (struct inode *, struct qstr *, struct qstr *, 799 int (*symlink) (struct inode *, struct dentry *, struct page *,
795 struct iattr *, struct nfs_fh *, 800 unsigned int, struct iattr *);
796 struct nfs_fattr *);
797 int (*mkdir) (struct inode *, struct dentry *, struct iattr *); 801 int (*mkdir) (struct inode *, struct dentry *, struct iattr *);
798 int (*rmdir) (struct inode *, struct qstr *); 802 int (*rmdir) (struct inode *, struct qstr *);
799 int (*readdir) (struct dentry *, struct rpc_cred *, 803 int (*readdir) (struct dentry *, struct rpc_cred *,
@@ -806,6 +810,7 @@ struct nfs_rpc_ops {
806 struct nfs_fsinfo *); 810 struct nfs_fsinfo *);
807 int (*pathconf) (struct nfs_server *, struct nfs_fh *, 811 int (*pathconf) (struct nfs_server *, struct nfs_fh *,
808 struct nfs_pathconf *); 812 struct nfs_pathconf *);
813 int (*set_capabilities)(struct nfs_server *, struct nfs_fh *);
809 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus); 814 u32 * (*decode_dirent)(u32 *, struct nfs_entry *, int plus);
810 void (*read_setup) (struct nfs_read_data *); 815 void (*read_setup) (struct nfs_read_data *);
811 int (*read_done) (struct rpc_task *, struct nfs_read_data *); 816 int (*read_done) (struct rpc_task *, struct nfs_read_data *);
@@ -829,9 +834,9 @@ struct nfs_rpc_ops {
829/* 834/*
830 * Function vectors etc. for the NFS client 835 * Function vectors etc. for the NFS client
831 */ 836 */
832extern struct nfs_rpc_ops nfs_v2_clientops; 837extern const struct nfs_rpc_ops nfs_v2_clientops;
833extern struct nfs_rpc_ops nfs_v3_clientops; 838extern const struct nfs_rpc_ops nfs_v3_clientops;
834extern struct nfs_rpc_ops nfs_v4_clientops; 839extern const struct nfs_rpc_ops nfs_v4_clientops;
835extern struct rpc_version nfs_version2; 840extern struct rpc_version nfs_version2;
836extern struct rpc_version nfs_version3; 841extern struct rpc_version nfs_version3;
837extern struct rpc_version nfs_version4; 842extern struct rpc_version nfs_version4;
diff --git a/include/linux/openprom_fs.h b/include/linux/openprom_fs.h
deleted file mode 100644
index a837aab8217e..000000000000
--- a/include/linux/openprom_fs.h
+++ /dev/null
@@ -1,10 +0,0 @@
1#ifndef _LINUX_OPENPROM_FS_H
2#define _LINUX_OPENPROM_FS_H
3
4/*
5 * The openprom filesystem constants/structures
6 */
7
8#define OPENPROM_SUPER_MAGIC 0x9fa1
9
10#endif /* _LINUX_OPENPROM_FS_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 7a249155ee4e..6a1e09834559 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2010,6 +2010,23 @@
2010#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea 2010#define PCI_DEVICE_ID_ALTIMA_AC9100 0x03ea
2011#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb 2011#define PCI_DEVICE_ID_ALTIMA_AC1003 0x03eb
2012 2012
2013#define PCI_VENDOR_ID_ARECA 0x17d3
2014#define PCI_DEVICE_ID_ARECA_1110 0x1110
2015#define PCI_DEVICE_ID_ARECA_1120 0x1120
2016#define PCI_DEVICE_ID_ARECA_1130 0x1130
2017#define PCI_DEVICE_ID_ARECA_1160 0x1160
2018#define PCI_DEVICE_ID_ARECA_1170 0x1170
2019#define PCI_DEVICE_ID_ARECA_1210 0x1210
2020#define PCI_DEVICE_ID_ARECA_1220 0x1220
2021#define PCI_DEVICE_ID_ARECA_1230 0x1230
2022#define PCI_DEVICE_ID_ARECA_1260 0x1260
2023#define PCI_DEVICE_ID_ARECA_1270 0x1270
2024#define PCI_DEVICE_ID_ARECA_1280 0x1280
2025#define PCI_DEVICE_ID_ARECA_1380 0x1380
2026#define PCI_DEVICE_ID_ARECA_1381 0x1381
2027#define PCI_DEVICE_ID_ARECA_1680 0x1680
2028#define PCI_DEVICE_ID_ARECA_1681 0x1681
2029
2013#define PCI_VENDOR_ID_S2IO 0x17d5 2030#define PCI_VENDOR_ID_S2IO 0x17d5
2014#define PCI_DEVICE_ID_S2IO_WIN 0x5731 2031#define PCI_DEVICE_ID_S2IO_WIN 0x5731
2015#define PCI_DEVICE_ID_S2IO_UNI 0x5831 2032#define PCI_DEVICE_ID_S2IO_UNI 0x5831
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index bd2c5a2bbbf5..c3f01b3085a4 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -305,6 +305,7 @@ enum
305 TCA_FW_POLICE, 305 TCA_FW_POLICE,
306 TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */ 306 TCA_FW_INDEV, /* used by CONFIG_NET_CLS_IND */
307 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */ 307 TCA_FW_ACT, /* used by CONFIG_NET_CLS_ACT */
308 TCA_FW_MASK,
308 __TCA_FW_MAX 309 __TCA_FW_MAX
309}; 310};
310 311
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 17e75783e3a5..3435ca38dd14 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -4,6 +4,7 @@
4#include <linux/slab.h> 4#include <linux/slab.h>
5#include <linux/fs.h> 5#include <linux/fs.h>
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/magic.h>
7#include <asm/atomic.h> 8#include <asm/atomic.h>
8 9
9/* 10/*
@@ -24,8 +25,6 @@ enum {
24 PROC_ROOT_INO = 1, 25 PROC_ROOT_INO = 1,
25}; 26};
26 27
27#define PROC_SUPER_MAGIC 0x9fa0
28
29/* 28/*
30 * This is not completely implemented yet. The idea is to 29 * This is not completely implemented yet. The idea is to
31 * create an in-memory tree (like the actual /proc filesystem 30 * create an in-memory tree (like the actual /proc filesystem
diff --git a/include/linux/qnx4_fs.h b/include/linux/qnx4_fs.h
index 27f49c85d5d6..0c7ac444fd35 100644
--- a/include/linux/qnx4_fs.h
+++ b/include/linux/qnx4_fs.h
@@ -11,6 +11,7 @@
11#define _LINUX_QNX4_FS_H 11#define _LINUX_QNX4_FS_H
12 12
13#include <linux/qnxtypes.h> 13#include <linux/qnxtypes.h>
14#include <linux/magic.h>
14 15
15#define QNX4_ROOT_INO 1 16#define QNX4_ROOT_INO 1
16 17
@@ -25,7 +26,6 @@
25 26
26#define QNX4_I_MAP_SLOTS 8 27#define QNX4_I_MAP_SLOTS 8
27#define QNX4_Z_MAP_SLOTS 64 28#define QNX4_Z_MAP_SLOTS 64
28#define QNX4_SUPER_MAGIC 0x002f /* qnx4 fs detection */
29#define QNX4_VALID_FS 0x0001 /* Clean fs. */ 29#define QNX4_VALID_FS 0x0001 /* Clean fs. */
30#define QNX4_ERROR_FS 0x0002 /* fs has errors. */ 30#define QNX4_ERROR_FS 0x0002 /* fs has errors. */
31#define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */ 31#define QNX4_BLOCK_SIZE 0x200 /* blocksize of 512 bytes */
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index daa2d83cefe8..28493ffaafe7 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -12,6 +12,8 @@
12#define _LINUX_REISER_FS_H 12#define _LINUX_REISER_FS_H
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/magic.h>
16
15#ifdef __KERNEL__ 17#ifdef __KERNEL__
16#include <linux/slab.h> 18#include <linux/slab.h>
17#include <linux/interrupt.h> 19#include <linux/interrupt.h>
@@ -227,14 +229,6 @@ struct reiserfs_super_block {
227 ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \ 229 ((!is_reiserfs_jr(SB_DISK_SUPER_BLOCK(s)) ? \
228 SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s))) 230 SB_ONDISK_JOURNAL_SIZE(s) + 1 : SB_ONDISK_RESERVED_FOR_JOURNAL(s)))
229 231
230 /* used by gcc */
231#define REISERFS_SUPER_MAGIC 0x52654973
232 /* used by file system utilities that
233 look at the superblock, etc. */
234#define REISERFS_SUPER_MAGIC_STRING "ReIsErFs"
235#define REISER2FS_SUPER_MAGIC_STRING "ReIsEr2Fs"
236#define REISER2FS_JR_SUPER_MAGIC_STRING "ReIsEr3Fs"
237
238int is_reiserfs_3_5(struct reiserfs_super_block *rs); 232int is_reiserfs_3_5(struct reiserfs_super_block *rs);
239int is_reiserfs_3_6(struct reiserfs_super_block *rs); 233int is_reiserfs_3_6(struct reiserfs_super_block *rs);
240int is_reiserfs_jr(struct reiserfs_super_block *rs); 234int is_reiserfs_jr(struct reiserfs_super_block *rs);
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index facd9ee37b76..9c92dc8b9a08 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -2,6 +2,7 @@
2#define __LINUX_RTNETLINK_H 2#define __LINUX_RTNETLINK_H
3 3
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/if.h>
5 6
6/**** 7/****
7 * Routing/neighbour discovery messages. 8 * Routing/neighbour discovery messages.
@@ -238,10 +239,8 @@ enum rt_class_t
238 RT_TABLE_DEFAULT=253, 239 RT_TABLE_DEFAULT=253,
239 RT_TABLE_MAIN=254, 240 RT_TABLE_MAIN=254,
240 RT_TABLE_LOCAL=255, 241 RT_TABLE_LOCAL=255,
241 __RT_TABLE_MAX 242 RT_TABLE_MAX=0xFFFFFFFF
242}; 243};
243#define RT_TABLE_MAX (__RT_TABLE_MAX - 1)
244
245 244
246 245
247/* Routing message attributes */ 246/* Routing message attributes */
@@ -263,6 +262,7 @@ enum rtattr_type_t
263 RTA_CACHEINFO, 262 RTA_CACHEINFO,
264 RTA_SESSION, 263 RTA_SESSION,
265 RTA_MP_ALGO, 264 RTA_MP_ALGO,
265 RTA_TABLE,
266 __RTA_MAX 266 __RTA_MAX
267}; 267};
268 268
@@ -383,226 +383,6 @@ struct rta_session
383 } u; 383 } u;
384}; 384};
385 385
386
387/*********************************************************
388 * Interface address.
389 ****/
390
391struct ifaddrmsg
392{
393 unsigned char ifa_family;
394 unsigned char ifa_prefixlen; /* The prefix length */
395 unsigned char ifa_flags; /* Flags */
396 unsigned char ifa_scope; /* See above */
397 int ifa_index; /* Link index */
398};
399
400enum
401{
402 IFA_UNSPEC,
403 IFA_ADDRESS,
404 IFA_LOCAL,
405 IFA_LABEL,
406 IFA_BROADCAST,
407 IFA_ANYCAST,
408 IFA_CACHEINFO,
409 IFA_MULTICAST,
410 __IFA_MAX
411};
412
413#define IFA_MAX (__IFA_MAX - 1)
414
415/* ifa_flags */
416
417#define IFA_F_SECONDARY 0x01
418#define IFA_F_TEMPORARY IFA_F_SECONDARY
419
420#define IFA_F_DEPRECATED 0x20
421#define IFA_F_TENTATIVE 0x40
422#define IFA_F_PERMANENT 0x80
423
424struct ifa_cacheinfo
425{
426 __u32 ifa_prefered;
427 __u32 ifa_valid;
428 __u32 cstamp; /* created timestamp, hundredths of seconds */
429 __u32 tstamp; /* updated timestamp, hundredths of seconds */
430};
431
432
433#define IFA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg))))
434#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
435
436/*
437 Important comment:
438 IFA_ADDRESS is prefix address, rather than local interface address.
439 It makes no difference for normally configured broadcast interfaces,
440 but for point-to-point IFA_ADDRESS is DESTINATION address,
441 local address is supplied in IFA_LOCAL attribute.
442 */
443
444/**************************************************************
445 * Neighbour discovery.
446 ****/
447
448struct ndmsg
449{
450 unsigned char ndm_family;
451 unsigned char ndm_pad1;
452 unsigned short ndm_pad2;
453 int ndm_ifindex; /* Link index */
454 __u16 ndm_state;
455 __u8 ndm_flags;
456 __u8 ndm_type;
457};
458
459enum
460{
461 NDA_UNSPEC,
462 NDA_DST,
463 NDA_LLADDR,
464 NDA_CACHEINFO,
465 NDA_PROBES,
466 __NDA_MAX
467};
468
469#define NDA_MAX (__NDA_MAX - 1)
470
471#define NDA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg))))
472#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
473
474/*
475 * Neighbor Cache Entry Flags
476 */
477
478#define NTF_PROXY 0x08 /* == ATF_PUBL */
479#define NTF_ROUTER 0x80
480
481/*
482 * Neighbor Cache Entry States.
483 */
484
485#define NUD_INCOMPLETE 0x01
486#define NUD_REACHABLE 0x02
487#define NUD_STALE 0x04
488#define NUD_DELAY 0x08
489#define NUD_PROBE 0x10
490#define NUD_FAILED 0x20
491
492/* Dummy states */
493#define NUD_NOARP 0x40
494#define NUD_PERMANENT 0x80
495#define NUD_NONE 0x00
496
497
498struct nda_cacheinfo
499{
500 __u32 ndm_confirmed;
501 __u32 ndm_used;
502 __u32 ndm_updated;
503 __u32 ndm_refcnt;
504};
505
506
507/*****************************************************************
508 * Neighbour tables specific messages.
509 *
510 * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
511 * NLM_F_DUMP flag set. Every neighbour table configuration is
512 * spread over multiple messages to avoid running into message
513 * size limits on systems with many interfaces. The first message
514 * in the sequence transports all not device specific data such as
515 * statistics, configuration, and the default parameter set.
516 * This message is followed by 0..n messages carrying device
517 * specific parameter sets.
518 * Although the ordering should be sufficient, NDTA_NAME can be
519 * used to identify sequences. The initial message can be identified
520 * by checking for NDTA_CONFIG. The device specific messages do
521 * not contain this TLV but have NDTPA_IFINDEX set to the
522 * corresponding interface index.
523 *
524 * To change neighbour table attributes, send RTM_SETNEIGHTBL
525 * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
526 * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
527 * otherwise. Device specific parameter sets can be changed by
528 * setting NDTPA_IFINDEX to the interface index of the corresponding
529 * device.
530 ****/
531
532struct ndt_stats
533{
534 __u64 ndts_allocs;
535 __u64 ndts_destroys;
536 __u64 ndts_hash_grows;
537 __u64 ndts_res_failed;
538 __u64 ndts_lookups;
539 __u64 ndts_hits;
540 __u64 ndts_rcv_probes_mcast;
541 __u64 ndts_rcv_probes_ucast;
542 __u64 ndts_periodic_gc_runs;
543 __u64 ndts_forced_gc_runs;
544};
545
546enum {
547 NDTPA_UNSPEC,
548 NDTPA_IFINDEX, /* u32, unchangeable */
549 NDTPA_REFCNT, /* u32, read-only */
550 NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
551 NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
552 NDTPA_RETRANS_TIME, /* u64, msecs */
553 NDTPA_GC_STALETIME, /* u64, msecs */
554 NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
555 NDTPA_QUEUE_LEN, /* u32 */
556 NDTPA_APP_PROBES, /* u32 */
557 NDTPA_UCAST_PROBES, /* u32 */
558 NDTPA_MCAST_PROBES, /* u32 */
559 NDTPA_ANYCAST_DELAY, /* u64, msecs */
560 NDTPA_PROXY_DELAY, /* u64, msecs */
561 NDTPA_PROXY_QLEN, /* u32 */
562 NDTPA_LOCKTIME, /* u64, msecs */
563 __NDTPA_MAX
564};
565#define NDTPA_MAX (__NDTPA_MAX - 1)
566
567struct ndtmsg
568{
569 __u8 ndtm_family;
570 __u8 ndtm_pad1;
571 __u16 ndtm_pad2;
572};
573
574struct ndt_config
575{
576 __u16 ndtc_key_len;
577 __u16 ndtc_entry_size;
578 __u32 ndtc_entries;
579 __u32 ndtc_last_flush; /* delta to now in msecs */
580 __u32 ndtc_last_rand; /* delta to now in msecs */
581 __u32 ndtc_hash_rnd;
582 __u32 ndtc_hash_mask;
583 __u32 ndtc_hash_chain_gc;
584 __u32 ndtc_proxy_qlen;
585};
586
587enum {
588 NDTA_UNSPEC,
589 NDTA_NAME, /* char *, unchangeable */
590 NDTA_THRESH1, /* u32 */
591 NDTA_THRESH2, /* u32 */
592 NDTA_THRESH3, /* u32 */
593 NDTA_CONFIG, /* struct ndt_config, read-only */
594 NDTA_PARMS, /* nested TLV NDTPA_* */
595 NDTA_STATS, /* struct ndt_stats, read-only */
596 NDTA_GC_INTERVAL, /* u64, msecs */
597 __NDTA_MAX
598};
599#define NDTA_MAX (__NDTA_MAX - 1)
600
601#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \
602 NLMSG_ALIGN(sizeof(struct ndtmsg))))
603#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
604
605
606/**** 386/****
607 * General form of address family dependent message. 387 * General form of address family dependent message.
608 ****/ 388 ****/
@@ -663,138 +443,6 @@ struct prefix_cacheinfo
663 __u32 valid_time; 443 __u32 valid_time;
664}; 444};
665 445
666/* The struct should be in sync with struct net_device_stats */
667struct rtnl_link_stats
668{
669 __u32 rx_packets; /* total packets received */
670 __u32 tx_packets; /* total packets transmitted */
671 __u32 rx_bytes; /* total bytes received */
672 __u32 tx_bytes; /* total bytes transmitted */
673 __u32 rx_errors; /* bad packets received */
674 __u32 tx_errors; /* packet transmit problems */
675 __u32 rx_dropped; /* no space in linux buffers */
676 __u32 tx_dropped; /* no space available in linux */
677 __u32 multicast; /* multicast packets received */
678 __u32 collisions;
679
680 /* detailed rx_errors: */
681 __u32 rx_length_errors;
682 __u32 rx_over_errors; /* receiver ring buff overflow */
683 __u32 rx_crc_errors; /* recved pkt with crc error */
684 __u32 rx_frame_errors; /* recv'd frame alignment error */
685 __u32 rx_fifo_errors; /* recv'r fifo overrun */
686 __u32 rx_missed_errors; /* receiver missed packet */
687
688 /* detailed tx_errors */
689 __u32 tx_aborted_errors;
690 __u32 tx_carrier_errors;
691 __u32 tx_fifo_errors;
692 __u32 tx_heartbeat_errors;
693 __u32 tx_window_errors;
694
695 /* for cslip etc */
696 __u32 rx_compressed;
697 __u32 tx_compressed;
698};
699
700/* The struct should be in sync with struct ifmap */
701struct rtnl_link_ifmap
702{
703 __u64 mem_start;
704 __u64 mem_end;
705 __u64 base_addr;
706 __u16 irq;
707 __u8 dma;
708 __u8 port;
709};
710
711enum
712{
713 IFLA_UNSPEC,
714 IFLA_ADDRESS,
715 IFLA_BROADCAST,
716 IFLA_IFNAME,
717 IFLA_MTU,
718 IFLA_LINK,
719 IFLA_QDISC,
720 IFLA_STATS,
721 IFLA_COST,
722#define IFLA_COST IFLA_COST
723 IFLA_PRIORITY,
724#define IFLA_PRIORITY IFLA_PRIORITY
725 IFLA_MASTER,
726#define IFLA_MASTER IFLA_MASTER
727 IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */
728#define IFLA_WIRELESS IFLA_WIRELESS
729 IFLA_PROTINFO, /* Protocol specific information for a link */
730#define IFLA_PROTINFO IFLA_PROTINFO
731 IFLA_TXQLEN,
732#define IFLA_TXQLEN IFLA_TXQLEN
733 IFLA_MAP,
734#define IFLA_MAP IFLA_MAP
735 IFLA_WEIGHT,
736#define IFLA_WEIGHT IFLA_WEIGHT
737 IFLA_OPERSTATE,
738 IFLA_LINKMODE,
739 __IFLA_MAX
740};
741
742
743#define IFLA_MAX (__IFLA_MAX - 1)
744
745#define IFLA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg))))
746#define IFLA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
747
748/* ifi_flags.
749
750 IFF_* flags.
751
752 The only change is:
753 IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are
754 more not changeable by user. They describe link media
755 characteristics and set by device driver.
756
757 Comments:
758 - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid
759 - If neither of these three flags are set;
760 the interface is NBMA.
761
762 - IFF_MULTICAST does not mean anything special:
763 multicasts can be used on all not-NBMA links.
764 IFF_MULTICAST means that this media uses special encapsulation
765 for multicast frames. Apparently, all IFF_POINTOPOINT and
766 IFF_BROADCAST devices are able to use multicasts too.
767 */
768
769/* IFLA_LINK.
770 For usual devices it is equal ifi_index.
771 If it is a "virtual interface" (f.e. tunnel), ifi_link
772 can point to real physical interface (f.e. for bandwidth calculations),
773 or maybe 0, what means, that real media is unknown (usual
774 for IPIP tunnels, when route to endpoint is allowed to change)
775 */
776
777/* Subtype attributes for IFLA_PROTINFO */
778enum
779{
780 IFLA_INET6_UNSPEC,
781 IFLA_INET6_FLAGS, /* link flags */
782 IFLA_INET6_CONF, /* sysctl parameters */
783 IFLA_INET6_STATS, /* statistics */
784 IFLA_INET6_MCAST, /* MC things. What of them? */
785 IFLA_INET6_CACHEINFO, /* time values and max reasm size */
786 __IFLA_INET6_MAX
787};
788
789#define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1)
790
791struct ifla_cacheinfo
792{
793 __u32 max_reasm_len;
794 __u32 tstamp; /* ipv6InterfaceTable updated timestamp */
795 __u32 reachable_time;
796 __u32 retrans_time;
797};
798 446
799/***************************************************************** 447/*****************************************************************
800 * Traffic control messages. 448 * Traffic control messages.
@@ -885,10 +533,13 @@ enum rtnetlink_groups {
885 RTNLGRP_NOP2, 533 RTNLGRP_NOP2,
886 RTNLGRP_DECnet_ROUTE, 534 RTNLGRP_DECnet_ROUTE,
887#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE 535#define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE
888 RTNLGRP_NOP3, 536 RTNLGRP_DECnet_RULE,
537#define RTNLGRP_DECnet_RULE RTNLGRP_DECnet_RULE
889 RTNLGRP_NOP4, 538 RTNLGRP_NOP4,
890 RTNLGRP_IPV6_PREFIX, 539 RTNLGRP_IPV6_PREFIX,
891#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX 540#define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX
541 RTNLGRP_IPV6_RULE,
542#define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE
892 __RTNLGRP_MAX 543 __RTNLGRP_MAX
893}; 544};
894#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 545#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
@@ -923,8 +574,6 @@ extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, in
923#define rtattr_parse_nested(tb, max, rta) \ 574#define rtattr_parse_nested(tb, max, rta) \
924 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) 575 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
925 576
926extern struct sock *rtnl;
927
928struct rtnetlink_link 577struct rtnetlink_link
929{ 578{
930 int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr); 579 int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr);
@@ -933,6 +582,10 @@ struct rtnetlink_link
933 582
934extern struct rtnetlink_link * rtnetlink_links[NPROTO]; 583extern struct rtnetlink_link * rtnetlink_links[NPROTO];
935extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); 584extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
585extern int rtnl_unicast(struct sk_buff *skb, u32 pid);
586extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
587 struct nlmsghdr *nlh, gfp_t flags);
588extern void rtnl_set_sk_err(u32 group, int error);
936extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics); 589extern int rtnetlink_put_metrics(struct sk_buff *skb, u32 *metrics);
937 590
938extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data); 591extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const void *data);
@@ -1065,6 +718,13 @@ extern void __rtnl_unlock(void);
1065 } \ 718 } \
1066} while(0) 719} while(0)
1067 720
721static inline u32 rtm_get_table(struct rtattr **rta, u8 table)
722{
723 return RTA_GET_U32(rta[RTA_TABLE-1]);
724rtattr_failure:
725 return table;
726}
727
1068#endif /* __KERNEL__ */ 728#endif /* __KERNEL__ */
1069 729
1070 730
diff --git a/include/linux/scatterlist.h b/include/linux/scatterlist.h
index 66ff545552f7..4efbd9c445f5 100644
--- a/include/linux/scatterlist.h
+++ b/include/linux/scatterlist.h
@@ -5,7 +5,7 @@
5#include <linux/mm.h> 5#include <linux/mm.h>
6#include <linux/string.h> 6#include <linux/string.h>
7 7
8static inline void sg_set_buf(struct scatterlist *sg, void *buf, 8static inline void sg_set_buf(struct scatterlist *sg, const void *buf,
9 unsigned int buflen) 9 unsigned int buflen)
10{ 10{
11 sg->page = virt_to_page(buf); 11 sg->page = virt_to_page(buf);
@@ -13,7 +13,7 @@ static inline void sg_set_buf(struct scatterlist *sg, void *buf,
13 sg->length = buflen; 13 sg->length = buflen;
14} 14}
15 15
16static inline void sg_init_one(struct scatterlist *sg, void *buf, 16static inline void sg_init_one(struct scatterlist *sg, const void *buf,
17 unsigned int buflen) 17 unsigned int buflen)
18{ 18{
19 memset(sg, 0, sizeof(*sg)); 19 memset(sg, 0, sizeof(*sg));
diff --git a/include/linux/security.h b/include/linux/security.h
index 6bc2aad494ff..9f56fb8a4a6c 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -31,6 +31,8 @@
31#include <linux/msg.h> 31#include <linux/msg.h>
32#include <linux/sched.h> 32#include <linux/sched.h>
33#include <linux/key.h> 33#include <linux/key.h>
34#include <linux/xfrm.h>
35#include <net/flow.h>
34 36
35struct ctl_table; 37struct ctl_table;
36 38
@@ -88,6 +90,7 @@ extern int cap_netlink_recv(struct sk_buff *skb, int cap);
88struct nfsctl_arg; 90struct nfsctl_arg;
89struct sched_param; 91struct sched_param;
90struct swap_info_struct; 92struct swap_info_struct;
93struct request_sock;
91 94
92/* bprm_apply_creds unsafe reasons */ 95/* bprm_apply_creds unsafe reasons */
93#define LSM_UNSAFE_SHARE 1 96#define LSM_UNSAFE_SHARE 1
@@ -812,9 +815,19 @@ struct swap_info_struct;
812 * which is used to copy security attributes between local stream sockets. 815 * which is used to copy security attributes between local stream sockets.
813 * @sk_free_security: 816 * @sk_free_security:
814 * Deallocate security structure. 817 * Deallocate security structure.
815 * @sk_getsid: 818 * @sk_clone_security:
816 * Retrieve the LSM-specific sid for the sock to enable caching of network 819 * Clone/copy security structure.
820 * @sk_getsecid:
821 * Retrieve the LSM-specific secid for the sock to enable caching of network
817 * authorizations. 822 * authorizations.
823 * @sock_graft:
824 * Sets the socket's isec sid to the sock's sid.
825 * @inet_conn_request:
826 * Sets the openreq's sid to socket's sid with MLS portion taken from peer sid.
827 * @inet_csk_clone:
828 * Sets the new child socket's sid to the openreq sid.
829 * @req_classify_flow:
830 * Sets the flow's sid to the openreq sid.
818 * 831 *
819 * Security hooks for XFRM operations. 832 * Security hooks for XFRM operations.
820 * 833 *
@@ -823,9 +836,10 @@ struct swap_info_struct;
823 * used by the XFRM system. 836 * used by the XFRM system.
824 * @sec_ctx contains the security context information being provided by 837 * @sec_ctx contains the security context information being provided by
825 * the user-level policy update program (e.g., setkey). 838 * the user-level policy update program (e.g., setkey).
826 * Allocate a security structure to the xp->security field. 839 * @sk refers to the sock from which to derive the security context.
827 * The security field is initialized to NULL when the xfrm_policy is 840 * Allocate a security structure to the xp->security field; the security
828 * allocated. 841 * field is initialized to NULL when the xfrm_policy is allocated. Only
842 * one of sec_ctx or sock can be specified.
829 * Return 0 if operation was successful (memory to allocate, legal context) 843 * Return 0 if operation was successful (memory to allocate, legal context)
830 * @xfrm_policy_clone_security: 844 * @xfrm_policy_clone_security:
831 * @old contains an existing xfrm_policy in the SPD. 845 * @old contains an existing xfrm_policy in the SPD.
@@ -844,9 +858,14 @@ struct swap_info_struct;
844 * Database by the XFRM system. 858 * Database by the XFRM system.
845 * @sec_ctx contains the security context information being provided by 859 * @sec_ctx contains the security context information being provided by
846 * the user-level SA generation program (e.g., setkey or racoon). 860 * the user-level SA generation program (e.g., setkey or racoon).
847 * Allocate a security structure to the x->security field. The 861 * @polsec contains the security context information associated with a xfrm
848 * security field is initialized to NULL when the xfrm_state is 862 * policy rule from which to take the base context. polsec must be NULL
849 * allocated. 863 * when sec_ctx is specified.
864 * @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
866 * field is initialized to NULL when the xfrm_state is allocated. Set the
867 * context to correspond to either sec_ctx or polsec, with the mls portion
868 * taken from secid in the latter case.
850 * Return 0 if operation was successful (memory to allocate, legal context). 869 * Return 0 if operation was successful (memory to allocate, legal context).
851 * @xfrm_state_free_security: 870 * @xfrm_state_free_security:
852 * @x contains the xfrm_state. 871 * @x contains the xfrm_state.
@@ -857,13 +876,27 @@ struct swap_info_struct;
857 * @xfrm_policy_lookup: 876 * @xfrm_policy_lookup:
858 * @xp contains the xfrm_policy for which the access control is being 877 * @xp contains the xfrm_policy for which the access control is being
859 * checked. 878 * checked.
860 * @sk_sid contains the sock security label that is used to authorize 879 * @fl_secid contains the flow security label that is used to authorize
861 * access to the policy xp. 880 * access to the policy xp.
862 * @dir contains the direction of the flow (input or output). 881 * @dir contains the direction of the flow (input or output).
863 * Check permission when a sock selects a xfrm_policy for processing 882 * Check permission when a flow selects a xfrm_policy for processing
864 * XFRMs on a packet. The hook is called when selecting either a 883 * XFRMs on a packet. The hook is called when selecting either a
865 * per-socket policy or a generic xfrm policy. 884 * per-socket policy or a generic xfrm policy.
866 * Return 0 if permission is granted. 885 * Return 0 if permission is granted.
886 * @xfrm_state_pol_flow_match:
887 * @x contains the state to match.
888 * @xp contains the policy to check for a match.
889 * @fl contains the flow to check for a match.
890 * Return 1 if there is a match.
891 * @xfrm_flow_state_match:
892 * @fl contains the flow key to match.
893 * @xfrm points to the xfrm_state to match.
894 * Return 1 if there is a match.
895 * @xfrm_decode_session:
896 * @skb points to skb to decode.
897 * @secid points to the flow key secid to set.
898 * @ckall says if all xfrms used should be checked for same secid.
899 * Return 0 if ckall is zero or all xfrms used have the same secid.
867 * 900 *
868 * Security hooks affecting all Key Management operations 901 * Security hooks affecting all Key Management operations
869 * 902 *
@@ -1308,8 +1341,8 @@ struct security_operations {
1308 int (*unix_may_send) (struct socket * sock, struct socket * other); 1341 int (*unix_may_send) (struct socket * sock, struct socket * other);
1309 1342
1310 int (*socket_create) (int family, int type, int protocol, int kern); 1343 int (*socket_create) (int family, int type, int protocol, int kern);
1311 void (*socket_post_create) (struct socket * sock, int family, 1344 int (*socket_post_create) (struct socket * sock, int family,
1312 int type, int protocol, int kern); 1345 int type, int protocol, int kern);
1313 int (*socket_bind) (struct socket * sock, 1346 int (*socket_bind) (struct socket * sock,
1314 struct sockaddr * address, int addrlen); 1347 struct sockaddr * address, int addrlen);
1315 int (*socket_connect) (struct socket * sock, 1348 int (*socket_connect) (struct socket * sock,
@@ -1332,18 +1365,31 @@ struct security_operations {
1332 int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid); 1365 int (*socket_getpeersec_dgram) (struct socket *sock, struct sk_buff *skb, u32 *secid);
1333 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); 1366 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1334 void (*sk_free_security) (struct sock *sk); 1367 void (*sk_free_security) (struct sock *sk);
1335 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); 1368 void (*sk_clone_security) (const struct sock *sk, struct sock *newsk);
1369 void (*sk_getsecid) (struct sock *sk, u32 *secid);
1370 void (*sock_graft)(struct sock* sk, struct socket *parent);
1371 int (*inet_conn_request)(struct sock *sk, struct sk_buff *skb,
1372 struct request_sock *req);
1373 void (*inet_csk_clone)(struct sock *newsk, const struct request_sock *req);
1374 void (*req_classify_flow)(const struct request_sock *req, struct flowi *fl);
1336#endif /* CONFIG_SECURITY_NETWORK */ 1375#endif /* CONFIG_SECURITY_NETWORK */
1337 1376
1338#ifdef CONFIG_SECURITY_NETWORK_XFRM 1377#ifdef CONFIG_SECURITY_NETWORK_XFRM
1339 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx); 1378 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp,
1379 struct xfrm_user_sec_ctx *sec_ctx, struct sock *sk);
1340 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new); 1380 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1341 void (*xfrm_policy_free_security) (struct xfrm_policy *xp); 1381 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1342 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp); 1382 int (*xfrm_policy_delete_security) (struct xfrm_policy *xp);
1343 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx); 1383 int (*xfrm_state_alloc_security) (struct xfrm_state *x,
1384 struct xfrm_user_sec_ctx *sec_ctx, struct xfrm_sec_ctx *polsec,
1385 u32 secid);
1344 void (*xfrm_state_free_security) (struct xfrm_state *x); 1386 void (*xfrm_state_free_security) (struct xfrm_state *x);
1345 int (*xfrm_state_delete_security) (struct xfrm_state *x); 1387 int (*xfrm_state_delete_security) (struct xfrm_state *x);
1346 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir); 1388 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 fl_secid, u8 dir);
1389 int (*xfrm_state_pol_flow_match)(struct xfrm_state *x,
1390 struct xfrm_policy *xp, struct flowi *fl);
1391 int (*xfrm_flow_state_match)(struct flowi *fl, struct xfrm_state *xfrm);
1392 int (*xfrm_decode_session)(struct sk_buff *skb, u32 *secid, int ckall);
1347#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 1393#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1348 1394
1349 /* key management security hooks */ 1395 /* key management security hooks */
@@ -2778,13 +2824,13 @@ static inline int security_socket_create (int family, int type,
2778 return security_ops->socket_create(family, type, protocol, kern); 2824 return security_ops->socket_create(family, type, protocol, kern);
2779} 2825}
2780 2826
2781static inline void security_socket_post_create(struct socket * sock, 2827static inline int security_socket_post_create(struct socket * sock,
2782 int family, 2828 int family,
2783 int type, 2829 int type,
2784 int protocol, int kern) 2830 int protocol, int kern)
2785{ 2831{
2786 security_ops->socket_post_create(sock, family, type, 2832 return security_ops->socket_post_create(sock, family, type,
2787 protocol, kern); 2833 protocol, kern);
2788} 2834}
2789 2835
2790static inline int security_socket_bind(struct socket * sock, 2836static inline int security_socket_bind(struct socket * sock,
@@ -2885,9 +2931,36 @@ static inline void security_sk_free(struct sock *sk)
2885 return security_ops->sk_free_security(sk); 2931 return security_ops->sk_free_security(sk);
2886} 2932}
2887 2933
2888static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir) 2934static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
2935{
2936 return security_ops->sk_clone_security(sk, newsk);
2937}
2938
2939static inline void security_sk_classify_flow(struct sock *sk, struct flowi *fl)
2889{ 2940{
2890 return security_ops->sk_getsid(sk, fl, dir); 2941 security_ops->sk_getsecid(sk, &fl->secid);
2942}
2943
2944static inline void security_req_classify_flow(const struct request_sock *req, struct flowi *fl)
2945{
2946 security_ops->req_classify_flow(req, fl);
2947}
2948
2949static inline void security_sock_graft(struct sock* sk, struct socket *parent)
2950{
2951 security_ops->sock_graft(sk, parent);
2952}
2953
2954static inline int security_inet_conn_request(struct sock *sk,
2955 struct sk_buff *skb, struct request_sock *req)
2956{
2957 return security_ops->inet_conn_request(sk, skb, req);
2958}
2959
2960static inline void security_inet_csk_clone(struct sock *newsk,
2961 const struct request_sock *req)
2962{
2963 security_ops->inet_csk_clone(newsk, req);
2891} 2964}
2892#else /* CONFIG_SECURITY_NETWORK */ 2965#else /* CONFIG_SECURITY_NETWORK */
2893static inline int security_unix_stream_connect(struct socket * sock, 2966static inline int security_unix_stream_connect(struct socket * sock,
@@ -2909,11 +2982,12 @@ static inline int security_socket_create (int family, int type,
2909 return 0; 2982 return 0;
2910} 2983}
2911 2984
2912static inline void security_socket_post_create(struct socket * sock, 2985static inline int security_socket_post_create(struct socket * sock,
2913 int family, 2986 int family,
2914 int type, 2987 int type,
2915 int protocol, int kern) 2988 int protocol, int kern)
2916{ 2989{
2990 return 0;
2917} 2991}
2918 2992
2919static inline int security_socket_bind(struct socket * sock, 2993static inline int security_socket_bind(struct socket * sock,
@@ -3011,16 +3085,43 @@ static inline void security_sk_free(struct sock *sk)
3011{ 3085{
3012} 3086}
3013 3087
3014static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir) 3088static inline void security_sk_clone(const struct sock *sk, struct sock *newsk)
3089{
3090}
3091
3092static inline void security_sk_classify_flow(struct sock *sk, struct flowi *fl)
3093{
3094}
3095
3096static inline void security_req_classify_flow(const struct request_sock *req, struct flowi *fl)
3097{
3098}
3099
3100static inline void security_sock_graft(struct sock* sk, struct socket *parent)
3101{
3102}
3103
3104static inline int security_inet_conn_request(struct sock *sk,
3105 struct sk_buff *skb, struct request_sock *req)
3015{ 3106{
3016 return 0; 3107 return 0;
3017} 3108}
3109
3110static inline void security_inet_csk_clone(struct sock *newsk,
3111 const struct request_sock *req)
3112{
3113}
3018#endif /* CONFIG_SECURITY_NETWORK */ 3114#endif /* CONFIG_SECURITY_NETWORK */
3019 3115
3020#ifdef CONFIG_SECURITY_NETWORK_XFRM 3116#ifdef CONFIG_SECURITY_NETWORK_XFRM
3021static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) 3117static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
3022{ 3118{
3023 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx); 3119 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx, NULL);
3120}
3121
3122static inline int security_xfrm_sock_policy_alloc(struct xfrm_policy *xp, struct sock *sk)
3123{
3124 return security_ops->xfrm_policy_alloc_security(xp, NULL, sk);
3024} 3125}
3025 3126
3026static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) 3127static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
@@ -3038,9 +3139,18 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
3038 return security_ops->xfrm_policy_delete_security(xp); 3139 return security_ops->xfrm_policy_delete_security(xp);
3039} 3140}
3040 3141
3041static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 3142static inline int security_xfrm_state_alloc(struct xfrm_state *x,
3143 struct xfrm_user_sec_ctx *sec_ctx)
3042{ 3144{
3043 return security_ops->xfrm_state_alloc_security(x, sec_ctx); 3145 return security_ops->xfrm_state_alloc_security(x, sec_ctx, NULL, 0);
3146}
3147
3148static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
3149 struct xfrm_sec_ctx *polsec, u32 secid)
3150{
3151 if (!polsec)
3152 return 0;
3153 return security_ops->xfrm_state_alloc_security(x, NULL, polsec, secid);
3044} 3154}
3045 3155
3046static inline int security_xfrm_state_delete(struct xfrm_state *x) 3156static inline int security_xfrm_state_delete(struct xfrm_state *x)
@@ -3053,9 +3163,32 @@ static inline void security_xfrm_state_free(struct xfrm_state *x)
3053 security_ops->xfrm_state_free_security(x); 3163 security_ops->xfrm_state_free_security(x);
3054} 3164}
3055 3165
3056static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) 3166static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir)
3167{
3168 return security_ops->xfrm_policy_lookup(xp, fl_secid, dir);
3169}
3170
3171static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3172 struct xfrm_policy *xp, struct flowi *fl)
3057{ 3173{
3058 return security_ops->xfrm_policy_lookup(xp, sk_sid, dir); 3174 return security_ops->xfrm_state_pol_flow_match(x, xp, fl);
3175}
3176
3177static inline int security_xfrm_flow_state_match(struct flowi *fl, struct xfrm_state *xfrm)
3178{
3179 return security_ops->xfrm_flow_state_match(fl, xfrm);
3180}
3181
3182static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3183{
3184 return security_ops->xfrm_decode_session(skb, secid, 1);
3185}
3186
3187static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl)
3188{
3189 int rc = security_ops->xfrm_decode_session(skb, &fl->secid, 0);
3190
3191 BUG_ON(rc);
3059} 3192}
3060#else /* CONFIG_SECURITY_NETWORK_XFRM */ 3193#else /* CONFIG_SECURITY_NETWORK_XFRM */
3061static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx) 3194static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
@@ -3063,6 +3196,11 @@ static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm
3063 return 0; 3196 return 0;
3064} 3197}
3065 3198
3199static inline int security_xfrm_sock_policy_alloc(struct xfrm_policy *xp, struct sock *sk)
3200{
3201 return 0;
3202}
3203
3066static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new) 3204static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
3067{ 3205{
3068 return 0; 3206 return 0;
@@ -3077,7 +3215,14 @@ static inline int security_xfrm_policy_delete(struct xfrm_policy *xp)
3077 return 0; 3215 return 0;
3078} 3216}
3079 3217
3080static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx) 3218static inline int security_xfrm_state_alloc(struct xfrm_state *x,
3219 struct xfrm_user_sec_ctx *sec_ctx)
3220{
3221 return 0;
3222}
3223
3224static inline int security_xfrm_state_alloc_acquire(struct xfrm_state *x,
3225 struct xfrm_sec_ctx *polsec, u32 secid)
3081{ 3226{
3082 return 0; 3227 return 0;
3083} 3228}
@@ -3091,10 +3236,32 @@ static inline int security_xfrm_state_delete(struct xfrm_state *x)
3091 return 0; 3236 return 0;
3092} 3237}
3093 3238
3094static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir) 3239static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 fl_secid, u8 dir)
3240{
3241 return 0;
3242}
3243
3244static inline int security_xfrm_state_pol_flow_match(struct xfrm_state *x,
3245 struct xfrm_policy *xp, struct flowi *fl)
3246{
3247 return 1;
3248}
3249
3250static inline int security_xfrm_flow_state_match(struct flowi *fl,
3251 struct xfrm_state *xfrm)
3252{
3253 return 1;
3254}
3255
3256static inline int security_xfrm_decode_session(struct sk_buff *skb, u32 *secid)
3095{ 3257{
3096 return 0; 3258 return 0;
3097} 3259}
3260
3261static inline void security_skb_classify_flow(struct sk_buff *skb, struct flowi *fl)
3262{
3263}
3264
3098#endif /* CONFIG_SECURITY_NETWORK_XFRM */ 3265#endif /* CONFIG_SECURITY_NETWORK_XFRM */
3099 3266
3100#ifdef CONFIG_KEYS 3267#ifdef CONFIG_KEYS
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 755e9cddac47..85577a4ffa61 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -34,8 +34,9 @@
34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
35 35
36#define CHECKSUM_NONE 0 36#define CHECKSUM_NONE 0
37#define CHECKSUM_HW 1 37#define CHECKSUM_PARTIAL 1
38#define CHECKSUM_UNNECESSARY 2 38#define CHECKSUM_UNNECESSARY 2
39#define CHECKSUM_COMPLETE 3
39 40
40#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ 41#define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \
41 ~(SMP_CACHE_BYTES - 1)) 42 ~(SMP_CACHE_BYTES - 1))
@@ -56,17 +57,17 @@
56 * Apparently with secret goal to sell you new device, when you 57 * Apparently with secret goal to sell you new device, when you
57 * will add new protocol to your host. F.e. IPv6. 8) 58 * will add new protocol to your host. F.e. IPv6. 8)
58 * 59 *
59 * HW: the most generic way. Device supplied checksum of _all_ 60 * COMPLETE: the most generic way. Device supplied checksum of _all_
60 * the packet as seen by netif_rx in skb->csum. 61 * the packet as seen by netif_rx in skb->csum.
61 * NOTE: Even if device supports only some protocols, but 62 * NOTE: Even if device supports only some protocols, but
62 * is able to produce some skb->csum, it MUST use HW, 63 * is able to produce some skb->csum, it MUST use COMPLETE,
63 * not UNNECESSARY. 64 * not UNNECESSARY.
64 * 65 *
65 * B. Checksumming on output. 66 * B. Checksumming on output.
66 * 67 *
67 * NONE: skb is checksummed by protocol or csum is not required. 68 * NONE: skb is checksummed by protocol or csum is not required.
68 * 69 *
69 * HW: device is required to csum packet as seen by hard_start_xmit 70 * PARTIAL: device is required to csum packet as seen by hard_start_xmit
70 * from skb->h.raw to the end and to record the checksum 71 * from skb->h.raw to the end and to record the checksum
71 * at skb->h.raw+skb->csum. 72 * at skb->h.raw+skb->csum.
72 * 73 *
@@ -1261,14 +1262,14 @@ static inline int skb_linearize_cow(struct sk_buff *skb)
1261 * @len: length of data pulled 1262 * @len: length of data pulled
1262 * 1263 *
1263 * After doing a pull on a received packet, you need to call this to 1264 * After doing a pull on a received packet, you need to call this to
1264 * update the CHECKSUM_HW checksum, or set ip_summed to CHECKSUM_NONE 1265 * update the CHECKSUM_COMPLETE checksum, or set ip_summed to
1265 * so that it can be recomputed from scratch. 1266 * CHECKSUM_NONE so that it can be recomputed from scratch.
1266 */ 1267 */
1267 1268
1268static inline void skb_postpull_rcsum(struct sk_buff *skb, 1269static inline void skb_postpull_rcsum(struct sk_buff *skb,
1269 const void *start, unsigned int len) 1270 const void *start, unsigned int len)
1270{ 1271{
1271 if (skb->ip_summed == CHECKSUM_HW) 1272 if (skb->ip_summed == CHECKSUM_COMPLETE)
1272 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); 1273 skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0));
1273} 1274}
1274 1275
@@ -1287,7 +1288,7 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len)
1287{ 1288{
1288 if (likely(len >= skb->len)) 1289 if (likely(len >= skb->len))
1289 return 0; 1290 return 0;
1290 if (skb->ip_summed == CHECKSUM_HW) 1291 if (skb->ip_summed == CHECKSUM_COMPLETE)
1291 skb->ip_summed = CHECKSUM_NONE; 1292 skb->ip_summed = CHECKSUM_NONE;
1292 return __pskb_trim(skb, len); 1293 return __pskb_trim(skb, len);
1293} 1294}
diff --git a/include/linux/smb.h b/include/linux/smb.h
index b0162208c963..6df3b1501559 100644
--- a/include/linux/smb.h
+++ b/include/linux/smb.h
@@ -10,6 +10,7 @@
10#define _LINUX_SMB_H 10#define _LINUX_SMB_H
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/magic.h>
13 14
14enum smb_protocol { 15enum smb_protocol {
15 SMB_PROTOCOL_NONE, 16 SMB_PROTOCOL_NONE,
@@ -101,8 +102,6 @@ enum smb_conn_state {
101 CONN_RETRYING /* Currently trying to reconnect */ 102 CONN_RETRYING /* Currently trying to reconnect */
102}; 103};
103 104
104#define SMB_SUPER_MAGIC 0x517B
105
106#define SMB_HEADER_LEN 37 /* includes everything up to, but not 105#define SMB_HEADER_LEN 37 /* includes everything up to, but not
107 * including smb_bcc */ 106 * including smb_bcc */
108 107
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 4db25d5c7cd1..854aa6b543f1 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -155,42 +155,11 @@ enum
155 UDP_MIB_NOPORTS, /* NoPorts */ 155 UDP_MIB_NOPORTS, /* NoPorts */
156 UDP_MIB_INERRORS, /* InErrors */ 156 UDP_MIB_INERRORS, /* InErrors */
157 UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */ 157 UDP_MIB_OUTDATAGRAMS, /* OutDatagrams */
158 UDP_MIB_RCVBUFERRORS, /* RcvbufErrors */
159 UDP_MIB_SNDBUFERRORS, /* SndbufErrors */
158 __UDP_MIB_MAX 160 __UDP_MIB_MAX
159}; 161};
160 162
161/* sctp mib definitions */
162/*
163 * draft-ietf-sigtran-sctp-mib-07.txt
164 */
165enum
166{
167 SCTP_MIB_NUM = 0,
168 SCTP_MIB_CURRESTAB, /* CurrEstab */
169 SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */
170 SCTP_MIB_PASSIVEESTABS, /* PassiveEstabs */
171 SCTP_MIB_ABORTEDS, /* Aborteds */
172 SCTP_MIB_SHUTDOWNS, /* Shutdowns */
173 SCTP_MIB_OUTOFBLUES, /* OutOfBlues */
174 SCTP_MIB_CHECKSUMERRORS, /* ChecksumErrors */
175 SCTP_MIB_OUTCTRLCHUNKS, /* OutCtrlChunks */
176 SCTP_MIB_OUTORDERCHUNKS, /* OutOrderChunks */
177 SCTP_MIB_OUTUNORDERCHUNKS, /* OutUnorderChunks */
178 SCTP_MIB_INCTRLCHUNKS, /* InCtrlChunks */
179 SCTP_MIB_INORDERCHUNKS, /* InOrderChunks */
180 SCTP_MIB_INUNORDERCHUNKS, /* InUnorderChunks */
181 SCTP_MIB_FRAGUSRMSGS, /* FragUsrMsgs */
182 SCTP_MIB_REASMUSRMSGS, /* ReasmUsrMsgs */
183 SCTP_MIB_OUTSCTPPACKS, /* OutSCTPPacks */
184 SCTP_MIB_INSCTPPACKS, /* InSCTPPacks */
185 SCTP_MIB_RTOALGORITHM, /* RtoAlgorithm */
186 SCTP_MIB_RTOMIN, /* RtoMin */
187 SCTP_MIB_RTOMAX, /* RtoMax */
188 SCTP_MIB_RTOINITIAL, /* RtoInitial */
189 SCTP_MIB_VALCOOKIELIFE, /* ValCookieLife */
190 SCTP_MIB_MAXINITRETR, /* MaxInitRetr */
191 __SCTP_MIB_MAX
192};
193
194/* linux mib definitions */ 163/* linux mib definitions */
195enum 164enum
196{ 165{
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 8fe9f35eba31..f6d1d646ce05 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -18,18 +18,6 @@
18#include <linux/sunrpc/timer.h> 18#include <linux/sunrpc/timer.h>
19#include <asm/signal.h> 19#include <asm/signal.h>
20 20
21/*
22 * This defines an RPC port mapping
23 */
24struct rpc_portmap {
25 __u32 pm_prog;
26 __u32 pm_vers;
27 __u32 pm_prot;
28 __u16 pm_port;
29 unsigned char pm_binding : 1; /* doing a getport() */
30 struct rpc_wait_queue pm_bindwait; /* waiting on getport() */
31};
32
33struct rpc_inode; 21struct rpc_inode;
34 22
35/* 23/*
@@ -40,7 +28,9 @@ struct rpc_clnt {
40 atomic_t cl_users; /* number of references */ 28 atomic_t cl_users; /* number of references */
41 struct rpc_xprt * cl_xprt; /* transport */ 29 struct rpc_xprt * cl_xprt; /* transport */
42 struct rpc_procinfo * cl_procinfo; /* procedure info */ 30 struct rpc_procinfo * cl_procinfo; /* procedure info */
43 u32 cl_maxproc; /* max procedure number */ 31 u32 cl_prog, /* RPC program number */
32 cl_vers, /* RPC version number */
33 cl_maxproc; /* max procedure number */
44 34
45 char * cl_server; /* server machine name */ 35 char * cl_server; /* server machine name */
46 char * cl_protname; /* protocol name */ 36 char * cl_protname; /* protocol name */
@@ -55,7 +45,6 @@ struct rpc_clnt {
55 cl_dead : 1;/* abandoned */ 45 cl_dead : 1;/* abandoned */
56 46
57 struct rpc_rtt * cl_rtt; /* RTO estimator data */ 47 struct rpc_rtt * cl_rtt; /* RTO estimator data */
58 struct rpc_portmap * cl_pmap; /* port mapping */
59 48
60 int cl_nodelen; /* nodename length */ 49 int cl_nodelen; /* nodename length */
61 char cl_nodename[UNX_MAXNODENAME]; 50 char cl_nodename[UNX_MAXNODENAME];
@@ -64,14 +53,8 @@ struct rpc_clnt {
64 struct dentry * cl_dentry; /* inode */ 53 struct dentry * cl_dentry; /* inode */
65 struct rpc_clnt * cl_parent; /* Points to parent of clones */ 54 struct rpc_clnt * cl_parent; /* Points to parent of clones */
66 struct rpc_rtt cl_rtt_default; 55 struct rpc_rtt cl_rtt_default;
67 struct rpc_portmap cl_pmap_default;
68 char cl_inline_name[32]; 56 char cl_inline_name[32];
69}; 57};
70#define cl_timeout cl_xprt->timeout
71#define cl_prog cl_pmap->pm_prog
72#define cl_vers cl_pmap->pm_vers
73#define cl_port cl_pmap->pm_port
74#define cl_prot cl_pmap->pm_prot
75 58
76/* 59/*
77 * General RPC program info 60 * General RPC program info
@@ -106,24 +89,36 @@ struct rpc_procinfo {
106 char * p_name; /* name of procedure */ 89 char * p_name; /* name of procedure */
107}; 90};
108 91
109#define RPC_CONGESTED(clnt) (RPCXPRT_CONGESTED((clnt)->cl_xprt))
110#define RPC_PEERADDR(clnt) (&(clnt)->cl_xprt->addr)
111
112#ifdef __KERNEL__ 92#ifdef __KERNEL__
113 93
114struct rpc_clnt *rpc_create_client(struct rpc_xprt *xprt, char *servname, 94struct rpc_create_args {
115 struct rpc_program *info, 95 int protocol;
116 u32 version, rpc_authflavor_t authflavor); 96 struct sockaddr *address;
117struct rpc_clnt *rpc_new_client(struct rpc_xprt *xprt, char *servname, 97 size_t addrsize;
118 struct rpc_program *info, 98 struct rpc_timeout *timeout;
119 u32 version, rpc_authflavor_t authflavor); 99 char *servername;
100 struct rpc_program *program;
101 u32 version;
102 rpc_authflavor_t authflavor;
103 unsigned long flags;
104};
105
106/* Values for "flags" field */
107#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0)
108#define RPC_CLNT_CREATE_INTR (1UL << 1)
109#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2)
110#define RPC_CLNT_CREATE_ONESHOT (1UL << 3)
111#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4)
112#define RPC_CLNT_CREATE_NOPING (1UL << 5)
113
114struct rpc_clnt *rpc_create(struct rpc_create_args *args);
120struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 115struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
121 struct rpc_program *, int); 116 struct rpc_program *, int);
122struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 117struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
123int rpc_shutdown_client(struct rpc_clnt *); 118int rpc_shutdown_client(struct rpc_clnt *);
124int rpc_destroy_client(struct rpc_clnt *); 119int rpc_destroy_client(struct rpc_clnt *);
125void rpc_release_client(struct rpc_clnt *); 120void rpc_release_client(struct rpc_clnt *);
126void rpc_getport(struct rpc_task *, struct rpc_clnt *); 121void rpc_getport(struct rpc_task *);
127int rpc_register(u32, u32, int, unsigned short, int *); 122int rpc_register(u32, u32, int, unsigned short, int *);
128 123
129void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); 124void rpc_call_setup(struct rpc_task *, struct rpc_message *, int);
@@ -140,6 +135,8 @@ void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
140size_t rpc_max_payload(struct rpc_clnt *); 135size_t rpc_max_payload(struct rpc_clnt *);
141void rpc_force_rebind(struct rpc_clnt *); 136void rpc_force_rebind(struct rpc_clnt *);
142int rpc_ping(struct rpc_clnt *clnt, int flags); 137int rpc_ping(struct rpc_clnt *clnt, int flags);
138size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
139char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
143 140
144/* 141/*
145 * Helper function for NFSroot support 142 * Helper function for NFSroot support
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index 1279280d7196..e30ba201910a 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -46,8 +46,8 @@ struct krb5_ctx {
46 unsigned char seed[16]; 46 unsigned char seed[16];
47 int signalg; 47 int signalg;
48 int sealalg; 48 int sealalg;
49 struct crypto_tfm *enc; 49 struct crypto_blkcipher *enc;
50 struct crypto_tfm *seq; 50 struct crypto_blkcipher *seq;
51 s32 endtime; 51 s32 endtime;
52 u32 seq_send; 52 u32 seq_send;
53 struct xdr_netobj mech_used; 53 struct xdr_netobj mech_used;
@@ -136,26 +136,27 @@ gss_unwrap_kerberos(struct gss_ctx *ctx_id, int offset,
136 136
137 137
138u32 138u32
139krb5_encrypt(struct crypto_tfm * key, 139krb5_encrypt(struct crypto_blkcipher *key,
140 void *iv, void *in, void *out, int length); 140 void *iv, void *in, void *out, int length);
141 141
142u32 142u32
143krb5_decrypt(struct crypto_tfm * key, 143krb5_decrypt(struct crypto_blkcipher *key,
144 void *iv, void *in, void *out, int length); 144 void *iv, void *in, void *out, int length);
145 145
146int 146int
147gss_encrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *outbuf, int offset, 147gss_encrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *outbuf,
148 struct page **pages); 148 int offset, struct page **pages);
149 149
150int 150int
151gss_decrypt_xdr_buf(struct crypto_tfm *tfm, struct xdr_buf *inbuf, int offset); 151gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
152 int offset);
152 153
153s32 154s32
154krb5_make_seq_num(struct crypto_tfm * key, 155krb5_make_seq_num(struct crypto_blkcipher *key,
155 int direction, 156 int direction,
156 s32 seqnum, unsigned char *cksum, unsigned char *buf); 157 s32 seqnum, unsigned char *cksum, unsigned char *buf);
157 158
158s32 159s32
159krb5_get_seq_num(struct crypto_tfm * key, 160krb5_get_seq_num(struct crypto_blkcipher *key,
160 unsigned char *cksum, 161 unsigned char *cksum,
161 unsigned char *buf, int *direction, s32 * seqnum); 162 unsigned char *buf, int *direction, s32 * seqnum);
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
index 336e218c2782..2cf3fbb40b4f 100644
--- a/include/linux/sunrpc/gss_spkm3.h
+++ b/include/linux/sunrpc/gss_spkm3.h
@@ -19,9 +19,9 @@ struct spkm3_ctx {
19 unsigned int req_flags ; 19 unsigned int req_flags ;
20 struct xdr_netobj share_key; 20 struct xdr_netobj share_key;
21 int conf_alg; 21 int conf_alg;
22 struct crypto_tfm* derived_conf_key; 22 struct crypto_blkcipher *derived_conf_key;
23 int intg_alg; 23 int intg_alg;
24 struct crypto_tfm* derived_integ_key; 24 struct crypto_blkcipher *derived_integ_key;
25 int keyestb_alg; /* alg used to get share_key */ 25 int keyestb_alg; /* alg used to get share_key */
26 int owf_alg; /* one way function */ 26 int owf_alg; /* one way function */
27}; 27};
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index a481472c9484..a2eb9b4a9de3 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -43,7 +43,7 @@ extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
43 43
44extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *); 44extern struct dentry *rpc_mkdir(char *, struct rpc_clnt *);
45extern int rpc_rmdir(struct dentry *); 45extern int rpc_rmdir(struct dentry *);
46extern struct dentry *rpc_mkpipe(char *, void *, struct rpc_pipe_ops *, int flags); 46extern struct dentry *rpc_mkpipe(struct dentry *, const char *, void *, struct rpc_pipe_ops *, int flags);
47extern int rpc_unlink(struct dentry *); 47extern int rpc_unlink(struct dentry *);
48extern struct vfsmount *rpc_get_mount(void); 48extern struct vfsmount *rpc_get_mount(void);
49extern void rpc_put_mount(void); 49extern void rpc_put_mount(void);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 82a91bb22362..f399c138f79d 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -127,7 +127,6 @@ struct rpc_call_ops {
127 */ 127 */
128#define RPC_TASK_ASYNC 0x0001 /* is an async task */ 128#define RPC_TASK_ASYNC 0x0001 /* is an async task */
129#define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */ 129#define RPC_TASK_SWAPPER 0x0002 /* is swapping in/out */
130#define RPC_TASK_CHILD 0x0008 /* is child of other task */
131#define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */ 130#define RPC_CALL_MAJORSEEN 0x0020 /* major timeout seen */
132#define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */ 131#define RPC_TASK_ROOTCREDS 0x0040 /* force root creds */
133#define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */ 132#define RPC_TASK_DYNAMIC 0x0080 /* task was kmalloc'ed */
@@ -136,7 +135,6 @@ struct rpc_call_ops {
136#define RPC_TASK_NOINTR 0x0400 /* uninterruptible task */ 135#define RPC_TASK_NOINTR 0x0400 /* uninterruptible task */
137 136
138#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC) 137#define RPC_IS_ASYNC(t) ((t)->tk_flags & RPC_TASK_ASYNC)
139#define RPC_IS_CHILD(t) ((t)->tk_flags & RPC_TASK_CHILD)
140#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 138#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
141#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) 139#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
142#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) 140#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
@@ -253,7 +251,6 @@ struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags,
253 const struct rpc_call_ops *ops, void *data); 251 const struct rpc_call_ops *ops, void *data);
254struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags, 252struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
255 const struct rpc_call_ops *ops, void *data); 253 const struct rpc_call_ops *ops, void *data);
256struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent);
257void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt, 254void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
258 int flags, const struct rpc_call_ops *ops, 255 int flags, const struct rpc_call_ops *ops,
259 void *data); 256 void *data);
@@ -261,8 +258,6 @@ void rpc_release_task(struct rpc_task *);
261void rpc_exit_task(struct rpc_task *); 258void rpc_exit_task(struct rpc_task *);
262void rpc_killall_tasks(struct rpc_clnt *); 259void rpc_killall_tasks(struct rpc_clnt *);
263int rpc_execute(struct rpc_task *); 260int rpc_execute(struct rpc_task *);
264void rpc_run_child(struct rpc_task *parent, struct rpc_task *child,
265 rpc_action action);
266void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *); 261void rpc_init_priority_wait_queue(struct rpc_wait_queue *, const char *);
267void rpc_init_wait_queue(struct rpc_wait_queue *, const char *); 262void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
268void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, 263void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 3a0cca255b76..bdeba8538c71 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -12,6 +12,7 @@
12#include <linux/uio.h> 12#include <linux/uio.h>
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kref.h>
15#include <linux/sunrpc/sched.h> 16#include <linux/sunrpc/sched.h>
16#include <linux/sunrpc/xdr.h> 17#include <linux/sunrpc/xdr.h>
17 18
@@ -51,6 +52,14 @@ struct rpc_timeout {
51 unsigned char to_exponential; 52 unsigned char to_exponential;
52}; 53};
53 54
55enum rpc_display_format_t {
56 RPC_DISPLAY_ADDR = 0,
57 RPC_DISPLAY_PORT,
58 RPC_DISPLAY_PROTO,
59 RPC_DISPLAY_ALL,
60 RPC_DISPLAY_MAX,
61};
62
54struct rpc_task; 63struct rpc_task;
55struct rpc_xprt; 64struct rpc_xprt;
56struct seq_file; 65struct seq_file;
@@ -103,8 +112,10 @@ struct rpc_rqst {
103 112
104struct rpc_xprt_ops { 113struct rpc_xprt_ops {
105 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 114 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
115 char * (*print_addr)(struct rpc_xprt *xprt, enum rpc_display_format_t format);
106 int (*reserve_xprt)(struct rpc_task *task); 116 int (*reserve_xprt)(struct rpc_task *task);
107 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 117 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
118 void (*rpcbind)(struct rpc_task *task);
108 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 119 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
109 void (*connect)(struct rpc_task *task); 120 void (*connect)(struct rpc_task *task);
110 void * (*buf_alloc)(struct rpc_task *task, size_t size); 121 void * (*buf_alloc)(struct rpc_task *task, size_t size);
@@ -119,12 +130,14 @@ struct rpc_xprt_ops {
119}; 130};
120 131
121struct rpc_xprt { 132struct rpc_xprt {
133 struct kref kref; /* Reference count */
122 struct rpc_xprt_ops * ops; /* transport methods */ 134 struct rpc_xprt_ops * ops; /* transport methods */
123 struct socket * sock; /* BSD socket layer */ 135 struct socket * sock; /* BSD socket layer */
124 struct sock * inet; /* INET layer */ 136 struct sock * inet; /* INET layer */
125 137
126 struct rpc_timeout timeout; /* timeout parms */ 138 struct rpc_timeout timeout; /* timeout parms */
127 struct sockaddr_in addr; /* server address */ 139 struct sockaddr_storage addr; /* server address */
140 size_t addrlen; /* size of server address */
128 int prot; /* IP protocol */ 141 int prot; /* IP protocol */
129 142
130 unsigned long cong; /* current congestion */ 143 unsigned long cong; /* current congestion */
@@ -138,6 +151,7 @@ struct rpc_xprt {
138 unsigned int tsh_size; /* size of transport specific 151 unsigned int tsh_size; /* size of transport specific
139 header */ 152 header */
140 153
154 struct rpc_wait_queue binding; /* requests waiting on rpcbind */
141 struct rpc_wait_queue sending; /* requests waiting to send */ 155 struct rpc_wait_queue sending; /* requests waiting to send */
142 struct rpc_wait_queue resend; /* requests waiting to resend */ 156 struct rpc_wait_queue resend; /* requests waiting to resend */
143 struct rpc_wait_queue pending; /* requests in flight */ 157 struct rpc_wait_queue pending; /* requests in flight */
@@ -205,6 +219,8 @@ struct rpc_xprt {
205 void (*old_data_ready)(struct sock *, int); 219 void (*old_data_ready)(struct sock *, int);
206 void (*old_state_change)(struct sock *); 220 void (*old_state_change)(struct sock *);
207 void (*old_write_space)(struct sock *); 221 void (*old_write_space)(struct sock *);
222
223 char * address_strings[RPC_DISPLAY_MAX];
208}; 224};
209 225
210#define XPRT_LAST_FRAG (1 << 0) 226#define XPRT_LAST_FRAG (1 << 0)
@@ -217,12 +233,12 @@ struct rpc_xprt {
217/* 233/*
218 * Transport operations used by ULPs 234 * Transport operations used by ULPs
219 */ 235 */
220struct rpc_xprt * xprt_create_proto(int proto, struct sockaddr_in *addr, struct rpc_timeout *to);
221void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr); 236void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long incr);
222 237
223/* 238/*
224 * Generic internal transport functions 239 * Generic internal transport functions
225 */ 240 */
241struct rpc_xprt * xprt_create_transport(int proto, struct sockaddr *addr, size_t size, struct rpc_timeout *toparms);
226void xprt_connect(struct rpc_task *task); 242void xprt_connect(struct rpc_task *task);
227void xprt_reserve(struct rpc_task *task); 243void xprt_reserve(struct rpc_task *task);
228int xprt_reserve_xprt(struct rpc_task *task); 244int xprt_reserve_xprt(struct rpc_task *task);
@@ -234,7 +250,8 @@ int xprt_adjust_timeout(struct rpc_rqst *req);
234void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task); 250void xprt_release_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
235void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task); 251void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
236void xprt_release(struct rpc_task *task); 252void xprt_release(struct rpc_task *task);
237int xprt_destroy(struct rpc_xprt *xprt); 253struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
254void xprt_put(struct rpc_xprt *xprt);
238 255
239static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) 256static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p)
240{ 257{
@@ -269,6 +286,8 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to);
269#define XPRT_CONNECTED (1) 286#define XPRT_CONNECTED (1)
270#define XPRT_CONNECTING (2) 287#define XPRT_CONNECTING (2)
271#define XPRT_CLOSE_WAIT (3) 288#define XPRT_CLOSE_WAIT (3)
289#define XPRT_BOUND (4)
290#define XPRT_BINDING (5)
272 291
273static inline void xprt_set_connected(struct rpc_xprt *xprt) 292static inline void xprt_set_connected(struct rpc_xprt *xprt)
274{ 293{
@@ -312,6 +331,33 @@ static inline int xprt_test_and_set_connecting(struct rpc_xprt *xprt)
312 return test_and_set_bit(XPRT_CONNECTING, &xprt->state); 331 return test_and_set_bit(XPRT_CONNECTING, &xprt->state);
313} 332}
314 333
334static inline void xprt_set_bound(struct rpc_xprt *xprt)
335{
336 test_and_set_bit(XPRT_BOUND, &xprt->state);
337}
338
339static inline int xprt_bound(struct rpc_xprt *xprt)
340{
341 return test_bit(XPRT_BOUND, &xprt->state);
342}
343
344static inline void xprt_clear_bound(struct rpc_xprt *xprt)
345{
346 clear_bit(XPRT_BOUND, &xprt->state);
347}
348
349static inline void xprt_clear_binding(struct rpc_xprt *xprt)
350{
351 smp_mb__before_clear_bit();
352 clear_bit(XPRT_BINDING, &xprt->state);
353 smp_mb__after_clear_bit();
354}
355
356static inline int xprt_test_and_set_binding(struct rpc_xprt *xprt)
357{
358 return test_and_set_bit(XPRT_BINDING, &xprt->state);
359}
360
315#endif /* __KERNEL__*/ 361#endif /* __KERNEL__*/
316 362
317#endif /* _LINUX_SUNRPC_XPRT_H */ 363#endif /* _LINUX_SUNRPC_XPRT_H */
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index e4b1a4d4dcf3..736ed917a4f8 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -411,6 +411,10 @@ enum
411 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, 411 NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115,
412 NET_TCP_DMA_COPYBREAK=116, 412 NET_TCP_DMA_COPYBREAK=116,
413 NET_TCP_SLOW_START_AFTER_IDLE=117, 413 NET_TCP_SLOW_START_AFTER_IDLE=117,
414 NET_CIPSOV4_CACHE_ENABLE=118,
415 NET_CIPSOV4_CACHE_BUCKET_SIZE=119,
416 NET_CIPSOV4_RBM_OPTFMT=120,
417 NET_CIPSOV4_RBM_STRICTVALID=121,
414}; 418};
415 419
416enum { 420enum {
@@ -552,6 +556,7 @@ enum {
552 NET_IPV6_ACCEPT_RA_RTR_PREF=20, 556 NET_IPV6_ACCEPT_RA_RTR_PREF=20,
553 NET_IPV6_RTR_PROBE_INTERVAL=21, 557 NET_IPV6_RTR_PROBE_INTERVAL=21,
554 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, 558 NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22,
559 NET_IPV6_PROXY_NDP=23,
555 __NET_IPV6_MAX 560 __NET_IPV6_MAX
556}; 561};
557 562
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h
index 7b7aadb69092..617d8a1c59ae 100644
--- a/include/linux/usbdevice_fs.h
+++ b/include/linux/usbdevice_fs.h
@@ -32,11 +32,10 @@
32#define _LINUX_USBDEVICE_FS_H 32#define _LINUX_USBDEVICE_FS_H
33 33
34#include <linux/types.h> 34#include <linux/types.h>
35#include <linux/magic.h>
35 36
36/* --------------------------------------------------------------------- */ 37/* --------------------------------------------------------------------- */
37 38
38#define USBDEVICE_SUPER_MAGIC 0x9fa2
39
40/* usbdevfs ioctl codes */ 39/* usbdevfs ioctl codes */
41 40
42struct usbdevfs_ctrltransfer { 41struct usbdevfs_ctrltransfer {
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 9e38b566d0e7..0422036af4eb 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -85,6 +85,7 @@ 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);
88 89
89/* These are exported to sysctl. */ 90/* These are exported to sysctl. */
90extern int dirty_background_ratio; 91extern int dirty_background_ratio;
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 46a15c7a1a13..14ecd19f4cdc 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -104,6 +104,13 @@ struct xfrm_stats {
104 104
105enum 105enum
106{ 106{
107 XFRM_POLICY_TYPE_MAIN = 0,
108 XFRM_POLICY_TYPE_SUB = 1,
109 XFRM_POLICY_TYPE_MAX = 2
110};
111
112enum
113{
107 XFRM_POLICY_IN = 0, 114 XFRM_POLICY_IN = 0,
108 XFRM_POLICY_OUT = 1, 115 XFRM_POLICY_OUT = 1,
109 XFRM_POLICY_FWD = 2, 116 XFRM_POLICY_FWD = 2,
@@ -120,7 +127,9 @@ enum
120 127
121#define XFRM_MODE_TRANSPORT 0 128#define XFRM_MODE_TRANSPORT 0
122#define XFRM_MODE_TUNNEL 1 129#define XFRM_MODE_TUNNEL 1
123#define XFRM_MODE_MAX 2 130#define XFRM_MODE_ROUTEOPTIMIZATION 2
131#define XFRM_MODE_IN_TRIGGER 3
132#define XFRM_MODE_MAX 4
124 133
125/* Netlink configuration messages. */ 134/* Netlink configuration messages. */
126enum { 135enum {
@@ -164,6 +173,10 @@ enum {
164#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE 173#define XFRM_MSG_NEWAE XFRM_MSG_NEWAE
165 XFRM_MSG_GETAE, 174 XFRM_MSG_GETAE,
166#define XFRM_MSG_GETAE XFRM_MSG_GETAE 175#define XFRM_MSG_GETAE XFRM_MSG_GETAE
176
177 XFRM_MSG_REPORT,
178#define XFRM_MSG_REPORT XFRM_MSG_REPORT
179
167 __XFRM_MSG_MAX 180 __XFRM_MSG_MAX
168}; 181};
169#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) 182#define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1)
@@ -217,6 +230,12 @@ enum xfrm_ae_ftype_t {
217#define XFRM_AE_MAX (__XFRM_AE_MAX - 1) 230#define XFRM_AE_MAX (__XFRM_AE_MAX - 1)
218}; 231};
219 232
233struct xfrm_userpolicy_type {
234 __u8 type;
235 __u16 reserved1;
236 __u8 reserved2;
237};
238
220/* Netlink message attributes. */ 239/* Netlink message attributes. */
221enum xfrm_attr_type_t { 240enum xfrm_attr_type_t {
222 XFRMA_UNSPEC, 241 XFRMA_UNSPEC,
@@ -232,6 +251,10 @@ enum xfrm_attr_type_t {
232 XFRMA_REPLAY_VAL, 251 XFRMA_REPLAY_VAL,
233 XFRMA_REPLAY_THRESH, 252 XFRMA_REPLAY_THRESH,
234 XFRMA_ETIMER_THRESH, 253 XFRMA_ETIMER_THRESH,
254 XFRMA_SRCADDR, /* xfrm_address_t */
255 XFRMA_COADDR, /* xfrm_address_t */
256 XFRMA_LASTUSED,
257 XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */
235 __XFRMA_MAX 258 __XFRMA_MAX
236 259
237#define XFRMA_MAX (__XFRMA_MAX - 1) 260#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -247,12 +270,13 @@ struct xfrm_usersa_info {
247 __u32 seq; 270 __u32 seq;
248 __u32 reqid; 271 __u32 reqid;
249 __u16 family; 272 __u16 family;
250 __u8 mode; /* 0=transport,1=tunnel */ 273 __u8 mode; /* XFRM_MODE_xxx */
251 __u8 replay_window; 274 __u8 replay_window;
252 __u8 flags; 275 __u8 flags;
253#define XFRM_STATE_NOECN 1 276#define XFRM_STATE_NOECN 1
254#define XFRM_STATE_DECAP_DSCP 2 277#define XFRM_STATE_DECAP_DSCP 2
255#define XFRM_STATE_NOPMTUDISC 4 278#define XFRM_STATE_NOPMTUDISC 4
279#define XFRM_STATE_WILDRECV 8
256}; 280};
257 281
258struct xfrm_usersa_id { 282struct xfrm_usersa_id {
@@ -319,12 +343,18 @@ struct xfrm_usersa_flush {
319 __u8 proto; 343 __u8 proto;
320}; 344};
321 345
346struct xfrm_user_report {
347 __u8 proto;
348 struct xfrm_selector sel;
349};
350
322#ifndef __KERNEL__ 351#ifndef __KERNEL__
323/* backwards compatibility for userspace */ 352/* backwards compatibility for userspace */
324#define XFRMGRP_ACQUIRE 1 353#define XFRMGRP_ACQUIRE 1
325#define XFRMGRP_EXPIRE 2 354#define XFRMGRP_EXPIRE 2
326#define XFRMGRP_SA 4 355#define XFRMGRP_SA 4
327#define XFRMGRP_POLICY 8 356#define XFRMGRP_POLICY 8
357#define XFRMGRP_REPORT 0x10
328#endif 358#endif
329 359
330enum xfrm_nlgroups { 360enum xfrm_nlgroups {
@@ -340,6 +370,8 @@ enum xfrm_nlgroups {
340#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY 370#define XFRMNLGRP_POLICY XFRMNLGRP_POLICY
341 XFRMNLGRP_AEVENTS, 371 XFRMNLGRP_AEVENTS,
342#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS 372#define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS
373 XFRMNLGRP_REPORT,
374#define XFRMNLGRP_REPORT XFRMNLGRP_REPORT
343 __XFRMNLGRP_MAX 375 __XFRMNLGRP_MAX
344}; 376};
345#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) 377#define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1)