aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pretzel.yyz.us>2005-06-22 13:10:49 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-22 13:10:49 -0400
commit80bd6d7f5e0d872a0f5a151473d2a39d95d210a8 (patch)
treeb3a36048d6b7de88f7e906624ecb4b98816bb736 /include/linux
parent949d33e70f2c3e93bfe5265a50e40175b1ab1ec1 (diff)
parent2a5a68b840cbab31baab2d9b2e1e6de3b289ae1e (diff)
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h7
-rw-r--r--include/linux/arcfb.h8
-rw-r--r--include/linux/ata.h1
-rw-r--r--include/linux/atalk.h26
-rw-r--r--include/linux/audit.h94
-rw-r--r--include/linux/auto_fs4.h2
-rw-r--r--include/linux/blkdev.h2
-rw-r--r--include/linux/chio.h168
-rw-r--r--include/linux/cpufreq.h2
-rw-r--r--include/linux/device.h64
-rw-r--r--include/linux/dm9000.h36
-rw-r--r--include/linux/dma-mapping.h5
-rw-r--r--include/linux/etherdevice.h22
-rw-r--r--include/linux/ethtool.h1
-rw-r--r--include/linux/fb.h19
-rw-r--r--include/linux/font.h26
-rw-r--r--include/linux/fs.h46
-rw-r--r--include/linux/fsl_devices.h8
-rw-r--r--include/linux/gameport.h28
-rw-r--r--include/linux/genalloc.h40
-rw-r--r--include/linux/gfp.h8
-rw-r--r--include/linux/hardirq.h6
-rw-r--r--include/linux/hdlc.h4
-rw-r--r--include/linux/hugetlb.h40
-rw-r--r--include/linux/i2c-sysfs.h36
-rw-r--r--include/linux/ide.h20
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_shaper.h3
-rw-r--r--include/linux/if_tr.h8
-rw-r--r--include/linux/inetdevice.h2
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/ioc4.h179
-rw-r--r--include/linux/ioc4_common.h21
-rw-r--r--include/linux/ip.h21
-rw-r--r--include/linux/ipv6.h13
-rw-r--r--include/linux/irq.h4
-rw-r--r--include/linux/klist.h55
-rw-r--r--include/linux/kobject.h8
-rw-r--r--include/linux/libata.h60
-rw-r--r--include/linux/major.h1
-rw-r--r--include/linux/mii.h8
-rw-r--r--include/linux/mm.h6
-rw-r--r--include/linux/mmzone.h21
-rw-r--r--include/linux/netdevice.h5
-rw-r--r--include/linux/netfilter_ipv4.h6
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_core.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_nat.h3
-rw-r--r--include/linux/netfilter_ipv4/listhelp.h1
-rw-r--r--include/linux/netfilter_ipv4/lockhelp.h129
-rw-r--r--include/linux/netlink.h27
-rw-r--r--include/linux/node.h1
-rw-r--r--include/linux/notifier.h1
-rw-r--r--include/linux/page-flags.h35
-rw-r--r--include/linux/pagemap.h4
-rw-r--r--include/linux/pci_ids.h12
-rw-r--r--include/linux/pfkeyv2.h1
-rw-r--r--include/linux/pkt_sched.h9
-rw-r--r--include/linux/raid/bitmap.h273
-rw-r--r--include/linux/raid/md.h17
-rw-r--r--include/linux/raid/md_k.h22
-rw-r--r--include/linux/raid/md_p.h9
-rw-r--r--include/linux/raid/md_u.h7
-rw-r--r--include/linux/raid/raid1.h16
-rw-r--r--include/linux/rtnetlink.h176
-rw-r--r--include/linux/sched.h11
-rw-r--r--include/linux/signal.h2
-rw-r--r--include/linux/skbuff.h13
-rw-r--r--include/linux/slab.h1
-rw-r--r--include/linux/smp.h40
-rw-r--r--include/linux/swap.h3
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/sysfs.h15
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h30
-rw-r--r--include/linux/tcp.h28
-rw-r--r--include/linux/usb.h11
-rw-r--r--include/linux/wireless.h283
-rw-r--r--include/linux/xfrm.h5
77 files changed, 1921 insertions, 413 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index aefe6d051ace..b123cc08773d 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -25,6 +25,10 @@
25#ifndef _LINUX_ACPI_H 25#ifndef _LINUX_ACPI_H
26#define _LINUX_ACPI_H 26#define _LINUX_ACPI_H
27 27
28#include <linux/config.h>
29
30#ifdef CONFIG_ACPI
31
28#ifndef _LINUX 32#ifndef _LINUX
29#define _LINUX 33#define _LINUX
30#endif 34#endif
@@ -533,4 +537,5 @@ static inline int acpi_get_pxm(acpi_handle handle)
533 537
534extern int pnpacpi_disabled; 538extern int pnpacpi_disabled;
535 539
536#endif /*_LINUX_ACPI_H*/ 540#endif /* CONFIG_ACPI */
541#endif /*_LINUX_ACPI_H*/
diff --git a/include/linux/arcfb.h b/include/linux/arcfb.h
new file mode 100644
index 000000000000..721e7654daeb
--- /dev/null
+++ b/include/linux/arcfb.h
@@ -0,0 +1,8 @@
1#ifndef __LINUX_ARCFB_H__
2#define __LINUX_ARCFB_H__
3
4#define FBIO_WAITEVENT _IO('F', 0x88)
5#define FBIO_GETCONTROL2 _IOR('F', 0x89, size_t)
6
7#endif
8
diff --git a/include/linux/ata.h b/include/linux/ata.h
index f178894edd04..ca5fcadf9981 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -224,6 +224,7 @@ struct ata_taskfile {
224}; 224};
225 225
226#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) 226#define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0)
227#define ata_id_is_sata(id) ((id)[93] == 0)
227#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) 228#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
228#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) 229#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
229#define ata_id_has_flush(id) ((id)[83] & (1 << 12)) 230#define ata_id_has_flush(id) ((id)[83] & (1 << 12))
diff --git a/include/linux/atalk.h b/include/linux/atalk.h
index 31d3fc25ccbd..09a1451c1159 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -20,7 +20,7 @@
20#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0) 20#define SIOCATALKDIFADDR (SIOCPROTOPRIVATE + 0)
21 21
22struct atalk_addr { 22struct atalk_addr {
23 __u16 s_net; 23 __be16 s_net;
24 __u8 s_node; 24 __u8 s_node;
25}; 25};
26 26
@@ -33,8 +33,8 @@ struct sockaddr_at {
33 33
34struct atalk_netrange { 34struct atalk_netrange {
35 __u8 nr_phase; 35 __u8 nr_phase;
36 __u16 nr_firstnet; 36 __be16 nr_firstnet;
37 __u16 nr_lastnet; 37 __be16 nr_lastnet;
38}; 38};
39 39
40#ifdef __KERNEL__ 40#ifdef __KERNEL__
@@ -70,8 +70,8 @@ struct atalk_iface {
70struct atalk_sock { 70struct atalk_sock {
71 /* struct sock has to be the first member of atalk_sock */ 71 /* struct sock has to be the first member of atalk_sock */
72 struct sock sk; 72 struct sock sk;
73 unsigned short dest_net; 73 __be16 dest_net;
74 unsigned short src_net; 74 __be16 src_net;
75 unsigned char dest_node; 75 unsigned char dest_node;
76 unsigned char src_node; 76 unsigned char src_node;
77 unsigned char dest_port; 77 unsigned char dest_port;
@@ -95,9 +95,9 @@ struct ddpehdr {
95 deh_hops:4, 95 deh_hops:4,
96 deh_len:10; 96 deh_len:10;
97#endif 97#endif
98 __u16 deh_sum; 98 __be16 deh_sum;
99 __u16 deh_dnet; 99 __be16 deh_dnet;
100 __u16 deh_snet; 100 __be16 deh_snet;
101 __u8 deh_dnode; 101 __u8 deh_dnode;
102 __u8 deh_snode; 102 __u8 deh_snode;
103 __u8 deh_dport; 103 __u8 deh_dport;
@@ -142,24 +142,24 @@ struct ddpshdr {
142 142
143/* AppleTalk AARP headers */ 143/* AppleTalk AARP headers */
144struct elapaarp { 144struct elapaarp {
145 __u16 hw_type; 145 __be16 hw_type;
146#define AARP_HW_TYPE_ETHERNET 1 146#define AARP_HW_TYPE_ETHERNET 1
147#define AARP_HW_TYPE_TOKENRING 2 147#define AARP_HW_TYPE_TOKENRING 2
148 __u16 pa_type; 148 __be16 pa_type;
149 __u8 hw_len; 149 __u8 hw_len;
150 __u8 pa_len; 150 __u8 pa_len;
151#define AARP_PA_ALEN 4 151#define AARP_PA_ALEN 4
152 __u16 function; 152 __be16 function;
153#define AARP_REQUEST 1 153#define AARP_REQUEST 1
154#define AARP_REPLY 2 154#define AARP_REPLY 2
155#define AARP_PROBE 3 155#define AARP_PROBE 3
156 __u8 hw_src[ETH_ALEN] __attribute__ ((packed)); 156 __u8 hw_src[ETH_ALEN] __attribute__ ((packed));
157 __u8 pa_src_zero __attribute__ ((packed)); 157 __u8 pa_src_zero __attribute__ ((packed));
158 __u16 pa_src_net __attribute__ ((packed)); 158 __be16 pa_src_net __attribute__ ((packed));
159 __u8 pa_src_node __attribute__ ((packed)); 159 __u8 pa_src_node __attribute__ ((packed));
160 __u8 hw_dst[ETH_ALEN] __attribute__ ((packed)); 160 __u8 hw_dst[ETH_ALEN] __attribute__ ((packed));
161 __u8 pa_dst_zero __attribute__ ((packed)); 161 __u8 pa_dst_zero __attribute__ ((packed));
162 __u16 pa_dst_net __attribute__ ((packed)); 162 __be16 pa_dst_net __attribute__ ((packed));
163 __u8 pa_dst_node __attribute__ ((packed)); 163 __u8 pa_dst_node __attribute__ ((packed));
164}; 164};
165 165
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 19f04b049798..bf2ad3ba72eb 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -27,15 +27,52 @@
27#include <linux/sched.h> 27#include <linux/sched.h>
28#include <linux/elf.h> 28#include <linux/elf.h>
29 29
30/* Request and reply types */ 30/* The netlink messages for the audit system is divided into blocks:
31#define AUDIT_GET 1000 /* Get status */ 31 * 1000 - 1099 are for commanding the audit system
32#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */ 32 * 1100 - 1199 user space trusted application messages
33#define AUDIT_LIST 1002 /* List filtering rules */ 33 * 1200 - 1299 messages internal to the audit daemon
34#define AUDIT_ADD 1003 /* Add filtering rule */ 34 * 1300 - 1399 audit event messages
35#define AUDIT_DEL 1004 /* Delete filtering rule */ 35 * 1400 - 1499 SE Linux use
36#define AUDIT_USER 1005 /* Send a message from user-space */ 36 * 1500 - 1999 future use
37#define AUDIT_LOGIN 1006 /* Define the login id and informaiton */ 37 * 2000 is for otherwise unclassified kernel audit messages
38#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */ 38 *
39 * Messages from 1000-1199 are bi-directional. 1200-1299 are exclusively user
40 * space. Anything over that is kernel --> user space communication.
41 */
42#define AUDIT_GET 1000 /* Get status */
43#define AUDIT_SET 1001 /* Set status (enable/disable/auditd) */
44#define AUDIT_LIST 1002 /* List syscall filtering rules */
45#define AUDIT_ADD 1003 /* Add syscall filtering rule */
46#define AUDIT_DEL 1004 /* Delete syscall filtering rule */
47#define AUDIT_USER 1005 /* Message from userspace -- deprecated */
48#define AUDIT_LOGIN 1006 /* Define the login id and information */
49#define AUDIT_WATCH_INS 1007 /* Insert file/dir watch entry */
50#define AUDIT_WATCH_REM 1008 /* Remove file/dir watch entry */
51#define AUDIT_WATCH_LIST 1009 /* List all file/dir watches */
52#define AUDIT_SIGNAL_INFO 1010 /* Get info about sender of signal to auditd */
53
54#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages uninteresting to kernel */
55#define AUDIT_LAST_USER_MSG 1199
56
57#define AUDIT_DAEMON_START 1200 /* Daemon startup record */
58#define AUDIT_DAEMON_END 1201 /* Daemon normal stop record */
59#define AUDIT_DAEMON_ABORT 1202 /* Daemon error stop record */
60#define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */
61
62#define AUDIT_SYSCALL 1300 /* Syscall event */
63#define AUDIT_FS_WATCH 1301 /* Filesystem watch event */
64#define AUDIT_PATH 1302 /* Filename path information */
65#define AUDIT_IPC 1303 /* IPC record */
66#define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */
67#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
68#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
69#define AUDIT_CWD 1307 /* Current working directory */
70
71#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
72#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
73#define AUDIT_AVC_PATH 1402 /* dentry, vfsmount pair from avc */
74
75#define AUDIT_KERNEL 2000 /* Asynchronous audit record. NOT A REQUEST. */
39 76
40/* Rule flags */ 77/* Rule flags */
41#define AUDIT_PER_TASK 0x01 /* Apply rule at task creation (not syscall) */ 78#define AUDIT_PER_TASK 0x01 /* Apply rule at task creation (not syscall) */
@@ -132,16 +169,9 @@
132#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE) 169#define AUDIT_ARCH_V850 (EM_V850|__AUDIT_ARCH_LE)
133#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) 170#define AUDIT_ARCH_X86_64 (EM_X86_64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)
134 171
135#ifndef __KERNEL__
136struct audit_message {
137 struct nlmsghdr nlh;
138 char data[1200];
139};
140#endif
141
142struct audit_status { 172struct audit_status {
143 __u32 mask; /* Bit mask for valid entries */ 173 __u32 mask; /* Bit mask for valid entries */
144 __u32 enabled; /* 1 = enabled, 0 = disbaled */ 174 __u32 enabled; /* 1 = enabled, 0 = disabled */
145 __u32 failure; /* Failure-to-log action */ 175 __u32 failure; /* Failure-to-log action */
146 __u32 pid; /* pid of auditd process */ 176 __u32 pid; /* pid of auditd process */
147 __u32 rate_limit; /* messages rate limit (per second) */ 177 __u32 rate_limit; /* messages rate limit (per second) */
@@ -161,6 +191,11 @@ struct audit_rule { /* for AUDIT_LIST, AUDIT_ADD, and AUDIT_DEL */
161 191
162#ifdef __KERNEL__ 192#ifdef __KERNEL__
163 193
194struct audit_sig_info {
195 uid_t uid;
196 pid_t pid;
197};
198
164struct audit_buffer; 199struct audit_buffer;
165struct audit_context; 200struct audit_context;
166struct inode; 201struct inode;
@@ -185,11 +220,16 @@ extern void audit_inode(const char *name, const struct inode *inode);
185 /* Private API (for audit.c only) */ 220 /* Private API (for audit.c only) */
186extern int audit_receive_filter(int type, int pid, int uid, int seq, 221extern int audit_receive_filter(int type, int pid, int uid, int seq,
187 void *data, uid_t loginuid); 222 void *data, uid_t loginuid);
188extern void audit_get_stamp(struct audit_context *ctx, 223extern unsigned int audit_serial(void);
189 struct timespec *t, unsigned int *serial); 224extern void auditsc_get_stamp(struct audit_context *ctx,
225 struct timespec *t, unsigned int *serial);
190extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 226extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
191extern uid_t audit_get_loginuid(struct audit_context *ctx); 227extern uid_t audit_get_loginuid(struct audit_context *ctx);
192extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); 228extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode);
229extern int audit_socketcall(int nargs, unsigned long *args);
230extern int audit_sockaddr(int len, void *addr);
231extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
232extern void audit_signal_info(int sig, struct task_struct *t);
193#else 233#else
194#define audit_alloc(t) ({ 0; }) 234#define audit_alloc(t) ({ 0; })
195#define audit_free(t) do { ; } while (0) 235#define audit_free(t) do { ; } while (0)
@@ -198,18 +238,24 @@ extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mo
198#define audit_getname(n) do { ; } while (0) 238#define audit_getname(n) do { ; } while (0)
199#define audit_putname(n) do { ; } while (0) 239#define audit_putname(n) do { ; } while (0)
200#define audit_inode(n,i) do { ; } while (0) 240#define audit_inode(n,i) do { ; } while (0)
241#define audit_receive_filter(t,p,u,s,d,l) ({ -EOPNOTSUPP; })
242#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
201#define audit_get_loginuid(c) ({ -1; }) 243#define audit_get_loginuid(c) ({ -1; })
202#define audit_ipc_perms(q,u,g,m) ({ 0; }) 244#define audit_ipc_perms(q,u,g,m) ({ 0; })
245#define audit_socketcall(n,a) ({ 0; })
246#define audit_sockaddr(len, addr) ({ 0; })
247#define audit_avc_path(dentry, mnt) ({ 0; })
248#define audit_signal_info(s,t) do { ; } while (0)
203#endif 249#endif
204 250
205#ifdef CONFIG_AUDIT 251#ifdef CONFIG_AUDIT
206/* These are defined in audit.c */ 252/* These are defined in audit.c */
207 /* Public API */ 253 /* Public API */
208extern void audit_log(struct audit_context *ctx, 254extern void audit_log(struct audit_context *ctx, int type,
209 const char *fmt, ...) 255 const char *fmt, ...)
210 __attribute__((format(printf,2,3))); 256 __attribute__((format(printf,3,4)));
211 257
212extern struct audit_buffer *audit_log_start(struct audit_context *ctx); 258extern struct audit_buffer *audit_log_start(struct audit_context *ctx,int type);
213extern void audit_log_format(struct audit_buffer *ab, 259extern void audit_log_format(struct audit_buffer *ab,
214 const char *fmt, ...) 260 const char *fmt, ...)
215 __attribute__((format(printf,2,3))); 261 __attribute__((format(printf,2,3)));
@@ -229,8 +275,8 @@ extern void audit_send_reply(int pid, int seq, int type,
229 void *payload, int size); 275 void *payload, int size);
230extern void audit_log_lost(const char *message); 276extern void audit_log_lost(const char *message);
231#else 277#else
232#define audit_log(t,f,...) do { ; } while (0) 278#define audit_log(c,t,f,...) do { ; } while (0)
233#define audit_log_start(t) ({ NULL; }) 279#define audit_log_start(c,t) ({ NULL; })
234#define audit_log_vformat(b,f,a) do { ; } while (0) 280#define audit_log_vformat(b,f,a) do { ; } while (0)
235#define audit_log_format(b,f,...) do { ; } while (0) 281#define audit_log_format(b,f,...) do { ; } while (0)
236#define audit_log_end(b) do { ; } while (0) 282#define audit_log_end(b) do { ; } while (0)
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h
index a1657fb99516..9343c89d843c 100644
--- a/include/linux/auto_fs4.h
+++ b/include/linux/auto_fs4.h
@@ -23,7 +23,7 @@
23#define AUTOFS_MIN_PROTO_VERSION 3 23#define AUTOFS_MIN_PROTO_VERSION 3
24#define AUTOFS_MAX_PROTO_VERSION 4 24#define AUTOFS_MAX_PROTO_VERSION 4
25 25
26#define AUTOFS_PROTO_SUBVERSION 6 26#define AUTOFS_PROTO_SUBVERSION 7
27 27
28/* Mask for expire behaviour */ 28/* Mask for expire behaviour */
29#define AUTOFS_EXP_IMMEDIATE 1 29#define AUTOFS_EXP_IMMEDIATE 1
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ef1afc178c0a..4a99b76c5a33 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -544,7 +544,7 @@ extern void blk_end_sync_rq(struct request *rq);
544extern void blk_attempt_remerge(request_queue_t *, struct request *); 544extern void blk_attempt_remerge(request_queue_t *, struct request *);
545extern void __blk_attempt_remerge(request_queue_t *, struct request *); 545extern void __blk_attempt_remerge(request_queue_t *, struct request *);
546extern struct request *blk_get_request(request_queue_t *, int, int); 546extern struct request *blk_get_request(request_queue_t *, int, int);
547extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int); 547extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
548extern void blk_requeue_request(request_queue_t *, struct request *); 548extern void blk_requeue_request(request_queue_t *, struct request *);
549extern void blk_plug_device(request_queue_t *); 549extern void blk_plug_device(request_queue_t *);
550extern int blk_remove_plug(request_queue_t *); 550extern int blk_remove_plug(request_queue_t *);
diff --git a/include/linux/chio.h b/include/linux/chio.h
new file mode 100644
index 000000000000..63035ae67e63
--- /dev/null
+++ b/include/linux/chio.h
@@ -0,0 +1,168 @@
1/*
2 * ioctl interface for the scsi media changer driver
3 */
4
5/* changer element types */
6#define CHET_MT 0 /* media transport element (robot) */
7#define CHET_ST 1 /* storage element (media slots) */
8#define CHET_IE 2 /* import/export element */
9#define CHET_DT 3 /* data transfer element (tape/cdrom/whatever) */
10#define CHET_V1 4 /* vendor specific #1 */
11#define CHET_V2 5 /* vendor specific #2 */
12#define CHET_V3 6 /* vendor specific #3 */
13#define CHET_V4 7 /* vendor specific #4 */
14
15
16/*
17 * CHIOGPARAMS
18 * query changer properties
19 *
20 * CHIOVGPARAMS
21 * query vendor-specific element types
22 *
23 * accessing elements works by specifing type and unit of the element.
24 * for eample, storage elements are addressed with type = CHET_ST and
25 * unit = 0 .. cp_nslots-1
26 *
27 */
28struct changer_params {
29 int cp_curpicker; /* current transport element */
30 int cp_npickers; /* number of transport elements (CHET_MT) */
31 int cp_nslots; /* number of storage elements (CHET_ST) */
32 int cp_nportals; /* number of import/export elements (CHET_IE) */
33 int cp_ndrives; /* number of data transfer elements (CHET_DT) */
34};
35struct changer_vendor_params {
36 int cvp_n1; /* number of vendor specific elems (CHET_V1) */
37 char cvp_label1[16];
38 int cvp_n2; /* number of vendor specific elems (CHET_V2) */
39 char cvp_label2[16];
40 int cvp_n3; /* number of vendor specific elems (CHET_V3) */
41 char cvp_label3[16];
42 int cvp_n4; /* number of vendor specific elems (CHET_V4) */
43 char cvp_label4[16];
44 int reserved[8];
45};
46
47
48/*
49 * CHIOMOVE
50 * move a medium from one element to another
51 */
52struct changer_move {
53 int cm_fromtype; /* type/unit of source element */
54 int cm_fromunit;
55 int cm_totype; /* type/unit of destination element */
56 int cm_tounit;
57 int cm_flags;
58};
59#define CM_INVERT 1 /* flag: rotate media (for double-sided like MOD) */
60
61
62/*
63 * CHIOEXCHANGE
64 * move one medium from element #1 to element #2,
65 * and another one from element #2 to element #3.
66 * element #1 and #3 are allowed to be identical.
67 */
68struct changer_exchange {
69 int ce_srctype; /* type/unit of element #1 */
70 int ce_srcunit;
71 int ce_fdsttype; /* type/unit of element #2 */
72 int ce_fdstunit;
73 int ce_sdsttype; /* type/unit of element #3 */
74 int ce_sdstunit;
75 int ce_flags;
76};
77#define CE_INVERT1 1
78#define CE_INVERT2 2
79
80
81/*
82 * CHIOPOSITION
83 * move the transport element (robot arm) to a specific element.
84 */
85struct changer_position {
86 int cp_type;
87 int cp_unit;
88 int cp_flags;
89};
90#define CP_INVERT 1
91
92
93/*
94 * CHIOGSTATUS
95 * get element status for all elements of a specific type
96 */
97struct changer_element_status {
98 int ces_type;
99 unsigned char *ces_data;
100};
101#define CESTATUS_FULL 0x01 /* full */
102#define CESTATUS_IMPEXP 0x02 /* media was imported (inserted by sysop) */
103#define CESTATUS_EXCEPT 0x04 /* error condition */
104#define CESTATUS_ACCESS 0x08 /* access allowed */
105#define CESTATUS_EXENAB 0x10 /* element can export media */
106#define CESTATUS_INENAB 0x20 /* element can import media */
107
108
109/*
110 * CHIOGELEM
111 * get more detailed status informtion for a single element
112 */
113struct changer_get_element {
114 int cge_type; /* type/unit */
115 int cge_unit;
116 int cge_status; /* status */
117 int cge_errno; /* errno */
118 int cge_srctype; /* source element of the last move/exchange */
119 int cge_srcunit;
120 int cge_id; /* scsi id (for data transfer elements) */
121 int cge_lun; /* scsi lun (for data transfer elements) */
122 char cge_pvoltag[36]; /* primary volume tag */
123 char cge_avoltag[36]; /* alternate volume tag */
124 int cge_flags;
125};
126/* flags */
127#define CGE_ERRNO 0x01 /* errno available */
128#define CGE_INVERT 0x02 /* media inverted */
129#define CGE_SRC 0x04 /* media src available */
130#define CGE_IDLUN 0x08 /* ID+LUN available */
131#define CGE_PVOLTAG 0x10 /* primary volume tag available */
132#define CGE_AVOLTAG 0x20 /* alternate volume tag available */
133
134
135/*
136 * CHIOSVOLTAG
137 * set volume tag
138 */
139struct changer_set_voltag {
140 int csv_type; /* type/unit */
141 int csv_unit;
142 char csv_voltag[36]; /* volume tag */
143 int csv_flags;
144};
145#define CSV_PVOLTAG 0x01 /* primary volume tag */
146#define CSV_AVOLTAG 0x02 /* alternate volume tag */
147#define CSV_CLEARTAG 0x04 /* clear volume tag */
148
149/* ioctls */
150#define CHIOMOVE _IOW('c', 1,struct changer_move)
151#define CHIOEXCHANGE _IOW('c', 2,struct changer_exchange)
152#define CHIOPOSITION _IOW('c', 3,struct changer_position)
153#define CHIOGPICKER _IOR('c', 4,int) /* not impl. */
154#define CHIOSPICKER _IOW('c', 5,int) /* not impl. */
155#define CHIOGPARAMS _IOR('c', 6,struct changer_params)
156#define CHIOGSTATUS _IOW('c', 8,struct changer_element_status)
157#define CHIOGELEM _IOW('c',16,struct changer_get_element)
158#define CHIOINITELEM _IO('c',17)
159#define CHIOSVOLTAG _IOW('c',18,struct changer_set_voltag)
160#define CHIOGVPARAMS _IOR('c',19,struct changer_vendor_params)
161
162/* ---------------------------------------------------------------------- */
163
164/*
165 * Local variables:
166 * c-basic-offset: 8
167 * End:
168 */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index f21af067d015..927daa86c9b3 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -49,7 +49,7 @@ int cpufreq_unregister_notifier(struct notifier_block *nb, unsigned int list);
49/* Frequency values here are CPU kHz so that hardware which doesn't run 49/* Frequency values here are CPU kHz so that hardware which doesn't run
50 * with some frequencies can complain without having to guess what per 50 * with some frequencies can complain without having to guess what per
51 * cent / per mille means. 51 * cent / per mille means.
52 * Maximum transition latency is in microseconds - if it's unknown, 52 * Maximum transition latency is in nanoseconds - if it's unknown,
53 * CPUFREQ_ETERNAL shall be used. 53 * CPUFREQ_ETERNAL shall be used.
54 */ 54 */
55 55
diff --git a/include/linux/device.h b/include/linux/device.h
index df94c0de53f2..7b781a72b293 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -14,6 +14,7 @@
14#include <linux/config.h> 14#include <linux/config.h>
15#include <linux/ioport.h> 15#include <linux/ioport.h>
16#include <linux/kobject.h> 16#include <linux/kobject.h>
17#include <linux/klist.h>
17#include <linux/list.h> 18#include <linux/list.h>
18#include <linux/types.h> 19#include <linux/types.h>
19#include <linux/module.h> 20#include <linux/module.h>
@@ -44,14 +45,15 @@ struct device;
44struct device_driver; 45struct device_driver;
45struct class; 46struct class;
46struct class_device; 47struct class_device;
47struct class_simple;
48 48
49struct bus_type { 49struct bus_type {
50 char * name; 50 const char * name;
51 51
52 struct subsystem subsys; 52 struct subsystem subsys;
53 struct kset drivers; 53 struct kset drivers;
54 struct kset devices; 54 struct kset devices;
55 struct klist klist_devices;
56 struct klist klist_drivers;
55 57
56 struct bus_attribute * bus_attrs; 58 struct bus_attribute * bus_attrs;
57 struct device_attribute * dev_attrs; 59 struct device_attribute * dev_attrs;
@@ -98,17 +100,18 @@ extern int bus_create_file(struct bus_type *, struct bus_attribute *);
98extern void bus_remove_file(struct bus_type *, struct bus_attribute *); 100extern void bus_remove_file(struct bus_type *, struct bus_attribute *);
99 101
100struct device_driver { 102struct device_driver {
101 char * name; 103 const char * name;
102 struct bus_type * bus; 104 struct bus_type * bus;
103 105
104 struct completion unloaded; 106 struct completion unloaded;
105 struct kobject kobj; 107 struct kobject kobj;
106 struct list_head devices; 108 struct klist klist_devices;
109 struct klist_node knode_bus;
107 110
108 struct module * owner; 111 struct module * owner;
109 112
110 int (*probe) (struct device * dev); 113 int (*probe) (struct device * dev);
111 int (*remove) (struct device * dev); 114 int (*remove) (struct device * dev);
112 void (*shutdown) (struct device * dev); 115 void (*shutdown) (struct device * dev);
113 int (*suspend) (struct device * dev, pm_message_t state, u32 level); 116 int (*suspend) (struct device * dev, pm_message_t state, u32 level);
114 int (*resume) (struct device * dev, u32 level); 117 int (*resume) (struct device * dev, u32 level);
@@ -137,12 +140,16 @@ struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store)
137extern int driver_create_file(struct device_driver *, struct driver_attribute *); 140extern int driver_create_file(struct device_driver *, struct driver_attribute *);
138extern void driver_remove_file(struct device_driver *, struct driver_attribute *); 141extern void driver_remove_file(struct device_driver *, struct driver_attribute *);
139 142
143extern int driver_for_each_device(struct device_driver * drv, struct device * start,
144 void * data, int (*fn)(struct device *, void *));
145
140 146
141/* 147/*
142 * device classes 148 * device classes
143 */ 149 */
144struct class { 150struct class {
145 char * name; 151 const char * name;
152 struct module * owner;
146 153
147 struct subsystem subsys; 154 struct subsystem subsys;
148 struct list_head children; 155 struct list_head children;
@@ -185,6 +192,7 @@ struct class_device {
185 struct kobject kobj; 192 struct kobject kobj;
186 struct class * class; /* required */ 193 struct class * class; /* required */
187 dev_t devt; /* dev_t, creates the sysfs "dev" */ 194 dev_t devt; /* dev_t, creates the sysfs "dev" */
195 struct class_device_attribute *devt_attr;
188 struct device * dev; /* not necessary, but nice to have */ 196 struct device * dev; /* not necessary, but nice to have */
189 void * class_data; /* class-specific data */ 197 void * class_data; /* class-specific data */
190 198
@@ -245,26 +253,28 @@ struct class_interface {
245extern int class_interface_register(struct class_interface *); 253extern int class_interface_register(struct class_interface *);
246extern void class_interface_unregister(struct class_interface *); 254extern void class_interface_unregister(struct class_interface *);
247 255
248/* interface for class simple stuff */ 256extern struct class *class_create(struct module *owner, char *name);
249extern struct class_simple *class_simple_create(struct module *owner, char *name); 257extern void class_destroy(struct class *cls);
250extern void class_simple_destroy(struct class_simple *cs); 258extern struct class_device *class_device_create(struct class *cls, dev_t devt,
251extern struct class_device *class_simple_device_add(struct class_simple *cs, dev_t dev, struct device *device, const char *fmt, ...) 259 struct device *device, char *fmt, ...)
252 __attribute__((format(printf,4,5))); 260 __attribute__((format(printf,4,5)));
253extern int class_simple_set_hotplug(struct class_simple *, 261extern void class_device_destroy(struct class *cls, dev_t devt);
254 int (*hotplug)(struct class_device *dev, char **envp, int num_envp, char *buffer, int buffer_size));
255extern void class_simple_device_remove(dev_t dev);
256 262
257 263
258struct device { 264struct device {
259 struct list_head node; /* node in sibling list */ 265 struct klist klist_children;
260 struct list_head bus_list; /* node in bus's list */ 266 struct klist_node knode_parent; /* node in sibling list */
261 struct list_head driver_list; 267 struct klist_node knode_driver;
262 struct list_head children; 268 struct klist_node knode_bus;
263 struct device * parent; 269 struct device * parent;
264 270
265 struct kobject kobj; 271 struct kobject kobj;
266 char bus_id[BUS_ID_SIZE]; /* position on parent bus */ 272 char bus_id[BUS_ID_SIZE]; /* position on parent bus */
267 273
274 struct semaphore sem; /* semaphore to synchronize calls to
275 * its driver.
276 */
277
268 struct bus_type * bus; /* type of bus device is on */ 278 struct bus_type * bus; /* type of bus device is on */
269 struct device_driver *driver; /* which driver has allocated this 279 struct device_driver *driver; /* which driver has allocated this
270 device */ 280 device */
@@ -288,12 +298,6 @@ struct device {
288 void (*release)(struct device * dev); 298 void (*release)(struct device * dev);
289}; 299};
290 300
291static inline struct device *
292list_to_dev(struct list_head *node)
293{
294 return list_entry(node, struct device, node);
295}
296
297static inline void * 301static inline void *
298dev_get_drvdata (struct device *dev) 302dev_get_drvdata (struct device *dev)
299{ 303{
@@ -321,7 +325,6 @@ extern int device_for_each_child(struct device *, void *,
321 * Manual binding of a device to driver. See drivers/base/bus.c 325 * Manual binding of a device to driver. See drivers/base/bus.c
322 * for information on use. 326 * for information on use.
323 */ 327 */
324extern int driver_probe_device(struct device_driver * drv, struct device * dev);
325extern void device_bind_driver(struct device * dev); 328extern void device_bind_driver(struct device * dev);
326extern void device_release_driver(struct device * dev); 329extern void device_release_driver(struct device * dev);
327extern int device_attach(struct device * dev); 330extern int device_attach(struct device * dev);
@@ -332,8 +335,10 @@ extern void driver_attach(struct device_driver * drv);
332 335
333struct device_attribute { 336struct device_attribute {
334 struct attribute attr; 337 struct attribute attr;
335 ssize_t (*show)(struct device * dev, char * buf); 338 ssize_t (*show)(struct device *dev, struct device_attribute *attr,
336 ssize_t (*store)(struct device * dev, const char * buf, size_t count); 339 char *buf);
340 ssize_t (*store)(struct device *dev, struct device_attribute *attr,
341 const char *buf, size_t count);
337}; 342};
338 343
339#define DEVICE_ATTR(_name,_mode,_show,_store) \ 344#define DEVICE_ATTR(_name,_mode,_show,_store) \
@@ -360,13 +365,12 @@ extern int (*platform_notify_remove)(struct device * dev);
360 */ 365 */
361extern struct device * get_device(struct device * dev); 366extern struct device * get_device(struct device * dev);
362extern void put_device(struct device * dev); 367extern void put_device(struct device * dev);
363extern struct device *device_find(const char *name, struct bus_type *bus);
364 368
365 369
366/* drivers/base/platform.c */ 370/* drivers/base/platform.c */
367 371
368struct platform_device { 372struct platform_device {
369 char * name; 373 const char * name;
370 u32 id; 374 u32 id;
371 struct device dev; 375 struct device dev;
372 u32 num_resources; 376 u32 num_resources;
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h
new file mode 100644
index 000000000000..0008e2ad0c9f
--- /dev/null
+++ b/include/linux/dm9000.h
@@ -0,0 +1,36 @@
1/* include/linux/dm9000.h
2 *
3 * Copyright (c) 2004 Simtec Electronics
4 * Ben Dooks <ben@simtec.co.uk>
5 *
6 * Header file for dm9000 platform data
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 *
12*/
13
14#ifndef __DM9000_PLATFORM_DATA
15#define __DM9000_PLATFORM_DATA __FILE__
16
17/* IO control flags */
18
19#define DM9000_PLATF_8BITONLY (0x0001)
20#define DM9000_PLATF_16BITONLY (0x0002)
21#define DM9000_PLATF_32BITONLY (0x0004)
22
23/* platfrom data for platfrom device structure's platfrom_data field */
24
25struct dm9000_plat_data {
26 unsigned int flags;
27
28 /* allow replacement IO routines */
29
30 void (*inblk)(void __iomem *reg, void *data, int len);
31 void (*outblk)(void __iomem *reg, void *data, int len);
32 void (*dumpblk)(void __iomem *reg, int len);
33};
34
35#endif /* __DM9000_PLATFORM_DATA */
36
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 806c305332c1..2d80cc761a15 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -14,7 +14,12 @@ enum dma_data_direction {
14}; 14};
15 15
16#define DMA_64BIT_MASK 0xffffffffffffffffULL 16#define DMA_64BIT_MASK 0xffffffffffffffffULL
17#define DMA_40BIT_MASK 0x000000ffffffffffULL
18#define DMA_39BIT_MASK 0x0000007fffffffffULL
17#define DMA_32BIT_MASK 0x00000000ffffffffULL 19#define DMA_32BIT_MASK 0x00000000ffffffffULL
20#define DMA_31BIT_MASK 0x000000007fffffffULL
21#define DMA_30BIT_MASK 0x000000003fffffffULL
22#define DMA_29BIT_MASK 0x000000001fffffffULL
18 23
19#include <asm/dma-mapping.h> 24#include <asm/dma-mapping.h>
20 25
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 220748b7abea..a1478258d002 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -56,18 +56,32 @@ static inline int is_zero_ether_addr(const u8 *addr)
56} 56}
57 57
58/** 58/**
59 * is_multicast_ether_addr - Determine if the given Ethernet address is a
60 * multicast address.
61 *
62 * @addr: Pointer to a six-byte array containing the Ethernet address
63 *
64 * Return true if the address is a multicast address.
65 */
66static inline int is_multicast_ether_addr(const u8 *addr)
67{
68 return addr[0] & 0x01;
69}
70
71/**
59 * is_valid_ether_addr - Determine if the given Ethernet address is valid 72 * is_valid_ether_addr - Determine if the given Ethernet address is valid
60 * @addr: Pointer to a six-byte array containing the Ethernet address 73 * @addr: Pointer to a six-byte array containing the Ethernet address
61 * 74 *
62 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not 75 * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not
63 * a multicast address, and is not FF:FF:FF:FF:FF:FF. The multicast 76 * a multicast address, and is not FF:FF:FF:FF:FF:FF.
64 * and FF:FF:... tests are combined into the single test "!(addr[0]&1)".
65 * 77 *
66 * Return true if the address is valid. 78 * Return true if the address is valid.
67 */ 79 */
68static inline int is_valid_ether_addr(const u8 *addr) 80static inline int is_valid_ether_addr(const u8 *addr)
69{ 81{
70 return !(addr[0]&1) && !is_zero_ether_addr(addr); 82 /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to
83 * explicitly check for it here. */
84 return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
71} 85}
72 86
73/** 87/**
@@ -83,6 +97,6 @@ static inline void random_ether_addr(u8 *addr)
83 addr [0] &= 0xfe; /* clear multicast bit */ 97 addr [0] &= 0xfe; /* clear multicast bit */
84 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 98 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
85} 99}
86#endif 100#endif /* __KERNEL__ */
87 101
88#endif /* _LINUX_ETHERDEVICE_H */ 102#endif /* _LINUX_ETHERDEVICE_H */
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c85b210490ea..a0ab26aab450 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -256,6 +256,7 @@ struct net_device;
256u32 ethtool_op_get_link(struct net_device *dev); 256u32 ethtool_op_get_link(struct net_device *dev);
257u32 ethtool_op_get_tx_csum(struct net_device *dev); 257u32 ethtool_op_get_tx_csum(struct net_device *dev);
258int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); 258int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
259int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
259u32 ethtool_op_get_sg(struct net_device *dev); 260u32 ethtool_op_get_sg(struct net_device *dev);
260int ethtool_op_set_sg(struct net_device *dev, u32 data); 261int ethtool_op_set_sg(struct net_device *dev, u32 data);
261u32 ethtool_op_get_tso(struct net_device *dev); 262u32 ethtool_op_get_tso(struct net_device *dev);
diff --git a/include/linux/fb.h b/include/linux/fb.h
index b468bf496547..bc24beeed971 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -524,11 +524,11 @@ struct fb_pixmap {
524 u32 offset; /* current offset to buffer */ 524 u32 offset; /* current offset to buffer */
525 u32 buf_align; /* byte alignment of each bitmap */ 525 u32 buf_align; /* byte alignment of each bitmap */
526 u32 scan_align; /* alignment per scanline */ 526 u32 scan_align; /* alignment per scanline */
527 u32 access_align; /* alignment per read/write */ 527 u32 access_align; /* alignment per read/write (bits) */
528 u32 flags; /* see FB_PIXMAP_* */ 528 u32 flags; /* see FB_PIXMAP_* */
529 /* access methods */ 529 /* access methods */
530 void (*outbuf)(struct fb_info *info, u8 *addr, u8 *src, unsigned int size); 530 void (*writeio)(struct fb_info *info, void __iomem *dst, void *src, unsigned int size);
531 u8 (*inbuf) (struct fb_info *info, u8 *addr); 531 void (*readio) (struct fb_info *info, void *dst, void __iomem *src, unsigned int size);
532}; 532};
533 533
534 534
@@ -816,18 +816,9 @@ extern int unregister_framebuffer(struct fb_info *fb_info);
816extern int fb_prepare_logo(struct fb_info *fb_info); 816extern int fb_prepare_logo(struct fb_info *fb_info);
817extern int fb_show_logo(struct fb_info *fb_info); 817extern int fb_show_logo(struct fb_info *fb_info);
818extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); 818extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
819extern void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, 819extern void fb_pad_unaligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 idx,
820 u8 *dst, u32 d_pitch, u8 *src, u32 idx,
821 u32 height, u32 shift_high, u32 shift_low, u32 mod); 820 u32 height, u32 shift_high, u32 shift_low, u32 mod);
822extern void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, 821extern void fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch, u32 height);
823 u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
824 u32 height);
825extern void fb_sysmove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf,
826 u8 *dst, u32 d_pitch, u8 *src, u32 idx,
827 u32 height, u32 shift_high, u32 shift_low, u32 mod);
828extern void fb_sysmove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf,
829 u8 *dst, u32 d_pitch, u8 *src, u32 s_pitch,
830 u32 height);
831extern void fb_set_suspend(struct fb_info *info, int state); 822extern void fb_set_suspend(struct fb_info *info, int state);
832extern int fb_get_color_depth(struct fb_var_screeninfo *var); 823extern int fb_get_color_depth(struct fb_var_screeninfo *var);
833extern int fb_get_options(char *name, char **option); 824extern int fb_get_options(char *name, char **option);
diff --git a/include/linux/font.h b/include/linux/font.h
index fc2d690c9d5f..8fc80a7d78ac 100644
--- a/include/linux/font.h
+++ b/include/linux/font.h
@@ -25,19 +25,23 @@ struct font_desc {
25#define VGA8x16_IDX 1 25#define VGA8x16_IDX 1
26#define PEARL8x8_IDX 2 26#define PEARL8x8_IDX 2
27#define VGA6x11_IDX 3 27#define VGA6x11_IDX 3
28#define SUN8x16_IDX 4 28#define FONT7x14_IDX 4
29#define SUN12x22_IDX 5 29#define FONT10x18_IDX 5
30#define ACORN8x8_IDX 6 30#define SUN8x16_IDX 6
31#define MINI4x6_IDX 7 31#define SUN12x22_IDX 7
32#define ACORN8x8_IDX 8
33#define MINI4x6_IDX 9
32 34
33extern struct font_desc font_vga_8x8, 35extern struct font_desc font_vga_8x8,
34 font_vga_8x16, 36 font_vga_8x16,
35 font_pearl_8x8, 37 font_pearl_8x8,
36 font_vga_6x11, 38 font_vga_6x11,
37 font_sun_8x16, 39 font_7x14,
38 font_sun_12x22, 40 font_10x18,
39 font_acorn_8x8, 41 font_sun_8x16,
40 font_mini_4x6; 42 font_sun_12x22,
43 font_acorn_8x8,
44 font_mini_4x6;
41 45
42/* Find a font with a specific name */ 46/* Find a font with a specific name */
43 47
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 0180102dace1..9b8b696d4f15 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1657,6 +1657,52 @@ static inline void simple_transaction_set(struct file *file, size_t n)
1657 ar->size = n; 1657 ar->size = n;
1658} 1658}
1659 1659
1660/*
1661 * simple attribute files
1662 *
1663 * These attributes behave similar to those in sysfs:
1664 *
1665 * Writing to an attribute immediately sets a value, an open file can be
1666 * written to multiple times.
1667 *
1668 * Reading from an attribute creates a buffer from the value that might get
1669 * read with multiple read calls. When the attribute has been read
1670 * completely, no further read calls are possible until the file is opened
1671 * again.
1672 *
1673 * All attributes contain a text representation of a numeric value
1674 * that are accessed with the get() and set() functions.
1675 */
1676#define DEFINE_SIMPLE_ATTRIBUTE(__fops, __get, __set, __fmt) \
1677static int __fops ## _open(struct inode *inode, struct file *file) \
1678{ \
1679 __simple_attr_check_format(__fmt, 0ull); \
1680 return simple_attr_open(inode, file, __get, __set, __fmt); \
1681} \
1682static struct file_operations __fops = { \
1683 .owner = THIS_MODULE, \
1684 .open = __fops ## _open, \
1685 .release = simple_attr_close, \
1686 .read = simple_attr_read, \
1687 .write = simple_attr_write, \
1688};
1689
1690static inline void __attribute__((format(printf, 1, 2)))
1691__simple_attr_check_format(const char *fmt, ...)
1692{
1693 /* don't do anything, just let the compiler check the arguments; */
1694}
1695
1696int simple_attr_open(struct inode *inode, struct file *file,
1697 u64 (*get)(void *), void (*set)(void *, u64),
1698 const char *fmt);
1699int simple_attr_close(struct inode *inode, struct file *file);
1700ssize_t simple_attr_read(struct file *file, char __user *buf,
1701 size_t len, loff_t *ppos);
1702ssize_t simple_attr_write(struct file *file, const char __user *buf,
1703 size_t len, loff_t *ppos);
1704
1705
1660#ifdef CONFIG_SECURITY 1706#ifdef CONFIG_SECURITY
1661static inline char *alloc_secdata(void) 1707static inline char *alloc_secdata(void)
1662{ 1708{
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index faaff4c64559..70f54af87b9f 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -51,6 +51,7 @@ struct gianfar_platform_data {
51 51
52 /* board specific information */ 52 /* board specific information */
53 u32 board_flags; 53 u32 board_flags;
54 u32 phy_flags;
54 u32 phyid; 55 u32 phyid;
55 u32 interruptPHY; 56 u32 interruptPHY;
56 u8 mac_addr[6]; 57 u8 mac_addr[6];
@@ -61,9 +62,14 @@ struct gianfar_platform_data {
61#define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002 62#define FSL_GIANFAR_DEV_HAS_COALESCE 0x00000002
62#define FSL_GIANFAR_DEV_HAS_RMON 0x00000004 63#define FSL_GIANFAR_DEV_HAS_RMON 0x00000004
63#define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008 64#define FSL_GIANFAR_DEV_HAS_MULTI_INTR 0x00000008
65#define FSL_GIANFAR_DEV_HAS_CSUM 0x00000010
66#define FSL_GIANFAR_DEV_HAS_VLAN 0x00000020
67#define FSL_GIANFAR_DEV_HAS_EXTENDED_HASH 0x00000040
68#define FSL_GIANFAR_DEV_HAS_PADDING 0x00000080
64 69
65/* Flags in gianfar_platform_data */ 70/* Flags in gianfar_platform_data */
66#define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* if not set use a timer */ 71#define FSL_GIANFAR_BRD_HAS_PHY_INTR 0x00000001 /* set or use a timer */
72#define FSL_GIANFAR_BRD_IS_REDUCED 0x00000002 /* Set if RGMII, RMII */
67 73
68struct fsl_i2c_platform_data { 74struct fsl_i2c_platform_data {
69 /* device specific information */ 75 /* device specific information */
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
index b1272f822cfa..cd623eccdbea 100644
--- a/include/linux/gameport.h
+++ b/include/linux/gameport.h
@@ -67,6 +67,8 @@ int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mo
67void gameport_close(struct gameport *gameport); 67void gameport_close(struct gameport *gameport);
68void gameport_rescan(struct gameport *gameport); 68void gameport_rescan(struct gameport *gameport);
69 69
70#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
71
70void __gameport_register_port(struct gameport *gameport, struct module *owner); 72void __gameport_register_port(struct gameport *gameport, struct module *owner);
71static inline void gameport_register_port(struct gameport *gameport) 73static inline void gameport_register_port(struct gameport *gameport)
72{ 74{
@@ -75,6 +77,29 @@ static inline void gameport_register_port(struct gameport *gameport)
75 77
76void gameport_unregister_port(struct gameport *gameport); 78void gameport_unregister_port(struct gameport *gameport);
77 79
80void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
81 __attribute__ ((format (printf, 2, 3)));
82
83#else
84
85static inline void gameport_register_port(struct gameport *gameport)
86{
87 return;
88}
89
90static inline void gameport_unregister_port(struct gameport *gameport)
91{
92 return;
93}
94
95static inline void gameport_set_phys(struct gameport *gameport,
96 const char *fmt, ...)
97{
98 return;
99}
100
101#endif
102
78static inline struct gameport *gameport_allocate_port(void) 103static inline struct gameport *gameport_allocate_port(void)
79{ 104{
80 struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL); 105 struct gameport *gameport = kcalloc(1, sizeof(struct gameport), GFP_KERNEL);
@@ -92,9 +117,6 @@ static inline void gameport_set_name(struct gameport *gameport, const char *name
92 strlcpy(gameport->name, name, sizeof(gameport->name)); 117 strlcpy(gameport->name, name, sizeof(gameport->name));
93} 118}
94 119
95void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
96 __attribute__ ((format (printf, 2, 3)));
97
98/* 120/*
99 * Use the following fucntions to manipulate gameport's per-port 121 * Use the following fucntions to manipulate gameport's per-port
100 * driver-specific data. 122 * driver-specific data.
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
new file mode 100644
index 000000000000..7fd0576a4454
--- /dev/null
+++ b/include/linux/genalloc.h
@@ -0,0 +1,40 @@
1/*
2 * Basic general purpose allocator for managing special purpose memory
3 * not managed by the regular kmalloc/kfree interface.
4 * Uses for this includes on-device special memory, uncached memory
5 * etc.
6 *
7 * This code is based on the buddy allocator found in the sym53c8xx_2
8 * driver, adapted for general purpose use.
9 *
10 * This source code is licensed under the GNU General Public License,
11 * Version 2. See the file COPYING for more details.
12 */
13
14#include <linux/spinlock.h>
15
16#define ALLOC_MIN_SHIFT 5 /* 32 bytes minimum */
17/*
18 * Link between free memory chunks of a given size.
19 */
20struct gen_pool_link {
21 struct gen_pool_link *next;
22};
23
24/*
25 * Memory pool descriptor.
26 */
27struct gen_pool {
28 spinlock_t lock;
29 unsigned long (*get_new_chunk)(struct gen_pool *);
30 struct gen_pool *next;
31 struct gen_pool_link *h;
32 unsigned long private;
33 int max_chunk_shift;
34};
35
36unsigned long gen_pool_alloc(struct gen_pool *poolp, int size);
37void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size);
38struct gen_pool *gen_pool_create(int nr_chunks, int max_chunk_shift,
39 unsigned long (*fp)(struct gen_pool *),
40 unsigned long data);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index af7407e8cfc5..8d6bf608b199 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -39,6 +39,7 @@ struct vm_area_struct;
39#define __GFP_COMP 0x4000u /* Add compound page metadata */ 39#define __GFP_COMP 0x4000u /* Add compound page metadata */
40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */ 40#define __GFP_ZERO 0x8000u /* Return zeroed page on success */
41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ 41#define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */
42#define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */
42 43
43#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 44#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
44#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) 45#define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1)
@@ -47,7 +48,7 @@ struct vm_area_struct;
47#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 48#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
48 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 49 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
49 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ 50 __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \
50 __GFP_NOMEMALLOC) 51 __GFP_NOMEMALLOC|__GFP_NORECLAIM)
51 52
52#define GFP_ATOMIC (__GFP_HIGH) 53#define GFP_ATOMIC (__GFP_HIGH)
53#define GFP_NOIO (__GFP_WAIT) 54#define GFP_NOIO (__GFP_WAIT)
@@ -132,5 +133,10 @@ extern void FASTCALL(free_cold_page(struct page *page));
132#define free_page(addr) free_pages((addr),0) 133#define free_page(addr) free_pages((addr),0)
133 134
134void page_alloc_init(void); 135void page_alloc_init(void);
136#ifdef CONFIG_NUMA
137void drain_remote_pages(void);
138#else
139static inline void drain_remote_pages(void) { };
140#endif
135 141
136#endif /* __LINUX_GFP_H */ 142#endif /* __LINUX_GFP_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index ebc712e91066..8336dba18971 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -43,13 +43,17 @@
43#define __IRQ_MASK(x) ((1UL << (x))-1) 43#define __IRQ_MASK(x) ((1UL << (x))-1)
44 44
45#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT) 45#define PREEMPT_MASK (__IRQ_MASK(PREEMPT_BITS) << PREEMPT_SHIFT)
46#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
47#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT) 46#define SOFTIRQ_MASK (__IRQ_MASK(SOFTIRQ_BITS) << SOFTIRQ_SHIFT)
47#define HARDIRQ_MASK (__IRQ_MASK(HARDIRQ_BITS) << HARDIRQ_SHIFT)
48 48
49#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT) 49#define PREEMPT_OFFSET (1UL << PREEMPT_SHIFT)
50#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT) 50#define SOFTIRQ_OFFSET (1UL << SOFTIRQ_SHIFT)
51#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT) 51#define HARDIRQ_OFFSET (1UL << HARDIRQ_SHIFT)
52 52
53#if PREEMPT_ACTIVE < (1 << (HARDIRQ_SHIFT + HARDIRQ_BITS))
54#error PREEMPT_ACTIVE is too low!
55#endif
56
53#define hardirq_count() (preempt_count() & HARDIRQ_MASK) 57#define hardirq_count() (preempt_count() & HARDIRQ_MASK)
54#define softirq_count() (preempt_count() & SOFTIRQ_MASK) 58#define softirq_count() (preempt_count() & SOFTIRQ_MASK)
55#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK)) 59#define irq_count() (preempt_count() & (HARDIRQ_MASK | SOFTIRQ_MASK))
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h
index 503194e62fe1..ed2927ef1ff7 100644
--- a/include/linux/hdlc.h
+++ b/include/linux/hdlc.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Generic HDLC support routines for Linux 2 * Generic HDLC support routines for Linux
3 * 3 *
4 * Copyright (C) 1999-2003 Krzysztof Halasa <khc@pm.waw.pl> 4 * Copyright (C) 1999-2005 Krzysztof Halasa <khc@pm.waw.pl>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify it 6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of version 2 of the GNU General Public License 7 * under the terms of version 2 of the GNU General Public License
@@ -41,6 +41,7 @@
41#define LMI_NONE 1 /* No LMI, all PVCs are static */ 41#define LMI_NONE 1 /* No LMI, all PVCs are static */
42#define LMI_ANSI 2 /* ANSI Annex D */ 42#define LMI_ANSI 2 /* ANSI Annex D */
43#define LMI_CCITT 3 /* ITU-T Annex A */ 43#define LMI_CCITT 3 /* ITU-T Annex A */
44#define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */
44 45
45#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ 46#define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */
46#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ 47#define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */
@@ -89,6 +90,7 @@ typedef struct pvc_device_struct {
89 unsigned int deleted: 1; 90 unsigned int deleted: 1;
90 unsigned int fecn: 1; 91 unsigned int fecn: 1;
91 unsigned int becn: 1; 92 unsigned int becn: 1;
93 unsigned int bandwidth; /* Cisco LMI reporting only */
92 }state; 94 }state;
93}pvc_device; 95}pvc_device;
94 96
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 6af1ae4a8211..f529d1442815 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -4,6 +4,7 @@
4#ifdef CONFIG_HUGETLB_PAGE 4#ifdef CONFIG_HUGETLB_PAGE
5 5
6#include <linux/mempolicy.h> 6#include <linux/mempolicy.h>
7#include <asm/tlbflush.h>
7 8
8struct ctl_table; 9struct ctl_table;
9 10
@@ -22,12 +23,6 @@ int hugetlb_report_meminfo(char *);
22int hugetlb_report_node_meminfo(int, char *); 23int hugetlb_report_node_meminfo(int, char *);
23int is_hugepage_mem_enough(size_t); 24int is_hugepage_mem_enough(size_t);
24unsigned long hugetlb_total_pages(void); 25unsigned long hugetlb_total_pages(void);
25struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
26 int write);
27struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
28 pmd_t *pmd, int write);
29int is_aligned_hugepage_range(unsigned long addr, unsigned long len);
30int pmd_huge(pmd_t pmd);
31struct page *alloc_huge_page(void); 26struct page *alloc_huge_page(void);
32void free_huge_page(struct page *); 27void free_huge_page(struct page *);
33 28
@@ -35,6 +30,17 @@ extern unsigned long max_huge_pages;
35extern const unsigned long hugetlb_zero, hugetlb_infinity; 30extern const unsigned long hugetlb_zero, hugetlb_infinity;
36extern int sysctl_hugetlb_shm_group; 31extern int sysctl_hugetlb_shm_group;
37 32
33/* arch callbacks */
34
35pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr);
36pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr);
37struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address,
38 int write);
39struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address,
40 pmd_t *pmd, int write);
41int is_aligned_hugepage_range(unsigned long addr, unsigned long len);
42int pmd_huge(pmd_t pmd);
43
38#ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE 44#ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE
39#define is_hugepage_only_range(mm, addr, len) 0 45#define is_hugepage_only_range(mm, addr, len) 0
40#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ 46#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \
@@ -48,6 +54,28 @@ extern int sysctl_hugetlb_shm_group;
48int prepare_hugepage_range(unsigned long addr, unsigned long len); 54int prepare_hugepage_range(unsigned long addr, unsigned long len);
49#endif 55#endif
50 56
57#ifndef ARCH_HAS_SETCLEAR_HUGE_PTE
58#define set_huge_pte_at(mm, addr, ptep, pte) set_pte_at(mm, addr, ptep, pte)
59#define huge_ptep_get_and_clear(mm, addr, ptep) ptep_get_and_clear(mm, addr, ptep)
60#else
61void set_huge_pte_at(struct mm_struct *mm, unsigned long addr,
62 pte_t *ptep, pte_t pte);
63pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr,
64 pte_t *ptep);
65#endif
66
67#ifndef ARCH_HAS_HUGETLB_PREFAULT_HOOK
68#define hugetlb_prefault_arch_hook(mm) do { } while (0)
69#else
70void hugetlb_prefault_arch_hook(struct mm_struct *mm);
71#endif
72
73#ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE
74#define hugetlb_clean_stale_pgtable(pte) BUG()
75#else
76void hugetlb_clean_stale_pgtable(pte_t *pte);
77#endif
78
51#else /* !CONFIG_HUGETLB_PAGE */ 79#else /* !CONFIG_HUGETLB_PAGE */
52 80
53static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) 81static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
diff --git a/include/linux/i2c-sysfs.h b/include/linux/i2c-sysfs.h
new file mode 100644
index 000000000000..d7bf6ce11679
--- /dev/null
+++ b/include/linux/i2c-sysfs.h
@@ -0,0 +1,36 @@
1/*
2 * i2c-sysfs.h - i2c chip driver sysfs defines
3 *
4 * Copyright (C) 2005 Yani Ioannou <yani.ioannou@gmail.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 */
20#ifndef _LINUX_I2C_SYSFS_H
21#define _LINUX_I2C_SYSFS_H
22
23struct sensor_device_attribute{
24 struct device_attribute dev_attr;
25 int index;
26};
27#define to_sensor_dev_attr(_dev_attr) \
28 container_of(_dev_attr, struct sensor_device_attribute, dev_attr)
29
30#define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \
31struct sensor_device_attribute sensor_dev_attr_##_name = { \
32 .dev_attr = __ATTR(_name,_mode,_show,_store), \
33 .index = _index, \
34}
35
36#endif /* _LINUX_I2C_SYSFS_H */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 9cfc0999becb..336d6e509f59 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -664,7 +664,6 @@ typedef struct ide_drive_s {
664 664
665 struct request *rq; /* current request */ 665 struct request *rq; /* current request */
666 struct ide_drive_s *next; /* circular list of hwgroup drives */ 666 struct ide_drive_s *next; /* circular list of hwgroup drives */
667 struct ide_driver_s *driver;/* (ide_driver_t *) */
668 void *driver_data; /* extra driver data */ 667 void *driver_data; /* extra driver data */
669 struct hd_driveid *id; /* drive model identification info */ 668 struct hd_driveid *id; /* drive model identification info */
670 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ 669 struct proc_dir_entry *proc; /* /proc/ide/ directory entry */
@@ -758,6 +757,8 @@ typedef struct ide_drive_s {
758 struct semaphore gendev_rel_sem; /* to deal with device release() */ 757 struct semaphore gendev_rel_sem; /* to deal with device release() */
759} ide_drive_t; 758} ide_drive_t;
760 759
760#define to_ide_device(dev)container_of(dev, ide_drive_t, gendev)
761
761#define IDE_CHIPSET_PCI_MASK \ 762#define IDE_CHIPSET_PCI_MASK \
762 ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) 763 ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx))
763#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) 764#define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1)
@@ -1086,28 +1087,20 @@ enum {
1086 */ 1087 */
1087typedef struct ide_driver_s { 1088typedef struct ide_driver_s {
1088 struct module *owner; 1089 struct module *owner;
1089 const char *name;
1090 const char *version; 1090 const char *version;
1091 u8 media; 1091 u8 media;
1092 unsigned busy : 1;
1093 unsigned supports_dsc_overlap : 1; 1092 unsigned supports_dsc_overlap : 1;
1094 int (*cleanup)(ide_drive_t *);
1095 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); 1093 ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t);
1096 int (*end_request)(ide_drive_t *, int, int); 1094 int (*end_request)(ide_drive_t *, int, int);
1097 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); 1095 ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8);
1098 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq); 1096 ide_startstop_t (*abort)(ide_drive_t *, struct request *rq);
1099 int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long); 1097 int (*ioctl)(ide_drive_t *, struct inode *, struct file *, unsigned int, unsigned long);
1100 ide_proc_entry_t *proc; 1098 ide_proc_entry_t *proc;
1101 int (*attach)(ide_drive_t *);
1102 void (*ata_prebuilder)(ide_drive_t *); 1099 void (*ata_prebuilder)(ide_drive_t *);
1103 void (*atapi_prebuilder)(ide_drive_t *); 1100 void (*atapi_prebuilder)(ide_drive_t *);
1104 struct device_driver gen_driver; 1101 struct device_driver gen_driver;
1105 struct list_head drives;
1106 struct list_head drivers;
1107} ide_driver_t; 1102} ide_driver_t;
1108 1103
1109#define DRIVER(drive) ((drive)->driver)
1110
1111int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); 1104int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long);
1112 1105
1113/* 1106/*
@@ -1328,8 +1321,6 @@ extern void ide_init_subdrivers(void);
1328 1321
1329void ide_init_disk(struct gendisk *, ide_drive_t *); 1322void ide_init_disk(struct gendisk *, ide_drive_t *);
1330 1323
1331extern int ata_attach(ide_drive_t *);
1332
1333extern int ideprobe_init(void); 1324extern int ideprobe_init(void);
1334 1325
1335extern void ide_scan_pcibus(int scan_direction) __init; 1326extern void ide_scan_pcibus(int scan_direction) __init;
@@ -1342,11 +1333,8 @@ extern void default_hwif_iops(ide_hwif_t *);
1342extern void default_hwif_mmiops(ide_hwif_t *); 1333extern void default_hwif_mmiops(ide_hwif_t *);
1343extern void default_hwif_transport(ide_hwif_t *); 1334extern void default_hwif_transport(ide_hwif_t *);
1344 1335
1345int ide_register_driver(ide_driver_t *driver); 1336void ide_register_subdriver(ide_drive_t *, ide_driver_t *);
1346void ide_unregister_driver(ide_driver_t *driver); 1337void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *);
1347int ide_register_subdriver(ide_drive_t *, ide_driver_t *);
1348int ide_unregister_subdriver (ide_drive_t *drive);
1349int ide_replace_subdriver(ide_drive_t *drive, const char *driver);
1350 1338
1351#define ON_BOARD 1 1339#define ON_BOARD 1
1352#define NEVER_BOARD 0 1340#define NEVER_BOARD 0
diff --git a/include/linux/if.h b/include/linux/if.h
index d73a9d62f208..ce627d9092ef 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -33,7 +33,7 @@
33#define IFF_LOOPBACK 0x8 /* is a loopback net */ 33#define IFF_LOOPBACK 0x8 /* is a loopback net */
34#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ 34#define IFF_POINTOPOINT 0x10 /* interface is has p-p link */
35#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ 35#define IFF_NOTRAILERS 0x20 /* avoid use of trailers */
36#define IFF_RUNNING 0x40 /* resources allocated */ 36#define IFF_RUNNING 0x40 /* interface running and carrier ok */
37#define IFF_NOARP 0x80 /* no ARP protocol */ 37#define IFF_NOARP 0x80 /* no ARP protocol */
38#define IFF_PROMISC 0x100 /* receive all packets */ 38#define IFF_PROMISC 0x100 /* receive all packets */
39#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ 39#define IFF_ALLMULTI 0x200 /* receive all multicast packets*/
diff --git a/include/linux/if_shaper.h b/include/linux/if_shaper.h
index 0485b256d043..004e6f09a6e2 100644
--- a/include/linux/if_shaper.h
+++ b/include/linux/if_shaper.h
@@ -23,7 +23,7 @@ struct shaper
23 __u32 shapeclock; 23 __u32 shapeclock;
24 unsigned long recovery; /* Time we can next clock a packet out on 24 unsigned long recovery; /* Time we can next clock a packet out on
25 an empty queue */ 25 an empty queue */
26 unsigned long locked; 26 struct semaphore sem;
27 struct net_device_stats stats; 27 struct net_device_stats stats;
28 struct net_device *dev; 28 struct net_device *dev;
29 int (*hard_start_xmit) (struct sk_buff *skb, 29 int (*hard_start_xmit) (struct sk_buff *skb,
@@ -38,7 +38,6 @@ struct shaper
38 int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh); 38 int (*hard_header_cache)(struct neighbour *neigh, struct hh_cache *hh);
39 void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr); 39 void (*header_cache_update)(struct hh_cache *hh, struct net_device *dev, unsigned char * haddr);
40 struct net_device_stats* (*get_stats)(struct net_device *dev); 40 struct net_device_stats* (*get_stats)(struct net_device *dev);
41 wait_queue_head_t wait_queue;
42 struct timer_list timer; 41 struct timer_list timer;
43}; 42};
44 43
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h
index a2b01e1e72f2..3fba9e2f5427 100644
--- a/include/linux/if_tr.h
+++ b/include/linux/if_tr.h
@@ -19,6 +19,8 @@
19#ifndef _LINUX_IF_TR_H 19#ifndef _LINUX_IF_TR_H
20#define _LINUX_IF_TR_H 20#define _LINUX_IF_TR_H
21 21
22#include <asm/byteorder.h> /* For __be16 */
23
22/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble 24/* IEEE 802.5 Token-Ring magic constants. The frame sizes omit the preamble
23 and FCS/CRC (frame check sequence). */ 25 and FCS/CRC (frame check sequence). */
24#define TR_ALEN 6 /* Octets in one token-ring addr */ 26#define TR_ALEN 6 /* Octets in one token-ring addr */
@@ -36,8 +38,8 @@ struct trh_hdr {
36 __u8 fc; /* frame control field */ 38 __u8 fc; /* frame control field */
37 __u8 daddr[TR_ALEN]; /* destination address */ 39 __u8 daddr[TR_ALEN]; /* destination address */
38 __u8 saddr[TR_ALEN]; /* source address */ 40 __u8 saddr[TR_ALEN]; /* source address */
39 __u16 rcf; /* route control field */ 41 __be16 rcf; /* route control field */
40 __u16 rseg[8]; /* routing registers */ 42 __be16 rseg[8]; /* routing registers */
41}; 43};
42 44
43#ifdef __KERNEL__ 45#ifdef __KERNEL__
@@ -55,7 +57,7 @@ struct trllc {
55 __u8 ssap; /* source SAP */ 57 __u8 ssap; /* source SAP */
56 __u8 llc; /* LLC control field */ 58 __u8 llc; /* LLC control field */
57 __u8 protid[3]; /* protocol id */ 59 __u8 protid[3]; /* protocol id */
58 __u16 ethertype; /* ether type field */ 60 __be16 ethertype; /* ether type field */
59}; 61};
60 62
61/* Token-Ring statistics collection data. */ 63/* Token-Ring statistics collection data. */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index 6fafb27877a7..7e1e15f934f3 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -29,6 +29,7 @@ struct ipv4_devconf
29 int no_xfrm; 29 int no_xfrm;
30 int no_policy; 30 int no_policy;
31 int force_igmp_version; 31 int force_igmp_version;
32 int promote_secondaries;
32 void *sysctl; 33 void *sysctl;
33}; 34};
34 35
@@ -71,6 +72,7 @@ struct in_device
71#define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects) 72#define IN_DEV_SEC_REDIRECTS(in_dev) (ipv4_devconf.secure_redirects || (in_dev)->cnf.secure_redirects)
72#define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag) 73#define IN_DEV_IDTAG(in_dev) ((in_dev)->cnf.tag)
73#define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id) 74#define IN_DEV_MEDIUM_ID(in_dev) ((in_dev)->cnf.medium_id)
75#define IN_DEV_PROMOTE_SECONDARIES(in_dev) (ipv4_devconf.promote_secondaries || (in_dev)->cnf.promote_secondaries)
74 76
75#define IN_DEV_RX_REDIRECTS(in_dev) \ 77#define IN_DEV_RX_REDIRECTS(in_dev) \
76 ((IN_DEV_FORWARD(in_dev) && \ 78 ((IN_DEV_FORWARD(in_dev) && \
diff --git a/include/linux/input.h b/include/linux/input.h
index 72731d7d189e..9d9598ed760d 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -1015,7 +1015,7 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min
1015 dev->absbit[LONG(axis)] |= BIT(axis); 1015 dev->absbit[LONG(axis)] |= BIT(axis);
1016} 1016}
1017 1017
1018extern struct class_simple *input_class; 1018extern struct class *input_class;
1019 1019
1020#endif 1020#endif
1021#endif 1021#endif
diff --git a/include/linux/ioc4.h b/include/linux/ioc4.h
new file mode 100644
index 000000000000..3dd18b785ebd
--- /dev/null
+++ b/include/linux/ioc4.h
@@ -0,0 +1,179 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
7 */
8
9#ifndef _LINUX_IOC4_H
10#define _LINUX_IOC4_H
11
12#include <linux/interrupt.h>
13
14/***************
15 * Definitions *
16 ***************/
17
18/* Miscellaneous values inherent to hardware */
19
20#define IOC4_EXTINT_COUNT_DIVISOR 520 /* PCI clocks per COUNT tick */
21
22/***********************************
23 * Structures needed by subdrivers *
24 ***********************************/
25
26/* This structure fully describes the IOC4 miscellaneous registers which
27 * appear at bar[0]+0x00000 through bar[0]+0x0005c. The corresponding
28 * PCI resource is managed by the main IOC4 driver because it contains
29 * registers of interest to many different IOC4 subdrivers.
30 */
31struct ioc4_misc_regs {
32 /* Miscellaneous IOC4 registers */
33 union ioc4_pci_err_addr_l {
34 uint32_t raw;
35 struct {
36 uint32_t valid:1; /* Address captured */
37 uint32_t master_id:4; /* Unit causing error
38 * 0/1: Serial port 0 TX/RX
39 * 2/3: Serial port 1 TX/RX
40 * 4/5: Serial port 2 TX/RX
41 * 6/7: Serial port 3 TX/RX
42 * 8: ATA/ATAPI
43 * 9-15: Undefined
44 */
45 uint32_t mul_err:1; /* Multiple errors occurred */
46 uint32_t addr:26; /* Bits 31-6 of error addr */
47 } fields;
48 } pci_err_addr_l;
49 uint32_t pci_err_addr_h; /* Bits 63-32 of error addr */
50 union ioc4_sio_int {
51 uint32_t raw;
52 struct {
53 uint8_t tx_mt:1; /* TX ring buffer empty */
54 uint8_t rx_full:1; /* RX ring buffer full */
55 uint8_t rx_high:1; /* RX high-water exceeded */
56 uint8_t rx_timer:1; /* RX timer has triggered */
57 uint8_t delta_dcd:1; /* DELTA_DCD seen */
58 uint8_t delta_cts:1; /* DELTA_CTS seen */
59 uint8_t intr_pass:1; /* Interrupt pass-through */
60 uint8_t tx_explicit:1; /* TX, MCW, or delay complete */
61 } fields[4];
62 } sio_ir; /* Serial interrupt state */
63 union ioc4_other_int {
64 uint32_t raw;
65 struct {
66 uint32_t ata_int:1; /* ATA port passthru */
67 uint32_t ata_memerr:1; /* ATA halted by mem error */
68 uint32_t memerr:4; /* Serial halted by mem err */
69 uint32_t kbd_int:1; /* kbd/mouse intr asserted */
70 uint32_t reserved:16; /* zero */
71 uint32_t rt_int:1; /* INT_OUT section latch */
72 uint32_t gen_int:8; /* Intr. from generic pins */
73 } fields;
74 } other_ir; /* Other interrupt state */
75 union ioc4_sio_int sio_ies; /* Serial interrupt enable set */
76 union ioc4_other_int other_ies; /* Other interrupt enable set */
77 union ioc4_sio_int sio_iec; /* Serial interrupt enable clear */
78 union ioc4_other_int other_iec; /* Other interrupt enable clear */
79 union ioc4_sio_cr {
80 uint32_t raw;
81 struct {
82 uint32_t cmd_pulse:4; /* Bytebus strobe width */
83 uint32_t arb_diag:3; /* PCI bus requester */
84 uint32_t sio_diag_idle:1; /* Active ser req? */
85 uint32_t ata_diag_idle:1; /* Active ATA req? */
86 uint32_t ata_diag_active:1; /* ATA req is winner */
87 uint32_t reserved:22; /* zero */
88 } fields;
89 } sio_cr;
90 uint32_t unused1;
91 union ioc4_int_out {
92 uint32_t raw;
93 struct {
94 uint32_t count:16; /* Period control */
95 uint32_t mode:3; /* Output signal shape */
96 uint32_t reserved:11; /* zero */
97 uint32_t diag:1; /* Timebase control */
98 uint32_t int_out:1; /* Current value */
99 } fields;
100 } int_out; /* External interrupt output control */
101 uint32_t unused2;
102 union ioc4_gpcr {
103 uint32_t raw;
104 struct {
105 uint32_t dir:8; /* Pin direction */
106 uint32_t edge:8; /* Edge/level mode */
107 uint32_t reserved1:4; /* zero */
108 uint32_t int_out_en:1; /* INT_OUT enable */
109 uint32_t reserved2:11; /* zero */
110 } fields;
111 } gpcr_s; /* Generic PIO control set */
112 union ioc4_gpcr gpcr_c; /* Generic PIO control clear */
113 union ioc4_gpdr {
114 uint32_t raw;
115 struct {
116 uint32_t gen_pin:8; /* State of pins */
117 uint32_t reserved:24;
118 } fields;
119 } gpdr; /* Generic PIO data */
120 uint32_t unused3;
121 union ioc4_gppr {
122 uint32_t raw;
123 struct {
124 uint32_t gen_pin:1; /* Single pin state */
125 uint32_t reserved:31;
126 } fields;
127 } gppr[8]; /* Generic PIO pins */
128};
129
130/* Masks for GPCR DIR pins */
131#define IOC4_GPCR_DIR_0 0x01 /* External interrupt output */
132#define IOC4_GPCR_DIR_1 0x02 /* External interrupt input */
133#define IOC4_GPCR_DIR_2 0x04
134#define IOC4_GPCR_DIR_3 0x08 /* Keyboard/mouse presence */
135#define IOC4_GPCR_DIR_4 0x10 /* Ser. port 0 xcvr select (0=232, 1=422) */
136#define IOC4_GPCR_DIR_5 0x20 /* Ser. port 1 xcvr select (0=232, 1=422) */
137#define IOC4_GPCR_DIR_6 0x40 /* Ser. port 2 xcvr select (0=232, 1=422) */
138#define IOC4_GPCR_DIR_7 0x80 /* Ser. port 3 xcvr select (0=232, 1=422) */
139
140/* Masks for GPCR EDGE pins */
141#define IOC4_GPCR_EDGE_0 0x01
142#define IOC4_GPCR_EDGE_1 0x02 /* External interrupt input */
143#define IOC4_GPCR_EDGE_2 0x04
144#define IOC4_GPCR_EDGE_3 0x08
145#define IOC4_GPCR_EDGE_4 0x10
146#define IOC4_GPCR_EDGE_5 0x20
147#define IOC4_GPCR_EDGE_6 0x40
148#define IOC4_GPCR_EDGE_7 0x80
149
150/* One of these per IOC4 */
151struct ioc4_driver_data {
152 struct list_head idd_list;
153 unsigned long idd_bar0;
154 struct pci_dev *idd_pdev;
155 const struct pci_device_id *idd_pci_id;
156 struct __iomem ioc4_misc_regs *idd_misc_regs;
157 unsigned long count_period;
158 void *idd_serial_data;
159};
160
161/* One per submodule */
162struct ioc4_submodule {
163 struct list_head is_list;
164 char *is_name;
165 struct module *is_owner;
166 int (*is_probe) (struct ioc4_driver_data *);
167 int (*is_remove) (struct ioc4_driver_data *);
168};
169
170#define IOC4_NUM_CARDS 8 /* max cards per partition */
171
172/**********************************
173 * Functions needed by submodules *
174 **********************************/
175
176extern int ioc4_register_submodule(struct ioc4_submodule *);
177extern void ioc4_unregister_submodule(struct ioc4_submodule *);
178
179#endif /* _LINUX_IOC4_H */
diff --git a/include/linux/ioc4_common.h b/include/linux/ioc4_common.h
deleted file mode 100644
index b03bcc46df55..000000000000
--- a/include/linux/ioc4_common.h
+++ /dev/null
@@ -1,21 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Copyright (c) 2005 Silicon Graphics, Inc. All Rights Reserved.
7 */
8
9#ifndef _LINUX_IOC4_COMMON_H
10#define _LINUX_IOC4_COMMON_H
11
12/* prototypes */
13
14int ioc4_serial_init(void);
15
16int ioc4_serial_attach_one(struct pci_dev *pdev, const struct
17 pci_device_id *pci_id);
18int ioc4_ide_attach_one(struct pci_dev *pdev, const struct
19 pci_device_id *pci_id);
20
21#endif /* _LINUX_IOC4_COMMON_H */
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 8438c68591f9..31e7cedd9f84 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -81,6 +81,7 @@
81#ifdef __KERNEL__ 81#ifdef __KERNEL__
82#include <linux/config.h> 82#include <linux/config.h>
83#include <linux/types.h> 83#include <linux/types.h>
84#include <net/request_sock.h>
84#include <net/sock.h> 85#include <net/sock.h>
85#include <linux/igmp.h> 86#include <linux/igmp.h>
86#include <net/flow.h> 87#include <net/flow.h>
@@ -107,6 +108,26 @@ struct ip_options {
107 108
108#define optlength(opt) (sizeof(struct ip_options) + opt->optlen) 109#define optlength(opt) (sizeof(struct ip_options) + opt->optlen)
109 110
111struct inet_request_sock {
112 struct request_sock req;
113 u32 loc_addr;
114 u32 rmt_addr;
115 u16 rmt_port;
116 u16 snd_wscale : 4,
117 rcv_wscale : 4,
118 tstamp_ok : 1,
119 sack_ok : 1,
120 wscale_ok : 1,
121 ecn_ok : 1,
122 acked : 1;
123 struct ip_options *opt;
124};
125
126static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
127{
128 return (struct inet_request_sock *)sk;
129}
130
110struct ipv6_pinfo; 131struct ipv6_pinfo;
111 132
112struct inet_sock { 133struct inet_sock {
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index ab0d0efbf240..6fcd6a0ade24 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -193,6 +193,19 @@ struct inet6_skb_parm {
193 193
194#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 194#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
195 195
196struct tcp6_request_sock {
197 struct tcp_request_sock req;
198 struct in6_addr loc_addr;
199 struct in6_addr rmt_addr;
200 struct sk_buff *pktopts;
201 int iif;
202};
203
204static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk)
205{
206 return (struct tcp6_request_sock *)sk;
207}
208
196/** 209/**
197 * struct ipv6_pinfo - ipv6 private area 210 * struct ipv6_pinfo - ipv6 private area
198 * 211 *
diff --git a/include/linux/irq.h b/include/linux/irq.h
index c3ff4d101667..7fc1022be9ee 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -47,6 +47,10 @@ struct hw_interrupt_type {
47 void (*ack)(unsigned int irq); 47 void (*ack)(unsigned int irq);
48 void (*end)(unsigned int irq); 48 void (*end)(unsigned int irq);
49 void (*set_affinity)(unsigned int irq, cpumask_t dest); 49 void (*set_affinity)(unsigned int irq, cpumask_t dest);
50 /* Currently used only by UML, might disappear one day.*/
51#ifdef CONFIG_IRQ_RELEASE_METHOD
52 void (*release)(unsigned int irq, void *dev_id);
53#endif
50}; 54};
51 55
52typedef struct hw_interrupt_type hw_irq_controller; 56typedef struct hw_interrupt_type hw_irq_controller;
diff --git a/include/linux/klist.h b/include/linux/klist.h
new file mode 100644
index 000000000000..eebf5e5696ec
--- /dev/null
+++ b/include/linux/klist.h
@@ -0,0 +1,55 @@
1/*
2 * klist.h - Some generic list helpers, extending struct list_head a bit.
3 *
4 * Implementations are found in lib/klist.c
5 *
6 *
7 * Copyright (C) 2005 Patrick Mochel
8 *
9 * This file is rleased under the GPL v2.
10 */
11
12#include <linux/spinlock.h>
13#include <linux/completion.h>
14#include <linux/kref.h>
15#include <linux/list.h>
16
17
18struct klist {
19 spinlock_t k_lock;
20 struct list_head k_list;
21};
22
23
24extern void klist_init(struct klist * k);
25
26
27struct klist_node {
28 struct klist * n_klist;
29 struct list_head n_node;
30 struct kref n_ref;
31 struct completion n_removed;
32};
33
34extern void klist_add_tail(struct klist * k, struct klist_node * n);
35extern void klist_add_head(struct klist * k, struct klist_node * n);
36
37extern void klist_del(struct klist_node * n);
38extern void klist_remove(struct klist_node * n);
39
40extern int klist_node_attached(struct klist_node * n);
41
42
43struct klist_iter {
44 struct klist * i_klist;
45 struct list_head * i_head;
46 struct klist_node * i_cur;
47};
48
49
50extern void klist_iter_init(struct klist * k, struct klist_iter * i);
51extern void klist_iter_init_node(struct klist * k, struct klist_iter * i,
52 struct klist_node * n);
53extern void klist_iter_exit(struct klist_iter * i);
54extern struct klist_node * klist_next(struct klist_iter * i);
55
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 765d660d3bea..3b22304f12fd 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -33,7 +33,7 @@
33extern u64 hotplug_seqnum; 33extern u64 hotplug_seqnum;
34 34
35struct kobject { 35struct kobject {
36 char * k_name; 36 const char * k_name;
37 char name[KOBJ_NAME_LEN]; 37 char name[KOBJ_NAME_LEN];
38 struct kref kref; 38 struct kref kref;
39 struct list_head entry; 39 struct list_head entry;
@@ -46,7 +46,7 @@ struct kobject {
46extern int kobject_set_name(struct kobject *, const char *, ...) 46extern int kobject_set_name(struct kobject *, const char *, ...)
47 __attribute__((format(printf,2,3))); 47 __attribute__((format(printf,2,3)));
48 48
49static inline char * kobject_name(struct kobject * kobj) 49static inline const char * kobject_name(const struct kobject * kobj)
50{ 50{
51 return kobj->k_name; 51 return kobj->k_name;
52} 52}
@@ -57,7 +57,7 @@ extern void kobject_cleanup(struct kobject *);
57extern int kobject_add(struct kobject *); 57extern int kobject_add(struct kobject *);
58extern void kobject_del(struct kobject *); 58extern void kobject_del(struct kobject *);
59 59
60extern int kobject_rename(struct kobject *, char *new_name); 60extern int kobject_rename(struct kobject *, const char *new_name);
61 61
62extern int kobject_register(struct kobject *); 62extern int kobject_register(struct kobject *);
63extern void kobject_unregister(struct kobject *); 63extern void kobject_unregister(struct kobject *);
@@ -94,7 +94,7 @@ struct kobj_type {
94 */ 94 */
95struct kset_hotplug_ops { 95struct kset_hotplug_ops {
96 int (*filter)(struct kset *kset, struct kobject *kobj); 96 int (*filter)(struct kset *kset, struct kobject *kobj);
97 char *(*name)(struct kset *kset, struct kobject *kobj); 97 const char *(*name)(struct kset *kset, struct kobject *kobj);
98 int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp, 98 int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp,
99 int num_envp, char *buffer, int buffer_size); 99 int num_envp, char *buffer, int buffer_size);
100}; 100};
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 1f7e2039a04e..6cd9ba63563b 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -410,6 +410,7 @@ extern u8 ata_chk_err(struct ata_port *ap);
410extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); 410extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf);
411extern int ata_port_start (struct ata_port *ap); 411extern int ata_port_start (struct ata_port *ap);
412extern void ata_port_stop (struct ata_port *ap); 412extern void ata_port_stop (struct ata_port *ap);
413extern void ata_host_stop (struct ata_host_set *host_set);
413extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); 414extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs);
414extern void ata_qc_prep(struct ata_queued_cmd *qc); 415extern void ata_qc_prep(struct ata_queued_cmd *qc);
415extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); 416extern int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -420,6 +421,7 @@ extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
420extern unsigned int ata_dev_classify(struct ata_taskfile *tf); 421extern unsigned int ata_dev_classify(struct ata_taskfile *tf);
421extern void ata_dev_id_string(u16 *id, unsigned char *s, 422extern void ata_dev_id_string(u16 *id, unsigned char *s,
422 unsigned int ofs, unsigned int len); 423 unsigned int ofs, unsigned int len);
424extern void ata_dev_config(struct ata_port *ap, unsigned int i);
423extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 425extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
424extern void ata_bmdma_start (struct ata_queued_cmd *qc); 426extern void ata_bmdma_start (struct ata_queued_cmd *qc);
425extern void ata_bmdma_stop(struct ata_port *ap); 427extern void ata_bmdma_stop(struct ata_port *ap);
@@ -466,12 +468,34 @@ static inline u8 ata_chk_status(struct ata_port *ap)
466 return ap->ops->check_status(ap); 468 return ap->ops->check_status(ap);
467} 469}
468 470
471
472/**
473 * ata_pause - Flush writes and pause 400 nanoseconds.
474 * @ap: Port to wait for.
475 *
476 * LOCKING:
477 * Inherited from caller.
478 */
479
469static inline void ata_pause(struct ata_port *ap) 480static inline void ata_pause(struct ata_port *ap)
470{ 481{
471 ata_altstatus(ap); 482 ata_altstatus(ap);
472 ndelay(400); 483 ndelay(400);
473} 484}
474 485
486
487/**
488 * ata_busy_wait - Wait for a port status register
489 * @ap: Port to wait for.
490 *
491 * Waits up to max*10 microseconds for the selected bits in the port's
492 * status register to be cleared.
493 * Returns final value of status register.
494 *
495 * LOCKING:
496 * Inherited from caller.
497 */
498
475static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, 499static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
476 unsigned int max) 500 unsigned int max)
477{ 501{
@@ -486,6 +510,18 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits,
486 return status; 510 return status;
487} 511}
488 512
513
514/**
515 * ata_wait_idle - Wait for a port to be idle.
516 * @ap: Port to wait for.
517 *
518 * Waits up to 10ms for port's BUSY and DRQ signals to clear.
519 * Returns final value of status register.
520 *
521 * LOCKING:
522 * Inherited from caller.
523 */
524
489static inline u8 ata_wait_idle(struct ata_port *ap) 525static inline u8 ata_wait_idle(struct ata_port *ap)
490{ 526{
491 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 527 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
@@ -524,6 +560,18 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns
524 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 560 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
525} 561}
526 562
563
564/**
565 * ata_irq_on - Enable interrupts on a port.
566 * @ap: Port on which interrupts are enabled.
567 *
568 * Enable interrupts on a legacy IDE device using MMIO or PIO,
569 * wait for idle, clear any pending interrupts.
570 *
571 * LOCKING:
572 * Inherited from caller.
573 */
574
527static inline u8 ata_irq_on(struct ata_port *ap) 575static inline u8 ata_irq_on(struct ata_port *ap)
528{ 576{
529 struct ata_ioports *ioaddr = &ap->ioaddr; 577 struct ata_ioports *ioaddr = &ap->ioaddr;
@@ -543,6 +591,18 @@ static inline u8 ata_irq_on(struct ata_port *ap)
543 return tmp; 591 return tmp;
544} 592}
545 593
594
595/**
596 * ata_irq_ack - Acknowledge a device interrupt.
597 * @ap: Port on which interrupts are enabled.
598 *
599 * Wait up to 10 ms for legacy IDE device to become idle (BUSY
600 * or BUSY+DRQ clear). Obtain dma status and port status from
601 * device. Clear the interrupt. Return port status.
602 *
603 * LOCKING:
604 */
605
546static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) 606static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
547{ 607{
548 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; 608 unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY;
diff --git a/include/linux/major.h b/include/linux/major.h
index 4b62c42b842c..e36a46702d94 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -100,6 +100,7 @@
100#define I2O_MAJOR 80 /* 80->87 */ 100#define I2O_MAJOR 80 /* 80->87 */
101 101
102#define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */ 102#define SHMIQ_MAJOR 85 /* Linux/mips, SGI /dev/shmiq */
103#define SCSI_CHANGER_MAJOR 86
103 104
104#define IDE6_MAJOR 88 105#define IDE6_MAJOR 88
105#define IDE7_MAJOR 89 106#define IDE7_MAJOR 89
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 20971fe78a8d..374b615ea9ea 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -65,9 +65,13 @@
65#define ADVERTISE_SLCT 0x001f /* Selector bits */ 65#define ADVERTISE_SLCT 0x001f /* Selector bits */
66#define ADVERTISE_CSMA 0x0001 /* Only selector supported */ 66#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
67#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ 67#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
68#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
68#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ 69#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
70#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
69#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ 71#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
72#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
70#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ 73#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
74#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
71#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ 75#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
72#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ 76#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
73#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ 77#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
@@ -84,9 +88,13 @@
84/* Link partner ability register. */ 88/* Link partner ability register. */
85#define LPA_SLCT 0x001f /* Same as advertise selector */ 89#define LPA_SLCT 0x001f /* Same as advertise selector */
86#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ 90#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
91#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
87#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ 92#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
93#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
88#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ 94#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
95#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
89#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ 96#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
97#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
90#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ 98#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
91#define LPA_PAUSE_CAP 0x0400 /* Can pause */ 99#define LPA_PAUSE_CAP 0x0400 /* Can pause */
92#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ 100#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 17518fe0b311..1813b162b0a8 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -691,6 +691,12 @@ extern void show_mem(void);
691extern void si_meminfo(struct sysinfo * val); 691extern void si_meminfo(struct sysinfo * val);
692extern void si_meminfo_node(struct sysinfo *val, int nid); 692extern void si_meminfo_node(struct sysinfo *val, int nid);
693 693
694#ifdef CONFIG_NUMA
695extern void setup_per_cpu_pageset(void);
696#else
697static inline void setup_per_cpu_pageset(void) {}
698#endif
699
694/* prio_tree.c */ 700/* prio_tree.c */
695void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); 701void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old);
696void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); 702void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index e530c6c092f1..4733d35d8223 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -63,6 +63,12 @@ struct per_cpu_pageset {
63#endif 63#endif
64} ____cacheline_aligned_in_smp; 64} ____cacheline_aligned_in_smp;
65 65
66#ifdef CONFIG_NUMA
67#define zone_pcp(__z, __cpu) ((__z)->pageset[(__cpu)])
68#else
69#define zone_pcp(__z, __cpu) (&(__z)->pageset[(__cpu)])
70#endif
71
66#define ZONE_DMA 0 72#define ZONE_DMA 0
67#define ZONE_NORMAL 1 73#define ZONE_NORMAL 1
68#define ZONE_HIGHMEM 2 74#define ZONE_HIGHMEM 2
@@ -122,8 +128,11 @@ struct zone {
122 */ 128 */
123 unsigned long lowmem_reserve[MAX_NR_ZONES]; 129 unsigned long lowmem_reserve[MAX_NR_ZONES];
124 130
131#ifdef CONFIG_NUMA
132 struct per_cpu_pageset *pageset[NR_CPUS];
133#else
125 struct per_cpu_pageset pageset[NR_CPUS]; 134 struct per_cpu_pageset pageset[NR_CPUS];
126 135#endif
127 /* 136 /*
128 * free areas of different sizes 137 * free areas of different sizes
129 */ 138 */
@@ -145,6 +154,14 @@ struct zone {
145 int all_unreclaimable; /* All pages pinned */ 154 int all_unreclaimable; /* All pages pinned */
146 155
147 /* 156 /*
157 * Does the allocator try to reclaim pages from the zone as soon
158 * as it fails a watermark_ok() in __alloc_pages?
159 */
160 int reclaim_pages;
161 /* A count of how many reclaimers are scanning this zone */
162 atomic_t reclaim_in_progress;
163
164 /*
148 * prev_priority holds the scanning priority for this zone. It is 165 * prev_priority holds the scanning priority for this zone. It is
149 * defined as the scanning priority at which we achieved our reclaim 166 * defined as the scanning priority at which we achieved our reclaim
150 * target at the previous try_to_free_pages() or balance_pgdat() 167 * target at the previous try_to_free_pages() or balance_pgdat()
@@ -381,7 +398,7 @@ int lowmem_reserve_ratio_sysctl_handler(struct ctl_table *, int, struct file *,
381 398
382#include <linux/topology.h> 399#include <linux/topology.h>
383/* Returns the number of the current Node. */ 400/* Returns the number of the current Node. */
384#define numa_node_id() (cpu_to_node(_smp_processor_id())) 401#define numa_node_id() (cpu_to_node(raw_smp_processor_id()))
385 402
386#ifndef CONFIG_DISCONTIGMEM 403#ifndef CONFIG_DISCONTIGMEM
387 404
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b25bd02720d3..ba5d1236aa17 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -204,7 +204,7 @@ struct hh_cache
204 /* cached hardware header; allow for machine alignment needs. */ 204 /* cached hardware header; allow for machine alignment needs. */
205#define HH_DATA_MOD 16 205#define HH_DATA_MOD 16
206#define HH_DATA_OFF(__len) \ 206#define HH_DATA_OFF(__len) \
207 (HH_DATA_MOD - ((__len) & (HH_DATA_MOD - 1))) 207 (HH_DATA_MOD - (((__len - 1) & (HH_DATA_MOD - 1)) + 1))
208#define HH_DATA_ALIGN(__len) \ 208#define HH_DATA_ALIGN(__len) \
209 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1)) 209 (((__len)+(HH_DATA_MOD-1))&~(HH_DATA_MOD - 1))
210 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 210 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
@@ -401,7 +401,7 @@ struct net_device
401 } reg_state; 401 } reg_state;
402 402
403 /* Net device features */ 403 /* Net device features */
404 int features; 404 unsigned long features;
405#define NETIF_F_SG 1 /* Scatter/gather IO. */ 405#define NETIF_F_SG 1 /* Scatter/gather IO. */
406#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ 406#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */
407#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ 407#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
@@ -913,6 +913,7 @@ extern void dev_mc_discard(struct net_device *dev);
913extern void dev_set_promiscuity(struct net_device *dev, int inc); 913extern void dev_set_promiscuity(struct net_device *dev, int inc);
914extern void dev_set_allmulti(struct net_device *dev, int inc); 914extern void dev_set_allmulti(struct net_device *dev, int inc);
915extern void netdev_state_change(struct net_device *dev); 915extern void netdev_state_change(struct net_device *dev);
916extern void netdev_features_change(struct net_device *dev);
916/* Load a device via the kmod */ 917/* Load a device via the kmod */
917extern void dev_load(const char *name); 918extern void dev_load(const char *name);
918extern void dev_mcast_init(void); 919extern void dev_mcast_init(void);
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 9e5750079e09..3ebc36afae1a 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -75,12 +75,6 @@ enum nf_ip_hook_priorities {
75#define SO_ORIGINAL_DST 80 75#define SO_ORIGINAL_DST 80
76 76
77#ifdef __KERNEL__ 77#ifdef __KERNEL__
78#ifdef CONFIG_NETFILTER_DEBUG
79void nf_debug_ip_local_deliver(struct sk_buff *skb);
80void nf_debug_ip_loopback_xmit(struct sk_buff *newskb);
81void nf_debug_ip_finish_output2(struct sk_buff *skb);
82#endif /*CONFIG_NETFILTER_DEBUG*/
83
84extern int ip_route_me_harder(struct sk_buff **pskb); 78extern int ip_route_me_harder(struct sk_buff **pskb);
85 79
86/* Call this before modifying an existing IP packet: ensures it is 80/* Call this before modifying an existing IP packet: ensures it is
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h
index d84be02cb4fc..694aec9b4784 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_core.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h
@@ -1,7 +1,6 @@
1#ifndef _IP_CONNTRACK_CORE_H 1#ifndef _IP_CONNTRACK_CORE_H
2#define _IP_CONNTRACK_CORE_H 2#define _IP_CONNTRACK_CORE_H
3#include <linux/netfilter.h> 3#include <linux/netfilter.h>
4#include <linux/netfilter_ipv4/lockhelp.h>
5 4
6/* This header is used to share core functionality between the 5/* This header is used to share core functionality between the
7 standalone connection tracking module, and the compatibility layer's use 6 standalone connection tracking module, and the compatibility layer's use
@@ -47,6 +46,6 @@ static inline int ip_conntrack_confirm(struct sk_buff **pskb)
47 46
48extern struct list_head *ip_conntrack_hash; 47extern struct list_head *ip_conntrack_hash;
49extern struct list_head ip_conntrack_expect_list; 48extern struct list_head ip_conntrack_expect_list;
50DECLARE_RWLOCK_EXTERN(ip_conntrack_lock); 49extern rwlock_t ip_conntrack_lock;
51#endif /* _IP_CONNTRACK_CORE_H */ 50#endif /* _IP_CONNTRACK_CORE_H */
52 51
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h
index 2b72b86176f0..e201ec6e9905 100644
--- a/include/linux/netfilter_ipv4/ip_nat.h
+++ b/include/linux/netfilter_ipv4/ip_nat.h
@@ -50,10 +50,9 @@ struct ip_nat_multi_range_compat
50 50
51#ifdef __KERNEL__ 51#ifdef __KERNEL__
52#include <linux/list.h> 52#include <linux/list.h>
53#include <linux/netfilter_ipv4/lockhelp.h>
54 53
55/* Protects NAT hash tables, and NAT-private part of conntracks. */ 54/* Protects NAT hash tables, and NAT-private part of conntracks. */
56DECLARE_RWLOCK_EXTERN(ip_nat_lock); 55extern rwlock_t ip_nat_lock;
57 56
58/* The structure embedded in the conntrack structure. */ 57/* The structure embedded in the conntrack structure. */
59struct ip_nat_info 58struct ip_nat_info
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h
index f2ae7c5e57bb..360429f48737 100644
--- a/include/linux/netfilter_ipv4/listhelp.h
+++ b/include/linux/netfilter_ipv4/listhelp.h
@@ -2,7 +2,6 @@
2#define _LISTHELP_H 2#define _LISTHELP_H
3#include <linux/config.h> 3#include <linux/config.h>
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/netfilter_ipv4/lockhelp.h>
6 5
7/* Header to do more comprehensive job than linux/list.h; assume list 6/* Header to do more comprehensive job than linux/list.h; assume list
8 is first entry in structure. */ 7 is first entry in structure. */
diff --git a/include/linux/netfilter_ipv4/lockhelp.h b/include/linux/netfilter_ipv4/lockhelp.h
deleted file mode 100644
index a3288633ab46..000000000000
--- a/include/linux/netfilter_ipv4/lockhelp.h
+++ /dev/null
@@ -1,129 +0,0 @@
1#ifndef _LOCKHELP_H
2#define _LOCKHELP_H
3#include <linux/config.h>
4
5#include <linux/spinlock.h>
6#include <asm/atomic.h>
7#include <linux/interrupt.h>
8#include <linux/smp.h>
9
10/* Header to do help in lock debugging. */
11
12#ifdef CONFIG_NETFILTER_DEBUG
13struct spinlock_debug
14{
15 spinlock_t l;
16 atomic_t locked_by;
17};
18
19struct rwlock_debug
20{
21 rwlock_t l;
22 long read_locked_map;
23 long write_locked_map;
24};
25
26#define DECLARE_LOCK(l) \
27struct spinlock_debug l = { SPIN_LOCK_UNLOCKED, ATOMIC_INIT(-1) }
28#define DECLARE_LOCK_EXTERN(l) \
29extern struct spinlock_debug l
30#define DECLARE_RWLOCK(l) \
31struct rwlock_debug l = { RW_LOCK_UNLOCKED, 0, 0 }
32#define DECLARE_RWLOCK_EXTERN(l) \
33extern struct rwlock_debug l
34
35#define MUST_BE_LOCKED(l) \
36do { if (atomic_read(&(l)->locked_by) != smp_processor_id()) \
37 printk("ASSERT %s:%u %s unlocked\n", __FILE__, __LINE__, #l); \
38} while(0)
39
40#define MUST_BE_UNLOCKED(l) \
41do { if (atomic_read(&(l)->locked_by) == smp_processor_id()) \
42 printk("ASSERT %s:%u %s locked\n", __FILE__, __LINE__, #l); \
43} while(0)
44
45/* Write locked OK as well. */
46#define MUST_BE_READ_LOCKED(l) \
47do { if (!((l)->read_locked_map & (1UL << smp_processor_id())) \
48 && !((l)->write_locked_map & (1UL << smp_processor_id()))) \
49 printk("ASSERT %s:%u %s not readlocked\n", __FILE__, __LINE__, #l); \
50} while(0)
51
52#define MUST_BE_WRITE_LOCKED(l) \
53do { if (!((l)->write_locked_map & (1UL << smp_processor_id()))) \
54 printk("ASSERT %s:%u %s not writelocked\n", __FILE__, __LINE__, #l); \
55} while(0)
56
57#define MUST_BE_READ_WRITE_UNLOCKED(l) \
58do { if ((l)->read_locked_map & (1UL << smp_processor_id())) \
59 printk("ASSERT %s:%u %s readlocked\n", __FILE__, __LINE__, #l); \
60 else if ((l)->write_locked_map & (1UL << smp_processor_id())) \
61 printk("ASSERT %s:%u %s writelocked\n", __FILE__, __LINE__, #l); \
62} while(0)
63
64#define LOCK_BH(lk) \
65do { \
66 MUST_BE_UNLOCKED(lk); \
67 spin_lock_bh(&(lk)->l); \
68 atomic_set(&(lk)->locked_by, smp_processor_id()); \
69} while(0)
70
71#define UNLOCK_BH(lk) \
72do { \
73 MUST_BE_LOCKED(lk); \
74 atomic_set(&(lk)->locked_by, -1); \
75 spin_unlock_bh(&(lk)->l); \
76} while(0)
77
78#define READ_LOCK(lk) \
79do { \
80 MUST_BE_READ_WRITE_UNLOCKED(lk); \
81 read_lock_bh(&(lk)->l); \
82 set_bit(smp_processor_id(), &(lk)->read_locked_map); \
83} while(0)
84
85#define WRITE_LOCK(lk) \
86do { \
87 MUST_BE_READ_WRITE_UNLOCKED(lk); \
88 write_lock_bh(&(lk)->l); \
89 set_bit(smp_processor_id(), &(lk)->write_locked_map); \
90} while(0)
91
92#define READ_UNLOCK(lk) \
93do { \
94 if (!((lk)->read_locked_map & (1UL << smp_processor_id()))) \
95 printk("ASSERT: %s:%u %s not readlocked\n", \
96 __FILE__, __LINE__, #lk); \
97 clear_bit(smp_processor_id(), &(lk)->read_locked_map); \
98 read_unlock_bh(&(lk)->l); \
99} while(0)
100
101#define WRITE_UNLOCK(lk) \
102do { \
103 MUST_BE_WRITE_LOCKED(lk); \
104 clear_bit(smp_processor_id(), &(lk)->write_locked_map); \
105 write_unlock_bh(&(lk)->l); \
106} while(0)
107
108#else
109#define DECLARE_LOCK(l) spinlock_t l = SPIN_LOCK_UNLOCKED
110#define DECLARE_LOCK_EXTERN(l) extern spinlock_t l
111#define DECLARE_RWLOCK(l) rwlock_t l = RW_LOCK_UNLOCKED
112#define DECLARE_RWLOCK_EXTERN(l) extern rwlock_t l
113
114#define MUST_BE_LOCKED(l)
115#define MUST_BE_UNLOCKED(l)
116#define MUST_BE_READ_LOCKED(l)
117#define MUST_BE_WRITE_LOCKED(l)
118#define MUST_BE_READ_WRITE_UNLOCKED(l)
119
120#define LOCK_BH(l) spin_lock_bh(l)
121#define UNLOCK_BH(l) spin_unlock_bh(l)
122
123#define READ_LOCK(l) read_lock_bh(l)
124#define WRITE_LOCK(l) write_lock_bh(l)
125#define READ_UNLOCK(l) read_unlock_bh(l)
126#define WRITE_UNLOCK(l) write_unlock_bh(l)
127#endif /*CONFIG_NETFILTER_DEBUG*/
128
129#endif /* _LOCKHELP_H */
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index b2738ac8bc99..3029cad63a01 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -14,6 +14,7 @@
14#define NETLINK_SELINUX 7 /* SELinux event notifications */ 14#define NETLINK_SELINUX 7 /* SELinux event notifications */
15#define NETLINK_ARPD 8 15#define NETLINK_ARPD 8
16#define NETLINK_AUDIT 9 /* auditing */ 16#define NETLINK_AUDIT 9 /* auditing */
17#define NETLINK_FIB_LOOKUP 10
17#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */ 18#define NETLINK_ROUTE6 11 /* af_inet6 route comm channel */
18#define NETLINK_IP6_FW 13 19#define NETLINK_IP6_FW 13
19#define NETLINK_DNRTMSG 14 /* DECnet routing messages */ 20#define NETLINK_DNRTMSG 14 /* DECnet routing messages */
@@ -146,7 +147,7 @@ struct netlink_callback
146 int (*dump)(struct sk_buff * skb, struct netlink_callback *cb); 147 int (*dump)(struct sk_buff * skb, struct netlink_callback *cb);
147 int (*done)(struct netlink_callback *cb); 148 int (*done)(struct netlink_callback *cb);
148 int family; 149 int family;
149 long args[4]; 150 long args[5];
150}; 151};
151 152
152struct netlink_notify 153struct netlink_notify
@@ -156,7 +157,7 @@ struct netlink_notify
156}; 157};
157 158
158static __inline__ struct nlmsghdr * 159static __inline__ struct nlmsghdr *
159__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len) 160__nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
160{ 161{
161 struct nlmsghdr *nlh; 162 struct nlmsghdr *nlh;
162 int size = NLMSG_LENGTH(len); 163 int size = NLMSG_LENGTH(len);
@@ -164,15 +165,31 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len)
164 nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size)); 165 nlh = (struct nlmsghdr*)skb_put(skb, NLMSG_ALIGN(size));
165 nlh->nlmsg_type = type; 166 nlh->nlmsg_type = type;
166 nlh->nlmsg_len = size; 167 nlh->nlmsg_len = size;
167 nlh->nlmsg_flags = 0; 168 nlh->nlmsg_flags = flags;
168 nlh->nlmsg_pid = pid; 169 nlh->nlmsg_pid = pid;
169 nlh->nlmsg_seq = seq; 170 nlh->nlmsg_seq = seq;
170 return nlh; 171 return nlh;
171} 172}
172 173
174#define NLMSG_NEW(skb, pid, seq, type, len, flags) \
175({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) \
176 goto nlmsg_failure; \
177 __nlmsg_put(skb, pid, seq, type, len, flags); })
178
173#define NLMSG_PUT(skb, pid, seq, type, len) \ 179#define NLMSG_PUT(skb, pid, seq, type, len) \
174({ if (skb_tailroom(skb) < (int)NLMSG_SPACE(len)) goto nlmsg_failure; \ 180 NLMSG_NEW(skb, pid, seq, type, len, 0)
175 __nlmsg_put(skb, pid, seq, type, len); }) 181
182#define NLMSG_NEW_ANSWER(skb, cb, type, len, flags) \
183 NLMSG_NEW(skb, NETLINK_CB((cb)->skb).pid, \
184 (cb)->nlh->nlmsg_seq, type, len, flags)
185
186#define NLMSG_END(skb, nlh) \
187({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \
188 (skb)->len; })
189
190#define NLMSG_CANCEL(skb, nlh) \
191({ skb_trim(skb, (unsigned char *) (nlh) - (skb)->data); \
192 -1; })
176 193
177extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 194extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
178 struct nlmsghdr *nlh, 195 struct nlmsghdr *nlh,
diff --git a/include/linux/node.h b/include/linux/node.h
index 6e0a697e594e..254dc3de650b 100644
--- a/include/linux/node.h
+++ b/include/linux/node.h
@@ -27,6 +27,7 @@ struct node {
27}; 27};
28 28
29extern int register_node(struct node *, int, struct node *); 29extern int register_node(struct node *, int, struct node *);
30extern void unregister_node(struct node *node);
30 31
31#define to_node(sys_device) container_of(sys_device, struct node, sysdev) 32#define to_node(sys_device) container_of(sys_device, struct node, sysdev)
32 33
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 9303a003e9ab..5937dd6053c3 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -56,6 +56,7 @@ extern int notifier_call_chain(struct notifier_block **n, unsigned long val, voi
56#define NETDEV_CHANGEADDR 0x0008 56#define NETDEV_CHANGEADDR 0x0008
57#define NETDEV_GOING_DOWN 0x0009 57#define NETDEV_GOING_DOWN 0x0009
58#define NETDEV_CHANGENAME 0x000A 58#define NETDEV_CHANGENAME 0x000A
59#define NETDEV_FEAT_CHANGE 0x000B
59 60
60#define SYS_DOWN 0x0001 /* Notify of system down */ 61#define SYS_DOWN 0x0001 /* Notify of system down */
61#define SYS_RESTART SYS_DOWN 62#define SYS_RESTART SYS_DOWN
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 39ab8c6b5652..f5a6695d4d21 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -61,21 +61,20 @@
61#define PG_active 6 61#define PG_active 6
62#define PG_slab 7 /* slab debug (Suparna wants this) */ 62#define PG_slab 7 /* slab debug (Suparna wants this) */
63 63
64#define PG_highmem 8 64#define PG_checked 8 /* kill me in 2.5.<early>. */
65#define PG_checked 9 /* kill me in 2.5.<early>. */ 65#define PG_arch_1 9
66#define PG_arch_1 10 66#define PG_reserved 10
67#define PG_reserved 11 67#define PG_private 11 /* Has something at ->private */
68 68
69#define PG_private 12 /* Has something at ->private */ 69#define PG_writeback 12 /* Page is under writeback */
70#define PG_writeback 13 /* Page is under writeback */ 70#define PG_nosave 13 /* Used for system suspend/resume */
71#define PG_nosave 14 /* Used for system suspend/resume */ 71#define PG_compound 14 /* Part of a compound page */
72#define PG_compound 15 /* Part of a compound page */ 72#define PG_swapcache 15 /* Swap page: swp_entry_t in private */
73 73
74#define PG_swapcache 16 /* Swap page: swp_entry_t in private */ 74#define PG_mappedtodisk 16 /* Has blocks allocated on-disk */
75#define PG_mappedtodisk 17 /* Has blocks allocated on-disk */ 75#define PG_reclaim 17 /* To be reclaimed asap */
76#define PG_reclaim 18 /* To be reclaimed asap */ 76#define PG_nosave_free 18 /* Free, should not be written */
77#define PG_nosave_free 19 /* Free, should not be written */ 77#define PG_uncached 19 /* Page has been mapped as uncached */
78#define PG_uncached 20 /* Page has been mapped as uncached */
79 78
80/* 79/*
81 * Global page accounting. One instance per CPU. Only unsigned longs are 80 * Global page accounting. One instance per CPU. Only unsigned longs are
@@ -136,8 +135,8 @@ struct page_state {
136 135
137extern void get_page_state(struct page_state *ret); 136extern void get_page_state(struct page_state *ret);
138extern void get_full_page_state(struct page_state *ret); 137extern void get_full_page_state(struct page_state *ret);
139extern unsigned long __read_page_state(unsigned offset); 138extern unsigned long __read_page_state(unsigned long offset);
140extern void __mod_page_state(unsigned offset, unsigned long delta); 139extern void __mod_page_state(unsigned long offset, unsigned long delta);
141 140
142#define read_page_state(member) \ 141#define read_page_state(member) \
143 __read_page_state(offsetof(struct page_state, member)) 142 __read_page_state(offsetof(struct page_state, member))
@@ -215,7 +214,7 @@ extern void __mod_page_state(unsigned offset, unsigned long delta);
215#define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) 214#define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags)
216 215
217#ifdef CONFIG_HIGHMEM 216#ifdef CONFIG_HIGHMEM
218#define PageHighMem(page) test_bit(PG_highmem, &(page)->flags) 217#define PageHighMem(page) is_highmem(page_zone(page))
219#else 218#else
220#define PageHighMem(page) 0 /* needed to optimize away at compile time */ 219#define PageHighMem(page) 0 /* needed to optimize away at compile time */
221#endif 220#endif
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 0422031161ba..d9a25647a295 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -52,12 +52,12 @@ void release_pages(struct page **pages, int nr, int cold);
52 52
53static inline struct page *page_cache_alloc(struct address_space *x) 53static inline struct page *page_cache_alloc(struct address_space *x)
54{ 54{
55 return alloc_pages(mapping_gfp_mask(x), 0); 55 return alloc_pages(mapping_gfp_mask(x)|__GFP_NORECLAIM, 0);
56} 56}
57 57
58static inline struct page *page_cache_alloc_cold(struct address_space *x) 58static inline struct page *page_cache_alloc_cold(struct address_space *x)
59{ 59{
60 return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD, 0); 60 return alloc_pages(mapping_gfp_mask(x)|__GFP_COLD|__GFP_NORECLAIM, 0);
61} 61}
62 62
63typedef int filler_t(void *, struct page *); 63typedef int filler_t(void *, struct page *);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 7b9720e35361..63e89e47b8e9 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -575,6 +575,7 @@
575#define PCI_DEVICE_ID_CT_65550 0x00e0 575#define PCI_DEVICE_ID_CT_65550 0x00e0
576#define PCI_DEVICE_ID_CT_65554 0x00e4 576#define PCI_DEVICE_ID_CT_65554 0x00e4
577#define PCI_DEVICE_ID_CT_65555 0x00e5 577#define PCI_DEVICE_ID_CT_65555 0x00e5
578#define PCI_DEVICE_ID_CT_69000 0x00c0
578 579
579#define PCI_VENDOR_ID_MIRO 0x1031 580#define PCI_VENDOR_ID_MIRO 0x1031
580#define PCI_DEVICE_ID_MIRO_36050 0x5601 581#define PCI_DEVICE_ID_MIRO_36050 0x5601
@@ -874,6 +875,7 @@
874#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026 875#define PCI_DEVICE_ID_APPLE_KL_USB_P 0x0026
875#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027 876#define PCI_DEVICE_ID_APPLE_UNI_N_AGP_P 0x0027
876#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d 877#define PCI_DEVICE_ID_APPLE_UNI_N_AGP15 0x002d
878#define PCI_DEVICE_ID_APPLE_UNI_N_PCI15 0x002e
877#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030 879#define PCI_DEVICE_ID_APPLE_UNI_N_FW2 0x0030
878#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032 880#define PCI_DEVICE_ID_APPLE_UNI_N_GMAC2 0x0032
879#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033 881#define PCI_DEVIEC_ID_APPLE_UNI_N_ATA 0x0033
@@ -1230,6 +1232,12 @@
1230#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258 1232#define PCI_DEVICE_ID_NVIDIA_QUADRO4_900XGL 0x0258
1231#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259 1233#define PCI_DEVICE_ID_NVIDIA_QUADRO4_750XGL 0x0259
1232#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B 1234#define PCI_DEVICE_ID_NVIDIA_QUADRO4_700XGL 0x025B
1235#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_IDE 0x0265
1236#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266
1237#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267
1238#define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268
1239#define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269
1240#define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B
1233#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 1241#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280
1234#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 1242#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281
1235#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 1243#define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282
@@ -2071,6 +2079,7 @@
2071#define PCI_DEVICE_ID_TIGON3_5703 0x1647 2079#define PCI_DEVICE_ID_TIGON3_5703 0x1647
2072#define PCI_DEVICE_ID_TIGON3_5704 0x1648 2080#define PCI_DEVICE_ID_TIGON3_5704 0x1648
2073#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649 2081#define PCI_DEVICE_ID_TIGON3_5704S_2 0x1649
2082#define PCI_DEVICE_ID_NX2_5706 0x164a
2074#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d 2083#define PCI_DEVICE_ID_TIGON3_5702FE 0x164d
2075#define PCI_DEVICE_ID_TIGON3_5705 0x1653 2084#define PCI_DEVICE_ID_TIGON3_5705 0x1653
2076#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 2085#define PCI_DEVICE_ID_TIGON3_5705_2 0x1654
@@ -2090,6 +2099,7 @@
2090#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 2099#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
2091#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 2100#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
2092#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 2101#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2102#define PCI_DEVICE_ID_NX2_5706S 0x16aa
2093#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 2103#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
2094#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 2104#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
2095#define PCI_DEVICE_ID_TIGON3_5781 0x16dd 2105#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
@@ -2374,6 +2384,8 @@
2374#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 2384#define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582
2375#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 2385#define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590
2376#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592 2386#define PCI_DEVICE_ID_INTEL_82915GM_IG 0x2592
2387#define PCI_DEVICE_ID_INTEL_82945G_HB 0x2770
2388#define PCI_DEVICE_ID_INTEL_82945G_IG 0x2772
2377#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 2389#define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640
2378#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 2390#define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641
2379#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642 2391#define PCI_DEVICE_ID_INTEL_ICH6_2 0x2642
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index e6b519220245..724066778aff 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -245,6 +245,7 @@ struct sadb_x_nat_t_port {
245 245
246/* Security Association flags */ 246/* Security Association flags */
247#define SADB_SAFLAGS_PFS 1 247#define SADB_SAFLAGS_PFS 1
248#define SADB_SAFLAGS_NOPMTUDISC 0x20000000
248#define SADB_SAFLAGS_DECAP_DSCP 0x40000000 249#define SADB_SAFLAGS_DECAP_DSCP 0x40000000
249#define SADB_SAFLAGS_NOECN 0x80000000 250#define SADB_SAFLAGS_NOECN 0x80000000
250 251
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index 73d84c071cb1..1d9da36eb9db 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -427,6 +427,7 @@ enum
427 TCA_NETEM_UNSPEC, 427 TCA_NETEM_UNSPEC,
428 TCA_NETEM_CORR, 428 TCA_NETEM_CORR,
429 TCA_NETEM_DELAY_DIST, 429 TCA_NETEM_DELAY_DIST,
430 TCA_NETEM_REORDER,
430 __TCA_NETEM_MAX, 431 __TCA_NETEM_MAX,
431}; 432};
432 433
@@ -437,7 +438,7 @@ struct tc_netem_qopt
437 __u32 latency; /* added delay (us) */ 438 __u32 latency; /* added delay (us) */
438 __u32 limit; /* fifo limit (packets) */ 439 __u32 limit; /* fifo limit (packets) */
439 __u32 loss; /* random packet loss (0=none ~0=100%) */ 440 __u32 loss; /* random packet loss (0=none ~0=100%) */
440 __u32 gap; /* re-ordering gap (0 for delay all) */ 441 __u32 gap; /* re-ordering gap (0 for none) */
441 __u32 duplicate; /* random packet dup (0=none ~0=100%) */ 442 __u32 duplicate; /* random packet dup (0=none ~0=100%) */
442 __u32 jitter; /* random jitter in latency (us) */ 443 __u32 jitter; /* random jitter in latency (us) */
443}; 444};
@@ -449,6 +450,12 @@ struct tc_netem_corr
449 __u32 dup_corr; /* duplicate correlation */ 450 __u32 dup_corr; /* duplicate correlation */
450}; 451};
451 452
453struct tc_netem_reorder
454{
455 __u32 probability;
456 __u32 correlation;
457};
458
452#define NETEM_DIST_SCALE 8192 459#define NETEM_DIST_SCALE 8192
453 460
454#endif 461#endif
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
new file mode 100644
index 000000000000..e24b74b11150
--- /dev/null
+++ b/include/linux/raid/bitmap.h
@@ -0,0 +1,273 @@
1/*
2 * bitmap.h: Copyright (C) Peter T. Breuer (ptb@ot.uc3m.es) 2003
3 *
4 * additions: Copyright (C) 2003-2004, Paul Clements, SteelEye Technology, Inc.
5 */
6#ifndef BITMAP_H
7#define BITMAP_H 1
8
9#define BITMAP_MAJOR 3
10#define BITMAP_MINOR 38
11
12/*
13 * in-memory bitmap:
14 *
15 * Use 16 bit block counters to track pending writes to each "chunk".
16 * The 2 high order bits are special-purpose, the first is a flag indicating
17 * whether a resync is needed. The second is a flag indicating whether a
18 * resync is active.
19 * This means that the counter is actually 14 bits:
20 *
21 * +--------+--------+------------------------------------------------+
22 * | resync | resync | counter |
23 * | needed | active | |
24 * | (0-1) | (0-1) | (0-16383) |
25 * +--------+--------+------------------------------------------------+
26 *
27 * The "resync needed" bit is set when:
28 * a '1' bit is read from storage at startup.
29 * a write request fails on some drives
30 * a resync is aborted on a chunk with 'resync active' set
31 * It is cleared (and resync-active set) when a resync starts across all drives
32 * of the chunk.
33 *
34 *
35 * The "resync active" bit is set when:
36 * a resync is started on all drives, and resync_needed is set.
37 * resync_needed will be cleared (as long as resync_active wasn't already set).
38 * It is cleared when a resync completes.
39 *
40 * The counter counts pending write requests, plus the on-disk bit.
41 * When the counter is '1' and the resync bits are clear, the on-disk
42 * bit can be cleared aswell, thus setting the counter to 0.
43 * When we set a bit, or in the counter (to start a write), if the fields is
44 * 0, we first set the disk bit and set the counter to 1.
45 *
46 * If the counter is 0, the on-disk bit is clear and the stipe is clean
47 * Anything that dirties the stipe pushes the counter to 2 (at least)
48 * and sets the on-disk bit (lazily).
49 * If a periodic sweep find the counter at 2, it is decremented to 1.
50 * If the sweep find the counter at 1, the on-disk bit is cleared and the
51 * counter goes to zero.
52 *
53 * Also, we'll hijack the "map" pointer itself and use it as two 16 bit block
54 * counters as a fallback when "page" memory cannot be allocated:
55 *
56 * Normal case (page memory allocated):
57 *
58 * page pointer (32-bit)
59 *
60 * [ ] ------+
61 * |
62 * +-------> [ ][ ]..[ ] (4096 byte page == 2048 counters)
63 * c1 c2 c2048
64 *
65 * Hijacked case (page memory allocation failed):
66 *
67 * hijacked page pointer (32-bit)
68 *
69 * [ ][ ] (no page memory allocated)
70 * counter #1 (16-bit) counter #2 (16-bit)
71 *
72 */
73
74#ifdef __KERNEL__
75
76#define PAGE_BITS (PAGE_SIZE << 3)
77#define PAGE_BIT_SHIFT (PAGE_SHIFT + 3)
78
79typedef __u16 bitmap_counter_t;
80#define COUNTER_BITS 16
81#define COUNTER_BIT_SHIFT 4
82#define COUNTER_BYTE_RATIO (COUNTER_BITS / 8)
83#define COUNTER_BYTE_SHIFT (COUNTER_BIT_SHIFT - 3)
84
85#define NEEDED_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 1)))
86#define RESYNC_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 2)))
87#define COUNTER_MAX ((bitmap_counter_t) RESYNC_MASK - 1)
88#define NEEDED(x) (((bitmap_counter_t) x) & NEEDED_MASK)
89#define RESYNC(x) (((bitmap_counter_t) x) & RESYNC_MASK)
90#define COUNTER(x) (((bitmap_counter_t) x) & COUNTER_MAX)
91
92/* how many counters per page? */
93#define PAGE_COUNTER_RATIO (PAGE_BITS / COUNTER_BITS)
94/* same, except a shift value for more efficient bitops */
95#define PAGE_COUNTER_SHIFT (PAGE_BIT_SHIFT - COUNTER_BIT_SHIFT)
96/* same, except a mask value for more efficient bitops */
97#define PAGE_COUNTER_MASK (PAGE_COUNTER_RATIO - 1)
98
99#define BITMAP_BLOCK_SIZE 512
100#define BITMAP_BLOCK_SHIFT 9
101
102/* how many blocks per chunk? (this is variable) */
103#define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->chunksize >> BITMAP_BLOCK_SHIFT)
104#define CHUNK_BLOCK_SHIFT(bitmap) ((bitmap)->chunkshift - BITMAP_BLOCK_SHIFT)
105#define CHUNK_BLOCK_MASK(bitmap) (CHUNK_BLOCK_RATIO(bitmap) - 1)
106
107/* when hijacked, the counters and bits represent even larger "chunks" */
108/* there will be 1024 chunks represented by each counter in the page pointers */
109#define PAGEPTR_BLOCK_RATIO(bitmap) \
110 (CHUNK_BLOCK_RATIO(bitmap) << PAGE_COUNTER_SHIFT >> 1)
111#define PAGEPTR_BLOCK_SHIFT(bitmap) \
112 (CHUNK_BLOCK_SHIFT(bitmap) + PAGE_COUNTER_SHIFT - 1)
113#define PAGEPTR_BLOCK_MASK(bitmap) (PAGEPTR_BLOCK_RATIO(bitmap) - 1)
114
115/*
116 * on-disk bitmap:
117 *
118 * Use one bit per "chunk" (block set). We do the disk I/O on the bitmap
119 * file a page at a time. There's a superblock at the start of the file.
120 */
121
122/* map chunks (bits) to file pages - offset by the size of the superblock */
123#define CHUNK_BIT_OFFSET(chunk) ((chunk) + (sizeof(bitmap_super_t) << 3))
124
125#endif
126
127/*
128 * bitmap structures:
129 */
130
131#define BITMAP_MAGIC 0x6d746962
132
133/* use these for bitmap->flags and bitmap->sb->state bit-fields */
134enum bitmap_state {
135 BITMAP_ACTIVE = 0x001, /* the bitmap is in use */
136 BITMAP_STALE = 0x002 /* the bitmap file is out of date or had -EIO */
137};
138
139/* the superblock at the front of the bitmap file -- little endian */
140typedef struct bitmap_super_s {
141 __u32 magic; /* 0 BITMAP_MAGIC */
142 __u32 version; /* 4 the bitmap major for now, could change... */
143 __u8 uuid[16]; /* 8 128 bit uuid - must match md device uuid */
144 __u64 events; /* 24 event counter for the bitmap (1)*/
145 __u64 events_cleared;/*32 event counter when last bit cleared (2) */
146 __u64 sync_size; /* 40 the size of the md device's sync range(3) */
147 __u32 state; /* 48 bitmap state information */
148 __u32 chunksize; /* 52 the bitmap chunk size in bytes */
149 __u32 daemon_sleep; /* 56 seconds between disk flushes */
150
151 __u8 pad[256 - 60]; /* set to zero */
152} bitmap_super_t;
153
154/* notes:
155 * (1) This event counter is updated before the eventcounter in the md superblock
156 * When a bitmap is loaded, it is only accepted if this event counter is equal
157 * to, or one greater than, the event counter in the superblock.
158 * (2) This event counter is updated when the other one is *if*and*only*if* the
159 * array is not degraded. As bits are not cleared when the array is degraded,
160 * this represents the last time that any bits were cleared.
161 * If a device is being added that has an event count with this value or
162 * higher, it is accepted as conforming to the bitmap.
163 * (3)This is the number of sectors represented by the bitmap, and is the range that
164 * resync happens across. For raid1 and raid5/6 it is the size of individual
165 * devices. For raid10 it is the size of the array.
166 */
167
168#ifdef __KERNEL__
169
170/* the in-memory bitmap is represented by bitmap_pages */
171struct bitmap_page {
172 /*
173 * map points to the actual memory page
174 */
175 char *map;
176 /*
177 * in emergencies (when map cannot be alloced), hijack the map
178 * pointer and use it as two counters itself
179 */
180 unsigned int hijacked:1;
181 /*
182 * count of dirty bits on the page
183 */
184 unsigned int count:31;
185};
186
187/* keep track of bitmap file pages that have pending writes on them */
188struct page_list {
189 struct list_head list;
190 struct page *page;
191};
192
193/* the main bitmap structure - one per mddev */
194struct bitmap {
195 struct bitmap_page *bp;
196 unsigned long pages; /* total number of pages in the bitmap */
197 unsigned long missing_pages; /* number of pages not yet allocated */
198
199 mddev_t *mddev; /* the md device that the bitmap is for */
200
201 int counter_bits; /* how many bits per block counter */
202
203 /* bitmap chunksize -- how much data does each bit represent? */
204 unsigned long chunksize;
205 unsigned long chunkshift; /* chunksize = 2^chunkshift (for bitops) */
206 unsigned long chunks; /* total number of data chunks for the array */
207
208 /* We hold a count on the chunk currently being synced, and drop
209 * it when the last block is started. If the resync is aborted
210 * midway, we need to be able to drop that count, so we remember
211 * the counted chunk..
212 */
213 unsigned long syncchunk;
214
215 __u64 events_cleared;
216
217 /* bitmap spinlock */
218 spinlock_t lock;
219
220 long offset; /* offset from superblock if file is NULL */
221 struct file *file; /* backing disk file */
222 struct page *sb_page; /* cached copy of the bitmap file superblock */
223 struct page **filemap; /* list of cache pages for the file */
224 unsigned long *filemap_attr; /* attributes associated w/ filemap pages */
225 unsigned long file_pages; /* number of pages in the file */
226
227 unsigned long flags;
228
229 /*
230 * the bitmap daemon - periodically wakes up and sweeps the bitmap
231 * file, cleaning up bits and flushing out pages to disk as necessary
232 */
233 unsigned long daemon_lastrun; /* jiffies of last run */
234 unsigned long daemon_sleep; /* how many seconds between updates? */
235
236 /*
237 * bitmap_writeback_daemon waits for file-pages that have been written,
238 * as there is no way to get a call-back when a page write completes.
239 */
240 mdk_thread_t *writeback_daemon;
241 spinlock_t write_lock;
242 wait_queue_head_t write_wait;
243 struct list_head complete_pages;
244 mempool_t *write_pool;
245};
246
247/* the bitmap API */
248
249/* these are used only by md/bitmap */
250int bitmap_create(mddev_t *mddev);
251void bitmap_destroy(mddev_t *mddev);
252int bitmap_active(struct bitmap *bitmap);
253
254char *file_path(struct file *file, char *buf, int count);
255void bitmap_print_sb(struct bitmap *bitmap);
256int bitmap_update_sb(struct bitmap *bitmap);
257
258int bitmap_setallbits(struct bitmap *bitmap);
259void bitmap_write_all(struct bitmap *bitmap);
260
261/* these are exported */
262int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors);
263void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors,
264 int success);
265int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks);
266void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
267void bitmap_close_sync(struct bitmap *bitmap);
268
269int bitmap_unplug(struct bitmap *bitmap);
270int bitmap_daemon_work(struct bitmap *bitmap);
271#endif
272
273#endif
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index a6a67d102bfa..ffa316ce4dc8 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -60,7 +60,14 @@
60 */ 60 */
61#define MD_MAJOR_VERSION 0 61#define MD_MAJOR_VERSION 0
62#define MD_MINOR_VERSION 90 62#define MD_MINOR_VERSION 90
63#define MD_PATCHLEVEL_VERSION 1 63/*
64 * MD_PATCHLEVEL_VERSION indicates kernel functionality.
65 * >=1 means different superblock formats are selectable using SET_ARRAY_INFO
66 * and major_version/minor_version accordingly
67 * >=2 means that Internal bitmaps are supported by setting MD_SB_BITMAP_PRESENT
68 * in the super status byte
69 */
70#define MD_PATCHLEVEL_VERSION 2
64 71
65extern int register_md_personality (int p_num, mdk_personality_t *p); 72extern int register_md_personality (int p_num, mdk_personality_t *p);
66extern int unregister_md_personality (int p_num); 73extern int unregister_md_personality (int p_num);
@@ -69,7 +76,7 @@ extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev),
69extern void md_unregister_thread (mdk_thread_t *thread); 76extern void md_unregister_thread (mdk_thread_t *thread);
70extern void md_wakeup_thread(mdk_thread_t *thread); 77extern void md_wakeup_thread(mdk_thread_t *thread);
71extern void md_check_recovery(mddev_t *mddev); 78extern void md_check_recovery(mddev_t *mddev);
72extern void md_write_start(mddev_t *mddev); 79extern void md_write_start(mddev_t *mddev, struct bio *bi);
73extern void md_write_end(mddev_t *mddev); 80extern void md_write_end(mddev_t *mddev);
74extern void md_handle_safemode(mddev_t *mddev); 81extern void md_handle_safemode(mddev_t *mddev);
75extern void md_done_sync(mddev_t *mddev, int blocks, int ok); 82extern void md_done_sync(mddev_t *mddev, int blocks, int ok);
@@ -78,6 +85,12 @@ extern void md_unplug_mddev(mddev_t *mddev);
78 85
79extern void md_print_devices (void); 86extern void md_print_devices (void);
80 87
88extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev,
89 sector_t sector, int size, struct page *page);
90extern int sync_page_io(struct block_device *bdev, sector_t sector, int size,
91 struct page *page, int rw);
92
93
81#define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); } 94#define MD_BUG(x...) { printk("md: bug in file %s, line %d\n", __FILE__, __LINE__); md_print_devices(); }
82 95
83#endif 96#endif
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index c9a0d4013be7..8c14ba565a45 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -15,6 +15,9 @@
15#ifndef _MD_K_H 15#ifndef _MD_K_H
16#define _MD_K_H 16#define _MD_K_H
17 17
18/* and dm-bio-list.h is not under include/linux because.... ??? */
19#include "../../../drivers/md/dm-bio-list.h"
20
18#define MD_RESERVED 0UL 21#define MD_RESERVED 0UL
19#define LINEAR 1UL 22#define LINEAR 1UL
20#define RAID0 2UL 23#define RAID0 2UL
@@ -180,6 +183,10 @@ struct mdk_rdev_s
180 183
181 int desc_nr; /* descriptor index in the superblock */ 184 int desc_nr; /* descriptor index in the superblock */
182 int raid_disk; /* role of device in array */ 185 int raid_disk; /* role of device in array */
186 int saved_raid_disk; /* role that device used to have in the
187 * array and could again if we did a partial
188 * resync from the bitmap
189 */
183 190
184 atomic_t nr_pending; /* number of pending requests. 191 atomic_t nr_pending; /* number of pending requests.
185 * only maintained for arrays that 192 * only maintained for arrays that
@@ -252,6 +259,11 @@ struct mddev_s
252 atomic_t recovery_active; /* blocks scheduled, but not written */ 259 atomic_t recovery_active; /* blocks scheduled, but not written */
253 wait_queue_head_t recovery_wait; 260 wait_queue_head_t recovery_wait;
254 sector_t recovery_cp; 261 sector_t recovery_cp;
262
263 spinlock_t write_lock;
264 wait_queue_head_t sb_wait; /* for waiting on superblock updates */
265 atomic_t pending_writes; /* number of active superblock writes */
266
255 unsigned int safemode; /* if set, update "clean" superblock 267 unsigned int safemode; /* if set, update "clean" superblock
256 * when no writes pending. 268 * when no writes pending.
257 */ 269 */
@@ -260,6 +272,13 @@ struct mddev_s
260 atomic_t writes_pending; 272 atomic_t writes_pending;
261 request_queue_t *queue; /* for plugging ... */ 273 request_queue_t *queue; /* for plugging ... */
262 274
275 struct bitmap *bitmap; /* the bitmap for the device */
276 struct file *bitmap_file; /* the bitmap file */
277 long bitmap_offset; /* offset from superblock of
278 * start of bitmap. May be
279 * negative, but not '0'
280 */
281
263 struct list_head all_mddevs; 282 struct list_head all_mddevs;
264}; 283};
265 284
@@ -291,7 +310,7 @@ struct mdk_personality_s
291 int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev); 310 int (*hot_add_disk) (mddev_t *mddev, mdk_rdev_t *rdev);
292 int (*hot_remove_disk) (mddev_t *mddev, int number); 311 int (*hot_remove_disk) (mddev_t *mddev, int number);
293 int (*spare_active) (mddev_t *mddev); 312 int (*spare_active) (mddev_t *mddev);
294 int (*sync_request)(mddev_t *mddev, sector_t sector_nr, int go_faster); 313 sector_t (*sync_request)(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster);
295 int (*resize) (mddev_t *mddev, sector_t sectors); 314 int (*resize) (mddev_t *mddev, sector_t sectors);
296 int (*reshape) (mddev_t *mddev, int raid_disks); 315 int (*reshape) (mddev_t *mddev, int raid_disks);
297 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size); 316 int (*reconfig) (mddev_t *mddev, int layout, int chunk_size);
@@ -334,6 +353,7 @@ typedef struct mdk_thread_s {
334 unsigned long flags; 353 unsigned long flags;
335 struct completion *event; 354 struct completion *event;
336 struct task_struct *tsk; 355 struct task_struct *tsk;
356 unsigned long timeout;
337 const char *name; 357 const char *name;
338} mdk_thread_t; 358} mdk_thread_t;
339 359
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 8ba95d67329f..dc65cd435494 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -96,6 +96,7 @@ typedef struct mdp_device_descriptor_s {
96#define MD_SB_CLEAN 0 96#define MD_SB_CLEAN 0
97#define MD_SB_ERRORS 1 97#define MD_SB_ERRORS 1
98 98
99#define MD_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */
99typedef struct mdp_superblock_s { 100typedef struct mdp_superblock_s {
100 /* 101 /*
101 * Constant generic information 102 * Constant generic information
@@ -184,7 +185,7 @@ struct mdp_superblock_1 {
184 /* constant array information - 128 bytes */ 185 /* constant array information - 128 bytes */
185 __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */ 186 __u32 magic; /* MD_SB_MAGIC: 0xa92b4efc - little endian */
186 __u32 major_version; /* 1 */ 187 __u32 major_version; /* 1 */
187 __u32 feature_map; /* 0 for now */ 188 __u32 feature_map; /* bit 0 set if 'bitmap_offset' is meaningful */
188 __u32 pad0; /* always set to 0 when writing */ 189 __u32 pad0; /* always set to 0 when writing */
189 190
190 __u8 set_uuid[16]; /* user-space generated. */ 191 __u8 set_uuid[16]; /* user-space generated. */
@@ -197,7 +198,11 @@ struct mdp_superblock_1 {
197 198
198 __u32 chunksize; /* in 512byte sectors */ 199 __u32 chunksize; /* in 512byte sectors */
199 __u32 raid_disks; 200 __u32 raid_disks;
200 __u8 pad1[128-96]; /* set to 0 when written */ 201 __u32 bitmap_offset; /* sectors after start of superblock that bitmap starts
202 * NOTE: signed, so bitmap can be before superblock
203 * only meaningful of feature_map[0] is set.
204 */
205 __u8 pad1[128-100]; /* set to 0 when written */
201 206
202 /* constant this-device information - 64 bytes */ 207 /* constant this-device information - 64 bytes */
203 __u64 data_offset; /* sector start of data, often 0 */ 208 __u64 data_offset; /* sector start of data, often 0 */
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h
index a2df5c2a42af..81da20ccec4d 100644
--- a/include/linux/raid/md_u.h
+++ b/include/linux/raid/md_u.h
@@ -23,6 +23,7 @@
23#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t) 23#define GET_DISK_INFO _IOR (MD_MAJOR, 0x12, mdu_disk_info_t)
24#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13) 24#define PRINT_RAID_DEBUG _IO (MD_MAJOR, 0x13)
25#define RAID_AUTORUN _IO (MD_MAJOR, 0x14) 25#define RAID_AUTORUN _IO (MD_MAJOR, 0x14)
26#define GET_BITMAP_FILE _IOR (MD_MAJOR, 0x15, mdu_bitmap_file_t)
26 27
27/* configuration */ 28/* configuration */
28#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20) 29#define CLEAR_ARRAY _IO (MD_MAJOR, 0x20)
@@ -36,6 +37,7 @@
36#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28) 37#define HOT_ADD_DISK _IO (MD_MAJOR, 0x28)
37#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29) 38#define SET_DISK_FAULTY _IO (MD_MAJOR, 0x29)
38#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a) 39#define HOT_GENERATE_ERROR _IO (MD_MAJOR, 0x2a)
40#define SET_BITMAP_FILE _IOW (MD_MAJOR, 0x2b, int)
39 41
40/* usage */ 42/* usage */
41#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) 43#define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t)
@@ -106,6 +108,11 @@ typedef struct mdu_start_info_s {
106 108
107} mdu_start_info_t; 109} mdu_start_info_t;
108 110
111typedef struct mdu_bitmap_file_s
112{
113 char pathname[4096];
114} mdu_bitmap_file_t;
115
109typedef struct mdu_param_s 116typedef struct mdu_param_s
110{ 117{
111 int personality; /* 1,2,3,4 */ 118 int personality; /* 1,2,3,4 */
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index abbfdd9afe1e..9d93cf12e890 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -36,12 +36,21 @@ struct r1_private_data_s {
36 spinlock_t device_lock; 36 spinlock_t device_lock;
37 37
38 struct list_head retry_list; 38 struct list_head retry_list;
39 /* queue pending writes and submit them on unplug */
40 struct bio_list pending_bio_list;
41 /* queue of writes that have been unplugged */
42 struct bio_list flushing_bio_list;
43
39 /* for use when syncing mirrors: */ 44 /* for use when syncing mirrors: */
40 45
41 spinlock_t resync_lock; 46 spinlock_t resync_lock;
42 int nr_pending; 47 int nr_pending;
43 int barrier; 48 int barrier;
44 sector_t next_resync; 49 sector_t next_resync;
50 int fullsync; /* set to 1 if a full sync is needed,
51 * (fresh device added).
52 * Cleared when a sync completes.
53 */
45 54
46 wait_queue_head_t wait_idle; 55 wait_queue_head_t wait_idle;
47 wait_queue_head_t wait_resume; 56 wait_queue_head_t wait_resume;
@@ -85,14 +94,17 @@ struct r1bio_s {
85 int read_disk; 94 int read_disk;
86 95
87 struct list_head retry_list; 96 struct list_head retry_list;
97 struct bitmap_update *bitmap_update;
88 /* 98 /*
89 * if the IO is in WRITE direction, then multiple bios are used. 99 * if the IO is in WRITE direction, then multiple bios are used.
90 * We choose the number when they are allocated. 100 * We choose the number when they are allocated.
91 */ 101 */
92 struct bio *bios[0]; 102 struct bio *bios[0];
103 /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/
93}; 104};
94 105
95/* bits for r1bio.state */ 106/* bits for r1bio.state */
96#define R1BIO_Uptodate 0 107#define R1BIO_Uptodate 0
97#define R1BIO_IsSync 1 108#define R1BIO_IsSync 1
109#define R1BIO_Degraded 2
98#endif 110#endif
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 91ac97c20777..e68dbf0bf579 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -89,6 +89,13 @@ enum {
89 RTM_GETANYCAST = 62, 89 RTM_GETANYCAST = 62,
90#define RTM_GETANYCAST RTM_GETANYCAST 90#define RTM_GETANYCAST RTM_GETANYCAST
91 91
92 RTM_NEWNEIGHTBL = 64,
93#define RTM_NEWNEIGHTBL RTM_NEWNEIGHTBL
94 RTM_GETNEIGHTBL = 66,
95#define RTM_GETNEIGHTBL RTM_GETNEIGHTBL
96 RTM_SETNEIGHTBL,
97#define RTM_SETNEIGHTBL RTM_SETNEIGHTBL
98
92 __RTM_MAX, 99 __RTM_MAX,
93#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) 100#define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1)
94}; 101};
@@ -493,6 +500,106 @@ struct nda_cacheinfo
493 __u32 ndm_refcnt; 500 __u32 ndm_refcnt;
494}; 501};
495 502
503
504/*****************************************************************
505 * Neighbour tables specific messages.
506 *
507 * To retrieve the neighbour tables send RTM_GETNEIGHTBL with the
508 * NLM_F_DUMP flag set. Every neighbour table configuration is
509 * spread over multiple messages to avoid running into message
510 * size limits on systems with many interfaces. The first message
511 * in the sequence transports all not device specific data such as
512 * statistics, configuration, and the default parameter set.
513 * This message is followed by 0..n messages carrying device
514 * specific parameter sets.
515 * Although the ordering should be sufficient, NDTA_NAME can be
516 * used to identify sequences. The initial message can be identified
517 * by checking for NDTA_CONFIG. The device specific messages do
518 * not contain this TLV but have NDTPA_IFINDEX set to the
519 * corresponding interface index.
520 *
521 * To change neighbour table attributes, send RTM_SETNEIGHTBL
522 * with NDTA_NAME set. Changeable attribute include NDTA_THRESH[1-3],
523 * NDTA_GC_INTERVAL, and all TLVs in NDTA_PARMS unless marked
524 * otherwise. Device specific parameter sets can be changed by
525 * setting NDTPA_IFINDEX to the interface index of the corresponding
526 * device.
527 ****/
528
529struct ndt_stats
530{
531 __u64 ndts_allocs;
532 __u64 ndts_destroys;
533 __u64 ndts_hash_grows;
534 __u64 ndts_res_failed;
535 __u64 ndts_lookups;
536 __u64 ndts_hits;
537 __u64 ndts_rcv_probes_mcast;
538 __u64 ndts_rcv_probes_ucast;
539 __u64 ndts_periodic_gc_runs;
540 __u64 ndts_forced_gc_runs;
541};
542
543enum {
544 NDTPA_UNSPEC,
545 NDTPA_IFINDEX, /* u32, unchangeable */
546 NDTPA_REFCNT, /* u32, read-only */
547 NDTPA_REACHABLE_TIME, /* u64, read-only, msecs */
548 NDTPA_BASE_REACHABLE_TIME, /* u64, msecs */
549 NDTPA_RETRANS_TIME, /* u64, msecs */
550 NDTPA_GC_STALETIME, /* u64, msecs */
551 NDTPA_DELAY_PROBE_TIME, /* u64, msecs */
552 NDTPA_QUEUE_LEN, /* u32 */
553 NDTPA_APP_PROBES, /* u32 */
554 NDTPA_UCAST_PROBES, /* u32 */
555 NDTPA_MCAST_PROBES, /* u32 */
556 NDTPA_ANYCAST_DELAY, /* u64, msecs */
557 NDTPA_PROXY_DELAY, /* u64, msecs */
558 NDTPA_PROXY_QLEN, /* u32 */
559 NDTPA_LOCKTIME, /* u64, msecs */
560 __NDTPA_MAX
561};
562#define NDTPA_MAX (__NDTPA_MAX - 1)
563
564struct ndtmsg
565{
566 __u8 ndtm_family;
567 __u8 ndtm_pad1;
568 __u16 ndtm_pad2;
569};
570
571struct ndt_config
572{
573 __u16 ndtc_key_len;
574 __u16 ndtc_entry_size;
575 __u32 ndtc_entries;
576 __u32 ndtc_last_flush; /* delta to now in msecs */
577 __u32 ndtc_last_rand; /* delta to now in msecs */
578 __u32 ndtc_hash_rnd;
579 __u32 ndtc_hash_mask;
580 __u32 ndtc_hash_chain_gc;
581 __u32 ndtc_proxy_qlen;
582};
583
584enum {
585 NDTA_UNSPEC,
586 NDTA_NAME, /* char *, unchangeable */
587 NDTA_THRESH1, /* u32 */
588 NDTA_THRESH2, /* u32 */
589 NDTA_THRESH3, /* u32 */
590 NDTA_CONFIG, /* struct ndt_config, read-only */
591 NDTA_PARMS, /* nested TLV NDTPA_* */
592 NDTA_STATS, /* struct ndt_stats, read-only */
593 NDTA_GC_INTERVAL, /* u64, msecs */
594 __NDTA_MAX
595};
596#define NDTA_MAX (__NDTA_MAX - 1)
597
598#define NDTA_RTA(r) ((struct rtattr*)(((char*)(r)) + \
599 NLMSG_ALIGN(sizeof(struct ndtmsg))))
600#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
601
602
496/**** 603/****
497 * General form of address family dependent message. 604 * General form of address family dependent message.
498 ****/ 605 ****/
@@ -789,6 +896,75 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
789({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \ 896({ if (unlikely(skb_tailroom(skb) < (int)(attrlen))) \
790 goto rtattr_failure; \ 897 goto rtattr_failure; \
791 memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); }) 898 memcpy(skb_put(skb, RTA_ALIGN(attrlen)), data, attrlen); })
899
900#define RTA_PUT_U8(skb, attrtype, value) \
901({ u8 _tmp = (value); \
902 RTA_PUT(skb, attrtype, sizeof(u8), &_tmp); })
903
904#define RTA_PUT_U16(skb, attrtype, value) \
905({ u16 _tmp = (value); \
906 RTA_PUT(skb, attrtype, sizeof(u16), &_tmp); })
907
908#define RTA_PUT_U32(skb, attrtype, value) \
909({ u32 _tmp = (value); \
910 RTA_PUT(skb, attrtype, sizeof(u32), &_tmp); })
911
912#define RTA_PUT_U64(skb, attrtype, value) \
913({ u64 _tmp = (value); \
914 RTA_PUT(skb, attrtype, sizeof(u64), &_tmp); })
915
916#define RTA_PUT_SECS(skb, attrtype, value) \
917 RTA_PUT_U64(skb, attrtype, (value) / HZ)
918
919#define RTA_PUT_MSECS(skb, attrtype, value) \
920 RTA_PUT_U64(skb, attrtype, jiffies_to_msecs(value))
921
922#define RTA_PUT_STRING(skb, attrtype, value) \
923 RTA_PUT(skb, attrtype, strlen(value) + 1, value)
924
925#define RTA_PUT_FLAG(skb, attrtype) \
926 RTA_PUT(skb, attrtype, 0, NULL);
927
928#define RTA_NEST(skb, type) \
929({ struct rtattr *__start = (struct rtattr *) (skb)->tail; \
930 RTA_PUT(skb, type, 0, NULL); \
931 __start; })
932
933#define RTA_NEST_END(skb, start) \
934({ (start)->rta_len = ((skb)->tail - (unsigned char *) (start)); \
935 (skb)->len; })
936
937#define RTA_NEST_CANCEL(skb, start) \
938({ if (start) \
939 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
940 -1; })
941
942#define RTA_GET_U8(rta) \
943({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u8)) \
944 goto rtattr_failure; \
945 *(u8 *) RTA_DATA(rta); })
946
947#define RTA_GET_U16(rta) \
948({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u16)) \
949 goto rtattr_failure; \
950 *(u16 *) RTA_DATA(rta); })
951
952#define RTA_GET_U32(rta) \
953({ if (!rta || RTA_PAYLOAD(rta) < sizeof(u32)) \
954 goto rtattr_failure; \
955 *(u32 *) RTA_DATA(rta); })
956
957#define RTA_GET_U64(rta) \
958({ u64 _tmp; \
959 if (!rta || RTA_PAYLOAD(rta) < sizeof(u64)) \
960 goto rtattr_failure; \
961 memcpy(&_tmp, RTA_DATA(rta), sizeof(_tmp)); \
962 _tmp; })
963
964#define RTA_GET_FLAG(rta) (!!(rta))
965
966#define RTA_GET_SECS(rta) ((unsigned long) RTA_GET_U64(rta) * HZ)
967#define RTA_GET_MSECS(rta) (msecs_to_jiffies((unsigned long) RTA_GET_U64(rta)))
792 968
793static inline struct rtattr * 969static inline struct rtattr *
794__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) 970__rta_reserve(struct sk_buff *skb, int attrtype, int attrlen)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 4dbb109022f3..b58afd97a180 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -201,8 +201,8 @@ extern unsigned long
201arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, 201arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr,
202 unsigned long len, unsigned long pgoff, 202 unsigned long len, unsigned long pgoff,
203 unsigned long flags); 203 unsigned long flags);
204extern void arch_unmap_area(struct vm_area_struct *area); 204extern void arch_unmap_area(struct mm_struct *, unsigned long);
205extern void arch_unmap_area_topdown(struct vm_area_struct *area); 205extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
206 206
207#define set_mm_counter(mm, member, value) (mm)->_##member = (value) 207#define set_mm_counter(mm, member, value) (mm)->_##member = (value)
208#define get_mm_counter(mm, member) ((mm)->_##member) 208#define get_mm_counter(mm, member) ((mm)->_##member)
@@ -218,9 +218,10 @@ struct mm_struct {
218 unsigned long (*get_unmapped_area) (struct file *filp, 218 unsigned long (*get_unmapped_area) (struct file *filp,
219 unsigned long addr, unsigned long len, 219 unsigned long addr, unsigned long len,
220 unsigned long pgoff, unsigned long flags); 220 unsigned long pgoff, unsigned long flags);
221 void (*unmap_area) (struct vm_area_struct *area); 221 void (*unmap_area) (struct mm_struct *mm, unsigned long addr);
222 unsigned long mmap_base; /* base of mmap area */ 222 unsigned long mmap_base; /* base of mmap area */
223 unsigned long free_area_cache; /* first hole */ 223 unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */
224 unsigned long free_area_cache; /* first hole of size cached_hole_size or larger */
224 pgd_t * pgd; 225 pgd_t * pgd;
225 atomic_t mm_users; /* How many users with user space? */ 226 atomic_t mm_users; /* How many users with user space? */
226 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */ 227 atomic_t mm_count; /* How many references to "struct mm_struct" (users count as 1) */
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 0a98f5ec5cae..7be18b5e2fb4 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -231,10 +231,8 @@ extern int __group_send_sig_info(int, struct siginfo *, struct task_struct *);
231extern long do_sigpending(void __user *, unsigned long); 231extern long do_sigpending(void __user *, unsigned long);
232extern int sigprocmask(int, sigset_t *, sigset_t *); 232extern int sigprocmask(int, sigset_t *, sigset_t *);
233 233
234#ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER
235struct pt_regs; 234struct pt_regs;
236extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); 235extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie);
237#endif
238 236
239#endif /* __KERNEL__ */ 237#endif /* __KERNEL__ */
240 238
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index cc04f5cd2286..d7c839a21842 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -193,7 +193,6 @@ struct skb_shared_info {
193 * @nfcache: Cache info 193 * @nfcache: Cache info
194 * @nfct: Associated connection, if any 194 * @nfct: Associated connection, if any
195 * @nfctinfo: Relationship of this skb to the connection 195 * @nfctinfo: Relationship of this skb to the connection
196 * @nf_debug: Netfilter debugging
197 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 196 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
198 * @private: Data which is private to the HIPPI implementation 197 * @private: Data which is private to the HIPPI implementation
199 * @tc_index: Traffic control index 198 * @tc_index: Traffic control index
@@ -264,9 +263,6 @@ struct sk_buff {
264 __u32 nfcache; 263 __u32 nfcache;
265 __u32 nfctinfo; 264 __u32 nfctinfo;
266 struct nf_conntrack *nfct; 265 struct nf_conntrack *nfct;
267#ifdef CONFIG_NETFILTER_DEBUG
268 unsigned int nf_debug;
269#endif
270#ifdef CONFIG_BRIDGE_NETFILTER 266#ifdef CONFIG_BRIDGE_NETFILTER
271 struct nf_bridge_info *nf_bridge; 267 struct nf_bridge_info *nf_bridge;
272#endif 268#endif
@@ -1219,15 +1215,6 @@ static inline void nf_reset(struct sk_buff *skb)
1219{ 1215{
1220 nf_conntrack_put(skb->nfct); 1216 nf_conntrack_put(skb->nfct);
1221 skb->nfct = NULL; 1217 skb->nfct = NULL;
1222#ifdef CONFIG_NETFILTER_DEBUG
1223 skb->nf_debug = 0;
1224#endif
1225}
1226static inline void nf_reset_debug(struct sk_buff *skb)
1227{
1228#ifdef CONFIG_NETFILTER_DEBUG
1229 skb->nf_debug = 0;
1230#endif
1231} 1218}
1232 1219
1233#ifdef CONFIG_BRIDGE_NETFILTER 1220#ifdef CONFIG_BRIDGE_NETFILTER
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 7d66385ae750..76cf7e60216c 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -64,6 +64,7 @@ extern int kmem_cache_shrink(kmem_cache_t *);
64extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); 64extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast);
65extern void kmem_cache_free(kmem_cache_t *, void *); 65extern void kmem_cache_free(kmem_cache_t *, void *);
66extern unsigned int kmem_cache_size(kmem_cache_t *); 66extern unsigned int kmem_cache_size(kmem_cache_t *);
67extern const char *kmem_cache_name(kmem_cache_t *);
67extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); 68extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags);
68 69
69/* Size description struct for general caches. */ 70/* Size description struct for general caches. */
diff --git a/include/linux/smp.h b/include/linux/smp.h
index dcf1db3b35d3..9dfa3ee769ae 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -92,10 +92,7 @@ void smp_prepare_boot_cpu(void);
92/* 92/*
93 * These macros fold the SMP functionality into a single CPU system 93 * These macros fold the SMP functionality into a single CPU system
94 */ 94 */
95 95#define raw_smp_processor_id() 0
96#if !defined(__smp_processor_id) || !defined(CONFIG_PREEMPT)
97# define smp_processor_id() 0
98#endif
99#define hard_smp_processor_id() 0 96#define hard_smp_processor_id() 0
100#define smp_call_function(func,info,retry,wait) ({ 0; }) 97#define smp_call_function(func,info,retry,wait) ({ 0; })
101#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) 98#define on_each_cpu(func,info,retry,wait) ({ func(info); 0; })
@@ -106,30 +103,25 @@ static inline void smp_send_reschedule(int cpu) { }
106#endif /* !SMP */ 103#endif /* !SMP */
107 104
108/* 105/*
109 * DEBUG_PREEMPT support: check whether smp_processor_id() is being 106 * smp_processor_id(): get the current CPU ID.
110 * used in a preemption-safe way.
111 * 107 *
112 * An architecture has to enable this debugging code explicitly. 108 * if DEBUG_PREEMPT is enabled the we check whether it is
113 * It can do so by renaming the smp_processor_id() macro to 109 * used in a preemption-safe way. (smp_processor_id() is safe
114 * __smp_processor_id(). This should only be done after some minimal 110 * if it's used in a preemption-off critical section, or in
115 * testing, because usually there are a number of false positives 111 * a thread that is bound to the current CPU.)
116 * that an architecture will trigger.
117 * 112 *
118 * To fix a false positive (i.e. smp_processor_id() use that the 113 * NOTE: raw_smp_processor_id() is for internal use only
119 * debugging code reports but which use for some reason is legal), 114 * (smp_processor_id() is the preferred variant), but in rare
120 * change the smp_processor_id() reference to _smp_processor_id(), 115 * instances it might also be used to turn off false positives
121 * which is the nondebug variant. NOTE: don't use this to hack around 116 * (i.e. smp_processor_id() use that the debugging code reports but
122 * real bugs. 117 * which use for some reason is legal). Don't use this to hack around
118 * the warning message, as your code might not work under PREEMPT.
123 */ 119 */
124#ifdef __smp_processor_id 120#ifdef CONFIG_DEBUG_PREEMPT
125# if defined(CONFIG_PREEMPT) && defined(CONFIG_DEBUG_PREEMPT) 121 extern unsigned int debug_smp_processor_id(void);
126 extern unsigned int smp_processor_id(void); 122# define smp_processor_id() debug_smp_processor_id()
127# else
128# define smp_processor_id() __smp_processor_id()
129# endif
130# define _smp_processor_id() __smp_processor_id()
131#else 123#else
132# define _smp_processor_id() smp_processor_id() 124# define smp_processor_id() raw_smp_processor_id()
133#endif 125#endif
134 126
135#define get_cpu() ({ preempt_disable(); smp_processor_id(); }) 127#define get_cpu() ({ preempt_disable(); smp_processor_id(); })
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 3bbc41be9bd0..2343f999e6e1 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -172,7 +172,8 @@ extern int rotate_reclaimable_page(struct page *page);
172extern void swap_setup(void); 172extern void swap_setup(void);
173 173
174/* linux/mm/vmscan.c */ 174/* linux/mm/vmscan.c */
175extern int try_to_free_pages(struct zone **, unsigned int, unsigned int); 175extern int try_to_free_pages(struct zone **, unsigned int);
176extern int zone_reclaim(struct zone *, unsigned int, unsigned int);
176extern int shrink_all_memory(int); 177extern int shrink_all_memory(int);
177extern int vm_swappiness; 178extern int vm_swappiness;
178 179
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 772998147e3e..a17745c80a91 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -346,6 +346,7 @@ enum
346 NET_TCP_MODERATE_RCVBUF=106, 346 NET_TCP_MODERATE_RCVBUF=106,
347 NET_TCP_TSO_WIN_DIVISOR=107, 347 NET_TCP_TSO_WIN_DIVISOR=107,
348 NET_TCP_BIC_BETA=108, 348 NET_TCP_BIC_BETA=108,
349 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
349}; 350};
350 351
351enum { 352enum {
@@ -399,6 +400,7 @@ enum
399 NET_IPV4_CONF_FORCE_IGMP_VERSION=17, 400 NET_IPV4_CONF_FORCE_IGMP_VERSION=17,
400 NET_IPV4_CONF_ARP_ANNOUNCE=18, 401 NET_IPV4_CONF_ARP_ANNOUNCE=18,
401 NET_IPV4_CONF_ARP_IGNORE=19, 402 NET_IPV4_CONF_ARP_IGNORE=19,
403 NET_IPV4_CONF_PROMOTE_SECONDARIES=20,
402 __NET_IPV4_CONF_MAX 404 __NET_IPV4_CONF_MAX
403}; 405};
404 406
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 38b58b30814a..392da5a6dacb 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -16,13 +16,13 @@ struct kobject;
16struct module; 16struct module;
17 17
18struct attribute { 18struct attribute {
19 char * name; 19 const char * name;
20 struct module * owner; 20 struct module * owner;
21 mode_t mode; 21 mode_t mode;
22}; 22};
23 23
24struct attribute_group { 24struct attribute_group {
25 char * name; 25 const char * name;
26 struct attribute ** attrs; 26 struct attribute ** attrs;
27}; 27};
28 28
@@ -73,6 +73,7 @@ struct sysfs_dirent {
73 int s_type; 73 int s_type;
74 umode_t s_mode; 74 umode_t s_mode;
75 struct dentry * s_dentry; 75 struct dentry * s_dentry;
76 struct iattr * s_iattr;
76}; 77};
77 78
78#define SYSFS_ROOT 0x0001 79#define SYSFS_ROOT 0x0001
@@ -105,11 +106,11 @@ sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode);
105extern void 106extern void
106sysfs_remove_file(struct kobject *, const struct attribute *); 107sysfs_remove_file(struct kobject *, const struct attribute *);
107 108
108extern int 109extern int
109sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name); 110sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name);
110 111
111extern void 112extern void
112sysfs_remove_link(struct kobject *, char * name); 113sysfs_remove_link(struct kobject *, const char * name);
113 114
114int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); 115int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr);
115int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); 116int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr);
@@ -153,12 +154,12 @@ static inline void sysfs_remove_file(struct kobject * k, const struct attribute
153 ; 154 ;
154} 155}
155 156
156static inline int sysfs_create_link(struct kobject * k, struct kobject * t, char * n) 157static inline int sysfs_create_link(struct kobject * k, struct kobject * t, const char * n)
157{ 158{
158 return 0; 159 return 0;
159} 160}
160 161
161static inline void sysfs_remove_link(struct kobject * k, char * name) 162static inline void sysfs_remove_link(struct kobject * k, const char * name)
162{ 163{
163 ; 164 ;
164} 165}
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index aa6b48bb4dcd..a6b2cc530af5 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -56,6 +56,36 @@ enum
56 TCF_META_ID_TCCLASSID, 56 TCF_META_ID_TCCLASSID,
57 TCF_META_ID_RTCLASSID, 57 TCF_META_ID_RTCLASSID,
58 TCF_META_ID_RTIIF, 58 TCF_META_ID_RTIIF,
59 TCF_META_ID_SK_FAMILY,
60 TCF_META_ID_SK_STATE,
61 TCF_META_ID_SK_REUSE,
62 TCF_META_ID_SK_BOUND_IF,
63 TCF_META_ID_SK_REFCNT,
64 TCF_META_ID_SK_SHUTDOWN,
65 TCF_META_ID_SK_PROTO,
66 TCF_META_ID_SK_TYPE,
67 TCF_META_ID_SK_RCVBUF,
68 TCF_META_ID_SK_RMEM_ALLOC,
69 TCF_META_ID_SK_WMEM_ALLOC,
70 TCF_META_ID_SK_OMEM_ALLOC,
71 TCF_META_ID_SK_WMEM_QUEUED,
72 TCF_META_ID_SK_RCV_QLEN,
73 TCF_META_ID_SK_SND_QLEN,
74 TCF_META_ID_SK_ERR_QLEN,
75 TCF_META_ID_SK_FORWARD_ALLOCS,
76 TCF_META_ID_SK_SNDBUF,
77 TCF_META_ID_SK_ALLOCS,
78 TCF_META_ID_SK_ROUTE_CAPS,
79 TCF_META_ID_SK_HASHENT,
80 TCF_META_ID_SK_LINGERTIME,
81 TCF_META_ID_SK_ACK_BACKLOG,
82 TCF_META_ID_SK_MAX_ACK_BACKLOG,
83 TCF_META_ID_SK_PRIO,
84 TCF_META_ID_SK_RCVLOWAT,
85 TCF_META_ID_SK_RCVTIMEO,
86 TCF_META_ID_SK_SNDTIMEO,
87 TCF_META_ID_SK_SENDMSG_OFF,
88 TCF_META_ID_SK_WRITE_PENDING,
59 __TCF_META_ID_MAX 89 __TCF_META_ID_MAX
60}; 90};
61#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) 91#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 14a55e3e3a50..97a7c9e03df5 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -230,6 +230,17 @@ struct tcp_options_received {
230 __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ 230 __u16 mss_clamp; /* Maximal mss, negotiated at connection setup */
231}; 231};
232 232
233struct tcp_request_sock {
234 struct inet_request_sock req;
235 __u32 rcv_isn;
236 __u32 snt_isn;
237};
238
239static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
240{
241 return (struct tcp_request_sock *)req;
242}
243
233struct tcp_sock { 244struct tcp_sock {
234 /* inet_sock has to be the first member of tcp_sock */ 245 /* inet_sock has to be the first member of tcp_sock */
235 struct inet_sock inet; 246 struct inet_sock inet;
@@ -368,22 +379,7 @@ struct tcp_sock {
368 379
369 __u32 total_retrans; /* Total retransmits for entire connection */ 380 __u32 total_retrans; /* Total retransmits for entire connection */
370 381
371 /* The syn_wait_lock is necessary only to avoid proc interface having 382 struct request_sock_queue accept_queue; /* FIFO of established children */
372 * to grab the main lock sock while browsing the listening hash
373 * (otherwise it's deadlock prone).
374 * This lock is acquired in read mode only from listening_get_next()
375 * and it's acquired in write mode _only_ from code that is actively
376 * changing the syn_wait_queue. All readers that are holding
377 * the master sock lock don't need to grab this lock in read mode
378 * too as the syn_wait_queue writes are always protected from
379 * the main sock lock.
380 */
381 rwlock_t syn_wait_lock;
382 struct tcp_listen_opt *listen_opt;
383
384 /* FIFO of established children */
385 struct open_request *accept_queue;
386 struct open_request *accept_queue_tail;
387 383
388 unsigned int keepalive_time; /* time before keep alive takes place */ 384 unsigned int keepalive_time; /* time before keep alive takes place */
389 unsigned int keepalive_intvl; /* time interval between keep alive probes */ 385 unsigned int keepalive_intvl; /* time interval between keep alive probes */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 41d1a644c9d4..3d508bf08402 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -287,15 +287,14 @@ struct usb_bus {
287 287
288 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ 288 struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */
289 289
290 struct class_device class_dev; /* class device for this bus */ 290 struct class_device *class_dev; /* class device for this bus */
291 struct kref kref; /* handles reference counting this bus */
291 void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */ 292 void (*release)(struct usb_bus *bus); /* function to destroy this bus's memory */
292#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) 293#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
293 struct mon_bus *mon_bus; /* non-null when associated */ 294 struct mon_bus *mon_bus; /* non-null when associated */
294 int monitored; /* non-zero when monitored */ 295 int monitored; /* non-zero when monitored */
295#endif 296#endif
296}; 297};
297#define to_usb_bus(d) container_of(d, struct usb_bus, class_dev)
298
299 298
300/* -------------------------------------------------------------------------- */ 299/* -------------------------------------------------------------------------- */
301 300
@@ -796,6 +795,10 @@ typedef void (*usb_complete_t)(struct urb *, struct pt_regs *);
796 * of the iso_frame_desc array, and the number of errors is reported in 795 * of the iso_frame_desc array, and the number of errors is reported in
797 * error_count. Completion callbacks for ISO transfers will normally 796 * error_count. Completion callbacks for ISO transfers will normally
798 * (re)submit URBs to ensure a constant transfer rate. 797 * (re)submit URBs to ensure a constant transfer rate.
798 *
799 * Note that even fields marked "public" should not be touched by the driver
800 * when the urb is owned by the hcd, that is, since the call to
801 * usb_submit_urb() till the entry into the completion routine.
799 */ 802 */
800struct urb 803struct urb
801{ 804{
@@ -803,12 +806,12 @@ struct urb
803 struct kref kref; /* reference count of the URB */ 806 struct kref kref; /* reference count of the URB */
804 spinlock_t lock; /* lock for the URB */ 807 spinlock_t lock; /* lock for the URB */
805 void *hcpriv; /* private data for host controller */ 808 void *hcpriv; /* private data for host controller */
806 struct list_head urb_list; /* list pointer to all active urbs */
807 int bandwidth; /* bandwidth for INT/ISO request */ 809 int bandwidth; /* bandwidth for INT/ISO request */
808 atomic_t use_count; /* concurrent submissions counter */ 810 atomic_t use_count; /* concurrent submissions counter */
809 u8 reject; /* submissions will fail */ 811 u8 reject; /* submissions will fail */
810 812
811 /* public, documented fields in the urb that can be used by drivers */ 813 /* public, documented fields in the urb that can be used by drivers */
814 struct list_head urb_list; /* list head for use by the urb owner */
812 struct usb_device *dev; /* (in) pointer to associated device */ 815 struct usb_device *dev; /* (in) pointer to associated device */
813 unsigned int pipe; /* (in) pipe information */ 816 unsigned int pipe; /* (in) pipe information */
814 int status; /* (return) non-ISO status */ 817 int status; /* (return) non-ISO status */
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index 2f51f2b6562e..ae485f9c916e 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -1,10 +1,10 @@
1/* 1/*
2 * This file define a set of standard wireless extensions 2 * This file define a set of standard wireless extensions
3 * 3 *
4 * Version : 17 21.6.04 4 * Version : 18 12.3.05
5 * 5 *
6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> 6 * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com>
7 * Copyright (c) 1997-2004 Jean Tourrilhes, All Rights Reserved. 7 * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved.
8 */ 8 */
9 9
10#ifndef _LINUX_WIRELESS_H 10#ifndef _LINUX_WIRELESS_H
@@ -82,7 +82,7 @@
82 * (there is some stuff that will be added in the future...) 82 * (there is some stuff that will be added in the future...)
83 * I just plan to increment with each new version. 83 * I just plan to increment with each new version.
84 */ 84 */
85#define WIRELESS_EXT 17 85#define WIRELESS_EXT 18
86 86
87/* 87/*
88 * Changes : 88 * Changes :
@@ -182,6 +182,21 @@
182 * - Document (struct iw_quality *)->updated, add new flags (INVALID) 182 * - Document (struct iw_quality *)->updated, add new flags (INVALID)
183 * - Wireless Event capability in struct iw_range 183 * - Wireless Event capability in struct iw_range
184 * - Add support for relative TxPower (yick !) 184 * - Add support for relative TxPower (yick !)
185 *
186 * V17 to V18 (From Jouni Malinen <jkmaline@cc.hut.fi>)
187 * ----------
188 * - Add support for WPA/WPA2
189 * - Add extended encoding configuration (SIOCSIWENCODEEXT and
190 * SIOCGIWENCODEEXT)
191 * - Add SIOCSIWGENIE/SIOCGIWGENIE
192 * - Add SIOCSIWMLME
193 * - Add SIOCSIWPMKSA
194 * - Add struct iw_range bit field for supported encoding capabilities
195 * - Add optional scan request parameters for SIOCSIWSCAN
196 * - Add SIOCSIWAUTH/SIOCGIWAUTH for setting authentication and WPA
197 * related parameters (extensible up to 4096 parameter values)
198 * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE,
199 * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND
185 */ 200 */
186 201
187/**************************** CONSTANTS ****************************/ 202/**************************** CONSTANTS ****************************/
@@ -256,6 +271,30 @@
256#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */ 271#define SIOCSIWPOWER 0x8B2C /* set Power Management settings */
257#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */ 272#define SIOCGIWPOWER 0x8B2D /* get Power Management settings */
258 273
274/* WPA : Generic IEEE 802.11 informatiom element (e.g., for WPA/RSN/WMM).
275 * This ioctl uses struct iw_point and data buffer that includes IE id and len
276 * fields. More than one IE may be included in the request. Setting the generic
277 * IE to empty buffer (len=0) removes the generic IE from the driver. Drivers
278 * are allowed to generate their own WPA/RSN IEs, but in these cases, drivers
279 * are required to report the used IE as a wireless event, e.g., when
280 * associating with an AP. */
281#define SIOCSIWGENIE 0x8B30 /* set generic IE */
282#define SIOCGIWGENIE 0x8B31 /* get generic IE */
283
284/* WPA : IEEE 802.11 MLME requests */
285#define SIOCSIWMLME 0x8B16 /* request MLME operation; uses
286 * struct iw_mlme */
287/* WPA : Authentication mode parameters */
288#define SIOCSIWAUTH 0x8B32 /* set authentication mode params */
289#define SIOCGIWAUTH 0x8B33 /* get authentication mode params */
290
291/* WPA : Extended version of encoding configuration */
292#define SIOCSIWENCODEEXT 0x8B34 /* set encoding token & mode */
293#define SIOCGIWENCODEEXT 0x8B35 /* get encoding token & mode */
294
295/* WPA2 : PMKSA cache management */
296#define SIOCSIWPMKSA 0x8B36 /* PMKSA cache operation */
297
259/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */ 298/* -------------------- DEV PRIVATE IOCTL LIST -------------------- */
260 299
261/* These 32 ioctl are wireless device private, for 16 commands. 300/* These 32 ioctl are wireless device private, for 16 commands.
@@ -297,6 +336,34 @@
297#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */ 336#define IWEVCUSTOM 0x8C02 /* Driver specific ascii string */
298#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */ 337#define IWEVREGISTERED 0x8C03 /* Discovered a new node (AP mode) */
299#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */ 338#define IWEVEXPIRED 0x8C04 /* Expired a node (AP mode) */
339#define IWEVGENIE 0x8C05 /* Generic IE (WPA, RSN, WMM, ..)
340 * (scan results); This includes id and
341 * length fields. One IWEVGENIE may
342 * contain more than one IE. Scan
343 * results may contain one or more
344 * IWEVGENIE events. */
345#define IWEVMICHAELMICFAILURE 0x8C06 /* Michael MIC failure
346 * (struct iw_michaelmicfailure)
347 */
348#define IWEVASSOCREQIE 0x8C07 /* IEs used in (Re)Association Request.
349 * The data includes id and length
350 * fields and may contain more than one
351 * IE. This event is required in
352 * Managed mode if the driver
353 * generates its own WPA/RSN IE. This
354 * should be sent just before
355 * IWEVREGISTERED event for the
356 * association. */
357#define IWEVASSOCRESPIE 0x8C08 /* IEs used in (Re)Association
358 * Response. The data includes id and
359 * length fields and may contain more
360 * than one IE. This may be sent
361 * between IWEVASSOCREQIE and
362 * IWEVREGISTERED events for the
363 * association. */
364#define IWEVPMKIDCAND 0x8C09 /* PMKID candidate for RSN
365 * pre-authentication
366 * (struct iw_pmkid_cand) */
300 367
301#define IWEVFIRST 0x8C00 368#define IWEVFIRST 0x8C00
302 369
@@ -432,12 +499,94 @@
432#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */ 499#define IW_SCAN_THIS_MODE 0x0020 /* Scan only this Mode */
433#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */ 500#define IW_SCAN_ALL_RATE 0x0040 /* Scan all Bit-Rates */
434#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */ 501#define IW_SCAN_THIS_RATE 0x0080 /* Scan only this Bit-Rate */
502/* struct iw_scan_req scan_type */
503#define IW_SCAN_TYPE_ACTIVE 0
504#define IW_SCAN_TYPE_PASSIVE 1
435/* Maximum size of returned data */ 505/* Maximum size of returned data */
436#define IW_SCAN_MAX_DATA 4096 /* In bytes */ 506#define IW_SCAN_MAX_DATA 4096 /* In bytes */
437 507
438/* Max number of char in custom event - use multiple of them if needed */ 508/* Max number of char in custom event - use multiple of them if needed */
439#define IW_CUSTOM_MAX 256 /* In bytes */ 509#define IW_CUSTOM_MAX 256 /* In bytes */
440 510
511/* Generic information element */
512#define IW_GENERIC_IE_MAX 1024
513
514/* MLME requests (SIOCSIWMLME / struct iw_mlme) */
515#define IW_MLME_DEAUTH 0
516#define IW_MLME_DISASSOC 1
517
518/* SIOCSIWAUTH/SIOCGIWAUTH struct iw_param flags */
519#define IW_AUTH_INDEX 0x0FFF
520#define IW_AUTH_FLAGS 0xF000
521/* SIOCSIWAUTH/SIOCGIWAUTH parameters (0 .. 4095)
522 * (IW_AUTH_INDEX mask in struct iw_param flags; this is the index of the
523 * parameter that is being set/get to; value will be read/written to
524 * struct iw_param value field) */
525#define IW_AUTH_WPA_VERSION 0
526#define IW_AUTH_CIPHER_PAIRWISE 1
527#define IW_AUTH_CIPHER_GROUP 2
528#define IW_AUTH_KEY_MGMT 3
529#define IW_AUTH_TKIP_COUNTERMEASURES 4
530#define IW_AUTH_DROP_UNENCRYPTED 5
531#define IW_AUTH_80211_AUTH_ALG 6
532#define IW_AUTH_WPA_ENABLED 7
533#define IW_AUTH_RX_UNENCRYPTED_EAPOL 8
534#define IW_AUTH_ROAMING_CONTROL 9
535#define IW_AUTH_PRIVACY_INVOKED 10
536
537/* IW_AUTH_WPA_VERSION values (bit field) */
538#define IW_AUTH_WPA_VERSION_DISABLED 0x00000001
539#define IW_AUTH_WPA_VERSION_WPA 0x00000002
540#define IW_AUTH_WPA_VERSION_WPA2 0x00000004
541
542/* IW_AUTH_PAIRWISE_CIPHER and IW_AUTH_GROUP_CIPHER values (bit field) */
543#define IW_AUTH_CIPHER_NONE 0x00000001
544#define IW_AUTH_CIPHER_WEP40 0x00000002
545#define IW_AUTH_CIPHER_TKIP 0x00000004
546#define IW_AUTH_CIPHER_CCMP 0x00000008
547#define IW_AUTH_CIPHER_WEP104 0x00000010
548
549/* IW_AUTH_KEY_MGMT values (bit field) */
550#define IW_AUTH_KEY_MGMT_802_1X 1
551#define IW_AUTH_KEY_MGMT_PSK 2
552
553/* IW_AUTH_80211_AUTH_ALG values (bit field) */
554#define IW_AUTH_ALG_OPEN_SYSTEM 0x00000001
555#define IW_AUTH_ALG_SHARED_KEY 0x00000002
556#define IW_AUTH_ALG_LEAP 0x00000004
557
558/* IW_AUTH_ROAMING_CONTROL values */
559#define IW_AUTH_ROAMING_ENABLE 0 /* driver/firmware based roaming */
560#define IW_AUTH_ROAMING_DISABLE 1 /* user space program used for roaming
561 * control */
562
563/* SIOCSIWENCODEEXT definitions */
564#define IW_ENCODE_SEQ_MAX_SIZE 8
565/* struct iw_encode_ext ->alg */
566#define IW_ENCODE_ALG_NONE 0
567#define IW_ENCODE_ALG_WEP 1
568#define IW_ENCODE_ALG_TKIP 2
569#define IW_ENCODE_ALG_CCMP 3
570/* struct iw_encode_ext ->ext_flags */
571#define IW_ENCODE_EXT_TX_SEQ_VALID 0x00000001
572#define IW_ENCODE_EXT_RX_SEQ_VALID 0x00000002
573#define IW_ENCODE_EXT_GROUP_KEY 0x00000004
574#define IW_ENCODE_EXT_SET_TX_KEY 0x00000008
575
576/* IWEVMICHAELMICFAILURE : struct iw_michaelmicfailure ->flags */
577#define IW_MICFAILURE_KEY_ID 0x00000003 /* Key ID 0..3 */
578#define IW_MICFAILURE_GROUP 0x00000004
579#define IW_MICFAILURE_PAIRWISE 0x00000008
580#define IW_MICFAILURE_STAKEY 0x00000010
581#define IW_MICFAILURE_COUNT 0x00000060 /* 1 or 2 (0 = count not supported)
582 */
583
584/* Bit field values for enc_capa in struct iw_range */
585#define IW_ENC_CAPA_WPA 0x00000001
586#define IW_ENC_CAPA_WPA2 0x00000002
587#define IW_ENC_CAPA_CIPHER_TKIP 0x00000004
588#define IW_ENC_CAPA_CIPHER_CCMP 0x00000008
589
441/* Event capability macros - in (struct iw_range *)->event_capa 590/* Event capability macros - in (struct iw_range *)->event_capa
442 * Because we have more than 32 possible events, we use an array of 591 * Because we have more than 32 possible events, we use an array of
443 * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */ 592 * 32 bit bitmasks. Note : 32 bits = 0x20 = 2^5. */
@@ -546,6 +695,132 @@ struct iw_thrspy
546 struct iw_quality high; /* High threshold */ 695 struct iw_quality high; /* High threshold */
547}; 696};
548 697
698/*
699 * Optional data for scan request
700 *
701 * Note: these optional parameters are controlling parameters for the
702 * scanning behavior, these do not apply to getting scan results
703 * (SIOCGIWSCAN). Drivers are expected to keep a local BSS table and
704 * provide a merged results with all BSSes even if the previous scan
705 * request limited scanning to a subset, e.g., by specifying an SSID.
706 * Especially, scan results are required to include an entry for the
707 * current BSS if the driver is in Managed mode and associated with an AP.
708 */
709struct iw_scan_req
710{
711 __u8 scan_type; /* IW_SCAN_TYPE_{ACTIVE,PASSIVE} */
712 __u8 essid_len;
713 __u8 num_channels; /* num entries in channel_list;
714 * 0 = scan all allowed channels */
715 __u8 flags; /* reserved as padding; use zero, this may
716 * be used in the future for adding flags
717 * to request different scan behavior */
718 struct sockaddr bssid; /* ff:ff:ff:ff:ff:ff for broadcast BSSID or
719 * individual address of a specific BSS */
720
721 /*
722 * Use this ESSID if IW_SCAN_THIS_ESSID flag is used instead of using
723 * the current ESSID. This allows scan requests for specific ESSID
724 * without having to change the current ESSID and potentially breaking
725 * the current association.
726 */
727 __u8 essid[IW_ESSID_MAX_SIZE];
728
729 /*
730 * Optional parameters for changing the default scanning behavior.
731 * These are based on the MLME-SCAN.request from IEEE Std 802.11.
732 * TU is 1.024 ms. If these are set to 0, driver is expected to use
733 * reasonable default values. min_channel_time defines the time that
734 * will be used to wait for the first reply on each channel. If no
735 * replies are received, next channel will be scanned after this. If
736 * replies are received, total time waited on the channel is defined by
737 * max_channel_time.
738 */
739 __u32 min_channel_time; /* in TU */
740 __u32 max_channel_time; /* in TU */
741
742 struct iw_freq channel_list[IW_MAX_FREQUENCIES];
743};
744
745/* ------------------------- WPA SUPPORT ------------------------- */
746
747/*
748 * Extended data structure for get/set encoding (this is used with
749 * SIOCSIWENCODEEXT/SIOCGIWENCODEEXT. struct iw_point and IW_ENCODE_*
750 * flags are used in the same way as with SIOCSIWENCODE/SIOCGIWENCODE and
751 * only the data contents changes (key data -> this structure, including
752 * key data).
753 *
754 * If the new key is the first group key, it will be set as the default
755 * TX key. Otherwise, default TX key index is only changed if
756 * IW_ENCODE_EXT_SET_TX_KEY flag is set.
757 *
758 * Key will be changed with SIOCSIWENCODEEXT in all cases except for
759 * special "change TX key index" operation which is indicated by setting
760 * key_len = 0 and ext_flags |= IW_ENCODE_EXT_SET_TX_KEY.
761 *
762 * tx_seq/rx_seq are only used when respective
763 * IW_ENCODE_EXT_{TX,RX}_SEQ_VALID flag is set in ext_flags. Normal
764 * TKIP/CCMP operation is to set RX seq with SIOCSIWENCODEEXT and start
765 * TX seq from zero whenever key is changed. SIOCGIWENCODEEXT is normally
766 * used only by an Authenticator (AP or an IBSS station) to get the
767 * current TX sequence number. Using TX_SEQ_VALID for SIOCSIWENCODEEXT and
768 * RX_SEQ_VALID for SIOCGIWENCODEEXT are optional, but can be useful for
769 * debugging/testing.
770 */
771struct iw_encode_ext
772{
773 __u32 ext_flags; /* IW_ENCODE_EXT_* */
774 __u8 tx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
775 __u8 rx_seq[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
776 struct sockaddr addr; /* ff:ff:ff:ff:ff:ff for broadcast/multicast
777 * (group) keys or unicast address for
778 * individual keys */
779 __u16 alg; /* IW_ENCODE_ALG_* */
780 __u16 key_len;
781 __u8 key[0];
782};
783
784/* SIOCSIWMLME data */
785struct iw_mlme
786{
787 __u16 cmd; /* IW_MLME_* */
788 __u16 reason_code;
789 struct sockaddr addr;
790};
791
792/* SIOCSIWPMKSA data */
793#define IW_PMKSA_ADD 1
794#define IW_PMKSA_REMOVE 2
795#define IW_PMKSA_FLUSH 3
796
797#define IW_PMKID_LEN 16
798
799struct iw_pmksa
800{
801 __u32 cmd; /* IW_PMKSA_* */
802 struct sockaddr bssid;
803 __u8 pmkid[IW_PMKID_LEN];
804};
805
806/* IWEVMICHAELMICFAILURE data */
807struct iw_michaelmicfailure
808{
809 __u32 flags;
810 struct sockaddr src_addr;
811 __u8 tsc[IW_ENCODE_SEQ_MAX_SIZE]; /* LSB first */
812};
813
814/* IWEVPMKIDCAND data */
815#define IW_PMKID_CAND_PREAUTH 0x00000001 /* RNS pre-authentication enabled */
816struct iw_pmkid_cand
817{
818 __u32 flags; /* IW_PMKID_CAND_* */
819 __u32 index; /* the smaller the index, the higher the
820 * priority */
821 struct sockaddr bssid;
822};
823
549/* ------------------------ WIRELESS STATS ------------------------ */ 824/* ------------------------ WIRELESS STATS ------------------------ */
550/* 825/*
551 * Wireless statistics (used for /proc/net/wireless) 826 * Wireless statistics (used for /proc/net/wireless)
@@ -725,6 +1000,8 @@ struct iw_range
725 struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */ 1000 struct iw_freq freq[IW_MAX_FREQUENCIES]; /* list */
726 /* Note : this frequency list doesn't need to fit channel numbers, 1001 /* Note : this frequency list doesn't need to fit channel numbers,
727 * because each entry contain its channel index */ 1002 * because each entry contain its channel index */
1003
1004 __u32 enc_capa; /* IW_ENC_CAPA_* bit field */
728}; 1005};
729 1006
730/* 1007/*
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index fd2ef742a9fd..f0d423300d84 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -174,6 +174,8 @@ enum xfrm_attr_type_t {
174 XFRMA_ALG_COMP, /* struct xfrm_algo */ 174 XFRMA_ALG_COMP, /* struct xfrm_algo */
175 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ 175 XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */
176 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ 176 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
177 XFRMA_SA,
178 XFRMA_POLICY,
177 __XFRMA_MAX 179 __XFRMA_MAX
178 180
179#define XFRMA_MAX (__XFRMA_MAX - 1) 181#define XFRMA_MAX (__XFRMA_MAX - 1)
@@ -194,6 +196,7 @@ struct xfrm_usersa_info {
194 __u8 flags; 196 __u8 flags;
195#define XFRM_STATE_NOECN 1 197#define XFRM_STATE_NOECN 1
196#define XFRM_STATE_DECAP_DSCP 2 198#define XFRM_STATE_DECAP_DSCP 2
199#define XFRM_STATE_NOPMTUDISC 4
197}; 200};
198 201
199struct xfrm_usersa_id { 202struct xfrm_usersa_id {
@@ -257,5 +260,7 @@ struct xfrm_usersa_flush {
257 260
258#define XFRMGRP_ACQUIRE 1 261#define XFRMGRP_ACQUIRE 1
259#define XFRMGRP_EXPIRE 2 262#define XFRMGRP_EXPIRE 2
263#define XFRMGRP_SA 4
264#define XFRMGRP_POLICY 8
260 265
261#endif /* _LINUX_XFRM_H */ 266#endif /* _LINUX_XFRM_H */