diff options
| author | Jeff Garzik <jgarzik@pretzel.yyz.us> | 2005-06-22 13:07:28 -0400 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-06-22 13:07:28 -0400 |
| commit | ff40c6d3d1437ecdf295b8e39adcb06c3d6021ef (patch) | |
| tree | 3666d029b4bd4df2909dbefd9c7a09e6042b7d32 /include/linux | |
| parent | 8bf62ecee58360749c5f0e68bc97d5e02a6816b1 (diff) | |
| parent | 2a5a68b840cbab31baab2d9b2e1e6de3b289ae1e (diff) | |
Merge upstream kernel changes into 'C/H/S support' branch of libata.
Diffstat (limited to 'include/linux')
84 files changed, 1999 insertions, 449 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index aefe6d051a..b123cc0877 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 | ||
| 534 | extern int pnpacpi_disabled; | 538 | extern 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 0000000000..721e7654da --- /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 d8981402cd..6962e26fc6 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -226,6 +226,7 @@ struct ata_taskfile { | |||
| 226 | }; | 226 | }; |
| 227 | 227 | ||
| 228 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 228 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
| 229 | #define ata_id_is_sata(id) ((id)[93] == 0) | ||
| 229 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 230 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
| 230 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 231 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
| 231 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) | 232 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) |
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 31d3fc25cc..09a1451c11 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 | ||
| 22 | struct atalk_addr { | 22 | struct 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 | ||
| 34 | struct atalk_netrange { | 34 | struct 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 { | |||
| 70 | struct atalk_sock { | 70 | struct 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 */ |
| 144 | struct elapaarp { | 144 | struct 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 19f04b0497..bf2ad3ba72 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__ | ||
| 136 | struct audit_message { | ||
| 137 | struct nlmsghdr nlh; | ||
| 138 | char data[1200]; | ||
| 139 | }; | ||
| 140 | #endif | ||
| 141 | |||
| 142 | struct audit_status { | 172 | struct 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 | ||
| 194 | struct audit_sig_info { | ||
| 195 | uid_t uid; | ||
| 196 | pid_t pid; | ||
| 197 | }; | ||
| 198 | |||
| 164 | struct audit_buffer; | 199 | struct audit_buffer; |
| 165 | struct audit_context; | 200 | struct audit_context; |
| 166 | struct inode; | 201 | struct 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) */ |
| 186 | extern int audit_receive_filter(int type, int pid, int uid, int seq, | 221 | extern int audit_receive_filter(int type, int pid, int uid, int seq, |
| 187 | void *data, uid_t loginuid); | 222 | void *data, uid_t loginuid); |
| 188 | extern void audit_get_stamp(struct audit_context *ctx, | 223 | extern unsigned int audit_serial(void); |
| 189 | struct timespec *t, unsigned int *serial); | 224 | extern void auditsc_get_stamp(struct audit_context *ctx, |
| 225 | struct timespec *t, unsigned int *serial); | ||
| 190 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); | 226 | extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); |
| 191 | extern uid_t audit_get_loginuid(struct audit_context *ctx); | 227 | extern uid_t audit_get_loginuid(struct audit_context *ctx); |
| 192 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); | 228 | extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode); |
| 229 | extern int audit_socketcall(int nargs, unsigned long *args); | ||
| 230 | extern int audit_sockaddr(int len, void *addr); | ||
| 231 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | ||
| 232 | extern 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 */ |
| 208 | extern void audit_log(struct audit_context *ctx, | 254 | extern 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 | ||
| 212 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx); | 258 | extern struct audit_buffer *audit_log_start(struct audit_context *ctx,int type); |
| 213 | extern void audit_log_format(struct audit_buffer *ab, | 259 | extern 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); |
| 230 | extern void audit_log_lost(const char *message); | 276 | extern 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 a1657fb995..9343c89d84 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 ef1afc178c..4a99b76c5a 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -544,7 +544,7 @@ extern void blk_end_sync_rq(struct request *rq); | |||
| 544 | extern void blk_attempt_remerge(request_queue_t *, struct request *); | 544 | extern void blk_attempt_remerge(request_queue_t *, struct request *); |
| 545 | extern void __blk_attempt_remerge(request_queue_t *, struct request *); | 545 | extern void __blk_attempt_remerge(request_queue_t *, struct request *); |
| 546 | extern struct request *blk_get_request(request_queue_t *, int, int); | 546 | extern struct request *blk_get_request(request_queue_t *, int, int); |
| 547 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *, int); | 547 | extern void blk_insert_request(request_queue_t *, struct request *, int, void *); |
| 548 | extern void blk_requeue_request(request_queue_t *, struct request *); | 548 | extern void blk_requeue_request(request_queue_t *, struct request *); |
| 549 | extern void blk_plug_device(request_queue_t *); | 549 | extern void blk_plug_device(request_queue_t *); |
| 550 | extern int blk_remove_plug(request_queue_t *); | 550 | extern int blk_remove_plug(request_queue_t *); |
diff --git a/include/linux/chio.h b/include/linux/chio.h new file mode 100644 index 0000000000..63035ae67e --- /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 | */ | ||
| 28 | struct 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 | }; | ||
| 35 | struct 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 | */ | ||
| 52 | struct 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 | */ | ||
| 68 | struct 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 | */ | ||
| 85 | struct 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 | */ | ||
| 97 | struct 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 | */ | ||
| 113 | struct 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 | */ | ||
| 139 | struct 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 f21af067d0..927daa86c9 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 cf470459fa..7b781a72b2 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; | |||
| 44 | struct device_driver; | 45 | struct device_driver; |
| 45 | struct class; | 46 | struct class; |
| 46 | struct class_device; | 47 | struct class_device; |
| 47 | struct class_simple; | ||
| 48 | 48 | ||
| 49 | struct bus_type { | 49 | struct 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 *); | |||
| 98 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | 100 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); |
| 99 | 101 | ||
| 100 | struct device_driver { | 102 | struct 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) | |||
| 137 | extern int driver_create_file(struct device_driver *, struct driver_attribute *); | 140 | extern int driver_create_file(struct device_driver *, struct driver_attribute *); |
| 138 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); | 141 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); |
| 139 | 142 | ||
| 143 | extern 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 | */ |
| 144 | struct class { | 150 | struct 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 { | |||
| 245 | extern int class_interface_register(struct class_interface *); | 253 | extern int class_interface_register(struct class_interface *); |
| 246 | extern void class_interface_unregister(struct class_interface *); | 254 | extern void class_interface_unregister(struct class_interface *); |
| 247 | 255 | ||
| 248 | /* interface for class simple stuff */ | 256 | extern struct class *class_create(struct module *owner, char *name); |
| 249 | extern struct class_simple *class_simple_create(struct module *owner, char *name); | 257 | extern void class_destroy(struct class *cls); |
| 250 | extern void class_simple_destroy(struct class_simple *cs); | 258 | extern struct class_device *class_device_create(struct class *cls, dev_t devt, |
| 251 | extern 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))); |
| 253 | extern int class_simple_set_hotplug(struct class_simple *, | 261 | extern 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)); | ||
| 255 | extern void class_simple_device_remove(dev_t dev); | ||
| 256 | 262 | ||
| 257 | 263 | ||
| 258 | struct device { | 264 | struct 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 */ |
| @@ -273,9 +283,6 @@ struct device { | |||
| 273 | BIOS data relevant to device) */ | 283 | BIOS data relevant to device) */ |
| 274 | struct dev_pm_info power; | 284 | struct dev_pm_info power; |
| 275 | 285 | ||
| 276 | u32 detach_state; /* State to enter when device is | ||
| 277 | detached from its driver. */ | ||
| 278 | |||
| 279 | u64 *dma_mask; /* dma mask (if dma'able device) */ | 286 | u64 *dma_mask; /* dma mask (if dma'able device) */ |
| 280 | u64 coherent_dma_mask;/* Like dma_mask, but for | 287 | u64 coherent_dma_mask;/* Like dma_mask, but for |
| 281 | alloc_coherent mappings as | 288 | alloc_coherent mappings as |
| @@ -291,12 +298,6 @@ struct device { | |||
| 291 | void (*release)(struct device * dev); | 298 | void (*release)(struct device * dev); |
| 292 | }; | 299 | }; |
| 293 | 300 | ||
| 294 | static inline struct device * | ||
| 295 | list_to_dev(struct list_head *node) | ||
| 296 | { | ||
| 297 | return list_entry(node, struct device, node); | ||
| 298 | } | ||
| 299 | |||
| 300 | static inline void * | 301 | static inline void * |
| 301 | dev_get_drvdata (struct device *dev) | 302 | dev_get_drvdata (struct device *dev) |
| 302 | { | 303 | { |
| @@ -324,7 +325,6 @@ extern int device_for_each_child(struct device *, void *, | |||
| 324 | * 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 |
| 325 | * for information on use. | 326 | * for information on use. |
| 326 | */ | 327 | */ |
| 327 | extern int driver_probe_device(struct device_driver * drv, struct device * dev); | ||
| 328 | extern void device_bind_driver(struct device * dev); | 328 | extern void device_bind_driver(struct device * dev); |
| 329 | extern void device_release_driver(struct device * dev); | 329 | extern void device_release_driver(struct device * dev); |
| 330 | extern int device_attach(struct device * dev); | 330 | extern int device_attach(struct device * dev); |
| @@ -335,8 +335,10 @@ extern void driver_attach(struct device_driver * drv); | |||
| 335 | 335 | ||
| 336 | struct device_attribute { | 336 | struct device_attribute { |
| 337 | struct attribute attr; | 337 | struct attribute attr; |
| 338 | ssize_t (*show)(struct device * dev, char * buf); | 338 | ssize_t (*show)(struct device *dev, struct device_attribute *attr, |
| 339 | 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); | ||
| 340 | }; | 342 | }; |
| 341 | 343 | ||
| 342 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | 344 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ |
| @@ -363,13 +365,12 @@ extern int (*platform_notify_remove)(struct device * dev); | |||
| 363 | */ | 365 | */ |
| 364 | extern struct device * get_device(struct device * dev); | 366 | extern struct device * get_device(struct device * dev); |
| 365 | extern void put_device(struct device * dev); | 367 | extern void put_device(struct device * dev); |
| 366 | extern struct device *device_find(const char *name, struct bus_type *bus); | ||
| 367 | 368 | ||
| 368 | 369 | ||
| 369 | /* drivers/base/platform.c */ | 370 | /* drivers/base/platform.c */ |
| 370 | 371 | ||
| 371 | struct platform_device { | 372 | struct platform_device { |
| 372 | char * name; | 373 | const char * name; |
| 373 | u32 id; | 374 | u32 id; |
| 374 | struct device dev; | 375 | struct device dev; |
| 375 | u32 num_resources; | 376 | u32 num_resources; |
diff --git a/include/linux/dm9000.h b/include/linux/dm9000.h new file mode 100644 index 0000000000..0008e2ad0c --- /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 | |||
| 25 | struct 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 806c305332..2d80cc761a 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/err.h b/include/linux/err.h index 17c55df136..ff71d2af5d 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | * This should be a per-architecture thing, to allow different | 13 | * This should be a per-architecture thing, to allow different |
| 14 | * error and pointer decisions. | 14 | * error and pointer decisions. |
| 15 | */ | 15 | */ |
| 16 | #define IS_ERR_VALUE(x) unlikely((x) > (unsigned long)-1000L) | ||
| 17 | |||
| 16 | static inline void *ERR_PTR(long error) | 18 | static inline void *ERR_PTR(long error) |
| 17 | { | 19 | { |
| 18 | return (void *) error; | 20 | return (void *) error; |
| @@ -25,7 +27,7 @@ static inline long PTR_ERR(const void *ptr) | |||
| 25 | 27 | ||
| 26 | static inline long IS_ERR(const void *ptr) | 28 | static inline long IS_ERR(const void *ptr) |
| 27 | { | 29 | { |
| 28 | return unlikely((unsigned long)ptr > (unsigned long)-1000L); | 30 | return IS_ERR_VALUE((unsigned long)ptr); |
| 29 | } | 31 | } |
| 30 | 32 | ||
| 31 | #endif /* _LINUX_ERR_H */ | 33 | #endif /* _LINUX_ERR_H */ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 220748b7ab..a1478258d0 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 | */ | ||
| 66 | static 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 | */ |
| 68 | static inline int is_valid_ether_addr(const u8 *addr) | 80 | static 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 c85b210490..a0ab26aab4 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -256,6 +256,7 @@ struct net_device; | |||
| 256 | u32 ethtool_op_get_link(struct net_device *dev); | 256 | u32 ethtool_op_get_link(struct net_device *dev); |
| 257 | u32 ethtool_op_get_tx_csum(struct net_device *dev); | 257 | u32 ethtool_op_get_tx_csum(struct net_device *dev); |
| 258 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); | 258 | int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); |
| 259 | int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); | ||
| 259 | u32 ethtool_op_get_sg(struct net_device *dev); | 260 | u32 ethtool_op_get_sg(struct net_device *dev); |
| 260 | int ethtool_op_set_sg(struct net_device *dev, u32 data); | 261 | int ethtool_op_set_sg(struct net_device *dev, u32 data); |
| 261 | u32 ethtool_op_get_tso(struct net_device *dev); | 262 | u32 ethtool_op_get_tso(struct net_device *dev); |
diff --git a/include/linux/fb.h b/include/linux/fb.h index b468bf4965..bc24beeed9 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); | |||
| 816 | extern int fb_prepare_logo(struct fb_info *fb_info); | 816 | extern int fb_prepare_logo(struct fb_info *fb_info); |
| 817 | extern int fb_show_logo(struct fb_info *fb_info); | 817 | extern int fb_show_logo(struct fb_info *fb_info); |
| 818 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); | 818 | extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); |
| 819 | extern void fb_iomove_buf_unaligned(struct fb_info *info, struct fb_pixmap *buf, | 819 | extern 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); |
| 822 | extern void fb_iomove_buf_aligned(struct fb_info *info, struct fb_pixmap *buf, | 821 | extern 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); | ||
| 825 | extern 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); | ||
| 828 | extern 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); | ||
| 831 | extern void fb_set_suspend(struct fb_info *info, int state); | 822 | extern void fb_set_suspend(struct fb_info *info, int state); |
| 832 | extern int fb_get_color_depth(struct fb_var_screeninfo *var); | 823 | extern int fb_get_color_depth(struct fb_var_screeninfo *var); |
| 833 | extern int fb_get_options(char *name, char **option); | 824 | extern int fb_get_options(char *name, char **option); |
diff --git a/include/linux/font.h b/include/linux/font.h index fc2d690c9d..8fc80a7d78 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 | ||
| 33 | extern struct font_desc font_vga_8x8, | 35 | extern 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 0180102dac..9b8b696d4f 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) \ | ||
| 1677 | static 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 | } \ | ||
| 1682 | static 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 | |||
| 1690 | static 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 | |||
| 1696 | int simple_attr_open(struct inode *inode, struct file *file, | ||
| 1697 | u64 (*get)(void *), void (*set)(void *, u64), | ||
| 1698 | const char *fmt); | ||
| 1699 | int simple_attr_close(struct inode *inode, struct file *file); | ||
| 1700 | ssize_t simple_attr_read(struct file *file, char __user *buf, | ||
| 1701 | size_t len, loff_t *ppos); | ||
| 1702 | ssize_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 |
| 1661 | static inline char *alloc_secdata(void) | 1707 | static inline char *alloc_secdata(void) |
| 1662 | { | 1708 | { |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index faaff4c645..70f54af87b 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 | ||
| 68 | struct fsl_i2c_platform_data { | 74 | struct 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 b1272f822c..cd623eccdb 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 | |||
| 67 | void gameport_close(struct gameport *gameport); | 67 | void gameport_close(struct gameport *gameport); |
| 68 | void gameport_rescan(struct gameport *gameport); | 68 | void gameport_rescan(struct gameport *gameport); |
| 69 | 69 | ||
| 70 | #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE)) | ||
| 71 | |||
| 70 | void __gameport_register_port(struct gameport *gameport, struct module *owner); | 72 | void __gameport_register_port(struct gameport *gameport, struct module *owner); |
| 71 | static inline void gameport_register_port(struct gameport *gameport) | 73 | static 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 | ||
| 76 | void gameport_unregister_port(struct gameport *gameport); | 78 | void gameport_unregister_port(struct gameport *gameport); |
| 77 | 79 | ||
| 80 | void gameport_set_phys(struct gameport *gameport, const char *fmt, ...) | ||
| 81 | __attribute__ ((format (printf, 2, 3))); | ||
| 82 | |||
| 83 | #else | ||
| 84 | |||
| 85 | static inline void gameport_register_port(struct gameport *gameport) | ||
| 86 | { | ||
| 87 | return; | ||
| 88 | } | ||
| 89 | |||
| 90 | static inline void gameport_unregister_port(struct gameport *gameport) | ||
| 91 | { | ||
| 92 | return; | ||
| 93 | } | ||
| 94 | |||
| 95 | static inline void gameport_set_phys(struct gameport *gameport, | ||
| 96 | const char *fmt, ...) | ||
| 97 | { | ||
| 98 | return; | ||
| 99 | } | ||
| 100 | |||
| 101 | #endif | ||
| 102 | |||
| 78 | static inline struct gameport *gameport_allocate_port(void) | 103 | static 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 | ||
| 95 | void 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 0000000000..7fd0576a44 --- /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 | */ | ||
| 20 | struct gen_pool_link { | ||
| 21 | struct gen_pool_link *next; | ||
| 22 | }; | ||
| 23 | |||
| 24 | /* | ||
| 25 | * Memory pool descriptor. | ||
| 26 | */ | ||
| 27 | struct 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 | |||
| 36 | unsigned long gen_pool_alloc(struct gen_pool *poolp, int size); | ||
| 37 | void gen_pool_free(struct gen_pool *mp, unsigned long ptr, int size); | ||
| 38 | struct 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 af7407e8cf..8d6bf608b1 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 | ||
| 134 | void page_alloc_init(void); | 135 | void page_alloc_init(void); |
| 136 | #ifdef CONFIG_NUMA | ||
| 137 | void drain_remote_pages(void); | ||
| 138 | #else | ||
| 139 | static 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 ebc712e910..8336dba189 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 503194e62f..ed2927ef1f 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 6af1ae4a82..f529d14428 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 | ||
| 8 | struct ctl_table; | 9 | struct ctl_table; |
| 9 | 10 | ||
| @@ -22,12 +23,6 @@ int hugetlb_report_meminfo(char *); | |||
| 22 | int hugetlb_report_node_meminfo(int, char *); | 23 | int hugetlb_report_node_meminfo(int, char *); |
| 23 | int is_hugepage_mem_enough(size_t); | 24 | int is_hugepage_mem_enough(size_t); |
| 24 | unsigned long hugetlb_total_pages(void); | 25 | unsigned long hugetlb_total_pages(void); |
| 25 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | ||
| 26 | int write); | ||
| 27 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
| 28 | pmd_t *pmd, int write); | ||
| 29 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
| 30 | int pmd_huge(pmd_t pmd); | ||
| 31 | struct page *alloc_huge_page(void); | 26 | struct page *alloc_huge_page(void); |
| 32 | void free_huge_page(struct page *); | 27 | void free_huge_page(struct page *); |
| 33 | 28 | ||
| @@ -35,6 +30,17 @@ extern unsigned long max_huge_pages; | |||
| 35 | extern const unsigned long hugetlb_zero, hugetlb_infinity; | 30 | extern const unsigned long hugetlb_zero, hugetlb_infinity; |
| 36 | extern int sysctl_hugetlb_shm_group; | 31 | extern int sysctl_hugetlb_shm_group; |
| 37 | 32 | ||
| 33 | /* arch callbacks */ | ||
| 34 | |||
| 35 | pte_t *huge_pte_alloc(struct mm_struct *mm, unsigned long addr); | ||
| 36 | pte_t *huge_pte_offset(struct mm_struct *mm, unsigned long addr); | ||
| 37 | struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | ||
| 38 | int write); | ||
| 39 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | ||
| 40 | pmd_t *pmd, int write); | ||
| 41 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
| 42 | int 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; | |||
| 48 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 54 | int 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 | ||
| 61 | void set_huge_pte_at(struct mm_struct *mm, unsigned long addr, | ||
| 62 | pte_t *ptep, pte_t pte); | ||
| 63 | pte_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 | ||
| 70 | void 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 | ||
| 76 | void hugetlb_clean_stale_pgtable(pte_t *pte); | ||
| 77 | #endif | ||
| 78 | |||
| 51 | #else /* !CONFIG_HUGETLB_PAGE */ | 79 | #else /* !CONFIG_HUGETLB_PAGE */ |
| 52 | 80 | ||
| 53 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 81 | static 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 0000000000..d7bf6ce116 --- /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 | |||
| 23 | struct 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) \ | ||
| 31 | struct 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 9cfc0999be..336d6e509f 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 | */ |
| 1087 | typedef struct ide_driver_s { | 1088 | typedef 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 | |||
| 1111 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 1104 | int 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 | ||
| 1329 | void ide_init_disk(struct gendisk *, ide_drive_t *); | 1322 | void ide_init_disk(struct gendisk *, ide_drive_t *); |
| 1330 | 1323 | ||
| 1331 | extern int ata_attach(ide_drive_t *); | ||
| 1332 | |||
| 1333 | extern int ideprobe_init(void); | 1324 | extern int ideprobe_init(void); |
| 1334 | 1325 | ||
| 1335 | extern void ide_scan_pcibus(int scan_direction) __init; | 1326 | extern void ide_scan_pcibus(int scan_direction) __init; |
| @@ -1342,11 +1333,8 @@ extern void default_hwif_iops(ide_hwif_t *); | |||
| 1342 | extern void default_hwif_mmiops(ide_hwif_t *); | 1333 | extern void default_hwif_mmiops(ide_hwif_t *); |
| 1343 | extern void default_hwif_transport(ide_hwif_t *); | 1334 | extern void default_hwif_transport(ide_hwif_t *); |
| 1344 | 1335 | ||
| 1345 | int ide_register_driver(ide_driver_t *driver); | 1336 | void ide_register_subdriver(ide_drive_t *, ide_driver_t *); |
| 1346 | void ide_unregister_driver(ide_driver_t *driver); | 1337 | void ide_unregister_subdriver(ide_drive_t *, ide_driver_t *); |
| 1347 | int ide_register_subdriver(ide_drive_t *, ide_driver_t *); | ||
| 1348 | int ide_unregister_subdriver (ide_drive_t *drive); | ||
| 1349 | int 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 d73a9d62f2..ce627d9092 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 0485b256d0..004e6f09a6 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 4fd451f81c..3fba9e2f54 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
| @@ -9,7 +9,7 @@ | |||
| 9 | * | 9 | * |
| 10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> | 10 | * Author: Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG> |
| 11 | * Donald Becker, <becker@super.org> | 11 | * Donald Becker, <becker@super.org> |
| 12 | * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> | 12 | * Peter De Schrijver, <stud11@cc4.kuleuven.ac.be> |
| 13 | * | 13 | * |
| 14 | * This program is free software; you can redistribute it and/or | 14 | * This program is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU General Public License | 15 | * modify it under the terms of the GNU General Public License |
| @@ -19,24 +19,18 @@ | |||
| 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 */ | ||
| 22 | 23 | ||
| 23 | /* 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 |
| 24 | and FCS/CRC (frame check sequence). */ | 25 | and FCS/CRC (frame check sequence). */ |
| 25 | #define TR_ALEN 6 /* Octets in one ethernet addr */ | 26 | #define TR_ALEN 6 /* Octets in one token-ring addr */ |
| 26 | #define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc)) | 27 | #define TR_HLEN (sizeof(struct trh_hdr)+sizeof(struct trllc)) |
| 27 | #define AC 0x10 | 28 | #define AC 0x10 |
| 28 | #define LLC_FRAME 0x40 | 29 | #define LLC_FRAME 0x40 |
| 29 | #if 0 | ||
| 30 | #define ETH_HLEN 14 /* Total octets in header. */ | ||
| 31 | #define ETH_ZLEN 60 /* Min. octets in frame sans FCS */ | ||
| 32 | #define ETH_DATA_LEN 1500 /* Max. octets in payload */ | ||
| 33 | #define ETH_FRAME_LEN 1514 /* Max. octets in frame sans FCS */ | ||
| 34 | #endif | ||
| 35 | |||
| 36 | 30 | ||
| 37 | /* LLC and SNAP constants */ | 31 | /* LLC and SNAP constants */ |
| 38 | #define EXTENDED_SAP 0xAA | 32 | #define EXTENDED_SAP 0xAA |
| 39 | #define UI_CMD 0x03 | 33 | #define UI_CMD 0x03 |
| 40 | 34 | ||
| 41 | /* This is an Token-Ring frame header. */ | 35 | /* This is an Token-Ring frame header. */ |
| 42 | struct trh_hdr { | 36 | struct trh_hdr { |
| @@ -44,8 +38,8 @@ struct trh_hdr { | |||
| 44 | __u8 fc; /* frame control field */ | 38 | __u8 fc; /* frame control field */ |
| 45 | __u8 daddr[TR_ALEN]; /* destination address */ | 39 | __u8 daddr[TR_ALEN]; /* destination address */ |
| 46 | __u8 saddr[TR_ALEN]; /* source address */ | 40 | __u8 saddr[TR_ALEN]; /* source address */ |
| 47 | __u16 rcf; /* route control field */ | 41 | __be16 rcf; /* route control field */ |
| 48 | __u16 rseg[8]; /* routing registers */ | 42 | __be16 rseg[8]; /* routing registers */ |
| 49 | }; | 43 | }; |
| 50 | 44 | ||
| 51 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
| @@ -63,7 +57,7 @@ struct trllc { | |||
| 63 | __u8 ssap; /* source SAP */ | 57 | __u8 ssap; /* source SAP */ |
| 64 | __u8 llc; /* LLC control field */ | 58 | __u8 llc; /* LLC control field */ |
| 65 | __u8 protid[3]; /* protocol id */ | 59 | __u8 protid[3]; /* protocol id */ |
| 66 | __u16 ethertype; /* ether type field */ | 60 | __be16 ethertype; /* ether type field */ |
| 67 | }; | 61 | }; |
| 68 | 62 | ||
| 69 | /* Token-Ring statistics collection data. */ | 63 | /* Token-Ring statistics collection data. */ |
| @@ -96,14 +90,13 @@ struct tr_statistics { | |||
| 96 | }; | 90 | }; |
| 97 | 91 | ||
| 98 | /* source routing stuff */ | 92 | /* source routing stuff */ |
| 99 | 93 | #define TR_RII 0x80 | |
| 100 | #define TR_RII 0x80 | 94 | #define TR_RCF_DIR_BIT 0x80 |
| 101 | #define TR_RCF_DIR_BIT 0x80 | 95 | #define TR_RCF_LEN_MASK 0x1f00 |
| 102 | #define TR_RCF_LEN_MASK 0x1f00 | 96 | #define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */ |
| 103 | #define TR_RCF_BROADCAST 0x8000 /* all-routes broadcast */ | 97 | #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */ |
| 104 | #define TR_RCF_LIMITED_BROADCAST 0xC000 /* single-route broadcast */ | 98 | #define TR_RCF_FRAME2K 0x20 |
| 105 | #define TR_RCF_FRAME2K 0x20 | 99 | #define TR_RCF_BROADCAST_MASK 0xC000 |
| 106 | #define TR_RCF_BROADCAST_MASK 0xC000 | 100 | #define TR_MAXRIFLEN 18 |
| 107 | #define TR_MAXRIFLEN 18 | ||
| 108 | 101 | ||
| 109 | #endif /* _LINUX_IF_TR_H */ | 102 | #endif /* _LINUX_IF_TR_H */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 6fafb27877..7e1e15f934 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 72731d7d18..9d9598ed76 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 | ||
| 1018 | extern struct class_simple *input_class; | 1018 | extern 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 0000000000..3dd18b785e --- /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 | */ | ||
| 31 | struct 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 */ | ||
| 151 | struct 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 */ | ||
| 162 | struct 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 | |||
| 176 | extern int ioc4_register_submodule(struct ioc4_submodule *); | ||
| 177 | extern 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 b03bcc46df..0000000000 --- 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 | |||
| 14 | int ioc4_serial_init(void); | ||
| 15 | |||
| 16 | int ioc4_serial_attach_one(struct pci_dev *pdev, const struct | ||
| 17 | pci_device_id *pci_id); | ||
| 18 | int 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 8438c68591..31e7cedd9f 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 | ||
| 111 | struct 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 | |||
| 126 | static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk) | ||
| 127 | { | ||
| 128 | return (struct inet_request_sock *)sk; | ||
| 129 | } | ||
| 130 | |||
| 110 | struct ipv6_pinfo; | 131 | struct ipv6_pinfo; |
| 111 | 132 | ||
| 112 | struct inet_sock { | 133 | struct inet_sock { |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index ab0d0efbf2..6fcd6a0ade 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 | ||
| 196 | struct 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 | |||
| 204 | static 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 c3ff4d1016..7fc1022be9 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 | ||
| 52 | typedef struct hw_interrupt_type hw_irq_controller; | 56 | typedef struct hw_interrupt_type hw_irq_controller; |
diff --git a/include/linux/klist.h b/include/linux/klist.h new file mode 100644 index 0000000000..eebf5e5696 --- /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 | |||
| 18 | struct klist { | ||
| 19 | spinlock_t k_lock; | ||
| 20 | struct list_head k_list; | ||
| 21 | }; | ||
| 22 | |||
| 23 | |||
| 24 | extern void klist_init(struct klist * k); | ||
| 25 | |||
| 26 | |||
| 27 | struct 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 | |||
| 34 | extern void klist_add_tail(struct klist * k, struct klist_node * n); | ||
| 35 | extern void klist_add_head(struct klist * k, struct klist_node * n); | ||
| 36 | |||
| 37 | extern void klist_del(struct klist_node * n); | ||
| 38 | extern void klist_remove(struct klist_node * n); | ||
| 39 | |||
| 40 | extern int klist_node_attached(struct klist_node * n); | ||
| 41 | |||
| 42 | |||
| 43 | struct klist_iter { | ||
| 44 | struct klist * i_klist; | ||
| 45 | struct list_head * i_head; | ||
| 46 | struct klist_node * i_cur; | ||
| 47 | }; | ||
| 48 | |||
| 49 | |||
| 50 | extern void klist_iter_init(struct klist * k, struct klist_iter * i); | ||
| 51 | extern void klist_iter_init_node(struct klist * k, struct klist_iter * i, | ||
| 52 | struct klist_node * n); | ||
| 53 | extern void klist_iter_exit(struct klist_iter * i); | ||
| 54 | extern struct klist_node * klist_next(struct klist_iter * i); | ||
| 55 | |||
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 765d660d3b..3b22304f12 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | extern u64 hotplug_seqnum; | 33 | extern u64 hotplug_seqnum; |
| 34 | 34 | ||
| 35 | struct kobject { | 35 | struct 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 { | |||
| 46 | extern int kobject_set_name(struct kobject *, const char *, ...) | 46 | extern int kobject_set_name(struct kobject *, const char *, ...) |
| 47 | __attribute__((format(printf,2,3))); | 47 | __attribute__((format(printf,2,3))); |
| 48 | 48 | ||
| 49 | static inline char * kobject_name(struct kobject * kobj) | 49 | static 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 *); | |||
| 57 | extern int kobject_add(struct kobject *); | 57 | extern int kobject_add(struct kobject *); |
| 58 | extern void kobject_del(struct kobject *); | 58 | extern void kobject_del(struct kobject *); |
| 59 | 59 | ||
| 60 | extern int kobject_rename(struct kobject *, char *new_name); | 60 | extern int kobject_rename(struct kobject *, const char *new_name); |
| 61 | 61 | ||
| 62 | extern int kobject_register(struct kobject *); | 62 | extern int kobject_register(struct kobject *); |
| 63 | extern void kobject_unregister(struct kobject *); | 63 | extern void kobject_unregister(struct kobject *); |
| @@ -94,7 +94,7 @@ struct kobj_type { | |||
| 94 | */ | 94 | */ |
| 95 | struct kset_hotplug_ops { | 95 | struct 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 bd0df84cfd..973090be7f 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -416,6 +416,7 @@ extern u8 ata_chk_err(struct ata_port *ap); | |||
| 416 | extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); | 416 | extern void ata_exec_command(struct ata_port *ap, struct ata_taskfile *tf); |
| 417 | extern int ata_port_start (struct ata_port *ap); | 417 | extern int ata_port_start (struct ata_port *ap); |
| 418 | extern void ata_port_stop (struct ata_port *ap); | 418 | extern void ata_port_stop (struct ata_port *ap); |
| 419 | extern void ata_host_stop (struct ata_host_set *host_set); | ||
| 419 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 420 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
| 420 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 421 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
| 421 | extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 422 | extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); |
| @@ -426,6 +427,7 @@ extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | |||
| 426 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); | 427 | extern unsigned int ata_dev_classify(struct ata_taskfile *tf); |
| 427 | extern void ata_dev_id_string(u16 *id, unsigned char *s, | 428 | extern void ata_dev_id_string(u16 *id, unsigned char *s, |
| 428 | unsigned int ofs, unsigned int len); | 429 | unsigned int ofs, unsigned int len); |
| 430 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | ||
| 429 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 431 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
| 430 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 432 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
| 431 | extern void ata_bmdma_stop(struct ata_port *ap); | 433 | extern void ata_bmdma_stop(struct ata_port *ap); |
| @@ -472,12 +474,34 @@ static inline u8 ata_chk_status(struct ata_port *ap) | |||
| 472 | return ap->ops->check_status(ap); | 474 | return ap->ops->check_status(ap); |
| 473 | } | 475 | } |
| 474 | 476 | ||
| 477 | |||
| 478 | /** | ||
| 479 | * ata_pause - Flush writes and pause 400 nanoseconds. | ||
| 480 | * @ap: Port to wait for. | ||
| 481 | * | ||
| 482 | * LOCKING: | ||
| 483 | * Inherited from caller. | ||
| 484 | */ | ||
| 485 | |||
| 475 | static inline void ata_pause(struct ata_port *ap) | 486 | static inline void ata_pause(struct ata_port *ap) |
| 476 | { | 487 | { |
| 477 | ata_altstatus(ap); | 488 | ata_altstatus(ap); |
| 478 | ndelay(400); | 489 | ndelay(400); |
| 479 | } | 490 | } |
| 480 | 491 | ||
| 492 | |||
| 493 | /** | ||
| 494 | * ata_busy_wait - Wait for a port status register | ||
| 495 | * @ap: Port to wait for. | ||
| 496 | * | ||
| 497 | * Waits up to max*10 microseconds for the selected bits in the port's | ||
| 498 | * status register to be cleared. | ||
| 499 | * Returns final value of status register. | ||
| 500 | * | ||
| 501 | * LOCKING: | ||
| 502 | * Inherited from caller. | ||
| 503 | */ | ||
| 504 | |||
| 481 | static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | 505 | static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, |
| 482 | unsigned int max) | 506 | unsigned int max) |
| 483 | { | 507 | { |
| @@ -492,6 +516,18 @@ static inline u8 ata_busy_wait(struct ata_port *ap, unsigned int bits, | |||
| 492 | return status; | 516 | return status; |
| 493 | } | 517 | } |
| 494 | 518 | ||
| 519 | |||
| 520 | /** | ||
| 521 | * ata_wait_idle - Wait for a port to be idle. | ||
| 522 | * @ap: Port to wait for. | ||
| 523 | * | ||
| 524 | * Waits up to 10ms for port's BUSY and DRQ signals to clear. | ||
| 525 | * Returns final value of status register. | ||
| 526 | * | ||
| 527 | * LOCKING: | ||
| 528 | * Inherited from caller. | ||
| 529 | */ | ||
| 530 | |||
| 495 | static inline u8 ata_wait_idle(struct ata_port *ap) | 531 | static inline u8 ata_wait_idle(struct ata_port *ap) |
| 496 | { | 532 | { |
| 497 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); | 533 | u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); |
| @@ -530,6 +566,18 @@ static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, uns | |||
| 530 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; | 566 | tf->device = ATA_DEVICE_OBS | ATA_DEV1; |
| 531 | } | 567 | } |
| 532 | 568 | ||
| 569 | |||
| 570 | /** | ||
| 571 | * ata_irq_on - Enable interrupts on a port. | ||
| 572 | * @ap: Port on which interrupts are enabled. | ||
| 573 | * | ||
| 574 | * Enable interrupts on a legacy IDE device using MMIO or PIO, | ||
| 575 | * wait for idle, clear any pending interrupts. | ||
| 576 | * | ||
| 577 | * LOCKING: | ||
| 578 | * Inherited from caller. | ||
| 579 | */ | ||
| 580 | |||
| 533 | static inline u8 ata_irq_on(struct ata_port *ap) | 581 | static inline u8 ata_irq_on(struct ata_port *ap) |
| 534 | { | 582 | { |
| 535 | struct ata_ioports *ioaddr = &ap->ioaddr; | 583 | struct ata_ioports *ioaddr = &ap->ioaddr; |
| @@ -549,6 +597,18 @@ static inline u8 ata_irq_on(struct ata_port *ap) | |||
| 549 | return tmp; | 597 | return tmp; |
| 550 | } | 598 | } |
| 551 | 599 | ||
| 600 | |||
| 601 | /** | ||
| 602 | * ata_irq_ack - Acknowledge a device interrupt. | ||
| 603 | * @ap: Port on which interrupts are enabled. | ||
| 604 | * | ||
| 605 | * Wait up to 10 ms for legacy IDE device to become idle (BUSY | ||
| 606 | * or BUSY+DRQ clear). Obtain dma status and port status from | ||
| 607 | * device. Clear the interrupt. Return port status. | ||
| 608 | * | ||
| 609 | * LOCKING: | ||
| 610 | */ | ||
| 611 | |||
| 552 | static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | 612 | static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) |
| 553 | { | 613 | { |
| 554 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; | 614 | unsigned int bits = chk_drq ? ATA_BUSY | ATA_DRQ : ATA_BUSY; |
| @@ -590,6 +650,13 @@ static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val) | |||
| 590 | ap->ops->scr_write(ap, reg, val); | 650 | ap->ops->scr_write(ap, reg, val); |
| 591 | } | 651 | } |
| 592 | 652 | ||
| 653 | static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, | ||
| 654 | u32 val) | ||
| 655 | { | ||
| 656 | ap->ops->scr_write(ap, reg, val); | ||
| 657 | (void) ap->ops->scr_read(ap, reg); | ||
| 658 | } | ||
| 659 | |||
| 593 | static inline unsigned int sata_dev_present(struct ata_port *ap) | 660 | static inline unsigned int sata_dev_present(struct ata_port *ap) |
| 594 | { | 661 | { |
| 595 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; | 662 | return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0; |
diff --git a/include/linux/major.h b/include/linux/major.h index 4b62c42b84..e36a46702d 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 20971fe78a..374b615ea9 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 17518fe0b3..1813b162b0 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -691,6 +691,12 @@ extern void show_mem(void); | |||
| 691 | extern void si_meminfo(struct sysinfo * val); | 691 | extern void si_meminfo(struct sysinfo * val); |
| 692 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 692 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
| 693 | 693 | ||
| 694 | #ifdef CONFIG_NUMA | ||
| 695 | extern void setup_per_cpu_pageset(void); | ||
| 696 | #else | ||
| 697 | static inline void setup_per_cpu_pageset(void) {} | ||
| 698 | #endif | ||
| 699 | |||
| 694 | /* prio_tree.c */ | 700 | /* prio_tree.c */ |
| 695 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 701 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
| 696 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); | 702 | void vma_prio_tree_insert(struct vm_area_struct *, struct prio_tree_root *); |
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index 7b904c5102..896342817b 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h | |||
| @@ -195,6 +195,33 @@ struct _mmc_csd { | |||
| 195 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ | 195 | #define MMC_VDD_35_36 0x00800000 /* VDD voltage 3.5 ~ 3.6 */ |
| 196 | #define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ | 196 | #define MMC_CARD_BUSY 0x80000000 /* Card Power up status bit */ |
| 197 | 197 | ||
| 198 | /* | ||
| 199 | * Card Command Classes (CCC) | ||
| 200 | */ | ||
| 201 | #define CCC_BASIC (1<<0) /* (0) Basic protocol functions */ | ||
| 202 | /* (CMD0,1,2,3,4,7,9,10,12,13,15) */ | ||
| 203 | #define CCC_STREAM_READ (1<<1) /* (1) Stream read commands */ | ||
| 204 | /* (CMD11) */ | ||
| 205 | #define CCC_BLOCK_READ (1<<2) /* (2) Block read commands */ | ||
| 206 | /* (CMD16,17,18) */ | ||
| 207 | #define CCC_STREAM_WRITE (1<<3) /* (3) Stream write commands */ | ||
| 208 | /* (CMD20) */ | ||
| 209 | #define CCC_BLOCK_WRITE (1<<4) /* (4) Block write commands */ | ||
| 210 | /* (CMD16,24,25,26,27) */ | ||
| 211 | #define CCC_ERASE (1<<5) /* (5) Ability to erase blocks */ | ||
| 212 | /* (CMD32,33,34,35,36,37,38,39) */ | ||
| 213 | #define CCC_WRITE_PROT (1<<6) /* (6) Able to write protect blocks */ | ||
| 214 | /* (CMD28,29,30) */ | ||
| 215 | #define CCC_LOCK_CARD (1<<7) /* (7) Able to lock down card */ | ||
| 216 | /* (CMD16,CMD42) */ | ||
| 217 | #define CCC_APP_SPEC (1<<8) /* (8) Application specific */ | ||
| 218 | /* (CMD55,56,57,ACMD*) */ | ||
| 219 | #define CCC_IO_MODE (1<<9) /* (9) I/O mode */ | ||
| 220 | /* (CMD5,39,40,52,53) */ | ||
| 221 | #define CCC_SWITCH (1<<10) /* (10) High speed switch */ | ||
| 222 | /* (CMD6,34,35,36,37,50) */ | ||
| 223 | /* (11) Reserved */ | ||
| 224 | /* (CMD?) */ | ||
| 198 | 225 | ||
| 199 | /* | 226 | /* |
| 200 | * CSD field definitions | 227 | * CSD field definitions |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index e530c6c092..4733d35d82 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/net.h b/include/linux/net.h index 6d997ff3f1..20cb226b22 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -101,7 +101,6 @@ enum sock_type { | |||
| 101 | * @sk: internal networking protocol agnostic socket representation | 101 | * @sk: internal networking protocol agnostic socket representation |
| 102 | * @wait: wait queue for several uses | 102 | * @wait: wait queue for several uses |
| 103 | * @type: socket type (%SOCK_STREAM, etc) | 103 | * @type: socket type (%SOCK_STREAM, etc) |
| 104 | * @passcred: credentials (used only in Unix Sockets (aka PF_LOCAL)) | ||
| 105 | */ | 104 | */ |
| 106 | struct socket { | 105 | struct socket { |
| 107 | socket_state state; | 106 | socket_state state; |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index ac11d73be4..ba5d1236aa 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. */ |
| @@ -503,7 +503,7 @@ static inline void *netdev_priv(struct net_device *dev) | |||
| 503 | #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) | 503 | #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) |
| 504 | 504 | ||
| 505 | struct packet_type { | 505 | struct packet_type { |
| 506 | unsigned short type; /* This is really htons(ether_type). */ | 506 | __be16 type; /* This is really htons(ether_type). */ |
| 507 | struct net_device *dev; /* NULL is wildcarded here */ | 507 | struct net_device *dev; /* NULL is wildcarded here */ |
| 508 | int (*func) (struct sk_buff *, struct net_device *, | 508 | int (*func) (struct sk_buff *, struct net_device *, |
| 509 | struct packet_type *); | 509 | struct packet_type *); |
| @@ -913,6 +913,7 @@ extern void dev_mc_discard(struct net_device *dev); | |||
| 913 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 913 | extern void dev_set_promiscuity(struct net_device *dev, int inc); |
| 914 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 914 | extern void dev_set_allmulti(struct net_device *dev, int inc); |
| 915 | extern void netdev_state_change(struct net_device *dev); | 915 | extern void netdev_state_change(struct net_device *dev); |
| 916 | extern void netdev_features_change(struct net_device *dev); | ||
| 916 | /* Load a device via the kmod */ | 917 | /* Load a device via the kmod */ |
| 917 | extern void dev_load(const char *name); | 918 | extern void dev_load(const char *name); |
| 918 | extern void dev_mcast_init(void); | 919 | extern void dev_mcast_init(void); |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 9e5750079e..3ebc36afae 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 | ||
| 79 | void nf_debug_ip_local_deliver(struct sk_buff *skb); | ||
| 80 | void nf_debug_ip_loopback_xmit(struct sk_buff *newskb); | ||
| 81 | void nf_debug_ip_finish_output2(struct sk_buff *skb); | ||
| 82 | #endif /*CONFIG_NETFILTER_DEBUG*/ | ||
| 83 | |||
| 84 | extern int ip_route_me_harder(struct sk_buff **pskb); | 78 | extern 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 d84be02cb4..694aec9b47 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 | ||
| 48 | extern struct list_head *ip_conntrack_hash; | 47 | extern struct list_head *ip_conntrack_hash; |
| 49 | extern struct list_head ip_conntrack_expect_list; | 48 | extern struct list_head ip_conntrack_expect_list; |
| 50 | DECLARE_RWLOCK_EXTERN(ip_conntrack_lock); | 49 | extern 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 2b72b86176..e201ec6e99 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. */ |
| 56 | DECLARE_RWLOCK_EXTERN(ip_nat_lock); | 55 | extern rwlock_t ip_nat_lock; |
| 57 | 56 | ||
| 58 | /* The structure embedded in the conntrack structure. */ | 57 | /* The structure embedded in the conntrack structure. */ |
| 59 | struct ip_nat_info | 58 | struct ip_nat_info |
diff --git a/include/linux/netfilter_ipv4/listhelp.h b/include/linux/netfilter_ipv4/listhelp.h index f2ae7c5e57..360429f487 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 a3288633ab..0000000000 --- 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 | ||
| 13 | struct spinlock_debug | ||
| 14 | { | ||
| 15 | spinlock_t l; | ||
| 16 | atomic_t locked_by; | ||
| 17 | }; | ||
| 18 | |||
| 19 | struct rwlock_debug | ||
| 20 | { | ||
| 21 | rwlock_t l; | ||
| 22 | long read_locked_map; | ||
| 23 | long write_locked_map; | ||
| 24 | }; | ||
| 25 | |||
| 26 | #define DECLARE_LOCK(l) \ | ||
| 27 | struct spinlock_debug l = { SPIN_LOCK_UNLOCKED, ATOMIC_INIT(-1) } | ||
| 28 | #define DECLARE_LOCK_EXTERN(l) \ | ||
| 29 | extern struct spinlock_debug l | ||
| 30 | #define DECLARE_RWLOCK(l) \ | ||
| 31 | struct rwlock_debug l = { RW_LOCK_UNLOCKED, 0, 0 } | ||
| 32 | #define DECLARE_RWLOCK_EXTERN(l) \ | ||
| 33 | extern struct rwlock_debug l | ||
| 34 | |||
| 35 | #define MUST_BE_LOCKED(l) \ | ||
| 36 | do { 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) \ | ||
| 41 | do { 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) \ | ||
| 47 | do { 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) \ | ||
| 53 | do { 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) \ | ||
| 58 | do { 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) \ | ||
| 65 | do { \ | ||
| 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) \ | ||
| 72 | do { \ | ||
| 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) \ | ||
| 79 | do { \ | ||
| 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) \ | ||
| 86 | do { \ | ||
| 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) \ | ||
| 93 | do { \ | ||
| 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) \ | ||
| 102 | do { \ | ||
| 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 b2738ac8bc..3029cad63a 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 | ||
| 152 | struct netlink_notify | 153 | struct netlink_notify |
| @@ -156,7 +157,7 @@ struct netlink_notify | |||
| 156 | }; | 157 | }; |
| 157 | 158 | ||
| 158 | static __inline__ struct nlmsghdr * | 159 | static __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 | ||
| 177 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 194 | extern 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 6e0a697e59..254dc3de65 100644 --- a/include/linux/node.h +++ b/include/linux/node.h | |||
| @@ -27,6 +27,7 @@ struct node { | |||
| 27 | }; | 27 | }; |
| 28 | 28 | ||
| 29 | extern int register_node(struct node *, int, struct node *); | 29 | extern int register_node(struct node *, int, struct node *); |
| 30 | extern 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 9303a003e9..5937dd6053 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 39ab8c6b56..f5a6695d4d 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 | ||
| 137 | extern void get_page_state(struct page_state *ret); | 136 | extern void get_page_state(struct page_state *ret); |
| 138 | extern void get_full_page_state(struct page_state *ret); | 137 | extern void get_full_page_state(struct page_state *ret); |
| 139 | extern unsigned long __read_page_state(unsigned offset); | 138 | extern unsigned long __read_page_state(unsigned long offset); |
| 140 | extern void __mod_page_state(unsigned offset, unsigned long delta); | 139 | extern 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 0422031161..d9a25647a2 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 | ||
| 53 | static inline struct page *page_cache_alloc(struct address_space *x) | 53 | static 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 | ||
| 58 | static inline struct page *page_cache_alloc_cold(struct address_space *x) | 58 | static 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 | ||
| 63 | typedef int filler_t(void *, struct page *); | 63 | typedef int filler_t(void *, struct page *); |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index ae27792b5a..63e89e47b8 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 |
| @@ -2064,12 +2072,14 @@ | |||
| 2064 | 2072 | ||
| 2065 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 | 2073 | #define PCI_VENDOR_ID_BROADCOM 0x14e4 |
| 2066 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 | 2074 | #define PCI_DEVICE_ID_TIGON3_5752 0x1600 |
| 2075 | #define PCI_DEVICE_ID_TIGON3_5752M 0x1601 | ||
| 2067 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 | 2076 | #define PCI_DEVICE_ID_TIGON3_5700 0x1644 |
| 2068 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 | 2077 | #define PCI_DEVICE_ID_TIGON3_5701 0x1645 |
| 2069 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 | 2078 | #define PCI_DEVICE_ID_TIGON3_5702 0x1646 |
| 2070 | #define PCI_DEVICE_ID_TIGON3_5703 0x1647 | 2079 | #define PCI_DEVICE_ID_TIGON3_5703 0x1647 |
| 2071 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 | 2080 | #define PCI_DEVICE_ID_TIGON3_5704 0x1648 |
| 2072 | #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 | ||
| 2073 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d | 2083 | #define PCI_DEVICE_ID_TIGON3_5702FE 0x164d |
| 2074 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 | 2084 | #define PCI_DEVICE_ID_TIGON3_5705 0x1653 |
| 2075 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 2085 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
| @@ -2089,6 +2099,7 @@ | |||
| 2089 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 | 2099 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 |
| 2090 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 | 2100 | #define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 |
| 2091 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 | 2101 | #define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 |
| 2102 | #define PCI_DEVICE_ID_NX2_5706S 0x16aa | ||
| 2092 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 | 2103 | #define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 |
| 2093 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 | 2104 | #define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 |
| 2094 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd | 2105 | #define PCI_DEVICE_ID_TIGON3_5781 0x16dd |
| @@ -2373,6 +2384,8 @@ | |||
| 2373 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 | 2384 | #define PCI_DEVICE_ID_INTEL_82915G_IG 0x2582 |
| 2374 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 | 2385 | #define PCI_DEVICE_ID_INTEL_82915GM_HB 0x2590 |
| 2375 | #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 | ||
| 2376 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 | 2389 | #define PCI_DEVICE_ID_INTEL_ICH6_0 0x2640 |
| 2377 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 | 2390 | #define PCI_DEVICE_ID_INTEL_ICH6_1 0x2641 |
| 2378 | #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 e6b5192202..724066778a 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 73d84c071c..1d9da36eb9 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 | ||
| 453 | struct 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 0000000000..e24b74b111 --- /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 | |||
| 79 | typedef __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 */ | ||
| 134 | enum 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 */ | ||
| 140 | typedef 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 */ | ||
| 171 | struct 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 */ | ||
| 188 | struct page_list { | ||
| 189 | struct list_head list; | ||
| 190 | struct page *page; | ||
| 191 | }; | ||
| 192 | |||
| 193 | /* the main bitmap structure - one per mddev */ | ||
| 194 | struct 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 */ | ||
| 250 | int bitmap_create(mddev_t *mddev); | ||
| 251 | void bitmap_destroy(mddev_t *mddev); | ||
| 252 | int bitmap_active(struct bitmap *bitmap); | ||
| 253 | |||
| 254 | char *file_path(struct file *file, char *buf, int count); | ||
| 255 | void bitmap_print_sb(struct bitmap *bitmap); | ||
| 256 | int bitmap_update_sb(struct bitmap *bitmap); | ||
| 257 | |||
| 258 | int bitmap_setallbits(struct bitmap *bitmap); | ||
| 259 | void bitmap_write_all(struct bitmap *bitmap); | ||
| 260 | |||
| 261 | /* these are exported */ | ||
| 262 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors); | ||
| 263 | void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long sectors, | ||
| 264 | int success); | ||
| 265 | int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks); | ||
| 266 | void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); | ||
| 267 | void bitmap_close_sync(struct bitmap *bitmap); | ||
| 268 | |||
| 269 | int bitmap_unplug(struct bitmap *bitmap); | ||
| 270 | int 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 a6a67d102b..ffa316ce4d 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 | ||
| 65 | extern int register_md_personality (int p_num, mdk_personality_t *p); | 72 | extern int register_md_personality (int p_num, mdk_personality_t *p); |
| 66 | extern int unregister_md_personality (int p_num); | 73 | extern int unregister_md_personality (int p_num); |
| @@ -69,7 +76,7 @@ extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), | |||
| 69 | extern void md_unregister_thread (mdk_thread_t *thread); | 76 | extern void md_unregister_thread (mdk_thread_t *thread); |
| 70 | extern void md_wakeup_thread(mdk_thread_t *thread); | 77 | extern void md_wakeup_thread(mdk_thread_t *thread); |
| 71 | extern void md_check_recovery(mddev_t *mddev); | 78 | extern void md_check_recovery(mddev_t *mddev); |
| 72 | extern void md_write_start(mddev_t *mddev); | 79 | extern void md_write_start(mddev_t *mddev, struct bio *bi); |
| 73 | extern void md_write_end(mddev_t *mddev); | 80 | extern void md_write_end(mddev_t *mddev); |
| 74 | extern void md_handle_safemode(mddev_t *mddev); | 81 | extern void md_handle_safemode(mddev_t *mddev); |
| 75 | extern void md_done_sync(mddev_t *mddev, int blocks, int ok); | 82 | extern 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 | ||
| 79 | extern void md_print_devices (void); | 86 | extern void md_print_devices (void); |
| 80 | 87 | ||
| 88 | extern void md_super_write(mddev_t *mddev, mdk_rdev_t *rdev, | ||
| 89 | sector_t sector, int size, struct page *page); | ||
| 90 | extern 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 c9a0d4013b..8c14ba565a 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 8ba95d6732..dc65cd4354 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 */ | ||
| 99 | typedef struct mdp_superblock_s { | 100 | typedef 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 a2df5c2a42..81da20ccec 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 | ||
| 111 | typedef struct mdu_bitmap_file_s | ||
| 112 | { | ||
| 113 | char pathname[4096]; | ||
| 114 | } mdu_bitmap_file_t; | ||
| 115 | |||
| 109 | typedef struct mdu_param_s | 116 | typedef 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 abbfdd9afe..9d93cf12e8 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 91ac97c207..e68dbf0bf5 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 | |||
| 529 | struct 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 | |||
| 543 | enum { | ||
| 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 | |||
| 564 | struct ndtmsg | ||
| 565 | { | ||
| 566 | __u8 ndtm_family; | ||
| 567 | __u8 ndtm_pad1; | ||
| 568 | __u16 ndtm_pad2; | ||
| 569 | }; | ||
| 570 | |||
| 571 | struct 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 | |||
| 584 | enum { | ||
| 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 | ||
| 793 | static inline struct rtattr * | 969 | static 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 4dbb109022..b58afd97a1 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -201,8 +201,8 @@ extern unsigned long | |||
| 201 | arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | 201 | arch_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); |
| 204 | extern void arch_unmap_area(struct vm_area_struct *area); | 204 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
| 205 | extern void arch_unmap_area_topdown(struct vm_area_struct *area); | 205 | extern 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/serial_core.h b/include/linux/serial_core.h index c3fb5984f2..d6025af7ef 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
| @@ -479,6 +479,25 @@ uart_handle_cts_change(struct uart_port *port, unsigned int status) | |||
| 479 | } | 479 | } |
| 480 | } | 480 | } |
| 481 | 481 | ||
| 482 | #include <linux/tty_flip.h> | ||
| 483 | |||
| 484 | static inline void | ||
| 485 | uart_insert_char(struct uart_port *port, unsigned int status, | ||
| 486 | unsigned int overrun, unsigned int ch, unsigned int flag) | ||
| 487 | { | ||
| 488 | struct tty_struct *tty = port->info->tty; | ||
| 489 | |||
| 490 | if ((status & port->ignore_status_mask & ~overrun) == 0) | ||
| 491 | tty_insert_flip_char(tty, ch, flag); | ||
| 492 | |||
| 493 | /* | ||
| 494 | * Overrun is special. Since it's reported immediately, | ||
| 495 | * it doesn't affect the current character. | ||
| 496 | */ | ||
| 497 | if (status & ~port->ignore_status_mask & overrun) | ||
| 498 | tty_insert_flip_char(tty, 0, TTY_OVERRUN); | ||
| 499 | } | ||
| 500 | |||
| 482 | /* | 501 | /* |
| 483 | * UART_ENABLE_MS - determine if port should enable modem status irqs | 502 | * UART_ENABLE_MS - determine if port should enable modem status irqs |
| 484 | */ | 503 | */ |
diff --git a/include/linux/signal.h b/include/linux/signal.h index 0a98f5ec5c..7be18b5e2f 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 *); | |||
| 231 | extern long do_sigpending(void __user *, unsigned long); | 231 | extern long do_sigpending(void __user *, unsigned long); |
| 232 | extern int sigprocmask(int, sigset_t *, sigset_t *); | 232 | extern int sigprocmask(int, sigset_t *, sigset_t *); |
| 233 | 233 | ||
| 234 | #ifndef HAVE_ARCH_GET_SIGNAL_TO_DELIVER | ||
| 235 | struct pt_regs; | 234 | struct pt_regs; |
| 236 | extern int get_signal_to_deliver(siginfo_t *info, struct k_sigaction *return_ka, struct pt_regs *regs, void *cookie); | 235 | extern 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 cc04f5cd22..d7c839a218 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 | } | ||
| 1226 | static 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 7d66385ae7..76cf7e6021 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
| @@ -64,6 +64,7 @@ extern int kmem_cache_shrink(kmem_cache_t *); | |||
| 64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); | 64 | extern void *kmem_cache_alloc(kmem_cache_t *, unsigned int __nocast); |
| 65 | extern void kmem_cache_free(kmem_cache_t *, void *); | 65 | extern void kmem_cache_free(kmem_cache_t *, void *); |
| 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); | 66 | extern unsigned int kmem_cache_size(kmem_cache_t *); |
| 67 | extern const char *kmem_cache_name(kmem_cache_t *); | ||
| 67 | extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags); | 68 | extern 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 dcf1db3b35..9dfa3ee769 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/spinlock.h b/include/linux/spinlock.h index e895f3eaf5..d6ba068719 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
| @@ -248,7 +248,7 @@ typedef struct { | |||
| 248 | 248 | ||
| 249 | #define _spin_trylock_bh(lock) ({preempt_disable(); local_bh_disable(); \ | 249 | #define _spin_trylock_bh(lock) ({preempt_disable(); local_bh_disable(); \ |
| 250 | _raw_spin_trylock(lock) ? \ | 250 | _raw_spin_trylock(lock) ? \ |
| 251 | 1 : ({preempt_enable(); local_bh_enable(); 0;});}) | 251 | 1 : ({preempt_enable_no_resched(); local_bh_enable(); 0;});}) |
| 252 | 252 | ||
| 253 | #define _spin_lock(lock) \ | 253 | #define _spin_lock(lock) \ |
| 254 | do { \ | 254 | do { \ |
| @@ -383,7 +383,7 @@ do { \ | |||
| 383 | #define _spin_unlock_bh(lock) \ | 383 | #define _spin_unlock_bh(lock) \ |
| 384 | do { \ | 384 | do { \ |
| 385 | _raw_spin_unlock(lock); \ | 385 | _raw_spin_unlock(lock); \ |
| 386 | preempt_enable(); \ | 386 | preempt_enable_no_resched(); \ |
| 387 | local_bh_enable(); \ | 387 | local_bh_enable(); \ |
| 388 | __release(lock); \ | 388 | __release(lock); \ |
| 389 | } while (0) | 389 | } while (0) |
| @@ -391,7 +391,7 @@ do { \ | |||
| 391 | #define _write_unlock_bh(lock) \ | 391 | #define _write_unlock_bh(lock) \ |
| 392 | do { \ | 392 | do { \ |
| 393 | _raw_write_unlock(lock); \ | 393 | _raw_write_unlock(lock); \ |
| 394 | preempt_enable(); \ | 394 | preempt_enable_no_resched(); \ |
| 395 | local_bh_enable(); \ | 395 | local_bh_enable(); \ |
| 396 | __release(lock); \ | 396 | __release(lock); \ |
| 397 | } while (0) | 397 | } while (0) |
| @@ -423,8 +423,8 @@ do { \ | |||
| 423 | #define _read_unlock_bh(lock) \ | 423 | #define _read_unlock_bh(lock) \ |
| 424 | do { \ | 424 | do { \ |
| 425 | _raw_read_unlock(lock); \ | 425 | _raw_read_unlock(lock); \ |
| 426 | preempt_enable_no_resched(); \ | ||
| 426 | local_bh_enable(); \ | 427 | local_bh_enable(); \ |
| 427 | preempt_enable(); \ | ||
| 428 | __release(lock); \ | 428 | __release(lock); \ |
| 429 | } while (0) | 429 | } while (0) |
| 430 | 430 | ||
diff --git a/include/linux/swap.h b/include/linux/swap.h index 3bbc41be9b..2343f999e6 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
| @@ -172,7 +172,8 @@ extern int rotate_reclaimable_page(struct page *page); | |||
| 172 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
| 173 | 173 | ||
| 174 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
| 175 | extern int try_to_free_pages(struct zone **, unsigned int, unsigned int); | 175 | extern int try_to_free_pages(struct zone **, unsigned int); |
| 176 | extern int zone_reclaim(struct zone *, unsigned int, unsigned int); | ||
| 176 | extern int shrink_all_memory(int); | 177 | extern int shrink_all_memory(int); |
| 177 | extern int vm_swappiness; | 178 | extern int vm_swappiness; |
| 178 | 179 | ||
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 772998147e..a17745c80a 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 | ||
| 351 | enum { | 352 | enum { |
| @@ -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 38b58b3081..392da5a6da 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
| @@ -16,13 +16,13 @@ struct kobject; | |||
| 16 | struct module; | 16 | struct module; |
| 17 | 17 | ||
| 18 | struct attribute { | 18 | struct 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 | ||
| 24 | struct attribute_group { | 24 | struct 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); | |||
| 105 | extern void | 106 | extern void |
| 106 | sysfs_remove_file(struct kobject *, const struct attribute *); | 107 | sysfs_remove_file(struct kobject *, const struct attribute *); |
| 107 | 108 | ||
| 108 | extern int | 109 | extern int |
| 109 | sysfs_create_link(struct kobject * kobj, struct kobject * target, char * name); | 110 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); |
| 110 | 111 | ||
| 111 | extern void | 112 | extern void |
| 112 | sysfs_remove_link(struct kobject *, char * name); | 113 | sysfs_remove_link(struct kobject *, const char * name); |
| 113 | 114 | ||
| 114 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 115 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); |
| 115 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 116 | int 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 | ||
| 156 | static inline int sysfs_create_link(struct kobject * k, struct kobject * t, char * n) | 157 | static 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 | ||
| 161 | static inline void sysfs_remove_link(struct kobject * k, char * name) | 162 | static 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 aa6b48bb4d..a6b2cc530a 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 14a55e3e3a..97a7c9e03d 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 | ||
| 233 | struct tcp_request_sock { | ||
| 234 | struct inet_request_sock req; | ||
| 235 | __u32 rcv_isn; | ||
| 236 | __u32 snt_isn; | ||
| 237 | }; | ||
| 238 | |||
| 239 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | ||
| 240 | { | ||
| 241 | return (struct tcp_request_sock *)req; | ||
| 242 | } | ||
| 243 | |||
| 233 | struct tcp_sock { | 244 | struct 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 41d1a644c9..3d508bf084 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 | */ |
| 800 | struct urb | 803 | struct 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/vmalloc.h b/include/linux/vmalloc.h index 3a358c8951..6409d9cf59 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
| @@ -41,6 +41,7 @@ extern struct vm_struct *get_vm_area(unsigned long size, unsigned long flags); | |||
| 41 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | 41 | extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, |
| 42 | unsigned long start, unsigned long end); | 42 | unsigned long start, unsigned long end); |
| 43 | extern struct vm_struct *remove_vm_area(void *addr); | 43 | extern struct vm_struct *remove_vm_area(void *addr); |
| 44 | extern struct vm_struct *__remove_vm_area(void *addr); | ||
| 44 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 45 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
| 45 | struct page ***pages); | 46 | struct page ***pages); |
| 46 | extern void unmap_vm_area(struct vm_struct *area); | 47 | extern void unmap_vm_area(struct vm_struct *area); |
diff --git a/include/linux/wait.h b/include/linux/wait.h index 17c874a8eb..c9486c3efb 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h | |||
| @@ -386,9 +386,7 @@ int wake_bit_function(wait_queue_t *wait, unsigned mode, int sync, void *key); | |||
| 386 | wait_queue_t name = { \ | 386 | wait_queue_t name = { \ |
| 387 | .task = current, \ | 387 | .task = current, \ |
| 388 | .func = autoremove_wake_function, \ | 388 | .func = autoremove_wake_function, \ |
| 389 | .task_list = { .next = &(name).task_list, \ | 389 | .task_list = LIST_HEAD_INIT((name).task_list), \ |
| 390 | .prev = &(name).task_list, \ | ||
| 391 | }, \ | ||
| 392 | } | 390 | } |
| 393 | 391 | ||
| 394 | #define DEFINE_WAIT_BIT(name, word, bit) \ | 392 | #define DEFINE_WAIT_BIT(name, word, bit) \ |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 2f51f2b656..ae485f9c91 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 | */ | ||
| 709 | struct 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 | */ | ||
| 771 | struct 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 */ | ||
| 785 | struct 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 | |||
| 799 | struct iw_pmksa | ||
| 800 | { | ||
| 801 | __u32 cmd; /* IW_PMKSA_* */ | ||
| 802 | struct sockaddr bssid; | ||
| 803 | __u8 pmkid[IW_PMKID_LEN]; | ||
| 804 | }; | ||
| 805 | |||
| 806 | /* IWEVMICHAELMICFAILURE data */ | ||
| 807 | struct 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 */ | ||
| 816 | struct 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 fd2ef742a9..f0d423300d 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 | ||
| 199 | struct xfrm_usersa_id { | 202 | struct 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 */ |
