diff options
Diffstat (limited to 'include/linux')
103 files changed, 1865 insertions, 675 deletions
diff --git a/include/linux/amba/clcd.h b/include/linux/amba/clcd.h index 6b8d73dc1ab0..9cf64b1b688b 100644 --- a/include/linux/amba/clcd.h +++ b/include/linux/amba/clcd.h | |||
@@ -54,6 +54,7 @@ | |||
54 | #define CNTL_LCDBPP4 (2 << 1) | 54 | #define CNTL_LCDBPP4 (2 << 1) |
55 | #define CNTL_LCDBPP8 (3 << 1) | 55 | #define CNTL_LCDBPP8 (3 << 1) |
56 | #define CNTL_LCDBPP16 (4 << 1) | 56 | #define CNTL_LCDBPP16 (4 << 1) |
57 | #define CNTL_LCDBPP16_565 (6 << 1) | ||
57 | #define CNTL_LCDBPP24 (5 << 1) | 58 | #define CNTL_LCDBPP24 (5 << 1) |
58 | #define CNTL_LCDBW (1 << 4) | 59 | #define CNTL_LCDBW (1 << 4) |
59 | #define CNTL_LCDTFT (1 << 5) | 60 | #define CNTL_LCDTFT (1 << 5) |
@@ -209,7 +210,16 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs) | |||
209 | val |= CNTL_LCDBPP8; | 210 | val |= CNTL_LCDBPP8; |
210 | break; | 211 | break; |
211 | case 16: | 212 | case 16: |
212 | val |= CNTL_LCDBPP16; | 213 | /* |
214 | * PL110 cannot choose between 5551 and 565 modes in | ||
215 | * its control register | ||
216 | */ | ||
217 | if ((fb->dev->periphid & 0x000fffff) == 0x00041110) | ||
218 | val |= CNTL_LCDBPP16; | ||
219 | else if (fb->fb.var.green.length == 5) | ||
220 | val |= CNTL_LCDBPP16; | ||
221 | else | ||
222 | val |= CNTL_LCDBPP16_565; | ||
213 | break; | 223 | break; |
214 | case 32: | 224 | case 32: |
215 | val |= CNTL_LCDBPP24; | 225 | val |= CNTL_LCDBPP24; |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 94f77cce27fa..312a2c0c64e6 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -146,6 +146,8 @@ enum { | |||
146 | ATA_CMD_STANDBYNOW1 = 0xE0, | 146 | ATA_CMD_STANDBYNOW1 = 0xE0, |
147 | ATA_CMD_IDLEIMMEDIATE = 0xE1, | 147 | ATA_CMD_IDLEIMMEDIATE = 0xE1, |
148 | ATA_CMD_INIT_DEV_PARAMS = 0x91, | 148 | ATA_CMD_INIT_DEV_PARAMS = 0x91, |
149 | ATA_CMD_READ_NATIVE_MAX = 0xF8, | ||
150 | ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, | ||
149 | 151 | ||
150 | /* SETFEATURES stuff */ | 152 | /* SETFEATURES stuff */ |
151 | SETFEATURES_XFER = 0x03, | 153 | SETFEATURES_XFER = 0x03, |
@@ -204,7 +206,6 @@ enum ata_tf_protocols { | |||
204 | ATA_PROT_UNKNOWN, /* unknown/invalid */ | 206 | ATA_PROT_UNKNOWN, /* unknown/invalid */ |
205 | ATA_PROT_NODATA, /* no data */ | 207 | ATA_PROT_NODATA, /* no data */ |
206 | ATA_PROT_PIO, /* PIO single sector */ | 208 | ATA_PROT_PIO, /* PIO single sector */ |
207 | ATA_PROT_PIO_MULT, /* PIO multiple sector */ | ||
208 | ATA_PROT_DMA, /* DMA */ | 209 | ATA_PROT_DMA, /* DMA */ |
209 | ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ | 210 | ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ |
210 | ATA_PROT_ATAPI_NODATA, /* packet command, no data */ | 211 | ATA_PROT_ATAPI_NODATA, /* packet command, no data */ |
@@ -247,18 +248,22 @@ struct ata_taskfile { | |||
247 | }; | 248 | }; |
248 | 249 | ||
249 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 250 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) |
251 | #define ata_id_is_cfa(id) ((id)[0] == 0x848A) | ||
250 | #define ata_id_is_sata(id) ((id)[93] == 0) | 252 | #define ata_id_is_sata(id) ((id)[93] == 0) |
251 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) | 253 | #define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) |
252 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) | 254 | #define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) |
255 | #define ata_id_hpa_enabled(id) ((id)[85] & (1 << 10)) | ||
253 | #define ata_id_has_fua(id) ((id)[84] & (1 << 6)) | 256 | #define ata_id_has_fua(id) ((id)[84] & (1 << 6)) |
254 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) | 257 | #define ata_id_has_flush(id) ((id)[83] & (1 << 12)) |
255 | #define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) | 258 | #define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) |
256 | #define ata_id_has_lba48(id) ((id)[83] & (1 << 10)) | 259 | #define ata_id_has_lba48(id) ((id)[83] & (1 << 10)) |
260 | #define ata_id_has_hpa(id) ((id)[82] & (1 << 10)) | ||
257 | #define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) | 261 | #define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) |
258 | #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) | 262 | #define ata_id_has_pm(id) ((id)[82] & (1 << 3)) |
259 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) | 263 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) |
260 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) | 264 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) |
261 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) | 265 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) |
266 | #define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) | ||
262 | #define ata_id_u32(id,n) \ | 267 | #define ata_id_u32(id,n) \ |
263 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) | 268 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) |
264 | #define ata_id_u64(id,n) \ | 269 | #define ata_id_u64(id,n) \ |
@@ -267,6 +272,16 @@ struct ata_taskfile { | |||
267 | ((u64) (id)[(n) + 1] << 16) | \ | 272 | ((u64) (id)[(n) + 1] << 16) | \ |
268 | ((u64) (id)[(n) + 0]) ) | 273 | ((u64) (id)[(n) + 0]) ) |
269 | 274 | ||
275 | static inline unsigned int ata_id_major_version(const u16 *id) | ||
276 | { | ||
277 | unsigned int mver; | ||
278 | |||
279 | for (mver = 14; mver >= 1; mver--) | ||
280 | if (id[ATA_ID_MAJOR_VER] & (1 << mver)) | ||
281 | break; | ||
282 | return mver; | ||
283 | } | ||
284 | |||
270 | static inline int ata_id_current_chs_valid(const u16 *id) | 285 | static inline int ata_id_current_chs_valid(const u16 *id) |
271 | { | 286 | { |
272 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 287 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -302,4 +317,16 @@ static inline int ata_ok(u8 status) | |||
302 | == ATA_DRDY); | 317 | == ATA_DRDY); |
303 | } | 318 | } |
304 | 319 | ||
320 | static inline int lba_28_ok(u64 block, u32 n_block) | ||
321 | { | ||
322 | /* check the ending block number */ | ||
323 | return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); | ||
324 | } | ||
325 | |||
326 | static inline int lba_48_ok(u64 block, u32 n_block) | ||
327 | { | ||
328 | /* check the ending block number */ | ||
329 | return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); | ||
330 | } | ||
331 | |||
305 | #endif /* __LINUX_ATA_H__ */ | 332 | #endif /* __LINUX_ATA_H__ */ |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 56bb6a4e15f3..c179966f1a2f 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -22,6 +22,7 @@ typedef struct request_queue request_queue_t; | |||
22 | struct elevator_queue; | 22 | struct elevator_queue; |
23 | typedef struct elevator_queue elevator_t; | 23 | typedef struct elevator_queue elevator_t; |
24 | struct request_pm_state; | 24 | struct request_pm_state; |
25 | struct blk_trace; | ||
25 | 26 | ||
26 | #define BLKDEV_MIN_RQ 4 | 27 | #define BLKDEV_MIN_RQ 4 |
27 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ | 28 | #define BLKDEV_MAX_RQ 128 /* Default maximum */ |
@@ -416,6 +417,8 @@ struct request_queue | |||
416 | unsigned int sg_reserved_size; | 417 | unsigned int sg_reserved_size; |
417 | int node; | 418 | int node; |
418 | 419 | ||
420 | struct blk_trace *blk_trace; | ||
421 | |||
419 | /* | 422 | /* |
420 | * reserved for flush operations | 423 | * reserved for flush operations |
421 | */ | 424 | */ |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h new file mode 100644 index 000000000000..b34d3e73d5ea --- /dev/null +++ b/include/linux/blktrace_api.h | |||
@@ -0,0 +1,277 @@ | |||
1 | #ifndef BLKTRACE_H | ||
2 | #define BLKTRACE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/blkdev.h> | ||
6 | #include <linux/relay.h> | ||
7 | |||
8 | /* | ||
9 | * Trace categories | ||
10 | */ | ||
11 | enum blktrace_cat { | ||
12 | BLK_TC_READ = 1 << 0, /* reads */ | ||
13 | BLK_TC_WRITE = 1 << 1, /* writes */ | ||
14 | BLK_TC_BARRIER = 1 << 2, /* barrier */ | ||
15 | BLK_TC_SYNC = 1 << 3, /* barrier */ | ||
16 | BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ | ||
17 | BLK_TC_REQUEUE = 1 << 5, /* requeueing */ | ||
18 | BLK_TC_ISSUE = 1 << 6, /* issue */ | ||
19 | BLK_TC_COMPLETE = 1 << 7, /* completions */ | ||
20 | BLK_TC_FS = 1 << 8, /* fs requests */ | ||
21 | BLK_TC_PC = 1 << 9, /* pc requests */ | ||
22 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | ||
23 | |||
24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | ||
25 | }; | ||
26 | |||
27 | #define BLK_TC_SHIFT (16) | ||
28 | #define BLK_TC_ACT(act) ((act) << BLK_TC_SHIFT) | ||
29 | |||
30 | /* | ||
31 | * Basic trace actions | ||
32 | */ | ||
33 | enum blktrace_act { | ||
34 | __BLK_TA_QUEUE = 1, /* queued */ | ||
35 | __BLK_TA_BACKMERGE, /* back merged to existing rq */ | ||
36 | __BLK_TA_FRONTMERGE, /* front merge to existing rq */ | ||
37 | __BLK_TA_GETRQ, /* allocated new request */ | ||
38 | __BLK_TA_SLEEPRQ, /* sleeping on rq allocation */ | ||
39 | __BLK_TA_REQUEUE, /* request requeued */ | ||
40 | __BLK_TA_ISSUE, /* sent to driver */ | ||
41 | __BLK_TA_COMPLETE, /* completed by driver */ | ||
42 | __BLK_TA_PLUG, /* queue was plugged */ | ||
43 | __BLK_TA_UNPLUG_IO, /* queue was unplugged by io */ | ||
44 | __BLK_TA_UNPLUG_TIMER, /* queue was unplugged by timer */ | ||
45 | __BLK_TA_INSERT, /* insert request */ | ||
46 | __BLK_TA_SPLIT, /* bio was split */ | ||
47 | __BLK_TA_BOUNCE, /* bio was bounced */ | ||
48 | __BLK_TA_REMAP, /* bio was remapped */ | ||
49 | }; | ||
50 | |||
51 | /* | ||
52 | * Trace actions in full. Additionally, read or write is masked | ||
53 | */ | ||
54 | #define BLK_TA_QUEUE (__BLK_TA_QUEUE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
55 | #define BLK_TA_BACKMERGE (__BLK_TA_BACKMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
56 | #define BLK_TA_FRONTMERGE (__BLK_TA_FRONTMERGE | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
57 | #define BLK_TA_GETRQ (__BLK_TA_GETRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
58 | #define BLK_TA_SLEEPRQ (__BLK_TA_SLEEPRQ | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
59 | #define BLK_TA_REQUEUE (__BLK_TA_REQUEUE | BLK_TC_ACT(BLK_TC_REQUEUE)) | ||
60 | #define BLK_TA_ISSUE (__BLK_TA_ISSUE | BLK_TC_ACT(BLK_TC_ISSUE)) | ||
61 | #define BLK_TA_COMPLETE (__BLK_TA_COMPLETE| BLK_TC_ACT(BLK_TC_COMPLETE)) | ||
62 | #define BLK_TA_PLUG (__BLK_TA_PLUG | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
63 | #define BLK_TA_UNPLUG_IO (__BLK_TA_UNPLUG_IO | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
64 | #define BLK_TA_UNPLUG_TIMER (__BLK_TA_UNPLUG_TIMER | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
65 | #define BLK_TA_INSERT (__BLK_TA_INSERT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
66 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) | ||
67 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | ||
68 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
69 | |||
70 | #define BLK_IO_TRACE_MAGIC 0x65617400 | ||
71 | #define BLK_IO_TRACE_VERSION 0x07 | ||
72 | |||
73 | /* | ||
74 | * The trace itself | ||
75 | */ | ||
76 | struct blk_io_trace { | ||
77 | u32 magic; /* MAGIC << 8 | version */ | ||
78 | u32 sequence; /* event number */ | ||
79 | u64 time; /* in microseconds */ | ||
80 | u64 sector; /* disk offset */ | ||
81 | u32 bytes; /* transfer length */ | ||
82 | u32 action; /* what happened */ | ||
83 | u32 pid; /* who did it */ | ||
84 | u32 device; /* device number */ | ||
85 | u32 cpu; /* on what cpu did it happen */ | ||
86 | u16 error; /* completion error */ | ||
87 | u16 pdu_len; /* length of data after this trace */ | ||
88 | }; | ||
89 | |||
90 | /* | ||
91 | * The remap event | ||
92 | */ | ||
93 | struct blk_io_trace_remap { | ||
94 | u32 device; | ||
95 | u32 __pad; | ||
96 | u64 sector; | ||
97 | }; | ||
98 | |||
99 | enum { | ||
100 | Blktrace_setup = 1, | ||
101 | Blktrace_running, | ||
102 | Blktrace_stopped, | ||
103 | }; | ||
104 | |||
105 | struct blk_trace { | ||
106 | int trace_state; | ||
107 | struct rchan *rchan; | ||
108 | unsigned long *sequence; | ||
109 | u16 act_mask; | ||
110 | u64 start_lba; | ||
111 | u64 end_lba; | ||
112 | u32 pid; | ||
113 | u32 dev; | ||
114 | struct dentry *dir; | ||
115 | struct dentry *dropped_file; | ||
116 | atomic_t dropped; | ||
117 | }; | ||
118 | |||
119 | /* | ||
120 | * User setup structure passed with BLKTRACESTART | ||
121 | */ | ||
122 | struct blk_user_trace_setup { | ||
123 | char name[BDEVNAME_SIZE]; /* output */ | ||
124 | u16 act_mask; /* input */ | ||
125 | u32 buf_size; /* input */ | ||
126 | u32 buf_nr; /* input */ | ||
127 | u64 start_lba; | ||
128 | u64 end_lba; | ||
129 | u32 pid; | ||
130 | }; | ||
131 | |||
132 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
133 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | ||
134 | extern void blk_trace_shutdown(request_queue_t *); | ||
135 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | ||
136 | |||
137 | /** | ||
138 | * blk_add_trace_rq - Add a trace for a request oriented action | ||
139 | * @q: queue the io is for | ||
140 | * @rq: the source request | ||
141 | * @what: the action | ||
142 | * | ||
143 | * Description: | ||
144 | * Records an action against a request. Will log the bio offset + size. | ||
145 | * | ||
146 | **/ | ||
147 | static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | ||
148 | u32 what) | ||
149 | { | ||
150 | struct blk_trace *bt = q->blk_trace; | ||
151 | int rw = rq->flags & 0x07; | ||
152 | |||
153 | if (likely(!bt)) | ||
154 | return; | ||
155 | |||
156 | if (blk_pc_request(rq)) { | ||
157 | what |= BLK_TC_ACT(BLK_TC_PC); | ||
158 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); | ||
159 | } else { | ||
160 | what |= BLK_TC_ACT(BLK_TC_FS); | ||
161 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, rw, what, rq->errors, 0, NULL); | ||
162 | } | ||
163 | } | ||
164 | |||
165 | /** | ||
166 | * blk_add_trace_bio - Add a trace for a bio oriented action | ||
167 | * @q: queue the io is for | ||
168 | * @bio: the source bio | ||
169 | * @what: the action | ||
170 | * | ||
171 | * Description: | ||
172 | * Records an action against a bio. Will log the bio offset + size. | ||
173 | * | ||
174 | **/ | ||
175 | static inline void blk_add_trace_bio(struct request_queue *q, struct bio *bio, | ||
176 | u32 what) | ||
177 | { | ||
178 | struct blk_trace *bt = q->blk_trace; | ||
179 | |||
180 | if (likely(!bt)) | ||
181 | return; | ||
182 | |||
183 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), 0, NULL); | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * blk_add_trace_generic - Add a trace for a generic action | ||
188 | * @q: queue the io is for | ||
189 | * @bio: the source bio | ||
190 | * @rw: the data direction | ||
191 | * @what: the action | ||
192 | * | ||
193 | * Description: | ||
194 | * Records a simple trace | ||
195 | * | ||
196 | **/ | ||
197 | static inline void blk_add_trace_generic(struct request_queue *q, | ||
198 | struct bio *bio, int rw, u32 what) | ||
199 | { | ||
200 | struct blk_trace *bt = q->blk_trace; | ||
201 | |||
202 | if (likely(!bt)) | ||
203 | return; | ||
204 | |||
205 | if (bio) | ||
206 | blk_add_trace_bio(q, bio, what); | ||
207 | else | ||
208 | __blk_add_trace(bt, 0, 0, rw, what, 0, 0, NULL); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * blk_add_trace_pdu_int - Add a trace for a bio with an integer payload | ||
213 | * @q: queue the io is for | ||
214 | * @what: the action | ||
215 | * @bio: the source bio | ||
216 | * @pdu: the integer payload | ||
217 | * | ||
218 | * Description: | ||
219 | * Adds a trace with some integer payload. This might be an unplug | ||
220 | * option given as the action, with the depth at unplug time given | ||
221 | * as the payload | ||
222 | * | ||
223 | **/ | ||
224 | static inline void blk_add_trace_pdu_int(struct request_queue *q, u32 what, | ||
225 | struct bio *bio, unsigned int pdu) | ||
226 | { | ||
227 | struct blk_trace *bt = q->blk_trace; | ||
228 | u64 rpdu = cpu_to_be64(pdu); | ||
229 | |||
230 | if (likely(!bt)) | ||
231 | return; | ||
232 | |||
233 | if (bio) | ||
234 | __blk_add_trace(bt, bio->bi_sector, bio->bi_size, bio->bi_rw, what, !bio_flagged(bio, BIO_UPTODATE), sizeof(rpdu), &rpdu); | ||
235 | else | ||
236 | __blk_add_trace(bt, 0, 0, 0, what, 0, sizeof(rpdu), &rpdu); | ||
237 | } | ||
238 | |||
239 | /** | ||
240 | * blk_add_trace_remap - Add a trace for a remap operation | ||
241 | * @q: queue the io is for | ||
242 | * @bio: the source bio | ||
243 | * @dev: target device | ||
244 | * @from: source sector | ||
245 | * @to: target sector | ||
246 | * | ||
247 | * Description: | ||
248 | * Device mapper or raid target sometimes need to split a bio because | ||
249 | * it spans a stripe (or similar). Add a trace for that action. | ||
250 | * | ||
251 | **/ | ||
252 | static inline void blk_add_trace_remap(struct request_queue *q, struct bio *bio, | ||
253 | dev_t dev, sector_t from, sector_t to) | ||
254 | { | ||
255 | struct blk_trace *bt = q->blk_trace; | ||
256 | struct blk_io_trace_remap r; | ||
257 | |||
258 | if (likely(!bt)) | ||
259 | return; | ||
260 | |||
261 | r.device = cpu_to_be32(dev); | ||
262 | r.sector = cpu_to_be64(to); | ||
263 | |||
264 | __blk_add_trace(bt, from, bio->bi_size, bio->bi_rw, BLK_TA_REMAP, !bio_flagged(bio, BIO_UPTODATE), sizeof(r), &r); | ||
265 | } | ||
266 | |||
267 | #else /* !CONFIG_BLK_DEV_IO_TRACE */ | ||
268 | #define blk_trace_ioctl(bdev, cmd, arg) (-ENOTTY) | ||
269 | #define blk_trace_shutdown(q) do { } while (0) | ||
270 | #define blk_add_trace_rq(q, rq, what) do { } while (0) | ||
271 | #define blk_add_trace_bio(q, rq, what) do { } while (0) | ||
272 | #define blk_add_trace_generic(q, rq, rw, what) do { } while (0) | ||
273 | #define blk_add_trace_pdu_int(q, what, bio, pdu) do { } while (0) | ||
274 | #define blk_add_trace_remap(q, bio, dev, f, t) do {} while (0) | ||
275 | #endif /* CONFIG_BLK_DEV_IO_TRACE */ | ||
276 | |||
277 | #endif | ||
diff --git a/include/linux/cache.h b/include/linux/cache.h index d22e632f41fb..cc4b3aafad9a 100644 --- a/include/linux/cache.h +++ b/include/linux/cache.h | |||
@@ -13,9 +13,7 @@ | |||
13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES | 13 | #define SMP_CACHE_BYTES L1_CACHE_BYTES |
14 | #endif | 14 | #endif |
15 | 15 | ||
16 | #if defined(CONFIG_X86) || defined(CONFIG_SPARC64) || defined(CONFIG_IA64) || defined(CONFIG_PARISC) | 16 | #ifndef __read_mostly |
17 | #define __read_mostly __attribute__((__section__(".data.read_mostly"))) | ||
18 | #else | ||
19 | #define __read_mostly | 17 | #define __read_mostly |
20 | #endif | 18 | #endif |
21 | 19 | ||
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h index b68fdf1f3156..3c9b0bc05123 100644 --- a/include/linux/cdrom.h +++ b/include/linux/cdrom.h | |||
@@ -378,7 +378,6 @@ struct cdrom_generic_command | |||
378 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ | 378 | #define CDC_MEDIA_CHANGED 0x80 /* media changed */ |
379 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ | 379 | #define CDC_PLAY_AUDIO 0x100 /* audio functions */ |
380 | #define CDC_RESET 0x200 /* hard reset device */ | 380 | #define CDC_RESET 0x200 /* hard reset device */ |
381 | #define CDC_IOCTLS 0x400 /* driver has non-standard ioctls */ | ||
382 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ | 381 | #define CDC_DRIVE_STATUS 0x800 /* driver implements drive status */ |
383 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ | 382 | #define CDC_GENERIC_PACKET 0x1000 /* driver implements generic packets */ |
384 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ | 383 | #define CDC_CD_R 0x2000 /* drive is a CD-R */ |
@@ -974,9 +973,7 @@ struct cdrom_device_ops { | |||
974 | int (*reset) (struct cdrom_device_info *); | 973 | int (*reset) (struct cdrom_device_info *); |
975 | /* play stuff */ | 974 | /* play stuff */ |
976 | int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); | 975 | int (*audio_ioctl) (struct cdrom_device_info *,unsigned int, void *); |
977 | /* dev-specific */ | 976 | |
978 | int (*dev_ioctl) (struct cdrom_device_info *, | ||
979 | unsigned int, unsigned long); | ||
980 | /* driver specifications */ | 977 | /* driver specifications */ |
981 | const int capability; /* capability flags */ | 978 | const int capability; /* capability flags */ |
982 | int n_minors; /* number of active minor devices */ | 979 | int n_minors; /* number of active minor devices */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index ae7dfb790df3..efb518f16bb3 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -97,6 +97,10 @@ COMPATIBLE_IOCTL(BLKRRPART) | |||
97 | COMPATIBLE_IOCTL(BLKFLSBUF) | 97 | COMPATIBLE_IOCTL(BLKFLSBUF) |
98 | COMPATIBLE_IOCTL(BLKSECTSET) | 98 | COMPATIBLE_IOCTL(BLKSECTSET) |
99 | COMPATIBLE_IOCTL(BLKSSZGET) | 99 | COMPATIBLE_IOCTL(BLKSSZGET) |
100 | COMPATIBLE_IOCTL(BLKTRACESTART) | ||
101 | COMPATIBLE_IOCTL(BLKTRACESTOP) | ||
102 | COMPATIBLE_IOCTL(BLKTRACESETUP) | ||
103 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) | ||
100 | ULONG_IOCTL(BLKRASET) | 104 | ULONG_IOCTL(BLKRASET) |
101 | ULONG_IOCTL(BLKFRASET) | 105 | ULONG_IOCTL(BLKFRASET) |
102 | /* RAID */ | 106 | /* RAID */ |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 0ed1d4853c69..d612b89dce33 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -32,7 +32,7 @@ struct cpu { | |||
32 | }; | 32 | }; |
33 | 33 | ||
34 | extern int register_cpu(struct cpu *, int, struct node *); | 34 | extern int register_cpu(struct cpu *, int, struct node *); |
35 | extern struct sys_device *get_cpu_sysdev(int cpu); | 35 | extern struct sys_device *get_cpu_sysdev(unsigned cpu); |
36 | #ifdef CONFIG_HOTPLUG_CPU | 36 | #ifdef CONFIG_HOTPLUG_CPU |
37 | extern void unregister_cpu(struct cpu *, struct node *); | 37 | extern void unregister_cpu(struct cpu *, struct node *); |
38 | #endif | 38 | #endif |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index d88bf8aa8b47..0ab1bc1152ca 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -229,6 +229,8 @@ struct crypto_tfm { | |||
229 | } crt_u; | 229 | } crt_u; |
230 | 230 | ||
231 | struct crypto_alg *__crt_alg; | 231 | struct crypto_alg *__crt_alg; |
232 | |||
233 | char __crt_ctx[] __attribute__ ((__aligned__)); | ||
232 | }; | 234 | }; |
233 | 235 | ||
234 | /* | 236 | /* |
@@ -301,7 +303,13 @@ static inline unsigned int crypto_tfm_alg_alignmask(struct crypto_tfm *tfm) | |||
301 | 303 | ||
302 | static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) | 304 | static inline void *crypto_tfm_ctx(struct crypto_tfm *tfm) |
303 | { | 305 | { |
304 | return (void *)&tfm[1]; | 306 | return tfm->__crt_ctx; |
307 | } | ||
308 | |||
309 | static inline unsigned int crypto_tfm_ctx_alignment(void) | ||
310 | { | ||
311 | struct crypto_tfm *tfm; | ||
312 | return __alignof__(tfm->__crt_ctx); | ||
305 | } | 313 | } |
306 | 314 | ||
307 | /* | 315 | /* |
diff --git a/include/linux/dccp.h b/include/linux/dccp.h index 088529f54965..676333b9fad0 100644 --- a/include/linux/dccp.h +++ b/include/linux/dccp.h | |||
@@ -18,7 +18,7 @@ | |||
18 | * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x | 18 | * @dccph_seq - sequence number high or low order 24 bits, depends on dccph_x |
19 | */ | 19 | */ |
20 | struct dccp_hdr { | 20 | struct dccp_hdr { |
21 | __u16 dccph_sport, | 21 | __be16 dccph_sport, |
22 | dccph_dport; | 22 | dccph_dport; |
23 | __u8 dccph_doff; | 23 | __u8 dccph_doff; |
24 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 24 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
@@ -32,18 +32,18 @@ struct dccp_hdr { | |||
32 | #endif | 32 | #endif |
33 | __u16 dccph_checksum; | 33 | __u16 dccph_checksum; |
34 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 34 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
35 | __u32 dccph_x:1, | 35 | __u8 dccph_x:1, |
36 | dccph_type:4, | 36 | dccph_type:4, |
37 | dccph_reserved:3, | 37 | dccph_reserved:3; |
38 | dccph_seq:24; | ||
39 | #elif defined(__BIG_ENDIAN_BITFIELD) | 38 | #elif defined(__BIG_ENDIAN_BITFIELD) |
40 | __u32 dccph_reserved:3, | 39 | __u8 dccph_reserved:3, |
41 | dccph_type:4, | 40 | dccph_type:4, |
42 | dccph_x:1, | 41 | dccph_x:1; |
43 | dccph_seq:24; | ||
44 | #else | 42 | #else |
45 | #error "Adjust your <asm/byteorder.h> defines" | 43 | #error "Adjust your <asm/byteorder.h> defines" |
46 | #endif | 44 | #endif |
45 | __u8 dccph_seq2; | ||
46 | __be16 dccph_seq; | ||
47 | }; | 47 | }; |
48 | 48 | ||
49 | /** | 49 | /** |
@@ -52,7 +52,7 @@ struct dccp_hdr { | |||
52 | * @dccph_seq_low - low 24 bits of a 48 bit seq packet | 52 | * @dccph_seq_low - low 24 bits of a 48 bit seq packet |
53 | */ | 53 | */ |
54 | struct dccp_hdr_ext { | 54 | struct dccp_hdr_ext { |
55 | __u32 dccph_seq_low; | 55 | __be32 dccph_seq_low; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /** | 58 | /** |
@@ -62,7 +62,7 @@ struct dccp_hdr_ext { | |||
62 | * @dccph_req_options - list of options (must be a multiple of 32 bits | 62 | * @dccph_req_options - list of options (must be a multiple of 32 bits |
63 | */ | 63 | */ |
64 | struct dccp_hdr_request { | 64 | struct dccp_hdr_request { |
65 | __u32 dccph_req_service; | 65 | __be32 dccph_req_service; |
66 | }; | 66 | }; |
67 | /** | 67 | /** |
68 | * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets | 68 | * struct dccp_hdr_ack_bits - acknowledgment bits common to most packets |
@@ -71,9 +71,9 @@ struct dccp_hdr_request { | |||
71 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR | 71 | * @dccph_resp_ack_nr_low - 48 bit ack number low order bits, contains GSR |
72 | */ | 72 | */ |
73 | struct dccp_hdr_ack_bits { | 73 | struct dccp_hdr_ack_bits { |
74 | __u32 dccph_reserved1:8, | 74 | __be16 dccph_reserved1; |
75 | dccph_ack_nr_high:24; | 75 | __be16 dccph_ack_nr_high; |
76 | __u32 dccph_ack_nr_low; | 76 | __be32 dccph_ack_nr_low; |
77 | }; | 77 | }; |
78 | /** | 78 | /** |
79 | * struct dccp_hdr_response - Conection initiation response header | 79 | * struct dccp_hdr_response - Conection initiation response header |
@@ -85,7 +85,7 @@ struct dccp_hdr_ack_bits { | |||
85 | */ | 85 | */ |
86 | struct dccp_hdr_response { | 86 | struct dccp_hdr_response { |
87 | struct dccp_hdr_ack_bits dccph_resp_ack; | 87 | struct dccp_hdr_ack_bits dccph_resp_ack; |
88 | __u32 dccph_resp_service; | 88 | __be32 dccph_resp_service; |
89 | }; | 89 | }; |
90 | 90 | ||
91 | /** | 91 | /** |
@@ -154,6 +154,10 @@ enum { | |||
154 | DCCPO_MANDATORY = 1, | 154 | DCCPO_MANDATORY = 1, |
155 | DCCPO_MIN_RESERVED = 3, | 155 | DCCPO_MIN_RESERVED = 3, |
156 | DCCPO_MAX_RESERVED = 31, | 156 | DCCPO_MAX_RESERVED = 31, |
157 | DCCPO_CHANGE_L = 32, | ||
158 | DCCPO_CONFIRM_L = 33, | ||
159 | DCCPO_CHANGE_R = 34, | ||
160 | DCCPO_CONFIRM_R = 35, | ||
157 | DCCPO_NDP_COUNT = 37, | 161 | DCCPO_NDP_COUNT = 37, |
158 | DCCPO_ACK_VECTOR_0 = 38, | 162 | DCCPO_ACK_VECTOR_0 = 38, |
159 | DCCPO_ACK_VECTOR_1 = 39, | 163 | DCCPO_ACK_VECTOR_1 = 39, |
@@ -168,7 +172,9 @@ enum { | |||
168 | /* DCCP features */ | 172 | /* DCCP features */ |
169 | enum { | 173 | enum { |
170 | DCCPF_RESERVED = 0, | 174 | DCCPF_RESERVED = 0, |
175 | DCCPF_CCID = 1, | ||
171 | DCCPF_SEQUENCE_WINDOW = 3, | 176 | DCCPF_SEQUENCE_WINDOW = 3, |
177 | DCCPF_ACK_RATIO = 5, | ||
172 | DCCPF_SEND_ACK_VECTOR = 6, | 178 | DCCPF_SEND_ACK_VECTOR = 6, |
173 | DCCPF_SEND_NDP_COUNT = 7, | 179 | DCCPF_SEND_NDP_COUNT = 7, |
174 | /* 10-127 reserved */ | 180 | /* 10-127 reserved */ |
@@ -176,9 +182,18 @@ enum { | |||
176 | DCCPF_MAX_CCID_SPECIFIC = 255, | 182 | DCCPF_MAX_CCID_SPECIFIC = 255, |
177 | }; | 183 | }; |
178 | 184 | ||
185 | /* this structure is argument to DCCP_SOCKOPT_CHANGE_X */ | ||
186 | struct dccp_so_feat { | ||
187 | __u8 dccpsf_feat; | ||
188 | __u8 *dccpsf_val; | ||
189 | __u8 dccpsf_len; | ||
190 | }; | ||
191 | |||
179 | /* DCCP socket options */ | 192 | /* DCCP socket options */ |
180 | #define DCCP_SOCKOPT_PACKET_SIZE 1 | 193 | #define DCCP_SOCKOPT_PACKET_SIZE 1 |
181 | #define DCCP_SOCKOPT_SERVICE 2 | 194 | #define DCCP_SOCKOPT_SERVICE 2 |
195 | #define DCCP_SOCKOPT_CHANGE_L 3 | ||
196 | #define DCCP_SOCKOPT_CHANGE_R 4 | ||
182 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 | 197 | #define DCCP_SOCKOPT_CCID_RX_INFO 128 |
183 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 | 198 | #define DCCP_SOCKOPT_CCID_TX_INFO 192 |
184 | 199 | ||
@@ -254,16 +269,12 @@ static inline unsigned int dccp_basic_hdr_len(const struct sk_buff *skb) | |||
254 | static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) | 269 | static inline __u64 dccp_hdr_seq(const struct sk_buff *skb) |
255 | { | 270 | { |
256 | const struct dccp_hdr *dh = dccp_hdr(skb); | 271 | const struct dccp_hdr *dh = dccp_hdr(skb); |
257 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 272 | __u64 seq_nr = ntohs(dh->dccph_seq); |
258 | __u64 seq_nr = ntohl(dh->dccph_seq << 8); | ||
259 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
260 | __u64 seq_nr = ntohl(dh->dccph_seq); | ||
261 | #else | ||
262 | #error "Adjust your <asm/byteorder.h> defines" | ||
263 | #endif | ||
264 | 273 | ||
265 | if (dh->dccph_x != 0) | 274 | if (dh->dccph_x != 0) |
266 | seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); | 275 | seq_nr = (seq_nr << 32) + ntohl(dccp_hdrx(skb)->dccph_seq_low); |
276 | else | ||
277 | seq_nr += (u32)dh->dccph_seq2 << 16; | ||
267 | 278 | ||
268 | return seq_nr; | 279 | return seq_nr; |
269 | } | 280 | } |
@@ -281,13 +292,7 @@ static inline struct dccp_hdr_ack_bits *dccp_hdr_ack_bits(const struct sk_buff * | |||
281 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) | 292 | static inline u64 dccp_hdr_ack_seq(const struct sk_buff *skb) |
282 | { | 293 | { |
283 | const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb); | 294 | const struct dccp_hdr_ack_bits *dhack = dccp_hdr_ack_bits(skb); |
284 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 295 | return ((u64)ntohs(dhack->dccph_ack_nr_high) << 32) + ntohl(dhack->dccph_ack_nr_low); |
285 | return (((u64)ntohl(dhack->dccph_ack_nr_high << 8)) << 32) + ntohl(dhack->dccph_ack_nr_low); | ||
286 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
287 | return (((u64)ntohl(dhack->dccph_ack_nr_high)) << 32) + ntohl(dhack->dccph_ack_nr_low); | ||
288 | #else | ||
289 | #error "Adjust your <asm/byteorder.h> defines" | ||
290 | #endif | ||
291 | } | 296 | } |
292 | 297 | ||
293 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) | 298 | static inline struct dccp_hdr_response *dccp_hdr_response(struct sk_buff *skb) |
@@ -314,38 +319,60 @@ static inline unsigned int dccp_hdr_len(const struct sk_buff *skb) | |||
314 | 319 | ||
315 | /* initial values for each feature */ | 320 | /* initial values for each feature */ |
316 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 | 321 | #define DCCPF_INITIAL_SEQUENCE_WINDOW 100 |
317 | /* FIXME: for now we're using CCID 3 (TFRC) */ | 322 | #define DCCPF_INITIAL_ACK_RATIO 2 |
318 | #define DCCPF_INITIAL_CCID 3 | 323 | #define DCCPF_INITIAL_CCID 2 |
319 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 0 | 324 | #define DCCPF_INITIAL_SEND_ACK_VECTOR 1 |
320 | /* FIXME: for now we're default to 1 but it should really be 0 */ | 325 | /* FIXME: for now we're default to 1 but it should really be 0 */ |
321 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 | 326 | #define DCCPF_INITIAL_SEND_NDP_COUNT 1 |
322 | 327 | ||
323 | #define DCCP_NDP_LIMIT 0xFFFFFF | 328 | #define DCCP_NDP_LIMIT 0xFFFFFF |
324 | 329 | ||
325 | /** | 330 | /** |
326 | * struct dccp_options - option values for a DCCP connection | 331 | * struct dccp_minisock - Minimal DCCP connection representation |
327 | * @dccpo_sequence_window - Sequence Window Feature (section 7.5.2) | 332 | * |
328 | * @dccpo_ccid - Congestion Control Id (CCID) (section 10) | 333 | * Will be used to pass the state from dccp_request_sock to dccp_sock. |
329 | * @dccpo_send_ack_vector - Send Ack Vector Feature (section 11.5) | 334 | * |
330 | * @dccpo_send_ndp_count - Send NDP Count Feature (7.7.2) | 335 | * @dccpms_sequence_window - Sequence Window Feature (section 7.5.2) |
336 | * @dccpms_ccid - Congestion Control Id (CCID) (section 10) | ||
337 | * @dccpms_send_ack_vector - Send Ack Vector Feature (section 11.5) | ||
338 | * @dccpms_send_ndp_count - Send NDP Count Feature (7.7.2) | ||
331 | */ | 339 | */ |
332 | struct dccp_options { | 340 | struct dccp_minisock { |
333 | __u64 dccpo_sequence_window; | 341 | __u64 dccpms_sequence_window; |
334 | __u8 dccpo_rx_ccid; | 342 | __u8 dccpms_rx_ccid; |
335 | __u8 dccpo_tx_ccid; | 343 | __u8 dccpms_tx_ccid; |
336 | __u8 dccpo_send_ack_vector; | 344 | __u8 dccpms_send_ack_vector; |
337 | __u8 dccpo_send_ndp_count; | 345 | __u8 dccpms_send_ndp_count; |
346 | __u8 dccpms_ack_ratio; | ||
347 | struct list_head dccpms_pending; | ||
348 | struct list_head dccpms_conf; | ||
349 | }; | ||
350 | |||
351 | struct dccp_opt_conf { | ||
352 | __u8 *dccpoc_val; | ||
353 | __u8 dccpoc_len; | ||
354 | }; | ||
355 | |||
356 | struct dccp_opt_pend { | ||
357 | struct list_head dccpop_node; | ||
358 | __u8 dccpop_type; | ||
359 | __u8 dccpop_feat; | ||
360 | __u8 *dccpop_val; | ||
361 | __u8 dccpop_len; | ||
362 | int dccpop_conf; | ||
363 | struct dccp_opt_conf *dccpop_sc; | ||
338 | }; | 364 | }; |
339 | 365 | ||
340 | extern void __dccp_options_init(struct dccp_options *dccpo); | 366 | extern void __dccp_minisock_init(struct dccp_minisock *dmsk); |
341 | extern void dccp_options_init(struct dccp_options *dccpo); | 367 | extern void dccp_minisock_init(struct dccp_minisock *dmsk); |
368 | |||
342 | extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); | 369 | extern int dccp_parse_options(struct sock *sk, struct sk_buff *skb); |
343 | 370 | ||
344 | struct dccp_request_sock { | 371 | struct dccp_request_sock { |
345 | struct inet_request_sock dreq_inet_rsk; | 372 | struct inet_request_sock dreq_inet_rsk; |
346 | __u64 dreq_iss; | 373 | __u64 dreq_iss; |
347 | __u64 dreq_isr; | 374 | __u64 dreq_isr; |
348 | __u32 dreq_service; | 375 | __be32 dreq_service; |
349 | }; | 376 | }; |
350 | 377 | ||
351 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) | 378 | static inline struct dccp_request_sock *dccp_rsk(const struct request_sock *req) |
@@ -373,13 +400,13 @@ enum dccp_role { | |||
373 | 400 | ||
374 | struct dccp_service_list { | 401 | struct dccp_service_list { |
375 | __u32 dccpsl_nr; | 402 | __u32 dccpsl_nr; |
376 | __u32 dccpsl_list[0]; | 403 | __be32 dccpsl_list[0]; |
377 | }; | 404 | }; |
378 | 405 | ||
379 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) | 406 | #define DCCP_SERVICE_INVALID_VALUE htonl((__u32)-1) |
380 | 407 | ||
381 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, | 408 | static inline int dccp_list_has_service(const struct dccp_service_list *sl, |
382 | const u32 service) | 409 | const __be32 service) |
383 | { | 410 | { |
384 | if (likely(sl != NULL)) { | 411 | if (likely(sl != NULL)) { |
385 | u32 i = sl->dccpsl_nr; | 412 | u32 i = sl->dccpsl_nr; |
@@ -425,17 +452,17 @@ struct dccp_sock { | |||
425 | __u64 dccps_gss; | 452 | __u64 dccps_gss; |
426 | __u64 dccps_gsr; | 453 | __u64 dccps_gsr; |
427 | __u64 dccps_gar; | 454 | __u64 dccps_gar; |
428 | __u32 dccps_service; | 455 | __be32 dccps_service; |
429 | struct dccp_service_list *dccps_service_list; | 456 | struct dccp_service_list *dccps_service_list; |
430 | struct timeval dccps_timestamp_time; | 457 | struct timeval dccps_timestamp_time; |
431 | __u32 dccps_timestamp_echo; | 458 | __u32 dccps_timestamp_echo; |
432 | __u32 dccps_packet_size; | 459 | __u32 dccps_packet_size; |
460 | __u16 dccps_l_ack_ratio; | ||
461 | __u16 dccps_r_ack_ratio; | ||
433 | unsigned long dccps_ndp_count; | 462 | unsigned long dccps_ndp_count; |
434 | __u32 dccps_mss_cache; | 463 | __u32 dccps_mss_cache; |
435 | struct dccp_options dccps_options; | 464 | struct dccp_minisock dccps_minisock; |
436 | struct dccp_ackvec *dccps_hc_rx_ackvec; | 465 | struct dccp_ackvec *dccps_hc_rx_ackvec; |
437 | void *dccps_hc_rx_ccid_private; | ||
438 | void *dccps_hc_tx_ccid_private; | ||
439 | struct ccid *dccps_hc_rx_ccid; | 466 | struct ccid *dccps_hc_rx_ccid; |
440 | struct ccid *dccps_hc_tx_ccid; | 467 | struct ccid *dccps_hc_tx_ccid; |
441 | struct dccp_options_received dccps_options_received; | 468 | struct dccp_options_received dccps_options_received; |
@@ -450,6 +477,11 @@ static inline struct dccp_sock *dccp_sk(const struct sock *sk) | |||
450 | return (struct dccp_sock *)sk; | 477 | return (struct dccp_sock *)sk; |
451 | } | 478 | } |
452 | 479 | ||
480 | static inline struct dccp_minisock *dccp_msk(const struct sock *sk) | ||
481 | { | ||
482 | return (struct dccp_minisock *)&dccp_sk(sk)->dccps_minisock; | ||
483 | } | ||
484 | |||
453 | static inline int dccp_service_not_initialized(const struct sock *sk) | 485 | static inline int dccp_service_not_initialized(const struct sock *sk) |
454 | { | 486 | { |
455 | return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; | 487 | return dccp_sk(sk)->dccps_service == DCCP_SERVICE_INVALID_VALUE; |
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h index a5fa6a6eede8..4b0428e335be 100644 --- a/include/linux/debugfs.h +++ b/include/linux/debugfs.h | |||
@@ -21,6 +21,11 @@ | |||
21 | 21 | ||
22 | struct file_operations; | 22 | struct file_operations; |
23 | 23 | ||
24 | struct debugfs_blob_wrapper { | ||
25 | void *data; | ||
26 | unsigned long size; | ||
27 | }; | ||
28 | |||
24 | #if defined(CONFIG_DEBUG_FS) | 29 | #if defined(CONFIG_DEBUG_FS) |
25 | struct dentry *debugfs_create_file(const char *name, mode_t mode, | 30 | struct dentry *debugfs_create_file(const char *name, mode_t mode, |
26 | struct dentry *parent, void *data, | 31 | struct dentry *parent, void *data, |
@@ -39,6 +44,9 @@ struct dentry *debugfs_create_u32(const char *name, mode_t mode, | |||
39 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, | 44 | struct dentry *debugfs_create_bool(const char *name, mode_t mode, |
40 | struct dentry *parent, u32 *value); | 45 | struct dentry *parent, u32 *value); |
41 | 46 | ||
47 | struct dentry *debugfs_create_blob(const char *name, mode_t mode, | ||
48 | struct dentry *parent, | ||
49 | struct debugfs_blob_wrapper *blob); | ||
42 | #else | 50 | #else |
43 | 51 | ||
44 | #include <linux/err.h> | 52 | #include <linux/err.h> |
@@ -94,6 +102,13 @@ static inline struct dentry *debugfs_create_bool(const char *name, mode_t mode, | |||
94 | return ERR_PTR(-ENODEV); | 102 | return ERR_PTR(-ENODEV); |
95 | } | 103 | } |
96 | 104 | ||
105 | static inline struct dentry *debugfs_create_blob(const char *name, mode_t mode, | ||
106 | struct dentry *parent, | ||
107 | struct debugfs_blob_wrapper *blob) | ||
108 | { | ||
109 | return ERR_PTR(-ENODEV); | ||
110 | } | ||
111 | |||
97 | #endif | 112 | #endif |
98 | 113 | ||
99 | #endif | 114 | #endif |
diff --git a/include/linux/device.h b/include/linux/device.h index 58df18d9cd3e..f6e72a65a3f2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -378,6 +378,7 @@ extern void device_bind_driver(struct device * dev); | |||
378 | extern void device_release_driver(struct device * dev); | 378 | extern void device_release_driver(struct device * dev); |
379 | extern int device_attach(struct device * dev); | 379 | extern int device_attach(struct device * dev); |
380 | extern void driver_attach(struct device_driver * drv); | 380 | extern void driver_attach(struct device_driver * drv); |
381 | extern void device_reprobe(struct device *dev); | ||
381 | 382 | ||
382 | 383 | ||
383 | /* | 384 | /* |
@@ -399,7 +400,7 @@ extern struct device * get_device(struct device * dev); | |||
399 | extern void put_device(struct device * dev); | 400 | extern void put_device(struct device * dev); |
400 | 401 | ||
401 | 402 | ||
402 | /* drivers/base/power.c */ | 403 | /* drivers/base/power/shutdown.c */ |
403 | extern void device_shutdown(void); | 404 | extern void device_shutdown(void); |
404 | 405 | ||
405 | 406 | ||
@@ -424,6 +425,8 @@ extern void firmware_unregister(struct subsystem *); | |||
424 | dev_printk(KERN_INFO , dev , format , ## arg) | 425 | dev_printk(KERN_INFO , dev , format , ## arg) |
425 | #define dev_warn(dev, format, arg...) \ | 426 | #define dev_warn(dev, format, arg...) \ |
426 | dev_printk(KERN_WARNING , dev , format , ## arg) | 427 | dev_printk(KERN_WARNING , dev , format , ## arg) |
428 | #define dev_notice(dev, format, arg...) \ | ||
429 | dev_printk(KERN_NOTICE , dev , format , ## arg) | ||
427 | 430 | ||
428 | /* Create alias, so I can be autoloaded. */ | 431 | /* Create alias, so I can be autoloaded. */ |
429 | #define MODULE_ALIAS_CHARDEV(major,minor) \ | 432 | #define MODULE_ALIAS_CHARDEV(major,minor) \ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2d80cc761a15..a8731062a74c 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -20,6 +20,7 @@ enum dma_data_direction { | |||
20 | #define DMA_31BIT_MASK 0x000000007fffffffULL | 20 | #define DMA_31BIT_MASK 0x000000007fffffffULL |
21 | #define DMA_30BIT_MASK 0x000000003fffffffULL | 21 | #define DMA_30BIT_MASK 0x000000003fffffffULL |
22 | #define DMA_29BIT_MASK 0x000000001fffffffULL | 22 | #define DMA_29BIT_MASK 0x000000001fffffffULL |
23 | #define DMA_28BIT_MASK 0x000000000fffffffULL | ||
23 | 24 | ||
24 | #include <asm/dma-mapping.h> | 25 | #include <asm/dma-mapping.h> |
25 | 26 | ||
diff --git a/include/linux/dn.h b/include/linux/dn.h index 782cae49e64c..10b6a6fd5837 100644 --- a/include/linux/dn.h +++ b/include/linux/dn.h | |||
@@ -71,17 +71,17 @@ | |||
71 | 71 | ||
72 | struct dn_naddr | 72 | struct dn_naddr |
73 | { | 73 | { |
74 | unsigned short a_len; | 74 | __le16 a_len; |
75 | unsigned char a_addr[DN_MAXADDL]; | 75 | __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */ |
76 | }; | 76 | }; |
77 | 77 | ||
78 | struct sockaddr_dn | 78 | struct sockaddr_dn |
79 | { | 79 | { |
80 | unsigned short sdn_family; | 80 | __u16 sdn_family; |
81 | unsigned char sdn_flags; | 81 | __u8 sdn_flags; |
82 | unsigned char sdn_objnum; | 82 | __u8 sdn_objnum; |
83 | unsigned short sdn_objnamel; | 83 | __le16 sdn_objnamel; |
84 | unsigned char sdn_objname[DN_MAXOBJL]; | 84 | __u8 sdn_objname[DN_MAXOBJL]; |
85 | struct dn_naddr sdn_add; | 85 | struct dn_naddr sdn_add; |
86 | }; | 86 | }; |
87 | #define sdn_nodeaddrl sdn_add.a_len /* Node address length */ | 87 | #define sdn_nodeaddrl sdn_add.a_len /* Node address length */ |
@@ -93,38 +93,38 @@ struct sockaddr_dn | |||
93 | * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure | 93 | * DECnet set/get DSO_CONDATA, DSO_DISDATA (optional data) structure |
94 | */ | 94 | */ |
95 | struct optdata_dn { | 95 | struct optdata_dn { |
96 | unsigned short opt_status; /* Extended status return */ | 96 | __le16 opt_status; /* Extended status return */ |
97 | #define opt_sts opt_status | 97 | #define opt_sts opt_status |
98 | unsigned short opt_optl; /* Length of user data */ | 98 | __le16 opt_optl; /* Length of user data */ |
99 | unsigned char opt_data[16]; /* User data */ | 99 | __u8 opt_data[16]; /* User data */ |
100 | }; | 100 | }; |
101 | 101 | ||
102 | struct accessdata_dn | 102 | struct accessdata_dn |
103 | { | 103 | { |
104 | unsigned char acc_accl; | 104 | __u8 acc_accl; |
105 | unsigned char acc_acc[DN_MAXACCL]; | 105 | __u8 acc_acc[DN_MAXACCL]; |
106 | unsigned char acc_passl; | 106 | __u8 acc_passl; |
107 | unsigned char acc_pass[DN_MAXACCL]; | 107 | __u8 acc_pass[DN_MAXACCL]; |
108 | unsigned char acc_userl; | 108 | __u8 acc_userl; |
109 | unsigned char acc_user[DN_MAXACCL]; | 109 | __u8 acc_user[DN_MAXACCL]; |
110 | }; | 110 | }; |
111 | 111 | ||
112 | /* | 112 | /* |
113 | * DECnet logical link information structure | 113 | * DECnet logical link information structure |
114 | */ | 114 | */ |
115 | struct linkinfo_dn { | 115 | struct linkinfo_dn { |
116 | unsigned short idn_segsize; /* Segment size for link */ | 116 | __le16 idn_segsize; /* Segment size for link */ |
117 | unsigned char idn_linkstate; /* Logical link state */ | 117 | __u8 idn_linkstate; /* Logical link state */ |
118 | }; | 118 | }; |
119 | 119 | ||
120 | /* | 120 | /* |
121 | * Ethernet address format (for DECnet) | 121 | * Ethernet address format (for DECnet) |
122 | */ | 122 | */ |
123 | union etheraddress { | 123 | union etheraddress { |
124 | unsigned char dne_addr[6]; /* Full ethernet address */ | 124 | __u8 dne_addr[6]; /* Full ethernet address */ |
125 | struct { | 125 | struct { |
126 | unsigned char dne_hiord[4]; /* DECnet HIORD prefix */ | 126 | __u8 dne_hiord[4]; /* DECnet HIORD prefix */ |
127 | unsigned char dne_nodeaddr[2]; /* DECnet node address */ | 127 | __u8 dne_nodeaddr[2]; /* DECnet node address */ |
128 | } dne_remote; | 128 | } dne_remote; |
129 | }; | 129 | }; |
130 | 130 | ||
@@ -133,7 +133,7 @@ union etheraddress { | |||
133 | * DECnet physical socket address format | 133 | * DECnet physical socket address format |
134 | */ | 134 | */ |
135 | struct dn_addr { | 135 | struct dn_addr { |
136 | unsigned short dna_family; /* AF_DECnet */ | 136 | __le16 dna_family; /* AF_DECnet */ |
137 | union etheraddress dna_netaddr; /* DECnet ethernet address */ | 137 | union etheraddress dna_netaddr; /* DECnet ethernet address */ |
138 | }; | 138 | }; |
139 | 139 | ||
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h index 2b8797084685..0874a67c6b92 100644 --- a/include/linux/dvb/audio.h +++ b/include/linux/dvb/audio.h | |||
@@ -121,4 +121,17 @@ typedef uint16_t audio_attributes_t; | |||
121 | #define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) | 121 | #define AUDIO_SET_ATTRIBUTES _IOW('o', 17, audio_attributes_t) |
122 | #define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) | 122 | #define AUDIO_SET_KARAOKE _IOW('o', 18, audio_karaoke_t) |
123 | 123 | ||
124 | /** | ||
125 | * AUDIO_GET_PTS | ||
126 | * | ||
127 | * Read the 33 bit presentation time stamp as defined | ||
128 | * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
129 | * | ||
130 | * The PTS should belong to the currently played | ||
131 | * frame if possible, but may also be a value close to it | ||
132 | * like the PTS of the last decoded frame or the last PTS | ||
133 | * extracted by the PES parser. | ||
134 | */ | ||
135 | #define AUDIO_GET_PTS _IOR('o', 19, __u64) | ||
136 | |||
124 | #endif /* _DVBAUDIO_H_ */ | 137 | #endif /* _DVBAUDIO_H_ */ |
diff --git a/include/linux/dvb/video.h b/include/linux/dvb/video.h index b81e58b2ebf8..faebfda397ff 100644 --- a/include/linux/dvb/video.h +++ b/include/linux/dvb/video.h | |||
@@ -200,4 +200,17 @@ typedef uint16_t video_attributes_t; | |||
200 | #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) | 200 | #define VIDEO_GET_SIZE _IOR('o', 55, video_size_t) |
201 | #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) | 201 | #define VIDEO_GET_FRAME_RATE _IOR('o', 56, unsigned int) |
202 | 202 | ||
203 | /** | ||
204 | * VIDEO_GET_PTS | ||
205 | * | ||
206 | * Read the 33 bit presentation time stamp as defined | ||
207 | * in ITU T-REC-H.222.0 / ISO/IEC 13818-1. | ||
208 | * | ||
209 | * The PTS should belong to the currently played | ||
210 | * frame if possible, but may also be a value close to it | ||
211 | * like the PTS of the last decoded frame or the last PTS | ||
212 | * extracted by the PES parser. | ||
213 | */ | ||
214 | #define VIDEO_GET_PTS _IOR('o', 57, __u64) | ||
215 | |||
203 | #endif /*_DVBVIDEO_H_*/ | 216 | #endif /*_DVBVIDEO_H_*/ |
diff --git a/include/linux/eventpoll.h b/include/linux/eventpoll.h index 1289f0ec4c00..1e4bdfcf83a2 100644 --- a/include/linux/eventpoll.h +++ b/include/linux/eventpoll.h | |||
@@ -52,7 +52,12 @@ struct file; | |||
52 | #ifdef CONFIG_EPOLL | 52 | #ifdef CONFIG_EPOLL |
53 | 53 | ||
54 | /* Used to initialize the epoll bits inside the "struct file" */ | 54 | /* Used to initialize the epoll bits inside the "struct file" */ |
55 | void eventpoll_init_file(struct file *file); | 55 | static inline void eventpoll_init_file(struct file *file) |
56 | { | ||
57 | INIT_LIST_HEAD(&file->f_ep_links); | ||
58 | spin_lock_init(&file->f_ep_lock); | ||
59 | } | ||
60 | |||
56 | 61 | ||
57 | /* Used to release the epoll bits inside the "struct file" */ | 62 | /* Used to release the epoll bits inside the "struct file" */ |
58 | void eventpoll_release_file(struct file *file); | 63 | void eventpoll_release_file(struct file *file); |
@@ -85,7 +90,6 @@ static inline void eventpoll_release(struct file *file) | |||
85 | eventpoll_release_file(file); | 90 | eventpoll_release_file(file); |
86 | } | 91 | } |
87 | 92 | ||
88 | |||
89 | #else | 93 | #else |
90 | 94 | ||
91 | static inline void eventpoll_init_file(struct file *file) {} | 95 | static inline void eventpoll_init_file(struct file *file) {} |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index c0272d73ab20..e7239f2f97a1 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -772,9 +772,12 @@ extern unsigned long ext3_count_free (struct buffer_head *, unsigned); | |||
772 | 772 | ||
773 | 773 | ||
774 | /* inode.c */ | 774 | /* inode.c */ |
775 | extern int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); | 775 | int ext3_forget(handle_t *, int, struct inode *, struct buffer_head *, int); |
776 | extern struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); | 776 | struct buffer_head * ext3_getblk (handle_t *, struct inode *, long, int, int *); |
777 | extern struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); | 777 | struct buffer_head * ext3_bread (handle_t *, struct inode *, int, int, int *); |
778 | int ext3_get_block_handle(handle_t *handle, struct inode *inode, | ||
779 | sector_t iblock, struct buffer_head *bh_result, int create, | ||
780 | int extend_disksize); | ||
778 | 781 | ||
779 | extern void ext3_read_inode (struct inode *); | 782 | extern void ext3_read_inode (struct inode *); |
780 | extern int ext3_write_inode (struct inode *, int); | 783 | extern int ext3_write_inode (struct inode *, int); |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index e71dd98dbcae..7abf90147180 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/rwsem.h> | 19 | #include <linux/rwsem.h> |
20 | #include <linux/rbtree.h> | 20 | #include <linux/rbtree.h> |
21 | #include <linux/seqlock.h> | 21 | #include <linux/seqlock.h> |
22 | #include <linux/mutex.h> | ||
22 | 23 | ||
23 | struct ext3_reserve_window { | 24 | struct ext3_reserve_window { |
24 | __u32 _rsv_start; /* First byte reserved */ | 25 | __u32 _rsv_start; /* First byte reserved */ |
@@ -122,16 +123,16 @@ struct ext3_inode_info { | |||
122 | __u16 i_extra_isize; | 123 | __u16 i_extra_isize; |
123 | 124 | ||
124 | /* | 125 | /* |
125 | * truncate_sem is for serialising ext3_truncate() against | 126 | * truncate_mutex is for serialising ext3_truncate() against |
126 | * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's | 127 | * ext3_getblock(). In the 2.4 ext2 design, great chunks of inode's |
127 | * data tree are chopped off during truncate. We can't do that in | 128 | * data tree are chopped off during truncate. We can't do that in |
128 | * ext3 because whenever we perform intermediate commits during | 129 | * ext3 because whenever we perform intermediate commits during |
129 | * truncate, the inode and all the metadata blocks *must* be in a | 130 | * truncate, the inode and all the metadata blocks *must* be in a |
130 | * consistent state which allows truncation of the orphans to restart | 131 | * consistent state which allows truncation of the orphans to restart |
131 | * during recovery. Hence we must fix the get_block-vs-truncate race | 132 | * during recovery. Hence we must fix the get_block-vs-truncate race |
132 | * by other means, so we have truncate_sem. | 133 | * by other means, so we have truncate_mutex. |
133 | */ | 134 | */ |
134 | struct semaphore truncate_sem; | 135 | struct mutex truncate_mutex; |
135 | struct inode vfs_inode; | 136 | struct inode vfs_inode; |
136 | }; | 137 | }; |
137 | 138 | ||
diff --git a/include/linux/file.h b/include/linux/file.h index 9901b850f2e4..9f7c2513866f 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #include <linux/compiler.h> | 10 | #include <linux/compiler.h> |
11 | #include <linux/spinlock.h> | 11 | #include <linux/spinlock.h> |
12 | #include <linux/rcupdate.h> | 12 | #include <linux/rcupdate.h> |
13 | #include <linux/types.h> | ||
13 | 14 | ||
14 | /* | 15 | /* |
15 | * The default fd array needs to be at least BITS_PER_LONG, | 16 | * The default fd array needs to be at least BITS_PER_LONG, |
@@ -17,10 +18,22 @@ | |||
17 | */ | 18 | */ |
18 | #define NR_OPEN_DEFAULT BITS_PER_LONG | 19 | #define NR_OPEN_DEFAULT BITS_PER_LONG |
19 | 20 | ||
21 | /* | ||
22 | * The embedded_fd_set is a small fd_set, | ||
23 | * suitable for most tasks (which open <= BITS_PER_LONG files) | ||
24 | */ | ||
25 | struct embedded_fd_set { | ||
26 | unsigned long fds_bits[1]; | ||
27 | }; | ||
28 | |||
29 | /* | ||
30 | * More than this number of fds: we use a separately allocated fd_set | ||
31 | */ | ||
32 | #define EMBEDDED_FD_SET_SIZE (BITS_PER_BYTE * sizeof(struct embedded_fd_set)) | ||
33 | |||
20 | struct fdtable { | 34 | struct fdtable { |
21 | unsigned int max_fds; | 35 | unsigned int max_fds; |
22 | int max_fdset; | 36 | int max_fdset; |
23 | int next_fd; | ||
24 | struct file ** fd; /* current fd array */ | 37 | struct file ** fd; /* current fd array */ |
25 | fd_set *close_on_exec; | 38 | fd_set *close_on_exec; |
26 | fd_set *open_fds; | 39 | fd_set *open_fds; |
@@ -33,13 +46,20 @@ struct fdtable { | |||
33 | * Open file table structure | 46 | * Open file table structure |
34 | */ | 47 | */ |
35 | struct files_struct { | 48 | struct files_struct { |
49 | /* | ||
50 | * read mostly part | ||
51 | */ | ||
36 | atomic_t count; | 52 | atomic_t count; |
37 | struct fdtable *fdt; | 53 | struct fdtable *fdt; |
38 | struct fdtable fdtab; | 54 | struct fdtable fdtab; |
39 | fd_set close_on_exec_init; | 55 | /* |
40 | fd_set open_fds_init; | 56 | * written part on a separate cache line in SMP |
57 | */ | ||
58 | spinlock_t file_lock ____cacheline_aligned_in_smp; | ||
59 | int next_fd; | ||
60 | struct embedded_fd_set close_on_exec_init; | ||
61 | struct embedded_fd_set open_fds_init; | ||
41 | struct file * fd_array[NR_OPEN_DEFAULT]; | 62 | struct file * fd_array[NR_OPEN_DEFAULT]; |
42 | spinlock_t file_lock; /* Protects concurrent writers. Nests inside tsk->alloc_lock */ | ||
43 | }; | 63 | }; |
44 | 64 | ||
45 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 65 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 5dc0fa288a4c..404d391f3d35 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -197,6 +197,10 @@ extern int dir_notify_enable; | |||
197 | #define BLKBSZGET _IOR(0x12,112,size_t) | 197 | #define BLKBSZGET _IOR(0x12,112,size_t) |
198 | #define BLKBSZSET _IOW(0x12,113,size_t) | 198 | #define BLKBSZSET _IOW(0x12,113,size_t) |
199 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ | 199 | #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */ |
200 | #define BLKTRACESETUP _IOWR(0x12,115,struct blk_user_trace_setup) | ||
201 | #define BLKTRACESTART _IO(0x12,116) | ||
202 | #define BLKTRACESTOP _IO(0x12,117) | ||
203 | #define BLKTRACETEARDOWN _IO(0x12,118) | ||
200 | 204 | ||
201 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 205 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
202 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 206 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
@@ -397,8 +401,8 @@ struct block_device { | |||
397 | dev_t bd_dev; /* not a kdev_t - it's a search key */ | 401 | dev_t bd_dev; /* not a kdev_t - it's a search key */ |
398 | struct inode * bd_inode; /* will die */ | 402 | struct inode * bd_inode; /* will die */ |
399 | int bd_openers; | 403 | int bd_openers; |
400 | struct semaphore bd_sem; /* open/close mutex */ | 404 | struct mutex bd_mutex; /* open/close mutex */ |
401 | struct semaphore bd_mount_sem; /* mount mutex */ | 405 | struct mutex bd_mount_mutex; /* mount mutex */ |
402 | struct list_head bd_inodes; | 406 | struct list_head bd_inodes; |
403 | void * bd_holder; | 407 | void * bd_holder; |
404 | int bd_holders; | 408 | int bd_holders; |
@@ -509,7 +513,7 @@ struct inode { | |||
509 | 513 | ||
510 | #ifdef CONFIG_INOTIFY | 514 | #ifdef CONFIG_INOTIFY |
511 | struct list_head inotify_watches; /* watches on this inode */ | 515 | struct list_head inotify_watches; /* watches on this inode */ |
512 | struct semaphore inotify_sem; /* protects the watches list */ | 516 | struct mutex inotify_mutex; /* protects the watches list */ |
513 | #endif | 517 | #endif |
514 | 518 | ||
515 | unsigned long i_state; | 519 | unsigned long i_state; |
@@ -843,7 +847,7 @@ struct super_block { | |||
843 | * The next field is for VFS *only*. No filesystems have any business | 847 | * The next field is for VFS *only*. No filesystems have any business |
844 | * even looking at it. You had been warned. | 848 | * even looking at it. You had been warned. |
845 | */ | 849 | */ |
846 | struct semaphore s_vfs_rename_sem; /* Kludge */ | 850 | struct mutex s_vfs_rename_mutex; /* Kludge */ |
847 | 851 | ||
848 | /* Granuality of c/m/atime in ns. | 852 | /* Granuality of c/m/atime in ns. |
849 | Cannot be worse than a second */ | 853 | Cannot be worse than a second */ |
@@ -1112,6 +1116,18 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1112 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1116 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
1113 | } | 1117 | } |
1114 | 1118 | ||
1119 | static inline void inode_inc_link_count(struct inode *inode) | ||
1120 | { | ||
1121 | inode->i_nlink++; | ||
1122 | mark_inode_dirty(inode); | ||
1123 | } | ||
1124 | |||
1125 | static inline void inode_dec_link_count(struct inode *inode) | ||
1126 | { | ||
1127 | inode->i_nlink--; | ||
1128 | mark_inode_dirty(inode); | ||
1129 | } | ||
1130 | |||
1115 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); | 1131 | extern void touch_atime(struct vfsmount *mnt, struct dentry *dentry); |
1116 | static inline void file_accessed(struct file *file) | 1132 | static inline void file_accessed(struct file *file) |
1117 | { | 1133 | { |
@@ -1531,7 +1547,7 @@ extern void destroy_inode(struct inode *); | |||
1531 | extern struct inode *new_inode(struct super_block *); | 1547 | extern struct inode *new_inode(struct super_block *); |
1532 | extern int remove_suid(struct dentry *); | 1548 | extern int remove_suid(struct dentry *); |
1533 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); | 1549 | extern void remove_dquot_ref(struct super_block *, int, struct list_head *); |
1534 | extern struct semaphore iprune_sem; | 1550 | extern struct mutex iprune_mutex; |
1535 | 1551 | ||
1536 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); | 1552 | extern void __insert_inode_hash(struct inode *, unsigned long hashval); |
1537 | extern void remove_inode_hash(struct inode *); | 1553 | extern void remove_inode_hash(struct inode *); |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index a9f1cfd096ff..a3a0e078f79d 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -83,5 +83,32 @@ struct fsl_i2c_platform_data { | |||
83 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 | 83 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 |
84 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 | 84 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 |
85 | 85 | ||
86 | |||
87 | enum fsl_usb2_operating_modes { | ||
88 | FSL_USB2_MPH_HOST, | ||
89 | FSL_USB2_DR_HOST, | ||
90 | FSL_USB2_DR_DEVICE, | ||
91 | FSL_USB2_DR_OTG, | ||
92 | }; | ||
93 | |||
94 | enum fsl_usb2_phy_modes { | ||
95 | FSL_USB2_PHY_NONE, | ||
96 | FSL_USB2_PHY_ULPI, | ||
97 | FSL_USB2_PHY_UTMI, | ||
98 | FSL_USB2_PHY_UTMI_WIDE, | ||
99 | FSL_USB2_PHY_SERIAL, | ||
100 | }; | ||
101 | |||
102 | struct fsl_usb2_platform_data { | ||
103 | /* board specific information */ | ||
104 | enum fsl_usb2_operating_modes operating_mode; | ||
105 | enum fsl_usb2_phy_modes phy_mode; | ||
106 | unsigned int port_enables; | ||
107 | }; | ||
108 | |||
109 | /* Flags in fsl_usb2_mph_platform_data */ | ||
110 | #define FSL_USB2_PORT0_ENABLED 0x00000001 | ||
111 | #define FSL_USB2_PORT1_ENABLED 0x00000002 | ||
112 | |||
86 | #endif /* _FSL_DEVICE_H_ */ | 113 | #endif /* _FSL_DEVICE_H_ */ |
87 | #endif /* __KERNEL__ */ | 114 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/generic_serial.h b/include/linux/generic_serial.h index 0abe9d9a0069..652611a4bdcd 100644 --- a/include/linux/generic_serial.h +++ b/include/linux/generic_serial.h | |||
@@ -12,6 +12,8 @@ | |||
12 | #ifndef GENERIC_SERIAL_H | 12 | #ifndef GENERIC_SERIAL_H |
13 | #define GENERIC_SERIAL_H | 13 | #define GENERIC_SERIAL_H |
14 | 14 | ||
15 | #include <linux/mutex.h> | ||
16 | |||
15 | struct real_driver { | 17 | struct real_driver { |
16 | void (*disable_tx_interrupts) (void *); | 18 | void (*disable_tx_interrupts) (void *); |
17 | void (*enable_tx_interrupts) (void *); | 19 | void (*enable_tx_interrupts) (void *); |
@@ -34,7 +36,7 @@ struct gs_port { | |||
34 | int xmit_head; | 36 | int xmit_head; |
35 | int xmit_tail; | 37 | int xmit_tail; |
36 | int xmit_cnt; | 38 | int xmit_cnt; |
37 | struct semaphore port_write_sem; | 39 | struct mutex port_write_mutex; |
38 | int flags; | 40 | int flags; |
39 | wait_queue_head_t open_wait; | 41 | wait_queue_head_t open_wait; |
40 | wait_queue_head_t close_wait; | 42 | wait_queue_head_t close_wait; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index eef5ccdcd731..fd647fde5ec1 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -149,22 +149,16 @@ struct disk_attribute { | |||
149 | ({ \ | 149 | ({ \ |
150 | typeof(gendiskp->dkstats->field) res = 0; \ | 150 | typeof(gendiskp->dkstats->field) res = 0; \ |
151 | int i; \ | 151 | int i; \ |
152 | for (i=0; i < NR_CPUS; i++) { \ | 152 | for_each_cpu(i) \ |
153 | if (!cpu_possible(i)) \ | ||
154 | continue; \ | ||
155 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ | 153 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ |
156 | } \ | ||
157 | res; \ | 154 | res; \ |
158 | }) | 155 | }) |
159 | 156 | ||
160 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | 157 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { |
161 | int i; | 158 | int i; |
162 | for (i=0; i < NR_CPUS; i++) { | 159 | for_each_cpu(i) |
163 | if (cpu_possible(i)) { | 160 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, |
164 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, | 161 | sizeof (struct disk_stats)); |
165 | sizeof (struct disk_stats)); | ||
166 | } | ||
167 | } | ||
168 | } | 162 | } |
169 | 163 | ||
170 | #else | 164 | #else |
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 68d82ad6b17c..d6f1019625af 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -20,10 +20,7 @@ void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long) | |||
20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); | 20 | int hugetlb_prefault(struct address_space *, struct vm_area_struct *); |
21 | int hugetlb_report_meminfo(char *); | 21 | int hugetlb_report_meminfo(char *); |
22 | int hugetlb_report_node_meminfo(int, char *); | 22 | int hugetlb_report_node_meminfo(int, char *); |
23 | int is_hugepage_mem_enough(size_t); | ||
24 | unsigned long hugetlb_total_pages(void); | 23 | unsigned long hugetlb_total_pages(void); |
25 | struct page *alloc_huge_page(struct vm_area_struct *, unsigned long); | ||
26 | void free_huge_page(struct page *); | ||
27 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 24 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
28 | unsigned long address, int write_access); | 25 | unsigned long address, int write_access); |
29 | 26 | ||
@@ -39,18 +36,35 @@ struct page *follow_huge_addr(struct mm_struct *mm, unsigned long address, | |||
39 | int write); | 36 | int write); |
40 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, | 37 | struct page *follow_huge_pmd(struct mm_struct *mm, unsigned long address, |
41 | pmd_t *pmd, int write); | 38 | pmd_t *pmd, int write); |
42 | int is_aligned_hugepage_range(unsigned long addr, unsigned long len); | ||
43 | int pmd_huge(pmd_t pmd); | 39 | int pmd_huge(pmd_t pmd); |
40 | void hugetlb_change_protection(struct vm_area_struct *vma, | ||
41 | unsigned long address, unsigned long end, pgprot_t newprot); | ||
44 | 42 | ||
45 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE | 43 | #ifndef ARCH_HAS_HUGEPAGE_ONLY_RANGE |
46 | #define is_hugepage_only_range(mm, addr, len) 0 | 44 | #define is_hugepage_only_range(mm, addr, len) 0 |
47 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 45 | #endif |
48 | do { } while (0) | 46 | |
47 | #ifndef ARCH_HAS_HUGETLB_FREE_PGD_RANGE | ||
48 | #define hugetlb_free_pgd_range free_pgd_range | ||
49 | #else | ||
50 | void hugetlb_free_pgd_range(struct mmu_gather **tlb, unsigned long addr, | ||
51 | unsigned long end, unsigned long floor, | ||
52 | unsigned long ceiling); | ||
49 | #endif | 53 | #endif |
50 | 54 | ||
51 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE | 55 | #ifndef ARCH_HAS_PREPARE_HUGEPAGE_RANGE |
52 | #define prepare_hugepage_range(addr, len) \ | 56 | /* |
53 | is_aligned_hugepage_range(addr, len) | 57 | * If the arch doesn't supply something else, assume that hugepage |
58 | * size aligned regions are ok without further preparation. | ||
59 | */ | ||
60 | static inline int prepare_hugepage_range(unsigned long addr, unsigned long len) | ||
61 | { | ||
62 | if (len & ~HPAGE_MASK) | ||
63 | return -EINVAL; | ||
64 | if (addr & ~HPAGE_MASK) | ||
65 | return -EINVAL; | ||
66 | return 0; | ||
67 | } | ||
54 | #else | 68 | #else |
55 | int prepare_hugepage_range(unsigned long addr, unsigned long len); | 69 | int prepare_hugepage_range(unsigned long addr, unsigned long len); |
56 | #endif | 70 | #endif |
@@ -87,20 +101,17 @@ static inline unsigned long hugetlb_total_pages(void) | |||
87 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) | 101 | #define copy_hugetlb_page_range(src, dst, vma) ({ BUG(); 0; }) |
88 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) | 102 | #define hugetlb_prefault(mapping, vma) ({ BUG(); 0; }) |
89 | #define unmap_hugepage_range(vma, start, end) BUG() | 103 | #define unmap_hugepage_range(vma, start, end) BUG() |
90 | #define is_hugepage_mem_enough(size) 0 | ||
91 | #define hugetlb_report_meminfo(buf) 0 | 104 | #define hugetlb_report_meminfo(buf) 0 |
92 | #define hugetlb_report_node_meminfo(n, buf) 0 | 105 | #define hugetlb_report_node_meminfo(n, buf) 0 |
93 | #define follow_huge_pmd(mm, addr, pmd, write) NULL | 106 | #define follow_huge_pmd(mm, addr, pmd, write) NULL |
94 | #define is_aligned_hugepage_range(addr, len) 0 | ||
95 | #define prepare_hugepage_range(addr, len) (-EINVAL) | 107 | #define prepare_hugepage_range(addr, len) (-EINVAL) |
96 | #define pmd_huge(x) 0 | 108 | #define pmd_huge(x) 0 |
97 | #define is_hugepage_only_range(mm, addr, len) 0 | 109 | #define is_hugepage_only_range(mm, addr, len) 0 |
98 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ | 110 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
99 | do { } while (0) | ||
100 | #define alloc_huge_page(vma, addr) ({ NULL; }) | ||
101 | #define free_huge_page(p) ({ (void)(p); BUG(); }) | ||
102 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 111 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) |
103 | 112 | ||
113 | #define hugetlb_change_protection(vma, address, end, newprot) | ||
114 | |||
104 | #ifndef HPAGE_MASK | 115 | #ifndef HPAGE_MASK |
105 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ | 116 | #define HPAGE_MASK PAGE_MASK /* Keep the compiler happy */ |
106 | #define HPAGE_SIZE PAGE_SIZE | 117 | #define HPAGE_SIZE PAGE_SIZE |
@@ -128,6 +139,8 @@ struct hugetlbfs_sb_info { | |||
128 | 139 | ||
129 | struct hugetlbfs_inode_info { | 140 | struct hugetlbfs_inode_info { |
130 | struct shared_policy policy; | 141 | struct shared_policy policy; |
142 | /* Protected by the (global) hugetlb_lock */ | ||
143 | unsigned long prereserved_hpages; | ||
131 | struct inode vfs_inode; | 144 | struct inode vfs_inode; |
132 | }; | 145 | }; |
133 | 146 | ||
@@ -144,6 +157,10 @@ static inline struct hugetlbfs_sb_info *HUGETLBFS_SB(struct super_block *sb) | |||
144 | extern struct file_operations hugetlbfs_file_operations; | 157 | extern struct file_operations hugetlbfs_file_operations; |
145 | extern struct vm_operations_struct hugetlb_vm_ops; | 158 | extern struct vm_operations_struct hugetlb_vm_ops; |
146 | struct file *hugetlb_zero_setup(size_t); | 159 | struct file *hugetlb_zero_setup(size_t); |
160 | int hugetlb_extend_reservation(struct hugetlbfs_inode_info *info, | ||
161 | unsigned long atleast_hpages); | ||
162 | void hugetlb_truncate_reservation(struct hugetlbfs_inode_info *info, | ||
163 | unsigned long atmost_hpages); | ||
147 | int hugetlb_get_quota(struct address_space *mapping); | 164 | int hugetlb_get_quota(struct address_space *mapping); |
148 | void hugetlb_put_quota(struct address_space *mapping); | 165 | void hugetlb_put_quota(struct address_space *mapping); |
149 | 166 | ||
diff --git a/include/linux/hwmon-sysfs.h b/include/linux/hwmon-sysfs.h index 7eb4004b3601..a90c09d331c1 100644 --- a/include/linux/hwmon-sysfs.h +++ b/include/linux/hwmon-sysfs.h | |||
@@ -27,11 +27,13 @@ struct sensor_device_attribute{ | |||
27 | #define to_sensor_dev_attr(_dev_attr) \ | 27 | #define to_sensor_dev_attr(_dev_attr) \ |
28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) | 28 | container_of(_dev_attr, struct sensor_device_attribute, dev_attr) |
29 | 29 | ||
30 | #define SENSOR_DEVICE_ATTR(_name,_mode,_show,_store,_index) \ | 30 | #define SENSOR_ATTR(_name, _mode, _show, _store, _index) \ |
31 | struct sensor_device_attribute sensor_dev_attr_##_name = { \ | 31 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ |
32 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 32 | .index = _index } |
33 | .index = _index, \ | 33 | |
34 | } | 34 | #define SENSOR_DEVICE_ATTR(_name, _mode, _show, _store, _index) \ |
35 | struct sensor_device_attribute sensor_dev_attr_##_name \ | ||
36 | = SENSOR_ATTR(_name, _mode, _show, _store, _index) | ||
35 | 37 | ||
36 | struct sensor_device_attribute_2 { | 38 | struct sensor_device_attribute_2 { |
37 | struct device_attribute dev_attr; | 39 | struct device_attribute dev_attr; |
@@ -41,11 +43,13 @@ struct sensor_device_attribute_2 { | |||
41 | #define to_sensor_dev_attr_2(_dev_attr) \ | 43 | #define to_sensor_dev_attr_2(_dev_attr) \ |
42 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) | 44 | container_of(_dev_attr, struct sensor_device_attribute_2, dev_attr) |
43 | 45 | ||
46 | #define SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) \ | ||
47 | { .dev_attr = __ATTR(_name, _mode, _show, _store), \ | ||
48 | .index = _index, \ | ||
49 | .nr = _nr } | ||
50 | |||
44 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ | 51 | #define SENSOR_DEVICE_ATTR_2(_name,_mode,_show,_store,_nr,_index) \ |
45 | struct sensor_device_attribute_2 sensor_dev_attr_##_name = { \ | 52 | struct sensor_device_attribute_2 sensor_dev_attr_##_name \ |
46 | .dev_attr = __ATTR(_name,_mode,_show,_store), \ | 53 | = SENSOR_ATTR_2(_name, _mode, _show, _store, _nr, _index) |
47 | .index = _index, \ | ||
48 | .nr = _nr, \ | ||
49 | } | ||
50 | 54 | ||
51 | #endif /* _LINUX_HWMON_SYSFS_H */ | 55 | #endif /* _LINUX_HWMON_SYSFS_H */ |
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 474c8f4f5d4f..ec311bc89439 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -172,7 +172,6 @@ | |||
172 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ | 172 | #define I2C_HW_B_RIVA 0x010010 /* Riva based graphics cards */ |
173 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ | 173 | #define I2C_HW_B_IOC 0x010011 /* IOC bit-wiggling */ |
174 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ | 174 | #define I2C_HW_B_TSUNA 0x010012 /* DEC Tsunami chipset */ |
175 | #define I2C_HW_B_FRODO 0x010013 /* 2d3D SA-1110 Development Board */ | ||
176 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ | 175 | #define I2C_HW_B_OMAHA 0x010014 /* Omaha I2C interface (ARM) */ |
177 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ | 176 | #define I2C_HW_B_GUIDE 0x010015 /* Guide bit-basher */ |
178 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ | 177 | #define I2C_HW_B_IXP2000 0x010016 /* GPIO on IXP2000 systems */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 63f1d63cc1d8..1635ee25918f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -32,7 +32,7 @@ | |||
32 | #include <linux/mod_devicetable.h> | 32 | #include <linux/mod_devicetable.h> |
33 | #include <linux/device.h> /* for struct device */ | 33 | #include <linux/device.h> /* for struct device */ |
34 | #include <linux/sched.h> /* for completion */ | 34 | #include <linux/sched.h> /* for completion */ |
35 | #include <asm/semaphore.h> | 35 | #include <linux/mutex.h> |
36 | 36 | ||
37 | /* --- For i2c-isa ---------------------------------------------------- */ | 37 | /* --- For i2c-isa ---------------------------------------------------- */ |
38 | 38 | ||
@@ -225,8 +225,8 @@ struct i2c_adapter { | |||
225 | int (*client_unregister)(struct i2c_client *); | 225 | int (*client_unregister)(struct i2c_client *); |
226 | 226 | ||
227 | /* data fields that are valid for all devices */ | 227 | /* data fields that are valid for all devices */ |
228 | struct semaphore bus_lock; | 228 | struct mutex bus_lock; |
229 | struct semaphore clist_lock; | 229 | struct mutex clist_lock; |
230 | 230 | ||
231 | int timeout; | 231 | int timeout; |
232 | int retries; | 232 | int retries; |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 0cf6c8b12caf..c771a7db9871 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -40,14 +40,16 @@ struct icmp6hdr { | |||
40 | struct icmpv6_nd_ra { | 40 | struct icmpv6_nd_ra { |
41 | __u8 hop_limit; | 41 | __u8 hop_limit; |
42 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 42 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
43 | __u8 reserved:6, | 43 | __u8 reserved:4, |
44 | router_pref:2, | ||
44 | other:1, | 45 | other:1, |
45 | managed:1; | 46 | managed:1; |
46 | 47 | ||
47 | #elif defined(__BIG_ENDIAN_BITFIELD) | 48 | #elif defined(__BIG_ENDIAN_BITFIELD) |
48 | __u8 managed:1, | 49 | __u8 managed:1, |
49 | other:1, | 50 | other:1, |
50 | reserved:6; | 51 | router_pref:2, |
52 | reserved:4; | ||
51 | #else | 53 | #else |
52 | #error "Please fix <asm/byteorder.h>" | 54 | #error "Please fix <asm/byteorder.h>" |
53 | #endif | 55 | #endif |
@@ -70,8 +72,13 @@ struct icmp6hdr { | |||
70 | #define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed | 72 | #define icmp6_addrconf_managed icmp6_dataun.u_nd_ra.managed |
71 | #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other | 73 | #define icmp6_addrconf_other icmp6_dataun.u_nd_ra.other |
72 | #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime | 74 | #define icmp6_rt_lifetime icmp6_dataun.u_nd_ra.rt_lifetime |
75 | #define icmp6_router_pref icmp6_dataun.u_nd_ra.router_pref | ||
73 | }; | 76 | }; |
74 | 77 | ||
78 | #define ICMPV6_ROUTER_PREF_LOW 0x3 | ||
79 | #define ICMPV6_ROUTER_PREF_MEDIUM 0x0 | ||
80 | #define ICMPV6_ROUTER_PREF_HIGH 0x1 | ||
81 | #define ICMPV6_ROUTER_PREF_INVALID 0x2 | ||
75 | 82 | ||
76 | #define ICMPV6_DEST_UNREACH 1 | 83 | #define ICMPV6_DEST_UNREACH 1 |
77 | #define ICMPV6_PKT_TOOBIG 2 | 84 | #define ICMPV6_PKT_TOOBIG 2 |
diff --git a/include/linux/if.h b/include/linux/if.h index 12c6f6d157c3..374e20ad8b0d 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ | 33 | #define IFF_LOOPBACK 0x8 /* is a loopback net */ |
34 | #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ | 34 | #define IFF_POINTOPOINT 0x10 /* interface is has p-p link */ |
35 | #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ | 35 | #define IFF_NOTRAILERS 0x20 /* avoid use of trailers */ |
36 | #define IFF_RUNNING 0x40 /* interface running and carrier ok */ | 36 | #define IFF_RUNNING 0x40 /* interface RFC2863 OPER_UP */ |
37 | #define IFF_NOARP 0x80 /* no ARP protocol */ | 37 | #define IFF_NOARP 0x80 /* no ARP protocol */ |
38 | #define IFF_PROMISC 0x100 /* receive all packets */ | 38 | #define IFF_PROMISC 0x100 /* receive all packets */ |
39 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ | 39 | #define IFF_ALLMULTI 0x200 /* receive all multicast packets*/ |
@@ -43,12 +43,16 @@ | |||
43 | 43 | ||
44 | #define IFF_MULTICAST 0x1000 /* Supports multicast */ | 44 | #define IFF_MULTICAST 0x1000 /* Supports multicast */ |
45 | 45 | ||
46 | #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_RUNNING) | ||
47 | |||
48 | #define IFF_PORTSEL 0x2000 /* can set media type */ | 46 | #define IFF_PORTSEL 0x2000 /* can set media type */ |
49 | #define IFF_AUTOMEDIA 0x4000 /* auto media select active */ | 47 | #define IFF_AUTOMEDIA 0x4000 /* auto media select active */ |
50 | #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/ | 48 | #define IFF_DYNAMIC 0x8000 /* dialup device with changing addresses*/ |
51 | 49 | ||
50 | #define IFF_LOWER_UP 0x10000 /* driver signals L1 up */ | ||
51 | #define IFF_DORMANT 0x20000 /* driver signals dormant */ | ||
52 | |||
53 | #define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\ | ||
54 | IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT) | ||
55 | |||
52 | /* Private (from user) interface flags (netdevice->priv_flags). */ | 56 | /* Private (from user) interface flags (netdevice->priv_flags). */ |
53 | #define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */ | 57 | #define IFF_802_1Q_VLAN 0x1 /* 802.1Q VLAN device. */ |
54 | #define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */ | 58 | #define IFF_EBRIDGE 0x2 /* Ethernet bridging device. */ |
@@ -83,6 +87,22 @@ | |||
83 | #define IF_PROTO_FR_ETH_PVC 0x200B | 87 | #define IF_PROTO_FR_ETH_PVC 0x200B |
84 | #define IF_PROTO_RAW 0x200C /* RAW Socket */ | 88 | #define IF_PROTO_RAW 0x200C /* RAW Socket */ |
85 | 89 | ||
90 | /* RFC 2863 operational status */ | ||
91 | enum { | ||
92 | IF_OPER_UNKNOWN, | ||
93 | IF_OPER_NOTPRESENT, | ||
94 | IF_OPER_DOWN, | ||
95 | IF_OPER_LOWERLAYERDOWN, | ||
96 | IF_OPER_TESTING, | ||
97 | IF_OPER_DORMANT, | ||
98 | IF_OPER_UP, | ||
99 | }; | ||
100 | |||
101 | /* link modes */ | ||
102 | enum { | ||
103 | IF_LINK_MODE_DEFAULT, | ||
104 | IF_LINK_MODE_DORMANT, /* limit upward transition to dormant */ | ||
105 | }; | ||
86 | 106 | ||
87 | /* | 107 | /* |
88 | * Device mapping structure. I'd just gone off and designed a | 108 | * Device mapping structure. I'd just gone off and designed a |
diff --git a/include/linux/in.h b/include/linux/in.h index ba355384016a..94f557fa4636 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -72,6 +72,7 @@ struct in_addr { | |||
72 | #define IP_FREEBIND 15 | 72 | #define IP_FREEBIND 15 |
73 | #define IP_IPSEC_POLICY 16 | 73 | #define IP_IPSEC_POLICY 16 |
74 | #define IP_XFRM_POLICY 17 | 74 | #define IP_XFRM_POLICY 17 |
75 | #define IP_PASSSEC 18 | ||
75 | 76 | ||
76 | /* BSD compatibility */ | 77 | /* BSD compatibility */ |
77 | #define IP_RECVRETOPTS IP_RETOPTS | 78 | #define IP_RECVRETOPTS IP_RETOPTS |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index fd7af86151b1..92297ff24e85 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -25,6 +25,7 @@ struct ipv4_devconf | |||
25 | int arp_filter; | 25 | int arp_filter; |
26 | int arp_announce; | 26 | int arp_announce; |
27 | int arp_ignore; | 27 | int arp_ignore; |
28 | int arp_accept; | ||
28 | int medium_id; | 29 | int medium_id; |
29 | int no_xfrm; | 30 | int no_xfrm; |
30 | int no_policy; | 31 | int no_policy; |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index dcfd2ecccb5d..92146f3b7423 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -7,11 +7,10 @@ | |||
7 | #define INIT_FDTABLE \ | 7 | #define INIT_FDTABLE \ |
8 | { \ | 8 | { \ |
9 | .max_fds = NR_OPEN_DEFAULT, \ | 9 | .max_fds = NR_OPEN_DEFAULT, \ |
10 | .max_fdset = __FD_SETSIZE, \ | 10 | .max_fdset = EMBEDDED_FD_SET_SIZE, \ |
11 | .next_fd = 0, \ | ||
12 | .fd = &init_files.fd_array[0], \ | 11 | .fd = &init_files.fd_array[0], \ |
13 | .close_on_exec = &init_files.close_on_exec_init, \ | 12 | .close_on_exec = (fd_set *)&init_files.close_on_exec_init, \ |
14 | .open_fds = &init_files.open_fds_init, \ | 13 | .open_fds = (fd_set *)&init_files.open_fds_init, \ |
15 | .rcu = RCU_HEAD_INIT, \ | 14 | .rcu = RCU_HEAD_INIT, \ |
16 | .free_files = NULL, \ | 15 | .free_files = NULL, \ |
17 | .next = NULL, \ | 16 | .next = NULL, \ |
@@ -20,9 +19,10 @@ | |||
20 | #define INIT_FILES \ | 19 | #define INIT_FILES \ |
21 | { \ | 20 | { \ |
22 | .count = ATOMIC_INIT(1), \ | 21 | .count = ATOMIC_INIT(1), \ |
23 | .file_lock = SPIN_LOCK_UNLOCKED, \ | ||
24 | .fdt = &init_files.fdtab, \ | 22 | .fdt = &init_files.fdtab, \ |
25 | .fdtab = INIT_FDTABLE, \ | 23 | .fdtab = INIT_FDTABLE, \ |
24 | .file_lock = SPIN_LOCK_UNLOCKED, \ | ||
25 | .next_fd = 0, \ | ||
26 | .close_on_exec_init = { { 0, } }, \ | 26 | .close_on_exec_init = { { 0, } }, \ |
27 | .open_fds_init = { { 0, } }, \ | 27 | .open_fds_init = { { 0, } }, \ |
28 | .fd_array = { NULL, } \ | 28 | .fd_array = { NULL, } \ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 9c8f4c9ed429..1263d8cb3c18 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -145,6 +145,15 @@ struct ipv6_devconf { | |||
145 | __s32 max_desync_factor; | 145 | __s32 max_desync_factor; |
146 | #endif | 146 | #endif |
147 | __s32 max_addresses; | 147 | __s32 max_addresses; |
148 | __s32 accept_ra_defrtr; | ||
149 | __s32 accept_ra_pinfo; | ||
150 | #ifdef CONFIG_IPV6_ROUTER_PREF | ||
151 | __s32 accept_ra_rtr_pref; | ||
152 | __s32 rtr_probe_interval; | ||
153 | #ifdef CONFIG_IPV6_ROUTE_INFO | ||
154 | __s32 accept_ra_rt_info_max_plen; | ||
155 | #endif | ||
156 | #endif | ||
148 | void *sysctl; | 157 | void *sysctl; |
149 | }; | 158 | }; |
150 | 159 | ||
@@ -167,6 +176,11 @@ enum { | |||
167 | DEVCONF_MAX_DESYNC_FACTOR, | 176 | DEVCONF_MAX_DESYNC_FACTOR, |
168 | DEVCONF_MAX_ADDRESSES, | 177 | DEVCONF_MAX_ADDRESSES, |
169 | DEVCONF_FORCE_MLD_VERSION, | 178 | DEVCONF_FORCE_MLD_VERSION, |
179 | DEVCONF_ACCEPT_RA_DEFRTR, | ||
180 | DEVCONF_ACCEPT_RA_PINFO, | ||
181 | DEVCONF_ACCEPT_RA_RTR_PREF, | ||
182 | DEVCONF_RTR_PROBE_INTERVAL, | ||
183 | DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN, | ||
170 | DEVCONF_MAX | 184 | DEVCONF_MAX |
171 | }; | 185 | }; |
172 | 186 | ||
diff --git a/include/linux/ipv6_route.h b/include/linux/ipv6_route.h index d7c41d1d706a..b323ff577967 100644 --- a/include/linux/ipv6_route.h +++ b/include/linux/ipv6_route.h | |||
@@ -23,12 +23,22 @@ | |||
23 | #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ | 23 | #define RTF_NONEXTHOP 0x00200000 /* route with no nexthop */ |
24 | #define RTF_EXPIRES 0x00400000 | 24 | #define RTF_EXPIRES 0x00400000 |
25 | 25 | ||
26 | #define RTF_ROUTEINFO 0x00800000 /* route information - RA */ | ||
27 | |||
26 | #define RTF_CACHE 0x01000000 /* cache entry */ | 28 | #define RTF_CACHE 0x01000000 /* cache entry */ |
27 | #define RTF_FLOW 0x02000000 /* flow significant route */ | 29 | #define RTF_FLOW 0x02000000 /* flow significant route */ |
28 | #define RTF_POLICY 0x04000000 /* policy route */ | 30 | #define RTF_POLICY 0x04000000 /* policy route */ |
29 | 31 | ||
32 | #define RTF_PREF(pref) ((pref) << 27) | ||
33 | #define RTF_PREF_MASK 0x18000000 | ||
34 | |||
30 | #define RTF_LOCAL 0x80000000 | 35 | #define RTF_LOCAL 0x80000000 |
31 | 36 | ||
37 | #ifdef __KERNEL__ | ||
38 | #define IPV6_EXTRACT_PREF(flag) (((flag) & RTF_PREF_MASK) >> 27) | ||
39 | #define IPV6_DECODE_PREF(pref) ((pref) ^ 2) /* 1:low,2:med,3:high */ | ||
40 | #endif | ||
41 | |||
32 | struct in6_rtmsg { | 42 | struct in6_rtmsg { |
33 | struct in6_addr rtmsg_dst; | 43 | struct in6_addr rtmsg_dst; |
34 | struct in6_addr rtmsg_src; | 44 | struct in6_addr rtmsg_src; |
diff --git a/include/linux/irda.h b/include/linux/irda.h index 95dee174cdc5..09d8f105a5a8 100644 --- a/include/linux/irda.h +++ b/include/linux/irda.h | |||
@@ -76,6 +76,7 @@ typedef enum { | |||
76 | IRDA_MCP2120_DONGLE = 9, | 76 | IRDA_MCP2120_DONGLE = 9, |
77 | IRDA_ACT200L_DONGLE = 10, | 77 | IRDA_ACT200L_DONGLE = 10, |
78 | IRDA_MA600_DONGLE = 11, | 78 | IRDA_MA600_DONGLE = 11, |
79 | IRDA_TOIM3232_DONGLE = 12, | ||
79 | } IRDA_DONGLE; | 80 | } IRDA_DONGLE; |
80 | 81 | ||
81 | /* Protocol types to be used for SOCK_DGRAM */ | 82 | /* Protocol types to be used for SOCK_DGRAM */ |
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index 41ee79962bb2..2ccbfb6340ba 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/journal-head.h> | 28 | #include <linux/journal-head.h> |
29 | #include <linux/stddef.h> | 29 | #include <linux/stddef.h> |
30 | #include <linux/bit_spinlock.h> | 30 | #include <linux/bit_spinlock.h> |
31 | #include <linux/mutex.h> | ||
31 | #include <asm/semaphore.h> | 32 | #include <asm/semaphore.h> |
32 | #endif | 33 | #endif |
33 | 34 | ||
@@ -575,7 +576,7 @@ struct transaction_s | |||
575 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | 576 | * @j_wait_checkpoint: Wait queue to trigger checkpointing |
576 | * @j_wait_commit: Wait queue to trigger commit | 577 | * @j_wait_commit: Wait queue to trigger commit |
577 | * @j_wait_updates: Wait queue to wait for updates to complete | 578 | * @j_wait_updates: Wait queue to wait for updates to complete |
578 | * @j_checkpoint_sem: Semaphore for locking against concurrent checkpoints | 579 | * @j_checkpoint_mutex: Mutex for locking against concurrent checkpoints |
579 | * @j_head: Journal head - identifies the first unused block in the journal | 580 | * @j_head: Journal head - identifies the first unused block in the journal |
580 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 581 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
581 | * journal. | 582 | * journal. |
@@ -645,7 +646,7 @@ struct journal_s | |||
645 | int j_barrier_count; | 646 | int j_barrier_count; |
646 | 647 | ||
647 | /* The barrier lock itself */ | 648 | /* The barrier lock itself */ |
648 | struct semaphore j_barrier; | 649 | struct mutex j_barrier; |
649 | 650 | ||
650 | /* | 651 | /* |
651 | * Transactions: The current running transaction... | 652 | * Transactions: The current running transaction... |
@@ -687,7 +688,7 @@ struct journal_s | |||
687 | wait_queue_head_t j_wait_updates; | 688 | wait_queue_head_t j_wait_updates; |
688 | 689 | ||
689 | /* Semaphore for locking against concurrent checkpoints */ | 690 | /* Semaphore for locking against concurrent checkpoints */ |
690 | struct semaphore j_checkpoint_sem; | 691 | struct mutex j_checkpoint_mutex; |
691 | 692 | ||
692 | /* | 693 | /* |
693 | * Journal head: identifies the first unused block in the journal. | 694 | * Journal head: identifies the first unused block in the journal. |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3b507bf05d09..bb6e7ddee2fd 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -91,6 +91,9 @@ extern struct notifier_block *panic_notifier_list; | |||
91 | extern long (*panic_blink)(long time); | 91 | extern long (*panic_blink)(long time); |
92 | NORET_TYPE void panic(const char * fmt, ...) | 92 | NORET_TYPE void panic(const char * fmt, ...) |
93 | __attribute__ ((NORET_AND format (printf, 1, 2))); | 93 | __attribute__ ((NORET_AND format (printf, 1, 2))); |
94 | extern void oops_enter(void); | ||
95 | extern void oops_exit(void); | ||
96 | extern int oops_may_print(void); | ||
94 | fastcall NORET_TYPE void do_exit(long error_code) | 97 | fastcall NORET_TYPE void do_exit(long error_code) |
95 | ATTRIB_NORET; | 98 | ATTRIB_NORET; |
96 | NORET_TYPE void complete_and_exit(struct completion *, long) | 99 | NORET_TYPE void complete_and_exit(struct completion *, long) |
diff --git a/include/linux/kobj_map.h b/include/linux/kobj_map.h index cbe7d8008042..bafe178a381f 100644 --- a/include/linux/kobj_map.h +++ b/include/linux/kobj_map.h | |||
@@ -1,6 +1,6 @@ | |||
1 | #ifdef __KERNEL__ | 1 | #ifdef __KERNEL__ |
2 | 2 | ||
3 | #include <asm/semaphore.h> | 3 | #include <linux/mutex.h> |
4 | 4 | ||
5 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); | 5 | typedef struct kobject *kobj_probe_t(dev_t, int *, void *); |
6 | struct kobj_map; | 6 | struct kobj_map; |
@@ -9,6 +9,6 @@ int kobj_map(struct kobj_map *, dev_t, unsigned long, struct module *, | |||
9 | kobj_probe_t *, int (*)(dev_t, void *), void *); | 9 | kobj_probe_t *, int (*)(dev_t, void *), void *); |
10 | void kobj_unmap(struct kobj_map *, dev_t, unsigned long); | 10 | void kobj_unmap(struct kobj_map *, dev_t, unsigned long); |
11 | struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); | 11 | struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); |
12 | struct kobj_map *kobj_map_init(kobj_probe_t *, struct semaphore *); | 12 | struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); |
13 | 13 | ||
14 | #endif | 14 | #endif |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index c374b5fa8d3b..4cb1214ec290 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -80,6 +80,8 @@ extern void kobject_unregister(struct kobject *); | |||
80 | extern struct kobject * kobject_get(struct kobject *); | 80 | extern struct kobject * kobject_get(struct kobject *); |
81 | extern void kobject_put(struct kobject *); | 81 | extern void kobject_put(struct kobject *); |
82 | 82 | ||
83 | extern struct kobject *kobject_add_dir(struct kobject *, const char *); | ||
84 | |||
83 | extern char * kobject_get_path(struct kobject *, gfp_t); | 85 | extern char * kobject_get_path(struct kobject *, gfp_t); |
84 | 86 | ||
85 | struct kobj_type { | 87 | struct kobj_type { |
@@ -255,7 +257,7 @@ struct subsys_attribute { | |||
255 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); | 257 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); |
256 | extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); | 258 | extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); |
257 | 259 | ||
258 | #if defined(CONFIG_HOTPLUG) & defined(CONFIG_NET) | 260 | #if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) |
259 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 261 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
260 | 262 | ||
261 | int add_uevent_var(char **envp, int num_envp, int *cur_index, | 263 | int add_uevent_var(char **envp, int num_envp, int *cur_index, |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 669756bc20a2..778adc0fa640 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <linux/percpu.h> | 36 | #include <linux/percpu.h> |
37 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
38 | #include <linux/rcupdate.h> | 38 | #include <linux/rcupdate.h> |
39 | #include <linux/mutex.h> | ||
39 | 40 | ||
40 | #ifdef CONFIG_KPROBES | 41 | #ifdef CONFIG_KPROBES |
41 | #include <asm/kprobes.h> | 42 | #include <asm/kprobes.h> |
@@ -152,7 +153,7 @@ struct kretprobe_instance { | |||
152 | }; | 153 | }; |
153 | 154 | ||
154 | extern spinlock_t kretprobe_lock; | 155 | extern spinlock_t kretprobe_lock; |
155 | extern struct semaphore kprobe_mutex; | 156 | extern struct mutex kprobe_mutex; |
156 | extern int arch_prepare_kprobe(struct kprobe *p); | 157 | extern int arch_prepare_kprobe(struct kprobe *p); |
157 | extern void arch_arm_kprobe(struct kprobe *p); | 158 | extern void arch_arm_kprobe(struct kprobe *p); |
158 | extern void arch_disarm_kprobe(struct kprobe *p); | 159 | extern void arch_disarm_kprobe(struct kprobe *p); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index c91be5e64ede..7a54244d30aa 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -35,7 +35,8 @@ | |||
35 | #include <linux/workqueue.h> | 35 | #include <linux/workqueue.h> |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * compile-time options | 38 | * compile-time options: to be removed as soon as all the drivers are |
39 | * converted to the new debugging mechanism | ||
39 | */ | 40 | */ |
40 | #undef ATA_DEBUG /* debugging output */ | 41 | #undef ATA_DEBUG /* debugging output */ |
41 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ | 42 | #undef ATA_VERBOSE_DEBUG /* yet more debugging output */ |
@@ -61,15 +62,37 @@ | |||
61 | 62 | ||
62 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) | 63 | #define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __FUNCTION__, ## args) |
63 | 64 | ||
64 | #ifdef ATA_NDEBUG | 65 | /* NEW: debug levels */ |
65 | #define assert(expr) | 66 | #define HAVE_LIBATA_MSG 1 |
66 | #else | 67 | |
67 | #define assert(expr) \ | 68 | enum { |
68 | if(unlikely(!(expr))) { \ | 69 | ATA_MSG_DRV = 0x0001, |
69 | printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n", \ | 70 | ATA_MSG_INFO = 0x0002, |
70 | #expr,__FILE__,__FUNCTION__,__LINE__); \ | 71 | ATA_MSG_PROBE = 0x0004, |
71 | } | 72 | ATA_MSG_WARN = 0x0008, |
72 | #endif | 73 | ATA_MSG_MALLOC = 0x0010, |
74 | ATA_MSG_CTL = 0x0020, | ||
75 | ATA_MSG_INTR = 0x0040, | ||
76 | ATA_MSG_ERR = 0x0080, | ||
77 | }; | ||
78 | |||
79 | #define ata_msg_drv(p) ((p)->msg_enable & ATA_MSG_DRV) | ||
80 | #define ata_msg_info(p) ((p)->msg_enable & ATA_MSG_INFO) | ||
81 | #define ata_msg_probe(p) ((p)->msg_enable & ATA_MSG_PROBE) | ||
82 | #define ata_msg_warn(p) ((p)->msg_enable & ATA_MSG_WARN) | ||
83 | #define ata_msg_malloc(p) ((p)->msg_enable & ATA_MSG_MALLOC) | ||
84 | #define ata_msg_ctl(p) ((p)->msg_enable & ATA_MSG_CTL) | ||
85 | #define ata_msg_intr(p) ((p)->msg_enable & ATA_MSG_INTR) | ||
86 | #define ata_msg_err(p) ((p)->msg_enable & ATA_MSG_ERR) | ||
87 | |||
88 | static inline u32 ata_msg_init(int dval, int default_msg_enable_bits) | ||
89 | { | ||
90 | if (dval < 0 || dval >= (sizeof(u32) * 8)) | ||
91 | return default_msg_enable_bits; /* should be 0x1 - only driver info msgs */ | ||
92 | if (!dval) | ||
93 | return 0; | ||
94 | return (1 << dval) - 1; | ||
95 | } | ||
73 | 96 | ||
74 | /* defines only for the constants which don't work well as enums */ | 97 | /* defines only for the constants which don't work well as enums */ |
75 | #define ATA_TAG_POISON 0xfafbfcfdU | 98 | #define ATA_TAG_POISON 0xfafbfcfdU |
@@ -99,8 +122,7 @@ enum { | |||
99 | /* struct ata_device stuff */ | 122 | /* struct ata_device stuff */ |
100 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ | 123 | ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ |
101 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ | 124 | ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ |
102 | ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ | 125 | ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ |
103 | ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */ | ||
104 | 126 | ||
105 | ATA_DEV_UNKNOWN = 0, /* unknown device */ | 127 | ATA_DEV_UNKNOWN = 0, /* unknown device */ |
106 | ATA_DEV_ATA = 1, /* ATA device */ | 128 | ATA_DEV_ATA = 1, /* ATA device */ |
@@ -115,9 +137,9 @@ enum { | |||
115 | ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ | 137 | ATA_FLAG_PORT_DISABLED = (1 << 2), /* port is disabled, ignore it */ |
116 | ATA_FLAG_SATA = (1 << 3), | 138 | ATA_FLAG_SATA = (1 << 3), |
117 | ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ | 139 | ATA_FLAG_NO_LEGACY = (1 << 4), /* no legacy mode check */ |
118 | ATA_FLAG_SRST = (1 << 5), /* use ATA SRST, not E.D.D. */ | 140 | ATA_FLAG_SRST = (1 << 5), /* (obsolete) use ATA SRST, not E.D.D. */ |
119 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ | 141 | ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ |
120 | ATA_FLAG_SATA_RESET = (1 << 7), /* use COMRESET */ | 142 | ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ |
121 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ | 143 | ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ |
122 | ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once | 144 | ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once |
123 | * proper HSM is in place. */ | 145 | * proper HSM is in place. */ |
@@ -129,10 +151,14 @@ enum { | |||
129 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ | 151 | ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ |
130 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ | 152 | ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ |
131 | 153 | ||
154 | ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* Flush port task */ | ||
155 | ATA_FLAG_IN_EH = (1 << 16), /* EH in progress */ | ||
156 | |||
132 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ | 157 | ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ |
133 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ | 158 | ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ |
134 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ | 159 | ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ |
135 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, | 160 | ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, |
161 | ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ | ||
136 | 162 | ||
137 | /* various lengths of time */ | 163 | /* various lengths of time */ |
138 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ | 164 | ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ |
@@ -162,11 +188,19 @@ enum { | |||
162 | PORT_DISABLED = 2, | 188 | PORT_DISABLED = 2, |
163 | 189 | ||
164 | /* encoding various smaller bitmaps into a single | 190 | /* encoding various smaller bitmaps into a single |
165 | * unsigned long bitmap | 191 | * unsigned int bitmap |
166 | */ | 192 | */ |
167 | ATA_SHIFT_UDMA = 0, | 193 | ATA_BITS_PIO = 5, |
168 | ATA_SHIFT_MWDMA = 8, | 194 | ATA_BITS_MWDMA = 3, |
169 | ATA_SHIFT_PIO = 11, | 195 | ATA_BITS_UDMA = 8, |
196 | |||
197 | ATA_SHIFT_PIO = 0, | ||
198 | ATA_SHIFT_MWDMA = ATA_SHIFT_PIO + ATA_BITS_PIO, | ||
199 | ATA_SHIFT_UDMA = ATA_SHIFT_MWDMA + ATA_BITS_MWDMA, | ||
200 | |||
201 | ATA_MASK_PIO = ((1 << ATA_BITS_PIO) - 1) << ATA_SHIFT_PIO, | ||
202 | ATA_MASK_MWDMA = ((1 << ATA_BITS_MWDMA) - 1) << ATA_SHIFT_MWDMA, | ||
203 | ATA_MASK_UDMA = ((1 << ATA_BITS_UDMA) - 1) << ATA_SHIFT_UDMA, | ||
170 | 204 | ||
171 | /* size of buffer to pad xfers ending on unaligned boundaries */ | 205 | /* size of buffer to pad xfers ending on unaligned boundaries */ |
172 | ATA_DMA_PAD_SZ = 4, | 206 | ATA_DMA_PAD_SZ = 4, |
@@ -189,10 +223,15 @@ enum hsm_task_states { | |||
189 | }; | 223 | }; |
190 | 224 | ||
191 | enum ata_completion_errors { | 225 | enum ata_completion_errors { |
192 | AC_ERR_OTHER = (1 << 0), | 226 | AC_ERR_DEV = (1 << 0), /* device reported error */ |
193 | AC_ERR_DEV = (1 << 1), | 227 | AC_ERR_HSM = (1 << 1), /* host state machine violation */ |
194 | AC_ERR_ATA_BUS = (1 << 2), | 228 | AC_ERR_TIMEOUT = (1 << 2), /* timeout */ |
195 | AC_ERR_HOST_BUS = (1 << 3), | 229 | AC_ERR_MEDIA = (1 << 3), /* media error */ |
230 | AC_ERR_ATA_BUS = (1 << 4), /* ATA bus error */ | ||
231 | AC_ERR_HOST_BUS = (1 << 5), /* host bus error */ | ||
232 | AC_ERR_SYSTEM = (1 << 6), /* system error */ | ||
233 | AC_ERR_INVALID = (1 << 7), /* invalid argument */ | ||
234 | AC_ERR_OTHER = (1 << 8), /* unknown */ | ||
196 | }; | 235 | }; |
197 | 236 | ||
198 | /* forward declarations */ | 237 | /* forward declarations */ |
@@ -202,7 +241,10 @@ struct ata_port; | |||
202 | struct ata_queued_cmd; | 241 | struct ata_queued_cmd; |
203 | 242 | ||
204 | /* typedefs */ | 243 | /* typedefs */ |
205 | typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc); | 244 | typedef void (*ata_qc_cb_t) (struct ata_queued_cmd *qc); |
245 | typedef void (*ata_probeinit_fn_t)(struct ata_port *); | ||
246 | typedef int (*ata_reset_fn_t)(struct ata_port *, int, unsigned int *); | ||
247 | typedef void (*ata_postreset_fn_t)(struct ata_port *ap, unsigned int *); | ||
206 | 248 | ||
207 | struct ata_ioports { | 249 | struct ata_ioports { |
208 | unsigned long cmd_addr; | 250 | unsigned long cmd_addr; |
@@ -305,7 +347,7 @@ struct ata_device { | |||
305 | unsigned long flags; /* ATA_DFLAG_xxx */ | 347 | unsigned long flags; /* ATA_DFLAG_xxx */ |
306 | unsigned int class; /* ATA_DEV_xxx */ | 348 | unsigned int class; /* ATA_DEV_xxx */ |
307 | unsigned int devno; /* 0 or 1 */ | 349 | unsigned int devno; /* 0 or 1 */ |
308 | u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */ | 350 | u16 *id; /* IDENTIFY xxx DEVICE data */ |
309 | u8 pio_mode; | 351 | u8 pio_mode; |
310 | u8 dma_mode; | 352 | u8 dma_mode; |
311 | u8 xfer_mode; | 353 | u8 xfer_mode; |
@@ -313,6 +355,8 @@ struct ata_device { | |||
313 | 355 | ||
314 | unsigned int multi_count; /* sectors count for | 356 | unsigned int multi_count; /* sectors count for |
315 | READ/WRITE MULTIPLE */ | 357 | READ/WRITE MULTIPLE */ |
358 | unsigned int max_sectors; /* per-device max sectors */ | ||
359 | unsigned int cdb_len; | ||
316 | 360 | ||
317 | /* for CHS addressing */ | 361 | /* for CHS addressing */ |
318 | u16 cylinders; /* Number of cylinders */ | 362 | u16 cylinders; /* Number of cylinders */ |
@@ -342,7 +386,6 @@ struct ata_port { | |||
342 | unsigned int mwdma_mask; | 386 | unsigned int mwdma_mask; |
343 | unsigned int udma_mask; | 387 | unsigned int udma_mask; |
344 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ | 388 | unsigned int cbl; /* cable type; ATA_CBL_xxx */ |
345 | unsigned int cdb_len; | ||
346 | 389 | ||
347 | struct ata_device device[ATA_MAX_DEVICES]; | 390 | struct ata_device device[ATA_MAX_DEVICES]; |
348 | 391 | ||
@@ -353,12 +396,14 @@ struct ata_port { | |||
353 | struct ata_host_stats stats; | 396 | struct ata_host_stats stats; |
354 | struct ata_host_set *host_set; | 397 | struct ata_host_set *host_set; |
355 | 398 | ||
356 | struct work_struct packet_task; | 399 | struct work_struct port_task; |
357 | 400 | ||
358 | struct work_struct pio_task; | ||
359 | unsigned int hsm_task_state; | 401 | unsigned int hsm_task_state; |
360 | unsigned long pio_task_timeout; | 402 | unsigned long pio_task_timeout; |
361 | 403 | ||
404 | u32 msg_enable; | ||
405 | struct list_head eh_done_q; | ||
406 | |||
362 | void *private_data; | 407 | void *private_data; |
363 | }; | 408 | }; |
364 | 409 | ||
@@ -378,7 +423,9 @@ struct ata_port_operations { | |||
378 | u8 (*check_altstatus)(struct ata_port *ap); | 423 | u8 (*check_altstatus)(struct ata_port *ap); |
379 | void (*dev_select)(struct ata_port *ap, unsigned int device); | 424 | void (*dev_select)(struct ata_port *ap, unsigned int device); |
380 | 425 | ||
381 | void (*phy_reset) (struct ata_port *ap); | 426 | void (*phy_reset) (struct ata_port *ap); /* obsolete */ |
427 | int (*probe_reset) (struct ata_port *ap, unsigned int *classes); | ||
428 | |||
382 | void (*post_set_mode) (struct ata_port *ap); | 429 | void (*post_set_mode) (struct ata_port *ap); |
383 | 430 | ||
384 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); | 431 | int (*check_atapi_dma) (struct ata_queued_cmd *qc); |
@@ -387,7 +434,7 @@ struct ata_port_operations { | |||
387 | void (*bmdma_start) (struct ata_queued_cmd *qc); | 434 | void (*bmdma_start) (struct ata_queued_cmd *qc); |
388 | 435 | ||
389 | void (*qc_prep) (struct ata_queued_cmd *qc); | 436 | void (*qc_prep) (struct ata_queued_cmd *qc); |
390 | int (*qc_issue) (struct ata_queued_cmd *qc); | 437 | unsigned int (*qc_issue) (struct ata_queued_cmd *qc); |
391 | 438 | ||
392 | void (*eng_timeout) (struct ata_port *ap); | 439 | void (*eng_timeout) (struct ata_port *ap); |
393 | 440 | ||
@@ -435,6 +482,18 @@ extern void ata_port_probe(struct ata_port *); | |||
435 | extern void __sata_phy_reset(struct ata_port *ap); | 482 | extern void __sata_phy_reset(struct ata_port *ap); |
436 | extern void sata_phy_reset(struct ata_port *ap); | 483 | extern void sata_phy_reset(struct ata_port *ap); |
437 | extern void ata_bus_reset(struct ata_port *ap); | 484 | extern void ata_bus_reset(struct ata_port *ap); |
485 | extern int ata_drive_probe_reset(struct ata_port *ap, | ||
486 | ata_probeinit_fn_t probeinit, | ||
487 | ata_reset_fn_t softreset, ata_reset_fn_t hardreset, | ||
488 | ata_postreset_fn_t postreset, unsigned int *classes); | ||
489 | extern void ata_std_probeinit(struct ata_port *ap); | ||
490 | extern int ata_std_softreset(struct ata_port *ap, int verbose, | ||
491 | unsigned int *classes); | ||
492 | extern int sata_std_hardreset(struct ata_port *ap, int verbose, | ||
493 | unsigned int *class); | ||
494 | extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); | ||
495 | extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, | ||
496 | int post_reset); | ||
438 | extern void ata_port_disable(struct ata_port *); | 497 | extern void ata_port_disable(struct ata_port *); |
439 | extern void ata_std_ports(struct ata_ioports *ioaddr); | 498 | extern void ata_std_ports(struct ata_ioports *ioaddr); |
440 | #ifdef CONFIG_PCI | 499 | #ifdef CONFIG_PCI |
@@ -443,6 +502,7 @@ extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_i | |||
443 | extern void ata_pci_remove_one (struct pci_dev *pdev); | 502 | extern void ata_pci_remove_one (struct pci_dev *pdev); |
444 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); | 503 | extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state); |
445 | extern int ata_pci_device_resume(struct pci_dev *pdev); | 504 | extern int ata_pci_device_resume(struct pci_dev *pdev); |
505 | extern int ata_pci_clear_simplex(struct pci_dev *pdev); | ||
446 | #endif /* CONFIG_PCI */ | 506 | #endif /* CONFIG_PCI */ |
447 | extern int ata_device_add(const struct ata_probe_ent *ent); | 507 | extern int ata_device_add(const struct ata_probe_ent *ent); |
448 | extern void ata_host_set_remove(struct ata_host_set *host_set); | 508 | extern void ata_host_set_remove(struct ata_host_set *host_set); |
@@ -450,6 +510,8 @@ extern int ata_scsi_detect(struct scsi_host_template *sht); | |||
450 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 510 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); |
451 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); | 511 | extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); |
452 | extern int ata_scsi_error(struct Scsi_Host *host); | 512 | extern int ata_scsi_error(struct Scsi_Host *host); |
513 | extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); | ||
514 | extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); | ||
453 | extern int ata_scsi_release(struct Scsi_Host *host); | 515 | extern int ata_scsi_release(struct Scsi_Host *host); |
454 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); | 516 | extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); |
455 | extern int ata_scsi_device_resume(struct scsi_device *); | 517 | extern int ata_scsi_device_resume(struct scsi_device *); |
@@ -457,6 +519,11 @@ extern int ata_scsi_device_suspend(struct scsi_device *); | |||
457 | extern int ata_device_resume(struct ata_port *, struct ata_device *); | 519 | extern int ata_device_resume(struct ata_port *, struct ata_device *); |
458 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); | 520 | extern int ata_device_suspend(struct ata_port *, struct ata_device *); |
459 | extern int ata_ratelimit(void); | 521 | extern int ata_ratelimit(void); |
522 | extern unsigned int ata_busy_sleep(struct ata_port *ap, | ||
523 | unsigned long timeout_pat, | ||
524 | unsigned long timeout); | ||
525 | extern void ata_port_queue_task(struct ata_port *ap, void (*fn)(void *), | ||
526 | void *data, unsigned long delay); | ||
460 | 527 | ||
461 | /* | 528 | /* |
462 | * Default driver ops implementations | 529 | * Default driver ops implementations |
@@ -470,26 +537,29 @@ extern void ata_std_dev_select (struct ata_port *ap, unsigned int device); | |||
470 | extern u8 ata_check_status(struct ata_port *ap); | 537 | extern u8 ata_check_status(struct ata_port *ap); |
471 | extern u8 ata_altstatus(struct ata_port *ap); | 538 | extern u8 ata_altstatus(struct ata_port *ap); |
472 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); | 539 | extern void ata_exec_command(struct ata_port *ap, const struct ata_taskfile *tf); |
540 | extern int ata_std_probe_reset(struct ata_port *ap, unsigned int *classes); | ||
473 | extern int ata_port_start (struct ata_port *ap); | 541 | extern int ata_port_start (struct ata_port *ap); |
474 | extern void ata_port_stop (struct ata_port *ap); | 542 | extern void ata_port_stop (struct ata_port *ap); |
475 | extern void ata_host_stop (struct ata_host_set *host_set); | 543 | extern void ata_host_stop (struct ata_host_set *host_set); |
476 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); | 544 | extern irqreturn_t ata_interrupt (int irq, void *dev_instance, struct pt_regs *regs); |
477 | extern void ata_qc_prep(struct ata_queued_cmd *qc); | 545 | extern void ata_qc_prep(struct ata_queued_cmd *qc); |
478 | extern int ata_qc_issue_prot(struct ata_queued_cmd *qc); | 546 | extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); |
547 | extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); | ||
479 | extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, | 548 | extern void ata_sg_init_one(struct ata_queued_cmd *qc, void *buf, |
480 | unsigned int buflen); | 549 | unsigned int buflen); |
481 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, | 550 | extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, |
482 | unsigned int n_elem); | 551 | unsigned int n_elem); |
483 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); | 552 | extern unsigned int ata_dev_classify(const struct ata_taskfile *tf); |
484 | extern void ata_dev_id_string(const u16 *id, unsigned char *s, | 553 | extern void ata_id_string(const u16 *id, unsigned char *s, |
485 | unsigned int ofs, unsigned int len); | 554 | unsigned int ofs, unsigned int len); |
486 | extern void ata_dev_config(struct ata_port *ap, unsigned int i); | 555 | extern void ata_id_c_string(const u16 *id, unsigned char *s, |
556 | unsigned int ofs, unsigned int len); | ||
487 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); | 557 | extern void ata_bmdma_setup (struct ata_queued_cmd *qc); |
488 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); | 558 | extern void ata_bmdma_start (struct ata_queued_cmd *qc); |
489 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); | 559 | extern void ata_bmdma_stop(struct ata_queued_cmd *qc); |
490 | extern u8 ata_bmdma_status(struct ata_port *ap); | 560 | extern u8 ata_bmdma_status(struct ata_port *ap); |
491 | extern void ata_bmdma_irq_clear(struct ata_port *ap); | 561 | extern void ata_bmdma_irq_clear(struct ata_port *ap); |
492 | extern void ata_qc_complete(struct ata_queued_cmd *qc); | 562 | extern void __ata_qc_complete(struct ata_queued_cmd *qc); |
493 | extern void ata_eng_timeout(struct ata_port *ap); | 563 | extern void ata_eng_timeout(struct ata_port *ap); |
494 | extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, | 564 | extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, |
495 | struct scsi_cmnd *cmd, | 565 | struct scsi_cmnd *cmd, |
@@ -540,7 +610,7 @@ extern void ata_pci_host_stop (struct ata_host_set *host_set); | |||
540 | extern struct ata_probe_ent * | 610 | extern struct ata_probe_ent * |
541 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); | 611 | ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask); |
542 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); | 612 | extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); |
543 | 613 | extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_device *, unsigned long); | |
544 | #endif /* CONFIG_PCI */ | 614 | #endif /* CONFIG_PCI */ |
545 | 615 | ||
546 | 616 | ||
@@ -586,10 +656,14 @@ static inline unsigned int ata_tag_valid(unsigned int tag) | |||
586 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; | 656 | return (tag < ATA_MAX_QUEUE) ? 1 : 0; |
587 | } | 657 | } |
588 | 658 | ||
659 | static inline unsigned int ata_class_present(unsigned int class) | ||
660 | { | ||
661 | return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; | ||
662 | } | ||
663 | |||
589 | static inline unsigned int ata_dev_present(const struct ata_device *dev) | 664 | static inline unsigned int ata_dev_present(const struct ata_device *dev) |
590 | { | 665 | { |
591 | return ((dev->class == ATA_DEV_ATA) || | 666 | return ata_class_present(dev->class); |
592 | (dev->class == ATA_DEV_ATAPI)); | ||
593 | } | 667 | } |
594 | 668 | ||
595 | static inline u8 ata_chk_status(struct ata_port *ap) | 669 | static inline u8 ata_chk_status(struct ata_port *ap) |
@@ -657,9 +731,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap) | |||
657 | 731 | ||
658 | if (status & (ATA_BUSY | ATA_DRQ)) { | 732 | if (status & (ATA_BUSY | ATA_DRQ)) { |
659 | unsigned long l = ap->ioaddr.status_addr; | 733 | unsigned long l = ap->ioaddr.status_addr; |
660 | printk(KERN_WARNING | 734 | if (ata_msg_warn(ap)) |
661 | "ATA: abnormal status 0x%X on port 0x%lX\n", | 735 | printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%lX\n", |
662 | status, l); | 736 | status, l); |
663 | } | 737 | } |
664 | 738 | ||
665 | return status; | 739 | return status; |
@@ -701,6 +775,24 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc) | |||
701 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); | 775 | ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); |
702 | } | 776 | } |
703 | 777 | ||
778 | /** | ||
779 | * ata_qc_complete - Complete an active ATA command | ||
780 | * @qc: Command to complete | ||
781 | * @err_mask: ATA Status register contents | ||
782 | * | ||
783 | * Indicate to the mid and upper layers that an ATA | ||
784 | * command has completed, with either an ok or not-ok status. | ||
785 | * | ||
786 | * LOCKING: | ||
787 | * spin_lock_irqsave(host_set lock) | ||
788 | */ | ||
789 | static inline void ata_qc_complete(struct ata_queued_cmd *qc) | ||
790 | { | ||
791 | if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED)) | ||
792 | return; | ||
793 | |||
794 | __ata_qc_complete(qc); | ||
795 | } | ||
704 | 796 | ||
705 | /** | 797 | /** |
706 | * ata_irq_on - Enable interrupts on a port. | 798 | * ata_irq_on - Enable interrupts on a port. |
@@ -751,7 +843,8 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | |||
751 | 843 | ||
752 | status = ata_busy_wait(ap, bits, 1000); | 844 | status = ata_busy_wait(ap, bits, 1000); |
753 | if (status & bits) | 845 | if (status & bits) |
754 | DPRINTK("abnormal status 0x%X\n", status); | 846 | if (ata_msg_err(ap)) |
847 | printk(KERN_ERR "abnormal status 0x%X\n", status); | ||
755 | 848 | ||
756 | /* get controller status; clear intr, err bits */ | 849 | /* get controller status; clear intr, err bits */ |
757 | if (ap->flags & ATA_FLAG_MMIO) { | 850 | if (ap->flags & ATA_FLAG_MMIO) { |
@@ -769,8 +862,10 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq) | |||
769 | post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); | 862 | post_stat = inb(ap->ioaddr.bmdma_addr + ATA_DMA_STATUS); |
770 | } | 863 | } |
771 | 864 | ||
772 | VPRINTK("irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", | 865 | if (ata_msg_intr(ap)) |
773 | host_stat, post_stat, status); | 866 | printk(KERN_INFO "%s: irq ack: host_stat 0x%X, new host_stat 0x%X, drv_stat 0x%X\n", |
867 | __FUNCTION__, | ||
868 | host_stat, post_stat, status); | ||
774 | 869 | ||
775 | return status; | 870 | return status; |
776 | } | 871 | } |
@@ -807,7 +902,7 @@ static inline int ata_try_flush_cache(const struct ata_device *dev) | |||
807 | static inline unsigned int ac_err_mask(u8 status) | 902 | static inline unsigned int ac_err_mask(u8 status) |
808 | { | 903 | { |
809 | if (status & ATA_BUSY) | 904 | if (status & ATA_BUSY) |
810 | return AC_ERR_ATA_BUS; | 905 | return AC_ERR_HSM; |
811 | if (status & (ATA_ERR | ATA_DF)) | 906 | if (status & (ATA_ERR | ATA_DF)) |
812 | return AC_ERR_DEV; | 907 | return AC_ERR_DEV; |
813 | return 0; | 908 | return 0; |
diff --git a/include/linux/list.h b/include/linux/list.h index 47208bd99f9e..67258b47e9ca 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -411,6 +411,17 @@ static inline void list_splice_init(struct list_head *list, | |||
411 | pos = list_entry(pos->member.next, typeof(*pos), member)) | 411 | pos = list_entry(pos->member.next, typeof(*pos), member)) |
412 | 412 | ||
413 | /** | 413 | /** |
414 | * list_for_each_entry_from - iterate over list of given type | ||
415 | * continuing from existing point | ||
416 | * @pos: the type * to use as a loop counter. | ||
417 | * @head: the head for your list. | ||
418 | * @member: the name of the list_struct within the struct. | ||
419 | */ | ||
420 | #define list_for_each_entry_from(pos, head, member) \ | ||
421 | for (; prefetch(pos->member.next), &pos->member != (head); \ | ||
422 | pos = list_entry(pos->member.next, typeof(*pos), member)) | ||
423 | |||
424 | /** | ||
414 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry | 425 | * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry |
415 | * @pos: the type * to use as a loop counter. | 426 | * @pos: the type * to use as a loop counter. |
416 | * @n: another type * to use as temporary storage | 427 | * @n: another type * to use as temporary storage |
@@ -438,6 +449,19 @@ static inline void list_splice_init(struct list_head *list, | |||
438 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | 449 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) |
439 | 450 | ||
440 | /** | 451 | /** |
452 | * list_for_each_entry_safe_from - iterate over list of given type | ||
453 | * from existing point safe against removal of list entry | ||
454 | * @pos: the type * to use as a loop counter. | ||
455 | * @n: another type * to use as temporary storage | ||
456 | * @head: the head for your list. | ||
457 | * @member: the name of the list_struct within the struct. | ||
458 | */ | ||
459 | #define list_for_each_entry_safe_from(pos, n, head, member) \ | ||
460 | for (n = list_entry(pos->member.next, typeof(*pos), member); \ | ||
461 | &pos->member != (head); \ | ||
462 | pos = n, n = list_entry(n->member.next, typeof(*n), member)) | ||
463 | |||
464 | /** | ||
441 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against | 465 | * list_for_each_entry_safe_reverse - iterate backwards over list of given type safe against |
442 | * removal of list entry | 466 | * removal of list entry |
443 | * @pos: the type * to use as a loop counter. | 467 | * @pos: the type * to use as a loop counter. |
diff --git a/include/linux/loop.h b/include/linux/loop.h index f96506782ebe..e76c7611d6cc 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/bio.h> | 17 | #include <linux/bio.h> |
18 | #include <linux/blkdev.h> | 18 | #include <linux/blkdev.h> |
19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
20 | #include <linux/mutex.h> | ||
20 | 21 | ||
21 | /* Possible states of device */ | 22 | /* Possible states of device */ |
22 | enum { | 23 | enum { |
@@ -60,7 +61,7 @@ struct loop_device { | |||
60 | int lo_state; | 61 | int lo_state; |
61 | struct completion lo_done; | 62 | struct completion lo_done; |
62 | struct completion lo_bh_done; | 63 | struct completion lo_bh_done; |
63 | struct semaphore lo_ctl_mutex; | 64 | struct mutex lo_ctl_mutex; |
64 | int lo_pending; | 65 | int lo_pending; |
65 | 66 | ||
66 | request_queue_t *lo_queue; | 67 | request_queue_t *lo_queue; |
diff --git a/include/linux/migrate.h b/include/linux/migrate.h new file mode 100644 index 000000000000..7d09962c3c0b --- /dev/null +++ b/include/linux/migrate.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef _LINUX_MIGRATE_H | ||
2 | #define _LINUX_MIGRATE_H | ||
3 | |||
4 | #include <linux/config.h> | ||
5 | #include <linux/mm.h> | ||
6 | |||
7 | #ifdef CONFIG_MIGRATION | ||
8 | extern int isolate_lru_page(struct page *p, struct list_head *pagelist); | ||
9 | extern int putback_lru_pages(struct list_head *l); | ||
10 | extern int migrate_page(struct page *, struct page *); | ||
11 | extern void migrate_page_copy(struct page *, struct page *); | ||
12 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
13 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
14 | struct list_head *moved, struct list_head *failed); | ||
15 | int migrate_pages_to(struct list_head *pagelist, | ||
16 | struct vm_area_struct *vma, int dest); | ||
17 | extern int fail_migrate_page(struct page *, struct page *); | ||
18 | |||
19 | extern int migrate_prep(void); | ||
20 | |||
21 | #else | ||
22 | |||
23 | static inline int isolate_lru_page(struct page *p, struct list_head *list) | ||
24 | { return -ENOSYS; } | ||
25 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
26 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
27 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
28 | |||
29 | static inline int migrate_prep(void) { return -ENOSYS; } | ||
30 | |||
31 | /* Possible settings for the migrate_page() method in address_operations */ | ||
32 | #define migrate_page NULL | ||
33 | #define fail_migrate_page NULL | ||
34 | |||
35 | #endif /* CONFIG_MIGRATION */ | ||
36 | #endif /* _LINUX_MIGRATE_H */ | ||
diff --git a/include/linux/mm.h b/include/linux/mm.h index 498ff8778fb6..6aa016f1d3ae 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -286,43 +286,34 @@ struct page { | |||
286 | * | 286 | * |
287 | * Also, many kernel routines increase the page count before a critical | 287 | * Also, many kernel routines increase the page count before a critical |
288 | * routine so they can be sure the page doesn't go away from under them. | 288 | * routine so they can be sure the page doesn't go away from under them. |
289 | * | ||
290 | * Since 2.6.6 (approx), a free page has ->_count = -1. This is so that we | ||
291 | * can use atomic_add_negative(-1, page->_count) to detect when the page | ||
292 | * becomes free and so that we can also use atomic_inc_and_test to atomically | ||
293 | * detect when we just tried to grab a ref on a page which some other CPU has | ||
294 | * already deemed to be freeable. | ||
295 | * | ||
296 | * NO code should make assumptions about this internal detail! Use the provided | ||
297 | * macros which retain the old rules: page_count(page) == 0 is a free page. | ||
298 | */ | 289 | */ |
299 | 290 | ||
300 | /* | 291 | /* |
301 | * Drop a ref, return true if the logical refcount fell to zero (the page has | 292 | * Drop a ref, return true if the logical refcount fell to zero (the page has |
302 | * no users) | 293 | * no users) |
303 | */ | 294 | */ |
304 | #define put_page_testzero(p) \ | 295 | static inline int put_page_testzero(struct page *page) |
305 | ({ \ | 296 | { |
306 | BUG_ON(atomic_read(&(p)->_count) == -1);\ | 297 | BUG_ON(atomic_read(&page->_count) == 0); |
307 | atomic_add_negative(-1, &(p)->_count); \ | 298 | return atomic_dec_and_test(&page->_count); |
308 | }) | 299 | } |
309 | 300 | ||
310 | /* | 301 | /* |
311 | * Grab a ref, return true if the page previously had a logical refcount of | 302 | * Try to grab a ref unless the page has a refcount of zero, return false if |
312 | * zero. ie: returns true if we just grabbed an already-deemed-to-be-free page | 303 | * that is the case. |
313 | */ | 304 | */ |
314 | #define get_page_testone(p) atomic_inc_and_test(&(p)->_count) | 305 | static inline int get_page_unless_zero(struct page *page) |
315 | 306 | { | |
316 | #define set_page_count(p,v) atomic_set(&(p)->_count, (v) - 1) | 307 | return atomic_inc_not_zero(&page->_count); |
317 | #define __put_page(p) atomic_dec(&(p)->_count) | 308 | } |
318 | 309 | ||
319 | extern void FASTCALL(__page_cache_release(struct page *)); | 310 | extern void FASTCALL(__page_cache_release(struct page *)); |
320 | 311 | ||
321 | static inline int page_count(struct page *page) | 312 | static inline int page_count(struct page *page) |
322 | { | 313 | { |
323 | if (PageCompound(page)) | 314 | if (unlikely(PageCompound(page))) |
324 | page = (struct page *)page_private(page); | 315 | page = (struct page *)page_private(page); |
325 | return atomic_read(&page->_count) + 1; | 316 | return atomic_read(&page->_count); |
326 | } | 317 | } |
327 | 318 | ||
328 | static inline void get_page(struct page *page) | 319 | static inline void get_page(struct page *page) |
@@ -332,8 +323,19 @@ static inline void get_page(struct page *page) | |||
332 | atomic_inc(&page->_count); | 323 | atomic_inc(&page->_count); |
333 | } | 324 | } |
334 | 325 | ||
326 | /* | ||
327 | * Setup the page count before being freed into the page allocator for | ||
328 | * the first time (boot or memory hotplug) | ||
329 | */ | ||
330 | static inline void init_page_count(struct page *page) | ||
331 | { | ||
332 | atomic_set(&page->_count, 1); | ||
333 | } | ||
334 | |||
335 | void put_page(struct page *page); | 335 | void put_page(struct page *page); |
336 | 336 | ||
337 | void split_page(struct page *page, unsigned int order); | ||
338 | |||
337 | /* | 339 | /* |
338 | * Multiple processes may "see" the same page. E.g. for untouched | 340 | * Multiple processes may "see" the same page. E.g. for untouched |
339 | * mappings of /dev/null, all processes see the same page full of | 341 | * mappings of /dev/null, all processes see the same page full of |
@@ -1046,7 +1048,7 @@ int in_gate_area_no_task(unsigned long addr); | |||
1046 | 1048 | ||
1047 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, | 1049 | int drop_caches_sysctl_handler(struct ctl_table *, int, struct file *, |
1048 | void __user *, size_t *, loff_t *); | 1050 | void __user *, size_t *, loff_t *); |
1049 | int shrink_slab(unsigned long scanned, gfp_t gfp_mask, | 1051 | unsigned long shrink_slab(unsigned long scanned, gfp_t gfp_mask, |
1050 | unsigned long lru_pages); | 1052 | unsigned long lru_pages); |
1051 | void drop_pagecache(void); | 1053 | void drop_pagecache(void); |
1052 | void drop_slab(void); | 1054 | void drop_slab(void); |
diff --git a/include/linux/mm_inline.h b/include/linux/mm_inline.h index 8ac854f7f190..3b6723dfaff3 100644 --- a/include/linux/mm_inline.h +++ b/include/linux/mm_inline.h | |||
@@ -32,7 +32,7 @@ del_page_from_lru(struct zone *zone, struct page *page) | |||
32 | { | 32 | { |
33 | list_del(&page->lru); | 33 | list_del(&page->lru); |
34 | if (PageActive(page)) { | 34 | if (PageActive(page)) { |
35 | ClearPageActive(page); | 35 | __ClearPageActive(page); |
36 | zone->nr_active--; | 36 | zone->nr_active--; |
37 | } else { | 37 | } else { |
38 | zone->nr_inactive--; | 38 | zone->nr_inactive--; |
diff --git a/include/linux/module.h b/include/linux/module.h index 84d75f3a8aca..70bd843c71cb 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -198,6 +198,9 @@ void *__symbol_get_gpl(const char *symbol); | |||
198 | #define EXPORT_SYMBOL_GPL(sym) \ | 198 | #define EXPORT_SYMBOL_GPL(sym) \ |
199 | __EXPORT_SYMBOL(sym, "_gpl") | 199 | __EXPORT_SYMBOL(sym, "_gpl") |
200 | 200 | ||
201 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) \ | ||
202 | __EXPORT_SYMBOL(sym, "_gpl_future") | ||
203 | |||
201 | #endif | 204 | #endif |
202 | 205 | ||
203 | struct module_ref | 206 | struct module_ref |
@@ -242,6 +245,7 @@ struct module | |||
242 | /* Sysfs stuff. */ | 245 | /* Sysfs stuff. */ |
243 | struct module_kobject mkobj; | 246 | struct module_kobject mkobj; |
244 | struct module_param_attrs *param_attrs; | 247 | struct module_param_attrs *param_attrs; |
248 | struct module_attribute *modinfo_attrs; | ||
245 | const char *version; | 249 | const char *version; |
246 | const char *srcversion; | 250 | const char *srcversion; |
247 | 251 | ||
@@ -255,6 +259,11 @@ struct module | |||
255 | unsigned int num_gpl_syms; | 259 | unsigned int num_gpl_syms; |
256 | const unsigned long *gpl_crcs; | 260 | const unsigned long *gpl_crcs; |
257 | 261 | ||
262 | /* symbols that will be GPL-only in the near future. */ | ||
263 | const struct kernel_symbol *gpl_future_syms; | ||
264 | unsigned int num_gpl_future_syms; | ||
265 | const unsigned long *gpl_future_crcs; | ||
266 | |||
258 | /* Exception table */ | 267 | /* Exception table */ |
259 | unsigned int num_exentries; | 268 | unsigned int num_exentries; |
260 | const struct exception_table_entry *extable; | 269 | const struct exception_table_entry *extable; |
@@ -441,6 +450,7 @@ void module_remove_driver(struct device_driver *); | |||
441 | #else /* !CONFIG_MODULES... */ | 450 | #else /* !CONFIG_MODULES... */ |
442 | #define EXPORT_SYMBOL(sym) | 451 | #define EXPORT_SYMBOL(sym) |
443 | #define EXPORT_SYMBOL_GPL(sym) | 452 | #define EXPORT_SYMBOL_GPL(sym) |
453 | #define EXPORT_SYMBOL_GPL_FUTURE(sym) | ||
444 | 454 | ||
445 | /* Given an address, look for it in the exception tables. */ | 455 | /* Given an address, look for it in the exception tables. */ |
446 | static inline const struct exception_table_entry * | 456 | static inline const struct exception_table_entry * |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index e933e2a355ad..779e6a5744c7 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -184,6 +184,7 @@ struct fat_slot_info { | |||
184 | #include <linux/string.h> | 184 | #include <linux/string.h> |
185 | #include <linux/nls.h> | 185 | #include <linux/nls.h> |
186 | #include <linux/fs.h> | 186 | #include <linux/fs.h> |
187 | #include <linux/mutex.h> | ||
187 | 188 | ||
188 | struct fat_mount_options { | 189 | struct fat_mount_options { |
189 | uid_t fs_uid; | 190 | uid_t fs_uid; |
@@ -199,7 +200,7 @@ struct fat_mount_options { | |||
199 | sys_immutable:1, /* set = system files are immutable */ | 200 | sys_immutable:1, /* set = system files are immutable */ |
200 | dotsOK:1, /* set = hidden and system files are named '.filename' */ | 201 | dotsOK:1, /* set = hidden and system files are named '.filename' */ |
201 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ | 202 | isvfat:1, /* 0=no vfat long filename support, 1=vfat support */ |
202 | utf8:1, /* Use of UTF8 character set (Default) */ | 203 | utf8:1, /* Use of UTF-8 character set (Default) */ |
203 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 204 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
204 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 205 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
205 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | 206 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ |
@@ -226,7 +227,7 @@ struct msdos_sb_info { | |||
226 | unsigned long max_cluster; /* maximum cluster number */ | 227 | unsigned long max_cluster; /* maximum cluster number */ |
227 | unsigned long root_cluster; /* first cluster of the root directory */ | 228 | unsigned long root_cluster; /* first cluster of the root directory */ |
228 | unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ | 229 | unsigned long fsinfo_sector; /* sector number of FAT32 fsinfo */ |
229 | struct semaphore fat_lock; | 230 | struct mutex fat_lock; |
230 | unsigned int prev_free; /* previously allocated cluster number */ | 231 | unsigned int prev_free; /* previously allocated cluster number */ |
231 | unsigned int free_clusters; /* -1 if undefined */ | 232 | unsigned int free_clusters; /* -1 if undefined */ |
232 | struct fat_mount_options options; | 233 | struct fat_mount_options options; |
diff --git a/include/linux/nbd.h b/include/linux/nbd.h index f95d51fae733..a6ce409ec6fc 100644 --- a/include/linux/nbd.h +++ b/include/linux/nbd.h | |||
@@ -38,6 +38,7 @@ enum { | |||
38 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
39 | 39 | ||
40 | #include <linux/wait.h> | 40 | #include <linux/wait.h> |
41 | #include <linux/mutex.h> | ||
41 | 42 | ||
42 | /* values for flags field */ | 43 | /* values for flags field */ |
43 | #define NBD_READ_ONLY 0x0001 | 44 | #define NBD_READ_ONLY 0x0001 |
@@ -57,7 +58,7 @@ struct nbd_device { | |||
57 | struct request *active_req; | 58 | struct request *active_req; |
58 | wait_queue_head_t active_wq; | 59 | wait_queue_head_t active_wq; |
59 | 60 | ||
60 | struct semaphore tx_lock; | 61 | struct mutex tx_lock; |
61 | struct gendisk *disk; | 62 | struct gendisk *disk; |
62 | int blksize; | 63 | int blksize; |
63 | u64 bytesize; | 64 | u64 bytesize; |
diff --git a/include/linux/ncp_fs_i.h b/include/linux/ncp_fs_i.h index 415be1ec6f98..bdb4c8ae6924 100644 --- a/include/linux/ncp_fs_i.h +++ b/include/linux/ncp_fs_i.h | |||
@@ -19,7 +19,7 @@ struct ncp_inode_info { | |||
19 | __le32 DosDirNum; | 19 | __le32 DosDirNum; |
20 | __u8 volNumber; | 20 | __u8 volNumber; |
21 | __le32 nwattr; | 21 | __le32 nwattr; |
22 | struct semaphore open_sem; | 22 | struct mutex open_mutex; |
23 | atomic_t opened; | 23 | atomic_t opened; |
24 | int access; | 24 | int access; |
25 | int flags; | 25 | int flags; |
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h index cf858eb80f0b..b089d9506283 100644 --- a/include/linux/ncp_fs_sb.h +++ b/include/linux/ncp_fs_sb.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
12 | #include <linux/ncp_mount.h> | 12 | #include <linux/ncp_mount.h> |
13 | #include <linux/net.h> | 13 | #include <linux/net.h> |
14 | #include <linux/mutex.h> | ||
14 | 15 | ||
15 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
16 | 17 | ||
@@ -51,7 +52,7 @@ struct ncp_server { | |||
51 | receive replies */ | 52 | receive replies */ |
52 | 53 | ||
53 | int lock; /* To prevent mismatch in protocols. */ | 54 | int lock; /* To prevent mismatch in protocols. */ |
54 | struct semaphore sem; | 55 | struct mutex mutex; |
55 | 56 | ||
56 | int current_size; /* for packet preparation */ | 57 | int current_size; /* for packet preparation */ |
57 | int has_subfunction; | 58 | int has_subfunction; |
@@ -96,7 +97,7 @@ struct ncp_server { | |||
96 | struct { | 97 | struct { |
97 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ | 98 | struct work_struct tq; /* STREAM/DGRAM: data/error ready */ |
98 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ | 99 | struct ncp_request_reply* creq; /* STREAM/DGRAM: awaiting reply from this request */ |
99 | struct semaphore creq_sem; /* DGRAM only: lock accesses to rcv.creq */ | 100 | struct mutex creq_mutex; /* DGRAM only: lock accesses to rcv.creq */ |
100 | 101 | ||
101 | unsigned int state; /* STREAM only: receiver state */ | 102 | unsigned int state; /* STREAM only: receiver state */ |
102 | struct { | 103 | struct { |
diff --git a/include/linux/net.h b/include/linux/net.h index 28195a2d8ff0..84a490e5f0a1 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -143,12 +143,18 @@ struct proto_ops { | |||
143 | struct poll_table_struct *wait); | 143 | struct poll_table_struct *wait); |
144 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 144 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
145 | unsigned long arg); | 145 | unsigned long arg); |
146 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | ||
147 | unsigned long arg); | ||
146 | int (*listen) (struct socket *sock, int len); | 148 | int (*listen) (struct socket *sock, int len); |
147 | int (*shutdown) (struct socket *sock, int flags); | 149 | int (*shutdown) (struct socket *sock, int flags); |
148 | int (*setsockopt)(struct socket *sock, int level, | 150 | int (*setsockopt)(struct socket *sock, int level, |
149 | int optname, char __user *optval, int optlen); | 151 | int optname, char __user *optval, int optlen); |
150 | int (*getsockopt)(struct socket *sock, int level, | 152 | int (*getsockopt)(struct socket *sock, int level, |
151 | int optname, char __user *optval, int __user *optlen); | 153 | int optname, char __user *optval, int __user *optlen); |
154 | int (*compat_setsockopt)(struct socket *sock, int level, | ||
155 | int optname, char __user *optval, int optlen); | ||
156 | int (*compat_getsockopt)(struct socket *sock, int level, | ||
157 | int optname, char __user *optval, int __user *optlen); | ||
152 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 158 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
153 | struct msghdr *m, size_t total_len); | 159 | struct msghdr *m, size_t total_len); |
154 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 160 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
@@ -247,6 +253,8 @@ SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_ | |||
247 | (file, sock, wait)) \ | 253 | (file, sock, wait)) \ |
248 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ | 254 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ |
249 | unsigned long arg), (sock, cmd, arg)) \ | 255 | unsigned long arg), (sock, cmd, arg)) \ |
256 | SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \ | ||
257 | unsigned long arg), (sock, cmd, arg)) \ | ||
250 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ | 258 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ |
251 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ | 259 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ |
252 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ | 260 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ |
@@ -271,6 +279,7 @@ static const struct proto_ops name##_ops = { \ | |||
271 | .getname = __lock_##name##_getname, \ | 279 | .getname = __lock_##name##_getname, \ |
272 | .poll = __lock_##name##_poll, \ | 280 | .poll = __lock_##name##_poll, \ |
273 | .ioctl = __lock_##name##_ioctl, \ | 281 | .ioctl = __lock_##name##_ioctl, \ |
282 | .compat_ioctl = __lock_##name##_compat_ioctl, \ | ||
274 | .listen = __lock_##name##_listen, \ | 283 | .listen = __lock_##name##_listen, \ |
275 | .shutdown = __lock_##name##_shutdown, \ | 284 | .shutdown = __lock_##name##_shutdown, \ |
276 | .setsockopt = __lock_##name##_setsockopt, \ | 285 | .setsockopt = __lock_##name##_setsockopt, \ |
@@ -279,6 +288,7 @@ static const struct proto_ops name##_ops = { \ | |||
279 | .recvmsg = __lock_##name##_recvmsg, \ | 288 | .recvmsg = __lock_##name##_recvmsg, \ |
280 | .mmap = __lock_##name##_mmap, \ | 289 | .mmap = __lock_##name##_mmap, \ |
281 | }; | 290 | }; |
291 | |||
282 | #endif | 292 | #endif |
283 | 293 | ||
284 | #define MODULE_ALIAS_NETPROTO(proto) \ | 294 | #define MODULE_ALIAS_NETPROTO(proto) \ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7fda03d338d1..950dc55e5192 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -230,7 +230,8 @@ enum netdev_state_t | |||
230 | __LINK_STATE_SCHED, | 230 | __LINK_STATE_SCHED, |
231 | __LINK_STATE_NOCARRIER, | 231 | __LINK_STATE_NOCARRIER, |
232 | __LINK_STATE_RX_SCHED, | 232 | __LINK_STATE_RX_SCHED, |
233 | __LINK_STATE_LINKWATCH_PENDING | 233 | __LINK_STATE_LINKWATCH_PENDING, |
234 | __LINK_STATE_DORMANT, | ||
234 | }; | 235 | }; |
235 | 236 | ||
236 | 237 | ||
@@ -335,11 +336,14 @@ struct net_device | |||
335 | */ | 336 | */ |
336 | 337 | ||
337 | 338 | ||
338 | unsigned short flags; /* interface flags (a la BSD) */ | 339 | unsigned int flags; /* interface flags (a la BSD) */ |
339 | unsigned short gflags; | 340 | unsigned short gflags; |
340 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ | 341 | unsigned short priv_flags; /* Like 'flags' but invisible to userspace. */ |
341 | unsigned short padded; /* How much padding added by alloc_netdev() */ | 342 | unsigned short padded; /* How much padding added by alloc_netdev() */ |
342 | 343 | ||
344 | unsigned char operstate; /* RFC2863 operstate */ | ||
345 | unsigned char link_mode; /* mapping policy to operstate */ | ||
346 | |||
343 | unsigned mtu; /* interface MTU value */ | 347 | unsigned mtu; /* interface MTU value */ |
344 | unsigned short type; /* interface hardware type */ | 348 | unsigned short type; /* interface hardware type */ |
345 | unsigned short hard_header_len; /* hardware hdr length */ | 349 | unsigned short hard_header_len; /* hardware hdr length */ |
@@ -708,12 +712,18 @@ static inline void dev_put(struct net_device *dev) | |||
708 | atomic_dec(&dev->refcnt); | 712 | atomic_dec(&dev->refcnt); |
709 | } | 713 | } |
710 | 714 | ||
711 | #define __dev_put(dev) atomic_dec(&(dev)->refcnt) | 715 | static inline void dev_hold(struct net_device *dev) |
712 | #define dev_hold(dev) atomic_inc(&(dev)->refcnt) | 716 | { |
717 | atomic_inc(&dev->refcnt); | ||
718 | } | ||
713 | 719 | ||
714 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on | 720 | /* Carrier loss detection, dial on demand. The functions netif_carrier_on |
715 | * and _off may be called from IRQ context, but it is caller | 721 | * and _off may be called from IRQ context, but it is caller |
716 | * who is responsible for serialization of these calls. | 722 | * who is responsible for serialization of these calls. |
723 | * | ||
724 | * The name carrier is inappropriate, these functions should really be | ||
725 | * called netif_lowerlayer_*() because they represent the state of any | ||
726 | * kind of lower layer not just hardware media. | ||
717 | */ | 727 | */ |
718 | 728 | ||
719 | extern void linkwatch_fire_event(struct net_device *dev); | 729 | extern void linkwatch_fire_event(struct net_device *dev); |
@@ -729,6 +739,29 @@ extern void netif_carrier_on(struct net_device *dev); | |||
729 | 739 | ||
730 | extern void netif_carrier_off(struct net_device *dev); | 740 | extern void netif_carrier_off(struct net_device *dev); |
731 | 741 | ||
742 | static inline void netif_dormant_on(struct net_device *dev) | ||
743 | { | ||
744 | if (!test_and_set_bit(__LINK_STATE_DORMANT, &dev->state)) | ||
745 | linkwatch_fire_event(dev); | ||
746 | } | ||
747 | |||
748 | static inline void netif_dormant_off(struct net_device *dev) | ||
749 | { | ||
750 | if (test_and_clear_bit(__LINK_STATE_DORMANT, &dev->state)) | ||
751 | linkwatch_fire_event(dev); | ||
752 | } | ||
753 | |||
754 | static inline int netif_dormant(const struct net_device *dev) | ||
755 | { | ||
756 | return test_bit(__LINK_STATE_DORMANT, &dev->state); | ||
757 | } | ||
758 | |||
759 | |||
760 | static inline int netif_oper_up(const struct net_device *dev) { | ||
761 | return (dev->operstate == IF_OPER_UP || | ||
762 | dev->operstate == IF_OPER_UNKNOWN /* backward compat */); | ||
763 | } | ||
764 | |||
732 | /* Hot-plugging. */ | 765 | /* Hot-plugging. */ |
733 | static inline int netif_device_present(struct net_device *dev) | 766 | static inline int netif_device_present(struct net_device *dev) |
734 | { | 767 | { |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 468896939843..412e52ca9720 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -80,10 +80,14 @@ struct nf_sockopt_ops | |||
80 | int set_optmin; | 80 | int set_optmin; |
81 | int set_optmax; | 81 | int set_optmax; |
82 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); | 82 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); |
83 | int (*compat_set)(struct sock *sk, int optval, | ||
84 | void __user *user, unsigned int len); | ||
83 | 85 | ||
84 | int get_optmin; | 86 | int get_optmin; |
85 | int get_optmax; | 87 | int get_optmax; |
86 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); | 88 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); |
89 | int (*compat_get)(struct sock *sk, int optval, | ||
90 | void __user *user, int *len); | ||
87 | 91 | ||
88 | /* Number of users inside set() or get(). */ | 92 | /* Number of users inside set() or get(). */ |
89 | unsigned int use; | 93 | unsigned int use; |
@@ -246,6 +250,11 @@ int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, | |||
246 | int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, | 250 | int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, |
247 | int *len); | 251 | int *len); |
248 | 252 | ||
253 | int compat_nf_setsockopt(struct sock *sk, int pf, int optval, | ||
254 | char __user *opt, int len); | ||
255 | int compat_nf_getsockopt(struct sock *sk, int pf, int optval, | ||
256 | char __user *opt, int *len); | ||
257 | |||
249 | /* Packet queuing */ | 258 | /* Packet queuing */ |
250 | struct nf_queue_handler { | 259 | struct nf_queue_handler { |
251 | int (*outfn)(struct sk_buff *skb, struct nf_info *info, | 260 | int (*outfn)(struct sk_buff *skb, struct nf_info *info, |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 934a2479f160..9f5b12cf489b 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -164,6 +164,7 @@ extern void nfattr_parse(struct nfattr *tb[], int maxattr, | |||
164 | __res; \ | 164 | __res; \ |
165 | }) | 165 | }) |
166 | 166 | ||
167 | extern int nfnetlink_has_listeners(unsigned int group); | ||
167 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | 168 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, |
168 | int echo); | 169 | int echo); |
169 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 170 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); |
diff --git a/include/linux/netfilter/nfnetlink_log.h b/include/linux/netfilter/nfnetlink_log.h index b04b03880595..a7497c7436df 100644 --- a/include/linux/netfilter/nfnetlink_log.h +++ b/include/linux/netfilter/nfnetlink_log.h | |||
@@ -47,6 +47,8 @@ enum nfulnl_attr_type { | |||
47 | NFULA_PAYLOAD, /* opaque data payload */ | 47 | NFULA_PAYLOAD, /* opaque data payload */ |
48 | NFULA_PREFIX, /* string prefix */ | 48 | NFULA_PREFIX, /* string prefix */ |
49 | NFULA_UID, /* user id of socket */ | 49 | NFULA_UID, /* user id of socket */ |
50 | NFULA_SEQ, /* instance-local sequence number */ | ||
51 | NFULA_SEQ_GLOBAL, /* global sequence number */ | ||
50 | 52 | ||
51 | __NFULA_MAX | 53 | __NFULA_MAX |
52 | }; | 54 | }; |
@@ -77,6 +79,7 @@ enum nfulnl_attr_config { | |||
77 | NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ | 79 | NFULA_CFG_NLBUFSIZ, /* u_int32_t buffer size */ |
78 | NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ | 80 | NFULA_CFG_TIMEOUT, /* u_int32_t in 1/100 s */ |
79 | NFULA_CFG_QTHRESH, /* u_int32_t */ | 81 | NFULA_CFG_QTHRESH, /* u_int32_t */ |
82 | NFULA_CFG_FLAGS, /* u_int16_t */ | ||
80 | __NFULA_CFG_MAX | 83 | __NFULA_CFG_MAX |
81 | }; | 84 | }; |
82 | #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) | 85 | #define NFULA_CFG_MAX (__NFULA_CFG_MAX -1) |
@@ -85,4 +88,7 @@ enum nfulnl_attr_config { | |||
85 | #define NFULNL_COPY_META 0x01 | 88 | #define NFULNL_COPY_META 0x01 |
86 | #define NFULNL_COPY_PACKET 0x02 | 89 | #define NFULNL_COPY_PACKET 0x02 |
87 | 90 | ||
91 | #define NFULNL_CFG_F_SEQ 0x0001 | ||
92 | #define NFULNL_CFG_F_SEQ_GLOBAL 0x0002 | ||
93 | |||
88 | #endif /* _NFNETLINK_LOG_H */ | 94 | #endif /* _NFNETLINK_LOG_H */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 6500d4e59d46..1350e47b0234 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -4,6 +4,62 @@ | |||
4 | #define XT_FUNCTION_MAXNAMELEN 30 | 4 | #define XT_FUNCTION_MAXNAMELEN 30 |
5 | #define XT_TABLE_MAXNAMELEN 32 | 5 | #define XT_TABLE_MAXNAMELEN 32 |
6 | 6 | ||
7 | struct xt_entry_match | ||
8 | { | ||
9 | union { | ||
10 | struct { | ||
11 | u_int16_t match_size; | ||
12 | |||
13 | /* Used by userspace */ | ||
14 | char name[XT_FUNCTION_MAXNAMELEN-1]; | ||
15 | |||
16 | u_int8_t revision; | ||
17 | } user; | ||
18 | struct { | ||
19 | u_int16_t match_size; | ||
20 | |||
21 | /* Used inside the kernel */ | ||
22 | struct xt_match *match; | ||
23 | } kernel; | ||
24 | |||
25 | /* Total length */ | ||
26 | u_int16_t match_size; | ||
27 | } u; | ||
28 | |||
29 | unsigned char data[0]; | ||
30 | }; | ||
31 | |||
32 | struct xt_entry_target | ||
33 | { | ||
34 | union { | ||
35 | struct { | ||
36 | u_int16_t target_size; | ||
37 | |||
38 | /* Used by userspace */ | ||
39 | char name[XT_FUNCTION_MAXNAMELEN-1]; | ||
40 | |||
41 | u_int8_t revision; | ||
42 | } user; | ||
43 | struct { | ||
44 | u_int16_t target_size; | ||
45 | |||
46 | /* Used inside the kernel */ | ||
47 | struct xt_target *target; | ||
48 | } kernel; | ||
49 | |||
50 | /* Total length */ | ||
51 | u_int16_t target_size; | ||
52 | } u; | ||
53 | |||
54 | unsigned char data[0]; | ||
55 | }; | ||
56 | |||
57 | struct xt_standard_target | ||
58 | { | ||
59 | struct xt_entry_target target; | ||
60 | int verdict; | ||
61 | }; | ||
62 | |||
7 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision | 63 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision |
8 | * kernel supports, if >= revision. */ | 64 | * kernel supports, if >= revision. */ |
9 | struct xt_get_revision | 65 | struct xt_get_revision |
@@ -92,8 +148,6 @@ struct xt_match | |||
92 | 148 | ||
93 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 149 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
94 | 150 | ||
95 | u_int8_t revision; | ||
96 | |||
97 | /* Return true or false: return FALSE and set *hotdrop = 1 to | 151 | /* Return true or false: return FALSE and set *hotdrop = 1 to |
98 | force immediate packet drop. */ | 152 | force immediate packet drop. */ |
99 | /* Arguments changed since 2.6.9, as this must now handle | 153 | /* Arguments changed since 2.6.9, as this must now handle |
@@ -102,6 +156,7 @@ struct xt_match | |||
102 | int (*match)(const struct sk_buff *skb, | 156 | int (*match)(const struct sk_buff *skb, |
103 | const struct net_device *in, | 157 | const struct net_device *in, |
104 | const struct net_device *out, | 158 | const struct net_device *out, |
159 | const struct xt_match *match, | ||
105 | const void *matchinfo, | 160 | const void *matchinfo, |
106 | int offset, | 161 | int offset, |
107 | unsigned int protoff, | 162 | unsigned int protoff, |
@@ -111,15 +166,25 @@ struct xt_match | |||
111 | /* Should return true or false. */ | 166 | /* Should return true or false. */ |
112 | int (*checkentry)(const char *tablename, | 167 | int (*checkentry)(const char *tablename, |
113 | const void *ip, | 168 | const void *ip, |
169 | const struct xt_match *match, | ||
114 | void *matchinfo, | 170 | void *matchinfo, |
115 | unsigned int matchinfosize, | 171 | unsigned int matchinfosize, |
116 | unsigned int hook_mask); | 172 | unsigned int hook_mask); |
117 | 173 | ||
118 | /* Called when entry of this type deleted. */ | 174 | /* Called when entry of this type deleted. */ |
119 | void (*destroy)(void *matchinfo, unsigned int matchinfosize); | 175 | void (*destroy)(const struct xt_match *match, void *matchinfo, |
176 | unsigned int matchinfosize); | ||
120 | 177 | ||
121 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 178 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
122 | struct module *me; | 179 | struct module *me; |
180 | |||
181 | char *table; | ||
182 | unsigned int matchsize; | ||
183 | unsigned int hooks; | ||
184 | unsigned short proto; | ||
185 | |||
186 | unsigned short family; | ||
187 | u_int8_t revision; | ||
123 | }; | 188 | }; |
124 | 189 | ||
125 | /* Registration hooks for targets. */ | 190 | /* Registration hooks for targets. */ |
@@ -129,8 +194,6 @@ struct xt_target | |||
129 | 194 | ||
130 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 195 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
131 | 196 | ||
132 | u_int8_t revision; | ||
133 | |||
134 | /* Returns verdict. Argument order changed since 2.6.9, as this | 197 | /* Returns verdict. Argument order changed since 2.6.9, as this |
135 | must now handle non-linear skbs, using skb_copy_bits and | 198 | must now handle non-linear skbs, using skb_copy_bits and |
136 | skb_ip_make_writable. */ | 199 | skb_ip_make_writable. */ |
@@ -138,6 +201,7 @@ struct xt_target | |||
138 | const struct net_device *in, | 201 | const struct net_device *in, |
139 | const struct net_device *out, | 202 | const struct net_device *out, |
140 | unsigned int hooknum, | 203 | unsigned int hooknum, |
204 | const struct xt_target *target, | ||
141 | const void *targinfo, | 205 | const void *targinfo, |
142 | void *userdata); | 206 | void *userdata); |
143 | 207 | ||
@@ -147,15 +211,25 @@ struct xt_target | |||
147 | /* Should return true or false. */ | 211 | /* Should return true or false. */ |
148 | int (*checkentry)(const char *tablename, | 212 | int (*checkentry)(const char *tablename, |
149 | const void *entry, | 213 | const void *entry, |
214 | const struct xt_target *target, | ||
150 | void *targinfo, | 215 | void *targinfo, |
151 | unsigned int targinfosize, | 216 | unsigned int targinfosize, |
152 | unsigned int hook_mask); | 217 | unsigned int hook_mask); |
153 | 218 | ||
154 | /* Called when entry of this type deleted. */ | 219 | /* Called when entry of this type deleted. */ |
155 | void (*destroy)(void *targinfo, unsigned int targinfosize); | 220 | void (*destroy)(const struct xt_target *target, void *targinfo, |
221 | unsigned int targinfosize); | ||
156 | 222 | ||
157 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 223 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
158 | struct module *me; | 224 | struct module *me; |
225 | |||
226 | char *table; | ||
227 | unsigned int targetsize; | ||
228 | unsigned int hooks; | ||
229 | unsigned short proto; | ||
230 | |||
231 | unsigned short family; | ||
232 | u_int8_t revision; | ||
159 | }; | 233 | }; |
160 | 234 | ||
161 | /* Furniture shopping... */ | 235 | /* Furniture shopping... */ |
@@ -202,10 +276,17 @@ struct xt_table_info | |||
202 | char *entries[NR_CPUS]; | 276 | char *entries[NR_CPUS]; |
203 | }; | 277 | }; |
204 | 278 | ||
205 | extern int xt_register_target(int af, struct xt_target *target); | 279 | extern int xt_register_target(struct xt_target *target); |
206 | extern void xt_unregister_target(int af, struct xt_target *target); | 280 | extern void xt_unregister_target(struct xt_target *target); |
207 | extern int xt_register_match(int af, struct xt_match *target); | 281 | extern int xt_register_match(struct xt_match *target); |
208 | extern void xt_unregister_match(int af, struct xt_match *target); | 282 | extern void xt_unregister_match(struct xt_match *target); |
283 | |||
284 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | ||
285 | unsigned int size, const char *table, unsigned int hook, | ||
286 | unsigned short proto, int inv_proto); | ||
287 | extern int xt_check_target(const struct xt_target *target, unsigned short family, | ||
288 | unsigned int size, const char *table, unsigned int hook, | ||
289 | unsigned short proto, int inv_proto); | ||
209 | 290 | ||
210 | extern int xt_register_table(struct xt_table *table, | 291 | extern int xt_register_table(struct xt_table *table, |
211 | struct xt_table_info *bootstrap, | 292 | struct xt_table_info *bootstrap, |
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h new file mode 100644 index 000000000000..a8132ec076fb --- /dev/null +++ b/include/linux/netfilter/xt_policy.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _XT_POLICY_H | ||
2 | #define _XT_POLICY_H | ||
3 | |||
4 | #define XT_POLICY_MAX_ELEM 4 | ||
5 | |||
6 | enum xt_policy_flags | ||
7 | { | ||
8 | XT_POLICY_MATCH_IN = 0x1, | ||
9 | XT_POLICY_MATCH_OUT = 0x2, | ||
10 | XT_POLICY_MATCH_NONE = 0x4, | ||
11 | XT_POLICY_MATCH_STRICT = 0x8, | ||
12 | }; | ||
13 | |||
14 | enum xt_policy_modes | ||
15 | { | ||
16 | XT_POLICY_MODE_TRANSPORT, | ||
17 | XT_POLICY_MODE_TUNNEL | ||
18 | }; | ||
19 | |||
20 | struct xt_policy_spec | ||
21 | { | ||
22 | u_int8_t saddr:1, | ||
23 | daddr:1, | ||
24 | proto:1, | ||
25 | mode:1, | ||
26 | spi:1, | ||
27 | reqid:1; | ||
28 | }; | ||
29 | |||
30 | union xt_policy_addr | ||
31 | { | ||
32 | struct in_addr a4; | ||
33 | struct in6_addr a6; | ||
34 | }; | ||
35 | |||
36 | struct xt_policy_elem | ||
37 | { | ||
38 | union xt_policy_addr saddr; | ||
39 | union xt_policy_addr smask; | ||
40 | union xt_policy_addr daddr; | ||
41 | union xt_policy_addr dmask; | ||
42 | u_int32_t spi; | ||
43 | u_int32_t reqid; | ||
44 | u_int8_t proto; | ||
45 | u_int8_t mode; | ||
46 | |||
47 | struct xt_policy_spec match; | ||
48 | struct xt_policy_spec invert; | ||
49 | }; | ||
50 | |||
51 | struct xt_policy_info | ||
52 | { | ||
53 | struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; | ||
54 | u_int16_t flags; | ||
55 | u_int16_t len; | ||
56 | }; | ||
57 | |||
58 | #endif /* _XT_POLICY_H */ | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index fd21796e5131..62cc27daca4e 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -65,35 +65,8 @@ struct arpt_arp { | |||
65 | u_int16_t invflags; | 65 | u_int16_t invflags; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | struct arpt_entry_target | 68 | #define arpt_entry_target xt_entry_target |
69 | { | 69 | #define arpt_standard_target xt_standard_target |
70 | union { | ||
71 | struct { | ||
72 | u_int16_t target_size; | ||
73 | |||
74 | /* Used by userspace */ | ||
75 | char name[ARPT_FUNCTION_MAXNAMELEN-1]; | ||
76 | u_int8_t revision; | ||
77 | } user; | ||
78 | struct { | ||
79 | u_int16_t target_size; | ||
80 | |||
81 | /* Used inside the kernel */ | ||
82 | struct arpt_target *target; | ||
83 | } kernel; | ||
84 | |||
85 | /* Total length */ | ||
86 | u_int16_t target_size; | ||
87 | } u; | ||
88 | |||
89 | unsigned char data[0]; | ||
90 | }; | ||
91 | |||
92 | struct arpt_standard_target | ||
93 | { | ||
94 | struct arpt_entry_target target; | ||
95 | int verdict; | ||
96 | }; | ||
97 | 70 | ||
98 | /* Values for "flag" field in struct arpt_ip (general arp structure). | 71 | /* Values for "flag" field in struct arpt_ip (general arp structure). |
99 | * No flags defined yet. | 72 | * No flags defined yet. |
@@ -263,8 +236,10 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
263 | */ | 236 | */ |
264 | #ifdef __KERNEL__ | 237 | #ifdef __KERNEL__ |
265 | 238 | ||
266 | #define arpt_register_target(tgt) xt_register_target(NF_ARP, tgt) | 239 | #define arpt_register_target(tgt) \ |
267 | #define arpt_unregister_target(tgt) xt_unregister_target(NF_ARP, tgt) | 240 | ({ (tgt)->family = NF_ARP; \ |
241 | xt_register_target(tgt); }) | ||
242 | #define arpt_unregister_target(tgt) xt_unregister_target(tgt) | ||
268 | 243 | ||
269 | extern int arpt_register_table(struct arpt_table *table, | 244 | extern int arpt_register_table(struct arpt_table *table, |
270 | const struct arpt_replace *repl); | 245 | const struct arpt_replace *repl); |
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h index de4d397865ce..a75b84bb9a88 100644 --- a/include/linux/netfilter_bridge.h +++ b/include/linux/netfilter_bridge.h | |||
@@ -47,22 +47,6 @@ enum nf_br_hook_priorities { | |||
47 | #define BRNF_BRIDGED 0x08 | 47 | #define BRNF_BRIDGED 0x08 |
48 | #define BRNF_NF_BRIDGE_PREROUTING 0x10 | 48 | #define BRNF_NF_BRIDGE_PREROUTING 0x10 |
49 | 49 | ||
50 | static inline | ||
51 | struct nf_bridge_info *nf_bridge_alloc(struct sk_buff *skb) | ||
52 | { | ||
53 | struct nf_bridge_info **nf_bridge = &(skb->nf_bridge); | ||
54 | |||
55 | if ((*nf_bridge = kmalloc(sizeof(**nf_bridge), GFP_ATOMIC)) != NULL) { | ||
56 | atomic_set(&(*nf_bridge)->use, 1); | ||
57 | (*nf_bridge)->mask = 0; | ||
58 | (*nf_bridge)->physindev = (*nf_bridge)->physoutdev = NULL; | ||
59 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | ||
60 | (*nf_bridge)->netoutdev = NULL; | ||
61 | #endif | ||
62 | } | ||
63 | |||
64 | return *nf_bridge; | ||
65 | } | ||
66 | 50 | ||
67 | /* Only used in br_forward.c */ | 51 | /* Only used in br_forward.c */ |
68 | static inline | 52 | static inline |
@@ -77,17 +61,6 @@ void nf_bridge_maybe_copy_header(struct sk_buff *skb) | |||
77 | } | 61 | } |
78 | } | 62 | } |
79 | 63 | ||
80 | static inline | ||
81 | void nf_bridge_save_header(struct sk_buff *skb) | ||
82 | { | ||
83 | int header_size = 16; | ||
84 | |||
85 | if (skb->protocol == __constant_htons(ETH_P_8021Q)) | ||
86 | header_size = 18; | ||
87 | |||
88 | memcpy(skb->nf_bridge->data, skb->data - header_size, header_size); | ||
89 | } | ||
90 | |||
91 | /* This is called by the IP fragmenting code and it ensures there is | 64 | /* This is called by the IP fragmenting code and it ensures there is |
92 | * enough room for the encapsulating header (if there is one). */ | 65 | * enough room for the encapsulating header (if there is one). */ |
93 | static inline | 66 | static inline |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 215765f043e6..f32d75c4f4cf 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -29,6 +29,7 @@ union ip_conntrack_expect_proto { | |||
29 | }; | 29 | }; |
30 | 30 | ||
31 | /* Add protocol helper include file here */ | 31 | /* Add protocol helper include file here */ |
32 | #include <linux/netfilter_ipv4/ip_conntrack_h323.h> | ||
32 | #include <linux/netfilter_ipv4/ip_conntrack_pptp.h> | 33 | #include <linux/netfilter_ipv4/ip_conntrack_pptp.h> |
33 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> | 34 | #include <linux/netfilter_ipv4/ip_conntrack_amanda.h> |
34 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> | 35 | #include <linux/netfilter_ipv4/ip_conntrack_ftp.h> |
@@ -37,6 +38,7 @@ union ip_conntrack_expect_proto { | |||
37 | /* per conntrack: application helper private data */ | 38 | /* per conntrack: application helper private data */ |
38 | union ip_conntrack_help { | 39 | union ip_conntrack_help { |
39 | /* insert conntrack helper private data (master) here */ | 40 | /* insert conntrack helper private data (master) here */ |
41 | struct ip_ct_h323_master ct_h323_info; | ||
40 | struct ip_ct_pptp_master ct_pptp_info; | 42 | struct ip_ct_pptp_master ct_pptp_info; |
41 | struct ip_ct_ftp_master ct_ftp_info; | 43 | struct ip_ct_ftp_master ct_ftp_info; |
42 | struct ip_ct_irc_master ct_irc_info; | 44 | struct ip_ct_irc_master ct_irc_info; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h new file mode 100644 index 000000000000..0987cea53840 --- /dev/null +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
@@ -0,0 +1,30 @@ | |||
1 | #ifndef _IP_CONNTRACK_H323_H | ||
2 | #define _IP_CONNTRACK_H323_H | ||
3 | |||
4 | #ifdef __KERNEL__ | ||
5 | |||
6 | #define RAS_PORT 1719 | ||
7 | #define Q931_PORT 1720 | ||
8 | #define H323_RTP_CHANNEL_MAX 4 /* Audio, video, FAX and other */ | ||
9 | |||
10 | /* This structure exists only once per master */ | ||
11 | struct ip_ct_h323_master { | ||
12 | |||
13 | /* Original and NATed Q.931 or H.245 signal ports */ | ||
14 | u_int16_t sig_port[IP_CT_DIR_MAX]; | ||
15 | |||
16 | /* Original and NATed RTP ports */ | ||
17 | u_int16_t rtp_port[H323_RTP_CHANNEL_MAX][IP_CT_DIR_MAX]; | ||
18 | |||
19 | union { | ||
20 | /* RAS connection timeout */ | ||
21 | u_int32_t timeout; | ||
22 | |||
23 | /* Next TPKT length (for separate TPKT header and data) */ | ||
24 | u_int16_t tpkt_len[IP_CT_DIR_MAX]; | ||
25 | }; | ||
26 | }; | ||
27 | |||
28 | #endif | ||
29 | |||
30 | #endif | ||
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 41a107de17cf..e9f5ed1d9f68 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -23,7 +23,7 @@ struct ip_nat_seq { | |||
23 | * modification (if any) */ | 23 | * modification (if any) */ |
24 | u_int32_t correction_pos; | 24 | u_int32_t correction_pos; |
25 | /* sequence number offset before and after last modification */ | 25 | /* sequence number offset before and after last modification */ |
26 | int32_t offset_before, offset_after; | 26 | int16_t offset_before, offset_after; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* Single range specification. */ | 29 | /* Single range specification. */ |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 76ba24b68515..d5b8c0d6a12b 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -52,61 +52,9 @@ struct ipt_ip { | |||
52 | u_int8_t invflags; | 52 | u_int8_t invflags; |
53 | }; | 53 | }; |
54 | 54 | ||
55 | struct ipt_entry_match | 55 | #define ipt_entry_match xt_entry_match |
56 | { | 56 | #define ipt_entry_target xt_entry_target |
57 | union { | 57 | #define ipt_standard_target xt_standard_target |
58 | struct { | ||
59 | u_int16_t match_size; | ||
60 | |||
61 | /* Used by userspace */ | ||
62 | char name[IPT_FUNCTION_MAXNAMELEN-1]; | ||
63 | |||
64 | u_int8_t revision; | ||
65 | } user; | ||
66 | struct { | ||
67 | u_int16_t match_size; | ||
68 | |||
69 | /* Used inside the kernel */ | ||
70 | struct ipt_match *match; | ||
71 | } kernel; | ||
72 | |||
73 | /* Total length */ | ||
74 | u_int16_t match_size; | ||
75 | } u; | ||
76 | |||
77 | unsigned char data[0]; | ||
78 | }; | ||
79 | |||
80 | struct ipt_entry_target | ||
81 | { | ||
82 | union { | ||
83 | struct { | ||
84 | u_int16_t target_size; | ||
85 | |||
86 | /* Used by userspace */ | ||
87 | char name[IPT_FUNCTION_MAXNAMELEN-1]; | ||
88 | |||
89 | u_int8_t revision; | ||
90 | } user; | ||
91 | struct { | ||
92 | u_int16_t target_size; | ||
93 | |||
94 | /* Used inside the kernel */ | ||
95 | struct ipt_target *target; | ||
96 | } kernel; | ||
97 | |||
98 | /* Total length */ | ||
99 | u_int16_t target_size; | ||
100 | } u; | ||
101 | |||
102 | unsigned char data[0]; | ||
103 | }; | ||
104 | |||
105 | struct ipt_standard_target | ||
106 | { | ||
107 | struct ipt_entry_target target; | ||
108 | int verdict; | ||
109 | }; | ||
110 | 58 | ||
111 | #define ipt_counters xt_counters | 59 | #define ipt_counters xt_counters |
112 | 60 | ||
@@ -321,11 +269,15 @@ ipt_get_target(struct ipt_entry *e) | |||
321 | #include <linux/init.h> | 269 | #include <linux/init.h> |
322 | extern void ipt_init(void) __init; | 270 | extern void ipt_init(void) __init; |
323 | 271 | ||
324 | #define ipt_register_target(tgt) xt_register_target(AF_INET, tgt) | 272 | #define ipt_register_target(tgt) \ |
325 | #define ipt_unregister_target(tgt) xt_unregister_target(AF_INET, tgt) | 273 | ({ (tgt)->family = AF_INET; \ |
274 | xt_register_target(tgt); }) | ||
275 | #define ipt_unregister_target(tgt) xt_unregister_target(tgt) | ||
326 | 276 | ||
327 | #define ipt_register_match(mtch) xt_register_match(AF_INET, mtch) | 277 | #define ipt_register_match(mtch) \ |
328 | #define ipt_unregister_match(mtch) xt_unregister_match(AF_INET, mtch) | 278 | ({ (mtch)->family = AF_INET; \ |
279 | xt_register_match(mtch); }) | ||
280 | #define ipt_unregister_match(mtch) xt_unregister_match(mtch) | ||
329 | 281 | ||
330 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) | 282 | //#define ipt_register_table(tbl, repl) xt_register_table(AF_INET, tbl, repl) |
331 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) | 283 | //#define ipt_unregister_table(tbl) xt_unregister_table(AF_INET, tbl) |
diff --git a/include/linux/netfilter_ipv4/ipt_policy.h b/include/linux/netfilter_ipv4/ipt_policy.h index a3f6eff39d33..b9478a255301 100644 --- a/include/linux/netfilter_ipv4/ipt_policy.h +++ b/include/linux/netfilter_ipv4/ipt_policy.h | |||
@@ -1,58 +1,21 @@ | |||
1 | #ifndef _IPT_POLICY_H | 1 | #ifndef _IPT_POLICY_H |
2 | #define _IPT_POLICY_H | 2 | #define _IPT_POLICY_H |
3 | 3 | ||
4 | #define IPT_POLICY_MAX_ELEM 4 | 4 | #define IPT_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 5 | ||
6 | enum ipt_policy_flags | 6 | /* ipt_policy_flags */ |
7 | { | 7 | #define IPT_POLICY_MATCH_IN XT_POLICY_MATCH_IN |
8 | IPT_POLICY_MATCH_IN = 0x1, | 8 | #define IPT_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT |
9 | IPT_POLICY_MATCH_OUT = 0x2, | 9 | #define IPT_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE |
10 | IPT_POLICY_MATCH_NONE = 0x4, | 10 | #define IPT_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT |
11 | IPT_POLICY_MATCH_STRICT = 0x8, | 11 | |
12 | }; | 12 | /* ipt_policy_modes */ |
13 | 13 | #define IPT_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | |
14 | enum ipt_policy_modes | 14 | #define IPT_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL |
15 | { | 15 | |
16 | IPT_POLICY_MODE_TRANSPORT, | 16 | #define ipt_policy_spec xt_policy_spec |
17 | IPT_POLICY_MODE_TUNNEL | 17 | #define ipt_policy_addr xt_policy_addr |
18 | }; | 18 | #define ipt_policy_elem xt_policy_elem |
19 | 19 | #define ipt_policy_info xt_policy_info | |
20 | struct ipt_policy_spec | ||
21 | { | ||
22 | u_int8_t saddr:1, | ||
23 | daddr:1, | ||
24 | proto:1, | ||
25 | mode:1, | ||
26 | spi:1, | ||
27 | reqid:1; | ||
28 | }; | ||
29 | |||
30 | union ipt_policy_addr | ||
31 | { | ||
32 | struct in_addr a4; | ||
33 | struct in6_addr a6; | ||
34 | }; | ||
35 | |||
36 | struct ipt_policy_elem | ||
37 | { | ||
38 | union ipt_policy_addr saddr; | ||
39 | union ipt_policy_addr smask; | ||
40 | union ipt_policy_addr daddr; | ||
41 | union ipt_policy_addr dmask; | ||
42 | u_int32_t spi; | ||
43 | u_int32_t reqid; | ||
44 | u_int8_t proto; | ||
45 | u_int8_t mode; | ||
46 | |||
47 | struct ipt_policy_spec match; | ||
48 | struct ipt_policy_spec invert; | ||
49 | }; | ||
50 | |||
51 | struct ipt_policy_info | ||
52 | { | ||
53 | struct ipt_policy_elem pol[IPT_POLICY_MAX_ELEM]; | ||
54 | u_int16_t flags; | ||
55 | u_int16_t len; | ||
56 | }; | ||
57 | 20 | ||
58 | #endif /* _IPT_POLICY_H */ | 21 | #endif /* _IPT_POLICY_H */ |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index f249b574f0fa..d0d5d1ee4be3 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -56,60 +56,9 @@ struct ip6t_ip6 { | |||
56 | u_int8_t invflags; | 56 | u_int8_t invflags; |
57 | }; | 57 | }; |
58 | 58 | ||
59 | /* FIXME: If alignment in kernel different from userspace? --RR */ | 59 | #define ip6t_entry_match xt_entry_match |
60 | struct ip6t_entry_match | 60 | #define ip6t_entry_target xt_entry_target |
61 | { | 61 | #define ip6t_standard_target xt_standard_target |
62 | union { | ||
63 | struct { | ||
64 | u_int16_t match_size; | ||
65 | |||
66 | /* Used by userspace */ | ||
67 | char name[IP6T_FUNCTION_MAXNAMELEN-1]; | ||
68 | u_int8_t revision; | ||
69 | } user; | ||
70 | struct { | ||
71 | u_int16_t match_size; | ||
72 | |||
73 | /* Used inside the kernel */ | ||
74 | struct ip6t_match *match; | ||
75 | } kernel; | ||
76 | |||
77 | /* Total length */ | ||
78 | u_int16_t match_size; | ||
79 | } u; | ||
80 | |||
81 | unsigned char data[0]; | ||
82 | }; | ||
83 | |||
84 | struct ip6t_entry_target | ||
85 | { | ||
86 | union { | ||
87 | struct { | ||
88 | u_int16_t target_size; | ||
89 | |||
90 | /* Used by userspace */ | ||
91 | char name[IP6T_FUNCTION_MAXNAMELEN-1]; | ||
92 | u_int8_t revision; | ||
93 | } user; | ||
94 | struct { | ||
95 | u_int16_t target_size; | ||
96 | |||
97 | /* Used inside the kernel */ | ||
98 | struct ip6t_target *target; | ||
99 | } kernel; | ||
100 | |||
101 | /* Total length */ | ||
102 | u_int16_t target_size; | ||
103 | } u; | ||
104 | |||
105 | unsigned char data[0]; | ||
106 | }; | ||
107 | |||
108 | struct ip6t_standard_target | ||
109 | { | ||
110 | struct ip6t_entry_target target; | ||
111 | int verdict; | ||
112 | }; | ||
113 | 62 | ||
114 | #define ip6t_counters xt_counters | 63 | #define ip6t_counters xt_counters |
115 | 64 | ||
@@ -334,11 +283,15 @@ ip6t_get_target(struct ip6t_entry *e) | |||
334 | #include <linux/init.h> | 283 | #include <linux/init.h> |
335 | extern void ip6t_init(void) __init; | 284 | extern void ip6t_init(void) __init; |
336 | 285 | ||
337 | #define ip6t_register_target(tgt) xt_register_target(AF_INET6, tgt) | 286 | #define ip6t_register_target(tgt) \ |
338 | #define ip6t_unregister_target(tgt) xt_unregister_target(AF_INET6, tgt) | 287 | ({ (tgt)->family = AF_INET6; \ |
288 | xt_register_target(tgt); }) | ||
289 | #define ip6t_unregister_target(tgt) xt_unregister_target(tgt) | ||
339 | 290 | ||
340 | #define ip6t_register_match(match) xt_register_match(AF_INET6, match) | 291 | #define ip6t_register_match(match) \ |
341 | #define ip6t_unregister_match(match) xt_unregister_match(AF_INET6, match) | 292 | ({ (match)->family = AF_INET6; \ |
293 | xt_register_match(match); }) | ||
294 | #define ip6t_unregister_match(match) xt_unregister_match(match) | ||
342 | 295 | ||
343 | extern int ip6t_register_table(struct ip6t_table *table, | 296 | extern int ip6t_register_table(struct ip6t_table *table, |
344 | const struct ip6t_replace *repl); | 297 | const struct ip6t_replace *repl); |
diff --git a/include/linux/netfilter_ipv6/ip6t_policy.h b/include/linux/netfilter_ipv6/ip6t_policy.h index 671bd818300f..6bab3163d2fb 100644 --- a/include/linux/netfilter_ipv6/ip6t_policy.h +++ b/include/linux/netfilter_ipv6/ip6t_policy.h | |||
@@ -1,58 +1,21 @@ | |||
1 | #ifndef _IP6T_POLICY_H | 1 | #ifndef _IP6T_POLICY_H |
2 | #define _IP6T_POLICY_H | 2 | #define _IP6T_POLICY_H |
3 | 3 | ||
4 | #define IP6T_POLICY_MAX_ELEM 4 | 4 | #define IP6T_POLICY_MAX_ELEM XT_POLICY_MAX_ELEM |
5 | 5 | ||
6 | enum ip6t_policy_flags | 6 | /* ip6t_policy_flags */ |
7 | { | 7 | #define IP6T_POLICY_MATCH_IN XT_POLICY_MATCH_IN |
8 | IP6T_POLICY_MATCH_IN = 0x1, | 8 | #define IP6T_POLICY_MATCH_OUT XT_POLICY_MATCH_OUT |
9 | IP6T_POLICY_MATCH_OUT = 0x2, | 9 | #define IP6T_POLICY_MATCH_NONE XT_POLICY_MATCH_NONE |
10 | IP6T_POLICY_MATCH_NONE = 0x4, | 10 | #define IP6T_POLICY_MATCH_STRICT XT_POLICY_MATCH_STRICT |
11 | IP6T_POLICY_MATCH_STRICT = 0x8, | 11 | |
12 | }; | 12 | /* ip6t_policy_modes */ |
13 | 13 | #define IP6T_POLICY_MODE_TRANSPORT XT_POLICY_MODE_TRANSPORT | |
14 | enum ip6t_policy_modes | 14 | #define IP6T_POLICY_MODE_TUNNEL XT_POLICY_MODE_TUNNEL |
15 | { | 15 | |
16 | IP6T_POLICY_MODE_TRANSPORT, | 16 | #define ip6t_policy_spec xt_policy_spec |
17 | IP6T_POLICY_MODE_TUNNEL | 17 | #define ip6t_policy_addr xt_policy_addr |
18 | }; | 18 | #define ip6t_policy_elem xt_policy_elem |
19 | 19 | #define ip6t_policy_info xt_policy_info | |
20 | struct ip6t_policy_spec | ||
21 | { | ||
22 | u_int8_t saddr:1, | ||
23 | daddr:1, | ||
24 | proto:1, | ||
25 | mode:1, | ||
26 | spi:1, | ||
27 | reqid:1; | ||
28 | }; | ||
29 | |||
30 | union ip6t_policy_addr | ||
31 | { | ||
32 | struct in_addr a4; | ||
33 | struct in6_addr a6; | ||
34 | }; | ||
35 | |||
36 | struct ip6t_policy_elem | ||
37 | { | ||
38 | union ip6t_policy_addr saddr; | ||
39 | union ip6t_policy_addr smask; | ||
40 | union ip6t_policy_addr daddr; | ||
41 | union ip6t_policy_addr dmask; | ||
42 | u_int32_t spi; | ||
43 | u_int32_t reqid; | ||
44 | u_int8_t proto; | ||
45 | u_int8_t mode; | ||
46 | |||
47 | struct ip6t_policy_spec match; | ||
48 | struct ip6t_policy_spec invert; | ||
49 | }; | ||
50 | |||
51 | struct ip6t_policy_info | ||
52 | { | ||
53 | struct ip6t_policy_elem pol[IP6T_POLICY_MAX_ELEM]; | ||
54 | u_int16_t flags; | ||
55 | u_int16_t len; | ||
56 | }; | ||
57 | 20 | ||
58 | #endif /* _IP6T_POLICY_H */ | 21 | #endif /* _IP6T_POLICY_H */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index c256ebe2a7b4..f8f3d1c927f8 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -151,6 +151,7 @@ struct netlink_skb_parms | |||
151 | 151 | ||
152 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); | 152 | extern struct sock *netlink_kernel_create(int unit, unsigned int groups, void (*input)(struct sock *sk, int len), struct module *module); |
153 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); | 153 | extern void netlink_ack(struct sk_buff *in_skb, struct nlmsghdr *nlh, int err); |
154 | extern int netlink_has_listeners(struct sock *sk, unsigned int group); | ||
154 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 155 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
155 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 156 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
156 | __u32 group, gfp_t allocation); | 157 | __u32 group, gfp_t allocation); |
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index d52999c43336..9ea629c02a4b 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -86,8 +86,9 @@ | |||
86 | * - The __xxx_page_state variants can be used safely when interrupts are | 86 | * - The __xxx_page_state variants can be used safely when interrupts are |
87 | * disabled. | 87 | * disabled. |
88 | * - The __xxx_page_state variants can be used if the field is only | 88 | * - The __xxx_page_state variants can be used if the field is only |
89 | * modified from process context, or only modified from interrupt context. | 89 | * modified from process context and protected from preemption, or only |
90 | * In this case, the field should be commented here. | 90 | * modified from interrupt context. In this case, the field should be |
91 | * commented here. | ||
91 | */ | 92 | */ |
92 | struct page_state { | 93 | struct page_state { |
93 | unsigned long nr_dirty; /* Dirty writeable pages */ | 94 | unsigned long nr_dirty; /* Dirty writeable pages */ |
@@ -239,22 +240,19 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
239 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) | 240 | #define __ClearPageDirty(page) __clear_bit(PG_dirty, &(page)->flags) |
240 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) | 241 | #define TestClearPageDirty(page) test_and_clear_bit(PG_dirty, &(page)->flags) |
241 | 242 | ||
242 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) | ||
243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) | 243 | #define PageLRU(page) test_bit(PG_lru, &(page)->flags) |
244 | #define TestSetPageLRU(page) test_and_set_bit(PG_lru, &(page)->flags) | 244 | #define SetPageLRU(page) set_bit(PG_lru, &(page)->flags) |
245 | #define TestClearPageLRU(page) test_and_clear_bit(PG_lru, &(page)->flags) | 245 | #define ClearPageLRU(page) clear_bit(PG_lru, &(page)->flags) |
246 | #define __ClearPageLRU(page) __clear_bit(PG_lru, &(page)->flags) | ||
246 | 247 | ||
247 | #define PageActive(page) test_bit(PG_active, &(page)->flags) | 248 | #define PageActive(page) test_bit(PG_active, &(page)->flags) |
248 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) | 249 | #define SetPageActive(page) set_bit(PG_active, &(page)->flags) |
249 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) | 250 | #define ClearPageActive(page) clear_bit(PG_active, &(page)->flags) |
250 | #define TestClearPageActive(page) test_and_clear_bit(PG_active, &(page)->flags) | 251 | #define __ClearPageActive(page) __clear_bit(PG_active, &(page)->flags) |
251 | #define TestSetPageActive(page) test_and_set_bit(PG_active, &(page)->flags) | ||
252 | 252 | ||
253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) | 253 | #define PageSlab(page) test_bit(PG_slab, &(page)->flags) |
254 | #define SetPageSlab(page) set_bit(PG_slab, &(page)->flags) | 254 | #define __SetPageSlab(page) __set_bit(PG_slab, &(page)->flags) |
255 | #define ClearPageSlab(page) clear_bit(PG_slab, &(page)->flags) | 255 | #define __ClearPageSlab(page) __clear_bit(PG_slab, &(page)->flags) |
256 | #define TestClearPageSlab(page) test_and_clear_bit(PG_slab, &(page)->flags) | ||
257 | #define TestSetPageSlab(page) test_and_set_bit(PG_slab, &(page)->flags) | ||
258 | 256 | ||
259 | #ifdef CONFIG_HIGHMEM | 257 | #ifdef CONFIG_HIGHMEM |
260 | #define PageHighMem(page) is_highmem(page_zone(page)) | 258 | #define PageHighMem(page) is_highmem(page_zone(page)) |
@@ -329,8 +327,8 @@ extern void __mod_page_state_offset(unsigned long offset, unsigned long delta); | |||
329 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) | 327 | #define TestClearPageReclaim(page) test_and_clear_bit(PG_reclaim, &(page)->flags) |
330 | 328 | ||
331 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) | 329 | #define PageCompound(page) test_bit(PG_compound, &(page)->flags) |
332 | #define SetPageCompound(page) set_bit(PG_compound, &(page)->flags) | 330 | #define __SetPageCompound(page) __set_bit(PG_compound, &(page)->flags) |
333 | #define ClearPageCompound(page) clear_bit(PG_compound, &(page)->flags) | 331 | #define __ClearPageCompound(page) __clear_bit(PG_compound, &(page)->flags) |
334 | 332 | ||
335 | #ifdef CONFIG_SWAP | 333 | #ifdef CONFIG_SWAP |
336 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) | 334 | #define PageSwapCache(page) test_bit(PG_swapcache, &(page)->flags) |
diff --git a/include/linux/pci.h b/include/linux/pci.h index fe1a2b02fc55..0aad5a378e95 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -95,6 +95,11 @@ enum pci_channel_state { | |||
95 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, | 95 | pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, |
96 | }; | 96 | }; |
97 | 97 | ||
98 | typedef unsigned short __bitwise pci_bus_flags_t; | ||
99 | enum pci_bus_flags { | ||
100 | PCI_BUS_FLAGS_NO_MSI = (pci_bus_flags_t) 1, | ||
101 | }; | ||
102 | |||
98 | /* | 103 | /* |
99 | * The pci_dev structure is used to describe PCI devices. | 104 | * The pci_dev structure is used to describe PCI devices. |
100 | */ | 105 | */ |
@@ -203,7 +208,7 @@ struct pci_bus { | |||
203 | char name[48]; | 208 | char name[48]; |
204 | 209 | ||
205 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ | 210 | unsigned short bridge_ctl; /* manage NO_ISA/FBB/et al behaviors */ |
206 | unsigned short pad2; | 211 | pci_bus_flags_t bus_flags; /* Inherited by child busses */ |
207 | struct device *bridge; | 212 | struct device *bridge; |
208 | struct class_device class_dev; | 213 | struct class_device class_dev; |
209 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ | 214 | struct bin_attribute *legacy_io; /* legacy I/O for this bus */ |
@@ -485,9 +490,9 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *); | |||
485 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 490 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
486 | int (*)(struct pci_dev *, u8, u8)); | 491 | int (*)(struct pci_dev *, u8, u8)); |
487 | #define HAVE_PCI_REQ_REGIONS 2 | 492 | #define HAVE_PCI_REQ_REGIONS 2 |
488 | int pci_request_regions(struct pci_dev *, char *); | 493 | int pci_request_regions(struct pci_dev *, const char *); |
489 | void pci_release_regions(struct pci_dev *); | 494 | void pci_release_regions(struct pci_dev *); |
490 | int pci_request_region(struct pci_dev *, int, char *); | 495 | int pci_request_region(struct pci_dev *, int, const char *); |
491 | void pci_release_region(struct pci_dev *, int); | 496 | void pci_release_region(struct pci_dev *, int); |
492 | 497 | ||
493 | /* drivers/pci/bus.c */ | 498 | /* drivers/pci/bus.c */ |
@@ -516,6 +521,7 @@ int pci_scan_bridge(struct pci_bus *bus, struct pci_dev * dev, int max, int pass | |||
516 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | 521 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), |
517 | void *userdata); | 522 | void *userdata); |
518 | int pci_cfg_space_size(struct pci_dev *dev); | 523 | int pci_cfg_space_size(struct pci_dev *dev); |
524 | unsigned char pci_bus_max_busnr(struct pci_bus* bus); | ||
519 | 525 | ||
520 | /* kmem_cache style wrapper around pci_alloc_consistent() */ | 526 | /* kmem_cache style wrapper around pci_alloc_consistent() */ |
521 | 527 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 751eea58bde8..f3dcf89d5232 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -852,6 +852,8 @@ | |||
852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 | 852 | #define PCI_DEVICE_ID_QLOGIC_ISP2432 0x2432 |
853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 | 853 | #define PCI_DEVICE_ID_QLOGIC_ISP2512 0x2512 |
854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 | 854 | #define PCI_DEVICE_ID_QLOGIC_ISP2522 0x2522 |
855 | #define PCI_DEVICE_ID_QLOGIC_ISP5422 0x5422 | ||
856 | #define PCI_DEVICE_ID_QLOGIC_ISP5432 0x5432 | ||
855 | 857 | ||
856 | #define PCI_VENDOR_ID_CYRIX 0x1078 | 858 | #define PCI_VENDOR_ID_CYRIX 0x1078 |
857 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 | 859 | #define PCI_DEVICE_ID_CYRIX_5510 0x0000 |
@@ -1369,6 +1371,7 @@ | |||
1369 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1371 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
1370 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1372 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
1371 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 | 1373 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 |
1374 | #define PCI_DEVICE_ID_SERVERWORKS_HT1000SB 0x0205 | ||
1372 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 | 1375 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4IDE 0x0211 |
1373 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 | 1376 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5IDE 0x0212 |
1374 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 | 1377 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6IDE 0x0213 |
@@ -1857,16 +1860,24 @@ | |||
1857 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d | 1860 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d |
1858 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e | 1861 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e |
1859 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 | 1862 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 |
1863 | #define PCI_DEVICE_ID_TIGON3_5714S 0x1669 | ||
1860 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a | 1864 | #define PCI_DEVICE_ID_TIGON3_5780 0x166a |
1861 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b | 1865 | #define PCI_DEVICE_ID_TIGON3_5780S 0x166b |
1862 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1866 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
1867 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | ||
1868 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | ||
1863 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1869 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
1864 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1870 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
1865 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 1871 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
1872 | #define PCI_DEVICE_ID_TIGON3_5715S 0x1679 | ||
1873 | #define PCI_DEVICE_ID_TIGON3_5754 0x167a | ||
1874 | #define PCI_DEVICE_ID_TIGON3_5755 0x167b | ||
1866 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c | 1875 | #define PCI_DEVICE_ID_TIGON3_5750M 0x167c |
1867 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d | 1876 | #define PCI_DEVICE_ID_TIGON3_5751M 0x167d |
1868 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e | 1877 | #define PCI_DEVICE_ID_TIGON3_5751F 0x167e |
1878 | #define PCI_DEVICE_ID_TIGON3_5787M 0x1693 | ||
1869 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 | 1879 | #define PCI_DEVICE_ID_TIGON3_5782 0x1696 |
1880 | #define PCI_DEVICE_ID_TIGON3_5787 0x169b | ||
1870 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c | 1881 | #define PCI_DEVICE_ID_TIGON3_5788 0x169c |
1871 | #define PCI_DEVICE_ID_TIGON3_5789 0x169d | 1882 | #define PCI_DEVICE_ID_TIGON3_5789 0x169d |
1872 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 | 1883 | #define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 5be87ba3b7ac..6df2585c0169 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -188,6 +188,8 @@ extern void device_power_up(void); | |||
188 | extern void device_resume(void); | 188 | extern void device_resume(void); |
189 | 189 | ||
190 | #ifdef CONFIG_PM | 190 | #ifdef CONFIG_PM |
191 | extern suspend_disk_method_t pm_disk_mode; | ||
192 | |||
191 | extern int device_suspend(pm_message_t state); | 193 | extern int device_suspend(pm_message_t state); |
192 | 194 | ||
193 | #define device_set_wakeup_enable(dev,val) \ | 195 | #define device_set_wakeup_enable(dev,val) \ |
@@ -215,7 +217,6 @@ static inline int dpm_runtime_suspend(struct device * dev, pm_message_t state) | |||
215 | 217 | ||
216 | static inline void dpm_runtime_resume(struct device * dev) | 218 | static inline void dpm_runtime_resume(struct device * dev) |
217 | { | 219 | { |
218 | |||
219 | } | 220 | } |
220 | 221 | ||
221 | #endif | 222 | #endif |
diff --git a/include/linux/profile.h b/include/linux/profile.h index 026969a5595c..1f2fea6640a4 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -14,6 +14,7 @@ | |||
14 | 14 | ||
15 | struct proc_dir_entry; | 15 | struct proc_dir_entry; |
16 | struct pt_regs; | 16 | struct pt_regs; |
17 | struct notifier_block; | ||
17 | 18 | ||
18 | /* init basic kernel profiler */ | 19 | /* init basic kernel profiler */ |
19 | void __init profile_init(void); | 20 | void __init profile_init(void); |
@@ -32,7 +33,6 @@ enum profile_type { | |||
32 | 33 | ||
33 | #ifdef CONFIG_PROFILING | 34 | #ifdef CONFIG_PROFILING |
34 | 35 | ||
35 | struct notifier_block; | ||
36 | struct task_struct; | 36 | struct task_struct; |
37 | struct mm_struct; | 37 | struct mm_struct; |
38 | 38 | ||
diff --git a/include/linux/quota.h b/include/linux/quota.h index f33aeb22c26a..8dc2d04a103f 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <linux/errno.h> | 38 | #include <linux/errno.h> |
39 | #include <linux/types.h> | 39 | #include <linux/types.h> |
40 | #include <linux/spinlock.h> | 40 | #include <linux/spinlock.h> |
41 | #include <linux/mutex.h> | ||
41 | 42 | ||
42 | #define __DQUOT_VERSION__ "dquot_6.5.1" | 43 | #define __DQUOT_VERSION__ "dquot_6.5.1" |
43 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 | 44 | #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 |
@@ -215,7 +216,7 @@ struct dquot { | |||
215 | struct list_head dq_inuse; /* List of all quotas */ | 216 | struct list_head dq_inuse; /* List of all quotas */ |
216 | struct list_head dq_free; /* Free list element */ | 217 | struct list_head dq_free; /* Free list element */ |
217 | struct list_head dq_dirty; /* List of dirty dquots */ | 218 | struct list_head dq_dirty; /* List of dirty dquots */ |
218 | struct semaphore dq_lock; /* dquot IO lock */ | 219 | struct mutex dq_lock; /* dquot IO lock */ |
219 | atomic_t dq_count; /* Use count */ | 220 | atomic_t dq_count; /* Use count */ |
220 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ | 221 | wait_queue_head_t dq_wait_unused; /* Wait queue for dquot to become unused */ |
221 | struct super_block *dq_sb; /* superblock this applies to */ | 222 | struct super_block *dq_sb; /* superblock this applies to */ |
@@ -285,8 +286,8 @@ struct quota_format_type { | |||
285 | 286 | ||
286 | struct quota_info { | 287 | struct quota_info { |
287 | unsigned int flags; /* Flags for diskquotas on this device */ | 288 | unsigned int flags; /* Flags for diskquotas on this device */ |
288 | struct semaphore dqio_sem; /* lock device while I/O in progress */ | 289 | struct mutex dqio_mutex; /* lock device while I/O in progress */ |
289 | struct semaphore dqonoff_sem; /* Serialize quotaon & quotaoff */ | 290 | struct mutex dqonoff_mutex; /* Serialize quotaon & quotaoff */ |
290 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ | 291 | struct rw_semaphore dqptr_sem; /* serialize ops using quota_info struct, pointers from inode to dquots */ |
291 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ | 292 | struct inode *files[MAXQUOTAS]; /* inodes of quotafiles */ |
292 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ | 293 | struct mem_dqinfo info[MAXQUOTAS]; /* Information for each quota type */ |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 9d5494aaac0f..3009c813d83d 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -130,6 +130,6 @@ struct r1bio_s { | |||
130 | * with failure when last write completes (and all failed). | 130 | * with failure when last write completes (and all failed). |
131 | * Record that bi_end_io was called with this flag... | 131 | * Record that bi_end_io was called with this flag... |
132 | */ | 132 | */ |
133 | #define R1BIO_Returned 4 | 133 | #define R1BIO_Returned 6 |
134 | 134 | ||
135 | #endif | 135 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index c2ec6c77874e..5673008b61e1 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -113,8 +113,6 @@ struct rcu_data { | |||
113 | 113 | ||
114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); | 114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); |
115 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); | 115 | DECLARE_PER_CPU(struct rcu_data, rcu_bh_data); |
116 | extern struct rcu_ctrlblk rcu_ctrlblk; | ||
117 | extern struct rcu_ctrlblk rcu_bh_ctrlblk; | ||
118 | 116 | ||
119 | /* | 117 | /* |
120 | * Increment the quiescent state counter. | 118 | * Increment the quiescent state counter. |
diff --git a/include/linux/relay.h b/include/linux/relay.h new file mode 100644 index 000000000000..4bcc1531d6a9 --- /dev/null +++ b/include/linux/relay.h | |||
@@ -0,0 +1,281 @@ | |||
1 | /* | ||
2 | * linux/include/linux/relay.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 | * CONFIG_RELAY definitions and declarations | ||
8 | */ | ||
9 | |||
10 | #ifndef _LINUX_RELAY_H | ||
11 | #define _LINUX_RELAY_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 | /* Needs a _much_ better name... */ | ||
23 | #define FIX_SIZE(x) ((((x) - 1) & PAGE_MASK) + PAGE_SIZE) | ||
24 | |||
25 | /* | ||
26 | * Tracks changes to rchan/rchan_buf structs | ||
27 | */ | ||
28 | #define RELAYFS_CHANNEL_VERSION 6 | ||
29 | |||
30 | /* | ||
31 | * Per-cpu relay channel buffer | ||
32 | */ | ||
33 | struct rchan_buf | ||
34 | { | ||
35 | void *start; /* start of channel buffer */ | ||
36 | void *data; /* start of current sub-buffer */ | ||
37 | size_t offset; /* current offset into sub-buffer */ | ||
38 | size_t subbufs_produced; /* count of sub-buffers produced */ | ||
39 | size_t subbufs_consumed; /* count of sub-buffers consumed */ | ||
40 | struct rchan *chan; /* associated channel */ | ||
41 | wait_queue_head_t read_wait; /* reader wait queue */ | ||
42 | struct work_struct wake_readers; /* reader wake-up work struct */ | ||
43 | struct dentry *dentry; /* channel file dentry */ | ||
44 | struct kref kref; /* channel buffer refcount */ | ||
45 | struct page **page_array; /* array of current buffer pages */ | ||
46 | unsigned int page_count; /* number of current buffer pages */ | ||
47 | unsigned int finalized; /* buffer has been finalized */ | ||
48 | size_t *padding; /* padding counts per sub-buffer */ | ||
49 | size_t prev_padding; /* temporary variable */ | ||
50 | size_t bytes_consumed; /* bytes consumed in cur read subbuf */ | ||
51 | unsigned int cpu; /* this buf's cpu */ | ||
52 | } ____cacheline_aligned; | ||
53 | |||
54 | /* | ||
55 | * Relay channel data structure | ||
56 | */ | ||
57 | struct rchan | ||
58 | { | ||
59 | u32 version; /* the version of this struct */ | ||
60 | size_t subbuf_size; /* sub-buffer size */ | ||
61 | size_t n_subbufs; /* number of sub-buffers per buffer */ | ||
62 | size_t alloc_size; /* total buffer size allocated */ | ||
63 | struct rchan_callbacks *cb; /* client callbacks */ | ||
64 | struct kref kref; /* channel refcount */ | ||
65 | void *private_data; /* for user-defined data */ | ||
66 | size_t last_toobig; /* tried to log event > subbuf size */ | ||
67 | struct rchan_buf *buf[NR_CPUS]; /* per-cpu channel buffers */ | ||
68 | }; | ||
69 | |||
70 | /* | ||
71 | * Relay channel client callbacks | ||
72 | */ | ||
73 | struct rchan_callbacks | ||
74 | { | ||
75 | /* | ||
76 | * subbuf_start - called on buffer-switch to a new sub-buffer | ||
77 | * @buf: the channel buffer containing the new sub-buffer | ||
78 | * @subbuf: the start of the new sub-buffer | ||
79 | * @prev_subbuf: the start of the previous sub-buffer | ||
80 | * @prev_padding: unused space at the end of previous sub-buffer | ||
81 | * | ||
82 | * The client should return 1 to continue logging, 0 to stop | ||
83 | * logging. | ||
84 | * | ||
85 | * NOTE: subbuf_start will also be invoked when the buffer is | ||
86 | * created, so that the first sub-buffer can be initialized | ||
87 | * if necessary. In this case, prev_subbuf will be NULL. | ||
88 | * | ||
89 | * NOTE: the client can reserve bytes at the beginning of the new | ||
90 | * sub-buffer by calling subbuf_start_reserve() in this callback. | ||
91 | */ | ||
92 | int (*subbuf_start) (struct rchan_buf *buf, | ||
93 | void *subbuf, | ||
94 | void *prev_subbuf, | ||
95 | size_t prev_padding); | ||
96 | |||
97 | /* | ||
98 | * buf_mapped - relay buffer mmap notification | ||
99 | * @buf: the channel buffer | ||
100 | * @filp: relay file pointer | ||
101 | * | ||
102 | * Called when a relay file is successfully mmapped | ||
103 | */ | ||
104 | void (*buf_mapped)(struct rchan_buf *buf, | ||
105 | struct file *filp); | ||
106 | |||
107 | /* | ||
108 | * buf_unmapped - relay buffer unmap notification | ||
109 | * @buf: the channel buffer | ||
110 | * @filp: relay file pointer | ||
111 | * | ||
112 | * Called when a relay file is successfully unmapped | ||
113 | */ | ||
114 | void (*buf_unmapped)(struct rchan_buf *buf, | ||
115 | struct file *filp); | ||
116 | /* | ||
117 | * create_buf_file - create file to represent a relay channel buffer | ||
118 | * @filename: the name of the file to create | ||
119 | * @parent: the parent of the file to create | ||
120 | * @mode: the mode of the file to create | ||
121 | * @buf: the channel buffer | ||
122 | * @is_global: outparam - set non-zero if the buffer should be global | ||
123 | * | ||
124 | * Called during relay_open(), once for each per-cpu buffer, | ||
125 | * to allow the client to create a file to be used to | ||
126 | * represent the corresponding channel buffer. If the file is | ||
127 | * created outside of relay, the parent must also exist in | ||
128 | * that filesystem. | ||
129 | * | ||
130 | * The callback should return the dentry of the file created | ||
131 | * to represent the relay buffer. | ||
132 | * | ||
133 | * Setting the is_global outparam to a non-zero value will | ||
134 | * cause relay_open() to create a single global buffer rather | ||
135 | * than the default set of per-cpu buffers. | ||
136 | * | ||
137 | * See Documentation/filesystems/relayfs.txt for more info. | ||
138 | */ | ||
139 | struct dentry *(*create_buf_file)(const char *filename, | ||
140 | struct dentry *parent, | ||
141 | int mode, | ||
142 | struct rchan_buf *buf, | ||
143 | int *is_global); | ||
144 | |||
145 | /* | ||
146 | * remove_buf_file - remove file representing a relay channel buffer | ||
147 | * @dentry: the dentry of the file to remove | ||
148 | * | ||
149 | * Called during relay_close(), once for each per-cpu buffer, | ||
150 | * to allow the client to remove a file used to represent a | ||
151 | * channel buffer. | ||
152 | * | ||
153 | * The callback should return 0 if successful, negative if not. | ||
154 | */ | ||
155 | int (*remove_buf_file)(struct dentry *dentry); | ||
156 | }; | ||
157 | |||
158 | /* | ||
159 | * CONFIG_RELAY kernel API, kernel/relay.c | ||
160 | */ | ||
161 | |||
162 | struct rchan *relay_open(const char *base_filename, | ||
163 | struct dentry *parent, | ||
164 | size_t subbuf_size, | ||
165 | size_t n_subbufs, | ||
166 | struct rchan_callbacks *cb); | ||
167 | extern void relay_close(struct rchan *chan); | ||
168 | extern void relay_flush(struct rchan *chan); | ||
169 | extern void relay_subbufs_consumed(struct rchan *chan, | ||
170 | unsigned int cpu, | ||
171 | size_t consumed); | ||
172 | extern void relay_reset(struct rchan *chan); | ||
173 | extern int relay_buf_full(struct rchan_buf *buf); | ||
174 | |||
175 | extern size_t relay_switch_subbuf(struct rchan_buf *buf, | ||
176 | size_t length); | ||
177 | |||
178 | /** | ||
179 | * relay_write - write data into the channel | ||
180 | * @chan: relay channel | ||
181 | * @data: data to be written | ||
182 | * @length: number of bytes to write | ||
183 | * | ||
184 | * Writes data into the current cpu's channel buffer. | ||
185 | * | ||
186 | * Protects the buffer by disabling interrupts. Use this | ||
187 | * if you might be logging from interrupt context. Try | ||
188 | * __relay_write() if you know you won't be logging from | ||
189 | * interrupt context. | ||
190 | */ | ||
191 | static inline void relay_write(struct rchan *chan, | ||
192 | const void *data, | ||
193 | size_t length) | ||
194 | { | ||
195 | unsigned long flags; | ||
196 | struct rchan_buf *buf; | ||
197 | |||
198 | local_irq_save(flags); | ||
199 | buf = chan->buf[smp_processor_id()]; | ||
200 | if (unlikely(buf->offset + length > chan->subbuf_size)) | ||
201 | length = relay_switch_subbuf(buf, length); | ||
202 | memcpy(buf->data + buf->offset, data, length); | ||
203 | buf->offset += length; | ||
204 | local_irq_restore(flags); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * __relay_write - write data into the channel | ||
209 | * @chan: relay channel | ||
210 | * @data: data to be written | ||
211 | * @length: number of bytes to write | ||
212 | * | ||
213 | * Writes data into the current cpu's channel buffer. | ||
214 | * | ||
215 | * Protects the buffer by disabling preemption. Use | ||
216 | * relay_write() if you might be logging from interrupt | ||
217 | * context. | ||
218 | */ | ||
219 | static inline void __relay_write(struct rchan *chan, | ||
220 | const void *data, | ||
221 | size_t length) | ||
222 | { | ||
223 | struct rchan_buf *buf; | ||
224 | |||
225 | buf = chan->buf[get_cpu()]; | ||
226 | if (unlikely(buf->offset + length > buf->chan->subbuf_size)) | ||
227 | length = relay_switch_subbuf(buf, length); | ||
228 | memcpy(buf->data + buf->offset, data, length); | ||
229 | buf->offset += length; | ||
230 | put_cpu(); | ||
231 | } | ||
232 | |||
233 | /** | ||
234 | * relay_reserve - reserve slot in channel buffer | ||
235 | * @chan: relay channel | ||
236 | * @length: number of bytes to reserve | ||
237 | * | ||
238 | * Returns pointer to reserved slot, NULL if full. | ||
239 | * | ||
240 | * Reserves a slot in the current cpu's channel buffer. | ||
241 | * Does not protect the buffer at all - caller must provide | ||
242 | * appropriate synchronization. | ||
243 | */ | ||
244 | static inline void *relay_reserve(struct rchan *chan, size_t length) | ||
245 | { | ||
246 | void *reserved; | ||
247 | struct rchan_buf *buf = chan->buf[smp_processor_id()]; | ||
248 | |||
249 | if (unlikely(buf->offset + length > buf->chan->subbuf_size)) { | ||
250 | length = relay_switch_subbuf(buf, length); | ||
251 | if (!length) | ||
252 | return NULL; | ||
253 | } | ||
254 | reserved = buf->data + buf->offset; | ||
255 | buf->offset += length; | ||
256 | |||
257 | return reserved; | ||
258 | } | ||
259 | |||
260 | /** | ||
261 | * subbuf_start_reserve - reserve bytes at the start of a sub-buffer | ||
262 | * @buf: relay channel buffer | ||
263 | * @length: number of bytes to reserve | ||
264 | * | ||
265 | * Helper function used to reserve bytes at the beginning of | ||
266 | * a sub-buffer in the subbuf_start() callback. | ||
267 | */ | ||
268 | static inline void subbuf_start_reserve(struct rchan_buf *buf, | ||
269 | size_t length) | ||
270 | { | ||
271 | BUG_ON(length >= buf->chan->subbuf_size - 1); | ||
272 | buf->offset = length; | ||
273 | } | ||
274 | |||
275 | /* | ||
276 | * exported relay file operations, kernel/relay.c | ||
277 | */ | ||
278 | extern struct file_operations relay_file_operations; | ||
279 | |||
280 | #endif /* _LINUX_RELAY_H */ | ||
281 | |||
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 0b2ba67ff13c..b739ac1f7ca0 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -11,8 +11,6 @@ | |||
11 | #ifndef _LINUX_RTC_H_ | 11 | #ifndef _LINUX_RTC_H_ |
12 | #define _LINUX_RTC_H_ | 12 | #define _LINUX_RTC_H_ |
13 | 13 | ||
14 | #include <linux/interrupt.h> | ||
15 | |||
16 | /* | 14 | /* |
17 | * The struct used to pass data via the following ioctl. Similar to the | 15 | * The struct used to pass data via the following ioctl. Similar to the |
18 | * struct tm in <time.h>, but it needs to be here so that the kernel | 16 | * struct tm in <time.h>, but it needs to be here so that the kernel |
@@ -95,6 +93,8 @@ struct rtc_pll_info { | |||
95 | 93 | ||
96 | #ifdef __KERNEL__ | 94 | #ifdef __KERNEL__ |
97 | 95 | ||
96 | #include <linux/interrupt.h> | ||
97 | |||
98 | typedef struct rtc_task { | 98 | typedef struct rtc_task { |
99 | void (*func)(void *private_data); | 99 | void (*func)(void *private_data); |
100 | void *private_data; | 100 | void *private_data; |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index d50482ba27fe..df0cdd41085c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -199,6 +199,7 @@ enum | |||
199 | #define RTPROT_BIRD 12 /* BIRD */ | 199 | #define RTPROT_BIRD 12 /* BIRD */ |
200 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ | 200 | #define RTPROT_DNROUTED 13 /* DECnet routing daemon */ |
201 | #define RTPROT_XORP 14 /* XORP */ | 201 | #define RTPROT_XORP 14 /* XORP */ |
202 | #define RTPROT_NTK 15 /* Netsukuku */ | ||
202 | 203 | ||
203 | /* rtm_scope | 204 | /* rtm_scope |
204 | 205 | ||
@@ -733,6 +734,8 @@ enum | |||
733 | #define IFLA_MAP IFLA_MAP | 734 | #define IFLA_MAP IFLA_MAP |
734 | IFLA_WEIGHT, | 735 | IFLA_WEIGHT, |
735 | #define IFLA_WEIGHT IFLA_WEIGHT | 736 | #define IFLA_WEIGHT IFLA_WEIGHT |
737 | IFLA_OPERSTATE, | ||
738 | IFLA_LINKMODE, | ||
736 | __IFLA_MAX | 739 | __IFLA_MAX |
737 | }; | 740 | }; |
738 | 741 | ||
@@ -836,6 +839,7 @@ enum | |||
836 | #define RTMGRP_IPV4_IFADDR 0x10 | 839 | #define RTMGRP_IPV4_IFADDR 0x10 |
837 | #define RTMGRP_IPV4_MROUTE 0x20 | 840 | #define RTMGRP_IPV4_MROUTE 0x20 |
838 | #define RTMGRP_IPV4_ROUTE 0x40 | 841 | #define RTMGRP_IPV4_ROUTE 0x40 |
842 | #define RTMGRP_IPV4_RULE 0x80 | ||
839 | 843 | ||
840 | #define RTMGRP_IPV6_IFADDR 0x100 | 844 | #define RTMGRP_IPV6_IFADDR 0x100 |
841 | #define RTMGRP_IPV6_MROUTE 0x200 | 845 | #define RTMGRP_IPV6_MROUTE 0x200 |
@@ -866,7 +870,8 @@ enum rtnetlink_groups { | |||
866 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE | 870 | #define RTNLGRP_IPV4_MROUTE RTNLGRP_IPV4_MROUTE |
867 | RTNLGRP_IPV4_ROUTE, | 871 | RTNLGRP_IPV4_ROUTE, |
868 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE | 872 | #define RTNLGRP_IPV4_ROUTE RTNLGRP_IPV4_ROUTE |
869 | RTNLGRP_NOP1, | 873 | RTNLGRP_IPV4_RULE, |
874 | #define RTNLGRP_IPV4_RULE RTNLGRP_IPV4_RULE | ||
870 | RTNLGRP_IPV6_IFADDR, | 875 | RTNLGRP_IPV6_IFADDR, |
871 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR | 876 | #define RTNLGRP_IPV6_IFADDR RTNLGRP_IPV6_IFADDR |
872 | RTNLGRP_IPV6_MROUTE, | 877 | RTNLGRP_IPV6_MROUTE, |
@@ -905,6 +910,7 @@ struct tcamsg | |||
905 | #ifdef __KERNEL__ | 910 | #ifdef __KERNEL__ |
906 | 911 | ||
907 | #include <linux/config.h> | 912 | #include <linux/config.h> |
913 | #include <linux/mutex.h> | ||
908 | 914 | ||
909 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); | 915 | extern size_t rtattr_strlcpy(char *dest, const struct rtattr *rta, size_t size); |
910 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) | 916 | static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str) |
@@ -1036,24 +1042,17 @@ __rta_reserve(struct sk_buff *skb, int attrtype, int attrlen) | |||
1036 | 1042 | ||
1037 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); | 1043 | extern void rtmsg_ifinfo(int type, struct net_device *dev, unsigned change); |
1038 | 1044 | ||
1039 | extern struct semaphore rtnl_sem; | 1045 | /* RTNL is used as a global lock for all changes to network configuration */ |
1040 | |||
1041 | #define rtnl_shlock() down(&rtnl_sem) | ||
1042 | #define rtnl_shlock_nowait() down_trylock(&rtnl_sem) | ||
1043 | |||
1044 | #define rtnl_shunlock() do { up(&rtnl_sem); \ | ||
1045 | if (rtnl && rtnl->sk_receive_queue.qlen) \ | ||
1046 | rtnl->sk_data_ready(rtnl, 0); \ | ||
1047 | } while(0) | ||
1048 | |||
1049 | extern void rtnl_lock(void); | 1046 | extern void rtnl_lock(void); |
1050 | extern int rtnl_lock_interruptible(void); | ||
1051 | extern void rtnl_unlock(void); | 1047 | extern void rtnl_unlock(void); |
1048 | extern int rtnl_trylock(void); | ||
1049 | |||
1052 | extern void rtnetlink_init(void); | 1050 | extern void rtnetlink_init(void); |
1051 | extern void __rtnl_unlock(void); | ||
1053 | 1052 | ||
1054 | #define ASSERT_RTNL() do { \ | 1053 | #define ASSERT_RTNL() do { \ |
1055 | if (unlikely(down_trylock(&rtnl_sem) == 0)) { \ | 1054 | if (unlikely(rtnl_trylock())) { \ |
1056 | up(&rtnl_sem); \ | 1055 | rtnl_unlock(); \ |
1057 | printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ | 1056 | printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ |
1058 | __FILE__, __LINE__); \ | 1057 | __FILE__, __LINE__); \ |
1059 | dump_stack(); \ | 1058 | dump_stack(); \ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 62e6314382f0..e60a91d5b369 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -706,6 +706,7 @@ struct task_struct { | |||
706 | prio_array_t *array; | 706 | prio_array_t *array; |
707 | 707 | ||
708 | unsigned short ioprio; | 708 | unsigned short ioprio; |
709 | unsigned int btrace_seq; | ||
709 | 710 | ||
710 | unsigned long sleep_avg; | 711 | unsigned long sleep_avg; |
711 | unsigned long long timestamp, last_ran; | 712 | unsigned long long timestamp, last_ran; |
diff --git a/include/linux/security.h b/include/linux/security.h index 7cbef482e13a..b18eb8cfa639 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1286,7 +1286,8 @@ struct security_operations { | |||
1286 | int (*socket_setsockopt) (struct socket * sock, int level, int optname); | 1286 | int (*socket_setsockopt) (struct socket * sock, int level, int optname); |
1287 | int (*socket_shutdown) (struct socket * sock, int how); | 1287 | int (*socket_shutdown) (struct socket * sock, int how); |
1288 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); | 1288 | int (*socket_sock_rcv_skb) (struct sock * sk, struct sk_buff * skb); |
1289 | int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); | 1289 | int (*socket_getpeersec_stream) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); |
1290 | int (*socket_getpeersec_dgram) (struct sk_buff *skb, char **secdata, u32 *seclen); | ||
1290 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); | 1291 | int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); |
1291 | void (*sk_free_security) (struct sock *sk); | 1292 | void (*sk_free_security) (struct sock *sk); |
1292 | unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); | 1293 | unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir); |
@@ -2741,10 +2742,16 @@ static inline int security_sock_rcv_skb (struct sock * sk, | |||
2741 | return security_ops->socket_sock_rcv_skb (sk, skb); | 2742 | return security_ops->socket_sock_rcv_skb (sk, skb); |
2742 | } | 2743 | } |
2743 | 2744 | ||
2744 | static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, | 2745 | static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, |
2745 | int __user *optlen, unsigned len) | 2746 | int __user *optlen, unsigned len) |
2746 | { | 2747 | { |
2747 | return security_ops->socket_getpeersec(sock, optval, optlen, len); | 2748 | return security_ops->socket_getpeersec_stream(sock, optval, optlen, len); |
2749 | } | ||
2750 | |||
2751 | static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, | ||
2752 | u32 *seclen) | ||
2753 | { | ||
2754 | return security_ops->socket_getpeersec_dgram(skb, secdata, seclen); | ||
2748 | } | 2755 | } |
2749 | 2756 | ||
2750 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) | 2757 | static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority) |
@@ -2863,8 +2870,14 @@ static inline int security_sock_rcv_skb (struct sock * sk, | |||
2863 | return 0; | 2870 | return 0; |
2864 | } | 2871 | } |
2865 | 2872 | ||
2866 | static inline int security_socket_getpeersec(struct socket *sock, char __user *optval, | 2873 | static inline int security_socket_getpeersec_stream(struct socket *sock, char __user *optval, |
2867 | int __user *optlen, unsigned len) | 2874 | int __user *optlen, unsigned len) |
2875 | { | ||
2876 | return -ENOPROTOOPT; | ||
2877 | } | ||
2878 | |||
2879 | static inline int security_socket_getpeersec_dgram(struct sk_buff *skb, char **secdata, | ||
2880 | u32 *seclen) | ||
2868 | { | 2881 | { |
2869 | return -ENOPROTOOPT; | 2882 | return -ENOPROTOOPT; |
2870 | } | 2883 | } |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 850a974ee505..b95f6eb7254c 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/string.h> | 6 | #include <linux/string.h> |
7 | #include <asm/semaphore.h> | 7 | #include <linux/mutex.h> |
8 | 8 | ||
9 | struct seq_operations; | 9 | struct seq_operations; |
10 | struct file; | 10 | struct file; |
@@ -19,7 +19,7 @@ struct seq_file { | |||
19 | size_t count; | 19 | size_t count; |
20 | loff_t index; | 20 | loff_t index; |
21 | loff_t version; | 21 | loff_t version; |
22 | struct semaphore sem; | 22 | struct mutex lock; |
23 | struct seq_operations *op; | 23 | struct seq_operations *op; |
24 | void *private; | 24 | void *private; |
25 | }; | 25 | }; |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 57abcea1cb5d..c32e60e79dea 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -369,6 +369,9 @@ void uart_parse_options(char *options, int *baud, int *parity, int *bits, | |||
369 | int uart_set_options(struct uart_port *port, struct console *co, int baud, | 369 | int uart_set_options(struct uart_port *port, struct console *co, int baud, |
370 | int parity, int bits, int flow); | 370 | int parity, int bits, int flow); |
371 | struct tty_driver *uart_console_device(struct console *co, int *index); | 371 | struct tty_driver *uart_console_device(struct console *co, int *index); |
372 | void uart_console_write(struct uart_port *port, const char *s, | ||
373 | unsigned int count, | ||
374 | void (*putchar)(struct uart_port *, int)); | ||
372 | 375 | ||
373 | /* | 376 | /* |
374 | * Port/driver registration/removal | 377 | * Port/driver registration/removal |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ad7cc22bd424..613b9513f8b9 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -270,7 +270,6 @@ struct sk_buff { | |||
270 | 270 | ||
271 | void (*destructor)(struct sk_buff *skb); | 271 | void (*destructor)(struct sk_buff *skb); |
272 | #ifdef CONFIG_NETFILTER | 272 | #ifdef CONFIG_NETFILTER |
273 | __u32 nfmark; | ||
274 | struct nf_conntrack *nfct; | 273 | struct nf_conntrack *nfct; |
275 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 274 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
276 | struct sk_buff *nfct_reasm; | 275 | struct sk_buff *nfct_reasm; |
@@ -278,6 +277,7 @@ struct sk_buff { | |||
278 | #ifdef CONFIG_BRIDGE_NETFILTER | 277 | #ifdef CONFIG_BRIDGE_NETFILTER |
279 | struct nf_bridge_info *nf_bridge; | 278 | struct nf_bridge_info *nf_bridge; |
280 | #endif | 279 | #endif |
280 | __u32 nfmark; | ||
281 | #endif /* CONFIG_NETFILTER */ | 281 | #endif /* CONFIG_NETFILTER */ |
282 | #ifdef CONFIG_NET_SCHED | 282 | #ifdef CONFIG_NET_SCHED |
283 | __u16 tc_index; /* traffic control index */ | 283 | __u16 tc_index; /* traffic control index */ |
@@ -304,6 +304,7 @@ struct sk_buff { | |||
304 | 304 | ||
305 | #include <asm/system.h> | 305 | #include <asm/system.h> |
306 | 306 | ||
307 | extern void kfree_skb(struct sk_buff *skb); | ||
307 | extern void __kfree_skb(struct sk_buff *skb); | 308 | extern void __kfree_skb(struct sk_buff *skb); |
308 | extern struct sk_buff *__alloc_skb(unsigned int size, | 309 | extern struct sk_buff *__alloc_skb(unsigned int size, |
309 | gfp_t priority, int fclone); | 310 | gfp_t priority, int fclone); |
@@ -404,22 +405,6 @@ static inline struct sk_buff *skb_get(struct sk_buff *skb) | |||
404 | */ | 405 | */ |
405 | 406 | ||
406 | /** | 407 | /** |
407 | * kfree_skb - free an sk_buff | ||
408 | * @skb: buffer to free | ||
409 | * | ||
410 | * Drop a reference to the buffer and free it if the usage count has | ||
411 | * hit zero. | ||
412 | */ | ||
413 | static inline void kfree_skb(struct sk_buff *skb) | ||
414 | { | ||
415 | if (likely(atomic_read(&skb->users) == 1)) | ||
416 | smp_rmb(); | ||
417 | else if (likely(!atomic_dec_and_test(&skb->users))) | ||
418 | return; | ||
419 | __kfree_skb(skb); | ||
420 | } | ||
421 | |||
422 | /** | ||
423 | * skb_cloned - is the buffer a clone | 408 | * skb_cloned - is the buffer a clone |
424 | * @skb: buffer to check | 409 | * @skb: buffer to check |
425 | * | 410 | * |
@@ -1174,12 +1159,14 @@ static inline int skb_linearize(struct sk_buff *skb, gfp_t gfp) | |||
1174 | */ | 1159 | */ |
1175 | 1160 | ||
1176 | static inline void skb_postpull_rcsum(struct sk_buff *skb, | 1161 | static inline void skb_postpull_rcsum(struct sk_buff *skb, |
1177 | const void *start, int len) | 1162 | const void *start, unsigned int len) |
1178 | { | 1163 | { |
1179 | if (skb->ip_summed == CHECKSUM_HW) | 1164 | if (skb->ip_summed == CHECKSUM_HW) |
1180 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); | 1165 | skb->csum = csum_sub(skb->csum, csum_partial(start, len, 0)); |
1181 | } | 1166 | } |
1182 | 1167 | ||
1168 | unsigned char *skb_pull_rcsum(struct sk_buff *skb, unsigned int len); | ||
1169 | |||
1183 | /** | 1170 | /** |
1184 | * pskb_trim_rcsum - trim received skb and update checksum | 1171 | * pskb_trim_rcsum - trim received skb and update checksum |
1185 | * @skb: buffer to trim | 1172 | * @skb: buffer to trim |
@@ -1351,16 +1338,6 @@ static inline void nf_conntrack_put_reasm(struct sk_buff *skb) | |||
1351 | kfree_skb(skb); | 1338 | kfree_skb(skb); |
1352 | } | 1339 | } |
1353 | #endif | 1340 | #endif |
1354 | static inline void nf_reset(struct sk_buff *skb) | ||
1355 | { | ||
1356 | nf_conntrack_put(skb->nfct); | ||
1357 | skb->nfct = NULL; | ||
1358 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1359 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
1360 | skb->nfct_reasm = NULL; | ||
1361 | #endif | ||
1362 | } | ||
1363 | |||
1364 | #ifdef CONFIG_BRIDGE_NETFILTER | 1341 | #ifdef CONFIG_BRIDGE_NETFILTER |
1365 | static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) | 1342 | static inline void nf_bridge_put(struct nf_bridge_info *nf_bridge) |
1366 | { | 1343 | { |
@@ -1373,6 +1350,20 @@ static inline void nf_bridge_get(struct nf_bridge_info *nf_bridge) | |||
1373 | atomic_inc(&nf_bridge->use); | 1350 | atomic_inc(&nf_bridge->use); |
1374 | } | 1351 | } |
1375 | #endif /* CONFIG_BRIDGE_NETFILTER */ | 1352 | #endif /* CONFIG_BRIDGE_NETFILTER */ |
1353 | static inline void nf_reset(struct sk_buff *skb) | ||
1354 | { | ||
1355 | nf_conntrack_put(skb->nfct); | ||
1356 | skb->nfct = NULL; | ||
1357 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | ||
1358 | nf_conntrack_put_reasm(skb->nfct_reasm); | ||
1359 | skb->nfct_reasm = NULL; | ||
1360 | #endif | ||
1361 | #ifdef CONFIG_BRIDGE_NETFILTER | ||
1362 | nf_bridge_put(skb->nf_bridge); | ||
1363 | skb->nf_bridge = NULL; | ||
1364 | #endif | ||
1365 | } | ||
1366 | |||
1376 | #else /* CONFIG_NETFILTER */ | 1367 | #else /* CONFIG_NETFILTER */ |
1377 | static inline void nf_reset(struct sk_buff *skb) {} | 1368 | static inline void nf_reset(struct sk_buff *skb) {} |
1378 | #endif /* CONFIG_NETFILTER */ | 1369 | #endif /* CONFIG_NETFILTER */ |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 8cf52939d0ab..2b28c849d75a 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -38,7 +38,6 @@ typedef struct kmem_cache kmem_cache_t; | |||
38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ | 38 | #define SLAB_DEBUG_INITIAL 0x00000200UL /* Call constructor (as verifier) */ |
39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ | 39 | #define SLAB_RED_ZONE 0x00000400UL /* Red zone objs in a cache */ |
40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ | 40 | #define SLAB_POISON 0x00000800UL /* Poison objects */ |
41 | #define SLAB_NO_REAP 0x00001000UL /* never reap from the cache */ | ||
42 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ | 41 | #define SLAB_HWCACHE_ALIGN 0x00002000UL /* align objs on a h/w cache lines */ |
43 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ | 42 | #define SLAB_CACHE_DMA 0x00004000UL /* use GFP_DMA memory */ |
44 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ | 43 | #define SLAB_MUST_HWCACHE_ALIGN 0x00008000UL /* force alignment */ |
@@ -118,7 +117,7 @@ extern void *kzalloc(size_t, gfp_t); | |||
118 | */ | 117 | */ |
119 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | 118 | static inline void *kcalloc(size_t n, size_t size, gfp_t flags) |
120 | { | 119 | { |
121 | if (n != 0 && size > INT_MAX / n) | 120 | if (n != 0 && size > ULONG_MAX / n) |
122 | return NULL; | 121 | return NULL; |
123 | return kzalloc(n * size, flags); | 122 | return kzalloc(n * size, flags); |
124 | } | 123 | } |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 44153fdf73fc..d699a16b0cb2 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -52,23 +52,12 @@ extern void smp_cpus_done(unsigned int max_cpus); | |||
52 | /* | 52 | /* |
53 | * Call a function on all other processors | 53 | * Call a function on all other processors |
54 | */ | 54 | */ |
55 | extern int smp_call_function (void (*func) (void *info), void *info, | 55 | int smp_call_function(void(*func)(void *info), void *info, int retry, int wait); |
56 | int retry, int wait); | ||
57 | 56 | ||
58 | /* | 57 | /* |
59 | * Call a function on all processors | 58 | * Call a function on all processors |
60 | */ | 59 | */ |
61 | static inline int on_each_cpu(void (*func) (void *info), void *info, | 60 | int on_each_cpu(void (*func) (void *info), void *info, int retry, int wait); |
62 | int retry, int wait) | ||
63 | { | ||
64 | int ret = 0; | ||
65 | |||
66 | preempt_disable(); | ||
67 | ret = smp_call_function(func, info, retry, wait); | ||
68 | func(info); | ||
69 | preempt_enable(); | ||
70 | return ret; | ||
71 | } | ||
72 | 61 | ||
73 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ | 62 | #define MSG_ALL_BUT_SELF 0x8000 /* Assume <32768 CPU's */ |
74 | #define MSG_ALL 0x8001 | 63 | #define MSG_ALL 0x8001 |
@@ -94,7 +83,13 @@ void smp_prepare_boot_cpu(void); | |||
94 | #define raw_smp_processor_id() 0 | 83 | #define raw_smp_processor_id() 0 |
95 | #define hard_smp_processor_id() 0 | 84 | #define hard_smp_processor_id() 0 |
96 | #define smp_call_function(func,info,retry,wait) ({ 0; }) | 85 | #define smp_call_function(func,info,retry,wait) ({ 0; }) |
97 | #define on_each_cpu(func,info,retry,wait) ({ func(info); 0; }) | 86 | #define on_each_cpu(func,info,retry,wait) \ |
87 | ({ \ | ||
88 | local_irq_disable(); \ | ||
89 | func(info); \ | ||
90 | local_irq_enable(); \ | ||
91 | 0; \ | ||
92 | }) | ||
98 | static inline void smp_send_reschedule(int cpu) { } | 93 | static inline void smp_send_reschedule(int cpu) { } |
99 | #define num_booting_cpus() 1 | 94 | #define num_booting_cpus() 1 |
100 | #define smp_prepare_boot_cpu() do {} while (0) | 95 | #define smp_prepare_boot_cpu() do {} while (0) |
diff --git a/include/linux/socket.h b/include/linux/socket.h index b02dda4ee83d..9ab2ddd80221 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -150,6 +150,7 @@ __KINLINE struct cmsghdr * cmsg_nxthdr (struct msghdr *__msg, struct cmsghdr *__ | |||
150 | 150 | ||
151 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ | 151 | #define SCM_RIGHTS 0x01 /* rw: access rights (array of int) */ |
152 | #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ | 152 | #define SCM_CREDENTIALS 0x02 /* rw: struct ucred */ |
153 | #define SCM_SECURITY 0x03 /* rw: security label */ | ||
153 | 154 | ||
154 | struct ucred { | 155 | struct ucred { |
155 | __u32 pid; | 156 | __u32 pid; |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index d33c6face032..b4acb3d37c3f 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -36,7 +36,7 @@ struct svc_sock { | |||
36 | 36 | ||
37 | struct list_head sk_deferred; /* deferred requests that need to | 37 | struct list_head sk_deferred; /* deferred requests that need to |
38 | * be revisted */ | 38 | * be revisted */ |
39 | struct semaphore sk_sem; /* to serialize sending data */ | 39 | struct mutex sk_mutex; /* to serialize sending data */ |
40 | 40 | ||
41 | int (*sk_recvfrom)(struct svc_rqst *rqstp); | 41 | int (*sk_recvfrom)(struct svc_rqst *rqstp); |
42 | int (*sk_sendto)(struct svc_rqst *rqstp); | 42 | int (*sk_sendto)(struct svc_rqst *rqstp); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index d572b19afb7d..54eac8a39a4c 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -172,9 +172,24 @@ extern int rotate_reclaimable_page(struct page *page); | |||
172 | extern void swap_setup(void); | 172 | extern void swap_setup(void); |
173 | 173 | ||
174 | /* linux/mm/vmscan.c */ | 174 | /* linux/mm/vmscan.c */ |
175 | extern int try_to_free_pages(struct zone **, gfp_t); | 175 | extern unsigned long try_to_free_pages(struct zone **, gfp_t); |
176 | extern int shrink_all_memory(int); | 176 | extern unsigned long shrink_all_memory(unsigned long nr_pages); |
177 | extern int vm_swappiness; | 177 | extern int vm_swappiness; |
178 | extern int remove_mapping(struct address_space *mapping, struct page *page); | ||
179 | |||
180 | /* possible outcome of pageout() */ | ||
181 | typedef enum { | ||
182 | /* failed to write page out, page is locked */ | ||
183 | PAGE_KEEP, | ||
184 | /* move page to the active list, page is locked */ | ||
185 | PAGE_ACTIVATE, | ||
186 | /* page has been sent to the disk successfully, page is unlocked */ | ||
187 | PAGE_SUCCESS, | ||
188 | /* page is clean and locked */ | ||
189 | PAGE_CLEAN, | ||
190 | } pageout_t; | ||
191 | |||
192 | extern pageout_t pageout(struct page *page, struct address_space *mapping); | ||
178 | 193 | ||
179 | #ifdef CONFIG_NUMA | 194 | #ifdef CONFIG_NUMA |
180 | extern int zone_reclaim_mode; | 195 | extern int zone_reclaim_mode; |
@@ -188,25 +203,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
188 | } | 203 | } |
189 | #endif | 204 | #endif |
190 | 205 | ||
191 | #ifdef CONFIG_MIGRATION | ||
192 | extern int isolate_lru_page(struct page *p); | ||
193 | extern int putback_lru_pages(struct list_head *l); | ||
194 | extern int migrate_page(struct page *, struct page *); | ||
195 | extern void migrate_page_copy(struct page *, struct page *); | ||
196 | extern int migrate_page_remove_references(struct page *, struct page *, int); | ||
197 | extern int migrate_pages(struct list_head *l, struct list_head *t, | ||
198 | struct list_head *moved, struct list_head *failed); | ||
199 | extern int fail_migrate_page(struct page *, struct page *); | ||
200 | #else | ||
201 | static inline int isolate_lru_page(struct page *p) { return -ENOSYS; } | ||
202 | static inline int putback_lru_pages(struct list_head *l) { return 0; } | ||
203 | static inline int migrate_pages(struct list_head *l, struct list_head *t, | ||
204 | struct list_head *moved, struct list_head *failed) { return -ENOSYS; } | ||
205 | /* Possible settings for the migrate_page() method in address_operations */ | ||
206 | #define migrate_page NULL | ||
207 | #define fail_migrate_page NULL | ||
208 | #endif | ||
209 | |||
210 | #ifdef CONFIG_MMU | 206 | #ifdef CONFIG_MMU |
211 | /* linux/mm/shmem.c */ | 207 | /* linux/mm/shmem.c */ |
212 | extern int shmem_unuse(swp_entry_t entry, struct page *page); | 208 | extern int shmem_unuse(swp_entry_t entry, struct page *page); |
@@ -238,14 +234,15 @@ extern struct page * read_swap_cache_async(swp_entry_t, struct vm_area_struct *v | |||
238 | /* linux/mm/swapfile.c */ | 234 | /* linux/mm/swapfile.c */ |
239 | extern long total_swap_pages; | 235 | extern long total_swap_pages; |
240 | extern unsigned int nr_swapfiles; | 236 | extern unsigned int nr_swapfiles; |
241 | extern struct swap_info_struct swap_info[]; | ||
242 | extern void si_swapinfo(struct sysinfo *); | 237 | extern void si_swapinfo(struct sysinfo *); |
243 | extern swp_entry_t get_swap_page(void); | 238 | extern swp_entry_t get_swap_page(void); |
244 | extern swp_entry_t get_swap_page_of_type(int type); | 239 | extern swp_entry_t get_swap_page_of_type(int); |
245 | extern int swap_duplicate(swp_entry_t); | 240 | extern int swap_duplicate(swp_entry_t); |
246 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 241 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
247 | extern void swap_free(swp_entry_t); | 242 | extern void swap_free(swp_entry_t); |
248 | extern void free_swap_and_cache(swp_entry_t); | 243 | extern void free_swap_and_cache(swp_entry_t); |
244 | extern int swap_type_of(dev_t); | ||
245 | extern unsigned int count_swap_pages(int, int); | ||
249 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); | 246 | extern sector_t map_swap_page(struct swap_info_struct *, pgoff_t); |
250 | extern struct swap_info_struct *get_swap_info_struct(unsigned); | 247 | extern struct swap_info_struct *get_swap_info_struct(unsigned); |
251 | extern int can_share_swap_page(struct page *); | 248 | extern int can_share_swap_page(struct page *); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index bac61db26456..76eaeff76f82 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -211,6 +211,7 @@ enum | |||
211 | NET_SCTP=17, | 211 | NET_SCTP=17, |
212 | NET_LLC=18, | 212 | NET_LLC=18, |
213 | NET_NETFILTER=19, | 213 | NET_NETFILTER=19, |
214 | NET_DCCP=20, | ||
214 | }; | 215 | }; |
215 | 216 | ||
216 | /* /proc/sys/kernel/random */ | 217 | /* /proc/sys/kernel/random */ |
@@ -261,6 +262,8 @@ enum | |||
261 | NET_CORE_DEV_WEIGHT=17, | 262 | NET_CORE_DEV_WEIGHT=17, |
262 | NET_CORE_SOMAXCONN=18, | 263 | NET_CORE_SOMAXCONN=18, |
263 | NET_CORE_BUDGET=19, | 264 | NET_CORE_BUDGET=19, |
265 | NET_CORE_AEVENT_ETIME=20, | ||
266 | NET_CORE_AEVENT_RSEQTH=21, | ||
264 | }; | 267 | }; |
265 | 268 | ||
266 | /* /proc/sys/net/ethernet */ | 269 | /* /proc/sys/net/ethernet */ |
@@ -397,6 +400,9 @@ enum | |||
397 | NET_TCP_CONG_CONTROL=110, | 400 | NET_TCP_CONG_CONTROL=110, |
398 | NET_TCP_ABC=111, | 401 | NET_TCP_ABC=111, |
399 | NET_IPV4_IPFRAG_MAX_DIST=112, | 402 | NET_IPV4_IPFRAG_MAX_DIST=112, |
403 | NET_TCP_MTU_PROBING=113, | ||
404 | NET_TCP_BASE_MSS=114, | ||
405 | NET_IPV4_TCP_WORKAROUND_SIGNED_WINDOWS=115, | ||
400 | }; | 406 | }; |
401 | 407 | ||
402 | enum { | 408 | enum { |
@@ -451,6 +457,7 @@ enum | |||
451 | NET_IPV4_CONF_ARP_ANNOUNCE=18, | 457 | NET_IPV4_CONF_ARP_ANNOUNCE=18, |
452 | NET_IPV4_CONF_ARP_IGNORE=19, | 458 | NET_IPV4_CONF_ARP_IGNORE=19, |
453 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | 459 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, |
460 | NET_IPV4_CONF_ARP_ACCEPT=21, | ||
454 | __NET_IPV4_CONF_MAX | 461 | __NET_IPV4_CONF_MAX |
455 | }; | 462 | }; |
456 | 463 | ||
@@ -531,6 +538,11 @@ enum { | |||
531 | NET_IPV6_MAX_DESYNC_FACTOR=15, | 538 | NET_IPV6_MAX_DESYNC_FACTOR=15, |
532 | NET_IPV6_MAX_ADDRESSES=16, | 539 | NET_IPV6_MAX_ADDRESSES=16, |
533 | NET_IPV6_FORCE_MLD_VERSION=17, | 540 | NET_IPV6_FORCE_MLD_VERSION=17, |
541 | NET_IPV6_ACCEPT_RA_DEFRTR=18, | ||
542 | NET_IPV6_ACCEPT_RA_PINFO=19, | ||
543 | NET_IPV6_ACCEPT_RA_RTR_PREF=20, | ||
544 | NET_IPV6_RTR_PROBE_INTERVAL=21, | ||
545 | NET_IPV6_ACCEPT_RA_RT_INFO_MAX_PLEN=22, | ||
534 | __NET_IPV6_MAX | 546 | __NET_IPV6_MAX |
535 | }; | 547 | }; |
536 | 548 | ||
@@ -562,6 +574,21 @@ enum { | |||
562 | __NET_NEIGH_MAX | 574 | __NET_NEIGH_MAX |
563 | }; | 575 | }; |
564 | 576 | ||
577 | /* /proc/sys/net/dccp */ | ||
578 | enum { | ||
579 | NET_DCCP_DEFAULT=1, | ||
580 | }; | ||
581 | |||
582 | /* /proc/sys/net/dccp/default */ | ||
583 | enum { | ||
584 | NET_DCCP_DEFAULT_SEQ_WINDOW = 1, | ||
585 | NET_DCCP_DEFAULT_RX_CCID = 2, | ||
586 | NET_DCCP_DEFAULT_TX_CCID = 3, | ||
587 | NET_DCCP_DEFAULT_ACK_RATIO = 4, | ||
588 | NET_DCCP_DEFAULT_SEND_ACKVEC = 5, | ||
589 | NET_DCCP_DEFAULT_SEND_NDP = 6, | ||
590 | }; | ||
591 | |||
565 | /* /proc/sys/net/ipx */ | 592 | /* /proc/sys/net/ipx */ |
566 | enum { | 593 | enum { |
567 | NET_IPX_PPROP_BROADCASTING=1, | 594 | NET_IPX_PPROP_BROADCASTING=1, |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index f2bb2396853f..542d39596bd8 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -343,6 +343,12 @@ struct tcp_sock { | |||
343 | __u32 seq; | 343 | __u32 seq; |
344 | __u32 time; | 344 | __u32 time; |
345 | } rcvq_space; | 345 | } rcvq_space; |
346 | |||
347 | /* TCP-specific MTU probe information. */ | ||
348 | struct { | ||
349 | __u32 probe_seq_start; | ||
350 | __u32 probe_seq_end; | ||
351 | } mtu_probe; | ||
346 | }; | 352 | }; |
347 | 353 | ||
348 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 354 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
diff --git a/include/linux/tty.h b/include/linux/tty.h index f45cd74e6f24..f13f49afe198 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/tty_driver.h> | 24 | #include <linux/tty_driver.h> |
25 | #include <linux/tty_ldisc.h> | 25 | #include <linux/tty_ldisc.h> |
26 | #include <linux/screen_info.h> | 26 | #include <linux/screen_info.h> |
27 | #include <linux/mutex.h> | ||
27 | 28 | ||
28 | #include <asm/system.h> | 29 | #include <asm/system.h> |
29 | 30 | ||
@@ -231,8 +232,8 @@ struct tty_struct { | |||
231 | int canon_data; | 232 | int canon_data; |
232 | unsigned long canon_head; | 233 | unsigned long canon_head; |
233 | unsigned int canon_column; | 234 | unsigned int canon_column; |
234 | struct semaphore atomic_read; | 235 | struct mutex atomic_read_lock; |
235 | struct semaphore atomic_write; | 236 | struct mutex atomic_write_lock; |
236 | unsigned char *write_buf; | 237 | unsigned char *write_buf; |
237 | int write_cnt; | 238 | int write_cnt; |
238 | spinlock_t read_lock; | 239 | spinlock_t read_lock; |
@@ -319,8 +320,7 @@ extern void tty_ldisc_put(int); | |||
319 | extern void tty_wakeup(struct tty_struct *tty); | 320 | extern void tty_wakeup(struct tty_struct *tty); |
320 | extern void tty_ldisc_flush(struct tty_struct *tty); | 321 | extern void tty_ldisc_flush(struct tty_struct *tty); |
321 | 322 | ||
322 | struct semaphore; | 323 | extern struct mutex tty_mutex; |
323 | extern struct semaphore tty_sem; | ||
324 | 324 | ||
325 | /* n_tty.c */ | 325 | /* n_tty.c */ |
326 | extern struct tty_ldisc tty_ldisc_N_TTY; | 326 | extern struct tty_ldisc tty_ldisc_N_TTY; |
diff --git a/include/linux/tty_flip.h b/include/linux/tty_flip.h index 222faf97d5f9..0c6169fff366 100644 --- a/include/linux/tty_flip.h +++ b/include/linux/tty_flip.h | |||
@@ -7,14 +7,8 @@ extern int tty_insert_flip_string_flags(struct tty_struct *tty, unsigned char *c | |||
7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); | 7 | extern int tty_prepare_flip_string(struct tty_struct *tty, unsigned char **chars, size_t size); |
8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); | 8 | extern int tty_prepare_flip_string_flags(struct tty_struct *tty, unsigned char **chars, char **flags, size_t size); |
9 | 9 | ||
10 | #ifdef INCLUDE_INLINE_FUNCS | 10 | static inline int tty_insert_flip_char(struct tty_struct *tty, |
11 | #define _INLINE_ extern | 11 | unsigned char ch, char flag) |
12 | #else | ||
13 | #define _INLINE_ static __inline__ | ||
14 | #endif | ||
15 | |||
16 | _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, | ||
17 | unsigned char ch, char flag) | ||
18 | { | 12 | { |
19 | struct tty_buffer *tb = tty->buf.tail; | 13 | struct tty_buffer *tb = tty->buf.tail; |
20 | if (tb && tb->active && tb->used < tb->size) { | 14 | if (tb && tb->active && tb->used < tb->size) { |
@@ -25,7 +19,7 @@ _INLINE_ int tty_insert_flip_char(struct tty_struct *tty, | |||
25 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); | 19 | return tty_insert_flip_string_flags(tty, &ch, &flag, 1); |
26 | } | 20 | } |
27 | 21 | ||
28 | _INLINE_ void tty_schedule_flip(struct tty_struct *tty) | 22 | static inline void tty_schedule_flip(struct tty_struct *tty) |
29 | { | 23 | { |
30 | unsigned long flags; | 24 | unsigned long flags; |
31 | spin_lock_irqsave(&tty->buf.lock, flags); | 25 | spin_lock_irqsave(&tty->buf.lock, flags); |
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h index b15ff2e99c91..80ae9ef940dc 100644 --- a/include/linux/udf_fs_sb.h +++ b/include/linux/udf_fs_sb.h | |||
@@ -13,7 +13,7 @@ | |||
13 | #ifndef _UDF_FS_SB_H | 13 | #ifndef _UDF_FS_SB_H |
14 | #define _UDF_FS_SB_H 1 | 14 | #define _UDF_FS_SB_H 1 |
15 | 15 | ||
16 | #include <asm/semaphore.h> | 16 | #include <linux/mutex.h> |
17 | 17 | ||
18 | #pragma pack(1) | 18 | #pragma pack(1) |
19 | 19 | ||
@@ -111,7 +111,7 @@ struct udf_sb_info | |||
111 | /* VAT inode */ | 111 | /* VAT inode */ |
112 | struct inode *s_vat; | 112 | struct inode *s_vat; |
113 | 113 | ||
114 | struct semaphore s_alloc_sem; | 114 | struct mutex s_alloc_mutex; |
115 | }; | 115 | }; |
116 | 116 | ||
117 | #endif /* _UDF_FS_SB_H */ | 117 | #endif /* _UDF_FS_SB_H */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 827cc6de5f5c..130d125fda12 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -1018,8 +1018,6 @@ extern int usb_get_descriptor(struct usb_device *dev, unsigned char desctype, | |||
1018 | unsigned char descindex, void *buf, int size); | 1018 | unsigned char descindex, void *buf, int size); |
1019 | extern int usb_get_status(struct usb_device *dev, | 1019 | extern int usb_get_status(struct usb_device *dev, |
1020 | int type, int target, void *data); | 1020 | int type, int target, void *data); |
1021 | extern int usb_get_string(struct usb_device *dev, | ||
1022 | unsigned short langid, unsigned char index, void *buf, int size); | ||
1023 | extern int usb_string(struct usb_device *dev, int index, | 1021 | extern int usb_string(struct usb_device *dev, int index, |
1024 | char *buf, size_t size); | 1022 | char *buf, size_t size); |
1025 | 1023 | ||
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h index ff81117eb733..1d78870ed8af 100644 --- a/include/linux/usb_gadget.h +++ b/include/linux/usb_gadget.h | |||
@@ -801,7 +801,9 @@ struct usb_gadget_driver { | |||
801 | * Call this in your gadget driver's module initialization function, | 801 | * Call this in your gadget driver's module initialization function, |
802 | * to tell the underlying usb controller driver about your driver. | 802 | * to tell the underlying usb controller driver about your driver. |
803 | * The driver's bind() function will be called to bind it to a | 803 | * The driver's bind() function will be called to bind it to a |
804 | * gadget. This function must be called in a context that can sleep. | 804 | * gadget before this registration call returns. It's expected that |
805 | * the bind() functions will be in init sections. | ||
806 | * This function must be called in a context that can sleep. | ||
805 | */ | 807 | */ |
806 | int usb_gadget_register_driver (struct usb_gadget_driver *driver); | 808 | int usb_gadget_register_driver (struct usb_gadget_driver *driver); |
807 | 809 | ||
@@ -814,7 +816,8 @@ int usb_gadget_register_driver (struct usb_gadget_driver *driver); | |||
814 | * going away. If the controller is connected to a USB host, | 816 | * going away. If the controller is connected to a USB host, |
815 | * it will first disconnect(). The driver is also requested | 817 | * it will first disconnect(). The driver is also requested |
816 | * to unbind() and clean up any device state, before this procedure | 818 | * to unbind() and clean up any device state, before this procedure |
817 | * finally returns. | 819 | * finally returns. It's expected that the unbind() functions |
820 | * will in in exit sections, so may not be linked in some kernels. | ||
818 | * This function must be called in a context that can sleep. | 821 | * This function must be called in a context that can sleep. |
819 | */ | 822 | */ |
820 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); | 823 | int usb_gadget_unregister_driver (struct usb_gadget_driver *driver); |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index 5208b12d5550..724cfbf54b8a 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -17,11 +17,12 @@ | |||
17 | #include <linux/time.h> /* need struct timeval */ | 17 | #include <linux/time.h> /* need struct timeval */ |
18 | #include <linux/poll.h> | 18 | #include <linux/poll.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/mutex.h> | ||
20 | #endif | 21 | #endif |
21 | #include <linux/compiler.h> /* need __user */ | 22 | #include <linux/compiler.h> /* need __user */ |
22 | 23 | ||
23 | 24 | ||
24 | #define OBSOLETE_OWNER 1 /* It will be removed for 2.6.15 */ | 25 | #define OBSOLETE_OWNER 1 /* It will be removed for 2.6.17 */ |
25 | #define HAVE_V4L2 1 | 26 | #define HAVE_V4L2 1 |
26 | 27 | ||
27 | /* | 28 | /* |
@@ -48,6 +49,16 @@ | |||
48 | 49 | ||
49 | #ifdef __KERNEL__ | 50 | #ifdef __KERNEL__ |
50 | 51 | ||
52 | /* Minor device allocation */ | ||
53 | #define MINOR_VFL_TYPE_GRABBER_MIN 0 | ||
54 | #define MINOR_VFL_TYPE_GRABBER_MAX 63 | ||
55 | #define MINOR_VFL_TYPE_RADIO_MIN 64 | ||
56 | #define MINOR_VFL_TYPE_RADIO_MAX 127 | ||
57 | #define MINOR_VFL_TYPE_VTX_MIN 192 | ||
58 | #define MINOR_VFL_TYPE_VTX_MAX 223 | ||
59 | #define MINOR_VFL_TYPE_VBI_MIN 224 | ||
60 | #define MINOR_VFL_TYPE_VBI_MAX 255 | ||
61 | |||
51 | #define VFL_TYPE_GRABBER 0 | 62 | #define VFL_TYPE_GRABBER 0 |
52 | #define VFL_TYPE_VBI 1 | 63 | #define VFL_TYPE_VBI 1 |
53 | #define VFL_TYPE_RADIO 2 | 64 | #define VFL_TYPE_RADIO 2 |
@@ -80,7 +91,7 @@ struct video_device | |||
80 | 91 | ||
81 | /* for videodev.c intenal usage -- please don't touch */ | 92 | /* for videodev.c intenal usage -- please don't touch */ |
82 | int users; /* video_exclusive_{open|close} ... */ | 93 | int users; /* video_exclusive_{open|close} ... */ |
83 | struct semaphore lock; /* ... helper function uses these */ | 94 | struct mutex lock; /* ... helper function uses these */ |
84 | char devfs_name[64]; /* devfs */ | 95 | char devfs_name[64]; /* devfs */ |
85 | struct class_device class_dev; /* sysfs */ | 96 | struct class_device class_dev; /* sysfs */ |
86 | }; | 97 | }; |
@@ -952,13 +963,68 @@ struct v4l2_sliced_vbi_format | |||
952 | __u32 reserved[2]; /* must be zero */ | 963 | __u32 reserved[2]; /* must be zero */ |
953 | }; | 964 | }; |
954 | 965 | ||
955 | #define V4L2_SLICED_TELETEXT_B (0x0001) | 966 | /* Teletext World System Teletext |
956 | #define V4L2_SLICED_VPS (0x0400) | 967 | (WST), defined on ITU-R BT.653-2 */ |
957 | #define V4L2_SLICED_CAPTION_525 (0x1000) | 968 | #define V4L2_SLICED_TELETEXT_PAL_B (0x000001) |
958 | #define V4L2_SLICED_WSS_625 (0x4000) | 969 | #define V4L2_SLICED_TELETEXT_PAL_C (0x000002) |
959 | 970 | #define V4L2_SLICED_TELETEXT_NTSC_B (0x000010) | |
960 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_CAPTION_525) | 971 | #define V4L2_SLICED_TELETEXT_SECAM (0x000020) |
961 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_B | V4L2_SLICED_VPS | V4L2_SLICED_WSS_625) | 972 | |
973 | /* Teletext North American Broadcast Teletext Specification | ||
974 | (NABTS), defined on ITU-R BT.653-2 */ | ||
975 | #define V4L2_SLICED_TELETEXT_NTSC_C (0x000040) | ||
976 | #define V4L2_SLICED_TELETEXT_NTSC_D (0x000080) | ||
977 | |||
978 | /* Video Program System, defined on ETS 300 231*/ | ||
979 | #define V4L2_SLICED_VPS (0x000400) | ||
980 | |||
981 | /* Closed Caption, defined on EIA-608 */ | ||
982 | #define V4L2_SLICED_CAPTION_525 (0x001000) | ||
983 | #define V4L2_SLICED_CAPTION_625 (0x002000) | ||
984 | |||
985 | /* Wide Screen System, defined on ITU-R BT1119.1 */ | ||
986 | #define V4L2_SLICED_WSS_625 (0x004000) | ||
987 | |||
988 | /* Wide Screen System, defined on IEC 61880 */ | ||
989 | #define V4L2_SLICED_WSS_525 (0x008000) | ||
990 | |||
991 | /* Vertical Interval Timecode (VITC), defined on SMPTE 12M */ | ||
992 | #define V4l2_SLICED_VITC_625 (0x010000) | ||
993 | #define V4l2_SLICED_VITC_525 (0x020000) | ||
994 | |||
995 | #define V4L2_SLICED_TELETEXT_B (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
996 | V4L2_SLICED_TELETEXT_NTSC_B) | ||
997 | |||
998 | #define V4L2_SLICED_TELETEXT (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
999 | V4L2_SLICED_TELETEXT_PAL_C |\ | ||
1000 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
1001 | V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
1002 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
1003 | V4L2_SLICED_TELETEXT_NTSC_D) | ||
1004 | |||
1005 | #define V4L2_SLICED_CAPTION (V4L2_SLICED_CAPTION_525 |\ | ||
1006 | V4L2_SLICED_CAPTION_625) | ||
1007 | |||
1008 | #define V4L2_SLICED_WSS (V4L2_SLICED_WSS_525 |\ | ||
1009 | V4L2_SLICED_WSS_625) | ||
1010 | |||
1011 | #define V4L2_SLICED_VITC (V4L2_SLICED_VITC_525 |\ | ||
1012 | V4L2_SLICED_VITC_625) | ||
1013 | |||
1014 | #define V4L2_SLICED_VBI_525 (V4L2_SLICED_TELETEXT_NTSC_B |\ | ||
1015 | V4L2_SLICED_TELETEXT_NTSC_C |\ | ||
1016 | V4L2_SLICED_TELETEXT_NTSC_D |\ | ||
1017 | V4L2_SLICED_CAPTION_525 |\ | ||
1018 | V4L2_SLICED_WSS_525 |\ | ||
1019 | V4l2_SLICED_VITC_525) | ||
1020 | |||
1021 | #define V4L2_SLICED_VBI_625 (V4L2_SLICED_TELETEXT_PAL_B |\ | ||
1022 | V4L2_SLICED_TELETEXT_PAL_C |\ | ||
1023 | V4L2_SLICED_TELETEXT_SECAM |\ | ||
1024 | V4L2_SLICED_VPS |\ | ||
1025 | V4L2_SLICED_CAPTION_625 |\ | ||
1026 | V4L2_SLICED_WSS_625 |\ | ||
1027 | V4l2_SLICED_VITC_625) | ||
962 | 1028 | ||
963 | struct v4l2_sliced_vbi_cap | 1029 | struct v4l2_sliced_vbi_cap |
964 | { | 1030 | { |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index fab5aed8ca31..530ae3f4248c 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -73,6 +73,11 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc); | |||
73 | int vt_waitactive(int vt); | 73 | int vt_waitactive(int vt); |
74 | void change_console(struct vc_data *new_vc); | 74 | void change_console(struct vc_data *new_vc); |
75 | void reset_vc(struct vc_data *vc); | 75 | void reset_vc(struct vc_data *vc); |
76 | #ifdef CONFIG_VT | ||
77 | int is_console_suspend_safe(void); | ||
78 | #else | ||
79 | static inline int is_console_suspend_safe(void) { return 1; } | ||
80 | #endif | ||
76 | 81 | ||
77 | /* | 82 | /* |
78 | * vc_screen.c shares this temporary buffer with the console write code so that | 83 | * vc_screen.c shares this temporary buffer with the console write code so that |
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index a555a0f7a7b4..13588564b42b 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
3 | * | 3 | * |
4 | * Version : 19 18.3.05 | 4 | * Version : 20 17.2.06 |
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-2006 Jean Tourrilhes, All Rights Reserved. |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef _LINUX_WIRELESS_H | 10 | #ifndef _LINUX_WIRELESS_H |
@@ -80,7 +80,7 @@ | |||
80 | * (there is some stuff that will be added in the future...) | 80 | * (there is some stuff that will be added in the future...) |
81 | * I just plan to increment with each new version. | 81 | * I just plan to increment with each new version. |
82 | */ | 82 | */ |
83 | #define WIRELESS_EXT 19 | 83 | #define WIRELESS_EXT 20 |
84 | 84 | ||
85 | /* | 85 | /* |
86 | * Changes : | 86 | * Changes : |
@@ -204,6 +204,10 @@ | |||
204 | * - Add IW_QUAL_ALL_UPDATED and IW_QUAL_ALL_INVALID macros | 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 | 205 | * - Add explicit flag to tell stats are in dBm : IW_QUAL_DBM |
206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros | 206 | * - Add IW_IOCTL_IDX() and IW_EVENT_IDX() macros |
207 | * | ||
208 | * V19 to V20 | ||
209 | * ---------- | ||
210 | * - RtNetlink requests support (SET/GET) | ||
207 | */ | 211 | */ |
208 | 212 | ||
209 | /**************************** CONSTANTS ****************************/ | 213 | /**************************** CONSTANTS ****************************/ |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 86b111300231..957c21c16d62 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -20,6 +20,10 @@ struct work_struct { | |||
20 | struct timer_list timer; | 20 | struct timer_list timer; |
21 | }; | 21 | }; |
22 | 22 | ||
23 | struct execute_work { | ||
24 | struct work_struct work; | ||
25 | }; | ||
26 | |||
23 | #define __WORK_INITIALIZER(n, f, d) { \ | 27 | #define __WORK_INITIALIZER(n, f, d) { \ |
24 | .entry = { &(n).entry, &(n).entry }, \ | 28 | .entry = { &(n).entry, &(n).entry }, \ |
25 | .func = (f), \ | 29 | .func = (f), \ |
@@ -74,6 +78,8 @@ extern void init_workqueues(void); | |||
74 | void cancel_rearming_delayed_work(struct work_struct *work); | 78 | void cancel_rearming_delayed_work(struct work_struct *work); |
75 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | 79 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, |
76 | struct work_struct *); | 80 | struct work_struct *); |
81 | int execute_in_process_context(void (*fn)(void *), void *, | ||
82 | struct execute_work *); | ||
77 | 83 | ||
78 | /* | 84 | /* |
79 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 85 | * Kill off a pending schedule_delayed_work(). Note that the work callback |
diff --git a/include/linux/x25.h b/include/linux/x25.h index 16d44931afa0..d035e4e87d07 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
@@ -11,6 +11,8 @@ | |||
11 | #ifndef X25_KERNEL_H | 11 | #ifndef X25_KERNEL_H |
12 | #define X25_KERNEL_H | 12 | #define X25_KERNEL_H |
13 | 13 | ||
14 | #include <linux/types.h> | ||
15 | |||
14 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) | 16 | #define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) |
15 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) | 17 | #define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) |
16 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) | 18 | #define SIOCX25GFACILITIES (SIOCPROTOPRIVATE + 2) |
@@ -21,6 +23,8 @@ | |||
21 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) | 23 | #define SIOCX25SCUDMATCHLEN (SIOCPROTOPRIVATE + 7) |
22 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) | 24 | #define SIOCX25CALLACCPTAPPRV (SIOCPROTOPRIVATE + 8) |
23 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) | 25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) | ||
27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) | ||
24 | 28 | ||
25 | /* | 29 | /* |
26 | * Values for {get,set}sockopt. | 30 | * Values for {get,set}sockopt. |
@@ -77,6 +81,8 @@ struct x25_subscrip_struct { | |||
77 | #define X25_MASK_PACKET_SIZE 0x04 | 81 | #define X25_MASK_PACKET_SIZE 0x04 |
78 | #define X25_MASK_WINDOW_SIZE 0x08 | 82 | #define X25_MASK_WINDOW_SIZE 0x08 |
79 | 83 | ||
84 | #define X25_MASK_CALLING_AE 0x10 | ||
85 | #define X25_MASK_CALLED_AE 0x20 | ||
80 | 86 | ||
81 | 87 | ||
82 | /* | 88 | /* |
@@ -99,6 +105,26 @@ struct x25_facilities { | |||
99 | }; | 105 | }; |
100 | 106 | ||
101 | /* | 107 | /* |
108 | * ITU DTE facilities | ||
109 | * Only the called and calling address | ||
110 | * extension are currently implemented. | ||
111 | * The rest are in place to avoid the struct | ||
112 | * changing size if someone needs them later | ||
113 | */ | ||
114 | |||
115 | struct x25_dte_facilities { | ||
116 | __u16 delay_cumul; | ||
117 | __u16 delay_target; | ||
118 | __u16 delay_max; | ||
119 | __u8 min_throughput; | ||
120 | __u8 expedited; | ||
121 | __u8 calling_len; | ||
122 | __u8 called_len; | ||
123 | __u8 calling_ae[20]; | ||
124 | __u8 called_ae[20]; | ||
125 | }; | ||
126 | |||
127 | /* | ||
102 | * Call User Data structure. | 128 | * Call User Data structure. |
103 | */ | 129 | */ |
104 | struct x25_calluserdata { | 130 | struct x25_calluserdata { |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 82fbb758e28f..6b42cc474c01 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -156,6 +156,10 @@ enum { | |||
156 | XFRM_MSG_FLUSHPOLICY, | 156 | XFRM_MSG_FLUSHPOLICY, |
157 | #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY | 157 | #define XFRM_MSG_FLUSHPOLICY XFRM_MSG_FLUSHPOLICY |
158 | 158 | ||
159 | XFRM_MSG_NEWAE, | ||
160 | #define XFRM_MSG_NEWAE XFRM_MSG_NEWAE | ||
161 | XFRM_MSG_GETAE, | ||
162 | #define XFRM_MSG_GETAE XFRM_MSG_GETAE | ||
159 | __XFRM_MSG_MAX | 163 | __XFRM_MSG_MAX |
160 | }; | 164 | }; |
161 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) | 165 | #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) |
@@ -194,6 +198,21 @@ struct xfrm_encap_tmpl { | |||
194 | xfrm_address_t encap_oa; | 198 | xfrm_address_t encap_oa; |
195 | }; | 199 | }; |
196 | 200 | ||
201 | /* AEVENT flags */ | ||
202 | enum xfrm_ae_ftype_t { | ||
203 | XFRM_AE_UNSPEC, | ||
204 | XFRM_AE_RTHR=1, /* replay threshold*/ | ||
205 | XFRM_AE_RVAL=2, /* replay value */ | ||
206 | XFRM_AE_LVAL=4, /* lifetime value */ | ||
207 | XFRM_AE_ETHR=8, /* expiry timer threshold */ | ||
208 | XFRM_AE_CR=16, /* Event cause is replay update */ | ||
209 | XFRM_AE_CE=32, /* Event cause is timer expiry */ | ||
210 | XFRM_AE_CU=64, /* Event cause is policy update */ | ||
211 | __XFRM_AE_MAX | ||
212 | |||
213 | #define XFRM_AE_MAX (__XFRM_AE_MAX - 1) | ||
214 | }; | ||
215 | |||
197 | /* Netlink message attributes. */ | 216 | /* Netlink message attributes. */ |
198 | enum xfrm_attr_type_t { | 217 | enum xfrm_attr_type_t { |
199 | XFRMA_UNSPEC, | 218 | XFRMA_UNSPEC, |
@@ -205,6 +224,10 @@ enum xfrm_attr_type_t { | |||
205 | XFRMA_SA, | 224 | XFRMA_SA, |
206 | XFRMA_POLICY, | 225 | XFRMA_POLICY, |
207 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ | 226 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ |
227 | XFRMA_LTIME_VAL, | ||
228 | XFRMA_REPLAY_VAL, | ||
229 | XFRMA_REPLAY_THRESH, | ||
230 | XFRMA_ETIMER_THRESH, | ||
208 | __XFRMA_MAX | 231 | __XFRMA_MAX |
209 | 232 | ||
210 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 233 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
@@ -235,6 +258,11 @@ struct xfrm_usersa_id { | |||
235 | __u8 proto; | 258 | __u8 proto; |
236 | }; | 259 | }; |
237 | 260 | ||
261 | struct xfrm_aevent_id { | ||
262 | struct xfrm_usersa_id sa_id; | ||
263 | __u32 flags; | ||
264 | }; | ||
265 | |||
238 | struct xfrm_userspi_info { | 266 | struct xfrm_userspi_info { |
239 | struct xfrm_usersa_info info; | 267 | struct xfrm_usersa_info info; |
240 | __u32 min; | 268 | __u32 min; |
@@ -306,6 +334,8 @@ enum xfrm_nlgroups { | |||
306 | #define XFRMNLGRP_SA XFRMNLGRP_SA | 334 | #define XFRMNLGRP_SA XFRMNLGRP_SA |
307 | XFRMNLGRP_POLICY, | 335 | XFRMNLGRP_POLICY, |
308 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY | 336 | #define XFRMNLGRP_POLICY XFRMNLGRP_POLICY |
337 | XFRMNLGRP_AEVENTS, | ||
338 | #define XFRMNLGRP_AEVENTS XFRMNLGRP_AEVENTS | ||
309 | __XFRMNLGRP_MAX | 339 | __XFRMNLGRP_MAX |
310 | }; | 340 | }; |
311 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) | 341 | #define XFRMNLGRP_MAX (__XFRMNLGRP_MAX - 1) |