diff options
Diffstat (limited to 'include/linux')
133 files changed, 3656 insertions, 1136 deletions
diff --git a/include/linux/8250_pci.h b/include/linux/8250_pci.h index 5f3ab21b339b..3209dd46ea7d 100644 --- a/include/linux/8250_pci.h +++ b/include/linux/8250_pci.h | |||
@@ -1,2 +1,37 @@ | |||
1 | int pci_siig10x_fn(struct pci_dev *dev, int enable); | 1 | /* |
2 | int pci_siig20x_fn(struct pci_dev *dev, int enable); | 2 | * Definitions for PCI support. |
3 | */ | ||
4 | #define FL_BASE_MASK 0x0007 | ||
5 | #define FL_BASE0 0x0000 | ||
6 | #define FL_BASE1 0x0001 | ||
7 | #define FL_BASE2 0x0002 | ||
8 | #define FL_BASE3 0x0003 | ||
9 | #define FL_BASE4 0x0004 | ||
10 | #define FL_GET_BASE(x) (x & FL_BASE_MASK) | ||
11 | |||
12 | /* Use successive BARs (PCI base address registers), | ||
13 | else use offset into some specified BAR */ | ||
14 | #define FL_BASE_BARS 0x0008 | ||
15 | |||
16 | /* do not assign an irq */ | ||
17 | #define FL_NOIRQ 0x0080 | ||
18 | |||
19 | /* Use the Base address register size to cap number of ports */ | ||
20 | #define FL_REGION_SZ_CAP 0x0100 | ||
21 | |||
22 | struct pciserial_board { | ||
23 | unsigned int flags; | ||
24 | unsigned int num_ports; | ||
25 | unsigned int base_baud; | ||
26 | unsigned int uart_offset; | ||
27 | unsigned int reg_shift; | ||
28 | unsigned int first_offset; | ||
29 | }; | ||
30 | |||
31 | struct serial_private; | ||
32 | |||
33 | struct serial_private * | ||
34 | pciserial_init_ports(struct pci_dev *dev, struct pciserial_board *board); | ||
35 | void pciserial_remove_ports(struct serial_private *priv); | ||
36 | void pciserial_suspend_ports(struct serial_private *priv); | ||
37 | void pciserial_resume_ports(struct serial_private *priv); | ||
diff --git a/include/linux/ata.h b/include/linux/ata.h index ca5fcadf9981..a5b74efab067 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -1,24 +1,29 @@ | |||
1 | 1 | ||
2 | /* | 2 | /* |
3 | Copyright 2003-2004 Red Hat, Inc. All rights reserved. | 3 | * Copyright 2003-2004 Red Hat, Inc. All rights reserved. |
4 | Copyright 2003-2004 Jeff Garzik | 4 | * Copyright 2003-2004 Jeff Garzik |
5 | 5 | * | |
6 | The contents of this file are subject to the Open | 6 | * |
7 | Software License version 1.1 that can be found at | 7 | * This program is free software; you can redistribute it and/or modify |
8 | http://www.opensource.org/licenses/osl-1.1.txt and is included herein | 8 | * it under the terms of the GNU General Public License as published by |
9 | by reference. | 9 | * the Free Software Foundation; either version 2, or (at your option) |
10 | 10 | * any later version. | |
11 | Alternatively, the contents of this file may be used under the terms | 11 | * |
12 | of the GNU General Public License version 2 (the "GPL") as distributed | 12 | * This program is distributed in the hope that it will be useful, |
13 | in the kernel source COPYING file, in which case the provisions of | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | the GPL are applicable instead of the above. If you wish to allow | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
15 | the use of your version of this file only under the terms of the | 15 | * GNU General Public License for more details. |
16 | GPL and not to allow others to use your version of this file under | 16 | * |
17 | the OSL, indicate your decision by deleting the provisions above and | 17 | * You should have received a copy of the GNU General Public License |
18 | replace them with the notice and other provisions required by the GPL. | 18 | * along with this program; see the file COPYING. If not, write to |
19 | If you do not delete the provisions above, a recipient may use your | 19 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
20 | version of this file under either the OSL or the GPL. | 20 | * |
21 | 21 | * | |
22 | * libata documentation is available via 'make {ps|pdf}docs', | ||
23 | * as Documentation/DocBook/libata.* | ||
24 | * | ||
25 | * Hardware documentation available from http://www.t13.org/ | ||
26 | * | ||
22 | */ | 27 | */ |
23 | 28 | ||
24 | #ifndef __LINUX_ATA_H__ | 29 | #ifndef __LINUX_ATA_H__ |
@@ -108,6 +113,8 @@ enum { | |||
108 | 113 | ||
109 | /* ATA device commands */ | 114 | /* ATA device commands */ |
110 | ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ | 115 | ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ |
116 | ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ | ||
117 | ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ | ||
111 | ATA_CMD_EDD = 0x90, /* execute device diagnostic */ | 118 | ATA_CMD_EDD = 0x90, /* execute device diagnostic */ |
112 | ATA_CMD_FLUSH = 0xE7, | 119 | ATA_CMD_FLUSH = 0xE7, |
113 | ATA_CMD_FLUSH_EXT = 0xEA, | 120 | ATA_CMD_FLUSH_EXT = 0xEA, |
diff --git a/include/linux/auxvec.h b/include/linux/auxvec.h new file mode 100644 index 000000000000..9a7b374c9fb4 --- /dev/null +++ b/include/linux/auxvec.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef _LINUX_AUXVEC_H | ||
2 | #define _LINUX_AUXVEC_H | ||
3 | |||
4 | #include <asm/auxvec.h> | ||
5 | |||
6 | /* Symbolic values for the entries in the auxiliary table | ||
7 | put on the initial stack */ | ||
8 | #define AT_NULL 0 /* end of vector */ | ||
9 | #define AT_IGNORE 1 /* entry should be ignored */ | ||
10 | #define AT_EXECFD 2 /* file descriptor of program */ | ||
11 | #define AT_PHDR 3 /* program headers for program */ | ||
12 | #define AT_PHENT 4 /* size of program header entry */ | ||
13 | #define AT_PHNUM 5 /* number of program headers */ | ||
14 | #define AT_PAGESZ 6 /* system page size */ | ||
15 | #define AT_BASE 7 /* base address of interpreter */ | ||
16 | #define AT_FLAGS 8 /* flags */ | ||
17 | #define AT_ENTRY 9 /* entry point of program */ | ||
18 | #define AT_NOTELF 10 /* program is not ELF */ | ||
19 | #define AT_UID 11 /* real uid */ | ||
20 | #define AT_EUID 12 /* effective uid */ | ||
21 | #define AT_GID 13 /* real gid */ | ||
22 | #define AT_EGID 14 /* effective gid */ | ||
23 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ | ||
24 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ | ||
25 | #define AT_CLKTCK 17 /* frequency at which times() increments */ | ||
26 | |||
27 | #define AT_SECURE 23 /* secure mode boolean */ | ||
28 | |||
29 | #define AT_VECTOR_SIZE 42 /* Size of auxiliary table. */ | ||
30 | |||
31 | #endif /* _LINUX_AUXVEC_H */ | ||
diff --git a/include/linux/bio.h b/include/linux/bio.h index 4fda06da56c1..cdaf03a14a51 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -111,7 +111,6 @@ struct bio { | |||
111 | void *bi_private; | 111 | void *bi_private; |
112 | 112 | ||
113 | bio_destructor_t *bi_destructor; /* destructor */ | 113 | bio_destructor_t *bi_destructor; /* destructor */ |
114 | struct bio_set *bi_set; /* memory pools set */ | ||
115 | }; | 114 | }; |
116 | 115 | ||
117 | /* | 116 | /* |
@@ -280,6 +279,7 @@ extern void bioset_free(struct bio_set *); | |||
280 | extern struct bio *bio_alloc(unsigned int __nocast, int); | 279 | extern struct bio *bio_alloc(unsigned int __nocast, int); |
281 | extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); | 280 | extern struct bio *bio_alloc_bioset(unsigned int __nocast, int, struct bio_set *); |
282 | extern void bio_put(struct bio *); | 281 | extern void bio_put(struct bio *); |
282 | extern void bio_free(struct bio *, struct bio_set *); | ||
283 | 283 | ||
284 | extern void bio_endio(struct bio *, unsigned int, int); | 284 | extern void bio_endio(struct bio *, unsigned int, int); |
285 | struct request_queue; | 285 | struct request_queue; |
diff --git a/include/linux/capability.h b/include/linux/capability.h index 8d139f4acf23..6b4618902d3d 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -233,6 +233,7 @@ typedef __u32 kernel_cap_t; | |||
233 | /* Allow enabling/disabling tagged queuing on SCSI controllers and sending | 233 | /* Allow enabling/disabling tagged queuing on SCSI controllers and sending |
234 | arbitrary SCSI commands */ | 234 | arbitrary SCSI commands */ |
235 | /* Allow setting encryption key on loopback filesystem */ | 235 | /* Allow setting encryption key on loopback filesystem */ |
236 | /* Allow setting zone reclaim policy */ | ||
236 | 237 | ||
237 | #define CAP_SYS_ADMIN 21 | 238 | #define CAP_SYS_ADMIN 21 |
238 | 239 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index b58b7d6f2fdb..f9ca534787e2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -18,6 +18,9 @@ | |||
18 | #define compat_jiffies_to_clock_t(x) \ | 18 | #define compat_jiffies_to_clock_t(x) \ |
19 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | 19 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) |
20 | 20 | ||
21 | typedef __compat_uid32_t compat_uid_t; | ||
22 | typedef __compat_gid32_t compat_gid_t; | ||
23 | |||
21 | struct rusage; | 24 | struct rusage; |
22 | 25 | ||
23 | struct compat_itimerspec { | 26 | struct compat_itimerspec { |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index e8904c0da686..86980c68234a 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -8,7 +8,7 @@ | |||
8 | * Basic handling of the devices is done in drivers/base/cpu.c | 8 | * Basic handling of the devices is done in drivers/base/cpu.c |
9 | * and system devices are handled in drivers/base/sys.c. | 9 | * and system devices are handled in drivers/base/sys.c. |
10 | * | 10 | * |
11 | * CPUs are exported via driverfs in the class/cpu/devices/ | 11 | * CPUs are exported via sysfs in the class/cpu/devices/ |
12 | * directory. | 12 | * directory. |
13 | * | 13 | * |
14 | * Per-cpu interfaces can be implemented using a struct device_interface. | 14 | * Per-cpu interfaces can be implemented using a struct device_interface. |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 3438233305a3..24062a1dbf61 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -23,7 +23,8 @@ void cpuset_init_current_mems_allowed(void); | |||
23 | void cpuset_update_current_mems_allowed(void); | 23 | void cpuset_update_current_mems_allowed(void); |
24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); | 24 | void cpuset_restrict_to_mems_allowed(unsigned long *nodes); |
25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); | 25 | int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl); |
26 | int cpuset_zone_allowed(struct zone *z); | 26 | extern int cpuset_zone_allowed(struct zone *z, unsigned int __nocast gfp_mask); |
27 | extern int cpuset_excl_nodes_overlap(const struct task_struct *p); | ||
27 | extern struct file_operations proc_cpuset_operations; | 28 | extern struct file_operations proc_cpuset_operations; |
28 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); | 29 | extern char *cpuset_task_status_allowed(struct task_struct *task, char *buffer); |
29 | 30 | ||
@@ -48,7 +49,13 @@ static inline int cpuset_zonelist_valid_mems_allowed(struct zonelist *zl) | |||
48 | return 1; | 49 | return 1; |
49 | } | 50 | } |
50 | 51 | ||
51 | static inline int cpuset_zone_allowed(struct zone *z) | 52 | static inline int cpuset_zone_allowed(struct zone *z, |
53 | unsigned int __nocast gfp_mask) | ||
54 | { | ||
55 | return 1; | ||
56 | } | ||
57 | |||
58 | static inline int cpuset_excl_nodes_overlap(const struct task_struct *p) | ||
52 | { | 59 | { |
53 | return 1; | 60 | return 1; |
54 | } | 61 | } |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index 5e2bcc636a02..3c89df6e7768 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define CRYPTO_TFM_MODE_CTR 0x00000008 | 45 | #define CRYPTO_TFM_MODE_CTR 0x00000008 |
46 | 46 | ||
47 | #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 | 47 | #define CRYPTO_TFM_REQ_WEAK_KEY 0x00000100 |
48 | #define CRYPTO_TFM_REQ_MAY_SLEEP 0x00000200 | ||
48 | #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 | 49 | #define CRYPTO_TFM_RES_WEAK_KEY 0x00100000 |
49 | #define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 | 50 | #define CRYPTO_TFM_RES_BAD_KEY_LEN 0x00200000 |
50 | #define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 | 51 | #define CRYPTO_TFM_RES_BAD_KEY_SCHED 0x00400000 |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 50be290d24d2..ab04b4f9b0db 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -88,8 +88,9 @@ struct dentry { | |||
88 | * negative */ | 88 | * negative */ |
89 | /* | 89 | /* |
90 | * The next three fields are touched by __d_lookup. Place them here | 90 | * The next three fields are touched by __d_lookup. Place them here |
91 | * so they all fit in a 16-byte range, with 16-byte alignment. | 91 | * so they all fit in a cache line. |
92 | */ | 92 | */ |
93 | struct hlist_node d_hash; /* lookup hash list */ | ||
93 | struct dentry *d_parent; /* parent directory */ | 94 | struct dentry *d_parent; /* parent directory */ |
94 | struct qstr d_name; | 95 | struct qstr d_name; |
95 | 96 | ||
@@ -103,7 +104,6 @@ struct dentry { | |||
103 | void *d_fsdata; /* fs-specific data */ | 104 | void *d_fsdata; /* fs-specific data */ |
104 | struct rcu_head d_rcu; | 105 | struct rcu_head d_rcu; |
105 | struct dcookie_struct *d_cookie; /* cookie, if any */ | 106 | struct dcookie_struct *d_cookie; /* cookie, if any */ |
106 | struct hlist_node d_hash; /* lookup hash list */ | ||
107 | int d_mounted; | 107 | int d_mounted; |
108 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ | 108 | unsigned char d_iname[DNAME_INLINE_LEN_MIN]; /* small names */ |
109 | }; | 109 | }; |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h new file mode 100644 index 000000000000..007c290f74d4 --- /dev/null +++ b/include/linux/dccp.h | |||
@@ -0,0 +1,456 @@ | |||
1 | #ifndef _LINUX_DCCP_H | ||
2 | #define _LINUX_DCCP_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <asm/byteorder.h> | ||
6 | |||
7 | /* Structure describing an Internet (DCCP) socket address. */ | ||
8 | struct sockaddr_dccp { | ||
9 | __u16 sdccp_family; /* Address family */ | ||
10 | __u16 sdccp_port; /* Port number */ | ||
11 | __u32 sdccp_addr; /* Internet address */ | ||
12 | __u32 sdccp_service; /* Service */ | ||
13 | /* Pad to size of `struct sockaddr': 16 bytes . */ | ||
14 | __u32 sdccp_pad; | ||
15 | }; | ||
16 | |||
17 | /** | ||
18 | * struct dccp_hdr - generic part of DCCP packet header | ||
19 | * | ||
20 | * @dccph_sport - Relevant port on the endpoint that sent this packet | ||
21 | * @dccph_dport - Relevant port on the other endpoint | ||
22 | * @dccph_doff - Data Offset from the start of the DCCP header, in 32-bit words | ||
23 | * @dccph_ccval - Used by the HC-Sender CCID | ||
24 | * @dccph_cscov - Parts of the packet that are covered by the Checksum field | ||
25 | * @dccph_checksum - Internet checksum, depends on dccph_cscov | ||
26 | * @dccph_x - 0 = 24 bit sequence number, 1 = 48 | ||
27 | * @dccph_type - packet type, see DCCP_PKT_ prefixed macros | ||
28 | * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x | ||
29 | */ | ||
30 | struct dccp_hdr { | ||
31 | __u16 dccph_sport, | ||
32 | dccph_dport; | ||
33 | __u8 dccph_doff; | ||
34 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
35 | __u8 dccph_cscov:4, | ||
36 | dccph_ccval:4; | ||
37 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
38 | __u8 dccph_ccval:4, | ||
39 | dccph_cscov:4; | ||
40 | #else | ||
41 | #error "Adjust your <asm/byteorder.h> defines" | ||
42 | #endif | ||
43 | __u16 dccph_checksum; | ||
44 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
45 | __u32 dccph_x:1, | ||
46 | dccph_type:4, | ||
47 | dccph_reserved:3, | ||
48 | dccph_seq:24; | ||
49 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
50 | __u32 dccph_reserved:3, | ||
51 | dccph_type:4, | ||
52 | dccph_x:1, | ||
53 | dccph_seq:24; | ||
54 | #else | ||
55 | #error "Adjust your <asm/byteorder.h> defines" | ||
56 | #endif | ||
57 | }; | ||
58 | |||
59 | /** | ||
60 | * struct dccp_hdr_ext - the low bits of a 48 bit seq packet | ||
61 | * | ||
62 | * @dccph_seq_low - low 24 bits of a 48 bit seq packet | ||
63 | */ | ||
64 | struct dccp_hdr_ext { | ||
65 | __u32 dccph_seq_low; | ||
66 | }; | ||
67 | |||
68 | /** | ||
69 | * struct dccp_hdr_request - Conection initiation request header | ||
70 | * | ||
71 | * @dccph_req_service - Service to which the client app wants to connect | ||
72 | * @dccph_req_options - list of options (must be a multiple of 32 bits | ||
73 | */ | ||
74 | struct dccp_hdr_request { | ||
75 | __u32 dccph_req_service; | ||
76 | }; | ||
77 | /** | ||
78 | * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets | ||
79 | * | ||
80 | * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR | ||
81 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR | ||
82 | */ | ||
83 | struct dccp_hdr_ack_bits { | ||
84 | __u32 dccph_reserved1:8, | ||
85 | dccph_ack_nr_high:24; | ||
86 | __u32 dccph_ack_nr_low; | ||
87 | }; | ||
88 | /** | ||
89 | * struct dccp_hdr_response - Conection initiation response header | ||
90 | * | ||
91 | * @dccph_resp_ack_nr_high - 48 bit ack number high order bits, contains GSR | ||
92 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR | ||
93 | * @dccph_resp_service - Echoes the Service Code on a received DCCP-Request | ||
94 | * @dccph_resp_options - list of options (must be a multiple of 32 bits | ||
95 | */ | ||
96 | struct dccp_hdr_response { | ||
97 | struct dccp_hdr_ack_bits dccph_resp_ack; | ||
98 | __u32 dccph_resp_service; | ||
99 | }; | ||
100 | |||
101 | /** | ||
102 | * struct dccp_hdr_reset - Unconditionally shut down a connection | ||
103 | * | ||
104 | * @dccph_reset_service - Echoes the Service Code on a received DCCP-Request | ||
105 | * @dccph_reset_options - list of options (must be a multiple of 32 bits | ||
106 | */ | ||
107 | struct dccp_hdr_reset { | ||
108 | struct dccp_hdr_ack_bits dccph_reset_ack; | ||
109 | __u8 dccph_reset_code, | ||
110 | dccph_reset_data[3]; | ||
111 | }; | ||
112 | |||
113 | enum dccp_pkt_type { | ||
114 | DCCP_PKT_REQUEST = 0, | ||
115 | DCCP_PKT_RESPONSE, | ||
116 | DCCP_PKT_DATA, | ||
117 | DCCP_PKT_ACK, | ||
118 | DCCP_PKT_DATAACK, | ||
119 | DCCP_PKT_CLOSEREQ, | ||
120 | DCCP_PKT_CLOSE, | ||
121 | DCCP_PKT_RESET, | ||
122 | DCCP_PKT_SYNC, | ||
123 | DCCP_PKT_SYNCACK, | ||
124 | DCCP_PKT_INVALID, | ||
125 | }; | ||
126 | |||
127 | #define DCCP_NR_PKT_TYPES DCCP_PKT_INVALID | ||
128 | |||
129 | static inline unsigned int dccp_packet_hdr_len(const __u8 type) | ||
130 | { | ||
131 | if (type == DCCP_PKT_DATA) | ||
132 | return 0; | ||
133 | if (type == DCCP_PKT_DATAACK || | ||
134 | type == DCCP_PKT_ACK || | ||
135 | type == DCCP_PKT_SYNC || | ||
136 | type == DCCP_PKT_SYNCACK || | ||
137 | type == DCCP_PKT_CLOSE || | ||
138 | type == DCCP_PKT_CLOSEREQ) | ||
139 | return sizeof(struct dccp_hdr_ack_bits); | ||
140 | if (type == DCCP_PKT_REQUEST) | ||
141 | return sizeof(struct dccp_hdr_request); | ||
142 | if (type == DCCP_PKT_RESPONSE) | ||
143 | return sizeof(struct dccp_hdr_response); | ||
144 | return sizeof(struct dccp_hdr_reset); | ||
145 | } | ||
146 | enum dccp_reset_codes { | ||
147 | DCCP_RESET_CODE_UNSPECIFIED = 0, | ||
148 | DCCP_RESET_CODE_CLOSED, | ||
149 | DCCP_RESET_CODE_ABORTED, | ||
150 | DCCP_RESET_CODE_NO_CONNECTION, | ||
151 | DCCP_RESET_CODE_PACKET_ERROR, | ||
152 | DCCP_RESET_CODE_OPTION_ERROR, | ||
153 | DCCP_RESET_CODE_MANDATORY_ERROR, | ||
154 | DCCP_RESET_CODE_CONNECTION_REFUSED, | ||
155 | DCCP_RESET_CODE_BAD_SERVICE_CODE, | ||
156 | DCCP_RESET_CODE_TOO_BUSY, | ||
157 | DCCP_RESET_CODE_BAD_INIT_COOKIE, | ||
158 | DCCP_RESET_CODE_AGGRESSION_PENALTY, | ||
159 | }; | ||
160 | |||
161 | /* DCCP options */ | ||
162 | enum { | ||
163 | DCCPO_PADDING = 0, | ||
164 | DCCPO_MANDATORY = 1, | ||
165 | DCCPO_MIN_RESERVED = 3, | ||
166 | DCCPO_MAX_RESERVED = 31, | ||
167 | DCCPO_NDP_COUNT = 37, | ||
168 | DCCPO_ACK_VECTOR_0 = 38, | ||
169 | DCCPO_ACK_VECTOR_1 = 39, | ||
170 | DCCPO_TIMESTAMP = 41, | ||
171 | DCCPO_TIMESTAMP_ECHO = 42, | ||
172 | DCCPO_ELAPSED_TIME = 43, | ||
173 | DCCPO_MAX = 45, | ||
174 | DCCPO_MIN_CCID_SPECIFIC = 128, | ||
175 | DCCPO_MAX_CCID_SPECIFIC = 255, | ||
176 | }; | ||
177 | |||
178 | /* DCCP features */ | ||
179 | enum { | ||
180 | DCCPF_RESERVED = 0, | ||
181 | DCCPF_SEQUENCE_WINDOW = 3, | ||
182 | DCCPF_SEND_ACK_VECTOR = 6, | ||
183 | DCCPF_SEND_NDP_COUNT = 7, | ||
184 | /* 10-127 reserved */ | ||
185 | DCCPF_MIN_CCID_SPECIFIC = 128, | ||
186 | DCCPF_MAX_CCID_SPECIFIC = 255, | ||
187 | }; | ||
188 | |||
189 | /* DCCP socket options */ | ||
190 | #define DCCP_SOCKOPT_PACKET_SIZE 1 | ||
191 | |||
192 | #ifdef __KERNEL__ | ||
193 | |||
194 | #include <linux/in.h> | ||
195 | #include <linux/list.h> | ||
196 | #include <linux/uio.h> | ||
197 | #include <linux/workqueue.h> | ||
198 | |||
199 | #include <net/inet_connection_sock.h> | ||
200 | #include <net/inet_timewait_sock.h> | ||
201 | #include <net/sock.h> | ||
202 | #include <net/tcp_states.h> | ||
203 | #include <net/tcp.h> | ||
204 | |||
205 | enum dccp_state { | ||
206 | DCCP_OPEN = TCP_ESTABLISHED, | ||
207 | DCCP_REQUESTING = TCP_SYN_SENT, | ||
208 | DCCP_PARTOPEN = TCP_FIN_WAIT1, /* FIXME: | ||
209 | This mapping is horrible, but TCP has | ||
210 | no matching state for DCCP_PARTOPEN, | ||
211 | as TCP_SYN_RECV is already used by | ||
212 | DCCP_RESPOND, why don't stop using TCP | ||
213 | mapping of states? OK, now we don't use | ||
214 | sk_stream_sendmsg anymore, so doesn't | ||
215 | seem to exist any reason for us to | ||
216 | do the TCP mapping here */ | ||
217 | DCCP_LISTEN = TCP_LISTEN, | ||
218 | DCCP_RESPOND = TCP_SYN_RECV, | ||
219 | DCCP_CLOSING = TCP_CLOSING, | ||
220 | DCCP_TIME_WAIT = TCP_TIME_WAIT, | ||
221 | DCCP_CLOSED = TCP_CLOSE, | ||
222 | DCCP_MAX_STATES = TCP_MAX_STATES, | ||
223 | }; | ||
224 | |||
225 | #define DCCP_STATE_MASK 0xf | ||
226 | #define DCCP_ACTION_FIN (1<<7) | ||
227 | |||
228 | enum { | ||
229 | DCCPF_OPEN = TCPF_ESTABLISHED, | ||
230 | DCCPF_REQUESTING = TCPF_SYN_SENT, | ||
231 | DCCPF_PARTOPEN = TCPF_FIN_WAIT1, | ||
232 | DCCPF_LISTEN = TCPF_LISTEN, | ||
233 | DCCPF_RESPOND = TCPF_SYN_RECV, | ||
234 | DCCPF_CLOSING = TCPF_CLOSING, | ||
235 | DCCPF_TIME_WAIT = TCPF_TIME_WAIT, | ||
236 | DCCPF_CLOSED = TCPF_CLOSE, | ||
237 | }; | ||
238 | |||
239 | static inline struct dccp_hdr *dccp_hdr(const struct sk_buff *skb) | ||
240 | { | ||
241 | return (struct dccp_hdr *)skb->h.raw; | ||
242 | } | ||
243 | |||
244 | static inline struct dccp_hdr_ext *dccp_hdrx(const struct sk_buff *skb) | ||
245 | { | ||
246 | return (struct dccp_hdr_ext *)(skb->h.raw + sizeof(struct dccp_hdr)); | ||
247 | } | ||
248 | |||
249 | static inline unsigned int __dccp_basic_hdr_len(const struct dccp_hdr *dh) | ||
250 | { | ||
251 | return sizeof(*dh) + (dh->dccph_x ? sizeof(struct dccp_hdr_ext) : 0); | ||
252 | } | ||
253 | |||
254 | static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb) | ||
255 | { | ||
256 | const struct dccp_hdr *dh = dccp_hdr(skb); | ||
257 | return __dccp_basic_hdr_len(dh); | ||
258 | } | ||
259 | |||
260 | static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) | ||
261 | { | ||
262 | const struct dccp_hdr *dh = dccp_hdr(skb); | ||
263 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
264 | __u64 seq_nr = ntohl(dh->dccph_seq << 8); | ||
265 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
266 | __u64 seq_nr = ntohl(dh->dccph_seq); | ||
267 | #else | ||
268 | #error "Adjust your <asm/byteorder.h> defines" | ||
269 | #endif | ||
270 | |||
271 | if (dh->dccph_x != 0) | ||
272 | seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); | ||
273 | |||
274 | return seq_nr; | ||
275 | } | ||
276 | |||
277 | static inline struct dccp_hdr_request *dccp_hdr_request(struct sk_buff *skb) | ||
278 | { | ||
279 | return (struct dccp_hdr_request *)(skb->h.raw + dccp_basic_hdr_len(skb)); | ||
280 | } | ||
281 | |||
282 | static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff *skb) | ||
283 | { | ||
284 | return (struct dccp_hdr_ack_bits *)(skb->h.raw + dccp_basic_hdr_len(skb)); | ||
285 | } | ||
286 | |||
287 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | ||
288 | { | ||
289 | const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb); | ||
290 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
291 | return (((u64)ntohl(dhack->dccph_ack_nr_high << 8)) << 32) + ntohl(dhack->dccph_ack_nr_low); | ||
292 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
293 | return (((u64)ntohl(dhack->dccph_ack_nr_high)) << 32) + ntohl(dhack->dccph_ack_nr_low); | ||
294 | #else | ||
295 | #error "Adjust your <asm/byteorder.h> defines" | ||
296 | #endif | ||
297 | } | ||
298 | |||
299 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) | ||
300 | { | ||
301 | return (struct dccp_hdr_response *)(skb->h.raw + dccp_basic_hdr_len(skb)); | ||
302 | } | ||
303 | |||
304 | static inline struct dccp_hdr_reset *dccp_hdr_reset(struct sk_buff *skb) | ||
305 | { | ||
306 | return (struct dccp_hdr_reset *)(skb->h.raw + dccp_basic_hdr_len(skb)); | ||
307 | } | ||
308 | |||
309 | static inline unsigned int __dccp_hdr_len(const struct dccp_hdr *dh) | ||
310 | { | ||
311 | return __dccp_basic_hdr_len(dh) + | ||
312 | dccp_packet_hdr_len(dh->dccph_type); | ||
313 | } | ||
314 | |||
315 | static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | ||
316 | { | ||
317 | return __dccp_hdr_len(dccp_hdr(skb)); | ||
318 | } | ||
319 | |||
320 | |||
321 | /* initial values for each feature */ | ||
322 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 | ||
323 | /* FIXME: for now we're using CCID 3 (TFRC) */ | ||
324 | #define DCCPF_INITIAL_CCID 3 | ||
325 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 0 | ||
326 | /* FIXME: for now we're default to 1 but it should really be 0 */ | ||
327 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 | ||
328 | |||
329 | #define DCCP_NDP_LIMIT 0xFFFFFF | ||
330 | |||
331 | /** | ||
332 | * struct dccp_options - option values for a DCCP connection | ||
333 | * @dccpo_sequence_window - Sequence Window Feature (section 7.5.2) | ||
334 | * @dccpo_ccid - Congestion Control Id (CCID) (section 10) | ||
335 | * @dccpo_send_ack_vector - Send Ack Vector Feature (section 11.5) | ||
336 | * @dccpo_send_ndp_count - Send NDP Count Feature (7.7.2) | ||
337 | */ | ||
338 | struct dccp_options { | ||
339 | __u64 dccpo_sequence_window; | ||
340 | __u8 dccpo_ccid; | ||
341 | __u8 dccpo_send_ack_vector; | ||
342 | __u8 dccpo_send_ndp_count; | ||
343 | }; | ||
344 | |||
345 | extern void __dccp_options_init(struct dccp_options *dccpo); | ||
346 | extern void dccp_options_init(struct dccp_options *dccpo); | ||
347 | extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); | ||
348 | |||
349 | struct dccp_request_sock { | ||
350 | struct inet_request_sock dreq_inet_rsk; | ||
351 | __u64 dreq_iss; | ||
352 | __u64 dreq_isr; | ||
353 | __u32 dreq_service; | ||
354 | }; | ||
355 | |||
356 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) | ||
357 | { | ||
358 | return (struct dccp_request_sock *)req; | ||
359 | } | ||
360 | |||
361 | extern struct inet_timewait_death_row dccp_death_row; | ||
362 | |||
363 | /* Read about the ECN nonce to see why it is 253 */ | ||
364 | #define DCCP_MAX_ACK_VECTOR_LEN 253 | ||
365 | |||
366 | struct dccp_options_received { | ||
367 | u32 dccpor_ndp:24, | ||
368 | dccpor_ack_vector_len:8; | ||
369 | u32 dccpor_ack_vector_idx:10; | ||
370 | /* 22 bits hole, try to pack */ | ||
371 | u32 dccpor_timestamp; | ||
372 | u32 dccpor_timestamp_echo; | ||
373 | u32 dccpor_elapsed_time; | ||
374 | }; | ||
375 | |||
376 | struct ccid; | ||
377 | |||
378 | enum dccp_role { | ||
379 | DCCP_ROLE_UNDEFINED, | ||
380 | DCCP_ROLE_LISTEN, | ||
381 | DCCP_ROLE_CLIENT, | ||
382 | DCCP_ROLE_SERVER, | ||
383 | }; | ||
384 | |||
385 | /** | ||
386 | * struct dccp_sock - DCCP socket state | ||
387 | * | ||
388 | * @dccps_swl - sequence number window low | ||
389 | * @dccps_swh - sequence number window high | ||
390 | * @dccps_awl - acknowledgement number window low | ||
391 | * @dccps_awh - acknowledgement number window high | ||
392 | * @dccps_iss - initial sequence number sent | ||
393 | * @dccps_isr - initial sequence number received | ||
394 | * @dccps_osr - first OPEN sequence number received | ||
395 | * @dccps_gss - greatest sequence number sent | ||
396 | * @dccps_gsr - greatest valid sequence number received | ||
397 | * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss | ||
398 | * @dccps_timestamp_time - time of latest TIMESTAMP option | ||
399 | * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option | ||
400 | * @dccps_ext_header_len - network protocol overhead (IP/IPv6 options) | ||
401 | * @dccps_pmtu_cookie - Last pmtu seen by socket | ||
402 | * @dccps_packet_size - Set thru setsockopt | ||
403 | * @dccps_role - Role of this sock, one of %dccp_role | ||
404 | * @dccps_ndp_count - number of Non Data Packets since last data packet | ||
405 | * @dccps_hc_rx_ackpkts - receiver half connection acked packets | ||
406 | */ | ||
407 | struct dccp_sock { | ||
408 | /* inet_connection_sock has to be the first member of dccp_sock */ | ||
409 | struct inet_connection_sock dccps_inet_connection; | ||
410 | __u64 dccps_swl; | ||
411 | __u64 dccps_swh; | ||
412 | __u64 dccps_awl; | ||
413 | __u64 dccps_awh; | ||
414 | __u64 dccps_iss; | ||
415 | __u64 dccps_isr; | ||
416 | __u64 dccps_osr; | ||
417 | __u64 dccps_gss; | ||
418 | __u64 dccps_gsr; | ||
419 | __u64 dccps_gar; | ||
420 | unsigned long dccps_service; | ||
421 | struct timeval dccps_timestamp_time; | ||
422 | __u32 dccps_timestamp_echo; | ||
423 | __u32 dccps_packet_size; | ||
424 | unsigned long dccps_ndp_count; | ||
425 | __u16 dccps_ext_header_len; | ||
426 | __u32 dccps_pmtu_cookie; | ||
427 | __u32 dccps_mss_cache; | ||
428 | struct dccp_options dccps_options; | ||
429 | struct dccp_ackpkts *dccps_hc_rx_ackpkts; | ||
430 | void *dccps_hc_rx_ccid_private; | ||
431 | void *dccps_hc_tx_ccid_private; | ||
432 | struct ccid *dccps_hc_rx_ccid; | ||
433 | struct ccid *dccps_hc_tx_ccid; | ||
434 | struct dccp_options_received dccps_options_received; | ||
435 | enum dccp_role dccps_role:2; | ||
436 | }; | ||
437 | |||
438 | static inline struct dccp_sock *dccp_sk(const struct sock *sk) | ||
439 | { | ||
440 | return (struct dccp_sock *)sk; | ||
441 | } | ||
442 | |||
443 | static inline const char *dccp_role(const struct sock *sk) | ||
444 | { | ||
445 | switch (dccp_sk(sk)->dccps_role) { | ||
446 | case DCCP_ROLE_UNDEFINED: return "undefined"; | ||
447 | case DCCP_ROLE_LISTEN: return "listen"; | ||
448 | case DCCP_ROLE_SERVER: return "server"; | ||
449 | case DCCP_ROLE_CLIENT: return "client"; | ||
450 | } | ||
451 | return NULL; | ||
452 | } | ||
453 | |||
454 | #endif /* __KERNEL__ */ | ||
455 | |||
456 | #endif /* _LINUX_DCCP_H */ | ||
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index 5e93e6dce9a4..c30175e8dec6 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __DMI_H__ | 1 | #ifndef __DMI_H__ |
2 | #define __DMI_H__ | 2 | #define __DMI_H__ |
3 | 3 | ||
4 | #include <linux/list.h> | ||
5 | |||
4 | enum dmi_field { | 6 | enum dmi_field { |
5 | DMI_NONE, | 7 | DMI_NONE, |
6 | DMI_BIOS_VENDOR, | 8 | DMI_BIOS_VENDOR, |
@@ -16,6 +18,24 @@ enum dmi_field { | |||
16 | DMI_STRING_MAX, | 18 | DMI_STRING_MAX, |
17 | }; | 19 | }; |
18 | 20 | ||
21 | enum dmi_device_type { | ||
22 | DMI_DEV_TYPE_ANY = 0, | ||
23 | DMI_DEV_TYPE_OTHER, | ||
24 | DMI_DEV_TYPE_UNKNOWN, | ||
25 | DMI_DEV_TYPE_VIDEO, | ||
26 | DMI_DEV_TYPE_SCSI, | ||
27 | DMI_DEV_TYPE_ETHERNET, | ||
28 | DMI_DEV_TYPE_TOKENRING, | ||
29 | DMI_DEV_TYPE_SOUND, | ||
30 | DMI_DEV_TYPE_IPMI = -1 | ||
31 | }; | ||
32 | |||
33 | struct dmi_header { | ||
34 | u8 type; | ||
35 | u8 length; | ||
36 | u16 handle; | ||
37 | }; | ||
38 | |||
19 | /* | 39 | /* |
20 | * DMI callbacks for problem boards | 40 | * DMI callbacks for problem boards |
21 | */ | 41 | */ |
@@ -26,22 +46,32 @@ struct dmi_strmatch { | |||
26 | 46 | ||
27 | struct dmi_system_id { | 47 | struct dmi_system_id { |
28 | int (*callback)(struct dmi_system_id *); | 48 | int (*callback)(struct dmi_system_id *); |
29 | char *ident; | 49 | const char *ident; |
30 | struct dmi_strmatch matches[4]; | 50 | struct dmi_strmatch matches[4]; |
31 | void *driver_data; | 51 | void *driver_data; |
32 | }; | 52 | }; |
33 | 53 | ||
34 | #define DMI_MATCH(a,b) { a, b } | 54 | #define DMI_MATCH(a, b) { a, b } |
55 | |||
56 | struct dmi_device { | ||
57 | struct list_head list; | ||
58 | int type; | ||
59 | const char *name; | ||
60 | void *device_data; /* Type specific data */ | ||
61 | }; | ||
35 | 62 | ||
36 | #if defined(CONFIG_X86) && !defined(CONFIG_X86_64) | 63 | #if defined(CONFIG_X86) && !defined(CONFIG_X86_64) |
37 | 64 | ||
38 | extern int dmi_check_system(struct dmi_system_id *list); | 65 | extern int dmi_check_system(struct dmi_system_id *list); |
39 | extern char * dmi_get_system_info(int field); | 66 | extern char * dmi_get_system_info(int field); |
40 | 67 | extern struct dmi_device * dmi_find_device(int type, const char *name, | |
68 | struct dmi_device *from); | ||
41 | #else | 69 | #else |
42 | 70 | ||
43 | static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } | 71 | static inline int dmi_check_system(struct dmi_system_id *list) { return 0; } |
44 | static inline char * dmi_get_system_info(int field) { return NULL; } | 72 | static inline char * dmi_get_system_info(int field) { return NULL; } |
73 | static struct dmi_device * dmi_find_device(int type, const char *name, | ||
74 | struct dmi_device *from) { return NULL; } | ||
45 | 75 | ||
46 | #endif | 76 | #endif |
47 | 77 | ||
diff --git a/include/linux/efi.h b/include/linux/efi.h index 73781ec165b4..c7c5dd316182 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -91,11 +91,6 @@ typedef struct { | |||
91 | 91 | ||
92 | #define EFI_PAGE_SHIFT 12 | 92 | #define EFI_PAGE_SHIFT 12 |
93 | 93 | ||
94 | /* | ||
95 | * For current x86 implementations of EFI, there is | ||
96 | * additional padding in the mem descriptors. This is not | ||
97 | * the case in ia64. Need to have this fixed in the f/w. | ||
98 | */ | ||
99 | typedef struct { | 94 | typedef struct { |
100 | u32 type; | 95 | u32 type; |
101 | u32 pad; | 96 | u32 pad; |
@@ -103,9 +98,6 @@ typedef struct { | |||
103 | u64 virt_addr; | 98 | u64 virt_addr; |
104 | u64 num_pages; | 99 | u64 num_pages; |
105 | u64 attribute; | 100 | u64 attribute; |
106 | #if defined (__i386__) | ||
107 | u64 pad1; | ||
108 | #endif | ||
109 | } efi_memory_desc_t; | 101 | } efi_memory_desc_t; |
110 | 102 | ||
111 | typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg); | 103 | typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg); |
@@ -240,10 +232,12 @@ typedef struct { | |||
240 | } efi_system_table_t; | 232 | } efi_system_table_t; |
241 | 233 | ||
242 | struct efi_memory_map { | 234 | struct efi_memory_map { |
243 | efi_memory_desc_t *phys_map; | 235 | void *phys_map; |
244 | efi_memory_desc_t *map; | 236 | void *map; |
237 | void *map_end; | ||
245 | int nr_map; | 238 | int nr_map; |
246 | unsigned long desc_version; | 239 | unsigned long desc_version; |
240 | unsigned long desc_size; | ||
247 | }; | 241 | }; |
248 | 242 | ||
249 | /* | 243 | /* |
diff --git a/include/linux/elf.h b/include/linux/elf.h index f5b3ba5a317d..ff955dbf510d 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_ELF_H | 2 | #define _LINUX_ELF_H |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/auxvec.h> | ||
5 | #include <asm/elf.h> | 6 | #include <asm/elf.h> |
6 | 7 | ||
7 | #ifndef elf_read_implies_exec | 8 | #ifndef elf_read_implies_exec |
@@ -158,29 +159,6 @@ typedef __s64 Elf64_Sxword; | |||
158 | #define ELF64_ST_BIND(x) ELF_ST_BIND(x) | 159 | #define ELF64_ST_BIND(x) ELF_ST_BIND(x) |
159 | #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) | 160 | #define ELF64_ST_TYPE(x) ELF_ST_TYPE(x) |
160 | 161 | ||
161 | /* Symbolic values for the entries in the auxiliary table | ||
162 | put on the initial stack */ | ||
163 | #define AT_NULL 0 /* end of vector */ | ||
164 | #define AT_IGNORE 1 /* entry should be ignored */ | ||
165 | #define AT_EXECFD 2 /* file descriptor of program */ | ||
166 | #define AT_PHDR 3 /* program headers for program */ | ||
167 | #define AT_PHENT 4 /* size of program header entry */ | ||
168 | #define AT_PHNUM 5 /* number of program headers */ | ||
169 | #define AT_PAGESZ 6 /* system page size */ | ||
170 | #define AT_BASE 7 /* base address of interpreter */ | ||
171 | #define AT_FLAGS 8 /* flags */ | ||
172 | #define AT_ENTRY 9 /* entry point of program */ | ||
173 | #define AT_NOTELF 10 /* program is not ELF */ | ||
174 | #define AT_UID 11 /* real uid */ | ||
175 | #define AT_EUID 12 /* effective uid */ | ||
176 | #define AT_GID 13 /* real gid */ | ||
177 | #define AT_EGID 14 /* effective gid */ | ||
178 | #define AT_PLATFORM 15 /* string identifying CPU for optimizations */ | ||
179 | #define AT_HWCAP 16 /* arch dependent hints at CPU capabilities */ | ||
180 | #define AT_CLKTCK 17 /* frequency at which times() increments */ | ||
181 | |||
182 | #define AT_SECURE 23 /* secure mode boolean */ | ||
183 | |||
184 | typedef struct dynamic{ | 162 | typedef struct dynamic{ |
185 | Elf32_Sword d_tag; | 163 | Elf32_Sword d_tag; |
186 | union{ | 164 | union{ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index ce8518e658b6..4522c7186bf3 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -69,6 +69,12 @@ static inline int is_multicast_ether_addr(const u8 *addr) | |||
69 | return ((addr[0] != 0xff) && (0x01 & addr[0])); | 69 | return ((addr[0] != 0xff) && (0x01 & addr[0])); |
70 | } | 70 | } |
71 | 71 | ||
72 | static inline int is_broadcast_ether_addr(const u8 *addr) | ||
73 | { | ||
74 | return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && | ||
75 | (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); | ||
76 | } | ||
77 | |||
72 | /** | 78 | /** |
73 | * is_valid_ether_addr - Determine if the given Ethernet address is valid | 79 | * is_valid_ether_addr - Determine if the given Ethernet address is valid |
74 | * @addr: Pointer to a six-byte array containing the Ethernet address | 80 | * @addr: Pointer to a six-byte array containing the Ethernet address |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index a0ab26aab450..ed1440ea4c91 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -250,6 +250,12 @@ struct ethtool_stats { | |||
250 | u64 data[0]; | 250 | u64 data[0]; |
251 | }; | 251 | }; |
252 | 252 | ||
253 | struct ethtool_perm_addr { | ||
254 | u32 cmd; /* ETHTOOL_GPERMADDR */ | ||
255 | u32 size; | ||
256 | u8 data[0]; | ||
257 | }; | ||
258 | |||
253 | struct net_device; | 259 | struct net_device; |
254 | 260 | ||
255 | /* Some generic methods drivers may use in their ethtool_ops */ | 261 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -261,6 +267,8 @@ u32 ethtool_op_get_sg(struct net_device *dev); | |||
261 | int ethtool_op_set_sg(struct net_device *dev, u32 data); | 267 | int ethtool_op_set_sg(struct net_device *dev, u32 data); |
262 | u32 ethtool_op_get_tso(struct net_device *dev); | 268 | u32 ethtool_op_get_tso(struct net_device *dev); |
263 | int ethtool_op_set_tso(struct net_device *dev, u32 data); | 269 | int ethtool_op_set_tso(struct net_device *dev, u32 data); |
270 | int ethtool_op_get_perm_addr(struct net_device *dev, | ||
271 | struct ethtool_perm_addr *addr, u8 *data); | ||
264 | 272 | ||
265 | /** | 273 | /** |
266 | * ðtool_ops - Alter and report network device settings | 274 | * ðtool_ops - Alter and report network device settings |
@@ -294,7 +302,8 @@ int ethtool_op_set_tso(struct net_device *dev, u32 data); | |||
294 | * get_strings: Return a set of strings that describe the requested objects | 302 | * get_strings: Return a set of strings that describe the requested objects |
295 | * phys_id: Identify the device | 303 | * phys_id: Identify the device |
296 | * get_stats: Return statistics about the device | 304 | * get_stats: Return statistics about the device |
297 | * | 305 | * get_perm_addr: Gets the permanent hardware address |
306 | * | ||
298 | * Description: | 307 | * Description: |
299 | * | 308 | * |
300 | * get_settings: | 309 | * get_settings: |
@@ -352,6 +361,7 @@ struct ethtool_ops { | |||
352 | int (*phys_id)(struct net_device *, u32); | 361 | int (*phys_id)(struct net_device *, u32); |
353 | int (*get_stats_count)(struct net_device *); | 362 | int (*get_stats_count)(struct net_device *); |
354 | void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); | 363 | void (*get_ethtool_stats)(struct net_device *, struct ethtool_stats *, u64 *); |
364 | int (*get_perm_addr)(struct net_device *, struct ethtool_perm_addr *, u8 *); | ||
355 | int (*begin)(struct net_device *); | 365 | int (*begin)(struct net_device *); |
356 | void (*complete)(struct net_device *); | 366 | void (*complete)(struct net_device *); |
357 | }; | 367 | }; |
@@ -389,6 +399,7 @@ struct ethtool_ops { | |||
389 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ | 399 | #define ETHTOOL_GSTATS 0x0000001d /* get NIC-specific statistics */ |
390 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ | 400 | #define ETHTOOL_GTSO 0x0000001e /* Get TSO enable (ethtool_value) */ |
391 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ | 401 | #define ETHTOOL_STSO 0x0000001f /* Set TSO enable (ethtool_value) */ |
402 | #define ETHTOOL_GPERMADDR 0x00000020 /* Get permanent hardware address */ | ||
392 | 403 | ||
393 | /* compatibility with older code */ | 404 | /* compatibility with older code */ |
394 | #define SPARC_ETH_GSET ETHTOOL_GSET | 405 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -408,6 +419,8 @@ struct ethtool_ops { | |||
408 | #define SUPPORTED_FIBRE (1 << 10) | 419 | #define SUPPORTED_FIBRE (1 << 10) |
409 | #define SUPPORTED_BNC (1 << 11) | 420 | #define SUPPORTED_BNC (1 << 11) |
410 | #define SUPPORTED_10000baseT_Full (1 << 12) | 421 | #define SUPPORTED_10000baseT_Full (1 << 12) |
422 | #define SUPPORTED_Pause (1 << 13) | ||
423 | #define SUPPORTED_Asym_Pause (1 << 14) | ||
411 | 424 | ||
412 | /* Indicates what features are advertised by the interface. */ | 425 | /* Indicates what features are advertised by the interface. */ |
413 | #define ADVERTISED_10baseT_Half (1 << 0) | 426 | #define ADVERTISED_10baseT_Half (1 << 0) |
@@ -423,6 +436,8 @@ struct ethtool_ops { | |||
423 | #define ADVERTISED_FIBRE (1 << 10) | 436 | #define ADVERTISED_FIBRE (1 << 10) |
424 | #define ADVERTISED_BNC (1 << 11) | 437 | #define ADVERTISED_BNC (1 << 11) |
425 | #define ADVERTISED_10000baseT_Full (1 << 12) | 438 | #define ADVERTISED_10000baseT_Full (1 << 12) |
439 | #define ADVERTISED_Pause (1 << 13) | ||
440 | #define ADVERTISED_Asym_Pause (1 << 14) | ||
426 | 441 | ||
427 | /* The following are all involved in forcing a particular link | 442 | /* The following are all involved in forcing a particular link |
428 | * mode for the device for setting things. When getting the | 443 | * mode for the device for setting things. When getting the |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index a657130ba03a..f7bd1c7ebefb 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -313,6 +313,9 @@ struct ext2_inode { | |||
313 | #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ | 313 | #define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */ |
314 | #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ | 314 | #define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */ |
315 | #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ | 315 | #define EXT2_MOUNT_XIP 0x010000 /* Execute in place */ |
316 | #define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */ | ||
317 | #define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */ | ||
318 | |||
316 | 319 | ||
317 | #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt | 320 | #define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt |
318 | #define set_opt(o, opt) o |= EXT2_MOUNT_##opt | 321 | #define set_opt(o, opt) o |= EXT2_MOUNT_##opt |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c16662836c58..c0272d73ab20 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -373,6 +373,8 @@ struct ext3_inode { | |||
373 | #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ | 373 | #define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */ |
374 | #define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ | 374 | #define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */ |
375 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ | 375 | #define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */ |
376 | #define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */ | ||
377 | #define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */ | ||
376 | 378 | ||
377 | /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ | 379 | /* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */ |
378 | #ifndef _LINUX_EXT2_FS_H | 380 | #ifndef _LINUX_EXT2_FS_H |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index 886255b69bb9..2063c0839d4f 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -3,6 +3,9 @@ | |||
3 | #include <linux/module.h> | 3 | #include <linux/module.h> |
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #define FIRMWARE_NAME_MAX 30 | 5 | #define FIRMWARE_NAME_MAX 30 |
6 | #define FW_ACTION_NOHOTPLUG 0 | ||
7 | #define FW_ACTION_HOTPLUG 1 | ||
8 | |||
6 | struct firmware { | 9 | struct firmware { |
7 | size_t size; | 10 | size_t size; |
8 | u8 *data; | 11 | u8 *data; |
@@ -11,7 +14,7 @@ struct device; | |||
11 | int request_firmware(const struct firmware **fw, const char *name, | 14 | int request_firmware(const struct firmware **fw, const char *name, |
12 | struct device *device); | 15 | struct device *device); |
13 | int request_firmware_nowait( | 16 | int request_firmware_nowait( |
14 | struct module *module, | 17 | struct module *module, int hotplug, |
15 | const char *name, struct device *device, void *context, | 18 | const char *name, struct device *device, void *context, |
16 | void (*cont)(const struct firmware *fw, void *context)); | 19 | void (*cont)(const struct firmware *fw, void *context)); |
17 | 20 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 67e6732d4fdc..fd93ab7da905 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -69,6 +69,7 @@ extern int dir_notify_enable; | |||
69 | #define READ 0 | 69 | #define READ 0 |
70 | #define WRITE 1 | 70 | #define WRITE 1 |
71 | #define READA 2 /* read-ahead - don't block if no resources */ | 71 | #define READA 2 /* read-ahead - don't block if no resources */ |
72 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ | ||
72 | #define SPECIAL 4 /* For non-blockdevice requests in request queue */ | 73 | #define SPECIAL 4 /* For non-blockdevice requests in request queue */ |
73 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | 74 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) |
74 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 75 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
@@ -281,19 +282,9 @@ struct iattr { | |||
281 | struct timespec ia_atime; | 282 | struct timespec ia_atime; |
282 | struct timespec ia_mtime; | 283 | struct timespec ia_mtime; |
283 | struct timespec ia_ctime; | 284 | struct timespec ia_ctime; |
284 | unsigned int ia_attr_flags; | ||
285 | }; | 285 | }; |
286 | 286 | ||
287 | /* | 287 | /* |
288 | * This is the inode attributes flag definitions | ||
289 | */ | ||
290 | #define ATTR_FLAG_SYNCRONOUS 1 /* Syncronous write */ | ||
291 | #define ATTR_FLAG_NOATIME 2 /* Don't update atime */ | ||
292 | #define ATTR_FLAG_APPEND 4 /* Append-only file */ | ||
293 | #define ATTR_FLAG_IMMUTABLE 8 /* Immutable file */ | ||
294 | #define ATTR_FLAG_NODIRATIME 16 /* Don't update atime for directory */ | ||
295 | |||
296 | /* | ||
297 | * Includes for diskquotas. | 288 | * Includes for diskquotas. |
298 | */ | 289 | */ |
299 | #include <linux/quota.h> | 290 | #include <linux/quota.h> |
@@ -594,7 +585,6 @@ struct file { | |||
594 | unsigned int f_uid, f_gid; | 585 | unsigned int f_uid, f_gid; |
595 | struct file_ra_state f_ra; | 586 | struct file_ra_state f_ra; |
596 | 587 | ||
597 | size_t f_maxcount; | ||
598 | unsigned long f_version; | 588 | unsigned long f_version; |
599 | void *f_security; | 589 | void *f_security; |
600 | 590 | ||
@@ -1291,6 +1281,7 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1291 | /* fs/open.c */ | 1281 | /* fs/open.c */ |
1292 | 1282 | ||
1293 | extern int do_truncate(struct dentry *, loff_t start); | 1283 | extern int do_truncate(struct dentry *, loff_t start); |
1284 | extern long do_sys_open(const char __user *filename, int flags, int mode); | ||
1294 | extern struct file *filp_open(const char *, int, int); | 1285 | extern struct file *filp_open(const char *, int, int); |
1295 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); | 1286 | extern struct file * dentry_open(struct dentry *, struct vfsmount *, int); |
1296 | extern int filp_close(struct file *, fl_owner_t id); | 1287 | extern int filp_close(struct file *, fl_owner_t id); |
diff --git a/include/linux/futex.h b/include/linux/futex.h index 65d6cfdb6d39..10f96c31971e 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -4,14 +4,40 @@ | |||
4 | /* Second argument to futex syscall */ | 4 | /* Second argument to futex syscall */ |
5 | 5 | ||
6 | 6 | ||
7 | #define FUTEX_WAIT (0) | 7 | #define FUTEX_WAIT 0 |
8 | #define FUTEX_WAKE (1) | 8 | #define FUTEX_WAKE 1 |
9 | #define FUTEX_FD (2) | 9 | #define FUTEX_FD 2 |
10 | #define FUTEX_REQUEUE (3) | 10 | #define FUTEX_REQUEUE 3 |
11 | #define FUTEX_CMP_REQUEUE (4) | 11 | #define FUTEX_CMP_REQUEUE 4 |
12 | #define FUTEX_WAKE_OP 5 | ||
12 | 13 | ||
13 | long do_futex(unsigned long uaddr, int op, int val, | 14 | long do_futex(unsigned long uaddr, int op, int val, |
14 | unsigned long timeout, unsigned long uaddr2, int val2, | 15 | unsigned long timeout, unsigned long uaddr2, int val2, |
15 | int val3); | 16 | int val3); |
16 | 17 | ||
18 | #define FUTEX_OP_SET 0 /* *(int *)UADDR2 = OPARG; */ | ||
19 | #define FUTEX_OP_ADD 1 /* *(int *)UADDR2 += OPARG; */ | ||
20 | #define FUTEX_OP_OR 2 /* *(int *)UADDR2 |= OPARG; */ | ||
21 | #define FUTEX_OP_ANDN 3 /* *(int *)UADDR2 &= ~OPARG; */ | ||
22 | #define FUTEX_OP_XOR 4 /* *(int *)UADDR2 ^= OPARG; */ | ||
23 | |||
24 | #define FUTEX_OP_OPARG_SHIFT 8 /* Use (1 << OPARG) instead of OPARG. */ | ||
25 | |||
26 | #define FUTEX_OP_CMP_EQ 0 /* if (oldval == CMPARG) wake */ | ||
27 | #define FUTEX_OP_CMP_NE 1 /* if (oldval != CMPARG) wake */ | ||
28 | #define FUTEX_OP_CMP_LT 2 /* if (oldval < CMPARG) wake */ | ||
29 | #define FUTEX_OP_CMP_LE 3 /* if (oldval <= CMPARG) wake */ | ||
30 | #define FUTEX_OP_CMP_GT 4 /* if (oldval > CMPARG) wake */ | ||
31 | #define FUTEX_OP_CMP_GE 5 /* if (oldval >= CMPARG) wake */ | ||
32 | |||
33 | /* FUTEX_WAKE_OP will perform atomically | ||
34 | int oldval = *(int *)UADDR2; | ||
35 | *(int *)UADDR2 = oldval OP OPARG; | ||
36 | if (oldval CMP CMPARG) | ||
37 | wake UADDR2; */ | ||
38 | |||
39 | #define FUTEX_OP(op, oparg, cmp, cmparg) \ | ||
40 | (((op & 0xf) << 28) | ((cmp & 0xf) << 24) \ | ||
41 | | ((oparg & 0xfff) << 12) | (cmparg & 0xfff)) | ||
42 | |||
17 | #endif | 43 | #endif |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 7c7400137e97..4dc990f3b5cc 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -40,6 +40,7 @@ struct vm_area_struct; | |||
40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ | 40 | #define __GFP_ZERO 0x8000u /* Return zeroed page on success */ |
41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ | 41 | #define __GFP_NOMEMALLOC 0x10000u /* Don't use emergency reserves */ |
42 | #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ | 42 | #define __GFP_NORECLAIM 0x20000u /* No realy zone reclaim during allocation */ |
43 | #define __GFP_HARDWALL 0x40000u /* Enforce hardwall cpuset memory allocs */ | ||
43 | 44 | ||
44 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ | 45 | #define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ |
45 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) | 46 | #define __GFP_BITS_MASK ((1 << __GFP_BITS_SHIFT) - 1) |
@@ -48,14 +49,15 @@ struct vm_area_struct; | |||
48 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ | 49 | #define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ |
49 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ | 50 | __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ |
50 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ | 51 | __GFP_NOFAIL|__GFP_NORETRY|__GFP_NO_GROW|__GFP_COMP| \ |
51 | __GFP_NOMEMALLOC|__GFP_NORECLAIM) | 52 | __GFP_NOMEMALLOC|__GFP_NORECLAIM|__GFP_HARDWALL) |
52 | 53 | ||
53 | #define GFP_ATOMIC (__GFP_HIGH) | 54 | #define GFP_ATOMIC (__GFP_HIGH) |
54 | #define GFP_NOIO (__GFP_WAIT) | 55 | #define GFP_NOIO (__GFP_WAIT) |
55 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) | 56 | #define GFP_NOFS (__GFP_WAIT | __GFP_IO) |
56 | #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) | 57 | #define GFP_KERNEL (__GFP_WAIT | __GFP_IO | __GFP_FS) |
57 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS) | 58 | #define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) |
58 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HIGHMEM) | 59 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
60 | __GFP_HIGHMEM) | ||
59 | 61 | ||
60 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some | 62 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some |
61 | platforms, used as appropriate on others */ | 63 | platforms, used as appropriate on others */ |
diff --git a/include/linux/hippidevice.h b/include/linux/hippidevice.h index 9debe6bbe5f0..bab303dafd6e 100644 --- a/include/linux/hippidevice.h +++ b/include/linux/hippidevice.h | |||
@@ -26,8 +26,12 @@ | |||
26 | #include <linux/if_hippi.h> | 26 | #include <linux/if_hippi.h> |
27 | 27 | ||
28 | #ifdef __KERNEL__ | 28 | #ifdef __KERNEL__ |
29 | extern unsigned short hippi_type_trans(struct sk_buff *skb, | 29 | |
30 | struct net_device *dev); | 30 | struct hippi_cb { |
31 | __u32 ifield; | ||
32 | }; | ||
33 | |||
34 | extern __be16 hippi_type_trans(struct sk_buff *skb, struct net_device *dev); | ||
31 | 35 | ||
32 | extern struct net_device *alloc_hippi_dev(int sizeof_priv); | 36 | extern struct net_device *alloc_hippi_dev(int sizeof_priv); |
33 | #endif | 37 | #endif |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index f529d1442815..e670b0d13fe0 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -70,12 +70,6 @@ pte_t huge_ptep_get_and_clear(struct mm_struct *mm, unsigned long addr, | |||
70 | void hugetlb_prefault_arch_hook(struct mm_struct *mm); | 70 | void hugetlb_prefault_arch_hook(struct mm_struct *mm); |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | #ifndef ARCH_HAS_HUGETLB_CLEAN_STALE_PGTABLE | ||
74 | #define hugetlb_clean_stale_pgtable(pte) BUG() | ||
75 | #else | ||
76 | void hugetlb_clean_stale_pgtable(pte_t *pte); | ||
77 | #endif | ||
78 | |||
79 | #else /* !CONFIG_HUGETLB_PAGE */ | 73 | #else /* !CONFIG_HUGETLB_PAGE */ |
80 | 74 | ||
81 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 75 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 1b5018a965f5..7eb4004b3601 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h | |||
@@ -33,4 +33,19 @@ struct sensor_device_attribute sensor_dev_attr_##_name = { \ | |||
33 | .index = _index, \ | 33 | .index = _index, \ |
34 | } | 34 | } |
35 | 35 | ||
36 | struct sensor_device_attribute_2 { | ||
37 | struct device_attribute dev_attr; | ||
38 | u8 index; | ||
39 | u8 nr; | ||
40 | }; | ||
41 | #define to_sensor_dev_attr_2(_dev_attr) \ | ||
42 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) | ||
43 | |||
44 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ | ||
45 | struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ | ||
46 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | ||
47 | .index = _index, \ | ||
48 | .nr = _nr, \ | ||
49 | } | ||
50 | |||
36 | #endif /* _LINUX_HWMON_SYSFS_H */ | 51 | #endif /* _LINUX_HWMON_SYSFS_H */ |
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h new file mode 100644 index 000000000000..cd4b7a042b86 --- /dev/null +++ b/include/linux/hwmon-vid.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | hwmon-vid.h - VID/VRM/VRD voltage conversions | ||
3 | |||
4 | Originally part of lm_sensors | ||
5 | Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> | ||
6 | With assistance from Trent Piepho <xyzzy@speakeasy.org> | ||
7 | |||
8 | This program is free software; you can redistribute it and/or modify | ||
9 | it under the terms of the GNU General Public License as published by | ||
10 | the Free Software Foundation; either version 2 of the License, or | ||
11 | (at your option) any later version. | ||
12 | |||
13 | This program is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | GNU General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU General Public License | ||
19 | along with this program; if not, write to the Free Software | ||
20 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
21 | */ | ||
22 | |||
23 | #ifndef _LINUX_HWMON_VID_H | ||
24 | #define _LINUX_HWMON_VID_H | ||
25 | |||
26 | int vid_from_reg(int val, int vrm); | ||
27 | int vid_which_vrm(void); | ||
28 | |||
29 | /* vrm is the VRM/VRD document version multiplied by 10. | ||
30 | val is in mV to avoid floating point in the kernel. | ||
31 | Returned value is the 4-, 5- or 6-bit VID code. | ||
32 | Note that only VRM 9.x is supported for now. */ | ||
33 | static inline int vid_to_reg(int val, int vrm) | ||
34 | { | ||
35 | switch (vrm) { | ||
36 | case 91: /* VRM 9.1 */ | ||
37 | case 90: /* VRM 9.0 */ | ||
38 | return ((val >= 1100) && (val <= 1850) ? | ||
39 | ((18499 - val * 10) / 25 + 5) / 10 : -1); | ||
40 | default: | ||
41 | return -1; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | #endif /* _LINUX_HWMON_VID_H */ | ||
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h new file mode 100644 index 000000000000..0efd994c37f1 --- /dev/null +++ b/include/linux/hwmon.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* | ||
2 | hwmon.h - part of lm_sensors, Linux kernel modules for hardware monitoring | ||
3 | |||
4 | This file declares helper functions for the sysfs class "hwmon", | ||
5 | for use by sensors drivers. | ||
6 | |||
7 | Copyright (C) 2005 Mark M. Hoffman <mhoffman@lightlink.com> | ||
8 | |||
9 | This program is free software; you can redistribute it and/or modify | ||
10 | it under the terms of the GNU General Public License as published by | ||
11 | the Free Software Foundation; version 2 of the License. | ||
12 | */ | ||
13 | |||
14 | #ifndef _HWMON_H_ | ||
15 | #define _HWMON_H_ | ||
16 | |||
17 | #include <linux/device.h> | ||
18 | |||
19 | struct class_device *hwmon_device_register(struct device *dev); | ||
20 | |||
21 | void hwmon_device_unregister(struct class_device *cdev); | ||
22 | |||
23 | /* Scale user input to sensible values */ | ||
24 | static inline int SENSORS_LIMIT(long value, long low, long high) | ||
25 | { | ||
26 | if (value < low) | ||
27 | return low; | ||
28 | else if (value > high) | ||
29 | return high; | ||
30 | else | ||
31 | return value; | ||
32 | } | ||
33 | |||
34 | #endif | ||
35 | |||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 33f08258f22b..44f30876a1c9 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* ------------------------------------------------------------------------- */ | 1 | /* ------------------------------------------------------------------------- */ |
2 | /* */ | 2 | /* */ |
3 | /* i2c.h - definitions for the i2c-bus interface */ | 3 | /* i2c-id.h - identifier values for i2c drivers and adapters */ |
4 | /* */ | 4 | /* */ |
5 | /* ------------------------------------------------------------------------- */ | 5 | /* ------------------------------------------------------------------------- */ |
6 | /* Copyright (C) 1995-1999 Simon G. Vogl | 6 | /* Copyright (C) 1995-1999 Simon G. Vogl |
@@ -24,16 +24,6 @@ | |||
24 | #define LINUX_I2C_ID_H | 24 | #define LINUX_I2C_ID_H |
25 | 25 | ||
26 | /* | 26 | /* |
27 | * This file is part of the i2c-bus package and contains the identifier | ||
28 | * values for drivers, adapters and other folk populating these serial | ||
29 | * worlds. | ||
30 | * | ||
31 | * These will change often (i.e. additions) , therefore this has been | ||
32 | * separated from the functional interface definitions of the i2c api. | ||
33 | * | ||
34 | */ | ||
35 | |||
36 | /* | ||
37 | * ---- Driver types ----------------------------------------------------- | 27 | * ---- Driver types ----------------------------------------------------- |
38 | * device id name + number function description, i2c address(es) | 28 | * device id name + number function description, i2c address(es) |
39 | * | 29 | * |
@@ -170,151 +160,113 @@ | |||
170 | 160 | ||
171 | /* | 161 | /* |
172 | * ---- Adapter types ---------------------------------------------------- | 162 | * ---- Adapter types ---------------------------------------------------- |
173 | * | ||
174 | * First, we distinguish between several algorithms to access the hardware | ||
175 | * interface types, as a PCF 8584 needs other care than a bit adapter. | ||
176 | */ | ||
177 | |||
178 | #define I2C_ALGO_NONE 0x000000 | ||
179 | #define I2C_ALGO_BIT 0x010000 /* bit style adapters */ | ||
180 | #define I2C_ALGO_PCF 0x020000 /* PCF 8584 style adapters */ | ||
181 | #define I2C_ALGO_ATI 0x030000 /* ATI video card */ | ||
182 | #define I2C_ALGO_SMBUS 0x040000 | ||
183 | #define I2C_ALGO_ISA 0x050000 /* lm_sensors ISA pseudo-adapter */ | ||
184 | #define I2C_ALGO_SAA7146 0x060000 /* SAA 7146 video decoder bus */ | ||
185 | #define I2C_ALGO_ACB 0x070000 /* ACCESS.bus algorithm */ | ||
186 | #define I2C_ALGO_IIC 0x080000 /* ITE IIC bus */ | ||
187 | #define I2C_ALGO_SAA7134 0x090000 | ||
188 | #define I2C_ALGO_MPC824X 0x0a0000 /* Motorola 8240 / 8245 */ | ||
189 | #define I2C_ALGO_IPMI 0x0b0000 /* IPMI dummy adapter */ | ||
190 | #define I2C_ALGO_IPMB 0x0c0000 /* IPMB adapter */ | ||
191 | #define I2C_ALGO_MPC107 0x0d0000 | ||
192 | #define I2C_ALGO_EC 0x100000 /* ACPI embedded controller */ | ||
193 | |||
194 | #define I2C_ALGO_MPC8XX 0x110000 /* MPC8xx PowerPC I2C algorithm */ | ||
195 | #define I2C_ALGO_OCP 0x120000 /* IBM or otherwise On-chip I2C algorithm */ | ||
196 | #define I2C_ALGO_BITHS 0x130000 /* enhanced bit style adapters */ | ||
197 | #define I2C_ALGO_IOP3XX 0x140000 /* XSCALE IOP3XX On-chip I2C alg */ | ||
198 | #define I2C_ALGO_SIBYTE 0x150000 /* Broadcom SiByte SOCs */ | ||
199 | #define I2C_ALGO_SGI 0x160000 /* SGI algorithm */ | ||
200 | |||
201 | #define I2C_ALGO_USB 0x170000 /* USB algorithm */ | ||
202 | #define I2C_ALGO_VIRT 0x180000 /* Virtual bus adapter */ | ||
203 | |||
204 | #define I2C_ALGO_MV64XXX 0x190000 /* Marvell mv64xxx i2c ctlr */ | ||
205 | #define I2C_ALGO_PCA 0x1a0000 /* PCA 9564 style adapters */ | ||
206 | #define I2C_ALGO_AU1550 0x1b0000 /* Au1550 PSC algorithm */ | ||
207 | |||
208 | #define I2C_ALGO_EXP 0x800000 /* experimental */ | ||
209 | |||
210 | #define I2C_ALGO_MASK 0xff0000 /* Mask for algorithms */ | ||
211 | #define I2C_ALGO_SHIFT 0x10 /* right shift to get index values */ | ||
212 | |||
213 | #define I2C_HW_ADAPS 0x10000 /* # adapter types */ | ||
214 | #define I2C_HW_MASK 0xffff | ||
215 | |||
216 | |||
217 | /* hw specific modules that are defined per algorithm layer | ||
218 | */ | 163 | */ |
219 | 164 | ||
220 | /* --- Bit algorithm adapters */ | 165 | /* --- Bit algorithm adapters */ |
221 | #define I2C_HW_B_LP 0x00 /* Parallel port Philips style adapter */ | 166 | #define I2C_HW_B_LP 0x010000 /* Parallel port Philips style */ |
222 | #define I2C_HW_B_LPC 0x01 /* Parallel port, over control reg. */ | 167 | #define I2C_HW_B_LPC 0x010001 /* Parallel port control reg. */ |
223 | #define I2C_HW_B_SER 0x02 /* Serial line interface */ | 168 | #define I2C_HW_B_SER 0x010002 /* Serial line interface */ |
224 | #define I2C_HW_B_ELV 0x03 /* ELV Card */ | 169 | #define I2C_HW_B_ELV 0x010003 /* ELV Card */ |
225 | #define I2C_HW_B_VELLE 0x04 /* Vellemann K8000 */ | 170 | #define I2C_HW_B_VELLE 0x010004 /* Vellemann K8000 */ |
226 | #define I2C_HW_B_BT848 0x05 /* BT848 video boards */ | 171 | #define I2C_HW_B_BT848 0x010005 /* BT848 video boards */ |
227 | #define I2C_HW_B_WNV 0x06 /* Winnov Videums */ | 172 | #define I2C_HW_B_WNV 0x010006 /* Winnov Videums */ |
228 | #define I2C_HW_B_VIA 0x07 /* Via vt82c586b */ | 173 | #define I2C_HW_B_VIA 0x010007 /* Via vt82c586b */ |
229 | #define I2C_HW_B_HYDRA 0x08 /* Apple Hydra Mac I/O */ | 174 | #define I2C_HW_B_HYDRA 0x010008 /* Apple Hydra Mac I/O */ |
230 | #define I2C_HW_B_G400 0x09 /* Matrox G400 */ | 175 | #define I2C_HW_B_G400 0x010009 /* Matrox G400 */ |
231 | #define I2C_HW_B_I810 0x0a /* Intel I810 */ | 176 | #define I2C_HW_B_I810 0x01000a /* Intel I810 */ |
232 | #define I2C_HW_B_VOO 0x0b /* 3dfx Voodoo 3 / Banshee */ | 177 | #define I2C_HW_B_VOO 0x01000b /* 3dfx Voodoo 3 / Banshee */ |
233 | #define I2C_HW_B_PPORT 0x0c /* Primitive parallel port adapter */ | 178 | #define I2C_HW_B_PPORT 0x01000c /* Primitive parallel port adapter */ |
234 | #define I2C_HW_B_SAVG 0x0d /* Savage 4 */ | 179 | #define I2C_HW_B_SAVG 0x01000d /* Savage 4 */ |
235 | #define I2C_HW_B_SCX200 0x0e /* Nat'l Semi SCx200 I2C */ | 180 | #define I2C_HW_B_SCX200 0x01000e /* Nat'l Semi SCx200 I2C */ |
236 | #define I2C_HW_B_RIVA 0x10 /* Riva based graphics cards */ | 181 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ |
237 | #define I2C_HW_B_IOC 0x11 /* IOC bit-wiggling */ | 182 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ |
238 | #define I2C_HW_B_TSUNA 0x12 /* DEC Tsunami chipset */ | 183 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ |
239 | #define I2C_HW_B_FRODO 0x13 /* 2d3D, Inc. SA-1110 Development Board */ | 184 | #define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */ |
240 | #define I2C_HW_B_OMAHA 0x14 /* Omaha I2C interface (ARM) */ | 185 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ |
241 | #define I2C_HW_B_GUIDE 0x15 /* Guide bit-basher */ | 186 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ |
242 | #define I2C_HW_B_IXP2000 0x16 /* GPIO on IXP2000 systems */ | 187 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ |
243 | #define I2C_HW_B_IXP4XX 0x17 /* GPIO on IXP4XX systems */ | 188 | #define I2C_HW_B_IXP4XX 0x010017 /* GPIO on IXP4XX systems */ |
244 | #define I2C_HW_B_S3VIA 0x18 /* S3Via ProSavage adapter */ | 189 | #define I2C_HW_B_S3VIA 0x010018 /* S3Via ProSavage adapter */ |
245 | #define I2C_HW_B_ZR36067 0x19 /* Zoran-36057/36067 based boards */ | 190 | #define I2C_HW_B_ZR36067 0x010019 /* Zoran-36057/36067 based boards */ |
246 | #define I2C_HW_B_PCILYNX 0x1a /* TI PCILynx I2C adapter */ | 191 | #define I2C_HW_B_PCILYNX 0x01001a /* TI PCILynx I2C adapter */ |
247 | #define I2C_HW_B_CX2388x 0x1b /* connexant 2388x based tv cards */ | 192 | #define I2C_HW_B_CX2388x 0x01001b /* connexant 2388x based tv cards */ |
193 | #define I2C_HW_B_NVIDIA 0x01001c /* nvidia framebuffer driver */ | ||
194 | #define I2C_HW_B_SAVAGE 0x01001d /* savage framebuffer driver */ | ||
195 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | ||
248 | 196 | ||
249 | /* --- PCF 8584 based algorithms */ | 197 | /* --- PCF 8584 based algorithms */ |
250 | #define I2C_HW_P_LP 0x00 /* Parallel port interface */ | 198 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
251 | #define I2C_HW_P_ISA 0x01 /* generic ISA Bus inteface card */ | 199 | #define I2C_HW_P_ISA 0x020001 /* generic ISA Bus inteface card */ |
252 | #define I2C_HW_P_ELEK 0x02 /* Elektor ISA Bus inteface card */ | 200 | #define I2C_HW_P_ELEK 0x020002 /* Elektor ISA Bus inteface card */ |
253 | 201 | ||
254 | /* --- PCA 9564 based algorithms */ | 202 | /* --- PCA 9564 based algorithms */ |
255 | #define I2C_HW_A_ISA 0x00 /* generic ISA Bus interface card */ | 203 | #define I2C_HW_A_ISA 0x1a0000 /* generic ISA Bus interface card */ |
256 | 204 | ||
257 | /* --- ACPI Embedded controller algorithms */ | 205 | /* --- ACPI Embedded controller algorithms */ |
258 | #define I2C_HW_ACPI_EC 0x00 | 206 | #define I2C_HW_ACPI_EC 0x1f0000 |
259 | 207 | ||
260 | /* --- MPC824x PowerPC adapters */ | 208 | /* --- MPC824x PowerPC adapters */ |
261 | #define I2C_HW_MPC824X 0x00 /* Motorola 8240 / 8245 */ | 209 | #define I2C_HW_MPC824X 0x100001 /* Motorola 8240 / 8245 */ |
262 | 210 | ||
263 | /* --- MPC8xx PowerPC adapters */ | 211 | /* --- MPC8xx PowerPC adapters */ |
264 | #define I2C_HW_MPC8XX_EPON 0x00 /* Eponymous MPC8xx I2C adapter */ | 212 | #define I2C_HW_MPC8XX_EPON 0x110000 /* Eponymous MPC8xx I2C adapter */ |
265 | 213 | ||
266 | /* --- ITE based algorithms */ | 214 | /* --- ITE based algorithms */ |
267 | #define I2C_HW_I_IIC 0x00 /* controller on the ITE */ | 215 | #define I2C_HW_I_IIC 0x080000 /* controller on the ITE */ |
268 | 216 | ||
269 | /* --- PowerPC on-chip adapters */ | 217 | /* --- PowerPC on-chip adapters */ |
270 | #define I2C_HW_OCP 0x00 /* IBM on-chip I2C adapter */ | 218 | #define I2C_HW_OCP 0x120000 /* IBM on-chip I2C adapter */ |
271 | 219 | ||
272 | /* --- Broadcom SiByte adapters */ | 220 | /* --- Broadcom SiByte adapters */ |
273 | #define I2C_HW_SIBYTE 0x00 | 221 | #define I2C_HW_SIBYTE 0x150000 |
274 | 222 | ||
275 | /* --- SGI adapters */ | 223 | /* --- SGI adapters */ |
276 | #define I2C_HW_SGI_VINO 0x00 | 224 | #define I2C_HW_SGI_VINO 0x160000 |
277 | #define I2C_HW_SGI_MACE 0x01 | 225 | #define I2C_HW_SGI_MACE 0x160001 |
278 | 226 | ||
279 | /* --- XSCALE on-chip adapters */ | 227 | /* --- XSCALE on-chip adapters */ |
280 | #define I2C_HW_IOP3XX 0x00 | 228 | #define I2C_HW_IOP3XX 0x140000 |
281 | 229 | ||
282 | /* --- Au1550 PSC adapters adapters */ | 230 | /* --- Au1550 PSC adapters adapters */ |
283 | #define I2C_HW_AU1550_PSC 0x00 | 231 | #define I2C_HW_AU1550_PSC 0x1b0000 |
284 | 232 | ||
285 | /* --- SMBus only adapters */ | 233 | /* --- SMBus only adapters */ |
286 | #define I2C_HW_SMBUS_PIIX4 0x00 | 234 | #define I2C_HW_SMBUS_PIIX4 0x040000 |
287 | #define I2C_HW_SMBUS_ALI15X3 0x01 | 235 | #define I2C_HW_SMBUS_ALI15X3 0x040001 |
288 | #define I2C_HW_SMBUS_VIA2 0x02 | 236 | #define I2C_HW_SMBUS_VIA2 0x040002 |
289 | #define I2C_HW_SMBUS_VOODOO3 0x03 | 237 | #define I2C_HW_SMBUS_VOODOO3 0x040003 |
290 | #define I2C_HW_SMBUS_I801 0x04 | 238 | #define I2C_HW_SMBUS_I801 0x040004 |
291 | #define I2C_HW_SMBUS_AMD756 0x05 | 239 | #define I2C_HW_SMBUS_AMD756 0x040005 |
292 | #define I2C_HW_SMBUS_SIS5595 0x06 | 240 | #define I2C_HW_SMBUS_SIS5595 0x040006 |
293 | #define I2C_HW_SMBUS_ALI1535 0x07 | 241 | #define I2C_HW_SMBUS_ALI1535 0x040007 |
294 | #define I2C_HW_SMBUS_SIS630 0x08 | 242 | #define I2C_HW_SMBUS_SIS630 0x040008 |
295 | #define I2C_HW_SMBUS_SIS96X 0x09 | 243 | #define I2C_HW_SMBUS_SIS96X 0x040009 |
296 | #define I2C_HW_SMBUS_AMD8111 0x0a | 244 | #define I2C_HW_SMBUS_AMD8111 0x04000a |
297 | #define I2C_HW_SMBUS_SCX200 0x0b | 245 | #define I2C_HW_SMBUS_SCX200 0x04000b |
298 | #define I2C_HW_SMBUS_NFORCE2 0x0c | 246 | #define I2C_HW_SMBUS_NFORCE2 0x04000c |
299 | #define I2C_HW_SMBUS_W9968CF 0x0d | 247 | #define I2C_HW_SMBUS_W9968CF 0x04000d |
300 | #define I2C_HW_SMBUS_OV511 0x0e /* OV511(+) USB 1.1 webcam ICs */ | 248 | #define I2C_HW_SMBUS_OV511 0x04000e /* OV511(+) USB 1.1 webcam ICs */ |
301 | #define I2C_HW_SMBUS_OV518 0x0f /* OV518(+) USB 1.1 webcam ICs */ | 249 | #define I2C_HW_SMBUS_OV518 0x04000f /* OV518(+) USB 1.1 webcam ICs */ |
302 | #define I2C_HW_SMBUS_OV519 0x10 /* OV519 USB 1.1 webcam IC */ | 250 | #define I2C_HW_SMBUS_OV519 0x040010 /* OV519 USB 1.1 webcam IC */ |
303 | #define I2C_HW_SMBUS_OVFX2 0x11 /* Cypress/OmniVision FX2 webcam */ | 251 | #define I2C_HW_SMBUS_OVFX2 0x040011 /* Cypress/OmniVision FX2 webcam */ |
304 | 252 | ||
305 | /* --- ISA pseudo-adapter */ | 253 | /* --- ISA pseudo-adapter */ |
306 | #define I2C_HW_ISA 0x00 | 254 | #define I2C_HW_ISA 0x050000 |
307 | 255 | ||
308 | /* --- IPMI pseudo-adapter */ | 256 | /* --- IPMI pseudo-adapter */ |
309 | #define I2C_HW_IPMI 0x00 | 257 | #define I2C_HW_IPMI 0x0b0000 |
310 | 258 | ||
311 | /* --- IPMB adapter */ | 259 | /* --- IPMB adapter */ |
312 | #define I2C_HW_IPMB 0x00 | 260 | #define I2C_HW_IPMB 0x0c0000 |
313 | 261 | ||
314 | /* --- MCP107 adapter */ | 262 | /* --- MCP107 adapter */ |
315 | #define I2C_HW_MPC107 0x00 | 263 | #define I2C_HW_MPC107 0x0d0000 |
316 | 264 | ||
317 | /* --- Marvell mv64xxx i2c adapter */ | 265 | /* --- Marvell mv64xxx i2c adapter */ |
318 | #define I2C_HW_MV64XXX 0x00 | 266 | #define I2C_HW_MV64XXX 0x190000 |
267 | |||
268 | /* --- Miscellaneous adapters */ | ||
269 | #define I2C_HW_SAA7146 0x060000 /* SAA7146 video decoder bus */ | ||
270 | #define I2C_HW_SAA7134 0x090000 /* SAA7134 video decoder bus */ | ||
319 | 271 | ||
320 | #endif /* LINUX_I2C_ID_H */ | 272 | #endif /* LINUX_I2C_ID_H */ |
diff --git a/include/linux/i2c-isa.h b/include/linux/i2c-isa.h new file mode 100644 index 000000000000..67e3598c4cec --- /dev/null +++ b/include/linux/i2c-isa.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * i2c-isa.h - definitions for the i2c-isa pseudo-i2c-adapter interface | ||
3 | * | ||
4 | * Copyright (C) 2005 Jean Delvare <khali@linux-fr.org> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #ifndef _LINUX_I2C_ISA_H | ||
22 | #define _LINUX_I2C_ISA_H | ||
23 | |||
24 | #include <linux/i2c.h> | ||
25 | |||
26 | extern int i2c_isa_add_driver(struct i2c_driver *driver); | ||
27 | extern int i2c_isa_del_driver(struct i2c_driver *driver); | ||
28 | |||
29 | /* Detect whether we are on the isa bus. This is only useful to hybrid | ||
30 | (i2c+isa) drivers. */ | ||
31 | #define i2c_is_isa_adapter(adapptr) \ | ||
32 | ((adapptr)->id == I2C_HW_ISA) | ||
33 | #define i2c_is_isa_client(clientptr) \ | ||
34 | i2c_is_isa_adapter((clientptr)->adapter) | ||
35 | |||
36 | #endif /* _LINUX_I2C_ISA_H */ | ||
diff --git a/include/linux/i2c-sensor.h b/include/linux/i2c-sensor.h deleted file mode 100644 index 21b625204956..000000000000 --- a/include/linux/i2c-sensor.h +++ /dev/null | |||
@@ -1,263 +0,0 @@ | |||
1 | /* | ||
2 | i2c-sensor.h - Part of the i2c package | ||
3 | was originally sensors.h - Part of lm_sensors, Linux kernel modules | ||
4 | for hardware monitoring | ||
5 | Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl> | ||
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, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #ifndef _LINUX_I2C_SENSOR_H | ||
23 | #define _LINUX_I2C_SENSOR_H | ||
24 | |||
25 | /* A structure containing detect information. | ||
26 | Force variables overrule all other variables; they force a detection on | ||
27 | that place. If a specific chip is given, the module blindly assumes this | ||
28 | chip type is present; if a general force (kind == 0) is given, the module | ||
29 | will still try to figure out what type of chip is present. This is useful | ||
30 | if for some reasons the detect for SMBus or ISA address space filled | ||
31 | fails. | ||
32 | probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. | ||
33 | A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for | ||
34 | the ISA bus, -1 for any I2C bus), the second is the address. | ||
35 | kind: The kind of chip. 0 equals any chip. | ||
36 | */ | ||
37 | struct i2c_force_data { | ||
38 | unsigned short *force; | ||
39 | unsigned short kind; | ||
40 | }; | ||
41 | |||
42 | /* A structure containing the detect information. | ||
43 | normal_i2c: filled in by the module writer. Terminated by I2C_CLIENT_ISA_END. | ||
44 | A list of I2C addresses which should normally be examined. | ||
45 | normal_isa: filled in by the module writer. Terminated by SENSORS_ISA_END. | ||
46 | A list of ISA addresses which should normally be examined. | ||
47 | probe: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. | ||
48 | A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for | ||
49 | the ISA bus, -1 for any I2C bus), the second is the address. These | ||
50 | addresses are also probed, as if they were in the 'normal' list. | ||
51 | ignore: insmod parameter. Initialize this list with I2C_CLIENT_ISA_END values. | ||
52 | A list of pairs. The first value is a bus number (ANY_I2C_ISA_BUS for | ||
53 | the ISA bus, -1 for any I2C bus), the second is the I2C address. These | ||
54 | addresses are never probed. This parameter overrules 'normal' and | ||
55 | 'probe', but not the 'force' lists. | ||
56 | force_data: insmod parameters. A list, ending with an element of which | ||
57 | the force field is NULL. | ||
58 | */ | ||
59 | struct i2c_address_data { | ||
60 | unsigned short *normal_i2c; | ||
61 | unsigned int *normal_isa; | ||
62 | unsigned short *probe; | ||
63 | unsigned short *ignore; | ||
64 | struct i2c_force_data *forces; | ||
65 | }; | ||
66 | |||
67 | #define SENSORS_MODULE_PARM_FORCE(name) \ | ||
68 | I2C_CLIENT_MODULE_PARM(force_ ## name, \ | ||
69 | "List of adapter,address pairs which are unquestionably" \ | ||
70 | " assumed to contain a `" # name "' chip") | ||
71 | |||
72 | |||
73 | /* This defines several insmod variables, and the addr_data structure */ | ||
74 | #define SENSORS_INSMOD \ | ||
75 | I2C_CLIENT_MODULE_PARM(probe, \ | ||
76 | "List of adapter,address pairs to scan additionally"); \ | ||
77 | I2C_CLIENT_MODULE_PARM(ignore, \ | ||
78 | "List of adapter,address pairs not to scan"); \ | ||
79 | static struct i2c_address_data addr_data = { \ | ||
80 | .normal_i2c = normal_i2c, \ | ||
81 | .normal_isa = normal_isa, \ | ||
82 | .probe = probe, \ | ||
83 | .ignore = ignore, \ | ||
84 | .forces = forces, \ | ||
85 | } | ||
86 | |||
87 | /* The following functions create an enum with the chip names as elements. | ||
88 | The first element of the enum is any_chip. These are the only macros | ||
89 | a module will want to use. */ | ||
90 | |||
91 | #define SENSORS_INSMOD_0 \ | ||
92 | enum chips { any_chip }; \ | ||
93 | I2C_CLIENT_MODULE_PARM(force, \ | ||
94 | "List of adapter,address pairs to boldly assume " \ | ||
95 | "to be present"); \ | ||
96 | static struct i2c_force_data forces[] = {{force,any_chip},{NULL}}; \ | ||
97 | SENSORS_INSMOD | ||
98 | |||
99 | #define SENSORS_INSMOD_1(chip1) \ | ||
100 | enum chips { any_chip, chip1 }; \ | ||
101 | I2C_CLIENT_MODULE_PARM(force, \ | ||
102 | "List of adapter,address pairs to boldly assume " \ | ||
103 | "to be present"); \ | ||
104 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
105 | static struct i2c_force_data forces[] = {{force,any_chip},\ | ||
106 | {force_ ## chip1,chip1}, \ | ||
107 | {NULL}}; \ | ||
108 | SENSORS_INSMOD | ||
109 | |||
110 | #define SENSORS_INSMOD_2(chip1,chip2) \ | ||
111 | enum chips { any_chip, chip1, chip2 }; \ | ||
112 | I2C_CLIENT_MODULE_PARM(force, \ | ||
113 | "List of adapter,address pairs to boldly assume " \ | ||
114 | "to be present"); \ | ||
115 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
116 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
117 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
118 | {force_ ## chip1,chip1}, \ | ||
119 | {force_ ## chip2,chip2}, \ | ||
120 | {NULL}}; \ | ||
121 | SENSORS_INSMOD | ||
122 | |||
123 | #define SENSORS_INSMOD_3(chip1,chip2,chip3) \ | ||
124 | enum chips { any_chip, chip1, chip2, chip3 }; \ | ||
125 | I2C_CLIENT_MODULE_PARM(force, \ | ||
126 | "List of adapter,address pairs to boldly assume " \ | ||
127 | "to be present"); \ | ||
128 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
129 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
130 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
131 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
132 | {force_ ## chip1,chip1}, \ | ||
133 | {force_ ## chip2,chip2}, \ | ||
134 | {force_ ## chip3,chip3}, \ | ||
135 | {NULL}}; \ | ||
136 | SENSORS_INSMOD | ||
137 | |||
138 | #define SENSORS_INSMOD_4(chip1,chip2,chip3,chip4) \ | ||
139 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | ||
140 | I2C_CLIENT_MODULE_PARM(force, \ | ||
141 | "List of adapter,address pairs to boldly assume " \ | ||
142 | "to be present"); \ | ||
143 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
144 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
145 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
146 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
147 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
148 | {force_ ## chip1,chip1}, \ | ||
149 | {force_ ## chip2,chip2}, \ | ||
150 | {force_ ## chip3,chip3}, \ | ||
151 | {force_ ## chip4,chip4}, \ | ||
152 | {NULL}}; \ | ||
153 | SENSORS_INSMOD | ||
154 | |||
155 | #define SENSORS_INSMOD_5(chip1,chip2,chip3,chip4,chip5) \ | ||
156 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | ||
157 | I2C_CLIENT_MODULE_PARM(force, \ | ||
158 | "List of adapter,address pairs to boldly assume " \ | ||
159 | "to be present"); \ | ||
160 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
161 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
162 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
163 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
164 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
165 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
166 | {force_ ## chip1,chip1}, \ | ||
167 | {force_ ## chip2,chip2}, \ | ||
168 | {force_ ## chip3,chip3}, \ | ||
169 | {force_ ## chip4,chip4}, \ | ||
170 | {force_ ## chip5,chip5}, \ | ||
171 | {NULL}}; \ | ||
172 | SENSORS_INSMOD | ||
173 | |||
174 | #define SENSORS_INSMOD_6(chip1,chip2,chip3,chip4,chip5,chip6) \ | ||
175 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | ||
176 | I2C_CLIENT_MODULE_PARM(force, \ | ||
177 | "List of adapter,address pairs to boldly assume " \ | ||
178 | "to be present"); \ | ||
179 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
180 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
181 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
182 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
183 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
184 | SENSORS_MODULE_PARM_FORCE(chip6); \ | ||
185 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
186 | {force_ ## chip1,chip1}, \ | ||
187 | {force_ ## chip2,chip2}, \ | ||
188 | {force_ ## chip3,chip3}, \ | ||
189 | {force_ ## chip4,chip4}, \ | ||
190 | {force_ ## chip5,chip5}, \ | ||
191 | {force_ ## chip6,chip6}, \ | ||
192 | {NULL}}; \ | ||
193 | SENSORS_INSMOD | ||
194 | |||
195 | #define SENSORS_INSMOD_7(chip1,chip2,chip3,chip4,chip5,chip6,chip7) \ | ||
196 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7 }; \ | ||
197 | I2C_CLIENT_MODULE_PARM(force, \ | ||
198 | "List of adapter,address pairs to boldly assume " \ | ||
199 | "to be present"); \ | ||
200 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
201 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
202 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
203 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
204 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
205 | SENSORS_MODULE_PARM_FORCE(chip6); \ | ||
206 | SENSORS_MODULE_PARM_FORCE(chip7); \ | ||
207 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
208 | {force_ ## chip1,chip1}, \ | ||
209 | {force_ ## chip2,chip2}, \ | ||
210 | {force_ ## chip3,chip3}, \ | ||
211 | {force_ ## chip4,chip4}, \ | ||
212 | {force_ ## chip5,chip5}, \ | ||
213 | {force_ ## chip6,chip6}, \ | ||
214 | {force_ ## chip7,chip7}, \ | ||
215 | {NULL}}; \ | ||
216 | SENSORS_INSMOD | ||
217 | |||
218 | #define SENSORS_INSMOD_8(chip1,chip2,chip3,chip4,chip5,chip6,chip7,chip8) \ | ||
219 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8 }; \ | ||
220 | I2C_CLIENT_MODULE_PARM(force, \ | ||
221 | "List of adapter,address pairs to boldly assume " \ | ||
222 | "to be present"); \ | ||
223 | SENSORS_MODULE_PARM_FORCE(chip1); \ | ||
224 | SENSORS_MODULE_PARM_FORCE(chip2); \ | ||
225 | SENSORS_MODULE_PARM_FORCE(chip3); \ | ||
226 | SENSORS_MODULE_PARM_FORCE(chip4); \ | ||
227 | SENSORS_MODULE_PARM_FORCE(chip5); \ | ||
228 | SENSORS_MODULE_PARM_FORCE(chip6); \ | ||
229 | SENSORS_MODULE_PARM_FORCE(chip7); \ | ||
230 | SENSORS_MODULE_PARM_FORCE(chip8); \ | ||
231 | static struct i2c_force_data forces[] = {{force,any_chip}, \ | ||
232 | {force_ ## chip1,chip1}, \ | ||
233 | {force_ ## chip2,chip2}, \ | ||
234 | {force_ ## chip3,chip3}, \ | ||
235 | {force_ ## chip4,chip4}, \ | ||
236 | {force_ ## chip5,chip5}, \ | ||
237 | {force_ ## chip6,chip6}, \ | ||
238 | {force_ ## chip7,chip7}, \ | ||
239 | {force_ ## chip8,chip8}, \ | ||
240 | {NULL}}; \ | ||
241 | SENSORS_INSMOD | ||
242 | |||
243 | /* Detect function. It iterates over all possible addresses itself. For | ||
244 | SMBus addresses, it will only call found_proc if some client is connected | ||
245 | to the SMBus (unless a 'force' matched); for ISA detections, this is not | ||
246 | done. */ | ||
247 | extern int i2c_detect(struct i2c_adapter *adapter, | ||
248 | struct i2c_address_data *address_data, | ||
249 | int (*found_proc) (struct i2c_adapter *, int, int)); | ||
250 | |||
251 | |||
252 | /* This macro is used to scale user-input to sensible values in almost all | ||
253 | chip drivers. */ | ||
254 | static inline int SENSORS_LIMIT(long value, long low, long high) | ||
255 | { | ||
256 | if (value < low) | ||
257 | return low; | ||
258 | else if (value > high) | ||
259 | return high; | ||
260 | else | ||
261 | return value; | ||
262 | } | ||
263 | #endif /* def _LINUX_I2C_SENSOR_H */ | ||
diff --git a/include/linux/i2c-vid.h b/include/linux/i2c-vid.h deleted file mode 100644 index 41d0635e0ba9..000000000000 --- a/include/linux/i2c-vid.h +++ /dev/null | |||
@@ -1,111 +0,0 @@ | |||
1 | /* | ||
2 | i2c-vid.h - Part of lm_sensors, Linux kernel modules for hardware | ||
3 | monitoring | ||
4 | Copyright (c) 2002 Mark D. Studebaker <mdsxyz123@yahoo.com> | ||
5 | With assistance from Trent Piepho <xyzzy@speakeasy.org> | ||
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, or | ||
10 | (at your option) any later version. | ||
11 | |||
12 | This program is distributed in the hope that it will be useful, | ||
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | GNU General Public License for more details. | ||
16 | |||
17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program; if not, write to the Free Software | ||
19 | Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | This file contains common code for decoding VID pins. | ||
24 | This file is #included in various chip drivers in this directory. | ||
25 | As the user is unlikely to load more than one driver which | ||
26 | includes this code we don't worry about the wasted space. | ||
27 | Reference: VRM x.y DC-DC Converter Design Guidelines, | ||
28 | available at http://developer.intel.com | ||
29 | */ | ||
30 | |||
31 | /* | ||
32 | AMD Opteron processors don't follow the Intel VRM spec. | ||
33 | I'm going to "make up" 2.4 as the VRM spec for the Opterons. | ||
34 | No good reason just a mnemonic for the 24x Opteron processor | ||
35 | series | ||
36 | |||
37 | Opteron VID encoding is: | ||
38 | |||
39 | 00000 = 1.550 V | ||
40 | 00001 = 1.525 V | ||
41 | . . . . | ||
42 | 11110 = 0.800 V | ||
43 | 11111 = 0.000 V (off) | ||
44 | */ | ||
45 | |||
46 | /* | ||
47 | Legal val values 0x00 - 0x1f; except for VRD 10.0, 0x00 - 0x3f. | ||
48 | vrm is the Intel VRM document version. | ||
49 | Note: vrm version is scaled by 10 and the return value is scaled by 1000 | ||
50 | to avoid floating point in the kernel. | ||
51 | */ | ||
52 | |||
53 | int i2c_which_vrm(void); | ||
54 | |||
55 | #define DEFAULT_VRM 82 | ||
56 | |||
57 | static inline int vid_from_reg(int val, int vrm) | ||
58 | { | ||
59 | int vid; | ||
60 | |||
61 | switch(vrm) { | ||
62 | |||
63 | case 0: | ||
64 | return 0; | ||
65 | |||
66 | case 100: /* VRD 10.0 */ | ||
67 | if((val & 0x1f) == 0x1f) | ||
68 | return 0; | ||
69 | if((val & 0x1f) <= 0x09 || val == 0x0a) | ||
70 | vid = 10875 - (val & 0x1f) * 250; | ||
71 | else | ||
72 | vid = 18625 - (val & 0x1f) * 250; | ||
73 | if(val & 0x20) | ||
74 | vid -= 125; | ||
75 | vid /= 10; /* only return 3 dec. places for now */ | ||
76 | return vid; | ||
77 | |||
78 | case 24: /* Opteron processor */ | ||
79 | return(val == 0x1f ? 0 : 1550 - val * 25); | ||
80 | |||
81 | case 91: /* VRM 9.1 */ | ||
82 | case 90: /* VRM 9.0 */ | ||
83 | return(val == 0x1f ? 0 : | ||
84 | 1850 - val * 25); | ||
85 | |||
86 | case 85: /* VRM 8.5 */ | ||
87 | return((val & 0x10 ? 25 : 0) + | ||
88 | ((val & 0x0f) > 0x04 ? 2050 : 1250) - | ||
89 | ((val & 0x0f) * 50)); | ||
90 | |||
91 | case 84: /* VRM 8.4 */ | ||
92 | val &= 0x0f; | ||
93 | /* fall through */ | ||
94 | default: /* VRM 8.2 */ | ||
95 | return(val == 0x1f ? 0 : | ||
96 | val & 0x10 ? 5100 - (val) * 100 : | ||
97 | 2050 - (val) * 50); | ||
98 | } | ||
99 | } | ||
100 | |||
101 | static inline int vid_to_reg(int val, int vrm) | ||
102 | { | ||
103 | switch (vrm) { | ||
104 | case 91: /* VRM 9.1 */ | ||
105 | case 90: /* VRM 9.0 */ | ||
106 | return ((val >= 1100) && (val <= 1850) ? | ||
107 | ((18499 - val * 10) / 25 + 5) / 10 : -1); | ||
108 | default: | ||
109 | return -1; | ||
110 | } | ||
111 | } | ||
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index be837b13f297..be35332b67e6 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -34,6 +34,13 @@ | |||
34 | #include <linux/device.h> /* for struct device */ | 34 | #include <linux/device.h> /* for struct device */ |
35 | #include <asm/semaphore.h> | 35 | #include <asm/semaphore.h> |
36 | 36 | ||
37 | /* --- For i2c-isa ---------------------------------------------------- */ | ||
38 | |||
39 | extern void i2c_adapter_dev_release(struct device *dev); | ||
40 | extern struct device_driver i2c_adapter_driver; | ||
41 | extern struct class i2c_adapter_class; | ||
42 | extern struct bus_type i2c_bus_type; | ||
43 | |||
37 | /* --- General options ------------------------------------------------ */ | 44 | /* --- General options ------------------------------------------------ */ |
38 | 45 | ||
39 | struct i2c_msg; | 46 | struct i2c_msg; |
@@ -41,7 +48,6 @@ struct i2c_algorithm; | |||
41 | struct i2c_adapter; | 48 | struct i2c_adapter; |
42 | struct i2c_client; | 49 | struct i2c_client; |
43 | struct i2c_driver; | 50 | struct i2c_driver; |
44 | struct i2c_client_address_data; | ||
45 | union i2c_smbus_data; | 51 | union i2c_smbus_data; |
46 | 52 | ||
47 | /* | 53 | /* |
@@ -143,12 +149,9 @@ struct i2c_driver { | |||
143 | */ | 149 | */ |
144 | struct i2c_client { | 150 | struct i2c_client { |
145 | unsigned int flags; /* div., see below */ | 151 | unsigned int flags; /* div., see below */ |
146 | unsigned int addr; /* chip address - NOTE: 7bit */ | 152 | unsigned short addr; /* chip address - NOTE: 7bit */ |
147 | /* addresses are stored in the */ | 153 | /* addresses are stored in the */ |
148 | /* _LOWER_ 7 bits of this char */ | 154 | /* _LOWER_ 7 bits */ |
149 | /* addr: unsigned int to make lm_sensors i2c-isa adapter work | ||
150 | more cleanly. It does not take any more memory space, due to | ||
151 | alignment considerations */ | ||
152 | struct i2c_adapter *adapter; /* the adapter we sit on */ | 155 | struct i2c_adapter *adapter; /* the adapter we sit on */ |
153 | struct i2c_driver *driver; /* and our access routines */ | 156 | struct i2c_driver *driver; /* and our access routines */ |
154 | int usage_count; /* How many accesses currently */ | 157 | int usage_count; /* How many accesses currently */ |
@@ -160,6 +163,11 @@ struct i2c_client { | |||
160 | }; | 163 | }; |
161 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 164 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
162 | 165 | ||
166 | static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) | ||
167 | { | ||
168 | return to_i2c_client(container_of(kobj, struct device, kobj)); | ||
169 | } | ||
170 | |||
163 | static inline void *i2c_get_clientdata (struct i2c_client *dev) | 171 | static inline void *i2c_get_clientdata (struct i2c_client *dev) |
164 | { | 172 | { |
165 | return dev_get_drvdata (&dev->dev); | 173 | return dev_get_drvdata (&dev->dev); |
@@ -170,13 +178,6 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data) | |||
170 | dev_set_drvdata (&dev->dev, data); | 178 | dev_set_drvdata (&dev->dev, data); |
171 | } | 179 | } |
172 | 180 | ||
173 | #define I2C_DEVNAME(str) .name = str | ||
174 | |||
175 | static inline char *i2c_clientname(struct i2c_client *c) | ||
176 | { | ||
177 | return &c->name[0]; | ||
178 | } | ||
179 | |||
180 | /* | 181 | /* |
181 | * The following structs are for those who like to implement new bus drivers: | 182 | * The following structs are for those who like to implement new bus drivers: |
182 | * i2c_algorithm is the interface to a class of hardware solutions which can | 183 | * i2c_algorithm is the interface to a class of hardware solutions which can |
@@ -184,9 +185,6 @@ static inline char *i2c_clientname(struct i2c_client *c) | |||
184 | * to name two of the most common. | 185 | * to name two of the most common. |
185 | */ | 186 | */ |
186 | struct i2c_algorithm { | 187 | struct i2c_algorithm { |
187 | char name[32]; /* textual description */ | ||
188 | unsigned int id; | ||
189 | |||
190 | /* If an adapter algorithm can't do I2C-level access, set master_xfer | 188 | /* If an adapter algorithm can't do I2C-level access, set master_xfer |
191 | to NULL. If an adapter algorithm can do SMBus access, set | 189 | to NULL. If an adapter algorithm can do SMBus access, set |
192 | smbus_xfer. If set to NULL, the SMBus protocol is simulated | 190 | smbus_xfer. If set to NULL, the SMBus protocol is simulated |
@@ -214,8 +212,7 @@ struct i2c_algorithm { | |||
214 | */ | 212 | */ |
215 | struct i2c_adapter { | 213 | struct i2c_adapter { |
216 | struct module *owner; | 214 | struct module *owner; |
217 | unsigned int id;/* == is algo->id | hwdep.struct->id, */ | 215 | unsigned int id; |
218 | /* for registered values see below */ | ||
219 | unsigned int class; | 216 | unsigned int class; |
220 | struct i2c_algorithm *algo;/* the algorithm to access the bus */ | 217 | struct i2c_algorithm *algo;/* the algorithm to access the bus */ |
221 | void *algo_data; | 218 | void *algo_data; |
@@ -292,12 +289,11 @@ struct i2c_client_address_data { | |||
292 | unsigned short *normal_i2c; | 289 | unsigned short *normal_i2c; |
293 | unsigned short *probe; | 290 | unsigned short *probe; |
294 | unsigned short *ignore; | 291 | unsigned short *ignore; |
295 | unsigned short *force; | 292 | unsigned short **forces; |
296 | }; | 293 | }; |
297 | 294 | ||
298 | /* Internal numbers to terminate lists */ | 295 | /* Internal numbers to terminate lists */ |
299 | #define I2C_CLIENT_END 0xfffeU | 296 | #define I2C_CLIENT_END 0xfffeU |
300 | #define I2C_CLIENT_ISA_END 0xfffefffeU | ||
301 | 297 | ||
302 | /* The numbers to use to set I2C bus address */ | 298 | /* The numbers to use to set I2C bus address */ |
303 | #define ANY_I2C_BUS 0xffff | 299 | #define ANY_I2C_BUS 0xffff |
@@ -356,10 +352,6 @@ extern int i2c_probe(struct i2c_adapter *adapter, | |||
356 | */ | 352 | */ |
357 | extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); | 353 | extern int i2c_control(struct i2c_client *,unsigned int, unsigned long); |
358 | 354 | ||
359 | /* This call returns a unique low identifier for each registered adapter, | ||
360 | * or -1 if the adapter was not registered. | ||
361 | */ | ||
362 | extern int i2c_adapter_id(struct i2c_adapter *adap); | ||
363 | extern struct i2c_adapter* i2c_get_adapter(int id); | 355 | extern struct i2c_adapter* i2c_get_adapter(int id); |
364 | extern void i2c_put_adapter(struct i2c_adapter *adap); | 356 | extern void i2c_put_adapter(struct i2c_adapter *adap); |
365 | 357 | ||
@@ -376,6 +368,12 @@ static inline int i2c_check_functionality(struct i2c_adapter *adap, u32 func) | |||
376 | return (func & i2c_get_functionality(adap)) == func; | 368 | return (func & i2c_get_functionality(adap)) == func; |
377 | } | 369 | } |
378 | 370 | ||
371 | /* Return id number for a specific adapter */ | ||
372 | static inline int i2c_adapter_id(struct i2c_adapter *adap) | ||
373 | { | ||
374 | return adap->nr; | ||
375 | } | ||
376 | |||
379 | /* | 377 | /* |
380 | * I2C Message - used for pure i2c transaction, also from /dev interface | 378 | * I2C Message - used for pure i2c transaction, also from /dev interface |
381 | */ | 379 | */ |
@@ -510,9 +508,6 @@ union i2c_smbus_data { | |||
510 | #define I2C_FUNCS 0x0705 /* Get the adapter functionality */ | 508 | #define I2C_FUNCS 0x0705 /* Get the adapter functionality */ |
511 | #define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ | 509 | #define I2C_RDWR 0x0707 /* Combined R/W transfer (one stop only)*/ |
512 | #define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ | 510 | #define I2C_PEC 0x0708 /* != 0 for SMBus PEC */ |
513 | #if 0 | ||
514 | #define I2C_ACK_TEST 0x0710 /* See if a slave is at a specific address */ | ||
515 | #endif | ||
516 | 511 | ||
517 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ | 512 | #define I2C_SMBUS 0x0720 /* SMBus-level access */ |
518 | 513 | ||
@@ -556,27 +551,148 @@ union i2c_smbus_data { | |||
556 | module_param_array(var, short, &var##_num, 0); \ | 551 | module_param_array(var, short, &var##_num, 0); \ |
557 | MODULE_PARM_DESC(var,desc) | 552 | MODULE_PARM_DESC(var,desc) |
558 | 553 | ||
559 | /* This is the one you want to use in your own modules */ | 554 | #define I2C_CLIENT_MODULE_PARM_FORCE(name) \ |
555 | I2C_CLIENT_MODULE_PARM(force_##name, \ | ||
556 | "List of adapter,address pairs which are " \ | ||
557 | "unquestionably assumed to contain a `" \ | ||
558 | # name "' chip") | ||
559 | |||
560 | |||
561 | #define I2C_CLIENT_INSMOD_COMMON \ | ||
562 | I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \ | ||
563 | "additionally"); \ | ||
564 | I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ | ||
565 | "scan"); \ | ||
566 | static struct i2c_client_address_data addr_data = { \ | ||
567 | .normal_i2c = normal_i2c, \ | ||
568 | .probe = probe, \ | ||
569 | .ignore = ignore, \ | ||
570 | .forces = forces, \ | ||
571 | } | ||
572 | |||
573 | /* These are the ones you want to use in your own drivers. Pick the one | ||
574 | which matches the number of devices the driver differenciates between. */ | ||
560 | #define I2C_CLIENT_INSMOD \ | 575 | #define I2C_CLIENT_INSMOD \ |
561 | I2C_CLIENT_MODULE_PARM(probe, \ | ||
562 | "List of adapter,address pairs to scan additionally"); \ | ||
563 | I2C_CLIENT_MODULE_PARM(ignore, \ | ||
564 | "List of adapter,address pairs not to scan"); \ | ||
565 | I2C_CLIENT_MODULE_PARM(force, \ | 576 | I2C_CLIENT_MODULE_PARM(force, \ |
566 | "List of adapter,address pairs to boldly assume " \ | 577 | "List of adapter,address pairs to boldly assume " \ |
567 | "to be present"); \ | 578 | "to be present"); \ |
568 | static struct i2c_client_address_data addr_data = { \ | 579 | static unsigned short *forces[] = { \ |
569 | .normal_i2c = normal_i2c, \ | 580 | force, \ |
570 | .probe = probe, \ | 581 | NULL \ |
571 | .ignore = ignore, \ | 582 | }; \ |
572 | .force = force, \ | 583 | I2C_CLIENT_INSMOD_COMMON |
573 | } | 584 | |
574 | 585 | #define I2C_CLIENT_INSMOD_1(chip1) \ | |
575 | /* Detect whether we are on the isa bus. If this returns true, all i2c | 586 | enum chips { any_chip, chip1 }; \ |
576 | access will fail! */ | 587 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ |
577 | #define i2c_is_isa_client(clientptr) \ | 588 | "boldly assume to be present"); \ |
578 | ((clientptr)->adapter->algo->id == I2C_ALGO_ISA) | 589 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ |
579 | #define i2c_is_isa_adapter(adapptr) \ | 590 | static unsigned short *forces[] = { force, force_##chip1, NULL }; \ |
580 | ((adapptr)->algo->id == I2C_ALGO_ISA) | 591 | I2C_CLIENT_INSMOD_COMMON |
592 | |||
593 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | ||
594 | enum chips { any_chip, chip1, chip2 }; \ | ||
595 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
596 | "boldly assume to be present"); \ | ||
597 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
598 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
599 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
600 | force_##chip2, NULL }; \ | ||
601 | I2C_CLIENT_INSMOD_COMMON | ||
602 | |||
603 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | ||
604 | enum chips { any_chip, chip1, chip2, chip3 }; \ | ||
605 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
606 | "boldly assume to be present"); \ | ||
607 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
608 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
609 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
610 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
611 | force_##chip2, force_##chip3, \ | ||
612 | NULL }; \ | ||
613 | I2C_CLIENT_INSMOD_COMMON | ||
614 | |||
615 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | ||
616 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | ||
617 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
618 | "boldly assume to be present"); \ | ||
619 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
620 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
621 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
622 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
623 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
624 | force_##chip2, force_##chip3, \ | ||
625 | force_##chip4, NULL}; \ | ||
626 | I2C_CLIENT_INSMOD_COMMON | ||
627 | |||
628 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | ||
629 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | ||
630 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
631 | "boldly assume to be present"); \ | ||
632 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
633 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
634 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
635 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
636 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
637 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
638 | force_##chip2, force_##chip3, \ | ||
639 | force_##chip4, force_##chip5, \ | ||
640 | NULL }; \ | ||
641 | I2C_CLIENT_INSMOD_COMMON | ||
642 | |||
643 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | ||
644 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | ||
645 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
646 | "boldly assume to be present"); \ | ||
647 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
648 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
649 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
650 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
651 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
652 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
653 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
654 | force_##chip2, force_##chip3, \ | ||
655 | force_##chip4, force_##chip5, \ | ||
656 | force_##chip6, NULL }; \ | ||
657 | I2C_CLIENT_INSMOD_COMMON | ||
658 | |||
659 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | ||
660 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
661 | chip7 }; \ | ||
662 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
663 | "boldly assume to be present"); \ | ||
664 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
665 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
666 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
667 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
668 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
669 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
670 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
671 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
672 | force_##chip2, force_##chip3, \ | ||
673 | force_##chip4, force_##chip5, \ | ||
674 | force_##chip6, force_##chip7, \ | ||
675 | NULL }; \ | ||
676 | I2C_CLIENT_INSMOD_COMMON | ||
677 | |||
678 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | ||
679 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | ||
680 | chip7, chip8 }; \ | ||
681 | I2C_CLIENT_MODULE_PARM(force, "List of adapter,address pairs to " \ | ||
682 | "boldly assume to be present"); \ | ||
683 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
684 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
685 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
686 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
687 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
688 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
689 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
690 | I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ | ||
691 | static unsigned short *forces[] = { force, force_##chip1, \ | ||
692 | force_##chip2, force_##chip3, \ | ||
693 | force_##chip4, force_##chip5, \ | ||
694 | force_##chip6, force_##chip7, \ | ||
695 | force_##chip8, NULL }; \ | ||
696 | I2C_CLIENT_INSMOD_COMMON | ||
581 | 697 | ||
582 | #endif /* _LINUX_I2C_H */ | 698 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index b5b58e9c054c..fc2d4c8225aa 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -110,6 +110,8 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb) | |||
110 | { | 110 | { |
111 | return (struct ethhdr *)skb->mac.raw; | 111 | return (struct ethhdr *)skb->mac.raw; |
112 | } | 112 | } |
113 | |||
114 | extern struct ctl_table ether_table[]; | ||
113 | #endif | 115 | #endif |
114 | 116 | ||
115 | #endif /* _LINUX_IF_ETHER_H */ | 117 | #endif /* _LINUX_IF_ETHER_H */ |
diff --git a/include/linux/if_fc.h b/include/linux/if_fc.h index 33330b458b95..376a34ea4723 100644 --- a/include/linux/if_fc.h +++ b/include/linux/if_fc.h | |||
@@ -44,7 +44,7 @@ struct fcllc { | |||
44 | __u8 ssap; /* source SAP */ | 44 | __u8 ssap; /* source SAP */ |
45 | __u8 llc; /* LLC control field */ | 45 | __u8 llc; /* LLC control field */ |
46 | __u8 protid[3]; /* protocol id */ | 46 | __u8 protid[3]; /* protocol id */ |
47 | __u16 ethertype; /* ether type field */ | 47 | __be16 ethertype; /* ether type field */ |
48 | }; | 48 | }; |
49 | 49 | ||
50 | #endif /* _LINUX_IF_FC_H */ | 50 | #endif /* _LINUX_IF_FC_H */ |
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index a912818e6361..1288a161bc0b 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h | |||
@@ -85,7 +85,7 @@ struct fddi_snap_hdr | |||
85 | __u8 ssap; /* always 0xAA */ | 85 | __u8 ssap; /* always 0xAA */ |
86 | __u8 ctrl; /* always 0x03 */ | 86 | __u8 ctrl; /* always 0x03 */ |
87 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ | 87 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ |
88 | __u16 ethertype; /* packet type ID field */ | 88 | __be16 ethertype; /* packet type ID field */ |
89 | } __attribute__ ((packed)); | 89 | } __attribute__ ((packed)); |
90 | 90 | ||
91 | /* Define FDDI LLC frame header */ | 91 | /* Define FDDI LLC frame header */ |
diff --git a/include/linux/if_frad.h b/include/linux/if_frad.h index 3c94b1736570..511999c7eeda 100644 --- a/include/linux/if_frad.h +++ b/include/linux/if_frad.h | |||
@@ -191,10 +191,12 @@ struct frad_local | |||
191 | int buffer; /* current buffer for S508 firmware */ | 191 | int buffer; /* current buffer for S508 firmware */ |
192 | }; | 192 | }; |
193 | 193 | ||
194 | extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *)); | ||
195 | |||
196 | #endif /* __KERNEL__ */ | 194 | #endif /* __KERNEL__ */ |
197 | 195 | ||
198 | #endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */ | 196 | #endif /* CONFIG_DLCI || CONFIG_DLCI_MODULE */ |
199 | 197 | ||
198 | #ifdef __KERNEL__ | ||
199 | extern void dlci_ioctl_set(int (*hook)(unsigned int, void __user *)); | ||
200 | #endif | ||
201 | |||
200 | #endif | 202 | #endif |
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h index c8ca72c46f76..94d31ca7d71a 100644 --- a/include/linux/if_hippi.h +++ b/include/linux/if_hippi.h | |||
@@ -102,9 +102,9 @@ struct hippi_fp_hdr | |||
102 | #error "Please fix <asm/byteorder.h>" | 102 | #error "Please fix <asm/byteorder.h>" |
103 | #endif | 103 | #endif |
104 | #else | 104 | #else |
105 | __u32 fixed; | 105 | __be32 fixed; |
106 | #endif | 106 | #endif |
107 | __u32 d2_size; | 107 | __be32 d2_size; |
108 | } __attribute__ ((packed)); | 108 | } __attribute__ ((packed)); |
109 | 109 | ||
110 | struct hippi_le_hdr | 110 | struct hippi_le_hdr |
@@ -144,7 +144,7 @@ struct hippi_snap_hdr | |||
144 | __u8 ssap; /* always 0xAA */ | 144 | __u8 ssap; /* always 0xAA */ |
145 | __u8 ctrl; /* always 0x03 */ | 145 | __u8 ctrl; /* always 0x03 */ |
146 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ | 146 | __u8 oui[HIPPI_OUI_LEN]; /* organizational universal id (zero)*/ |
147 | __u16 ethertype; /* packet type ID field */ | 147 | __be16 ethertype; /* packet type ID field */ |
148 | } __attribute__ ((packed)); | 148 | } __attribute__ ((packed)); |
149 | 149 | ||
150 | struct hippi_hdr | 150 | struct hippi_hdr |
diff --git a/include/linux/if_tr.h b/include/linux/if_tr.h index 3fba9e2f5427..5502f597cf0e 100644 --- a/include/linux/if_tr.h +++ b/include/linux/if_tr.h | |||
@@ -43,12 +43,16 @@ struct trh_hdr { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | #ifdef __KERNEL__ | 45 | #ifdef __KERNEL__ |
46 | #include <linux/config.h> | ||
46 | #include <linux/skbuff.h> | 47 | #include <linux/skbuff.h> |
47 | 48 | ||
48 | static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) | 49 | static inline struct trh_hdr *tr_hdr(const struct sk_buff *skb) |
49 | { | 50 | { |
50 | return (struct trh_hdr *)skb->mac.raw; | 51 | return (struct trh_hdr *)skb->mac.raw; |
51 | } | 52 | } |
53 | #ifdef CONFIG_SYSCTL | ||
54 | extern struct ctl_table tr_table[]; | ||
55 | #endif | ||
52 | #endif | 56 | #endif |
53 | 57 | ||
54 | /* This is an Token-Ring LLC structure */ | 58 | /* This is an Token-Ring LLC structure */ |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 096a85a58ae5..88aef7b86ef4 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -77,6 +77,7 @@ struct tun_struct { | |||
77 | #define TUNSETIFF _IOW('T', 202, int) | 77 | #define TUNSETIFF _IOW('T', 202, int) |
78 | #define TUNSETPERSIST _IOW('T', 203, int) | 78 | #define TUNSETPERSIST _IOW('T', 203, int) |
79 | #define TUNSETOWNER _IOW('T', 204, int) | 79 | #define TUNSETOWNER _IOW('T', 204, int) |
80 | #define TUNSETLINK _IOW('T', 205, int) | ||
80 | 81 | ||
81 | /* TUNSETIFF ifr flags */ | 82 | /* TUNSETIFF ifr flags */ |
82 | #define IFF_TUN 0x0001 | 83 | #define IFF_TUN 0x0001 |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 62a9d89dfbe2..17d0c0d40b0e 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -155,7 +155,6 @@ static inline int __vlan_hwaccel_rx(struct sk_buff *skb, | |||
155 | { | 155 | { |
156 | struct net_device_stats *stats; | 156 | struct net_device_stats *stats; |
157 | 157 | ||
158 | skb->real_dev = skb->dev; | ||
159 | skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK]; | 158 | skb->dev = grp->vlan_devices[vlan_tag & VLAN_VID_MASK]; |
160 | if (skb->dev == NULL) { | 159 | if (skb->dev == NULL) { |
161 | dev_kfree_skb_any(skb); | 160 | dev_kfree_skb_any(skb); |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 0c31ef0b5bad..28f4f3b36950 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -129,6 +129,9 @@ struct igmpv3_query { | |||
129 | #include <linux/skbuff.h> | 129 | #include <linux/skbuff.h> |
130 | #include <linux/in.h> | 130 | #include <linux/in.h> |
131 | 131 | ||
132 | extern int sysctl_igmp_max_memberships; | ||
133 | extern int sysctl_igmp_max_msf; | ||
134 | |||
132 | struct ip_sf_socklist | 135 | struct ip_sf_socklist |
133 | { | 136 | { |
134 | unsigned int sl_max; | 137 | unsigned int sl_max; |
diff --git a/include/linux/in.h b/include/linux/in.h index fb88c66d748d..ba355384016a 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -32,6 +32,7 @@ enum { | |||
32 | IPPROTO_PUP = 12, /* PUP protocol */ | 32 | IPPROTO_PUP = 12, /* PUP protocol */ |
33 | IPPROTO_UDP = 17, /* User Datagram Protocol */ | 33 | IPPROTO_UDP = 17, /* User Datagram Protocol */ |
34 | IPPROTO_IDP = 22, /* XNS IDP protocol */ | 34 | IPPROTO_IDP = 22, /* XNS IDP protocol */ |
35 | IPPROTO_DCCP = 33, /* Datagram Congestion Control Protocol */ | ||
35 | IPPROTO_RSVP = 46, /* RSVP protocol */ | 36 | IPPROTO_RSVP = 46, /* RSVP protocol */ |
36 | IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */ | 37 | IPPROTO_GRE = 47, /* Cisco GRE tunnels (rfc 1701,1702) */ |
37 | 38 | ||
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h new file mode 100644 index 000000000000..a4606e5810e5 --- /dev/null +++ b/include/linux/inet_diag.h | |||
@@ -0,0 +1,138 @@ | |||
1 | #ifndef _INET_DIAG_H_ | ||
2 | #define _INET_DIAG_H_ 1 | ||
3 | |||
4 | /* Just some random number */ | ||
5 | #define TCPDIAG_GETSOCK 18 | ||
6 | #define DCCPDIAG_GETSOCK 19 | ||
7 | |||
8 | #define INET_DIAG_GETSOCK_MAX 24 | ||
9 | |||
10 | /* Socket identity */ | ||
11 | struct inet_diag_sockid { | ||
12 | __u16 idiag_sport; | ||
13 | __u16 idiag_dport; | ||
14 | __u32 idiag_src[4]; | ||
15 | __u32 idiag_dst[4]; | ||
16 | __u32 idiag_if; | ||
17 | __u32 idiag_cookie[2]; | ||
18 | #define INET_DIAG_NOCOOKIE (~0U) | ||
19 | }; | ||
20 | |||
21 | /* Request structure */ | ||
22 | |||
23 | struct inet_diag_req { | ||
24 | __u8 idiag_family; /* Family of addresses. */ | ||
25 | __u8 idiag_src_len; | ||
26 | __u8 idiag_dst_len; | ||
27 | __u8 idiag_ext; /* Query extended information */ | ||
28 | |||
29 | struct inet_diag_sockid id; | ||
30 | |||
31 | __u32 idiag_states; /* States to dump */ | ||
32 | __u32 idiag_dbs; /* Tables to dump (NI) */ | ||
33 | }; | ||
34 | |||
35 | enum { | ||
36 | INET_DIAG_REQ_NONE, | ||
37 | INET_DIAG_REQ_BYTECODE, | ||
38 | }; | ||
39 | |||
40 | #define INET_DIAG_REQ_MAX INET_DIAG_REQ_BYTECODE | ||
41 | |||
42 | /* Bytecode is sequence of 4 byte commands followed by variable arguments. | ||
43 | * All the commands identified by "code" are conditional jumps forward: | ||
44 | * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be | ||
45 | * length of the command and its arguments. | ||
46 | */ | ||
47 | |||
48 | struct inet_diag_bc_op { | ||
49 | unsigned char code; | ||
50 | unsigned char yes; | ||
51 | unsigned short no; | ||
52 | }; | ||
53 | |||
54 | enum { | ||
55 | INET_DIAG_BC_NOP, | ||
56 | INET_DIAG_BC_JMP, | ||
57 | INET_DIAG_BC_S_GE, | ||
58 | INET_DIAG_BC_S_LE, | ||
59 | INET_DIAG_BC_D_GE, | ||
60 | INET_DIAG_BC_D_LE, | ||
61 | INET_DIAG_BC_AUTO, | ||
62 | INET_DIAG_BC_S_COND, | ||
63 | INET_DIAG_BC_D_COND, | ||
64 | }; | ||
65 | |||
66 | struct inet_diag_hostcond { | ||
67 | __u8 family; | ||
68 | __u8 prefix_len; | ||
69 | int port; | ||
70 | __u32 addr[0]; | ||
71 | }; | ||
72 | |||
73 | /* Base info structure. It contains socket identity (addrs/ports/cookie) | ||
74 | * and, alas, the information shown by netstat. */ | ||
75 | struct inet_diag_msg { | ||
76 | __u8 idiag_family; | ||
77 | __u8 idiag_state; | ||
78 | __u8 idiag_timer; | ||
79 | __u8 idiag_retrans; | ||
80 | |||
81 | struct inet_diag_sockid id; | ||
82 | |||
83 | __u32 idiag_expires; | ||
84 | __u32 idiag_rqueue; | ||
85 | __u32 idiag_wqueue; | ||
86 | __u32 idiag_uid; | ||
87 | __u32 idiag_inode; | ||
88 | }; | ||
89 | |||
90 | /* Extensions */ | ||
91 | |||
92 | enum { | ||
93 | INET_DIAG_NONE, | ||
94 | INET_DIAG_MEMINFO, | ||
95 | INET_DIAG_INFO, | ||
96 | INET_DIAG_VEGASINFO, | ||
97 | INET_DIAG_CONG, | ||
98 | }; | ||
99 | |||
100 | #define INET_DIAG_MAX INET_DIAG_CONG | ||
101 | |||
102 | |||
103 | /* INET_DIAG_MEM */ | ||
104 | |||
105 | struct inet_diag_meminfo { | ||
106 | __u32 idiag_rmem; | ||
107 | __u32 idiag_wmem; | ||
108 | __u32 idiag_fmem; | ||
109 | __u32 idiag_tmem; | ||
110 | }; | ||
111 | |||
112 | /* INET_DIAG_VEGASINFO */ | ||
113 | |||
114 | struct tcpvegas_info { | ||
115 | __u32 tcpv_enabled; | ||
116 | __u32 tcpv_rttcnt; | ||
117 | __u32 tcpv_rtt; | ||
118 | __u32 tcpv_minrtt; | ||
119 | }; | ||
120 | |||
121 | #ifdef __KERNEL__ | ||
122 | struct sock; | ||
123 | struct inet_hashinfo; | ||
124 | |||
125 | struct inet_diag_handler { | ||
126 | struct inet_hashinfo *idiag_hashinfo; | ||
127 | void (*idiag_get_info)(struct sock *sk, | ||
128 | struct inet_diag_msg *r, | ||
129 | void *info); | ||
130 | __u16 idiag_info_size; | ||
131 | __u16 idiag_type; | ||
132 | }; | ||
133 | |||
134 | extern int inet_diag_register(const struct inet_diag_handler *handler); | ||
135 | extern void inet_diag_unregister(const struct inet_diag_handler *handler); | ||
136 | #endif /* __KERNEL__ */ | ||
137 | |||
138 | #endif /* _INET_DIAG_H_ */ | ||
diff --git a/include/linux/inotify.h b/include/linux/inotify.h index 93bb3afe646b..ee5b239092ed 100644 --- a/include/linux/inotify.h +++ b/include/linux/inotify.h | |||
@@ -47,6 +47,7 @@ struct inotify_event { | |||
47 | #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ | 47 | #define IN_MOVE (IN_MOVED_FROM | IN_MOVED_TO) /* moves */ |
48 | 48 | ||
49 | /* special flags */ | 49 | /* special flags */ |
50 | #define IN_MASK_ADD 0x20000000 /* add to the mask of an already existing watch */ | ||
50 | #define IN_ISDIR 0x40000000 /* event occurred against dir */ | 51 | #define IN_ISDIR 0x40000000 /* event occurred against dir */ |
51 | #define IN_ONESHOT 0x80000000 /* only send event once */ | 52 | #define IN_ONESHOT 0x80000000 /* only send event once */ |
52 | 53 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index bdc53c6cc962..4767e5429534 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -66,6 +66,7 @@ struct input_absinfo { | |||
66 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ | 66 | #define EVIOCGKEY(len) _IOC(_IOC_READ, 'E', 0x18, len) /* get global keystate */ |
67 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ | 67 | #define EVIOCGLED(len) _IOC(_IOC_READ, 'E', 0x19, len) /* get all LEDs */ |
68 | #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ | 68 | #define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ |
69 | #define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ | ||
69 | 70 | ||
70 | #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ | 71 | #define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ |
71 | #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ | 72 | #define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ |
@@ -86,6 +87,7 @@ struct input_absinfo { | |||
86 | #define EV_REL 0x02 | 87 | #define EV_REL 0x02 |
87 | #define EV_ABS 0x03 | 88 | #define EV_ABS 0x03 |
88 | #define EV_MSC 0x04 | 89 | #define EV_MSC 0x04 |
90 | #define EV_SW 0x05 | ||
89 | #define EV_LED 0x11 | 91 | #define EV_LED 0x11 |
90 | #define EV_SND 0x12 | 92 | #define EV_SND 0x12 |
91 | #define EV_REP 0x14 | 93 | #define EV_REP 0x14 |
@@ -551,6 +553,20 @@ struct input_absinfo { | |||
551 | #define ABS_MAX 0x3f | 553 | #define ABS_MAX 0x3f |
552 | 554 | ||
553 | /* | 555 | /* |
556 | * Switch events | ||
557 | */ | ||
558 | |||
559 | #define SW_0 0x00 | ||
560 | #define SW_1 0x01 | ||
561 | #define SW_2 0x02 | ||
562 | #define SW_3 0x03 | ||
563 | #define SW_4 0x04 | ||
564 | #define SW_5 0x05 | ||
565 | #define SW_6 0x06 | ||
566 | #define SW_7 0x07 | ||
567 | #define SW_MAX 0x0f | ||
568 | |||
569 | /* | ||
554 | * Misc events | 570 | * Misc events |
555 | */ | 571 | */ |
556 | 572 | ||
@@ -824,6 +840,7 @@ struct input_dev { | |||
824 | unsigned long ledbit[NBITS(LED_MAX)]; | 840 | unsigned long ledbit[NBITS(LED_MAX)]; |
825 | unsigned long sndbit[NBITS(SND_MAX)]; | 841 | unsigned long sndbit[NBITS(SND_MAX)]; |
826 | unsigned long ffbit[NBITS(FF_MAX)]; | 842 | unsigned long ffbit[NBITS(FF_MAX)]; |
843 | unsigned long swbit[NBITS(SW_MAX)]; | ||
827 | int ff_effects_max; | 844 | int ff_effects_max; |
828 | 845 | ||
829 | unsigned int keycodemax; | 846 | unsigned int keycodemax; |
@@ -844,6 +861,7 @@ struct input_dev { | |||
844 | unsigned long key[NBITS(KEY_MAX)]; | 861 | unsigned long key[NBITS(KEY_MAX)]; |
845 | unsigned long led[NBITS(LED_MAX)]; | 862 | unsigned long led[NBITS(LED_MAX)]; |
846 | unsigned long snd[NBITS(SND_MAX)]; | 863 | unsigned long snd[NBITS(SND_MAX)]; |
864 | unsigned long sw[NBITS(SW_MAX)]; | ||
847 | 865 | ||
848 | int absmax[ABS_MAX + 1]; | 866 | int absmax[ABS_MAX + 1]; |
849 | int absmin[ABS_MAX + 1]; | 867 | int absmin[ABS_MAX + 1]; |
@@ -886,6 +904,7 @@ struct input_dev { | |||
886 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 | 904 | #define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200 |
887 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 | 905 | #define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400 |
888 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 | 906 | #define INPUT_DEVICE_ID_MATCH_FFBIT 0x800 |
907 | #define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000 | ||
889 | 908 | ||
890 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ | 909 | #define INPUT_DEVICE_ID_MATCH_DEVICE\ |
891 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) | 910 | (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) |
@@ -906,6 +925,7 @@ struct input_device_id { | |||
906 | unsigned long ledbit[NBITS(LED_MAX)]; | 925 | unsigned long ledbit[NBITS(LED_MAX)]; |
907 | unsigned long sndbit[NBITS(SND_MAX)]; | 926 | unsigned long sndbit[NBITS(SND_MAX)]; |
908 | unsigned long ffbit[NBITS(FF_MAX)]; | 927 | unsigned long ffbit[NBITS(FF_MAX)]; |
928 | unsigned long swbit[NBITS(SW_MAX)]; | ||
909 | 929 | ||
910 | unsigned long driver_info; | 930 | unsigned long driver_info; |
911 | }; | 931 | }; |
@@ -998,6 +1018,11 @@ static inline void input_report_ff_status(struct input_dev *dev, unsigned int co | |||
998 | input_event(dev, EV_FF_STATUS, code, value); | 1018 | input_event(dev, EV_FF_STATUS, code, value); |
999 | } | 1019 | } |
1000 | 1020 | ||
1021 | static inline void input_report_switch(struct input_dev *dev, unsigned int code, int value) | ||
1022 | { | ||
1023 | input_event(dev, EV_SW, code, !!value); | ||
1024 | } | ||
1025 | |||
1001 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) | 1026 | static inline void input_regs(struct input_dev *dev, struct pt_regs *regs) |
1002 | { | 1027 | { |
1003 | dev->regs = regs; | 1028 | dev->regs = regs; |
diff --git a/include/linux/ioctl32.h b/include/linux/ioctl32.h index e8c4af32b3bb..948809d99917 100644 --- a/include/linux/ioctl32.h +++ b/include/linux/ioctl32.h | |||
@@ -14,26 +14,4 @@ struct ioctl_trans { | |||
14 | struct ioctl_trans *next; | 14 | struct ioctl_trans *next; |
15 | }; | 15 | }; |
16 | 16 | ||
17 | /* | ||
18 | * Register an 32bit ioctl translation handler for ioctl cmd. | ||
19 | * | ||
20 | * handler == NULL: use 64bit ioctl handler. | ||
21 | * arguments to handler: fd: file descriptor | ||
22 | * cmd: ioctl command. | ||
23 | * arg: ioctl argument | ||
24 | * struct file *file: file descriptor pointer. | ||
25 | */ | ||
26 | |||
27 | #ifdef CONFIG_COMPAT | ||
28 | extern int __deprecated register_ioctl32_conversion(unsigned int cmd, | ||
29 | ioctl_trans_handler_t handler); | ||
30 | extern int __deprecated unregister_ioctl32_conversion(unsigned int cmd); | ||
31 | |||
32 | #else | ||
33 | |||
34 | #define register_ioctl32_conversion(cmd, handler) ({ 0; }) | ||
35 | #define unregister_ioctl32_conversion(cmd) ({ 0; }) | ||
36 | |||
37 | #endif | ||
38 | |||
39 | #endif | 17 | #endif |
diff --git a/include/linux/ip.h b/include/linux/ip.h index 31e7cedd9f84..33e8a19a1a0f 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -196,6 +196,8 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
196 | #endif | 196 | #endif |
197 | #endif | 197 | #endif |
198 | 198 | ||
199 | extern int inet_sk_rebuild_header(struct sock *sk); | ||
200 | |||
199 | struct iphdr { | 201 | struct iphdr { |
200 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 202 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
201 | __u8 ihl:4, | 203 | __u8 ihl:4, |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 596ca6130159..938d55b813a5 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -35,6 +35,7 @@ | |||
35 | #define __LINUX_IPMI_H | 35 | #define __LINUX_IPMI_H |
36 | 36 | ||
37 | #include <linux/ipmi_msgdefs.h> | 37 | #include <linux/ipmi_msgdefs.h> |
38 | #include <linux/compiler.h> | ||
38 | 39 | ||
39 | /* | 40 | /* |
40 | * This file describes an interface to an IPMI driver. You have to | 41 | * This file describes an interface to an IPMI driver. You have to |
@@ -241,7 +242,8 @@ struct ipmi_recv_msg | |||
241 | /* The user_msg_data is the data supplied when a message was | 242 | /* The user_msg_data is the data supplied when a message was |
242 | sent, if this is a response to a sent message. If this is | 243 | sent, if this is a response to a sent message. If this is |
243 | not a response to a sent message, then user_msg_data will | 244 | not a response to a sent message, then user_msg_data will |
244 | be NULL. */ | 245 | be NULL. If the user above is NULL, then this will be the |
246 | intf. */ | ||
245 | void *user_msg_data; | 247 | void *user_msg_data; |
246 | 248 | ||
247 | /* Call this when done with the message. It will presumably free | 249 | /* Call this when done with the message. It will presumably free |
@@ -298,13 +300,19 @@ void ipmi_get_version(ipmi_user_t user, | |||
298 | this user, so it will affect all users of this interface. This is | 300 | this user, so it will affect all users of this interface. This is |
299 | so some initialization code can come in and do the OEM-specific | 301 | so some initialization code can come in and do the OEM-specific |
300 | things it takes to determine your address (if not the BMC) and set | 302 | things it takes to determine your address (if not the BMC) and set |
301 | it for everyone else. */ | 303 | it for everyone else. Note that each channel can have its own address. */ |
302 | void ipmi_set_my_address(ipmi_user_t user, | 304 | int ipmi_set_my_address(ipmi_user_t user, |
303 | unsigned char address); | 305 | unsigned int channel, |
304 | unsigned char ipmi_get_my_address(ipmi_user_t user); | 306 | unsigned char address); |
305 | void ipmi_set_my_LUN(ipmi_user_t user, | 307 | int ipmi_get_my_address(ipmi_user_t user, |
306 | unsigned char LUN); | 308 | unsigned int channel, |
307 | unsigned char ipmi_get_my_LUN(ipmi_user_t user); | 309 | unsigned char *address); |
310 | int ipmi_set_my_LUN(ipmi_user_t user, | ||
311 | unsigned int channel, | ||
312 | unsigned char LUN); | ||
313 | int ipmi_get_my_LUN(ipmi_user_t user, | ||
314 | unsigned int channel, | ||
315 | unsigned char *LUN); | ||
308 | 316 | ||
309 | /* | 317 | /* |
310 | * Like ipmi_request, but lets you specify the number of retries and | 318 | * Like ipmi_request, but lets you specify the number of retries and |
@@ -585,6 +593,16 @@ struct ipmi_cmdspec | |||
585 | * things it takes to determine your address (if not the BMC) and set | 593 | * things it takes to determine your address (if not the BMC) and set |
586 | * it for everyone else. You should probably leave the LUN alone. | 594 | * it for everyone else. You should probably leave the LUN alone. |
587 | */ | 595 | */ |
596 | struct ipmi_channel_lun_address_set | ||
597 | { | ||
598 | unsigned short channel; | ||
599 | unsigned char value; | ||
600 | }; | ||
601 | #define IPMICTL_SET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 24, struct ipmi_channel_lun_address_set) | ||
602 | #define IPMICTL_GET_MY_CHANNEL_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 25, struct ipmi_channel_lun_address_set) | ||
603 | #define IPMICTL_SET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 26, struct ipmi_channel_lun_address_set) | ||
604 | #define IPMICTL_GET_MY_CHANNEL_LUN_CMD _IOR(IPMI_IOC_MAGIC, 27, struct ipmi_channel_lun_address_set) | ||
605 | /* Legacy interfaces, these only set IPMB 0. */ | ||
588 | #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) | 606 | #define IPMICTL_SET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 17, unsigned int) |
589 | #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) | 607 | #define IPMICTL_GET_MY_ADDRESS_CMD _IOR(IPMI_IOC_MAGIC, 18, unsigned int) |
590 | #define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int) | 608 | #define IPMICTL_SET_MY_LUN_CMD _IOR(IPMI_IOC_MAGIC, 19, unsigned int) |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 6fcd6a0ade24..3c7dbc6a0a70 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -193,6 +193,11 @@ struct inet6_skb_parm { | |||
193 | 193 | ||
194 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) | 194 | #define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) |
195 | 195 | ||
196 | static inline int inet6_iif(const struct sk_buff *skb) | ||
197 | { | ||
198 | return IP6CB(skb)->iif; | ||
199 | } | ||
200 | |||
196 | struct tcp6_request_sock { | 201 | struct tcp6_request_sock { |
197 | struct tcp_request_sock req; | 202 | struct tcp_request_sock req; |
198 | struct in6_addr loc_addr; | 203 | struct in6_addr loc_addr; |
@@ -308,6 +313,36 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to, | |||
308 | 313 | ||
309 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) | 314 | #define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) |
310 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) | 315 | #define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) |
316 | |||
317 | #include <linux/tcp.h> | ||
318 | |||
319 | struct tcp6_timewait_sock { | ||
320 | struct tcp_timewait_sock tw_v6_sk; | ||
321 | struct in6_addr tw_v6_daddr; | ||
322 | struct in6_addr tw_v6_rcv_saddr; | ||
323 | }; | ||
324 | |||
325 | static inline struct tcp6_timewait_sock *tcp6_twsk(const struct sock *sk) | ||
326 | { | ||
327 | return (struct tcp6_timewait_sock *)sk; | ||
328 | } | ||
329 | |||
330 | static inline struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) | ||
331 | { | ||
332 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | ||
333 | &inet6_sk(sk)->rcv_saddr : &tcp6_twsk(sk)->tw_v6_rcv_saddr; | ||
334 | } | ||
335 | |||
336 | static inline struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) | ||
337 | { | ||
338 | return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL; | ||
339 | } | ||
340 | |||
341 | static inline int inet_v6_ipv6only(const struct sock *sk) | ||
342 | { | ||
343 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | ||
344 | ipv6_only_sock(sk) : inet_twsk(sk)->tw_ipv6only; | ||
345 | } | ||
311 | #else | 346 | #else |
312 | #define __ipv6_only_sock(sk) 0 | 347 | #define __ipv6_only_sock(sk) 0 |
313 | #define ipv6_only_sock(sk) 0 | 348 | #define ipv6_only_sock(sk) 0 |
@@ -322,8 +357,19 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
322 | return NULL; | 357 | return NULL; |
323 | } | 358 | } |
324 | 359 | ||
325 | #endif | 360 | #define __tcp_v6_rcv_saddr(__sk) NULL |
361 | #define tcp_v6_rcv_saddr(__sk) NULL | ||
362 | #define tcp_twsk_ipv6only(__sk) 0 | ||
363 | #define inet_v6_ipv6only(__sk) 0 | ||
364 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | ||
326 | 365 | ||
327 | #endif | 366 | #define INET6_MATCH(__sk, __saddr, __daddr, __ports, __dif) \ |
367 | (((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | ||
368 | ((__sk)->sk_family == AF_INET6) && \ | ||
369 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | ||
370 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | ||
371 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | ||
328 | 372 | ||
329 | #endif | 373 | #endif /* __KERNEL__ */ |
374 | |||
375 | #endif /* _IPV6_H */ | ||
diff --git a/include/linux/irq.h b/include/linux/irq.h index 069d3b84d311..69681c3b1f05 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -32,7 +32,12 @@ | |||
32 | #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ | 32 | #define IRQ_WAITING 32 /* IRQ not yet seen - for autodetection */ |
33 | #define IRQ_LEVEL 64 /* IRQ level triggered */ | 33 | #define IRQ_LEVEL 64 /* IRQ level triggered */ |
34 | #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ | 34 | #define IRQ_MASKED 128 /* IRQ masked - shouldn't be seen again */ |
35 | #define IRQ_PER_CPU 256 /* IRQ is per CPU */ | 35 | #if defined(ARCH_HAS_IRQ_PER_CPU) |
36 | # define IRQ_PER_CPU 256 /* IRQ is per CPU */ | ||
37 | # define CHECK_IRQ_PER_CPU(var) ((var) & IRQ_PER_CPU) | ||
38 | #else | ||
39 | # define CHECK_IRQ_PER_CPU(var) 0 | ||
40 | #endif | ||
36 | 41 | ||
37 | /* | 42 | /* |
38 | * Interrupt controller descriptor. This is all we need | 43 | * Interrupt controller descriptor. This is all we need |
@@ -71,16 +76,139 @@ typedef struct irq_desc { | |||
71 | unsigned int irq_count; /* For detecting broken interrupts */ | 76 | unsigned int irq_count; /* For detecting broken interrupts */ |
72 | unsigned int irqs_unhandled; | 77 | unsigned int irqs_unhandled; |
73 | spinlock_t lock; | 78 | spinlock_t lock; |
79 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | ||
80 | unsigned int move_irq; /* Flag need to re-target intr dest*/ | ||
81 | #endif | ||
74 | } ____cacheline_aligned irq_desc_t; | 82 | } ____cacheline_aligned irq_desc_t; |
75 | 83 | ||
76 | extern irq_desc_t irq_desc [NR_IRQS]; | 84 | extern irq_desc_t irq_desc [NR_IRQS]; |
77 | 85 | ||
86 | /* Return a pointer to the irq descriptor for IRQ. */ | ||
87 | static inline irq_desc_t * | ||
88 | irq_descp (int irq) | ||
89 | { | ||
90 | return irq_desc + irq; | ||
91 | } | ||
92 | |||
78 | #include <asm/hw_irq.h> /* the arch dependent stuff */ | 93 | #include <asm/hw_irq.h> /* the arch dependent stuff */ |
79 | 94 | ||
80 | extern int setup_irq(unsigned int irq, struct irqaction * new); | 95 | extern int setup_irq(unsigned int irq, struct irqaction * new); |
81 | 96 | ||
82 | #ifdef CONFIG_GENERIC_HARDIRQS | 97 | #ifdef CONFIG_GENERIC_HARDIRQS |
83 | extern cpumask_t irq_affinity[NR_IRQS]; | 98 | extern cpumask_t irq_affinity[NR_IRQS]; |
99 | |||
100 | #ifdef CONFIG_SMP | ||
101 | static inline void set_native_irq_info(int irq, cpumask_t mask) | ||
102 | { | ||
103 | irq_affinity[irq] = mask; | ||
104 | } | ||
105 | #else | ||
106 | static inline void set_native_irq_info(int irq, cpumask_t mask) | ||
107 | { | ||
108 | } | ||
109 | #endif | ||
110 | |||
111 | #ifdef CONFIG_SMP | ||
112 | |||
113 | #if defined (CONFIG_GENERIC_PENDING_IRQ) || defined (CONFIG_IRQBALANCE) | ||
114 | extern cpumask_t pending_irq_cpumask[NR_IRQS]; | ||
115 | |||
116 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | ||
117 | { | ||
118 | irq_desc_t *desc = irq_desc + irq; | ||
119 | unsigned long flags; | ||
120 | |||
121 | spin_lock_irqsave(&desc->lock, flags); | ||
122 | desc->move_irq = 1; | ||
123 | pending_irq_cpumask[irq] = mask; | ||
124 | spin_unlock_irqrestore(&desc->lock, flags); | ||
125 | } | ||
126 | |||
127 | static inline void | ||
128 | move_native_irq(int irq) | ||
129 | { | ||
130 | cpumask_t tmp; | ||
131 | irq_desc_t *desc = irq_descp(irq); | ||
132 | |||
133 | if (likely (!desc->move_irq)) | ||
134 | return; | ||
135 | |||
136 | desc->move_irq = 0; | ||
137 | |||
138 | if (likely(cpus_empty(pending_irq_cpumask[irq]))) | ||
139 | return; | ||
140 | |||
141 | if (!desc->handler->set_affinity) | ||
142 | return; | ||
143 | |||
144 | /* note - we hold the desc->lock */ | ||
145 | cpus_and(tmp, pending_irq_cpumask[irq], cpu_online_map); | ||
146 | |||
147 | /* | ||
148 | * If there was a valid mask to work with, please | ||
149 | * do the disable, re-program, enable sequence. | ||
150 | * This is *not* particularly important for level triggered | ||
151 | * but in a edge trigger case, we might be setting rte | ||
152 | * when an active trigger is comming in. This could | ||
153 | * cause some ioapics to mal-function. | ||
154 | * Being paranoid i guess! | ||
155 | */ | ||
156 | if (unlikely(!cpus_empty(tmp))) { | ||
157 | desc->handler->disable(irq); | ||
158 | desc->handler->set_affinity(irq,tmp); | ||
159 | desc->handler->enable(irq); | ||
160 | } | ||
161 | cpus_clear(pending_irq_cpumask[irq]); | ||
162 | } | ||
163 | |||
164 | #ifdef CONFIG_PCI_MSI | ||
165 | /* | ||
166 | * Wonder why these are dummies? | ||
167 | * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq() | ||
168 | * counter part after translating the vector to irq info. We need to perform | ||
169 | * this operation on the real irq, when we dont use vector, i.e when | ||
170 | * pci_use_vector() is false. | ||
171 | */ | ||
172 | static inline void move_irq(int irq) | ||
173 | { | ||
174 | } | ||
175 | |||
176 | static inline void set_irq_info(int irq, cpumask_t mask) | ||
177 | { | ||
178 | } | ||
179 | |||
180 | #else // CONFIG_PCI_MSI | ||
181 | |||
182 | static inline void move_irq(int irq) | ||
183 | { | ||
184 | move_native_irq(irq); | ||
185 | } | ||
186 | |||
187 | static inline void set_irq_info(int irq, cpumask_t mask) | ||
188 | { | ||
189 | set_native_irq_info(irq, mask); | ||
190 | } | ||
191 | #endif // CONFIG_PCI_MSI | ||
192 | |||
193 | #else // CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE | ||
194 | |||
195 | #define move_irq(x) | ||
196 | #define move_native_irq(x) | ||
197 | #define set_pending_irq(x,y) | ||
198 | static inline void set_irq_info(int irq, cpumask_t mask) | ||
199 | { | ||
200 | set_native_irq_info(irq, mask); | ||
201 | } | ||
202 | |||
203 | #endif // CONFIG_GENERIC_PENDING_IRQ | ||
204 | |||
205 | #else // CONFIG_SMP | ||
206 | |||
207 | #define move_irq(x) | ||
208 | #define move_native_irq(x) | ||
209 | |||
210 | #endif // CONFIG_SMP | ||
211 | |||
84 | extern int no_irq_affinity; | 212 | extern int no_irq_affinity; |
85 | extern int noirqdebug_setup(char *str); | 213 | extern int noirqdebug_setup(char *str); |
86 | 214 | ||
diff --git a/include/linux/isdn.h b/include/linux/isdn.h index 862083eb58ab..53eaee96065b 100644 --- a/include/linux/isdn.h +++ b/include/linux/isdn.h | |||
@@ -150,7 +150,6 @@ typedef struct { | |||
150 | #include <linux/errno.h> | 150 | #include <linux/errno.h> |
151 | #include <linux/fs.h> | 151 | #include <linux/fs.h> |
152 | #include <linux/major.h> | 152 | #include <linux/major.h> |
153 | #include <asm/segment.h> | ||
154 | #include <asm/io.h> | 153 | #include <asm/io.h> |
155 | #include <linux/kernel.h> | 154 | #include <linux/kernel.h> |
156 | #include <linux/signal.h> | 155 | #include <linux/signal.h> |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 593407e865b1..84321a4cac93 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -914,7 +914,6 @@ extern int journal_wipe (journal_t *, int); | |||
914 | extern int journal_skip_recovery (journal_t *); | 914 | extern int journal_skip_recovery (journal_t *); |
915 | extern void journal_update_superblock (journal_t *, int); | 915 | extern void journal_update_superblock (journal_t *, int); |
916 | extern void __journal_abort_hard (journal_t *); | 916 | extern void __journal_abort_hard (journal_t *); |
917 | extern void __journal_abort_soft (journal_t *, int); | ||
918 | extern void journal_abort (journal_t *, int); | 917 | extern void journal_abort (journal_t *, int); |
919 | extern int journal_errno (journal_t *); | 918 | extern int journal_errno (journal_t *); |
920 | extern void journal_ack_err (journal_t *); | 919 | extern void journal_ack_err (journal_t *); |
diff --git a/include/linux/klist.h b/include/linux/klist.h index eebf5e5696ec..c4d1fae4dd89 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -9,6 +9,9 @@ | |||
9 | * This file is rleased under the GPL v2. | 9 | * This file is rleased under the GPL v2. |
10 | */ | 10 | */ |
11 | 11 | ||
12 | #ifndef _LINUX_KLIST_H | ||
13 | #define _LINUX_KLIST_H | ||
14 | |||
12 | #include <linux/spinlock.h> | 15 | #include <linux/spinlock.h> |
13 | #include <linux/completion.h> | 16 | #include <linux/completion.h> |
14 | #include <linux/kref.h> | 17 | #include <linux/kref.h> |
@@ -31,8 +34,8 @@ struct klist_node { | |||
31 | struct completion n_removed; | 34 | struct completion n_removed; |
32 | }; | 35 | }; |
33 | 36 | ||
34 | extern void klist_add_tail(struct klist * k, struct klist_node * n); | 37 | extern void klist_add_tail(struct klist_node * n, struct klist * k); |
35 | extern void klist_add_head(struct klist * k, struct klist_node * n); | 38 | extern void klist_add_head(struct klist_node * n, struct klist * k); |
36 | 39 | ||
37 | extern void klist_del(struct klist_node * n); | 40 | extern void klist_del(struct klist_node * n); |
38 | extern void klist_remove(struct klist_node * n); | 41 | extern void klist_remove(struct klist_node * n); |
@@ -53,3 +56,4 @@ extern void klist_iter_init_node(struct klist * k, struct klist_iter * i, | |||
53 | extern void klist_iter_exit(struct klist_iter * i); | 56 | extern void klist_iter_exit(struct klist_iter * i); |
54 | extern struct klist_node * klist_next(struct klist_iter * i); | 57 | extern struct klist_node * klist_next(struct klist_iter * i); |
55 | 58 | ||
59 | #endif | ||
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index e050fc2d4c26..e30afdca7917 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -42,6 +42,9 @@ | |||
42 | #define KPROBE_REENTER 0x00000004 | 42 | #define KPROBE_REENTER 0x00000004 |
43 | #define KPROBE_HIT_SSDONE 0x00000008 | 43 | #define KPROBE_HIT_SSDONE 0x00000008 |
44 | 44 | ||
45 | /* Attach to insert probes on any functions which should be ignored*/ | ||
46 | #define __kprobes __attribute__((__section__(".kprobes.text"))) | ||
47 | |||
45 | struct kprobe; | 48 | struct kprobe; |
46 | struct pt_regs; | 49 | struct pt_regs; |
47 | struct kretprobe; | 50 | struct kretprobe; |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6cd9ba63563b..022105c745fc 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -1,23 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | Copyright 2003-2004 Red Hat, Inc. All rights reserved. | 2 | * Copyright 2003-2005 Red Hat, Inc. All rights reserved. |
3 | Copyright 2003-2004 Jeff Garzik | 3 | * Copyright 2003-2005 Jeff Garzik |
4 | 4 | * | |
5 | The contents of this file are subject to the Open | 5 | * |
6 | Software License version 1.1 that can be found at | 6 | * This program is free software; you can redistribute it and/or modify |
7 | http://www.opensource.org/licenses/osl-1.1.txt and is included herein | 7 | * it under the terms of the GNU General Public License as published by |
8 | by reference. | 8 | * the Free Software Foundation; either version 2, or (at your option) |
9 | 9 | * any later version. | |
10 | Alternatively, the contents of this file may be used under the terms | 10 | * |
11 | of the GNU General Public License version 2 (the "GPL") as distributed | 11 | * This program is distributed in the hope that it will be useful, |
12 | in the kernel source COPYING file, in which case the provisions of | 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | the GPL are applicable instead of the above. If you wish to allow | 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | the use of your version of this file only under the terms of the | 14 | * GNU General Public License for more details. |
15 | GPL and not to allow others to use your version of this file under | 15 | * |
16 | the OSL, indicate your decision by deleting the provisions above and | 16 | * You should have received a copy of the GNU General Public License |
17 | replace them with the notice and other provisions required by the GPL. | 17 | * along with this program; see the file COPYING. If not, write to |
18 | If you do not delete the provisions above, a recipient may use your | 18 | * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
19 | version of this file under either the OSL or the GPL. | 19 | * |
20 | 20 | * | |
21 | * libata documentation is available via 'make {ps|pdf}docs', | ||
22 | * as Documentation/DocBook/libata.* | ||
23 | * | ||
21 | */ | 24 | */ |
22 | 25 | ||
23 | #ifndef __LINUX_LIBATA_H__ | 26 | #ifndef __LINUX_LIBATA_H__ |
@@ -37,7 +40,6 @@ | |||
37 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ | 40 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ |
38 | #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ | 41 | #undef ATA_IRQ_TRAP /* define to ack screaming irqs */ |
39 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ | 42 | #undef ATA_NDEBUG /* define to disable quick runtime checks */ |
40 | #undef ATA_ENABLE_ATAPI /* define to enable ATAPI support */ | ||
41 | #undef ATA_ENABLE_PATA /* define to enable PATA support in some | 43 | #undef ATA_ENABLE_PATA /* define to enable PATA support in some |
42 | * low-level drivers */ | 44 | * low-level drivers */ |
43 | #undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ | 45 | #undef ATAPI_ENABLE_DMADIR /* enables ATAPI DMADIR bridge support */ |
@@ -113,6 +115,8 @@ enum { | |||
113 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ | 115 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ |
114 | ATA_FLAG_SATA_RESET = (1 << 7), /* use COMRESET */ | 116 | ATA_FLAG_SATA_RESET = (1 << 7), /* use COMRESET */ |
115 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ | 117 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ |
118 | ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once | ||
119 | * proper HSM is in place. */ | ||
116 | 120 | ||
117 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 121 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ |
118 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ | 122 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ |
@@ -363,7 +367,7 @@ struct ata_port_operations { | |||
363 | 367 | ||
364 | void (*host_stop) (struct ata_host_set *host_set); | 368 | void (*host_stop) (struct ata_host_set *host_set); |
365 | 369 | ||
366 | void (*bmdma_stop) (struct ata_port *ap); | 370 | void (*bmdma_stop) (struct ata_queued_cmd *qc); |
367 | u8 (*bmdma_status) (struct ata_port *ap); | 371 | u8 (*bmdma_status) (struct ata_port *ap); |
368 | }; | 372 | }; |
369 | 373 | ||
@@ -424,7 +428,7 @@ extern void ata_dev_id_string(u16 *id, unsigned char *s, | |||
424 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | 428 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); |
425 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 429 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
426 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 430 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
427 | extern void ata_bmdma_stop(struct ata_port *ap); | 431 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
428 | extern u8 ata_bmdma_status(struct ata_port *ap); | 432 | extern u8 ata_bmdma_status(struct ata_port *ap); |
429 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 433 | extern void ata_bmdma_irq_clear(struct ata_port *ap); |
430 | extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat); | 434 | extern void ata_qc_complete(struct ata_queued_cmd *qc, u8 drv_stat); |
@@ -445,6 +449,7 @@ struct pci_bits { | |||
445 | unsigned long val; | 449 | unsigned long val; |
446 | }; | 450 | }; |
447 | 451 | ||
452 | extern void ata_pci_host_stop (struct ata_host_set *host_set); | ||
448 | extern struct ata_probe_ent * | 453 | extern struct ata_probe_ent * |
449 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); | 454 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); |
450 | extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); | 455 | extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); |
@@ -644,7 +649,7 @@ static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val) | |||
644 | ap->ops->scr_write(ap, reg, val); | 649 | ap->ops->scr_write(ap, reg, val); |
645 | } | 650 | } |
646 | 651 | ||
647 | static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, | 652 | static inline void scr_write_flush(struct ata_port *ap, unsigned int reg, |
648 | u32 val) | 653 | u32 val) |
649 | { | 654 | { |
650 | ap->ops->scr_write(ap, reg, val); | 655 | ap->ops->scr_write(ap, reg, val); |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 338f7795d8a0..147eb01e0d4b 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -33,6 +33,13 @@ | |||
33 | ALIGN; \ | 33 | ALIGN; \ |
34 | name: | 34 | name: |
35 | 35 | ||
36 | #define KPROBE_ENTRY(name) \ | ||
37 | .section .kprobes.text, "ax"; \ | ||
38 | .globl name; \ | ||
39 | ALIGN; \ | ||
40 | name: | ||
41 | |||
42 | |||
36 | #endif | 43 | #endif |
37 | 44 | ||
38 | #define NORET_TYPE /**/ | 45 | #define NORET_TYPE /**/ |
diff --git a/include/linux/list.h b/include/linux/list.h index aab2db21b013..e6ec59682274 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -419,6 +419,20 @@ static inline void list_splice_init(struct list_head *list, | |||
419 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 419 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
420 | 420 | ||
421 | /** | 421 | /** |
422 | * list_for_each_entry_safe_continue - iterate over list of given type | ||
423 | * continuing after existing point safe against removal of list entry | ||
424 | * @pos: the type * to use as a loop counter. | ||
425 | * @n: another type * to use as temporary storage | ||
426 | * @head: the head for your list. | ||
427 | * @member: the name of the list_struct within the struct. | ||
428 | */ | ||
429 | #define list_for_each_entry_safe_continue(pos, n, head, member) \ | ||
430 | for (pos = list_entry(pos->member.next, typeof(*pos), member), \ | ||
431 | n = list_entry(pos->member.next, typeof(*pos), member); \ | ||
432 | &pos->member != (head); \ | ||
433 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | ||
434 | |||
435 | /** | ||
422 | * list_for_each_rcu - iterate over an rcu-protected list | 436 | * list_for_each_rcu - iterate over an rcu-protected list |
423 | * @pos: the &struct list_head to use as a loop counter. | 437 | * @pos: the &struct list_head to use as a loop counter. |
424 | * @head: the head for your list. | 438 | * @head: the head for your list. |
@@ -620,6 +634,57 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
620 | next->next->pprev = &next->next; | 634 | next->next->pprev = &next->next; |
621 | } | 635 | } |
622 | 636 | ||
637 | /** | ||
638 | * hlist_add_before_rcu - adds the specified element to the specified hlist | ||
639 | * before the specified node while permitting racing traversals. | ||
640 | * @n: the new element to add to the hash list. | ||
641 | * @next: the existing element to add the new element before. | ||
642 | * | ||
643 | * The caller must take whatever precautions are necessary | ||
644 | * (such as holding appropriate locks) to avoid racing | ||
645 | * with another list-mutation primitive, such as hlist_add_head_rcu() | ||
646 | * or hlist_del_rcu(), running on this same list. | ||
647 | * However, it is perfectly legal to run concurrently with | ||
648 | * the _rcu list-traversal primitives, such as | ||
649 | * hlist_for_each_rcu(), used to prevent memory-consistency | ||
650 | * problems on Alpha CPUs. | ||
651 | */ | ||
652 | static inline void hlist_add_before_rcu(struct hlist_node *n, | ||
653 | struct hlist_node *next) | ||
654 | { | ||
655 | n->pprev = next->pprev; | ||
656 | n->next = next; | ||
657 | smp_wmb(); | ||
658 | next->pprev = &n->next; | ||
659 | *(n->pprev) = n; | ||
660 | } | ||
661 | |||
662 | /** | ||
663 | * hlist_add_after_rcu - adds the specified element to the specified hlist | ||
664 | * after the specified node while permitting racing traversals. | ||
665 | * @prev: the existing element to add the new element after. | ||
666 | * @n: the new element to add to the hash list. | ||
667 | * | ||
668 | * The caller must take whatever precautions are necessary | ||
669 | * (such as holding appropriate locks) to avoid racing | ||
670 | * with another list-mutation primitive, such as hlist_add_head_rcu() | ||
671 | * or hlist_del_rcu(), running on this same list. | ||
672 | * However, it is perfectly legal to run concurrently with | ||
673 | * the _rcu list-traversal primitives, such as | ||
674 | * hlist_for_each_rcu(), used to prevent memory-consistency | ||
675 | * problems on Alpha CPUs. | ||
676 | */ | ||
677 | static inline void hlist_add_after_rcu(struct hlist_node *prev, | ||
678 | struct hlist_node *n) | ||
679 | { | ||
680 | n->next = prev->next; | ||
681 | n->pprev = &prev->next; | ||
682 | smp_wmb(); | ||
683 | prev->next = n; | ||
684 | if (n->next) | ||
685 | n->next->pprev = &n->next; | ||
686 | } | ||
687 | |||
623 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) | 688 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) |
624 | 689 | ||
625 | #define hlist_for_each(pos, head) \ | 690 | #define hlist_for_each(pos, head) \ |
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h index 8480aef10e62..94a46f38c532 100644 --- a/include/linux/mempolicy.h +++ b/include/linux/mempolicy.h | |||
@@ -150,6 +150,9 @@ void mpol_free_shared_policy(struct shared_policy *p); | |||
150 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, | 150 | struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp, |
151 | unsigned long idx); | 151 | unsigned long idx); |
152 | 152 | ||
153 | struct mempolicy *get_vma_policy(struct task_struct *task, | ||
154 | struct vm_area_struct *vma, unsigned long addr); | ||
155 | |||
153 | extern void numa_default_policy(void); | 156 | extern void numa_default_policy(void); |
154 | extern void numa_policy_init(void); | 157 | extern void numa_policy_init(void); |
155 | 158 | ||
diff --git a/include/linux/mii.h b/include/linux/mii.h index 374b615ea9ea..9b8d0476988a 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -22,6 +22,7 @@ | |||
22 | #define MII_EXPANSION 0x06 /* Expansion register */ | 22 | #define MII_EXPANSION 0x06 /* Expansion register */ |
23 | #define MII_CTRL1000 0x09 /* 1000BASE-T control */ | 23 | #define MII_CTRL1000 0x09 /* 1000BASE-T control */ |
24 | #define MII_STAT1000 0x0a /* 1000BASE-T status */ | 24 | #define MII_STAT1000 0x0a /* 1000BASE-T status */ |
25 | #define MII_ESTATUS 0x0f /* Extended Status */ | ||
25 | #define MII_DCOUNTER 0x12 /* Disconnect counter */ | 26 | #define MII_DCOUNTER 0x12 /* Disconnect counter */ |
26 | #define MII_FCSCOUNTER 0x13 /* False carrier counter */ | 27 | #define MII_FCSCOUNTER 0x13 /* False carrier counter */ |
27 | #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ | 28 | #define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ |
@@ -54,7 +55,10 @@ | |||
54 | #define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ | 55 | #define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ |
55 | #define BMSR_RFAULT 0x0010 /* Remote fault detected */ | 56 | #define BMSR_RFAULT 0x0010 /* Remote fault detected */ |
56 | #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ | 57 | #define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ |
57 | #define BMSR_RESV 0x07c0 /* Unused... */ | 58 | #define BMSR_RESV 0x00c0 /* Unused... */ |
59 | #define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ | ||
60 | #define BMSR_100FULL2 0x0200 /* Can do 100BASE-T2 HDX */ | ||
61 | #define BMSR_100HALF2 0x0400 /* Can do 100BASE-T2 FDX */ | ||
58 | #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ | 62 | #define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ |
59 | #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ | 63 | #define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ |
60 | #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ | 64 | #define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ |
@@ -114,6 +118,9 @@ | |||
114 | #define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ | 118 | #define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ |
115 | #define EXPANSION_RESV 0xffe0 /* Unused... */ | 119 | #define EXPANSION_RESV 0xffe0 /* Unused... */ |
116 | 120 | ||
121 | #define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */ | ||
122 | #define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */ | ||
123 | |||
117 | /* N-way test register. */ | 124 | /* N-way test register. */ |
118 | #define NWAYTEST_RESV1 0x00ff /* Unused... */ | 125 | #define NWAYTEST_RESV1 0x00ff /* Unused... */ |
119 | #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ | 126 | #define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index aefedf04b9bb..18fc77f682de 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -33,6 +33,13 @@ struct mmc_csd { | |||
33 | unsigned int capacity; | 33 | unsigned int capacity; |
34 | }; | 34 | }; |
35 | 35 | ||
36 | struct sd_scr { | ||
37 | unsigned char sda_vsn; | ||
38 | unsigned char bus_widths; | ||
39 | #define SD_SCR_BUS_WIDTH_1 (1<<0) | ||
40 | #define SD_SCR_BUS_WIDTH_4 (1<<2) | ||
41 | }; | ||
42 | |||
36 | struct mmc_host; | 43 | struct mmc_host; |
37 | 44 | ||
38 | /* | 45 | /* |
@@ -47,19 +54,27 @@ struct mmc_card { | |||
47 | #define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ | 54 | #define MMC_STATE_PRESENT (1<<0) /* present in sysfs */ |
48 | #define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ | 55 | #define MMC_STATE_DEAD (1<<1) /* device no longer in stack */ |
49 | #define MMC_STATE_BAD (1<<2) /* unrecognised device */ | 56 | #define MMC_STATE_BAD (1<<2) /* unrecognised device */ |
57 | #define MMC_STATE_SDCARD (1<<3) /* is an SD card */ | ||
58 | #define MMC_STATE_READONLY (1<<4) /* card is read-only */ | ||
50 | u32 raw_cid[4]; /* raw card CID */ | 59 | u32 raw_cid[4]; /* raw card CID */ |
51 | u32 raw_csd[4]; /* raw card CSD */ | 60 | u32 raw_csd[4]; /* raw card CSD */ |
61 | u32 raw_scr[2]; /* raw card SCR */ | ||
52 | struct mmc_cid cid; /* card identification */ | 62 | struct mmc_cid cid; /* card identification */ |
53 | struct mmc_csd csd; /* card specific */ | 63 | struct mmc_csd csd; /* card specific */ |
64 | struct sd_scr scr; /* extra SD information */ | ||
54 | }; | 65 | }; |
55 | 66 | ||
56 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) | 67 | #define mmc_card_present(c) ((c)->state & MMC_STATE_PRESENT) |
57 | #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) | 68 | #define mmc_card_dead(c) ((c)->state & MMC_STATE_DEAD) |
58 | #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) | 69 | #define mmc_card_bad(c) ((c)->state & MMC_STATE_BAD) |
70 | #define mmc_card_sd(c) ((c)->state & MMC_STATE_SDCARD) | ||
71 | #define mmc_card_readonly(c) ((c)->state & MMC_STATE_READONLY) | ||
59 | 72 | ||
60 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 73 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
61 | #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) | 74 | #define mmc_card_set_dead(c) ((c)->state |= MMC_STATE_DEAD) |
62 | #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) | 75 | #define mmc_card_set_bad(c) ((c)->state |= MMC_STATE_BAD) |
76 | #define mmc_card_set_sd(c) ((c)->state |= MMC_STATE_SDCARD) | ||
77 | #define mmc_card_set_readonly(c) ((c)->state |= MMC_STATE_READONLY) | ||
63 | 78 | ||
64 | #define mmc_card_name(c) ((c)->cid.prod_name) | 79 | #define mmc_card_name(c) ((c)->cid.prod_name) |
65 | #define mmc_card_id(c) ((c)->dev.bus_id) | 80 | #define mmc_card_id(c) ((c)->dev.bus_id) |
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index f90f674eb3b0..6014160d9c06 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -46,16 +46,28 @@ struct mmc_ios { | |||
46 | #define MMC_BUSMODE_OPENDRAIN 1 | 46 | #define MMC_BUSMODE_OPENDRAIN 1 |
47 | #define MMC_BUSMODE_PUSHPULL 2 | 47 | #define MMC_BUSMODE_PUSHPULL 2 |
48 | 48 | ||
49 | unsigned char chip_select; /* SPI chip select */ | ||
50 | |||
51 | #define MMC_CS_DONTCARE 0 | ||
52 | #define MMC_CS_HIGH 1 | ||
53 | #define MMC_CS_LOW 2 | ||
54 | |||
49 | unsigned char power_mode; /* power supply mode */ | 55 | unsigned char power_mode; /* power supply mode */ |
50 | 56 | ||
51 | #define MMC_POWER_OFF 0 | 57 | #define MMC_POWER_OFF 0 |
52 | #define MMC_POWER_UP 1 | 58 | #define MMC_POWER_UP 1 |
53 | #define MMC_POWER_ON 2 | 59 | #define MMC_POWER_ON 2 |
60 | |||
61 | unsigned char bus_width; /* data bus width */ | ||
62 | |||
63 | #define MMC_BUS_WIDTH_1 0 | ||
64 | #define MMC_BUS_WIDTH_4 2 | ||
54 | }; | 65 | }; |
55 | 66 | ||
56 | struct mmc_host_ops { | 67 | struct mmc_host_ops { |
57 | void (*request)(struct mmc_host *host, struct mmc_request *req); | 68 | void (*request)(struct mmc_host *host, struct mmc_request *req); |
58 | void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); | 69 | void (*set_ios)(struct mmc_host *host, struct mmc_ios *ios); |
70 | int (*get_ro)(struct mmc_host *host); | ||
59 | }; | 71 | }; |
60 | 72 | ||
61 | struct mmc_card; | 73 | struct mmc_card; |
@@ -63,11 +75,16 @@ struct device; | |||
63 | 75 | ||
64 | struct mmc_host { | 76 | struct mmc_host { |
65 | struct device *dev; | 77 | struct device *dev; |
78 | struct class_device class_dev; | ||
79 | int index; | ||
66 | struct mmc_host_ops *ops; | 80 | struct mmc_host_ops *ops; |
67 | unsigned int f_min; | 81 | unsigned int f_min; |
68 | unsigned int f_max; | 82 | unsigned int f_max; |
69 | u32 ocr_avail; | 83 | u32 ocr_avail; |
70 | char host_name[8]; | 84 | |
85 | unsigned long caps; /* Host capabilities */ | ||
86 | |||
87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | ||
71 | 88 | ||
72 | /* host specific block data */ | 89 | /* host specific block data */ |
73 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 90 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
@@ -80,6 +97,10 @@ struct mmc_host { | |||
80 | struct mmc_ios ios; /* current io bus settings */ | 97 | struct mmc_ios ios; /* current io bus settings */ |
81 | u32 ocr; /* the current OCR setting */ | 98 | u32 ocr; /* the current OCR setting */ |
82 | 99 | ||
100 | unsigned int mode; /* current card mode of host */ | ||
101 | #define MMC_MODE_MMC 0 | ||
102 | #define MMC_MODE_SD 1 | ||
103 | |||
83 | struct list_head cards; /* devices attached to this host */ | 104 | struct list_head cards; /* devices attached to this host */ |
84 | 105 | ||
85 | wait_queue_head_t wq; | 106 | wait_queue_head_t wq; |
@@ -97,6 +118,7 @@ extern void mmc_free_host(struct mmc_host *); | |||
97 | 118 | ||
98 | #define mmc_priv(x) ((void *)((x) + 1)) | 119 | #define mmc_priv(x) ((void *)((x) + 1)) |
99 | #define mmc_dev(x) ((x)->dev) | 120 | #define mmc_dev(x) ((x)->dev) |
121 | #define mmc_hostname(x) ((x)->class_dev.class_id) | ||
100 | 122 | ||
101 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); | 123 | extern int mmc_suspend_host(struct mmc_host *, pm_message_t); |
102 | extern int mmc_resume_host(struct mmc_host *); | 124 | extern int mmc_resume_host(struct mmc_host *); |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 0d35d4ffb360..1ab78e8d6c53 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -88,6 +88,8 @@ struct mmc_card; | |||
88 | 88 | ||
89 | extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); | 89 | extern int mmc_wait_for_req(struct mmc_host *, struct mmc_request *); |
90 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); | 90 | extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); |
91 | extern int mmc_wait_for_app_cmd(struct mmc_host *, unsigned int, | ||
92 | struct mmc_command *, int); | ||
91 | 93 | ||
92 | extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); | 94 | extern int __mmc_claim_host(struct mmc_host *host, struct mmc_card *card); |
93 | 95 | ||
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h index 896342817b97..f819cae92266 100644 --- a/include/linux/mmc/protocol.h +++ b/include/linux/mmc/protocol.h | |||
@@ -236,5 +236,12 @@ struct _mmc_csd { | |||
236 | #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ | 236 | #define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ |
237 | #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ | 237 | #define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ |
238 | 238 | ||
239 | |||
240 | /* | ||
241 | * SD bus widths | ||
242 | */ | ||
243 | #define SD_BUS_WIDTH_1 0 | ||
244 | #define SD_BUS_WIDTH_4 2 | ||
245 | |||
239 | #endif /* MMC_MMC_PROTOCOL_H */ | 246 | #endif /* MMC_MMC_PROTOCOL_H */ |
240 | 247 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 6c90461ed99f..5ed471b58f4f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -487,11 +487,27 @@ struct mem_section { | |||
487 | unsigned long section_mem_map; | 487 | unsigned long section_mem_map; |
488 | }; | 488 | }; |
489 | 489 | ||
490 | extern struct mem_section mem_section[NR_MEM_SECTIONS]; | 490 | #ifdef CONFIG_SPARSEMEM_EXTREME |
491 | #define SECTIONS_PER_ROOT (PAGE_SIZE / sizeof (struct mem_section)) | ||
492 | #else | ||
493 | #define SECTIONS_PER_ROOT 1 | ||
494 | #endif | ||
495 | |||
496 | #define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT) | ||
497 | #define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT) | ||
498 | #define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) | ||
499 | |||
500 | #ifdef CONFIG_SPARSEMEM_EXTREME | ||
501 | extern struct mem_section *mem_section[NR_SECTION_ROOTS]; | ||
502 | #else | ||
503 | extern struct mem_section mem_section[NR_SECTION_ROOTS][SECTIONS_PER_ROOT]; | ||
504 | #endif | ||
491 | 505 | ||
492 | static inline struct mem_section *__nr_to_section(unsigned long nr) | 506 | static inline struct mem_section *__nr_to_section(unsigned long nr) |
493 | { | 507 | { |
494 | return &mem_section[nr]; | 508 | if (!mem_section[SECTION_NR_TO_ROOT(nr)]) |
509 | return NULL; | ||
510 | return &mem_section[SECTION_NR_TO_ROOT(nr)][nr & SECTION_ROOT_MASK]; | ||
495 | } | 511 | } |
496 | 512 | ||
497 | /* | 513 | /* |
@@ -513,12 +529,12 @@ static inline struct page *__section_mem_map_addr(struct mem_section *section) | |||
513 | 529 | ||
514 | static inline int valid_section(struct mem_section *section) | 530 | static inline int valid_section(struct mem_section *section) |
515 | { | 531 | { |
516 | return (section->section_mem_map & SECTION_MARKED_PRESENT); | 532 | return (section && (section->section_mem_map & SECTION_MARKED_PRESENT)); |
517 | } | 533 | } |
518 | 534 | ||
519 | static inline int section_has_mem_map(struct mem_section *section) | 535 | static inline int section_has_mem_map(struct mem_section *section) |
520 | { | 536 | { |
521 | return (section->section_mem_map & SECTION_HAS_MEM_MAP); | 537 | return (section && (section->section_mem_map & SECTION_HAS_MEM_MAP)); |
522 | } | 538 | } |
523 | 539 | ||
524 | static inline int valid_section_nr(unsigned long nr) | 540 | static inline int valid_section_nr(unsigned long nr) |
@@ -572,6 +588,7 @@ static inline int pfn_valid(unsigned long pfn) | |||
572 | void sparse_init(void); | 588 | void sparse_init(void); |
573 | #else | 589 | #else |
574 | #define sparse_init() do {} while (0) | 590 | #define sparse_init() do {} while (0) |
591 | #define sparse_index_init(_sec, _nid) do {} while (0) | ||
575 | #endif /* CONFIG_SPARSEMEM */ | 592 | #endif /* CONFIG_SPARSEMEM */ |
576 | 593 | ||
577 | #ifdef CONFIG_NODES_SPAN_OTHER_NODES | 594 | #ifdef CONFIG_NODES_SPAN_OTHER_NODES |
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index dce53ac1625d..47da39ba3f03 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Device tables which are exported to userspace via | 2 | * Device tables which are exported to userspace via |
3 | * scripts/table2alias.c. You must keep that file in sync with this | 3 | * scripts/mod/file2alias.c. You must keep that file in sync with this |
4 | * header. | 4 | * header. |
5 | */ | 5 | */ |
6 | 6 | ||
@@ -33,7 +33,8 @@ struct ieee1394_device_id { | |||
33 | __u32 model_id; | 33 | __u32 model_id; |
34 | __u32 specifier_id; | 34 | __u32 specifier_id; |
35 | __u32 version; | 35 | __u32 version; |
36 | kernel_ulong_t driver_data; | 36 | kernel_ulong_t driver_data |
37 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
37 | }; | 38 | }; |
38 | 39 | ||
39 | 40 | ||
@@ -182,9 +183,18 @@ struct of_device_id | |||
182 | char name[32]; | 183 | char name[32]; |
183 | char type[32]; | 184 | char type[32]; |
184 | char compatible[128]; | 185 | char compatible[128]; |
186 | #if __KERNEL__ | ||
185 | void *data; | 187 | void *data; |
188 | #else | ||
189 | kernel_ulong_t data; | ||
190 | #endif | ||
186 | }; | 191 | }; |
187 | 192 | ||
193 | /* VIO */ | ||
194 | struct vio_device_id { | ||
195 | char type[32]; | ||
196 | char compat[32]; | ||
197 | }; | ||
188 | 198 | ||
189 | /* PCMCIA */ | 199 | /* PCMCIA */ |
190 | 200 | ||
@@ -208,7 +218,8 @@ struct pcmcia_device_id { | |||
208 | #ifdef __KERNEL__ | 218 | #ifdef __KERNEL__ |
209 | const char * prod_id[4]; | 219 | const char * prod_id[4]; |
210 | #else | 220 | #else |
211 | kernel_ulong_t prod_id[4]; | 221 | kernel_ulong_t prod_id[4] |
222 | __attribute__((aligned(sizeof(kernel_ulong_t)))); | ||
212 | #endif | 223 | #endif |
213 | 224 | ||
214 | /* not matched against */ | 225 | /* not matched against */ |
diff --git a/include/linux/msg.h b/include/linux/msg.h index 2c4c6aa643ff..903e0ab8101f 100644 --- a/include/linux/msg.h +++ b/include/linux/msg.h | |||
@@ -77,6 +77,7 @@ struct msg_msg { | |||
77 | /* one msq_queue structure for each present queue on the system */ | 77 | /* one msq_queue structure for each present queue on the system */ |
78 | struct msg_queue { | 78 | struct msg_queue { |
79 | struct kern_ipc_perm q_perm; | 79 | struct kern_ipc_perm q_perm; |
80 | int q_id; | ||
80 | time_t q_stime; /* last msgsnd time */ | 81 | time_t q_stime; /* last msgsnd time */ |
81 | time_t q_rtime; /* last msgrcv time */ | 82 | time_t q_rtime; /* last msgrcv time */ |
82 | time_t q_ctime; /* last change time */ | 83 | time_t q_ctime; /* last change time */ |
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h index 5773ea42f6e4..0b08cd692201 100644 --- a/include/linux/mv643xx.h +++ b/include/linux/mv643xx.h | |||
@@ -980,7 +980,7 @@ | |||
980 | /* I2C Registers */ | 980 | /* I2C Registers */ |
981 | /****************************************/ | 981 | /****************************************/ |
982 | 982 | ||
983 | #define MV64XXX_I2C_CTLR_NAME "mv64xxx i2c" | 983 | #define MV64XXX_I2C_CTLR_NAME "mv64xxx_i2c" |
984 | #define MV64XXX_I2C_OFFSET 0xc000 | 984 | #define MV64XXX_I2C_OFFSET 0xc000 |
985 | #define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 | 985 | #define MV64XXX_I2C_REG_BLOCK_SIZE 0x0020 |
986 | 986 | ||
diff --git a/include/linux/net.h b/include/linux/net.h index 20cb226b2268..4e981585a89a 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -84,6 +84,7 @@ enum sock_type { | |||
84 | SOCK_RAW = 3, | 84 | SOCK_RAW = 3, |
85 | SOCK_RDM = 4, | 85 | SOCK_RDM = 4, |
86 | SOCK_SEQPACKET = 5, | 86 | SOCK_SEQPACKET = 5, |
87 | SOCK_DCCP = 6, | ||
87 | SOCK_PACKET = 10, | 88 | SOCK_PACKET = 10, |
88 | }; | 89 | }; |
89 | 90 | ||
@@ -282,5 +283,15 @@ static struct proto_ops name##_ops = { \ | |||
282 | #define MODULE_ALIAS_NETPROTO(proto) \ | 283 | #define MODULE_ALIAS_NETPROTO(proto) \ |
283 | MODULE_ALIAS("net-pf-" __stringify(proto)) | 284 | MODULE_ALIAS("net-pf-" __stringify(proto)) |
284 | 285 | ||
286 | #define MODULE_ALIAS_NET_PF_PROTO(pf, proto) \ | ||
287 | MODULE_ALIAS("net-pf-" __stringify(pf) "-proto-" __stringify(proto)) | ||
288 | |||
289 | #ifdef CONFIG_SYSCTL | ||
290 | #include <linux/sysctl.h> | ||
291 | extern ctl_table net_table[]; | ||
292 | extern int net_msg_cost; | ||
293 | extern int net_msg_burst; | ||
294 | #endif | ||
295 | |||
285 | #endif /* __KERNEL__ */ | 296 | #endif /* __KERNEL__ */ |
286 | #endif /* _LINUX_NET_H */ | 297 | #endif /* _LINUX_NET_H */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 3a0ed7f9e801..7c717907896d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -244,6 +244,7 @@ struct netdev_boot_setup { | |||
244 | }; | 244 | }; |
245 | #define NETDEV_BOOT_SETUP_MAX 8 | 245 | #define NETDEV_BOOT_SETUP_MAX 8 |
246 | 246 | ||
247 | extern int __init netdev_boot_setup(char *str); | ||
247 | 248 | ||
248 | /* | 249 | /* |
249 | * The DEVICE structure. | 250 | * The DEVICE structure. |
@@ -336,6 +337,7 @@ struct net_device | |||
336 | /* Interface address info. */ | 337 | /* Interface address info. */ |
337 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 338 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
338 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ | 339 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address */ |
340 | unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ | ||
339 | unsigned char addr_len; /* hardware address length */ | 341 | unsigned char addr_len; /* hardware address length */ |
340 | unsigned short dev_id; /* for shared network cards */ | 342 | unsigned short dev_id; /* for shared network cards */ |
341 | 343 | ||
@@ -497,10 +499,12 @@ static inline void *netdev_priv(struct net_device *dev) | |||
497 | #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) | 499 | #define SET_NETDEV_DEV(net, pdev) ((net)->class_dev.dev = (pdev)) |
498 | 500 | ||
499 | struct packet_type { | 501 | struct packet_type { |
500 | __be16 type; /* This is really htons(ether_type). */ | 502 | __be16 type; /* This is really htons(ether_type). */ |
501 | struct net_device *dev; /* NULL is wildcarded here */ | 503 | struct net_device *dev; /* NULL is wildcarded here */ |
502 | int (*func) (struct sk_buff *, struct net_device *, | 504 | int (*func) (struct sk_buff *, |
503 | struct packet_type *); | 505 | struct net_device *, |
506 | struct packet_type *, | ||
507 | struct net_device *); | ||
504 | void *af_packet_priv; | 508 | void *af_packet_priv; |
505 | struct list_head list; | 509 | struct list_head list; |
506 | }; | 510 | }; |
@@ -671,6 +675,7 @@ extern void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev); | |||
671 | extern void dev_init(void); | 675 | extern void dev_init(void); |
672 | 676 | ||
673 | extern int netdev_nit; | 677 | extern int netdev_nit; |
678 | extern int netdev_budget; | ||
674 | 679 | ||
675 | /* Called by rtnetlink.c:rtnl_unlock() */ | 680 | /* Called by rtnetlink.c:rtnl_unlock() */ |
676 | extern void netdev_run_todo(void); | 681 | extern void netdev_run_todo(void); |
@@ -697,19 +702,9 @@ static inline int netif_carrier_ok(const struct net_device *dev) | |||
697 | 702 | ||
698 | extern void __netdev_watchdog_up(struct net_device *dev); | 703 | extern void __netdev_watchdog_up(struct net_device *dev); |
699 | 704 | ||
700 | static inline void netif_carrier_on(struct net_device *dev) | 705 | extern void netif_carrier_on(struct net_device *dev); |
701 | { | ||
702 | if (test_and_clear_bit(__LINK_STATE_NOCARRIER, &dev->state)) | ||
703 | linkwatch_fire_event(dev); | ||
704 | if (netif_running(dev)) | ||
705 | __netdev_watchdog_up(dev); | ||
706 | } | ||
707 | 706 | ||
708 | static inline void netif_carrier_off(struct net_device *dev) | 707 | extern void netif_carrier_off(struct net_device *dev); |
709 | { | ||
710 | if (!test_and_set_bit(__LINK_STATE_NOCARRIER, &dev->state)) | ||
711 | linkwatch_fire_event(dev); | ||
712 | } | ||
713 | 708 | ||
714 | /* Hot-plugging. */ | 709 | /* Hot-plugging. */ |
715 | static inline int netif_device_present(struct net_device *dev) | 710 | static inline int netif_device_present(struct net_device *dev) |
@@ -916,6 +911,14 @@ extern int skb_checksum_help(struct sk_buff *skb, int inward); | |||
916 | extern void net_enable_timestamp(void); | 911 | extern void net_enable_timestamp(void); |
917 | extern void net_disable_timestamp(void); | 912 | extern void net_disable_timestamp(void); |
918 | 913 | ||
914 | #ifdef CONFIG_PROC_FS | ||
915 | extern void *dev_seq_start(struct seq_file *seq, loff_t *pos); | ||
916 | extern void *dev_seq_next(struct seq_file *seq, void *v, loff_t *pos); | ||
917 | extern void dev_seq_stop(struct seq_file *seq, void *v); | ||
918 | #endif | ||
919 | |||
920 | extern void linkwatch_run_queue(void); | ||
921 | |||
919 | #endif /* __KERNEL__ */ | 922 | #endif /* __KERNEL__ */ |
920 | 923 | ||
921 | #endif /* _LINUX_DEV_H */ | 924 | #endif /* _LINUX_DEV_H */ |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 2e2045482cb1..be365e70ee99 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -21,10 +21,23 @@ | |||
21 | #define NF_STOP 5 | 21 | #define NF_STOP 5 |
22 | #define NF_MAX_VERDICT NF_STOP | 22 | #define NF_MAX_VERDICT NF_STOP |
23 | 23 | ||
24 | /* we overload the higher bits for encoding auxiliary data such as the queue | ||
25 | * number. Not nice, but better than additional function arguments. */ | ||
26 | #define NF_VERDICT_MASK 0x0000ffff | ||
27 | #define NF_VERDICT_BITS 16 | ||
28 | |||
29 | #define NF_VERDICT_QMASK 0xffff0000 | ||
30 | #define NF_VERDICT_QBITS 16 | ||
31 | |||
32 | #define NF_QUEUE_NR(x) (((x << NF_VERDICT_QBITS) & NF_VERDICT_QMASK) | NF_QUEUE) | ||
33 | |||
34 | /* only for userspace compatibility */ | ||
35 | #ifndef __KERNEL__ | ||
24 | /* Generic cache responses from hook functions. | 36 | /* Generic cache responses from hook functions. |
25 | <= 0x2000 is used for protocol-flags. */ | 37 | <= 0x2000 is used for protocol-flags. */ |
26 | #define NFC_UNKNOWN 0x4000 | 38 | #define NFC_UNKNOWN 0x4000 |
27 | #define NFC_ALTERED 0x8000 | 39 | #define NFC_ALTERED 0x8000 |
40 | #endif | ||
28 | 41 | ||
29 | #ifdef __KERNEL__ | 42 | #ifdef __KERNEL__ |
30 | #include <linux/config.h> | 43 | #include <linux/config.h> |
@@ -101,15 +114,51 @@ void nf_unregister_sockopt(struct nf_sockopt_ops *reg); | |||
101 | 114 | ||
102 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 115 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; |
103 | 116 | ||
104 | typedef void nf_logfn(unsigned int hooknum, | 117 | /* those NF_LOG_* defines and struct nf_loginfo are legacy definitios that will |
118 | * disappear once iptables is replaced with pkttables. Please DO NOT use them | ||
119 | * for any new code! */ | ||
120 | #define NF_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ | ||
121 | #define NF_LOG_TCPOPT 0x02 /* Log TCP options */ | ||
122 | #define NF_LOG_IPOPT 0x04 /* Log IP options */ | ||
123 | #define NF_LOG_UID 0x08 /* Log UID owning local socket */ | ||
124 | #define NF_LOG_MASK 0x0f | ||
125 | |||
126 | #define NF_LOG_TYPE_LOG 0x01 | ||
127 | #define NF_LOG_TYPE_ULOG 0x02 | ||
128 | |||
129 | struct nf_loginfo { | ||
130 | u_int8_t type; | ||
131 | union { | ||
132 | struct { | ||
133 | u_int32_t copy_len; | ||
134 | u_int16_t group; | ||
135 | u_int16_t qthreshold; | ||
136 | } ulog; | ||
137 | struct { | ||
138 | u_int8_t level; | ||
139 | u_int8_t logflags; | ||
140 | } log; | ||
141 | } u; | ||
142 | }; | ||
143 | |||
144 | typedef void nf_logfn(unsigned int pf, | ||
145 | unsigned int hooknum, | ||
105 | const struct sk_buff *skb, | 146 | const struct sk_buff *skb, |
106 | const struct net_device *in, | 147 | const struct net_device *in, |
107 | const struct net_device *out, | 148 | const struct net_device *out, |
149 | const struct nf_loginfo *li, | ||
108 | const char *prefix); | 150 | const char *prefix); |
109 | 151 | ||
152 | struct nf_logger { | ||
153 | struct module *me; | ||
154 | nf_logfn *logfn; | ||
155 | char *name; | ||
156 | }; | ||
157 | |||
110 | /* Function to register/unregister log function. */ | 158 | /* Function to register/unregister log function. */ |
111 | int nf_log_register(int pf, nf_logfn *logfn); | 159 | int nf_log_register(int pf, struct nf_logger *logger); |
112 | void nf_log_unregister(int pf, nf_logfn *logfn); | 160 | int nf_log_unregister_pf(int pf); |
161 | void nf_log_unregister_logger(struct nf_logger *logger); | ||
113 | 162 | ||
114 | /* Calls the registered backend logging function */ | 163 | /* Calls the registered backend logging function */ |
115 | void nf_log_packet(int pf, | 164 | void nf_log_packet(int pf, |
@@ -117,6 +166,7 @@ void nf_log_packet(int pf, | |||
117 | const struct sk_buff *skb, | 166 | const struct sk_buff *skb, |
118 | const struct net_device *in, | 167 | const struct net_device *in, |
119 | const struct net_device *out, | 168 | const struct net_device *out, |
169 | struct nf_loginfo *li, | ||
120 | const char *fmt, ...); | 170 | const char *fmt, ...); |
121 | 171 | ||
122 | /* Activate hook; either okfn or kfree_skb called, unless a hook | 172 | /* Activate hook; either okfn or kfree_skb called, unless a hook |
@@ -175,11 +225,16 @@ int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, | |||
175 | int *len); | 225 | int *len); |
176 | 226 | ||
177 | /* Packet queuing */ | 227 | /* Packet queuing */ |
178 | typedef int (*nf_queue_outfn_t)(struct sk_buff *skb, | 228 | struct nf_queue_handler { |
179 | struct nf_info *info, void *data); | 229 | int (*outfn)(struct sk_buff *skb, struct nf_info *info, |
230 | unsigned int queuenum, void *data); | ||
231 | void *data; | ||
232 | char *name; | ||
233 | }; | ||
180 | extern int nf_register_queue_handler(int pf, | 234 | extern int nf_register_queue_handler(int pf, |
181 | nf_queue_outfn_t outfn, void *data); | 235 | struct nf_queue_handler *qh); |
182 | extern int nf_unregister_queue_handler(int pf); | 236 | extern int nf_unregister_queue_handler(int pf); |
237 | extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); | ||
183 | extern void nf_reinject(struct sk_buff *skb, | 238 | extern void nf_reinject(struct sk_buff *skb, |
184 | struct nf_info *info, | 239 | struct nf_info *info, |
185 | unsigned int verdict); | 240 | unsigned int verdict); |
@@ -190,6 +245,27 @@ extern void nf_ct_attach(struct sk_buff *, struct sk_buff *); | |||
190 | /* FIXME: Before cache is ever used, this must be implemented for real. */ | 245 | /* FIXME: Before cache is ever used, this must be implemented for real. */ |
191 | extern void nf_invalidate_cache(int pf); | 246 | extern void nf_invalidate_cache(int pf); |
192 | 247 | ||
248 | /* Call this before modifying an existing packet: ensures it is | ||
249 | modifiable and linear to the point you care about (writable_len). | ||
250 | Returns true or false. */ | ||
251 | extern int skb_make_writable(struct sk_buff **pskb, unsigned int writable_len); | ||
252 | |||
253 | struct nf_queue_rerouter { | ||
254 | void (*save)(const struct sk_buff *skb, struct nf_info *info); | ||
255 | int (*reroute)(struct sk_buff **skb, const struct nf_info *info); | ||
256 | int rer_size; | ||
257 | }; | ||
258 | |||
259 | #define nf_info_reroute(x) ((void *)x + sizeof(struct nf_info)) | ||
260 | |||
261 | extern int nf_register_queue_rerouter(int pf, struct nf_queue_rerouter *rer); | ||
262 | extern int nf_unregister_queue_rerouter(int pf); | ||
263 | |||
264 | #ifdef CONFIG_PROC_FS | ||
265 | #include <linux/proc_fs.h> | ||
266 | extern struct proc_dir_entry *proc_net_netfilter; | ||
267 | #endif | ||
268 | |||
193 | #else /* !CONFIG_NETFILTER */ | 269 | #else /* !CONFIG_NETFILTER */ |
194 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) | 270 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) |
195 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | 271 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h new file mode 100644 index 000000000000..1d5b10ae2399 --- /dev/null +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -0,0 +1,169 @@ | |||
1 | #ifndef _NFNETLINK_H | ||
2 | #define _NFNETLINK_H | ||
3 | #include <linux/types.h> | ||
4 | |||
5 | #ifndef __KERNEL__ | ||
6 | /* nfnetlink groups: Up to 32 maximum - backwards compatibility for userspace */ | ||
7 | #define NF_NETLINK_CONNTRACK_NEW 0x00000001 | ||
8 | #define NF_NETLINK_CONNTRACK_UPDATE 0x00000002 | ||
9 | #define NF_NETLINK_CONNTRACK_DESTROY 0x00000004 | ||
10 | #define NF_NETLINK_CONNTRACK_EXP_NEW 0x00000008 | ||
11 | #define NF_NETLINK_CONNTRACK_EXP_UPDATE 0x00000010 | ||
12 | #define NF_NETLINK_CONNTRACK_EXP_DESTROY 0x00000020 | ||
13 | #endif | ||
14 | |||
15 | enum nfnetlink_groups { | ||
16 | NFNLGRP_NONE, | ||
17 | #define NFNLGRP_NONE NFNLGRP_NONE | ||
18 | NFNLGRP_CONNTRACK_NEW, | ||
19 | #define NFNLGRP_CONNTRACK_NEW NFNLGRP_CONNTRACK_NEW | ||
20 | NFNLGRP_CONNTRACK_UPDATE, | ||
21 | #define NFNLGRP_CONNTRACK_UPDATE NFNLGRP_CONNTRACK_UPDATE | ||
22 | NFNLGRP_CONNTRACK_DESTROY, | ||
23 | #define NFNLGRP_CONNTRACK_DESTROY NFNLGRP_CONNTRACK_DESTROY | ||
24 | NFNLGRP_CONNTRACK_EXP_NEW, | ||
25 | #define NFNLGRP_CONNTRACK_EXP_NEW NFNLGRP_CONNTRACK_EXP_NEW | ||
26 | NFNLGRP_CONNTRACK_EXP_UPDATE, | ||
27 | #define NFNLGRP_CONNTRACK_EXP_UPDATE NFNLGRP_CONNTRACK_EXP_UPDATE | ||
28 | NFNLGRP_CONNTRACK_EXP_DESTROY, | ||
29 | #define NFNLGRP_CONNTRACK_EXP_DESTROY NFNLGRP_CONNTRACK_EXP_DESTROY | ||
30 | __NFNLGRP_MAX, | ||
31 | }; | ||
32 | #define NFNLGRP_MAX (__NFNLGRP_MAX - 1) | ||
33 | |||
34 | /* Generic structure for encapsulation optional netfilter information. | ||
35 | * It is reminiscent of sockaddr, but with sa_family replaced | ||
36 | * with attribute type. | ||
37 | * ! This should someday be put somewhere generic as now rtnetlink and | ||
38 | * ! nfnetlink use the same attributes methods. - J. Schulist. | ||
39 | */ | ||
40 | |||
41 | struct nfattr | ||
42 | { | ||
43 | u_int16_t nfa_len; | ||
44 | u_int16_t nfa_type; | ||
45 | } __attribute__ ((packed)); | ||
46 | |||
47 | /* FIXME: Shamelessly copy and pasted from rtnetlink.h, it's time | ||
48 | * to put this in a generic file */ | ||
49 | |||
50 | #define NFA_ALIGNTO 4 | ||
51 | #define NFA_ALIGN(len) (((len) + NFA_ALIGNTO - 1) & ~(NFA_ALIGNTO - 1)) | ||
52 | #define NFA_OK(nfa,len) ((len) > 0 && (nfa)->nfa_len >= sizeof(struct nfattr) \ | ||
53 | && (nfa)->nfa_len <= (len)) | ||
54 | #define NFA_NEXT(nfa,attrlen) ((attrlen) -= NFA_ALIGN((nfa)->nfa_len), \ | ||
55 | (struct nfattr *)(((char *)(nfa)) + NFA_ALIGN((nfa)->nfa_len))) | ||
56 | #define NFA_LENGTH(len) (NFA_ALIGN(sizeof(struct nfattr)) + (len)) | ||
57 | #define NFA_SPACE(len) NFA_ALIGN(NFA_LENGTH(len)) | ||
58 | #define NFA_DATA(nfa) ((void *)(((char *)(nfa)) + NFA_LENGTH(0))) | ||
59 | #define NFA_PAYLOAD(nfa) ((int)((nfa)->nfa_len) - NFA_LENGTH(0)) | ||
60 | #define NFA_NEST(skb, type) \ | ||
61 | ({ struct nfattr *__start = (struct nfattr *) (skb)->tail; \ | ||
62 | NFA_PUT(skb, type, 0, NULL); \ | ||
63 | __start; }) | ||
64 | #define NFA_NEST_END(skb, start) \ | ||
65 | ({ (start)->nfa_len = ((skb)->tail - (unsigned char *) (start)); \ | ||
66 | (skb)->len; }) | ||
67 | #define NFA_NEST_CANCEL(skb, start) \ | ||
68 | ({ if (start) \ | ||
69 | skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ | ||
70 | -1; }) | ||
71 | |||
72 | /* General form of address family dependent message. | ||
73 | */ | ||
74 | struct nfgenmsg { | ||
75 | u_int8_t nfgen_family; /* AF_xxx */ | ||
76 | u_int8_t version; /* nfnetlink version */ | ||
77 | u_int16_t res_id; /* resource id */ | ||
78 | } __attribute__ ((packed)); | ||
79 | |||
80 | #define NFNETLINK_V0 0 | ||
81 | |||
82 | #define NFM_NFA(n) ((struct nfattr *)(((char *)(n)) \ | ||
83 | + NLMSG_ALIGN(sizeof(struct nfgenmsg)))) | ||
84 | #define NFM_PAYLOAD(n) NLMSG_PAYLOAD(n, sizeof(struct nfgenmsg)) | ||
85 | |||
86 | /* netfilter netlink message types are split in two pieces: | ||
87 | * 8 bit subsystem, 8bit operation. | ||
88 | */ | ||
89 | |||
90 | #define NFNL_SUBSYS_ID(x) ((x & 0xff00) >> 8) | ||
91 | #define NFNL_MSG_TYPE(x) (x & 0x00ff) | ||
92 | |||
93 | /* No enum here, otherwise __stringify() trick of MODULE_ALIAS_NFNL_SUBSYS() | ||
94 | * won't work anymore */ | ||
95 | #define NFNL_SUBSYS_NONE 0 | ||
96 | #define NFNL_SUBSYS_CTNETLINK 1 | ||
97 | #define NFNL_SUBSYS_CTNETLINK_EXP 2 | ||
98 | #define NFNL_SUBSYS_QUEUE 3 | ||
99 | #define NFNL_SUBSYS_ULOG 4 | ||
100 | #define NFNL_SUBSYS_COUNT 5 | ||
101 | |||
102 | #ifdef __KERNEL__ | ||
103 | |||
104 | #include <linux/netlink.h> | ||
105 | #include <linux/capability.h> | ||
106 | |||
107 | struct nfnl_callback | ||
108 | { | ||
109 | int (*call)(struct sock *nl, struct sk_buff *skb, | ||
110 | struct nlmsghdr *nlh, struct nfattr *cda[], int *errp); | ||
111 | kernel_cap_t cap_required; /* capabilities required for this msg */ | ||
112 | u_int16_t attr_count; /* number of nfattr's */ | ||
113 | }; | ||
114 | |||
115 | struct nfnetlink_subsystem | ||
116 | { | ||
117 | const char *name; | ||
118 | __u8 subsys_id; /* nfnetlink subsystem ID */ | ||
119 | __u8 cb_count; /* number of callbacks */ | ||
120 | struct nfnl_callback *cb; /* callback for individual types */ | ||
121 | }; | ||
122 | |||
123 | extern void __nfa_fill(struct sk_buff *skb, int attrtype, | ||
124 | int attrlen, const void *data); | ||
125 | #define NFA_PUT(skb, attrtype, attrlen, data) \ | ||
126 | ({ if (skb_tailroom(skb) < (int)NFA_SPACE(attrlen)) goto nfattr_failure; \ | ||
127 | __nfa_fill(skb, attrtype, attrlen, data); }) | ||
128 | |||
129 | extern struct semaphore nfnl_sem; | ||
130 | |||
131 | #define nfnl_shlock() down(&nfnl_sem) | ||
132 | #define nfnl_shlock_nowait() down_trylock(&nfnl_sem) | ||
133 | |||
134 | #define nfnl_shunlock() do { up(&nfnl_sem); \ | ||
135 | if(nfnl && nfnl->sk_receive_queue.qlen) \ | ||
136 | nfnl->sk_data_ready(nfnl, 0); \ | ||
137 | } while(0) | ||
138 | |||
139 | extern void nfnl_lock(void); | ||
140 | extern void nfnl_unlock(void); | ||
141 | |||
142 | extern int nfnetlink_subsys_register(struct nfnetlink_subsystem *n); | ||
143 | extern int nfnetlink_subsys_unregister(struct nfnetlink_subsystem *n); | ||
144 | |||
145 | extern int nfattr_parse(struct nfattr *tb[], int maxattr, | ||
146 | struct nfattr *nfa, int len); | ||
147 | |||
148 | #define nfattr_parse_nested(tb, max, nfa) \ | ||
149 | nfattr_parse((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa))) | ||
150 | |||
151 | #define nfattr_bad_size(tb, max, cta_min) \ | ||
152 | ({ int __i, __res = 0; \ | ||
153 | for (__i=0; __i<max; __i++) \ | ||
154 | if (tb[__i] && NFA_PAYLOAD(tb[__i]) < cta_min[__i]){ \ | ||
155 | __res = 1; \ | ||
156 | break; \ | ||
157 | } \ | ||
158 | __res; \ | ||
159 | }) | ||
160 | |||
161 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | ||
162 | int echo); | ||
163 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | ||
164 | |||
165 | #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \ | ||
166 | MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys)) | ||
167 | |||
168 | #endif /* __KERNEL__ */ | ||
169 | #endif /* _NFNETLINK_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h new file mode 100644 index 000000000000..5c55751c78e4 --- /dev/null +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -0,0 +1,124 @@ | |||
1 | #ifndef _IPCONNTRACK_NETLINK_H | ||
2 | #define _IPCONNTRACK_NETLINK_H | ||
3 | #include <linux/netfilter/nfnetlink.h> | ||
4 | |||
5 | enum cntl_msg_types { | ||
6 | IPCTNL_MSG_CT_NEW, | ||
7 | IPCTNL_MSG_CT_GET, | ||
8 | IPCTNL_MSG_CT_DELETE, | ||
9 | IPCTNL_MSG_CT_GET_CTRZERO, | ||
10 | |||
11 | IPCTNL_MSG_MAX | ||
12 | }; | ||
13 | |||
14 | enum ctnl_exp_msg_types { | ||
15 | IPCTNL_MSG_EXP_NEW, | ||
16 | IPCTNL_MSG_EXP_GET, | ||
17 | IPCTNL_MSG_EXP_DELETE, | ||
18 | |||
19 | IPCTNL_MSG_EXP_MAX | ||
20 | }; | ||
21 | |||
22 | |||
23 | enum ctattr_type { | ||
24 | CTA_UNSPEC, | ||
25 | CTA_TUPLE_ORIG, | ||
26 | CTA_TUPLE_REPLY, | ||
27 | CTA_STATUS, | ||
28 | CTA_PROTOINFO, | ||
29 | CTA_HELP, | ||
30 | CTA_NAT, | ||
31 | CTA_TIMEOUT, | ||
32 | CTA_MARK, | ||
33 | CTA_COUNTERS_ORIG, | ||
34 | CTA_COUNTERS_REPLY, | ||
35 | CTA_USE, | ||
36 | CTA_ID, | ||
37 | __CTA_MAX | ||
38 | }; | ||
39 | #define CTA_MAX (__CTA_MAX - 1) | ||
40 | |||
41 | enum ctattr_tuple { | ||
42 | CTA_TUPLE_UNSPEC, | ||
43 | CTA_TUPLE_IP, | ||
44 | CTA_TUPLE_PROTO, | ||
45 | __CTA_TUPLE_MAX | ||
46 | }; | ||
47 | #define CTA_TUPLE_MAX (__CTA_TUPLE_MAX - 1) | ||
48 | |||
49 | enum ctattr_ip { | ||
50 | CTA_IP_UNSPEC, | ||
51 | CTA_IP_V4_SRC, | ||
52 | CTA_IP_V4_DST, | ||
53 | CTA_IP_V6_SRC, | ||
54 | CTA_IP_V6_DST, | ||
55 | __CTA_IP_MAX | ||
56 | }; | ||
57 | #define CTA_IP_MAX (__CTA_IP_MAX - 1) | ||
58 | |||
59 | enum ctattr_l4proto { | ||
60 | CTA_PROTO_UNSPEC, | ||
61 | CTA_PROTO_NUM, | ||
62 | CTA_PROTO_SRC_PORT, | ||
63 | CTA_PROTO_DST_PORT, | ||
64 | CTA_PROTO_ICMP_ID, | ||
65 | CTA_PROTO_ICMP_TYPE, | ||
66 | CTA_PROTO_ICMP_CODE, | ||
67 | __CTA_PROTO_MAX | ||
68 | }; | ||
69 | #define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1) | ||
70 | |||
71 | enum ctattr_protoinfo { | ||
72 | CTA_PROTOINFO_UNSPEC, | ||
73 | CTA_PROTOINFO_TCP_STATE, | ||
74 | __CTA_PROTOINFO_MAX | ||
75 | }; | ||
76 | #define CTA_PROTOINFO_MAX (__CTA_PROTOINFO_MAX - 1) | ||
77 | |||
78 | enum ctattr_counters { | ||
79 | CTA_COUNTERS_UNSPEC, | ||
80 | CTA_COUNTERS_PACKETS, | ||
81 | CTA_COUNTERS_BYTES, | ||
82 | __CTA_COUNTERS_MAX | ||
83 | }; | ||
84 | #define CTA_COUNTERS_MAX (__CTA_COUNTERS_MAX - 1) | ||
85 | |||
86 | enum ctattr_nat { | ||
87 | CTA_NAT_UNSPEC, | ||
88 | CTA_NAT_MINIP, | ||
89 | CTA_NAT_MAXIP, | ||
90 | CTA_NAT_PROTO, | ||
91 | __CTA_NAT_MAX | ||
92 | }; | ||
93 | #define CTA_NAT_MAX (__CTA_NAT_MAX - 1) | ||
94 | |||
95 | enum ctattr_protonat { | ||
96 | CTA_PROTONAT_UNSPEC, | ||
97 | CTA_PROTONAT_PORT_MIN, | ||
98 | CTA_PROTONAT_PORT_MAX, | ||
99 | __CTA_PROTONAT_MAX | ||
100 | }; | ||
101 | #define CTA_PROTONAT_MAX (__CTA_PROTONAT_MAX - 1) | ||
102 | |||
103 | enum ctattr_expect { | ||
104 | CTA_EXPECT_UNSPEC, | ||
105 | CTA_EXPECT_MASTER, | ||
106 | CTA_EXPECT_TUPLE, | ||
107 | CTA_EXPECT_MASK, | ||
108 | CTA_EXPECT_TIMEOUT, | ||
109 | CTA_EXPECT_ID, | ||
110 | CTA_EXPECT_HELP_NAME, | ||
111 | __CTA_EXPECT_MAX | ||
112 | }; | ||
113 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) | ||
114 | |||
115 | enum ctattr_help { | ||
116 | CTA_HELP_UNSPEC, | ||
117 | CTA_HELP_NAME, | ||
118 | __CTA_HELP_MAX | ||
119 | }; | ||
120 | #define CTA_HELP_MAX (__CTA_HELP_MAX - 1) | ||
121 | |||
122 | #define CTA_HELP_MAXNAMESIZE 32 | ||
123 | |||
124 | #endif /* _IPCONNTRACK_NETLINK_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h new file mode 100644 index 000000000000..b04b03880595 --- /dev/null +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -0,0 +1,88 @@ | |||
1 | #ifndef _NFNETLINK_LOG_H | ||
2 | #define _NFNETLINK_LOG_H | ||
3 | |||
4 | /* This file describes the netlink messages (i.e. 'protocol packets'), | ||
5 | * and not any kind of function definitions. It is shared between kernel and | ||
6 | * userspace. Don't put kernel specific stuff in here */ | ||
7 | |||
8 | #include <linux/types.h> | ||
9 | #include <linux/netfilter/nfnetlink.h> | ||
10 | |||
11 | enum nfulnl_msg_types { | ||
12 | NFULNL_MSG_PACKET, /* packet from kernel to userspace */ | ||
13 | NFULNL_MSG_CONFIG, /* connect to a particular queue */ | ||
14 | |||
15 | NFULNL_MSG_MAX | ||
16 | }; | ||
17 | |||
18 | struct nfulnl_msg_packet_hdr { | ||
19 | u_int16_t hw_protocol; /* hw protocol (network order) */ | ||
20 | u_int8_t hook; /* netfilter hook */ | ||
21 | u_int8_t _pad; | ||
22 | } __attribute__ ((packed)); | ||
23 | |||
24 | struct nfulnl_msg_packet_hw { | ||
25 | u_int16_t hw_addrlen; | ||
26 | u_int16_t _pad; | ||
27 | u_int8_t hw_addr[8]; | ||
28 | } __attribute__ ((packed)); | ||
29 | |||
30 | struct nfulnl_msg_packet_timestamp { | ||
31 | aligned_u64 sec; | ||
32 | aligned_u64 usec; | ||
33 | } __attribute__ ((packed)); | ||
34 | |||
35 | #define NFULNL_PREFIXLEN 30 /* just like old log target */ | ||
36 | |||
37 | enum nfulnl_attr_type { | ||
38 | NFULA_UNSPEC, | ||
39 | NFULA_PACKET_HDR, | ||
40 | NFULA_MARK, /* u_int32_t nfmark */ | ||
41 | NFULA_TIMESTAMP, /* nfulnl_msg_packet_timestamp */ | ||
42 | NFULA_IFINDEX_INDEV, /* u_int32_t ifindex */ | ||
43 | NFULA_IFINDEX_OUTDEV, /* u_int32_t ifindex */ | ||
44 | NFULA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */ | ||
45 | NFULA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */ | ||
46 | NFULA_HWADDR, /* nfulnl_msg_packet_hw */ | ||
47 | NFULA_PAYLOAD, /* opaque data payload */ | ||
48 | NFULA_PREFIX, /* string prefix */ | ||
49 | NFULA_UID, /* user id of socket */ | ||
50 | |||
51 | __NFULA_MAX | ||
52 | }; | ||
53 | #define NFULA_MAX (__NFULA_MAX - 1) | ||
54 | |||
55 | enum nfulnl_msg_config_cmds { | ||
56 | NFULNL_CFG_CMD_NONE, | ||
57 | NFULNL_CFG_CMD_BIND, | ||
58 | NFULNL_CFG_CMD_UNBIND, | ||
59 | NFULNL_CFG_CMD_PF_BIND, | ||
60 | NFULNL_CFG_CMD_PF_UNBIND, | ||
61 | }; | ||
62 | |||
63 | struct nfulnl_msg_config_cmd { | ||
64 | u_int8_t command; /* nfulnl_msg_config_cmds */ | ||
65 | } __attribute__ ((packed)); | ||
66 | |||
67 | struct nfulnl_msg_config_mode { | ||
68 | u_int32_t copy_range; | ||
69 | u_int8_t copy_mode; | ||
70 | u_int8_t _pad; | ||
71 | } __attribute__ ((packed)); | ||
72 | |||
73 | enum nfulnl_attr_config { | ||
74 | NFULA_CFG_UNSPEC, | ||
75 | NFULA_CFG_CMD, /* nfulnl_msg_config_cmd */ | ||
76 | NFULA_CFG_MODE, /* nfulnl_msg_config_mode */ | ||
77 | NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ | ||
78 | NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ | ||
79 | NFULA_CFG_QTHRESH, /* u_int32_t */ | ||
80 | __NFULA_CFG_MAX | ||
81 | }; | ||
82 | #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) | ||
83 | |||
84 | #define NFULNL_COPY_NONE 0x00 | ||
85 | #define NFULNL_COPY_META 0x01 | ||
86 | #define NFULNL_COPY_PACKET 0x02 | ||
87 | |||
88 | #endif /* _NFNETLINK_LOG_H */ | ||
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h new file mode 100644 index 000000000000..9e774373244c --- /dev/null +++ b/include/linux/netfilter/nfnetlink_queue.h | |||
@@ -0,0 +1,89 @@ | |||
1 | #ifndef _NFNETLINK_QUEUE_H | ||
2 | #define _NFNETLINK_QUEUE_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/netfilter/nfnetlink.h> | ||
6 | |||
7 | enum nfqnl_msg_types { | ||
8 | NFQNL_MSG_PACKET, /* packet from kernel to userspace */ | ||
9 | NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ | ||
10 | NFQNL_MSG_CONFIG, /* connect to a particular queue */ | ||
11 | |||
12 | NFQNL_MSG_MAX | ||
13 | }; | ||
14 | |||
15 | struct nfqnl_msg_packet_hdr { | ||
16 | u_int32_t packet_id; /* unique ID of packet in queue */ | ||
17 | u_int16_t hw_protocol; /* hw protocol (network order) */ | ||
18 | u_int8_t hook; /* netfilter hook */ | ||
19 | } __attribute__ ((packed)); | ||
20 | |||
21 | struct nfqnl_msg_packet_hw { | ||
22 | u_int16_t hw_addrlen; | ||
23 | u_int16_t _pad; | ||
24 | u_int8_t hw_addr[8]; | ||
25 | } __attribute__ ((packed)); | ||
26 | |||
27 | struct nfqnl_msg_packet_timestamp { | ||
28 | aligned_u64 sec; | ||
29 | aligned_u64 usec; | ||
30 | } __attribute__ ((packed)); | ||
31 | |||
32 | enum nfqnl_attr_type { | ||
33 | NFQA_UNSPEC, | ||
34 | NFQA_PACKET_HDR, | ||
35 | NFQA_VERDICT_HDR, /* nfqnl_msg_verdict_hrd */ | ||
36 | NFQA_MARK, /* u_int32_t nfmark */ | ||
37 | NFQA_TIMESTAMP, /* nfqnl_msg_packet_timestamp */ | ||
38 | NFQA_IFINDEX_INDEV, /* u_int32_t ifindex */ | ||
39 | NFQA_IFINDEX_OUTDEV, /* u_int32_t ifindex */ | ||
40 | NFQA_IFINDEX_PHYSINDEV, /* u_int32_t ifindex */ | ||
41 | NFQA_IFINDEX_PHYSOUTDEV, /* u_int32_t ifindex */ | ||
42 | NFQA_HWADDR, /* nfqnl_msg_packet_hw */ | ||
43 | NFQA_PAYLOAD, /* opaque data payload */ | ||
44 | |||
45 | __NFQA_MAX | ||
46 | }; | ||
47 | #define NFQA_MAX (__NFQA_MAX - 1) | ||
48 | |||
49 | struct nfqnl_msg_verdict_hdr { | ||
50 | u_int32_t verdict; | ||
51 | u_int32_t id; | ||
52 | } __attribute__ ((packed)); | ||
53 | |||
54 | |||
55 | enum nfqnl_msg_config_cmds { | ||
56 | NFQNL_CFG_CMD_NONE, | ||
57 | NFQNL_CFG_CMD_BIND, | ||
58 | NFQNL_CFG_CMD_UNBIND, | ||
59 | NFQNL_CFG_CMD_PF_BIND, | ||
60 | NFQNL_CFG_CMD_PF_UNBIND, | ||
61 | }; | ||
62 | |||
63 | struct nfqnl_msg_config_cmd { | ||
64 | u_int8_t command; /* nfqnl_msg_config_cmds */ | ||
65 | u_int8_t _pad; | ||
66 | u_int16_t pf; /* AF_xxx for PF_[UN]BIND */ | ||
67 | } __attribute__ ((packed)); | ||
68 | |||
69 | enum nfqnl_config_mode { | ||
70 | NFQNL_COPY_NONE, | ||
71 | NFQNL_COPY_META, | ||
72 | NFQNL_COPY_PACKET, | ||
73 | }; | ||
74 | |||
75 | struct nfqnl_msg_config_params { | ||
76 | u_int32_t copy_range; | ||
77 | u_int8_t copy_mode; /* enum nfqnl_config_mode */ | ||
78 | } __attribute__ ((packed)); | ||
79 | |||
80 | |||
81 | enum nfqnl_attr_config { | ||
82 | NFQA_CFG_UNSPEC, | ||
83 | NFQA_CFG_CMD, /* nfqnl_msg_config_cmd */ | ||
84 | NFQA_CFG_PARAMS, /* nfqnl_msg_config_params */ | ||
85 | __NFQA_CFG_MAX | ||
86 | }; | ||
87 | #define NFQA_CFG_MAX (__NFQA_CFG_MAX-1) | ||
88 | |||
89 | #endif /* _NFNETLINK_QUEUE_H */ | ||
diff --git a/include/linux/netfilter_decnet.h b/include/linux/netfilter_decnet.h index 3064eec9cb8e..6f425369ee29 100644 --- a/include/linux/netfilter_decnet.h +++ b/include/linux/netfilter_decnet.h | |||
@@ -9,6 +9,8 @@ | |||
9 | 9 | ||
10 | #include <linux/netfilter.h> | 10 | #include <linux/netfilter.h> |
11 | 11 | ||
12 | /* only for userspace compatibility */ | ||
13 | #ifndef __KERNEL__ | ||
12 | /* IP Cache bits. */ | 14 | /* IP Cache bits. */ |
13 | /* Src IP address. */ | 15 | /* Src IP address. */ |
14 | #define NFC_DN_SRC 0x0001 | 16 | #define NFC_DN_SRC 0x0001 |
@@ -18,6 +20,7 @@ | |||
18 | #define NFC_DN_IF_IN 0x0004 | 20 | #define NFC_DN_IF_IN 0x0004 |
19 | /* Output device. */ | 21 | /* Output device. */ |
20 | #define NFC_DN_IF_OUT 0x0008 | 22 | #define NFC_DN_IF_OUT 0x0008 |
23 | #endif /* ! __KERNEL__ */ | ||
21 | 24 | ||
22 | /* DECnet Hooks */ | 25 | /* DECnet Hooks */ |
23 | /* After promisc drops, checksum checks. */ | 26 | /* After promisc drops, checksum checks. */ |
@@ -53,7 +56,21 @@ struct nf_dn_rtmsg { | |||
53 | 56 | ||
54 | #define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg))) | 57 | #define NFDN_RTMSG(r) ((unsigned char *)(r) + NLMSG_ALIGN(sizeof(struct nf_dn_rtmsg))) |
55 | 58 | ||
59 | #ifndef __KERNEL__ | ||
60 | /* backwards compatibility for userspace */ | ||
56 | #define DNRMG_L1_GROUP 0x01 | 61 | #define DNRMG_L1_GROUP 0x01 |
57 | #define DNRMG_L2_GROUP 0x02 | 62 | #define DNRMG_L2_GROUP 0x02 |
63 | #endif | ||
64 | |||
65 | enum { | ||
66 | DNRNG_NLGRP_NONE, | ||
67 | #define DNRNG_NLGRP_NONE DNRNG_NLGRP_NONE | ||
68 | DNRNG_NLGRP_L1, | ||
69 | #define DNRNG_NLGRP_L1 DNRNG_NLGRP_L1 | ||
70 | DNRNG_NLGRP_L2, | ||
71 | #define DNRNG_NLGRP_L2 DNRNG_NLGRP_L2 | ||
72 | __DNRNG_NLGRP_MAX | ||
73 | }; | ||
74 | #define DNRNG_NLGRP_MAX (__DNRNG_NLGRP_MAX - 1) | ||
58 | 75 | ||
59 | #endif /*__LINUX_DECNET_NETFILTER_H*/ | 76 | #endif /*__LINUX_DECNET_NETFILTER_H*/ |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index 3ebc36afae1a..fdc4a9527343 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -8,6 +8,8 @@ | |||
8 | #include <linux/config.h> | 8 | #include <linux/config.h> |
9 | #include <linux/netfilter.h> | 9 | #include <linux/netfilter.h> |
10 | 10 | ||
11 | /* only for userspace compatibility */ | ||
12 | #ifndef __KERNEL__ | ||
11 | /* IP Cache bits. */ | 13 | /* IP Cache bits. */ |
12 | /* Src IP address. */ | 14 | /* Src IP address. */ |
13 | #define NFC_IP_SRC 0x0001 | 15 | #define NFC_IP_SRC 0x0001 |
@@ -35,6 +37,7 @@ | |||
35 | #define NFC_IP_DST_PT 0x0400 | 37 | #define NFC_IP_DST_PT 0x0400 |
36 | /* Something else about the proto */ | 38 | /* Something else about the proto */ |
37 | #define NFC_IP_PROTO_UNKNOWN 0x2000 | 39 | #define NFC_IP_PROTO_UNKNOWN 0x2000 |
40 | #endif /* ! __KERNEL__ */ | ||
38 | 41 | ||
39 | /* IP Hooks */ | 42 | /* IP Hooks */ |
40 | /* After promisc drops, checksum checks. */ | 43 | /* After promisc drops, checksum checks. */ |
@@ -77,11 +80,6 @@ enum nf_ip_hook_priorities { | |||
77 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
78 | extern int ip_route_me_harder(struct sk_buff **pskb); | 81 | extern int ip_route_me_harder(struct sk_buff **pskb); |
79 | 82 | ||
80 | /* Call this before modifying an existing IP packet: ensures it is | ||
81 | modifiable and linear to the point you care about (writable_len). | ||
82 | Returns true or false. */ | ||
83 | extern int skb_ip_make_writable(struct sk_buff **pskb, | ||
84 | unsigned int writable_len); | ||
85 | #endif /*__KERNEL__*/ | 83 | #endif /*__KERNEL__*/ |
86 | 84 | ||
87 | #endif /*__LINUX_IP_NETFILTER_H*/ | 85 | #endif /*__LINUX_IP_NETFILTER_H*/ |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 08fe5f7d14a0..7e033e9271a8 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -65,6 +65,63 @@ enum ip_conntrack_status { | |||
65 | 65 | ||
66 | /* Both together */ | 66 | /* Both together */ |
67 | IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE), | 67 | IPS_NAT_DONE_MASK = (IPS_DST_NAT_DONE | IPS_SRC_NAT_DONE), |
68 | |||
69 | /* Connection is dying (removed from lists), can not be unset. */ | ||
70 | IPS_DYING_BIT = 9, | ||
71 | IPS_DYING = (1 << IPS_DYING_BIT), | ||
72 | }; | ||
73 | |||
74 | /* Connection tracking event bits */ | ||
75 | enum ip_conntrack_events | ||
76 | { | ||
77 | /* New conntrack */ | ||
78 | IPCT_NEW_BIT = 0, | ||
79 | IPCT_NEW = (1 << IPCT_NEW_BIT), | ||
80 | |||
81 | /* Expected connection */ | ||
82 | IPCT_RELATED_BIT = 1, | ||
83 | IPCT_RELATED = (1 << IPCT_RELATED_BIT), | ||
84 | |||
85 | /* Destroyed conntrack */ | ||
86 | IPCT_DESTROY_BIT = 2, | ||
87 | IPCT_DESTROY = (1 << IPCT_DESTROY_BIT), | ||
88 | |||
89 | /* Timer has been refreshed */ | ||
90 | IPCT_REFRESH_BIT = 3, | ||
91 | IPCT_REFRESH = (1 << IPCT_REFRESH_BIT), | ||
92 | |||
93 | /* Status has changed */ | ||
94 | IPCT_STATUS_BIT = 4, | ||
95 | IPCT_STATUS = (1 << IPCT_STATUS_BIT), | ||
96 | |||
97 | /* Update of protocol info */ | ||
98 | IPCT_PROTOINFO_BIT = 5, | ||
99 | IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT), | ||
100 | |||
101 | /* Volatile protocol info */ | ||
102 | IPCT_PROTOINFO_VOLATILE_BIT = 6, | ||
103 | IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT), | ||
104 | |||
105 | /* New helper for conntrack */ | ||
106 | IPCT_HELPER_BIT = 7, | ||
107 | IPCT_HELPER = (1 << IPCT_HELPER_BIT), | ||
108 | |||
109 | /* Update of helper info */ | ||
110 | IPCT_HELPINFO_BIT = 8, | ||
111 | IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT), | ||
112 | |||
113 | /* Volatile helper info */ | ||
114 | IPCT_HELPINFO_VOLATILE_BIT = 9, | ||
115 | IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT), | ||
116 | |||
117 | /* NAT info */ | ||
118 | IPCT_NATINFO_BIT = 10, | ||
119 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | ||
120 | }; | ||
121 | |||
122 | enum ip_conntrack_expect_events { | ||
123 | IPEXP_NEW_BIT = 0, | ||
124 | IPEXP_NEW = (1 << IPEXP_NEW_BIT), | ||
68 | }; | 125 | }; |
69 | 126 | ||
70 | #ifdef __KERNEL__ | 127 | #ifdef __KERNEL__ |
@@ -152,6 +209,9 @@ struct ip_conntrack | |||
152 | /* Current number of expected connections */ | 209 | /* Current number of expected connections */ |
153 | unsigned int expecting; | 210 | unsigned int expecting; |
154 | 211 | ||
212 | /* Unique ID that identifies this conntrack*/ | ||
213 | unsigned int id; | ||
214 | |||
155 | /* Helper, if any. */ | 215 | /* Helper, if any. */ |
156 | struct ip_conntrack_helper *helper; | 216 | struct ip_conntrack_helper *helper; |
157 | 217 | ||
@@ -171,7 +231,7 @@ struct ip_conntrack | |||
171 | #endif /* CONFIG_IP_NF_NAT_NEEDED */ | 231 | #endif /* CONFIG_IP_NF_NAT_NEEDED */ |
172 | 232 | ||
173 | #if defined(CONFIG_IP_NF_CONNTRACK_MARK) | 233 | #if defined(CONFIG_IP_NF_CONNTRACK_MARK) |
174 | unsigned long mark; | 234 | u_int32_t mark; |
175 | #endif | 235 | #endif |
176 | 236 | ||
177 | /* Traversed often, so hopefully in different cacheline to top */ | 237 | /* Traversed often, so hopefully in different cacheline to top */ |
@@ -200,6 +260,12 @@ struct ip_conntrack_expect | |||
200 | /* Usage count. */ | 260 | /* Usage count. */ |
201 | atomic_t use; | 261 | atomic_t use; |
202 | 262 | ||
263 | /* Unique ID */ | ||
264 | unsigned int id; | ||
265 | |||
266 | /* Flags */ | ||
267 | unsigned int flags; | ||
268 | |||
203 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 269 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
204 | /* This is the original per-proto part, used to map the | 270 | /* This is the original per-proto part, used to map the |
205 | * expected connection the way the recipient expects. */ | 271 | * expected connection the way the recipient expects. */ |
@@ -209,6 +275,8 @@ struct ip_conntrack_expect | |||
209 | #endif | 275 | #endif |
210 | }; | 276 | }; |
211 | 277 | ||
278 | #define IP_CT_EXPECT_PERMANENT 0x1 | ||
279 | |||
212 | static inline struct ip_conntrack * | 280 | static inline struct ip_conntrack * |
213 | tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) | 281 | tuplehash_to_ctrack(const struct ip_conntrack_tuple_hash *hash) |
214 | { | 282 | { |
@@ -239,7 +307,12 @@ ip_conntrack_get(const struct sk_buff *skb, enum ip_conntrack_info *ctinfo) | |||
239 | } | 307 | } |
240 | 308 | ||
241 | /* decrement reference count on a conntrack */ | 309 | /* decrement reference count on a conntrack */ |
242 | extern void ip_conntrack_put(struct ip_conntrack *ct); | 310 | static inline void |
311 | ip_conntrack_put(struct ip_conntrack *ct) | ||
312 | { | ||
313 | IP_NF_ASSERT(ct); | ||
314 | nf_conntrack_put(&ct->ct_general); | ||
315 | } | ||
243 | 316 | ||
244 | /* call to create an explicit dependency on ip_conntrack. */ | 317 | /* call to create an explicit dependency on ip_conntrack. */ |
245 | extern void need_ip_conntrack(void); | 318 | extern void need_ip_conntrack(void); |
@@ -274,12 +347,50 @@ extern void | |||
274 | ip_ct_iterate_cleanup(int (*iter)(struct ip_conntrack *i, void *data), | 347 | ip_ct_iterate_cleanup(int (*iter)(struct ip_conntrack *i, void *data), |
275 | void *data); | 348 | void *data); |
276 | 349 | ||
350 | extern struct ip_conntrack_helper * | ||
351 | __ip_conntrack_helper_find_byname(const char *); | ||
352 | extern struct ip_conntrack_helper * | ||
353 | ip_conntrack_helper_find_get(const struct ip_conntrack_tuple *tuple); | ||
354 | extern void ip_conntrack_helper_put(struct ip_conntrack_helper *helper); | ||
355 | |||
356 | extern struct ip_conntrack_protocol * | ||
357 | __ip_conntrack_proto_find(u_int8_t protocol); | ||
358 | extern struct ip_conntrack_protocol * | ||
359 | ip_conntrack_proto_find_get(u_int8_t protocol); | ||
360 | extern void ip_conntrack_proto_put(struct ip_conntrack_protocol *proto); | ||
361 | |||
362 | extern void ip_ct_remove_expectations(struct ip_conntrack *ct); | ||
363 | |||
364 | extern struct ip_conntrack *ip_conntrack_alloc(struct ip_conntrack_tuple *, | ||
365 | struct ip_conntrack_tuple *); | ||
366 | |||
367 | extern void ip_conntrack_free(struct ip_conntrack *ct); | ||
368 | |||
369 | extern void ip_conntrack_hash_insert(struct ip_conntrack *ct); | ||
370 | |||
371 | extern struct ip_conntrack_expect * | ||
372 | __ip_conntrack_expect_find(const struct ip_conntrack_tuple *tuple); | ||
373 | |||
374 | extern struct ip_conntrack_expect * | ||
375 | ip_conntrack_expect_find_get(const struct ip_conntrack_tuple *tuple); | ||
376 | |||
377 | extern struct ip_conntrack_tuple_hash * | ||
378 | __ip_conntrack_find(const struct ip_conntrack_tuple *tuple, | ||
379 | const struct ip_conntrack *ignored_conntrack); | ||
380 | |||
381 | extern void ip_conntrack_flush(void); | ||
382 | |||
277 | /* It's confirmed if it is, or has been in the hash table. */ | 383 | /* It's confirmed if it is, or has been in the hash table. */ |
278 | static inline int is_confirmed(struct ip_conntrack *ct) | 384 | static inline int is_confirmed(struct ip_conntrack *ct) |
279 | { | 385 | { |
280 | return test_bit(IPS_CONFIRMED_BIT, &ct->status); | 386 | return test_bit(IPS_CONFIRMED_BIT, &ct->status); |
281 | } | 387 | } |
282 | 388 | ||
389 | static inline int is_dying(struct ip_conntrack *ct) | ||
390 | { | ||
391 | return test_bit(IPS_DYING_BIT, &ct->status); | ||
392 | } | ||
393 | |||
283 | extern unsigned int ip_conntrack_htable_size; | 394 | extern unsigned int ip_conntrack_htable_size; |
284 | 395 | ||
285 | struct ip_conntrack_stat | 396 | struct ip_conntrack_stat |
@@ -303,6 +414,85 @@ struct ip_conntrack_stat | |||
303 | 414 | ||
304 | #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) | 415 | #define CONNTRACK_STAT_INC(count) (__get_cpu_var(ip_conntrack_stat).count++) |
305 | 416 | ||
417 | #ifdef CONFIG_IP_NF_CONNTRACK_EVENTS | ||
418 | #include <linux/notifier.h> | ||
419 | #include <linux/interrupt.h> | ||
420 | |||
421 | struct ip_conntrack_ecache { | ||
422 | struct ip_conntrack *ct; | ||
423 | unsigned int events; | ||
424 | }; | ||
425 | DECLARE_PER_CPU(struct ip_conntrack_ecache, ip_conntrack_ecache); | ||
426 | |||
427 | #define CONNTRACK_ECACHE(x) (__get_cpu_var(ip_conntrack_ecache).x) | ||
428 | |||
429 | extern struct notifier_block *ip_conntrack_chain; | ||
430 | extern struct notifier_block *ip_conntrack_expect_chain; | ||
431 | |||
432 | static inline int ip_conntrack_register_notifier(struct notifier_block *nb) | ||
433 | { | ||
434 | return notifier_chain_register(&ip_conntrack_chain, nb); | ||
435 | } | ||
436 | |||
437 | static inline int ip_conntrack_unregister_notifier(struct notifier_block *nb) | ||
438 | { | ||
439 | return notifier_chain_unregister(&ip_conntrack_chain, nb); | ||
440 | } | ||
441 | |||
442 | static inline int | ||
443 | ip_conntrack_expect_register_notifier(struct notifier_block *nb) | ||
444 | { | ||
445 | return notifier_chain_register(&ip_conntrack_expect_chain, nb); | ||
446 | } | ||
447 | |||
448 | static inline int | ||
449 | ip_conntrack_expect_unregister_notifier(struct notifier_block *nb) | ||
450 | { | ||
451 | return notifier_chain_unregister(&ip_conntrack_expect_chain, nb); | ||
452 | } | ||
453 | |||
454 | extern void ip_ct_deliver_cached_events(const struct ip_conntrack *ct); | ||
455 | extern void __ip_ct_event_cache_init(struct ip_conntrack *ct); | ||
456 | |||
457 | static inline void | ||
458 | ip_conntrack_event_cache(enum ip_conntrack_events event, | ||
459 | const struct sk_buff *skb) | ||
460 | { | ||
461 | struct ip_conntrack *ct = (struct ip_conntrack *)skb->nfct; | ||
462 | struct ip_conntrack_ecache *ecache; | ||
463 | |||
464 | local_bh_disable(); | ||
465 | ecache = &__get_cpu_var(ip_conntrack_ecache); | ||
466 | if (ct != ecache->ct) | ||
467 | __ip_ct_event_cache_init(ct); | ||
468 | ecache->events |= event; | ||
469 | local_bh_enable(); | ||
470 | } | ||
471 | |||
472 | static inline void ip_conntrack_event(enum ip_conntrack_events event, | ||
473 | struct ip_conntrack *ct) | ||
474 | { | ||
475 | if (is_confirmed(ct) && !is_dying(ct)) | ||
476 | notifier_call_chain(&ip_conntrack_chain, event, ct); | ||
477 | } | ||
478 | |||
479 | static inline void | ||
480 | ip_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
481 | struct ip_conntrack_expect *exp) | ||
482 | { | ||
483 | notifier_call_chain(&ip_conntrack_expect_chain, event, exp); | ||
484 | } | ||
485 | #else /* CONFIG_IP_NF_CONNTRACK_EVENTS */ | ||
486 | static inline void ip_conntrack_event_cache(enum ip_conntrack_events event, | ||
487 | const struct sk_buff *skb) {} | ||
488 | static inline void ip_conntrack_event(enum ip_conntrack_events event, | ||
489 | struct ip_conntrack *ct) {} | ||
490 | static inline void ip_ct_deliver_cached_events(const struct ip_conntrack *ct) {} | ||
491 | static inline void | ||
492 | ip_conntrack_expect_event(enum ip_conntrack_expect_events event, | ||
493 | struct ip_conntrack_expect *exp) {} | ||
494 | #endif /* CONFIG_IP_NF_CONNTRACK_EVENTS */ | ||
495 | |||
306 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 496 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
307 | static inline int ip_nat_initialized(struct ip_conntrack *conntrack, | 497 | static inline int ip_nat_initialized(struct ip_conntrack *conntrack, |
308 | enum ip_nat_manip_type manip) | 498 | enum ip_nat_manip_type manip) |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_core.h b/include/linux/netfilter_ipv4/ip_conntrack_core.h index 694aec9b4784..907d4f5ca5dc 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_core.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_core.h | |||
@@ -2,6 +2,9 @@ | |||
2 | #define _IP_CONNTRACK_CORE_H | 2 | #define _IP_CONNTRACK_CORE_H |
3 | #include <linux/netfilter.h> | 3 | #include <linux/netfilter.h> |
4 | 4 | ||
5 | #define MAX_IP_CT_PROTO 256 | ||
6 | extern struct ip_conntrack_protocol *ip_ct_protos[MAX_IP_CT_PROTO]; | ||
7 | |||
5 | /* This header is used to share core functionality between the | 8 | /* This header is used to share core functionality between the |
6 | standalone connection tracking module, and the compatibility layer's use | 9 | standalone connection tracking module, and the compatibility layer's use |
7 | of connection tracking. */ | 10 | of connection tracking. */ |
@@ -38,12 +41,19 @@ extern int __ip_conntrack_confirm(struct sk_buff **pskb); | |||
38 | /* Confirm a connection: returns NF_DROP if packet must be dropped. */ | 41 | /* Confirm a connection: returns NF_DROP if packet must be dropped. */ |
39 | static inline int ip_conntrack_confirm(struct sk_buff **pskb) | 42 | static inline int ip_conntrack_confirm(struct sk_buff **pskb) |
40 | { | 43 | { |
41 | if ((*pskb)->nfct | 44 | struct ip_conntrack *ct = (struct ip_conntrack *)(*pskb)->nfct; |
42 | && !is_confirmed((struct ip_conntrack *)(*pskb)->nfct)) | 45 | int ret = NF_ACCEPT; |
43 | return __ip_conntrack_confirm(pskb); | 46 | |
44 | return NF_ACCEPT; | 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; | ||
45 | } | 53 | } |
46 | 54 | ||
55 | extern void ip_ct_unlink_expect(struct ip_conntrack_expect *exp); | ||
56 | |||
47 | extern struct list_head *ip_conntrack_hash; | 57 | extern struct list_head *ip_conntrack_hash; |
48 | extern struct list_head ip_conntrack_expect_list; | 58 | extern struct list_head ip_conntrack_expect_list; |
49 | extern rwlock_t ip_conntrack_lock; | 59 | extern rwlock_t ip_conntrack_lock; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper.h b/include/linux/netfilter_ipv4/ip_conntrack_helper.h index 3692daa93dec..8d69279ccfe4 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_helper.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_helper.h | |||
@@ -24,6 +24,8 @@ struct ip_conntrack_helper | |||
24 | int (*help)(struct sk_buff **pskb, | 24 | int (*help)(struct sk_buff **pskb, |
25 | struct ip_conntrack *ct, | 25 | struct ip_conntrack *ct, |
26 | enum ip_conntrack_info conntrackinfo); | 26 | enum ip_conntrack_info conntrackinfo); |
27 | |||
28 | int (*to_nfattr)(struct sk_buff *skb, const struct ip_conntrack *ct); | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | extern int ip_conntrack_helper_register(struct ip_conntrack_helper *); | 31 | extern int ip_conntrack_helper_register(struct ip_conntrack_helper *); |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h index e20b57c5e1b7..b6b99be8632a 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_protocol.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_protocol.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #ifndef _IP_CONNTRACK_PROTOCOL_H | 2 | #ifndef _IP_CONNTRACK_PROTOCOL_H |
3 | #define _IP_CONNTRACK_PROTOCOL_H | 3 | #define _IP_CONNTRACK_PROTOCOL_H |
4 | #include <linux/netfilter_ipv4/ip_conntrack.h> | 4 | #include <linux/netfilter_ipv4/ip_conntrack.h> |
5 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
5 | 6 | ||
6 | struct seq_file; | 7 | struct seq_file; |
7 | 8 | ||
@@ -47,22 +48,22 @@ struct ip_conntrack_protocol | |||
47 | int (*error)(struct sk_buff *skb, enum ip_conntrack_info *ctinfo, | 48 | int (*error)(struct sk_buff *skb, enum ip_conntrack_info *ctinfo, |
48 | unsigned int hooknum); | 49 | unsigned int hooknum); |
49 | 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 | int (*tuple_to_nfattr)(struct sk_buff *skb, | ||
56 | const struct ip_conntrack_tuple *t); | ||
57 | int (*nfattr_to_tuple)(struct nfattr *tb[], | ||
58 | struct ip_conntrack_tuple *t); | ||
59 | |||
50 | /* Module (if any) which this is connected to. */ | 60 | /* Module (if any) which this is connected to. */ |
51 | struct module *me; | 61 | struct module *me; |
52 | }; | 62 | }; |
53 | 63 | ||
54 | #define MAX_IP_CT_PROTO 256 | ||
55 | extern struct ip_conntrack_protocol *ip_ct_protos[MAX_IP_CT_PROTO]; | ||
56 | |||
57 | /* Protocol registration. */ | 64 | /* Protocol registration. */ |
58 | extern int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto); | 65 | extern int ip_conntrack_protocol_register(struct ip_conntrack_protocol *proto); |
59 | extern void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto); | 66 | extern void ip_conntrack_protocol_unregister(struct ip_conntrack_protocol *proto); |
60 | |||
61 | static inline struct ip_conntrack_protocol *ip_ct_find_proto(u_int8_t protocol) | ||
62 | { | ||
63 | return ip_ct_protos[protocol]; | ||
64 | } | ||
65 | |||
66 | /* Existing built-in protocols */ | 67 | /* Existing built-in protocols */ |
67 | extern struct ip_conntrack_protocol ip_conntrack_protocol_tcp; | 68 | extern struct ip_conntrack_protocol ip_conntrack_protocol_tcp; |
68 | extern struct ip_conntrack_protocol ip_conntrack_protocol_udp; | 69 | extern struct ip_conntrack_protocol ip_conntrack_protocol_udp; |
@@ -73,6 +74,11 @@ extern int ip_conntrack_protocol_tcp_init(void); | |||
73 | /* Log invalid packets */ | 74 | /* Log invalid packets */ |
74 | extern unsigned int ip_ct_log_invalid; | 75 | extern unsigned int ip_ct_log_invalid; |
75 | 76 | ||
77 | extern int ip_ct_port_tuple_to_nfattr(struct sk_buff *, | ||
78 | const struct ip_conntrack_tuple *); | ||
79 | extern int ip_ct_port_nfattr_to_tuple(struct nfattr *tb[], | ||
80 | struct ip_conntrack_tuple *); | ||
81 | |||
76 | #ifdef CONFIG_SYSCTL | 82 | #ifdef CONFIG_SYSCTL |
77 | #ifdef DEBUG_INVALID_PACKETS | 83 | #ifdef DEBUG_INVALID_PACKETS |
78 | #define LOG_INVALID(proto) \ | 84 | #define LOG_INVALID(proto) \ |
diff --git a/include/linux/netfilter_ipv4/ip_logging.h b/include/linux/netfilter_ipv4/ip_logging.h deleted file mode 100644 index 0c5c52cb6589..000000000000 --- a/include/linux/netfilter_ipv4/ip_logging.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* IPv4 macros for the internal logging interface. */ | ||
2 | #ifndef __IP_LOGGING_H | ||
3 | #define __IP_LOGGING_H | ||
4 | |||
5 | #ifdef __KERNEL__ | ||
6 | #include <linux/socket.h> | ||
7 | #include <linux/netfilter_logging.h> | ||
8 | |||
9 | #define nf_log_ip_packet(pskb,hooknum,in,out,fmt,args...) \ | ||
10 | nf_log_packet(AF_INET,pskb,hooknum,in,out,fmt,##args) | ||
11 | |||
12 | #define nf_log_ip(pfh,len,fmt,args...) \ | ||
13 | nf_log(AF_INET,pfh,len,fmt,##args) | ||
14 | |||
15 | #define nf_ip_log_register(logging) nf_log_register(AF_INET,logging) | ||
16 | #define nf_ip_log_unregister(logging) nf_log_unregister(AF_INET,logging) | ||
17 | |||
18 | #endif /*__KERNEL__*/ | ||
19 | |||
20 | #endif /*__IP_LOGGING_H*/ | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat_protocol.h b/include/linux/netfilter_ipv4/ip_nat_protocol.h index 129708c22386..ef63aa991a06 100644 --- a/include/linux/netfilter_ipv4/ip_nat_protocol.h +++ b/include/linux/netfilter_ipv4/ip_nat_protocol.h | |||
@@ -4,6 +4,9 @@ | |||
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | #include <linux/list.h> | 5 | #include <linux/list.h> |
6 | 6 | ||
7 | #include <linux/netfilter_ipv4/ip_nat.h> | ||
8 | #include <linux/netfilter/nfnetlink_conntrack.h> | ||
9 | |||
7 | struct iphdr; | 10 | struct iphdr; |
8 | struct ip_nat_range; | 11 | struct ip_nat_range; |
9 | 12 | ||
@@ -15,6 +18,8 @@ struct ip_nat_protocol | |||
15 | /* Protocol number. */ | 18 | /* Protocol number. */ |
16 | unsigned int protonum; | 19 | unsigned int protonum; |
17 | 20 | ||
21 | struct module *me; | ||
22 | |||
18 | /* Translate a packet to the target according to manip type. | 23 | /* Translate a packet to the target according to manip type. |
19 | Return true if succeeded. */ | 24 | Return true if succeeded. */ |
20 | int (*manip_pkt)(struct sk_buff **pskb, | 25 | int (*manip_pkt)(struct sk_buff **pskb, |
@@ -43,19 +48,20 @@ struct ip_nat_protocol | |||
43 | 48 | ||
44 | unsigned int (*print_range)(char *buffer, | 49 | unsigned int (*print_range)(char *buffer, |
45 | const struct ip_nat_range *range); | 50 | const struct ip_nat_range *range); |
46 | }; | ||
47 | 51 | ||
48 | #define MAX_IP_NAT_PROTO 256 | 52 | int (*range_to_nfattr)(struct sk_buff *skb, |
49 | extern struct ip_nat_protocol *ip_nat_protos[MAX_IP_NAT_PROTO]; | 53 | const struct ip_nat_range *range); |
54 | |||
55 | int (*nfattr_to_range)(struct nfattr *tb[], | ||
56 | struct ip_nat_range *range); | ||
57 | }; | ||
50 | 58 | ||
51 | /* Protocol registration. */ | 59 | /* Protocol registration. */ |
52 | extern int ip_nat_protocol_register(struct ip_nat_protocol *proto); | 60 | extern int ip_nat_protocol_register(struct ip_nat_protocol *proto); |
53 | extern void ip_nat_protocol_unregister(struct ip_nat_protocol *proto); | 61 | extern void ip_nat_protocol_unregister(struct ip_nat_protocol *proto); |
54 | 62 | ||
55 | static inline struct ip_nat_protocol *ip_nat_find_proto(u_int8_t protocol) | 63 | extern struct ip_nat_protocol *ip_nat_proto_find_get(u_int8_t protocol); |
56 | { | 64 | extern void ip_nat_proto_put(struct ip_nat_protocol *proto); |
57 | return ip_nat_protos[protocol]; | ||
58 | } | ||
59 | 65 | ||
60 | /* Built-in protocols. */ | 66 | /* Built-in protocols. */ |
61 | extern struct ip_nat_protocol ip_nat_protocol_tcp; | 67 | extern struct ip_nat_protocol ip_nat_protocol_tcp; |
@@ -67,4 +73,9 @@ extern int init_protocols(void) __init; | |||
67 | extern void cleanup_protocols(void); | 73 | extern void cleanup_protocols(void); |
68 | extern struct ip_nat_protocol *find_nat_proto(u_int16_t protonum); | 74 | extern struct ip_nat_protocol *find_nat_proto(u_int16_t protonum); |
69 | 75 | ||
76 | extern int ip_nat_port_range_to_nfattr(struct sk_buff *skb, | ||
77 | const struct ip_nat_range *range); | ||
78 | extern int ip_nat_port_nfattr_to_range(struct nfattr *tb[], | ||
79 | struct ip_nat_range *range); | ||
80 | |||
70 | #endif /*_IP_NAT_PROTO_H*/ | 81 | #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 index fecd2a06dcd8..73b9552e6a89 100644 --- a/include/linux/netfilter_ipv4/ip_nat_rule.h +++ b/include/linux/netfilter_ipv4/ip_nat_rule.h | |||
@@ -19,5 +19,10 @@ extern unsigned int | |||
19 | alloc_null_binding(struct ip_conntrack *conntrack, | 19 | alloc_null_binding(struct ip_conntrack *conntrack, |
20 | struct ip_nat_info *info, | 20 | struct ip_nat_info *info, |
21 | unsigned int hooknum); | 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); | ||
22 | #endif | 27 | #endif |
23 | #endif /* _IP_NAT_RULE_H */ | 28 | #endif /* _IP_NAT_RULE_H */ |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 12ce47808e7d..d19d65cf4530 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -109,7 +109,8 @@ struct ipt_counters | |||
109 | 109 | ||
110 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ | 110 | /* Values for "flag" field in struct ipt_ip (general ip structure). */ |
111 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ | 111 | #define IPT_F_FRAG 0x01 /* Set if rule is a fragment rule */ |
112 | #define IPT_F_MASK 0x01 /* All possible flag bits mask. */ | 112 | #define IPT_F_GOTO 0x02 /* Set if jump is a goto */ |
113 | #define IPT_F_MASK 0x03 /* All possible flag bits mask. */ | ||
113 | 114 | ||
114 | /* Values for "inv" field in struct ipt_ip. */ | 115 | /* Values for "inv" field in struct ipt_ip. */ |
115 | #define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ | 116 | #define IPT_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ |
diff --git a/include/linux/netfilter_ipv4/ipt_LOG.h b/include/linux/netfilter_ipv4/ipt_LOG.h index d25f782e57d1..22d16177319b 100644 --- a/include/linux/netfilter_ipv4/ipt_LOG.h +++ b/include/linux/netfilter_ipv4/ipt_LOG.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _IPT_LOG_H | 1 | #ifndef _IPT_LOG_H |
2 | #define _IPT_LOG_H | 2 | #define _IPT_LOG_H |
3 | 3 | ||
4 | /* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */ | ||
4 | #define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ | 5 | #define IPT_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ |
5 | #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ | 6 | #define IPT_LOG_TCPOPT 0x02 /* Log TCP options */ |
6 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IPT_LOG_IPOPT 0x04 /* Log IP options */ |
diff --git a/include/linux/netfilter_ipv4/ipt_NFQUEUE.h b/include/linux/netfilter_ipv4/ipt_NFQUEUE.h new file mode 100644 index 000000000000..b5b2943b0c66 --- /dev/null +++ b/include/linux/netfilter_ipv4/ipt_NFQUEUE.h | |||
@@ -0,0 +1,16 @@ | |||
1 | /* iptables module for using NFQUEUE mechanism | ||
2 | * | ||
3 | * (C) 2005 Harald Welte <laforge@netfilter.org> | ||
4 | * | ||
5 | * This software is distributed under GNU GPL v2, 1991 | ||
6 | * | ||
7 | */ | ||
8 | #ifndef _IPT_NFQ_TARGET_H | ||
9 | #define _IPT_NFQ_TARGET_H | ||
10 | |||
11 | /* target info */ | ||
12 | struct ipt_NFQ_info { | ||
13 | u_int16_t queuenum; | ||
14 | }; | ||
15 | |||
16 | #endif /* _IPT_DSCP_TARGET_H */ | ||
diff --git a/include/linux/netfilter_ipv4/ipt_TTL.h b/include/linux/netfilter_ipv4/ipt_TTL.h new file mode 100644 index 000000000000..ee6611edc112 --- /dev/null +++ b/include/linux/netfilter_ipv4/ipt_TTL.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* TTL modification module for IP tables | ||
2 | * (C) 2000 by Harald Welte <laforge@netfilter.org> */ | ||
3 | |||
4 | #ifndef _IPT_TTL_H | ||
5 | #define _IPT_TTL_H | ||
6 | |||
7 | enum { | ||
8 | IPT_TTL_SET = 0, | ||
9 | IPT_TTL_INC, | ||
10 | IPT_TTL_DEC | ||
11 | }; | ||
12 | |||
13 | #define IPT_TTL_MAXMODE IPT_TTL_DEC | ||
14 | |||
15 | struct ipt_TTL_info { | ||
16 | u_int8_t mode; | ||
17 | u_int8_t ttl; | ||
18 | }; | ||
19 | |||
20 | |||
21 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ipt_connbytes.h b/include/linux/netfilter_ipv4/ipt_connbytes.h new file mode 100644 index 000000000000..9e5532f8d8ac --- /dev/null +++ b/include/linux/netfilter_ipv4/ipt_connbytes.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef _IPT_CONNBYTES_H | ||
2 | #define _IPT_CONNBYTES_H | ||
3 | |||
4 | enum ipt_connbytes_what { | ||
5 | IPT_CONNBYTES_PKTS, | ||
6 | IPT_CONNBYTES_BYTES, | ||
7 | IPT_CONNBYTES_AVGPKT, | ||
8 | }; | ||
9 | |||
10 | enum ipt_connbytes_direction { | ||
11 | IPT_CONNBYTES_DIR_ORIGINAL, | ||
12 | IPT_CONNBYTES_DIR_REPLY, | ||
13 | IPT_CONNBYTES_DIR_BOTH, | ||
14 | }; | ||
15 | |||
16 | struct ipt_connbytes_info | ||
17 | { | ||
18 | struct { | ||
19 | aligned_u64 from; /* count to be matched */ | ||
20 | aligned_u64 to; /* count to be matched */ | ||
21 | } count; | ||
22 | u_int8_t what; /* ipt_connbytes_what */ | ||
23 | u_int8_t direction; /* ipt_connbytes_direction */ | ||
24 | }; | ||
25 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ipt_dccp.h b/include/linux/netfilter_ipv4/ipt_dccp.h new file mode 100644 index 000000000000..3cb3a522e62b --- /dev/null +++ b/include/linux/netfilter_ipv4/ipt_dccp.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _IPT_DCCP_H_ | ||
2 | #define _IPT_DCCP_H_ | ||
3 | |||
4 | #define IPT_DCCP_SRC_PORTS 0x01 | ||
5 | #define IPT_DCCP_DEST_PORTS 0x02 | ||
6 | #define IPT_DCCP_TYPE 0x04 | ||
7 | #define IPT_DCCP_OPTION 0x08 | ||
8 | |||
9 | #define IPT_DCCP_VALID_FLAGS 0x0f | ||
10 | |||
11 | struct ipt_dccp_info { | ||
12 | u_int16_t dpts[2]; /* Min, Max */ | ||
13 | u_int16_t spts[2]; /* Min, Max */ | ||
14 | |||
15 | u_int16_t flags; | ||
16 | u_int16_t invflags; | ||
17 | |||
18 | u_int16_t typemask; | ||
19 | u_int8_t option; | ||
20 | }; | ||
21 | |||
22 | #endif /* _IPT_DCCP_H_ */ | ||
23 | |||
diff --git a/include/linux/netfilter_ipv4/ipt_string.h b/include/linux/netfilter_ipv4/ipt_string.h new file mode 100644 index 000000000000..a265f6e44eab --- /dev/null +++ b/include/linux/netfilter_ipv4/ipt_string.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _IPT_STRING_H | ||
2 | #define _IPT_STRING_H | ||
3 | |||
4 | #define IPT_STRING_MAX_PATTERN_SIZE 128 | ||
5 | #define IPT_STRING_MAX_ALGO_NAME_SIZE 16 | ||
6 | |||
7 | struct ipt_string_info | ||
8 | { | ||
9 | u_int16_t from_offset; | ||
10 | u_int16_t to_offset; | ||
11 | char algo[IPT_STRING_MAX_ALGO_NAME_SIZE]; | ||
12 | char pattern[IPT_STRING_MAX_PATTERN_SIZE]; | ||
13 | u_int8_t patlen; | ||
14 | u_int8_t invert; | ||
15 | struct ts_config __attribute__((aligned(8))) *config; | ||
16 | }; | ||
17 | |||
18 | #endif /*_IPT_STRING_H*/ | ||
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h index bee7a5ec7c66..edcc2c6eb5c7 100644 --- a/include/linux/netfilter_ipv6.h +++ b/include/linux/netfilter_ipv6.h | |||
@@ -10,6 +10,8 @@ | |||
10 | 10 | ||
11 | #include <linux/netfilter.h> | 11 | #include <linux/netfilter.h> |
12 | 12 | ||
13 | /* only for userspace compatibility */ | ||
14 | #ifndef __KERNEL__ | ||
13 | /* IP Cache bits. */ | 15 | /* IP Cache bits. */ |
14 | /* Src IP address. */ | 16 | /* Src IP address. */ |
15 | #define NFC_IP6_SRC 0x0001 | 17 | #define NFC_IP6_SRC 0x0001 |
@@ -38,6 +40,7 @@ | |||
38 | #define NFC_IP6_DST_PT 0x0400 | 40 | #define NFC_IP6_DST_PT 0x0400 |
39 | /* Something else about the proto */ | 41 | /* Something else about the proto */ |
40 | #define NFC_IP6_PROTO_UNKNOWN 0x2000 | 42 | #define NFC_IP6_PROTO_UNKNOWN 0x2000 |
43 | #endif /* ! __KERNEL__ */ | ||
41 | 44 | ||
42 | 45 | ||
43 | /* IP6 Hooks */ | 46 | /* IP6 Hooks */ |
@@ -68,4 +71,7 @@ enum nf_ip6_hook_priorities { | |||
68 | NF_IP6_PRI_LAST = INT_MAX, | 71 | NF_IP6_PRI_LAST = INT_MAX, |
69 | }; | 72 | }; |
70 | 73 | ||
74 | extern int ipv6_netfilter_init(void); | ||
75 | extern void ipv6_netfilter_fini(void); | ||
76 | |||
71 | #endif /*__LINUX_IP6_NETFILTER_H*/ | 77 | #endif /*__LINUX_IP6_NETFILTER_H*/ |
diff --git a/include/linux/netfilter_ipv6/ip6_logging.h b/include/linux/netfilter_ipv6/ip6_logging.h deleted file mode 100644 index a0b2ee3043aa..000000000000 --- a/include/linux/netfilter_ipv6/ip6_logging.h +++ /dev/null | |||
@@ -1,20 +0,0 @@ | |||
1 | /* IPv6 macros for the nternal logging interface. */ | ||
2 | #ifndef __IP6_LOGGING_H | ||
3 | #define __IP6_LOGGING_H | ||
4 | |||
5 | #ifdef __KERNEL__ | ||
6 | #include <linux/socket.h> | ||
7 | #include <linux/netfilter_logging.h> | ||
8 | |||
9 | #define nf_log_ip6_packet(pskb,hooknum,in,out,fmt,args...) \ | ||
10 | nf_log_packet(AF_INET6,pskb,hooknum,in,out,fmt,##args) | ||
11 | |||
12 | #define nf_log_ip6(pfh,len,fmt,args...) \ | ||
13 | nf_log(AF_INET6,pfh,len,fmt,##args) | ||
14 | |||
15 | #define nf_ip6_log_register(logging) nf_log_register(AF_INET6,logging) | ||
16 | #define nf_ip6_log_unregister(logging) nf_log_unregister(AF_INET6,logging) | ||
17 | |||
18 | #endif /*__KERNEL__*/ | ||
19 | |||
20 | #endif /*__IP6_LOGGING_H*/ | ||
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index f1ce3b009853..58c72a52dc65 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -111,7 +111,8 @@ struct ip6t_counters | |||
111 | #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper | 111 | #define IP6T_F_PROTO 0x01 /* Set if rule cares about upper |
112 | protocols */ | 112 | protocols */ |
113 | #define IP6T_F_TOS 0x02 /* Match the TOS. */ | 113 | #define IP6T_F_TOS 0x02 /* Match the TOS. */ |
114 | #define IP6T_F_MASK 0x03 /* All possible flag bits mask. */ | 114 | #define IP6T_F_GOTO 0x04 /* Set if jump is a goto */ |
115 | #define IP6T_F_MASK 0x07 /* All possible flag bits mask. */ | ||
115 | 116 | ||
116 | /* Values for "inv" field in struct ip6t_ip6. */ | 117 | /* Values for "inv" field in struct ip6t_ip6. */ |
117 | #define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ | 118 | #define IP6T_INV_VIA_IN 0x01 /* Invert the sense of IN IFACE. */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_HL.h b/include/linux/netfilter_ipv6/ip6t_HL.h new file mode 100644 index 000000000000..afb7813d45ab --- /dev/null +++ b/include/linux/netfilter_ipv6/ip6t_HL.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* Hop Limit modification module for ip6tables | ||
2 | * Maciej Soltysiak <solt@dns.toxicfilms.tv> | ||
3 | * Based on HW's TTL module */ | ||
4 | |||
5 | #ifndef _IP6T_HL_H | ||
6 | #define _IP6T_HL_H | ||
7 | |||
8 | enum { | ||
9 | IP6T_HL_SET = 0, | ||
10 | IP6T_HL_INC, | ||
11 | IP6T_HL_DEC | ||
12 | }; | ||
13 | |||
14 | #define IP6T_HL_MAXMODE IP6T_HL_DEC | ||
15 | |||
16 | struct ip6t_HL_info { | ||
17 | u_int8_t mode; | ||
18 | u_int8_t hop_limit; | ||
19 | }; | ||
20 | |||
21 | |||
22 | #endif | ||
diff --git a/include/linux/netfilter_ipv6/ip6t_LOG.h b/include/linux/netfilter_ipv6/ip6t_LOG.h index 42996a43bb39..9008ff5c40ae 100644 --- a/include/linux/netfilter_ipv6/ip6t_LOG.h +++ b/include/linux/netfilter_ipv6/ip6t_LOG.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _IP6T_LOG_H | 1 | #ifndef _IP6T_LOG_H |
2 | #define _IP6T_LOG_H | 2 | #define _IP6T_LOG_H |
3 | 3 | ||
4 | /* make sure not to change this without changing netfilter.h:NF_LOG_* (!) */ | ||
4 | #define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ | 5 | #define IP6T_LOG_TCPSEQ 0x01 /* Log TCP sequence numbers */ |
5 | #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ | 6 | #define IP6T_LOG_TCPOPT 0x02 /* Log TCP options */ |
6 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ | 7 | #define IP6T_LOG_IPOPT 0x04 /* Log IP options */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_REJECT.h b/include/linux/netfilter_ipv6/ip6t_REJECT.h new file mode 100644 index 000000000000..6be6504162bb --- /dev/null +++ b/include/linux/netfilter_ipv6/ip6t_REJECT.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _IP6T_REJECT_H | ||
2 | #define _IP6T_REJECT_H | ||
3 | |||
4 | enum ip6t_reject_with { | ||
5 | IP6T_ICMP6_NO_ROUTE, | ||
6 | IP6T_ICMP6_ADM_PROHIBITED, | ||
7 | IP6T_ICMP6_NOT_NEIGHBOUR, | ||
8 | IP6T_ICMP6_ADDR_UNREACH, | ||
9 | IP6T_ICMP6_PORT_UNREACH, | ||
10 | IP6T_ICMP6_ECHOREPLY, | ||
11 | IP6T_TCP_RESET | ||
12 | }; | ||
13 | |||
14 | struct ip6t_reject_info { | ||
15 | u_int32_t with; /* reject type */ | ||
16 | }; | ||
17 | |||
18 | #endif /*_IP6T_REJECT_H*/ | ||
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 6552b71bfa73..167518668936 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #define NETLINK_W1 1 /* 1-wire subsystem */ | 8 | #define NETLINK_W1 1 /* 1-wire subsystem */ |
9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ | 9 | #define NETLINK_USERSOCK 2 /* Reserved for user mode socket protocols */ |
10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ | 10 | #define NETLINK_FIREWALL 3 /* Firewalling hook */ |
11 | #define NETLINK_TCPDIAG 4 /* TCP socket monitoring */ | 11 | #define NETLINK_INET_DIAG 4 /* INET socket monitoring */ |
12 | #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ | 12 | #define NETLINK_NFLOG 5 /* netfilter/iptables ULOG */ |
13 | #define NETLINK_XFRM 6 /* ipsec */ | 13 | #define NETLINK_XFRM 6 /* ipsec */ |
14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ | 14 | #define NETLINK_SELINUX 7 /* SELinux event notifications */ |
@@ -90,6 +90,15 @@ struct nlmsgerr | |||
90 | struct nlmsghdr msg; | 90 | struct nlmsghdr msg; |
91 | }; | 91 | }; |
92 | 92 | ||
93 | #define NETLINK_ADD_MEMBERSHIP 1 | ||
94 | #define NETLINK_DROP_MEMBERSHIP 2 | ||
95 | #define NETLINK_PKTINFO 3 | ||
96 | |||
97 | struct nl_pktinfo | ||
98 | { | ||
99 | __u32 group; | ||
100 | }; | ||
101 | |||
93 | #define NET_MAJOR 36 /* Major 36 is reserved for networking */ | 102 | #define NET_MAJOR 36 /* Major 36 is reserved for networking */ |
94 | 103 | ||
95 | enum { | 104 | enum { |
@@ -106,9 +115,8 @@ struct netlink_skb_parms | |||
106 | { | 115 | { |
107 | struct ucred creds; /* Skb credentials */ | 116 | struct ucred creds; /* Skb credentials */ |
108 | __u32 pid; | 117 | __u32 pid; |
109 | __u32 groups; | ||
110 | __u32 dst_pid; | 118 | __u32 dst_pid; |
111 | __u32 dst_groups; | 119 | __u32 dst_group; |
112 | kernel_cap_t eff_cap; | 120 | kernel_cap_t eff_cap; |
113 | __u32 loginuid; /* Login (audit) uid */ | 121 | __u32 loginuid; /* Login (audit) uid */ |
114 | }; | 122 | }; |
@@ -117,11 +125,11 @@ struct netlink_skb_parms | |||
117 | #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) | 125 | #define NETLINK_CREDS(skb) (&NETLINK_CB((skb)).creds) |
118 | 126 | ||
119 | 127 | ||
120 | extern struct sock *netlink_kernel_create(int unit, void (*input)(struct sock *sk, int len)); | 128 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); |
121 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 129 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
122 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 130 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
123 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 131 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
124 | __u32 group, int allocation); | 132 | __u32 group, unsigned int __nocast allocation); |
125 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 133 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); |
126 | extern int netlink_register_notifier(struct notifier_block *nb); | 134 | extern int netlink_register_notifier(struct notifier_block *nb); |
127 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 135 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index f5a6695d4d21..f34767c5fc79 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -134,6 +134,7 @@ struct page_state { | |||
134 | }; | 134 | }; |
135 | 135 | ||
136 | extern void get_page_state(struct page_state *ret); | 136 | extern void get_page_state(struct page_state *ret); |
137 | extern void get_page_state_node(struct page_state *ret, int node); | ||
137 | extern void get_full_page_state(struct page_state *ret); | 138 | extern void get_full_page_state(struct page_state *ret); |
138 | extern unsigned long __read_page_state(unsigned long offset); | 139 | extern unsigned long __read_page_state(unsigned long offset); |
139 | extern void __mod_page_state(unsigned long offset, unsigned long delta); | 140 | extern void __mod_page_state(unsigned long offset, unsigned long delta); |
@@ -194,6 +195,7 @@ extern void __mod_page_state(unsigned long offset, unsigned long delta); | |||
194 | #define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags) | 195 | #define SetPageDirty(page) set_bit(PG_dirty, &(page)->flags) |
195 | #define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags) | 196 | #define TestSetPageDirty(page) test_and_set_bit(PG_dirty, &(page)->flags) |
196 | #define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags) | 197 | #define ClearPageDirty(page) clear_bit(PG_dirty, &(page)->flags) |
198 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) | ||
197 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) | 199 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) |
198 | 200 | ||
199 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) | 201 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 927ed487630d..ee0ab7a5f91b 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1249,6 +1249,7 @@ | |||
1249 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 | 1249 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA 0x0266 |
1250 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 | 1250 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP51_SATA2 0x0267 |
1251 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1251 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
1252 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x036F | ||
1252 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | 1253 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 |
1253 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | 1254 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 |
1254 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B | 1255 | #define PCI_DEVICE_ID_NVIDIA_MCP51_AUDIO 0x026B |
@@ -1611,6 +1612,7 @@ | |||
1611 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 | 1612 | #define PCI_DEVICE_ID_TOSHIBA_TC35815CF 0x0030 |
1612 | #define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 | 1613 | #define PCI_DEVICE_ID_TOSHIBA_TX4927 0x0180 |
1613 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 | 1614 | #define PCI_DEVICE_ID_TOSHIBA_TC86C001_MISC 0x0108 |
1615 | #define PCI_DEVICE_ID_TOSHIBA_SPIDER_NET 0x01b3 | ||
1614 | 1616 | ||
1615 | #define PCI_VENDOR_ID_RICOH 0x1180 | 1617 | #define PCI_VENDOR_ID_RICOH 0x1180 |
1616 | #define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 | 1618 | #define PCI_DEVICE_ID_RICOH_RL5C465 0x0465 |
@@ -2144,6 +2146,10 @@ | |||
2144 | #define PCI_DEVICE_ID_ENE_1225 0x1225 | 2146 | #define PCI_DEVICE_ID_ENE_1225 0x1225 |
2145 | #define PCI_DEVICE_ID_ENE_1410 0x1410 | 2147 | #define PCI_DEVICE_ID_ENE_1410 0x1410 |
2146 | #define PCI_DEVICE_ID_ENE_1420 0x1420 | 2148 | #define PCI_DEVICE_ID_ENE_1420 0x1420 |
2149 | #define PCI_VENDOR_ID_CHELSIO 0x1425 | ||
2150 | |||
2151 | #define PCI_VENDOR_ID_MIPS 0x153f | ||
2152 | #define PCI_DEVICE_ID_SOC_IT 0x0001 | ||
2147 | 2153 | ||
2148 | #define PCI_VENDOR_ID_SYBA 0x1592 | 2154 | #define PCI_VENDOR_ID_SYBA 0x1592 |
2149 | #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 | 2155 | #define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 |
diff --git a/include/linux/phy.h b/include/linux/phy.h new file mode 100644 index 000000000000..72cb67b66e0c --- /dev/null +++ b/include/linux/phy.h | |||
@@ -0,0 +1,377 @@ | |||
1 | /* | ||
2 | * include/linux/phy.h | ||
3 | * | ||
4 | * Framework and drivers for configuring and reading different PHYs | ||
5 | * Based on code in sungem_phy.c and gianfar_phy.c | ||
6 | * | ||
7 | * Author: Andy Fleming | ||
8 | * | ||
9 | * Copyright (c) 2004 Freescale Semiconductor, Inc. | ||
10 | * | ||
11 | * This program is free software; you can redistribute it and/or modify it | ||
12 | * under the terms of the GNU General Public License as published by the | ||
13 | * Free Software Foundation; either version 2 of the License, or (at your | ||
14 | * option) any later version. | ||
15 | * | ||
16 | */ | ||
17 | |||
18 | #ifndef __PHY_H | ||
19 | #define __PHY_H | ||
20 | |||
21 | #include <linux/spinlock.h> | ||
22 | #include <linux/device.h> | ||
23 | |||
24 | #define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ | ||
25 | SUPPORTED_10baseT_Full | \ | ||
26 | SUPPORTED_100baseT_Half | \ | ||
27 | SUPPORTED_100baseT_Full | \ | ||
28 | SUPPORTED_Autoneg | \ | ||
29 | SUPPORTED_TP | \ | ||
30 | SUPPORTED_MII) | ||
31 | |||
32 | #define PHY_GBIT_FEATURES (PHY_BASIC_FEATURES | \ | ||
33 | SUPPORTED_1000baseT_Half | \ | ||
34 | SUPPORTED_1000baseT_Full) | ||
35 | |||
36 | /* Set phydev->irq to PHY_POLL if interrupts are not supported, | ||
37 | * or not desired for this PHY. Set to PHY_IGNORE_INTERRUPT if | ||
38 | * the attached driver handles the interrupt | ||
39 | */ | ||
40 | #define PHY_POLL -1 | ||
41 | #define PHY_IGNORE_INTERRUPT -2 | ||
42 | |||
43 | #define PHY_HAS_INTERRUPT 0x00000001 | ||
44 | #define PHY_HAS_MAGICANEG 0x00000002 | ||
45 | |||
46 | #define MII_BUS_MAX 4 | ||
47 | |||
48 | |||
49 | #define PHY_INIT_TIMEOUT 100000 | ||
50 | #define PHY_STATE_TIME 1 | ||
51 | #define PHY_FORCE_TIMEOUT 10 | ||
52 | #define PHY_AN_TIMEOUT 10 | ||
53 | |||
54 | #define PHY_MAX_ADDR 32 | ||
55 | |||
56 | /* The Bus class for PHYs. Devices which provide access to | ||
57 | * PHYs should register using this structure */ | ||
58 | struct mii_bus { | ||
59 | const char *name; | ||
60 | int id; | ||
61 | void *priv; | ||
62 | int (*read)(struct mii_bus *bus, int phy_id, int regnum); | ||
63 | int (*write)(struct mii_bus *bus, int phy_id, int regnum, u16 val); | ||
64 | int (*reset)(struct mii_bus *bus); | ||
65 | |||
66 | /* A lock to ensure that only one thing can read/write | ||
67 | * the MDIO bus at a time */ | ||
68 | spinlock_t mdio_lock; | ||
69 | |||
70 | struct device *dev; | ||
71 | |||
72 | /* list of all PHYs on bus */ | ||
73 | struct phy_device *phy_map[PHY_MAX_ADDR]; | ||
74 | |||
75 | /* Pointer to an array of interrupts, each PHY's | ||
76 | * interrupt at the index matching its address */ | ||
77 | int *irq; | ||
78 | }; | ||
79 | |||
80 | #define PHY_INTERRUPT_DISABLED 0x0 | ||
81 | #define PHY_INTERRUPT_ENABLED 0x80000000 | ||
82 | |||
83 | /* PHY state machine states: | ||
84 | * | ||
85 | * DOWN: PHY device and driver are not ready for anything. probe | ||
86 | * should be called if and only if the PHY is in this state, | ||
87 | * given that the PHY device exists. | ||
88 | * - PHY driver probe function will, depending on the PHY, set | ||
89 | * the state to STARTING or READY | ||
90 | * | ||
91 | * STARTING: PHY device is coming up, and the ethernet driver is | ||
92 | * not ready. PHY drivers may set this in the probe function. | ||
93 | * If they do, they are responsible for making sure the state is | ||
94 | * eventually set to indicate whether the PHY is UP or READY, | ||
95 | * depending on the state when the PHY is done starting up. | ||
96 | * - PHY driver will set the state to READY | ||
97 | * - start will set the state to PENDING | ||
98 | * | ||
99 | * READY: PHY is ready to send and receive packets, but the | ||
100 | * controller is not. By default, PHYs which do not implement | ||
101 | * probe will be set to this state by phy_probe(). If the PHY | ||
102 | * driver knows the PHY is ready, and the PHY state is STARTING, | ||
103 | * then it sets this STATE. | ||
104 | * - start will set the state to UP | ||
105 | * | ||
106 | * PENDING: PHY device is coming up, but the ethernet driver is | ||
107 | * ready. phy_start will set this state if the PHY state is | ||
108 | * STARTING. | ||
109 | * - PHY driver will set the state to UP when the PHY is ready | ||
110 | * | ||
111 | * UP: The PHY and attached device are ready to do work. | ||
112 | * Interrupts should be started here. | ||
113 | * - timer moves to AN | ||
114 | * | ||
115 | * AN: The PHY is currently negotiating the link state. Link is | ||
116 | * therefore down for now. phy_timer will set this state when it | ||
117 | * detects the state is UP. config_aneg will set this state | ||
118 | * whenever called with phydev->autoneg set to AUTONEG_ENABLE. | ||
119 | * - If autonegotiation finishes, but there's no link, it sets | ||
120 | * the state to NOLINK. | ||
121 | * - If aneg finishes with link, it sets the state to RUNNING, | ||
122 | * and calls adjust_link | ||
123 | * - If autonegotiation did not finish after an arbitrary amount | ||
124 | * of time, autonegotiation should be tried again if the PHY | ||
125 | * supports "magic" autonegotiation (back to AN) | ||
126 | * - If it didn't finish, and no magic_aneg, move to FORCING. | ||
127 | * | ||
128 | * NOLINK: PHY is up, but not currently plugged in. | ||
129 | * - If the timer notes that the link comes back, we move to RUNNING | ||
130 | * - config_aneg moves to AN | ||
131 | * - phy_stop moves to HALTED | ||
132 | * | ||
133 | * FORCING: PHY is being configured with forced settings | ||
134 | * - if link is up, move to RUNNING | ||
135 | * - If link is down, we drop to the next highest setting, and | ||
136 | * retry (FORCING) after a timeout | ||
137 | * - phy_stop moves to HALTED | ||
138 | * | ||
139 | * RUNNING: PHY is currently up, running, and possibly sending | ||
140 | * and/or receiving packets | ||
141 | * - timer will set CHANGELINK if we're polling (this ensures the | ||
142 | * link state is polled every other cycle of this state machine, | ||
143 | * which makes it every other second) | ||
144 | * - irq will set CHANGELINK | ||
145 | * - config_aneg will set AN | ||
146 | * - phy_stop moves to HALTED | ||
147 | * | ||
148 | * CHANGELINK: PHY experienced a change in link state | ||
149 | * - timer moves to RUNNING if link | ||
150 | * - timer moves to NOLINK if the link is down | ||
151 | * - phy_stop moves to HALTED | ||
152 | * | ||
153 | * HALTED: PHY is up, but no polling or interrupts are done. Or | ||
154 | * PHY is in an error state. | ||
155 | * | ||
156 | * - phy_start moves to RESUMING | ||
157 | * | ||
158 | * RESUMING: PHY was halted, but now wants to run again. | ||
159 | * - If we are forcing, or aneg is done, timer moves to RUNNING | ||
160 | * - If aneg is not done, timer moves to AN | ||
161 | * - phy_stop moves to HALTED | ||
162 | */ | ||
163 | enum phy_state { | ||
164 | PHY_DOWN=0, | ||
165 | PHY_STARTING, | ||
166 | PHY_READY, | ||
167 | PHY_PENDING, | ||
168 | PHY_UP, | ||
169 | PHY_AN, | ||
170 | PHY_RUNNING, | ||
171 | PHY_NOLINK, | ||
172 | PHY_FORCING, | ||
173 | PHY_CHANGELINK, | ||
174 | PHY_HALTED, | ||
175 | PHY_RESUMING | ||
176 | }; | ||
177 | |||
178 | /* phy_device: An instance of a PHY | ||
179 | * | ||
180 | * drv: Pointer to the driver for this PHY instance | ||
181 | * bus: Pointer to the bus this PHY is on | ||
182 | * dev: driver model device structure for this PHY | ||
183 | * phy_id: UID for this device found during discovery | ||
184 | * state: state of the PHY for management purposes | ||
185 | * dev_flags: Device-specific flags used by the PHY driver. | ||
186 | * addr: Bus address of PHY | ||
187 | * link_timeout: The number of timer firings to wait before the | ||
188 | * giving up on the current attempt at acquiring a link | ||
189 | * irq: IRQ number of the PHY's interrupt (-1 if none) | ||
190 | * phy_timer: The timer for handling the state machine | ||
191 | * phy_queue: A work_queue for the interrupt | ||
192 | * attached_dev: The attached enet driver's device instance ptr | ||
193 | * adjust_link: Callback for the enet controller to respond to | ||
194 | * changes in the link state. | ||
195 | * adjust_state: Callback for the enet driver to respond to | ||
196 | * changes in the state machine. | ||
197 | * | ||
198 | * speed, duplex, pause, supported, advertising, and | ||
199 | * autoneg are used like in mii_if_info | ||
200 | * | ||
201 | * interrupts currently only supports enabled or disabled, | ||
202 | * but could be changed in the future to support enabling | ||
203 | * and disabling specific interrupts | ||
204 | * | ||
205 | * Contains some infrastructure for polling and interrupt | ||
206 | * handling, as well as handling shifts in PHY hardware state | ||
207 | */ | ||
208 | struct phy_device { | ||
209 | /* Information about the PHY type */ | ||
210 | /* And management functions */ | ||
211 | struct phy_driver *drv; | ||
212 | |||
213 | struct mii_bus *bus; | ||
214 | |||
215 | struct device dev; | ||
216 | |||
217 | u32 phy_id; | ||
218 | |||
219 | enum phy_state state; | ||
220 | |||
221 | u32 dev_flags; | ||
222 | |||
223 | /* Bus address of the PHY (0-32) */ | ||
224 | int addr; | ||
225 | |||
226 | /* forced speed & duplex (no autoneg) | ||
227 | * partner speed & duplex & pause (autoneg) | ||
228 | */ | ||
229 | int speed; | ||
230 | int duplex; | ||
231 | int pause; | ||
232 | int asym_pause; | ||
233 | |||
234 | /* The most recently read link state */ | ||
235 | int link; | ||
236 | |||
237 | /* Enabled Interrupts */ | ||
238 | u32 interrupts; | ||
239 | |||
240 | /* Union of PHY and Attached devices' supported modes */ | ||
241 | /* See mii.h for more info */ | ||
242 | u32 supported; | ||
243 | u32 advertising; | ||
244 | |||
245 | int autoneg; | ||
246 | |||
247 | int link_timeout; | ||
248 | |||
249 | /* Interrupt number for this PHY | ||
250 | * -1 means no interrupt */ | ||
251 | int irq; | ||
252 | |||
253 | /* private data pointer */ | ||
254 | /* For use by PHYs to maintain extra state */ | ||
255 | void *priv; | ||
256 | |||
257 | /* Interrupt and Polling infrastructure */ | ||
258 | struct work_struct phy_queue; | ||
259 | struct timer_list phy_timer; | ||
260 | |||
261 | spinlock_t lock; | ||
262 | |||
263 | struct net_device *attached_dev; | ||
264 | |||
265 | void (*adjust_link)(struct net_device *dev); | ||
266 | |||
267 | void (*adjust_state)(struct net_device *dev); | ||
268 | }; | ||
269 | #define to_phy_device(d) container_of(d, struct phy_device, dev) | ||
270 | |||
271 | /* struct phy_driver: Driver structure for a particular PHY type | ||
272 | * | ||
273 | * phy_id: The result of reading the UID registers of this PHY | ||
274 | * type, and ANDing them with the phy_id_mask. This driver | ||
275 | * only works for PHYs with IDs which match this field | ||
276 | * name: The friendly name of this PHY type | ||
277 | * phy_id_mask: Defines the important bits of the phy_id | ||
278 | * features: A list of features (speed, duplex, etc) supported | ||
279 | * by this PHY | ||
280 | * flags: A bitfield defining certain other features this PHY | ||
281 | * supports (like interrupts) | ||
282 | * | ||
283 | * The drivers must implement config_aneg and read_status. All | ||
284 | * other functions are optional. Note that none of these | ||
285 | * functions should be called from interrupt time. The goal is | ||
286 | * for the bus read/write functions to be able to block when the | ||
287 | * bus transaction is happening, and be freed up by an interrupt | ||
288 | * (The MPC85xx has this ability, though it is not currently | ||
289 | * supported in the driver). | ||
290 | */ | ||
291 | struct phy_driver { | ||
292 | u32 phy_id; | ||
293 | char *name; | ||
294 | unsigned int phy_id_mask; | ||
295 | u32 features; | ||
296 | u32 flags; | ||
297 | |||
298 | /* Called to initialize the PHY, | ||
299 | * including after a reset */ | ||
300 | int (*config_init)(struct phy_device *phydev); | ||
301 | |||
302 | /* Called during discovery. Used to set | ||
303 | * up device-specific structures, if any */ | ||
304 | int (*probe)(struct phy_device *phydev); | ||
305 | |||
306 | /* PHY Power Management */ | ||
307 | int (*suspend)(struct phy_device *phydev); | ||
308 | int (*resume)(struct phy_device *phydev); | ||
309 | |||
310 | /* Configures the advertisement and resets | ||
311 | * autonegotiation if phydev->autoneg is on, | ||
312 | * forces the speed to the current settings in phydev | ||
313 | * if phydev->autoneg is off */ | ||
314 | int (*config_aneg)(struct phy_device *phydev); | ||
315 | |||
316 | /* Determines the negotiated speed and duplex */ | ||
317 | int (*read_status)(struct phy_device *phydev); | ||
318 | |||
319 | /* Clears any pending interrupts */ | ||
320 | int (*ack_interrupt)(struct phy_device *phydev); | ||
321 | |||
322 | /* Enables or disables interrupts */ | ||
323 | int (*config_intr)(struct phy_device *phydev); | ||
324 | |||
325 | /* Clears up any memory if needed */ | ||
326 | void (*remove)(struct phy_device *phydev); | ||
327 | |||
328 | struct device_driver driver; | ||
329 | }; | ||
330 | #define to_phy_driver(d) container_of(d, struct phy_driver, driver) | ||
331 | |||
332 | int phy_read(struct phy_device *phydev, u16 regnum); | ||
333 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val); | ||
334 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | ||
335 | int phy_clear_interrupt(struct phy_device *phydev); | ||
336 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | ||
337 | struct phy_device * phy_attach(struct net_device *dev, | ||
338 | const char *phy_id, u32 flags); | ||
339 | struct phy_device * phy_connect(struct net_device *dev, const char *phy_id, | ||
340 | void (*handler)(struct net_device *), u32 flags); | ||
341 | void phy_disconnect(struct phy_device *phydev); | ||
342 | void phy_detach(struct phy_device *phydev); | ||
343 | void phy_start(struct phy_device *phydev); | ||
344 | void phy_stop(struct phy_device *phydev); | ||
345 | int phy_start_aneg(struct phy_device *phydev); | ||
346 | |||
347 | int mdiobus_register(struct mii_bus *bus); | ||
348 | void mdiobus_unregister(struct mii_bus *bus); | ||
349 | void phy_sanitize_settings(struct phy_device *phydev); | ||
350 | int phy_stop_interrupts(struct phy_device *phydev); | ||
351 | |||
352 | static inline int phy_read_status(struct phy_device *phydev) { | ||
353 | return phydev->drv->read_status(phydev); | ||
354 | } | ||
355 | |||
356 | int genphy_config_advert(struct phy_device *phydev); | ||
357 | int genphy_setup_forced(struct phy_device *phydev); | ||
358 | int genphy_restart_aneg(struct phy_device *phydev); | ||
359 | int genphy_config_aneg(struct phy_device *phydev); | ||
360 | int genphy_update_link(struct phy_device *phydev); | ||
361 | int genphy_read_status(struct phy_device *phydev); | ||
362 | void phy_driver_unregister(struct phy_driver *drv); | ||
363 | int phy_driver_register(struct phy_driver *new_driver); | ||
364 | void phy_prepare_link(struct phy_device *phydev, | ||
365 | void (*adjust_link)(struct net_device *)); | ||
366 | void phy_start_machine(struct phy_device *phydev, | ||
367 | void (*handler)(struct net_device *)); | ||
368 | void phy_stop_machine(struct phy_device *phydev); | ||
369 | int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd); | ||
370 | int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd); | ||
371 | int phy_mii_ioctl(struct phy_device *phydev, | ||
372 | struct mii_ioctl_data *mii_data, int cmd); | ||
373 | int phy_start_interrupts(struct phy_device *phydev); | ||
374 | void phy_print_status(struct phy_device *phydev); | ||
375 | |||
376 | extern struct bus_type mdio_bus_type; | ||
377 | #endif /* __PHY_H */ | ||
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h index 36725e7c02c6..1767073df26f 100644 --- a/include/linux/pipe_fs_i.h +++ b/include/linux/pipe_fs_i.h | |||
@@ -39,9 +39,6 @@ struct pipe_inode_info { | |||
39 | 39 | ||
40 | #define PIPE_SEM(inode) (&(inode).i_sem) | 40 | #define PIPE_SEM(inode) (&(inode).i_sem) |
41 | #define PIPE_WAIT(inode) (&(inode).i_pipe->wait) | 41 | #define PIPE_WAIT(inode) (&(inode).i_pipe->wait) |
42 | #define PIPE_BASE(inode) ((inode).i_pipe->base) | ||
43 | #define PIPE_START(inode) ((inode).i_pipe->start) | ||
44 | #define PIPE_LEN(inode) ((inode).i_pipe->len) | ||
45 | #define PIPE_READERS(inode) ((inode).i_pipe->readers) | 42 | #define PIPE_READERS(inode) ((inode).i_pipe->readers) |
46 | #define PIPE_WRITERS(inode) ((inode).i_pipe->writers) | 43 | #define PIPE_WRITERS(inode) ((inode).i_pipe->writers) |
47 | #define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) | 44 | #define PIPE_WAITING_WRITERS(inode) ((inode).i_pipe->waiting_writers) |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 7aeb208ed713..5cfb07648eca 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -186,7 +186,9 @@ extern int pm_suspend(suspend_state_t state); | |||
186 | 186 | ||
187 | struct device; | 187 | struct device; |
188 | 188 | ||
189 | typedef u32 __bitwise pm_message_t; | 189 | typedef struct pm_message { |
190 | int event; | ||
191 | } pm_message_t; | ||
190 | 192 | ||
191 | /* | 193 | /* |
192 | * There are 4 important states driver can be in: | 194 | * There are 4 important states driver can be in: |
@@ -207,9 +209,13 @@ typedef u32 __bitwise pm_message_t; | |||
207 | * or something similar soon. | 209 | * or something similar soon. |
208 | */ | 210 | */ |
209 | 211 | ||
210 | #define PMSG_FREEZE ((__force pm_message_t) 3) | 212 | #define PM_EVENT_ON 0 |
211 | #define PMSG_SUSPEND ((__force pm_message_t) 3) | 213 | #define PM_EVENT_FREEZE 1 |
212 | #define PMSG_ON ((__force pm_message_t) 0) | 214 | #define PM_EVENT_SUSPEND 2 |
215 | |||
216 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) | ||
217 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) | ||
218 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | ||
213 | 219 | ||
214 | struct dev_pm_info { | 220 | struct dev_pm_info { |
215 | pm_message_t power_state; | 221 | pm_message_t power_state; |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 5ec2bd0c2848..aadbac29103c 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -443,7 +443,7 @@ static inline void pnp_unregister_driver(struct pnp_driver *drv) { ; } | |||
443 | #define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) | 443 | #define pnp_info(format, arg...) printk(KERN_INFO "pnp: " format "\n" , ## arg) |
444 | #define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) | 444 | #define pnp_warn(format, arg...) printk(KERN_WARNING "pnp: " format "\n" , ## arg) |
445 | 445 | ||
446 | #ifdef DEBUG | 446 | #ifdef CONFIG_PNP_DEBUG |
447 | #define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg) | 447 | #define pnp_dbg(format, arg...) printk(KERN_DEBUG "pnp: " format "\n" , ## arg) |
448 | #else | 448 | #else |
449 | #define pnp_dbg(format, arg...) do {} while (0) | 449 | #define pnp_dbg(format, arg...) do {} while (0) |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index a373fc254df2..dc6f3647bfbc 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #define PTRACE_DETACH 0x11 | 20 | #define PTRACE_DETACH 0x11 |
21 | 21 | ||
22 | #define PTRACE_SYSCALL 24 | 22 | #define PTRACE_SYSCALL 24 |
23 | #define PTRACE_SYSEMU 31 | ||
24 | #define PTRACE_SYSEMU_SINGLESTEP 32 | ||
23 | 25 | ||
24 | /* 0x4200-0x4300 are reserved for architecture-independent additions. */ | 26 | /* 0x4200-0x4300 are reserved for architecture-independent additions. */ |
25 | #define PTRACE_SETOPTIONS 0x4200 | 27 | #define PTRACE_SETOPTIONS 0x4200 |
@@ -88,6 +90,7 @@ extern void __ptrace_link(struct task_struct *child, | |||
88 | struct task_struct *new_parent); | 90 | struct task_struct *new_parent); |
89 | extern void __ptrace_unlink(struct task_struct *child); | 91 | extern void __ptrace_unlink(struct task_struct *child); |
90 | extern void ptrace_untrace(struct task_struct *child); | 92 | extern void ptrace_untrace(struct task_struct *child); |
93 | extern int ptrace_may_attach(struct task_struct *task); | ||
91 | 94 | ||
92 | static inline void ptrace_link(struct task_struct *child, | 95 | static inline void ptrace_link(struct task_struct *child, |
93 | struct task_struct *new_parent) | 96 | struct task_struct *new_parent) |
diff --git a/include/linux/random.h b/include/linux/random.h index cc6703449916..7b2adb3322d5 100644 --- a/include/linux/random.h +++ b/include/linux/random.h | |||
@@ -59,6 +59,8 @@ extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, | |||
59 | __u16 sport, __u16 dport); | 59 | __u16 sport, __u16 dport); |
60 | extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, | 60 | extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, |
61 | __u16 sport, __u16 dport); | 61 | __u16 sport, __u16 dport); |
62 | extern u64 secure_dccp_sequence_number(__u32 saddr, __u32 daddr, | ||
63 | __u16 sport, __u16 dport); | ||
62 | 64 | ||
63 | #ifndef MODULE | 65 | #ifndef MODULE |
64 | extern struct file_operations random_fops, urandom_fops; | 66 | extern struct file_operations random_fops, urandom_fops; |
diff --git a/include/linux/relayfs_fs.h b/include/linux/relayfs_fs.h new file mode 100644 index 000000000000..cfafc3e76bc2 --- /dev/null +++ b/include/linux/relayfs_fs.h | |||
@@ -0,0 +1,255 @@ | |||
1 | /* | ||
2 | * linux/include/linux/relayfs_fs.h | ||
3 | * | ||
4 | * Copyright (C) 2002, 2003 - Tom Zanussi (zanussi@us.ibm.com), IBM Corp | ||
5 | * Copyright (C) 1999, 2000, 2001, 2002 - Karim Yaghmour (karim@opersys.com) | ||
6 | * | ||
7 | * RelayFS definitions and declarations | ||
8 | */ | ||
9 | |||
10 | #ifndef _LINUX_RELAYFS_FS_H | ||
11 | #define _LINUX_RELAYFS_FS_H | ||
12 | |||
13 | #include <linux/config.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/sched.h> | ||
16 | #include <linux/wait.h> | ||
17 | #include <linux/list.h> | ||
18 | #include <linux/fs.h> | ||
19 | #include <linux/poll.h> | ||
20 | #include <linux/kref.h> | ||
21 | |||
22 | /* | ||
23 | * Tracks changes to rchan_buf struct | ||
24 | */ | ||
25 | #define RELAYFS_CHANNEL_VERSION 5 | ||
26 | |||
27 | /* | ||
28 | * Per-cpu relay channel buffer | ||
29 | */ | ||
30 | struct rchan_buf | ||
31 | { | ||
32 | void *start; /* start of channel buffer */ | ||
33 | void *data; /* start of current sub-buffer */ | ||
34 | size_t offset; /* current offset into sub-buffer */ | ||
35 | size_t subbufs_produced; /* count of sub-buffers produced */ | ||
36 | size_t subbufs_consumed; /* count of sub-buffers consumed */ | ||
37 | struct rchan *chan; /* associated channel */ | ||
38 | wait_queue_head_t read_wait; /* reader wait queue */ | ||
39 | struct work_struct wake_readers; /* reader wake-up work struct */ | ||
40 | struct dentry *dentry; /* channel file dentry */ | ||
41 | struct kref kref; /* channel buffer refcount */ | ||
42 | struct page **page_array; /* array of current buffer pages */ | ||
43 | unsigned int page_count; /* number of current buffer pages */ | ||
44 | unsigned int finalized; /* buffer has been finalized */ | ||
45 | size_t *padding; /* padding counts per sub-buffer */ | ||
46 | size_t prev_padding; /* temporary variable */ | ||
47 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ | ||
48 | unsigned int cpu; /* this buf's cpu */ | ||
49 | } ____cacheline_aligned; | ||
50 | |||
51 | /* | ||
52 | * Relay channel data structure | ||
53 | */ | ||
54 | struct rchan | ||
55 | { | ||
56 | u32 version; /* the version of this struct */ | ||
57 | size_t subbuf_size; /* sub-buffer size */ | ||
58 | size_t n_subbufs; /* number of sub-buffers per buffer */ | ||
59 | size_t alloc_size; /* total buffer size allocated */ | ||
60 | struct rchan_callbacks *cb; /* client callbacks */ | ||
61 | struct kref kref; /* channel refcount */ | ||
62 | void *private_data; /* for user-defined data */ | ||
63 | struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ | ||
64 | }; | ||
65 | |||
66 | /* | ||
67 | * Relayfs inode | ||
68 | */ | ||
69 | struct relayfs_inode_info | ||
70 | { | ||
71 | struct inode vfs_inode; | ||
72 | struct rchan_buf *buf; | ||
73 | }; | ||
74 | |||
75 | static inline struct relayfs_inode_info *RELAYFS_I(struct inode *inode) | ||
76 | { | ||
77 | return container_of(inode, struct relayfs_inode_info, vfs_inode); | ||
78 | } | ||
79 | |||
80 | /* | ||
81 | * Relay channel client callbacks | ||
82 | */ | ||
83 | struct rchan_callbacks | ||
84 | { | ||
85 | /* | ||
86 | * subbuf_start - called on buffer-switch to a new sub-buffer | ||
87 | * @buf: the channel buffer containing the new sub-buffer | ||
88 | * @subbuf: the start of the new sub-buffer | ||
89 | * @prev_subbuf: the start of the previous sub-buffer | ||
90 | * @prev_padding: unused space at the end of previous sub-buffer | ||
91 | * | ||
92 | * The client should return 1 to continue logging, 0 to stop | ||
93 | * logging. | ||
94 | * | ||
95 | * NOTE: subbuf_start will also be invoked when the buffer is | ||
96 | * created, so that the first sub-buffer can be initialized | ||
97 | * if necessary. In this case, prev_subbuf will be NULL. | ||
98 | * | ||
99 | * NOTE: the client can reserve bytes at the beginning of the new | ||
100 | * sub-buffer by calling subbuf_start_reserve() in this callback. | ||
101 | */ | ||
102 | int (*subbuf_start) (struct rchan_buf *buf, | ||
103 | void *subbuf, | ||
104 | void *prev_subbuf, | ||
105 | size_t prev_padding); | ||
106 | |||
107 | /* | ||
108 | * buf_mapped - relayfs buffer mmap notification | ||
109 | * @buf: the channel buffer | ||
110 | * @filp: relayfs file pointer | ||
111 | * | ||
112 | * Called when a relayfs file is successfully mmapped | ||
113 | */ | ||
114 | void (*buf_mapped)(struct rchan_buf *buf, | ||
115 | struct file *filp); | ||
116 | |||
117 | /* | ||
118 | * buf_unmapped - relayfs buffer unmap notification | ||
119 | * @buf: the channel buffer | ||
120 | * @filp: relayfs file pointer | ||
121 | * | ||
122 | * Called when a relayfs file is successfully unmapped | ||
123 | */ | ||
124 | void (*buf_unmapped)(struct rchan_buf *buf, | ||
125 | struct file *filp); | ||
126 | }; | ||
127 | |||
128 | /* | ||
129 | * relayfs kernel API, fs/relayfs/relay.c | ||
130 | */ | ||
131 | |||
132 | struct rchan *relay_open(const char *base_filename, | ||
133 | struct dentry *parent, | ||
134 | size_t subbuf_size, | ||
135 | size_t n_subbufs, | ||
136 | struct rchan_callbacks *cb); | ||
137 | extern void relay_close(struct rchan *chan); | ||
138 | extern void relay_flush(struct rchan *chan); | ||
139 | extern void relay_subbufs_consumed(struct rchan *chan, | ||
140 | unsigned int cpu, | ||
141 | size_t consumed); | ||
142 | extern void relay_reset(struct rchan *chan); | ||
143 | extern int relay_buf_full(struct rchan_buf *buf); | ||
144 | |||
145 | extern size_t relay_switch_subbuf(struct rchan_buf *buf, | ||
146 | size_t length); | ||
147 | extern struct dentry *relayfs_create_dir(const char *name, | ||
148 | struct dentry *parent); | ||
149 | extern int relayfs_remove_dir(struct dentry *dentry); | ||
150 | |||
151 | /** | ||
152 | * relay_write - write data into the channel | ||
153 | * @chan: relay channel | ||
154 | * @data: data to be written | ||
155 | * @length: number of bytes to write | ||
156 | * | ||
157 | * Writes data into the current cpu's channel buffer. | ||
158 | * | ||
159 | * Protects the buffer by disabling interrupts. Use this | ||
160 | * if you might be logging from interrupt context. Try | ||
161 | * __relay_write() if you know you won't be logging from | ||
162 | * interrupt context. | ||
163 | */ | ||
164 | static inline void relay_write(struct rchan *chan, | ||
165 | const void *data, | ||
166 | size_t length) | ||
167 | { | ||
168 | unsigned long flags; | ||
169 | struct rchan_buf *buf; | ||
170 | |||
171 | local_irq_save(flags); | ||
172 | buf = chan->buf[smp_processor_id()]; | ||
173 | if (unlikely(buf->offset + length > chan->subbuf_size)) | ||
174 | length = relay_switch_subbuf(buf, length); | ||
175 | memcpy(buf->data + buf->offset, data, length); | ||
176 | buf->offset += length; | ||
177 | local_irq_restore(flags); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * __relay_write - write data into the channel | ||
182 | * @chan: relay channel | ||
183 | * @data: data to be written | ||
184 | * @length: number of bytes to write | ||
185 | * | ||
186 | * Writes data into the current cpu's channel buffer. | ||
187 | * | ||
188 | * Protects the buffer by disabling preemption. Use | ||
189 | * relay_write() if you might be logging from interrupt | ||
190 | * context. | ||
191 | */ | ||
192 | static inline void __relay_write(struct rchan *chan, | ||
193 | const void *data, | ||
194 | size_t length) | ||
195 | { | ||
196 | struct rchan_buf *buf; | ||
197 | |||
198 | buf = chan->buf[get_cpu()]; | ||
199 | if (unlikely(buf->offset + length > buf->chan->subbuf_size)) | ||
200 | length = relay_switch_subbuf(buf, length); | ||
201 | memcpy(buf->data + buf->offset, data, length); | ||
202 | buf->offset += length; | ||
203 | put_cpu(); | ||
204 | } | ||
205 | |||
206 | /** | ||
207 | * relay_reserve - reserve slot in channel buffer | ||
208 | * @chan: relay channel | ||
209 | * @length: number of bytes to reserve | ||
210 | * | ||
211 | * Returns pointer to reserved slot, NULL if full. | ||
212 | * | ||
213 | * Reserves a slot in the current cpu's channel buffer. | ||
214 | * Does not protect the buffer at all - caller must provide | ||
215 | * appropriate synchronization. | ||
216 | */ | ||
217 | static inline void *relay_reserve(struct rchan *chan, size_t length) | ||
218 | { | ||
219 | void *reserved; | ||
220 | struct rchan_buf *buf = chan->buf[smp_processor_id()]; | ||
221 | |||
222 | if (unlikely(buf->offset + length > buf->chan->subbuf_size)) { | ||
223 | length = relay_switch_subbuf(buf, length); | ||
224 | if (!length) | ||
225 | return NULL; | ||
226 | } | ||
227 | reserved = buf->data + buf->offset; | ||
228 | buf->offset += length; | ||
229 | |||
230 | return reserved; | ||
231 | } | ||
232 | |||
233 | /** | ||
234 | * subbuf_start_reserve - reserve bytes at the start of a sub-buffer | ||
235 | * @buf: relay channel buffer | ||
236 | * @length: number of bytes to reserve | ||
237 | * | ||
238 | * Helper function used to reserve bytes at the beginning of | ||
239 | * a sub-buffer in the subbuf_start() callback. | ||
240 | */ | ||
241 | static inline void subbuf_start_reserve(struct rchan_buf *buf, | ||
242 | size_t length) | ||
243 | { | ||
244 | BUG_ON(length >= buf->chan->subbuf_size - 1); | ||
245 | buf->offset = length; | ||
246 | } | ||
247 | |||
248 | /* | ||
249 | * exported relayfs file operations, fs/relayfs/inode.c | ||
250 | */ | ||
251 | |||
252 | extern struct file_operations relayfs_file_operations; | ||
253 | |||
254 | #endif /* _LINUX_RELAYFS_FS_H */ | ||
255 | |||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 657c05ab8f9e..c231e9a08f0b 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -826,9 +826,8 @@ enum | |||
826 | #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) | 826 | #define TCA_RTA(r) ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct tcmsg)))) |
827 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) | 827 | #define TCA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct tcmsg)) |
828 | 828 | ||
829 | 829 | #ifndef __KERNEL__ | |
830 | /* RTnetlink multicast groups */ | 830 | /* RTnetlink multicast groups - backwards compatibility for userspace */ |
831 | |||
832 | #define RTMGRP_LINK 1 | 831 | #define RTMGRP_LINK 1 |
833 | #define RTMGRP_NOTIFY 2 | 832 | #define RTMGRP_NOTIFY 2 |
834 | #define RTMGRP_NEIGH 4 | 833 | #define RTMGRP_NEIGH 4 |
@@ -847,6 +846,43 @@ enum | |||
847 | #define RTMGRP_DECnet_ROUTE 0x4000 | 846 | #define RTMGRP_DECnet_ROUTE 0x4000 |
848 | 847 | ||
849 | #define RTMGRP_IPV6_PREFIX 0x20000 | 848 | #define RTMGRP_IPV6_PREFIX 0x20000 |
849 | #endif | ||
850 | |||
851 | /* RTnetlink multicast groups */ | ||
852 | enum rtnetlink_groups { | ||
853 | RTNLGRP_NONE, | ||
854 | #define RTNLGRP_NONE RTNLGRP_NONE | ||
855 | RTNLGRP_LINK, | ||
856 | #define RTNLGRP_LINK RTNLGRP_LINK | ||
857 | RTNLGRP_NOTIFY, | ||
858 | #define RTNLGRP_NOTIFY RTNLGRP_NOTIFY | ||
859 | RTNLGRP_NEIGH, | ||
860 | #define RTNLGRP_NEIGH RTNLGRP_NEIGH | ||
861 | RTNLGRP_TC, | ||
862 | #define RTNLGRP_TC RTNLGRP_TC | ||
863 | RTNLGRP_IPV4_IFADDR, | ||
864 | #define RTNLGRP_IPV4_IFADDR RTNLGRP_IPV4_IFADDR | ||
865 | RTNLGRP_IPV4_MROUTE, | ||
866 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE | ||
867 | RTNLGRP_IPV4_ROUTE, | ||
868 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE | ||
869 | RTNLGRP_IPV6_IFADDR, | ||
870 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR | ||
871 | RTNLGRP_IPV6_MROUTE, | ||
872 | #define RTNLGRP_IPV6_MROUTE RTNLGRP_IPV6_MROUTE | ||
873 | RTNLGRP_IPV6_ROUTE, | ||
874 | #define RTNLGRP_IPV6_ROUTE RTNLGRP_IPV6_ROUTE | ||
875 | RTNLGRP_IPV6_IFINFO, | ||
876 | #define RTNLGRP_IPV6_IFINFO RTNLGRP_IPV6_IFINFO | ||
877 | RTNLGRP_DECnet_IFADDR, | ||
878 | #define RTNLGRP_DECnet_IFADDR RTNLGRP_DECnet_IFADDR | ||
879 | RTNLGRP_DECnet_ROUTE, | ||
880 | #define RTNLGRP_DECnet_ROUTE RTNLGRP_DECnet_ROUTE | ||
881 | RTNLGRP_IPV6_PREFIX, | ||
882 | #define RTNLGRP_IPV6_PREFIX RTNLGRP_IPV6_PREFIX | ||
883 | __RTNLGRP_MAX | ||
884 | }; | ||
885 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | ||
850 | 886 | ||
851 | /* TC action piece */ | 887 | /* TC action piece */ |
852 | struct tcamsg | 888 | struct tcamsg |
diff --git a/include/linux/sched.h b/include/linux/sched.h index dec5827c7742..ea1b5f32ec5c 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -35,6 +35,8 @@ | |||
35 | #include <linux/topology.h> | 35 | #include <linux/topology.h> |
36 | #include <linux/seccomp.h> | 36 | #include <linux/seccomp.h> |
37 | 37 | ||
38 | #include <linux/auxvec.h> /* For AT_VECTOR_SIZE */ | ||
39 | |||
38 | struct exec_domain; | 40 | struct exec_domain; |
39 | 41 | ||
40 | /* | 42 | /* |
@@ -176,6 +178,23 @@ extern void trap_init(void); | |||
176 | extern void update_process_times(int user); | 178 | extern void update_process_times(int user); |
177 | extern void scheduler_tick(void); | 179 | extern void scheduler_tick(void); |
178 | 180 | ||
181 | #ifdef CONFIG_DETECT_SOFTLOCKUP | ||
182 | extern void softlockup_tick(struct pt_regs *regs); | ||
183 | extern void spawn_softlockup_task(void); | ||
184 | extern void touch_softlockup_watchdog(void); | ||
185 | #else | ||
186 | static inline void softlockup_tick(struct pt_regs *regs) | ||
187 | { | ||
188 | } | ||
189 | static inline void spawn_softlockup_task(void) | ||
190 | { | ||
191 | } | ||
192 | static inline void touch_softlockup_watchdog(void) | ||
193 | { | ||
194 | } | ||
195 | #endif | ||
196 | |||
197 | |||
179 | /* Attach to any functions which should be ignored in wchan output. */ | 198 | /* Attach to any functions which should be ignored in wchan output. */ |
180 | #define __sched __attribute__((__section__(".sched.text"))) | 199 | #define __sched __attribute__((__section__(".sched.text"))) |
181 | /* Is this address in the __sched functions? */ | 200 | /* Is this address in the __sched functions? */ |
@@ -244,7 +263,7 @@ struct mm_struct { | |||
244 | mm_counter_t _rss; | 263 | mm_counter_t _rss; |
245 | mm_counter_t _anon_rss; | 264 | mm_counter_t _anon_rss; |
246 | 265 | ||
247 | unsigned long saved_auxv[42]; /* for /proc/PID/auxv */ | 266 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
248 | 267 | ||
249 | unsigned dumpable:2; | 268 | unsigned dumpable:2; |
250 | cpumask_t cpu_vm_mask; | 269 | cpumask_t cpu_vm_mask; |
@@ -545,13 +564,6 @@ struct sched_domain { | |||
545 | 564 | ||
546 | extern void partition_sched_domains(cpumask_t *partition1, | 565 | extern void partition_sched_domains(cpumask_t *partition1, |
547 | cpumask_t *partition2); | 566 | cpumask_t *partition2); |
548 | #ifdef ARCH_HAS_SCHED_DOMAIN | ||
549 | /* Useful helpers that arch setup code may use. Defined in kernel/sched.c */ | ||
550 | extern cpumask_t cpu_isolated_map; | ||
551 | extern void init_sched_build_groups(struct sched_group groups[], | ||
552 | cpumask_t span, int (*group_fn)(int cpu)); | ||
553 | extern void cpu_attach_domain(struct sched_domain *sd, int cpu); | ||
554 | #endif /* ARCH_HAS_SCHED_DOMAIN */ | ||
555 | #endif /* CONFIG_SMP */ | 567 | #endif /* CONFIG_SMP */ |
556 | 568 | ||
557 | 569 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index b42095a68b1c..7aab6ab7c57f 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -2727,7 +2727,8 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
2727 | return security_ops->socket_getpeersec(sock, optval, optlen, len); | 2727 | return security_ops->socket_getpeersec(sock, optval, optlen, len); |
2728 | } | 2728 | } |
2729 | 2729 | ||
2730 | static inline int security_sk_alloc(struct sock *sk, int family, int priority) | 2730 | static inline int security_sk_alloc(struct sock *sk, int family, |
2731 | unsigned int __nocast priority) | ||
2731 | { | 2732 | { |
2732 | return security_ops->sk_alloc_security(sk, family, priority); | 2733 | return security_ops->sk_alloc_security(sk, family, priority); |
2733 | } | 2734 | } |
@@ -2844,7 +2845,8 @@ static inline int security_socket_getpeersec(struct socket *sock, char __user *o | |||
2844 | return -ENOPROTOOPT; | 2845 | return -ENOPROTOOPT; |
2845 | } | 2846 | } |
2846 | 2847 | ||
2847 | static inline int security_sk_alloc(struct sock *sk, int family, int priority) | 2848 | static inline int security_sk_alloc(struct sock *sk, int family, |
2849 | unsigned int __nocast priority) | ||
2848 | { | 2850 | { |
2849 | return 0; | 2851 | return 0; |
2850 | } | 2852 | } |
diff --git a/include/linux/selinux_netlink.h b/include/linux/selinux_netlink.h index 957e6ebca4e6..bbf489decd84 100644 --- a/include/linux/selinux_netlink.h +++ b/include/linux/selinux_netlink.h | |||
@@ -20,10 +20,21 @@ enum { | |||
20 | SELNL_MSG_MAX | 20 | SELNL_MSG_MAX |
21 | }; | 21 | }; |
22 | 22 | ||
23 | /* Multicast groups */ | 23 | #ifndef __KERNEL__ |
24 | /* Multicast groups - backwards compatiblility for userspace */ | ||
24 | #define SELNL_GRP_NONE 0x00000000 | 25 | #define SELNL_GRP_NONE 0x00000000 |
25 | #define SELNL_GRP_AVC 0x00000001 /* AVC notifications */ | 26 | #define SELNL_GRP_AVC 0x00000001 /* AVC notifications */ |
26 | #define SELNL_GRP_ALL 0xffffffff | 27 | #define SELNL_GRP_ALL 0xffffffff |
28 | #endif | ||
29 | |||
30 | enum selinux_nlgroups { | ||
31 | SELNLGRP_NONE, | ||
32 | #define SELNLGRP_NONE SELNLGRP_NONE | ||
33 | SELNLGRP_AVC, | ||
34 | #define SELNLGRP_AVC SELNLGRP_AVC | ||
35 | __SELNLGRP_MAX | ||
36 | }; | ||
37 | #define SELNLGRP_MAX (__SELNLGRP_MAX - 1) | ||
27 | 38 | ||
28 | /* Message structures */ | 39 | /* Message structures */ |
29 | struct selnl_msg_setenforce { | 40 | struct selnl_msg_setenforce { |
diff --git a/include/linux/sem.h b/include/linux/sem.h index 2d8516be9fd7..106f9757339a 100644 --- a/include/linux/sem.h +++ b/include/linux/sem.h | |||
@@ -88,6 +88,7 @@ struct sem { | |||
88 | /* One sem_array data structure for each set of semaphores in the system. */ | 88 | /* One sem_array data structure for each set of semaphores in the system. */ |
89 | struct sem_array { | 89 | struct sem_array { |
90 | struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ | 90 | struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ |
91 | int sem_id; | ||
91 | time_t sem_otime; /* last semop time */ | 92 | time_t sem_otime; /* last semop time */ |
92 | time_t sem_ctime; /* last change time */ | 93 | time_t sem_ctime; /* last change time */ |
93 | struct sem *sem_base; /* ptr to first semaphore in array */ | 94 | struct sem *sem_base; /* ptr to first semaphore in array */ |
diff --git a/include/linux/serial.h b/include/linux/serial.h index 9f2d85284d0b..12cd9cf65e8f 100644 --- a/include/linux/serial.h +++ b/include/linux/serial.h | |||
@@ -176,10 +176,6 @@ struct serial_icounter_struct { | |||
176 | #ifdef __KERNEL__ | 176 | #ifdef __KERNEL__ |
177 | #include <linux/compiler.h> | 177 | #include <linux/compiler.h> |
178 | 178 | ||
179 | /* Export to allow PCMCIA to use this - Dave Hinds */ | ||
180 | extern int __deprecated register_serial(struct serial_struct *req); | ||
181 | extern void __deprecated unregister_serial(int line); | ||
182 | |||
183 | /* Allow architectures to override entries in serial8250_ports[] at run time: */ | 179 | /* Allow architectures to override entries in serial8250_ports[] at run time: */ |
184 | struct uart_port; /* forward declaration */ | 180 | struct uart_port; /* forward declaration */ |
185 | extern int early_serial_setup(struct uart_port *port); | 181 | extern int early_serial_setup(struct uart_port *port); |
diff --git a/include/linux/serialP.h b/include/linux/serialP.h index 2b2f35a64d75..2b9e6b9554d5 100644 --- a/include/linux/serialP.h +++ b/include/linux/serialP.h | |||
@@ -140,44 +140,4 @@ struct rs_multiport_struct { | |||
140 | #define ALPHA_KLUDGE_MCR 0 | 140 | #define ALPHA_KLUDGE_MCR 0 |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | /* | ||
144 | * Definitions for PCI support. | ||
145 | */ | ||
146 | #define SPCI_FL_BASE_MASK 0x0007 | ||
147 | #define SPCI_FL_BASE0 0x0000 | ||
148 | #define SPCI_FL_BASE1 0x0001 | ||
149 | #define SPCI_FL_BASE2 0x0002 | ||
150 | #define SPCI_FL_BASE3 0x0003 | ||
151 | #define SPCI_FL_BASE4 0x0004 | ||
152 | #define SPCI_FL_GET_BASE(x) (x & SPCI_FL_BASE_MASK) | ||
153 | |||
154 | #define SPCI_FL_IRQ_MASK (0x0007 << 4) | ||
155 | #define SPCI_FL_IRQBASE0 (0x0000 << 4) | ||
156 | #define SPCI_FL_IRQBASE1 (0x0001 << 4) | ||
157 | #define SPCI_FL_IRQBASE2 (0x0002 << 4) | ||
158 | #define SPCI_FL_IRQBASE3 (0x0003 << 4) | ||
159 | #define SPCI_FL_IRQBASE4 (0x0004 << 4) | ||
160 | #define SPCI_FL_GET_IRQBASE(x) ((x & SPCI_FL_IRQ_MASK) >> 4) | ||
161 | |||
162 | /* Use successive BARs (PCI base address registers), | ||
163 | else use offset into some specified BAR */ | ||
164 | #define SPCI_FL_BASE_TABLE 0x0100 | ||
165 | |||
166 | /* Use successive entries in the irq resource table */ | ||
167 | #define SPCI_FL_IRQ_TABLE 0x0200 | ||
168 | |||
169 | /* Use the irq resource table instead of dev->irq */ | ||
170 | #define SPCI_FL_IRQRESOURCE 0x0400 | ||
171 | |||
172 | /* Use the Base address register size to cap number of ports */ | ||
173 | #define SPCI_FL_REGION_SZ_CAP 0x0800 | ||
174 | |||
175 | /* Do not use irq sharing for this device */ | ||
176 | #define SPCI_FL_NO_SHIRQ 0x1000 | ||
177 | |||
178 | /* This is a PNP device */ | ||
179 | #define SPCI_FL_ISPNP 0x2000 | ||
180 | |||
181 | #define SPCI_FL_PNPDEFAULT (SPCI_FL_IRQRESOURCE|SPCI_FL_ISPNP) | ||
182 | |||
183 | #endif /* _LINUX_SERIAL_H */ | 143 | #endif /* _LINUX_SERIAL_H */ |
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h index 3e3c1fa35b06..d8a023d804d4 100644 --- a/include/linux/serial_8250.h +++ b/include/linux/serial_8250.h | |||
@@ -14,6 +14,9 @@ | |||
14 | #include <linux/serial_core.h> | 14 | #include <linux/serial_core.h> |
15 | #include <linux/device.h> | 15 | #include <linux/device.h> |
16 | 16 | ||
17 | /* | ||
18 | * This is the platform device platform_data structure | ||
19 | */ | ||
17 | struct plat_serial8250_port { | 20 | struct plat_serial8250_port { |
18 | unsigned long iobase; /* io base address */ | 21 | unsigned long iobase; /* io base address */ |
19 | void __iomem *membase; /* ioremap cookie or NULL */ | 22 | void __iomem *membase; /* ioremap cookie or NULL */ |
@@ -26,4 +29,17 @@ struct plat_serial8250_port { | |||
26 | unsigned int flags; /* UPF_* flags */ | 29 | unsigned int flags; /* UPF_* flags */ |
27 | }; | 30 | }; |
28 | 31 | ||
32 | /* | ||
33 | * This should be used by drivers which want to register | ||
34 | * their own 8250 ports without registering their own | ||
35 | * platform device. Using these will make your driver | ||
36 | * dependent on the 8250 driver. | ||
37 | */ | ||
38 | struct uart_port; | ||
39 | |||
40 | int serial8250_register_port(struct uart_port *); | ||
41 | void serial8250_unregister_port(int line); | ||
42 | void serial8250_suspend_port(int line); | ||
43 | void serial8250_resume_port(int line); | ||
44 | |||
29 | #endif | 45 | #endif |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index f6fca8f2f3ca..9b12fe731612 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -142,8 +142,8 @@ struct uart_ops { | |||
142 | unsigned int (*tx_empty)(struct uart_port *); | 142 | unsigned int (*tx_empty)(struct uart_port *); |
143 | void (*set_mctrl)(struct uart_port *, unsigned int mctrl); | 143 | void (*set_mctrl)(struct uart_port *, unsigned int mctrl); |
144 | unsigned int (*get_mctrl)(struct uart_port *); | 144 | unsigned int (*get_mctrl)(struct uart_port *); |
145 | void (*stop_tx)(struct uart_port *, unsigned int tty_stop); | 145 | void (*stop_tx)(struct uart_port *); |
146 | void (*start_tx)(struct uart_port *, unsigned int tty_start); | 146 | void (*start_tx)(struct uart_port *); |
147 | void (*send_xchar)(struct uart_port *, char ch); | 147 | void (*send_xchar)(struct uart_port *, char ch); |
148 | void (*stop_rx)(struct uart_port *); | 148 | void (*stop_rx)(struct uart_port *); |
149 | void (*enable_ms)(struct uart_port *); | 149 | void (*enable_ms)(struct uart_port *); |
@@ -360,8 +360,6 @@ struct tty_driver *uart_console_device(struct console *co, int *index); | |||
360 | */ | 360 | */ |
361 | int uart_register_driver(struct uart_driver *uart); | 361 | int uart_register_driver(struct uart_driver *uart); |
362 | void uart_unregister_driver(struct uart_driver *uart); | 362 | void uart_unregister_driver(struct uart_driver *uart); |
363 | void __deprecated uart_unregister_port(struct uart_driver *reg, int line); | ||
364 | int __deprecated uart_register_port(struct uart_driver *reg, struct uart_port *port); | ||
365 | int uart_add_one_port(struct uart_driver *reg, struct uart_port *port); | 363 | int uart_add_one_port(struct uart_driver *reg, struct uart_port *port); |
366 | int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); | 364 | int uart_remove_one_port(struct uart_driver *reg, struct uart_port *port); |
367 | int uart_match_port(struct uart_port *port1, struct uart_port *port2); | 365 | int uart_match_port(struct uart_port *port1, struct uart_port *port2); |
@@ -387,11 +385,11 @@ int uart_resume_port(struct uart_driver *reg, struct uart_port *port); | |||
387 | /* | 385 | /* |
388 | * The following are helper functions for the low level drivers. | 386 | * The following are helper functions for the low level drivers. |
389 | */ | 387 | */ |
390 | #ifdef SUPPORT_SYSRQ | ||
391 | static inline int | 388 | static inline int |
392 | uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, | 389 | uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, |
393 | struct pt_regs *regs) | 390 | struct pt_regs *regs) |
394 | { | 391 | { |
392 | #ifdef SUPPORT_SYSRQ | ||
395 | if (port->sysrq) { | 393 | if (port->sysrq) { |
396 | if (ch && time_before(jiffies, port->sysrq)) { | 394 | if (ch && time_before(jiffies, port->sysrq)) { |
397 | handle_sysrq(ch, regs, NULL); | 395 | handle_sysrq(ch, regs, NULL); |
@@ -400,11 +398,9 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, | |||
400 | } | 398 | } |
401 | port->sysrq = 0; | 399 | port->sysrq = 0; |
402 | } | 400 | } |
401 | #endif | ||
403 | return 0; | 402 | return 0; |
404 | } | 403 | } |
405 | #else | ||
406 | #define uart_handle_sysrq_char(port,ch,regs) (0) | ||
407 | #endif | ||
408 | 404 | ||
409 | /* | 405 | /* |
410 | * We do the SysRQ and SAK checking like this... | 406 | * We do the SysRQ and SAK checking like this... |
@@ -468,13 +464,13 @@ uart_handle_cts_change(struct uart_port *port, unsigned int status) | |||
468 | if (tty->hw_stopped) { | 464 | if (tty->hw_stopped) { |
469 | if (status) { | 465 | if (status) { |
470 | tty->hw_stopped = 0; | 466 | tty->hw_stopped = 0; |
471 | port->ops->start_tx(port, 0); | 467 | port->ops->start_tx(port); |
472 | uart_write_wakeup(port); | 468 | uart_write_wakeup(port); |
473 | } | 469 | } |
474 | } else { | 470 | } else { |
475 | if (!status) { | 471 | if (!status) { |
476 | tty->hw_stopped = 1; | 472 | tty->hw_stopped = 1; |
477 | port->ops->stop_tx(port, 0); | 473 | port->ops->stop_tx(port); |
478 | } | 474 | } |
479 | } | 475 | } |
480 | } | 476 | } |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 948527e42a60..da7da9c0ed1b 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -155,16 +155,29 @@ struct skb_shared_info { | |||
155 | #define SKB_DATAREF_SHIFT 16 | 155 | #define SKB_DATAREF_SHIFT 16 |
156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) | 156 | #define SKB_DATAREF_MASK ((1 << SKB_DATAREF_SHIFT) - 1) |
157 | 157 | ||
158 | extern struct timeval skb_tv_base; | ||
159 | |||
160 | struct skb_timeval { | ||
161 | u32 off_sec; | ||
162 | u32 off_usec; | ||
163 | }; | ||
164 | |||
165 | |||
166 | enum { | ||
167 | SKB_FCLONE_UNAVAILABLE, | ||
168 | SKB_FCLONE_ORIG, | ||
169 | SKB_FCLONE_CLONE, | ||
170 | }; | ||
171 | |||
158 | /** | 172 | /** |
159 | * struct sk_buff - socket buffer | 173 | * struct sk_buff - socket buffer |
160 | * @next: Next buffer in list | 174 | * @next: Next buffer in list |
161 | * @prev: Previous buffer in list | 175 | * @prev: Previous buffer in list |
162 | * @list: List we are on | 176 | * @list: List we are on |
163 | * @sk: Socket we are owned by | 177 | * @sk: Socket we are owned by |
164 | * @stamp: Time we arrived | 178 | * @tstamp: Time we arrived stored as offset to skb_tv_base |
165 | * @dev: Device we arrived on/are leaving by | 179 | * @dev: Device we arrived on/are leaving by |
166 | * @input_dev: Device we arrived on | 180 | * @input_dev: Device we arrived on |
167 | * @real_dev: The real device we are using | ||
168 | * @h: Transport layer header | 181 | * @h: Transport layer header |
169 | * @nh: Network layer header | 182 | * @nh: Network layer header |
170 | * @mac: Link layer header | 183 | * @mac: Link layer header |
@@ -190,14 +203,11 @@ struct skb_shared_info { | |||
190 | * @end: End pointer | 203 | * @end: End pointer |
191 | * @destructor: Destruct function | 204 | * @destructor: Destruct function |
192 | * @nfmark: Can be used for communication between hooks | 205 | * @nfmark: Can be used for communication between hooks |
193 | * @nfcache: Cache info | ||
194 | * @nfct: Associated connection, if any | 206 | * @nfct: Associated connection, if any |
195 | * @nfctinfo: Relationship of this skb to the connection | 207 | * @nfctinfo: Relationship of this skb to the connection |
196 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 208 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
197 | * @private: Data which is private to the HIPPI implementation | ||
198 | * @tc_index: Traffic control index | 209 | * @tc_index: Traffic control index |
199 | * @tc_verd: traffic control verdict | 210 | * @tc_verd: traffic control verdict |
200 | * @tc_classid: traffic control classid | ||
201 | */ | 211 | */ |
202 | 212 | ||
203 | struct sk_buff { | 213 | struct sk_buff { |
@@ -205,12 +215,10 @@ struct sk_buff { | |||
205 | struct sk_buff *next; | 215 | struct sk_buff *next; |
206 | struct sk_buff *prev; | 216 | struct sk_buff *prev; |
207 | 217 | ||
208 | struct sk_buff_head *list; | ||
209 | struct sock *sk; | 218 | struct sock *sk; |
210 | struct timeval stamp; | 219 | struct skb_timeval tstamp; |
211 | struct net_device *dev; | 220 | struct net_device *dev; |
212 | struct net_device *input_dev; | 221 | struct net_device *input_dev; |
213 | struct net_device *real_dev; | ||
214 | 222 | ||
215 | union { | 223 | union { |
216 | struct tcphdr *th; | 224 | struct tcphdr *th; |
@@ -252,33 +260,28 @@ struct sk_buff { | |||
252 | __u8 local_df:1, | 260 | __u8 local_df:1, |
253 | cloned:1, | 261 | cloned:1, |
254 | ip_summed:2, | 262 | ip_summed:2, |
255 | nohdr:1; | 263 | nohdr:1, |
256 | /* 3 bits spare */ | 264 | nfctinfo:3; |
257 | __u8 pkt_type; | 265 | __u8 pkt_type:3, |
266 | fclone:2; | ||
258 | __be16 protocol; | 267 | __be16 protocol; |
259 | 268 | ||
260 | void (*destructor)(struct sk_buff *skb); | 269 | void (*destructor)(struct sk_buff *skb); |
261 | #ifdef CONFIG_NETFILTER | 270 | #ifdef CONFIG_NETFILTER |
262 | unsigned long nfmark; | 271 | __u32 nfmark; |
263 | __u32 nfcache; | ||
264 | __u32 nfctinfo; | ||
265 | struct nf_conntrack *nfct; | 272 | struct nf_conntrack *nfct; |
273 | #if defined(CONFIG_IP_VS) || defined(CONFIG_IP_VS_MODULE) | ||
274 | __u8 ipvs_property:1; | ||
275 | #endif | ||
266 | #ifdef CONFIG_BRIDGE_NETFILTER | 276 | #ifdef CONFIG_BRIDGE_NETFILTER |
267 | struct nf_bridge_info *nf_bridge; | 277 | struct nf_bridge_info *nf_bridge; |
268 | #endif | 278 | #endif |
269 | #endif /* CONFIG_NETFILTER */ | 279 | #endif /* CONFIG_NETFILTER */ |
270 | #if defined(CONFIG_HIPPI) | ||
271 | union { | ||
272 | __u32 ifield; | ||
273 | } private; | ||
274 | #endif | ||
275 | #ifdef CONFIG_NET_SCHED | 280 | #ifdef CONFIG_NET_SCHED |
276 | __u32 tc_index; /* traffic control index */ | 281 | __u16 tc_index; /* traffic control index */ |
277 | #ifdef CONFIG_NET_CLS_ACT | 282 | #ifdef CONFIG_NET_CLS_ACT |
278 | __u32 tc_verd; /* traffic control verdict */ | 283 | __u16 tc_verd; /* traffic control verdict */ |
279 | __u32 tc_classid; /* traffic control classid */ | ||
280 | #endif | 284 | #endif |
281 | |||
282 | #endif | 285 | #endif |
283 | 286 | ||
284 | 287 | ||
@@ -300,8 +303,20 @@ struct sk_buff { | |||
300 | #include <asm/system.h> | 303 | #include <asm/system.h> |
301 | 304 | ||
302 | extern void __kfree_skb(struct sk_buff *skb); | 305 | extern void __kfree_skb(struct sk_buff *skb); |
303 | extern struct sk_buff *alloc_skb(unsigned int size, | 306 | extern struct sk_buff *__alloc_skb(unsigned int size, |
304 | unsigned int __nocast priority); | 307 | unsigned int __nocast priority, int fclone); |
308 | static inline struct sk_buff *alloc_skb(unsigned int size, | ||
309 | unsigned int __nocast priority) | ||
310 | { | ||
311 | return __alloc_skb(size, priority, 0); | ||
312 | } | ||
313 | |||
314 | static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | ||
315 | unsigned int __nocast priority) | ||
316 | { | ||
317 | return __alloc_skb(size, priority, 1); | ||
318 | } | ||
319 | |||
305 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, | 320 | extern struct sk_buff *alloc_skb_from_cache(kmem_cache_t *cp, |
306 | unsigned int size, | 321 | unsigned int size, |
307 | unsigned int __nocast priority); | 322 | unsigned int __nocast priority); |
@@ -597,7 +612,6 @@ static inline void __skb_queue_head(struct sk_buff_head *list, | |||
597 | { | 612 | { |
598 | struct sk_buff *prev, *next; | 613 | struct sk_buff *prev, *next; |
599 | 614 | ||
600 | newsk->list = list; | ||
601 | list->qlen++; | 615 | list->qlen++; |
602 | prev = (struct sk_buff *)list; | 616 | prev = (struct sk_buff *)list; |
603 | next = prev->next; | 617 | next = prev->next; |
@@ -622,7 +636,6 @@ static inline void __skb_queue_tail(struct sk_buff_head *list, | |||
622 | { | 636 | { |
623 | struct sk_buff *prev, *next; | 637 | struct sk_buff *prev, *next; |
624 | 638 | ||
625 | newsk->list = list; | ||
626 | list->qlen++; | 639 | list->qlen++; |
627 | next = (struct sk_buff *)list; | 640 | next = (struct sk_buff *)list; |
628 | prev = next->prev; | 641 | prev = next->prev; |
@@ -655,7 +668,6 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | |||
655 | next->prev = prev; | 668 | next->prev = prev; |
656 | prev->next = next; | 669 | prev->next = next; |
657 | result->next = result->prev = NULL; | 670 | result->next = result->prev = NULL; |
658 | result->list = NULL; | ||
659 | } | 671 | } |
660 | return result; | 672 | return result; |
661 | } | 673 | } |
@@ -664,7 +676,7 @@ static inline struct sk_buff *__skb_dequeue(struct sk_buff_head *list) | |||
664 | /* | 676 | /* |
665 | * Insert a packet on a list. | 677 | * Insert a packet on a list. |
666 | */ | 678 | */ |
667 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk); | 679 | extern void skb_insert(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); |
668 | static inline void __skb_insert(struct sk_buff *newsk, | 680 | static inline void __skb_insert(struct sk_buff *newsk, |
669 | struct sk_buff *prev, struct sk_buff *next, | 681 | struct sk_buff *prev, struct sk_buff *next, |
670 | struct sk_buff_head *list) | 682 | struct sk_buff_head *list) |
@@ -672,24 +684,23 @@ static inline void __skb_insert(struct sk_buff *newsk, | |||
672 | newsk->next = next; | 684 | newsk->next = next; |
673 | newsk->prev = prev; | 685 | newsk->prev = prev; |
674 | next->prev = prev->next = newsk; | 686 | next->prev = prev->next = newsk; |
675 | newsk->list = list; | ||
676 | list->qlen++; | 687 | list->qlen++; |
677 | } | 688 | } |
678 | 689 | ||
679 | /* | 690 | /* |
680 | * Place a packet after a given packet in a list. | 691 | * Place a packet after a given packet in a list. |
681 | */ | 692 | */ |
682 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk); | 693 | extern void skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list); |
683 | static inline void __skb_append(struct sk_buff *old, struct sk_buff *newsk) | 694 | static inline void __skb_append(struct sk_buff *old, struct sk_buff *newsk, struct sk_buff_head *list) |
684 | { | 695 | { |
685 | __skb_insert(newsk, old, old->next, old->list); | 696 | __skb_insert(newsk, old, old->next, list); |
686 | } | 697 | } |
687 | 698 | ||
688 | /* | 699 | /* |
689 | * remove sk_buff from list. _Must_ be called atomically, and with | 700 | * remove sk_buff from list. _Must_ be called atomically, and with |
690 | * the list known.. | 701 | * the list known.. |
691 | */ | 702 | */ |
692 | extern void skb_unlink(struct sk_buff *skb); | 703 | extern void skb_unlink(struct sk_buff *skb, struct sk_buff_head *list); |
693 | static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | 704 | static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) |
694 | { | 705 | { |
695 | struct sk_buff *next, *prev; | 706 | struct sk_buff *next, *prev; |
@@ -698,7 +709,6 @@ static inline void __skb_unlink(struct sk_buff *skb, struct sk_buff_head *list) | |||
698 | next = skb->next; | 709 | next = skb->next; |
699 | prev = skb->prev; | 710 | prev = skb->prev; |
700 | skb->next = skb->prev = NULL; | 711 | skb->next = skb->prev = NULL; |
701 | skb->list = NULL; | ||
702 | next->prev = prev; | 712 | next->prev = prev; |
703 | prev->next = next; | 713 | prev->next = next; |
704 | } | 714 | } |
@@ -1213,6 +1223,8 @@ extern void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to); | |||
1213 | extern void skb_split(struct sk_buff *skb, | 1223 | extern void skb_split(struct sk_buff *skb, |
1214 | struct sk_buff *skb1, const u32 len); | 1224 | struct sk_buff *skb1, const u32 len); |
1215 | 1225 | ||
1226 | extern void skb_release_data(struct sk_buff *skb); | ||
1227 | |||
1216 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | 1228 | static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, |
1217 | int len, void *buffer) | 1229 | int len, void *buffer) |
1218 | { | 1230 | { |
@@ -1230,6 +1242,42 @@ static inline void *skb_header_pointer(const struct sk_buff *skb, int offset, | |||
1230 | extern void skb_init(void); | 1242 | extern void skb_init(void); |
1231 | extern void skb_add_mtu(int mtu); | 1243 | extern void skb_add_mtu(int mtu); |
1232 | 1244 | ||
1245 | /** | ||
1246 | * skb_get_timestamp - get timestamp from a skb | ||
1247 | * @skb: skb to get stamp from | ||
1248 | * @stamp: pointer to struct timeval to store stamp in | ||
1249 | * | ||
1250 | * Timestamps are stored in the skb as offsets to a base timestamp. | ||
1251 | * This function converts the offset back to a struct timeval and stores | ||
1252 | * it in stamp. | ||
1253 | */ | ||
1254 | static inline void skb_get_timestamp(const struct sk_buff *skb, struct timeval *stamp) | ||
1255 | { | ||
1256 | stamp->tv_sec = skb->tstamp.off_sec; | ||
1257 | stamp->tv_usec = skb->tstamp.off_usec; | ||
1258 | if (skb->tstamp.off_sec) { | ||
1259 | stamp->tv_sec += skb_tv_base.tv_sec; | ||
1260 | stamp->tv_usec += skb_tv_base.tv_usec; | ||
1261 | } | ||
1262 | } | ||
1263 | |||
1264 | /** | ||
1265 | * skb_set_timestamp - set timestamp of a skb | ||
1266 | * @skb: skb to set stamp of | ||
1267 | * @stamp: pointer to struct timeval to get stamp from | ||
1268 | * | ||
1269 | * Timestamps are stored in the skb as offsets to a base timestamp. | ||
1270 | * This function converts a struct timeval to an offset and stores | ||
1271 | * it in the skb. | ||
1272 | */ | ||
1273 | static inline void skb_set_timestamp(struct sk_buff *skb, const struct timeval *stamp) | ||
1274 | { | ||
1275 | skb->tstamp.off_sec = stamp->tv_sec - skb_tv_base.tv_sec; | ||
1276 | skb->tstamp.off_usec = stamp->tv_usec - skb_tv_base.tv_usec; | ||
1277 | } | ||
1278 | |||
1279 | extern void __net_timestamp(struct sk_buff *skb); | ||
1280 | |||
1233 | #ifdef CONFIG_NETFILTER | 1281 | #ifdef CONFIG_NETFILTER |
1234 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 1282 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
1235 | { | 1283 | { |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 80b2dfde2e80..42a6bea58af3 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -99,7 +99,21 @@ found: | |||
99 | return __kmalloc(size, flags); | 99 | return __kmalloc(size, flags); |
100 | } | 100 | } |
101 | 101 | ||
102 | extern void *kcalloc(size_t, size_t, unsigned int __nocast); | 102 | extern void *kzalloc(size_t, unsigned int __nocast); |
103 | |||
104 | /** | ||
105 | * kcalloc - allocate memory for an array. The memory is set to zero. | ||
106 | * @n: number of elements. | ||
107 | * @size: element size. | ||
108 | * @flags: the type of memory to allocate. | ||
109 | */ | ||
110 | static inline void *kcalloc(size_t n, size_t size, unsigned int __nocast flags) | ||
111 | { | ||
112 | if (n != 0 && size > INT_MAX / n) | ||
113 | return NULL; | ||
114 | return kzalloc(n * size, flags); | ||
115 | } | ||
116 | |||
103 | extern void kfree(const void *); | 117 | extern void kfree(const void *); |
104 | extern unsigned int ksize(const void *); | 118 | extern unsigned int ksize(const void *); |
105 | 119 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index a5c7d96e4d2e..1739c2d5b95b 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -26,6 +26,13 @@ struct __kernel_sockaddr_storage { | |||
26 | #include <linux/types.h> /* pid_t */ | 26 | #include <linux/types.h> /* pid_t */ |
27 | #include <linux/compiler.h> /* __user */ | 27 | #include <linux/compiler.h> /* __user */ |
28 | 28 | ||
29 | extern int sysctl_somaxconn; | ||
30 | extern void sock_init(void); | ||
31 | #ifdef CONFIG_PROC_FS | ||
32 | struct seq_file; | ||
33 | extern void socket_seq_show(struct seq_file *seq); | ||
34 | #endif | ||
35 | |||
29 | typedef unsigned short sa_family_t; | 36 | typedef unsigned short sa_family_t; |
30 | 37 | ||
31 | /* | 38 | /* |
@@ -271,6 +278,8 @@ struct ucred { | |||
271 | #define SOL_IRDA 266 | 278 | #define SOL_IRDA 266 |
272 | #define SOL_NETBEUI 267 | 279 | #define SOL_NETBEUI 267 |
273 | #define SOL_LLC 268 | 280 | #define SOL_LLC 268 |
281 | #define SOL_DCCP 269 | ||
282 | #define SOL_NETLINK 270 | ||
274 | 283 | ||
275 | /* IPX options */ | 284 | /* IPX options */ |
276 | #define IPX_TYPE 1 | 285 | #define IPX_TYPE 1 |
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h index 768cbba617d0..f56d24734950 100644 --- a/include/linux/sonypi.h +++ b/include/linux/sonypi.h | |||
@@ -99,6 +99,8 @@ | |||
99 | #define SONYPI_EVENT_BATTERY_INSERT 57 | 99 | #define SONYPI_EVENT_BATTERY_INSERT 57 |
100 | #define SONYPI_EVENT_BATTERY_REMOVE 58 | 100 | #define SONYPI_EVENT_BATTERY_REMOVE 58 |
101 | #define SONYPI_EVENT_FNKEY_RELEASED 59 | 101 | #define SONYPI_EVENT_FNKEY_RELEASED 59 |
102 | #define SONYPI_EVENT_WIRELESS_ON 60 | ||
103 | #define SONYPI_EVENT_WIRELESS_OFF 61 | ||
102 | 104 | ||
103 | /* get/set brightness */ | 105 | /* get/set brightness */ |
104 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) | 106 | #define SONYPI_IOCGBRT _IOR('v', 0, __u8) |
diff --git a/include/linux/sound.h b/include/linux/sound.h index 428f59794f48..72b9af4c3fd4 100644 --- a/include/linux/sound.h +++ b/include/linux/sound.h | |||
@@ -29,7 +29,9 @@ | |||
29 | * Sound core interface functions | 29 | * Sound core interface functions |
30 | */ | 30 | */ |
31 | 31 | ||
32 | struct device; | ||
32 | extern int register_sound_special(struct file_operations *fops, int unit); | 33 | extern int register_sound_special(struct file_operations *fops, int unit); |
34 | extern int register_sound_special_device(struct file_operations *fops, int unit, struct device *dev); | ||
33 | extern int register_sound_mixer(struct file_operations *fops, int dev); | 35 | extern int register_sound_mixer(struct file_operations *fops, int dev); |
34 | extern int register_sound_midi(struct file_operations *fops, int dev); | 36 | extern int register_sound_midi(struct file_operations *fops, int dev); |
35 | extern int register_sound_dsp(struct file_operations *fops, int dev); | 37 | extern int register_sound_dsp(struct file_operations *fops, int dev); |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index 6864063d1b9f..c4e3ea7cf154 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -60,6 +60,7 @@ struct cache_head { | |||
60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ | 60 | #define CACHE_NEW_EXPIRY 120 /* keep new things pending confirmation for 120 seconds */ |
61 | 61 | ||
62 | struct cache_detail { | 62 | struct cache_detail { |
63 | struct module * owner; | ||
63 | int hash_size; | 64 | int hash_size; |
64 | struct cache_head ** hash_table; | 65 | struct cache_head ** hash_table; |
65 | rwlock_t hash_lock; | 66 | rwlock_t hash_lock; |
diff --git a/include/linux/swap.h b/include/linux/swap.h index bfe3e763ccf2..3c9ff0048153 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -107,6 +107,8 @@ enum { | |||
107 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ | 107 | SWP_USED = (1 << 0), /* is slot in swap_info[] used? */ |
108 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ | 108 | SWP_WRITEOK = (1 << 1), /* ok to write to this swap? */ |
109 | SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), | 109 | SWP_ACTIVE = (SWP_USED | SWP_WRITEOK), |
110 | /* add others here before... */ | ||
111 | SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ | ||
110 | }; | 112 | }; |
111 | 113 | ||
112 | #define SWAP_CLUSTER_MAX 32 | 114 | #define SWAP_CLUSTER_MAX 32 |
@@ -116,16 +118,13 @@ enum { | |||
116 | 118 | ||
117 | /* | 119 | /* |
118 | * The in-memory structure used to track swap areas. | 120 | * The in-memory structure used to track swap areas. |
119 | * extent_list.prev points at the lowest-index extent. That list is | ||
120 | * sorted. | ||
121 | */ | 121 | */ |
122 | struct swap_info_struct { | 122 | struct swap_info_struct { |
123 | unsigned int flags; | 123 | unsigned int flags; |
124 | spinlock_t sdev_lock; | 124 | int prio; /* swap priority */ |
125 | struct file *swap_file; | 125 | struct file *swap_file; |
126 | struct block_device *bdev; | 126 | struct block_device *bdev; |
127 | struct list_head extent_list; | 127 | struct list_head extent_list; |
128 | int nr_extents; | ||
129 | struct swap_extent *curr_swap_extent; | 128 | struct swap_extent *curr_swap_extent; |
130 | unsigned old_block_size; | 129 | unsigned old_block_size; |
131 | unsigned short * swap_map; | 130 | unsigned short * swap_map; |
@@ -133,10 +132,9 @@ struct swap_info_struct { | |||
133 | unsigned int highest_bit; | 132 | unsigned int highest_bit; |
134 | unsigned int cluster_next; | 133 | unsigned int cluster_next; |
135 | unsigned int cluster_nr; | 134 | unsigned int cluster_nr; |
136 | int prio; /* swap priority */ | 135 | unsigned int pages; |
137 | int pages; | 136 | unsigned int max; |
138 | unsigned long max; | 137 | unsigned int inuse_pages; |
139 | unsigned long inuse_pages; | ||
140 | int next; /* next entry on swap list */ | 138 | int next; /* next entry on swap list */ |
141 | }; | 139 | }; |
142 | 140 | ||
@@ -222,13 +220,7 @@ extern int can_share_swap_page(struct page *); | |||
222 | extern int remove_exclusive_swap_page(struct page *); | 220 | extern int remove_exclusive_swap_page(struct page *); |
223 | struct backing_dev_info; | 221 | struct backing_dev_info; |
224 | 222 | ||
225 | extern struct swap_list_t swap_list; | 223 | extern spinlock_t swap_lock; |
226 | extern spinlock_t swaplock; | ||
227 | |||
228 | #define swap_list_lock() spin_lock(&swaplock) | ||
229 | #define swap_list_unlock() spin_unlock(&swaplock) | ||
230 | #define swap_device_lock(p) spin_lock(&p->sdev_lock) | ||
231 | #define swap_device_unlock(p) spin_unlock(&p->sdev_lock) | ||
232 | 224 | ||
233 | /* linux/mm/thrash.c */ | 225 | /* linux/mm/thrash.c */ |
234 | extern struct mm_struct * swap_token_mm; | 226 | extern struct mm_struct * swap_token_mm; |
diff --git a/include/linux/swapops.h b/include/linux/swapops.h index d4c7db35e708..87b9d14c710d 100644 --- a/include/linux/swapops.h +++ b/include/linux/swapops.h | |||
@@ -4,7 +4,7 @@ | |||
4 | * the low-order bits. | 4 | * the low-order bits. |
5 | * | 5 | * |
6 | * We arrange the `type' and `offset' fields so that `type' is at the five | 6 | * We arrange the `type' and `offset' fields so that `type' is at the five |
7 | * high-order bits of the smp_entry_t and `offset' is right-aligned in the | 7 | * high-order bits of the swp_entry_t and `offset' is right-aligned in the |
8 | * remaining bits. | 8 | * remaining bits. |
9 | * | 9 | * |
10 | * swp_entry_t's are *never* stored anywhere in their arch-dependent format. | 10 | * swp_entry_t's are *never* stored anywhere in their arch-dependent format. |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index e82be96d4906..532a6c5c24e9 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -711,6 +711,7 @@ enum { | |||
711 | DEV_RAID=4, | 711 | DEV_RAID=4, |
712 | DEV_MAC_HID=5, | 712 | DEV_MAC_HID=5, |
713 | DEV_SCSI=6, | 713 | DEV_SCSI=6, |
714 | DEV_IPMI=7, | ||
714 | }; | 715 | }; |
715 | 716 | ||
716 | /* /proc/sys/dev/cdrom */ | 717 | /* /proc/sys/dev/cdrom */ |
@@ -776,6 +777,11 @@ enum { | |||
776 | DEV_SCSI_LOGGING_LEVEL=1, | 777 | DEV_SCSI_LOGGING_LEVEL=1, |
777 | }; | 778 | }; |
778 | 779 | ||
780 | /* /proc/sys/dev/ipmi */ | ||
781 | enum { | ||
782 | DEV_IPMI_POWEROFF_POWERCYCLE=1, | ||
783 | }; | ||
784 | |||
779 | /* /proc/sys/abi */ | 785 | /* /proc/sys/abi */ |
780 | enum | 786 | enum |
781 | { | 787 | { |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index e4fd82e42104..ac4ca44c75ca 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -55,24 +55,6 @@ struct tcphdr { | |||
55 | __u16 urg_ptr; | 55 | __u16 urg_ptr; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | |||
59 | enum { | ||
60 | TCP_ESTABLISHED = 1, | ||
61 | TCP_SYN_SENT, | ||
62 | TCP_SYN_RECV, | ||
63 | TCP_FIN_WAIT1, | ||
64 | TCP_FIN_WAIT2, | ||
65 | TCP_TIME_WAIT, | ||
66 | TCP_CLOSE, | ||
67 | TCP_CLOSE_WAIT, | ||
68 | TCP_LAST_ACK, | ||
69 | TCP_LISTEN, | ||
70 | TCP_CLOSING, /* now a valid state */ | ||
71 | |||
72 | TCP_MAX_STATES /* Leave at the end! */ | ||
73 | }; | ||
74 | |||
75 | #define TCP_STATE_MASK 0xF | ||
76 | #define TCP_ACTION_FIN (1 << 7) | 58 | #define TCP_ACTION_FIN (1 << 7) |
77 | 59 | ||
78 | enum { | 60 | enum { |
@@ -195,8 +177,9 @@ struct tcp_info | |||
195 | 177 | ||
196 | #include <linux/config.h> | 178 | #include <linux/config.h> |
197 | #include <linux/skbuff.h> | 179 | #include <linux/skbuff.h> |
198 | #include <linux/ip.h> | ||
199 | #include <net/sock.h> | 180 | #include <net/sock.h> |
181 | #include <net/inet_connection_sock.h> | ||
182 | #include <net/inet_timewait_sock.h> | ||
200 | 183 | ||
201 | /* This defines a selective acknowledgement block. */ | 184 | /* This defines a selective acknowledgement block. */ |
202 | struct tcp_sack_block { | 185 | struct tcp_sack_block { |
@@ -236,8 +219,8 @@ static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | |||
236 | } | 219 | } |
237 | 220 | ||
238 | struct tcp_sock { | 221 | struct tcp_sock { |
239 | /* inet_sock has to be the first member of tcp_sock */ | 222 | /* inet_connection_sock has to be the first member of tcp_sock */ |
240 | struct inet_sock inet; | 223 | struct inet_connection_sock inet_conn; |
241 | int tcp_header_len; /* Bytes of tcp header to send */ | 224 | int tcp_header_len; /* Bytes of tcp header to send */ |
242 | 225 | ||
243 | /* | 226 | /* |
@@ -258,19 +241,6 @@ struct tcp_sock { | |||
258 | __u32 snd_sml; /* Last byte of the most recently transmitted small packet */ | 241 | __u32 snd_sml; /* Last byte of the most recently transmitted small packet */ |
259 | __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ | 242 | __u32 rcv_tstamp; /* timestamp of last received ACK (for keepalives) */ |
260 | __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ | 243 | __u32 lsndtime; /* timestamp of last sent data packet (for restart window) */ |
261 | struct tcp_bind_bucket *bind_hash; | ||
262 | /* Delayed ACK control data */ | ||
263 | struct { | ||
264 | __u8 pending; /* ACK is pending */ | ||
265 | __u8 quick; /* Scheduled number of quick acks */ | ||
266 | __u8 pingpong; /* The session is interactive */ | ||
267 | __u8 blocked; /* Delayed ACK was blocked by socket lock*/ | ||
268 | __u32 ato; /* Predicted tick of soft clock */ | ||
269 | unsigned long timeout; /* Currently scheduled timeout */ | ||
270 | __u32 lrcvtime; /* timestamp of last received data packet*/ | ||
271 | __u16 last_seg_size; /* Size of last incoming segment */ | ||
272 | __u16 rcv_mss; /* MSS used for delayed ACK decisions */ | ||
273 | } ack; | ||
274 | 244 | ||
275 | /* Data for direct copy to user */ | 245 | /* Data for direct copy to user */ |
276 | struct { | 246 | struct { |
@@ -288,19 +258,15 @@ struct tcp_sock { | |||
288 | __u32 mss_cache; /* Cached effective mss, not including SACKS */ | 258 | __u32 mss_cache; /* Cached effective mss, not including SACKS */ |
289 | __u16 xmit_size_goal; /* Goal for segmenting output packets */ | 259 | __u16 xmit_size_goal; /* Goal for segmenting output packets */ |
290 | __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ | 260 | __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ |
291 | __u8 ca_state; /* State of fast-retransmit machine */ | ||
292 | __u8 retransmits; /* Number of unrecovered RTO timeouts. */ | ||
293 | 261 | ||
294 | __u16 advmss; /* Advertised MSS */ | ||
295 | __u32 window_clamp; /* Maximal window to advertise */ | 262 | __u32 window_clamp; /* Maximal window to advertise */ |
296 | __u32 rcv_ssthresh; /* Current window clamp */ | 263 | __u32 rcv_ssthresh; /* Current window clamp */ |
297 | 264 | ||
298 | __u32 frto_highmark; /* snd_nxt when RTO occurred */ | 265 | __u32 frto_highmark; /* snd_nxt when RTO occurred */ |
299 | __u8 reordering; /* Packet reordering metric. */ | 266 | __u8 reordering; /* Packet reordering metric. */ |
300 | __u8 frto_counter; /* Number of new acks after RTO */ | 267 | __u8 frto_counter; /* Number of new acks after RTO */ |
301 | 268 | __u8 nonagle; /* Disable Nagle algorithm? */ | |
302 | __u8 unused; | 269 | __u8 keepalive_probes; /* num of allowed keep alive probes */ |
303 | __u8 defer_accept; /* User waits for some data after accept() */ | ||
304 | 270 | ||
305 | /* RTT measurement */ | 271 | /* RTT measurement */ |
306 | __u32 srtt; /* smoothed round trip time << 3 */ | 272 | __u32 srtt; /* smoothed round trip time << 3 */ |
@@ -308,19 +274,13 @@ struct tcp_sock { | |||
308 | __u32 mdev_max; /* maximal mdev for the last rtt period */ | 274 | __u32 mdev_max; /* maximal mdev for the last rtt period */ |
309 | __u32 rttvar; /* smoothed mdev_max */ | 275 | __u32 rttvar; /* smoothed mdev_max */ |
310 | __u32 rtt_seq; /* sequence number to update rttvar */ | 276 | __u32 rtt_seq; /* sequence number to update rttvar */ |
311 | __u32 rto; /* retransmit timeout */ | ||
312 | 277 | ||
313 | __u32 packets_out; /* Packets which are "in flight" */ | 278 | __u32 packets_out; /* Packets which are "in flight" */ |
314 | __u32 left_out; /* Packets which leaved network */ | 279 | __u32 left_out; /* Packets which leaved network */ |
315 | __u32 retrans_out; /* Retransmitted packets out */ | 280 | __u32 retrans_out; /* Retransmitted packets out */ |
316 | __u8 backoff; /* backoff */ | ||
317 | /* | 281 | /* |
318 | * Options received (usually on last packet, some only on SYN packets). | 282 | * Options received (usually on last packet, some only on SYN packets). |
319 | */ | 283 | */ |
320 | __u8 nonagle; /* Disable Nagle algorithm? */ | ||
321 | __u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
322 | |||
323 | __u8 probes_out; /* unanswered 0 window probes */ | ||
324 | struct tcp_options_received rx_opt; | 284 | struct tcp_options_received rx_opt; |
325 | 285 | ||
326 | /* | 286 | /* |
@@ -333,11 +293,6 @@ struct tcp_sock { | |||
333 | __u32 snd_cwnd_used; | 293 | __u32 snd_cwnd_used; |
334 | __u32 snd_cwnd_stamp; | 294 | __u32 snd_cwnd_stamp; |
335 | 295 | ||
336 | /* Two commonly used timers in both sender and receiver paths. */ | ||
337 | unsigned long timeout; | ||
338 | struct timer_list retransmit_timer; /* Resend (no ack) */ | ||
339 | struct timer_list delack_timer; /* Ack delay */ | ||
340 | |||
341 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 296 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ |
342 | 297 | ||
343 | struct tcp_func *af_specific; /* Operations which are AF_INET{4,6} specific */ | 298 | struct tcp_func *af_specific; /* Operations which are AF_INET{4,6} specific */ |
@@ -352,8 +307,7 @@ struct tcp_sock { | |||
352 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ | 307 | struct tcp_sack_block duplicate_sack[1]; /* D-SACK block */ |
353 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ | 308 | struct tcp_sack_block selective_acks[4]; /* The SACKS themselves*/ |
354 | 309 | ||
355 | __u8 syn_retries; /* num of allowed syn retries */ | 310 | __u16 advmss; /* Advertised MSS */ |
356 | __u8 ecn_flags; /* ECN status bits. */ | ||
357 | __u16 prior_ssthresh; /* ssthresh saved at recovery start */ | 311 | __u16 prior_ssthresh; /* ssthresh saved at recovery start */ |
358 | __u32 lost_out; /* Lost packets */ | 312 | __u32 lost_out; /* Lost packets */ |
359 | __u32 sacked_out; /* SACK'd packets */ | 313 | __u32 sacked_out; /* SACK'd packets */ |
@@ -367,14 +321,12 @@ struct tcp_sock { | |||
367 | int undo_retrans; /* number of undoable retransmissions. */ | 321 | int undo_retrans; /* number of undoable retransmissions. */ |
368 | __u32 urg_seq; /* Seq of received urgent pointer */ | 322 | __u32 urg_seq; /* Seq of received urgent pointer */ |
369 | __u16 urg_data; /* Saved octet of OOB data and control flags */ | 323 | __u16 urg_data; /* Saved octet of OOB data and control flags */ |
370 | __u8 pending; /* Scheduled timer event */ | ||
371 | __u8 urg_mode; /* In urgent mode */ | 324 | __u8 urg_mode; /* In urgent mode */ |
325 | __u8 ecn_flags; /* ECN status bits. */ | ||
372 | __u32 snd_up; /* Urgent pointer */ | 326 | __u32 snd_up; /* Urgent pointer */ |
373 | 327 | ||
374 | __u32 total_retrans; /* Total retransmits for entire connection */ | 328 | __u32 total_retrans; /* Total retransmits for entire connection */ |
375 | 329 | ||
376 | struct request_sock_queue accept_queue; /* FIFO of established children */ | ||
377 | |||
378 | unsigned int keepalive_time; /* time before keep alive takes place */ | 330 | unsigned int keepalive_time; /* time before keep alive takes place */ |
379 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 331 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
380 | int linger2; | 332 | int linger2; |
@@ -394,11 +346,6 @@ struct tcp_sock { | |||
394 | __u32 seq; | 346 | __u32 seq; |
395 | __u32 time; | 347 | __u32 time; |
396 | } rcvq_space; | 348 | } rcvq_space; |
397 | |||
398 | /* Pluggable TCP congestion control hook */ | ||
399 | struct tcp_congestion_ops *ca_ops; | ||
400 | u32 ca_priv[16]; | ||
401 | #define TCP_CA_PRIV_SIZE (16*sizeof(u32)) | ||
402 | }; | 349 | }; |
403 | 350 | ||
404 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 351 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
@@ -406,9 +353,18 @@ static inline struct tcp_sock *tcp_sk(const struct sock *sk) | |||
406 | return (struct tcp_sock *)sk; | 353 | return (struct tcp_sock *)sk; |
407 | } | 354 | } |
408 | 355 | ||
409 | static inline void *tcp_ca(const struct tcp_sock *tp) | 356 | struct tcp_timewait_sock { |
357 | struct inet_timewait_sock tw_sk; | ||
358 | __u32 tw_rcv_nxt; | ||
359 | __u32 tw_snd_nxt; | ||
360 | __u32 tw_rcv_wnd; | ||
361 | __u32 tw_ts_recent; | ||
362 | long tw_ts_recent_stamp; | ||
363 | }; | ||
364 | |||
365 | static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) | ||
410 | { | 366 | { |
411 | return (void *) tp->ca_priv; | 367 | return (struct tcp_timewait_sock *)sk; |
412 | } | 368 | } |
413 | 369 | ||
414 | #endif | 370 | #endif |
diff --git a/include/linux/tcp_diag.h b/include/linux/tcp_diag.h deleted file mode 100644 index 7a5996743946..000000000000 --- a/include/linux/tcp_diag.h +++ /dev/null | |||
@@ -1,127 +0,0 @@ | |||
1 | #ifndef _TCP_DIAG_H_ | ||
2 | #define _TCP_DIAG_H_ 1 | ||
3 | |||
4 | /* Just some random number */ | ||
5 | #define TCPDIAG_GETSOCK 18 | ||
6 | |||
7 | /* Socket identity */ | ||
8 | struct tcpdiag_sockid | ||
9 | { | ||
10 | __u16 tcpdiag_sport; | ||
11 | __u16 tcpdiag_dport; | ||
12 | __u32 tcpdiag_src[4]; | ||
13 | __u32 tcpdiag_dst[4]; | ||
14 | __u32 tcpdiag_if; | ||
15 | __u32 tcpdiag_cookie[2]; | ||
16 | #define TCPDIAG_NOCOOKIE (~0U) | ||
17 | }; | ||
18 | |||
19 | /* Request structure */ | ||
20 | |||
21 | struct tcpdiagreq | ||
22 | { | ||
23 | __u8 tcpdiag_family; /* Family of addresses. */ | ||
24 | __u8 tcpdiag_src_len; | ||
25 | __u8 tcpdiag_dst_len; | ||
26 | __u8 tcpdiag_ext; /* Query extended information */ | ||
27 | |||
28 | struct tcpdiag_sockid id; | ||
29 | |||
30 | __u32 tcpdiag_states; /* States to dump */ | ||
31 | __u32 tcpdiag_dbs; /* Tables to dump (NI) */ | ||
32 | }; | ||
33 | |||
34 | enum | ||
35 | { | ||
36 | TCPDIAG_REQ_NONE, | ||
37 | TCPDIAG_REQ_BYTECODE, | ||
38 | }; | ||
39 | |||
40 | #define TCPDIAG_REQ_MAX TCPDIAG_REQ_BYTECODE | ||
41 | |||
42 | /* Bytecode is sequence of 4 byte commands followed by variable arguments. | ||
43 | * All the commands identified by "code" are conditional jumps forward: | ||
44 | * to offset cc+"yes" or to offset cc+"no". "yes" is supposed to be | ||
45 | * length of the command and its arguments. | ||
46 | */ | ||
47 | |||
48 | struct tcpdiag_bc_op | ||
49 | { | ||
50 | unsigned char code; | ||
51 | unsigned char yes; | ||
52 | unsigned short no; | ||
53 | }; | ||
54 | |||
55 | enum | ||
56 | { | ||
57 | TCPDIAG_BC_NOP, | ||
58 | TCPDIAG_BC_JMP, | ||
59 | TCPDIAG_BC_S_GE, | ||
60 | TCPDIAG_BC_S_LE, | ||
61 | TCPDIAG_BC_D_GE, | ||
62 | TCPDIAG_BC_D_LE, | ||
63 | TCPDIAG_BC_AUTO, | ||
64 | TCPDIAG_BC_S_COND, | ||
65 | TCPDIAG_BC_D_COND, | ||
66 | }; | ||
67 | |||
68 | struct tcpdiag_hostcond | ||
69 | { | ||
70 | __u8 family; | ||
71 | __u8 prefix_len; | ||
72 | int port; | ||
73 | __u32 addr[0]; | ||
74 | }; | ||
75 | |||
76 | /* Base info structure. It contains socket identity (addrs/ports/cookie) | ||
77 | * and, alas, the information shown by netstat. */ | ||
78 | struct tcpdiagmsg | ||
79 | { | ||
80 | __u8 tcpdiag_family; | ||
81 | __u8 tcpdiag_state; | ||
82 | __u8 tcpdiag_timer; | ||
83 | __u8 tcpdiag_retrans; | ||
84 | |||
85 | struct tcpdiag_sockid id; | ||
86 | |||
87 | __u32 tcpdiag_expires; | ||
88 | __u32 tcpdiag_rqueue; | ||
89 | __u32 tcpdiag_wqueue; | ||
90 | __u32 tcpdiag_uid; | ||
91 | __u32 tcpdiag_inode; | ||
92 | }; | ||
93 | |||
94 | /* Extensions */ | ||
95 | |||
96 | enum | ||
97 | { | ||
98 | TCPDIAG_NONE, | ||
99 | TCPDIAG_MEMINFO, | ||
100 | TCPDIAG_INFO, | ||
101 | TCPDIAG_VEGASINFO, | ||
102 | TCPDIAG_CONG, | ||
103 | }; | ||
104 | |||
105 | #define TCPDIAG_MAX TCPDIAG_CONG | ||
106 | |||
107 | |||
108 | /* TCPDIAG_MEM */ | ||
109 | |||
110 | struct tcpdiag_meminfo | ||
111 | { | ||
112 | __u32 tcpdiag_rmem; | ||
113 | __u32 tcpdiag_wmem; | ||
114 | __u32 tcpdiag_fmem; | ||
115 | __u32 tcpdiag_tmem; | ||
116 | }; | ||
117 | |||
118 | /* TCPDIAG_VEGASINFO */ | ||
119 | |||
120 | struct tcpvegas_info { | ||
121 | __u32 tcpv_enabled; | ||
122 | __u32 tcpv_rttcnt; | ||
123 | __u32 tcpv_rtt; | ||
124 | __u32 tcpv_minrtt; | ||
125 | }; | ||
126 | |||
127 | #endif /* _TCP_DIAG_H_ */ | ||
diff --git a/include/linux/time.h b/include/linux/time.h index 5634497ff5df..c10d4c21c183 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -97,7 +97,6 @@ extern int do_settimeofday(struct timespec *tv); | |||
97 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); | 97 | extern int do_sys_settimeofday(struct timespec *tv, struct timezone *tz); |
98 | extern void clock_was_set(void); // call when ever the clock is set | 98 | extern void clock_was_set(void); // call when ever the clock is set |
99 | extern int do_posix_clock_monotonic_gettime(struct timespec *tp); | 99 | extern int do_posix_clock_monotonic_gettime(struct timespec *tp); |
100 | extern long do_nanosleep(struct timespec *t); | ||
101 | extern long do_utimes(char __user * filename, struct timeval * times); | 100 | extern long do_utimes(char __user * filename, struct timeval * times); |
102 | struct itimerval; | 101 | struct itimerval; |
103 | extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); | 102 | extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 74fdd07d3792..7e050a2cc35b 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -260,6 +260,29 @@ extern long pps_calcnt; /* calibration intervals */ | |||
260 | extern long pps_errcnt; /* calibration errors */ | 260 | extern long pps_errcnt; /* calibration errors */ |
261 | extern long pps_stbcnt; /* stability limit exceeded */ | 261 | extern long pps_stbcnt; /* stability limit exceeded */ |
262 | 262 | ||
263 | /** | ||
264 | * ntp_clear - Clears the NTP state variables | ||
265 | * | ||
266 | * Must be called while holding a write on the xtime_lock | ||
267 | */ | ||
268 | static inline void ntp_clear(void) | ||
269 | { | ||
270 | time_adjust = 0; /* stop active adjtime() */ | ||
271 | time_status |= STA_UNSYNC; | ||
272 | time_maxerror = NTP_PHASE_LIMIT; | ||
273 | time_esterror = NTP_PHASE_LIMIT; | ||
274 | } | ||
275 | |||
276 | /** | ||
277 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC | ||
278 | * | ||
279 | */ | ||
280 | static inline int ntp_synced(void) | ||
281 | { | ||
282 | return !(time_status & STA_UNSYNC); | ||
283 | } | ||
284 | |||
285 | |||
263 | #ifdef CONFIG_TIME_INTERPOLATION | 286 | #ifdef CONFIG_TIME_INTERPOLATION |
264 | 287 | ||
265 | #define TIME_SOURCE_CPU 0 | 288 | #define TIME_SOURCE_CPU 0 |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 0320225e96da..3df1d474e5c5 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -135,6 +135,29 @@ | |||
135 | } | 135 | } |
136 | #endif | 136 | #endif |
137 | 137 | ||
138 | /* sched_domains SD_ALLNODES_INIT for NUMA machines */ | ||
139 | #define SD_ALLNODES_INIT (struct sched_domain) { \ | ||
140 | .span = CPU_MASK_NONE, \ | ||
141 | .parent = NULL, \ | ||
142 | .groups = NULL, \ | ||
143 | .min_interval = 64, \ | ||
144 | .max_interval = 64*num_online_cpus(), \ | ||
145 | .busy_factor = 128, \ | ||
146 | .imbalance_pct = 133, \ | ||
147 | .cache_hot_time = (10*1000000), \ | ||
148 | .cache_nice_tries = 1, \ | ||
149 | .busy_idx = 3, \ | ||
150 | .idle_idx = 3, \ | ||
151 | .newidle_idx = 0, /* unused */ \ | ||
152 | .wake_idx = 0, /* unused */ \ | ||
153 | .forkexec_idx = 0, /* unused */ \ | ||
154 | .per_cpu_gain = 100, \ | ||
155 | .flags = SD_LOAD_BALANCE, \ | ||
156 | .last_balance = jiffies, \ | ||
157 | .balance_interval = 64, \ | ||
158 | .nr_balance_failed = 0, \ | ||
159 | } | ||
160 | |||
138 | #ifdef CONFIG_NUMA | 161 | #ifdef CONFIG_NUMA |
139 | #ifndef SD_NODE_INIT | 162 | #ifndef SD_NODE_INIT |
140 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! | 163 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! |
diff --git a/include/linux/types.h b/include/linux/types.h index dcb13f865df9..2b678c22ca4a 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -123,6 +123,9 @@ typedef __u64 u_int64_t; | |||
123 | typedef __s64 int64_t; | 123 | typedef __s64 int64_t; |
124 | #endif | 124 | #endif |
125 | 125 | ||
126 | /* this is a special 64bit data type that is 8-byte aligned */ | ||
127 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) | ||
128 | |||
126 | /* | 129 | /* |
127 | * The type used for indexing onto a disc or disc partition. | 130 | * The type used for indexing onto a disc or disc partition. |
128 | * If required, asm/types.h can override it and define | 131 | * If required, asm/types.h can override it and define |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 6409d9cf5965..b244f69ef682 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -10,6 +10,14 @@ | |||
10 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 10 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
11 | /* bits [20..32] reserved for arch specific ioremap internals */ | 11 | /* bits [20..32] reserved for arch specific ioremap internals */ |
12 | 12 | ||
13 | /* | ||
14 | * Maximum alignment for ioremap() regions. | ||
15 | * Can be overriden by arch-specific value. | ||
16 | */ | ||
17 | #ifndef IOREMAP_MAX_ORDER | ||
18 | #define IOREMAP_MAX_ORDER (7 + PAGE_SHIFT) /* 128 pages */ | ||
19 | #endif | ||
20 | |||
13 | struct vm_struct { | 21 | struct vm_struct { |
14 | void *addr; | 22 | void *addr; |
15 | unsigned long size; | 23 | unsigned long size; |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index ae485f9c916e..a555a0f7a7b4 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,7 +1,7 @@ | |||
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 : 18 12.3.05 | 4 | * Version : 19 18.3.05 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2005 Jean Tourrilhes, All Rights Reserved. |
@@ -69,8 +69,6 @@ | |||
69 | 69 | ||
70 | /***************************** INCLUDES *****************************/ | 70 | /***************************** INCLUDES *****************************/ |
71 | 71 | ||
72 | /* To minimise problems in user space, I might remove those headers | ||
73 | * at some point. Jean II */ | ||
74 | #include <linux/types.h> /* for "caddr_t" et al */ | 72 | #include <linux/types.h> /* for "caddr_t" et al */ |
75 | #include <linux/socket.h> /* for "struct sockaddr" et al */ | 73 | #include <linux/socket.h> /* for "struct sockaddr" et al */ |
76 | #include <linux/if.h> /* for IFNAMSIZ and co... */ | 74 | #include <linux/if.h> /* for IFNAMSIZ and co... */ |
@@ -82,7 +80,7 @@ | |||
82 | * (there is some stuff that will be added in the future...) | 80 | * (there is some stuff that will be added in the future...) |
83 | * I just plan to increment with each new version. | 81 | * I just plan to increment with each new version. |
84 | */ | 82 | */ |
85 | #define WIRELESS_EXT 18 | 83 | #define WIRELESS_EXT 19 |
86 | 84 | ||
87 | /* | 85 | /* |
88 | * Changes : | 86 | * Changes : |
@@ -197,6 +195,15 @@ | |||
197 | * related parameters (extensible up to 4096 parameter values) | 195 | * related parameters (extensible up to 4096 parameter values) |
198 | * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, | 196 | * - Add wireless events: IWEVGENIE, IWEVMICHAELMICFAILURE, |
199 | * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND | 197 | * IWEVASSOCREQIE, IWEVASSOCRESPIE, IWEVPMKIDCAND |
198 | * | ||
199 | * V18 to V19 | ||
200 | * ---------- | ||
201 | * - Remove (struct iw_point *)->pointer from events and streams | ||
202 | * - Remove header includes to help user space | ||
203 | * - Increase IW_ENCODING_TOKEN_MAX from 32 to 64 | ||
204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros | ||
205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM | ||
206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros | ||
200 | */ | 207 | */ |
201 | 208 | ||
202 | /**************************** CONSTANTS ****************************/ | 209 | /**************************** CONSTANTS ****************************/ |
@@ -322,6 +329,7 @@ | |||
322 | /* The first and the last (range) */ | 329 | /* The first and the last (range) */ |
323 | #define SIOCIWFIRST 0x8B00 | 330 | #define SIOCIWFIRST 0x8B00 |
324 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ | 331 | #define SIOCIWLAST SIOCIWLASTPRIV /* 0x8BFF */ |
332 | #define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST) | ||
325 | 333 | ||
326 | /* Even : get (world access), odd : set (root access) */ | 334 | /* Even : get (world access), odd : set (root access) */ |
327 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) | 335 | #define IW_IS_SET(cmd) (!((cmd) & 0x1)) |
@@ -366,6 +374,7 @@ | |||
366 | * (struct iw_pmkid_cand) */ | 374 | * (struct iw_pmkid_cand) */ |
367 | 375 | ||
368 | #define IWEVFIRST 0x8C00 | 376 | #define IWEVFIRST 0x8C00 |
377 | #define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST) | ||
369 | 378 | ||
370 | /* ------------------------- PRIVATE INFO ------------------------- */ | 379 | /* ------------------------- PRIVATE INFO ------------------------- */ |
371 | /* | 380 | /* |
@@ -427,12 +436,15 @@ | |||
427 | #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ | 436 | #define IW_MODE_MONITOR 6 /* Passive monitor (listen only) */ |
428 | 437 | ||
429 | /* Statistics flags (bitmask in updated) */ | 438 | /* Statistics flags (bitmask in updated) */ |
430 | #define IW_QUAL_QUAL_UPDATED 0x1 /* Value was updated since last read */ | 439 | #define IW_QUAL_QUAL_UPDATED 0x01 /* Value was updated since last read */ |
431 | #define IW_QUAL_LEVEL_UPDATED 0x2 | 440 | #define IW_QUAL_LEVEL_UPDATED 0x02 |
432 | #define IW_QUAL_NOISE_UPDATED 0x4 | 441 | #define IW_QUAL_NOISE_UPDATED 0x04 |
442 | #define IW_QUAL_ALL_UPDATED 0x07 | ||
443 | #define IW_QUAL_DBM 0x08 /* Level + Noise are dBm */ | ||
433 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ | 444 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ |
434 | #define IW_QUAL_LEVEL_INVALID 0x20 | 445 | #define IW_QUAL_LEVEL_INVALID 0x20 |
435 | #define IW_QUAL_NOISE_INVALID 0x40 | 446 | #define IW_QUAL_NOISE_INVALID 0x40 |
447 | #define IW_QUAL_ALL_INVALID 0x70 | ||
436 | 448 | ||
437 | /* Frequency flags */ | 449 | /* Frequency flags */ |
438 | #define IW_FREQ_AUTO 0x00 /* Let the driver decides */ | 450 | #define IW_FREQ_AUTO 0x00 /* Let the driver decides */ |
@@ -443,7 +455,7 @@ | |||
443 | #define IW_MAX_ENCODING_SIZES 8 | 455 | #define IW_MAX_ENCODING_SIZES 8 |
444 | 456 | ||
445 | /* Maximum size of the encoding token in bytes */ | 457 | /* Maximum size of the encoding token in bytes */ |
446 | #define IW_ENCODING_TOKEN_MAX 32 /* 256 bits (for now) */ | 458 | #define IW_ENCODING_TOKEN_MAX 64 /* 512 bits (for now) */ |
447 | 459 | ||
448 | /* Flags for encoding (along with the token) */ | 460 | /* Flags for encoding (along with the token) */ |
449 | #define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ | 461 | #define IW_ENCODE_INDEX 0x00FF /* Token index (if needed) */ |
@@ -1039,12 +1051,16 @@ struct iw_event | |||
1039 | #define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) | 1051 | #define IW_EV_CHAR_LEN (IW_EV_LCP_LEN + IFNAMSIZ) |
1040 | #define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) | 1052 | #define IW_EV_UINT_LEN (IW_EV_LCP_LEN + sizeof(__u32)) |
1041 | #define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) | 1053 | #define IW_EV_FREQ_LEN (IW_EV_LCP_LEN + sizeof(struct iw_freq)) |
1042 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point)) | ||
1043 | #define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) | 1054 | #define IW_EV_PARAM_LEN (IW_EV_LCP_LEN + sizeof(struct iw_param)) |
1044 | #define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) | 1055 | #define IW_EV_ADDR_LEN (IW_EV_LCP_LEN + sizeof(struct sockaddr)) |
1045 | #define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) | 1056 | #define IW_EV_QUAL_LEN (IW_EV_LCP_LEN + sizeof(struct iw_quality)) |
1046 | 1057 | ||
1047 | /* Note : in the case of iw_point, the extra data will come at the | 1058 | /* iw_point events are special. First, the payload (extra data) come at |
1048 | * end of the event */ | 1059 | * the end of the event, so they are bigger than IW_EV_POINT_LEN. Second, |
1060 | * we omit the pointer, so start at an offset. */ | ||
1061 | #define IW_EV_POINT_OFF (((char *) &(((struct iw_point *) NULL)->length)) - \ | ||
1062 | (char *) NULL) | ||
1063 | #define IW_EV_POINT_LEN (IW_EV_LCP_LEN + sizeof(struct iw_point) - \ | ||
1064 | IW_EV_POINT_OFF) | ||
1049 | 1065 | ||
1050 | #endif /* _LINUX_WIRELESS_H */ | 1066 | #endif /* _LINUX_WIRELESS_H */ |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index f0d423300d84..0fb077d68441 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -258,9 +258,27 @@ struct xfrm_usersa_flush { | |||
258 | __u8 proto; | 258 | __u8 proto; |
259 | }; | 259 | }; |
260 | 260 | ||
261 | #ifndef __KERNEL__ | ||
262 | /* backwards compatibility for userspace */ | ||
261 | #define XFRMGRP_ACQUIRE 1 | 263 | #define XFRMGRP_ACQUIRE 1 |
262 | #define XFRMGRP_EXPIRE 2 | 264 | #define XFRMGRP_EXPIRE 2 |
263 | #define XFRMGRP_SA 4 | 265 | #define XFRMGRP_SA 4 |
264 | #define XFRMGRP_POLICY 8 | 266 | #define XFRMGRP_POLICY 8 |
267 | #endif | ||
268 | |||
269 | enum xfrm_nlgroups { | ||
270 | XFRMNLGRP_NONE, | ||
271 | #define XFRMNLGRP_NONE XFRMNLGRP_NONE | ||
272 | XFRMNLGRP_ACQUIRE, | ||
273 | #define XFRMNLGRP_ACQUIRE XFRMNLGRP_ACQUIRE | ||
274 | XFRMNLGRP_EXPIRE, | ||
275 | #define XFRMNLGRP_EXPIRE XFRMNLGRP_EXPIRE | ||
276 | XFRMNLGRP_SA, | ||
277 | #define XFRMNLGRP_SA XFRMNLGRP_SA | ||
278 | XFRMNLGRP_POLICY, | ||
279 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY | ||
280 | __XFRMNLGRP_MAX | ||
281 | }; | ||
282 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) | ||
265 | 283 | ||
266 | #endif /* _LINUX_XFRM_H */ | 284 | #endif /* _LINUX_XFRM_H */ |