diff options
author | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor@insightbb.com> | 2007-05-01 00:24:54 -0400 |
commit | bc95f3669f5e6f63cf0b84fe4922c3c6dd4aa775 (patch) | |
tree | 427fcf2a7287c16d4b5aa6cbf494d59579a6a8b1 /include/linux | |
parent | 3d29cdff999c37b3876082278a8134a0642a02cd (diff) | |
parent | dc87c3985e9b442c60994308a96f887579addc39 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/usb/input/Makefile
drivers/usb/input/gtco.c
Diffstat (limited to 'include/linux')
191 files changed, 2919 insertions, 3477 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index e81e301a4d71..4ff0f57d0add 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -69,9 +69,7 @@ header-y += hdsmart.h | |||
69 | header-y += hysdn_if.h | 69 | header-y += hysdn_if.h |
70 | header-y += i2c-dev.h | 70 | header-y += i2c-dev.h |
71 | header-y += i8k.h | 71 | header-y += i8k.h |
72 | header-y += icmp.h | ||
73 | header-y += if_arcnet.h | 72 | header-y += if_arcnet.h |
74 | header-y += if_arp.h | ||
75 | header-y += if_bonding.h | 73 | header-y += if_bonding.h |
76 | header-y += if_cablemodem.h | 74 | header-y += if_cablemodem.h |
77 | header-y += if_fc.h | 75 | header-y += if_fc.h |
@@ -88,7 +86,6 @@ header-y += if_tunnel.h | |||
88 | header-y += in6.h | 86 | header-y += in6.h |
89 | header-y += in_route.h | 87 | header-y += in_route.h |
90 | header-y += ioctl.h | 88 | header-y += ioctl.h |
91 | header-y += ip.h | ||
92 | header-y += ipmi_msgdefs.h | 89 | header-y += ipmi_msgdefs.h |
93 | header-y += ip_mp_alg.h | 90 | header-y += ip_mp_alg.h |
94 | header-y += ipsec.h | 91 | header-y += ipsec.h |
@@ -116,6 +113,7 @@ header-y += netrom.h | |||
116 | header-y += nfs2.h | 113 | header-y += nfs2.h |
117 | header-y += nfs4_mount.h | 114 | header-y += nfs4_mount.h |
118 | header-y += nfs_mount.h | 115 | header-y += nfs_mount.h |
116 | header-y += nl80211.h | ||
119 | header-y += oom.h | 117 | header-y += oom.h |
120 | header-y += param.h | 118 | header-y += param.h |
121 | header-y += pci_regs.h | 119 | header-y += pci_regs.h |
@@ -210,8 +208,10 @@ unifdef-y += hiddev.h | |||
210 | unifdef-y += hpet.h | 208 | unifdef-y += hpet.h |
211 | unifdef-y += i2c.h | 209 | unifdef-y += i2c.h |
212 | unifdef-y += i2o-dev.h | 210 | unifdef-y += i2o-dev.h |
211 | unifdef-y += icmp.h | ||
213 | unifdef-y += icmpv6.h | 212 | unifdef-y += icmpv6.h |
214 | unifdef-y += if_addr.h | 213 | unifdef-y += if_addr.h |
214 | unifdef-y += if_arp.h | ||
215 | unifdef-y += if_bridge.h | 215 | unifdef-y += if_bridge.h |
216 | unifdef-y += if_ec.h | 216 | unifdef-y += if_ec.h |
217 | unifdef-y += if_eql.h | 217 | unifdef-y += if_eql.h |
@@ -231,6 +231,7 @@ unifdef-y += inet_diag.h | |||
231 | unifdef-y += in.h | 231 | unifdef-y += in.h |
232 | unifdef-y += inotify.h | 232 | unifdef-y += inotify.h |
233 | unifdef-y += input.h | 233 | unifdef-y += input.h |
234 | unifdef-y += ip.h | ||
234 | unifdef-y += ipc.h | 235 | unifdef-y += ipc.h |
235 | unifdef-y += ipmi.h | 236 | unifdef-y += ipmi.h |
236 | unifdef-y += ipv6.h | 237 | unifdef-y += ipv6.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 815f1fb4ce21..8bcfaa4c66ae 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -75,7 +75,7 @@ enum acpi_address_range_id { | |||
75 | 75 | ||
76 | typedef int (*acpi_table_handler) (struct acpi_table_header *table); | 76 | typedef int (*acpi_table_handler) (struct acpi_table_header *table); |
77 | 77 | ||
78 | typedef int (*acpi_madt_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); | 78 | typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end); |
79 | 79 | ||
80 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | 80 | char * __acpi_map_table (unsigned long phys_addr, unsigned long size); |
81 | unsigned long acpi_find_rsdp (void); | 81 | unsigned long acpi_find_rsdp (void); |
@@ -85,8 +85,10 @@ int acpi_numa_init (void); | |||
85 | 85 | ||
86 | int acpi_table_init (void); | 86 | int acpi_table_init (void); |
87 | int acpi_table_parse (char *id, acpi_table_handler handler); | 87 | int acpi_table_parse (char *id, acpi_table_handler handler); |
88 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_madt_entry_handler handler, unsigned int max_entries); | 88 | int __init acpi_table_parse_entries(char *id, unsigned long table_size, |
89 | int acpi_table_parse_srat (enum acpi_srat_type id, acpi_madt_entry_handler handler, unsigned int max_entries); | 89 | int entry_id, acpi_table_entry_handler handler, unsigned int max_entries); |
90 | int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries); | ||
91 | int acpi_table_parse_srat (enum acpi_srat_type id, acpi_table_entry_handler handler, unsigned int max_entries); | ||
90 | int acpi_parse_mcfg (struct acpi_table_header *header); | 92 | int acpi_parse_mcfg (struct acpi_table_header *header); |
91 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); | 93 | void acpi_table_print_madt_entry (struct acpi_subtable_header *madt); |
92 | void acpi_table_print_srat_entry (struct acpi_subtable_header *srat); | 94 | void acpi_table_print_srat_entry (struct acpi_subtable_header *srat); |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 272736e37990..edb31bfff68f 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -40,6 +40,7 @@ enum { | |||
40 | ATA_MAX_DEVICES = 2, /* per bus/port */ | 40 | ATA_MAX_DEVICES = 2, /* per bus/port */ |
41 | ATA_MAX_PRD = 256, /* we could make these 256/256 */ | 41 | ATA_MAX_PRD = 256, /* we could make these 256/256 */ |
42 | ATA_SECT_SIZE = 512, | 42 | ATA_SECT_SIZE = 512, |
43 | ATA_MAX_SECTORS_128 = 128, | ||
43 | ATA_MAX_SECTORS = 256, | 44 | ATA_MAX_SECTORS = 256, |
44 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ | 45 | ATA_MAX_SECTORS_LBA48 = 65535,/* TODO: 65536? */ |
45 | 46 | ||
@@ -158,11 +159,19 @@ enum { | |||
158 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | 159 | ATA_CMD_INIT_DEV_PARAMS = 0x91, |
159 | ATA_CMD_READ_NATIVE_MAX = 0xF8, | 160 | ATA_CMD_READ_NATIVE_MAX = 0xF8, |
160 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, | 161 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, |
162 | ATA_CMD_SET_MAX = 0xF9, | ||
163 | ATA_CMD_SET_MAX_EXT = 0x37, | ||
161 | ATA_CMD_READ_LOG_EXT = 0x2f, | 164 | ATA_CMD_READ_LOG_EXT = 0x2f, |
162 | 165 | ||
163 | /* READ_LOG_EXT pages */ | 166 | /* READ_LOG_EXT pages */ |
164 | ATA_LOG_SATA_NCQ = 0x10, | 167 | ATA_LOG_SATA_NCQ = 0x10, |
165 | 168 | ||
169 | /* READ/WRITE LONG (obsolete) */ | ||
170 | ATA_CMD_READ_LONG = 0x22, | ||
171 | ATA_CMD_READ_LONG_ONCE = 0x23, | ||
172 | ATA_CMD_WRITE_LONG = 0x32, | ||
173 | ATA_CMD_WRITE_LONG_ONCE = 0x33, | ||
174 | |||
166 | /* SETFEATURES stuff */ | 175 | /* SETFEATURES stuff */ |
167 | SETFEATURES_XFER = 0x03, | 176 | SETFEATURES_XFER = 0x03, |
168 | XFER_UDMA_7 = 0x47, | 177 | XFER_UDMA_7 = 0x47, |
@@ -193,6 +202,8 @@ enum { | |||
193 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ | 202 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ |
194 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ | 203 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ |
195 | 204 | ||
205 | SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ | ||
206 | |||
196 | /* ATAPI stuff */ | 207 | /* ATAPI stuff */ |
197 | ATAPI_PKT_DMA = (1 << 0), | 208 | ATAPI_PKT_DMA = (1 << 0), |
198 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: | 209 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: |
@@ -282,7 +293,6 @@ struct ata_taskfile { | |||
282 | }; | 293 | }; |
283 | 294 | ||
284 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 295 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
285 | #define ata_id_is_sata(id) ((id)[93] == 0) | ||
286 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 296 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
287 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 297 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
288 | #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) | 298 | #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) |
@@ -324,6 +334,11 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
324 | return mver; | 334 | return mver; |
325 | } | 335 | } |
326 | 336 | ||
337 | static inline int ata_id_is_sata(const u16 *id) | ||
338 | { | ||
339 | return ata_id_major_version(id) >= 5 && id[93] == 0; | ||
340 | } | ||
341 | |||
327 | static inline int ata_id_current_chs_valid(const u16 *id) | 342 | static inline int ata_id_current_chs_valid(const u16 *id) |
328 | { | 343 | { |
329 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 344 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -350,7 +365,7 @@ static inline int ata_id_is_cfa(const u16 *id) | |||
350 | 365 | ||
351 | static inline int ata_drive_40wire(const u16 *dev_id) | 366 | static inline int ata_drive_40wire(const u16 *dev_id) |
352 | { | 367 | { |
353 | if (ata_id_major_version(dev_id) >= 5 && ata_id_is_sata(dev_id)) | 368 | if (ata_id_is_sata(dev_id)) |
354 | return 0; /* SATA */ | 369 | return 0; /* SATA */ |
355 | if ((dev_id[93] & 0xE000) == 0x6000) | 370 | if ((dev_id[93] & 0xE000) == 0x6000) |
356 | return 0; /* 80 wire */ | 371 | return 0; /* 80 wire */ |
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index d12984ddaa9f..ced8a1ed080c 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
@@ -101,7 +101,7 @@ struct ddpehdr { | |||
101 | 101 | ||
102 | static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb) | 102 | static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb) |
103 | { | 103 | { |
104 | return (struct ddpehdr *)skb->h.raw; | 104 | return (struct ddpehdr *)skb_transport_header(skb); |
105 | } | 105 | } |
106 | 106 | ||
107 | /* AppleTalk AARP headers */ | 107 | /* AppleTalk AARP headers */ |
@@ -129,7 +129,7 @@ struct elapaarp { | |||
129 | 129 | ||
130 | static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb) | 130 | static __inline__ struct elapaarp *aarp_hdr(struct sk_buff *skb) |
131 | { | 131 | { |
132 | return (struct elapaarp *)skb->h.raw; | 132 | return (struct elapaarp *)skb_transport_header(skb); |
133 | } | 133 | } |
134 | 134 | ||
135 | /* Not specified - how long till we drop a resolved entry */ | 135 | /* Not specified - how long till we drop a resolved entry */ |
diff --git a/include/linux/atmel_pdc.h b/include/linux/atmel_pdc.h new file mode 100644 index 000000000000..5058a31d2ce8 --- /dev/null +++ b/include/linux/atmel_pdc.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * include/linux/atmel_pdc.h | ||
3 | * | ||
4 | * Copyright (C) 2005 Ivan Kokshaysky | ||
5 | * Copyright (C) SAN People | ||
6 | * | ||
7 | * Peripheral Data Controller (PDC) registers. | ||
8 | * Based on AT91RM9200 datasheet revision E. | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | */ | ||
15 | |||
16 | #ifndef ATMEL_PDC_H | ||
17 | #define ATMEL_PDC_H | ||
18 | |||
19 | #define ATMEL_PDC_RPR 0x100 /* Receive Pointer Register */ | ||
20 | #define ATMEL_PDC_RCR 0x104 /* Receive Counter Register */ | ||
21 | #define ATMEL_PDC_TPR 0x108 /* Transmit Pointer Register */ | ||
22 | #define ATMEL_PDC_TCR 0x10c /* Transmit Counter Register */ | ||
23 | #define ATMEL_PDC_RNPR 0x110 /* Receive Next Pointer Register */ | ||
24 | #define ATMEL_PDC_RNCR 0x114 /* Receive Next Counter Register */ | ||
25 | #define ATMEL_PDC_TNPR 0x118 /* Transmit Next Pointer Register */ | ||
26 | #define ATMEL_PDC_TNCR 0x11c /* Transmit Next Counter Register */ | ||
27 | |||
28 | #define ATMEL_PDC_PTCR 0x120 /* Transfer Control Register */ | ||
29 | #define ATMEL_PDC_RXTEN (1 << 0) /* Receiver Transfer Enable */ | ||
30 | #define ATMEL_PDC_RXTDIS (1 << 1) /* Receiver Transfer Disable */ | ||
31 | #define ATMEL_PDC_TXTEN (1 << 8) /* Transmitter Transfer Enable */ | ||
32 | #define ATMEL_PDC_TXTDIS (1 << 9) /* Transmitter Transfer Disable */ | ||
33 | |||
34 | #define ATMEL_PDC_PTSR 0x124 /* Transfer Status Register */ | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/audit.h b/include/linux/audit.h index 0e07db6cc0d0..773e30df11ee 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #ifndef _LINUX_AUDIT_H_ | 24 | #ifndef _LINUX_AUDIT_H_ |
25 | #define _LINUX_AUDIT_H_ | 25 | #define _LINUX_AUDIT_H_ |
26 | 26 | ||
27 | #include <linux/types.h> | ||
27 | #include <linux/elf-em.h> | 28 | #include <linux/elf-em.h> |
28 | 29 | ||
29 | /* The netlink messages for the audit system is divided into blocks: | 30 | /* The netlink messages for the audit system is divided into blocks: |
@@ -89,6 +90,7 @@ | |||
89 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ | 90 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ |
90 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ | 91 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ |
91 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ | 92 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ |
93 | #define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ | ||
92 | 94 | ||
93 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 95 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
94 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 96 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -387,6 +389,7 @@ extern int __audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode | |||
387 | extern int audit_bprm(struct linux_binprm *bprm); | 389 | extern int audit_bprm(struct linux_binprm *bprm); |
388 | extern int audit_socketcall(int nargs, unsigned long *args); | 390 | extern int audit_socketcall(int nargs, unsigned long *args); |
389 | extern int audit_sockaddr(int len, void *addr); | 391 | extern int audit_sockaddr(int len, void *addr); |
392 | extern int __audit_fd_pair(int fd1, int fd2); | ||
390 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); | 393 | extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); |
391 | extern int audit_set_macxattr(const char *name); | 394 | extern int audit_set_macxattr(const char *name); |
392 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); | 395 | extern int __audit_mq_open(int oflag, mode_t mode, struct mq_attr __user *u_attr); |
@@ -401,6 +404,12 @@ static inline int audit_ipc_obj(struct kern_ipc_perm *ipcp) | |||
401 | return __audit_ipc_obj(ipcp); | 404 | return __audit_ipc_obj(ipcp); |
402 | return 0; | 405 | return 0; |
403 | } | 406 | } |
407 | static inline int audit_fd_pair(int fd1, int fd2) | ||
408 | { | ||
409 | if (unlikely(!audit_dummy_context())) | ||
410 | return __audit_fd_pair(fd1, fd2); | ||
411 | return 0; | ||
412 | } | ||
404 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) | 413 | static inline int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode) |
405 | { | 414 | { |
406 | if (unlikely(!audit_dummy_context())) | 415 | if (unlikely(!audit_dummy_context())) |
@@ -459,6 +468,7 @@ extern int audit_n_rules; | |||
459 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) | 468 | #define audit_ipc_set_perm(q,u,g,m) ({ 0; }) |
460 | #define audit_bprm(p) ({ 0; }) | 469 | #define audit_bprm(p) ({ 0; }) |
461 | #define audit_socketcall(n,a) ({ 0; }) | 470 | #define audit_socketcall(n,a) ({ 0; }) |
471 | #define audit_fd_pair(n,a) ({ 0; }) | ||
462 | #define audit_sockaddr(len, addr) ({ 0; }) | 472 | #define audit_sockaddr(len, addr) ({ 0; }) |
463 | #define audit_avc_path(dentry, mnt) ({ 0; }) | 473 | #define audit_avc_path(dentry, mnt) ({ 0; }) |
464 | #define audit_set_macxattr(n) do { ; } while (0) | 474 | #define audit_set_macxattr(n) do { ; } while (0) |
diff --git a/include/linux/auto_fs4.h b/include/linux/auto_fs4.h index 0a6bc52ffe88..31a29541b504 100644 --- a/include/linux/auto_fs4.h +++ b/include/linux/auto_fs4.h | |||
@@ -59,6 +59,13 @@ struct autofs_packet_expire_multi { | |||
59 | char name[NAME_MAX+1]; | 59 | char name[NAME_MAX+1]; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | union autofs_packet_union { | ||
63 | struct autofs_packet_hdr hdr; | ||
64 | struct autofs_packet_missing missing; | ||
65 | struct autofs_packet_expire expire; | ||
66 | struct autofs_packet_expire_multi expire_multi; | ||
67 | }; | ||
68 | |||
62 | /* autofs v5 common packet struct */ | 69 | /* autofs v5 common packet struct */ |
63 | struct autofs_v5_packet { | 70 | struct autofs_v5_packet { |
64 | struct autofs_packet_hdr hdr; | 71 | struct autofs_packet_hdr hdr; |
@@ -78,12 +85,13 @@ typedef struct autofs_v5_packet autofs_packet_expire_indirect_t; | |||
78 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; | 85 | typedef struct autofs_v5_packet autofs_packet_missing_direct_t; |
79 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; | 86 | typedef struct autofs_v5_packet autofs_packet_expire_direct_t; |
80 | 87 | ||
81 | union autofs_packet_union { | 88 | union autofs_v5_packet_union { |
82 | struct autofs_packet_hdr hdr; | 89 | struct autofs_packet_hdr hdr; |
83 | struct autofs_packet_missing missing; | ||
84 | struct autofs_packet_expire expire; | ||
85 | struct autofs_packet_expire_multi expire_multi; | ||
86 | struct autofs_v5_packet v5_packet; | 90 | struct autofs_v5_packet v5_packet; |
91 | autofs_packet_missing_indirect_t missing_indirect; | ||
92 | autofs_packet_expire_indirect_t expire_indirect; | ||
93 | autofs_packet_missing_direct_t missing_direct; | ||
94 | autofs_packet_expire_direct_t expire_direct; | ||
87 | }; | 95 | }; |
88 | 96 | ||
89 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) | 97 | #define AUTOFS_IOC_EXPIRE_MULTI _IOW(0x93,0x66,int) |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 7011d6255593..f2542c24b328 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -93,6 +93,7 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | 93 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); |
94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | 94 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); |
95 | long congestion_wait(int rw, long timeout); | 95 | long congestion_wait(int rw, long timeout); |
96 | long congestion_wait_interruptible(int rw, long timeout); | ||
96 | void congestion_end(int rw); | 97 | void congestion_end(int rw); |
97 | 98 | ||
98 | #define bdi_cap_writeback_dirty(bdi) \ | 99 | #define bdi_cap_writeback_dirty(bdi) \ |
diff --git a/include/linux/backlight.h b/include/linux/backlight.h index a5cf1beacb44..1023ba0d6e55 100644 --- a/include/linux/backlight.h +++ b/include/linux/backlight.h | |||
@@ -9,17 +9,28 @@ | |||
9 | #define _LINUX_BACKLIGHT_H | 9 | #define _LINUX_BACKLIGHT_H |
10 | 10 | ||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | ||
12 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
13 | 14 | ||
15 | /* Notes on locking: | ||
16 | * | ||
17 | * backlight_device->ops_lock is an internal backlight lock protecting the | ||
18 | * ops pointer and no code outside the core should need to touch it. | ||
19 | * | ||
20 | * Access to update_status() is serialised by the update_lock mutex since | ||
21 | * most drivers seem to need this and historically get it wrong. | ||
22 | * | ||
23 | * Most drivers don't need locking on their get_brightness() method. | ||
24 | * If yours does, you need to implement it in the driver. You can use the | ||
25 | * update_lock mutex if appropriate. | ||
26 | * | ||
27 | * Any other use of the locks below is probably wrong. | ||
28 | */ | ||
29 | |||
14 | struct backlight_device; | 30 | struct backlight_device; |
15 | struct fb_info; | 31 | struct fb_info; |
16 | 32 | ||
17 | /* This structure defines all the properties of a backlight | 33 | struct backlight_ops { |
18 | (usually attached to a LCD). */ | ||
19 | struct backlight_properties { | ||
20 | /* Owner module */ | ||
21 | struct module *owner; | ||
22 | |||
23 | /* Notify the backlight driver some property has changed */ | 34 | /* Notify the backlight driver some property has changed */ |
24 | int (*update_status)(struct backlight_device *); | 35 | int (*update_status)(struct backlight_device *); |
25 | /* Return the current backlight brightness (accounting for power, | 36 | /* Return the current backlight brightness (accounting for power, |
@@ -28,7 +39,10 @@ struct backlight_properties { | |||
28 | /* Check if given framebuffer device is the one bound to this backlight; | 39 | /* Check if given framebuffer device is the one bound to this backlight; |
29 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ | 40 | return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ |
30 | int (*check_fb)(struct fb_info *); | 41 | int (*check_fb)(struct fb_info *); |
42 | }; | ||
31 | 43 | ||
44 | /* This structure defines all the properties of a backlight */ | ||
45 | struct backlight_properties { | ||
32 | /* Current User requested brightness (0 - max_brightness) */ | 46 | /* Current User requested brightness (0 - max_brightness) */ |
33 | int brightness; | 47 | int brightness; |
34 | /* Maximal value for brightness (read-only) */ | 48 | /* Maximal value for brightness (read-only) */ |
@@ -41,20 +55,34 @@ struct backlight_properties { | |||
41 | }; | 55 | }; |
42 | 56 | ||
43 | struct backlight_device { | 57 | struct backlight_device { |
44 | /* This protects the 'props' field. If 'props' is NULL, the driver that | 58 | /* Backlight properties */ |
59 | struct backlight_properties props; | ||
60 | |||
61 | /* Serialise access to update_status method */ | ||
62 | struct mutex update_lock; | ||
63 | |||
64 | /* This protects the 'ops' field. If 'ops' is NULL, the driver that | ||
45 | registered this device has been unloaded, and if class_get_devdata() | 65 | registered this device has been unloaded, and if class_get_devdata() |
46 | points to something in the body of that driver, it is also invalid. */ | 66 | points to something in the body of that driver, it is also invalid. */ |
47 | struct semaphore sem; | 67 | struct mutex ops_lock; |
48 | /* If this is NULL, the backing module is unloaded */ | 68 | struct backlight_ops *ops; |
49 | struct backlight_properties *props; | 69 | |
50 | /* The framebuffer notifier block */ | 70 | /* The framebuffer notifier block */ |
51 | struct notifier_block fb_notif; | 71 | struct notifier_block fb_notif; |
52 | /* The class device structure */ | 72 | /* The class device structure */ |
53 | struct class_device class_dev; | 73 | struct class_device class_dev; |
54 | }; | 74 | }; |
55 | 75 | ||
76 | static inline void backlight_update_status(struct backlight_device *bd) | ||
77 | { | ||
78 | mutex_lock(&bd->update_lock); | ||
79 | if (bd->ops && bd->ops->update_status) | ||
80 | bd->ops->update_status(bd); | ||
81 | mutex_unlock(&bd->update_lock); | ||
82 | } | ||
83 | |||
56 | extern struct backlight_device *backlight_device_register(const char *name, | 84 | extern struct backlight_device *backlight_device_register(const char *name, |
57 | struct device *dev,void *devdata,struct backlight_properties *bp); | 85 | struct device *dev, void *devdata, struct backlight_ops *ops); |
58 | extern void backlight_device_unregister(struct backlight_device *bd); | 86 | extern void backlight_device_unregister(struct backlight_device *bd); |
59 | 87 | ||
60 | #define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) | 88 | #define to_backlight_device(obj) container_of(obj, struct backlight_device, class_dev) |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 08daf3272c02..4d85262b4fa4 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -276,7 +276,7 @@ extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, | |||
276 | extern mempool_t *bio_split_pool; | 276 | extern mempool_t *bio_split_pool; |
277 | extern void bio_pair_release(struct bio_pair *dbio); | 277 | extern void bio_pair_release(struct bio_pair *dbio); |
278 | 278 | ||
279 | extern struct bio_set *bioset_create(int, int, int); | 279 | extern struct bio_set *bioset_create(int, int); |
280 | extern void bioset_free(struct bio_set *); | 280 | extern void bioset_free(struct bio_set *); |
281 | 281 | ||
282 | extern struct bio *bio_alloc(gfp_t, int); | 282 | extern struct bio *bio_alloc(gfp_t, int); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 83dcd8c0e974..a686eabe22d6 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -116,6 +116,7 @@ struct io_context { | |||
116 | 116 | ||
117 | struct as_io_context *aic; | 117 | struct as_io_context *aic; |
118 | struct rb_root cic_root; | 118 | struct rb_root cic_root; |
119 | void *ioc_data; | ||
119 | }; | 120 | }; |
120 | 121 | ||
121 | void put_io_context(struct io_context *ioc); | 122 | void put_io_context(struct io_context *ioc); |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 2275f2748708..81c07cd18643 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -108,7 +108,7 @@ static inline void *alloc_remap(int nid, unsigned long size) | |||
108 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ | 108 | #endif /* CONFIG_HAVE_ARCH_ALLOC_REMAP */ |
109 | 109 | ||
110 | extern unsigned long __meminitdata nr_kernel_pages; | 110 | extern unsigned long __meminitdata nr_kernel_pages; |
111 | extern unsigned long nr_all_pages; | 111 | extern unsigned long __meminitdata nr_all_pages; |
112 | 112 | ||
113 | extern void *alloc_large_system_hash(const char *tablename, | 113 | extern void *alloc_large_system_hash(const char *tablename, |
114 | unsigned long bucketsize, | 114 | unsigned long bucketsize, |
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index bbbe7b4da0bb..f50f04bdbc16 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -939,7 +939,7 @@ struct cdrom_device_info { | |||
939 | int speed; /* maximum speed for reading data */ | 939 | int speed; /* maximum speed for reading data */ |
940 | int capacity; /* number of discs in jukebox */ | 940 | int capacity; /* number of discs in jukebox */ |
941 | /* device-related storage */ | 941 | /* device-related storage */ |
942 | int options : 30; /* options flags */ | 942 | unsigned int options : 30; /* options flags */ |
943 | unsigned mc_flags : 2; /* media change buffer flags */ | 943 | unsigned mc_flags : 2; /* media change buffer flags */ |
944 | int use_count; /* number of times device opened */ | 944 | int use_count; /* number of times device opened */ |
945 | char name[20]; /* name of the device type */ | 945 | char name[20]; /* name of the device type */ |
diff --git a/include/linux/cfag12864b.h b/include/linux/cfag12864b.h index 0bc45e69da5a..1605dd8aa646 100644 --- a/include/linux/cfag12864b.h +++ b/include/linux/cfag12864b.h | |||
@@ -73,5 +73,10 @@ extern void cfag12864b_disable(void); | |||
73 | */ | 73 | */ |
74 | extern unsigned char cfag12864b_isenabled(void); | 74 | extern unsigned char cfag12864b_isenabled(void); |
75 | 75 | ||
76 | /* | ||
77 | * Is the module inited? | ||
78 | */ | ||
79 | extern unsigned char cfag12864b_isinited(void); | ||
80 | |||
76 | #endif /* _CFAG12864B_H_ */ | 81 | #endif /* _CFAG12864B_H_ */ |
77 | 82 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index 80b17f440ec1..ccd863dd77fa 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -234,5 +234,24 @@ asmlinkage long compat_sys_migrate_pages(compat_pid_t pid, | |||
234 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, | 234 | compat_ulong_t maxnode, const compat_ulong_t __user *old_nodes, |
235 | const compat_ulong_t __user *new_nodes); | 235 | const compat_ulong_t __user *new_nodes); |
236 | 236 | ||
237 | /* | ||
238 | * epoll (fs/eventpoll.c) compat bits follow ... | ||
239 | */ | ||
240 | #ifndef CONFIG_HAS_COMPAT_EPOLL_EVENT | ||
241 | struct epoll_event; | ||
242 | #define compat_epoll_event epoll_event | ||
243 | #else | ||
244 | asmlinkage long compat_sys_epoll_ctl(int epfd, int op, int fd, | ||
245 | struct compat_epoll_event __user *event); | ||
246 | asmlinkage long compat_sys_epoll_wait(int epfd, | ||
247 | struct compat_epoll_event __user *events, | ||
248 | int maxevents, int timeout); | ||
249 | #endif | ||
250 | asmlinkage long compat_sys_epoll_pwait(int epfd, | ||
251 | struct compat_epoll_event __user *events, | ||
252 | int maxevents, int timeout, | ||
253 | const compat_sigset_t __user *sigmask, | ||
254 | compat_size_t sigsetsize); | ||
255 | |||
237 | #endif /* CONFIG_COMPAT */ | 256 | #endif /* CONFIG_COMPAT */ |
238 | #endif /* _LINUX_COMPAT_H */ | 257 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index aca66984aafd..3b6949b41745 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -15,8 +15,8 @@ | |||
15 | # define __acquire(x) __context__(x,1) | 15 | # define __acquire(x) __context__(x,1) |
16 | # define __release(x) __context__(x,-1) | 16 | # define __release(x) __context__(x,-1) |
17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
18 | extern void __chk_user_ptr(void __user *); | 18 | extern void __chk_user_ptr(const void __user *); |
19 | extern void __chk_io_ptr(void __iomem *); | 19 | extern void __chk_io_ptr(const void __iomem *); |
20 | #else | 20 | #else |
21 | # define __user | 21 | # define __user |
22 | # define __kernel | 22 | # define __kernel |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 769ddc6df492..c22b0dfcbcd2 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -127,9 +127,13 @@ static inline int cpu_is_offline(int cpu) { return 0; } | |||
127 | #endif /* CONFIG_HOTPLUG_CPU */ | 127 | #endif /* CONFIG_HOTPLUG_CPU */ |
128 | 128 | ||
129 | #ifdef CONFIG_SUSPEND_SMP | 129 | #ifdef CONFIG_SUSPEND_SMP |
130 | extern int suspend_cpu_hotplug; | ||
131 | |||
130 | extern int disable_nonboot_cpus(void); | 132 | extern int disable_nonboot_cpus(void); |
131 | extern void enable_nonboot_cpus(void); | 133 | extern void enable_nonboot_cpus(void); |
132 | #else | 134 | #else |
135 | #define suspend_cpu_hotplug 0 | ||
136 | |||
133 | static inline int disable_nonboot_cpus(void) { return 0; } | 137 | static inline int disable_nonboot_cpus(void) { return 0; } |
134 | static inline void enable_nonboot_cpus(void) {} | 138 | static inline void enable_nonboot_cpus(void) {} |
135 | #endif | 139 | #endif |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d0e8c8b0e34d..23f55140ccd5 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -398,11 +398,11 @@ extern cpumask_t cpu_present_map; | |||
398 | #endif | 398 | #endif |
399 | 399 | ||
400 | #ifdef CONFIG_SMP | 400 | #ifdef CONFIG_SMP |
401 | int highest_possible_processor_id(void); | 401 | extern int nr_cpu_ids; |
402 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) | 402 | #define any_online_cpu(mask) __any_online_cpu(&(mask)) |
403 | int __any_online_cpu(const cpumask_t *mask); | 403 | int __any_online_cpu(const cpumask_t *mask); |
404 | #else | 404 | #else |
405 | #define highest_possible_processor_id() 0 | 405 | #define nr_cpu_ids 1 |
406 | #define any_online_cpu(mask) 0 | 406 | #define any_online_cpu(mask) 0 |
407 | #endif | 407 | #endif |
408 | 408 | ||
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 1cb054bd93f2..fda2148d8c85 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -260,19 +260,20 @@ enum { | |||
260 | 260 | ||
261 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) | 261 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) |
262 | { | 262 | { |
263 | return (struct dccp_hdr *)skb->h.raw; | 263 | return (struct dccp_hdr *)skb_transport_header(skb); |
264 | } | 264 | } |
265 | 265 | ||
266 | static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) | 266 | static inline struct dccp_hdr *dccp_zeroed_hdr(struct sk_buff *skb, int headlen) |
267 | { | 267 | { |
268 | skb->h.raw = skb_push(skb, headlen); | 268 | skb_push(skb, headlen); |
269 | memset(skb->h.raw, 0, headlen); | 269 | skb_reset_transport_header(skb); |
270 | return dccp_hdr(skb); | 270 | return memset(skb_transport_header(skb), 0, headlen); |
271 | } | 271 | } |
272 | 272 | ||
273 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) | 273 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) |
274 | { | 274 | { |
275 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); | 275 | return (struct dccp_hdr_ext *)(skb_transport_header(skb) + |
276 | sizeof(struct dccp_hdr)); | ||
276 | } | 277 | } |
277 | 278 | ||
278 | static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) | 279 | static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) |
@@ -301,12 +302,14 @@ static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) | |||
301 | 302 | ||
302 | static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb) | 303 | static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb) |
303 | { | 304 | { |
304 | return (struct dccp_hdr_request *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 305 | return (struct dccp_hdr_request *)(skb_transport_header(skb) + |
306 | dccp_basic_hdr_len(skb)); | ||
305 | } | 307 | } |
306 | 308 | ||
307 | static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb) | 309 | static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb) |
308 | { | 310 | { |
309 | return (struct dccp_hdr_ack_bits *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 311 | return (struct dccp_hdr_ack_bits *)(skb_transport_header(skb) + |
312 | dccp_basic_hdr_len(skb)); | ||
310 | } | 313 | } |
311 | 314 | ||
312 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | 315 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) |
@@ -317,12 +320,14 @@ static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | |||
317 | 320 | ||
318 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) | 321 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) |
319 | { | 322 | { |
320 | return (struct dccp_hdr_response *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 323 | return (struct dccp_hdr_response *)(skb_transport_header(skb) + |
324 | dccp_basic_hdr_len(skb)); | ||
321 | } | 325 | } |
322 | 326 | ||
323 | static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb) | 327 | static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb) |
324 | { | 328 | { |
325 | return (struct dccp_hdr_reset *)(skb->h.raw + dccp_basic_hdr_len(skb)); | 329 | return (struct dccp_hdr_reset *)(skb_transport_header(skb) + |
330 | dccp_basic_hdr_len(skb)); | ||
326 | } | 331 | } |
327 | 332 | ||
328 | static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh) | 333 | static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh) |
@@ -460,26 +465,27 @@ struct dccp_ackvec; | |||
460 | * @dccps_service_list - second .. last service code on passive socket | 465 | * @dccps_service_list - second .. last service code on passive socket |
461 | * @dccps_timestamp_time - time of latest TIMESTAMP option | 466 | * @dccps_timestamp_time - time of latest TIMESTAMP option |
462 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option | 467 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option |
463 | * @dccps_l_ack_ratio - | 468 | * @dccps_l_ack_ratio - feature-local Ack Ratio |
464 | * @dccps_r_ack_ratio - | 469 | * @dccps_r_ack_ratio - feature-remote Ack Ratio |
465 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) | 470 | * @dccps_pcslen - sender partial checksum coverage (via sockopt) |
466 | * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) | 471 | * @dccps_pcrlen - receiver partial checksum coverage (via sockopt) |
467 | * @dccps_ndp_count - number of Non Data Packets since last data packet | 472 | * @dccps_ndp_count - number of Non Data Packets since last data packet |
468 | * @dccps_mss_cache - | 473 | * @dccps_mss_cache - current value of MSS (path MTU minus header sizes) |
469 | * @dccps_minisock - | 474 | * @dccps_minisock - associated minisock (accessed via dccp_msk) |
470 | * @dccps_hc_rx_ackvec - rx half connection ack vector | 475 | * @dccps_hc_rx_ackvec - rx half connection ack vector |
471 | * @dccps_hc_rx_ccid - | 476 | * @dccps_hc_rx_ccid - CCID used for the receiver (or receiving half-connection) |
472 | * @dccps_hc_tx_ccid - | 477 | * @dccps_hc_tx_ccid - CCID used for the sender (or sending half-connection) |
473 | * @dccps_options_received - | 478 | * @dccps_options_received - parsed set of retrieved options |
474 | * @dccps_epoch - | 479 | * @dccps_role - role of this sock, one of %dccp_role |
475 | * @dccps_role - Role of this sock, one of %dccp_role | 480 | * @dccps_hc_rx_insert_options - receiver wants to add options when acking |
476 | * @dccps_hc_rx_insert_options - | 481 | * @dccps_hc_tx_insert_options - sender wants to add options when sending |
477 | * @dccps_hc_tx_insert_options - | ||
478 | * @dccps_xmit_timer - timer for when CCID is not ready to send | 482 | * @dccps_xmit_timer - timer for when CCID is not ready to send |
483 | * @dccps_syn_rtt - RTT sample from Request/Response exchange (in usecs) | ||
479 | */ | 484 | */ |
480 | struct dccp_sock { | 485 | struct dccp_sock { |
481 | /* inet_connection_sock has to be the first member of dccp_sock */ | 486 | /* inet_connection_sock has to be the first member of dccp_sock */ |
482 | struct inet_connection_sock dccps_inet_connection; | 487 | struct inet_connection_sock dccps_inet_connection; |
488 | #define dccps_syn_rtt dccps_inet_connection.icsk_ack.lrcvtime | ||
483 | __u64 dccps_swl; | 489 | __u64 dccps_swl; |
484 | __u64 dccps_swh; | 490 | __u64 dccps_swh; |
485 | __u64 dccps_awl; | 491 | __u64 dccps_awl; |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index 047567d34ca7..5a9c49534d08 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -33,6 +33,9 @@ struct dentry *debugfs_create_file(const char *name, mode_t mode, | |||
33 | 33 | ||
34 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); | 34 | struct dentry *debugfs_create_dir(const char *name, struct dentry *parent); |
35 | 35 | ||
36 | struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent, | ||
37 | const char *dest); | ||
38 | |||
36 | void debugfs_remove(struct dentry *dentry); | 39 | void debugfs_remove(struct dentry *dentry); |
37 | 40 | ||
38 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, | 41 | struct dentry *debugfs_create_u8(const char *name, mode_t mode, |
@@ -41,6 +44,8 @@ struct dentry *debugfs_create_u16(const char *name, mode_t mode, | |||
41 | struct dentry *parent, u16 *value); | 44 | struct dentry *parent, u16 *value); |
42 | struct dentry *debugfs_create_u32(const char *name, mode_t mode, | 45 | struct dentry *debugfs_create_u32(const char *name, mode_t mode, |
43 | struct dentry *parent, u32 *value); | 46 | struct dentry *parent, u32 *value); |
47 | struct dentry *debugfs_create_u64(const char *name, mode_t mode, | ||
48 | struct dentry *parent, u64 *value); | ||
44 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 49 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
45 | struct dentry *parent, u32 *value); | 50 | struct dentry *parent, u32 *value); |
46 | 51 | ||
@@ -70,6 +75,13 @@ static inline struct dentry *debugfs_create_dir(const char *name, | |||
70 | return ERR_PTR(-ENODEV); | 75 | return ERR_PTR(-ENODEV); |
71 | } | 76 | } |
72 | 77 | ||
78 | static inline struct dentry *debugfs_create_symlink(const char *name, | ||
79 | struct dentry *parent, | ||
80 | const char *dest) | ||
81 | { | ||
82 | return ERR_PTR(-ENODEV); | ||
83 | } | ||
84 | |||
73 | static inline void debugfs_remove(struct dentry *dentry) | 85 | static inline void debugfs_remove(struct dentry *dentry) |
74 | { } | 86 | { } |
75 | 87 | ||
@@ -94,6 +106,13 @@ static inline struct dentry *debugfs_create_u32(const char *name, mode_t mode, | |||
94 | return ERR_PTR(-ENODEV); | 106 | return ERR_PTR(-ENODEV); |
95 | } | 107 | } |
96 | 108 | ||
109 | static inline struct dentry *debugfs_create_u64(const char *name, mode_t mode, | ||
110 | struct dentry *parent, | ||
111 | u64 *value) | ||
112 | { | ||
113 | return ERR_PTR(-ENODEV); | ||
114 | } | ||
115 | |||
97 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 116 | static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
98 | struct dentry *parent, | 117 | struct dentry *parent, |
99 | u32 *value) | 118 | u32 *value) |
diff --git a/include/linux/device.h b/include/linux/device.h index 26e4692f2d1a..a0cd2ced31a9 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * device.h - generic, centralized driver model | 2 | * device.h - generic, centralized driver model |
3 | * | 3 | * |
4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> | 4 | * Copyright (c) 2001-2003 Patrick Mochel <mochel@osdl.org> |
5 | * Copyright (c) 2004-2007 Greg Kroah-Hartman <gregkh@suse.de> | ||
5 | * | 6 | * |
6 | * This file is released under the GPLv2 | 7 | * This file is released under the GPLv2 |
7 | * | 8 | * |
@@ -33,9 +34,24 @@ struct device; | |||
33 | struct device_driver; | 34 | struct device_driver; |
34 | struct class; | 35 | struct class; |
35 | struct class_device; | 36 | struct class_device; |
37 | struct bus_type; | ||
38 | |||
39 | struct bus_attribute { | ||
40 | struct attribute attr; | ||
41 | ssize_t (*show)(struct bus_type *, char * buf); | ||
42 | ssize_t (*store)(struct bus_type *, const char * buf, size_t count); | ||
43 | }; | ||
44 | |||
45 | #define BUS_ATTR(_name,_mode,_show,_store) \ | ||
46 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) | ||
47 | |||
48 | extern int __must_check bus_create_file(struct bus_type *, | ||
49 | struct bus_attribute *); | ||
50 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | ||
36 | 51 | ||
37 | struct bus_type { | 52 | struct bus_type { |
38 | const char * name; | 53 | const char * name; |
54 | struct module * owner; | ||
39 | 55 | ||
40 | struct subsystem subsys; | 56 | struct subsystem subsys; |
41 | struct kset drivers; | 57 | struct kset drivers; |
@@ -48,6 +64,8 @@ struct bus_type { | |||
48 | struct bus_attribute * bus_attrs; | 64 | struct bus_attribute * bus_attrs; |
49 | struct device_attribute * dev_attrs; | 65 | struct device_attribute * dev_attrs; |
50 | struct driver_attribute * drv_attrs; | 66 | struct driver_attribute * drv_attrs; |
67 | struct bus_attribute drivers_autoprobe_attr; | ||
68 | struct bus_attribute drivers_probe_attr; | ||
51 | 69 | ||
52 | int (*match)(struct device * dev, struct device_driver * drv); | 70 | int (*match)(struct device * dev, struct device_driver * drv); |
53 | int (*uevent)(struct device *dev, char **envp, | 71 | int (*uevent)(struct device *dev, char **envp, |
@@ -60,6 +78,9 @@ struct bus_type { | |||
60 | int (*suspend_late)(struct device * dev, pm_message_t state); | 78 | int (*suspend_late)(struct device * dev, pm_message_t state); |
61 | int (*resume_early)(struct device * dev); | 79 | int (*resume_early)(struct device * dev); |
62 | int (*resume)(struct device * dev); | 80 | int (*resume)(struct device * dev); |
81 | |||
82 | unsigned int drivers_autoprobe:1; | ||
83 | unsigned int multithread_probe:1; | ||
63 | }; | 84 | }; |
64 | 85 | ||
65 | extern int __must_check bus_register(struct bus_type * bus); | 86 | extern int __must_check bus_register(struct bus_type * bus); |
@@ -101,40 +122,23 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
101 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | 122 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be |
102 | unbound */ | 123 | unbound */ |
103 | 124 | ||
104 | /* driverfs interface for exporting bus attributes */ | ||
105 | |||
106 | struct bus_attribute { | ||
107 | struct attribute attr; | ||
108 | ssize_t (*show)(struct bus_type *, char * buf); | ||
109 | ssize_t (*store)(struct bus_type *, const char * buf, size_t count); | ||
110 | }; | ||
111 | |||
112 | #define BUS_ATTR(_name,_mode,_show,_store) \ | ||
113 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) | ||
114 | |||
115 | extern int __must_check bus_create_file(struct bus_type *, | ||
116 | struct bus_attribute *); | ||
117 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | ||
118 | |||
119 | struct device_driver { | 125 | struct device_driver { |
120 | const char * name; | 126 | const char * name; |
121 | struct bus_type * bus; | 127 | struct bus_type * bus; |
122 | 128 | ||
123 | struct completion unloaded; | ||
124 | struct kobject kobj; | 129 | struct kobject kobj; |
125 | struct klist klist_devices; | 130 | struct klist klist_devices; |
126 | struct klist_node knode_bus; | 131 | struct klist_node knode_bus; |
127 | 132 | ||
128 | struct module * owner; | 133 | struct module * owner; |
129 | const char * mod_name; /* used for built-in modules */ | 134 | const char * mod_name; /* used for built-in modules */ |
135 | struct module_kobject * mkobj; | ||
130 | 136 | ||
131 | int (*probe) (struct device * dev); | 137 | int (*probe) (struct device * dev); |
132 | int (*remove) (struct device * dev); | 138 | int (*remove) (struct device * dev); |
133 | void (*shutdown) (struct device * dev); | 139 | void (*shutdown) (struct device * dev); |
134 | int (*suspend) (struct device * dev, pm_message_t state); | 140 | int (*suspend) (struct device * dev, pm_message_t state); |
135 | int (*resume) (struct device * dev); | 141 | int (*resume) (struct device * dev); |
136 | |||
137 | unsigned int multithread_probe:1; | ||
138 | }; | 142 | }; |
139 | 143 | ||
140 | 144 | ||
@@ -146,7 +150,7 @@ extern void put_driver(struct device_driver * drv); | |||
146 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | 150 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); |
147 | extern int driver_probe_done(void); | 151 | extern int driver_probe_done(void); |
148 | 152 | ||
149 | /* driverfs interface for exporting driver attributes */ | 153 | /* sysfs interface for exporting driver attributes */ |
150 | 154 | ||
151 | struct driver_attribute { | 155 | struct driver_attribute { |
152 | struct attribute attr; | 156 | struct attribute attr; |
@@ -179,10 +183,9 @@ struct class { | |||
179 | struct list_head children; | 183 | struct list_head children; |
180 | struct list_head devices; | 184 | struct list_head devices; |
181 | struct list_head interfaces; | 185 | struct list_head interfaces; |
186 | struct kset class_dirs; | ||
182 | struct semaphore sem; /* locks both the children and interfaces lists */ | 187 | struct semaphore sem; /* locks both the children and interfaces lists */ |
183 | 188 | ||
184 | struct kobject *virtual_dir; | ||
185 | |||
186 | struct class_attribute * class_attrs; | 189 | struct class_attribute * class_attrs; |
187 | struct class_device_attribute * class_dev_attrs; | 190 | struct class_device_attribute * class_dev_attrs; |
188 | struct device_attribute * dev_attrs; | 191 | struct device_attribute * dev_attrs; |
@@ -293,8 +296,6 @@ extern void class_device_initialize(struct class_device *); | |||
293 | extern int __must_check class_device_add(struct class_device *); | 296 | extern int __must_check class_device_add(struct class_device *); |
294 | extern void class_device_del(struct class_device *); | 297 | extern void class_device_del(struct class_device *); |
295 | 298 | ||
296 | extern int class_device_rename(struct class_device *, char *); | ||
297 | |||
298 | extern struct class_device * class_device_get(struct class_device *); | 299 | extern struct class_device * class_device_get(struct class_device *); |
299 | extern void class_device_put(struct class_device *); | 300 | extern void class_device_put(struct class_device *); |
300 | 301 | ||
@@ -328,11 +329,23 @@ extern struct class_device *class_device_create(struct class *cls, | |||
328 | __attribute__((format(printf,5,6))); | 329 | __attribute__((format(printf,5,6))); |
329 | extern void class_device_destroy(struct class *cls, dev_t devt); | 330 | extern void class_device_destroy(struct class *cls, dev_t devt); |
330 | 331 | ||
332 | /* | ||
333 | * The type of device, "struct device" is embedded in. A class | ||
334 | * or bus can contain devices of different types | ||
335 | * like "partitions" and "disks", "mouse" and "event". | ||
336 | * This identifies the device type and carries type-specific | ||
337 | * information, equivalent to the kobj_type of a kobject. | ||
338 | * If "name" is specified, the uevent will contain it in | ||
339 | * the DEVTYPE variable. | ||
340 | */ | ||
331 | struct device_type { | 341 | struct device_type { |
332 | struct device_attribute *attrs; | 342 | const char *name; |
343 | struct attribute_group **groups; | ||
333 | int (*uevent)(struct device *dev, char **envp, int num_envp, | 344 | int (*uevent)(struct device *dev, char **envp, int num_envp, |
334 | char *buffer, int buffer_size); | 345 | char *buffer, int buffer_size); |
335 | void (*release)(struct device *dev); | 346 | void (*release)(struct device *dev); |
347 | int (*suspend)(struct device * dev, pm_message_t state); | ||
348 | int (*resume)(struct device * dev); | ||
336 | }; | 349 | }; |
337 | 350 | ||
338 | /* interface for exporting device attributes */ | 351 | /* interface for exporting device attributes */ |
@@ -354,6 +367,12 @@ extern int __must_check device_create_bin_file(struct device *dev, | |||
354 | struct bin_attribute *attr); | 367 | struct bin_attribute *attr); |
355 | extern void device_remove_bin_file(struct device *dev, | 368 | extern void device_remove_bin_file(struct device *dev, |
356 | struct bin_attribute *attr); | 369 | struct bin_attribute *attr); |
370 | extern int device_schedule_callback_owner(struct device *dev, | ||
371 | void (*func)(struct device *), struct module *owner); | ||
372 | |||
373 | /* This is a macro to avoid include problems with THIS_MODULE */ | ||
374 | #define device_schedule_callback(dev, func) \ | ||
375 | device_schedule_callback_owner(dev, func, THIS_MODULE) | ||
357 | 376 | ||
358 | /* device resource management */ | 377 | /* device resource management */ |
359 | typedef void (*dr_release_t)(struct device *dev, void *res); | 378 | typedef void (*dr_release_t)(struct device *dev, void *res); |
@@ -552,7 +571,11 @@ extern const char *dev_driver_string(struct device *dev); | |||
552 | #define dev_dbg(dev, format, arg...) \ | 571 | #define dev_dbg(dev, format, arg...) \ |
553 | dev_printk(KERN_DEBUG , dev , format , ## arg) | 572 | dev_printk(KERN_DEBUG , dev , format , ## arg) |
554 | #else | 573 | #else |
555 | #define dev_dbg(dev, format, arg...) do { (void)(dev); } while (0) | 574 | static inline int __attribute__ ((format (printf, 2, 3))) |
575 | dev_dbg(struct device * dev, const char * fmt, ...) | ||
576 | { | ||
577 | return 0; | ||
578 | } | ||
556 | #endif | 579 | #endif |
557 | 580 | ||
558 | #define dev_err(dev, format, arg...) \ | 581 | #define dev_err(dev, format, arg...) \ |
diff --git a/include/linux/ds1742rtc.h b/include/linux/ds1742rtc.h deleted file mode 100644 index a83cdd1cafc9..000000000000 --- a/include/linux/ds1742rtc.h +++ /dev/null | |||
@@ -1,53 +0,0 @@ | |||
1 | /* | ||
2 | * ds1742rtc.h - register definitions for the Real-Time-Clock / CMOS RAM | ||
3 | * | ||
4 | * Copyright (C) 1999-2001 Toshiba Corporation | ||
5 | * Copyright (C) 2003 Ralf Baechle (ralf@linux-mips.org) | ||
6 | * | ||
7 | * Permission is hereby granted to copy, modify and redistribute this code | ||
8 | * in terms of the GNU Library General Public License, Version 2 or later, | ||
9 | * at your option. | ||
10 | */ | ||
11 | #ifndef __LINUX_DS1742RTC_H | ||
12 | #define __LINUX_DS1742RTC_H | ||
13 | |||
14 | #include <asm/ds1742.h> | ||
15 | |||
16 | #define RTC_BRAM_SIZE 0x800 | ||
17 | #define RTC_OFFSET 0x7f8 | ||
18 | |||
19 | /* | ||
20 | * Register summary | ||
21 | */ | ||
22 | #define RTC_CONTROL (RTC_OFFSET + 0) | ||
23 | #define RTC_CENTURY (RTC_OFFSET + 0) | ||
24 | #define RTC_SECONDS (RTC_OFFSET + 1) | ||
25 | #define RTC_MINUTES (RTC_OFFSET + 2) | ||
26 | #define RTC_HOURS (RTC_OFFSET + 3) | ||
27 | #define RTC_DAY (RTC_OFFSET + 4) | ||
28 | #define RTC_DATE (RTC_OFFSET + 5) | ||
29 | #define RTC_MONTH (RTC_OFFSET + 6) | ||
30 | #define RTC_YEAR (RTC_OFFSET + 7) | ||
31 | |||
32 | #define RTC_CENTURY_MASK 0x3f | ||
33 | #define RTC_SECONDS_MASK 0x7f | ||
34 | #define RTC_DAY_MASK 0x07 | ||
35 | |||
36 | /* | ||
37 | * Bits in the Control/Century register | ||
38 | */ | ||
39 | #define RTC_WRITE 0x80 | ||
40 | #define RTC_READ 0x40 | ||
41 | |||
42 | /* | ||
43 | * Bits in the Seconds register | ||
44 | */ | ||
45 | #define RTC_STOP 0x80 | ||
46 | |||
47 | /* | ||
48 | * Bits in the Day register | ||
49 | */ | ||
50 | #define RTC_BATT_FLAG 0x80 | ||
51 | #define RTC_FREQ_TEST 0x40 | ||
52 | |||
53 | #endif /* __LINUX_DS1742RTC_H */ | ||
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h index 0874a67c6b92..89412e18f571 100644 --- a/include/linux/dvb/audio.h +++ b/include/linux/dvb/audio.h | |||
@@ -47,7 +47,9 @@ typedef enum { | |||
47 | typedef enum { | 47 | typedef enum { |
48 | AUDIO_STEREO, | 48 | AUDIO_STEREO, |
49 | AUDIO_MONO_LEFT, | 49 | AUDIO_MONO_LEFT, |
50 | AUDIO_MONO_RIGHT | 50 | AUDIO_MONO_RIGHT, |
51 | AUDIO_MONO, | ||
52 | AUDIO_STEREO_SWAPPED | ||
51 | } audio_channel_select_t; | 53 | } audio_channel_select_t; |
52 | 54 | ||
53 | 55 | ||
@@ -133,5 +135,6 @@ typedef uint16_t audio_attributes_t; | |||
133 | * extracted by the PES parser. | 135 | * extracted by the PES parser. |
134 | */ | 136 | */ |
135 | #define AUDIO_GET_PTS _IOR('o', 19, __u64) | 137 | #define AUDIO_GET_PTS _IOR('o', 19, __u64) |
138 | #define AUDIO_BILINGUAL_CHANNEL_SELECT _IO('o', 20) | ||
136 | 139 | ||
137 | #endif /* _DVBAUDIO_H_ */ | 140 | #endif /* _DVBAUDIO_H_ */ |
diff --git a/include/linux/dvb/version.h b/include/linux/dvb/version.h index 6183c9c4849e..126e0c26cb09 100644 --- a/include/linux/dvb/version.h +++ b/include/linux/dvb/version.h | |||
@@ -24,6 +24,6 @@ | |||
24 | #define _DVBVERSION_H_ | 24 | #define _DVBVERSION_H_ |
25 | 25 | ||
26 | #define DVB_API_VERSION 3 | 26 | #define DVB_API_VERSION 3 |
27 | #define DVB_API_VERSION_MINOR 1 | 27 | #define DVB_API_VERSION_MINOR 2 |
28 | 28 | ||
29 | #endif /*_DVBVERSION_H_*/ | 29 | #endif /*_DVBVERSION_H_*/ |
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h index faebfda397ff..93e4c3a6d190 100644 --- a/include/linux/dvb/video.h +++ b/include/linux/dvb/video.h | |||
@@ -80,14 +80,70 @@ typedef enum { | |||
80 | } video_play_state_t; | 80 | } video_play_state_t; |
81 | 81 | ||
82 | 82 | ||
83 | /* Decoder commands */ | ||
84 | #define VIDEO_CMD_PLAY (0) | ||
85 | #define VIDEO_CMD_STOP (1) | ||
86 | #define VIDEO_CMD_FREEZE (2) | ||
87 | #define VIDEO_CMD_CONTINUE (3) | ||
88 | |||
89 | /* Flags for VIDEO_CMD_FREEZE */ | ||
90 | #define VIDEO_CMD_FREEZE_TO_BLACK (1 << 0) | ||
91 | |||
92 | /* Flags for VIDEO_CMD_STOP */ | ||
93 | #define VIDEO_CMD_STOP_TO_BLACK (1 << 0) | ||
94 | #define VIDEO_CMD_STOP_IMMEDIATELY (1 << 1) | ||
95 | |||
96 | /* Play input formats: */ | ||
97 | /* The decoder has no special format requirements */ | ||
98 | #define VIDEO_PLAY_FMT_NONE (0) | ||
99 | /* The decoder requires full GOPs */ | ||
100 | #define VIDEO_PLAY_FMT_GOP (1) | ||
101 | |||
102 | /* The structure must be zeroed before use by the application | ||
103 | This ensures it can be extended safely in the future. */ | ||
104 | struct video_command { | ||
105 | __u32 cmd; | ||
106 | __u32 flags; | ||
107 | union { | ||
108 | struct { | ||
109 | __u64 pts; | ||
110 | } stop; | ||
111 | |||
112 | struct { | ||
113 | /* 0 or 1000 specifies normal speed, | ||
114 | 1 specifies forward single stepping, | ||
115 | -1 specifies backward single stepping, | ||
116 | >1: playback at speed/1000 of the normal speed, | ||
117 | <-1: reverse playback at (-speed/1000) of the normal speed. */ | ||
118 | __s32 speed; | ||
119 | __u32 format; | ||
120 | } play; | ||
121 | |||
122 | struct { | ||
123 | __u32 data[16]; | ||
124 | } raw; | ||
125 | }; | ||
126 | }; | ||
127 | |||
128 | /* FIELD_UNKNOWN can be used if the hardware does not know whether | ||
129 | the Vsync is for an odd, even or progressive (i.e. non-interlaced) | ||
130 | field. */ | ||
131 | #define VIDEO_VSYNC_FIELD_UNKNOWN (0) | ||
132 | #define VIDEO_VSYNC_FIELD_ODD (1) | ||
133 | #define VIDEO_VSYNC_FIELD_EVEN (2) | ||
134 | #define VIDEO_VSYNC_FIELD_PROGRESSIVE (3) | ||
135 | |||
83 | struct video_event { | 136 | struct video_event { |
84 | int32_t type; | 137 | int32_t type; |
85 | #define VIDEO_EVENT_SIZE_CHANGED 1 | 138 | #define VIDEO_EVENT_SIZE_CHANGED 1 |
86 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 | 139 | #define VIDEO_EVENT_FRAME_RATE_CHANGED 2 |
140 | #define VIDEO_EVENT_DECODER_STOPPED 3 | ||
141 | #define VIDEO_EVENT_VSYNC 4 | ||
87 | time_t timestamp; | 142 | time_t timestamp; |
88 | union { | 143 | union { |
89 | video_size_t size; | 144 | video_size_t size; |
90 | unsigned int frame_rate; /* in frames per 1000sec */ | 145 | unsigned int frame_rate; /* in frames per 1000sec */ |
146 | unsigned char vsync_field; /* unknown/odd/even/progressive */ | ||
91 | } u; | 147 | } u; |
92 | }; | 148 | }; |
93 | 149 | ||
@@ -213,4 +269,10 @@ typedef uint16_t video_attributes_t; | |||
213 | */ | 269 | */ |
214 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | 270 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) |
215 | 271 | ||
272 | /* Read the number of displayed frames since the decoder was started */ | ||
273 | #define VIDEO_GET_FRAME_COUNT _IOR('o', 58, __u64) | ||
274 | |||
275 | #define VIDEO_COMMAND _IOWR('o', 59, struct video_command) | ||
276 | #define VIDEO_TRY_COMMAND _IOWR('o', 60, struct video_command) | ||
277 | |||
216 | #endif /*_DVBVIDEO_H_*/ | 278 | #endif /*_DVBVIDEO_H_*/ |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 84cfa8bbdc36..d2a96cbf4f0e 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -31,12 +31,19 @@ | |||
31 | /* | 31 | /* |
32 | * On x86-64 make the 64bit structure have the same alignment as the | 32 | * On x86-64 make the 64bit structure have the same alignment as the |
33 | * 32bit structure. This makes 32bit emulation easier. | 33 | * 32bit structure. This makes 32bit emulation easier. |
34 | * | ||
35 | * UML/x86_64 needs the same packing as x86_64 - UML + UML_X86 + | ||
36 | * 64_BIT adds up to UML/x86_64. | ||
34 | */ | 37 | */ |
35 | #ifdef __x86_64__ | 38 | #ifdef __x86_64__ |
36 | #define EPOLL_PACKED __attribute__((packed)) | 39 | #define EPOLL_PACKED __attribute__((packed)) |
37 | #else | 40 | #else |
41 | #if defined(CONFIG_UML) && defined(CONFIG_UML_X86) && defined(CONFIG_64BIT) | ||
42 | #define EPOLL_PACKED __attribute__((packed)) | ||
43 | #else | ||
38 | #define EPOLL_PACKED | 44 | #define EPOLL_PACKED |
39 | #endif | 45 | #endif |
46 | #endif | ||
40 | 47 | ||
41 | struct epoll_event { | 48 | struct epoll_event { |
42 | __u32 events; | 49 | __u32 events; |
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h index a41cc24568ca..7eb1d73fc5d1 100644 --- a/include/linux/ext4_fs_extents.h +++ b/include/linux/ext4_fs_extents.h | |||
@@ -22,12 +22,12 @@ | |||
22 | #include <linux/ext4_fs.h> | 22 | #include <linux/ext4_fs.h> |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * With AGRESSIVE_TEST defined, the capacity of index/leaf blocks | 25 | * With AGGRESSIVE_TEST defined, the capacity of index/leaf blocks |
26 | * becomes very small, so index split, in-depth growing and | 26 | * becomes very small, so index split, in-depth growing and |
27 | * other hard changes happen much more often. | 27 | * other hard changes happen much more often. |
28 | * This is for debug purposes only. | 28 | * This is for debug purposes only. |
29 | */ | 29 | */ |
30 | #define AGRESSIVE_TEST_ | 30 | #define AGGRESSIVE_TEST_ |
31 | 31 | ||
32 | /* | 32 | /* |
33 | * With EXTENTS_STATS defined, the number of blocks and extents | 33 | * With EXTENTS_STATS defined, the number of blocks and extents |
diff --git a/include/linux/fb.h b/include/linux/fb.h index a78e25683f82..be913ec87169 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -516,13 +516,15 @@ struct fb_cursor_user { | |||
516 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 | 516 | #define FB_EVENT_GET_CONSOLE_MAP 0x07 |
517 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ | 517 | /* CONSOLE-SPECIFIC: set console to framebuffer mapping */ |
518 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 | 518 | #define FB_EVENT_SET_CONSOLE_MAP 0x08 |
519 | /* A display blank is requested */ | 519 | /* A hardware display blank change occured */ |
520 | #define FB_EVENT_BLANK 0x09 | 520 | #define FB_EVENT_BLANK 0x09 |
521 | /* Private modelist is to be replaced */ | 521 | /* Private modelist is to be replaced */ |
522 | #define FB_EVENT_NEW_MODELIST 0x0A | 522 | #define FB_EVENT_NEW_MODELIST 0x0A |
523 | /* The resolution of the passed in fb_info about to change and | 523 | /* The resolution of the passed in fb_info about to change and |
524 | all vc's should be changed */ | 524 | all vc's should be changed */ |
525 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B | 525 | #define FB_EVENT_MODE_CHANGE_ALL 0x0B |
526 | /* A software display blank change occured */ | ||
527 | #define FB_EVENT_CONBLANK 0x0C | ||
526 | 528 | ||
527 | struct fb_event { | 529 | struct fb_event { |
528 | struct fb_info *info; | 530 | struct fb_info *info; |
@@ -767,16 +769,13 @@ struct fb_info { | |||
767 | struct fb_videomode *mode; /* current mode */ | 769 | struct fb_videomode *mode; /* current mode */ |
768 | 770 | ||
769 | #ifdef CONFIG_FB_BACKLIGHT | 771 | #ifdef CONFIG_FB_BACKLIGHT |
770 | /* Lock ordering: | ||
771 | * bl_mutex (protects bl_dev and bl_curve) | ||
772 | * bl_dev->sem (backlight class) | ||
773 | */ | ||
774 | struct mutex bl_mutex; | ||
775 | |||
776 | /* assigned backlight device */ | 772 | /* assigned backlight device */ |
773 | /* set before framebuffer registration, | ||
774 | remove after unregister */ | ||
777 | struct backlight_device *bl_dev; | 775 | struct backlight_device *bl_dev; |
778 | 776 | ||
779 | /* Backlight level curve */ | 777 | /* Backlight level curve */ |
778 | struct mutex bl_curve_mutex; | ||
780 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; | 779 | u8 bl_curve[FB_BACKLIGHT_LEVELS]; |
781 | #endif | 780 | #endif |
782 | 781 | ||
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h index 8270aac2aa5d..87b606b63f1e 100644 --- a/include/linux/fib_rules.h +++ b/include/linux/fib_rules.h | |||
@@ -5,8 +5,13 @@ | |||
5 | #include <linux/rtnetlink.h> | 5 | #include <linux/rtnetlink.h> |
6 | 6 | ||
7 | /* rule is permanent, and cannot be deleted */ | 7 | /* rule is permanent, and cannot be deleted */ |
8 | #define FIB_RULE_PERMANENT 1 | 8 | #define FIB_RULE_PERMANENT 0x00000001 |
9 | #define FIB_RULE_INVERT 2 | 9 | #define FIB_RULE_INVERT 0x00000002 |
10 | #define FIB_RULE_UNRESOLVED 0x00000004 | ||
11 | #define FIB_RULE_DEV_DETACHED 0x00000008 | ||
12 | |||
13 | /* try to find source address in routing lookups */ | ||
14 | #define FIB_RULE_FIND_SADDR 0x00010000 | ||
10 | 15 | ||
11 | struct fib_rule_hdr | 16 | struct fib_rule_hdr |
12 | { | 17 | { |
@@ -29,7 +34,7 @@ enum | |||
29 | FRA_DST, /* destination address */ | 34 | FRA_DST, /* destination address */ |
30 | FRA_SRC, /* source address */ | 35 | FRA_SRC, /* source address */ |
31 | FRA_IFNAME, /* interface name */ | 36 | FRA_IFNAME, /* interface name */ |
32 | FRA_UNUSED1, | 37 | FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ |
33 | FRA_UNUSED2, | 38 | FRA_UNUSED2, |
34 | FRA_PRIORITY, /* priority/preference */ | 39 | FRA_PRIORITY, /* priority/preference */ |
35 | FRA_UNUSED3, | 40 | FRA_UNUSED3, |
@@ -51,8 +56,8 @@ enum | |||
51 | { | 56 | { |
52 | FR_ACT_UNSPEC, | 57 | FR_ACT_UNSPEC, |
53 | FR_ACT_TO_TBL, /* Pass to fixed table */ | 58 | FR_ACT_TO_TBL, /* Pass to fixed table */ |
54 | FR_ACT_RES1, | 59 | FR_ACT_GOTO, /* Jump to another rule */ |
55 | FR_ACT_RES2, | 60 | FR_ACT_NOP, /* No operation */ |
56 | FR_ACT_RES3, | 61 | FR_ACT_RES3, |
57 | FR_ACT_RES4, | 62 | FR_ACT_RES4, |
58 | FR_ACT_BLACKHOLE, /* Drop without notification */ | 63 | FR_ACT_BLACKHOLE, /* Drop without notification */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 86ec3f4a7da6..095a9c9a64fb 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -843,8 +843,13 @@ extern int fcntl_setlease(unsigned int fd, struct file *filp, long arg); | |||
843 | extern int fcntl_getlease(struct file *filp); | 843 | extern int fcntl_getlease(struct file *filp); |
844 | 844 | ||
845 | /* fs/sync.c */ | 845 | /* fs/sync.c */ |
846 | extern int do_sync_file_range(struct file *file, loff_t offset, loff_t endbyte, | 846 | extern int do_sync_mapping_range(struct address_space *mapping, loff_t offset, |
847 | unsigned int flags); | 847 | loff_t endbyte, unsigned int flags); |
848 | static inline int do_sync_file_range(struct file *file, loff_t offset, | ||
849 | loff_t endbyte, unsigned int flags) | ||
850 | { | ||
851 | return do_sync_mapping_range(file->f_mapping, offset, endbyte, flags); | ||
852 | } | ||
848 | 853 | ||
849 | /* fs/locks.c */ | 854 | /* fs/locks.c */ |
850 | extern void locks_init_lock(struct file_lock *); | 855 | extern void locks_init_lock(struct file_lock *); |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index abb64c437f6f..73710d617775 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -120,44 +120,5 @@ struct fsl_spi_platform_data { | |||
120 | u32 sysclk; | 120 | u32 sysclk; |
121 | }; | 121 | }; |
122 | 122 | ||
123 | /* Ethernet interface (phy management and speed) | ||
124 | */ | ||
125 | enum enet_interface { | ||
126 | ENET_10_MII, /* 10 Base T, MII interface */ | ||
127 | ENET_10_RMII, /* 10 Base T, RMII interface */ | ||
128 | ENET_10_RGMII, /* 10 Base T, RGMII interface */ | ||
129 | ENET_100_MII, /* 100 Base T, MII interface */ | ||
130 | ENET_100_RMII, /* 100 Base T, RMII interface */ | ||
131 | ENET_100_RGMII, /* 100 Base T, RGMII interface */ | ||
132 | ENET_1000_GMII, /* 1000 Base T, GMII interface */ | ||
133 | ENET_1000_RGMII, /* 1000 Base T, RGMII interface */ | ||
134 | ENET_1000_TBI, /* 1000 Base T, TBI interface */ | ||
135 | ENET_1000_RTBI /* 1000 Base T, RTBI interface */ | ||
136 | }; | ||
137 | |||
138 | struct ucc_geth_platform_data { | ||
139 | /* device specific information */ | ||
140 | u32 device_flags; | ||
141 | u32 phy_reg_addr; | ||
142 | |||
143 | /* board specific information */ | ||
144 | u32 board_flags; | ||
145 | u8 rx_clock; | ||
146 | u8 tx_clock; | ||
147 | u32 phy_id; | ||
148 | enum enet_interface phy_interface; | ||
149 | u32 phy_interrupt; | ||
150 | u8 mac_addr[6]; | ||
151 | }; | ||
152 | |||
153 | /* Flags related to UCC Gigabit Ethernet device features */ | ||
154 | #define FSL_UGETH_DEV_HAS_GIGABIT 0x00000001 | ||
155 | #define FSL_UGETH_DEV_HAS_COALESCE 0x00000002 | ||
156 | #define FSL_UGETH_DEV_HAS_RMON 0x00000004 | ||
157 | |||
158 | /* Flags in ucc_geth_platform_data */ | ||
159 | #define FSL_UGETH_BRD_HAS_PHY_INTR 0x00000001 | ||
160 | /* if not set use a timer */ | ||
161 | |||
162 | #endif /* _FSL_DEVICE_H_ */ | 123 | #endif /* _FSL_DEVICE_H_ */ |
163 | #endif /* __KERNEL__ */ | 124 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h new file mode 100644 index 000000000000..2b217c7b9312 --- /dev/null +++ b/include/linux/gpio_keys.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _GPIO_KEYS_H | ||
2 | #define _GPIO_KEYS_H | ||
3 | |||
4 | struct gpio_keys_button { | ||
5 | /* Configuration parameters */ | ||
6 | int keycode; | ||
7 | int gpio; | ||
8 | int active_low; | ||
9 | char *desc; | ||
10 | }; | ||
11 | |||
12 | struct gpio_keys_platform_data { | ||
13 | struct gpio_keys_button *buttons; | ||
14 | int nbuttons; | ||
15 | }; | ||
16 | |||
17 | #endif | ||
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index d4b333938f73..db390c511ada 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -43,8 +43,7 @@ struct hdlc_proto { | |||
43 | void (*stop)(struct net_device *dev); /* if open & !DCD */ | 43 | void (*stop)(struct net_device *dev); /* if open & !DCD */ |
44 | void (*detach)(struct net_device *dev); | 44 | void (*detach)(struct net_device *dev); |
45 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); | 45 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); |
46 | unsigned short (*type_trans)(struct sk_buff *skb, | 46 | __be16 (*type_trans)(struct sk_buff *skb, struct net_device *dev); |
47 | struct net_device *dev); | ||
48 | struct module *module; | 47 | struct module *module; |
49 | struct hdlc_proto *next; /* next protocol in the list */ | 48 | struct hdlc_proto *next; /* next protocol in the list */ |
50 | }; | 49 | }; |
@@ -132,8 +131,8 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, | |||
132 | { | 131 | { |
133 | hdlc_device *hdlc = dev_to_hdlc(dev); | 132 | hdlc_device *hdlc = dev_to_hdlc(dev); |
134 | 133 | ||
135 | skb->mac.raw = skb->data; | 134 | skb->dev = dev; |
136 | skb->dev = dev; | 135 | skb_reset_mac_header(skb); |
137 | 136 | ||
138 | if (hdlc->proto->type_trans) | 137 | if (hdlc->proto->type_trans) |
139 | return hdlc->proto->type_trans(skb, dev); | 138 | return hdlc->proto->type_trans(skb, dev); |
diff --git a/include/linux/hid.h b/include/linux/hid.h index d26b08f461f2..37076b116ed0 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -6,7 +6,7 @@ | |||
6 | * | 6 | * |
7 | * Copyright (c) 1999 Andreas Gal | 7 | * Copyright (c) 1999 Andreas Gal |
8 | * Copyright (c) 2000-2001 Vojtech Pavlik | 8 | * Copyright (c) 2000-2001 Vojtech Pavlik |
9 | * Copyright (c) 2006 Jiri Kosina | 9 | * Copyright (c) 2006-2007 Jiri Kosina |
10 | */ | 10 | */ |
11 | 11 | ||
12 | /* | 12 | /* |
@@ -247,6 +247,11 @@ struct hid_item { | |||
247 | * HID device quirks. | 247 | * HID device quirks. |
248 | */ | 248 | */ |
249 | 249 | ||
250 | /* | ||
251 | * Increase this if you need to configure more HID quirks at module load time | ||
252 | */ | ||
253 | #define MAX_USBHID_BOOT_QUIRKS 4 | ||
254 | |||
250 | #define HID_QUIRK_INVERT 0x00000001 | 255 | #define HID_QUIRK_INVERT 0x00000001 |
251 | #define HID_QUIRK_NOTOUCH 0x00000002 | 256 | #define HID_QUIRK_NOTOUCH 0x00000002 |
252 | #define HID_QUIRK_IGNORE 0x00000004 | 257 | #define HID_QUIRK_IGNORE 0x00000004 |
@@ -267,6 +272,9 @@ struct hid_item { | |||
267 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 | 272 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 |
268 | #define HID_QUIRK_IGNORE_MOUSE 0x00040000 | 273 | #define HID_QUIRK_IGNORE_MOUSE 0x00040000 |
269 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 | 274 | #define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 |
275 | #define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 | ||
276 | #define HID_QUIRK_DUPLICATE_USAGES 0x00200000 | ||
277 | #define HID_QUIRK_RESET_LEDS 0x00400000 | ||
270 | 278 | ||
271 | /* | 279 | /* |
272 | * This is the global environment of the parser. This information is | 280 | * This is the global environment of the parser. This information is |
@@ -292,7 +300,7 @@ struct hid_global { | |||
292 | */ | 300 | */ |
293 | 301 | ||
294 | #define HID_MAX_DESCRIPTOR_SIZE 4096 | 302 | #define HID_MAX_DESCRIPTOR_SIZE 4096 |
295 | #define HID_MAX_USAGES 1024 | 303 | #define HID_MAX_USAGES 8192 |
296 | #define HID_DEFAULT_NUM_COLLECTIONS 16 | 304 | #define HID_DEFAULT_NUM_COLLECTIONS 16 |
297 | 305 | ||
298 | struct hid_local { | 306 | struct hid_local { |
@@ -492,6 +500,12 @@ void hid_output_report(struct hid_report *report, __u8 *data); | |||
492 | void hid_free_device(struct hid_device *device); | 500 | void hid_free_device(struct hid_device *device); |
493 | struct hid_device *hid_parse_report(__u8 *start, unsigned size); | 501 | struct hid_device *hid_parse_report(__u8 *start, unsigned size); |
494 | 502 | ||
503 | /* HID quirks API */ | ||
504 | u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct); | ||
505 | int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); | ||
506 | int usbhid_quirks_init(char **quirks_param); | ||
507 | void usbhid_quirks_exit(void); | ||
508 | |||
495 | #ifdef CONFIG_HID_FF | 509 | #ifdef CONFIG_HID_FF |
496 | int hid_ff_init(struct hid_device *hid); | 510 | int hid_ff_init(struct hid_device *hid); |
497 | 511 | ||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 37f9279192a9..17c29dca8354 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -47,7 +47,7 @@ enum hrtimer_restart { | |||
47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context | 47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context |
48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and | 48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and |
49 | * does not restart the timer | 49 | * does not restart the timer |
50 | * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in softirq context | 50 | * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context |
51 | * Special mode for tick emultation | 51 | * Special mode for tick emultation |
52 | */ | 52 | */ |
53 | enum hrtimer_cb_mode { | 53 | enum hrtimer_cb_mode { |
@@ -139,7 +139,8 @@ struct hrtimer_sleeper { | |||
139 | }; | 139 | }; |
140 | 140 | ||
141 | /** | 141 | /** |
142 | * struct hrtimer_base - the timer base for a specific clock | 142 | * struct hrtimer_clock_base - the timer base for a specific clock |
143 | * @cpu_base: per cpu clock base | ||
143 | * @index: clock type index for per_cpu support when moving a | 144 | * @index: clock type index for per_cpu support when moving a |
144 | * timer to a base on another cpu. | 145 | * timer to a base on another cpu. |
145 | * @active: red black tree root node for the active timers | 146 | * @active: red black tree root node for the active timers |
@@ -205,6 +206,7 @@ struct hrtimer_cpu_base { | |||
205 | struct clock_event_device; | 206 | struct clock_event_device; |
206 | 207 | ||
207 | extern void clock_was_set(void); | 208 | extern void clock_was_set(void); |
209 | extern void hres_timers_resume(void); | ||
208 | extern void hrtimer_interrupt(struct clock_event_device *dev); | 210 | extern void hrtimer_interrupt(struct clock_event_device *dev); |
209 | 211 | ||
210 | /* | 212 | /* |
@@ -235,6 +237,8 @@ static inline ktime_t hrtimer_cb_get_time(struct hrtimer *timer) | |||
235 | */ | 237 | */ |
236 | static inline void clock_was_set(void) { } | 238 | static inline void clock_was_set(void) { } |
237 | 239 | ||
240 | static inline void hres_timers_resume(void) { } | ||
241 | |||
238 | /* | 242 | /* |
239 | * In non high resolution mode the time reference is taken from | 243 | * In non high resolution mode the time reference is taken from |
240 | * the base softirq time variable. | 244 | * the base softirq time variable. |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index a60995afe334..3f3e7a648da3 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 <linux/shm.h> | ||
7 | #include <asm/tlbflush.h> | 8 | #include <asm/tlbflush.h> |
8 | 9 | ||
9 | struct ctl_table; | 10 | struct ctl_table; |
@@ -168,7 +169,12 @@ void hugetlb_put_quota(struct address_space *mapping); | |||
168 | 169 | ||
169 | static inline int is_file_hugepages(struct file *file) | 170 | static inline int is_file_hugepages(struct file *file) |
170 | { | 171 | { |
171 | return file->f_op == &hugetlbfs_file_operations; | 172 | if (file->f_op == &hugetlbfs_file_operations) |
173 | return 1; | ||
174 | if (is_file_shm_hugepages(file)) | ||
175 | return 1; | ||
176 | |||
177 | return 0; | ||
172 | } | 178 | } |
173 | 179 | ||
174 | static inline void set_file_hugepages(struct file *file) | 180 | static inline void set_file_hugepages(struct file *file) |
diff --git a/include/linux/icmp.h b/include/linux/icmp.h index 24da4fbc1a2f..474f2a51cf0a 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h | |||
@@ -82,6 +82,15 @@ struct icmphdr { | |||
82 | } un; | 82 | } un; |
83 | }; | 83 | }; |
84 | 84 | ||
85 | #ifdef __KERNEL__ | ||
86 | #include <linux/skbuff.h> | ||
87 | |||
88 | static inline struct icmphdr *icmp_hdr(const struct sk_buff *skb) | ||
89 | { | ||
90 | return (struct icmphdr *)skb_transport_header(skb); | ||
91 | } | ||
92 | #endif | ||
93 | |||
85 | /* | 94 | /* |
86 | * constants for (set|get)sockopt | 95 | * constants for (set|get)sockopt |
87 | */ | 96 | */ |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 68d3526c3a05..7c5e9817e998 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -75,6 +75,15 @@ struct icmp6hdr { | |||
75 | #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref | 75 | #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref |
76 | }; | 76 | }; |
77 | 77 | ||
78 | #ifdef __KERNEL__ | ||
79 | #include <linux/skbuff.h> | ||
80 | |||
81 | static inline struct icmp6hdr *icmp6_hdr(const struct sk_buff *skb) | ||
82 | { | ||
83 | return (struct icmp6hdr *)skb_transport_header(skb); | ||
84 | } | ||
85 | #endif | ||
86 | |||
78 | #define ICMPV6_ROUTER_PREF_LOW 0x3 | 87 | #define ICMPV6_ROUTER_PREF_LOW 0x3 |
79 | #define ICMPV6_ROUTER_PREF_MEDIUM 0x0 | 88 | #define ICMPV6_ROUTER_PREF_MEDIUM 0x0 |
80 | #define ICMPV6_ROUTER_PREF_HIGH 0x1 | 89 | #define ICMPV6_ROUTER_PREF_HIGH 0x1 |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 04e0fa97ac99..d3bbc7188b6a 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -615,6 +615,7 @@ typedef struct ide_drive_s { | |||
615 | u8 init_speed; /* transfer rate set at boot */ | 615 | u8 init_speed; /* transfer rate set at boot */ |
616 | u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ | 616 | u8 pio_speed; /* unused by core, used by some drivers for fallback from DMA */ |
617 | u8 current_speed; /* current transfer rate set */ | 617 | u8 current_speed; /* current transfer rate set */ |
618 | u8 desired_speed; /* desired transfer rate set */ | ||
618 | u8 dn; /* now wide spread use */ | 619 | u8 dn; /* now wide spread use */ |
619 | u8 wcache; /* status of write cache */ | 620 | u8 wcache; /* status of write cache */ |
620 | u8 acoustic; /* acoustic management */ | 621 | u8 acoustic; /* acoustic management */ |
@@ -636,7 +637,6 @@ typedef struct ide_drive_s { | |||
636 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 637 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
637 | unsigned int cyl; /* "real" number of cyls */ | 638 | unsigned int cyl; /* "real" number of cyls */ |
638 | unsigned int drive_data; /* use by tuneproc/selectproc */ | 639 | unsigned int drive_data; /* use by tuneproc/selectproc */ |
639 | unsigned int usage; /* current "open()" count for drive */ | ||
640 | unsigned int failures; /* current failure count */ | 640 | unsigned int failures; /* current failure count */ |
641 | unsigned int max_failures; /* maximum allowed failure count */ | 641 | unsigned int max_failures; /* maximum allowed failure count */ |
642 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 642 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ |
@@ -736,23 +736,22 @@ typedef struct hwif_s { | |||
736 | int (*ide_dma_end)(ide_drive_t *drive); | 736 | int (*ide_dma_end)(ide_drive_t *drive); |
737 | int (*ide_dma_check)(ide_drive_t *drive); | 737 | int (*ide_dma_check)(ide_drive_t *drive); |
738 | int (*ide_dma_on)(ide_drive_t *drive); | 738 | int (*ide_dma_on)(ide_drive_t *drive); |
739 | int (*ide_dma_off_quietly)(ide_drive_t *drive); | 739 | void (*dma_off_quietly)(ide_drive_t *drive); |
740 | int (*ide_dma_test_irq)(ide_drive_t *drive); | 740 | int (*ide_dma_test_irq)(ide_drive_t *drive); |
741 | int (*ide_dma_host_on)(ide_drive_t *drive); | 741 | void (*ide_dma_clear_irq)(ide_drive_t *drive); |
742 | int (*ide_dma_host_off)(ide_drive_t *drive); | 742 | void (*dma_host_on)(ide_drive_t *drive); |
743 | void (*dma_host_off)(ide_drive_t *drive); | ||
743 | int (*ide_dma_lostirq)(ide_drive_t *drive); | 744 | int (*ide_dma_lostirq)(ide_drive_t *drive); |
744 | int (*ide_dma_timeout)(ide_drive_t *drive); | 745 | int (*ide_dma_timeout)(ide_drive_t *drive); |
745 | 746 | ||
746 | void (*OUTB)(u8 addr, unsigned long port); | 747 | void (*OUTB)(u8 addr, unsigned long port); |
747 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); | 748 | void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); |
748 | void (*OUTW)(u16 addr, unsigned long port); | 749 | void (*OUTW)(u16 addr, unsigned long port); |
749 | void (*OUTL)(u32 addr, unsigned long port); | ||
750 | void (*OUTSW)(unsigned long port, void *addr, u32 count); | 750 | void (*OUTSW)(unsigned long port, void *addr, u32 count); |
751 | void (*OUTSL)(unsigned long port, void *addr, u32 count); | 751 | void (*OUTSL)(unsigned long port, void *addr, u32 count); |
752 | 752 | ||
753 | u8 (*INB)(unsigned long port); | 753 | u8 (*INB)(unsigned long port); |
754 | u16 (*INW)(unsigned long port); | 754 | u16 (*INW)(unsigned long port); |
755 | u32 (*INL)(unsigned long port); | ||
756 | void (*INSW)(unsigned long port, void *addr, u32 count); | 755 | void (*INSW)(unsigned long port, void *addr, u32 count); |
757 | void (*INSL)(unsigned long port, void *addr, u32 count); | 756 | void (*INSL)(unsigned long port, void *addr, u32 count); |
758 | 757 | ||
@@ -774,7 +773,6 @@ typedef struct hwif_s { | |||
774 | unsigned int cursg; | 773 | unsigned int cursg; |
775 | unsigned int cursg_ofs; | 774 | unsigned int cursg_ofs; |
776 | 775 | ||
777 | int mmio; /* hosts iomio (0) or custom (2) select */ | ||
778 | int rqsize; /* max sectors per request */ | 776 | int rqsize; /* max sectors per request */ |
779 | int irq; /* our irq number */ | 777 | int irq; /* our irq number */ |
780 | 778 | ||
@@ -802,12 +800,11 @@ typedef struct hwif_s { | |||
802 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ | 800 | unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */ |
803 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ | 801 | unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ |
804 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ | 802 | unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ |
805 | unsigned no_dsc : 1; /* 0 default, 1 dsc_overlap disabled */ | ||
806 | unsigned auto_poll : 1; /* supports nop auto-poll */ | 803 | unsigned auto_poll : 1; /* supports nop auto-poll */ |
807 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ | 804 | unsigned sg_mapped : 1; /* sg_table and sg_nents are ready */ |
808 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ | 805 | unsigned no_io_32bit : 1; /* 1 = can not do 32-bit IO ops */ |
809 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ | 806 | unsigned err_stops_fifo : 1; /* 1=data FIFO is cleared by an error */ |
810 | unsigned atapi_irq_bogon : 1; /* Generates spurious DMA interrupts in PIO mode */ | 807 | unsigned mmio : 1; /* host uses MMIO */ |
811 | 808 | ||
812 | struct device gendev; | 809 | struct device gendev; |
813 | struct completion gendev_rel_comp; /* To deal with device release() */ | 810 | struct completion gendev_rel_comp; /* To deal with device release() */ |
@@ -864,6 +861,8 @@ typedef struct hwgroup_s { | |||
864 | int (*expiry)(ide_drive_t *); | 861 | int (*expiry)(ide_drive_t *); |
865 | /* ide_system_bus_speed */ | 862 | /* ide_system_bus_speed */ |
866 | int pio_clock; | 863 | int pio_clock; |
864 | int req_gen; | ||
865 | int req_gen_timer; | ||
867 | 866 | ||
868 | unsigned char cmd_buf[4]; | 867 | unsigned char cmd_buf[4]; |
869 | } ide_hwgroup_t; | 868 | } ide_hwgroup_t; |
@@ -1280,8 +1279,9 @@ int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | |||
1280 | int __ide_dma_bad_drive(ide_drive_t *); | 1279 | int __ide_dma_bad_drive(ide_drive_t *); |
1281 | int __ide_dma_good_drive(ide_drive_t *); | 1280 | int __ide_dma_good_drive(ide_drive_t *); |
1282 | int ide_use_dma(ide_drive_t *); | 1281 | int ide_use_dma(ide_drive_t *); |
1283 | int __ide_dma_off(ide_drive_t *); | 1282 | void ide_dma_off(ide_drive_t *); |
1284 | void ide_dma_verbose(ide_drive_t *); | 1283 | void ide_dma_verbose(ide_drive_t *); |
1284 | int ide_set_dma(ide_drive_t *); | ||
1285 | ide_startstop_t ide_dma_intr(ide_drive_t *); | 1285 | ide_startstop_t ide_dma_intr(ide_drive_t *); |
1286 | 1286 | ||
1287 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1287 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1291,9 +1291,9 @@ extern void ide_destroy_dmatable(ide_drive_t *); | |||
1291 | extern int ide_release_dma(ide_hwif_t *); | 1291 | extern int ide_release_dma(ide_hwif_t *); |
1292 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); | 1292 | extern void ide_setup_dma(ide_hwif_t *, unsigned long, unsigned int); |
1293 | 1293 | ||
1294 | extern int __ide_dma_host_off(ide_drive_t *); | 1294 | void ide_dma_host_off(ide_drive_t *); |
1295 | extern int __ide_dma_off_quietly(ide_drive_t *); | 1295 | void ide_dma_off_quietly(ide_drive_t *); |
1296 | extern int __ide_dma_host_on(ide_drive_t *); | 1296 | void ide_dma_host_on(ide_drive_t *); |
1297 | extern int __ide_dma_on(ide_drive_t *); | 1297 | extern int __ide_dma_on(ide_drive_t *); |
1298 | extern int __ide_dma_check(ide_drive_t *); | 1298 | extern int __ide_dma_check(ide_drive_t *); |
1299 | extern int ide_dma_setup(ide_drive_t *); | 1299 | extern int ide_dma_setup(ide_drive_t *); |
@@ -1305,8 +1305,9 @@ extern int __ide_dma_timeout(ide_drive_t *); | |||
1305 | 1305 | ||
1306 | #else | 1306 | #else |
1307 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } | 1307 | static inline int ide_use_dma(ide_drive_t *drive) { return 0; } |
1308 | static inline int __ide_dma_off(ide_drive_t *drive) { return 0; } | 1308 | static inline void ide_dma_off(ide_drive_t *drive) { ; } |
1309 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } | 1309 | static inline void ide_dma_verbose(ide_drive_t *drive) { ; } |
1310 | static inline int ide_set_dma(ide_drive_t *drive) { return 1; } | ||
1310 | #endif /* CONFIG_BLK_DEV_IDEDMA */ | 1311 | #endif /* CONFIG_BLK_DEV_IDEDMA */ |
1311 | 1312 | ||
1312 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI | 1313 | #ifndef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1354,20 +1355,21 @@ extern int ide_dma_enable(ide_drive_t *drive); | |||
1354 | extern char *ide_xfer_verbose(u8 xfer_rate); | 1355 | extern char *ide_xfer_verbose(u8 xfer_rate); |
1355 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1356 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1356 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1357 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1358 | int ide_use_fast_pio(ide_drive_t *); | ||
1357 | 1359 | ||
1358 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1360 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1359 | 1361 | ||
1360 | typedef struct ide_pio_timings_s { | 1362 | typedef struct ide_pio_timings_s { |
1361 | int setup_time; /* Address setup (ns) minimum */ | 1363 | int setup_time; /* Address setup (ns) minimum */ |
1362 | int active_time; /* Active pulse (ns) minimum */ | 1364 | int active_time; /* Active pulse (ns) minimum */ |
1363 | int cycle_time; /* Cycle time (ns) minimum = (setup + active + recovery) */ | 1365 | int cycle_time; /* Cycle time (ns) minimum = */ |
1366 | /* active + recovery (+ setup for some chips) */ | ||
1364 | } ide_pio_timings_t; | 1367 | } ide_pio_timings_t; |
1365 | 1368 | ||
1366 | typedef struct ide_pio_data_s { | 1369 | typedef struct ide_pio_data_s { |
1367 | u8 pio_mode; | 1370 | u8 pio_mode; |
1368 | u8 use_iordy; | 1371 | u8 use_iordy; |
1369 | u8 overridden; | 1372 | u8 overridden; |
1370 | u8 blacklisted; | ||
1371 | unsigned int cycle_time; | 1373 | unsigned int cycle_time; |
1372 | } ide_pio_data_t; | 1374 | } ide_pio_data_t; |
1373 | 1375 | ||
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index d557e4ce9b6b..43f3bedaafd3 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h | |||
@@ -39,6 +39,7 @@ enum | |||
39 | #define IFA_F_TEMPORARY IFA_F_SECONDARY | 39 | #define IFA_F_TEMPORARY IFA_F_SECONDARY |
40 | 40 | ||
41 | #define IFA_F_NODAD 0x02 | 41 | #define IFA_F_NODAD 0x02 |
42 | #define IFA_F_OPTIMISTIC 0x04 | ||
42 | #define IFA_F_HOMEADDRESS 0x10 | 43 | #define IFA_F_HOMEADDRESS 0x10 |
43 | #define IFA_F_DEPRECATED 0x20 | 44 | #define IFA_F_DEPRECATED 0x20 |
44 | #define IFA_F_TENTATIVE 0x40 | 45 | #define IFA_F_TENTATIVE 0x40 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 7f5714214ee3..ed7b93c3083a 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -148,4 +148,13 @@ struct arphdr | |||
148 | 148 | ||
149 | }; | 149 | }; |
150 | 150 | ||
151 | #ifdef __KERNEL__ | ||
152 | #include <linux/skbuff.h> | ||
153 | |||
154 | static inline struct arphdr *arp_hdr(const struct sk_buff *skb) | ||
155 | { | ||
156 | return (struct arphdr *)skb_network_header(skb); | ||
157 | } | ||
158 | #endif | ||
159 | |||
151 | #endif /* _LINUX_IF_ARP_H */ | 160 | #endif /* _LINUX_IF_ARP_H */ |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index fd1b6eb94a5f..4ff211d98769 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -105,7 +105,8 @@ struct __fdb_entry | |||
105 | #include <linux/netdevice.h> | 105 | #include <linux/netdevice.h> |
106 | 106 | ||
107 | extern void brioctl_set(int (*ioctl_hook)(unsigned int, void __user *)); | 107 | extern void brioctl_set(int (*ioctl_hook)(unsigned int, void __user *)); |
108 | extern int (*br_handle_frame_hook)(struct net_bridge_port *p, struct sk_buff **pskb); | 108 | extern struct sk_buff *(*br_handle_frame_hook)(struct net_bridge_port *p, |
109 | struct sk_buff *skb); | ||
109 | extern int (*br_should_route_hook)(struct sk_buff **pskb); | 110 | extern int (*br_should_route_hook)(struct sk_buff **pskb); |
110 | 111 | ||
111 | #endif | 112 | #endif |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index ab08f35cbc35..1db774cf9dc2 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -61,6 +61,7 @@ | |||
61 | #define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ | 61 | #define ETH_P_8021Q 0x8100 /* 802.1Q VLAN Extended Header */ |
62 | #define ETH_P_IPX 0x8137 /* IPX over DIX */ | 62 | #define ETH_P_IPX 0x8137 /* IPX over DIX */ |
63 | #define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ | 63 | #define ETH_P_IPV6 0x86DD /* IPv6 over bluebook */ |
64 | #define ETH_P_PAUSE 0x8808 /* IEEE Pause frames. See 802.3 31B */ | ||
64 | #define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ | 65 | #define ETH_P_SLOW 0x8809 /* Slow Protocol. See 802.3ad 43B */ |
65 | #define ETH_P_WCCP 0x883E /* Web-cache coordination protocol | 66 | #define ETH_P_WCCP 0x883E /* Web-cache coordination protocol |
66 | * defined in draft-wilson-wrec-wccp-v2-00.txt */ | 67 | * defined in draft-wilson-wrec-wccp-v2-00.txt */ |
@@ -112,7 +113,7 @@ struct ethhdr { | |||
112 | 113 | ||
113 | static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | 114 | static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) |
114 | { | 115 | { |
115 | return (struct ethhdr *)skb->mac.raw; | 116 | return (struct ethhdr *)skb_mac_header(skb); |
116 | } | 117 | } |
117 | 118 | ||
118 | #ifdef CONFIG_SYSCTL | 119 | #ifdef CONFIG_SYSCTL |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 35ed3b5467f3..604c2434f71c 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -126,6 +126,7 @@ enum | |||
126 | IFLA_INET6_STATS, /* statistics */ | 126 | IFLA_INET6_STATS, /* statistics */ |
127 | IFLA_INET6_MCAST, /* MC things. What of them? */ | 127 | IFLA_INET6_MCAST, /* MC things. What of them? */ |
128 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ | 128 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ |
129 | IFLA_INET6_ICMP6STATS, /* statistics (icmpv6) */ | ||
129 | __IFLA_INET6_MAX | 130 | __IFLA_INET6_MAX |
130 | }; | 131 | }; |
131 | 132 | ||
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index f3de05c30678..ad09609227ff 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -42,6 +42,7 @@ struct sockaddr_ll | |||
42 | #define PACKET_STATISTICS 6 | 42 | #define PACKET_STATISTICS 6 |
43 | #define PACKET_COPY_THRESH 7 | 43 | #define PACKET_COPY_THRESH 7 |
44 | #define PACKET_AUXDATA 8 | 44 | #define PACKET_AUXDATA 8 |
45 | #define PACKET_ORIGDEV 9 | ||
45 | 46 | ||
46 | struct tpacket_stats | 47 | struct tpacket_stats |
47 | { | 48 | { |
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h index 4fab3d0a4bce..6f987be60fe2 100644 --- a/include/linux/if_pppox.h +++ b/include/linux/if_pppox.h | |||
@@ -111,9 +111,20 @@ struct pppoe_hdr { | |||
111 | struct pppoe_tag tag[0]; | 111 | struct pppoe_tag tag[0]; |
112 | } __attribute__ ((packed)); | 112 | } __attribute__ ((packed)); |
113 | 113 | ||
114 | /* Length of entire PPPoE + PPP header */ | ||
115 | #define PPPOE_SES_HLEN 8 | ||
116 | |||
114 | #ifdef __KERNEL__ | 117 | #ifdef __KERNEL__ |
118 | #include <linux/skbuff.h> | ||
119 | |||
120 | static inline struct pppoe_hdr *pppoe_hdr(const struct sk_buff *skb) | ||
121 | { | ||
122 | return (struct pppoe_hdr *)skb_network_header(skb); | ||
123 | } | ||
124 | |||
115 | struct pppoe_opt { | 125 | struct pppoe_opt { |
116 | struct net_device *dev; /* device associated with socket*/ | 126 | struct net_device *dev; /* device associated with socket*/ |
127 | int ifindex; /* ifindex of device associated with socket */ | ||
117 | struct pppoe_addr pa; /* what this socket is bound to*/ | 128 | struct pppoe_addr pa; /* what this socket is bound to*/ |
118 | struct sockaddr_pppox relay; /* what socket data will be | 129 | struct sockaddr_pppox relay; /* what socket data will be |
119 | relayed to (PPPoE relaying) */ | 130 | relayed to (PPPoE relaying) */ |
@@ -132,6 +143,7 @@ struct pppox_sock { | |||
132 | unsigned short num; | 143 | unsigned short num; |
133 | }; | 144 | }; |
134 | #define pppoe_dev proto.pppoe.dev | 145 | #define pppoe_dev proto.pppoe.dev |
146 | #define pppoe_ifindex proto.pppoe.ifindex | ||
135 | #define pppoe_pa proto.pppoe.pa | 147 | #define pppoe_pa proto.pppoe.pa |
136 | #define pppoe_relay proto.pppoe.relay | 148 | #define pppoe_relay proto.pppoe.relay |
137 | 149 | ||
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index 2f94cf2c7abb..046e9d95ba9a 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
@@ -47,7 +47,7 @@ struct trh_hdr { | |||
47 | 47 | ||
48 | static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) | 48 | static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) |
49 | { | 49 | { |
50 | return (struct trh_hdr *)skb->mac.raw; | 50 | return (struct trh_hdr *)skb_mac_header(skb); |
51 | } | 51 | } |
52 | #ifdef CONFIG_SYSCTL | 52 | #ifdef CONFIG_SYSCTL |
53 | extern struct ctl_table tr_table[]; | 53 | extern struct ctl_table tr_table[]; |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 35cb38573583..81e9bc93569b 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -51,7 +51,7 @@ struct vlan_ethhdr { | |||
51 | 51 | ||
52 | static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | 52 | static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) |
53 | { | 53 | { |
54 | return (struct vlan_ethhdr *)skb->mac.raw; | 54 | return (struct vlan_ethhdr *)skb_mac_header(skb); |
55 | } | 55 | } |
56 | 56 | ||
57 | struct vlan_hdr { | 57 | struct vlan_hdr { |
@@ -70,15 +70,34 @@ extern void vlan_ioctl_set(int (*hook)(void __user *)); | |||
70 | * depends on completely exhausting the VLAN identifier space. Thus | 70 | * depends on completely exhausting the VLAN identifier space. Thus |
71 | * it gives constant time look-up, but in many cases it wastes memory. | 71 | * it gives constant time look-up, but in many cases it wastes memory. |
72 | */ | 72 | */ |
73 | #define VLAN_GROUP_ARRAY_LEN 4096 | 73 | #define VLAN_GROUP_ARRAY_LEN 4096 |
74 | #define VLAN_GROUP_ARRAY_SPLIT_PARTS 8 | ||
75 | #define VLAN_GROUP_ARRAY_PART_LEN (VLAN_GROUP_ARRAY_LEN/VLAN_GROUP_ARRAY_SPLIT_PARTS) | ||
74 | 76 | ||
75 | struct vlan_group { | 77 | struct vlan_group { |
76 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ | 78 | int real_dev_ifindex; /* The ifindex of the ethernet(like) device the vlan is attached to. */ |
77 | struct hlist_node hlist; /* linked list */ | 79 | struct hlist_node hlist; /* linked list */ |
78 | struct net_device *vlan_devices[VLAN_GROUP_ARRAY_LEN]; | 80 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
79 | struct rcu_head rcu; | 81 | struct rcu_head rcu; |
80 | }; | 82 | }; |
81 | 83 | ||
84 | static inline struct net_device *vlan_group_get_device(struct vlan_group *vg, int vlan_id) | ||
85 | { | ||
86 | struct net_device **array; | ||
87 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | ||
88 | return array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN]; | ||
89 | } | ||
90 | |||
91 | static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id, | ||
92 | struct net_device *dev) | ||
93 | { | ||
94 | struct net_device **array; | ||
95 | if (!vg) | ||
96 | return; | ||
97 | array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN]; | ||
98 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | ||
99 | } | ||
100 | |||
82 | struct vlan_priority_tci_mapping { | 101 | struct vlan_priority_tci_mapping { |
83 | unsigned long priority; | 102 | unsigned long priority; |
84 | unsigned short vlan_qos; /* This should be shifted when first set, so we only do it | 103 | unsigned short vlan_qos; /* This should be shifted when first set, so we only do it |
@@ -160,7 +179,7 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, | |||
160 | return NET_RX_DROP; | 179 | return NET_RX_DROP; |
161 | } | 180 | } |
162 | 181 | ||
163 | skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK]; | 182 | skb->dev = vlan_group_get_device(grp, vlan_tag & VLAN_VID_MASK); |
164 | if (skb->dev == NULL) { | 183 | if (skb->dev == NULL) { |
165 | dev_kfree_skb_any(skb); | 184 | dev_kfree_skb_any(skb); |
166 | 185 | ||
@@ -256,8 +275,8 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, unsigned short | |||
256 | veth->h_vlan_TCI = htons(tag); | 275 | veth->h_vlan_TCI = htons(tag); |
257 | 276 | ||
258 | skb->protocol = __constant_htons(ETH_P_8021Q); | 277 | skb->protocol = __constant_htons(ETH_P_8021Q); |
259 | skb->mac.raw -= VLAN_HLEN; | 278 | skb->mac_header -= VLAN_HLEN; |
260 | skb->nh.raw -= VLAN_HLEN; | 279 | skb->network_header -= VLAN_HLEN; |
261 | 280 | ||
262 | return skb; | 281 | return skb; |
263 | } | 282 | } |
diff --git a/include/linux/if_wanpipe_common.h b/include/linux/if_wanpipe_common.h deleted file mode 100644 index 6e5461d69fdd..000000000000 --- a/include/linux/if_wanpipe_common.h +++ /dev/null | |||
@@ -1,58 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * if_wanipe_common.h Sangoma Driver/Socket common area definitions. | ||
3 | * | ||
4 | * Author: Nenad Corbic <ncorbic@sangoma.com> | ||
5 | * | ||
6 | * Copyright: (c) 2000 Sangoma Technologies Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * as published by the Free Software Foundation; either version | ||
11 | * 2 of the License, or (at your option) any later version. | ||
12 | * ============================================================================ | ||
13 | * Jan 13, 2000 Nenad Corbic Initial version | ||
14 | *****************************************************************************/ | ||
15 | |||
16 | |||
17 | #ifndef _WANPIPE_SOCK_DRIVER_COMMON_H | ||
18 | #define _WANPIPE_SOCK_DRIVER_COMMON_H | ||
19 | |||
20 | typedef struct { | ||
21 | struct net_device *slave; | ||
22 | atomic_t packet_sent; | ||
23 | atomic_t receive_block; | ||
24 | atomic_t command; | ||
25 | atomic_t disconnect; | ||
26 | atomic_t driver_busy; | ||
27 | long common_critical; | ||
28 | struct timer_list *tx_timer; | ||
29 | struct sock *sk; /* Wanpipe Sock bind's here */ | ||
30 | int (*func)(struct sk_buff *skb, struct net_device *dev, | ||
31 | struct sock *sk); | ||
32 | |||
33 | struct work_struct wanpipe_work; /* deferred keventd work */ | ||
34 | unsigned char rw_bind; /* Sock bind state */ | ||
35 | unsigned char usedby; | ||
36 | unsigned char state; | ||
37 | unsigned char svc; | ||
38 | unsigned short lcn; | ||
39 | void *mbox; | ||
40 | } wanpipe_common_t; | ||
41 | |||
42 | |||
43 | enum { | ||
44 | WANSOCK_UNCONFIGURED, /* link/channel is not configured */ | ||
45 | WANSOCK_DISCONNECTED, /* link/channel is disconnected */ | ||
46 | WANSOCK_CONNECTING, /* connection is in progress */ | ||
47 | WANSOCK_CONNECTED, /* link/channel is operational */ | ||
48 | WANSOCK_LIMIT, /* for verification only */ | ||
49 | WANSOCK_DUALPORT, /* for Dual Port cards */ | ||
50 | WANSOCK_DISCONNECTING, | ||
51 | WANSOCK_BINDED, | ||
52 | WANSOCK_BIND_LISTEN, | ||
53 | WANSOCK_LISTEN | ||
54 | }; | ||
55 | |||
56 | #endif | ||
57 | |||
58 | |||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 9dbb525c5178..f510e7e382a8 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -80,6 +80,27 @@ struct igmpv3_query { | |||
80 | __be32 srcs[0]; | 80 | __be32 srcs[0]; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | #ifdef __KERNEL__ | ||
84 | #include <linux/skbuff.h> | ||
85 | |||
86 | static inline struct igmphdr *igmp_hdr(const struct sk_buff *skb) | ||
87 | { | ||
88 | return (struct igmphdr *)skb_transport_header(skb); | ||
89 | } | ||
90 | |||
91 | static inline struct igmpv3_report * | ||
92 | igmpv3_report_hdr(const struct sk_buff *skb) | ||
93 | { | ||
94 | return (struct igmpv3_report *)skb_transport_header(skb); | ||
95 | } | ||
96 | |||
97 | static inline struct igmpv3_query * | ||
98 | igmpv3_query_hdr(const struct sk_buff *skb) | ||
99 | { | ||
100 | return (struct igmpv3_query *)skb_transport_header(skb); | ||
101 | } | ||
102 | #endif | ||
103 | |||
83 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ | 104 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ |
84 | #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ | 105 | #define IGMP_HOST_MEMBERSHIP_REPORT 0x12 /* Ditto */ |
85 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ | 106 | #define IGMP_DVMRP 0x13 /* DVMRP routing */ |
@@ -218,5 +239,7 @@ extern void ip_mc_up(struct in_device *); | |||
218 | extern void ip_mc_down(struct in_device *); | 239 | extern void ip_mc_down(struct in_device *); |
219 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); | 240 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); |
220 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); | 241 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); |
242 | extern void ip_mc_rejoin_group(struct ip_mc_list *im); | ||
243 | |||
221 | #endif | 244 | #endif |
222 | #endif | 245 | #endif |
diff --git a/include/linux/in.h b/include/linux/in.h index 1912e7c0bc26..3975cbf52f20 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -83,6 +83,7 @@ struct in_addr { | |||
83 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ | 83 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ |
84 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ | 84 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ |
85 | #define IP_PMTUDISC_DO 2 /* Always DF */ | 85 | #define IP_PMTUDISC_DO 2 /* Always DF */ |
86 | #define IP_PMTUDISC_PROBE 3 /* Ignore dst pmtu */ | ||
86 | 87 | ||
87 | #define IP_MULTICAST_IF 32 | 88 | #define IP_MULTICAST_IF 32 |
88 | #define IP_MULTICAST_TTL 33 | 89 | #define IP_MULTICAST_TTL 33 |
diff --git a/include/linux/in6.h b/include/linux/in6.h index 4e8350ae8869..2a61c82af115 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -44,10 +44,8 @@ struct in6_addr | |||
44 | * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined | 44 | * NOTE: Be aware the IN6ADDR_* constants and in6addr_* externals are defined |
45 | * in network byte order, not in host byte order as are the IPv4 equivalents | 45 | * in network byte order, not in host byte order as are the IPv4 equivalents |
46 | */ | 46 | */ |
47 | #if 0 | ||
48 | extern const struct in6_addr in6addr_any; | 47 | extern const struct in6_addr in6addr_any; |
49 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } | 48 | #define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } } |
50 | #endif | ||
51 | extern const struct in6_addr in6addr_loopback; | 49 | extern const struct in6_addr in6addr_loopback; |
52 | #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } | 50 | #define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } } |
53 | 51 | ||
@@ -179,6 +177,7 @@ struct in6_flowlabel_req | |||
179 | #define IPV6_PMTUDISC_DONT 0 | 177 | #define IPV6_PMTUDISC_DONT 0 |
180 | #define IPV6_PMTUDISC_WANT 1 | 178 | #define IPV6_PMTUDISC_WANT 1 |
181 | #define IPV6_PMTUDISC_DO 2 | 179 | #define IPV6_PMTUDISC_DO 2 |
180 | #define IPV6_PMTUDISC_PROBE 3 | ||
182 | 181 | ||
183 | /* Flowlabel */ | 182 | /* Flowlabel */ |
184 | #define IPV6_FLOWLABEL_MGR 32 | 183 | #define IPV6_FLOWLABEL_MGR 32 |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index e5ea1411050b..838cf5a5bd7f 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -423,4 +423,13 @@ extern int probe_irq_off(unsigned long); /* returns 0 or negative on failure */ | |||
423 | extern unsigned int probe_irq_mask(unsigned long); /* returns mask of ISA interrupts */ | 423 | extern unsigned int probe_irq_mask(unsigned long); /* returns mask of ISA interrupts */ |
424 | #endif | 424 | #endif |
425 | 425 | ||
426 | #ifdef CONFIG_PROC_FS | ||
427 | /* Initialize /proc/irq/ */ | ||
428 | extern void init_irq_proc(void); | ||
429 | #else | ||
430 | static inline void init_irq_proc(void) | ||
431 | { | ||
432 | } | ||
433 | #endif | ||
434 | |||
426 | #endif | 435 | #endif |
diff --git a/include/linux/io.h b/include/linux/io.h index c244a0cc9319..09d351236379 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -33,9 +33,22 @@ int ioremap_page_range(unsigned long addr, unsigned long end, | |||
33 | /* | 33 | /* |
34 | * Managed iomap interface | 34 | * Managed iomap interface |
35 | */ | 35 | */ |
36 | #ifdef CONFIG_HAS_IOPORT | ||
36 | void __iomem * devm_ioport_map(struct device *dev, unsigned long port, | 37 | void __iomem * devm_ioport_map(struct device *dev, unsigned long port, |
37 | unsigned int nr); | 38 | unsigned int nr); |
38 | void devm_ioport_unmap(struct device *dev, void __iomem *addr); | 39 | void devm_ioport_unmap(struct device *dev, void __iomem *addr); |
40 | #else | ||
41 | static inline void __iomem *devm_ioport_map(struct device *dev, | ||
42 | unsigned long port, | ||
43 | unsigned int nr) | ||
44 | { | ||
45 | return NULL; | ||
46 | } | ||
47 | |||
48 | static inline void devm_ioport_unmap(struct device *dev, void __iomem *addr) | ||
49 | { | ||
50 | } | ||
51 | #endif | ||
39 | 52 | ||
40 | void __iomem * devm_ioremap(struct device *dev, unsigned long offset, | 53 | void __iomem * devm_ioremap(struct device *dev, unsigned long offset, |
41 | unsigned long size); | 54 | unsigned long size); |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 6859a3b14088..71ea92319241 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -99,7 +99,6 @@ extern struct resource ioport_resource; | |||
99 | extern struct resource iomem_resource; | 99 | extern struct resource iomem_resource; |
100 | 100 | ||
101 | extern int request_resource(struct resource *root, struct resource *new); | 101 | extern int request_resource(struct resource *root, struct resource *new); |
102 | extern struct resource * ____request_resource(struct resource *root, struct resource *new); | ||
103 | extern int release_resource(struct resource *new); | 102 | extern int release_resource(struct resource *new); |
104 | extern int insert_resource(struct resource *parent, struct resource *new); | 103 | extern int insert_resource(struct resource *parent, struct resource *new); |
105 | extern int allocate_resource(struct resource *root, struct resource *new, | 104 | extern int allocate_resource(struct resource *root, struct resource *new, |
diff --git a/include/linux/ip.h b/include/linux/ip.h index 1d36b971a8b5..bd0a2a8631c6 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -104,6 +104,20 @@ struct iphdr { | |||
104 | /*The options start here. */ | 104 | /*The options start here. */ |
105 | }; | 105 | }; |
106 | 106 | ||
107 | #ifdef __KERNEL__ | ||
108 | #include <linux/skbuff.h> | ||
109 | |||
110 | static inline struct iphdr *ip_hdr(const struct sk_buff *skb) | ||
111 | { | ||
112 | return (struct iphdr *)skb_network_header(skb); | ||
113 | } | ||
114 | |||
115 | static inline struct iphdr *ipip_hdr(const struct sk_buff *skb) | ||
116 | { | ||
117 | return (struct iphdr *)skb_transport_header(skb); | ||
118 | } | ||
119 | #endif | ||
120 | |||
107 | struct ip_auth_hdr { | 121 | struct ip_auth_hdr { |
108 | __u8 nexthdr; | 122 | __u8 nexthdr; |
109 | __u8 hdrlen; /* This one is measured in 32 bit units! */ | 123 | __u8 hdrlen; /* This one is measured in 32 bit units! */ |
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index 636094c29b16..6da6772c19ff 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -92,19 +92,16 @@ extern struct ipc_namespace init_ipc_ns; | |||
92 | 92 | ||
93 | #ifdef CONFIG_SYSVIPC | 93 | #ifdef CONFIG_SYSVIPC |
94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | 94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, |
95 | extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); | ||
95 | #else | 96 | #else |
96 | #define INIT_IPC_NS(ns) | 97 | #define INIT_IPC_NS(ns) |
98 | static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) | ||
99 | { return 0; } | ||
97 | #endif | 100 | #endif |
98 | 101 | ||
99 | #ifdef CONFIG_IPC_NS | 102 | #ifdef CONFIG_IPC_NS |
100 | extern void free_ipc_ns(struct kref *kref); | 103 | extern void free_ipc_ns(struct kref *kref); |
101 | extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); | ||
102 | extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); | 104 | extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); |
103 | #else | ||
104 | static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) | ||
105 | { | ||
106 | return 0; | ||
107 | } | ||
108 | #endif | 105 | #endif |
109 | 106 | ||
110 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 107 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index f8241130f5ea..09ea01a8a99c 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -177,6 +177,10 @@ struct ipv6_devconf { | |||
177 | #endif | 177 | #endif |
178 | #endif | 178 | #endif |
179 | __s32 proxy_ndp; | 179 | __s32 proxy_ndp; |
180 | __s32 accept_source_route; | ||
181 | #ifdef CONFIG_IPV6_OPTIMISTIC_DAD | ||
182 | __s32 optimistic_dad; | ||
183 | #endif | ||
180 | void *sysctl; | 184 | void *sysctl; |
181 | }; | 185 | }; |
182 | 186 | ||
@@ -205,6 +209,9 @@ enum { | |||
205 | DEVCONF_RTR_PROBE_INTERVAL, | 209 | DEVCONF_RTR_PROBE_INTERVAL, |
206 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, | 210 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, |
207 | DEVCONF_PROXY_NDP, | 211 | DEVCONF_PROXY_NDP, |
212 | __DEVCONF_OPTIMISTIC_DAD, | ||
213 | DEVCONF_ACCEPT_SOURCE_ROUTE, | ||
214 | DEVCONF_OPTIMISTIC_DAD, | ||
208 | DEVCONF_MAX | 215 | DEVCONF_MAX |
209 | }; | 216 | }; |
210 | 217 | ||
@@ -216,6 +223,16 @@ enum { | |||
216 | #include <net/if_inet6.h> /* struct ipv6_mc_socklist */ | 223 | #include <net/if_inet6.h> /* struct ipv6_mc_socklist */ |
217 | #include <net/inet_sock.h> | 224 | #include <net/inet_sock.h> |
218 | 225 | ||
226 | static inline struct ipv6hdr *ipv6_hdr(const struct sk_buff *skb) | ||
227 | { | ||
228 | return (struct ipv6hdr *)skb_network_header(skb); | ||
229 | } | ||
230 | |||
231 | static inline struct ipv6hdr *ipipv6_hdr(const struct sk_buff *skb) | ||
232 | { | ||
233 | return (struct ipv6hdr *)skb_transport_header(skb); | ||
234 | } | ||
235 | |||
219 | /* | 236 | /* |
220 | This structure contains results of exthdrs parsing | 237 | This structure contains results of exthdrs parsing |
221 | as offsets from skb->nh. | 238 | as offsets from skb->nh. |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 1939d42c21d2..a6899402b522 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/spinlock.h> | 18 | #include <linux/spinlock.h> |
19 | #include <linux/cpumask.h> | 19 | #include <linux/cpumask.h> |
20 | #include <linux/irqreturn.h> | 20 | #include <linux/irqreturn.h> |
21 | #include <linux/errno.h> | ||
21 | 22 | ||
22 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
23 | #include <asm/ptrace.h> | 24 | #include <asm/ptrace.h> |
@@ -200,17 +201,6 @@ extern int setup_irq(unsigned int irq, struct irqaction *new); | |||
200 | #endif | 201 | #endif |
201 | 202 | ||
202 | #ifdef CONFIG_SMP | 203 | #ifdef CONFIG_SMP |
203 | static inline void set_native_irq_info(int irq, cpumask_t mask) | ||
204 | { | ||
205 | irq_desc[irq].affinity = mask; | ||
206 | } | ||
207 | #else | ||
208 | static inline void set_native_irq_info(int irq, cpumask_t mask) | ||
209 | { | ||
210 | } | ||
211 | #endif | ||
212 | |||
213 | #ifdef CONFIG_SMP | ||
214 | 204 | ||
215 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) | 205 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
216 | 206 | ||
@@ -328,9 +318,6 @@ extern void note_interrupt(unsigned int irq, struct irq_desc *desc, | |||
328 | /* Resending of interrupts :*/ | 318 | /* Resending of interrupts :*/ |
329 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); | 319 | void check_irq_resend(struct irq_desc *desc, unsigned int irq); |
330 | 320 | ||
331 | /* Initialize /proc/irq/ */ | ||
332 | extern void init_irq_proc(void); | ||
333 | |||
334 | /* Enable/disable irq debugging output: */ | 321 | /* Enable/disable irq debugging output: */ |
335 | extern int noirqdebug_setup(char *str); | 322 | extern int noirqdebug_setup(char *str); |
336 | 323 | ||
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h index 2e79f816703b..63bd9cf821a7 100644 --- a/include/linux/isdn/capiutil.h +++ b/include/linux/isdn/capiutil.h | |||
@@ -174,9 +174,26 @@ char *capi_info2str(__u16 reason); | |||
174 | /* | 174 | /* |
175 | * Debugging / Tracing functions | 175 | * Debugging / Tracing functions |
176 | */ | 176 | */ |
177 | |||
177 | char *capi_cmd2str(__u8 cmd, __u8 subcmd); | 178 | char *capi_cmd2str(__u8 cmd, __u8 subcmd); |
178 | char *capi_cmsg2str(_cmsg * cmsg); | 179 | |
179 | char *capi_message2str(__u8 * msg); | 180 | typedef struct { |
181 | u_char *buf; | ||
182 | u_char *p; | ||
183 | size_t size; | ||
184 | size_t pos; | ||
185 | } _cdebbuf; | ||
186 | |||
187 | #define CDEBUG_SIZE 1024 | ||
188 | #define CDEBUG_GSIZE 4096 | ||
189 | |||
190 | _cdebbuf *cdebbuf_alloc(void); | ||
191 | void cdebbuf_free(_cdebbuf *cdb); | ||
192 | int cdebug_init(void); | ||
193 | void cdebug_exit(void); | ||
194 | |||
195 | _cdebbuf *capi_cmsg2str(_cmsg *cmsg); | ||
196 | _cdebbuf *capi_message2str(__u8 *msg); | ||
180 | 197 | ||
181 | /*-----------------------------------------------------------------------*/ | 198 | /*-----------------------------------------------------------------------*/ |
182 | 199 | ||
diff --git a/include/linux/jffs.h b/include/linux/jffs.h deleted file mode 100644 index 92213215277f..000000000000 --- a/include/linux/jffs.h +++ /dev/null | |||
@@ -1,224 +0,0 @@ | |||
1 | /* | ||
2 | * JFFS -- Journalling Flash File System, Linux implementation. | ||
3 | * | ||
4 | * Copyright (C) 1999, 2000 Axis Communications AB. | ||
5 | * | ||
6 | * Created by Finn Hakansson <finn@axis.com>. | ||
7 | * | ||
8 | * This is free software; you can redistribute it and/or modify it | ||
9 | * under the terms of the GNU General Public License as published by | ||
10 | * the Free Software Foundation; either version 2 of the License, or | ||
11 | * (at your option) any later version. | ||
12 | * | ||
13 | * $Id: jffs.h,v 1.20 2001/09/18 21:33:37 dwmw2 Exp $ | ||
14 | * | ||
15 | * Ported to Linux 2.3.x and MTD: | ||
16 | * Copyright (C) 2000 Alexander Larsson (alex@cendio.se), Cendio Systems AB | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_JFFS_H__ | ||
21 | #define __LINUX_JFFS_H__ | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | #include <linux/completion.h> | ||
25 | |||
26 | #define JFFS_VERSION_STRING "1.0" | ||
27 | |||
28 | /* This is a magic number that is used as an identification number for | ||
29 | this file system. It is written to the super_block structure. */ | ||
30 | #define JFFS_MAGIC_SB_BITMASK 0x07c0 /* 1984 */ | ||
31 | |||
32 | /* This is a magic number that every on-flash raw inode begins with. */ | ||
33 | #define JFFS_MAGIC_BITMASK 0x34383931 /* "1984" */ | ||
34 | |||
35 | /* These two bitmasks are the valid ones for the flash memories we have | ||
36 | for the moment. */ | ||
37 | #define JFFS_EMPTY_BITMASK 0xffffffff | ||
38 | #define JFFS_DIRTY_BITMASK 0x00000000 | ||
39 | |||
40 | /* This is the inode number of the root node. */ | ||
41 | #define JFFS_MIN_INO 1 | ||
42 | |||
43 | /* How many slots in the file hash table should we have? */ | ||
44 | #define JFFS_HASH_SIZE 40 | ||
45 | |||
46 | /* Don't use more than 254 bytes as the maximum allowed length of a file's | ||
47 | name due to errors that could occur during the scanning of the flash | ||
48 | memory. In fact, a name length of 255 or 0xff, could be the result of | ||
49 | an uncompleted write. For instance, if a raw inode is written to the | ||
50 | flash memory and there is a power lossage just before the length of | ||
51 | the name is written, the length 255 would be interpreted as an illegal | ||
52 | value. */ | ||
53 | #define JFFS_MAX_NAME_LEN 254 | ||
54 | |||
55 | /* Commands for ioctl(). */ | ||
56 | #define JFFS_IOCTL_MAGIC 't' | ||
57 | #define JFFS_PRINT_HASH _IO(JFFS_IOCTL_MAGIC, 90) | ||
58 | #define JFFS_PRINT_TREE _IO(JFFS_IOCTL_MAGIC, 91) | ||
59 | #define JFFS_GET_STATUS _IO(JFFS_IOCTL_MAGIC, 92) | ||
60 | |||
61 | /* XXX: This is something that we should try to get rid of in the future. */ | ||
62 | #define JFFS_MODIFY_INODE 0x01 | ||
63 | #define JFFS_MODIFY_NAME 0x02 | ||
64 | #define JFFS_MODIFY_DATA 0x04 | ||
65 | #define JFFS_MODIFY_EXIST 0x08 | ||
66 | |||
67 | struct jffs_control; | ||
68 | |||
69 | /* The JFFS raw inode structure: Used for storage on physical media. */ | ||
70 | /* Perhaps the uid, gid, atime, mtime and ctime members should have | ||
71 | more space due to future changes in the Linux kernel. Anyhow, since | ||
72 | a user of this filesystem probably have to fix a large number of | ||
73 | other things, we have decided to not be forward compatible. */ | ||
74 | struct jffs_raw_inode | ||
75 | { | ||
76 | __u32 magic; /* A constant magic number. */ | ||
77 | __u32 ino; /* Inode number. */ | ||
78 | __u32 pino; /* Parent's inode number. */ | ||
79 | __u32 version; /* Version number. */ | ||
80 | __u32 mode; /* The file's type or mode. */ | ||
81 | __u16 uid; /* The file's owner. */ | ||
82 | __u16 gid; /* The file's group. */ | ||
83 | __u32 atime; /* Last access time. */ | ||
84 | __u32 mtime; /* Last modification time. */ | ||
85 | __u32 ctime; /* Creation time. */ | ||
86 | __u32 offset; /* Where to begin to write. */ | ||
87 | __u32 dsize; /* Size of the node's data. */ | ||
88 | __u32 rsize; /* How much are going to be replaced? */ | ||
89 | __u8 nsize; /* Name length. */ | ||
90 | __u8 nlink; /* Number of links. */ | ||
91 | __u8 spare : 6; /* For future use. */ | ||
92 | __u8 rename : 1; /* Rename to a name of an already existing file? */ | ||
93 | __u8 deleted : 1; /* Has this file been deleted? */ | ||
94 | __u8 accurate; /* The inode is obsolete if accurate == 0. */ | ||
95 | __u32 dchksum; /* Checksum for the data. */ | ||
96 | __u16 nchksum; /* Checksum for the name. */ | ||
97 | __u16 chksum; /* Checksum for the raw inode. */ | ||
98 | }; | ||
99 | |||
100 | /* Define the offset of the accurate byte in struct jffs_raw_inode. */ | ||
101 | #define JFFS_RAW_INODE_ACCURATE_OFFSET (sizeof(struct jffs_raw_inode) \ | ||
102 | - 2 * sizeof(__u32) - sizeof(__u8)) | ||
103 | |||
104 | /* Define the offset of the chksum member in struct jffs_raw_inode. */ | ||
105 | #define JFFS_RAW_INODE_CHKSUM_OFFSET (sizeof(struct jffs_raw_inode) \ | ||
106 | - sizeof(__u16)) | ||
107 | |||
108 | /* Define the offset of the dchksum member in struct jffs_raw_inode. */ | ||
109 | #define JFFS_RAW_INODE_DCHKSUM_OFFSET (sizeof(struct jffs_raw_inode) \ | ||
110 | - sizeof(__u16) - sizeof(__u16) \ | ||
111 | - sizeof(__u32)) | ||
112 | |||
113 | |||
114 | /* The RAM representation of the node. The names of pointers to | ||
115 | jffs_nodes are very often just called `n' in the source code. */ | ||
116 | struct jffs_node | ||
117 | { | ||
118 | __u32 ino; /* Inode number. */ | ||
119 | __u32 version; /* Version number. */ | ||
120 | __u32 data_offset; /* Logic location of the data to insert. */ | ||
121 | __u32 data_size; /* The amount of data this node inserts. */ | ||
122 | __u32 removed_size; /* The amount of data that this node removes. */ | ||
123 | __u32 fm_offset; /* Physical location of the data in the actual | ||
124 | flash memory data chunk. */ | ||
125 | __u8 name_size; /* Size of the name. */ | ||
126 | struct jffs_fm *fm; /* Physical memory information. */ | ||
127 | struct jffs_node *version_prev; | ||
128 | struct jffs_node *version_next; | ||
129 | struct jffs_node *range_prev; | ||
130 | struct jffs_node *range_next; | ||
131 | }; | ||
132 | |||
133 | |||
134 | /* The RAM representation of a file (plain files, directories, | ||
135 | links, etc.). Pointers to jffs_files are normally named `f' | ||
136 | in the JFFS source code. */ | ||
137 | struct jffs_file | ||
138 | { | ||
139 | __u32 ino; /* Inode number. */ | ||
140 | __u32 pino; /* Parent's inode number. */ | ||
141 | __u32 mode; /* file_type, mode */ | ||
142 | __u16 uid; /* owner */ | ||
143 | __u16 gid; /* group */ | ||
144 | __u32 atime; /* Last access time. */ | ||
145 | __u32 mtime; /* Last modification time. */ | ||
146 | __u32 ctime; /* Creation time. */ | ||
147 | __u8 nsize; /* Name length. */ | ||
148 | __u8 nlink; /* Number of links. */ | ||
149 | __u8 deleted; /* Has this file been deleted? */ | ||
150 | char *name; /* The name of this file; NULL-terminated. */ | ||
151 | __u32 size; /* The total size of the file's data. */ | ||
152 | __u32 highest_version; /* The highest version number of this file. */ | ||
153 | struct jffs_control *c; | ||
154 | struct jffs_file *parent; /* Reference to the parent directory. */ | ||
155 | struct jffs_file *children; /* Always NULL for plain files. */ | ||
156 | struct jffs_file *sibling_prev; /* Siblings in the same directory. */ | ||
157 | struct jffs_file *sibling_next; | ||
158 | struct list_head hash; /* hash list. */ | ||
159 | struct jffs_node *range_head; /* The final data. */ | ||
160 | struct jffs_node *range_tail; /* The first data. */ | ||
161 | struct jffs_node *version_head; /* The youngest node. */ | ||
162 | struct jffs_node *version_tail; /* The oldest node. */ | ||
163 | }; | ||
164 | |||
165 | |||
166 | /* This is just a definition of a simple list used for keeping track of | ||
167 | files deleted due to a rename. This list is only used during the | ||
168 | mounting of the file system and only if there have been rename operations | ||
169 | earlier. */ | ||
170 | struct jffs_delete_list | ||
171 | { | ||
172 | __u32 ino; | ||
173 | struct jffs_delete_list *next; | ||
174 | }; | ||
175 | |||
176 | |||
177 | /* A struct for the overall file system control. Pointers to | ||
178 | jffs_control structs are named `c' in the source code. */ | ||
179 | struct jffs_control | ||
180 | { | ||
181 | struct super_block *sb; /* Reference to the VFS super block. */ | ||
182 | struct jffs_file *root; /* The root directory file. */ | ||
183 | struct list_head *hash; /* Hash table for finding files by ino. */ | ||
184 | struct jffs_fmcontrol *fmc; /* Flash memory control structure. */ | ||
185 | __u32 hash_len; /* The size of the hash table. */ | ||
186 | __u32 next_ino; /* Next inode number to use for new files. */ | ||
187 | __u16 building_fs; /* Is the file system being built right now? */ | ||
188 | struct jffs_delete_list *delete_list; /* Track deleted files. */ | ||
189 | pid_t thread_pid; /* GC thread's PID */ | ||
190 | struct task_struct *gc_task; /* GC task struct */ | ||
191 | struct completion gc_thread_comp; /* GC thread exit mutex */ | ||
192 | __u32 gc_minfree_threshold; /* GC trigger thresholds */ | ||
193 | __u32 gc_maxdirty_threshold; | ||
194 | }; | ||
195 | |||
196 | |||
197 | /* Used to inform about flash status. */ | ||
198 | struct jffs_flash_status | ||
199 | { | ||
200 | __u32 size; | ||
201 | __u32 used; | ||
202 | __u32 dirty; | ||
203 | __u32 begin; | ||
204 | __u32 end; | ||
205 | }; | ||
206 | |||
207 | /* This stuff could be used for finding memory leaks. */ | ||
208 | #define JFFS_MEMORY_DEBUG 0 | ||
209 | |||
210 | extern long no_jffs_node; | ||
211 | #if defined(JFFS_MEMORY_DEBUG) && JFFS_MEMORY_DEBUG | ||
212 | extern long no_jffs_control; | ||
213 | extern long no_jffs_raw_inode; | ||
214 | extern long no_jffs_node_ref; | ||
215 | extern long no_jffs_fm; | ||
216 | extern long no_jffs_fmcontrol; | ||
217 | extern long no_hash; | ||
218 | extern long no_name; | ||
219 | #define DJM(x) x | ||
220 | #else | ||
221 | #define DJM(x) | ||
222 | #endif | ||
223 | |||
224 | #endif /* __LINUX_JFFS_H__ */ | ||
diff --git a/include/linux/jhash.h b/include/linux/jhash.h index 82c7ae412eec..2a2f99fbcb16 100644 --- a/include/linux/jhash.h +++ b/include/linux/jhash.h | |||
@@ -84,7 +84,7 @@ static inline u32 jhash(const void *key, u32 length, u32 initval) | |||
84 | /* A special optimized version that handles 1 or more of u32s. | 84 | /* A special optimized version that handles 1 or more of u32s. |
85 | * The length parameter here is the number of u32s in the key. | 85 | * The length parameter here is the number of u32s in the key. |
86 | */ | 86 | */ |
87 | static inline u32 jhash2(u32 *k, u32 length, u32 initval) | 87 | static inline u32 jhash2(const u32 *k, u32 length, u32 initval) |
88 | { | 88 | { |
89 | u32 a, b, c, len; | 89 | u32 a, b, c, len; |
90 | 90 | ||
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 1cebcbc28b47..3e3b92dabe3b 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -7,6 +7,8 @@ | |||
7 | 7 | ||
8 | 8 | ||
9 | #define KSYM_NAME_LEN 127 | 9 | #define KSYM_NAME_LEN 127 |
10 | #define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ | ||
11 | 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1) | ||
10 | 12 | ||
11 | #ifdef CONFIG_KALLSYMS | 13 | #ifdef CONFIG_KALLSYMS |
12 | /* Lookup the address for a symbol. Returns 0 if not found. */ | 14 | /* Lookup the address for a symbol. Returns 0 if not found. */ |
@@ -22,7 +24,10 @@ const char *kallsyms_lookup(unsigned long addr, | |||
22 | unsigned long *offset, | 24 | unsigned long *offset, |
23 | char **modname, char *namebuf); | 25 | char **modname, char *namebuf); |
24 | 26 | ||
25 | /* Replace "%s" in format with address, if found */ | 27 | /* Look up a kernel symbol and return it in a text buffer. */ |
28 | extern int sprint_symbol(char *buffer, unsigned long address); | ||
29 | |||
30 | /* Look up a kernel symbol and print it to the kernel messages. */ | ||
26 | extern void __print_symbol(const char *fmt, unsigned long address); | 31 | extern void __print_symbol(const char *fmt, unsigned long address); |
27 | 32 | ||
28 | #else /* !CONFIG_KALLSYMS */ | 33 | #else /* !CONFIG_KALLSYMS */ |
@@ -47,6 +52,12 @@ static inline const char *kallsyms_lookup(unsigned long addr, | |||
47 | return NULL; | 52 | return NULL; |
48 | } | 53 | } |
49 | 54 | ||
55 | static inline int sprint_symbol(char *buffer, unsigned long addr) | ||
56 | { | ||
57 | *buffer = '\0'; | ||
58 | return 0; | ||
59 | } | ||
60 | |||
50 | /* Stupid that this does nothing, but I didn't create this mess. */ | 61 | /* Stupid that this does nothing, but I didn't create this mess. */ |
51 | #define __print_symbol(fmt, addr) | 62 | #define __print_symbol(fmt, addr) |
52 | #endif /*CONFIG_KALLSYMS*/ | 63 | #endif /*CONFIG_KALLSYMS*/ |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 06c58c423fe1..506ad20c18f8 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
@@ -75,7 +75,7 @@ extern int do_poke_blanked_console; | |||
75 | 75 | ||
76 | extern void (*kbd_ledfunc)(unsigned int led); | 76 | extern void (*kbd_ledfunc)(unsigned int led); |
77 | 77 | ||
78 | extern void set_console(int nr); | 78 | extern int set_console(int nr); |
79 | extern void schedule_console_callback(void); | 79 | extern void schedule_console_callback(void); |
80 | 80 | ||
81 | static inline void set_leds(void) | 81 | static inline void set_leds(void) |
diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h index bceea527dd37..2dacab8beccb 100644 --- a/include/linux/kdev_t.h +++ b/include/linux/kdev_t.h | |||
@@ -87,7 +87,6 @@ static inline unsigned sysv_minor(u32 dev) | |||
87 | return dev & 0x3ffff; | 87 | return dev & 0x3ffff; |
88 | } | 88 | } |
89 | 89 | ||
90 | |||
91 | #else /* __KERNEL__ */ | 90 | #else /* __KERNEL__ */ |
92 | 91 | ||
93 | /* | 92 | /* |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 9ddf25c21538..e2f41b051b12 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -121,6 +121,7 @@ extern int vscnprintf(char *buf, size_t size, const char *fmt, va_list args) | |||
121 | __attribute__ ((format (printf, 3, 0))); | 121 | __attribute__ ((format (printf, 3, 0))); |
122 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) | 122 | extern char *kasprintf(gfp_t gfp, const char *fmt, ...) |
123 | __attribute__ ((format (printf, 2, 3))); | 123 | __attribute__ ((format (printf, 2, 3))); |
124 | extern char *kvasprintf(gfp_t gfp, const char *fmt, va_list args); | ||
124 | 125 | ||
125 | extern int sscanf(const char *, const char *, ...) | 126 | extern int sscanf(const char *, const char *, ...) |
126 | __attribute__ ((format (scanf, 2, 3))); | 127 | __attribute__ ((format (scanf, 2, 3))); |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index d02425cdd801..696e5ec63f77 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -125,6 +125,7 @@ extern struct kimage *kexec_crash_image; | |||
125 | #define KEXEC_ARCH_PPC (20 << 16) | 125 | #define KEXEC_ARCH_PPC (20 << 16) |
126 | #define KEXEC_ARCH_PPC64 (21 << 16) | 126 | #define KEXEC_ARCH_PPC64 (21 << 16) |
127 | #define KEXEC_ARCH_IA_64 (50 << 16) | 127 | #define KEXEC_ARCH_IA_64 (50 << 16) |
128 | #define KEXEC_ARCH_ARM (40 << 16) | ||
128 | #define KEXEC_ARCH_S390 (22 << 16) | 129 | #define KEXEC_ARCH_S390 (22 << 16) |
129 | #define KEXEC_ARCH_SH (42 << 16) | 130 | #define KEXEC_ARCH_SH (42 << 16) |
130 | #define KEXEC_ARCH_MIPS_LE (10 << 16) | 131 | #define KEXEC_ARCH_MIPS_LE (10 << 16) |
diff --git a/include/linux/key.h b/include/linux/key.h index 169f05e4863e..a9220e75782e 100644 --- a/include/linux/key.h +++ b/include/linux/key.h | |||
@@ -160,6 +160,8 @@ struct key { | |||
160 | */ | 160 | */ |
161 | union { | 161 | union { |
162 | struct list_head link; | 162 | struct list_head link; |
163 | unsigned long x[2]; | ||
164 | void *p[2]; | ||
163 | } type_data; | 165 | } type_data; |
164 | 166 | ||
165 | /* key data | 167 | /* key data |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index b850e0310538..eb0e63ef297f 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/sysfs.h> | 22 | #include <linux/sysfs.h> |
23 | #include <linux/compiler.h> | 23 | #include <linux/compiler.h> |
24 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
25 | #include <linux/rwsem.h> | ||
26 | #include <linux/kref.h> | 25 | #include <linux/kref.h> |
27 | #include <linux/kernel.h> | 26 | #include <linux/kernel.h> |
28 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
@@ -43,11 +42,9 @@ enum kobject_action { | |||
43 | KOBJ_ADD = (__force kobject_action_t) 0x01, /* exclusive to core */ | 42 | KOBJ_ADD = (__force kobject_action_t) 0x01, /* exclusive to core */ |
44 | KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* exclusive to core */ | 43 | KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* exclusive to core */ |
45 | KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* device state change */ | 44 | KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* device state change */ |
46 | KOBJ_MOUNT = (__force kobject_action_t) 0x04, /* mount event for block devices (broken) */ | 45 | KOBJ_OFFLINE = (__force kobject_action_t) 0x04, /* device offline */ |
47 | KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices (broken) */ | 46 | KOBJ_ONLINE = (__force kobject_action_t) 0x05, /* device online */ |
48 | KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* device offline */ | 47 | KOBJ_MOVE = (__force kobject_action_t) 0x06, /* device move */ |
49 | KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* device online */ | ||
50 | KOBJ_MOVE = (__force kobject_action_t) 0x08, /* device move */ | ||
51 | }; | 48 | }; |
52 | 49 | ||
53 | struct kobject { | 50 | struct kobject { |
@@ -89,6 +86,8 @@ extern void kobject_unregister(struct kobject *); | |||
89 | extern struct kobject * kobject_get(struct kobject *); | 86 | extern struct kobject * kobject_get(struct kobject *); |
90 | extern void kobject_put(struct kobject *); | 87 | extern void kobject_put(struct kobject *); |
91 | 88 | ||
89 | extern struct kobject *kobject_kset_add_dir(struct kset *kset, | ||
90 | struct kobject *, const char *); | ||
92 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); | 91 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); |
93 | 92 | ||
94 | extern char * kobject_get_path(struct kobject *, gfp_t); | 93 | extern char * kobject_get_path(struct kobject *, gfp_t); |
@@ -175,7 +174,6 @@ extern struct kobject * kset_find_obj(struct kset *, const char *); | |||
175 | 174 | ||
176 | struct subsystem { | 175 | struct subsystem { |
177 | struct kset kset; | 176 | struct kset kset; |
178 | struct rw_semaphore rwsem; | ||
179 | }; | 177 | }; |
180 | 178 | ||
181 | #define decl_subsys(_name,_type,_uevent_ops) \ | 179 | #define decl_subsys(_name,_type,_uevent_ops) \ |
diff --git a/include/linux/ks0108.h b/include/linux/ks0108.h index 8047d4b17bf1..a2c54acceb4e 100644 --- a/include/linux/ks0108.h +++ b/include/linux/ks0108.h | |||
@@ -43,4 +43,7 @@ extern void ks0108_address(unsigned char address); | |||
43 | /* Set the controller's current page (0..7) */ | 43 | /* Set the controller's current page (0..7) */ |
44 | extern void ks0108_page(unsigned char page); | 44 | extern void ks0108_page(unsigned char page); |
45 | 45 | ||
46 | /* Is the module inited? */ | ||
47 | extern unsigned char ks0108_isinited(void); | ||
48 | |||
46 | #endif /* _KS0108_H_ */ | 49 | #endif /* _KS0108_H_ */ |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c68c7ac6b232..81bb9c7a4eb3 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -57,7 +57,11 @@ typedef union { | |||
57 | } ktime_t; | 57 | } ktime_t; |
58 | 58 | ||
59 | #define KTIME_MAX ((s64)~((u64)1 << 63)) | 59 | #define KTIME_MAX ((s64)~((u64)1 << 63)) |
60 | #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | 60 | #if (BITS_PER_LONG == 64) |
61 | # define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC) | ||
62 | #else | ||
63 | # define KTIME_SEC_MAX LONG_MAX | ||
64 | #endif | ||
61 | 65 | ||
62 | /* | 66 | /* |
63 | * ktime_t definitions when using the 64-bit scalar representation: | 67 | * ktime_t definitions when using the 64-bit scalar representation: |
@@ -255,6 +259,12 @@ static inline s64 ktime_to_ns(const ktime_t kt) | |||
255 | 259 | ||
256 | #endif | 260 | #endif |
257 | 261 | ||
262 | static inline s64 ktime_to_us(const ktime_t kt) | ||
263 | { | ||
264 | struct timeval tv = ktime_to_timeval(kt); | ||
265 | return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; | ||
266 | } | ||
267 | |||
258 | /* | 268 | /* |
259 | * The resolution of the clocks. The resolution value is returned in | 269 | * The resolution of the clocks. The resolution value is returned in |
260 | * the clock_getres() system call to give application programmers an | 270 | * the clock_getres() system call to give application programmers an |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f3604593fb76..275354ffa1cb 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <asm/types.h> | 11 | #include <asm/types.h> |
12 | #include <linux/ioctl.h> | 12 | #include <linux/ioctl.h> |
13 | 13 | ||
14 | #define KVM_API_VERSION 3 | 14 | #define KVM_API_VERSION 4 |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Architectural interrupt line count, and the size of the bitmap needed | 17 | * Architectural interrupt line count, and the size of the bitmap needed |
@@ -52,11 +52,10 @@ enum kvm_exit_reason { | |||
52 | /* for KVM_RUN */ | 52 | /* for KVM_RUN */ |
53 | struct kvm_run { | 53 | struct kvm_run { |
54 | /* in */ | 54 | /* in */ |
55 | __u32 vcpu; | ||
56 | __u32 emulated; /* skip current instruction */ | 55 | __u32 emulated; /* skip current instruction */ |
57 | __u32 mmio_completed; /* mmio request completed */ | 56 | __u32 mmio_completed; /* mmio request completed */ |
58 | __u8 request_interrupt_window; | 57 | __u8 request_interrupt_window; |
59 | __u8 padding1[3]; | 58 | __u8 padding1[7]; |
60 | 59 | ||
61 | /* out */ | 60 | /* out */ |
62 | __u32 exit_type; | 61 | __u32 exit_type; |
@@ -111,10 +110,6 @@ struct kvm_run { | |||
111 | 110 | ||
112 | /* for KVM_GET_REGS and KVM_SET_REGS */ | 111 | /* for KVM_GET_REGS and KVM_SET_REGS */ |
113 | struct kvm_regs { | 112 | struct kvm_regs { |
114 | /* in */ | ||
115 | __u32 vcpu; | ||
116 | __u32 padding; | ||
117 | |||
118 | /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ | 113 | /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */ |
119 | __u64 rax, rbx, rcx, rdx; | 114 | __u64 rax, rbx, rcx, rdx; |
120 | __u64 rsi, rdi, rsp, rbp; | 115 | __u64 rsi, rdi, rsp, rbp; |
@@ -141,10 +136,6 @@ struct kvm_dtable { | |||
141 | 136 | ||
142 | /* for KVM_GET_SREGS and KVM_SET_SREGS */ | 137 | /* for KVM_GET_SREGS and KVM_SET_SREGS */ |
143 | struct kvm_sregs { | 138 | struct kvm_sregs { |
144 | /* in */ | ||
145 | __u32 vcpu; | ||
146 | __u32 padding; | ||
147 | |||
148 | /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */ | 139 | /* out (KVM_GET_SREGS) / in (KVM_SET_SREGS) */ |
149 | struct kvm_segment cs, ds, es, fs, gs, ss; | 140 | struct kvm_segment cs, ds, es, fs, gs, ss; |
150 | struct kvm_segment tr, ldt; | 141 | struct kvm_segment tr, ldt; |
@@ -163,8 +154,8 @@ struct kvm_msr_entry { | |||
163 | 154 | ||
164 | /* for KVM_GET_MSRS and KVM_SET_MSRS */ | 155 | /* for KVM_GET_MSRS and KVM_SET_MSRS */ |
165 | struct kvm_msrs { | 156 | struct kvm_msrs { |
166 | __u32 vcpu; | ||
167 | __u32 nmsrs; /* number of msrs in entries */ | 157 | __u32 nmsrs; /* number of msrs in entries */ |
158 | __u32 pad; | ||
168 | 159 | ||
169 | struct kvm_msr_entry entries[0]; | 160 | struct kvm_msr_entry entries[0]; |
170 | }; | 161 | }; |
@@ -179,8 +170,6 @@ struct kvm_msr_list { | |||
179 | struct kvm_translation { | 170 | struct kvm_translation { |
180 | /* in */ | 171 | /* in */ |
181 | __u64 linear_address; | 172 | __u64 linear_address; |
182 | __u32 vcpu; | ||
183 | __u32 padding; | ||
184 | 173 | ||
185 | /* out */ | 174 | /* out */ |
186 | __u64 physical_address; | 175 | __u64 physical_address; |
@@ -193,7 +182,6 @@ struct kvm_translation { | |||
193 | /* for KVM_INTERRUPT */ | 182 | /* for KVM_INTERRUPT */ |
194 | struct kvm_interrupt { | 183 | struct kvm_interrupt { |
195 | /* in */ | 184 | /* in */ |
196 | __u32 vcpu; | ||
197 | __u32 irq; | 185 | __u32 irq; |
198 | }; | 186 | }; |
199 | 187 | ||
@@ -206,8 +194,8 @@ struct kvm_breakpoint { | |||
206 | /* for KVM_DEBUG_GUEST */ | 194 | /* for KVM_DEBUG_GUEST */ |
207 | struct kvm_debug_guest { | 195 | struct kvm_debug_guest { |
208 | /* int */ | 196 | /* int */ |
209 | __u32 vcpu; | ||
210 | __u32 enabled; | 197 | __u32 enabled; |
198 | __u32 pad; | ||
211 | struct kvm_breakpoint breakpoints[4]; | 199 | struct kvm_breakpoint breakpoints[4]; |
212 | __u32 singlestep; | 200 | __u32 singlestep; |
213 | }; | 201 | }; |
@@ -224,20 +212,36 @@ struct kvm_dirty_log { | |||
224 | 212 | ||
225 | #define KVMIO 0xAE | 213 | #define KVMIO 0xAE |
226 | 214 | ||
215 | /* | ||
216 | * ioctls for /dev/kvm fds: | ||
217 | */ | ||
227 | #define KVM_GET_API_VERSION _IO(KVMIO, 1) | 218 | #define KVM_GET_API_VERSION _IO(KVMIO, 1) |
219 | #define KVM_CREATE_VM _IO(KVMIO, 2) /* returns a VM fd */ | ||
220 | #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list) | ||
221 | |||
222 | /* | ||
223 | * ioctls for VM fds | ||
224 | */ | ||
225 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region) | ||
226 | /* | ||
227 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns | ||
228 | * a vcpu fd. | ||
229 | */ | ||
230 | #define KVM_CREATE_VCPU _IOW(KVMIO, 11, int) | ||
231 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log) | ||
232 | |||
233 | /* | ||
234 | * ioctls for vcpu fds | ||
235 | */ | ||
228 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) | 236 | #define KVM_RUN _IOWR(KVMIO, 2, struct kvm_run) |
229 | #define KVM_GET_REGS _IOWR(KVMIO, 3, struct kvm_regs) | 237 | #define KVM_GET_REGS _IOR(KVMIO, 3, struct kvm_regs) |
230 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) | 238 | #define KVM_SET_REGS _IOW(KVMIO, 4, struct kvm_regs) |
231 | #define KVM_GET_SREGS _IOWR(KVMIO, 5, struct kvm_sregs) | 239 | #define KVM_GET_SREGS _IOR(KVMIO, 5, struct kvm_sregs) |
232 | #define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs) | 240 | #define KVM_SET_SREGS _IOW(KVMIO, 6, struct kvm_sregs) |
233 | #define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation) | 241 | #define KVM_TRANSLATE _IOWR(KVMIO, 7, struct kvm_translation) |
234 | #define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt) | 242 | #define KVM_INTERRUPT _IOW(KVMIO, 8, struct kvm_interrupt) |
235 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest) | 243 | #define KVM_DEBUG_GUEST _IOW(KVMIO, 9, struct kvm_debug_guest) |
236 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 10, struct kvm_memory_region) | ||
237 | #define KVM_CREATE_VCPU _IOW(KVMIO, 11, int /* vcpu_slot */) | ||
238 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 12, struct kvm_dirty_log) | ||
239 | #define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs) | 244 | #define KVM_GET_MSRS _IOWR(KVMIO, 13, struct kvm_msrs) |
240 | #define KVM_SET_MSRS _IOWR(KVMIO, 14, struct kvm_msrs) | 245 | #define KVM_SET_MSRS _IOW(KVMIO, 14, struct kvm_msrs) |
241 | #define KVM_GET_MSR_INDEX_LIST _IOWR(KVMIO, 15, struct kvm_msr_list) | ||
242 | 246 | ||
243 | #endif | 247 | #endif |
diff --git a/include/linux/kvm_para.h b/include/linux/kvm_para.h new file mode 100644 index 000000000000..3b292565a693 --- /dev/null +++ b/include/linux/kvm_para.h | |||
@@ -0,0 +1,73 @@ | |||
1 | #ifndef __LINUX_KVM_PARA_H | ||
2 | #define __LINUX_KVM_PARA_H | ||
3 | |||
4 | /* | ||
5 | * Guest OS interface for KVM paravirtualization | ||
6 | * | ||
7 | * Note: this interface is totally experimental, and is certain to change | ||
8 | * as we make progress. | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * Per-VCPU descriptor area shared between guest and host. Writable to | ||
13 | * both guest and host. Registered with the host by the guest when | ||
14 | * a guest acknowledges paravirtual mode. | ||
15 | * | ||
16 | * NOTE: all addresses are guest-physical addresses (gpa), to make it | ||
17 | * easier for the hypervisor to map between the various addresses. | ||
18 | */ | ||
19 | struct kvm_vcpu_para_state { | ||
20 | /* | ||
21 | * API version information for compatibility. If there's any support | ||
22 | * mismatch (too old host trying to execute too new guest) then | ||
23 | * the host will deny entry into paravirtual mode. Any other | ||
24 | * combination (new host + old guest and new host + new guest) | ||
25 | * is supposed to work - new host versions will support all old | ||
26 | * guest API versions. | ||
27 | */ | ||
28 | u32 guest_version; | ||
29 | u32 host_version; | ||
30 | u32 size; | ||
31 | u32 ret; | ||
32 | |||
33 | /* | ||
34 | * The address of the vm exit instruction (VMCALL or VMMCALL), | ||
35 | * which the host will patch according to the CPU model the | ||
36 | * VM runs on: | ||
37 | */ | ||
38 | u64 hypercall_gpa; | ||
39 | |||
40 | } __attribute__ ((aligned(PAGE_SIZE))); | ||
41 | |||
42 | #define KVM_PARA_API_VERSION 1 | ||
43 | |||
44 | /* | ||
45 | * This is used for an RDMSR's ECX parameter to probe for a KVM host. | ||
46 | * Hopefully no CPU vendor will use up this number. This is placed well | ||
47 | * out of way of the typical space occupied by CPU vendors' MSR indices, | ||
48 | * and we think (or at least hope) it wont be occupied in the future | ||
49 | * either. | ||
50 | */ | ||
51 | #define MSR_KVM_API_MAGIC 0x87655678 | ||
52 | |||
53 | #define KVM_EINVAL 1 | ||
54 | |||
55 | /* | ||
56 | * Hypercall calling convention: | ||
57 | * | ||
58 | * Each hypercall may have 0-6 parameters. | ||
59 | * | ||
60 | * 64-bit hypercall index is in RAX, goes from 0 to __NR_hypercalls-1 | ||
61 | * | ||
62 | * 64-bit parameters 1-6 are in the standard gcc x86_64 calling convention | ||
63 | * order: RDI, RSI, RDX, RCX, R8, R9. | ||
64 | * | ||
65 | * 32-bit index is EBX, parameters are: EAX, ECX, EDX, ESI, EDI, EBP. | ||
66 | * (the first 3 are according to the gcc regparm calling convention) | ||
67 | * | ||
68 | * No registers are clobbered by the hypercall, except that the | ||
69 | * return value is in RAX. | ||
70 | */ | ||
71 | #define __NR_hypercalls 0 | ||
72 | |||
73 | #endif | ||
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index d739b2e7eac2..598793c0745b 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -9,22 +9,38 @@ | |||
9 | #define _LINUX_LCD_H | 9 | #define _LINUX_LCD_H |
10 | 10 | ||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | ||
12 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
13 | 14 | ||
15 | /* Notes on locking: | ||
16 | * | ||
17 | * lcd_device->ops_lock is an internal backlight lock protecting the ops | ||
18 | * field and no code outside the core should need to touch it. | ||
19 | * | ||
20 | * Access to set_power() is serialised by the update_lock mutex since | ||
21 | * most drivers seem to need this and historically get it wrong. | ||
22 | * | ||
23 | * Most drivers don't need locking on their get_power() method. | ||
24 | * If yours does, you need to implement it in the driver. You can use the | ||
25 | * update_lock mutex if appropriate. | ||
26 | * | ||
27 | * Any other use of the locks below is probably wrong. | ||
28 | */ | ||
29 | |||
14 | struct lcd_device; | 30 | struct lcd_device; |
15 | struct fb_info; | 31 | struct fb_info; |
16 | 32 | ||
17 | /* This structure defines all the properties of a LCD flat panel. */ | ||
18 | struct lcd_properties { | 33 | struct lcd_properties { |
19 | /* Owner module */ | 34 | /* The maximum value for contrast (read-only) */ |
20 | struct module *owner; | 35 | int max_contrast; |
36 | }; | ||
37 | |||
38 | struct lcd_ops { | ||
21 | /* Get the LCD panel power status (0: full on, 1..3: controller | 39 | /* Get the LCD panel power status (0: full on, 1..3: controller |
22 | power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ | 40 | power on, flat panel power off, 4: full off), see FB_BLANK_XXX */ |
23 | int (*get_power)(struct lcd_device *); | 41 | int (*get_power)(struct lcd_device *); |
24 | /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ | 42 | /* Enable or disable power to the LCD (0: on; 4: off, see FB_BLANK_XXX) */ |
25 | int (*set_power)(struct lcd_device *, int power); | 43 | int (*set_power)(struct lcd_device *, int power); |
26 | /* The maximum value for contrast (read-only) */ | ||
27 | int max_contrast; | ||
28 | /* Get the current contrast setting (0-max_contrast) */ | 44 | /* Get the current contrast setting (0-max_contrast) */ |
29 | int (*get_contrast)(struct lcd_device *); | 45 | int (*get_contrast)(struct lcd_device *); |
30 | /* Set LCD panel contrast */ | 46 | /* Set LCD panel contrast */ |
@@ -35,20 +51,31 @@ struct lcd_properties { | |||
35 | }; | 51 | }; |
36 | 52 | ||
37 | struct lcd_device { | 53 | struct lcd_device { |
38 | /* This protects the 'props' field. If 'props' is NULL, the driver that | 54 | struct lcd_properties props; |
55 | /* This protects the 'ops' field. If 'ops' is NULL, the driver that | ||
39 | registered this device has been unloaded, and if class_get_devdata() | 56 | registered this device has been unloaded, and if class_get_devdata() |
40 | points to something in the body of that driver, it is also invalid. */ | 57 | points to something in the body of that driver, it is also invalid. */ |
41 | struct semaphore sem; | 58 | struct mutex ops_lock; |
42 | /* If this is NULL, the backing module is unloaded */ | 59 | /* If this is NULL, the backing module is unloaded */ |
43 | struct lcd_properties *props; | 60 | struct lcd_ops *ops; |
61 | /* Serialise access to set_power method */ | ||
62 | struct mutex update_lock; | ||
44 | /* The framebuffer notifier block */ | 63 | /* The framebuffer notifier block */ |
45 | struct notifier_block fb_notif; | 64 | struct notifier_block fb_notif; |
46 | /* The class device structure */ | 65 | /* The class device structure */ |
47 | struct class_device class_dev; | 66 | struct class_device class_dev; |
48 | }; | 67 | }; |
49 | 68 | ||
69 | static inline void lcd_set_power(struct lcd_device *ld, int power) | ||
70 | { | ||
71 | mutex_lock(&ld->update_lock); | ||
72 | if (ld->ops && ld->ops->set_power) | ||
73 | ld->ops->set_power(ld, power); | ||
74 | mutex_unlock(&ld->update_lock); | ||
75 | } | ||
76 | |||
50 | extern struct lcd_device *lcd_device_register(const char *name, | 77 | extern struct lcd_device *lcd_device_register(const char *name, |
51 | void *devdata, struct lcd_properties *lp); | 78 | void *devdata, struct lcd_ops *ops); |
52 | extern void lcd_device_unregister(struct lcd_device *ld); | 79 | extern void lcd_device_unregister(struct lcd_device *ld); |
53 | 80 | ||
54 | #define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) | 81 | #define to_lcd_device(obj) container_of(obj, struct lcd_device, class_dev) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index b870b20df43c..d8cfc72ea9c1 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #include <linux/ata.h> | 35 | #include <linux/ata.h> |
36 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
37 | #include <scsi/scsi_host.h> | 37 | #include <scsi/scsi_host.h> |
38 | #include <linux/acpi.h> | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * Define if arch has non-standard setup. This is a _PCI_ standard | 41 | * Define if arch has non-standard setup. This is a _PCI_ standard |
@@ -209,6 +210,7 @@ enum { | |||
209 | 210 | ||
210 | /* host set flags */ | 211 | /* host set flags */ |
211 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ | 212 | ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host only */ |
213 | ATA_HOST_STARTED = (1 << 1), /* Host started */ | ||
212 | 214 | ||
213 | /* various lengths of time */ | 215 | /* various lengths of time */ |
214 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ | 216 | ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ |
@@ -280,11 +282,13 @@ enum { | |||
280 | ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */ | 282 | ATA_EHI_NO_AUTOPSY = (1 << 2), /* no autopsy */ |
281 | ATA_EHI_QUIET = (1 << 3), /* be quiet */ | 283 | ATA_EHI_QUIET = (1 << 3), /* be quiet */ |
282 | 284 | ||
283 | ATA_EHI_DID_RESET = (1 << 16), /* already reset this port */ | 285 | ATA_EHI_DID_SOFTRESET = (1 << 16), /* already soft-reset this port */ |
284 | ATA_EHI_PRINTINFO = (1 << 17), /* print configuration info */ | 286 | ATA_EHI_DID_HARDRESET = (1 << 17), /* already soft-reset this port */ |
285 | ATA_EHI_SETMODE = (1 << 18), /* configure transfer mode */ | 287 | ATA_EHI_PRINTINFO = (1 << 18), /* print configuration info */ |
286 | ATA_EHI_POST_SETMODE = (1 << 19), /* revaildating after setmode */ | 288 | ATA_EHI_SETMODE = (1 << 19), /* configure transfer mode */ |
289 | ATA_EHI_POST_SETMODE = (1 << 20), /* revaildating after setmode */ | ||
287 | 290 | ||
291 | ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET, | ||
288 | ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, | 292 | ATA_EHI_RESET_MODIFIER_MASK = ATA_EHI_RESUME_LINK, |
289 | 293 | ||
290 | /* max repeat if error condition is still set after ->error_handler */ | 294 | /* max repeat if error condition is still set after ->error_handler */ |
@@ -310,15 +314,17 @@ enum { | |||
310 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ | 314 | ATA_HORKAGE_DIAGNOSTIC = (1 << 0), /* Failed boot diag */ |
311 | ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ | 315 | ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ |
312 | ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ | 316 | ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ |
317 | ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ | ||
318 | ATA_HORKAGE_DMA_RW_ONLY = (1 << 4), /* ATAPI DMA for RW only */ | ||
313 | }; | 319 | }; |
314 | 320 | ||
315 | enum hsm_task_states { | 321 | enum hsm_task_states { |
316 | HSM_ST_IDLE, /* no command on going */ | 322 | HSM_ST_IDLE, /* no command on going */ |
323 | HSM_ST_FIRST, /* (waiting the device to) | ||
324 | write CDB or first data block */ | ||
317 | HSM_ST, /* (waiting the device to) transfer data */ | 325 | HSM_ST, /* (waiting the device to) transfer data */ |
318 | HSM_ST_LAST, /* (waiting the device to) complete command */ | 326 | HSM_ST_LAST, /* (waiting the device to) complete command */ |
319 | HSM_ST_ERR, /* error */ | 327 | HSM_ST_ERR, /* error */ |
320 | HSM_ST_FIRST, /* (waiting the device to) | ||
321 | write CDB or first data block */ | ||
322 | }; | 328 | }; |
323 | 329 | ||
324 | enum ata_completion_errors { | 330 | enum ata_completion_errors { |
@@ -364,34 +370,6 @@ struct ata_ioports { | |||
364 | void __iomem *scr_addr; | 370 | void __iomem *scr_addr; |
365 | }; | 371 | }; |
366 | 372 | ||
367 | struct ata_probe_ent { | ||
368 | struct list_head node; | ||
369 | struct device *dev; | ||
370 | const struct ata_port_operations *port_ops; | ||
371 | struct scsi_host_template *sht; | ||
372 | struct ata_ioports port[ATA_MAX_PORTS]; | ||
373 | unsigned int n_ports; | ||
374 | unsigned int dummy_port_mask; | ||
375 | unsigned int pio_mask; | ||
376 | unsigned int mwdma_mask; | ||
377 | unsigned int udma_mask; | ||
378 | unsigned long irq; | ||
379 | unsigned long irq2; | ||
380 | unsigned int irq_flags; | ||
381 | unsigned long port_flags; | ||
382 | unsigned long _host_flags; | ||
383 | void __iomem * const *iomap; | ||
384 | void *private_data; | ||
385 | |||
386 | /* port_info for the secondary port. Together with irq2, it's | ||
387 | * used to implement non-uniform secondary port. Currently, | ||
388 | * the only user is ata_piix combined mode. This workaround | ||
389 | * will be removed together with ata_probe_ent when init model | ||
390 | * is updated. | ||
391 | */ | ||
392 | const struct ata_port_info *pinfo2; | ||
393 | }; | ||
394 | |||
395 | struct ata_host { | 373 | struct ata_host { |
396 | spinlock_t lock; | 374 | spinlock_t lock; |
397 | struct device *dev; | 375 | struct device *dev; |
@@ -402,8 +380,7 @@ struct ata_host { | |||
402 | void *private_data; | 380 | void *private_data; |
403 | const struct ata_port_operations *ops; | 381 | const struct ata_port_operations *ops; |
404 | unsigned long flags; | 382 | unsigned long flags; |
405 | int simplex_claimed; /* Keep seperate in case we | 383 | struct ata_port *simplex_claimed; /* channel owning the DMA */ |
406 | ever need to do this locked */ | ||
407 | struct ata_port *ports[0]; | 384 | struct ata_port *ports[0]; |
408 | }; | 385 | }; |
409 | 386 | ||
@@ -425,6 +402,7 @@ struct ata_queued_cmd { | |||
425 | int dma_dir; | 402 | int dma_dir; |
426 | 403 | ||
427 | unsigned int pad_len; | 404 | unsigned int pad_len; |
405 | unsigned int sect_size; | ||
428 | 406 | ||
429 | unsigned int nbytes; | 407 | unsigned int nbytes; |
430 | unsigned int curbytes; | 408 | unsigned int curbytes; |
@@ -470,6 +448,7 @@ struct ata_device { | |||
470 | struct scsi_device *sdev; /* attached SCSI device */ | 448 | struct scsi_device *sdev; /* attached SCSI device */ |
471 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 449 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
472 | u64 n_sectors; /* size of device, if ATA */ | 450 | u64 n_sectors; /* size of device, if ATA */ |
451 | u64 n_sectors_boot; /* size of ATA device at startup */ | ||
473 | unsigned int class; /* ATA_DEV_xxx */ | 452 | unsigned int class; /* ATA_DEV_xxx */ |
474 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 453 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ |
475 | u8 pio_mode; | 454 | u8 pio_mode; |
@@ -494,7 +473,12 @@ struct ata_device { | |||
494 | 473 | ||
495 | /* error history */ | 474 | /* error history */ |
496 | struct ata_ering ering; | 475 | struct ata_ering ering; |
476 | int spdn_cnt; | ||
497 | unsigned int horkage; /* List of broken features */ | 477 | unsigned int horkage; /* List of broken features */ |
478 | #ifdef CONFIG_SATA_ACPI | ||
479 | /* ACPI objects info */ | ||
480 | acpi_handle obj_handle; | ||
481 | #endif | ||
498 | }; | 482 | }; |
499 | 483 | ||
500 | /* Offset into struct ata_device. Fields above it are maintained | 484 | /* Offset into struct ata_device. Fields above it are maintained |
@@ -530,8 +514,8 @@ struct ata_port { | |||
530 | spinlock_t *lock; | 514 | spinlock_t *lock; |
531 | unsigned long flags; /* ATA_FLAG_xxx */ | 515 | unsigned long flags; /* ATA_FLAG_xxx */ |
532 | unsigned int pflags; /* ATA_PFLAG_xxx */ | 516 | unsigned int pflags; /* ATA_PFLAG_xxx */ |
533 | unsigned int id; /* unique id req'd by scsi midlyr */ | 517 | unsigned int print_id; /* user visible unique port ID */ |
534 | unsigned int port_no; /* unique port #; from zero */ | 518 | unsigned int port_no; /* 0 based port no. inside the host */ |
535 | 519 | ||
536 | struct ata_prd *prd; /* our SG list */ | 520 | struct ata_prd *prd; /* our SG list */ |
537 | dma_addr_t prd_dma; /* and its DMA mapping */ | 521 | dma_addr_t prd_dma; /* and its DMA mapping */ |
@@ -590,11 +574,11 @@ struct ata_port { | |||
590 | struct ata_port_operations { | 574 | struct ata_port_operations { |
591 | void (*port_disable) (struct ata_port *); | 575 | void (*port_disable) (struct ata_port *); |
592 | 576 | ||
593 | void (*dev_config) (struct ata_port *, struct ata_device *); | 577 | void (*dev_config) (struct ata_device *); |
594 | 578 | ||
595 | void (*set_piomode) (struct ata_port *, struct ata_device *); | 579 | void (*set_piomode) (struct ata_port *, struct ata_device *); |
596 | void (*set_dmamode) (struct ata_port *, struct ata_device *); | 580 | void (*set_dmamode) (struct ata_port *, struct ata_device *); |
597 | unsigned long (*mode_filter) (const struct ata_port *, struct ata_device *, unsigned long); | 581 | unsigned long (*mode_filter) (struct ata_device *, unsigned long); |
598 | 582 | ||
599 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); | 583 | void (*tf_load) (struct ata_port *ap, const struct ata_taskfile *tf); |
600 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); | 584 | void (*tf_read) (struct ata_port *ap, struct ata_taskfile *tf); |
@@ -609,6 +593,8 @@ struct ata_port_operations { | |||
609 | 593 | ||
610 | void (*post_set_mode) (struct ata_port *ap); | 594 | void (*post_set_mode) (struct ata_port *ap); |
611 | 595 | ||
596 | int (*cable_detect) (struct ata_port *ap); | ||
597 | |||
612 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); | 598 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); |
613 | 599 | ||
614 | void (*bmdma_setup) (struct ata_queued_cmd *qc); | 600 | void (*bmdma_setup) (struct ata_queued_cmd *qc); |
@@ -657,6 +643,7 @@ struct ata_port_info { | |||
657 | unsigned long mwdma_mask; | 643 | unsigned long mwdma_mask; |
658 | unsigned long udma_mask; | 644 | unsigned long udma_mask; |
659 | const struct ata_port_operations *port_ops; | 645 | const struct ata_port_operations *port_ops; |
646 | irq_handler_t irq_handler; | ||
660 | void *private_data; | 647 | void *private_data; |
661 | }; | 648 | }; |
662 | 649 | ||
@@ -679,6 +666,7 @@ extern const unsigned long sata_deb_timing_hotplug[]; | |||
679 | extern const unsigned long sata_deb_timing_long[]; | 666 | extern const unsigned long sata_deb_timing_long[]; |
680 | 667 | ||
681 | extern const struct ata_port_operations ata_dummy_port_ops; | 668 | extern const struct ata_port_operations ata_dummy_port_ops; |
669 | extern const struct ata_port_info ata_dummy_port_info; | ||
682 | 670 | ||
683 | static inline const unsigned long * | 671 | static inline const unsigned long * |
684 | sata_ehc_deb_timing(struct ata_eh_context *ehc) | 672 | sata_ehc_deb_timing(struct ata_eh_context *ehc) |
@@ -694,6 +682,7 @@ static inline int ata_port_is_dummy(struct ata_port *ap) | |||
694 | return ap->ops == &ata_dummy_port_ops; | 682 | return ap->ops == &ata_dummy_port_ops; |
695 | } | 683 | } |
696 | 684 | ||
685 | extern void sata_print_link_status(struct ata_port *ap); | ||
697 | extern void ata_port_probe(struct ata_port *); | 686 | extern void ata_port_probe(struct ata_port *); |
698 | extern void __sata_phy_reset(struct ata_port *ap); | 687 | extern void __sata_phy_reset(struct ata_port *ap); |
699 | extern void sata_phy_reset(struct ata_port *ap); | 688 | extern void sata_phy_reset(struct ata_port *ap); |
@@ -713,13 +702,23 @@ extern void ata_std_ports(struct ata_ioports *ioaddr); | |||
713 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, | 702 | extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, |
714 | unsigned int n_ports); | 703 | unsigned int n_ports); |
715 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 704 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
705 | #ifdef CONFIG_PM | ||
716 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); | 706 | extern void ata_pci_device_do_suspend(struct pci_dev *pdev, pm_message_t mesg); |
717 | extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev); | 707 | extern int __must_check ata_pci_device_do_resume(struct pci_dev *pdev); |
718 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); | 708 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t mesg); |
719 | extern int ata_pci_device_resume(struct pci_dev *pdev); | 709 | extern int ata_pci_device_resume(struct pci_dev *pdev); |
710 | #endif | ||
720 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | 711 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); |
721 | #endif /* CONFIG_PCI */ | 712 | #endif /* CONFIG_PCI */ |
722 | extern int ata_device_add(const struct ata_probe_ent *ent); | 713 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); |
714 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, | ||
715 | const struct ata_port_info * const * ppi, int n_ports); | ||
716 | extern int ata_host_start(struct ata_host *host); | ||
717 | extern int ata_host_register(struct ata_host *host, | ||
718 | struct scsi_host_template *sht); | ||
719 | extern int ata_host_activate(struct ata_host *host, int irq, | ||
720 | irq_handler_t irq_handler, unsigned long irq_flags, | ||
721 | struct scsi_host_template *sht); | ||
723 | extern void ata_host_detach(struct ata_host *host); | 722 | extern void ata_host_detach(struct ata_host *host); |
724 | extern void ata_host_init(struct ata_host *, struct device *, | 723 | extern void ata_host_init(struct ata_host *, struct device *, |
725 | unsigned long, const struct ata_port_operations *); | 724 | unsigned long, const struct ata_port_operations *); |
@@ -742,10 +741,12 @@ extern int sata_scr_write(struct ata_port *ap, int reg, u32 val); | |||
742 | extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); | 741 | extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val); |
743 | extern int ata_port_online(struct ata_port *ap); | 742 | extern int ata_port_online(struct ata_port *ap); |
744 | extern int ata_port_offline(struct ata_port *ap); | 743 | extern int ata_port_offline(struct ata_port *ap); |
744 | #ifdef CONFIG_PM | ||
745 | extern int ata_scsi_device_resume(struct scsi_device *); | 745 | extern int ata_scsi_device_resume(struct scsi_device *); |
746 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); | 746 | extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t mesg); |
747 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 747 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
748 | extern void ata_host_resume(struct ata_host *host); | 748 | extern void ata_host_resume(struct ata_host *host); |
749 | #endif | ||
749 | extern int ata_ratelimit(void); | 750 | extern int ata_ratelimit(void); |
750 | extern int ata_busy_sleep(struct ata_port *ap, | 751 | extern int ata_busy_sleep(struct ata_port *ap, |
751 | unsigned long timeout_pat, unsigned long timeout); | 752 | unsigned long timeout_pat, unsigned long timeout); |
@@ -754,6 +755,7 @@ extern void ata_port_queue_task(struct ata_port *ap, work_func_t fn, | |||
754 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, | 755 | extern u32 ata_wait_register(void __iomem *reg, u32 mask, u32 val, |
755 | unsigned long interval_msec, | 756 | unsigned long interval_msec, |
756 | unsigned long timeout_msec); | 757 | unsigned long timeout_msec); |
758 | extern unsigned int ata_dev_try_classify(struct ata_port *, unsigned int, u8 *); | ||
757 | 759 | ||
758 | /* | 760 | /* |
759 | * Default driver ops implementations | 761 | * Default driver ops implementations |
@@ -781,10 +783,12 @@ extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | |||
781 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 783 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
782 | unsigned int n_elem); | 784 | unsigned int n_elem); |
783 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); | 785 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); |
786 | extern void ata_dev_disable(struct ata_device *adev); | ||
784 | extern void ata_id_string(const u16 *id, unsigned char *s, | 787 | extern void ata_id_string(const u16 *id, unsigned char *s, |
785 | unsigned int ofs, unsigned int len); | 788 | unsigned int ofs, unsigned int len); |
786 | extern void ata_id_c_string(const u16 *id, unsigned char *s, | 789 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
787 | unsigned int ofs, unsigned int len); | 790 | unsigned int ofs, unsigned int len); |
791 | extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown); | ||
788 | extern unsigned long ata_device_blacklisted(const struct ata_device *dev); | 792 | extern unsigned long ata_device_blacklisted(const struct ata_device *dev); |
789 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 793 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
790 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 794 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
@@ -814,11 +818,17 @@ extern void ata_scsi_slave_destroy(struct scsi_device *sdev); | |||
814 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, | 818 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, |
815 | int queue_depth); | 819 | int queue_depth); |
816 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); | 820 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); |
821 | extern int ata_do_set_mode(struct ata_port *ap, struct ata_device **r_failed_dev); | ||
817 | extern u8 ata_irq_on(struct ata_port *ap); | 822 | extern u8 ata_irq_on(struct ata_port *ap); |
818 | extern u8 ata_dummy_irq_on(struct ata_port *ap); | 823 | extern u8 ata_dummy_irq_on(struct ata_port *ap); |
819 | extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq); | 824 | extern u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq); |
820 | extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq); | 825 | extern u8 ata_dummy_irq_ack(struct ata_port *ap, unsigned int chk_drq); |
821 | 826 | ||
827 | extern int ata_cable_40wire(struct ata_port *ap); | ||
828 | extern int ata_cable_80wire(struct ata_port *ap); | ||
829 | extern int ata_cable_sata(struct ata_port *ap); | ||
830 | extern int ata_cable_unknown(struct ata_port *ap); | ||
831 | |||
822 | /* | 832 | /* |
823 | * Timing helpers | 833 | * Timing helpers |
824 | */ | 834 | */ |
@@ -856,10 +866,13 @@ struct pci_bits { | |||
856 | unsigned long val; | 866 | unsigned long val; |
857 | }; | 867 | }; |
858 | 868 | ||
859 | extern struct ata_probe_ent * | 869 | extern int ata_pci_init_native_host(struct ata_host *host, |
860 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); | 870 | unsigned int port_mask); |
871 | extern int ata_pci_prepare_native_host(struct pci_dev *pdev, | ||
872 | const struct ata_port_info * const * ppi, | ||
873 | int n_ports, struct ata_host **r_host); | ||
861 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); | 874 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
862 | extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); | 875 | extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); |
863 | #endif /* CONFIG_PCI */ | 876 | #endif /* CONFIG_PCI */ |
864 | 877 | ||
865 | /* | 878 | /* |
@@ -885,10 +898,10 @@ extern void ata_do_eh(struct ata_port *ap, ata_prereset_fn_t prereset, | |||
885 | * printk helpers | 898 | * printk helpers |
886 | */ | 899 | */ |
887 | #define ata_port_printk(ap, lv, fmt, args...) \ | 900 | #define ata_port_printk(ap, lv, fmt, args...) \ |
888 | printk(lv"ata%u: "fmt, (ap)->id , ##args) | 901 | printk(lv"ata%u: "fmt, (ap)->print_id , ##args) |
889 | 902 | ||
890 | #define ata_dev_printk(dev, lv, fmt, args...) \ | 903 | #define ata_dev_printk(dev, lv, fmt, args...) \ |
891 | printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args) | 904 | printk(lv"ata%u.%02u: "fmt, (dev)->ap->print_id, (dev)->devno , ##args) |
892 | 905 | ||
893 | /* | 906 | /* |
894 | * ata_eh_info helpers | 907 | * ata_eh_info helpers |
@@ -1026,6 +1039,21 @@ static inline u8 ata_chk_status(struct ata_port *ap) | |||
1026 | return ap->ops->check_status(ap); | 1039 | return ap->ops->check_status(ap); |
1027 | } | 1040 | } |
1028 | 1041 | ||
1042 | /** | ||
1043 | * ata_ncq_enabled - Test whether NCQ is enabled | ||
1044 | * @dev: ATA device to test for | ||
1045 | * | ||
1046 | * LOCKING: | ||
1047 | * spin_lock_irqsave(host lock) | ||
1048 | * | ||
1049 | * RETURNS: | ||
1050 | * 1 if NCQ is enabled for @dev, 0 otherwise. | ||
1051 | */ | ||
1052 | static inline int ata_ncq_enabled(struct ata_device *dev) | ||
1053 | { | ||
1054 | return (dev->flags & (ATA_DFLAG_PIO | ATA_DFLAG_NCQ_OFF | | ||
1055 | ATA_DFLAG_NCQ)) == ATA_DFLAG_NCQ; | ||
1056 | } | ||
1029 | 1057 | ||
1030 | /** | 1058 | /** |
1031 | * ata_pause - Flush writes and pause 400 nanoseconds. | 1059 | * ata_pause - Flush writes and pause 400 nanoseconds. |
@@ -1144,6 +1172,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
1144 | qc->n_elem = 0; | 1172 | qc->n_elem = 0; |
1145 | qc->err_mask = 0; | 1173 | qc->err_mask = 0; |
1146 | qc->pad_len = 0; | 1174 | qc->pad_len = 0; |
1175 | qc->sect_size = ATA_SECT_SIZE; | ||
1147 | 1176 | ||
1148 | ata_tf_init(qc->dev, &qc->tf); | 1177 | ata_tf_init(qc->dev, &qc->tf); |
1149 | 1178 | ||
@@ -1191,7 +1220,7 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev) | |||
1191 | 1220 | ||
1192 | static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) | 1221 | static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host) |
1193 | { | 1222 | { |
1194 | return (struct ata_port *) &host->hostdata[0]; | 1223 | return *(struct ata_port **)&host->hostdata[0]; |
1195 | } | 1224 | } |
1196 | 1225 | ||
1197 | #endif /* __LINUX_LIBATA_H__ */ | 1226 | #endif /* __LINUX_LIBATA_H__ */ |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 06fe93a3e916..14c937d345cb 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -245,7 +245,7 @@ extern void lock_release(struct lockdep_map *lock, int nested, | |||
245 | 245 | ||
246 | # define INIT_LOCKDEP .lockdep_recursion = 0, | 246 | # define INIT_LOCKDEP .lockdep_recursion = 0, |
247 | 247 | ||
248 | #define lockdep_depth(tsk) ((tsk)->lockdep_depth) | 248 | #define lockdep_depth(tsk) (debug_locks ? (tsk)->lockdep_depth : 0) |
249 | 249 | ||
250 | #else /* !LOCKDEP */ | 250 | #else /* !LOCKDEP */ |
251 | 251 | ||
diff --git a/include/linux/log2.h b/include/linux/log2.h index 99922bedfcc9..57e641e19a81 100644 --- a/include/linux/log2.h +++ b/include/linux/log2.h | |||
@@ -152,7 +152,7 @@ unsigned long __roundup_pow_of_two(unsigned long n) | |||
152 | * roundup_pow_of_two - round the given value up to nearest power of two | 152 | * roundup_pow_of_two - round the given value up to nearest power of two |
153 | * @n - parameter | 153 | * @n - parameter |
154 | * | 154 | * |
155 | * round the given balue up to the nearest power of two | 155 | * round the given value up to the nearest power of two |
156 | * - the result is undefined when n == 0 | 156 | * - the result is undefined when n == 0 |
157 | * - this can be used to initialise global variables from constant data | 157 | * - this can be used to initialise global variables from constant data |
158 | */ | 158 | */ |
diff --git a/include/linux/magic.h b/include/linux/magic.h index b32c8a97fcec..a9c6567fe70c 100644 --- a/include/linux/magic.h +++ b/include/linux/magic.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define HPFS_SUPER_MAGIC 0xf995e849 | 13 | #define HPFS_SUPER_MAGIC 0xf995e849 |
14 | #define ISOFS_SUPER_MAGIC 0x9660 | 14 | #define ISOFS_SUPER_MAGIC 0x9660 |
15 | #define JFFS2_SUPER_MAGIC 0x72b6 | 15 | #define JFFS2_SUPER_MAGIC 0x72b6 |
16 | #define KVMFS_SUPER_MAGIC 0x19700426 | ||
16 | 17 | ||
17 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ | 18 | #define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ |
18 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ | 19 | #define MINIX_SUPER_MAGIC2 0x138F /* minix fs, 30 char names */ |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h index 48148e0cdbd1..75e55dcdeb18 100644 --- a/include/linux/migrate.h +++ b/include/linux/migrate.h | |||
@@ -5,6 +5,14 @@ | |||
5 | 5 | ||
6 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); | 6 | typedef struct page *new_page_t(struct page *, unsigned long private, int **); |
7 | 7 | ||
8 | /* Check if a vma is migratable */ | ||
9 | static inline int vma_migratable(struct vm_area_struct *vma) | ||
10 | { | ||
11 | if (vma->vm_flags & (VM_IO|VM_HUGETLB|VM_PFNMAP|VM_RESERVED)) | ||
12 | return 0; | ||
13 | return 1; | ||
14 | } | ||
15 | |||
8 | #ifdef CONFIG_MIGRATION | 16 | #ifdef CONFIG_MIGRATION |
9 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | 17 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); |
10 | extern int putback_lru_pages(struct list_head *l); | 18 | extern int putback_lru_pages(struct list_head *l); |
diff --git a/include/linux/minix_fs.h b/include/linux/minix_fs.h index 9850d513ff60..0e39745f5111 100644 --- a/include/linux/minix_fs.h +++ b/include/linux/minix_fs.h | |||
@@ -78,8 +78,7 @@ struct minix_super_block { | |||
78 | * V3 minix super-block data on disk | 78 | * V3 minix super-block data on disk |
79 | */ | 79 | */ |
80 | struct minix3_super_block { | 80 | struct minix3_super_block { |
81 | __u16 s_ninodes; | 81 | __u32 s_ninodes; |
82 | __u16 s_nzones; | ||
83 | __u16 s_pad0; | 82 | __u16 s_pad0; |
84 | __u16 s_imap_blocks; | 83 | __u16 s_imap_blocks; |
85 | __u16 s_zmap_blocks; | 84 | __u16 s_zmap_blocks; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index a0eec16eb0bd..60e0e4a592d2 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -660,15 +660,11 @@ static inline int page_mapped(struct page *page) | |||
660 | extern void show_free_areas(void); | 660 | extern void show_free_areas(void); |
661 | 661 | ||
662 | #ifdef CONFIG_SHMEM | 662 | #ifdef CONFIG_SHMEM |
663 | struct page *shmem_nopage(struct vm_area_struct *vma, | ||
664 | unsigned long address, int *type); | ||
665 | int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new); | 663 | int shmem_set_policy(struct vm_area_struct *vma, struct mempolicy *new); |
666 | struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | 664 | struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, |
667 | unsigned long addr); | 665 | unsigned long addr); |
668 | int shmem_lock(struct file *file, int lock, struct user_struct *user); | 666 | int shmem_lock(struct file *file, int lock, struct user_struct *user); |
669 | #else | 667 | #else |
670 | #define shmem_nopage filemap_nopage | ||
671 | |||
672 | static inline int shmem_lock(struct file *file, int lock, | 668 | static inline int shmem_lock(struct file *file, int lock, |
673 | struct user_struct *user) | 669 | struct user_struct *user) |
674 | { | 670 | { |
@@ -688,7 +684,6 @@ static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma, | |||
688 | } | 684 | } |
689 | #endif | 685 | #endif |
690 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); | 686 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); |
691 | extern int shmem_mmap(struct file *file, struct vm_area_struct *vma); | ||
692 | 687 | ||
693 | int shmem_zero_setup(struct vm_area_struct *); | 688 | int shmem_zero_setup(struct vm_area_struct *); |
694 | 689 | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 913e5752569f..bfcef8a1ad8b 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -62,6 +62,12 @@ struct mmc_ios { | |||
62 | 62 | ||
63 | #define MMC_BUS_WIDTH_1 0 | 63 | #define MMC_BUS_WIDTH_1 0 |
64 | #define MMC_BUS_WIDTH_4 2 | 64 | #define MMC_BUS_WIDTH_4 2 |
65 | |||
66 | unsigned char timing; /* timing specification used */ | ||
67 | |||
68 | #define MMC_TIMING_LEGACY 0 | ||
69 | #define MMC_TIMING_MMC_HS 1 | ||
70 | #define MMC_TIMING_SD_HS 2 | ||
65 | }; | 71 | }; |
66 | 72 | ||
67 | struct mmc_host_ops { | 73 | struct mmc_host_ops { |
@@ -87,6 +93,8 @@ struct mmc_host { | |||
87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 93 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
88 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ | 94 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ |
89 | #define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ | 95 | #define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ |
96 | #define MMC_CAP_MMC_HIGHSPEED (1 << 3) /* Can do MMC high-speed timing */ | ||
97 | #define MMC_CAP_SD_HIGHSPEED (1 << 4) /* Can do SD high-speed timing */ | ||
90 | 98 | ||
91 | /* host specific block data */ | 99 | /* host specific block data */ |
92 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 100 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index e0c393cc7240..e96b2dee10bb 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -320,4 +320,16 @@ struct eisa_device_id { | |||
320 | 320 | ||
321 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" | 321 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" |
322 | 322 | ||
323 | struct parisc_device_id { | ||
324 | __u8 hw_type; /* 5 bits used */ | ||
325 | __u8 hversion_rev; /* 4 bits */ | ||
326 | __u16 hversion; /* 12 bits */ | ||
327 | __u32 sversion; /* 20 bits */ | ||
328 | }; | ||
329 | |||
330 | #define PA_HWTYPE_ANY_ID 0xff | ||
331 | #define PA_HVERSION_REV_ANY_ID 0xff | ||
332 | #define PA_HVERSION_ANY_ID 0xffff | ||
333 | #define PA_SVERSION_ANY_ID 0xffffffff | ||
334 | |||
323 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 335 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index 419d3ef293dd..95679eb8571e 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -76,8 +76,6 @@ void sort_extable(struct exception_table_entry *start, | |||
76 | struct exception_table_entry *finish); | 76 | struct exception_table_entry *finish); |
77 | void sort_main_extable(void); | 77 | void sort_main_extable(void); |
78 | 78 | ||
79 | extern struct subsystem module_subsys; | ||
80 | |||
81 | #ifdef MODULE | 79 | #ifdef MODULE |
82 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 80 | #define MODULE_GENERIC_TABLE(gtype,name) \ |
83 | extern const struct gtype##_id __mod_##gtype##_table \ | 81 | extern const struct gtype##_id __mod_##gtype##_table \ |
@@ -467,10 +465,6 @@ int unregister_module_notifier(struct notifier_block * nb); | |||
467 | 465 | ||
468 | extern void print_modules(void); | 466 | extern void print_modules(void); |
469 | 467 | ||
470 | struct device_driver; | ||
471 | void module_add_driver(struct module *, struct device_driver *); | ||
472 | void module_remove_driver(struct device_driver *); | ||
473 | |||
474 | #else /* !CONFIG_MODULES... */ | 468 | #else /* !CONFIG_MODULES... */ |
475 | #define EXPORT_SYMBOL(sym) | 469 | #define EXPORT_SYMBOL(sym) |
476 | #define EXPORT_SYMBOL_GPL(sym) | 470 | #define EXPORT_SYMBOL_GPL(sym) |
@@ -568,18 +562,59 @@ static inline void print_modules(void) | |||
568 | { | 562 | { |
569 | } | 563 | } |
570 | 564 | ||
565 | #endif /* CONFIG_MODULES */ | ||
566 | |||
571 | struct device_driver; | 567 | struct device_driver; |
568 | #ifdef CONFIG_SYSFS | ||
572 | struct module; | 569 | struct module; |
573 | 570 | ||
574 | static inline void module_add_driver(struct module *module, struct device_driver *driver) | 571 | extern struct subsystem module_subsys; |
572 | |||
573 | int mod_sysfs_init(struct module *mod); | ||
574 | int mod_sysfs_setup(struct module *mod, | ||
575 | struct kernel_param *kparam, | ||
576 | unsigned int num_params); | ||
577 | int module_add_modinfo_attrs(struct module *mod); | ||
578 | void module_remove_modinfo_attrs(struct module *mod); | ||
579 | |||
580 | #else /* !CONFIG_SYSFS */ | ||
581 | |||
582 | static inline int mod_sysfs_init(struct module *mod) | ||
575 | { | 583 | { |
584 | return 0; | ||
576 | } | 585 | } |
577 | 586 | ||
578 | static inline void module_remove_driver(struct device_driver *driver) | 587 | static inline int mod_sysfs_setup(struct module *mod, |
588 | struct kernel_param *kparam, | ||
589 | unsigned int num_params) | ||
579 | { | 590 | { |
591 | return 0; | ||
580 | } | 592 | } |
581 | 593 | ||
582 | #endif /* CONFIG_MODULES */ | 594 | static inline int module_add_modinfo_attrs(struct module *mod) |
595 | { | ||
596 | return 0; | ||
597 | } | ||
598 | |||
599 | static inline void module_remove_modinfo_attrs(struct module *mod) | ||
600 | { } | ||
601 | |||
602 | #endif /* CONFIG_SYSFS */ | ||
603 | |||
604 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
605 | |||
606 | void module_add_driver(struct module *mod, struct device_driver *drv); | ||
607 | void module_remove_driver(struct device_driver *drv); | ||
608 | |||
609 | #else /* not both CONFIG_SYSFS && CONFIG_MODULES */ | ||
610 | |||
611 | static inline void module_add_driver(struct module *mod, struct device_driver *drv) | ||
612 | { } | ||
613 | |||
614 | static inline void module_remove_driver(struct device_driver *drv) | ||
615 | { } | ||
616 | |||
617 | #endif | ||
583 | 618 | ||
584 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) | 619 | #define symbol_request(x) try_then_request_module(symbol_get(x), "symbol:" #x) |
585 | 620 | ||
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index 4a189dadb160..c83588c8d08b 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -59,7 +59,7 @@ struct kparam_array | |||
59 | }; | 59 | }; |
60 | 60 | ||
61 | /* This is the fundamental function for registering boot/module | 61 | /* This is the fundamental function for registering boot/module |
62 | parameters. perm sets the visibility in driverfs: 000 means it's | 62 | parameters. perm sets the visibility in sysfs: 000 means it's |
63 | not there, read bits mean it's readable, write bits mean it's | 63 | not there, read bits mean it's readable, write bits mean it's |
64 | writable. */ | 64 | writable. */ |
65 | #define __module_param_call(prefix, name, set, get, arg, perm) \ | 65 | #define __module_param_call(prefix, name, set, get, arg, perm) \ |
@@ -169,10 +169,22 @@ extern int param_get_string(char *buffer, struct kernel_param *kp); | |||
169 | 169 | ||
170 | struct module; | 170 | struct module; |
171 | 171 | ||
172 | #if defined(CONFIG_SYSFS) && defined(CONFIG_MODULES) | ||
172 | extern int module_param_sysfs_setup(struct module *mod, | 173 | extern int module_param_sysfs_setup(struct module *mod, |
173 | struct kernel_param *kparam, | 174 | struct kernel_param *kparam, |
174 | unsigned int num_params); | 175 | unsigned int num_params); |
175 | 176 | ||
176 | extern void module_param_sysfs_remove(struct module *mod); | 177 | extern void module_param_sysfs_remove(struct module *mod); |
178 | #else | ||
179 | static inline int module_param_sysfs_setup(struct module *mod, | ||
180 | struct kernel_param *kparam, | ||
181 | unsigned int num_params) | ||
182 | { | ||
183 | return 0; | ||
184 | } | ||
185 | |||
186 | static inline void module_param_sysfs_remove(struct module *mod) | ||
187 | { } | ||
188 | #endif | ||
177 | 189 | ||
178 | #endif /* _LINUX_MODULE_PARAMS_H */ | 190 | #endif /* _LINUX_MODULE_PARAMS_H */ |
diff --git a/include/linux/msi.h b/include/linux/msi.h index 74c8a2ecc9dd..e38fe6822cb4 100644 --- a/include/linux/msi.h +++ b/include/linux/msi.h | |||
@@ -17,7 +17,7 @@ struct msi_desc { | |||
17 | struct { | 17 | struct { |
18 | __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ | 18 | __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ |
19 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | 19 | __u8 maskbit : 1; /* mask-pending bit supported ? */ |
20 | __u8 unused : 1; | 20 | __u8 masked : 1; |
21 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | 21 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ |
22 | __u8 pos; /* Location of the msi capability */ | 22 | __u8 pos; /* Location of the msi capability */ |
23 | __u16 entry_nr; /* specific enabled entry */ | 23 | __u16 entry_nr; /* specific enabled entry */ |
@@ -32,10 +32,8 @@ struct msi_desc { | |||
32 | void __iomem *mask_base; | 32 | void __iomem *mask_base; |
33 | struct pci_dev *dev; | 33 | struct pci_dev *dev; |
34 | 34 | ||
35 | #ifdef CONFIG_PM | 35 | /* Last set MSI message */ |
36 | /* PM save area for MSIX address/data */ | 36 | struct msi_msg msg; |
37 | struct msi_msg msg_save; | ||
38 | #endif | ||
39 | }; | 37 | }; |
40 | 38 | ||
41 | /* | 39 | /* |
diff --git a/include/linux/mtd/bbm.h b/include/linux/mtd/bbm.h index 1221b7c44158..fff8c53e5434 100644 --- a/include/linux/mtd/bbm.h +++ b/include/linux/mtd/bbm.h | |||
@@ -92,6 +92,13 @@ struct nand_bbt_descr { | |||
92 | */ | 92 | */ |
93 | #define ONENAND_BADBLOCK_POS 0 | 93 | #define ONENAND_BADBLOCK_POS 0 |
94 | 94 | ||
95 | /* | ||
96 | * Bad block scanning errors | ||
97 | */ | ||
98 | #define ONENAND_BBT_READ_ERROR 1 | ||
99 | #define ONENAND_BBT_READ_ECC_ERROR 2 | ||
100 | #define ONENAND_BBT_READ_FATAL_ERROR 4 | ||
101 | |||
95 | /** | 102 | /** |
96 | * struct bbm_info - [GENERIC] Bad Block Table data structure | 103 | * struct bbm_info - [GENERIC] Bad Block Table data structure |
97 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry | 104 | * @bbt_erase_shift: [INTERN] number of address bits in a bbt entry |
diff --git a/include/linux/mtd/iflash.h b/include/linux/mtd/iflash.h deleted file mode 100644 index 9aa5b4f02666..000000000000 --- a/include/linux/mtd/iflash.h +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* $Id: iflash.h,v 1.2 2000/11/13 18:01:54 dwmw2 Exp $ */ | ||
2 | |||
3 | #ifndef __MTD_IFLASH_H__ | ||
4 | #define __MTD_IFLASH_H__ | ||
5 | |||
6 | /* Extended CIS registers for Series 2 and 2+ cards */ | ||
7 | /* The registers are all offsets from 0x4000 */ | ||
8 | #define CISREG_CSR 0x0100 | ||
9 | #define CISREG_WP 0x0104 | ||
10 | #define CISREG_RDYBSY 0x0140 | ||
11 | |||
12 | /* Extended CIS registers for Series 2 cards */ | ||
13 | #define CISREG_SLEEP 0x0118 | ||
14 | #define CISREG_RDY_MASK 0x0120 | ||
15 | #define CISREG_RDY_STATUS 0x0130 | ||
16 | |||
17 | /* Extended CIS registers for Series 2+ cards */ | ||
18 | #define CISREG_VCR 0x010c | ||
19 | |||
20 | /* Card Status Register */ | ||
21 | #define CSR_SRESET 0x20 /* Soft reset */ | ||
22 | #define CSR_CMWP 0x10 /* Common memory write protect */ | ||
23 | #define CSR_PWRDOWN 0x08 /* Power down status */ | ||
24 | #define CSR_CISWP 0x04 /* Common memory CIS WP */ | ||
25 | #define CSR_WP 0x02 /* Mechanical write protect */ | ||
26 | #define CSR_READY 0x01 /* Ready/busy status */ | ||
27 | |||
28 | /* Write Protection Register */ | ||
29 | #define WP_BLKEN 0x04 /* Enable block locking */ | ||
30 | #define WP_CMWP 0x02 /* Common memory write protect */ | ||
31 | #define WP_CISWP 0x01 /* Common memory CIS WP */ | ||
32 | |||
33 | /* Voltage Control Register */ | ||
34 | #define VCR_VCC_LEVEL 0x80 /* 0 = 5V, 1 = 3.3V */ | ||
35 | #define VCR_VPP_VALID 0x02 /* Vpp Valid */ | ||
36 | #define VCR_VPP_GEN 0x01 /* Integrated Vpp generator */ | ||
37 | |||
38 | /* Ready/Busy Mode Register */ | ||
39 | #define RDYBSY_RACK 0x02 /* Ready acknowledge */ | ||
40 | #define RDYBSY_MODE 0x01 /* 1 = high performance */ | ||
41 | |||
42 | #define LOW(x) ((x) & 0xff) | ||
43 | |||
44 | /* 28F008SA-Compatible Command Set */ | ||
45 | #define IF_READ_ARRAY 0xffff | ||
46 | #define IF_INTEL_ID 0x9090 | ||
47 | #define IF_READ_CSR 0x7070 | ||
48 | #define IF_CLEAR_CSR 0x5050 | ||
49 | #define IF_WRITE 0x4040 | ||
50 | #define IF_BLOCK_ERASE 0x2020 | ||
51 | #define IF_ERASE_SUSPEND 0xb0b0 | ||
52 | #define IF_CONFIRM 0xd0d0 | ||
53 | |||
54 | /* 28F016SA Performance Enhancement Commands */ | ||
55 | #define IF_READ_PAGE 0x7575 | ||
56 | #define IF_PAGE_SWAP 0x7272 | ||
57 | #define IF_SINGLE_LOAD 0x7474 | ||
58 | #define IF_SEQ_LOAD 0xe0e0 | ||
59 | #define IF_PAGE_WRITE 0x0c0c | ||
60 | #define IF_RDY_MODE 0x9696 | ||
61 | #define IF_RDY_LEVEL 0x0101 | ||
62 | #define IF_RDY_PULSE_WRITE 0x0202 | ||
63 | #define IF_RDY_PULSE_ERASE 0x0303 | ||
64 | #define IF_RDY_DISABLE 0x0404 | ||
65 | #define IF_LOCK_BLOCK 0x7777 | ||
66 | #define IF_UPLOAD_STATUS 0x9797 | ||
67 | #define IF_READ_ESR 0x7171 | ||
68 | #define IF_ERASE_UNLOCKED 0xa7a7 | ||
69 | #define IF_SLEEP 0xf0f0 | ||
70 | #define IF_ABORT 0x8080 | ||
71 | #define IF_UPLOAD_DEVINFO 0x9999 | ||
72 | |||
73 | /* Definitions for Compatible Status Register */ | ||
74 | #define CSR_WR_READY 0x8080 /* Write state machine status */ | ||
75 | #define CSR_ERA_SUSPEND 0x4040 /* Erase suspend status */ | ||
76 | #define CSR_ERA_ERR 0x2020 /* Erase status */ | ||
77 | #define CSR_WR_ERR 0x1010 /* Data write status */ | ||
78 | #define CSR_VPP_LOW 0x0808 /* Vpp status */ | ||
79 | |||
80 | /* Definitions for Global Status Register */ | ||
81 | #define GSR_WR_READY 0x8080 /* Write state machine status */ | ||
82 | #define GSR_OP_SUSPEND 0x4040 /* Operation suspend status */ | ||
83 | #define GSR_OP_ERR 0x2020 /* Device operation status */ | ||
84 | #define GSR_SLEEP 0x1010 /* Device sleep status */ | ||
85 | #define GSR_QUEUE_FULL 0x0808 /* Queue status */ | ||
86 | #define GSR_PAGE_AVAIL 0x0404 /* Page buffer available status */ | ||
87 | #define GSR_PAGE_READY 0x0202 /* Page buffer status */ | ||
88 | #define GSR_PAGE_SELECT 0x0101 /* Page buffer select status */ | ||
89 | |||
90 | /* Definitions for Block Status Register */ | ||
91 | #define BSR_READY 0x8080 /* Block status */ | ||
92 | #define BSR_UNLOCK 0x4040 /* Block lock status */ | ||
93 | #define BSR_FAILED 0x2020 /* Block operation status */ | ||
94 | #define BSR_ABORTED 0x1010 /* Operation abort status */ | ||
95 | #define BSR_QUEUE_FULL 0x0808 /* Queue status */ | ||
96 | #define BSR_VPP_LOW 0x0404 /* Vpp status */ | ||
97 | |||
98 | #endif /* __MTD_IFLASH_H__ */ | ||
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index 28d461d862bd..81f3a314dd76 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h | |||
@@ -183,7 +183,7 @@ typedef union { | |||
183 | struct map_info { | 183 | struct map_info { |
184 | char *name; | 184 | char *name; |
185 | unsigned long size; | 185 | unsigned long size; |
186 | unsigned long phys; | 186 | resource_size_t phys; |
187 | #define NO_XIP (-1UL) | 187 | #define NO_XIP (-1UL) |
188 | 188 | ||
189 | void __iomem *virt; | 189 | void __iomem *virt; |
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h index d644e57703ad..45d482ce8397 100644 --- a/include/linux/mtd/mtd.h +++ b/include/linux/mtd/mtd.h | |||
@@ -53,6 +53,7 @@ struct mtd_erase_region_info { | |||
53 | u_int32_t offset; /* At which this region starts, from the beginning of the MTD */ | 53 | u_int32_t offset; /* At which this region starts, from the beginning of the MTD */ |
54 | u_int32_t erasesize; /* For this region */ | 54 | u_int32_t erasesize; /* For this region */ |
55 | u_int32_t numblocks; /* Number of blocks of erasesize in this region */ | 55 | u_int32_t numblocks; /* Number of blocks of erasesize in this region */ |
56 | unsigned long *lockmap; /* If keeping bitmap of locks */ | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | /* | 59 | /* |
@@ -85,6 +86,10 @@ typedef enum { | |||
85 | * mode = MTD_OOB_PLACE) | 86 | * mode = MTD_OOB_PLACE) |
86 | * @datbuf: data buffer - if NULL only oob data are read/written | 87 | * @datbuf: data buffer - if NULL only oob data are read/written |
87 | * @oobbuf: oob data buffer | 88 | * @oobbuf: oob data buffer |
89 | * | ||
90 | * Note, it is allowed to read more then one OOB area at one go, but not write. | ||
91 | * The interface assumes that the OOB write requests program only one page's | ||
92 | * OOB area. | ||
88 | */ | 93 | */ |
89 | struct mtd_oob_ops { | 94 | struct mtd_oob_ops { |
90 | mtd_oob_mode_t mode; | 95 | mtd_oob_mode_t mode; |
@@ -117,18 +122,7 @@ struct mtd_info { | |||
117 | u_int32_t writesize; | 122 | u_int32_t writesize; |
118 | 123 | ||
119 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) | 124 | u_int32_t oobsize; // Amount of OOB data per block (e.g. 16) |
120 | u_int32_t ecctype; | 125 | u_int32_t oobavail; // Available OOB bytes per block |
121 | u_int32_t eccsize; | ||
122 | |||
123 | /* | ||
124 | * Reuse some of the above unused fields in the case of NOR flash | ||
125 | * with configurable programming regions to avoid modifying the | ||
126 | * user visible structure layout/size. Only valid when the | ||
127 | * MTD_PROGRAM_REGIONS flag is set. | ||
128 | * (Maybe we should have an union for those?) | ||
129 | */ | ||
130 | #define MTD_PROGREGION_CTRLMODE_VALID(mtd) (mtd)->oobsize | ||
131 | #define MTD_PROGREGION_CTRLMODE_INVALID(mtd) (mtd)->ecctype | ||
132 | 126 | ||
133 | // Kernel-only stuff starts here. | 127 | // Kernel-only stuff starts here. |
134 | char *name; | 128 | char *name; |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 2071b02f0526..cf197ad62da6 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -343,6 +343,7 @@ struct nand_buffers { | |||
343 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about | 343 | * @options: [BOARDSPECIFIC] various chip options. They can partly be set to inform nand_scan about |
344 | * special functionality. See the defines for further explanation | 344 | * special functionality. See the defines for further explanation |
345 | * @badblockpos: [INTERN] position of the bad block marker in the oob area | 345 | * @badblockpos: [INTERN] position of the bad block marker in the oob area |
346 | * @cellinfo: [INTERN] MLC/multichip data from chip ident | ||
346 | * @numchips: [INTERN] number of physical chips | 347 | * @numchips: [INTERN] number of physical chips |
347 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 348 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
348 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 | 349 | * @pagemask: [INTERN] page number mask = number of (pages / chip) - 1 |
@@ -430,6 +431,7 @@ struct nand_chip { | |||
430 | #define NAND_MFR_RENESAS 0x07 | 431 | #define NAND_MFR_RENESAS 0x07 |
431 | #define NAND_MFR_STMICRO 0x20 | 432 | #define NAND_MFR_STMICRO 0x20 |
432 | #define NAND_MFR_HYNIX 0xad | 433 | #define NAND_MFR_HYNIX 0xad |
434 | #define NAND_MFR_MICRON 0x2c | ||
433 | 435 | ||
434 | /** | 436 | /** |
435 | * struct nand_flash_dev - NAND Flash Device ID Structure | 437 | * struct nand_flash_dev - NAND Flash Device ID Structure |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index f775a7af3890..a56d24ada505 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005-2006 Samsung Electronics | 4 | * Copyright (C) 2005-2007 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -42,14 +42,10 @@ typedef enum { | |||
42 | 42 | ||
43 | /** | 43 | /** |
44 | * struct onenand_bufferram - OneNAND BufferRAM Data | 44 | * struct onenand_bufferram - OneNAND BufferRAM Data |
45 | * @block: block address in BufferRAM | 45 | * @blockpage: block & page address in BufferRAM |
46 | * @page: page address in BufferRAM | ||
47 | * @valid: valid flag | ||
48 | */ | 46 | */ |
49 | struct onenand_bufferram { | 47 | struct onenand_bufferram { |
50 | int block; | 48 | int blockpage; |
51 | int page; | ||
52 | int valid; | ||
53 | }; | 49 | }; |
54 | 50 | ||
55 | /** | 51 | /** |
@@ -63,7 +59,6 @@ struct onenand_bufferram { | |||
63 | * partly be set to inform onenand_scan about | 59 | * partly be set to inform onenand_scan about |
64 | * @erase_shift: [INTERN] number of address bits in a block | 60 | * @erase_shift: [INTERN] number of address bits in a block |
65 | * @page_shift: [INTERN] number of address bits in a page | 61 | * @page_shift: [INTERN] number of address bits in a page |
66 | * @ppb_shift: [INTERN] number of address bits in a pages per block | ||
67 | * @page_mask: [INTERN] a page per block mask | 62 | * @page_mask: [INTERN] a page per block mask |
68 | * @bufferram_index: [INTERN] BufferRAM index | 63 | * @bufferram_index: [INTERN] BufferRAM index |
69 | * @bufferram: [INTERN] BufferRAM info | 64 | * @bufferram: [INTERN] BufferRAM info |
@@ -87,7 +82,8 @@ struct onenand_bufferram { | |||
87 | * @wq: [INTERN] wait queue to sleep on if a OneNAND | 82 | * @wq: [INTERN] wait queue to sleep on if a OneNAND |
88 | * operation is in progress | 83 | * operation is in progress |
89 | * @state: [INTERN] the current state of the OneNAND device | 84 | * @state: [INTERN] the current state of the OneNAND device |
90 | * @page_buf: data buffer | 85 | * @page_buf: [INTERN] page main data buffer |
86 | * @oob_buf: [INTERN] page oob data buffer | ||
91 | * @subpagesize: [INTERN] holds the subpagesize | 87 | * @subpagesize: [INTERN] holds the subpagesize |
92 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme | 88 | * @ecclayout: [REPLACEABLE] the default ecc placement scheme |
93 | * @bbm: [REPLACEABLE] pointer to Bad Block Management | 89 | * @bbm: [REPLACEABLE] pointer to Bad Block Management |
@@ -103,7 +99,6 @@ struct onenand_chip { | |||
103 | 99 | ||
104 | unsigned int erase_shift; | 100 | unsigned int erase_shift; |
105 | unsigned int page_shift; | 101 | unsigned int page_shift; |
106 | unsigned int ppb_shift; /* Pages per block shift */ | ||
107 | unsigned int page_mask; | 102 | unsigned int page_mask; |
108 | 103 | ||
109 | unsigned int bufferram_index; | 104 | unsigned int bufferram_index; |
@@ -128,6 +123,7 @@ struct onenand_chip { | |||
128 | wait_queue_head_t wq; | 123 | wait_queue_head_t wq; |
129 | onenand_state_t state; | 124 | onenand_state_t state; |
130 | unsigned char *page_buf; | 125 | unsigned char *page_buf; |
126 | unsigned char *oob_buf; | ||
131 | 127 | ||
132 | int subpagesize; | 128 | int subpagesize; |
133 | struct nand_ecclayout *ecclayout; | 129 | struct nand_ecclayout *ecclayout; |
@@ -150,6 +146,9 @@ struct onenand_chip { | |||
150 | #define ONENAND_SET_SYS_CFG1(v, this) \ | 146 | #define ONENAND_SET_SYS_CFG1(v, this) \ |
151 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) | 147 | (this->write_word(v, this->base + ONENAND_REG_SYS_CFG1)) |
152 | 148 | ||
149 | #define ONENAND_IS_DDP(this) \ | ||
150 | (this->device_id & ONENAND_DEVICE_IS_DDP) | ||
151 | |||
153 | /* Check byte access in OneNAND */ | 152 | /* Check byte access in OneNAND */ |
154 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) | 153 | #define ONENAND_CHECK_BYTE_ACCESS(addr) (addr & 0x1) |
155 | 154 | ||
@@ -159,6 +158,7 @@ struct onenand_chip { | |||
159 | #define ONENAND_HAS_CONT_LOCK (0x0001) | 158 | #define ONENAND_HAS_CONT_LOCK (0x0001) |
160 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 159 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
161 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 160 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
161 | #define ONENAND_OOBBUF_ALLOC (0x2000) | ||
162 | 162 | ||
163 | /* | 163 | /* |
164 | * OneNAND Flash Manufacturer ID Codes | 164 | * OneNAND Flash Manufacturer ID Codes |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index e31c8f5d4271..af94719890e7 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -3,7 +3,8 @@ | |||
3 | * | 3 | * |
4 | * OneNAND Register header file | 4 | * OneNAND Register header file |
5 | * | 5 | * |
6 | * Copyright (C) 2005-2006 Samsung Electronics | 6 | * Copyright (C) 2005-2007 Samsung Electronics |
7 | * Kyungmin Park <kyungmin.park@samsung.com> | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * 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 | * it under the terms of the GNU General Public License version 2 as |
@@ -80,9 +81,11 @@ | |||
80 | #define ONENAND_VERSION_PROCESS_SHIFT (8) | 81 | #define ONENAND_VERSION_PROCESS_SHIFT (8) |
81 | 82 | ||
82 | /* | 83 | /* |
83 | * Start Address 1 F100h (R/W) | 84 | * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) |
84 | */ | 85 | */ |
85 | #define ONENAND_DDP_SHIFT (15) | 86 | #define ONENAND_DDP_SHIFT (15) |
87 | #define ONENAND_DDP_CHIP0 (0) | ||
88 | #define ONENAND_DDP_CHIP1 (1 << ONENAND_DDP_SHIFT) | ||
86 | 89 | ||
87 | /* | 90 | /* |
88 | * Start Address 8 F107h (R/W) | 91 | * Start Address 8 F107h (R/W) |
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h index 86831e3594f6..0dc07d5f3354 100644 --- a/include/linux/mtd/physmap.h +++ b/include/linux/mtd/physmap.h | |||
@@ -18,9 +18,10 @@ | |||
18 | #define __LINUX_MTD_PHYSMAP__ | 18 | #define __LINUX_MTD_PHYSMAP__ |
19 | 19 | ||
20 | #include <linux/mtd/mtd.h> | 20 | #include <linux/mtd/mtd.h> |
21 | #include <linux/mtd/map.h> | ||
22 | #include <linux/mtd/partitions.h> | 21 | #include <linux/mtd/partitions.h> |
23 | 22 | ||
23 | struct map_info; | ||
24 | |||
24 | struct physmap_flash_data { | 25 | struct physmap_flash_data { |
25 | unsigned int width; | 26 | unsigned int width; |
26 | void (*set_vpp)(struct map_info *, int); | 27 | void (*set_vpp)(struct map_info *, int); |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h new file mode 100644 index 000000000000..3d967b6b120a --- /dev/null +++ b/include/linux/mtd/ubi.h | |||
@@ -0,0 +1,202 @@ | |||
1 | /* | ||
2 | * Copyright (c) International Business Machines Corp., 2006 | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See | ||
12 | * the GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
17 | * | ||
18 | * Author: Artem Bityutskiy (Битюцкий Артём) | ||
19 | */ | ||
20 | |||
21 | #ifndef __LINUX_UBI_H__ | ||
22 | #define __LINUX_UBI_H__ | ||
23 | |||
24 | #include <asm/ioctl.h> | ||
25 | #include <linux/types.h> | ||
26 | #include <mtd/ubi-user.h> | ||
27 | |||
28 | /* | ||
29 | * UBI data type hint constants. | ||
30 | * | ||
31 | * UBI_LONGTERM: long-term data | ||
32 | * UBI_SHORTTERM: short-term data | ||
33 | * UBI_UNKNOWN: data persistence is unknown | ||
34 | * | ||
35 | * These constants are used when data is written to UBI volumes in order to | ||
36 | * help the UBI wear-leveling unit to find more appropriate physical | ||
37 | * eraseblocks. | ||
38 | */ | ||
39 | enum { | ||
40 | UBI_LONGTERM = 1, | ||
41 | UBI_SHORTTERM, | ||
42 | UBI_UNKNOWN | ||
43 | }; | ||
44 | |||
45 | /* | ||
46 | * enum ubi_open_mode - UBI volume open mode constants. | ||
47 | * | ||
48 | * UBI_READONLY: read-only mode | ||
49 | * UBI_READWRITE: read-write mode | ||
50 | * UBI_EXCLUSIVE: exclusive mode | ||
51 | */ | ||
52 | enum { | ||
53 | UBI_READONLY = 1, | ||
54 | UBI_READWRITE, | ||
55 | UBI_EXCLUSIVE | ||
56 | }; | ||
57 | |||
58 | /** | ||
59 | * struct ubi_volume_info - UBI volume description data structure. | ||
60 | * @vol_id: volume ID | ||
61 | * @ubi_num: UBI device number this volume belongs to | ||
62 | * @size: how many physical eraseblocks are reserved for this volume | ||
63 | * @used_bytes: how many bytes of data this volume contains | ||
64 | * @used_ebs: how many physical eraseblocks of this volume actually contain any | ||
65 | * data | ||
66 | * @vol_type: volume type (%UBI_DYNAMIC_VOLUME or %UBI_STATIC_VOLUME) | ||
67 | * @corrupted: non-zero if the volume is corrupted (static volumes only) | ||
68 | * @upd_marker: non-zero if the volume has update marker set | ||
69 | * @alignment: volume alignment | ||
70 | * @usable_leb_size: how many bytes are available in logical eraseblocks of | ||
71 | * this volume | ||
72 | * @name_len: volume name length | ||
73 | * @name: volume name | ||
74 | * @cdev: UBI volume character device major and minor numbers | ||
75 | * | ||
76 | * The @corrupted flag is only relevant to static volumes and is always zero | ||
77 | * for dynamic ones. This is because UBI does not care about dynamic volume | ||
78 | * data protection and only cares about protecting static volume data. | ||
79 | * | ||
80 | * The @upd_marker flag is set if the volume update operation was interrupted. | ||
81 | * Before touching the volume data during the update operation, UBI first sets | ||
82 | * the update marker flag for this volume. If the volume update operation was | ||
83 | * further interrupted, the update marker indicates this. If the update marker | ||
84 | * is set, the contents of the volume is certainly damaged and a new volume | ||
85 | * update operation has to be started. | ||
86 | * | ||
87 | * To put it differently, @corrupted and @upd_marker fields have different | ||
88 | * semantics: | ||
89 | * o the @corrupted flag means that this static volume is corrupted for some | ||
90 | * reasons, but not because an interrupted volume update | ||
91 | * o the @upd_marker field means that the volume is damaged because of an | ||
92 | * interrupted update operation. | ||
93 | * | ||
94 | * I.e., the @corrupted flag is never set if the @upd_marker flag is set. | ||
95 | * | ||
96 | * The @used_bytes and @used_ebs fields are only really needed for static | ||
97 | * volumes and contain the number of bytes stored in this static volume and how | ||
98 | * many eraseblock this data occupies. In case of dynamic volumes, the | ||
99 | * @used_bytes field is equivalent to @size*@usable_leb_size, and the @used_ebs | ||
100 | * field is equivalent to @size. | ||
101 | * | ||
102 | * In general, logical eraseblock size is a property of the UBI device, not | ||
103 | * of the UBI volume. Indeed, the logical eraseblock size depends on the | ||
104 | * physical eraseblock size and on how much bytes UBI headers consume. But | ||
105 | * because of the volume alignment (@alignment), the usable size of logical | ||
106 | * eraseblocks if a volume may be less. The following equation is true: | ||
107 | * @usable_leb_size = LEB size - (LEB size mod @alignment), | ||
108 | * where LEB size is the logical eraseblock size defined by the UBI device. | ||
109 | * | ||
110 | * The alignment is multiple to the minimal flash input/output unit size or %1 | ||
111 | * if all the available space is used. | ||
112 | * | ||
113 | * To put this differently, alignment may be considered is a way to change | ||
114 | * volume logical eraseblock sizes. | ||
115 | */ | ||
116 | struct ubi_volume_info { | ||
117 | int ubi_num; | ||
118 | int vol_id; | ||
119 | int size; | ||
120 | long long used_bytes; | ||
121 | int used_ebs; | ||
122 | int vol_type; | ||
123 | int corrupted; | ||
124 | int upd_marker; | ||
125 | int alignment; | ||
126 | int usable_leb_size; | ||
127 | int name_len; | ||
128 | const char *name; | ||
129 | dev_t cdev; | ||
130 | }; | ||
131 | |||
132 | /** | ||
133 | * struct ubi_device_info - UBI device description data structure. | ||
134 | * @ubi_num: ubi device number | ||
135 | * @leb_size: logical eraseblock size on this UBI device | ||
136 | * @min_io_size: minimal I/O unit size | ||
137 | * @ro_mode: if this device is in read-only mode | ||
138 | * @cdev: UBI character device major and minor numbers | ||
139 | * | ||
140 | * Note, @leb_size is the logical eraseblock size offered by the UBI device. | ||
141 | * Volumes of this UBI device may have smaller logical eraseblock size if their | ||
142 | * alignment is not equivalent to %1. | ||
143 | */ | ||
144 | struct ubi_device_info { | ||
145 | int ubi_num; | ||
146 | int leb_size; | ||
147 | int min_io_size; | ||
148 | int ro_mode; | ||
149 | dev_t cdev; | ||
150 | }; | ||
151 | |||
152 | /* UBI descriptor given to users when they open UBI volumes */ | ||
153 | struct ubi_volume_desc; | ||
154 | |||
155 | int ubi_get_device_info(int ubi_num, struct ubi_device_info *di); | ||
156 | void ubi_get_volume_info(struct ubi_volume_desc *desc, | ||
157 | struct ubi_volume_info *vi); | ||
158 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | ||
159 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | ||
160 | int mode); | ||
161 | void ubi_close_volume(struct ubi_volume_desc *desc); | ||
162 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | ||
163 | int len, int check); | ||
164 | int ubi_leb_write(struct ubi_volume_desc *desc, int lnum, const void *buf, | ||
165 | int offset, int len, int dtype); | ||
166 | int ubi_leb_change(struct ubi_volume_desc *desc, int lnum, const void *buf, | ||
167 | int len, int dtype); | ||
168 | int ubi_leb_erase(struct ubi_volume_desc *desc, int lnum); | ||
169 | int ubi_leb_unmap(struct ubi_volume_desc *desc, int lnum); | ||
170 | int ubi_is_mapped(struct ubi_volume_desc *desc, int lnum); | ||
171 | |||
172 | /* | ||
173 | * This function is the same as the 'ubi_leb_read()' function, but it does not | ||
174 | * provide the checking capability. | ||
175 | */ | ||
176 | static inline int ubi_read(struct ubi_volume_desc *desc, int lnum, char *buf, | ||
177 | int offset, int len) | ||
178 | { | ||
179 | return ubi_leb_read(desc, lnum, buf, offset, len, 0); | ||
180 | } | ||
181 | |||
182 | /* | ||
183 | * This function is the same as the 'ubi_leb_write()' functions, but it does | ||
184 | * not have the data type argument. | ||
185 | */ | ||
186 | static inline int ubi_write(struct ubi_volume_desc *desc, int lnum, | ||
187 | const void *buf, int offset, int len) | ||
188 | { | ||
189 | return ubi_leb_write(desc, lnum, buf, offset, len, UBI_UNKNOWN); | ||
190 | } | ||
191 | |||
192 | /* | ||
193 | * This function is the same as the 'ubi_leb_change()' functions, but it does | ||
194 | * not have the data type argument. | ||
195 | */ | ||
196 | static inline int ubi_change(struct ubi_volume_desc *desc, int lnum, | ||
197 | const void *buf, int len) | ||
198 | { | ||
199 | return ubi_leb_change(desc, lnum, buf, len, UBI_UNKNOWN); | ||
200 | } | ||
201 | |||
202 | #endif /* !__LINUX_UBI_H__ */ | ||
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index aff25c000abf..c6d4ab86b83c 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -1288,7 +1288,7 @@ struct mv64xxx_i2c_pdata { | |||
1288 | #define MV643XX_ETH_NAME "mv643xx_eth" | 1288 | #define MV643XX_ETH_NAME "mv643xx_eth" |
1289 | 1289 | ||
1290 | struct mv643xx_eth_platform_data { | 1290 | struct mv643xx_eth_platform_data { |
1291 | char *mac_addr; /* pointer to mac address */ | 1291 | int port_number; |
1292 | u16 force_phy_addr; /* force override if phy_addr == 0 */ | 1292 | u16 force_phy_addr; /* force override if phy_addr == 0 */ |
1293 | u16 phy_addr; | 1293 | u16 phy_addr; |
1294 | 1294 | ||
@@ -1303,6 +1303,7 @@ struct mv643xx_eth_platform_data { | |||
1303 | u32 tx_sram_size; | 1303 | u32 tx_sram_size; |
1304 | u32 rx_sram_addr; | 1304 | u32 rx_sram_addr; |
1305 | u32 rx_sram_size; | 1305 | u32 rx_sram_size; |
1306 | u8 mac_addr[6]; /* mac address if non-zero*/ | ||
1306 | }; | 1307 | }; |
1307 | 1308 | ||
1308 | #endif /* __ASM_MV643XX_H */ | 1309 | #endif /* __ASM_MV643XX_H */ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index d39a5a67e979..b7dd24917f0d 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -82,6 +82,7 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |||
82 | extern void release_open_intent(struct nameidata *); | 82 | extern void release_open_intent(struct nameidata *); |
83 | 83 | ||
84 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); | 84 | extern struct dentry * lookup_one_len(const char *, struct dentry *, int); |
85 | extern struct dentry *lookup_one_len_kern(const char *, struct dentry *, int); | ||
85 | 86 | ||
86 | extern int follow_down(struct vfsmount **, struct dentry **); | 87 | extern int follow_down(struct vfsmount **, struct dentry **); |
87 | extern int follow_up(struct vfsmount **, struct dentry **); | 88 | extern int follow_up(struct vfsmount **, struct dentry **); |
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index a503052138bd..6330fc76b00f 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h | |||
@@ -50,6 +50,8 @@ struct ncp_server { | |||
50 | int packet_size; | 50 | int packet_size; |
51 | unsigned char *packet; /* Here we prepare requests and | 51 | unsigned char *packet; /* Here we prepare requests and |
52 | receive replies */ | 52 | receive replies */ |
53 | unsigned char *txbuf; /* Storage for current request */ | ||
54 | unsigned char *rxbuf; /* Storage for reply to current request */ | ||
53 | 55 | ||
54 | int lock; /* To prevent mismatch in protocols. */ | 56 | int lock; /* To prevent mismatch in protocols. */ |
55 | struct mutex mutex; | 57 | struct mutex mutex; |
diff --git a/include/linux/net.h b/include/linux/net.h index 4db21e63d8d2..efc45177b503 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -24,7 +24,7 @@ | |||
24 | struct poll_table_struct; | 24 | struct poll_table_struct; |
25 | struct inode; | 25 | struct inode; |
26 | 26 | ||
27 | #define NPROTO 33 /* should be enough for now.. */ | 27 | #define NPROTO 34 /* should be enough for now.. */ |
28 | 28 | ||
29 | #define SYS_SOCKET 1 /* sys_socket(2) */ | 29 | #define SYS_SOCKET 1 /* sys_socket(2) */ |
30 | #define SYS_BIND 2 /* sys_bind(2) */ | 30 | #define SYS_BIND 2 /* sys_bind(2) */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 1a528548cd1d..ac0c92b1e002 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -42,6 +42,8 @@ | |||
42 | struct vlan_group; | 42 | struct vlan_group; |
43 | struct ethtool_ops; | 43 | struct ethtool_ops; |
44 | struct netpoll_info; | 44 | struct netpoll_info; |
45 | /* 802.11 specific */ | ||
46 | struct wireless_dev; | ||
45 | /* source back-compat hooks */ | 47 | /* source back-compat hooks */ |
46 | #define SET_ETHTOOL_OPS(netdev,ops) \ | 48 | #define SET_ETHTOOL_OPS(netdev,ops) \ |
47 | ( (netdev)->ethtool_ops = (ops) ) | 49 | ( (netdev)->ethtool_ops = (ops) ) |
@@ -347,13 +349,15 @@ struct net_device | |||
347 | 349 | ||
348 | 350 | ||
349 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 351 | struct net_device_stats* (*get_stats)(struct net_device *dev); |
352 | struct net_device_stats stats; | ||
350 | 353 | ||
354 | #ifdef CONFIG_WIRELESS_EXT | ||
351 | /* List of functions to handle Wireless Extensions (instead of ioctl). | 355 | /* List of functions to handle Wireless Extensions (instead of ioctl). |
352 | * See <net/iw_handler.h> for details. Jean II */ | 356 | * See <net/iw_handler.h> for details. Jean II */ |
353 | const struct iw_handler_def * wireless_handlers; | 357 | const struct iw_handler_def * wireless_handlers; |
354 | /* Instance data managed by the core of Wireless Extensions. */ | 358 | /* Instance data managed by the core of Wireless Extensions. */ |
355 | struct iw_public_data * wireless_data; | 359 | struct iw_public_data * wireless_data; |
356 | 360 | #endif | |
357 | const struct ethtool_ops *ethtool_ops; | 361 | const struct ethtool_ops *ethtool_ops; |
358 | 362 | ||
359 | /* | 363 | /* |
@@ -398,6 +402,8 @@ struct net_device | |||
398 | void *ip6_ptr; /* IPv6 specific data */ | 402 | void *ip6_ptr; /* IPv6 specific data */ |
399 | void *ec_ptr; /* Econet specific data */ | 403 | void *ec_ptr; /* Econet specific data */ |
400 | void *ax25_ptr; /* AX.25 specific data */ | 404 | void *ax25_ptr; /* AX.25 specific data */ |
405 | struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, | ||
406 | assign before registering */ | ||
401 | 407 | ||
402 | /* | 408 | /* |
403 | * Cache line mostly used on receive path (including eth_type_trans()) | 409 | * Cache line mostly used on receive path (including eth_type_trans()) |
@@ -647,8 +653,10 @@ static inline void netif_start_queue(struct net_device *dev) | |||
647 | static inline void netif_wake_queue(struct net_device *dev) | 653 | static inline void netif_wake_queue(struct net_device *dev) |
648 | { | 654 | { |
649 | #ifdef CONFIG_NETPOLL_TRAP | 655 | #ifdef CONFIG_NETPOLL_TRAP |
650 | if (netpoll_trap()) | 656 | if (netpoll_trap()) { |
657 | clear_bit(__LINK_STATE_XOFF, &dev->state); | ||
651 | return; | 658 | return; |
659 | } | ||
652 | #endif | 660 | #endif |
653 | if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) | 661 | if (test_and_clear_bit(__LINK_STATE_XOFF, &dev->state)) |
654 | __netif_schedule(dev); | 662 | __netif_schedule(dev); |
@@ -656,10 +664,6 @@ static inline void netif_wake_queue(struct net_device *dev) | |||
656 | 664 | ||
657 | static inline void netif_stop_queue(struct net_device *dev) | 665 | static inline void netif_stop_queue(struct net_device *dev) |
658 | { | 666 | { |
659 | #ifdef CONFIG_NETPOLL_TRAP | ||
660 | if (netpoll_trap()) | ||
661 | return; | ||
662 | #endif | ||
663 | set_bit(__LINK_STATE_XOFF, &dev->state); | 667 | set_bit(__LINK_STATE_XOFF, &dev->state); |
664 | } | 668 | } |
665 | 669 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 70d3b4f1e48d..10b5c6275706 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -281,9 +281,6 @@ extern void nf_reinject(struct sk_buff *skb, | |||
281 | struct nf_info *info, | 281 | struct nf_info *info, |
282 | unsigned int verdict); | 282 | unsigned int verdict); |
283 | 283 | ||
284 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); | ||
285 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); | ||
286 | |||
287 | /* FIXME: Before cache is ever used, this must be implemented for real. */ | 284 | /* FIXME: Before cache is ever used, this must be implemented for real. */ |
288 | extern void nf_invalidate_cache(int pf); | 285 | extern void nf_invalidate_cache(int pf); |
289 | 286 | ||
@@ -388,11 +385,18 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff **pskb, | |||
388 | { | 385 | { |
389 | return 1; | 386 | return 1; |
390 | } | 387 | } |
391 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | ||
392 | struct flowi; | 388 | struct flowi; |
393 | static inline void | 389 | static inline void |
394 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} | 390 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} |
395 | #endif /*CONFIG_NETFILTER*/ | 391 | #endif /*CONFIG_NETFILTER*/ |
396 | 392 | ||
393 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
394 | extern void (*ip_ct_attach)(struct sk_buff *, struct sk_buff *); | ||
395 | extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); | ||
396 | extern void (*nf_ct_destroy)(struct nf_conntrack *); | ||
397 | #else | ||
398 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | ||
399 | #endif | ||
400 | |||
397 | #endif /*__KERNEL__*/ | 401 | #endif /*__KERNEL__*/ |
398 | #endif /*__LINUX_NETFILTER_H*/ | 402 | #endif /*__LINUX_NETFILTER_H*/ |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index 007af4c2770b..22ce29995f13 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
@@ -30,6 +30,11 @@ enum tcp_conntrack { | |||
30 | /* Be liberal in window checking */ | 30 | /* Be liberal in window checking */ |
31 | #define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 | 31 | #define IP_CT_TCP_FLAG_BE_LIBERAL 0x08 |
32 | 32 | ||
33 | struct nf_ct_tcp_flags { | ||
34 | u_int8_t flags; | ||
35 | u_int8_t mask; | ||
36 | }; | ||
37 | |||
33 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
34 | 39 | ||
35 | struct ip_ct_tcp_state { | 40 | struct ip_ct_tcp_state { |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 1e9c821f152d..0f9311df1559 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -62,11 +62,11 @@ struct nfattr | |||
62 | #define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0))) | 62 | #define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0))) |
63 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) | 63 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) |
64 | #define NFA_NEST(skb, type) \ | 64 | #define NFA_NEST(skb, type) \ |
65 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ | 65 | ({ struct nfattr *__start = (struct nfattr *)skb_tail_pointer(skb); \ |
66 | NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ | 66 | NFA_PUT(skb, (NFNL_NFA_NEST | type), 0, NULL); \ |
67 | __start; }) | 67 | __start; }) |
68 | #define NFA_NEST_END(skb, start) \ | 68 | #define NFA_NEST_END(skb, start) \ |
69 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ | 69 | ({ (start)->nfa_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ |
70 | (skb)->len; }) | 70 | (skb)->len; }) |
71 | #define NFA_NEST_CANCEL(skb, start) \ | 71 | #define NFA_NEST_CANCEL(skb, start) \ |
72 | ({ if (start) \ | 72 | ({ if (start) \ |
@@ -111,7 +111,7 @@ struct nfgenmsg { | |||
111 | struct nfnl_callback | 111 | struct nfnl_callback |
112 | { | 112 | { |
113 | int (*call)(struct sock *nl, struct sk_buff *skb, | 113 | int (*call)(struct sock *nl, struct sk_buff *skb, |
114 | struct nlmsghdr *nlh, struct nfattr *cda[], int *errp); | 114 | struct nlmsghdr *nlh, struct nfattr *cda[]); |
115 | u_int16_t attr_count; /* number of nfattr's */ | 115 | u_int16_t attr_count; /* number of nfattr's */ |
116 | }; | 116 | }; |
117 | 117 | ||
@@ -129,19 +129,6 @@ extern void __nfa_fill(struct sk_buff *skb, int attrtype, | |||
129 | ({ if (skb_tailroom(skb) < (int)NFA_SPACE(attrlen)) goto nfattr_failure; \ | 129 | ({ if (skb_tailroom(skb) < (int)NFA_SPACE(attrlen)) goto nfattr_failure; \ |
130 | __nfa_fill(skb, attrtype, attrlen, data); }) | 130 | __nfa_fill(skb, attrtype, attrlen, data); }) |
131 | 131 | ||
132 | extern struct semaphore nfnl_sem; | ||
133 | |||
134 | #define nfnl_shlock() down(&nfnl_sem) | ||
135 | #define nfnl_shlock_nowait() down_trylock(&nfnl_sem) | ||
136 | |||
137 | #define nfnl_shunlock() do { up(&nfnl_sem); \ | ||
138 | if(nfnl && nfnl->sk_receive_queue.qlen) \ | ||
139 | nfnl->sk_data_ready(nfnl, 0); \ | ||
140 | } while(0) | ||
141 | |||
142 | extern void nfnl_lock(void); | ||
143 | extern void nfnl_unlock(void); | ||
144 | |||
145 | extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n); | 132 | extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n); |
146 | extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n); | 133 | extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n); |
147 | 134 | ||
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index b5883ccee295..d7c35039721e 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -83,6 +83,10 @@ enum ctattr_protoinfo { | |||
83 | enum ctattr_protoinfo_tcp { | 83 | enum ctattr_protoinfo_tcp { |
84 | CTA_PROTOINFO_TCP_UNSPEC, | 84 | CTA_PROTOINFO_TCP_UNSPEC, |
85 | CTA_PROTOINFO_TCP_STATE, | 85 | CTA_PROTOINFO_TCP_STATE, |
86 | CTA_PROTOINFO_TCP_WSCALE_ORIGINAL, | ||
87 | CTA_PROTOINFO_TCP_WSCALE_REPLY, | ||
88 | CTA_PROTOINFO_TCP_FLAGS_ORIGINAL, | ||
89 | CTA_PROTOINFO_TCP_FLAGS_REPLY, | ||
86 | __CTA_PROTOINFO_TCP_MAX | 90 | __CTA_PROTOINFO_TCP_MAX |
87 | }; | 91 | }; |
88 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) | 92 | #define CTA_PROTOINFO_TCP_MAX (__CTA_PROTOINFO_TCP_MAX - 1) |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index 55689f39f77a..19060030bac9 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -7,6 +7,7 @@ | |||
7 | #include <linux/netfilter.h> | 7 | #include <linux/netfilter.h> |
8 | #include <linux/if_ether.h> | 8 | #include <linux/if_ether.h> |
9 | #include <linux/if_vlan.h> | 9 | #include <linux/if_vlan.h> |
10 | #include <linux/if_pppox.h> | ||
10 | 11 | ||
11 | /* Bridge Hooks */ | 12 | /* Bridge Hooks */ |
12 | /* After promisc drops, checksum checks. */ | 13 | /* After promisc drops, checksum checks. */ |
@@ -58,8 +59,14 @@ static inline int nf_bridge_maybe_copy_header(struct sk_buff *skb) | |||
58 | * enough room for the encapsulating header (if there is one). */ | 59 | * enough room for the encapsulating header (if there is one). */ |
59 | static inline int nf_bridge_pad(const struct sk_buff *skb) | 60 | static inline int nf_bridge_pad(const struct sk_buff *skb) |
60 | { | 61 | { |
61 | return (skb->nf_bridge && skb->protocol == htons(ETH_P_8021Q)) | 62 | int padding = 0; |
62 | ? VLAN_HLEN : 0; | 63 | |
64 | if (skb->nf_bridge && skb->protocol == htons(ETH_P_8021Q)) | ||
65 | padding = VLAN_HLEN; | ||
66 | else if (skb->nf_bridge && skb->protocol == htons(ETH_P_PPP_SES)) | ||
67 | padding = PPPOE_SES_HLEN; | ||
68 | |||
69 | return padding; | ||
63 | } | 70 | } |
64 | 71 | ||
65 | struct bridge_skb_cb { | 72 | struct bridge_skb_cb { |
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h index 07f044ff1a6b..a11b0c2017fd 100644 --- a/include/linux/netfilter_bridge/ebt_802_3.h +++ b/include/linux/netfilter_bridge/ebt_802_3.h | |||
@@ -54,7 +54,7 @@ struct ebt_802_3_hdr { | |||
54 | 54 | ||
55 | static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) | 55 | static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) |
56 | { | 56 | { |
57 | return (struct ebt_802_3_hdr *)skb->mac.raw; | 57 | return (struct ebt_802_3_hdr *)skb_mac_header(skb); |
58 | } | 58 | } |
59 | #endif | 59 | #endif |
60 | 60 | ||
diff --git a/include/linux/netfilter_bridge/ebt_arp.h b/include/linux/netfilter_bridge/ebt_arp.h index 97e4dbde1f89..cbf4843b6b0f 100644 --- a/include/linux/netfilter_bridge/ebt_arp.h +++ b/include/linux/netfilter_bridge/ebt_arp.h | |||
@@ -8,8 +8,10 @@ | |||
8 | #define EBT_ARP_DST_IP 0x10 | 8 | #define EBT_ARP_DST_IP 0x10 |
9 | #define EBT_ARP_SRC_MAC 0x20 | 9 | #define EBT_ARP_SRC_MAC 0x20 |
10 | #define EBT_ARP_DST_MAC 0x40 | 10 | #define EBT_ARP_DST_MAC 0x40 |
11 | #define EBT_ARP_GRAT 0x80 | ||
11 | #define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \ | 12 | #define EBT_ARP_MASK (EBT_ARP_OPCODE | EBT_ARP_HTYPE | EBT_ARP_PTYPE | \ |
12 | EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC) | 13 | EBT_ARP_SRC_IP | EBT_ARP_DST_IP | EBT_ARP_SRC_MAC | EBT_ARP_DST_MAC | \ |
14 | EBT_ARP_GRAT) | ||
13 | #define EBT_ARP_MATCH "arp" | 15 | #define EBT_ARP_MATCH "arp" |
14 | 16 | ||
15 | struct ebt_arp_info | 17 | struct ebt_arp_info |
diff --git a/include/linux/netfilter_ipv4/Kbuild b/include/linux/netfilter_ipv4/Kbuild index 180337801a86..7185792b900f 100644 --- a/include/linux/netfilter_ipv4/Kbuild +++ b/include/linux/netfilter_ipv4/Kbuild | |||
@@ -1,9 +1,3 @@ | |||
1 | header-y += ip_conntrack_helper.h | ||
2 | header-y += ip_conntrack_protocol.h | ||
3 | header-y += ip_conntrack_sctp.h | ||
4 | header-y += ip_conntrack_tcp.h | ||
5 | header-y += ip_conntrack_tftp.h | ||
6 | header-y += ip_nat_pptp.h | ||
7 | header-y += ipt_addrtype.h | 1 | header-y += ipt_addrtype.h |
8 | header-y += ipt_ah.h | 2 | header-y += ipt_ah.h |
9 | header-y += ipt_CLASSIFY.h | 3 | header-y += ipt_CLASSIFY.h |
@@ -49,13 +43,5 @@ header-y += ipt_ttl.h | |||
49 | header-y += ipt_TTL.h | 43 | header-y += ipt_TTL.h |
50 | header-y += ipt_ULOG.h | 44 | header-y += ipt_ULOG.h |
51 | 45 | ||
52 | unifdef-y += ip_conntrack.h | ||
53 | unifdef-y += ip_conntrack_h323.h | ||
54 | unifdef-y += ip_conntrack_irc.h | ||
55 | unifdef-y += ip_conntrack_pptp.h | ||
56 | unifdef-y += ip_conntrack_proto_gre.h | ||
57 | unifdef-y += ip_conntrack_tuple.h | ||
58 | unifdef-y += ip_nat.h | ||
59 | unifdef-y += ip_nat_rule.h | ||
60 | unifdef-y += ip_queue.h | 46 | unifdef-y += ip_queue.h |
61 | unifdef-y += ip_tables.h | 47 | unifdef-y += ip_tables.h |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h deleted file mode 100644 index da9274e6bf12..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ /dev/null | |||
@@ -1,402 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_H | ||
2 | #define _IP_CONNTRACK_H | ||
3 | |||
4 | #include <linux/netfilter/nf_conntrack_common.h> | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | #include <linux/netfilter_ipv4/ip_conntrack_tuple.h> | ||
8 | #include <linux/bitops.h> | ||
9 | #include <linux/compiler.h> | ||
10 | #include <asm/atomic.h> | ||
11 | |||
12 | #include <linux/timer.h> | ||
13 | #include <linux/netfilter_ipv4/ip_conntrack_tcp.h> | ||
14 | #include <linux/netfilter_ipv4/ip_conntrack_icmp.h> | ||
15 | #include <linux/netfilter_ipv4/ip_conntrack_proto_gre.h> | ||
16 | #include <linux/netfilter_ipv4/ip_conntrack_sctp.h> | ||
17 | |||
18 | /* per conntrack: protocol private data */ | ||
19 | union ip_conntrack_proto { | ||
20 | /* insert conntrack proto private data here */ | ||
21 | struct ip_ct_gre gre; | ||
22 | struct ip_ct_sctp sctp; | ||
23 | struct ip_ct_tcp tcp; | ||
24 | struct ip_ct_icmp icmp; | ||
25 | }; | ||
26 | |||
27 | union ip_conntrack_expect_proto { | ||
28 | /* insert expect proto private data here */ | ||
29 | }; | ||
30 | |||
31 | /* Add protocol helper include file here */ | ||
32 | #include <linux/netfilter_ipv4/ip_conntrack_h323.h> | ||
33 | #include <linux/netfilter_ipv4/ip_conntrack_pptp.h> | ||
34 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> | ||
35 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> | ||
36 | #include <linux/netfilter_ipv4/ip_conntrack_irc.h> | ||
37 | |||
38 | /* per conntrack: application helper private data */ | ||
39 | union ip_conntrack_help { | ||
40 | /* insert conntrack helper private data (master) here */ | ||
41 | struct ip_ct_h323_master ct_h323_info; | ||
42 | struct ip_ct_pptp_master ct_pptp_info; | ||
43 | struct ip_ct_ftp_master ct_ftp_info; | ||
44 | struct ip_ct_irc_master ct_irc_info; | ||
45 | }; | ||
46 | |||
47 | #ifdef CONFIG_IP_NF_NAT_NEEDED | ||
48 | #include <linux/netfilter_ipv4/ip_nat.h> | ||
49 | #include <linux/netfilter_ipv4/ip_nat_pptp.h> | ||
50 | |||
51 | /* per conntrack: nat application helper private data */ | ||
52 | union ip_conntrack_nat_help { | ||
53 | /* insert nat helper private data here */ | ||
54 | struct ip_nat_pptp nat_pptp_info; | ||
55 | }; | ||
56 | #endif | ||
57 | |||
58 | #include <linux/types.h> | ||
59 | #include <linux/skbuff.h> | ||
60 | |||
61 | #ifdef CONFIG_NETFILTER_DEBUG | ||
62 | #define IP_NF_ASSERT(x) \ | ||
63 | do { \ | ||
64 | if (!(x)) \ | ||
65 | /* Wooah! I'm tripping my conntrack in a frenzy of \ | ||
66 | netplay... */ \ | ||
67 | printk("NF_IP_ASSERT: %s:%i(%s)\n", \ | ||
68 | __FILE__, __LINE__, __FUNCTION__); \ | ||
69 | } while(0) | ||
70 | #else | ||
71 | #define IP_NF_ASSERT(x) | ||
72 | #endif | ||
73 | |||
74 | struct ip_conntrack_helper; | ||
75 | |||
76 | struct ip_conntrack | ||
77 | { | ||
78 | /* Usage count in here is 1 for hash table/destruct timer, 1 per skb, | ||
79 | plus 1 for any connection(s) we are `master' for */ | ||
80 | struct nf_conntrack ct_general; | ||
81 | |||
82 | /* Have we seen traffic both ways yet? (bitset) */ | ||
83 | unsigned long status; | ||
84 | |||
85 | /* Timer function; drops refcnt when it goes off. */ | ||
86 | struct timer_list timeout; | ||
87 | |||
88 | #ifdef CONFIG_IP_NF_CT_ACCT | ||
89 | /* Accounting Information (same cache line as other written members) */ | ||
90 | struct ip_conntrack_counter counters[IP_CT_DIR_MAX]; | ||
91 | #endif | ||
92 | /* If we were expected by an expectation, this will be it */ | ||
93 | struct ip_conntrack *master; | ||
94 | |||
95 | /* Current number of expected connections */ | ||
96 | unsigned int expecting; | ||
97 | |||
98 | /* Unique ID that identifies this conntrack*/ | ||
99 | unsigned int id; | ||
100 | |||
101 | /* Helper, if any. */ | ||
102 | struct ip_conntrack_helper *helper; | ||
103 | |||
104 | /* Storage reserved for other modules: */ | ||
105 | union ip_conntrack_proto proto; | ||
106 | |||
107 | union ip_conntrack_help help; | ||
108 | |||
109 | #ifdef CONFIG_IP_NF_NAT_NEEDED | ||
110 | struct { | ||
111 | struct ip_nat_info info; | ||
112 | union ip_conntrack_nat_help help; | ||
113 | #if defined(CONFIG_IP_NF_TARGET_MASQUERADE) || \ | ||
114 | defined(CONFIG_IP_NF_TARGET_MASQUERADE_MODULE) | ||
115 | int masq_index; | ||
116 | #endif | ||
117 | } nat; | ||
118 | #endif /* CONFIG_IP_NF_NAT_NEEDED */ | ||
119 | |||
120 | #if defined(CONFIG_IP_NF_CONNTRACK_MARK) | ||
121 | u_int32_t mark; | ||
122 | #endif | ||
123 | |||
124 | #ifdef CONFIG_IP_NF_CONNTRACK_SECMARK | ||
125 | u_int32_t secmark; | ||
126 | #endif | ||
127 | |||
128 | /* Traversed often, so hopefully in different cacheline to top */ | ||
129 | /* These are my tuples; original and reply */ | ||
130 | struct ip_conntrack_tuple_hash tuplehash[IP_CT_DIR_MAX]; | ||
131 | }; | ||
132 | |||
133 | struct ip_conntrack_expect | ||
134 | { | ||
135 | /* Internal linked list (global expectation list) */ | ||
136 | struct list_head list; | ||
137 | |||
138 | /* We expect this tuple, with the following mask */ | ||
139 | struct ip_conntrack_tuple tuple, mask; | ||
140 | |||
141 | /* Function to call after setup and insertion */ | ||
142 | void (*expectfn)(struct ip_conntrack *new, | ||
143 | struct ip_conntrack_expect *this); | ||
144 | |||
145 | /* The conntrack of the master connection */ | ||
146 | struct ip_conntrack *master; | ||
147 | |||
148 | /* Timer function; deletes the expectation. */ | ||
149 | struct timer_list timeout; | ||
150 | |||
151 | /* Usage count. */ | ||
152 | atomic_t use; | ||
153 | |||
154 | /* Unique ID */ | ||
155 | unsigned int id; | ||
156 | |||
157 | /* Flags */ | ||
158 | unsigned int flags; | ||
159 | |||
160 | #ifdef CONFIG_IP_NF_NAT_NEEDED | ||
161 | __be32 saved_ip; | ||
162 | /* This is the original per-proto part, used to map the | ||
163 | * expected connection the way the recipient expects. */ | ||
164 | union ip_conntrack_manip_proto saved_proto; | ||
165 | /* Direction relative to the master connection. */ | ||
166 | enum ip_conntrack_dir dir; | ||
167 | #endif | ||
168 | }; | ||
169 | |||
170 | #define IP_CT_EXPECT_PERMANENT 0x1 | ||
171 | |||
172 | static inline struct ip_conntrack * | ||
173 | tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) | ||
174 | { | ||
175 | return container_of(hash, struct ip_conntrack, | ||
176 | tuplehash[hash->tuple.dst.dir]); | ||
177 | } | ||
178 | |||
179 | /* get master conntrack via master expectation */ | ||
180 | #define master_ct(conntr) (conntr->master) | ||
181 | |||
182 | /* Alter reply tuple (maybe alter helper). */ | ||
183 | extern void | ||
184 | ip_conntrack_alter_reply(struct ip_conntrack *conntrack, | ||
185 | const struct ip_conntrack_tuple *newreply); | ||
186 | |||
187 | /* Is this tuple taken? (ignoring any belonging to the given | ||
188 | conntrack). */ | ||
189 | extern int | ||
190 | ip_conntrack_tuple_taken(const struct ip_conntrack_tuple *tuple, | ||
191 | const struct ip_conntrack *ignored_conntrack); | ||
192 | |||
193 | /* Return conntrack_info and tuple hash for given skb. */ | ||
194 | static inline struct ip_conntrack * | ||
195 | ip_conntrack_get(const struct sk_buff *skb, enum ip_conntrack_info *ctinfo) | ||
196 | { | ||
197 | *ctinfo = skb->nfctinfo; | ||
198 | return (struct ip_conntrack *)skb->nfct; | ||
199 | } | ||
200 | |||
201 | /* decrement reference count on a conntrack */ | ||
202 | static inline void | ||
203 | ip_conntrack_put(struct ip_conntrack *ct) | ||
204 | { | ||
205 | IP_NF_ASSERT(ct); | ||
206 | nf_conntrack_put(&ct->ct_general); | ||
207 | } | ||
208 | |||
209 | extern int invert_tuplepr(struct ip_conntrack_tuple *inverse, | ||
210 | const struct ip_conntrack_tuple *orig); | ||
211 | |||
212 | extern void __ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
213 | enum ip_conntrack_info ctinfo, | ||
214 | const struct sk_buff *skb, | ||
215 | unsigned long extra_jiffies, | ||
216 | int do_acct); | ||
217 | |||
218 | /* Refresh conntrack for this many jiffies and do accounting */ | ||
219 | static inline void ip_ct_refresh_acct(struct ip_conntrack *ct, | ||
220 | enum ip_conntrack_info ctinfo, | ||
221 | const struct sk_buff *skb, | ||
222 | unsigned long extra_jiffies) | ||
223 | { | ||
224 | __ip_ct_refresh_acct(ct, ctinfo, skb, extra_jiffies, 1); | ||
225 | } | ||
226 | |||
227 | /* Refresh conntrack for this many jiffies */ | ||
228 | static inline void ip_ct_refresh(struct ip_conntrack *ct, | ||
229 | const struct sk_buff *skb, | ||
230 | unsigned long extra_jiffies) | ||
231 | { | ||
232 | __ip_ct_refresh_acct(ct, 0, skb, extra_jiffies, 0); | ||
233 | } | ||
234 | |||
235 | /* These are for NAT. Icky. */ | ||
236 | /* Update TCP window tracking data when NAT mangles the packet */ | ||
237 | extern void ip_conntrack_tcp_update(struct sk_buff *skb, | ||
238 | struct ip_conntrack *conntrack, | ||
239 | enum ip_conntrack_dir dir); | ||
240 | |||
241 | /* Call me when a conntrack is destroyed. */ | ||
242 | extern void (*ip_conntrack_destroyed)(struct ip_conntrack *conntrack); | ||
243 | |||
244 | /* Fake conntrack entry for untracked connections */ | ||
245 | extern struct ip_conntrack ip_conntrack_untracked; | ||
246 | |||
247 | /* Returns new sk_buff, or NULL */ | ||
248 | struct sk_buff * | ||
249 | ip_ct_gather_frags(struct sk_buff *skb, u_int32_t user); | ||
250 | |||
251 | /* Iterate over all conntracks: if iter returns true, it's deleted. */ | ||
252 | extern void | ||
253 | ip_ct_iterate_cleanup(int (*iter)(struct ip_conntrack *i, void *data), | ||
254 | void *data); | ||
255 | |||
256 | extern struct ip_conntrack_helper * | ||
257 | __ip_conntrack_helper_find_byname(const char *); | ||
258 | extern struct ip_conntrack_helper * | ||
259 | ip_conntrack_helper_find_get(const struct ip_conntrack_tuple *tuple); | ||
260 | extern void ip_conntrack_helper_put(struct ip_conntrack_helper *helper); | ||
261 | |||
262 | extern struct ip_conntrack_protocol * | ||
263 | __ip_conntrack_proto_find(u_int8_t protocol); | ||
264 | extern struct ip_conntrack_protocol * | ||
265 | ip_conntrack_proto_find_get(u_int8_t protocol); | ||
266 | extern void ip_conntrack_proto_put(struct ip_conntrack_protocol *proto); | ||
267 | |||
268 | extern void ip_ct_remove_expectations(struct ip_conntrack *ct); | ||
269 | |||
270 | extern struct ip_conntrack *ip_conntrack_alloc(struct ip_conntrack_tuple *, | ||
271 | struct ip_conntrack_tuple *); | ||
272 | |||
273 | extern void ip_conntrack_free(struct ip_conntrack *ct); | ||
274 | |||
275 | extern void ip_conntrack_hash_insert(struct ip_conntrack *ct); | ||
276 | |||
277 | extern struct ip_conntrack_expect * | ||
278 | __ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); | ||
279 | |||
280 | extern struct ip_conntrack_expect * | ||
281 | ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple); | ||
282 | |||
283 | extern struct ip_conntrack_tuple_hash * | ||
284 | __ip_conntrack_find(const struct ip_conntrack_tuple *tuple, | ||
285 | const struct ip_conntrack *ignored_conntrack); | ||
286 | |||
287 | extern void ip_conntrack_flush(void); | ||
288 | |||
289 | /* It's confirmed if it is, or has been in the hash table. */ | ||
290 | static inline int is_confirmed(struct ip_conntrack *ct) | ||
291 | { | ||
292 | return test_bit(IPS_CONFIRMED_BIT, &ct->status); | ||
293 | } | ||
294 | |||
295 | static inline int is_dying(struct ip_conntrack *ct) | ||
296 | { | ||
297 | return test_bit(IPS_DYING_BIT, &ct->status); | ||
298 | } | ||
299 | |||
300 | extern unsigned int ip_conntrack_htable_size; | ||
301 | extern int ip_conntrack_checksum; | ||
302 | |||
303 | #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) | ||
304 | #define CONNTRACK_STAT_INC_ATOMIC(count) \ | ||
305 | do { \ | ||
306 | local_bh_disable(); \ | ||
307 | __get_cpu_var(ip_conntrack_stat).count++; \ | ||
308 | local_bh_enable(); \ | ||
309 | } while (0) | ||
310 | |||
311 | #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS | ||
312 | #include <linux/notifier.h> | ||
313 | #include <linux/interrupt.h> | ||
314 | |||
315 | struct ip_conntrack_ecache { | ||
316 | struct ip_conntrack *ct; | ||
317 | unsigned int events; | ||
318 | }; | ||
319 | DECLARE_PER_CPU(struct ip_conntrack_ecache, ip_conntrack_ecache); | ||
320 | |||
321 | #define CONNTRACK_ECACHE(x) (__get_cpu_var(ip_conntrack_ecache).x) | ||
322 | |||
323 | extern struct atomic_notifier_head ip_conntrack_chain; | ||
324 | extern struct atomic_notifier_head ip_conntrack_expect_chain; | ||
325 | |||
326 | static inline int ip_conntrack_register_notifier(struct notifier_block *nb) | ||
327 | { | ||
328 | return atomic_notifier_chain_register(&ip_conntrack_chain, nb); | ||
329 | } | ||
330 | |||
331 | static inline int ip_conntrack_unregister_notifier(struct notifier_block *nb) | ||
332 | { | ||
333 | return atomic_notifier_chain_unregister(&ip_conntrack_chain, nb); | ||
334 | } | ||
335 | |||
336 | static inline int | ||
337 | ip_conntrack_expect_register_notifier(struct notifier_block *nb) | ||
338 | { | ||
339 | return atomic_notifier_chain_register(&ip_conntrack_expect_chain, nb); | ||
340 | } | ||
341 | |||
342 | static inline int | ||
343 | ip_conntrack_expect_unregister_notifier(struct notifier_block *nb) | ||
344 | { | ||
345 | return atomic_notifier_chain_unregister(&ip_conntrack_expect_chain, | ||
346 | nb); | ||
347 | } | ||
348 | |||
349 | extern void ip_ct_deliver_cached_events(const struct ip_conntrack *ct); | ||
350 | extern void __ip_ct_event_cache_init(struct ip_conntrack *ct); | ||
351 | |||
352 | static inline void | ||
353 | ip_conntrack_event_cache(enum ip_conntrack_events event, | ||
354 | const struct sk_buff *skb) | ||
355 | { | ||
356 | struct ip_conntrack *ct = (struct ip_conntrack *)skb->nfct; | ||
357 | struct ip_conntrack_ecache *ecache; | ||
358 | |||
359 | local_bh_disable(); | ||
360 | ecache = &__get_cpu_var(ip_conntrack_ecache); | ||
361 | if (ct != ecache->ct) | ||
362 | __ip_ct_event_cache_init(ct); | ||
363 | ecache->events |= event; | ||
364 | local_bh_enable(); | ||
365 | } | ||
366 | |||
367 | static inline void ip_conntrack_event(enum ip_conntrack_events event, | ||
368 | struct ip_conntrack *ct) | ||
369 | { | ||
370 | if (is_confirmed(ct) && !is_dying(ct)) | ||
371 | atomic_notifier_call_chain(&ip_conntrack_chain, event, ct); | ||
372 | } | ||
373 | |||
374 | static inline void | ||
375 | ip_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
376 | struct ip_conntrack_expect *exp) | ||
377 | { | ||
378 | atomic_notifier_call_chain(&ip_conntrack_expect_chain, event, exp); | ||
379 | } | ||
380 | #else /* CONFIG_IP_NF_CONNTRACK_EVENTS */ | ||
381 | static inline void ip_conntrack_event_cache(enum ip_conntrack_events event, | ||
382 | const struct sk_buff *skb) {} | ||
383 | static inline void ip_conntrack_event(enum ip_conntrack_events event, | ||
384 | struct ip_conntrack *ct) {} | ||
385 | static inline void ip_ct_deliver_cached_events(const struct ip_conntrack *ct) {} | ||
386 | static inline void | ||
387 | ip_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
388 | struct ip_conntrack_expect *exp) {} | ||
389 | #endif /* CONFIG_IP_NF_CONNTRACK_EVENTS */ | ||
390 | |||
391 | #ifdef CONFIG_IP_NF_NAT_NEEDED | ||
392 | static inline int ip_nat_initialized(struct ip_conntrack *conntrack, | ||
393 | enum ip_nat_manip_type manip) | ||
394 | { | ||
395 | if (manip == IP_NAT_MANIP_SRC) | ||
396 | return test_bit(IPS_SRC_NAT_DONE_BIT, &conntrack->status); | ||
397 | return test_bit(IPS_DST_NAT_DONE_BIT, &conntrack->status); | ||
398 | } | ||
399 | #endif /* CONFIG_IP_NF_NAT_NEEDED */ | ||
400 | |||
401 | #endif /* __KERNEL__ */ | ||
402 | #endif /* _IP_CONNTRACK_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_amanda.h b/include/linux/netfilter_ipv4/ip_conntrack_amanda.h deleted file mode 100644 index de3e41f51aec..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_amanda.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_AMANDA_H | ||
2 | #define _IP_CONNTRACK_AMANDA_H | ||
3 | /* AMANDA tracking. */ | ||
4 | |||
5 | struct ip_conntrack_expect; | ||
6 | extern unsigned int (*ip_nat_amanda_hook)(struct sk_buff **pskb, | ||
7 | enum ip_conntrack_info ctinfo, | ||
8 | unsigned int matchoff, | ||
9 | unsigned int matchlen, | ||
10 | struct ip_conntrack_expect *exp); | ||
11 | #endif /* _IP_CONNTRACK_AMANDA_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h deleted file mode 100644 index 907d4f5ca5dc..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_CORE_H | ||
2 | #define _IP_CONNTRACK_CORE_H | ||
3 | #include <linux/netfilter.h> | ||
4 | |||
5 | #define MAX_IP_CT_PROTO 256 | ||
6 | extern struct ip_conntrack_protocol *ip_ct_protos[MAX_IP_CT_PROTO]; | ||
7 | |||
8 | /* This header is used to share core functionality between the | ||
9 | standalone connection tracking module, and the compatibility layer's use | ||
10 | of connection tracking. */ | ||
11 | extern unsigned int ip_conntrack_in(unsigned int hooknum, | ||
12 | struct sk_buff **pskb, | ||
13 | const struct net_device *in, | ||
14 | const struct net_device *out, | ||
15 | int (*okfn)(struct sk_buff *)); | ||
16 | |||
17 | extern int ip_conntrack_init(void); | ||
18 | extern void ip_conntrack_cleanup(void); | ||
19 | |||
20 | struct ip_conntrack_protocol; | ||
21 | |||
22 | extern int | ||
23 | ip_ct_get_tuple(const struct iphdr *iph, | ||
24 | const struct sk_buff *skb, | ||
25 | unsigned int dataoff, | ||
26 | struct ip_conntrack_tuple *tuple, | ||
27 | const struct ip_conntrack_protocol *protocol); | ||
28 | |||
29 | extern int | ||
30 | ip_ct_invert_tuple(struct ip_conntrack_tuple *inverse, | ||
31 | const struct ip_conntrack_tuple *orig, | ||
32 | const struct ip_conntrack_protocol *protocol); | ||
33 | |||
34 | /* Find a connection corresponding to a tuple. */ | ||
35 | struct ip_conntrack_tuple_hash * | ||
36 | ip_conntrack_find_get(const struct ip_conntrack_tuple *tuple, | ||
37 | const struct ip_conntrack *ignored_conntrack); | ||
38 | |||
39 | extern int __ip_conntrack_confirm(struct sk_buff **pskb); | ||
40 | |||
41 | /* Confirm a connection: returns NF_DROP if packet must be dropped. */ | ||
42 | static inline int ip_conntrack_confirm(struct sk_buff **pskb) | ||
43 | { | ||
44 | struct ip_conntrack *ct = (struct ip_conntrack *)(*pskb)->nfct; | ||
45 | int ret = NF_ACCEPT; | ||
46 | |||
47 | if (ct) { | ||
48 | if (!is_confirmed(ct)) | ||
49 | ret = __ip_conntrack_confirm(pskb); | ||
50 | ip_ct_deliver_cached_events(ct); | ||
51 | } | ||
52 | return ret; | ||
53 | } | ||
54 | |||
55 | extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp); | ||
56 | |||
57 | extern struct list_head *ip_conntrack_hash; | ||
58 | extern struct list_head ip_conntrack_expect_list; | ||
59 | extern rwlock_t ip_conntrack_lock; | ||
60 | #endif /* _IP_CONNTRACK_CORE_H */ | ||
61 | |||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h b/include/linux/netfilter_ipv4/ip_conntrack_ftp.h deleted file mode 100644 index 2129fc3972ac..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_ftp.h +++ /dev/null | |||
@@ -1,44 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_FTP_H | ||
2 | #define _IP_CONNTRACK_FTP_H | ||
3 | /* FTP tracking. */ | ||
4 | |||
5 | /* This enum is exposed to userspace */ | ||
6 | enum ip_ct_ftp_type | ||
7 | { | ||
8 | /* PORT command from client */ | ||
9 | IP_CT_FTP_PORT, | ||
10 | /* PASV response from server */ | ||
11 | IP_CT_FTP_PASV, | ||
12 | /* EPRT command from client */ | ||
13 | IP_CT_FTP_EPRT, | ||
14 | /* EPSV response from server */ | ||
15 | IP_CT_FTP_EPSV, | ||
16 | }; | ||
17 | |||
18 | #ifdef __KERNEL__ | ||
19 | |||
20 | #define FTP_PORT 21 | ||
21 | |||
22 | #define NUM_SEQ_TO_REMEMBER 2 | ||
23 | /* This structure exists only once per master */ | ||
24 | struct ip_ct_ftp_master { | ||
25 | /* Valid seq positions for cmd matching after newline */ | ||
26 | u_int32_t seq_aft_nl[IP_CT_DIR_MAX][NUM_SEQ_TO_REMEMBER]; | ||
27 | /* 0 means seq_match_aft_nl not set */ | ||
28 | int seq_aft_nl_num[IP_CT_DIR_MAX]; | ||
29 | }; | ||
30 | |||
31 | struct ip_conntrack_expect; | ||
32 | |||
33 | /* For NAT to hook in when we find a packet which describes what other | ||
34 | * connection we should expect. */ | ||
35 | extern unsigned int (*ip_nat_ftp_hook)(struct sk_buff **pskb, | ||
36 | enum ip_conntrack_info ctinfo, | ||
37 | enum ip_ct_ftp_type type, | ||
38 | unsigned int matchoff, | ||
39 | unsigned int matchlen, | ||
40 | struct ip_conntrack_expect *exp, | ||
41 | u32 *seq); | ||
42 | #endif /* __KERNEL__ */ | ||
43 | |||
44 | #endif /* _IP_CONNTRACK_FTP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h deleted file mode 100644 index 18f769818f4e..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ /dev/null | |||
@@ -1,89 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_H323_H | ||
2 | #define _IP_CONNTRACK_H323_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #include <linux/netfilter/nf_conntrack_h323_asn1.h> | ||
7 | |||
8 | #define RAS_PORT 1719 | ||
9 | #define Q931_PORT 1720 | ||
10 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | ||
11 | |||
12 | /* This structure exists only once per master */ | ||
13 | struct ip_ct_h323_master { | ||
14 | |||
15 | /* Original and NATed Q.931 or H.245 signal ports */ | ||
16 | u_int16_t sig_port[IP_CT_DIR_MAX]; | ||
17 | |||
18 | /* Original and NATed RTP ports */ | ||
19 | u_int16_t rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX]; | ||
20 | |||
21 | union { | ||
22 | /* RAS connection timeout */ | ||
23 | u_int32_t timeout; | ||
24 | |||
25 | /* Next TPKT length (for separate TPKT header and data) */ | ||
26 | u_int16_t tpkt_len[IP_CT_DIR_MAX]; | ||
27 | }; | ||
28 | }; | ||
29 | |||
30 | struct ip_conntrack_expect; | ||
31 | |||
32 | extern int get_h225_addr(unsigned char *data, TransportAddress * addr, | ||
33 | __be32 * ip, u_int16_t * port); | ||
34 | extern void ip_conntrack_h245_expect(struct ip_conntrack *new, | ||
35 | struct ip_conntrack_expect *this); | ||
36 | extern void ip_conntrack_q931_expect(struct ip_conntrack *new, | ||
37 | struct ip_conntrack_expect *this); | ||
38 | extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, | ||
39 | unsigned char **data, int dataoff, | ||
40 | H245_TransportAddress * addr, | ||
41 | __be32 ip, u_int16_t port); | ||
42 | extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, | ||
43 | unsigned char **data, int dataoff, | ||
44 | TransportAddress * addr, | ||
45 | __be32 ip, u_int16_t port); | ||
46 | extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, | ||
47 | struct ip_conntrack * ct, | ||
48 | enum ip_conntrack_info ctinfo, | ||
49 | unsigned char **data, | ||
50 | TransportAddress * addr, int count); | ||
51 | extern int (*set_ras_addr_hook) (struct sk_buff ** pskb, | ||
52 | struct ip_conntrack * ct, | ||
53 | enum ip_conntrack_info ctinfo, | ||
54 | unsigned char **data, | ||
55 | TransportAddress * addr, int count); | ||
56 | extern int (*nat_rtp_rtcp_hook) (struct sk_buff ** pskb, | ||
57 | struct ip_conntrack * ct, | ||
58 | enum ip_conntrack_info ctinfo, | ||
59 | unsigned char **data, int dataoff, | ||
60 | H245_TransportAddress * addr, | ||
61 | u_int16_t port, u_int16_t rtp_port, | ||
62 | struct ip_conntrack_expect * rtp_exp, | ||
63 | struct ip_conntrack_expect * rtcp_exp); | ||
64 | extern int (*nat_t120_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, | ||
65 | enum ip_conntrack_info ctinfo, | ||
66 | unsigned char **data, int dataoff, | ||
67 | H245_TransportAddress * addr, u_int16_t port, | ||
68 | struct ip_conntrack_expect * exp); | ||
69 | extern int (*nat_h245_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, | ||
70 | enum ip_conntrack_info ctinfo, | ||
71 | unsigned char **data, int dataoff, | ||
72 | TransportAddress * addr, u_int16_t port, | ||
73 | struct ip_conntrack_expect * exp); | ||
74 | extern int (*nat_callforwarding_hook) (struct sk_buff ** pskb, | ||
75 | struct ip_conntrack * ct, | ||
76 | enum ip_conntrack_info ctinfo, | ||
77 | unsigned char **data, int dataoff, | ||
78 | TransportAddress * addr, | ||
79 | u_int16_t port, | ||
80 | struct ip_conntrack_expect * exp); | ||
81 | extern int (*nat_q931_hook) (struct sk_buff ** pskb, struct ip_conntrack * ct, | ||
82 | enum ip_conntrack_info ctinfo, | ||
83 | unsigned char **data, TransportAddress * addr, | ||
84 | int idx, u_int16_t port, | ||
85 | struct ip_conntrack_expect * exp); | ||
86 | |||
87 | #endif | ||
88 | |||
89 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper.h b/include/linux/netfilter_ipv4/ip_conntrack_helper.h deleted file mode 100644 index 77fe868d36ff..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper.h +++ /dev/null | |||
@@ -1,46 +0,0 @@ | |||
1 | /* IP connection tracking helpers. */ | ||
2 | #ifndef _IP_CONNTRACK_HELPER_H | ||
3 | #define _IP_CONNTRACK_HELPER_H | ||
4 | #include <linux/netfilter_ipv4/ip_conntrack.h> | ||
5 | |||
6 | struct module; | ||
7 | |||
8 | struct ip_conntrack_helper | ||
9 | { | ||
10 | struct list_head list; /* Internal use. */ | ||
11 | |||
12 | const char *name; /* name of the module */ | ||
13 | struct module *me; /* pointer to self */ | ||
14 | unsigned int max_expected; /* Maximum number of concurrent | ||
15 | * expected connections */ | ||
16 | unsigned int timeout; /* timeout for expecteds */ | ||
17 | |||
18 | /* Mask of things we will help (compared against server response) */ | ||
19 | struct ip_conntrack_tuple tuple; | ||
20 | struct ip_conntrack_tuple mask; | ||
21 | |||
22 | /* Function to call when data passes; return verdict, or -1 to | ||
23 | invalidate. */ | ||
24 | int (*help)(struct sk_buff **pskb, | ||
25 | struct ip_conntrack *ct, | ||
26 | enum ip_conntrack_info conntrackinfo); | ||
27 | |||
28 | void (*destroy)(struct ip_conntrack *ct); | ||
29 | |||
30 | int (*to_nfattr)(struct sk_buff *skb, const struct ip_conntrack *ct); | ||
31 | }; | ||
32 | |||
33 | extern int ip_conntrack_helper_register(struct ip_conntrack_helper *); | ||
34 | extern void ip_conntrack_helper_unregister(struct ip_conntrack_helper *); | ||
35 | |||
36 | /* Allocate space for an expectation: this is mandatory before calling | ||
37 | ip_conntrack_expect_related. You will have to call put afterwards. */ | ||
38 | extern struct ip_conntrack_expect * | ||
39 | ip_conntrack_expect_alloc(struct ip_conntrack *master); | ||
40 | extern void ip_conntrack_expect_put(struct ip_conntrack_expect *exp); | ||
41 | |||
42 | /* Add an expected connection: can have more than one per connection */ | ||
43 | extern int ip_conntrack_expect_related(struct ip_conntrack_expect *exp); | ||
44 | extern void ip_conntrack_unexpect_related(struct ip_conntrack_expect *exp); | ||
45 | |||
46 | #endif /*_IP_CONNTRACK_HELPER_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_icmp.h b/include/linux/netfilter_ipv4/ip_conntrack_icmp.h deleted file mode 100644 index eed5ee3e4744..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_icmp.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_ICMP_H | ||
2 | #define _IP_CONNTRACK_ICMP_H | ||
3 | |||
4 | #include <net/netfilter/ipv4/nf_conntrack_icmp.h> | ||
5 | |||
6 | #endif /* _IP_CONNTRACK_ICMP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_irc.h b/include/linux/netfilter_ipv4/ip_conntrack_irc.h deleted file mode 100644 index 16601e0d5626..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_irc.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /* IRC extension for IP connection tracking. | ||
2 | * (C) 2000 by Harald Welte <laforge@gnumonks.org> | ||
3 | * based on RR's ip_conntrack_ftp.h | ||
4 | * | ||
5 | * ip_conntrack_irc.h,v 1.6 2000/11/07 18:26:42 laforge Exp | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * as published by the Free Software Foundation; either version | ||
10 | * 2 of the License, or (at your option) any later version. | ||
11 | * | ||
12 | * | ||
13 | */ | ||
14 | #ifndef _IP_CONNTRACK_IRC_H | ||
15 | #define _IP_CONNTRACK_IRC_H | ||
16 | |||
17 | /* This structure exists only once per master */ | ||
18 | struct ip_ct_irc_master { | ||
19 | }; | ||
20 | |||
21 | #ifdef __KERNEL__ | ||
22 | extern unsigned int (*ip_nat_irc_hook)(struct sk_buff **pskb, | ||
23 | enum ip_conntrack_info ctinfo, | ||
24 | unsigned int matchoff, | ||
25 | unsigned int matchlen, | ||
26 | struct ip_conntrack_expect *exp); | ||
27 | |||
28 | #define IRC_PORT 6667 | ||
29 | |||
30 | #endif /* __KERNEL__ */ | ||
31 | |||
32 | #endif /* _IP_CONNTRACK_IRC_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h b/include/linux/netfilter_ipv4/ip_conntrack_pptp.h deleted file mode 100644 index 2644b1faddd6..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_pptp.h +++ /dev/null | |||
@@ -1,326 +0,0 @@ | |||
1 | /* PPTP constants and structs */ | ||
2 | #ifndef _CONNTRACK_PPTP_H | ||
3 | #define _CONNTRACK_PPTP_H | ||
4 | |||
5 | /* state of the control session */ | ||
6 | enum pptp_ctrlsess_state { | ||
7 | PPTP_SESSION_NONE, /* no session present */ | ||
8 | PPTP_SESSION_ERROR, /* some session error */ | ||
9 | PPTP_SESSION_STOPREQ, /* stop_sess request seen */ | ||
10 | PPTP_SESSION_REQUESTED, /* start_sess request seen */ | ||
11 | PPTP_SESSION_CONFIRMED, /* session established */ | ||
12 | }; | ||
13 | |||
14 | /* state of the call inside the control session */ | ||
15 | enum pptp_ctrlcall_state { | ||
16 | PPTP_CALL_NONE, | ||
17 | PPTP_CALL_ERROR, | ||
18 | PPTP_CALL_OUT_REQ, | ||
19 | PPTP_CALL_OUT_CONF, | ||
20 | PPTP_CALL_IN_REQ, | ||
21 | PPTP_CALL_IN_REP, | ||
22 | PPTP_CALL_IN_CONF, | ||
23 | PPTP_CALL_CLEAR_REQ, | ||
24 | }; | ||
25 | |||
26 | |||
27 | /* conntrack private data */ | ||
28 | struct ip_ct_pptp_master { | ||
29 | enum pptp_ctrlsess_state sstate; /* session state */ | ||
30 | |||
31 | /* everything below is going to be per-expectation in newnat, | ||
32 | * since there could be more than one call within one session */ | ||
33 | enum pptp_ctrlcall_state cstate; /* call state */ | ||
34 | __be16 pac_call_id; /* call id of PAC, host byte order */ | ||
35 | __be16 pns_call_id; /* call id of PNS, host byte order */ | ||
36 | |||
37 | /* in pre-2.6.11 this used to be per-expect. Now it is per-conntrack | ||
38 | * and therefore imposes a fixed limit on the number of maps */ | ||
39 | struct ip_ct_gre_keymap *keymap_orig, *keymap_reply; | ||
40 | }; | ||
41 | |||
42 | /* conntrack_expect private member */ | ||
43 | struct ip_ct_pptp_expect { | ||
44 | enum pptp_ctrlcall_state cstate; /* call state */ | ||
45 | __be16 pac_call_id; /* call id of PAC */ | ||
46 | __be16 pns_call_id; /* call id of PNS */ | ||
47 | }; | ||
48 | |||
49 | |||
50 | #ifdef __KERNEL__ | ||
51 | |||
52 | #define IP_CONNTR_PPTP PPTP_CONTROL_PORT | ||
53 | |||
54 | #define PPTP_CONTROL_PORT 1723 | ||
55 | |||
56 | #define PPTP_PACKET_CONTROL 1 | ||
57 | #define PPTP_PACKET_MGMT 2 | ||
58 | |||
59 | #define PPTP_MAGIC_COOKIE 0x1a2b3c4d | ||
60 | |||
61 | struct pptp_pkt_hdr { | ||
62 | __u16 packetLength; | ||
63 | __be16 packetType; | ||
64 | __be32 magicCookie; | ||
65 | }; | ||
66 | |||
67 | /* PptpControlMessageType values */ | ||
68 | #define PPTP_START_SESSION_REQUEST 1 | ||
69 | #define PPTP_START_SESSION_REPLY 2 | ||
70 | #define PPTP_STOP_SESSION_REQUEST 3 | ||
71 | #define PPTP_STOP_SESSION_REPLY 4 | ||
72 | #define PPTP_ECHO_REQUEST 5 | ||
73 | #define PPTP_ECHO_REPLY 6 | ||
74 | #define PPTP_OUT_CALL_REQUEST 7 | ||
75 | #define PPTP_OUT_CALL_REPLY 8 | ||
76 | #define PPTP_IN_CALL_REQUEST 9 | ||
77 | #define PPTP_IN_CALL_REPLY 10 | ||
78 | #define PPTP_IN_CALL_CONNECT 11 | ||
79 | #define PPTP_CALL_CLEAR_REQUEST 12 | ||
80 | #define PPTP_CALL_DISCONNECT_NOTIFY 13 | ||
81 | #define PPTP_WAN_ERROR_NOTIFY 14 | ||
82 | #define PPTP_SET_LINK_INFO 15 | ||
83 | |||
84 | #define PPTP_MSG_MAX 15 | ||
85 | |||
86 | /* PptpGeneralError values */ | ||
87 | #define PPTP_ERROR_CODE_NONE 0 | ||
88 | #define PPTP_NOT_CONNECTED 1 | ||
89 | #define PPTP_BAD_FORMAT 2 | ||
90 | #define PPTP_BAD_VALUE 3 | ||
91 | #define PPTP_NO_RESOURCE 4 | ||
92 | #define PPTP_BAD_CALLID 5 | ||
93 | #define PPTP_REMOVE_DEVICE_ERROR 6 | ||
94 | |||
95 | struct PptpControlHeader { | ||
96 | __be16 messageType; | ||
97 | __u16 reserved; | ||
98 | }; | ||
99 | |||
100 | /* FramingCapability Bitmap Values */ | ||
101 | #define PPTP_FRAME_CAP_ASYNC 0x1 | ||
102 | #define PPTP_FRAME_CAP_SYNC 0x2 | ||
103 | |||
104 | /* BearerCapability Bitmap Values */ | ||
105 | #define PPTP_BEARER_CAP_ANALOG 0x1 | ||
106 | #define PPTP_BEARER_CAP_DIGITAL 0x2 | ||
107 | |||
108 | struct PptpStartSessionRequest { | ||
109 | __be16 protocolVersion; | ||
110 | __u16 reserved1; | ||
111 | __be32 framingCapability; | ||
112 | __be32 bearerCapability; | ||
113 | __be16 maxChannels; | ||
114 | __be16 firmwareRevision; | ||
115 | __u8 hostName[64]; | ||
116 | __u8 vendorString[64]; | ||
117 | }; | ||
118 | |||
119 | /* PptpStartSessionResultCode Values */ | ||
120 | #define PPTP_START_OK 1 | ||
121 | #define PPTP_START_GENERAL_ERROR 2 | ||
122 | #define PPTP_START_ALREADY_CONNECTED 3 | ||
123 | #define PPTP_START_NOT_AUTHORIZED 4 | ||
124 | #define PPTP_START_UNKNOWN_PROTOCOL 5 | ||
125 | |||
126 | struct PptpStartSessionReply { | ||
127 | __be16 protocolVersion; | ||
128 | __u8 resultCode; | ||
129 | __u8 generalErrorCode; | ||
130 | __be32 framingCapability; | ||
131 | __be32 bearerCapability; | ||
132 | __be16 maxChannels; | ||
133 | __be16 firmwareRevision; | ||
134 | __u8 hostName[64]; | ||
135 | __u8 vendorString[64]; | ||
136 | }; | ||
137 | |||
138 | /* PptpStopReasons */ | ||
139 | #define PPTP_STOP_NONE 1 | ||
140 | #define PPTP_STOP_PROTOCOL 2 | ||
141 | #define PPTP_STOP_LOCAL_SHUTDOWN 3 | ||
142 | |||
143 | struct PptpStopSessionRequest { | ||
144 | __u8 reason; | ||
145 | __u8 reserved1; | ||
146 | __u16 reserved2; | ||
147 | }; | ||
148 | |||
149 | /* PptpStopSessionResultCode */ | ||
150 | #define PPTP_STOP_OK 1 | ||
151 | #define PPTP_STOP_GENERAL_ERROR 2 | ||
152 | |||
153 | struct PptpStopSessionReply { | ||
154 | __u8 resultCode; | ||
155 | __u8 generalErrorCode; | ||
156 | __u16 reserved1; | ||
157 | }; | ||
158 | |||
159 | struct PptpEchoRequest { | ||
160 | __be32 identNumber; | ||
161 | }; | ||
162 | |||
163 | /* PptpEchoReplyResultCode */ | ||
164 | #define PPTP_ECHO_OK 1 | ||
165 | #define PPTP_ECHO_GENERAL_ERROR 2 | ||
166 | |||
167 | struct PptpEchoReply { | ||
168 | __be32 identNumber; | ||
169 | __u8 resultCode; | ||
170 | __u8 generalErrorCode; | ||
171 | __u16 reserved; | ||
172 | }; | ||
173 | |||
174 | /* PptpFramingType */ | ||
175 | #define PPTP_ASYNC_FRAMING 1 | ||
176 | #define PPTP_SYNC_FRAMING 2 | ||
177 | #define PPTP_DONT_CARE_FRAMING 3 | ||
178 | |||
179 | /* PptpCallBearerType */ | ||
180 | #define PPTP_ANALOG_TYPE 1 | ||
181 | #define PPTP_DIGITAL_TYPE 2 | ||
182 | #define PPTP_DONT_CARE_BEARER_TYPE 3 | ||
183 | |||
184 | struct PptpOutCallRequest { | ||
185 | __be16 callID; | ||
186 | __be16 callSerialNumber; | ||
187 | __be32 minBPS; | ||
188 | __be32 maxBPS; | ||
189 | __be32 bearerType; | ||
190 | __be32 framingType; | ||
191 | __be16 packetWindow; | ||
192 | __be16 packetProcDelay; | ||
193 | __be16 phoneNumberLength; | ||
194 | __u16 reserved1; | ||
195 | __u8 phoneNumber[64]; | ||
196 | __u8 subAddress[64]; | ||
197 | }; | ||
198 | |||
199 | /* PptpCallResultCode */ | ||
200 | #define PPTP_OUTCALL_CONNECT 1 | ||
201 | #define PPTP_OUTCALL_GENERAL_ERROR 2 | ||
202 | #define PPTP_OUTCALL_NO_CARRIER 3 | ||
203 | #define PPTP_OUTCALL_BUSY 4 | ||
204 | #define PPTP_OUTCALL_NO_DIAL_TONE 5 | ||
205 | #define PPTP_OUTCALL_TIMEOUT 6 | ||
206 | #define PPTP_OUTCALL_DONT_ACCEPT 7 | ||
207 | |||
208 | struct PptpOutCallReply { | ||
209 | __be16 callID; | ||
210 | __be16 peersCallID; | ||
211 | __u8 resultCode; | ||
212 | __u8 generalErrorCode; | ||
213 | __be16 causeCode; | ||
214 | __be32 connectSpeed; | ||
215 | __be16 packetWindow; | ||
216 | __be16 packetProcDelay; | ||
217 | __be32 physChannelID; | ||
218 | }; | ||
219 | |||
220 | struct PptpInCallRequest { | ||
221 | __be16 callID; | ||
222 | __be16 callSerialNumber; | ||
223 | __be32 callBearerType; | ||
224 | __be32 physChannelID; | ||
225 | __be16 dialedNumberLength; | ||
226 | __be16 dialingNumberLength; | ||
227 | __u8 dialedNumber[64]; | ||
228 | __u8 dialingNumber[64]; | ||
229 | __u8 subAddress[64]; | ||
230 | }; | ||
231 | |||
232 | /* PptpInCallResultCode */ | ||
233 | #define PPTP_INCALL_ACCEPT 1 | ||
234 | #define PPTP_INCALL_GENERAL_ERROR 2 | ||
235 | #define PPTP_INCALL_DONT_ACCEPT 3 | ||
236 | |||
237 | struct PptpInCallReply { | ||
238 | __be16 callID; | ||
239 | __be16 peersCallID; | ||
240 | __u8 resultCode; | ||
241 | __u8 generalErrorCode; | ||
242 | __be16 packetWindow; | ||
243 | __be16 packetProcDelay; | ||
244 | __u16 reserved; | ||
245 | }; | ||
246 | |||
247 | struct PptpInCallConnected { | ||
248 | __be16 peersCallID; | ||
249 | __u16 reserved; | ||
250 | __be32 connectSpeed; | ||
251 | __be16 packetWindow; | ||
252 | __be16 packetProcDelay; | ||
253 | __be32 callFramingType; | ||
254 | }; | ||
255 | |||
256 | struct PptpClearCallRequest { | ||
257 | __be16 callID; | ||
258 | __u16 reserved; | ||
259 | }; | ||
260 | |||
261 | struct PptpCallDisconnectNotify { | ||
262 | __be16 callID; | ||
263 | __u8 resultCode; | ||
264 | __u8 generalErrorCode; | ||
265 | __be16 causeCode; | ||
266 | __u16 reserved; | ||
267 | __u8 callStatistics[128]; | ||
268 | }; | ||
269 | |||
270 | struct PptpWanErrorNotify { | ||
271 | __be16 peersCallID; | ||
272 | __u16 reserved; | ||
273 | __be32 crcErrors; | ||
274 | __be32 framingErrors; | ||
275 | __be32 hardwareOverRuns; | ||
276 | __be32 bufferOverRuns; | ||
277 | __be32 timeoutErrors; | ||
278 | __be32 alignmentErrors; | ||
279 | }; | ||
280 | |||
281 | struct PptpSetLinkInfo { | ||
282 | __be16 peersCallID; | ||
283 | __u16 reserved; | ||
284 | __be32 sendAccm; | ||
285 | __be32 recvAccm; | ||
286 | }; | ||
287 | |||
288 | union pptp_ctrl_union { | ||
289 | struct PptpStartSessionRequest sreq; | ||
290 | struct PptpStartSessionReply srep; | ||
291 | struct PptpStopSessionRequest streq; | ||
292 | struct PptpStopSessionReply strep; | ||
293 | struct PptpOutCallRequest ocreq; | ||
294 | struct PptpOutCallReply ocack; | ||
295 | struct PptpInCallRequest icreq; | ||
296 | struct PptpInCallReply icack; | ||
297 | struct PptpInCallConnected iccon; | ||
298 | struct PptpClearCallRequest clrreq; | ||
299 | struct PptpCallDisconnectNotify disc; | ||
300 | struct PptpWanErrorNotify wanerr; | ||
301 | struct PptpSetLinkInfo setlink; | ||
302 | }; | ||
303 | |||
304 | extern int | ||
305 | (*ip_nat_pptp_hook_outbound)(struct sk_buff **pskb, | ||
306 | struct ip_conntrack *ct, | ||
307 | enum ip_conntrack_info ctinfo, | ||
308 | struct PptpControlHeader *ctlh, | ||
309 | union pptp_ctrl_union *pptpReq); | ||
310 | |||
311 | extern int | ||
312 | (*ip_nat_pptp_hook_inbound)(struct sk_buff **pskb, | ||
313 | struct ip_conntrack *ct, | ||
314 | enum ip_conntrack_info ctinfo, | ||
315 | struct PptpControlHeader *ctlh, | ||
316 | union pptp_ctrl_union *pptpReq); | ||
317 | |||
318 | extern void | ||
319 | (*ip_nat_pptp_hook_exp_gre)(struct ip_conntrack_expect *exp_orig, | ||
320 | struct ip_conntrack_expect *exp_reply); | ||
321 | |||
322 | extern void | ||
323 | (*ip_nat_pptp_hook_expectfn)(struct ip_conntrack *ct, | ||
324 | struct ip_conntrack_expect *exp); | ||
325 | #endif /* __KERNEL__ */ | ||
326 | #endif /* _CONNTRACK_PPTP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h b/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h deleted file mode 100644 index e371e0fc1672..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_proto_gre.h +++ /dev/null | |||
@@ -1,114 +0,0 @@ | |||
1 | #ifndef _CONNTRACK_PROTO_GRE_H | ||
2 | #define _CONNTRACK_PROTO_GRE_H | ||
3 | #include <asm/byteorder.h> | ||
4 | |||
5 | /* GRE PROTOCOL HEADER */ | ||
6 | |||
7 | /* GRE Version field */ | ||
8 | #define GRE_VERSION_1701 0x0 | ||
9 | #define GRE_VERSION_PPTP 0x1 | ||
10 | |||
11 | /* GRE Protocol field */ | ||
12 | #define GRE_PROTOCOL_PPTP 0x880B | ||
13 | |||
14 | /* GRE Flags */ | ||
15 | #define GRE_FLAG_C 0x80 | ||
16 | #define GRE_FLAG_R 0x40 | ||
17 | #define GRE_FLAG_K 0x20 | ||
18 | #define GRE_FLAG_S 0x10 | ||
19 | #define GRE_FLAG_A 0x80 | ||
20 | |||
21 | #define GRE_IS_C(f) ((f)&GRE_FLAG_C) | ||
22 | #define GRE_IS_R(f) ((f)&GRE_FLAG_R) | ||
23 | #define GRE_IS_K(f) ((f)&GRE_FLAG_K) | ||
24 | #define GRE_IS_S(f) ((f)&GRE_FLAG_S) | ||
25 | #define GRE_IS_A(f) ((f)&GRE_FLAG_A) | ||
26 | |||
27 | /* GRE is a mess: Four different standards */ | ||
28 | struct gre_hdr { | ||
29 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
30 | __u16 rec:3, | ||
31 | srr:1, | ||
32 | seq:1, | ||
33 | key:1, | ||
34 | routing:1, | ||
35 | csum:1, | ||
36 | version:3, | ||
37 | reserved:4, | ||
38 | ack:1; | ||
39 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
40 | __u16 csum:1, | ||
41 | routing:1, | ||
42 | key:1, | ||
43 | seq:1, | ||
44 | srr:1, | ||
45 | rec:3, | ||
46 | ack:1, | ||
47 | reserved:4, | ||
48 | version:3; | ||
49 | #else | ||
50 | #error "Adjust your <asm/byteorder.h> defines" | ||
51 | #endif | ||
52 | __be16 protocol; | ||
53 | }; | ||
54 | |||
55 | /* modified GRE header for PPTP */ | ||
56 | struct gre_hdr_pptp { | ||
57 | __u8 flags; /* bitfield */ | ||
58 | __u8 version; /* should be GRE_VERSION_PPTP */ | ||
59 | __be16 protocol; /* should be GRE_PROTOCOL_PPTP */ | ||
60 | __be16 payload_len; /* size of ppp payload, not inc. gre header */ | ||
61 | __be16 call_id; /* peer's call_id for this session */ | ||
62 | __be32 seq; /* sequence number. Present if S==1 */ | ||
63 | __be32 ack; /* seq number of highest packet recieved by */ | ||
64 | /* sender in this session */ | ||
65 | }; | ||
66 | |||
67 | |||
68 | /* this is part of ip_conntrack */ | ||
69 | struct ip_ct_gre { | ||
70 | unsigned int stream_timeout; | ||
71 | unsigned int timeout; | ||
72 | }; | ||
73 | |||
74 | #ifdef __KERNEL__ | ||
75 | struct ip_conntrack_expect; | ||
76 | struct ip_conntrack; | ||
77 | |||
78 | /* structure for original <-> reply keymap */ | ||
79 | struct ip_ct_gre_keymap { | ||
80 | struct list_head list; | ||
81 | |||
82 | struct ip_conntrack_tuple tuple; | ||
83 | }; | ||
84 | |||
85 | /* add new tuple->key_reply pair to keymap */ | ||
86 | int ip_ct_gre_keymap_add(struct ip_conntrack *ct, | ||
87 | struct ip_conntrack_tuple *t, | ||
88 | int reply); | ||
89 | |||
90 | /* delete keymap entries */ | ||
91 | void ip_ct_gre_keymap_destroy(struct ip_conntrack *ct); | ||
92 | |||
93 | |||
94 | /* get pointer to gre key, if present */ | ||
95 | static inline __be32 *gre_key(struct gre_hdr *greh) | ||
96 | { | ||
97 | if (!greh->key) | ||
98 | return NULL; | ||
99 | if (greh->csum || greh->routing) | ||
100 | return (__be32 *) (greh+sizeof(*greh)+4); | ||
101 | return (__be32 *) (greh+sizeof(*greh)); | ||
102 | } | ||
103 | |||
104 | /* get pointer ot gre csum, if present */ | ||
105 | static inline __sum16 *gre_csum(struct gre_hdr *greh) | ||
106 | { | ||
107 | if (!greh->csum) | ||
108 | return NULL; | ||
109 | return (__sum16 *) (greh+sizeof(*greh)); | ||
110 | } | ||
111 | |||
112 | #endif /* __KERNEL__ */ | ||
113 | |||
114 | #endif /* _CONNTRACK_PROTO_GRE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h deleted file mode 100644 index 2c76b879e3dc..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h +++ /dev/null | |||
@@ -1,98 +0,0 @@ | |||
1 | /* Header for use in defining a given protocol for connection tracking. */ | ||
2 | #ifndef _IP_CONNTRACK_PROTOCOL_H | ||
3 | #define _IP_CONNTRACK_PROTOCOL_H | ||
4 | #include <linux/netfilter_ipv4/ip_conntrack.h> | ||
5 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
6 | |||
7 | struct seq_file; | ||
8 | |||
9 | struct ip_conntrack_protocol | ||
10 | { | ||
11 | /* Protocol number. */ | ||
12 | u_int8_t proto; | ||
13 | |||
14 | /* Protocol name */ | ||
15 | const char *name; | ||
16 | |||
17 | /* Try to fill in the third arg: dataoff is offset past IP | ||
18 | hdr. Return true if possible. */ | ||
19 | int (*pkt_to_tuple)(const struct sk_buff *skb, | ||
20 | unsigned int dataoff, | ||
21 | struct ip_conntrack_tuple *tuple); | ||
22 | |||
23 | /* Invert the per-proto part of the tuple: ie. turn xmit into reply. | ||
24 | * Some packets can't be inverted: return 0 in that case. | ||
25 | */ | ||
26 | int (*invert_tuple)(struct ip_conntrack_tuple *inverse, | ||
27 | const struct ip_conntrack_tuple *orig); | ||
28 | |||
29 | /* Print out the per-protocol part of the tuple. Return like seq_* */ | ||
30 | int (*print_tuple)(struct seq_file *, | ||
31 | const struct ip_conntrack_tuple *); | ||
32 | |||
33 | /* Print out the private part of the conntrack. */ | ||
34 | int (*print_conntrack)(struct seq_file *, const struct ip_conntrack *); | ||
35 | |||
36 | /* Returns verdict for packet, or -1 for invalid. */ | ||
37 | int (*packet)(struct ip_conntrack *conntrack, | ||
38 | const struct sk_buff *skb, | ||
39 | enum ip_conntrack_info ctinfo); | ||
40 | |||
41 | /* Called when a new connection for this protocol found; | ||
42 | * returns TRUE if it's OK. If so, packet() called next. */ | ||
43 | int (*new)(struct ip_conntrack *conntrack, const struct sk_buff *skb); | ||
44 | |||
45 | /* Called when a conntrack entry is destroyed */ | ||
46 | void (*destroy)(struct ip_conntrack *conntrack); | ||
47 | |||
48 | int (*error)(struct sk_buff *skb, enum ip_conntrack_info *ctinfo, | ||
49 | unsigned int hooknum); | ||
50 | |||
51 | /* convert protoinfo to nfnetink attributes */ | ||
52 | int (*to_nfattr)(struct sk_buff *skb, struct nfattr *nfa, | ||
53 | const struct ip_conntrack *ct); | ||
54 | |||
55 | /* convert nfnetlink attributes to protoinfo */ | ||
56 | int (*from_nfattr)(struct nfattr *tb[], struct ip_conntrack *ct); | ||
57 | |||
58 | int (*tuple_to_nfattr)(struct sk_buff *skb, | ||
59 | const struct ip_conntrack_tuple *t); | ||
60 | int (*nfattr_to_tuple)(struct nfattr *tb[], | ||
61 | struct ip_conntrack_tuple *t); | ||
62 | |||
63 | /* Module (if any) which this is connected to. */ | ||
64 | struct module *me; | ||
65 | }; | ||
66 | |||
67 | /* Protocol registration. */ | ||
68 | extern int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto); | ||
69 | extern void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto); | ||
70 | /* Existing built-in protocols */ | ||
71 | extern struct ip_conntrack_protocol ip_conntrack_protocol_tcp; | ||
72 | extern struct ip_conntrack_protocol ip_conntrack_protocol_udp; | ||
73 | extern struct ip_conntrack_protocol ip_conntrack_protocol_icmp; | ||
74 | extern struct ip_conntrack_protocol ip_conntrack_generic_protocol; | ||
75 | extern int ip_conntrack_protocol_tcp_init(void); | ||
76 | |||
77 | /* Log invalid packets */ | ||
78 | extern unsigned int ip_ct_log_invalid; | ||
79 | |||
80 | extern int ip_ct_port_tuple_to_nfattr(struct sk_buff *, | ||
81 | const struct ip_conntrack_tuple *); | ||
82 | extern int ip_ct_port_nfattr_to_tuple(struct nfattr *tb[], | ||
83 | struct ip_conntrack_tuple *); | ||
84 | |||
85 | #ifdef CONFIG_SYSCTL | ||
86 | #ifdef DEBUG_INVALID_PACKETS | ||
87 | #define LOG_INVALID(proto) \ | ||
88 | (ip_ct_log_invalid == (proto) || ip_ct_log_invalid == IPPROTO_RAW) | ||
89 | #else | ||
90 | #define LOG_INVALID(proto) \ | ||
91 | ((ip_ct_log_invalid == (proto) || ip_ct_log_invalid == IPPROTO_RAW) \ | ||
92 | && net_ratelimit()) | ||
93 | #endif | ||
94 | #else | ||
95 | #define LOG_INVALID(proto) 0 | ||
96 | #endif /* CONFIG_SYSCTL */ | ||
97 | |||
98 | #endif /*_IP_CONNTRACK_PROTOCOL_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sctp.h b/include/linux/netfilter_ipv4/ip_conntrack_sctp.h deleted file mode 100644 index 4099a041a32a..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_sctp.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_SCTP_H | ||
2 | #define _IP_CONNTRACK_SCTP_H | ||
3 | |||
4 | #include <linux/netfilter/nf_conntrack_sctp.h> | ||
5 | |||
6 | #endif /* _IP_CONNTRACK_SCTP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_sip.h b/include/linux/netfilter_ipv4/ip_conntrack_sip.h deleted file mode 100644 index bef6c646defa..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_sip.h +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | #ifndef __IP_CONNTRACK_SIP_H__ | ||
2 | #define __IP_CONNTRACK_SIP_H__ | ||
3 | #ifdef __KERNEL__ | ||
4 | |||
5 | #define SIP_PORT 5060 | ||
6 | #define SIP_TIMEOUT 3600 | ||
7 | |||
8 | enum sip_header_pos { | ||
9 | POS_REG_REQ_URI, | ||
10 | POS_REQ_URI, | ||
11 | POS_FROM, | ||
12 | POS_TO, | ||
13 | POS_VIA, | ||
14 | POS_CONTACT, | ||
15 | POS_CONTENT, | ||
16 | POS_MEDIA, | ||
17 | POS_OWNER, | ||
18 | POS_CONNECTION, | ||
19 | POS_SDP_HEADER, | ||
20 | }; | ||
21 | |||
22 | extern unsigned int (*ip_nat_sip_hook)(struct sk_buff **pskb, | ||
23 | enum ip_conntrack_info ctinfo, | ||
24 | struct ip_conntrack *ct, | ||
25 | const char **dptr); | ||
26 | extern unsigned int (*ip_nat_sdp_hook)(struct sk_buff **pskb, | ||
27 | enum ip_conntrack_info ctinfo, | ||
28 | struct ip_conntrack_expect *exp, | ||
29 | const char *dptr); | ||
30 | |||
31 | extern int ct_sip_get_info(const char *dptr, size_t dlen, | ||
32 | unsigned int *matchoff, | ||
33 | unsigned int *matchlen, | ||
34 | enum sip_header_pos pos); | ||
35 | extern int ct_sip_lnlen(const char *line, const char *limit); | ||
36 | extern const char *ct_sip_search(const char *needle, const char *haystack, | ||
37 | size_t needle_len, size_t haystack_len, | ||
38 | int case_sensitive); | ||
39 | #endif /* __KERNEL__ */ | ||
40 | #endif /* __IP_CONNTRACK_SIP_H__ */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tcp.h b/include/linux/netfilter_ipv4/ip_conntrack_tcp.h deleted file mode 100644 index 876b8fb17e68..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_tcp.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_TCP_H | ||
2 | #define _IP_CONNTRACK_TCP_H | ||
3 | |||
4 | #include <linux/netfilter/nf_conntrack_tcp.h> | ||
5 | |||
6 | #endif /* _IP_CONNTRACK_TCP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h b/include/linux/netfilter_ipv4/ip_conntrack_tftp.h deleted file mode 100644 index a404fc0abf0e..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_tftp.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | #ifndef _IP_CT_TFTP | ||
2 | #define _IP_CT_TFTP | ||
3 | |||
4 | #define TFTP_PORT 69 | ||
5 | |||
6 | struct tftphdr { | ||
7 | __be16 opcode; | ||
8 | }; | ||
9 | |||
10 | #define TFTP_OPCODE_READ 1 | ||
11 | #define TFTP_OPCODE_WRITE 2 | ||
12 | #define TFTP_OPCODE_DATA 3 | ||
13 | #define TFTP_OPCODE_ACK 4 | ||
14 | #define TFTP_OPCODE_ERROR 5 | ||
15 | |||
16 | extern unsigned int (*ip_nat_tftp_hook)(struct sk_buff **pskb, | ||
17 | enum ip_conntrack_info ctinfo, | ||
18 | struct ip_conntrack_expect *exp); | ||
19 | |||
20 | #endif /* _IP_CT_TFTP */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h deleted file mode 100644 index c228bde74c33..000000000000 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ /dev/null | |||
@@ -1,146 +0,0 @@ | |||
1 | #ifndef _IP_CONNTRACK_TUPLE_H | ||
2 | #define _IP_CONNTRACK_TUPLE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/netfilter/nf_conntrack_tuple_common.h> | ||
6 | |||
7 | /* A `tuple' is a structure containing the information to uniquely | ||
8 | identify a connection. ie. if two packets have the same tuple, they | ||
9 | are in the same connection; if not, they are not. | ||
10 | |||
11 | We divide the structure along "manipulatable" and | ||
12 | "non-manipulatable" lines, for the benefit of the NAT code. | ||
13 | */ | ||
14 | |||
15 | /* The protocol-specific manipulable parts of the tuple: always in | ||
16 | network order! */ | ||
17 | union ip_conntrack_manip_proto | ||
18 | { | ||
19 | /* Add other protocols here. */ | ||
20 | u_int16_t all; | ||
21 | |||
22 | struct { | ||
23 | __be16 port; | ||
24 | } tcp; | ||
25 | struct { | ||
26 | __be16 port; | ||
27 | } udp; | ||
28 | struct { | ||
29 | __be16 id; | ||
30 | } icmp; | ||
31 | struct { | ||
32 | __be16 port; | ||
33 | } sctp; | ||
34 | struct { | ||
35 | __be16 key; /* key is 32bit, pptp only uses 16 */ | ||
36 | } gre; | ||
37 | }; | ||
38 | |||
39 | /* The manipulable part of the tuple. */ | ||
40 | struct ip_conntrack_manip | ||
41 | { | ||
42 | __be32 ip; | ||
43 | union ip_conntrack_manip_proto u; | ||
44 | }; | ||
45 | |||
46 | /* This contains the information to distinguish a connection. */ | ||
47 | struct ip_conntrack_tuple | ||
48 | { | ||
49 | struct ip_conntrack_manip src; | ||
50 | |||
51 | /* These are the parts of the tuple which are fixed. */ | ||
52 | struct { | ||
53 | __be32 ip; | ||
54 | union { | ||
55 | /* Add other protocols here. */ | ||
56 | u_int16_t all; | ||
57 | |||
58 | struct { | ||
59 | __be16 port; | ||
60 | } tcp; | ||
61 | struct { | ||
62 | __be16 port; | ||
63 | } udp; | ||
64 | struct { | ||
65 | u_int8_t type, code; | ||
66 | } icmp; | ||
67 | struct { | ||
68 | __be16 port; | ||
69 | } sctp; | ||
70 | struct { | ||
71 | __be16 key; /* key is 32bit, | ||
72 | * pptp only uses 16 */ | ||
73 | } gre; | ||
74 | } u; | ||
75 | |||
76 | /* The protocol. */ | ||
77 | u_int8_t protonum; | ||
78 | |||
79 | /* The direction (for tuplehash) */ | ||
80 | u_int8_t dir; | ||
81 | } dst; | ||
82 | }; | ||
83 | |||
84 | /* This is optimized opposed to a memset of the whole structure. Everything we | ||
85 | * really care about is the source/destination unions */ | ||
86 | #define IP_CT_TUPLE_U_BLANK(tuple) \ | ||
87 | do { \ | ||
88 | (tuple)->src.u.all = 0; \ | ||
89 | (tuple)->dst.u.all = 0; \ | ||
90 | } while (0) | ||
91 | |||
92 | #ifdef __KERNEL__ | ||
93 | |||
94 | #define DUMP_TUPLE(tp) \ | ||
95 | DEBUGP("tuple %p: %u %u.%u.%u.%u:%hu -> %u.%u.%u.%u:%hu\n", \ | ||
96 | (tp), (tp)->dst.protonum, \ | ||
97 | NIPQUAD((tp)->src.ip), ntohs((tp)->src.u.all), \ | ||
98 | NIPQUAD((tp)->dst.ip), ntohs((tp)->dst.u.all)) | ||
99 | |||
100 | /* If we're the first tuple, it's the original dir. */ | ||
101 | #define DIRECTION(h) ((enum ip_conntrack_dir)(h)->tuple.dst.dir) | ||
102 | |||
103 | /* Connections have two entries in the hash table: one for each way */ | ||
104 | struct ip_conntrack_tuple_hash | ||
105 | { | ||
106 | struct list_head list; | ||
107 | |||
108 | struct ip_conntrack_tuple tuple; | ||
109 | }; | ||
110 | |||
111 | #endif /* __KERNEL__ */ | ||
112 | |||
113 | static inline int ip_ct_tuple_src_equal(const struct ip_conntrack_tuple *t1, | ||
114 | const struct ip_conntrack_tuple *t2) | ||
115 | { | ||
116 | return t1->src.ip == t2->src.ip | ||
117 | && t1->src.u.all == t2->src.u.all; | ||
118 | } | ||
119 | |||
120 | static inline int ip_ct_tuple_dst_equal(const struct ip_conntrack_tuple *t1, | ||
121 | const struct ip_conntrack_tuple *t2) | ||
122 | { | ||
123 | return t1->dst.ip == t2->dst.ip | ||
124 | && t1->dst.u.all == t2->dst.u.all | ||
125 | && t1->dst.protonum == t2->dst.protonum; | ||
126 | } | ||
127 | |||
128 | static inline int ip_ct_tuple_equal(const struct ip_conntrack_tuple *t1, | ||
129 | const struct ip_conntrack_tuple *t2) | ||
130 | { | ||
131 | return ip_ct_tuple_src_equal(t1, t2) && ip_ct_tuple_dst_equal(t1, t2); | ||
132 | } | ||
133 | |||
134 | static inline int ip_ct_tuple_mask_cmp(const struct ip_conntrack_tuple *t, | ||
135 | const struct ip_conntrack_tuple *tuple, | ||
136 | const struct ip_conntrack_tuple *mask) | ||
137 | { | ||
138 | return !(((t->src.ip ^ tuple->src.ip) & mask->src.ip) | ||
139 | || ((t->dst.ip ^ tuple->dst.ip) & mask->dst.ip) | ||
140 | || ((t->src.u.all ^ tuple->src.u.all) & mask->src.u.all) | ||
141 | || ((t->dst.u.all ^ tuple->dst.u.all) & mask->dst.u.all) | ||
142 | || ((t->dst.protonum ^ tuple->dst.protonum) | ||
143 | & mask->dst.protonum)); | ||
144 | } | ||
145 | |||
146 | #endif /* _IP_CONNTRACK_TUPLE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h deleted file mode 100644 index bbca89aab813..000000000000 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ /dev/null | |||
@@ -1,79 +0,0 @@ | |||
1 | #ifndef _IP_NAT_H | ||
2 | #define _IP_NAT_H | ||
3 | #include <linux/netfilter_ipv4.h> | ||
4 | #include <linux/netfilter_ipv4/ip_conntrack_tuple.h> | ||
5 | |||
6 | #define IP_NAT_MAPPING_TYPE_MAX_NAMELEN 16 | ||
7 | |||
8 | enum ip_nat_manip_type | ||
9 | { | ||
10 | IP_NAT_MANIP_SRC, | ||
11 | IP_NAT_MANIP_DST | ||
12 | }; | ||
13 | |||
14 | /* SRC manip occurs POST_ROUTING or LOCAL_IN */ | ||
15 | #define HOOK2MANIP(hooknum) ((hooknum) != NF_IP_POST_ROUTING && (hooknum) != NF_IP_LOCAL_IN) | ||
16 | |||
17 | #define IP_NAT_RANGE_MAP_IPS 1 | ||
18 | #define IP_NAT_RANGE_PROTO_SPECIFIED 2 | ||
19 | #define IP_NAT_RANGE_PROTO_RANDOM 4 /* add randomness to "port" selection */ | ||
20 | |||
21 | /* NAT sequence number modifications */ | ||
22 | struct ip_nat_seq { | ||
23 | /* position of the last TCP sequence number | ||
24 | * modification (if any) */ | ||
25 | u_int32_t correction_pos; | ||
26 | /* sequence number offset before and after last modification */ | ||
27 | int16_t offset_before, offset_after; | ||
28 | }; | ||
29 | |||
30 | /* Single range specification. */ | ||
31 | struct ip_nat_range | ||
32 | { | ||
33 | /* Set to OR of flags above. */ | ||
34 | unsigned int flags; | ||
35 | |||
36 | /* Inclusive: network order. */ | ||
37 | __be32 min_ip, max_ip; | ||
38 | |||
39 | /* Inclusive: network order */ | ||
40 | union ip_conntrack_manip_proto min, max; | ||
41 | }; | ||
42 | |||
43 | /* For backwards compat: don't use in modern code. */ | ||
44 | struct ip_nat_multi_range_compat | ||
45 | { | ||
46 | unsigned int rangesize; /* Must be 1. */ | ||
47 | |||
48 | /* hangs off end. */ | ||
49 | struct ip_nat_range range[1]; | ||
50 | }; | ||
51 | |||
52 | #ifdef __KERNEL__ | ||
53 | #include <linux/list.h> | ||
54 | |||
55 | /* Protects NAT hash tables, and NAT-private part of conntracks. */ | ||
56 | extern rwlock_t ip_nat_lock; | ||
57 | |||
58 | /* The structure embedded in the conntrack structure. */ | ||
59 | struct ip_nat_info | ||
60 | { | ||
61 | struct list_head bysource; | ||
62 | struct ip_nat_seq seq[IP_CT_DIR_MAX]; | ||
63 | }; | ||
64 | |||
65 | struct ip_conntrack; | ||
66 | |||
67 | /* Set up the info structure to map into this range. */ | ||
68 | extern unsigned int ip_nat_setup_info(struct ip_conntrack *conntrack, | ||
69 | const struct ip_nat_range *range, | ||
70 | unsigned int hooknum); | ||
71 | |||
72 | /* Is this tuple already taken? (not by us)*/ | ||
73 | extern int ip_nat_used_tuple(const struct ip_conntrack_tuple *tuple, | ||
74 | const struct ip_conntrack *ignored_conntrack); | ||
75 | |||
76 | #else /* !__KERNEL__: iptables wants this to compile. */ | ||
77 | #define ip_nat_multi_range ip_nat_multi_range_compat | ||
78 | #endif /*__KERNEL__*/ | ||
79 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_core.h b/include/linux/netfilter_ipv4/ip_nat_core.h deleted file mode 100644 index 60566f9fd7b3..000000000000 --- a/include/linux/netfilter_ipv4/ip_nat_core.h +++ /dev/null | |||
@@ -1,18 +0,0 @@ | |||
1 | #ifndef _IP_NAT_CORE_H | ||
2 | #define _IP_NAT_CORE_H | ||
3 | #include <linux/list.h> | ||
4 | #include <linux/netfilter_ipv4/ip_conntrack.h> | ||
5 | |||
6 | /* This header used to share core functionality between the standalone | ||
7 | NAT module, and the compatibility layer's use of NAT for masquerading. */ | ||
8 | |||
9 | extern unsigned int ip_nat_packet(struct ip_conntrack *ct, | ||
10 | enum ip_conntrack_info conntrackinfo, | ||
11 | unsigned int hooknum, | ||
12 | struct sk_buff **pskb); | ||
13 | |||
14 | extern int ip_nat_icmp_reply_translation(struct ip_conntrack *ct, | ||
15 | enum ip_conntrack_info ctinfo, | ||
16 | unsigned int hooknum, | ||
17 | struct sk_buff **pskb); | ||
18 | #endif /* _IP_NAT_CORE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_helper.h b/include/linux/netfilter_ipv4/ip_nat_helper.h deleted file mode 100644 index bf9cb105c885..000000000000 --- a/include/linux/netfilter_ipv4/ip_nat_helper.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | #ifndef _IP_NAT_HELPER_H | ||
2 | #define _IP_NAT_HELPER_H | ||
3 | /* NAT protocol helper routines. */ | ||
4 | |||
5 | #include <linux/netfilter_ipv4/ip_conntrack.h> | ||
6 | #include <linux/module.h> | ||
7 | |||
8 | struct sk_buff; | ||
9 | |||
10 | /* These return true or false. */ | ||
11 | extern int ip_nat_mangle_tcp_packet(struct sk_buff **skb, | ||
12 | struct ip_conntrack *ct, | ||
13 | enum ip_conntrack_info ctinfo, | ||
14 | unsigned int match_offset, | ||
15 | unsigned int match_len, | ||
16 | const char *rep_buffer, | ||
17 | unsigned int rep_len); | ||
18 | extern int ip_nat_mangle_udp_packet(struct sk_buff **skb, | ||
19 | struct ip_conntrack *ct, | ||
20 | enum ip_conntrack_info ctinfo, | ||
21 | unsigned int match_offset, | ||
22 | unsigned int match_len, | ||
23 | const char *rep_buffer, | ||
24 | unsigned int rep_len); | ||
25 | extern int ip_nat_seq_adjust(struct sk_buff **pskb, | ||
26 | struct ip_conntrack *ct, | ||
27 | enum ip_conntrack_info ctinfo); | ||
28 | |||
29 | /* Setup NAT on this expected conntrack so it follows master, but goes | ||
30 | * to port ct->master->saved_proto. */ | ||
31 | extern void ip_nat_follow_master(struct ip_conntrack *ct, | ||
32 | struct ip_conntrack_expect *this); | ||
33 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_pptp.h b/include/linux/netfilter_ipv4/ip_nat_pptp.h deleted file mode 100644 index 36668bf0f373..000000000000 --- a/include/linux/netfilter_ipv4/ip_nat_pptp.h +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | /* PPTP constants and structs */ | ||
2 | #ifndef _NAT_PPTP_H | ||
3 | #define _NAT_PPTP_H | ||
4 | |||
5 | /* conntrack private data */ | ||
6 | struct ip_nat_pptp { | ||
7 | __be16 pns_call_id; /* NAT'ed PNS call id */ | ||
8 | __be16 pac_call_id; /* NAT'ed PAC call id */ | ||
9 | }; | ||
10 | |||
11 | #endif /* _NAT_PPTP_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_protocol.h b/include/linux/netfilter_ipv4/ip_nat_protocol.h deleted file mode 100644 index 612a43614e7b..000000000000 --- a/include/linux/netfilter_ipv4/ip_nat_protocol.h +++ /dev/null | |||
@@ -1,74 +0,0 @@ | |||
1 | /* Header for use in defining a given protocol. */ | ||
2 | #ifndef _IP_NAT_PROTOCOL_H | ||
3 | #define _IP_NAT_PROTOCOL_H | ||
4 | #include <linux/init.h> | ||
5 | #include <linux/list.h> | ||
6 | |||
7 | #include <linux/netfilter_ipv4/ip_nat.h> | ||
8 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
9 | |||
10 | struct iphdr; | ||
11 | struct ip_nat_range; | ||
12 | |||
13 | struct ip_nat_protocol | ||
14 | { | ||
15 | /* Protocol name */ | ||
16 | const char *name; | ||
17 | |||
18 | /* Protocol number. */ | ||
19 | unsigned int protonum; | ||
20 | |||
21 | struct module *me; | ||
22 | |||
23 | /* Translate a packet to the target according to manip type. | ||
24 | Return true if succeeded. */ | ||
25 | int (*manip_pkt)(struct sk_buff **pskb, | ||
26 | unsigned int iphdroff, | ||
27 | const struct ip_conntrack_tuple *tuple, | ||
28 | enum ip_nat_manip_type maniptype); | ||
29 | |||
30 | /* Is the manipable part of the tuple between min and max incl? */ | ||
31 | int (*in_range)(const struct ip_conntrack_tuple *tuple, | ||
32 | enum ip_nat_manip_type maniptype, | ||
33 | const union ip_conntrack_manip_proto *min, | ||
34 | const union ip_conntrack_manip_proto *max); | ||
35 | |||
36 | /* Alter the per-proto part of the tuple (depending on | ||
37 | maniptype), to give a unique tuple in the given range if | ||
38 | possible; return false if not. Per-protocol part of tuple | ||
39 | is initialized to the incoming packet. */ | ||
40 | int (*unique_tuple)(struct ip_conntrack_tuple *tuple, | ||
41 | const struct ip_nat_range *range, | ||
42 | enum ip_nat_manip_type maniptype, | ||
43 | const struct ip_conntrack *conntrack); | ||
44 | |||
45 | int (*range_to_nfattr)(struct sk_buff *skb, | ||
46 | const struct ip_nat_range *range); | ||
47 | |||
48 | int (*nfattr_to_range)(struct nfattr *tb[], | ||
49 | struct ip_nat_range *range); | ||
50 | }; | ||
51 | |||
52 | /* Protocol registration. */ | ||
53 | extern int ip_nat_protocol_register(struct ip_nat_protocol *proto); | ||
54 | extern void ip_nat_protocol_unregister(struct ip_nat_protocol *proto); | ||
55 | |||
56 | extern struct ip_nat_protocol *ip_nat_proto_find_get(u_int8_t protocol); | ||
57 | extern void ip_nat_proto_put(struct ip_nat_protocol *proto); | ||
58 | |||
59 | /* Built-in protocols. */ | ||
60 | extern struct ip_nat_protocol ip_nat_protocol_tcp; | ||
61 | extern struct ip_nat_protocol ip_nat_protocol_udp; | ||
62 | extern struct ip_nat_protocol ip_nat_protocol_icmp; | ||
63 | extern struct ip_nat_protocol ip_nat_unknown_protocol; | ||
64 | |||
65 | extern int init_protocols(void) __init; | ||
66 | extern void cleanup_protocols(void); | ||
67 | extern struct ip_nat_protocol *find_nat_proto(u_int16_t protonum); | ||
68 | |||
69 | extern int ip_nat_port_range_to_nfattr(struct sk_buff *skb, | ||
70 | const struct ip_nat_range *range); | ||
71 | extern int ip_nat_port_nfattr_to_range(struct nfattr *tb[], | ||
72 | struct ip_nat_range *range); | ||
73 | |||
74 | #endif /*_IP_NAT_PROTO_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_rule.h b/include/linux/netfilter_ipv4/ip_nat_rule.h deleted file mode 100644 index 73b9552e6a89..000000000000 --- a/include/linux/netfilter_ipv4/ip_nat_rule.h +++ /dev/null | |||
@@ -1,28 +0,0 @@ | |||
1 | #ifndef _IP_NAT_RULE_H | ||
2 | #define _IP_NAT_RULE_H | ||
3 | #include <linux/netfilter_ipv4/ip_conntrack.h> | ||
4 | #include <linux/netfilter_ipv4/ip_tables.h> | ||
5 | #include <linux/netfilter_ipv4/ip_nat.h> | ||
6 | |||
7 | #ifdef __KERNEL__ | ||
8 | |||
9 | extern int ip_nat_rule_init(void) __init; | ||
10 | extern void ip_nat_rule_cleanup(void); | ||
11 | extern int ip_nat_rule_find(struct sk_buff **pskb, | ||
12 | unsigned int hooknum, | ||
13 | const struct net_device *in, | ||
14 | const struct net_device *out, | ||
15 | struct ip_conntrack *ct, | ||
16 | struct ip_nat_info *info); | ||
17 | |||
18 | extern unsigned int | ||
19 | alloc_null_binding(struct ip_conntrack *conntrack, | ||
20 | struct ip_nat_info *info, | ||
21 | unsigned int hooknum); | ||
22 | |||
23 | extern unsigned int | ||
24 | alloc_null_binding_confirmed(struct ip_conntrack *conntrack, | ||
25 | struct ip_nat_info *info, | ||
26 | unsigned int hooknum); | ||
27 | #endif | ||
28 | #endif /* _IP_NAT_RULE_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_SAME.h b/include/linux/netfilter_ipv4/ipt_SAME.h index cc4c0b2269af..be6e682a85ec 100644 --- a/include/linux/netfilter_ipv4/ipt_SAME.h +++ b/include/linux/netfilter_ipv4/ipt_SAME.h | |||
@@ -13,7 +13,7 @@ struct ipt_same_info | |||
13 | u_int32_t *iparray; | 13 | u_int32_t *iparray; |
14 | 14 | ||
15 | /* hangs off end. */ | 15 | /* hangs off end. */ |
16 | struct ip_nat_range range[IPT_SAME_MAX_RANGE]; | 16 | struct nf_nat_range range[IPT_SAME_MAX_RANGE]; |
17 | }; | 17 | }; |
18 | 18 | ||
19 | #endif /*_IPT_SAME_H*/ | 19 | #endif /*_IPT_SAME_H*/ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 2a20f488ac1b..f41688f56632 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -138,6 +138,11 @@ struct nlattr | |||
138 | #include <linux/capability.h> | 138 | #include <linux/capability.h> |
139 | #include <linux/skbuff.h> | 139 | #include <linux/skbuff.h> |
140 | 140 | ||
141 | static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) | ||
142 | { | ||
143 | return (struct nlmsghdr *)skb->data; | ||
144 | } | ||
145 | |||
141 | struct netlink_skb_parms | 146 | struct netlink_skb_parms |
142 | { | 147 | { |
143 | struct ucred creds; /* Skb credentials */ | 148 | struct ucred creds; /* Skb credentials */ |
@@ -152,7 +157,10 @@ struct netlink_skb_parms | |||
152 | #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) | 157 | #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) |
153 | 158 | ||
154 | 159 | ||
155 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); | 160 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, |
161 | void (*input)(struct sock *sk, int len), | ||
162 | struct mutex *cb_mutex, | ||
163 | struct module *module); | ||
156 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 164 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
157 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | 165 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); |
158 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 166 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
@@ -171,9 +179,16 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb, int protocol); | |||
171 | 179 | ||
172 | /* | 180 | /* |
173 | * skb should fit one page. This choice is good for headerless malloc. | 181 | * skb should fit one page. This choice is good for headerless malloc. |
182 | * But we should limit to 8K so that userspace does not have to | ||
183 | * use enormous buffer sizes on recvmsg() calls just to avoid | ||
184 | * MSG_TRUNC when PAGE_SIZE is very large. | ||
174 | */ | 185 | */ |
175 | #define NLMSG_GOODORDER 0 | 186 | #if PAGE_SIZE < 8192UL |
176 | #define NLMSG_GOODSIZE (SKB_MAX_ORDER(0, NLMSG_GOODORDER)) | 187 | #define NLMSG_GOODSIZE SKB_WITH_OVERHEAD(PAGE_SIZE) |
188 | #else | ||
189 | #define NLMSG_GOODSIZE SKB_WITH_OVERHEAD(8192UL) | ||
190 | #endif | ||
191 | |||
177 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) | 192 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) |
178 | 193 | ||
179 | 194 | ||
@@ -217,18 +232,6 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags) | |||
217 | #define NLMSG_PUT(skb, pid, seq, type, len) \ | 232 | #define NLMSG_PUT(skb, pid, seq, type, len) \ |
218 | NLMSG_NEW(skb, pid, seq, type, len, 0) | 233 | NLMSG_NEW(skb, pid, seq, type, len, 0) |
219 | 234 | ||
220 | #define NLMSG_NEW_ANSWER(skb, cb, type, len, flags) \ | ||
221 | NLMSG_NEW(skb, NETLINK_CB((cb)->skb).pid, \ | ||
222 | (cb)->nlh->nlmsg_seq, type, len, flags) | ||
223 | |||
224 | #define NLMSG_END(skb, nlh) \ | ||
225 | ({ (nlh)->nlmsg_len = (skb)->tail - (unsigned char *) (nlh); \ | ||
226 | (skb)->len; }) | ||
227 | |||
228 | #define NLMSG_CANCEL(skb, nlh) \ | ||
229 | ({ skb_trim(skb, (unsigned char *) (nlh) - (skb)->data); \ | ||
230 | -1; }) | ||
231 | |||
232 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, | 235 | extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, |
233 | struct nlmsghdr *nlh, | 236 | struct nlmsghdr *nlh, |
234 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), | 237 | int (*dump)(struct sk_buff *skb, struct netlink_callback*), |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 47aaa2c66738..e9ae0c6e2c62 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -415,6 +415,7 @@ extern void nfs_complete_unlink(struct dentry *); | |||
415 | /* | 415 | /* |
416 | * linux/fs/nfs/write.c | 416 | * linux/fs/nfs/write.c |
417 | */ | 417 | */ |
418 | extern int nfs_congestion_kb; | ||
418 | extern int nfs_writepage(struct page *page, struct writeback_control *wbc); | 419 | extern int nfs_writepage(struct page *page, struct writeback_control *wbc); |
419 | extern int nfs_writepages(struct address_space *, struct writeback_control *); | 420 | extern int nfs_writepages(struct address_space *, struct writeback_control *); |
420 | extern int nfs_flush_incompatible(struct file *file, struct page *page); | 421 | extern int nfs_flush_incompatible(struct file *file, struct page *page); |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 95796e6924f1..c95d5e642548 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -82,6 +82,7 @@ struct nfs_server { | |||
82 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ | 82 | struct rpc_clnt * client_acl; /* ACL RPC client handle */ |
83 | struct nfs_iostats * io_stats; /* I/O statistics */ | 83 | struct nfs_iostats * io_stats; /* I/O statistics */ |
84 | struct backing_dev_info backing_dev_info; | 84 | struct backing_dev_info backing_dev_info; |
85 | atomic_t writeback; /* number of writeback pages */ | ||
85 | int flags; /* various flags */ | 86 | int flags; /* various flags */ |
86 | unsigned int caps; /* server capabilities */ | 87 | unsigned int caps; /* server capabilities */ |
87 | unsigned int rsize; /* read size */ | 88 | unsigned int rsize; /* read size */ |
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h index 2e555d49c9b7..16b0266b14fd 100644 --- a/include/linux/nfs_page.h +++ b/include/linux/nfs_page.h | |||
@@ -31,7 +31,6 @@ | |||
31 | #define PG_NEED_COMMIT 1 | 31 | #define PG_NEED_COMMIT 1 |
32 | #define PG_NEED_RESCHED 2 | 32 | #define PG_NEED_RESCHED 2 |
33 | #define PG_NEED_FLUSH 3 | 33 | #define PG_NEED_FLUSH 3 |
34 | #define PG_FLUSHING 4 | ||
35 | 34 | ||
36 | struct nfs_inode; | 35 | struct nfs_inode; |
37 | struct nfs_page { | 36 | struct nfs_page { |
@@ -50,8 +49,6 @@ struct nfs_page { | |||
50 | }; | 49 | }; |
51 | 50 | ||
52 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) | 51 | #define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) |
53 | #define NFS_NEED_COMMIT(req) (test_bit(PG_NEED_COMMIT,&(req)->wb_flags)) | ||
54 | #define NFS_NEED_RESCHED(req) (test_bit(PG_NEED_RESCHED,&(req)->wb_flags)) | ||
55 | 52 | ||
56 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, | 53 | extern struct nfs_page *nfs_create_request(struct nfs_open_context *ctx, |
57 | struct inode *inode, | 54 | struct inode *inode, |
@@ -122,34 +119,6 @@ nfs_list_remove_request(struct nfs_page *req) | |||
122 | req->wb_list_head = NULL; | 119 | req->wb_list_head = NULL; |
123 | } | 120 | } |
124 | 121 | ||
125 | static inline int | ||
126 | nfs_defer_commit(struct nfs_page *req) | ||
127 | { | ||
128 | return !test_and_set_bit(PG_NEED_COMMIT, &req->wb_flags); | ||
129 | } | ||
130 | |||
131 | static inline void | ||
132 | nfs_clear_commit(struct nfs_page *req) | ||
133 | { | ||
134 | smp_mb__before_clear_bit(); | ||
135 | clear_bit(PG_NEED_COMMIT, &req->wb_flags); | ||
136 | smp_mb__after_clear_bit(); | ||
137 | } | ||
138 | |||
139 | static inline int | ||
140 | nfs_defer_reschedule(struct nfs_page *req) | ||
141 | { | ||
142 | return !test_and_set_bit(PG_NEED_RESCHED, &req->wb_flags); | ||
143 | } | ||
144 | |||
145 | static inline void | ||
146 | nfs_clear_reschedule(struct nfs_page *req) | ||
147 | { | ||
148 | smp_mb__before_clear_bit(); | ||
149 | clear_bit(PG_NEED_RESCHED, &req->wb_flags); | ||
150 | smp_mb__after_clear_bit(); | ||
151 | } | ||
152 | |||
153 | static inline struct nfs_page * | 122 | static inline struct nfs_page * |
154 | nfs_list_entry(struct list_head *head) | 123 | nfs_list_entry(struct list_head *head) |
155 | { | 124 | { |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h new file mode 100644 index 000000000000..9a30ba2ca75e --- /dev/null +++ b/include/linux/nl80211.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef __LINUX_NL80211_H | ||
2 | #define __LINUX_NL80211_H | ||
3 | /* | ||
4 | * 802.11 netlink interface public header | ||
5 | * | ||
6 | * Copyright 2006, 2007 Johannes Berg <johannes@sipsolutions.net> | ||
7 | */ | ||
8 | |||
9 | /** | ||
10 | * enum nl80211_iftype - (virtual) interface types | ||
11 | * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides | ||
12 | * @NL80211_IFTYPE_ADHOC: independent BSS member | ||
13 | * @NL80211_IFTYPE_STATION: managed BSS member | ||
14 | * @NL80211_IFTYPE_AP: access point | ||
15 | * @NL80211_IFTYPE_AP_VLAN: VLAN interface for access points | ||
16 | * @NL80211_IFTYPE_WDS: wireless distribution interface | ||
17 | * @NL80211_IFTYPE_MONITOR: monitor interface receiving all frames | ||
18 | * @__NL80211_IFTYPE_AFTER_LAST: internal use | ||
19 | * | ||
20 | * These values are used with the NL80211_ATTR_IFTYPE | ||
21 | * to set the type of an interface. | ||
22 | * | ||
23 | */ | ||
24 | enum nl80211_iftype { | ||
25 | NL80211_IFTYPE_UNSPECIFIED, | ||
26 | NL80211_IFTYPE_ADHOC, | ||
27 | NL80211_IFTYPE_STATION, | ||
28 | NL80211_IFTYPE_AP, | ||
29 | NL80211_IFTYPE_AP_VLAN, | ||
30 | NL80211_IFTYPE_WDS, | ||
31 | NL80211_IFTYPE_MONITOR, | ||
32 | |||
33 | /* keep last */ | ||
34 | __NL80211_IFTYPE_AFTER_LAST | ||
35 | }; | ||
36 | #define NL80211_IFTYPE_MAX (__NL80211_IFTYPE_AFTER_LAST - 1) | ||
37 | |||
38 | #endif /* __LINUX_NL80211_H */ | ||
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index b1063e9cdb1b..52c54a5720f3 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -352,7 +352,7 @@ extern nodemask_t node_possible_map; | |||
352 | #define node_possible(node) node_isset((node), node_possible_map) | 352 | #define node_possible(node) node_isset((node), node_possible_map) |
353 | #define first_online_node first_node(node_online_map) | 353 | #define first_online_node first_node(node_online_map) |
354 | #define next_online_node(nid) next_node((nid), node_online_map) | 354 | #define next_online_node(nid) next_node((nid), node_online_map) |
355 | int highest_possible_node_id(void); | 355 | extern int nr_node_ids; |
356 | #else | 356 | #else |
357 | #define num_online_nodes() 1 | 357 | #define num_online_nodes() 1 |
358 | #define num_possible_nodes() 1 | 358 | #define num_possible_nodes() 1 |
@@ -360,7 +360,7 @@ int highest_possible_node_id(void); | |||
360 | #define node_possible(node) ((node) == 0) | 360 | #define node_possible(node) ((node) == 0) |
361 | #define first_online_node 0 | 361 | #define first_online_node 0 |
362 | #define next_online_node(nid) (MAX_NUMNODES) | 362 | #define next_online_node(nid) (MAX_NUMNODES) |
363 | #define highest_possible_node_id() 0 | 363 | #define nr_node_ids 1 |
364 | #endif | 364 | #endif |
365 | 365 | ||
366 | #define any_online_node(mask) \ | 366 | #define any_online_node(mask) \ |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 350878a2d848..96326594e55d 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -76,7 +76,7 @@ | |||
76 | #define PG_active 6 | 76 | #define PG_active 6 |
77 | #define PG_slab 7 /* slab debug (Suparna wants this) */ | 77 | #define PG_slab 7 /* slab debug (Suparna wants this) */ |
78 | 78 | ||
79 | #define PG_checked 8 /* kill me in 2.5.<early>. */ | 79 | #define PG_owner_priv_1 8 /* Owner use. If pagecache, fs may use*/ |
80 | #define PG_arch_1 9 | 80 | #define PG_arch_1 9 |
81 | #define PG_reserved 10 | 81 | #define PG_reserved 10 |
82 | #define PG_private 11 /* If pagecache, has fs-private data */ | 82 | #define PG_private 11 /* If pagecache, has fs-private data */ |
@@ -91,6 +91,8 @@ | |||
91 | #define PG_nosave_free 18 /* Used for system suspend/resume */ | 91 | #define PG_nosave_free 18 /* Used for system suspend/resume */ |
92 | #define PG_buddy 19 /* Page is free, on buddy lists */ | 92 | #define PG_buddy 19 /* Page is free, on buddy lists */ |
93 | 93 | ||
94 | /* PG_owner_priv_1 users should have descriptive aliases */ | ||
95 | #define PG_checked PG_owner_priv_1 /* Used by some filesystems */ | ||
94 | 96 | ||
95 | #if (BITS_PER_LONG > 32) | 97 | #if (BITS_PER_LONG > 32) |
96 | /* | 98 | /* |
@@ -131,7 +133,7 @@ | |||
131 | static inline void SetPageUptodate(struct page *page) | 133 | static inline void SetPageUptodate(struct page *page) |
132 | { | 134 | { |
133 | if (!test_and_set_bit(PG_uptodate, &page->flags)) | 135 | if (!test_and_set_bit(PG_uptodate, &page->flags)) |
134 | page_test_and_clear_dirty(page); | 136 | page_clear_dirty(page); |
135 | } | 137 | } |
136 | #else | 138 | #else |
137 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 139 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 98c8765a488e..972491089ac9 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -209,11 +209,6 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | |||
209 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | 209 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); |
210 | } | 210 | } |
211 | 211 | ||
212 | static inline void pci_remove_saved_cap(struct pci_cap_saved_state *cap) | ||
213 | { | ||
214 | hlist_del(&cap->next); | ||
215 | } | ||
216 | |||
217 | /* | 212 | /* |
218 | * For PCI devices, the region numbers are assigned this way: | 213 | * For PCI devices, the region numbers are assigned this way: |
219 | * | 214 | * |
@@ -366,8 +361,6 @@ struct pci_driver { | |||
366 | struct pci_error_handlers *err_handler; | 361 | struct pci_error_handlers *err_handler; |
367 | struct device_driver driver; | 362 | struct device_driver driver; |
368 | struct pci_dynids dynids; | 363 | struct pci_dynids dynids; |
369 | |||
370 | int multithread_probe; | ||
371 | }; | 364 | }; |
372 | 365 | ||
373 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) | 366 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) |
@@ -543,6 +536,7 @@ void pci_set_master(struct pci_dev *dev); | |||
543 | int __must_check pci_set_mwi(struct pci_dev *dev); | 536 | int __must_check pci_set_mwi(struct pci_dev *dev); |
544 | void pci_clear_mwi(struct pci_dev *dev); | 537 | void pci_clear_mwi(struct pci_dev *dev); |
545 | void pci_intx(struct pci_dev *dev, int enable); | 538 | void pci_intx(struct pci_dev *dev, int enable); |
539 | void pci_msi_off(struct pci_dev *dev); | ||
546 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 540 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
547 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 541 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
548 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 542 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
@@ -844,6 +838,7 @@ void __iomem * pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | |||
844 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | 838 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); |
845 | void __iomem * const * pcim_iomap_table(struct pci_dev *pdev); | 839 | void __iomem * const * pcim_iomap_table(struct pci_dev *pdev); |
846 | int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); | 840 | int pcim_iomap_regions(struct pci_dev *pdev, u16 mask, const char *name); |
841 | void pcim_iounmap_regions(struct pci_dev *pdev, u16 mask); | ||
847 | 842 | ||
848 | extern int pci_pci_problems; | 843 | extern int pci_pci_problems; |
849 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ | 844 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
@@ -854,5 +849,8 @@ extern int pci_pci_problems; | |||
854 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ | 849 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ |
855 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ | 850 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ |
856 | 851 | ||
852 | extern unsigned long pci_cardbus_io_size; | ||
853 | extern unsigned long pci_cardbus_mem_size; | ||
854 | |||
857 | #endif /* __KERNEL__ */ | 855 | #endif /* __KERNEL__ */ |
858 | #endif /* LINUX_PCI_H */ | 856 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 182a96f77c84..1b0ddbb8a804 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -368,7 +368,6 @@ | |||
368 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 | 368 | #define PCI_DEVICE_ID_ATI_IXP400_SATA 0x4379 |
369 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a | 369 | #define PCI_DEVICE_ID_ATI_IXP400_SATA2 0x437a |
370 | #define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 | 370 | #define PCI_DEVICE_ID_ATI_IXP600_SATA 0x4380 |
371 | #define PCI_DEVICE_ID_ATI_IXP600_SRAID 0x4381 | ||
372 | #define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 | 371 | #define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 |
373 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c | 372 | #define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c |
374 | 373 | ||
@@ -1459,6 +1458,8 @@ | |||
1459 | 1458 | ||
1460 | #define PCI_VENDOR_ID_TOSHIBA_2 0x102f | 1459 | #define PCI_VENDOR_ID_TOSHIBA_2 0x102f |
1461 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 | 1460 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 |
1461 | #define PCI_DEVICE_ID_TOSHIBA_TC35815_NWU 0x0031 | ||
1462 | #define PCI_DEVICE_ID_TOSHIBA_TC35815_TX4939 0x0032 | ||
1462 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE 0x0105 | 1463 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_IDE 0x0105 |
1463 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 | 1464 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 |
1464 | #define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 | 1465 | #define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 |
@@ -2089,6 +2090,7 @@ | |||
2089 | #define PCI_VENDOR_ID_PASEMI 0x1959 | 2090 | #define PCI_VENDOR_ID_PASEMI 0x1959 |
2090 | 2091 | ||
2091 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 | 2092 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 |
2093 | #define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 | ||
2092 | 2094 | ||
2093 | #define PCI_VENDOR_ID_JMICRON 0x197B | 2095 | #define PCI_VENDOR_ID_JMICRON 0x197B |
2094 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 | 2096 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 7a6d34ee5ab1..495d368390e0 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -292,9 +292,11 @@ | |||
292 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ | 292 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ |
293 | #define PCI_MSI_MASK_BIT 16 /* Mask bits register */ | 293 | #define PCI_MSI_MASK_BIT 16 /* Mask bits register */ |
294 | 294 | ||
295 | /* MSI-X registers (these are at offset PCI_MSI_FLAGS) */ | 295 | /* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ |
296 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF | 296 | #define PCI_MSIX_FLAGS 2 |
297 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | 297 | #define PCI_MSIX_FLAGS_QSIZE 0x7FF |
298 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | ||
299 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) | ||
298 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 300 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
299 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) | 301 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) |
300 | 302 | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index edd4c88ca7d8..2a659789f9ca 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -55,6 +55,7 @@ typedef enum { | |||
55 | PHY_INTERFACE_MODE_TBI, | 55 | PHY_INTERFACE_MODE_TBI, |
56 | PHY_INTERFACE_MODE_RMII, | 56 | PHY_INTERFACE_MODE_RMII, |
57 | PHY_INTERFACE_MODE_RGMII, | 57 | PHY_INTERFACE_MODE_RGMII, |
58 | PHY_INTERFACE_MODE_RGMII_ID, | ||
58 | PHY_INTERFACE_MODE_RTBI | 59 | PHY_INTERFACE_MODE_RTBI |
59 | } phy_interface_t; | 60 | } phy_interface_t; |
60 | 61 | ||
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 2e19478e9e84..8bcbc54e1b48 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -99,4 +99,8 @@ extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | |||
99 | loff_t *, size_t, unsigned int, | 99 | loff_t *, size_t, unsigned int, |
100 | splice_actor *); | 100 | splice_actor *); |
101 | 101 | ||
102 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, struct file *, | ||
103 | loff_t *, size_t, unsigned int, | ||
104 | splice_actor *); | ||
105 | |||
102 | #endif | 106 | #endif |
diff --git a/include/linux/plist.h b/include/linux/plist.h index b95818a037ad..85de2f055874 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
@@ -97,9 +97,9 @@ struct plist_node { | |||
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | /** | 99 | /** |
100 | * #PLIST_HEAD_INIT - static struct plist_head initializer | 100 | * PLIST_HEAD_INIT - static struct plist_head initializer |
101 | * | ||
102 | * @head: struct plist_head variable name | 101 | * @head: struct plist_head variable name |
102 | * @_lock: lock to initialize for this list | ||
103 | */ | 103 | */ |
104 | #define PLIST_HEAD_INIT(head, _lock) \ | 104 | #define PLIST_HEAD_INIT(head, _lock) \ |
105 | { \ | 105 | { \ |
@@ -109,8 +109,7 @@ struct plist_node { | |||
109 | } | 109 | } |
110 | 110 | ||
111 | /** | 111 | /** |
112 | * #PLIST_NODE_INIT - static struct plist_node initializer | 112 | * PLIST_NODE_INIT - static struct plist_node initializer |
113 | * | ||
114 | * @node: struct plist_node variable name | 113 | * @node: struct plist_node variable name |
115 | * @__prio: initial node priority | 114 | * @__prio: initial node priority |
116 | */ | 115 | */ |
@@ -122,8 +121,8 @@ struct plist_node { | |||
122 | 121 | ||
123 | /** | 122 | /** |
124 | * plist_head_init - dynamic struct plist_head initializer | 123 | * plist_head_init - dynamic struct plist_head initializer |
125 | * | ||
126 | * @head: &struct plist_head pointer | 124 | * @head: &struct plist_head pointer |
125 | * @lock: list spinlock, remembered for debugging | ||
127 | */ | 126 | */ |
128 | static inline void | 127 | static inline void |
129 | plist_head_init(struct plist_head *head, spinlock_t *lock) | 128 | plist_head_init(struct plist_head *head, spinlock_t *lock) |
@@ -137,7 +136,6 @@ plist_head_init(struct plist_head *head, spinlock_t *lock) | |||
137 | 136 | ||
138 | /** | 137 | /** |
139 | * plist_node_init - Dynamic struct plist_node initializer | 138 | * plist_node_init - Dynamic struct plist_node initializer |
140 | * | ||
141 | * @node: &struct plist_node pointer | 139 | * @node: &struct plist_node pointer |
142 | * @prio: initial node priority | 140 | * @prio: initial node priority |
143 | */ | 141 | */ |
@@ -152,49 +150,46 @@ extern void plist_del(struct plist_node *node, struct plist_head *head); | |||
152 | 150 | ||
153 | /** | 151 | /** |
154 | * plist_for_each - iterate over the plist | 152 | * plist_for_each - iterate over the plist |
155 | * | 153 | * @pos: the type * to use as a loop counter |
156 | * @pos1: the type * to use as a loop counter. | 154 | * @head: the head for your list |
157 | * @head: the head for your list. | ||
158 | */ | 155 | */ |
159 | #define plist_for_each(pos, head) \ | 156 | #define plist_for_each(pos, head) \ |
160 | list_for_each_entry(pos, &(head)->node_list, plist.node_list) | 157 | list_for_each_entry(pos, &(head)->node_list, plist.node_list) |
161 | 158 | ||
162 | /** | 159 | /** |
163 | * plist_for_each_entry_safe - iterate over a plist of given type safe | 160 | * plist_for_each_safe - iterate safely over a plist of given type |
164 | * against removal of list entry | 161 | * @pos: the type * to use as a loop counter |
162 | * @n: another type * to use as temporary storage | ||
163 | * @head: the head for your list | ||
165 | * | 164 | * |
166 | * @pos1: the type * to use as a loop counter. | 165 | * Iterate over a plist of given type, safe against removal of list entry. |
167 | * @n1: another type * to use as temporary storage | ||
168 | * @head: the head for your list. | ||
169 | */ | 166 | */ |
170 | #define plist_for_each_safe(pos, n, head) \ | 167 | #define plist_for_each_safe(pos, n, head) \ |
171 | list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list) | 168 | list_for_each_entry_safe(pos, n, &(head)->node_list, plist.node_list) |
172 | 169 | ||
173 | /** | 170 | /** |
174 | * plist_for_each_entry - iterate over list of given type | 171 | * plist_for_each_entry - iterate over list of given type |
175 | * | 172 | * @pos: the type * to use as a loop counter |
176 | * @pos: the type * to use as a loop counter. | 173 | * @head: the head for your list |
177 | * @head: the head for your list. | 174 | * @mem: the name of the list_struct within the struct |
178 | * @member: the name of the list_struct within the struct. | ||
179 | */ | 175 | */ |
180 | #define plist_for_each_entry(pos, head, mem) \ | 176 | #define plist_for_each_entry(pos, head, mem) \ |
181 | list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list) | 177 | list_for_each_entry(pos, &(head)->node_list, mem.plist.node_list) |
182 | 178 | ||
183 | /** | 179 | /** |
184 | * plist_for_each_entry_safe - iterate over list of given type safe against | 180 | * plist_for_each_entry_safe - iterate safely over list of given type |
185 | * removal of list entry | 181 | * @pos: the type * to use as a loop counter |
186 | * | ||
187 | * @pos: the type * to use as a loop counter. | ||
188 | * @n: another type * to use as temporary storage | 182 | * @n: another type * to use as temporary storage |
189 | * @head: the head for your list. | 183 | * @head: the head for your list |
190 | * @m: the name of the list_struct within the struct. | 184 | * @m: the name of the list_struct within the struct |
185 | * | ||
186 | * Iterate over list of given type, safe against removal of list entry. | ||
191 | */ | 187 | */ |
192 | #define plist_for_each_entry_safe(pos, n, head, m) \ | 188 | #define plist_for_each_entry_safe(pos, n, head, m) \ |
193 | list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list) | 189 | list_for_each_entry_safe(pos, n, &(head)->node_list, m.plist.node_list) |
194 | 190 | ||
195 | /** | 191 | /** |
196 | * plist_head_empty - return !0 if a plist_head is empty | 192 | * plist_head_empty - return !0 if a plist_head is empty |
197 | * | ||
198 | * @head: &struct plist_head pointer | 193 | * @head: &struct plist_head pointer |
199 | */ | 194 | */ |
200 | static inline int plist_head_empty(const struct plist_head *head) | 195 | static inline int plist_head_empty(const struct plist_head *head) |
@@ -204,7 +199,6 @@ static inline int plist_head_empty(const struct plist_head *head) | |||
204 | 199 | ||
205 | /** | 200 | /** |
206 | * plist_node_empty - return !0 if plist_node is not on a list | 201 | * plist_node_empty - return !0 if plist_node is not on a list |
207 | * | ||
208 | * @node: &struct plist_node pointer | 202 | * @node: &struct plist_node pointer |
209 | */ | 203 | */ |
210 | static inline int plist_node_empty(const struct plist_node *node) | 204 | static inline int plist_node_empty(const struct plist_node *node) |
@@ -216,10 +210,9 @@ static inline int plist_node_empty(const struct plist_node *node) | |||
216 | 210 | ||
217 | /** | 211 | /** |
218 | * plist_first_entry - get the struct for the first entry | 212 | * plist_first_entry - get the struct for the first entry |
219 | * | 213 | * @head: the &struct plist_head pointer |
220 | * @ptr: the &struct plist_head pointer. | 214 | * @type: the type of the struct this is embedded in |
221 | * @type: the type of the struct this is embedded in. | 215 | * @member: the name of the list_struct within the struct |
222 | * @member: the name of the list_struct within the struct. | ||
223 | */ | 216 | */ |
224 | #ifdef CONFIG_DEBUG_PI_LIST | 217 | #ifdef CONFIG_DEBUG_PI_LIST |
225 | # define plist_first_entry(head, type, member) \ | 218 | # define plist_first_entry(head, type, member) \ |
@@ -234,7 +227,6 @@ static inline int plist_node_empty(const struct plist_node *node) | |||
234 | 227 | ||
235 | /** | 228 | /** |
236 | * plist_first - return the first node (and thus, highest priority) | 229 | * plist_first - return the first node (and thus, highest priority) |
237 | * | ||
238 | * @head: the &struct plist_head pointer | 230 | * @head: the &struct plist_head pointer |
239 | * | 231 | * |
240 | * Assumes the plist is _not_ empty. | 232 | * Assumes the plist is _not_ empty. |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 070394e846d0..6e8fa3049e5d 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -112,26 +112,81 @@ typedef int __bitwise suspend_state_t; | |||
112 | 112 | ||
113 | typedef int __bitwise suspend_disk_method_t; | 113 | typedef int __bitwise suspend_disk_method_t; |
114 | 114 | ||
115 | #define PM_DISK_FIRMWARE ((__force suspend_disk_method_t) 1) | 115 | /* invalid must be 0 so struct pm_ops initialisers can leave it out */ |
116 | #define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 2) | 116 | #define PM_DISK_INVALID ((__force suspend_disk_method_t) 0) |
117 | #define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 3) | 117 | #define PM_DISK_PLATFORM ((__force suspend_disk_method_t) 1) |
118 | #define PM_DISK_REBOOT ((__force suspend_disk_method_t) 4) | 118 | #define PM_DISK_SHUTDOWN ((__force suspend_disk_method_t) 2) |
119 | #define PM_DISK_TEST ((__force suspend_disk_method_t) 5) | 119 | #define PM_DISK_REBOOT ((__force suspend_disk_method_t) 3) |
120 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 6) | 120 | #define PM_DISK_TEST ((__force suspend_disk_method_t) 4) |
121 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 7) | 121 | #define PM_DISK_TESTPROC ((__force suspend_disk_method_t) 5) |
122 | 122 | #define PM_DISK_MAX ((__force suspend_disk_method_t) 6) | |
123 | |||
124 | /** | ||
125 | * struct pm_ops - Callbacks for managing platform dependent suspend states. | ||
126 | * @valid: Callback to determine whether the given state can be entered. | ||
127 | * If %CONFIG_SOFTWARE_SUSPEND is set then %PM_SUSPEND_DISK is | ||
128 | * always valid and never passed to this call. If not assigned, | ||
129 | * no suspend states are valid. | ||
130 | * Valid states are advertised in /sys/power/state but can still | ||
131 | * be rejected by prepare or enter if the conditions aren't right. | ||
132 | * There is a %pm_valid_only_mem function available that can be assigned | ||
133 | * to this if you only implement mem sleep. | ||
134 | * | ||
135 | * @prepare: Prepare the platform for the given suspend state. Can return a | ||
136 | * negative error code if necessary. | ||
137 | * | ||
138 | * @enter: Enter the given suspend state, must be assigned. Can return a | ||
139 | * negative error code if necessary. | ||
140 | * | ||
141 | * @finish: Called when the system has left the given state and all devices | ||
142 | * are resumed. The return value is ignored. | ||
143 | * | ||
144 | * @pm_disk_mode: The generic code always allows one of the shutdown methods | ||
145 | * %PM_DISK_SHUTDOWN, %PM_DISK_REBOOT, %PM_DISK_TEST and | ||
146 | * %PM_DISK_TESTPROC. If this variable is set, the mode it is set | ||
147 | * to is allowed in addition to those modes and is also made default. | ||
148 | * When this mode is sent selected, the @prepare call will be called | ||
149 | * before suspending to disk (if present), the @enter call should be | ||
150 | * present and will be called after all state has been saved and the | ||
151 | * machine is ready to be powered off; the @finish callback is called | ||
152 | * after state has been restored. All these calls are called with | ||
153 | * %PM_SUSPEND_DISK as the state. | ||
154 | */ | ||
123 | struct pm_ops { | 155 | struct pm_ops { |
124 | suspend_disk_method_t pm_disk_mode; | ||
125 | int (*valid)(suspend_state_t state); | 156 | int (*valid)(suspend_state_t state); |
126 | int (*prepare)(suspend_state_t state); | 157 | int (*prepare)(suspend_state_t state); |
127 | int (*enter)(suspend_state_t state); | 158 | int (*enter)(suspend_state_t state); |
128 | int (*finish)(suspend_state_t state); | 159 | int (*finish)(suspend_state_t state); |
160 | suspend_disk_method_t pm_disk_mode; | ||
129 | }; | 161 | }; |
130 | 162 | ||
131 | extern void pm_set_ops(struct pm_ops *); | 163 | /** |
164 | * pm_set_ops - set platform dependent power management ops | ||
165 | * @pm_ops: The new power management operations to set. | ||
166 | */ | ||
167 | extern void pm_set_ops(struct pm_ops *pm_ops); | ||
132 | extern struct pm_ops *pm_ops; | 168 | extern struct pm_ops *pm_ops; |
133 | extern int pm_suspend(suspend_state_t state); | 169 | extern int pm_suspend(suspend_state_t state); |
134 | 170 | ||
171 | extern int pm_valid_only_mem(suspend_state_t state); | ||
172 | |||
173 | /** | ||
174 | * arch_suspend_disable_irqs - disable IRQs for suspend | ||
175 | * | ||
176 | * Disables IRQs (in the default case). This is a weak symbol in the common | ||
177 | * code and thus allows architectures to override it if more needs to be | ||
178 | * done. Not called for suspend to disk. | ||
179 | */ | ||
180 | extern void arch_suspend_disable_irqs(void); | ||
181 | |||
182 | /** | ||
183 | * arch_suspend_enable_irqs - enable IRQs after suspend | ||
184 | * | ||
185 | * Enables IRQs (in the default case). This is a weak symbol in the common | ||
186 | * code and thus allows architectures to override it if more needs to be | ||
187 | * done. Not called for suspend to disk. | ||
188 | */ | ||
189 | extern void arch_suspend_enable_irqs(void); | ||
135 | 190 | ||
136 | /* | 191 | /* |
137 | * Device power management | 192 | * Device power management |
@@ -240,6 +295,20 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
240 | __suspend_report_result(__FUNCTION__, fn, ret); \ | 295 | __suspend_report_result(__FUNCTION__, fn, ret); \ |
241 | } while (0) | 296 | } while (0) |
242 | 297 | ||
298 | /* | ||
299 | * Platform hook to activate device wakeup capability, if that's not already | ||
300 | * handled by enable_irq_wake() etc. | ||
301 | * Returns zero on success, else negative errno | ||
302 | */ | ||
303 | extern int (*platform_enable_wakeup)(struct device *dev, int is_on); | ||
304 | |||
305 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
306 | { | ||
307 | if (platform_enable_wakeup) | ||
308 | return (*platform_enable_wakeup)(dev, is_on); | ||
309 | return 0; | ||
310 | } | ||
311 | |||
243 | #else /* !CONFIG_PM */ | 312 | #else /* !CONFIG_PM */ |
244 | 313 | ||
245 | static inline int device_suspend(pm_message_t state) | 314 | static inline int device_suspend(pm_message_t state) |
@@ -261,6 +330,11 @@ static inline void dpm_runtime_resume(struct device * dev) | |||
261 | 330 | ||
262 | #define suspend_report_result(fn, ret) do { } while (0) | 331 | #define suspend_report_result(fn, ret) do { } while (0) |
263 | 332 | ||
333 | static inline int call_platform_enable_wakeup(struct device *dev, int is_on) | ||
334 | { | ||
335 | return 0; | ||
336 | } | ||
337 | |||
264 | #endif | 338 | #endif |
265 | 339 | ||
266 | /* changes to device_may_wakeup take effect on the next pm state change. | 340 | /* changes to device_may_wakeup take effect on the next pm state change. |
diff --git a/include/linux/pmu.h b/include/linux/pmu.h index 783177387ac6..b0952e532ed5 100644 --- a/include/linux/pmu.h +++ b/include/linux/pmu.h | |||
@@ -168,24 +168,16 @@ extern int pmu_get_model(void); | |||
168 | 168 | ||
169 | struct pmu_sleep_notifier | 169 | struct pmu_sleep_notifier |
170 | { | 170 | { |
171 | int (*notifier_call)(struct pmu_sleep_notifier *self, int when); | 171 | void (*notifier_call)(struct pmu_sleep_notifier *self, int when); |
172 | int priority; | 172 | int priority; |
173 | struct list_head list; | 173 | struct list_head list; |
174 | }; | 174 | }; |
175 | 175 | ||
176 | /* Code values for calling sleep/wakeup handlers | 176 | /* Code values for calling sleep/wakeup handlers |
177 | * | ||
178 | * Note: If a sleep request got cancelled, all drivers will get | ||
179 | * the PBOOK_SLEEP_REJECT, even those who didn't get the PBOOK_SLEEP_REQUEST. | ||
180 | */ | 177 | */ |
181 | #define PBOOK_SLEEP_REQUEST 1 | 178 | #define PBOOK_SLEEP_REQUEST 1 |
182 | #define PBOOK_SLEEP_NOW 2 | 179 | #define PBOOK_SLEEP_NOW 2 |
183 | #define PBOOK_SLEEP_REJECT 3 | 180 | #define PBOOK_WAKE 3 |
184 | #define PBOOK_WAKE 4 | ||
185 | |||
186 | /* Result codes returned by the notifiers */ | ||
187 | #define PBOOK_SLEEP_OK 0 | ||
188 | #define PBOOK_SLEEP_REFUSE -1 | ||
189 | 181 | ||
190 | /* priority levels in notifiers */ | 182 | /* priority levels in notifiers */ |
191 | #define SLEEP_LEVEL_VIDEO 100 /* Video driver (first wake) */ | 183 | #define SLEEP_LEVEL_VIDEO 100 /* Video driver (first wake) */ |
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index 8245c282168b..de72c49747c8 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -104,6 +104,7 @@ struct mdk_rdev_s | |||
104 | * for reporting to userspace and storing | 104 | * for reporting to userspace and storing |
105 | * in superblock. | 105 | * in superblock. |
106 | */ | 106 | */ |
107 | struct work_struct del_work; /* used for delayed sysfs removal */ | ||
107 | }; | 108 | }; |
108 | 109 | ||
109 | struct mddev_s | 110 | struct mddev_s |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 4a629ea70cc4..1fae30af91f3 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -574,13 +574,6 @@ extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, in | |||
574 | #define rtattr_parse_nested(tb, max, rta) \ | 574 | #define rtattr_parse_nested(tb, max, rta) \ |
575 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) | 575 | rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) |
576 | 576 | ||
577 | struct rtnetlink_link | ||
578 | { | ||
579 | int (*doit)(struct sk_buff *, struct nlmsghdr*, void *attr); | ||
580 | int (*dumpit)(struct sk_buff *, struct netlink_callback *cb); | ||
581 | }; | ||
582 | |||
583 | extern struct rtnetlink_link * rtnetlink_links[NPROTO]; | ||
584 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); | 577 | extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); |
585 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); | 578 | extern int rtnl_unicast(struct sk_buff *skb, u32 pid); |
586 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, | 579 | extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, |
@@ -605,7 +598,7 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi | |||
605 | 598 | ||
606 | #define RTA_PUT_NOHDR(skb, attrlen, data) \ | 599 | #define RTA_PUT_NOHDR(skb, attrlen, data) \ |
607 | ({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \ | 600 | ({ RTA_APPEND(skb, RTA_ALIGN(attrlen), data); \ |
608 | memset(skb->tail - (RTA_ALIGN(attrlen) - attrlen), 0, \ | 601 | memset(skb_tail_pointer(skb) - (RTA_ALIGN(attrlen) - attrlen), 0, \ |
609 | RTA_ALIGN(attrlen) - attrlen); }) | 602 | RTA_ALIGN(attrlen) - attrlen); }) |
610 | 603 | ||
611 | #define RTA_PUT_U8(skb, attrtype, value) \ | 604 | #define RTA_PUT_U8(skb, attrtype, value) \ |
@@ -637,12 +630,12 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi | |||
637 | RTA_PUT(skb, attrtype, 0, NULL); | 630 | RTA_PUT(skb, attrtype, 0, NULL); |
638 | 631 | ||
639 | #define RTA_NEST(skb, type) \ | 632 | #define RTA_NEST(skb, type) \ |
640 | ({ struct rtattr *__start = (struct rtattr *) (skb)->tail; \ | 633 | ({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \ |
641 | RTA_PUT(skb, type, 0, NULL); \ | 634 | RTA_PUT(skb, type, 0, NULL); \ |
642 | __start; }) | 635 | __start; }) |
643 | 636 | ||
644 | #define RTA_NEST_END(skb, start) \ | 637 | #define RTA_NEST_END(skb, start) \ |
645 | ({ (start)->rta_len = ((skb)->tail - (unsigned char *) (start)); \ | 638 | ({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ |
646 | (skb)->len; }) | 639 | (skb)->len; }) |
647 | 640 | ||
648 | #define RTA_NEST_CANCEL(skb, start) \ | 641 | #define RTA_NEST_CANCEL(skb, start) \ |
diff --git a/include/linux/rxrpc.h b/include/linux/rxrpc.h new file mode 100644 index 000000000000..f7b826b565c7 --- /dev/null +++ b/include/linux/rxrpc.h | |||
@@ -0,0 +1,62 @@ | |||
1 | /* AF_RXRPC parameters | ||
2 | * | ||
3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
4 | * Written by David Howells (dhowells@redhat.com) | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License | ||
8 | * as published by the Free Software Foundation; either version | ||
9 | * 2 of the License, or (at your option) any later version. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_RXRPC_H | ||
13 | #define _LINUX_RXRPC_H | ||
14 | |||
15 | #include <linux/in.h> | ||
16 | #include <linux/in6.h> | ||
17 | |||
18 | /* | ||
19 | * RxRPC socket address | ||
20 | */ | ||
21 | struct sockaddr_rxrpc { | ||
22 | sa_family_t srx_family; /* address family */ | ||
23 | u16 srx_service; /* service desired */ | ||
24 | u16 transport_type; /* type of transport socket (SOCK_DGRAM) */ | ||
25 | u16 transport_len; /* length of transport address */ | ||
26 | union { | ||
27 | sa_family_t family; /* transport address family */ | ||
28 | struct sockaddr_in sin; /* IPv4 transport address */ | ||
29 | struct sockaddr_in6 sin6; /* IPv6 transport address */ | ||
30 | } transport; | ||
31 | }; | ||
32 | |||
33 | /* | ||
34 | * RxRPC socket options | ||
35 | */ | ||
36 | #define RXRPC_SECURITY_KEY 1 /* [clnt] set client security key */ | ||
37 | #define RXRPC_SECURITY_KEYRING 2 /* [srvr] set ring of server security keys */ | ||
38 | #define RXRPC_EXCLUSIVE_CONNECTION 3 /* [clnt] use exclusive RxRPC connection */ | ||
39 | #define RXRPC_MIN_SECURITY_LEVEL 4 /* minimum security level */ | ||
40 | |||
41 | /* | ||
42 | * RxRPC control messages | ||
43 | * - terminal messages mean that a user call ID tag can be recycled | ||
44 | */ | ||
45 | #define RXRPC_USER_CALL_ID 1 /* user call ID specifier */ | ||
46 | #define RXRPC_ABORT 2 /* abort request / notification [terminal] */ | ||
47 | #define RXRPC_ACK 3 /* [Server] RPC op final ACK received [terminal] */ | ||
48 | #define RXRPC_NET_ERROR 5 /* network error received [terminal] */ | ||
49 | #define RXRPC_BUSY 6 /* server busy received [terminal] */ | ||
50 | #define RXRPC_LOCAL_ERROR 7 /* local error generated [terminal] */ | ||
51 | #define RXRPC_NEW_CALL 8 /* [Server] new incoming call notification */ | ||
52 | #define RXRPC_ACCEPT 9 /* [Server] accept request */ | ||
53 | |||
54 | /* | ||
55 | * RxRPC security levels | ||
56 | */ | ||
57 | #define RXRPC_SECURITY_PLAIN 0 /* plain secure-checksummed packets only */ | ||
58 | #define RXRPC_SECURITY_AUTH 1 /* authenticated packets */ | ||
59 | #define RXRPC_SECURITY_ENCRYPT 2 /* encrypted packets */ | ||
60 | |||
61 | |||
62 | #endif /* _LINUX_RXRPC_H */ | ||
diff --git a/include/linux/sched.h b/include/linux/sched.h index 5053dc01fad4..a1707583de49 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -196,13 +196,13 @@ extern void init_idle(struct task_struct *idle, int cpu); | |||
196 | extern cpumask_t nohz_cpu_mask; | 196 | extern cpumask_t nohz_cpu_mask; |
197 | 197 | ||
198 | /* | 198 | /* |
199 | * Only dump TASK_* tasks. (-1 for all tasks) | 199 | * Only dump TASK_* tasks. (0 for all tasks) |
200 | */ | 200 | */ |
201 | extern void show_state_filter(unsigned long state_filter); | 201 | extern void show_state_filter(unsigned long state_filter); |
202 | 202 | ||
203 | static inline void show_state(void) | 203 | static inline void show_state(void) |
204 | { | 204 | { |
205 | show_state_filter(-1); | 205 | show_state_filter(0); |
206 | } | 206 | } |
207 | 207 | ||
208 | extern void show_regs(struct pt_regs *); | 208 | extern void show_regs(struct pt_regs *); |
@@ -684,7 +684,6 @@ struct sched_domain { | |||
684 | unsigned int imbalance_pct; /* No balance until over watermark */ | 684 | unsigned int imbalance_pct; /* No balance until over watermark */ |
685 | unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ | 685 | unsigned long long cache_hot_time; /* Task considered cache hot (ns) */ |
686 | unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ | 686 | unsigned int cache_nice_tries; /* Leave cache hot tasks for # tries */ |
687 | unsigned int per_cpu_gain; /* CPU % gained by adding domain cpus */ | ||
688 | unsigned int busy_idx; | 687 | unsigned int busy_idx; |
689 | unsigned int idle_idx; | 688 | unsigned int idle_idx; |
690 | unsigned int newidle_idx; | 689 | unsigned int newidle_idx; |
@@ -1329,6 +1328,7 @@ extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | |||
1329 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | 1328 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); |
1330 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | 1329 | extern int kill_pgrp(struct pid *pid, int sig, int priv); |
1331 | extern int kill_pid(struct pid *pid, int sig, int priv); | 1330 | extern int kill_pid(struct pid *pid, int sig, int priv); |
1331 | extern int kill_proc_info(int, struct siginfo *, pid_t); | ||
1332 | extern void do_notify_parent(struct task_struct *, int); | 1332 | extern void do_notify_parent(struct task_struct *, int); |
1333 | extern void force_sig(int, struct task_struct *); | 1333 | extern void force_sig(int, struct task_struct *); |
1334 | extern void force_sig_specific(int, struct task_struct *); | 1334 | extern void force_sig_specific(int, struct task_struct *); |
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index d4f86560bfff..d70df61a029f 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -63,6 +63,15 @@ typedef struct sctphdr { | |||
63 | __be32 checksum; | 63 | __be32 checksum; |
64 | } __attribute__((packed)) sctp_sctphdr_t; | 64 | } __attribute__((packed)) sctp_sctphdr_t; |
65 | 65 | ||
66 | #ifdef __KERNEL__ | ||
67 | #include <linux/skbuff.h> | ||
68 | |||
69 | static inline struct sctphdr *sctp_hdr(const struct sk_buff *skb) | ||
70 | { | ||
71 | return (struct sctphdr *)skb_transport_header(skb); | ||
72 | } | ||
73 | #endif | ||
74 | |||
66 | /* Section 3.2. Chunk Field Descriptions. */ | 75 | /* Section 3.2. Chunk Field Descriptions. */ |
67 | typedef struct sctp_chunkhdr { | 76 | typedef struct sctp_chunkhdr { |
68 | __u8 type; | 77 | __u8 type; |
diff --git a/include/linux/sdla_fr.h b/include/linux/sdla_fr.h deleted file mode 100644 index cdfa77fcb06b..000000000000 --- a/include/linux/sdla_fr.h +++ /dev/null | |||
@@ -1,638 +0,0 @@ | |||
1 | /***************************************************************************** | ||
2 | * sdla_fr.h Sangoma frame relay firmware API definitions. | ||
3 | * | ||
4 | * Author: Gideon Hack | ||
5 | * Nenad Corbic <ncorbic@sangoma.com> | ||
6 | * | ||
7 | * Copyright: (c) 1995-2000 Sangoma Technologies Inc. | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * as published by the Free Software Foundation; either version | ||
12 | * 2 of the License, or (at your option) any later version. | ||
13 | * ============================================================================ | ||
14 | * Oct 04, 1999 Gideon Hack Updated API structures | ||
15 | * Jun 02, 1999 Gideon Hack Modifications for S514 support | ||
16 | * Oct 12, 1997 Jaspreet Singh Added FR_READ_DLCI_IB_MAPPING | ||
17 | * Jul 21, 1997 Jaspreet Singh Changed FRRES_TOO_LONG and FRRES_TOO_MANY to | ||
18 | * 0x05 and 0x06 respectively. | ||
19 | * Dec 23, 1996 Gene Kozin v2.0 | ||
20 | * Apr 29, 1996 Gene Kozin v1.0 (merged version S502 & S508 definitions). | ||
21 | * Sep 26, 1995 Gene Kozin Initial version. | ||
22 | *****************************************************************************/ | ||
23 | #ifndef _SDLA_FR_H | ||
24 | #define _SDLA_FR_H | ||
25 | |||
26 | /*---------------------------------------------------------------------------- | ||
27 | * Notes: | ||
28 | * ------ | ||
29 | * 1. All structures defined in this file are byte-alined. | ||
30 | * | ||
31 | * Compiler Platform | ||
32 | * -------- -------- | ||
33 | * GNU C Linux | ||
34 | */ | ||
35 | |||
36 | #ifndef PACKED | ||
37 | # define PACKED __attribute__((packed)) | ||
38 | #endif /* PACKED */ | ||
39 | |||
40 | /* Adapter memory layout */ | ||
41 | #define FR_MB_VECTOR 0xE000 /* mailbox window vector */ | ||
42 | #define FR502_RX_VECTOR 0xA000 /* S502 direct receive window vector */ | ||
43 | #define FR502_MBOX_OFFS 0xF60 /* S502 mailbox offset */ | ||
44 | #define FR508_MBOX_OFFS 0 /* S508 mailbox offset */ | ||
45 | #define FR502_FLAG_OFFS 0x1FF0 /* S502 status flags offset */ | ||
46 | #define FR508_FLAG_OFFS 0x1000 /* S508 status flags offset */ | ||
47 | #define FR502_RXMB_OFFS 0x900 /* S502 direct receive mailbox offset */ | ||
48 | #define FR508_TXBC_OFFS 0x1100 /* S508 Tx buffer info offset */ | ||
49 | #define FR508_RXBC_OFFS 0x1120 /* S508 Rx buffer info offset */ | ||
50 | |||
51 | /* Important constants */ | ||
52 | #define FR502_MAX_DATA 4096 /* maximum data buffer length */ | ||
53 | #define FR508_MAX_DATA 4080 /* maximum data buffer length */ | ||
54 | #define MIN_LGTH_FR_DATA_CFG 300 /* min Information frame length | ||
55 | (for configuration purposes) */ | ||
56 | #define FR_MAX_NO_DATA_BYTES_IN_FRAME 15354 /* max Information frame length */ | ||
57 | |||
58 | #define HIGHEST_VALID_DLCI 991 | ||
59 | |||
60 | /****** Data Structures *****************************************************/ | ||
61 | |||
62 | /*---------------------------------------------------------------------------- | ||
63 | * Frame relay command block. | ||
64 | */ | ||
65 | typedef struct fr_cmd | ||
66 | { | ||
67 | unsigned char command PACKED; /* command code */ | ||
68 | unsigned short length PACKED; /* length of data buffer */ | ||
69 | unsigned char result PACKED; /* return code */ | ||
70 | unsigned short dlci PACKED; /* DLCI number */ | ||
71 | unsigned char attr PACKED; /* FECN, BECN, DE and C/R bits */ | ||
72 | unsigned short rxlost1 PACKED; /* frames discarded at int. level */ | ||
73 | unsigned long rxlost2 PACKED; /* frames discarded at app. level */ | ||
74 | unsigned char rsrv[2] PACKED; /* reserved for future use */ | ||
75 | } fr_cmd_t; | ||
76 | |||
77 | /* 'command' field defines */ | ||
78 | #define FR_WRITE 0x01 | ||
79 | #define FR_READ 0x02 | ||
80 | #define FR_ISSUE_IS_FRAME 0x03 | ||
81 | #define FR_SET_CONFIG 0x10 | ||
82 | #define FR_READ_CONFIG 0x11 | ||
83 | #define FR_COMM_DISABLE 0x12 | ||
84 | #define FR_COMM_ENABLE 0x13 | ||
85 | #define FR_READ_STATUS 0x14 | ||
86 | #define FR_READ_STATISTICS 0x15 | ||
87 | #define FR_FLUSH_STATISTICS 0x16 | ||
88 | #define FR_LIST_ACTIVE_DLCI 0x17 | ||
89 | #define FR_FLUSH_DATA_BUFFERS 0x18 | ||
90 | #define FR_READ_ADD_DLC_STATS 0x19 | ||
91 | #define FR_ADD_DLCI 0x20 | ||
92 | #define FR_DELETE_DLCI 0x21 | ||
93 | #define FR_ACTIVATE_DLCI 0x22 | ||
94 | #define FR_DEACTIVATE_DLCI 0x22 | ||
95 | #define FR_READ_MODEM_STATUS 0x30 | ||
96 | #define FR_SET_MODEM_STATUS 0x31 | ||
97 | #define FR_READ_ERROR_STATS 0x32 | ||
98 | #define FR_FLUSH_ERROR_STATS 0x33 | ||
99 | #define FR_READ_DLCI_IB_MAPPING 0x34 | ||
100 | #define FR_READ_CODE_VERSION 0x40 | ||
101 | #define FR_SET_INTR_MODE 0x50 | ||
102 | #define FR_READ_INTR_MODE 0x51 | ||
103 | #define FR_SET_TRACE_CONFIG 0x60 | ||
104 | #define FR_FT1_STATUS_CTRL 0x80 | ||
105 | #define FR_SET_FT1_MODE 0x81 | ||
106 | |||
107 | /* Special UDP drivers management commands */ | ||
108 | #define FPIPE_ENABLE_TRACING 0x41 | ||
109 | #define FPIPE_DISABLE_TRACING 0x42 | ||
110 | #define FPIPE_GET_TRACE_INFO 0x43 | ||
111 | #define FPIPE_FT1_READ_STATUS 0x44 | ||
112 | #define FPIPE_DRIVER_STAT_IFSEND 0x45 | ||
113 | #define FPIPE_DRIVER_STAT_INTR 0x46 | ||
114 | #define FPIPE_DRIVER_STAT_GEN 0x47 | ||
115 | #define FPIPE_FLUSH_DRIVER_STATS 0x48 | ||
116 | #define FPIPE_ROUTER_UP_TIME 0x49 | ||
117 | |||
118 | /* 'result' field defines */ | ||
119 | #define FRRES_OK 0x00 /* command executed successfully */ | ||
120 | #define FRRES_DISABLED 0x01 /* communications not enabled */ | ||
121 | #define FRRES_INOPERATIVE 0x02 /* channel inoperative */ | ||
122 | #define FRRES_DLCI_INACTIVE 0x03 /* DLCI is inactive */ | ||
123 | #define FRRES_DLCI_INVALID 0x04 /* DLCI is not configured */ | ||
124 | #define FRRES_TOO_LONG 0x05 | ||
125 | #define FRRES_TOO_MANY 0x06 | ||
126 | #define FRRES_CIR_OVERFLOW 0x07 /* Tx throughput has exceeded CIR */ | ||
127 | #define FRRES_BUFFER_OVERFLOW 0x08 | ||
128 | #define FRRES_MODEM_FAILURE 0x10 /* DCD and/or CTS dropped */ | ||
129 | #define FRRES_CHANNEL_DOWN 0x11 /* channel became inoperative */ | ||
130 | #define FRRES_CHANNEL_UP 0x12 /* channel became operative */ | ||
131 | #define FRRES_DLCI_CHANGE 0x13 /* DLCI status (or number) changed */ | ||
132 | #define FRRES_DLCI_MISMATCH 0x14 | ||
133 | #define FRRES_INVALID_CMD 0x1F /* invalid command */ | ||
134 | |||
135 | /* 'attr' field defines */ | ||
136 | #define FRATTR_ | ||
137 | |||
138 | /*---------------------------------------------------------------------------- | ||
139 | * Frame relay mailbox. | ||
140 | * This structure is located at offset FR50?_MBOX_OFFS into FR_MB_VECTOR. | ||
141 | * For S502 it is also located at offset FR502_RXMB_OFFS into | ||
142 | * FR502_RX_VECTOR. | ||
143 | */ | ||
144 | typedef struct fr_mbox | ||
145 | { | ||
146 | unsigned char opflag PACKED; /* 00h: execution flag */ | ||
147 | fr_cmd_t cmd PACKED; /* 01h: command block */ | ||
148 | unsigned char data[1] PACKED; /* 10h: variable length data buffer */ | ||
149 | } fr_mbox_t; | ||
150 | |||
151 | /*---------------------------------------------------------------------------- | ||
152 | * S502 frame relay status flags. | ||
153 | * This structure is located at offset FR502_FLAG_OFFS into FR_MB_VECTOR. | ||
154 | */ | ||
155 | typedef struct fr502_flags | ||
156 | { | ||
157 | unsigned char rsrv1[1] PACKED; /* 00h: */ | ||
158 | unsigned char tx_ready PACKED; /* 01h: Tx buffer available */ | ||
159 | unsigned char rx_ready PACKED; /* 02h: Rx frame available */ | ||
160 | unsigned char event PACKED; /* 03h: asynchronous event */ | ||
161 | unsigned char mstatus PACKED; /* 04h: modem status */ | ||
162 | unsigned char rsrv2[8] PACKED; /* 05h: */ | ||
163 | unsigned char iflag PACKED; /* 0Dh: interrupt flag */ | ||
164 | unsigned char imask PACKED; /* 0Eh: interrupt mask */ | ||
165 | } fr502_flags_t; | ||
166 | |||
167 | /*---------------------------------------------------------------------------- | ||
168 | * S508 frame relay status flags. | ||
169 | * This structure is located at offset FR508_FLAG_OFFS into FR_MB_VECTOR. | ||
170 | */ | ||
171 | typedef struct fr508_flags | ||
172 | { | ||
173 | unsigned char rsrv1[3] PACKED; /* 00h: reserved */ | ||
174 | unsigned char event PACKED; /* 03h: asynchronous event */ | ||
175 | unsigned char mstatus PACKED; /* 04h: modem status */ | ||
176 | unsigned char rsrv2[11] PACKED; /* 05h: reserved */ | ||
177 | unsigned char iflag PACKED; /* 10h: interrupt flag */ | ||
178 | unsigned char imask PACKED; /* 11h: interrupt mask */ | ||
179 | unsigned long tse_offs PACKED; /* 12h: Tx status element */ | ||
180 | unsigned short dlci PACKED; /* 16h: DLCI NUMBER */ | ||
181 | } fr508_flags_t; | ||
182 | |||
183 | /* 'event' field defines */ | ||
184 | #define FR_EVENT_STATUS 0x01 /* channel status change */ | ||
185 | #define FR_EVENT_DLC_STATUS 0x02 /* DLC status change */ | ||
186 | #define FR_EVENT_BAD_DLCI 0x04 /* FSR included wrong DLCI */ | ||
187 | #define FR_EVENT_LINK_DOWN 0x40 /* DCD or CTS low */ | ||
188 | |||
189 | /* 'mstatus' field defines */ | ||
190 | #define FR_MDM_DCD 0x08 /* mdm_status: DCD */ | ||
191 | #define FR_MDM_CTS 0x20 /* mdm_status: CTS */ | ||
192 | |||
193 | /* 'iflag' & 'imask' fields defines */ | ||
194 | #define FR_INTR_RXRDY 0x01 /* Rx ready */ | ||
195 | #define FR_INTR_TXRDY 0x02 /* Tx ready */ | ||
196 | #define FR_INTR_MODEM 0x04 /* modem status change (DCD, CTS) */ | ||
197 | #define FR_INTR_READY 0x08 /* interface command completed */ | ||
198 | #define FR_INTR_DLC 0x10 /* DLC status change */ | ||
199 | #define FR_INTR_TIMER 0x20 /* millisecond timer */ | ||
200 | #define FR_INTR_TX_MULT_DLCIs 0x80 /* Tx interrupt on multiple DLCIs */ | ||
201 | |||
202 | |||
203 | /*---------------------------------------------------------------------------- | ||
204 | * Receive Buffer Configuration Info. S508 only! | ||
205 | * This structure is located at offset FR508_RXBC_OFFS into FR_MB_VECTOR. | ||
206 | */ | ||
207 | typedef struct fr_buf_info | ||
208 | { | ||
209 | unsigned short rse_num PACKED; /* 00h: number of status elements */ | ||
210 | unsigned long rse_base PACKED; /* 02h: receive status array base */ | ||
211 | unsigned long rse_next PACKED; /* 06h: next status element */ | ||
212 | unsigned long buf_base PACKED; /* 0Ah: rotational buffer base */ | ||
213 | unsigned short reserved PACKED; /* 0Eh: */ | ||
214 | unsigned long buf_top PACKED; /* 10h: rotational buffer top */ | ||
215 | } fr_buf_info_t; | ||
216 | |||
217 | /*---------------------------------------------------------------------------- | ||
218 | * Buffer Status Element. S508 only! | ||
219 | * Array of structures of this type is located at offset defined by the | ||
220 | * 'rse_base' field of the frBufInfo_t structure into absolute adapter | ||
221 | * memory address space. | ||
222 | */ | ||
223 | typedef struct fr_rx_buf_ctl | ||
224 | { | ||
225 | unsigned char flag PACKED; /* 00h: ready flag */ | ||
226 | unsigned short length PACKED; /* 01h: frame length */ | ||
227 | unsigned short dlci PACKED; /* 03h: DLCI */ | ||
228 | unsigned char attr PACKED; /* 05h: FECN/BECN/DE/CR */ | ||
229 | unsigned short tmstamp PACKED; /* 06h: time stamp */ | ||
230 | unsigned short rsrv[2] PACKED; /* 08h: */ | ||
231 | unsigned long offset PACKED; /* 0Ch: buffer absolute address */ | ||
232 | } fr_rx_buf_ctl_t; | ||
233 | |||
234 | typedef struct fr_tx_buf_ctl | ||
235 | { | ||
236 | unsigned char flag PACKED; /* 00h: ready flag */ | ||
237 | unsigned short rsrv0[2] PACKED; /* 01h: */ | ||
238 | unsigned short length PACKED; /* 05h: frame length */ | ||
239 | unsigned short dlci PACKED; /* 07h: DLCI */ | ||
240 | unsigned char attr PACKED; /* 09h: FECN/BECN/DE/CR */ | ||
241 | unsigned short rsrv1 PACKED; /* 0Ah: */ | ||
242 | unsigned long offset PACKED; /* 0Ch: buffer absolute address */ | ||
243 | } fr_tx_buf_ctl_t; | ||
244 | |||
245 | /*---------------------------------------------------------------------------- | ||
246 | * Global Configuration Block. Passed to FR_SET_CONFIG command when dlci == 0. | ||
247 | */ | ||
248 | typedef struct fr_conf | ||
249 | { | ||
250 | unsigned short station PACKED; /* 00h: CPE/Node */ | ||
251 | unsigned short options PACKED; /* 02h: configuration options */ | ||
252 | unsigned short kbps PACKED; /* 04h: baud rate in kbps */ | ||
253 | unsigned short port PACKED; /* 06h: RS-232/V.35 */ | ||
254 | unsigned short mtu PACKED; /* 08h: max. transmit length */ | ||
255 | unsigned short t391 PACKED; /* 0Ah: */ | ||
256 | unsigned short t392 PACKED; /* 0Ch: */ | ||
257 | unsigned short n391 PACKED; /* 0Eh: */ | ||
258 | unsigned short n392 PACKED; /* 10h: */ | ||
259 | unsigned short n393 PACKED; /* 12h: */ | ||
260 | unsigned short cir_fwd PACKED; /* 14h: */ | ||
261 | unsigned short bc_fwd PACKED; /* 16h: */ | ||
262 | unsigned short be_fwd PACKED; /* 18h: */ | ||
263 | unsigned short cir_bwd PACKED; /* 1Ah: */ | ||
264 | unsigned short bc_bwd PACKED; /* 1Ch: */ | ||
265 | unsigned short be_bwd PACKED; /* 1Eh: */ | ||
266 | unsigned short dlci[0] PACKED; /* 20h: */ | ||
267 | } fr_conf_t; | ||
268 | |||
269 | /* 'station_type' defines */ | ||
270 | #define FRCFG_STATION_CPE 0 | ||
271 | #define FRCFG_STATION_NODE 1 | ||
272 | |||
273 | /* 'conf_flags' defines */ | ||
274 | #define FRCFG_IGNORE_TX_CIR 0x0001 | ||
275 | #define FRCFG_IGNORE_RX_CIR 0x0002 | ||
276 | #define FRCFG_DONT_RETRANSMIT 0x0004 | ||
277 | #define FRCFG_IGNORE_CBS 0x0008 | ||
278 | #define FRCFG_THROUGHPUT 0x0010 /* enable throughput calculation */ | ||
279 | #define FRCFG_DIRECT_RX 0x0080 /* enable direct receive buffer */ | ||
280 | #define FRCFG_AUTO_CONFIG 0x8000 /* enable auto DLCI configuration */ | ||
281 | |||
282 | /* 'baud_rate' defines */ | ||
283 | #define FRCFG_BAUD_1200 12 | ||
284 | #define FRCFG_BAUD_2400 24 | ||
285 | #define FRCFG_BAUD_4800 48 | ||
286 | #define FRCFG_BAUD_9600 96 | ||
287 | #define FRCFG_BAUD_19200 19 | ||
288 | #define FRCFG_BAUD_38400 38 | ||
289 | #define FRCFG_BAUD_56000 56 | ||
290 | #define FRCFG_BAUD_64000 64 | ||
291 | #define FRCFG_BAUD_128000 128 | ||
292 | |||
293 | /* 'port_mode' defines */ | ||
294 | #define FRCFG_MODE_EXT_CLK 0x0000 | ||
295 | #define FRCFG_MODE_INT_CLK 0x0001 | ||
296 | #define FRCFG_MODE_V35 0x0000 /* S508 only */ | ||
297 | #define FRCFG_MODE_RS232 0x0002 /* S508 only */ | ||
298 | |||
299 | /* defines for line tracing */ | ||
300 | |||
301 | /* the line trace status element presented by the frame relay code */ | ||
302 | typedef struct { | ||
303 | unsigned char flag PACKED; /* ready flag */ | ||
304 | unsigned short length PACKED; /* trace length */ | ||
305 | unsigned char rsrv0[2] PACKED; /* reserved */ | ||
306 | unsigned char attr PACKED; /* trace attributes */ | ||
307 | unsigned short tmstamp PACKED; /* time stamp */ | ||
308 | unsigned char rsrv1[4] PACKED; /* reserved */ | ||
309 | unsigned long offset PACKED; /* buffer absolute address */ | ||
310 | } fr_trc_el_t; | ||
311 | |||
312 | typedef struct { | ||
313 | unsigned char status PACKED; /* status flag */ | ||
314 | unsigned char data_passed PACKED; /* 0 if no data passed, 1 if */ | ||
315 | /* data passed */ | ||
316 | unsigned short length PACKED; /* frame length */ | ||
317 | unsigned short tmstamp PACKED; /* time stamp */ | ||
318 | } fpipemon_trc_hdr_t; | ||
319 | |||
320 | typedef struct { | ||
321 | fpipemon_trc_hdr_t fpipemon_trc_hdr PACKED; | ||
322 | unsigned char data[FR_MAX_NO_DATA_BYTES_IN_FRAME] PACKED; | ||
323 | } fpipemon_trc_t; | ||
324 | |||
325 | /* bit settings for the 'status' byte - note that bits 1, 2 and 3 are used */ | ||
326 | /* for returning the number of frames being passed to fpipemon */ | ||
327 | #define TRC_OUTGOING_FRM 0x01 | ||
328 | #define TRC_ABORT_ERROR 0x10 | ||
329 | #define TRC_CRC_ERROR 0x20 | ||
330 | #define TRC_OVERRUN_ERROR 0x40 | ||
331 | #define MORE_TRC_DATA 0x80 | ||
332 | |||
333 | #define MAX_FRMS_TRACED 0x07 | ||
334 | |||
335 | #define NO_TRC_ELEMENTS_OFF 0x9000 | ||
336 | #define BASE_TRC_ELEMENTS_OFF 0x9002 | ||
337 | #define TRC_ACTIVE 0x01 | ||
338 | #define FLUSH_TRC_BUFFERS 0x02 | ||
339 | #define FLUSH_TRC_STATISTICS 0x04 | ||
340 | #define TRC_SIGNALLING_FRMS 0x10 | ||
341 | #define TRC_INFO_FRMS 0x20 | ||
342 | #define ACTIVATE_TRC (TRC_ACTIVE | TRC_SIGNALLING_FRMS | TRC_INFO_FRMS) | ||
343 | #define RESET_TRC (FLUSH_TRC_BUFFERS | FLUSH_TRC_STATISTICS) | ||
344 | |||
345 | /*---------------------------------------------------------------------------- | ||
346 | * Channel configuration. | ||
347 | * This structure is passed to the FR_SET_CONFIG command when dlci != 0. | ||
348 | */ | ||
349 | typedef struct fr_dlc_conf | ||
350 | { | ||
351 | unsigned short conf_flags PACKED; /* 00h: configuration bits */ | ||
352 | unsigned short cir_fwd PACKED; /* 02h: */ | ||
353 | unsigned short bc_fwd PACKED; /* 04h: */ | ||
354 | unsigned short be_fwd PACKED; /* 06h: */ | ||
355 | unsigned short cir_bwd PACKED; /* 08h: */ | ||
356 | unsigned short bc_bwd PACKED; /* 0Ah: */ | ||
357 | unsigned short be_bwd PACKED; /* 0Ch: */ | ||
358 | } fr_dlc_conf_t; | ||
359 | |||
360 | /*---------------------------------------------------------------------------- | ||
361 | * S502 interrupt mode control block. | ||
362 | * This structure is passed to the FR_SET_INTR_FLAGS and returned by the | ||
363 | * FR_READ_INTR_FLAGS commands. | ||
364 | */ | ||
365 | typedef struct fr502_intr_ctl | ||
366 | { | ||
367 | unsigned char mode PACKED; /* 00h: interrupt enable flags */ | ||
368 | unsigned short tx_len PACKED; /* 01h: required Tx buffer size */ | ||
369 | } fr502_intr_ctl_t; | ||
370 | |||
371 | /*---------------------------------------------------------------------------- | ||
372 | * S508 interrupt mode control block. | ||
373 | * This structure is passed to the FR_SET_INTR_FLAGS and returned by the | ||
374 | * FR_READ_INTR_FLAGS commands. | ||
375 | */ | ||
376 | typedef struct fr508_intr_ctl | ||
377 | { | ||
378 | unsigned char mode PACKED; /* 00h: interrupt enable flags */ | ||
379 | unsigned short tx_len PACKED; /* 01h: required Tx buffer size */ | ||
380 | unsigned char irq PACKED; /* 03h: IRQ level to activate */ | ||
381 | unsigned char flags PACKED; /* 04h: ?? */ | ||
382 | unsigned short timeout PACKED; /* 05h: ms, for timer interrupt */ | ||
383 | } fr508_intr_ctl_t; | ||
384 | |||
385 | /*---------------------------------------------------------------------------- | ||
386 | * Channel status. | ||
387 | * This structure is returned by the FR_READ_STATUS command. | ||
388 | */ | ||
389 | typedef struct fr_dlc_Status | ||
390 | { | ||
391 | unsigned char status PACKED; /* 00h: link/DLCI status */ | ||
392 | struct | ||
393 | { | ||
394 | unsigned short dlci PACKED; /* 01h: DLCI number */ | ||
395 | unsigned char status PACKED; /* 03h: DLCI status */ | ||
396 | } circuit[1] PACKED; | ||
397 | } fr_dlc_status_t; | ||
398 | |||
399 | /* 'status' defines */ | ||
400 | #define FR_LINK_INOPER 0x00 /* for global status (DLCI == 0) */ | ||
401 | #define FR_LINK_OPER 0x01 | ||
402 | #define FR_DLCI_DELETED 0x01 /* for circuit status (DLCI != 0) */ | ||
403 | #define FR_DLCI_ACTIVE 0x02 | ||
404 | #define FR_DLCI_WAITING 0x04 | ||
405 | #define FR_DLCI_NEW 0x08 | ||
406 | #define FR_DLCI_REPORT 0x40 | ||
407 | |||
408 | /*---------------------------------------------------------------------------- | ||
409 | * Global Statistics Block. | ||
410 | * This structure is returned by the FR_READ_STATISTICS command when | ||
411 | * dcli == 0. | ||
412 | */ | ||
413 | typedef struct fr_link_stat | ||
414 | { | ||
415 | unsigned short rx_too_long PACKED; /* 00h: */ | ||
416 | unsigned short rx_dropped PACKED; /* 02h: */ | ||
417 | unsigned short rx_dropped2 PACKED; /* 04h: */ | ||
418 | unsigned short rx_bad_dlci PACKED; /* 06h: */ | ||
419 | unsigned short rx_bad_format PACKED; /* 08h: */ | ||
420 | unsigned short retransmitted PACKED; /* 0Ah: */ | ||
421 | unsigned short cpe_tx_FSE PACKED; /* 0Ch: */ | ||
422 | unsigned short cpe_tx_LIV PACKED; /* 0Eh: */ | ||
423 | unsigned short cpe_rx_FSR PACKED; /* 10h: */ | ||
424 | unsigned short cpe_rx_LIV PACKED; /* 12h: */ | ||
425 | unsigned short node_rx_FSE PACKED; /* 14h: */ | ||
426 | unsigned short node_rx_LIV PACKED; /* 16h: */ | ||
427 | unsigned short node_tx_FSR PACKED; /* 18h: */ | ||
428 | unsigned short node_tx_LIV PACKED; /* 1Ah: */ | ||
429 | unsigned short rx_ISF_err PACKED; /* 1Ch: */ | ||
430 | unsigned short rx_unsolicited PACKED; /* 1Eh: */ | ||
431 | unsigned short rx_SSN_err PACKED; /* 20h: */ | ||
432 | unsigned short rx_RSN_err PACKED; /* 22h: */ | ||
433 | unsigned short T391_timeouts PACKED; /* 24h: */ | ||
434 | unsigned short T392_timeouts PACKED; /* 26h: */ | ||
435 | unsigned short N392_reached PACKED; /* 28h: */ | ||
436 | unsigned short cpe_SSN_RSN PACKED; /* 2Ah: */ | ||
437 | unsigned short current_SSN PACKED; /* 2Ch: */ | ||
438 | unsigned short current_RSN PACKED; /* 2Eh: */ | ||
439 | unsigned short curreny_T391 PACKED; /* 30h: */ | ||
440 | unsigned short current_T392 PACKED; /* 32h: */ | ||
441 | unsigned short current_N392 PACKED; /* 34h: */ | ||
442 | unsigned short current_N393 PACKED; /* 36h: */ | ||
443 | } fr_link_stat_t; | ||
444 | |||
445 | /*---------------------------------------------------------------------------- | ||
446 | * DLCI statistics. | ||
447 | * This structure is returned by the FR_READ_STATISTICS command when | ||
448 | * dlci != 0. | ||
449 | */ | ||
450 | typedef struct fr_dlci_stat | ||
451 | { | ||
452 | unsigned long tx_frames PACKED; /* 00h: */ | ||
453 | unsigned long tx_bytes PACKED; /* 04h: */ | ||
454 | unsigned long rx_frames PACKED; /* 08h: */ | ||
455 | unsigned long rx_bytes PACKED; /* 0Ch: */ | ||
456 | unsigned long rx_dropped PACKED; /* 10h: */ | ||
457 | unsigned long rx_inactive PACKED; /* 14h: */ | ||
458 | unsigned long rx_exceed_CIR PACKED; /* 18h: */ | ||
459 | unsigned long rx_DE_set PACKED; /* 1Ch: */ | ||
460 | unsigned long tx_throughput PACKED; /* 20h: */ | ||
461 | unsigned long tx_calc_timer PACKED; /* 24h: */ | ||
462 | unsigned long rx_throughput PACKED; /* 28h: */ | ||
463 | unsigned long rx_calc_timer PACKED; /* 2Ch: */ | ||
464 | } fr_dlci_stat_t; | ||
465 | |||
466 | /*---------------------------------------------------------------------------- | ||
467 | * Communications error statistics. | ||
468 | * This structure is returned by the FR_READ_ERROR_STATS command. | ||
469 | */ | ||
470 | typedef struct fr_comm_stat | ||
471 | { | ||
472 | unsigned char rx_overruns PACKED; /* 00h: */ | ||
473 | unsigned char rx_bad_crc PACKED; /* 01h: */ | ||
474 | unsigned char rx_aborts PACKED; /* 02h: */ | ||
475 | unsigned char rx_too_long PACKED; /* 03h: */ | ||
476 | unsigned char tx_aborts PACKED; /* 04h: */ | ||
477 | unsigned char tx_underruns PACKED; /* 05h: */ | ||
478 | unsigned char tx_missed_undr PACKED; /* 06h: */ | ||
479 | unsigned char dcd_dropped PACKED; /* 07h: */ | ||
480 | unsigned char cts_dropped PACKED; /* 08h: */ | ||
481 | } fr_comm_stat_t; | ||
482 | |||
483 | /*---------------------------------------------------------------------------- | ||
484 | * Defines for the FR_ISSUE_IS_FRAME command. | ||
485 | */ | ||
486 | #define FR_ISF_LVE 2 /* issue Link Verification Enquiry */ | ||
487 | #define FR_ISF_FSE 3 /* issue Full Status Enquiry */ | ||
488 | |||
489 | /*---------------------------------------------------------------------------- | ||
490 | * Frame Relay ARP Header -- Used for Dynamic route creation with InvARP | ||
491 | */ | ||
492 | |||
493 | typedef struct arphdr_fr | ||
494 | { | ||
495 | unsigned short ar_hrd PACKED; /* format of hardware addr */ | ||
496 | unsigned short ar_pro PACKED; /* format of protocol addr */ | ||
497 | unsigned char ar_hln PACKED; /* length of hardware addr */ | ||
498 | unsigned char ar_pln PACKED; /* length of protocol addr */ | ||
499 | unsigned short ar_op PACKED; /* ARP opcode */ | ||
500 | unsigned short ar_sha PACKED; /* Sender DLCI addr 2 bytes */ | ||
501 | unsigned long ar_sip PACKED; /* Sender IP addr 4 bytes */ | ||
502 | unsigned short ar_tha PACKED; /* Target DLCI addr 2 bytes */ | ||
503 | unsigned long ar_tip PACKED; /* Target IP addr 4 bytes */ | ||
504 | } arphdr_fr_t; | ||
505 | |||
506 | /*---------------------------------------------------------------------------- | ||
507 | * Frame Relay RFC 1490 SNAP Header -- Used to check for ARP packets | ||
508 | */ | ||
509 | typedef struct arphdr_1490 | ||
510 | { | ||
511 | unsigned char control PACKED; /* UI, etc... */ | ||
512 | unsigned char pad PACKED; /* Pad */ | ||
513 | unsigned char NLPID PACKED; /* SNAP */ | ||
514 | unsigned char OUI[3] PACKED; /* Ethertype, etc... */ | ||
515 | unsigned short PID PACKED; /* ARP, IP, etc... */ | ||
516 | } arphdr_1490_t; | ||
517 | |||
518 | /* UDP/IP packet (for UDP management) layout */ | ||
519 | |||
520 | /* The embedded control block for UDP mgmt | ||
521 | This is essentially a mailbox structure, without the large data field */ | ||
522 | |||
523 | typedef struct { | ||
524 | unsigned char opp_flag PACKED; /* the opp flag */ | ||
525 | unsigned char command PACKED; /* command code */ | ||
526 | unsigned short length PACKED; /* length of data buffer */ | ||
527 | unsigned char result PACKED; /* return code */ | ||
528 | unsigned short dlci PACKED; /* DLCI number */ | ||
529 | unsigned char attr PACKED; /* FECN, BECN, DE and C/R bits */ | ||
530 | unsigned short rxlost1 PACKED; /* frames discarded at int. level */ | ||
531 | unsigned long rxlost2 PACKED; /* frames discarded at app. level */ | ||
532 | unsigned char rsrv[2] PACKED; /* reserved for future use */ | ||
533 | } cblock_t; | ||
534 | |||
535 | |||
536 | /* UDP management packet layout (data area of ip packet) */ | ||
537 | |||
538 | typedef struct { | ||
539 | unsigned char control PACKED; | ||
540 | unsigned char NLPID PACKED; | ||
541 | } fr_encap_hdr_t; | ||
542 | |||
543 | typedef struct { | ||
544 | // fr_encap_hdr_t fr_encap_hdr PACKED; | ||
545 | ip_pkt_t ip_pkt PACKED; | ||
546 | udp_pkt_t udp_pkt PACKED; | ||
547 | wp_mgmt_t wp_mgmt PACKED; | ||
548 | cblock_t cblock PACKED; | ||
549 | unsigned char data[4080] PACKED; | ||
550 | } fr_udp_pkt_t; | ||
551 | |||
552 | |||
553 | /* valid ip_protocol for UDP management */ | ||
554 | #define UDPMGMT_UDP_PROTOCOL 0x11 | ||
555 | |||
556 | #define UDPMGMT_FPIPE_SIGNATURE "FPIPE8ND" | ||
557 | #define UDPMGMT_DRVRSTATS_SIGNATURE "DRVSTATS" | ||
558 | |||
559 | /* values for request/reply byte */ | ||
560 | #define UDPMGMT_REQUEST 0x01 | ||
561 | #define UDPMGMT_REPLY 0x02 | ||
562 | #define UDP_OFFSET 12 | ||
563 | |||
564 | typedef struct { | ||
565 | unsigned long if_send_entry; | ||
566 | unsigned long if_send_skb_null; | ||
567 | unsigned long if_send_broadcast; | ||
568 | unsigned long if_send_multicast; | ||
569 | unsigned long if_send_critical_ISR; | ||
570 | unsigned long if_send_critical_non_ISR; | ||
571 | unsigned long if_send_busy; | ||
572 | unsigned long if_send_busy_timeout; | ||
573 | unsigned long if_send_DRVSTATS_request; | ||
574 | unsigned long if_send_FPIPE_request; | ||
575 | unsigned long if_send_wan_disconnected; | ||
576 | unsigned long if_send_dlci_disconnected; | ||
577 | unsigned long if_send_no_bfrs; | ||
578 | unsigned long if_send_adptr_bfrs_full; | ||
579 | unsigned long if_send_bfrs_passed_to_adptr; | ||
580 | unsigned long if_send_consec_send_fail; | ||
581 | } drvstats_if_send_t; | ||
582 | |||
583 | typedef struct { | ||
584 | unsigned long rx_intr_no_socket; | ||
585 | unsigned long rx_intr_dev_not_started; | ||
586 | unsigned long rx_intr_DRVSTATS_request; | ||
587 | unsigned long rx_intr_FPIPE_request; | ||
588 | unsigned long rx_intr_bfr_not_passed_to_stack; | ||
589 | unsigned long rx_intr_bfr_passed_to_stack; | ||
590 | } drvstats_rx_intr_t; | ||
591 | |||
592 | typedef struct { | ||
593 | unsigned long UDP_FPIPE_mgmt_kmalloc_err; | ||
594 | unsigned long UDP_FPIPE_mgmt_direction_err; | ||
595 | unsigned long UDP_FPIPE_mgmt_adptr_type_err; | ||
596 | unsigned long UDP_FPIPE_mgmt_adptr_cmnd_OK; | ||
597 | unsigned long UDP_FPIPE_mgmt_adptr_cmnd_timeout; | ||
598 | unsigned long UDP_FPIPE_mgmt_adptr_send_passed; | ||
599 | unsigned long UDP_FPIPE_mgmt_adptr_send_failed; | ||
600 | unsigned long UDP_FPIPE_mgmt_not_passed_to_stack; | ||
601 | unsigned long UDP_FPIPE_mgmt_passed_to_stack; | ||
602 | unsigned long UDP_FPIPE_mgmt_no_socket; | ||
603 | unsigned long UDP_DRVSTATS_mgmt_kmalloc_err; | ||
604 | unsigned long UDP_DRVSTATS_mgmt_adptr_cmnd_OK; | ||
605 | unsigned long UDP_DRVSTATS_mgmt_adptr_cmnd_timeout; | ||
606 | unsigned long UDP_DRVSTATS_mgmt_adptr_send_passed; | ||
607 | unsigned long UDP_DRVSTATS_mgmt_adptr_send_failed; | ||
608 | unsigned long UDP_DRVSTATS_mgmt_not_passed_to_stack; | ||
609 | unsigned long UDP_DRVSTATS_mgmt_passed_to_stack; | ||
610 | unsigned long UDP_DRVSTATS_mgmt_no_socket; | ||
611 | } drvstats_gen_t; | ||
612 | |||
613 | typedef struct { | ||
614 | unsigned char attr PACKED; | ||
615 | unsigned short time_stamp PACKED; | ||
616 | unsigned char reserved[13] PACKED; | ||
617 | } api_rx_hdr_t; | ||
618 | |||
619 | typedef struct { | ||
620 | api_rx_hdr_t api_rx_hdr PACKED; | ||
621 | void * data PACKED; | ||
622 | } api_rx_element_t; | ||
623 | |||
624 | typedef struct { | ||
625 | unsigned char attr PACKED; | ||
626 | unsigned char reserved[15] PACKED; | ||
627 | } api_tx_hdr_t; | ||
628 | |||
629 | typedef struct { | ||
630 | api_tx_hdr_t api_tx_hdr PACKED; | ||
631 | void * data PACKED; | ||
632 | } api_tx_element_t; | ||
633 | |||
634 | #ifdef _MSC_ | ||
635 | # pragma pack() | ||
636 | #endif | ||
637 | #endif /* _SDLA_FR_H */ | ||
638 | |||
diff --git a/include/linux/security.h b/include/linux/security.h index 7f88d97575fd..47e82c120f9a 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1324,7 +1324,7 @@ struct security_operations { | |||
1324 | 1324 | ||
1325 | void (*d_instantiate) (struct dentry *dentry, struct inode *inode); | 1325 | void (*d_instantiate) (struct dentry *dentry, struct inode *inode); |
1326 | 1326 | ||
1327 | int (*getprocattr)(struct task_struct *p, char *name, void *value, size_t size); | 1327 | int (*getprocattr)(struct task_struct *p, char *name, char **value); |
1328 | int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); | 1328 | int (*setprocattr)(struct task_struct *p, char *name, void *value, size_t size); |
1329 | int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen); | 1329 | int (*secid_to_secctx)(u32 secid, char **secdata, u32 *seclen); |
1330 | void (*release_secctx)(char *secdata, u32 seclen); | 1330 | void (*release_secctx)(char *secdata, u32 seclen); |
@@ -2092,9 +2092,9 @@ static inline void security_d_instantiate (struct dentry *dentry, struct inode * | |||
2092 | security_ops->d_instantiate (dentry, inode); | 2092 | security_ops->d_instantiate (dentry, inode); |
2093 | } | 2093 | } |
2094 | 2094 | ||
2095 | static inline int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) | 2095 | static inline int security_getprocattr(struct task_struct *p, char *name, char **value) |
2096 | { | 2096 | { |
2097 | return security_ops->getprocattr(p, name, value, size); | 2097 | return security_ops->getprocattr(p, name, value); |
2098 | } | 2098 | } |
2099 | 2099 | ||
2100 | static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) | 2100 | static inline int security_setprocattr(struct task_struct *p, char *name, void *value, size_t size) |
@@ -2749,7 +2749,7 @@ static inline int security_sem_semop (struct sem_array * sma, | |||
2749 | static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) | 2749 | static inline void security_d_instantiate (struct dentry *dentry, struct inode *inode) |
2750 | { } | 2750 | { } |
2751 | 2751 | ||
2752 | static inline int security_getprocattr(struct task_struct *p, char *name, void *value, size_t size) | 2752 | static inline int security_getprocattr(struct task_struct *p, char *name, char **value) |
2753 | { | 2753 | { |
2754 | return -EINVAL; | 2754 | return -EINVAL; |
2755 | } | 2755 | } |
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h index 6b0648cfdffc..26e4925bc35b 100644 --- a/include/linux/seqlock.h +++ b/include/linux/seqlock.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __LINUX_SEQLOCK_H | 2 | #define __LINUX_SEQLOCK_H |
3 | /* | 3 | /* |
4 | * Reader/writer consistent mechanism without starving writers. This type of | 4 | * Reader/writer consistent mechanism without starving writers. This type of |
5 | * lock for data where the reader wants a consitent set of information | 5 | * lock for data where the reader wants a consistent set of information |
6 | * and is willing to retry if the information changes. Readers never | 6 | * and is willing to retry if the information changes. Readers never |
7 | * block but they may have to retry if a writer is in | 7 | * block but they may have to retry if a writer is in |
8 | * progress. Writers do not wait for readers. | 8 | * progress. Writers do not wait for readers. |
@@ -61,10 +61,10 @@ static inline void write_seqlock(seqlock_t *sl) | |||
61 | { | 61 | { |
62 | spin_lock(&sl->lock); | 62 | spin_lock(&sl->lock); |
63 | ++sl->sequence; | 63 | ++sl->sequence; |
64 | smp_wmb(); | 64 | smp_wmb(); |
65 | } | 65 | } |
66 | 66 | ||
67 | static inline void write_sequnlock(seqlock_t *sl) | 67 | static inline void write_sequnlock(seqlock_t *sl) |
68 | { | 68 | { |
69 | smp_wmb(); | 69 | smp_wmb(); |
70 | sl->sequence++; | 70 | sl->sequence++; |
@@ -77,7 +77,7 @@ static inline int write_tryseqlock(seqlock_t *sl) | |||
77 | 77 | ||
78 | if (ret) { | 78 | if (ret) { |
79 | ++sl->sequence; | 79 | ++sl->sequence; |
80 | smp_wmb(); | 80 | smp_wmb(); |
81 | } | 81 | } |
82 | return ret; | 82 | return ret; |
83 | } | 83 | } |
diff --git a/include/linux/shm.h b/include/linux/shm.h index a2c896ad0bef..ad2e3af65997 100644 --- a/include/linux/shm.h +++ b/include/linux/shm.h | |||
@@ -96,12 +96,17 @@ struct shmid_kernel /* private to the kernel */ | |||
96 | 96 | ||
97 | #ifdef CONFIG_SYSVIPC | 97 | #ifdef CONFIG_SYSVIPC |
98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); | 98 | long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); |
99 | extern int is_file_shm_hugepages(struct file *file); | ||
99 | #else | 100 | #else |
100 | static inline long do_shmat(int shmid, char __user *shmaddr, | 101 | static inline long do_shmat(int shmid, char __user *shmaddr, |
101 | int shmflg, unsigned long *addr) | 102 | int shmflg, unsigned long *addr) |
102 | { | 103 | { |
103 | return -ENOSYS; | 104 | return -ENOSYS; |
104 | } | 105 | } |
106 | static inline int is_file_shm_hugepages(struct file *file) | ||
107 | { | ||
108 | return 0; | ||
109 | } | ||
105 | #endif | 110 | #endif |
106 | 111 | ||
107 | #endif /* __KERNEL__ */ | 112 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 4ff3940210d8..253a2b9be9d6 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -27,20 +27,24 @@ | |||
27 | #include <net/checksum.h> | 27 | #include <net/checksum.h> |
28 | #include <linux/rcupdate.h> | 28 | #include <linux/rcupdate.h> |
29 | #include <linux/dmaengine.h> | 29 | #include <linux/dmaengine.h> |
30 | #include <linux/hrtimer.h> | ||
30 | 31 | ||
31 | #define HAVE_ALLOC_SKB /* For the drivers to know */ | 32 | #define HAVE_ALLOC_SKB /* For the drivers to know */ |
32 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ | 33 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ |
33 | 34 | ||
35 | /* Don't change this without changing skb_csum_unnecessary! */ | ||
34 | #define CHECKSUM_NONE 0 | 36 | #define CHECKSUM_NONE 0 |
35 | #define CHECKSUM_PARTIAL 1 | 37 | #define CHECKSUM_UNNECESSARY 1 |
36 | #define CHECKSUM_UNNECESSARY 2 | 38 | #define CHECKSUM_COMPLETE 2 |
37 | #define CHECKSUM_COMPLETE 3 | 39 | #define CHECKSUM_PARTIAL 3 |
38 | 40 | ||
39 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ | 41 | #define SKB_DATA_ALIGN(X) (((X) + (SMP_CACHE_BYTES - 1)) & \ |
40 | ~(SMP_CACHE_BYTES - 1)) | 42 | ~(SMP_CACHE_BYTES - 1)) |
41 | #define SKB_MAX_ORDER(X, ORDER) (((PAGE_SIZE << (ORDER)) - (X) - \ | 43 | #define SKB_WITH_OVERHEAD(X) \ |
42 | sizeof(struct skb_shared_info)) & \ | 44 | (((X) - sizeof(struct skb_shared_info)) & \ |
43 | ~(SMP_CACHE_BYTES - 1)) | 45 | ~(SMP_CACHE_BYTES - 1)) |
46 | #define SKB_MAX_ORDER(X, ORDER) \ | ||
47 | SKB_WITH_OVERHEAD((PAGE_SIZE << (ORDER)) - (X)) | ||
44 | #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) | 48 | #define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) |
45 | #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) | 49 | #define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) |
46 | 50 | ||
@@ -66,8 +70,8 @@ | |||
66 | * NONE: skb is checksummed by protocol or csum is not required. | 70 | * NONE: skb is checksummed by protocol or csum is not required. |
67 | * | 71 | * |
68 | * PARTIAL: device is required to csum packet as seen by hard_start_xmit | 72 | * PARTIAL: device is required to csum packet as seen by hard_start_xmit |
69 | * from skb->h.raw to the end and to record the checksum | 73 | * from skb->transport_header to the end and to record the checksum |
70 | * at skb->h.raw+skb->csum. | 74 | * at skb->transport_header + skb->csum. |
71 | * | 75 | * |
72 | * Device must show its capabilities in dev->features, set | 76 | * Device must show its capabilities in dev->features, set |
73 | * at device setup time. | 77 | * at device setup time. |
@@ -83,12 +87,13 @@ | |||
83 | */ | 87 | */ |
84 | 88 | ||
85 | struct net_device; | 89 | struct net_device; |
90 | struct scatterlist; | ||
86 | 91 | ||
87 | #ifdef CONFIG_NETFILTER | 92 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
88 | struct nf_conntrack { | 93 | struct nf_conntrack { |
89 | atomic_t use; | 94 | atomic_t use; |
90 | void (*destroy)(struct nf_conntrack *); | ||
91 | }; | 95 | }; |
96 | #endif | ||
92 | 97 | ||
93 | #ifdef CONFIG_BRIDGE_NETFILTER | 98 | #ifdef CONFIG_BRIDGE_NETFILTER |
94 | struct nf_bridge_info { | 99 | struct nf_bridge_info { |
@@ -103,8 +108,6 @@ struct nf_bridge_info { | |||
103 | }; | 108 | }; |
104 | #endif | 109 | #endif |
105 | 110 | ||
106 | #endif | ||
107 | |||
108 | struct sk_buff_head { | 111 | struct sk_buff_head { |
109 | /* These two members must be first. */ | 112 | /* These two members must be first. */ |
110 | struct sk_buff *next; | 113 | struct sk_buff *next; |
@@ -156,11 +159,6 @@ struct skb_shared_info { | |||
156 | #define SKB_DATAREF_SHIFT 16 | 159 | #define SKB_DATAREF_SHIFT 16 |
157 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) | 160 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
158 | 161 | ||
159 | struct skb_timeval { | ||
160 | u32 off_sec; | ||
161 | u32 off_usec; | ||
162 | }; | ||
163 | |||
164 | 162 | ||
165 | enum { | 163 | enum { |
166 | SKB_FCLONE_UNAVAILABLE, | 164 | SKB_FCLONE_UNAVAILABLE, |
@@ -181,6 +179,16 @@ enum { | |||
181 | SKB_GSO_TCPV6 = 1 << 4, | 179 | SKB_GSO_TCPV6 = 1 << 4, |
182 | }; | 180 | }; |
183 | 181 | ||
182 | #if BITS_PER_LONG > 32 | ||
183 | #define NET_SKBUFF_DATA_USES_OFFSET 1 | ||
184 | #endif | ||
185 | |||
186 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | ||
187 | typedef unsigned int sk_buff_data_t; | ||
188 | #else | ||
189 | typedef unsigned char *sk_buff_data_t; | ||
190 | #endif | ||
191 | |||
184 | /** | 192 | /** |
185 | * struct sk_buff - socket buffer | 193 | * struct sk_buff - socket buffer |
186 | * @next: Next buffer in list | 194 | * @next: Next buffer in list |
@@ -188,17 +196,19 @@ enum { | |||
188 | * @sk: Socket we are owned by | 196 | * @sk: Socket we are owned by |
189 | * @tstamp: Time we arrived | 197 | * @tstamp: Time we arrived |
190 | * @dev: Device we arrived on/are leaving by | 198 | * @dev: Device we arrived on/are leaving by |
191 | * @input_dev: Device we arrived on | 199 | * @iif: ifindex of device we arrived on |
192 | * @h: Transport layer header | 200 | * @h: Transport layer header |
193 | * @nh: Network layer header | 201 | * @network_header: Network layer header |
194 | * @mac: Link layer header | 202 | * @mac_header: Link layer header |
195 | * @dst: destination entry | 203 | * @dst: destination entry |
196 | * @sp: the security path, used for xfrm | 204 | * @sp: the security path, used for xfrm |
197 | * @cb: Control buffer. Free for use by every layer. Put private vars here | 205 | * @cb: Control buffer. Free for use by every layer. Put private vars here |
198 | * @len: Length of actual data | 206 | * @len: Length of actual data |
199 | * @data_len: Data length | 207 | * @data_len: Data length |
200 | * @mac_len: Length of link layer header | 208 | * @mac_len: Length of link layer header |
201 | * @csum: Checksum | 209 | * @csum: Checksum (must include start/offset pair) |
210 | * @csum_start: Offset from skb->head where checksumming should start | ||
211 | * @csum_offset: Offset from csum_start where checksum should be stored | ||
202 | * @local_df: allow local fragmentation | 212 | * @local_df: allow local fragmentation |
203 | * @cloned: Head may be cloned (check refcnt to be sure) | 213 | * @cloned: Head may be cloned (check refcnt to be sure) |
204 | * @nohdr: Payload reference only, must not modify header | 214 | * @nohdr: Payload reference only, must not modify header |
@@ -233,30 +243,10 @@ struct sk_buff { | |||
233 | struct sk_buff *prev; | 243 | struct sk_buff *prev; |
234 | 244 | ||
235 | struct sock *sk; | 245 | struct sock *sk; |
236 | struct skb_timeval tstamp; | 246 | ktime_t tstamp; |
237 | struct net_device *dev; | 247 | struct net_device *dev; |
238 | struct net_device *input_dev; | 248 | int iif; |
239 | 249 | /* 4 byte hole on 64 bit*/ | |
240 | union { | ||
241 | struct tcphdr *th; | ||
242 | struct udphdr *uh; | ||
243 | struct icmphdr *icmph; | ||
244 | struct igmphdr *igmph; | ||
245 | struct iphdr *ipiph; | ||
246 | struct ipv6hdr *ipv6h; | ||
247 | unsigned char *raw; | ||
248 | } h; | ||
249 | |||
250 | union { | ||
251 | struct iphdr *iph; | ||
252 | struct ipv6hdr *ipv6h; | ||
253 | struct arphdr *arph; | ||
254 | unsigned char *raw; | ||
255 | } nh; | ||
256 | |||
257 | union { | ||
258 | unsigned char *raw; | ||
259 | } mac; | ||
260 | 250 | ||
261 | struct dst_entry *dst; | 251 | struct dst_entry *dst; |
262 | struct sec_path *sp; | 252 | struct sec_path *sp; |
@@ -274,7 +264,10 @@ struct sk_buff { | |||
274 | mac_len; | 264 | mac_len; |
275 | union { | 265 | union { |
276 | __wsum csum; | 266 | __wsum csum; |
277 | __u32 csum_offset; | 267 | struct { |
268 | __u16 csum_start; | ||
269 | __u16 csum_offset; | ||
270 | }; | ||
278 | }; | 271 | }; |
279 | __u32 priority; | 272 | __u32 priority; |
280 | __u8 local_df:1, | 273 | __u8 local_df:1, |
@@ -288,15 +281,13 @@ struct sk_buff { | |||
288 | __be16 protocol; | 281 | __be16 protocol; |
289 | 282 | ||
290 | void (*destructor)(struct sk_buff *skb); | 283 | void (*destructor)(struct sk_buff *skb); |
291 | #ifdef CONFIG_NETFILTER | ||
292 | struct nf_conntrack *nfct; | ||
293 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 284 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
285 | struct nf_conntrack *nfct; | ||
294 | struct sk_buff *nfct_reasm; | 286 | struct sk_buff *nfct_reasm; |
295 | #endif | 287 | #endif |
296 | #ifdef CONFIG_BRIDGE_NETFILTER | 288 | #ifdef CONFIG_BRIDGE_NETFILTER |
297 | struct nf_bridge_info *nf_bridge; | 289 | struct nf_bridge_info *nf_bridge; |
298 | #endif | 290 | #endif |
299 | #endif /* CONFIG_NETFILTER */ | ||
300 | #ifdef CONFIG_NET_SCHED | 291 | #ifdef CONFIG_NET_SCHED |
301 | __u16 tc_index; /* traffic control index */ | 292 | __u16 tc_index; /* traffic control index */ |
302 | #ifdef CONFIG_NET_CLS_ACT | 293 | #ifdef CONFIG_NET_CLS_ACT |
@@ -312,13 +303,16 @@ struct sk_buff { | |||
312 | 303 | ||
313 | __u32 mark; | 304 | __u32 mark; |
314 | 305 | ||
306 | sk_buff_data_t transport_header; | ||
307 | sk_buff_data_t network_header; | ||
308 | sk_buff_data_t mac_header; | ||
315 | /* These elements must be at the end, see alloc_skb() for details. */ | 309 | /* These elements must be at the end, see alloc_skb() for details. */ |
310 | sk_buff_data_t tail; | ||
311 | sk_buff_data_t end; | ||
312 | unsigned char *head, | ||
313 | *data; | ||
316 | unsigned int truesize; | 314 | unsigned int truesize; |
317 | atomic_t users; | 315 | atomic_t users; |
318 | unsigned char *head, | ||
319 | *data, | ||
320 | *tail, | ||
321 | *end; | ||
322 | }; | 316 | }; |
323 | 317 | ||
324 | #ifdef __KERNEL__ | 318 | #ifdef __KERNEL__ |
@@ -345,9 +339,6 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | |||
345 | return __alloc_skb(size, priority, 1, -1); | 339 | return __alloc_skb(size, priority, 1, -1); |
346 | } | 340 | } |
347 | 341 | ||
348 | extern struct sk_buff *alloc_skb_from_cache(struct kmem_cache *cp, | ||
349 | unsigned int size, | ||
350 | gfp_t priority); | ||
351 | extern void kfree_skbmem(struct sk_buff *skb); | 342 | extern void kfree_skbmem(struct sk_buff *skb); |
352 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 343 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
353 | gfp_t priority); | 344 | gfp_t priority); |
@@ -363,6 +354,11 @@ extern struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | |||
363 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, | 354 | extern struct sk_buff *skb_copy_expand(const struct sk_buff *skb, |
364 | int newheadroom, int newtailroom, | 355 | int newheadroom, int newtailroom, |
365 | gfp_t priority); | 356 | gfp_t priority); |
357 | extern int skb_to_sgvec(struct sk_buff *skb, | ||
358 | struct scatterlist *sg, int offset, | ||
359 | int len); | ||
360 | extern int skb_cow_data(struct sk_buff *skb, int tailbits, | ||
361 | struct sk_buff **trailer); | ||
366 | extern int skb_pad(struct sk_buff *skb, int pad); | 362 | extern int skb_pad(struct sk_buff *skb, int pad); |
367 | #define dev_kfree_skb(a) kfree_skb(a) | 363 | #define dev_kfree_skb(a) kfree_skb(a) |
368 | extern void skb_over_panic(struct sk_buff *skb, int len, | 364 | extern void skb_over_panic(struct sk_buff *skb, int len, |
@@ -404,8 +400,20 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |||
404 | unsigned int to, struct ts_config *config, | 400 | unsigned int to, struct ts_config *config, |
405 | struct ts_state *state); | 401 | struct ts_state *state); |
406 | 402 | ||
403 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | ||
404 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) | ||
405 | { | ||
406 | return skb->head + skb->end; | ||
407 | } | ||
408 | #else | ||
409 | static inline unsigned char *skb_end_pointer(const struct sk_buff *skb) | ||
410 | { | ||
411 | return skb->end; | ||
412 | } | ||
413 | #endif | ||
414 | |||
407 | /* Internal */ | 415 | /* Internal */ |
408 | #define skb_shinfo(SKB) ((struct skb_shared_info *)((SKB)->end)) | 416 | #define skb_shinfo(SKB) ((struct skb_shared_info *)(skb_end_pointer(SKB))) |
409 | 417 | ||
410 | /** | 418 | /** |
411 | * skb_queue_empty - check if a queue is empty | 419 | * skb_queue_empty - check if a queue is empty |
@@ -621,6 +629,13 @@ static inline void skb_queue_head_init(struct sk_buff_head *list) | |||
621 | list->qlen = 0; | 629 | list->qlen = 0; |
622 | } | 630 | } |
623 | 631 | ||
632 | static inline void skb_queue_head_init_class(struct sk_buff_head *list, | ||
633 | struct lock_class_key *class) | ||
634 | { | ||
635 | skb_queue_head_init(list); | ||
636 | lockdep_set_class(&list->lock, class); | ||
637 | } | ||
638 | |||
624 | /* | 639 | /* |
625 | * Insert an sk_buff at the start of a list. | 640 | * Insert an sk_buff at the start of a list. |
626 | * | 641 | * |
@@ -817,12 +832,46 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | |||
817 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) | 832 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) |
818 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) | 833 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) |
819 | 834 | ||
835 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | ||
836 | static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) | ||
837 | { | ||
838 | return skb->head + skb->tail; | ||
839 | } | ||
840 | |||
841 | static inline void skb_reset_tail_pointer(struct sk_buff *skb) | ||
842 | { | ||
843 | skb->tail = skb->data - skb->head; | ||
844 | } | ||
845 | |||
846 | static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) | ||
847 | { | ||
848 | skb_reset_tail_pointer(skb); | ||
849 | skb->tail += offset; | ||
850 | } | ||
851 | #else /* NET_SKBUFF_DATA_USES_OFFSET */ | ||
852 | static inline unsigned char *skb_tail_pointer(const struct sk_buff *skb) | ||
853 | { | ||
854 | return skb->tail; | ||
855 | } | ||
856 | |||
857 | static inline void skb_reset_tail_pointer(struct sk_buff *skb) | ||
858 | { | ||
859 | skb->tail = skb->data; | ||
860 | } | ||
861 | |||
862 | static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset) | ||
863 | { | ||
864 | skb->tail = skb->data + offset; | ||
865 | } | ||
866 | |||
867 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | ||
868 | |||
820 | /* | 869 | /* |
821 | * Add data to an sk_buff | 870 | * Add data to an sk_buff |
822 | */ | 871 | */ |
823 | static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | 872 | static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) |
824 | { | 873 | { |
825 | unsigned char *tmp = skb->tail; | 874 | unsigned char *tmp = skb_tail_pointer(skb); |
826 | SKB_LINEAR_ASSERT(skb); | 875 | SKB_LINEAR_ASSERT(skb); |
827 | skb->tail += len; | 876 | skb->tail += len; |
828 | skb->len += len; | 877 | skb->len += len; |
@@ -840,11 +889,11 @@ static inline unsigned char *__skb_put(struct sk_buff *skb, unsigned int len) | |||
840 | */ | 889 | */ |
841 | static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len) | 890 | static inline unsigned char *skb_put(struct sk_buff *skb, unsigned int len) |
842 | { | 891 | { |
843 | unsigned char *tmp = skb->tail; | 892 | unsigned char *tmp = skb_tail_pointer(skb); |
844 | SKB_LINEAR_ASSERT(skb); | 893 | SKB_LINEAR_ASSERT(skb); |
845 | skb->tail += len; | 894 | skb->tail += len; |
846 | skb->len += len; | 895 | skb->len += len; |
847 | if (unlikely(skb->tail>skb->end)) | 896 | if (unlikely(skb->tail > skb->end)) |
848 | skb_over_panic(skb, len, current_text_addr()); | 897 | skb_over_panic(skb, len, current_text_addr()); |
849 | return tmp; | 898 | return tmp; |
850 | } | 899 | } |
@@ -957,6 +1006,130 @@ static inline void skb_reserve(struct sk_buff *skb, int len) | |||
957 | skb->tail += len; | 1006 | skb->tail += len; |
958 | } | 1007 | } |
959 | 1008 | ||
1009 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | ||
1010 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | ||
1011 | { | ||
1012 | return skb->head + skb->transport_header; | ||
1013 | } | ||
1014 | |||
1015 | static inline void skb_reset_transport_header(struct sk_buff *skb) | ||
1016 | { | ||
1017 | skb->transport_header = skb->data - skb->head; | ||
1018 | } | ||
1019 | |||
1020 | static inline void skb_set_transport_header(struct sk_buff *skb, | ||
1021 | const int offset) | ||
1022 | { | ||
1023 | skb_reset_transport_header(skb); | ||
1024 | skb->transport_header += offset; | ||
1025 | } | ||
1026 | |||
1027 | static inline unsigned char *skb_network_header(const struct sk_buff *skb) | ||
1028 | { | ||
1029 | return skb->head + skb->network_header; | ||
1030 | } | ||
1031 | |||
1032 | static inline void skb_reset_network_header(struct sk_buff *skb) | ||
1033 | { | ||
1034 | skb->network_header = skb->data - skb->head; | ||
1035 | } | ||
1036 | |||
1037 | static inline void skb_set_network_header(struct sk_buff *skb, const int offset) | ||
1038 | { | ||
1039 | skb_reset_network_header(skb); | ||
1040 | skb->network_header += offset; | ||
1041 | } | ||
1042 | |||
1043 | static inline unsigned char *skb_mac_header(const struct sk_buff *skb) | ||
1044 | { | ||
1045 | return skb->head + skb->mac_header; | ||
1046 | } | ||
1047 | |||
1048 | static inline int skb_mac_header_was_set(const struct sk_buff *skb) | ||
1049 | { | ||
1050 | return skb->mac_header != ~0U; | ||
1051 | } | ||
1052 | |||
1053 | static inline void skb_reset_mac_header(struct sk_buff *skb) | ||
1054 | { | ||
1055 | skb->mac_header = skb->data - skb->head; | ||
1056 | } | ||
1057 | |||
1058 | static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | ||
1059 | { | ||
1060 | skb_reset_mac_header(skb); | ||
1061 | skb->mac_header += offset; | ||
1062 | } | ||
1063 | |||
1064 | #else /* NET_SKBUFF_DATA_USES_OFFSET */ | ||
1065 | |||
1066 | static inline unsigned char *skb_transport_header(const struct sk_buff *skb) | ||
1067 | { | ||
1068 | return skb->transport_header; | ||
1069 | } | ||
1070 | |||
1071 | static inline void skb_reset_transport_header(struct sk_buff *skb) | ||
1072 | { | ||
1073 | skb->transport_header = skb->data; | ||
1074 | } | ||
1075 | |||
1076 | static inline void skb_set_transport_header(struct sk_buff *skb, | ||
1077 | const int offset) | ||
1078 | { | ||
1079 | skb->transport_header = skb->data + offset; | ||
1080 | } | ||
1081 | |||
1082 | static inline unsigned char *skb_network_header(const struct sk_buff *skb) | ||
1083 | { | ||
1084 | return skb->network_header; | ||
1085 | } | ||
1086 | |||
1087 | static inline void skb_reset_network_header(struct sk_buff *skb) | ||
1088 | { | ||
1089 | skb->network_header = skb->data; | ||
1090 | } | ||
1091 | |||
1092 | static inline void skb_set_network_header(struct sk_buff *skb, const int offset) | ||
1093 | { | ||
1094 | skb->network_header = skb->data + offset; | ||
1095 | } | ||
1096 | |||
1097 | static inline unsigned char *skb_mac_header(const struct sk_buff *skb) | ||
1098 | { | ||
1099 | return skb->mac_header; | ||
1100 | } | ||
1101 | |||
1102 | static inline int skb_mac_header_was_set(const struct sk_buff *skb) | ||
1103 | { | ||
1104 | return skb->mac_header != NULL; | ||
1105 | } | ||
1106 | |||
1107 | static inline void skb_reset_mac_header(struct sk_buff *skb) | ||
1108 | { | ||
1109 | skb->mac_header = skb->data; | ||
1110 | } | ||
1111 | |||
1112 | static inline void skb_set_mac_header(struct sk_buff *skb, const int offset) | ||
1113 | { | ||
1114 | skb->mac_header = skb->data + offset; | ||
1115 | } | ||
1116 | #endif /* NET_SKBUFF_DATA_USES_OFFSET */ | ||
1117 | |||
1118 | static inline int skb_transport_offset(const struct sk_buff *skb) | ||
1119 | { | ||
1120 | return skb_transport_header(skb) - skb->data; | ||
1121 | } | ||
1122 | |||
1123 | static inline u32 skb_network_header_len(const struct sk_buff *skb) | ||
1124 | { | ||
1125 | return skb->transport_header - skb->network_header; | ||
1126 | } | ||
1127 | |||
1128 | static inline int skb_network_offset(const struct sk_buff *skb) | ||
1129 | { | ||
1130 | return skb_network_header(skb) - skb->data; | ||
1131 | } | ||
1132 | |||
960 | /* | 1133 | /* |
961 | * CPUs often take a performance hit when accessing unaligned memory | 1134 | * CPUs often take a performance hit when accessing unaligned memory |
962 | * locations. The actual performance hit varies, it can be small if the | 1135 | * locations. The actual performance hit varies, it can be small if the |
@@ -1008,8 +1181,8 @@ static inline void __skb_trim(struct sk_buff *skb, unsigned int len) | |||
1008 | WARN_ON(1); | 1181 | WARN_ON(1); |
1009 | return; | 1182 | return; |
1010 | } | 1183 | } |
1011 | skb->len = len; | 1184 | skb->len = len; |
1012 | skb->tail = skb->data + len; | 1185 | skb_set_tail_pointer(skb, len); |
1013 | } | 1186 | } |
1014 | 1187 | ||
1015 | /** | 1188 | /** |
@@ -1298,6 +1471,11 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1298 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | 1471 | prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ |
1299 | skb = skb->next) | 1472 | skb = skb->next) |
1300 | 1473 | ||
1474 | #define skb_queue_walk_safe(queue, skb, tmp) \ | ||
1475 | for (skb = (queue)->next, tmp = skb->next; \ | ||
1476 | skb != (struct sk_buff *)(queue); \ | ||
1477 | skb = tmp, tmp = skb->next) | ||
1478 | |||
1301 | #define skb_queue_reverse_walk(queue, skb) \ | 1479 | #define skb_queue_reverse_walk(queue, skb) \ |
1302 | for (skb = (queue)->prev; \ | 1480 | for (skb = (queue)->prev; \ |
1303 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | 1481 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ |
@@ -1321,8 +1499,8 @@ extern __wsum skb_checksum(const struct sk_buff *skb, int offset, | |||
1321 | int len, __wsum csum); | 1499 | int len, __wsum csum); |
1322 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, | 1500 | extern int skb_copy_bits(const struct sk_buff *skb, int offset, |
1323 | void *to, int len); | 1501 | void *to, int len); |
1324 | extern int skb_store_bits(const struct sk_buff *skb, int offset, | 1502 | extern int skb_store_bits(struct sk_buff *skb, int offset, |
1325 | void *from, int len); | 1503 | const void *from, int len); |
1326 | extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, | 1504 | extern __wsum skb_copy_and_csum_bits(const struct sk_buff *skb, |
1327 | int offset, u8 *to, int len, | 1505 | int offset, u8 *to, int len, |
1328 | __wsum csum); | 1506 | __wsum csum); |
@@ -1346,8 +1524,36 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | |||
1346 | return buffer; | 1524 | return buffer; |
1347 | } | 1525 | } |
1348 | 1526 | ||
1527 | static inline void skb_copy_from_linear_data(const struct sk_buff *skb, | ||
1528 | void *to, | ||
1529 | const unsigned int len) | ||
1530 | { | ||
1531 | memcpy(to, skb->data, len); | ||
1532 | } | ||
1533 | |||
1534 | static inline void skb_copy_from_linear_data_offset(const struct sk_buff *skb, | ||
1535 | const int offset, void *to, | ||
1536 | const unsigned int len) | ||
1537 | { | ||
1538 | memcpy(to, skb->data + offset, len); | ||
1539 | } | ||
1540 | |||
1541 | static inline void skb_copy_to_linear_data(struct sk_buff *skb, | ||
1542 | const void *from, | ||
1543 | const unsigned int len) | ||
1544 | { | ||
1545 | memcpy(skb->data, from, len); | ||
1546 | } | ||
1547 | |||
1548 | static inline void skb_copy_to_linear_data_offset(struct sk_buff *skb, | ||
1549 | const int offset, | ||
1550 | const void *from, | ||
1551 | const unsigned int len) | ||
1552 | { | ||
1553 | memcpy(skb->data + offset, from, len); | ||
1554 | } | ||
1555 | |||
1349 | extern void skb_init(void); | 1556 | extern void skb_init(void); |
1350 | extern void skb_add_mtu(int mtu); | ||
1351 | 1557 | ||
1352 | /** | 1558 | /** |
1353 | * skb_get_timestamp - get timestamp from a skb | 1559 | * skb_get_timestamp - get timestamp from a skb |
@@ -1360,29 +1566,28 @@ extern void skb_add_mtu(int mtu); | |||
1360 | */ | 1566 | */ |
1361 | static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp) | 1567 | static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp) |
1362 | { | 1568 | { |
1363 | stamp->tv_sec = skb->tstamp.off_sec; | 1569 | *stamp = ktime_to_timeval(skb->tstamp); |
1364 | stamp->tv_usec = skb->tstamp.off_usec; | ||
1365 | } | 1570 | } |
1366 | 1571 | ||
1367 | /** | 1572 | static inline void __net_timestamp(struct sk_buff *skb) |
1368 | * skb_set_timestamp - set timestamp of a skb | 1573 | { |
1369 | * @skb: skb to set stamp of | 1574 | skb->tstamp = ktime_get_real(); |
1370 | * @stamp: pointer to struct timeval to get stamp from | 1575 | } |
1371 | * | 1576 | |
1372 | * Timestamps are stored in the skb as offsets to a base timestamp. | 1577 | static inline ktime_t net_timedelta(ktime_t t) |
1373 | * This function converts a struct timeval to an offset and stores | ||
1374 | * it in the skb. | ||
1375 | */ | ||
1376 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | ||
1377 | { | 1578 | { |
1378 | skb->tstamp.off_sec = stamp->tv_sec; | 1579 | return ktime_sub(ktime_get_real(), t); |
1379 | skb->tstamp.off_usec = stamp->tv_usec; | ||
1380 | } | 1580 | } |
1381 | 1581 | ||
1382 | extern void __net_timestamp(struct sk_buff *skb); | ||
1383 | 1582 | ||
1583 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | ||
1384 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 1584 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
1385 | 1585 | ||
1586 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) | ||
1587 | { | ||
1588 | return skb->ip_summed & CHECKSUM_UNNECESSARY; | ||
1589 | } | ||
1590 | |||
1386 | /** | 1591 | /** |
1387 | * skb_checksum_complete - Calculate checksum of an entire packet | 1592 | * skb_checksum_complete - Calculate checksum of an entire packet |
1388 | * @skb: packet to process | 1593 | * @skb: packet to process |
@@ -1401,22 +1606,22 @@ extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | |||
1401 | */ | 1606 | */ |
1402 | static inline unsigned int skb_checksum_complete(struct sk_buff *skb) | 1607 | static inline unsigned int skb_checksum_complete(struct sk_buff *skb) |
1403 | { | 1608 | { |
1404 | return skb->ip_summed != CHECKSUM_UNNECESSARY && | 1609 | return skb_csum_unnecessary(skb) ? |
1405 | __skb_checksum_complete(skb); | 1610 | 0 : __skb_checksum_complete(skb); |
1406 | } | 1611 | } |
1407 | 1612 | ||
1408 | #ifdef CONFIG_NETFILTER | 1613 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
1614 | extern void nf_conntrack_destroy(struct nf_conntrack *nfct); | ||
1409 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 1615 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
1410 | { | 1616 | { |
1411 | if (nfct && atomic_dec_and_test(&nfct->use)) | 1617 | if (nfct && atomic_dec_and_test(&nfct->use)) |
1412 | nfct->destroy(nfct); | 1618 | nf_conntrack_destroy(nfct); |
1413 | } | 1619 | } |
1414 | static inline void nf_conntrack_get(struct nf_conntrack *nfct) | 1620 | static inline void nf_conntrack_get(struct nf_conntrack *nfct) |
1415 | { | 1621 | { |
1416 | if (nfct) | 1622 | if (nfct) |
1417 | atomic_inc(&nfct->use); | 1623 | atomic_inc(&nfct->use); |
1418 | } | 1624 | } |
1419 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1420 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) | 1625 | static inline void nf_conntrack_get_reasm(struct sk_buff *skb) |
1421 | { | 1626 | { |
1422 | if (skb) | 1627 | if (skb) |
@@ -1442,9 +1647,9 @@ static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge) | |||
1442 | #endif /* CONFIG_BRIDGE_NETFILTER */ | 1647 | #endif /* CONFIG_BRIDGE_NETFILTER */ |
1443 | static inline void nf_reset(struct sk_buff *skb) | 1648 | static inline void nf_reset(struct sk_buff *skb) |
1444 | { | 1649 | { |
1650 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1445 | nf_conntrack_put(skb->nfct); | 1651 | nf_conntrack_put(skb->nfct); |
1446 | skb->nfct = NULL; | 1652 | skb->nfct = NULL; |
1447 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1448 | nf_conntrack_put_reasm(skb->nfct_reasm); | 1653 | nf_conntrack_put_reasm(skb->nfct_reasm); |
1449 | skb->nfct_reasm = NULL; | 1654 | skb->nfct_reasm = NULL; |
1450 | #endif | 1655 | #endif |
@@ -1454,9 +1659,33 @@ static inline void nf_reset(struct sk_buff *skb) | |||
1454 | #endif | 1659 | #endif |
1455 | } | 1660 | } |
1456 | 1661 | ||
1457 | #else /* CONFIG_NETFILTER */ | 1662 | /* Note: This doesn't put any conntrack and bridge info in dst. */ |
1458 | static inline void nf_reset(struct sk_buff *skb) {} | 1663 | static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src) |
1459 | #endif /* CONFIG_NETFILTER */ | 1664 | { |
1665 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1666 | dst->nfct = src->nfct; | ||
1667 | nf_conntrack_get(src->nfct); | ||
1668 | dst->nfctinfo = src->nfctinfo; | ||
1669 | dst->nfct_reasm = src->nfct_reasm; | ||
1670 | nf_conntrack_get_reasm(src->nfct_reasm); | ||
1671 | #endif | ||
1672 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
1673 | dst->nf_bridge = src->nf_bridge; | ||
1674 | nf_bridge_get(src->nf_bridge); | ||
1675 | #endif | ||
1676 | } | ||
1677 | |||
1678 | static inline void nf_copy(struct sk_buff *dst, const struct sk_buff *src) | ||
1679 | { | ||
1680 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1681 | nf_conntrack_put(dst->nfct); | ||
1682 | nf_conntrack_put_reasm(dst->nfct_reasm); | ||
1683 | #endif | ||
1684 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
1685 | nf_bridge_put(dst->nf_bridge); | ||
1686 | #endif | ||
1687 | __nf_copy(dst, src); | ||
1688 | } | ||
1460 | 1689 | ||
1461 | #ifdef CONFIG_NETWORK_SECMARK | 1690 | #ifdef CONFIG_NETWORK_SECMARK |
1462 | static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from) | 1691 | static inline void skb_copy_secmark(struct sk_buff *to, const struct sk_buff *from) |
@@ -1481,5 +1710,12 @@ static inline int skb_is_gso(const struct sk_buff *skb) | |||
1481 | return skb_shinfo(skb)->gso_size; | 1710 | return skb_shinfo(skb)->gso_size; |
1482 | } | 1711 | } |
1483 | 1712 | ||
1713 | static inline void skb_forward_csum(struct sk_buff *skb) | ||
1714 | { | ||
1715 | /* Unfortunately we don't support this one. Any brave souls? */ | ||
1716 | if (skb->ip_summed == CHECKSUM_COMPLETE) | ||
1717 | skb->ip_summed = CHECKSUM_NONE; | ||
1718 | } | ||
1719 | |||
1484 | #endif /* __KERNEL__ */ | 1720 | #endif /* __KERNEL__ */ |
1485 | #endif /* _LINUX_SKBUFF_H */ | 1721 | #endif /* _LINUX_SKBUFF_H */ |
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h new file mode 100644 index 000000000000..cc9be4a11861 --- /dev/null +++ b/include/linux/sm501-regs.h | |||
@@ -0,0 +1,357 @@ | |||
1 | /* sm501-regs.h | ||
2 | * | ||
3 | * Copyright 2006 Simtec Electronics | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | * | ||
9 | * Silicon Motion SM501 register definitions | ||
10 | */ | ||
11 | |||
12 | /* System Configuration area */ | ||
13 | /* System config base */ | ||
14 | #define SM501_SYS_CONFIG (0x000000) | ||
15 | |||
16 | /* config 1 */ | ||
17 | #define SM501_SYSTEM_CONTROL (0x000000) | ||
18 | #define SM501_MISC_CONTROL (0x000004) | ||
19 | |||
20 | #define SM501_MISC_BUS_SH (0x0) | ||
21 | #define SM501_MISC_BUS_PCI (0x1) | ||
22 | #define SM501_MISC_BUS_XSCALE (0x2) | ||
23 | #define SM501_MISC_BUS_NEC (0x6) | ||
24 | #define SM501_MISC_BUS_MASK (0x7) | ||
25 | |||
26 | #define SM501_MISC_VR_62MB (1<<3) | ||
27 | #define SM501_MISC_CDR_RESET (1<<7) | ||
28 | #define SM501_MISC_USB_LB (1<<8) | ||
29 | #define SM501_MISC_USB_SLAVE (1<<9) | ||
30 | #define SM501_MISC_BL_1 (1<<10) | ||
31 | #define SM501_MISC_MC (1<<11) | ||
32 | #define SM501_MISC_DAC_POWER (1<<12) | ||
33 | #define SM501_MISC_IRQ_INVERT (1<<16) | ||
34 | #define SM501_MISC_SH (1<<17) | ||
35 | |||
36 | #define SM501_MISC_HOLD_EMPTY (0<<18) | ||
37 | #define SM501_MISC_HOLD_8 (1<<18) | ||
38 | #define SM501_MISC_HOLD_16 (2<<18) | ||
39 | #define SM501_MISC_HOLD_24 (3<<18) | ||
40 | #define SM501_MISC_HOLD_32 (4<<18) | ||
41 | #define SM501_MISC_HOLD_MASK (7<<18) | ||
42 | |||
43 | #define SM501_MISC_FREQ_12 (1<<24) | ||
44 | #define SM501_MISC_PNL_24BIT (1<<25) | ||
45 | #define SM501_MISC_8051_LE (1<<26) | ||
46 | |||
47 | |||
48 | |||
49 | #define SM501_GPIO31_0_CONTROL (0x000008) | ||
50 | #define SM501_GPIO63_32_CONTROL (0x00000C) | ||
51 | #define SM501_DRAM_CONTROL (0x000010) | ||
52 | |||
53 | /* command list */ | ||
54 | #define SM501_ARBTRTN_CONTROL (0x000014) | ||
55 | |||
56 | /* command list */ | ||
57 | #define SM501_COMMAND_LIST_STATUS (0x000024) | ||
58 | |||
59 | /* interrupt debug */ | ||
60 | #define SM501_RAW_IRQ_STATUS (0x000028) | ||
61 | #define SM501_RAW_IRQ_CLEAR (0x000028) | ||
62 | #define SM501_IRQ_STATUS (0x00002C) | ||
63 | #define SM501_IRQ_MASK (0x000030) | ||
64 | #define SM501_DEBUG_CONTROL (0x000034) | ||
65 | |||
66 | /* power management */ | ||
67 | #define SM501_CURRENT_GATE (0x000038) | ||
68 | #define SM501_CURRENT_CLOCK (0x00003C) | ||
69 | #define SM501_POWER_MODE_0_GATE (0x000040) | ||
70 | #define SM501_POWER_MODE_0_CLOCK (0x000044) | ||
71 | #define SM501_POWER_MODE_1_GATE (0x000048) | ||
72 | #define SM501_POWER_MODE_1_CLOCK (0x00004C) | ||
73 | #define SM501_SLEEP_MODE_GATE (0x000050) | ||
74 | #define SM501_POWER_MODE_CONTROL (0x000054) | ||
75 | |||
76 | /* power gates for units within the 501 */ | ||
77 | #define SM501_GATE_HOST (0) | ||
78 | #define SM501_GATE_MEMORY (1) | ||
79 | #define SM501_GATE_DISPLAY (2) | ||
80 | #define SM501_GATE_2D_ENGINE (3) | ||
81 | #define SM501_GATE_CSC (4) | ||
82 | #define SM501_GATE_ZVPORT (5) | ||
83 | #define SM501_GATE_GPIO (6) | ||
84 | #define SM501_GATE_UART0 (7) | ||
85 | #define SM501_GATE_UART1 (8) | ||
86 | #define SM501_GATE_SSP (10) | ||
87 | #define SM501_GATE_USB_HOST (11) | ||
88 | #define SM501_GATE_USB_GADGET (12) | ||
89 | #define SM501_GATE_UCONTROLLER (17) | ||
90 | #define SM501_GATE_AC97 (18) | ||
91 | |||
92 | /* panel clock */ | ||
93 | #define SM501_CLOCK_P2XCLK (24) | ||
94 | /* crt clock */ | ||
95 | #define SM501_CLOCK_V2XCLK (16) | ||
96 | /* main clock */ | ||
97 | #define SM501_CLOCK_MCLK (8) | ||
98 | /* SDRAM controller clock */ | ||
99 | #define SM501_CLOCK_M1XCLK (0) | ||
100 | |||
101 | /* config 2 */ | ||
102 | #define SM501_PCI_MASTER_BASE (0x000058) | ||
103 | #define SM501_ENDIAN_CONTROL (0x00005C) | ||
104 | #define SM501_DEVICEID (0x000060) | ||
105 | /* 0x050100A0 */ | ||
106 | |||
107 | #define SM501_PLLCLOCK_COUNT (0x000064) | ||
108 | #define SM501_MISC_TIMING (0x000068) | ||
109 | #define SM501_CURRENT_SDRAM_CLOCK (0x00006C) | ||
110 | |||
111 | /* GPIO base */ | ||
112 | #define SM501_GPIO (0x010000) | ||
113 | #define SM501_GPIO_DATA_LOW (0x00) | ||
114 | #define SM501_GPIO_DATA_HIGH (0x04) | ||
115 | #define SM501_GPIO_DDR_LOW (0x08) | ||
116 | #define SM501_GPIO_DDR_HIGH (0x0C) | ||
117 | #define SM501_GPIO_IRQ_SETUP (0x10) | ||
118 | #define SM501_GPIO_IRQ_STATUS (0x14) | ||
119 | #define SM501_GPIO_IRQ_RESET (0x14) | ||
120 | |||
121 | /* I2C controller base */ | ||
122 | #define SM501_I2C (0x010040) | ||
123 | #define SM501_I2C_BYTE_COUNT (0x00) | ||
124 | #define SM501_I2C_CONTROL (0x01) | ||
125 | #define SM501_I2C_STATUS (0x02) | ||
126 | #define SM501_I2C_RESET (0x02) | ||
127 | #define SM501_I2C_SLAVE_ADDRESS (0x03) | ||
128 | #define SM501_I2C_DATA (0x04) | ||
129 | |||
130 | /* SSP base */ | ||
131 | #define SM501_SSP (0x020000) | ||
132 | |||
133 | /* Uart 0 base */ | ||
134 | #define SM501_UART0 (0x030000) | ||
135 | |||
136 | /* Uart 1 base */ | ||
137 | #define SM501_UART1 (0x030020) | ||
138 | |||
139 | /* USB host port base */ | ||
140 | #define SM501_USB_HOST (0x040000) | ||
141 | |||
142 | /* USB slave/gadget base */ | ||
143 | #define SM501_USB_GADGET (0x060000) | ||
144 | |||
145 | /* USB slave/gadget data port base */ | ||
146 | #define SM501_USB_GADGET_DATA (0x070000) | ||
147 | |||
148 | /* Display contoller/video engine base */ | ||
149 | #define SM501_DC (0x080000) | ||
150 | |||
151 | /* common defines for the SM501 address registers */ | ||
152 | #define SM501_ADDR_FLIP (1<<31) | ||
153 | #define SM501_ADDR_EXT (1<<27) | ||
154 | #define SM501_ADDR_CS1 (1<<26) | ||
155 | #define SM501_ADDR_MASK (0x3f << 26) | ||
156 | |||
157 | #define SM501_FIFO_MASK (0x3 << 16) | ||
158 | #define SM501_FIFO_1 (0x0 << 16) | ||
159 | #define SM501_FIFO_3 (0x1 << 16) | ||
160 | #define SM501_FIFO_7 (0x2 << 16) | ||
161 | #define SM501_FIFO_11 (0x3 << 16) | ||
162 | |||
163 | /* common registers for panel and the crt */ | ||
164 | #define SM501_OFF_DC_H_TOT (0x000) | ||
165 | #define SM501_OFF_DC_V_TOT (0x008) | ||
166 | #define SM501_OFF_DC_H_SYNC (0x004) | ||
167 | #define SM501_OFF_DC_V_SYNC (0x00C) | ||
168 | |||
169 | #define SM501_DC_PANEL_CONTROL (0x000) | ||
170 | |||
171 | #define SM501_DC_PANEL_CONTROL_FPEN (1<<27) | ||
172 | #define SM501_DC_PANEL_CONTROL_BIAS (1<<26) | ||
173 | #define SM501_DC_PANEL_CONTROL_DATA (1<<25) | ||
174 | #define SM501_DC_PANEL_CONTROL_VDD (1<<24) | ||
175 | #define SM501_DC_PANEL_CONTROL_DP (1<<23) | ||
176 | |||
177 | #define SM501_DC_PANEL_CONTROL_TFT_888 (0<<21) | ||
178 | #define SM501_DC_PANEL_CONTROL_TFT_333 (1<<21) | ||
179 | #define SM501_DC_PANEL_CONTROL_TFT_444 (2<<21) | ||
180 | |||
181 | #define SM501_DC_PANEL_CONTROL_DE (1<<20) | ||
182 | |||
183 | #define SM501_DC_PANEL_CONTROL_LCD_TFT (0<<18) | ||
184 | #define SM501_DC_PANEL_CONTROL_LCD_STN8 (1<<18) | ||
185 | #define SM501_DC_PANEL_CONTROL_LCD_STN12 (2<<18) | ||
186 | |||
187 | #define SM501_DC_PANEL_CONTROL_CP (1<<14) | ||
188 | #define SM501_DC_PANEL_CONTROL_VSP (1<<13) | ||
189 | #define SM501_DC_PANEL_CONTROL_HSP (1<<12) | ||
190 | #define SM501_DC_PANEL_CONTROL_CK (1<<9) | ||
191 | #define SM501_DC_PANEL_CONTROL_TE (1<<8) | ||
192 | #define SM501_DC_PANEL_CONTROL_VPD (1<<7) | ||
193 | #define SM501_DC_PANEL_CONTROL_VP (1<<6) | ||
194 | #define SM501_DC_PANEL_CONTROL_HPD (1<<5) | ||
195 | #define SM501_DC_PANEL_CONTROL_HP (1<<4) | ||
196 | #define SM501_DC_PANEL_CONTROL_GAMMA (1<<3) | ||
197 | #define SM501_DC_PANEL_CONTROL_EN (1<<2) | ||
198 | |||
199 | #define SM501_DC_PANEL_CONTROL_8BPP (0<<0) | ||
200 | #define SM501_DC_PANEL_CONTROL_16BPP (1<<0) | ||
201 | #define SM501_DC_PANEL_CONTROL_32BPP (2<<0) | ||
202 | |||
203 | |||
204 | #define SM501_DC_PANEL_PANNING_CONTROL (0x004) | ||
205 | #define SM501_DC_PANEL_COLOR_KEY (0x008) | ||
206 | #define SM501_DC_PANEL_FB_ADDR (0x00C) | ||
207 | #define SM501_DC_PANEL_FB_OFFSET (0x010) | ||
208 | #define SM501_DC_PANEL_FB_WIDTH (0x014) | ||
209 | #define SM501_DC_PANEL_FB_HEIGHT (0x018) | ||
210 | #define SM501_DC_PANEL_TL_LOC (0x01C) | ||
211 | #define SM501_DC_PANEL_BR_LOC (0x020) | ||
212 | #define SM501_DC_PANEL_H_TOT (0x024) | ||
213 | #define SM501_DC_PANEL_H_SYNC (0x028) | ||
214 | #define SM501_DC_PANEL_V_TOT (0x02C) | ||
215 | #define SM501_DC_PANEL_V_SYNC (0x030) | ||
216 | #define SM501_DC_PANEL_CUR_LINE (0x034) | ||
217 | |||
218 | #define SM501_DC_VIDEO_CONTROL (0x040) | ||
219 | #define SM501_DC_VIDEO_FB0_ADDR (0x044) | ||
220 | #define SM501_DC_VIDEO_FB_WIDTH (0x048) | ||
221 | #define SM501_DC_VIDEO_FB0_LAST_ADDR (0x04C) | ||
222 | #define SM501_DC_VIDEO_TL_LOC (0x050) | ||
223 | #define SM501_DC_VIDEO_BR_LOC (0x054) | ||
224 | #define SM501_DC_VIDEO_SCALE (0x058) | ||
225 | #define SM501_DC_VIDEO_INIT_SCALE (0x05C) | ||
226 | #define SM501_DC_VIDEO_YUV_CONSTANTS (0x060) | ||
227 | #define SM501_DC_VIDEO_FB1_ADDR (0x064) | ||
228 | #define SM501_DC_VIDEO_FB1_LAST_ADDR (0x068) | ||
229 | |||
230 | #define SM501_DC_VIDEO_ALPHA_CONTROL (0x080) | ||
231 | #define SM501_DC_VIDEO_ALPHA_FB_ADDR (0x084) | ||
232 | #define SM501_DC_VIDEO_ALPHA_FB_OFFSET (0x088) | ||
233 | #define SM501_DC_VIDEO_ALPHA_FB_LAST_ADDR (0x08C) | ||
234 | #define SM501_DC_VIDEO_ALPHA_TL_LOC (0x090) | ||
235 | #define SM501_DC_VIDEO_ALPHA_BR_LOC (0x094) | ||
236 | #define SM501_DC_VIDEO_ALPHA_SCALE (0x098) | ||
237 | #define SM501_DC_VIDEO_ALPHA_INIT_SCALE (0x09C) | ||
238 | #define SM501_DC_VIDEO_ALPHA_CHROMA_KEY (0x0A0) | ||
239 | #define SM501_DC_VIDEO_ALPHA_COLOR_LOOKUP (0x0A4) | ||
240 | |||
241 | #define SM501_DC_PANEL_HWC_BASE (0x0F0) | ||
242 | #define SM501_DC_PANEL_HWC_ADDR (0x0F0) | ||
243 | #define SM501_DC_PANEL_HWC_LOC (0x0F4) | ||
244 | #define SM501_DC_PANEL_HWC_COLOR_1_2 (0x0F8) | ||
245 | #define SM501_DC_PANEL_HWC_COLOR_3 (0x0FC) | ||
246 | |||
247 | #define SM501_HWC_EN (1<<31) | ||
248 | |||
249 | #define SM501_OFF_HWC_ADDR (0x00) | ||
250 | #define SM501_OFF_HWC_LOC (0x04) | ||
251 | #define SM501_OFF_HWC_COLOR_1_2 (0x08) | ||
252 | #define SM501_OFF_HWC_COLOR_3 (0x0C) | ||
253 | |||
254 | #define SM501_DC_ALPHA_CONTROL (0x100) | ||
255 | #define SM501_DC_ALPHA_FB_ADDR (0x104) | ||
256 | #define SM501_DC_ALPHA_FB_OFFSET (0x108) | ||
257 | #define SM501_DC_ALPHA_TL_LOC (0x10C) | ||
258 | #define SM501_DC_ALPHA_BR_LOC (0x110) | ||
259 | #define SM501_DC_ALPHA_CHROMA_KEY (0x114) | ||
260 | #define SM501_DC_ALPHA_COLOR_LOOKUP (0x118) | ||
261 | |||
262 | #define SM501_DC_CRT_CONTROL (0x200) | ||
263 | |||
264 | #define SM501_DC_CRT_CONTROL_TVP (1<<15) | ||
265 | #define SM501_DC_CRT_CONTROL_CP (1<<14) | ||
266 | #define SM501_DC_CRT_CONTROL_VSP (1<<13) | ||
267 | #define SM501_DC_CRT_CONTROL_HSP (1<<12) | ||
268 | #define SM501_DC_CRT_CONTROL_VS (1<<11) | ||
269 | #define SM501_DC_CRT_CONTROL_BLANK (1<<10) | ||
270 | #define SM501_DC_CRT_CONTROL_SEL (1<<9) | ||
271 | #define SM501_DC_CRT_CONTROL_TE (1<<8) | ||
272 | #define SM501_DC_CRT_CONTROL_PIXEL_MASK (0xF << 4) | ||
273 | #define SM501_DC_CRT_CONTROL_GAMMA (1<<3) | ||
274 | #define SM501_DC_CRT_CONTROL_ENABLE (1<<2) | ||
275 | |||
276 | #define SM501_DC_CRT_CONTROL_8BPP (0<<0) | ||
277 | #define SM501_DC_CRT_CONTROL_16BPP (1<<0) | ||
278 | #define SM501_DC_CRT_CONTROL_32BPP (2<<0) | ||
279 | |||
280 | #define SM501_DC_CRT_FB_ADDR (0x204) | ||
281 | #define SM501_DC_CRT_FB_OFFSET (0x208) | ||
282 | #define SM501_DC_CRT_H_TOT (0x20C) | ||
283 | #define SM501_DC_CRT_H_SYNC (0x210) | ||
284 | #define SM501_DC_CRT_V_TOT (0x214) | ||
285 | #define SM501_DC_CRT_V_SYNC (0x218) | ||
286 | #define SM501_DC_CRT_SIGNATURE_ANALYZER (0x21C) | ||
287 | #define SM501_DC_CRT_CUR_LINE (0x220) | ||
288 | #define SM501_DC_CRT_MONITOR_DETECT (0x224) | ||
289 | |||
290 | #define SM501_DC_CRT_HWC_BASE (0x230) | ||
291 | #define SM501_DC_CRT_HWC_ADDR (0x230) | ||
292 | #define SM501_DC_CRT_HWC_LOC (0x234) | ||
293 | #define SM501_DC_CRT_HWC_COLOR_1_2 (0x238) | ||
294 | #define SM501_DC_CRT_HWC_COLOR_3 (0x23C) | ||
295 | |||
296 | #define SM501_DC_PANEL_PALETTE (0x400) | ||
297 | |||
298 | #define SM501_DC_VIDEO_PALETTE (0x800) | ||
299 | |||
300 | #define SM501_DC_CRT_PALETTE (0xC00) | ||
301 | |||
302 | /* Zoom Video port base */ | ||
303 | #define SM501_ZVPORT (0x090000) | ||
304 | |||
305 | /* AC97/I2S base */ | ||
306 | #define SM501_AC97 (0x0A0000) | ||
307 | |||
308 | /* 8051 micro controller base */ | ||
309 | #define SM501_UCONTROLLER (0x0B0000) | ||
310 | |||
311 | /* 8051 micro controller SRAM base */ | ||
312 | #define SM501_UCONTROLLER_SRAM (0x0C0000) | ||
313 | |||
314 | /* DMA base */ | ||
315 | #define SM501_DMA (0x0D0000) | ||
316 | |||
317 | /* 2d engine base */ | ||
318 | #define SM501_2D_ENGINE (0x100000) | ||
319 | #define SM501_2D_SOURCE (0x00) | ||
320 | #define SM501_2D_DESTINATION (0x04) | ||
321 | #define SM501_2D_DIMENSION (0x08) | ||
322 | #define SM501_2D_CONTROL (0x0C) | ||
323 | #define SM501_2D_PITCH (0x10) | ||
324 | #define SM501_2D_FOREGROUND (0x14) | ||
325 | #define SM501_2D_BACKGROUND (0x18) | ||
326 | #define SM501_2D_STRETCH (0x1C) | ||
327 | #define SM501_2D_COLOR_COMPARE (0x20) | ||
328 | #define SM501_2D_COLOR_COMPARE_MASK (0x24) | ||
329 | #define SM501_2D_MASK (0x28) | ||
330 | #define SM501_2D_CLIP_TL (0x2C) | ||
331 | #define SM501_2D_CLIP_BR (0x30) | ||
332 | #define SM501_2D_MONO_PATTERN_LOW (0x34) | ||
333 | #define SM501_2D_MONO_PATTERN_HIGH (0x38) | ||
334 | #define SM501_2D_WINDOW_WIDTH (0x3C) | ||
335 | #define SM501_2D_SOURCE_BASE (0x40) | ||
336 | #define SM501_2D_DESTINATION_BASE (0x44) | ||
337 | #define SM501_2D_ALPHA (0x48) | ||
338 | #define SM501_2D_WRAP (0x4C) | ||
339 | #define SM501_2D_STATUS (0x50) | ||
340 | |||
341 | #define SM501_CSC_Y_SOURCE_BASE (0xC8) | ||
342 | #define SM501_CSC_CONSTANTS (0xCC) | ||
343 | #define SM501_CSC_Y_SOURCE_X (0xD0) | ||
344 | #define SM501_CSC_Y_SOURCE_Y (0xD4) | ||
345 | #define SM501_CSC_U_SOURCE_BASE (0xD8) | ||
346 | #define SM501_CSC_V_SOURCE_BASE (0xDC) | ||
347 | #define SM501_CSC_SOURCE_DIMENSION (0xE0) | ||
348 | #define SM501_CSC_SOURCE_PITCH (0xE4) | ||
349 | #define SM501_CSC_DESTINATION (0xE8) | ||
350 | #define SM501_CSC_DESTINATION_DIMENSION (0xEC) | ||
351 | #define SM501_CSC_DESTINATION_PITCH (0xF0) | ||
352 | #define SM501_CSC_SCALE_FACTOR (0xF4) | ||
353 | #define SM501_CSC_DESTINATION_BASE (0xF8) | ||
354 | #define SM501_CSC_CONTROL (0xFC) | ||
355 | |||
356 | /* 2d engine data port base */ | ||
357 | #define SM501_2D_ENGINE_DATA (0x110000) | ||
diff --git a/include/linux/sm501.h b/include/linux/sm501.h new file mode 100644 index 000000000000..9e3aaad6fe4d --- /dev/null +++ b/include/linux/sm501.h | |||
@@ -0,0 +1,170 @@ | |||
1 | /* include/linux/sm501.h | ||
2 | * | ||
3 | * Copyright (c) 2006 Simtec Electronics | ||
4 | * Ben Dooks <ben@simtec.co.uk> | ||
5 | * Vincent Sanders <vince@simtec.co.uk> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License | ||
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | extern int sm501_unit_power(struct device *dev, | ||
22 | unsigned int unit, unsigned int to); | ||
23 | |||
24 | extern unsigned long sm501_set_clock(struct device *dev, | ||
25 | int clksrc, unsigned long freq); | ||
26 | |||
27 | extern unsigned long sm501_find_clock(int clksrc, unsigned long req_freq); | ||
28 | |||
29 | /* sm501_misc_control | ||
30 | * | ||
31 | * Modify the SM501's MISC_CONTROL register | ||
32 | */ | ||
33 | |||
34 | extern int sm501_misc_control(struct device *dev, | ||
35 | unsigned long set, unsigned long clear); | ||
36 | |||
37 | /* sm501_modify_reg | ||
38 | * | ||
39 | * Modify a register in the SM501 which may be shared with other | ||
40 | * drivers. | ||
41 | */ | ||
42 | |||
43 | extern unsigned long sm501_modify_reg(struct device *dev, | ||
44 | unsigned long reg, | ||
45 | unsigned long set, | ||
46 | unsigned long clear); | ||
47 | |||
48 | /* sm501_gpio_set | ||
49 | * | ||
50 | * set the state of the given GPIO line | ||
51 | */ | ||
52 | |||
53 | extern void sm501_gpio_set(struct device *dev, | ||
54 | unsigned long gpio, | ||
55 | unsigned int to, | ||
56 | unsigned int dir); | ||
57 | |||
58 | /* sm501_gpio_get | ||
59 | * | ||
60 | * get the state of the given GPIO line | ||
61 | */ | ||
62 | |||
63 | extern unsigned long sm501_gpio_get(struct device *dev, | ||
64 | unsigned long gpio); | ||
65 | |||
66 | |||
67 | /* Platform data definitions */ | ||
68 | |||
69 | #define SM501FB_FLAG_USE_INIT_MODE (1<<0) | ||
70 | #define SM501FB_FLAG_DISABLE_AT_EXIT (1<<1) | ||
71 | #define SM501FB_FLAG_USE_HWCURSOR (1<<2) | ||
72 | #define SM501FB_FLAG_USE_HWACCEL (1<<3) | ||
73 | |||
74 | struct sm501_platdata_fbsub { | ||
75 | struct fb_videomode *def_mode; | ||
76 | unsigned int def_bpp; | ||
77 | unsigned long max_mem; | ||
78 | unsigned int flags; | ||
79 | }; | ||
80 | |||
81 | enum sm501_fb_routing { | ||
82 | SM501_FB_OWN = 0, /* CRT=>CRT, Panel=>Panel */ | ||
83 | SM501_FB_CRT_PANEL = 1, /* Panel=>CRT, Panel=>Panel */ | ||
84 | }; | ||
85 | |||
86 | /* sm501_platdata_fb flag field bit definitions */ | ||
87 | |||
88 | #define SM501_FBPD_SWAP_FB_ENDIAN (1<<0) /* need to endian swap */ | ||
89 | |||
90 | /* sm501_platdata_fb | ||
91 | * | ||
92 | * configuration data for the framebuffer driver | ||
93 | */ | ||
94 | |||
95 | struct sm501_platdata_fb { | ||
96 | enum sm501_fb_routing fb_route; | ||
97 | unsigned int flags; | ||
98 | struct sm501_platdata_fbsub *fb_crt; | ||
99 | struct sm501_platdata_fbsub *fb_pnl; | ||
100 | }; | ||
101 | |||
102 | /* gpio i2c */ | ||
103 | |||
104 | struct sm501_platdata_gpio_i2c { | ||
105 | unsigned int pin_sda; | ||
106 | unsigned int pin_scl; | ||
107 | }; | ||
108 | |||
109 | /* sm501_initdata | ||
110 | * | ||
111 | * use for initialising values that may not have been setup | ||
112 | * before the driver is loaded. | ||
113 | */ | ||
114 | |||
115 | struct sm501_reg_init { | ||
116 | unsigned long set; | ||
117 | unsigned long mask; | ||
118 | }; | ||
119 | |||
120 | #define SM501_USE_USB_HOST (1<<0) | ||
121 | #define SM501_USE_USB_SLAVE (1<<1) | ||
122 | #define SM501_USE_SSP0 (1<<2) | ||
123 | #define SM501_USE_SSP1 (1<<3) | ||
124 | #define SM501_USE_UART0 (1<<4) | ||
125 | #define SM501_USE_UART1 (1<<5) | ||
126 | #define SM501_USE_FBACCEL (1<<6) | ||
127 | #define SM501_USE_AC97 (1<<7) | ||
128 | #define SM501_USE_I2S (1<<8) | ||
129 | |||
130 | #define SM501_USE_ALL (0xffffffff) | ||
131 | |||
132 | struct sm501_initdata { | ||
133 | struct sm501_reg_init gpio_low; | ||
134 | struct sm501_reg_init gpio_high; | ||
135 | struct sm501_reg_init misc_timing; | ||
136 | struct sm501_reg_init misc_control; | ||
137 | |||
138 | unsigned long devices; | ||
139 | unsigned long mclk; /* non-zero to modify */ | ||
140 | unsigned long m1xclk; /* non-zero to modify */ | ||
141 | }; | ||
142 | |||
143 | /* sm501_init_gpio | ||
144 | * | ||
145 | * default gpio settings | ||
146 | */ | ||
147 | |||
148 | struct sm501_init_gpio { | ||
149 | struct sm501_reg_init gpio_data_low; | ||
150 | struct sm501_reg_init gpio_data_high; | ||
151 | struct sm501_reg_init gpio_ddr_low; | ||
152 | struct sm501_reg_init gpio_ddr_high; | ||
153 | }; | ||
154 | |||
155 | /* sm501_platdata | ||
156 | * | ||
157 | * This is passed with the platform device to allow the board | ||
158 | * to control the behaviour of the SM501 driver(s) which attach | ||
159 | * to the device. | ||
160 | * | ||
161 | */ | ||
162 | |||
163 | struct sm501_platdata { | ||
164 | struct sm501_initdata *init; | ||
165 | struct sm501_init_gpio *init_gpiop; | ||
166 | struct sm501_platdata_fb *fb; | ||
167 | |||
168 | struct sm501_platdata_gpio_i2c *gpio_i2c; | ||
169 | unsigned int gpio_i2c_nr; | ||
170 | }; | ||
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 854aa6b543f1..802b3a38b041 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -40,6 +40,8 @@ enum | |||
40 | IPSTATS_MIB_FRAGCREATES, /* FragCreates */ | 40 | IPSTATS_MIB_FRAGCREATES, /* FragCreates */ |
41 | IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */ | 41 | IPSTATS_MIB_INMCASTPKTS, /* InMcastPkts */ |
42 | IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ | 42 | IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ |
43 | IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */ | ||
44 | IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ | ||
43 | __IPSTATS_MIB_MAX | 45 | __IPSTATS_MIB_MAX |
44 | }; | 46 | }; |
45 | 47 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index 28157a36e6cc..6e7c9483a6a6 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -16,7 +16,7 @@ struct __kernel_sockaddr_storage { | |||
16 | /* _SS_MAXSIZE value minus size of ss_family */ | 16 | /* _SS_MAXSIZE value minus size of ss_family */ |
17 | } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ | 17 | } __attribute__ ((aligned(_K_SS_ALIGNSIZE))); /* force desired alignment */ |
18 | 18 | ||
19 | #ifdef __KERNEL__ | 19 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) |
20 | 20 | ||
21 | #include <asm/socket.h> /* arch-dependent defines */ | 21 | #include <asm/socket.h> /* arch-dependent defines */ |
22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ | 22 | #include <linux/sockios.h> /* the SIOCxxx I/O controls */ |
@@ -188,7 +188,8 @@ struct ucred { | |||
188 | #define AF_TIPC 30 /* TIPC sockets */ | 188 | #define AF_TIPC 30 /* TIPC sockets */ |
189 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ | 189 | #define AF_BLUETOOTH 31 /* Bluetooth sockets */ |
190 | #define AF_IUCV 32 /* IUCV sockets */ | 190 | #define AF_IUCV 32 /* IUCV sockets */ |
191 | #define AF_MAX 33 /* For now.. */ | 191 | #define AF_RXRPC 33 /* RxRPC sockets */ |
192 | #define AF_MAX 34 /* For now.. */ | ||
192 | 193 | ||
193 | /* Protocol families, same as address families. */ | 194 | /* Protocol families, same as address families. */ |
194 | #define PF_UNSPEC AF_UNSPEC | 195 | #define PF_UNSPEC AF_UNSPEC |
@@ -222,6 +223,7 @@ struct ucred { | |||
222 | #define PF_TIPC AF_TIPC | 223 | #define PF_TIPC AF_TIPC |
223 | #define PF_BLUETOOTH AF_BLUETOOTH | 224 | #define PF_BLUETOOTH AF_BLUETOOTH |
224 | #define PF_IUCV AF_IUCV | 225 | #define PF_IUCV AF_IUCV |
226 | #define PF_RXRPC AF_RXRPC | ||
225 | #define PF_MAX AF_MAX | 227 | #define PF_MAX AF_MAX |
226 | 228 | ||
227 | /* Maximum queue length specifiable by listen. */ | 229 | /* Maximum queue length specifiable by listen. */ |
@@ -284,6 +286,7 @@ struct ucred { | |||
284 | #define SOL_DCCP 269 | 286 | #define SOL_DCCP 269 |
285 | #define SOL_NETLINK 270 | 287 | #define SOL_NETLINK 270 |
286 | #define SOL_TIPC 271 | 288 | #define SOL_TIPC 271 |
289 | #define SOL_RXRPC 272 | ||
287 | 290 | ||
288 | /* IPX options */ | 291 | /* IPX options */ |
289 | #define IPX_TYPE 1 | 292 | #define IPX_TYPE 1 |
diff --git a/include/linux/sony-laptop.h b/include/linux/sony-laptop.h new file mode 100644 index 000000000000..e2e036d94e4a --- /dev/null +++ b/include/linux/sony-laptop.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef _SONYLAPTOP_H_ | ||
2 | #define _SONYLAPTOP_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | #ifdef __KERNEL__ | ||
7 | |||
8 | /* used only for communication between v4l and sony-laptop */ | ||
9 | |||
10 | #define SONY_PIC_COMMAND_GETCAMERA 1 /* obsolete */ | ||
11 | #define SONY_PIC_COMMAND_SETCAMERA 2 | ||
12 | #define SONY_PIC_COMMAND_GETCAMERABRIGHTNESS 3 /* obsolete */ | ||
13 | #define SONY_PIC_COMMAND_SETCAMERABRIGHTNESS 4 | ||
14 | #define SONY_PIC_COMMAND_GETCAMERACONTRAST 5 /* obsolete */ | ||
15 | #define SONY_PIC_COMMAND_SETCAMERACONTRAST 6 | ||
16 | #define SONY_PIC_COMMAND_GETCAMERAHUE 7 /* obsolete */ | ||
17 | #define SONY_PIC_COMMAND_SETCAMERAHUE 8 | ||
18 | #define SONY_PIC_COMMAND_GETCAMERACOLOR 9 /* obsolete */ | ||
19 | #define SONY_PIC_COMMAND_SETCAMERACOLOR 10 | ||
20 | #define SONY_PIC_COMMAND_GETCAMERASHARPNESS 11 /* obsolete */ | ||
21 | #define SONY_PIC_COMMAND_SETCAMERASHARPNESS 12 | ||
22 | #define SONY_PIC_COMMAND_GETCAMERAPICTURE 13 /* obsolete */ | ||
23 | #define SONY_PIC_COMMAND_SETCAMERAPICTURE 14 | ||
24 | #define SONY_PIC_COMMAND_GETCAMERAAGC 15 /* obsolete */ | ||
25 | #define SONY_PIC_COMMAND_SETCAMERAAGC 16 | ||
26 | #define SONY_PIC_COMMAND_GETCAMERADIRECTION 17 /* obsolete */ | ||
27 | #define SONY_PIC_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ | ||
28 | #define SONY_PIC_COMMAND_GETCAMERAREVISION 19 /* obsolete */ | ||
29 | |||
30 | int sony_pic_camera_command(int command, u8 value); | ||
31 | |||
32 | #endif /* __KERNEL__ */ | ||
33 | |||
34 | #endif /* _SONYLAPTOP_H_ */ | ||
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index 2e8c048b9b80..9dbca629dcfb 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -25,7 +25,6 @@ struct spi_bitbang { | |||
25 | spinlock_t lock; | 25 | spinlock_t lock; |
26 | struct list_head queue; | 26 | struct list_head queue; |
27 | u8 busy; | 27 | u8 busy; |
28 | u8 shutdown; | ||
29 | u8 use_dma; | 28 | u8 use_dma; |
30 | 29 | ||
31 | struct spi_master *master; | 30 | struct spi_master *master; |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 61fef376ed2e..a946176db638 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -283,6 +283,43 @@ do { \ | |||
283 | }) | 283 | }) |
284 | 284 | ||
285 | /* | 285 | /* |
286 | * Locks two spinlocks l1 and l2. | ||
287 | * l1_first indicates if spinlock l1 should be taken first. | ||
288 | */ | ||
289 | static inline void double_spin_lock(spinlock_t *l1, spinlock_t *l2, | ||
290 | bool l1_first) | ||
291 | __acquires(l1) | ||
292 | __acquires(l2) | ||
293 | { | ||
294 | if (l1_first) { | ||
295 | spin_lock(l1); | ||
296 | spin_lock(l2); | ||
297 | } else { | ||
298 | spin_lock(l2); | ||
299 | spin_lock(l1); | ||
300 | } | ||
301 | } | ||
302 | |||
303 | /* | ||
304 | * Unlocks two spinlocks l1 and l2. | ||
305 | * l1_taken_first indicates if spinlock l1 was taken first and therefore | ||
306 | * should be released after spinlock l2. | ||
307 | */ | ||
308 | static inline void double_spin_unlock(spinlock_t *l1, spinlock_t *l2, | ||
309 | bool l1_taken_first) | ||
310 | __releases(l1) | ||
311 | __releases(l2) | ||
312 | { | ||
313 | if (l1_taken_first) { | ||
314 | spin_unlock(l2); | ||
315 | spin_unlock(l1); | ||
316 | } else { | ||
317 | spin_unlock(l1); | ||
318 | spin_unlock(l2); | ||
319 | } | ||
320 | } | ||
321 | |||
322 | /* | ||
286 | * Pull the atomic_t declaration: | 323 | * Pull the atomic_t declaration: |
287 | * (asm-mips/atomic.h needs above definitions) | 324 | * (asm-mips/atomic.h needs above definitions) |
288 | */ | 325 | */ |
diff --git a/include/linux/stat.h b/include/linux/stat.h index 4f8539ccff6c..679ef0d70b6b 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -7,7 +7,7 @@ | |||
7 | 7 | ||
8 | #endif | 8 | #endif |
9 | 9 | ||
10 | #ifdef __KERNEL__ | 10 | #if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) |
11 | 11 | ||
12 | #define S_IFMT 00170000 | 12 | #define S_IFMT 00170000 |
13 | #define S_IFSOCK 0140000 | 13 | #define S_IFSOCK 0140000 |
diff --git a/include/linux/string.h b/include/linux/string.h index 4f69ef9e6eb5..7f2eb6a477f9 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -47,6 +47,12 @@ extern int strncmp(const char *,const char *,__kernel_size_t); | |||
47 | #ifndef __HAVE_ARCH_STRNICMP | 47 | #ifndef __HAVE_ARCH_STRNICMP |
48 | extern int strnicmp(const char *, const char *, __kernel_size_t); | 48 | extern int strnicmp(const char *, const char *, __kernel_size_t); |
49 | #endif | 49 | #endif |
50 | #ifndef __HAVE_ARCH_STRCASECMP | ||
51 | extern int strcasecmp(const char *s1, const char *s2); | ||
52 | #endif | ||
53 | #ifndef __HAVE_ARCH_STRNCASECMP | ||
54 | extern int strncasecmp(const char *s1, const char *s2, size_t n); | ||
55 | #endif | ||
50 | #ifndef __HAVE_ARCH_STRCHR | 56 | #ifndef __HAVE_ARCH_STRCHR |
51 | extern char * strchr(const char *,int); | 57 | extern char * strchr(const char *,int); |
52 | #endif | 58 | #endif |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index de9fc576fa1c..3069ecca0129 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -150,10 +150,10 @@ struct rpc_call_ops { | |||
150 | #define RPC_TASK_HAS_TIMER 3 | 150 | #define RPC_TASK_HAS_TIMER 3 |
151 | #define RPC_TASK_ACTIVE 4 | 151 | #define RPC_TASK_ACTIVE 4 |
152 | 152 | ||
153 | #define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 153 | #define RPC_IS_RUNNING(t) test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
154 | #define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 154 | #define rpc_set_running(t) set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
155 | #define rpc_test_and_set_running(t) \ | 155 | #define rpc_test_and_set_running(t) \ |
156 | (test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) | 156 | test_and_set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate) |
157 | #define rpc_clear_running(t) \ | 157 | #define rpc_clear_running(t) \ |
158 | do { \ | 158 | do { \ |
159 | smp_mb__before_clear_bit(); \ | 159 | smp_mb__before_clear_bit(); \ |
@@ -161,8 +161,8 @@ struct rpc_call_ops { | |||
161 | smp_mb__after_clear_bit(); \ | 161 | smp_mb__after_clear_bit(); \ |
162 | } while (0) | 162 | } while (0) |
163 | 163 | ||
164 | #define RPC_IS_QUEUED(t) (test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)) | 164 | #define RPC_IS_QUEUED(t) test_bit(RPC_TASK_QUEUED, &(t)->tk_runstate) |
165 | #define rpc_set_queued(t) (set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate)) | 165 | #define rpc_set_queued(t) set_bit(RPC_TASK_QUEUED, &(t)->tk_runstate) |
166 | #define rpc_clear_queued(t) \ | 166 | #define rpc_clear_queued(t) \ |
167 | do { \ | 167 | do { \ |
168 | smp_mb__before_clear_bit(); \ | 168 | smp_mb__before_clear_bit(); \ |
@@ -179,7 +179,7 @@ struct rpc_call_ops { | |||
179 | smp_mb__after_clear_bit(); \ | 179 | smp_mb__after_clear_bit(); \ |
180 | } while (0) | 180 | } while (0) |
181 | 181 | ||
182 | #define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate)) | 182 | #define RPC_IS_ACTIVATED(t) test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate) |
183 | 183 | ||
184 | /* | 184 | /* |
185 | * Task priorities. | 185 | * Task priorities. |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 83b3c7b433aa..35fa4d5aadd0 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -194,9 +194,7 @@ static inline void svc_putu32(struct kvec *iov, __be32 val) | |||
194 | 194 | ||
195 | union svc_addr_u { | 195 | union svc_addr_u { |
196 | struct in_addr addr; | 196 | struct in_addr addr; |
197 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | ||
198 | struct in6_addr addr6; | 197 | struct in6_addr addr6; |
199 | #endif | ||
200 | }; | 198 | }; |
201 | 199 | ||
202 | /* | 200 | /* |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index cccea0a0feb4..7909687557bf 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -66,7 +66,7 @@ struct svc_sock { | |||
66 | * Function prototypes. | 66 | * Function prototypes. |
67 | */ | 67 | */ |
68 | int svc_makesock(struct svc_serv *, int, unsigned short, int flags); | 68 | int svc_makesock(struct svc_serv *, int, unsigned short, int flags); |
69 | void svc_close_socket(struct svc_sock *); | 69 | void svc_force_close_socket(struct svc_sock *); |
70 | int svc_recv(struct svc_rqst *, long); | 70 | int svc_recv(struct svc_rqst *, long); |
71 | int svc_send(struct svc_rqst *); | 71 | int svc_send(struct svc_rqst *); |
72 | void svc_drop(struct svc_rqst *); | 72 | void svc_drop(struct svc_rqst *); |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index ec639aa3a1d3..ceb6cc5ceebb 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -108,7 +108,10 @@ extern void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | |||
108 | #else | 108 | #else |
109 | 109 | ||
110 | #define make_migration_entry(page, write) swp_entry(0, 0) | 110 | #define make_migration_entry(page, write) swp_entry(0, 0) |
111 | #define is_migration_entry(swp) 0 | 111 | static inline int is_migration_entry(swp_entry_t swp) |
112 | { | ||
113 | return 0; | ||
114 | } | ||
112 | #define migration_entry_to_page(swp) NULL | 115 | #define migration_entry_to_page(swp) NULL |
113 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } | 116 | static inline void make_migration_entry_read(swp_entry_t *entryp) { } |
114 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, | 117 | static inline void migration_entry_wait(struct mm_struct *mm, pmd_t *pmd, |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 2c5fb38d9392..47f1c53332ce 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -290,6 +290,7 @@ enum | |||
290 | NET_CORE_BUDGET=19, | 290 | NET_CORE_BUDGET=19, |
291 | NET_CORE_AEVENT_ETIME=20, | 291 | NET_CORE_AEVENT_ETIME=20, |
292 | NET_CORE_AEVENT_RSEQTH=21, | 292 | NET_CORE_AEVENT_RSEQTH=21, |
293 | NET_CORE_WARNINGS=22, | ||
293 | }; | 294 | }; |
294 | 295 | ||
295 | /* /proc/sys/net/ethernet */ | 296 | /* /proc/sys/net/ethernet */ |
@@ -438,6 +439,8 @@ enum | |||
438 | NET_CIPSOV4_RBM_STRICTVALID=121, | 439 | NET_CIPSOV4_RBM_STRICTVALID=121, |
439 | NET_TCP_AVAIL_CONG_CONTROL=122, | 440 | NET_TCP_AVAIL_CONG_CONTROL=122, |
440 | NET_TCP_ALLOWED_CONG_CONTROL=123, | 441 | NET_TCP_ALLOWED_CONG_CONTROL=123, |
442 | NET_TCP_MAX_SSTHRESH=124, | ||
443 | NET_TCP_FRTO_RESPONSE=125, | ||
441 | }; | 444 | }; |
442 | 445 | ||
443 | enum { | 446 | enum { |
@@ -580,6 +583,7 @@ enum { | |||
580 | NET_IPV6_RTR_PROBE_INTERVAL=21, | 583 | NET_IPV6_RTR_PROBE_INTERVAL=21, |
581 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | 584 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, |
582 | NET_IPV6_PROXY_NDP=23, | 585 | NET_IPV6_PROXY_NDP=23, |
586 | NET_IPV6_ACCEPT_SOURCE_ROUTE=25, | ||
583 | __NET_IPV6_MAX | 587 | __NET_IPV6_MAX |
584 | }; | 588 | }; |
585 | 589 | ||
@@ -788,6 +792,7 @@ enum { | |||
788 | NET_BRIDGE_NF_CALL_IPTABLES = 2, | 792 | NET_BRIDGE_NF_CALL_IPTABLES = 2, |
789 | NET_BRIDGE_NF_CALL_IP6TABLES = 3, | 793 | NET_BRIDGE_NF_CALL_IP6TABLES = 3, |
790 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, | 794 | NET_BRIDGE_NF_FILTER_VLAN_TAGGED = 4, |
795 | NET_BRIDGE_NF_FILTER_PPPOE_TAGGED = 5, | ||
791 | }; | 796 | }; |
792 | 797 | ||
793 | /* CTL_FS names: */ | 798 | /* CTL_FS names: */ |
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 192de3afa96b..7d5d1ec95c2e 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -11,12 +11,14 @@ | |||
11 | #define _SYSFS_H_ | 11 | #define _SYSFS_H_ |
12 | 12 | ||
13 | #include <linux/compiler.h> | 13 | #include <linux/compiler.h> |
14 | #include <linux/errno.h> | ||
14 | #include <linux/list.h> | 15 | #include <linux/list.h> |
15 | #include <asm/atomic.h> | 16 | #include <asm/atomic.h> |
16 | 17 | ||
17 | struct kobject; | 18 | struct kobject; |
18 | struct module; | 19 | struct module; |
19 | struct nameidata; | 20 | struct nameidata; |
21 | struct dentry; | ||
20 | 22 | ||
21 | struct attribute { | 23 | struct attribute { |
22 | const char * name; | 24 | const char * name; |
@@ -68,18 +70,6 @@ struct sysfs_ops { | |||
68 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); | 70 | ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); |
69 | }; | 71 | }; |
70 | 72 | ||
71 | struct sysfs_dirent { | ||
72 | atomic_t s_count; | ||
73 | struct list_head s_sibling; | ||
74 | struct list_head s_children; | ||
75 | void * s_element; | ||
76 | int s_type; | ||
77 | umode_t s_mode; | ||
78 | struct dentry * s_dentry; | ||
79 | struct iattr * s_iattr; | ||
80 | atomic_t s_event; | ||
81 | }; | ||
82 | |||
83 | #define SYSFS_ROOT 0x0001 | 73 | #define SYSFS_ROOT 0x0001 |
84 | #define SYSFS_DIR 0x0002 | 74 | #define SYSFS_DIR 0x0002 |
85 | #define SYSFS_KOBJ_ATTR 0x0004 | 75 | #define SYSFS_KOBJ_ATTR 0x0004 |
@@ -89,6 +79,9 @@ struct sysfs_dirent { | |||
89 | 79 | ||
90 | #ifdef CONFIG_SYSFS | 80 | #ifdef CONFIG_SYSFS |
91 | 81 | ||
82 | extern int sysfs_schedule_callback(struct kobject *kobj, | ||
83 | void (*func)(void *), void *data, struct module *owner); | ||
84 | |||
92 | extern int __must_check | 85 | extern int __must_check |
93 | sysfs_create_dir(struct kobject *, struct dentry *); | 86 | sysfs_create_dir(struct kobject *, struct dentry *); |
94 | 87 | ||
@@ -126,6 +119,11 @@ void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | |||
126 | int __must_check sysfs_create_group(struct kobject *, | 119 | int __must_check sysfs_create_group(struct kobject *, |
127 | const struct attribute_group *); | 120 | const struct attribute_group *); |
128 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 121 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
122 | int sysfs_add_file_to_group(struct kobject *kobj, | ||
123 | const struct attribute *attr, const char *group); | ||
124 | void sysfs_remove_file_from_group(struct kobject *kobj, | ||
125 | const struct attribute *attr, const char *group); | ||
126 | |||
129 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | 127 | void sysfs_notify(struct kobject * k, char *dir, char *attr); |
130 | 128 | ||
131 | 129 | ||
@@ -138,6 +136,12 @@ extern int __must_check sysfs_init(void); | |||
138 | 136 | ||
139 | #else /* CONFIG_SYSFS */ | 137 | #else /* CONFIG_SYSFS */ |
140 | 138 | ||
139 | static inline int sysfs_schedule_callback(struct kobject *kobj, | ||
140 | void (*func)(void *), void *data, struct module *owner) | ||
141 | { | ||
142 | return -ENOSYS; | ||
143 | } | ||
144 | |||
141 | static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) | 145 | static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) |
142 | { | 146 | { |
143 | return 0; | 147 | return 0; |
@@ -210,6 +214,17 @@ static inline void sysfs_remove_group(struct kobject * k, const struct attribute | |||
210 | ; | 214 | ; |
211 | } | 215 | } |
212 | 216 | ||
217 | static inline int sysfs_add_file_to_group(struct kobject *kobj, | ||
218 | const struct attribute *attr, const char *group) | ||
219 | { | ||
220 | return 0; | ||
221 | } | ||
222 | |||
223 | static inline void sysfs_remove_file_from_group(struct kobject *kobj, | ||
224 | const struct attribute *attr, const char *group) | ||
225 | { | ||
226 | } | ||
227 | |||
213 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | 228 | static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) |
214 | { | 229 | { |
215 | } | 230 | } |
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index 3fced4798255..a46104a28f66 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -31,7 +31,7 @@ | |||
31 | */ | 31 | */ |
32 | 32 | ||
33 | 33 | ||
34 | #define TASKSTATS_VERSION 3 | 34 | #define TASKSTATS_VERSION 4 |
35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | 35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN |
36 | * in linux/sched.h */ | 36 | * in linux/sched.h */ |
37 | 37 | ||
@@ -66,7 +66,7 @@ struct taskstats { | |||
66 | /* Delay waiting for cpu, while runnable | 66 | /* Delay waiting for cpu, while runnable |
67 | * count, delay_total NOT updated atomically | 67 | * count, delay_total NOT updated atomically |
68 | */ | 68 | */ |
69 | __u64 cpu_count; | 69 | __u64 cpu_count __attribute__((aligned(8))); |
70 | __u64 cpu_delay_total; | 70 | __u64 cpu_delay_total; |
71 | 71 | ||
72 | /* Following four fields atomically updated using task->delays->lock */ | 72 | /* Following four fields atomically updated using task->delays->lock */ |
@@ -101,14 +101,17 @@ struct taskstats { | |||
101 | 101 | ||
102 | /* Basic Accounting Fields start */ | 102 | /* Basic Accounting Fields start */ |
103 | char ac_comm[TS_COMM_LEN]; /* Command name */ | 103 | char ac_comm[TS_COMM_LEN]; /* Command name */ |
104 | __u8 ac_sched; /* Scheduling discipline */ | 104 | __u8 ac_sched __attribute__((aligned(8))); |
105 | /* Scheduling discipline */ | ||
105 | __u8 ac_pad[3]; | 106 | __u8 ac_pad[3]; |
106 | __u32 ac_uid; /* User ID */ | 107 | __u32 ac_uid __attribute__((aligned(8))); |
108 | /* User ID */ | ||
107 | __u32 ac_gid; /* Group ID */ | 109 | __u32 ac_gid; /* Group ID */ |
108 | __u32 ac_pid; /* Process ID */ | 110 | __u32 ac_pid; /* Process ID */ |
109 | __u32 ac_ppid; /* Parent process ID */ | 111 | __u32 ac_ppid; /* Parent process ID */ |
110 | __u32 ac_btime; /* Begin time [sec since 1970] */ | 112 | __u32 ac_btime; /* Begin time [sec since 1970] */ |
111 | __u64 ac_etime; /* Elapsed time [usec] */ | 113 | __u64 ac_etime __attribute__((aligned(8))); |
114 | /* Elapsed time [usec] */ | ||
112 | __u64 ac_utime; /* User CPU time [usec] */ | 115 | __u64 ac_utime; /* User CPU time [usec] */ |
113 | __u64 ac_stime; /* SYstem CPU time [usec] */ | 116 | __u64 ac_stime; /* SYstem CPU time [usec] */ |
114 | __u64 ac_minflt; /* Minor Page Fault Count */ | 117 | __u64 ac_minflt; /* Minor Page Fault Count */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 29d3089038ab..c6b9f92e8289 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -178,6 +178,21 @@ struct tcp_md5sig { | |||
178 | #include <net/inet_connection_sock.h> | 178 | #include <net/inet_connection_sock.h> |
179 | #include <net/inet_timewait_sock.h> | 179 | #include <net/inet_timewait_sock.h> |
180 | 180 | ||
181 | static inline struct tcphdr *tcp_hdr(const struct sk_buff *skb) | ||
182 | { | ||
183 | return (struct tcphdr *)skb_transport_header(skb); | ||
184 | } | ||
185 | |||
186 | static inline unsigned int tcp_hdrlen(const struct sk_buff *skb) | ||
187 | { | ||
188 | return tcp_hdr(skb)->doff * 4; | ||
189 | } | ||
190 | |||
191 | static inline unsigned int tcp_optlen(const struct sk_buff *skb) | ||
192 | { | ||
193 | return (tcp_hdr(skb)->doff - 5) * 4; | ||
194 | } | ||
195 | |||
181 | /* This defines a selective acknowledgement block. */ | 196 | /* This defines a selective acknowledgement block. */ |
182 | struct tcp_sack_block_wire { | 197 | struct tcp_sack_block_wire { |
183 | __be32 start_seq; | 198 | __be32 start_seq; |
@@ -242,6 +257,8 @@ struct tcp_sock { | |||
242 | * See RFC793 and RFC1122. The RFC writes these in capitals. | 257 | * See RFC793 and RFC1122. The RFC writes these in capitals. |
243 | */ | 258 | */ |
244 | u32 rcv_nxt; /* What we want to receive next */ | 259 | u32 rcv_nxt; /* What we want to receive next */ |
260 | u32 copied_seq; /* Head of yet unread data */ | ||
261 | u32 rcv_wup; /* rcv_nxt on last window update sent */ | ||
245 | u32 snd_nxt; /* Next sequence we send */ | 262 | u32 snd_nxt; /* Next sequence we send */ |
246 | 263 | ||
247 | u32 snd_una; /* First byte we want an ack for */ | 264 | u32 snd_una; /* First byte we want an ack for */ |
@@ -300,17 +317,15 @@ struct tcp_sock { | |||
300 | u32 snd_ssthresh; /* Slow start size threshold */ | 317 | u32 snd_ssthresh; /* Slow start size threshold */ |
301 | u32 snd_cwnd; /* Sending congestion window */ | 318 | u32 snd_cwnd; /* Sending congestion window */ |
302 | u16 snd_cwnd_cnt; /* Linear increase counter */ | 319 | u16 snd_cwnd_cnt; /* Linear increase counter */ |
303 | u16 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ | 320 | u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ |
304 | u32 snd_cwnd_used; | 321 | u32 snd_cwnd_used; |
305 | u32 snd_cwnd_stamp; | 322 | u32 snd_cwnd_stamp; |
306 | 323 | ||
307 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 324 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ |
308 | 325 | ||
309 | u32 rcv_wnd; /* Current receiver window */ | 326 | u32 rcv_wnd; /* Current receiver window */ |
310 | u32 rcv_wup; /* rcv_nxt on last window update sent */ | ||
311 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ | 327 | u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ |
312 | u32 pushed_seq; /* Last pushed seq, required to talk to windows */ | 328 | u32 pushed_seq; /* Last pushed seq, required to talk to windows */ |
313 | u32 copied_seq; /* Head of yet unread data */ | ||
314 | 329 | ||
315 | /* SACKs data */ | 330 | /* SACKs data */ |
316 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 331 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 6c5a6e6e813b..a9d1f049cc15 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -96,7 +96,6 @@ | |||
96 | .busy_factor = 64, \ | 96 | .busy_factor = 64, \ |
97 | .imbalance_pct = 110, \ | 97 | .imbalance_pct = 110, \ |
98 | .cache_nice_tries = 0, \ | 98 | .cache_nice_tries = 0, \ |
99 | .per_cpu_gain = 25, \ | ||
100 | .busy_idx = 0, \ | 99 | .busy_idx = 0, \ |
101 | .idle_idx = 0, \ | 100 | .idle_idx = 0, \ |
102 | .newidle_idx = 1, \ | 101 | .newidle_idx = 1, \ |
@@ -128,7 +127,6 @@ | |||
128 | .busy_factor = 64, \ | 127 | .busy_factor = 64, \ |
129 | .imbalance_pct = 125, \ | 128 | .imbalance_pct = 125, \ |
130 | .cache_nice_tries = 1, \ | 129 | .cache_nice_tries = 1, \ |
131 | .per_cpu_gain = 100, \ | ||
132 | .busy_idx = 2, \ | 130 | .busy_idx = 2, \ |
133 | .idle_idx = 1, \ | 131 | .idle_idx = 1, \ |
134 | .newidle_idx = 2, \ | 132 | .newidle_idx = 2, \ |
@@ -159,7 +157,6 @@ | |||
159 | .busy_factor = 64, \ | 157 | .busy_factor = 64, \ |
160 | .imbalance_pct = 125, \ | 158 | .imbalance_pct = 125, \ |
161 | .cache_nice_tries = 1, \ | 159 | .cache_nice_tries = 1, \ |
162 | .per_cpu_gain = 100, \ | ||
163 | .busy_idx = 2, \ | 160 | .busy_idx = 2, \ |
164 | .idle_idx = 1, \ | 161 | .idle_idx = 1, \ |
165 | .newidle_idx = 2, \ | 162 | .newidle_idx = 2, \ |
@@ -193,7 +190,6 @@ | |||
193 | .newidle_idx = 0, /* unused */ \ | 190 | .newidle_idx = 0, /* unused */ \ |
194 | .wake_idx = 0, /* unused */ \ | 191 | .wake_idx = 0, /* unused */ \ |
195 | .forkexec_idx = 0, /* unused */ \ | 192 | .forkexec_idx = 0, /* unused */ \ |
196 | .per_cpu_gain = 100, \ | ||
197 | .flags = SD_LOAD_BALANCE \ | 193 | .flags = SD_LOAD_BALANCE \ |
198 | | SD_SERIALIZE, \ | 194 | | SD_SERIALIZE, \ |
199 | .last_balance = jiffies, \ | 195 | .last_balance = jiffies, \ |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 7e08c07efe0f..6de445c31a64 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -26,6 +26,15 @@ struct udphdr { | |||
26 | __sum16 check; | 26 | __sum16 check; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | #ifdef __KERNEL__ | ||
30 | #include <linux/skbuff.h> | ||
31 | |||
32 | static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | ||
33 | { | ||
34 | return (struct udphdr *)skb_transport_header(skb); | ||
35 | } | ||
36 | #endif | ||
37 | |||
29 | /* UDP socket options */ | 38 | /* UDP socket options */ |
30 | #define UDP_CORK 1 /* Never send partially complete segments */ | 39 | #define UDP_CORK 1 /* Never send partially complete segments */ |
31 | #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ | 40 | #define UDP_ENCAP 100 /* Set the socket to accept encapsulated packets */ |
diff --git a/include/linux/ufs_fs.h b/include/linux/ufs_fs.h index dc2e9fe69418..daeba22b7656 100644 --- a/include/linux/ufs_fs.h +++ b/include/linux/ufs_fs.h | |||
@@ -649,10 +649,10 @@ struct ufs2_inode { | |||
649 | __fs32 ui_blksize; /* 12: Inode blocksize. */ | 649 | __fs32 ui_blksize; /* 12: Inode blocksize. */ |
650 | __fs64 ui_size; /* 16: File byte count. */ | 650 | __fs64 ui_size; /* 16: File byte count. */ |
651 | __fs64 ui_blocks; /* 24: Bytes actually held. */ | 651 | __fs64 ui_blocks; /* 24: Bytes actually held. */ |
652 | struct ufs_timeval ui_atime; /* 32: Last access time. */ | 652 | __fs64 ui_atime; /* 32: Last access time. */ |
653 | struct ufs_timeval ui_mtime; /* 40: Last modified time. */ | 653 | __fs64 ui_mtime; /* 40: Last modified time. */ |
654 | struct ufs_timeval ui_ctime; /* 48: Last inode change time. */ | 654 | __fs64 ui_ctime; /* 48: Last inode change time. */ |
655 | struct ufs_timeval ui_birthtime; /* 56: Inode creation time. */ | 655 | __fs64 ui_birthtime; /* 56: Inode creation time. */ |
656 | __fs32 ui_mtimensec; /* 64: Last modified time. */ | 656 | __fs32 ui_mtimensec; /* 64: Last modified time. */ |
657 | __fs32 ui_atimensec; /* 68: Last access time. */ | 657 | __fs32 ui_atimensec; /* 68: Last access time. */ |
658 | __fs32 ui_ctimensec; /* 72: Last inode change time. */ | 658 | __fs32 ui_ctimensec; /* 72: Last inode change time. */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index b5c226a87ed8..cfbd2bb8fa2c 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -299,8 +299,9 @@ struct usb_bus { | |||
299 | int bandwidth_int_reqs; /* number of Interrupt requests */ | 299 | int bandwidth_int_reqs; /* number of Interrupt requests */ |
300 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ | 300 | int bandwidth_isoc_reqs; /* number of Isoc. requests */ |
301 | 301 | ||
302 | #ifdef CONFIG_USB_DEVICEFS | ||
302 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 303 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
303 | 304 | #endif | |
304 | struct class_device *class_dev; /* class device for this bus */ | 305 | struct class_device *class_dev; /* class device for this bus */ |
305 | 306 | ||
306 | #if defined(CONFIG_USB_MON) | 307 | #if defined(CONFIG_USB_MON) |
@@ -373,9 +374,12 @@ struct usb_device { | |||
373 | char *serial; /* iSerialNumber string, if present */ | 374 | char *serial; /* iSerialNumber string, if present */ |
374 | 375 | ||
375 | struct list_head filelist; | 376 | struct list_head filelist; |
376 | struct device *usbfs_dev; | 377 | #ifdef CONFIG_USB_DEVICE_CLASS |
378 | struct device *usb_classdev; | ||
379 | #endif | ||
380 | #ifdef CONFIG_USB_DEVICEFS | ||
377 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ | 381 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the device */ |
378 | 382 | #endif | |
379 | /* | 383 | /* |
380 | * Child devices - these can be either new devices | 384 | * Child devices - these can be either new devices |
381 | * (if this is a hub device), or different instances | 385 | * (if this is a hub device), or different instances |
@@ -388,12 +392,19 @@ struct usb_device { | |||
388 | struct usb_device *children[USB_MAXCHILDREN]; | 392 | struct usb_device *children[USB_MAXCHILDREN]; |
389 | 393 | ||
390 | int pm_usage_cnt; /* usage counter for autosuspend */ | 394 | int pm_usage_cnt; /* usage counter for autosuspend */ |
395 | u32 quirks; /* quirks of the whole device */ | ||
396 | |||
391 | #ifdef CONFIG_PM | 397 | #ifdef CONFIG_PM |
392 | struct delayed_work autosuspend; /* for delayed autosuspends */ | 398 | struct delayed_work autosuspend; /* for delayed autosuspends */ |
393 | struct mutex pm_mutex; /* protects PM operations */ | 399 | struct mutex pm_mutex; /* protects PM operations */ |
394 | 400 | ||
401 | unsigned long last_busy; /* time of last use */ | ||
402 | int autosuspend_delay; /* in jiffies */ | ||
403 | |||
395 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | 404 | unsigned auto_pm:1; /* autosuspend/resume in progress */ |
396 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | 405 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ |
406 | unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ | ||
407 | unsigned autoresume_disabled:1; /* disabled by the user */ | ||
397 | #endif | 408 | #endif |
398 | }; | 409 | }; |
399 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 410 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
@@ -433,6 +444,11 @@ static inline void usb_autopm_disable(struct usb_interface *intf) | |||
433 | usb_autopm_set_interface(intf); | 444 | usb_autopm_set_interface(intf); |
434 | } | 445 | } |
435 | 446 | ||
447 | static inline void usb_mark_last_busy(struct usb_device *udev) | ||
448 | { | ||
449 | udev->last_busy = jiffies; | ||
450 | } | ||
451 | |||
436 | #else | 452 | #else |
437 | 453 | ||
438 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | 454 | static inline int usb_autopm_set_interface(struct usb_interface *intf) |
@@ -447,6 +463,8 @@ static inline void usb_autopm_enable(struct usb_interface *intf) | |||
447 | { } | 463 | { } |
448 | static inline void usb_autopm_disable(struct usb_interface *intf) | 464 | static inline void usb_autopm_disable(struct usb_interface *intf) |
449 | { } | 465 | { } |
466 | static inline void usb_mark_last_busy(struct usb_device *udev) | ||
467 | { } | ||
450 | #endif | 468 | #endif |
451 | 469 | ||
452 | /*-------------------------------------------------------------------------*/ | 470 | /*-------------------------------------------------------------------------*/ |
@@ -935,7 +953,7 @@ struct usb_iso_packet_descriptor { | |||
935 | unsigned int offset; | 953 | unsigned int offset; |
936 | unsigned int length; /* expected length */ | 954 | unsigned int length; /* expected length */ |
937 | unsigned int actual_length; | 955 | unsigned int actual_length; |
938 | unsigned int status; | 956 | int status; |
939 | }; | 957 | }; |
940 | 958 | ||
941 | struct urb; | 959 | struct urb; |
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h index ba617c372455..2204ae22c381 100644 --- a/include/linux/usb/cdc.h +++ b/include/linux/usb/cdc.h | |||
@@ -73,6 +73,13 @@ struct usb_cdc_acm_descriptor { | |||
73 | __u8 bmCapabilities; | 73 | __u8 bmCapabilities; |
74 | } __attribute__ ((packed)); | 74 | } __attribute__ ((packed)); |
75 | 75 | ||
76 | /* capabilities from 5.2.3.3 */ | ||
77 | |||
78 | #define USB_CDC_COMM_FEATURE 0x01 | ||
79 | #define USB_CDC_CAP_LINE 0x02 | ||
80 | #define USB_CDC_CAP_BRK 0x04 | ||
81 | #define USB_CDC_CAP_NOTIFY 0x08 | ||
82 | |||
76 | /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ | 83 | /* "Union Functional Descriptor" from CDC spec 5.2.3.8 */ |
77 | struct usb_cdc_union_desc { | 84 | struct usb_cdc_union_desc { |
78 | __u8 bLength; | 85 | __u8 bLength; |
@@ -84,6 +91,17 @@ struct usb_cdc_union_desc { | |||
84 | /* ... and there could be other slave interfaces */ | 91 | /* ... and there could be other slave interfaces */ |
85 | } __attribute__ ((packed)); | 92 | } __attribute__ ((packed)); |
86 | 93 | ||
94 | /* "Country Selection Functional Descriptor" from CDC spec 5.2.3.9 */ | ||
95 | struct usb_cdc_country_functional_desc { | ||
96 | __u8 bLength; | ||
97 | __u8 bDescriptorType; | ||
98 | __u8 bDescriptorSubType; | ||
99 | |||
100 | __u8 iCountryCodeRelDate; | ||
101 | __le16 wCountyCode0; | ||
102 | /* ... and there can be a lot of country codes */ | ||
103 | } __attribute__ ((packed)); | ||
104 | |||
87 | /* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */ | 105 | /* "Network Channel Terminal Functional Descriptor" from CDC spec 5.2.3.11 */ |
88 | struct usb_cdc_network_terminal_desc { | 106 | struct usb_cdc_network_terminal_desc { |
89 | __u8 bLength; | 107 | __u8 bLength; |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index ae7833749fa2..6169438ec5a2 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -1,8 +1,9 @@ | |||
1 | /* | 1 | /* |
2 | * This file holds USB constants and structures that are needed for USB | 2 | * This file holds USB constants and structures that are needed for |
3 | * device APIs. These are used by the USB device model, which is defined | 3 | * USB device APIs. These are used by the USB device model, which is |
4 | * in chapter 9 of the USB 2.0 specification. Linux has several APIs in C | 4 | * defined in chapter 9 of the USB 2.0 specification and in the |
5 | * that need these: | 5 | * Wireless USB 1.0 (spread around). Linux has several APIs in C that |
6 | * need these: | ||
6 | * | 7 | * |
7 | * - the master/host side Linux-USB kernel driver API; | 8 | * - the master/host side Linux-USB kernel driver API; |
8 | * - the "usbfs" user space API; and | 9 | * - the "usbfs" user space API; and |
@@ -14,6 +15,19 @@ | |||
14 | * | 15 | * |
15 | * There's also "Wireless USB", using low power short range radios for | 16 | * There's also "Wireless USB", using low power short range radios for |
16 | * peripheral interconnection but otherwise building on the USB framework. | 17 | * peripheral interconnection but otherwise building on the USB framework. |
18 | * | ||
19 | * Note all descriptors are declared '__attribute__((packed))' so that: | ||
20 | * | ||
21 | * [a] they never get padded, either internally (USB spec writers | ||
22 | * probably handled that) or externally; | ||
23 | * | ||
24 | * [b] so that accessing bigger-than-a-bytes fields will never | ||
25 | * generate bus errors on any platform, even when the location of | ||
26 | * its descriptor inside a bundle isn't "naturally aligned", and | ||
27 | * | ||
28 | * [c] for consistency, removing all doubt even when it appears to | ||
29 | * someone that the two other points are non-issues for that | ||
30 | * particular descriptor type. | ||
17 | */ | 31 | */ |
18 | 32 | ||
19 | #ifndef __LINUX_USB_CH9_H | 33 | #ifndef __LINUX_USB_CH9_H |
@@ -167,12 +181,15 @@ struct usb_ctrlrequest { | |||
167 | #define USB_DT_WIRE_ADAPTER 0x21 | 181 | #define USB_DT_WIRE_ADAPTER 0x21 |
168 | #define USB_DT_RPIPE 0x22 | 182 | #define USB_DT_RPIPE 0x22 |
169 | 183 | ||
170 | /* conventional codes for class-specific descriptors */ | 184 | /* Conventional codes for class-specific descriptors. The convention is |
171 | #define USB_DT_CS_DEVICE 0x21 | 185 | * defined in the USB "Common Class" Spec (3.11). Individual class specs |
172 | #define USB_DT_CS_CONFIG 0x22 | 186 | * are authoritative for their usage, not the "common class" writeup. |
173 | #define USB_DT_CS_STRING 0x23 | 187 | */ |
174 | #define USB_DT_CS_INTERFACE 0x24 | 188 | #define USB_DT_CS_DEVICE (USB_TYPE_CLASS | USB_DT_DEVICE) |
175 | #define USB_DT_CS_ENDPOINT 0x25 | 189 | #define USB_DT_CS_CONFIG (USB_TYPE_CLASS | USB_DT_CONFIG) |
190 | #define USB_DT_CS_STRING (USB_TYPE_CLASS | USB_DT_STRING) | ||
191 | #define USB_DT_CS_INTERFACE (USB_TYPE_CLASS | USB_DT_INTERFACE) | ||
192 | #define USB_DT_CS_ENDPOINT (USB_TYPE_CLASS | USB_DT_ENDPOINT) | ||
176 | 193 | ||
177 | /* All standard descriptors have these 2 fields at the beginning */ | 194 | /* All standard descriptors have these 2 fields at the beginning */ |
178 | struct usb_descriptor_header { | 195 | struct usb_descriptor_header { |
@@ -367,7 +384,7 @@ struct usb_debug_descriptor { | |||
367 | /* bulk endpoints with 8 byte maxpacket */ | 384 | /* bulk endpoints with 8 byte maxpacket */ |
368 | __u8 bDebugInEndpoint; | 385 | __u8 bDebugInEndpoint; |
369 | __u8 bDebugOutEndpoint; | 386 | __u8 bDebugOutEndpoint; |
370 | }; | 387 | } __attribute__((packed)); |
371 | 388 | ||
372 | /*-------------------------------------------------------------------------*/ | 389 | /*-------------------------------------------------------------------------*/ |
373 | 390 | ||
@@ -396,7 +413,7 @@ struct usb_security_descriptor { | |||
396 | 413 | ||
397 | __le16 wTotalLength; | 414 | __le16 wTotalLength; |
398 | __u8 bNumEncryptionTypes; | 415 | __u8 bNumEncryptionTypes; |
399 | }; | 416 | } __attribute__((packed)); |
400 | 417 | ||
401 | /*-------------------------------------------------------------------------*/ | 418 | /*-------------------------------------------------------------------------*/ |
402 | 419 | ||
@@ -410,7 +427,7 @@ struct usb_key_descriptor { | |||
410 | __u8 tTKID[3]; | 427 | __u8 tTKID[3]; |
411 | __u8 bReserved; | 428 | __u8 bReserved; |
412 | __u8 bKeyData[0]; | 429 | __u8 bKeyData[0]; |
413 | }; | 430 | } __attribute__((packed)); |
414 | 431 | ||
415 | /*-------------------------------------------------------------------------*/ | 432 | /*-------------------------------------------------------------------------*/ |
416 | 433 | ||
@@ -426,7 +443,7 @@ struct usb_encryption_descriptor { | |||
426 | #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ | 443 | #define USB_ENC_TYPE_RSA_1 3 /* rsa3072/sha1 auth */ |
427 | __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ | 444 | __u8 bEncryptionValue; /* use in SET_ENCRYPTION */ |
428 | __u8 bAuthKeyIndex; | 445 | __u8 bAuthKeyIndex; |
429 | }; | 446 | } __attribute__((packed)); |
430 | 447 | ||
431 | 448 | ||
432 | /*-------------------------------------------------------------------------*/ | 449 | /*-------------------------------------------------------------------------*/ |
@@ -438,7 +455,7 @@ struct usb_bos_descriptor { | |||
438 | 455 | ||
439 | __le16 wTotalLength; | 456 | __le16 wTotalLength; |
440 | __u8 bNumDeviceCaps; | 457 | __u8 bNumDeviceCaps; |
441 | }; | 458 | } __attribute__((packed)); |
442 | 459 | ||
443 | /*-------------------------------------------------------------------------*/ | 460 | /*-------------------------------------------------------------------------*/ |
444 | 461 | ||
@@ -447,7 +464,7 @@ struct usb_dev_cap_header { | |||
447 | __u8 bLength; | 464 | __u8 bLength; |
448 | __u8 bDescriptorType; | 465 | __u8 bDescriptorType; |
449 | __u8 bDevCapabilityType; | 466 | __u8 bDevCapabilityType; |
450 | }; | 467 | } __attribute__((packed)); |
451 | 468 | ||
452 | #define USB_CAP_TYPE_WIRELESS_USB 1 | 469 | #define USB_CAP_TYPE_WIRELESS_USB 1 |
453 | 470 | ||
@@ -475,7 +492,7 @@ struct usb_wireless_cap_descriptor { /* Ultra Wide Band */ | |||
475 | __u8 bmFFITXPowerInfo; /* FFI power levels */ | 492 | __u8 bmFFITXPowerInfo; /* FFI power levels */ |
476 | __le16 bmBandGroup; | 493 | __le16 bmBandGroup; |
477 | __u8 bReserved; | 494 | __u8 bReserved; |
478 | }; | 495 | } __attribute__((packed)); |
479 | 496 | ||
480 | /*-------------------------------------------------------------------------*/ | 497 | /*-------------------------------------------------------------------------*/ |
481 | 498 | ||
@@ -496,7 +513,7 @@ struct usb_wireless_ep_comp_descriptor { | |||
496 | #define USB_ENDPOINT_SWITCH_NO 0 | 513 | #define USB_ENDPOINT_SWITCH_NO 0 |
497 | #define USB_ENDPOINT_SWITCH_SWITCH 1 | 514 | #define USB_ENDPOINT_SWITCH_SWITCH 1 |
498 | #define USB_ENDPOINT_SWITCH_SCALE 2 | 515 | #define USB_ENDPOINT_SWITCH_SCALE 2 |
499 | }; | 516 | } __attribute__((packed)); |
500 | 517 | ||
501 | /*-------------------------------------------------------------------------*/ | 518 | /*-------------------------------------------------------------------------*/ |
502 | 519 | ||
@@ -512,7 +529,7 @@ struct usb_handshake { | |||
512 | __u8 CDID[16]; | 529 | __u8 CDID[16]; |
513 | __u8 nonce[16]; | 530 | __u8 nonce[16]; |
514 | __u8 MIC[8]; | 531 | __u8 MIC[8]; |
515 | }; | 532 | } __attribute__((packed)); |
516 | 533 | ||
517 | /*-------------------------------------------------------------------------*/ | 534 | /*-------------------------------------------------------------------------*/ |
518 | 535 | ||
@@ -524,7 +541,7 @@ struct usb_connection_context { | |||
524 | __u8 CHID[16]; /* persistent host id */ | 541 | __u8 CHID[16]; /* persistent host id */ |
525 | __u8 CDID[16]; /* device id (unique w/in host context) */ | 542 | __u8 CDID[16]; /* device id (unique w/in host context) */ |
526 | __u8 CK[16]; /* connection key */ | 543 | __u8 CK[16]; /* connection key */ |
527 | }; | 544 | } __attribute__((packed)); |
528 | 545 | ||
529 | /*-------------------------------------------------------------------------*/ | 546 | /*-------------------------------------------------------------------------*/ |
530 | 547 | ||
diff --git a/include/linux/usb/iowarrior.h b/include/linux/usb/iowarrior.h new file mode 100644 index 000000000000..cbbe020a4f5c --- /dev/null +++ b/include/linux/usb/iowarrior.h | |||
@@ -0,0 +1,33 @@ | |||
1 | #ifndef _IOWARRIOR_H_ | ||
2 | #define _IOWARRIOR_H_ | ||
3 | |||
4 | #define CODEMERCS_MAGIC_NUMBER 0xC0 /* like COde Mercenaries */ | ||
5 | |||
6 | /* Define the ioctl commands for reading and writing data */ | ||
7 | #define IOW_WRITE _IOW(CODEMERCS_MAGIC_NUMBER, 1, __u8 *) | ||
8 | #define IOW_READ _IOW(CODEMERCS_MAGIC_NUMBER, 2, __u8 *) | ||
9 | |||
10 | /* | ||
11 | A struct for available device info which is read | ||
12 | with the ioctl IOW_GETINFO. | ||
13 | To be compatible with 2.4 userspace which didn't have an easy way to get | ||
14 | this information. | ||
15 | */ | ||
16 | struct iowarrior_info { | ||
17 | __u32 vendor; /* vendor id : supposed to be USB_VENDOR_ID_CODEMERCS in all cases */ | ||
18 | __u32 product; /* product id : depends on type of chip (USB_DEVICE_ID_CODEMERCS_XXXXX) */ | ||
19 | __u8 serial[9]; /* the serial number of our chip (if a serial-number is not available this is empty string) */ | ||
20 | __u32 revision; /* revision number of the chip */ | ||
21 | __u32 speed; /* USB-speed of the device (0=UNKNOWN, 1=LOW, 2=FULL 3=HIGH) */ | ||
22 | __u32 power; /* power consumption of the device in mA */ | ||
23 | __u32 if_num; /* the number of the endpoint */ | ||
24 | __u32 report_size; /* size of the data-packets on this interface */ | ||
25 | }; | ||
26 | |||
27 | /* | ||
28 | Get some device-information (product-id , serial-number etc.) | ||
29 | in order to identify a chip. | ||
30 | */ | ||
31 | #define IOW_GETINFO _IOR(CODEMERCS_MAGIC_NUMBER, 3, struct iowarrior_info) | ||
32 | |||
33 | #endif /* _IOWARRIOR_H_ */ | ||
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h new file mode 100644 index 000000000000..6bac8faacbc6 --- /dev/null +++ b/include/linux/usb/quirks.h | |||
@@ -0,0 +1,11 @@ | |||
1 | /* | ||
2 | * This file holds the definitions of quirks found in USB devices. | ||
3 | * Only quirks that affect the whole device, not an interface, | ||
4 | * belong here. | ||
5 | */ | ||
6 | |||
7 | /* device must not be autosuspended */ | ||
8 | #define USB_QUIRK_NO_AUTOSUSPEND 0x00000001 | ||
9 | |||
10 | /* string descriptors must not be fetched using a 255-byte read */ | ||
11 | #define USB_QUIRK_STRING_FETCH_255 0x00000002 | ||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 33dcd8576696..32acbae28d24 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -54,6 +54,8 @@ | |||
54 | * @write_wait: a wait_queue_head_t used by the port. | 54 | * @write_wait: a wait_queue_head_t used by the port. |
55 | * @work: work queue entry for the line discipline waking up. | 55 | * @work: work queue entry for the line discipline waking up. |
56 | * @open_count: number of times this port has been opened. | 56 | * @open_count: number of times this port has been opened. |
57 | * @throttled: nonzero if the read urb is inactive to throttle the device | ||
58 | * @throttle_req: nonzero if the tty wants to throttle us | ||
57 | * | 59 | * |
58 | * This structure is used by the usb-serial core and drivers for the specific | 60 | * This structure is used by the usb-serial core and drivers for the specific |
59 | * ports of a device. | 61 | * ports of a device. |
@@ -88,6 +90,8 @@ struct usb_serial_port { | |||
88 | wait_queue_head_t write_wait; | 90 | wait_queue_head_t write_wait; |
89 | struct work_struct work; | 91 | struct work_struct work; |
90 | int open_count; | 92 | int open_count; |
93 | char throttled; | ||
94 | char throttle_req; | ||
91 | struct device dev; | 95 | struct device dev; |
92 | }; | 96 | }; |
93 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | 97 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) |
@@ -269,6 +273,8 @@ extern int usb_serial_generic_write_room (struct usb_serial_port *port); | |||
269 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); | 273 | extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); |
270 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); | 274 | extern void usb_serial_generic_read_bulk_callback (struct urb *urb); |
271 | extern void usb_serial_generic_write_bulk_callback (struct urb *urb); | 275 | extern void usb_serial_generic_write_bulk_callback (struct urb *urb); |
276 | extern void usb_serial_generic_throttle (struct usb_serial_port *port); | ||
277 | extern void usb_serial_generic_unthrottle (struct usb_serial_port *port); | ||
272 | extern void usb_serial_generic_shutdown (struct usb_serial *serial); | 278 | extern void usb_serial_generic_shutdown (struct usb_serial *serial); |
273 | extern int usb_serial_generic_register (int debug); | 279 | extern int usb_serial_generic_register (int debug); |
274 | extern void usb_serial_generic_deregister (void); | 280 | extern void usb_serial_generic_deregister (void); |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 2ae76fe52ff7..1b792b9286ba 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -46,7 +46,9 @@ | |||
46 | US_FLAG(MAX_SECTORS_64, 0x00000400) \ | 46 | US_FLAG(MAX_SECTORS_64, 0x00000400) \ |
47 | /* Sets max_sectors to 64 */ \ | 47 | /* Sets max_sectors to 64 */ \ |
48 | US_FLAG(IGNORE_DEVICE, 0x00000800) \ | 48 | US_FLAG(IGNORE_DEVICE, 0x00000800) \ |
49 | /* Don't claim device */ | 49 | /* Don't claim device */ \ |
50 | US_FLAG(CAPACITY_HEURISTICS, 0x00001000) \ | ||
51 | /* sometimes sizes is too big */ | ||
50 | 52 | ||
51 | #define US_FLAG(name, value) US_FL_##name = value , | 53 | #define US_FLAG(name, value) US_FL_##name = value , |
52 | enum { US_DO_ALL_FLAGS }; | 54 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/usbdevice_fs.h b/include/linux/usbdevice_fs.h index 617d8a1c59ae..342dd5a7e8bb 100644 --- a/include/linux/usbdevice_fs.h +++ b/include/linux/usbdevice_fs.h | |||
@@ -159,9 +159,9 @@ struct usbdevfs_ioctl32 { | |||
159 | #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) | 159 | #define USBDEVFS_SUBMITURB32 _IOR('U', 10, struct usbdevfs_urb32) |
160 | #define USBDEVFS_DISCARDURB _IO('U', 11) | 160 | #define USBDEVFS_DISCARDURB _IO('U', 11) |
161 | #define USBDEVFS_REAPURB _IOW('U', 12, void *) | 161 | #define USBDEVFS_REAPURB _IOW('U', 12, void *) |
162 | #define USBDEVFS_REAPURB32 _IOW('U', 12, u32) | 162 | #define USBDEVFS_REAPURB32 _IOW('U', 12, __u32) |
163 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) | 163 | #define USBDEVFS_REAPURBNDELAY _IOW('U', 13, void *) |
164 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, u32) | 164 | #define USBDEVFS_REAPURBNDELAY32 _IOW('U', 13, __u32) |
165 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) | 165 | #define USBDEVFS_DISCSIGNAL _IOR('U', 14, struct usbdevfs_disconnectsignal) |
166 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) | 166 | #define USBDEVFS_CLAIMINTERFACE _IOR('U', 15, unsigned int) |
167 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) | 167 | #define USBDEVFS_RELEASEINTERFACE _IOR('U', 16, unsigned int) |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index a4555fe3754c..e10267d402c5 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -70,6 +70,8 @@ static inline int unshare_utsname(unsigned long unshare_flags, | |||
70 | 70 | ||
71 | static inline int copy_utsname(int flags, struct task_struct *tsk) | 71 | static inline int copy_utsname(int flags, struct task_struct *tsk) |
72 | { | 72 | { |
73 | if (flags & CLONE_NEWUTS) | ||
74 | return -EINVAL; | ||
73 | return 0; | 75 | return 0; |
74 | } | 76 | } |
75 | static inline void put_uts_ns(struct uts_namespace *ns) | 77 | static inline void put_uts_ns(struct uts_namespace *ns) |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d94e2683be52..a25c2afa67e1 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -1,5 +1,45 @@ | |||
1 | /* | 1 | /* |
2 | * Video for Linux Two | 2 | * Video for Linux Two header file |
3 | * | ||
4 | * Copyright (C) 1999-2007 the contributors | ||
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 | * Alternatively you can redistribute this file under the terms of the | ||
17 | * BSD license as stated below: | ||
18 | * | ||
19 | * Redistribution and use in source and binary forms, with or without | ||
20 | * modification, are permitted provided that the following conditions | ||
21 | * are met: | ||
22 | * 1. Redistributions of source code must retain the above copyright | ||
23 | * notice, this list of conditions and the following disclaimer. | ||
24 | * 2. Redistributions in binary form must reproduce the above copyright | ||
25 | * notice, this list of conditions and the following disclaimer in | ||
26 | * the documentation and/or other materials provided with the | ||
27 | * distribution. | ||
28 | * 3. The names of its contributors may not be used to endorse or promote | ||
29 | * products derived from this software without specific prior written | ||
30 | * permission. | ||
31 | * | ||
32 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
33 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
34 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
35 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
36 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
37 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED | ||
38 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
39 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
40 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
41 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
42 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
3 | * | 43 | * |
4 | * Header file for v4l or V4L2 drivers and applications | 44 | * Header file for v4l or V4L2 drivers and applications |
5 | * with public API. | 45 | * with public API. |
@@ -8,8 +48,9 @@ | |||
8 | * | 48 | * |
9 | * See http://linuxtv.org for more info | 49 | * See http://linuxtv.org for more info |
10 | * | 50 | * |
11 | * Author: Bill Dirks <bdirks@pacbell.net> | 51 | * Author: Bill Dirks <bill@thedirks.org> |
12 | * Justin Schoeman | 52 | * Justin Schoeman |
53 | * Hans Verkuil <hverkuil@xs4all.nl> | ||
13 | * et al. | 54 | * et al. |
14 | */ | 55 | */ |
15 | #ifndef __LINUX_VIDEODEV2_H | 56 | #ifndef __LINUX_VIDEODEV2_H |
@@ -55,47 +96,60 @@ | |||
55 | * E N U M S | 96 | * E N U M S |
56 | */ | 97 | */ |
57 | enum v4l2_field { | 98 | enum v4l2_field { |
58 | V4L2_FIELD_ANY = 0, /* driver can choose from none, | 99 | V4L2_FIELD_ANY = 0, /* driver can choose from none, |
59 | top, bottom, interlaced | 100 | top, bottom, interlaced |
60 | depending on whatever it thinks | 101 | depending on whatever it thinks |
61 | is approximate ... */ | 102 | is approximate ... */ |
62 | V4L2_FIELD_NONE = 1, /* this device has no fields ... */ | 103 | V4L2_FIELD_NONE = 1, /* this device has no fields ... */ |
63 | V4L2_FIELD_TOP = 2, /* top field only */ | 104 | V4L2_FIELD_TOP = 2, /* top field only */ |
64 | V4L2_FIELD_BOTTOM = 3, /* bottom field only */ | 105 | V4L2_FIELD_BOTTOM = 3, /* bottom field only */ |
65 | V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */ | 106 | V4L2_FIELD_INTERLACED = 4, /* both fields interlaced */ |
66 | V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one | 107 | V4L2_FIELD_SEQ_TB = 5, /* both fields sequential into one |
67 | buffer, top-bottom order */ | 108 | buffer, top-bottom order */ |
68 | V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */ | 109 | V4L2_FIELD_SEQ_BT = 6, /* same as above + bottom-top order */ |
69 | V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into | 110 | V4L2_FIELD_ALTERNATE = 7, /* both fields alternating into |
70 | separate buffers */ | 111 | separate buffers */ |
112 | V4L2_FIELD_INTERLACED_TB = 8, /* both fields interlaced, top field | ||
113 | first and the top field is | ||
114 | transmitted first */ | ||
115 | V4L2_FIELD_INTERLACED_BT = 9, /* both fields interlaced, top field | ||
116 | first and the bottom field is | ||
117 | transmitted first */ | ||
71 | }; | 118 | }; |
72 | #define V4L2_FIELD_HAS_TOP(field) \ | 119 | #define V4L2_FIELD_HAS_TOP(field) \ |
73 | ((field) == V4L2_FIELD_TOP ||\ | 120 | ((field) == V4L2_FIELD_TOP ||\ |
74 | (field) == V4L2_FIELD_INTERLACED ||\ | 121 | (field) == V4L2_FIELD_INTERLACED ||\ |
122 | (field) == V4L2_FIELD_INTERLACED_TB ||\ | ||
123 | (field) == V4L2_FIELD_INTERLACED_BT ||\ | ||
75 | (field) == V4L2_FIELD_SEQ_TB ||\ | 124 | (field) == V4L2_FIELD_SEQ_TB ||\ |
76 | (field) == V4L2_FIELD_SEQ_BT) | 125 | (field) == V4L2_FIELD_SEQ_BT) |
77 | #define V4L2_FIELD_HAS_BOTTOM(field) \ | 126 | #define V4L2_FIELD_HAS_BOTTOM(field) \ |
78 | ((field) == V4L2_FIELD_BOTTOM ||\ | 127 | ((field) == V4L2_FIELD_BOTTOM ||\ |
79 | (field) == V4L2_FIELD_INTERLACED ||\ | 128 | (field) == V4L2_FIELD_INTERLACED ||\ |
129 | (field) == V4L2_FIELD_INTERLACED_TB ||\ | ||
130 | (field) == V4L2_FIELD_INTERLACED_BT ||\ | ||
80 | (field) == V4L2_FIELD_SEQ_TB ||\ | 131 | (field) == V4L2_FIELD_SEQ_TB ||\ |
81 | (field) == V4L2_FIELD_SEQ_BT) | 132 | (field) == V4L2_FIELD_SEQ_BT) |
82 | #define V4L2_FIELD_HAS_BOTH(field) \ | 133 | #define V4L2_FIELD_HAS_BOTH(field) \ |
83 | ((field) == V4L2_FIELD_INTERLACED ||\ | 134 | ((field) == V4L2_FIELD_INTERLACED ||\ |
84 | (field) == V4L2_FIELD_SEQ_TB ||\ | 135 | (field) == V4L2_FIELD_INTERLACED_TB ||\ |
136 | (field) == V4L2_FIELD_INTERLACED_BT ||\ | ||
137 | (field) == V4L2_FIELD_SEQ_TB ||\ | ||
85 | (field) == V4L2_FIELD_SEQ_BT) | 138 | (field) == V4L2_FIELD_SEQ_BT) |
86 | 139 | ||
87 | enum v4l2_buf_type { | 140 | enum v4l2_buf_type { |
88 | V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, | 141 | V4L2_BUF_TYPE_VIDEO_CAPTURE = 1, |
89 | V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, | 142 | V4L2_BUF_TYPE_VIDEO_OUTPUT = 2, |
90 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, | 143 | V4L2_BUF_TYPE_VIDEO_OVERLAY = 3, |
91 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, | 144 | V4L2_BUF_TYPE_VBI_CAPTURE = 4, |
92 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, | 145 | V4L2_BUF_TYPE_VBI_OUTPUT = 5, |
146 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, | ||
147 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, | ||
93 | #if 1 | 148 | #if 1 |
94 | /* Experimental Sliced VBI */ | 149 | /* Experimental */ |
95 | V4L2_BUF_TYPE_SLICED_VBI_CAPTURE = 6, | 150 | V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY = 8, |
96 | V4L2_BUF_TYPE_SLICED_VBI_OUTPUT = 7, | ||
97 | #endif | 151 | #endif |
98 | V4L2_BUF_TYPE_PRIVATE = 0x80, | 152 | V4L2_BUF_TYPE_PRIVATE = 0x80, |
99 | }; | 153 | }; |
100 | 154 | ||
101 | enum v4l2_ctrl_type { | 155 | enum v4l2_ctrl_type { |
@@ -186,11 +240,11 @@ struct v4l2_capability | |||
186 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ | 240 | #define V4L2_CAP_VIDEO_OVERLAY 0x00000004 /* Can do video overlay */ |
187 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ | 241 | #define V4L2_CAP_VBI_CAPTURE 0x00000010 /* Is a raw VBI capture device */ |
188 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ | 242 | #define V4L2_CAP_VBI_OUTPUT 0x00000020 /* Is a raw VBI output device */ |
189 | #if 1 | ||
190 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ | 243 | #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ |
191 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ | 244 | #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ |
192 | #endif | ||
193 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ | 245 | #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ |
246 | #define V4L2_CAP_VIDEO_OUTPUT_POS 0x00000200 /* Video output can have x,y coords */ | ||
247 | #define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000400 /* Can do video output overlay */ | ||
194 | 248 | ||
195 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ | 249 | #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ |
196 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ | 250 | #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ |
@@ -213,6 +267,8 @@ struct v4l2_pix_format | |||
213 | __u32 sizeimage; | 267 | __u32 sizeimage; |
214 | enum v4l2_colorspace colorspace; | 268 | enum v4l2_colorspace colorspace; |
215 | __u32 priv; /* private data, depends on pixelformat */ | 269 | __u32 priv; /* private data, depends on pixelformat */ |
270 | __u32 left; /* only valid if V4L2_CAP_VIDEO_OUTPUT_POS is set */ | ||
271 | __u32 top; /* only valid if V4L2_CAP_VIDEO_OUTPUT_POS is set */ | ||
216 | }; | 272 | }; |
217 | 273 | ||
218 | /* Pixel format FOURCC depth Description */ | 274 | /* Pixel format FOURCC depth Description */ |
@@ -560,10 +616,14 @@ struct v4l2_framebuffer | |||
560 | #define V4L2_FBUF_CAP_CHROMAKEY 0x0002 | 616 | #define V4L2_FBUF_CAP_CHROMAKEY 0x0002 |
561 | #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004 | 617 | #define V4L2_FBUF_CAP_LIST_CLIPPING 0x0004 |
562 | #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008 | 618 | #define V4L2_FBUF_CAP_BITMAP_CLIPPING 0x0008 |
619 | #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 | ||
620 | #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 | ||
563 | /* Flags for the 'flags' field. */ | 621 | /* Flags for the 'flags' field. */ |
564 | #define V4L2_FBUF_FLAG_PRIMARY 0x0001 | 622 | #define V4L2_FBUF_FLAG_PRIMARY 0x0001 |
565 | #define V4L2_FBUF_FLAG_OVERLAY 0x0002 | 623 | #define V4L2_FBUF_FLAG_OVERLAY 0x0002 |
566 | #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004 | 624 | #define V4L2_FBUF_FLAG_CHROMAKEY 0x0004 |
625 | #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 | ||
626 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 | ||
567 | 627 | ||
568 | struct v4l2_clip | 628 | struct v4l2_clip |
569 | { | 629 | { |
@@ -579,6 +639,7 @@ struct v4l2_window | |||
579 | struct v4l2_clip __user *clips; | 639 | struct v4l2_clip __user *clips; |
580 | __u32 clipcount; | 640 | __u32 clipcount; |
581 | void __user *bitmap; | 641 | void __user *bitmap; |
642 | __u8 global_alpha; | ||
582 | }; | 643 | }; |
583 | 644 | ||
584 | /* | 645 | /* |
@@ -1001,6 +1062,7 @@ enum v4l2_mpeg_audio_crc { | |||
1001 | V4L2_MPEG_AUDIO_CRC_NONE = 0, | 1062 | V4L2_MPEG_AUDIO_CRC_NONE = 0, |
1002 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, | 1063 | V4L2_MPEG_AUDIO_CRC_CRC16 = 1, |
1003 | }; | 1064 | }; |
1065 | #define V4L2_CID_MPEG_AUDIO_MUTE (V4L2_CID_MPEG_BASE+109) | ||
1004 | 1066 | ||
1005 | /* MPEG video */ | 1067 | /* MPEG video */ |
1006 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) | 1068 | #define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) |
@@ -1027,6 +1089,8 @@ enum v4l2_mpeg_video_bitrate_mode { | |||
1027 | #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) | 1089 | #define V4L2_CID_MPEG_VIDEO_BITRATE (V4L2_CID_MPEG_BASE+207) |
1028 | #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) | 1090 | #define V4L2_CID_MPEG_VIDEO_BITRATE_PEAK (V4L2_CID_MPEG_BASE+208) |
1029 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) | 1091 | #define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) |
1092 | #define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) | ||
1093 | #define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) | ||
1030 | 1094 | ||
1031 | /* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */ | 1095 | /* MPEG-class control IDs specific to the CX2584x driver as defined by V4L2 */ |
1032 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) | 1096 | #define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) |
@@ -1067,6 +1131,7 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type { | |||
1067 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) | 1131 | #define V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+8) |
1068 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) | 1132 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_BOTTOM (V4L2_CID_MPEG_CX2341X_BASE+9) |
1069 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) | 1133 | #define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) |
1134 | #define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) | ||
1070 | 1135 | ||
1071 | /* | 1136 | /* |
1072 | * T U N I N G | 1137 | * T U N I N G |
@@ -1157,6 +1222,55 @@ struct v4l2_audioout | |||
1157 | }; | 1222 | }; |
1158 | 1223 | ||
1159 | /* | 1224 | /* |
1225 | * M P E G S E R V I C E S | ||
1226 | * | ||
1227 | * NOTE: EXPERIMENTAL API | ||
1228 | */ | ||
1229 | #if 1 | ||
1230 | #define V4L2_ENC_IDX_FRAME_I (0) | ||
1231 | #define V4L2_ENC_IDX_FRAME_P (1) | ||
1232 | #define V4L2_ENC_IDX_FRAME_B (2) | ||
1233 | #define V4L2_ENC_IDX_FRAME_MASK (0xf) | ||
1234 | |||
1235 | struct v4l2_enc_idx_entry { | ||
1236 | __u64 offset; | ||
1237 | __u64 pts; | ||
1238 | __u32 length; | ||
1239 | __u32 flags; | ||
1240 | __u32 reserved[2]; | ||
1241 | }; | ||
1242 | |||
1243 | #define V4L2_ENC_IDX_ENTRIES (64) | ||
1244 | struct v4l2_enc_idx { | ||
1245 | __u32 entries; | ||
1246 | __u32 entries_cap; | ||
1247 | __u32 reserved[4]; | ||
1248 | struct v4l2_enc_idx_entry entry[V4L2_ENC_IDX_ENTRIES]; | ||
1249 | }; | ||
1250 | |||
1251 | |||
1252 | #define V4L2_ENC_CMD_START (0) | ||
1253 | #define V4L2_ENC_CMD_STOP (1) | ||
1254 | #define V4L2_ENC_CMD_PAUSE (2) | ||
1255 | #define V4L2_ENC_CMD_RESUME (3) | ||
1256 | |||
1257 | /* Flags for V4L2_ENC_CMD_STOP */ | ||
1258 | #define V4L2_ENC_CMD_STOP_AT_GOP_END (1 << 0) | ||
1259 | |||
1260 | struct v4l2_encoder_cmd { | ||
1261 | __u32 cmd; | ||
1262 | __u32 flags; | ||
1263 | union { | ||
1264 | struct { | ||
1265 | __u32 data[8]; | ||
1266 | } raw; | ||
1267 | }; | ||
1268 | }; | ||
1269 | |||
1270 | #endif | ||
1271 | |||
1272 | |||
1273 | /* | ||
1160 | * D A T A S E R V I C E S ( V B I ) | 1274 | * D A T A S E R V I C E S ( V B I ) |
1161 | * | 1275 | * |
1162 | * Data services API by Michael Schimek | 1276 | * Data services API by Michael Schimek |
@@ -1179,7 +1293,6 @@ struct v4l2_vbi_format | |||
1179 | #define V4L2_VBI_UNSYNC (1<< 0) | 1293 | #define V4L2_VBI_UNSYNC (1<< 0) |
1180 | #define V4L2_VBI_INTERLACED (1<< 1) | 1294 | #define V4L2_VBI_INTERLACED (1<< 1) |
1181 | 1295 | ||
1182 | #if 1 | ||
1183 | /* Sliced VBI | 1296 | /* Sliced VBI |
1184 | * | 1297 | * |
1185 | * This implements is a proposal V4L2 API to allow SLICED VBI | 1298 | * This implements is a proposal V4L2 API to allow SLICED VBI |
@@ -1212,7 +1325,6 @@ struct v4l2_sliced_vbi_format | |||
1212 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 1325 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) |
1213 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 1326 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) |
1214 | 1327 | ||
1215 | |||
1216 | struct v4l2_sliced_vbi_cap | 1328 | struct v4l2_sliced_vbi_cap |
1217 | { | 1329 | { |
1218 | __u16 service_set; | 1330 | __u16 service_set; |
@@ -1233,7 +1345,6 @@ struct v4l2_sliced_vbi_data | |||
1233 | __u32 reserved; /* must be 0 */ | 1345 | __u32 reserved; /* must be 0 */ |
1234 | __u8 data[48]; | 1346 | __u8 data[48]; |
1235 | }; | 1347 | }; |
1236 | #endif | ||
1237 | 1348 | ||
1238 | /* | 1349 | /* |
1239 | * A G G R E G A T E S T R U C T U R E S | 1350 | * A G G R E G A T E S T R U C T U R E S |
@@ -1249,9 +1360,7 @@ struct v4l2_format | |||
1249 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE | 1360 | struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE |
1250 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY | 1361 | struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY |
1251 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE | 1362 | struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE |
1252 | #if 1 | ||
1253 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE | 1363 | struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE |
1254 | #endif | ||
1255 | __u8 raw_data[200]; // user-defined | 1364 | __u8 raw_data[200]; // user-defined |
1256 | } fmt; | 1365 | } fmt; |
1257 | }; | 1366 | }; |
@@ -1271,6 +1380,33 @@ struct v4l2_streamparm | |||
1271 | }; | 1380 | }; |
1272 | 1381 | ||
1273 | /* | 1382 | /* |
1383 | * A D V A N C E D D E B U G G I N G | ||
1384 | * | ||
1385 | * NOTE: EXPERIMENTAL API | ||
1386 | */ | ||
1387 | |||
1388 | /* VIDIOC_DBG_G_REGISTER and VIDIOC_DBG_S_REGISTER */ | ||
1389 | |||
1390 | #define V4L2_CHIP_MATCH_HOST 0 /* Match against chip ID on host (0 for the host) */ | ||
1391 | #define V4L2_CHIP_MATCH_I2C_DRIVER 1 /* Match against I2C driver ID */ | ||
1392 | #define V4L2_CHIP_MATCH_I2C_ADDR 2 /* Match against I2C 7-bit address */ | ||
1393 | |||
1394 | struct v4l2_register { | ||
1395 | __u32 match_type; /* Match type */ | ||
1396 | __u32 match_chip; /* Match this chip, meaning determined by match_type */ | ||
1397 | __u64 reg; | ||
1398 | __u64 val; | ||
1399 | }; | ||
1400 | |||
1401 | /* VIDIOC_G_CHIP_IDENT */ | ||
1402 | struct v4l2_chip_ident { | ||
1403 | __u32 match_type; /* Match type */ | ||
1404 | __u32 match_chip; /* Match this chip, meaning determined by match_type */ | ||
1405 | __u32 ident; /* chip identifier as specified in <media/v4l2-chip-ident.h> */ | ||
1406 | __u32 revision; /* chip revision, chip specific */ | ||
1407 | }; | ||
1408 | |||
1409 | /* | ||
1274 | * I O C T L C O D E S F O R V I D E O D E V I C E S | 1410 | * I O C T L C O D E S F O R V I D E O D E V I C E S |
1275 | * | 1411 | * |
1276 | */ | 1412 | */ |
@@ -1328,9 +1464,7 @@ struct v4l2_streamparm | |||
1328 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) | 1464 | #define VIDIOC_ENUMAUDOUT _IOWR ('V', 66, struct v4l2_audioout) |
1329 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1465 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
1330 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1466 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
1331 | #if 1 | ||
1332 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) | 1467 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) |
1333 | #endif | ||
1334 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1468 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
1335 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1469 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) |
1336 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | 1470 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) |
@@ -1338,6 +1472,15 @@ struct v4l2_streamparm | |||
1338 | #if 1 | 1472 | #if 1 |
1339 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | 1473 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) |
1340 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | 1474 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) |
1475 | #define VIDIOC_G_ENC_INDEX _IOR ('V', 76, struct v4l2_enc_idx) | ||
1476 | #define VIDIOC_ENCODER_CMD _IOWR ('V', 77, struct v4l2_encoder_cmd) | ||
1477 | #define VIDIOC_TRY_ENCODER_CMD _IOWR ('V', 78, struct v4l2_encoder_cmd) | ||
1478 | |||
1479 | /* Experimental, only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */ | ||
1480 | #define VIDIOC_DBG_S_REGISTER _IOW ('V', 79, struct v4l2_register) | ||
1481 | #define VIDIOC_DBG_G_REGISTER _IOWR ('V', 80, struct v4l2_register) | ||
1482 | |||
1483 | #define VIDIOC_G_CHIP_IDENT _IOWR ('V', 81, struct v4l2_chip_ident) | ||
1341 | #endif | 1484 | #endif |
1342 | 1485 | ||
1343 | #ifdef __OLD_VIDIOC_ | 1486 | #ifdef __OLD_VIDIOC_ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 37a1a41f5b65..e0db669998f3 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -83,6 +83,7 @@ void reset_vc(struct vc_data *vc); | |||
83 | #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) | 83 | #define CON_BUF_SIZE (CONFIG_BASE_SMALL ? 256 : PAGE_SIZE) |
84 | extern char con_buf[CON_BUF_SIZE]; | 84 | extern char con_buf[CON_BUF_SIZE]; |
85 | extern struct semaphore con_buf_sem; | 85 | extern struct semaphore con_buf_sem; |
86 | extern char vt_dont_switch; | ||
86 | 87 | ||
87 | struct vt_spawn_console { | 88 | struct vt_spawn_console { |
88 | spinlock_t lock; | 89 | spinlock_t lock; |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 7c269f4992eb..0987aa7a6cf5 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 : 21 14.3.06 | 4 | * Version : 22 16.3.07 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2007 Jean Tourrilhes, All Rights Reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _LINUX_WIRELESS_H | 10 | #ifndef _LINUX_WIRELESS_H |
@@ -85,7 +85,7 @@ | |||
85 | * (there is some stuff that will be added in the future...) | 85 | * (there is some stuff that will be added in the future...) |
86 | * I just plan to increment with each new version. | 86 | * I just plan to increment with each new version. |
87 | */ | 87 | */ |
88 | #define WIRELESS_EXT 21 | 88 | #define WIRELESS_EXT 22 |
89 | 89 | ||
90 | /* | 90 | /* |
91 | * Changes : | 91 | * Changes : |
@@ -186,7 +186,7 @@ | |||
186 | * - Wireless Event capability in struct iw_range | 186 | * - Wireless Event capability in struct iw_range |
187 | * - Add support for relative TxPower (yick !) | 187 | * - Add support for relative TxPower (yick !) |
188 | * | 188 | * |
189 | * V17 to V18 (From Jouni Malinen <jkmaline@cc.hut.fi>) | 189 | * V17 to V18 (From Jouni Malinen <j@w1.fi>) |
190 | * ---------- | 190 | * ---------- |
191 | * - Add support for WPA/WPA2 | 191 | * - Add support for WPA/WPA2 |
192 | * - Add extended encoding configuration (SIOCSIWENCODEEXT and | 192 | * - Add extended encoding configuration (SIOCSIWENCODEEXT and |
@@ -221,6 +221,10 @@ | |||
221 | * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers | 221 | * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers |
222 | * - Power/Retry relative values no longer * 100000 | 222 | * - Power/Retry relative values no longer * 100000 |
223 | * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI | 223 | * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI |
224 | * | ||
225 | * V21 to V22 | ||
226 | * ---------- | ||
227 | * - Prevent leaking of kernel space in stream on 64 bits. | ||
224 | */ | 228 | */ |
225 | 229 | ||
226 | /**************************** CONSTANTS ****************************/ | 230 | /**************************** CONSTANTS ****************************/ |
@@ -334,7 +338,7 @@ | |||
334 | * separate range because of collisions with other tools such as | 338 | * separate range because of collisions with other tools such as |
335 | * 'mii-tool'. | 339 | * 'mii-tool'. |
336 | * We now have 32 commands, so a bit more space ;-). | 340 | * We now have 32 commands, so a bit more space ;-). |
337 | * Also, all 'odd' commands are only usable by root and don't return the | 341 | * Also, all 'even' commands are only usable by root and don't return the |
338 | * content of ifr/iwr to user (but you are not obliged to use the set/get | 342 | * content of ifr/iwr to user (but you are not obliged to use the set/get |
339 | * convention, just use every other two command). More details in iwpriv.c. | 343 | * convention, just use every other two command). More details in iwpriv.c. |
340 | * And I repeat : you are not forced to use them with iwpriv, but you | 344 | * And I repeat : you are not forced to use them with iwpriv, but you |
@@ -348,7 +352,7 @@ | |||
348 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ | 352 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ |
349 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) | 353 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) |
350 | 354 | ||
351 | /* Even : get (world access), odd : set (root access) */ | 355 | /* Odd : get (world access), even : set (root access) */ |
352 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) | 356 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) |
353 | #define IW_IS_GET(cmd) ((cmd) & 0x1) | 357 | #define IW_IS_GET(cmd) ((cmd) & 0x1) |
354 | 358 | ||
@@ -1085,4 +1089,15 @@ struct iw_event | |||
1085 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ | 1089 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ |
1086 | IW_EV_POINT_OFF) | 1090 | IW_EV_POINT_OFF) |
1087 | 1091 | ||
1092 | /* Size of the Event prefix when packed in stream */ | ||
1093 | #define IW_EV_LCP_PK_LEN (4) | ||
1094 | /* Size of the various events when packed in stream */ | ||
1095 | #define IW_EV_CHAR_PK_LEN (IW_EV_LCP_PK_LEN + IFNAMSIZ) | ||
1096 | #define IW_EV_UINT_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(__u32)) | ||
1097 | #define IW_EV_FREQ_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_freq)) | ||
1098 | #define IW_EV_PARAM_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_param)) | ||
1099 | #define IW_EV_ADDR_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct sockaddr)) | ||
1100 | #define IW_EV_QUAL_PK_LEN (IW_EV_LCP_PK_LEN + sizeof(struct iw_quality)) | ||
1101 | #define IW_EV_POINT_PK_LEN (IW_EV_LCP_LEN + 4) | ||
1102 | |||
1088 | #endif /* _LINUX_WIRELESS_H */ | 1103 | #endif /* _LINUX_WIRELESS_H */ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 2a7b38d87018..b8abfc74d038 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -191,14 +191,15 @@ int execute_in_process_context(work_func_t fn, struct execute_work *); | |||
191 | 191 | ||
192 | /* | 192 | /* |
193 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 193 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
194 | * function may still be running on return from cancel_delayed_work(). Run | 194 | * function may still be running on return from cancel_delayed_work(), unless |
195 | * flush_scheduled_work() to wait on it. | 195 | * it returns 1 and the work doesn't re-arm itself. Run flush_workqueue() or |
196 | * cancel_work_sync() to wait on it. | ||
196 | */ | 197 | */ |
197 | static inline int cancel_delayed_work(struct delayed_work *work) | 198 | static inline int cancel_delayed_work(struct delayed_work *work) |
198 | { | 199 | { |
199 | int ret; | 200 | int ret; |
200 | 201 | ||
201 | ret = del_timer_sync(&work->timer); | 202 | ret = del_timer(&work->timer); |
202 | if (ret) | 203 | if (ret) |
203 | work_release(&work->work); | 204 | work_release(&work->work); |
204 | return ret; | 205 | return ret; |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index fc35e6bdfb93..0c78f7f4a976 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -84,7 +84,7 @@ static inline void wait_on_inode(struct inode *inode) | |||
84 | int wakeup_pdflush(long nr_pages); | 84 | int wakeup_pdflush(long nr_pages); |
85 | void laptop_io_completion(void); | 85 | void laptop_io_completion(void); |
86 | void laptop_sync_completion(void); | 86 | void laptop_sync_completion(void); |
87 | void throttle_vm_writeout(void); | 87 | void throttle_vm_writeout(gfp_t gfp_mask); |
88 | 88 | ||
89 | /* These are exported to sysctl. */ | 89 | /* These are exported to sysctl. */ |
90 | extern int dirty_background_ratio; | 90 | extern int dirty_background_ratio; |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 15ca89e9961b..a5d53e0fe152 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -181,6 +181,15 @@ enum { | |||
181 | XFRM_MSG_MIGRATE, | 181 | XFRM_MSG_MIGRATE, |
182 | #define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE | 182 | #define XFRM_MSG_MIGRATE XFRM_MSG_MIGRATE |
183 | 183 | ||
184 | XFRM_MSG_NEWSADINFO, | ||
185 | #define XFRM_MSG_NEWSADINFO XFRM_MSG_NEWSADINFO | ||
186 | XFRM_MSG_GETSADINFO, | ||
187 | #define XFRM_MSG_GETSADINFO XFRM_MSG_GETSADINFO | ||
188 | |||
189 | XFRM_MSG_NEWSPDINFO, | ||
190 | #define XFRM_MSG_NEWSPDINFO XFRM_MSG_NEWSPDINFO | ||
191 | XFRM_MSG_GETSPDINFO, | ||
192 | #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO | ||
184 | __XFRM_MSG_MAX | 193 | __XFRM_MSG_MAX |
185 | }; | 194 | }; |
186 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) | 195 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) |
@@ -234,6 +243,17 @@ enum xfrm_ae_ftype_t { | |||
234 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) | 243 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) |
235 | }; | 244 | }; |
236 | 245 | ||
246 | /* SAD Table filter flags */ | ||
247 | enum xfrm_sad_ftype_t { | ||
248 | XFRM_SAD_UNSPEC, | ||
249 | XFRM_SAD_HMASK=1, | ||
250 | XFRM_SAD_HMAX=2, | ||
251 | XFRM_SAD_CNT=4, | ||
252 | __XFRM_SAD_MAX | ||
253 | |||
254 | #define XFRM_SAD_MAX (__XFRM_SAD_MAX - 1) | ||
255 | }; | ||
256 | |||
237 | struct xfrm_userpolicy_type { | 257 | struct xfrm_userpolicy_type { |
238 | __u8 type; | 258 | __u8 type; |
239 | __u16 reserved1; | 259 | __u16 reserved1; |
@@ -265,6 +285,46 @@ enum xfrm_attr_type_t { | |||
265 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 285 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
266 | }; | 286 | }; |
267 | 287 | ||
288 | enum xfrm_sadattr_type_t { | ||
289 | XFRMA_SAD_UNSPEC, | ||
290 | XFRMA_SADHMASK, | ||
291 | XFRMA_SADHMAX, | ||
292 | XFRMA_SADCNT, | ||
293 | __XFRMA_SAD_MAX | ||
294 | |||
295 | #define XFRMA_SAD_MAX (__XFRMA_SAD_MAX - 1) | ||
296 | }; | ||
297 | |||
298 | /* SPD Table filter flags */ | ||
299 | enum xfrm_spd_ftype_t { | ||
300 | XFRM_SPD_UNSPEC, | ||
301 | XFRM_SPD_HMASK=1, | ||
302 | XFRM_SPD_HMAX=2, | ||
303 | XFRM_SPD_ICNT=4, | ||
304 | XFRM_SPD_OCNT=8, | ||
305 | XFRM_SPD_FCNT=16, | ||
306 | XFRM_SPD_ISCNT=32, | ||
307 | XFRM_SPD_OSCNT=64, | ||
308 | XFRM_SPD_FSCNT=128, | ||
309 | __XFRM_SPD_MAX | ||
310 | |||
311 | #define XFRM_SPD_MAX (__XFRM_SPD_MAX - 1) | ||
312 | }; | ||
313 | enum xfrm_spdattr_type_t { | ||
314 | XFRMA_SPD_UNSPEC, | ||
315 | XFRMA_SPDHMASK, | ||
316 | XFRMA_SPDHMAX, | ||
317 | XFRMA_SPDICNT, | ||
318 | XFRMA_SPDOCNT, | ||
319 | XFRMA_SPDFCNT, | ||
320 | XFRMA_SPDISCNT, | ||
321 | XFRMA_SPDOSCNT, | ||
322 | XFRMA_SPDFSCNT, | ||
323 | __XFRMA_SPD_MAX | ||
324 | |||
325 | #define XFRMA_SPD_MAX (__XFRMA_SPD_MAX - 1) | ||
326 | }; | ||
327 | |||
268 | struct xfrm_usersa_info { | 328 | struct xfrm_usersa_info { |
269 | struct xfrm_selector sel; | 329 | struct xfrm_selector sel; |
270 | struct xfrm_id id; | 330 | struct xfrm_id id; |