aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h8
-rw-r--r--include/linux/bio.h2
-rw-r--r--include/linux/bitops.h9
-rw-r--r--include/linux/blkdev.h96
-rw-r--r--include/linux/bootmem.h46
-rw-r--r--include/linux/configfs.h205
-rw-r--r--include/linux/cpufreq.h10
-rw-r--r--include/linux/dccp.h7
-rw-r--r--include/linux/device.h14
-rw-r--r--include/linux/dm-ioctl.h11
-rw-r--r--include/linux/elevator.h1
-rw-r--r--include/linux/etherdevice.h3
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/linux/firmware.h2
-rw-r--r--include/linux/fs.h34
-rw-r--r--include/linux/fuse.h24
-rw-r--r--include/linux/hugetlb.h4
-rw-r--r--include/linux/hwmon-vid.h6
-rw-r--r--include/linux/i2c-id.h20
-rw-r--r--include/linux/i2c.h41
-rw-r--r--include/linux/i2o.h976
-rw-r--r--include/linux/if_pppox.h3
-rw-r--r--include/linux/inet.h2
-rw-r--r--include/linux/input.h79
-rw-r--r--include/linux/ip.h131
-rw-r--r--include/linux/ipv6.h79
-rw-r--r--include/linux/irq.h13
-rw-r--r--include/linux/jbd.h8
-rw-r--r--include/linux/key.h8
-rw-r--r--include/linux/kobject.h54
-rw-r--r--include/linux/kobject_uevent.h57
-rw-r--r--include/linux/libata.h24
-rw-r--r--include/linux/lockd/lockd.h2
-rw-r--r--include/linux/mempolicy.h38
-rw-r--r--include/linux/mm.h55
-rw-r--r--include/linux/mmzone.h44
-rw-r--r--include/linux/moduleparam.h2
-rw-r--r--include/linux/nbd.h8
-rw-r--r--include/linux/net.h4
-rw-r--r--include/linux/netdevice.h11
-rw-r--r--include/linux/netfilter/nfnetlink_conntrack.h5
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h6
-rw-r--r--include/linux/nfs_fs.h65
-rw-r--r--include/linux/nfs_idmap.h2
-rw-r--r--include/linux/nfs_page.h12
-rw-r--r--include/linux/nfs_xdr.h89
-rw-r--r--include/linux/nfsd/xdr.h3
-rw-r--r--include/linux/nfsd/xdr3.h1
-rw-r--r--include/linux/page-flags.h91
-rw-r--r--include/linux/parport.h1
-rw-r--r--include/linux/parport_pc.h4
-rw-r--r--include/linux/pci_ids.h16
-rw-r--r--include/linux/pfkeyv2.h13
-rw-r--r--include/linux/pkt_sched.h7
-rw-r--r--include/linux/platform_device.h1
-rw-r--r--include/linux/pnp.h9
-rw-r--r--include/linux/raid/md.h4
-rw-r--r--include/linux/raid/md_k.h80
-rw-r--r--include/linux/raid/raid1.h14
-rw-r--r--include/linux/raid/raid10.h22
-rw-r--r--include/linux/raid/raid5.h7
-rw-r--r--include/linux/ramfs.h10
-rw-r--r--include/linux/random.h6
-rw-r--r--include/linux/rmap.h1
-rw-r--r--include/linux/sched.h25
-rw-r--r--include/linux/security.h132
-rw-r--r--include/linux/skbuff.h5
-rw-r--r--include/linux/socket.h1
-rw-r--r--include/linux/spinlock.h3
-rw-r--r--include/linux/sunrpc/clnt.h5
-rw-r--r--include/linux/sunrpc/gss_spkm3.h2
-rw-r--r--include/linux/sunrpc/sched.h48
-rw-r--r--include/linux/sunrpc/xdr.h6
-rw-r--r--include/linux/sunrpc/xprt.h12
-rw-r--r--include/linux/suspend.h8
-rw-r--r--include/linux/swap.h2
-rw-r--r--include/linux/sysctl.h3
-rw-r--r--include/linux/tcp.h21
-rw-r--r--include/linux/udf_fs.h5
-rw-r--r--include/linux/udf_fs_i.h5
-rw-r--r--include/linux/udf_fs_sb.h5
-rw-r--r--include/linux/udp.h6
-rw-r--r--include/linux/usb.h35
-rw-r--r--include/linux/usb_usual.h126
-rw-r--r--include/linux/writeback.h15
-rw-r--r--include/linux/xfrm.h29
86 files changed, 1933 insertions, 1178 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index d2873b732bb1..94f77cce27fa 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -129,6 +129,7 @@ enum {
129 ATA_CMD_READ_EXT = 0x25, 129 ATA_CMD_READ_EXT = 0x25,
130 ATA_CMD_WRITE = 0xCA, 130 ATA_CMD_WRITE = 0xCA,
131 ATA_CMD_WRITE_EXT = 0x35, 131 ATA_CMD_WRITE_EXT = 0x35,
132 ATA_CMD_WRITE_FUA_EXT = 0x3D,
132 ATA_CMD_PIO_READ = 0x20, 133 ATA_CMD_PIO_READ = 0x20,
133 ATA_CMD_PIO_READ_EXT = 0x24, 134 ATA_CMD_PIO_READ_EXT = 0x24,
134 ATA_CMD_PIO_WRITE = 0x30, 135 ATA_CMD_PIO_WRITE = 0x30,
@@ -137,10 +138,13 @@ enum {
137 ATA_CMD_READ_MULTI_EXT = 0x29, 138 ATA_CMD_READ_MULTI_EXT = 0x29,
138 ATA_CMD_WRITE_MULTI = 0xC5, 139 ATA_CMD_WRITE_MULTI = 0xC5,
139 ATA_CMD_WRITE_MULTI_EXT = 0x39, 140 ATA_CMD_WRITE_MULTI_EXT = 0x39,
141 ATA_CMD_WRITE_MULTI_FUA_EXT = 0xCE,
140 ATA_CMD_SET_FEATURES = 0xEF, 142 ATA_CMD_SET_FEATURES = 0xEF,
141 ATA_CMD_PACKET = 0xA0, 143 ATA_CMD_PACKET = 0xA0,
142 ATA_CMD_VERIFY = 0x40, 144 ATA_CMD_VERIFY = 0x40,
143 ATA_CMD_VERIFY_EXT = 0x42, 145 ATA_CMD_VERIFY_EXT = 0x42,
146 ATA_CMD_STANDBYNOW1 = 0xE0,
147 ATA_CMD_IDLEIMMEDIATE = 0xE1,
144 ATA_CMD_INIT_DEV_PARAMS = 0x91, 148 ATA_CMD_INIT_DEV_PARAMS = 0x91,
145 149
146 /* SETFEATURES stuff */ 150 /* SETFEATURES stuff */
@@ -192,6 +196,7 @@ enum {
192 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ 196 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
193 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 197 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
194 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 198 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
199 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
195}; 200};
196 201
197enum ata_tf_protocols { 202enum ata_tf_protocols {
@@ -245,7 +250,8 @@ struct ata_taskfile {
245#define ata_id_is_sata(id) ((id)[93] == 0) 250#define ata_id_is_sata(id) ((id)[93] == 0)
246#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6)) 251#define ata_id_rahead_enabled(id) ((id)[85] & (1 << 6))
247#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5)) 252#define ata_id_wcache_enabled(id) ((id)[85] & (1 << 5))
248#define ata_id_has_flush(id) ((id)[83] & (1 << 12)) 253#define ata_id_has_fua(id) ((id)[84] & (1 << 6))
254#define ata_id_has_flush(id) ((id)[83] & (1 << 12))
249#define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13)) 255#define ata_id_has_flush_ext(id) ((id)[83] & (1 << 13))
250#define ata_id_has_lba48(id) ((id)[83] & (1 << 10)) 256#define ata_id_has_lba48(id) ((id)[83] & (1 << 10))
251#define ata_id_has_wcache(id) ((id)[82] & (1 << 5)) 257#define ata_id_has_wcache(id) ((id)[82] & (1 << 5))
diff --git a/include/linux/bio.h b/include/linux/bio.h
index 685fd3720df5..b60ffe32cd21 100644
--- a/include/linux/bio.h
+++ b/include/linux/bio.h
@@ -292,6 +292,8 @@ extern struct bio *bio_clone(struct bio *, gfp_t);
292extern void bio_init(struct bio *); 292extern void bio_init(struct bio *);
293 293
294extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); 294extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int);
295extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *,
296 unsigned int, unsigned int);
295extern int bio_get_nr_vecs(struct block_device *); 297extern int bio_get_nr_vecs(struct block_device *);
296extern struct bio *bio_map_user(struct request_queue *, struct block_device *, 298extern struct bio *bio_map_user(struct request_queue *, struct block_device *,
297 unsigned long, unsigned int, int); 299 unsigned long, unsigned int, int);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index 38c2fb7ebe09..6a2a19f14bb2 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -76,6 +76,15 @@ static __inline__ int generic_fls(int x)
76 */ 76 */
77#include <asm/bitops.h> 77#include <asm/bitops.h>
78 78
79
80static inline int generic_fls64(__u64 x)
81{
82 __u32 h = x >> 32;
83 if (h)
84 return fls(x) + 32;
85 return fls(x);
86}
87
79static __inline__ int get_bitmask_order(unsigned int count) 88static __inline__ int get_bitmask_order(unsigned int count)
80{ 89{
81 int order; 90 int order;
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index a33a31e71bbc..fb0985377421 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -102,7 +102,7 @@ void copy_io_context(struct io_context **pdst, struct io_context **psrc);
102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); 102void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
103 103
104struct request; 104struct request;
105typedef void (rq_end_io_fn)(struct request *); 105typedef void (rq_end_io_fn)(struct request *, int);
106 106
107struct request_list { 107struct request_list {
108 int count[2]; 108 int count[2];
@@ -184,6 +184,7 @@ struct request {
184 void *sense; 184 void *sense;
185 185
186 unsigned int timeout; 186 unsigned int timeout;
187 int retries;
187 188
188 /* 189 /*
189 * For Power Management requests 190 * For Power Management requests
@@ -206,6 +207,7 @@ enum rq_flag_bits {
206 __REQ_SORTED, /* elevator knows about this request */ 207 __REQ_SORTED, /* elevator knows about this request */
207 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 208 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
208 __REQ_HARDBARRIER, /* may not be passed by drive either */ 209 __REQ_HARDBARRIER, /* may not be passed by drive either */
210 __REQ_FUA, /* forced unit access */
209 __REQ_CMD, /* is a regular fs rw request */ 211 __REQ_CMD, /* is a regular fs rw request */
210 __REQ_NOMERGE, /* don't touch this for merging */ 212 __REQ_NOMERGE, /* don't touch this for merging */
211 __REQ_STARTED, /* drive already may have started this one */ 213 __REQ_STARTED, /* drive already may have started this one */
@@ -229,9 +231,7 @@ enum rq_flag_bits {
229 __REQ_PM_SUSPEND, /* suspend request */ 231 __REQ_PM_SUSPEND, /* suspend request */
230 __REQ_PM_RESUME, /* resume request */ 232 __REQ_PM_RESUME, /* resume request */
231 __REQ_PM_SHUTDOWN, /* shutdown request */ 233 __REQ_PM_SHUTDOWN, /* shutdown request */
232 __REQ_BAR_PREFLUSH, /* barrier pre-flush done */ 234 __REQ_ORDERED_COLOR, /* is before or after barrier */
233 __REQ_BAR_POSTFLUSH, /* barrier post-flush */
234 __REQ_BAR_FLUSH, /* rq is the flush request */
235 __REQ_NR_BITS, /* stops here */ 235 __REQ_NR_BITS, /* stops here */
236}; 236};
237 237
@@ -240,6 +240,7 @@ enum rq_flag_bits {
240#define REQ_SORTED (1 << __REQ_SORTED) 240#define REQ_SORTED (1 << __REQ_SORTED)
241#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) 241#define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER)
242#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) 242#define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER)
243#define REQ_FUA (1 << __REQ_FUA)
243#define REQ_CMD (1 << __REQ_CMD) 244#define REQ_CMD (1 << __REQ_CMD)
244#define REQ_NOMERGE (1 << __REQ_NOMERGE) 245#define REQ_NOMERGE (1 << __REQ_NOMERGE)
245#define REQ_STARTED (1 << __REQ_STARTED) 246#define REQ_STARTED (1 << __REQ_STARTED)
@@ -259,9 +260,7 @@ enum rq_flag_bits {
259#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND) 260#define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND)
260#define REQ_PM_RESUME (1 << __REQ_PM_RESUME) 261#define REQ_PM_RESUME (1 << __REQ_PM_RESUME)
261#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) 262#define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN)
262#define REQ_BAR_PREFLUSH (1 << __REQ_BAR_PREFLUSH) 263#define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR)
263#define REQ_BAR_POSTFLUSH (1 << __REQ_BAR_POSTFLUSH)
264#define REQ_BAR_FLUSH (1 << __REQ_BAR_FLUSH)
265 264
266/* 265/*
267 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME 266 * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME
@@ -291,8 +290,7 @@ struct bio_vec;
291typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *); 290typedef int (merge_bvec_fn) (request_queue_t *, struct bio *, struct bio_vec *);
292typedef void (activity_fn) (void *data, int rw); 291typedef void (activity_fn) (void *data, int rw);
293typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *); 292typedef int (issue_flush_fn) (request_queue_t *, struct gendisk *, sector_t *);
294typedef int (prepare_flush_fn) (request_queue_t *, struct request *); 293typedef void (prepare_flush_fn) (request_queue_t *, struct request *);
295typedef void (end_flush_fn) (request_queue_t *, struct request *);
296 294
297enum blk_queue_state { 295enum blk_queue_state {
298 Queue_down, 296 Queue_down,
@@ -334,7 +332,6 @@ struct request_queue
334 activity_fn *activity_fn; 332 activity_fn *activity_fn;
335 issue_flush_fn *issue_flush_fn; 333 issue_flush_fn *issue_flush_fn;
336 prepare_flush_fn *prepare_flush_fn; 334 prepare_flush_fn *prepare_flush_fn;
337 end_flush_fn *end_flush_fn;
338 335
339 /* 336 /*
340 * Dispatch queue sorting 337 * Dispatch queue sorting
@@ -419,14 +416,11 @@ struct request_queue
419 /* 416 /*
420 * reserved for flush operations 417 * reserved for flush operations
421 */ 418 */
422 struct request *flush_rq; 419 unsigned int ordered, next_ordered, ordseq;
423 unsigned char ordered; 420 int orderr, ordcolor;
424}; 421 struct request pre_flush_rq, bar_rq, post_flush_rq;
425 422 struct request *orig_bar_rq;
426enum { 423 unsigned int bi_size;
427 QUEUE_ORDERED_NONE,
428 QUEUE_ORDERED_TAG,
429 QUEUE_ORDERED_FLUSH,
430}; 424};
431 425
432#define RQ_INACTIVE (-1) 426#define RQ_INACTIVE (-1)
@@ -444,12 +438,51 @@ enum {
444#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 438#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
445#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 439#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
446#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ 440#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
447#define QUEUE_FLAG_FLUSH 9 /* doing barrier flush sequence */ 441
442enum {
443 /*
444 * Hardbarrier is supported with one of the following methods.
445 *
446 * NONE : hardbarrier unsupported
447 * DRAIN : ordering by draining is enough
448 * DRAIN_FLUSH : ordering by draining w/ pre and post flushes
449 * DRAIN_FUA : ordering by draining w/ pre flush and FUA write
450 * TAG : ordering by tag is enough
451 * TAG_FLUSH : ordering by tag w/ pre and post flushes
452 * TAG_FUA : ordering by tag w/ pre flush and FUA write
453 */
454 QUEUE_ORDERED_NONE = 0x00,
455 QUEUE_ORDERED_DRAIN = 0x01,
456 QUEUE_ORDERED_TAG = 0x02,
457
458 QUEUE_ORDERED_PREFLUSH = 0x10,
459 QUEUE_ORDERED_POSTFLUSH = 0x20,
460 QUEUE_ORDERED_FUA = 0x40,
461
462 QUEUE_ORDERED_DRAIN_FLUSH = QUEUE_ORDERED_DRAIN |
463 QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH,
464 QUEUE_ORDERED_DRAIN_FUA = QUEUE_ORDERED_DRAIN |
465 QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA,
466 QUEUE_ORDERED_TAG_FLUSH = QUEUE_ORDERED_TAG |
467 QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_POSTFLUSH,
468 QUEUE_ORDERED_TAG_FUA = QUEUE_ORDERED_TAG |
469 QUEUE_ORDERED_PREFLUSH | QUEUE_ORDERED_FUA,
470
471 /*
472 * Ordered operation sequence
473 */
474 QUEUE_ORDSEQ_STARTED = 0x01, /* flushing in progress */
475 QUEUE_ORDSEQ_DRAIN = 0x02, /* waiting for the queue to be drained */
476 QUEUE_ORDSEQ_PREFLUSH = 0x04, /* pre-flushing in progress */
477 QUEUE_ORDSEQ_BAR = 0x08, /* original barrier req in progress */
478 QUEUE_ORDSEQ_POSTFLUSH = 0x10, /* post-flushing in progress */
479 QUEUE_ORDSEQ_DONE = 0x20,
480};
448 481
449#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) 482#define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags)
450#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) 483#define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags)
451#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) 484#define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags)
452#define blk_queue_flushing(q) test_bit(QUEUE_FLAG_FLUSH, &(q)->queue_flags) 485#define blk_queue_flushing(q) ((q)->ordseq)
453 486
454#define blk_fs_request(rq) ((rq)->flags & REQ_CMD) 487#define blk_fs_request(rq) ((rq)->flags & REQ_CMD)
455#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) 488#define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC)
@@ -465,8 +498,7 @@ enum {
465 498
466#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) 499#define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED)
467#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) 500#define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER)
468#define blk_barrier_preflush(rq) ((rq)->flags & REQ_BAR_PREFLUSH) 501#define blk_fua_rq(rq) ((rq)->flags & REQ_FUA)
469#define blk_barrier_postflush(rq) ((rq)->flags & REQ_BAR_POSTFLUSH)
470 502
471#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 503#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
472 504
@@ -558,7 +590,8 @@ extern void blk_unregister_queue(struct gendisk *disk);
558extern void register_disk(struct gendisk *dev); 590extern void register_disk(struct gendisk *dev);
559extern void generic_make_request(struct bio *bio); 591extern void generic_make_request(struct bio *bio);
560extern void blk_put_request(struct request *); 592extern void blk_put_request(struct request *);
561extern void blk_end_sync_rq(struct request *rq); 593extern void __blk_put_request(request_queue_t *, struct request *);
594extern void blk_end_sync_rq(struct request *rq, int error);
562extern void blk_attempt_remerge(request_queue_t *, struct request *); 595extern void blk_attempt_remerge(request_queue_t *, struct request *);
563extern struct request *blk_get_request(request_queue_t *, int, gfp_t); 596extern struct request *blk_get_request(request_queue_t *, int, gfp_t);
564extern void blk_insert_request(request_queue_t *, struct request *, int, void *); 597extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
@@ -579,6 +612,9 @@ extern int blk_rq_map_kern(request_queue_t *, struct request *, void *, unsigned
579extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int); 612extern int blk_rq_map_user_iov(request_queue_t *, struct request *, struct sg_iovec *, int);
580extern int blk_execute_rq(request_queue_t *, struct gendisk *, 613extern int blk_execute_rq(request_queue_t *, struct gendisk *,
581 struct request *, int); 614 struct request *, int);
615extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *,
616 struct request *, int, rq_end_io_fn *);
617
582static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 618static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
583{ 619{
584 return bdev->bd_disk->queue; 620 return bdev->bd_disk->queue;
@@ -608,7 +644,7 @@ static inline void blk_run_address_space(struct address_space *mapping)
608 */ 644 */
609extern int end_that_request_first(struct request *, int, int); 645extern int end_that_request_first(struct request *, int, int);
610extern int end_that_request_chunk(struct request *, int, int); 646extern int end_that_request_chunk(struct request *, int, int);
611extern void end_that_request_last(struct request *); 647extern void end_that_request_last(struct request *, int);
612extern void end_request(struct request *req, int uptodate); 648extern void end_request(struct request *req, int uptodate);
613 649
614/* 650/*
@@ -659,11 +695,12 @@ extern void blk_queue_prep_rq(request_queue_t *, prep_rq_fn *pfn);
659extern void blk_queue_merge_bvec(request_queue_t *, merge_bvec_fn *); 695extern void blk_queue_merge_bvec(request_queue_t *, merge_bvec_fn *);
660extern void blk_queue_dma_alignment(request_queue_t *, int); 696extern void blk_queue_dma_alignment(request_queue_t *, int);
661extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); 697extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev);
662extern void blk_queue_ordered(request_queue_t *, int); 698extern int blk_queue_ordered(request_queue_t *, unsigned, prepare_flush_fn *);
663extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *); 699extern void blk_queue_issue_flush_fn(request_queue_t *, issue_flush_fn *);
664extern struct request *blk_start_pre_flush(request_queue_t *,struct request *); 700extern int blk_do_ordered(request_queue_t *, struct request **);
665extern int blk_complete_barrier_rq(request_queue_t *, struct request *, int); 701extern unsigned blk_ordered_cur_seq(request_queue_t *);
666extern int blk_complete_barrier_rq_locked(request_queue_t *, struct request *, int); 702extern unsigned blk_ordered_req_seq(struct request *);
703extern void blk_ordered_complete_seq(request_queue_t *, unsigned, int);
667 704
668extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); 705extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *);
669extern void blk_dump_rq_flags(struct request *, char *); 706extern void blk_dump_rq_flags(struct request *, char *);
@@ -696,7 +733,8 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *);
696 733
697#define MAX_PHYS_SEGMENTS 128 734#define MAX_PHYS_SEGMENTS 128
698#define MAX_HW_SEGMENTS 128 735#define MAX_HW_SEGMENTS 128
699#define MAX_SECTORS 255 736#define SAFE_MAX_SECTORS 255
737#define BLK_DEF_MAX_SECTORS 1024
700 738
701#define MAX_SEGMENT_SIZE 65536 739#define MAX_SEGMENT_SIZE 65536
702 740
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index 3b03b0b868dd..993da8cc9706 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -43,50 +43,38 @@ typedef struct bootmem_data {
43extern unsigned long __init bootmem_bootmap_pages (unsigned long); 43extern unsigned long __init bootmem_bootmap_pages (unsigned long);
44extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); 44extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend);
45extern void __init free_bootmem (unsigned long addr, unsigned long size); 45extern void __init free_bootmem (unsigned long addr, unsigned long size);
46extern void * __init __alloc_bootmem_limit (unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); 46extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal);
47extern void * __init __alloc_bootmem_low(unsigned long size,
48 unsigned long align,
49 unsigned long goal);
50extern void * __init __alloc_bootmem_low_node(pg_data_t *pgdat,
51 unsigned long size,
52 unsigned long align,
53 unsigned long goal);
47#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 54#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
48extern void __init reserve_bootmem (unsigned long addr, unsigned long size); 55extern void __init reserve_bootmem (unsigned long addr, unsigned long size);
49#define alloc_bootmem(x) \ 56#define alloc_bootmem(x) \
50 __alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 57 __alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
51#define alloc_bootmem_low(x) \ 58#define alloc_bootmem_low(x) \
52 __alloc_bootmem((x), SMP_CACHE_BYTES, 0) 59 __alloc_bootmem_low((x), SMP_CACHE_BYTES, 0)
53#define alloc_bootmem_pages(x) \ 60#define alloc_bootmem_pages(x) \
54 __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) 61 __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
55#define alloc_bootmem_low_pages(x) \ 62#define alloc_bootmem_low_pages(x) \
56 __alloc_bootmem((x), PAGE_SIZE, 0) 63 __alloc_bootmem_low((x), PAGE_SIZE, 0)
57
58#define alloc_bootmem_limit(x, limit) \
59 __alloc_bootmem_limit((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit))
60#define alloc_bootmem_low_limit(x, limit) \
61 __alloc_bootmem_limit((x), SMP_CACHE_BYTES, 0, (limit))
62#define alloc_bootmem_pages_limit(x, limit) \
63 __alloc_bootmem_limit((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit))
64#define alloc_bootmem_low_pages_limit(x, limit) \
65 __alloc_bootmem_limit((x), PAGE_SIZE, 0, (limit))
66
67#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 64#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
68extern unsigned long __init free_all_bootmem (void); 65extern unsigned long __init free_all_bootmem (void);
69 66extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal);
70extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); 67extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn);
71extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); 68extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size);
72extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); 69extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size);
73extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); 70extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat);
74extern void * __init __alloc_bootmem_node_limit (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit);
75#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 71#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
76#define alloc_bootmem_node(pgdat, x) \ 72#define alloc_bootmem_node(pgdat, x) \
77 __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) 73 __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS))
78#define alloc_bootmem_pages_node(pgdat, x) \ 74#define alloc_bootmem_pages_node(pgdat, x) \
79 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) 75 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS))
80#define alloc_bootmem_low_pages_node(pgdat, x) \ 76#define alloc_bootmem_low_pages_node(pgdat, x) \
81 __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) 77 __alloc_bootmem_low_node((pgdat), (x), PAGE_SIZE, 0)
82
83#define alloc_bootmem_node_limit(pgdat, x, limit) \
84 __alloc_bootmem_node_limit((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit))
85#define alloc_bootmem_pages_node_limit(pgdat, x, limit) \
86 __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit))
87#define alloc_bootmem_low_pages_node_limit(pgdat, x, limit) \
88 __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, 0, (limit))
89
90#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 78#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
91 79
92#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP 80#ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP
@@ -123,15 +111,5 @@ extern void *__init alloc_large_system_hash(const char *tablename,
123#endif 111#endif
124extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ 112extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */
125 113
126static inline void *__alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal)
127{
128 return __alloc_bootmem_limit(size, align, goal, 0);
129}
130
131static inline void *__alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align,
132 unsigned long goal)
133{
134 return __alloc_bootmem_node_limit(pgdat, size, align, goal, 0);
135}
136 114
137#endif /* _LINUX_BOOTMEM_H */ 115#endif /* _LINUX_BOOTMEM_H */
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
new file mode 100644
index 000000000000..acffb8c9073a
--- /dev/null
+++ b/include/linux/configfs.h
@@ -0,0 +1,205 @@
1/* -*- mode: c; c-basic-offset: 8; -*-
2 * vim: noexpandtab sw=8 ts=8 sts=0:
3 *
4 * configfs.h - definitions for the device driver filesystem
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 021110-1307, USA.
20 *
21 * Based on sysfs:
22 * sysfs is Copyright (C) 2001, 2002, 2003 Patrick Mochel
23 *
24 * Based on kobject.h:
25 * Copyright (c) 2002-2003 Patrick Mochel
26 * Copyright (c) 2002-2003 Open Source Development Labs
27 *
28 * configfs Copyright (C) 2005 Oracle. All rights reserved.
29 *
30 * Please read Documentation/filesystems/configfs.txt before using the
31 * configfs interface, ESPECIALLY the parts about reference counts and
32 * item destructors.
33 */
34
35#ifndef _CONFIGFS_H_
36#define _CONFIGFS_H_
37
38#ifdef __KERNEL__
39
40#include <linux/types.h>
41#include <linux/list.h>
42#include <linux/kref.h>
43
44#include <asm/atomic.h>
45#include <asm/semaphore.h>
46
47#define CONFIGFS_ITEM_NAME_LEN 20
48
49struct module;
50
51struct configfs_item_operations;
52struct configfs_group_operations;
53struct configfs_attribute;
54struct configfs_subsystem;
55
56struct config_item {
57 char *ci_name;
58 char ci_namebuf[CONFIGFS_ITEM_NAME_LEN];
59 struct kref ci_kref;
60 struct list_head ci_entry;
61 struct config_item *ci_parent;
62 struct config_group *ci_group;
63 struct config_item_type *ci_type;
64 struct dentry *ci_dentry;
65};
66
67extern int config_item_set_name(struct config_item *, const char *, ...);
68
69static inline char *config_item_name(struct config_item * item)
70{
71 return item->ci_name;
72}
73
74extern void config_item_init(struct config_item *);
75extern void config_item_init_type_name(struct config_item *item,
76 const char *name,
77 struct config_item_type *type);
78extern void config_item_cleanup(struct config_item *);
79
80extern struct config_item * config_item_get(struct config_item *);
81extern void config_item_put(struct config_item *);
82
83struct config_item_type {
84 struct module *ct_owner;
85 struct configfs_item_operations *ct_item_ops;
86 struct configfs_group_operations *ct_group_ops;
87 struct configfs_attribute **ct_attrs;
88};
89
90
91/**
92 * group - a group of config_items of a specific type, belonging
93 * to a specific subsystem.
94 */
95
96struct config_group {
97 struct config_item cg_item;
98 struct list_head cg_children;
99 struct configfs_subsystem *cg_subsys;
100 struct config_group **default_groups;
101};
102
103
104extern void config_group_init(struct config_group *group);
105extern void config_group_init_type_name(struct config_group *group,
106 const char *name,
107 struct config_item_type *type);
108
109
110static inline struct config_group *to_config_group(struct config_item *item)
111{
112 return item ? container_of(item,struct config_group,cg_item) : NULL;
113}
114
115static inline struct config_group *config_group_get(struct config_group *group)
116{
117 return group ? to_config_group(config_item_get(&group->cg_item)) : NULL;
118}
119
120static inline void config_group_put(struct config_group *group)
121{
122 config_item_put(&group->cg_item);
123}
124
125extern struct config_item *config_group_find_obj(struct config_group *, const char *);
126
127
128struct configfs_attribute {
129 char *ca_name;
130 struct module *ca_owner;
131 mode_t ca_mode;
132};
133
134
135/*
136 * If allow_link() exists, the item can symlink(2) out to other
137 * items. If the item is a group, it may support mkdir(2).
138 * Groups supply one of make_group() and make_item(). If the
139 * group supports make_group(), one can create group children. If it
140 * supports make_item(), one can create config_item children. If it has
141 * default_groups on group->default_groups, it has automatically created
142 * group children. default_groups may coexist alongsize make_group() or
143 * make_item(), but if the group wishes to have only default_groups
144 * children (disallowing mkdir(2)), it need not provide either function.
145 * If the group has commit(), it supports pending and commited (active)
146 * items.
147 */
148struct configfs_item_operations {
149 void (*release)(struct config_item *);
150 ssize_t (*show_attribute)(struct config_item *, struct configfs_attribute *,char *);
151 ssize_t (*store_attribute)(struct config_item *,struct configfs_attribute *,const char *, size_t);
152 int (*allow_link)(struct config_item *src, struct config_item *target);
153 int (*drop_link)(struct config_item *src, struct config_item *target);
154};
155
156struct configfs_group_operations {
157 struct config_item *(*make_item)(struct config_group *group, const char *name);
158 struct config_group *(*make_group)(struct config_group *group, const char *name);
159 int (*commit_item)(struct config_item *item);
160 void (*drop_item)(struct config_group *group, struct config_item *item);
161};
162
163
164
165/**
166 * Use these macros to make defining attributes easier. See include/linux/device.h
167 * for examples..
168 */
169
170#if 0
171#define __ATTR(_name,_mode,_show,_store) { \
172 .attr = {.ca_name = __stringify(_name), .ca_mode = _mode, .ca_owner = THIS_MODULE }, \
173 .show = _show, \
174 .store = _store, \
175}
176
177#define __ATTR_RO(_name) { \
178 .attr = { .ca_name = __stringify(_name), .ca_mode = 0444, .ca_owner = THIS_MODULE }, \
179 .show = _name##_show, \
180}
181
182#define __ATTR_NULL { .attr = { .name = NULL } }
183
184#define attr_name(_attr) (_attr).attr.name
185#endif
186
187
188struct configfs_subsystem {
189 struct config_group su_group;
190 struct semaphore su_sem;
191};
192
193static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group)
194{
195 return group ?
196 container_of(group, struct configfs_subsystem, su_group) :
197 NULL;
198}
199
200int configfs_register_subsystem(struct configfs_subsystem *subsys);
201void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
202
203#endif /* __KERNEL__ */
204
205#endif /* _CONFIGFS_H_ */
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index d068176b7ad7..c31650df9241 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -256,6 +256,16 @@ int cpufreq_update_policy(unsigned int cpu);
256/* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */ 256/* query the current CPU frequency (in kHz). If zero, cpufreq couldn't detect it */
257unsigned int cpufreq_get(unsigned int cpu); 257unsigned int cpufreq_get(unsigned int cpu);
258 258
259/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
260#ifdef CONFIG_CPU_FREQ
261unsigned int cpufreq_quick_get(unsigned int cpu);
262#else
263static inline unsigned int cpufreq_quick_get(unsigned int cpu)
264{
265 return 0;
266}
267#endif
268
259 269
260/********************************************************************* 270/*********************************************************************
261 * CPUFREQ DEFAULT GOVERNOR * 271 * CPUFREQ DEFAULT GOVERNOR *
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index 71fab4311e92..088529f54965 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -192,10 +192,9 @@ enum {
192#include <linux/workqueue.h> 192#include <linux/workqueue.h>
193 193
194#include <net/inet_connection_sock.h> 194#include <net/inet_connection_sock.h>
195#include <net/inet_sock.h>
195#include <net/inet_timewait_sock.h> 196#include <net/inet_timewait_sock.h>
196#include <net/sock.h>
197#include <net/tcp_states.h> 197#include <net/tcp_states.h>
198#include <net/tcp.h>
199 198
200enum dccp_state { 199enum dccp_state {
201 DCCP_OPEN = TCP_ESTABLISHED, 200 DCCP_OPEN = TCP_ESTABLISHED,
@@ -408,8 +407,6 @@ struct dccp_ackvec;
408 * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss 407 * @dccps_gar - greatest valid ack number received on a non-Sync; initialized to %dccps_iss
409 * @dccps_timestamp_time - time of latest TIMESTAMP option 408 * @dccps_timestamp_time - time of latest TIMESTAMP option
410 * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option 409 * @dccps_timestamp_echo - latest timestamp received on a TIMESTAMP option
411 * @dccps_ext_header_len - network protocol overhead (IP/IPv6 options)
412 * @dccps_pmtu_cookie - Last pmtu seen by socket
413 * @dccps_packet_size - Set thru setsockopt 410 * @dccps_packet_size - Set thru setsockopt
414 * @dccps_role - Role of this sock, one of %dccp_role 411 * @dccps_role - Role of this sock, one of %dccp_role
415 * @dccps_ndp_count - number of Non Data Packets since last data packet 412 * @dccps_ndp_count - number of Non Data Packets since last data packet
@@ -434,8 +431,6 @@ struct dccp_sock {
434 __u32 dccps_timestamp_echo; 431 __u32 dccps_timestamp_echo;
435 __u32 dccps_packet_size; 432 __u32 dccps_packet_size;
436 unsigned long dccps_ndp_count; 433 unsigned long dccps_ndp_count;
437 __u16 dccps_ext_header_len;
438 __u32 dccps_pmtu_cookie;
439 __u32 dccps_mss_cache; 434 __u32 dccps_mss_cache;
440 struct dccp_options dccps_options; 435 struct dccp_options dccps_options;
441 struct dccp_ackvec *dccps_hc_rx_ackvec; 436 struct dccp_ackvec *dccps_hc_rx_ackvec;
diff --git a/include/linux/device.h b/include/linux/device.h
index 17cbc6db67b4..0cdee78e5ce1 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -47,8 +47,8 @@ struct bus_type {
47 struct driver_attribute * drv_attrs; 47 struct driver_attribute * drv_attrs;
48 48
49 int (*match)(struct device * dev, struct device_driver * drv); 49 int (*match)(struct device * dev, struct device_driver * drv);
50 int (*hotplug) (struct device *dev, char **envp, 50 int (*uevent)(struct device *dev, char **envp,
51 int num_envp, char *buffer, int buffer_size); 51 int num_envp, char *buffer, int buffer_size);
52 int (*suspend)(struct device * dev, pm_message_t state); 52 int (*suspend)(struct device * dev, pm_message_t state);
53 int (*resume)(struct device * dev); 53 int (*resume)(struct device * dev);
54}; 54};
@@ -151,7 +151,7 @@ struct class {
151 struct class_attribute * class_attrs; 151 struct class_attribute * class_attrs;
152 struct class_device_attribute * class_dev_attrs; 152 struct class_device_attribute * class_dev_attrs;
153 153
154 int (*hotplug)(struct class_device *dev, char **envp, 154 int (*uevent)(struct class_device *dev, char **envp,
155 int num_envp, char *buffer, int buffer_size); 155 int num_envp, char *buffer, int buffer_size);
156 156
157 void (*release)(struct class_device *dev); 157 void (*release)(struct class_device *dev);
@@ -209,9 +209,9 @@ extern int class_device_create_file(struct class_device *,
209 * set, this will be called instead of the class specific release function. 209 * set, this will be called instead of the class specific release function.
210 * Only use this if you want to override the default release function, like 210 * Only use this if you want to override the default release function, like
211 * when you are nesting class_device structures. 211 * when you are nesting class_device structures.
212 * @hotplug: pointer to a hotplug function for this struct class_device. If 212 * @uevent: pointer to a uevent function for this struct class_device. If
213 * set, this will be called instead of the class specific hotplug function. 213 * set, this will be called instead of the class specific uevent function.
214 * Only use this if you want to override the default hotplug function, like 214 * Only use this if you want to override the default uevent function, like
215 * when you are nesting class_device structures. 215 * when you are nesting class_device structures.
216 */ 216 */
217struct class_device { 217struct class_device {
@@ -227,7 +227,7 @@ struct class_device {
227 struct class_device *parent; /* parent of this child device, if there is one */ 227 struct class_device *parent; /* parent of this child device, if there is one */
228 228
229 void (*release)(struct class_device *dev); 229 void (*release)(struct class_device *dev);
230 int (*hotplug)(struct class_device *dev, char **envp, 230 int (*uevent)(struct class_device *dev, char **envp,
231 int num_envp, char *buffer, int buffer_size); 231 int num_envp, char *buffer, int buffer_size);
232 char class_id[BUS_ID_SIZE]; /* unique to this class */ 232 char class_id[BUS_ID_SIZE]; /* unique to this class */
233}; 233};
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index f5eb6b6cd109..fa75ba0d635e 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -272,9 +272,9 @@ typedef char ioctl_struct[308];
272#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) 272#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
273 273
274#define DM_VERSION_MAJOR 4 274#define DM_VERSION_MAJOR 4
275#define DM_VERSION_MINOR 4 275#define DM_VERSION_MINOR 5
276#define DM_VERSION_PATCHLEVEL 0 276#define DM_VERSION_PATCHLEVEL 0
277#define DM_VERSION_EXTRA "-ioctl (2005-01-12)" 277#define DM_VERSION_EXTRA "-ioctl (2005-10-04)"
278 278
279/* Status bits */ 279/* Status bits */
280#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 280#define DM_READONLY_FLAG (1 << 0) /* In/Out */
@@ -301,8 +301,13 @@ typedef char ioctl_struct[308];
301#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */ 301#define DM_BUFFER_FULL_FLAG (1 << 8) /* Out */
302 302
303/* 303/*
304 * Set this to improve performance when you aren't going to use open_count 304 * Set this to improve performance when you aren't going to use open_count.
305 */ 305 */
306#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */ 306#define DM_SKIP_BDGET_FLAG (1 << 9) /* In */
307 307
308/*
309 * Set this to avoid attempting to freeze any filesystem when suspending.
310 */
311#define DM_SKIP_LOCKFS_FLAG (1 << 10) /* In */
312
308#endif /* _LINUX_DM_IOCTL_H */ 313#endif /* _LINUX_DM_IOCTL_H */
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index a74c27e460ba..fb80fa44c4dd 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -130,6 +130,7 @@ extern int elv_try_last_merge(request_queue_t *, struct bio *);
130#define ELEVATOR_INSERT_FRONT 1 130#define ELEVATOR_INSERT_FRONT 1
131#define ELEVATOR_INSERT_BACK 2 131#define ELEVATOR_INSERT_BACK 2
132#define ELEVATOR_INSERT_SORT 3 132#define ELEVATOR_INSERT_SORT 3
133#define ELEVATOR_INSERT_REQUEUE 4
133 134
134/* 135/*
135 * return values from elevator_may_queue_fn 136 * return values from elevator_may_queue_fn
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 5f49a30eb6f2..745c988359c0 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -63,10 +63,11 @@ static inline int is_zero_ether_addr(const u8 *addr)
63 * @addr: Pointer to a six-byte array containing the Ethernet address 63 * @addr: Pointer to a six-byte array containing the Ethernet address
64 * 64 *
65 * Return true if the address is a multicast address. 65 * Return true if the address is a multicast address.
66 * By definition the broadcast address is also a multicast address.
66 */ 67 */
67static inline int is_multicast_ether_addr(const u8 *addr) 68static inline int is_multicast_ether_addr(const u8 *addr)
68{ 69{
69 return ((addr[0] != 0xff) && (0x01 & addr[0])); 70 return (0x01 & addr[0]);
70} 71}
71 72
72/** 73/**
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 3ba843c46382..c6cb8f095088 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -143,7 +143,7 @@ static inline unsigned int sk_filter_len(struct sk_filter *fp)
143struct sk_buff; 143struct sk_buff;
144struct sock; 144struct sock;
145 145
146extern int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen); 146extern unsigned int sk_run_filter(struct sk_buff *skb, struct sock_filter *filter, int flen);
147extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 147extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
148extern int sk_chk_filter(struct sock_filter *filter, int flen); 148extern int sk_chk_filter(struct sock_filter *filter, int flen);
149#endif /* __KERNEL__ */ 149#endif /* __KERNEL__ */
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 2063c0839d4f..2d716080be4a 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -14,7 +14,7 @@ struct device;
14int request_firmware(const struct firmware **fw, const char *name, 14int request_firmware(const struct firmware **fw, const char *name,
15 struct device *device); 15 struct device *device);
16int request_firmware_nowait( 16int request_firmware_nowait(
17 struct module *module, int hotplug, 17 struct module *module, int uevent,
18 const char *name, struct device *device, void *context, 18 const char *name, struct device *device, void *context,
19 void (*cont)(const struct firmware *fw, void *context)); 19 void (*cont)(const struct firmware *fw, void *context));
20 20
diff --git a/include/linux/fs.h b/include/linux/fs.h
index cc35b6ac778d..2c9c48d65630 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -302,6 +302,37 @@ struct iattr {
302 */ 302 */
303#include <linux/quota.h> 303#include <linux/quota.h>
304 304
305/**
306 * enum positive_aop_returns - aop return codes with specific semantics
307 *
308 * @AOP_WRITEPAGE_ACTIVATE: Informs the caller that page writeback has
309 * completed, that the page is still locked, and
310 * should be considered active. The VM uses this hint
311 * to return the page to the active list -- it won't
312 * be a candidate for writeback again in the near
313 * future. Other callers must be careful to unlock
314 * the page if they get this return. Returned by
315 * writepage();
316 *
317 * @AOP_TRUNCATED_PAGE: The AOP method that was handed a locked page has
318 * unlocked it and the page might have been truncated.
319 * The caller should back up to acquiring a new page and
320 * trying again. The aop will be taking reasonable
321 * precautions not to livelock. If the caller held a page
322 * reference, it should drop it before retrying. Returned
323 * by readpage(), prepare_write(), and commit_write().
324 *
325 * address_space_operation functions return these large constants to indicate
326 * special semantics to the caller. These are much larger than the bytes in a
327 * page to allow for functions that return the number of bytes operated on in a
328 * given page.
329 */
330
331enum positive_aop_returns {
332 AOP_WRITEPAGE_ACTIVATE = 0x80000,
333 AOP_TRUNCATED_PAGE = 0x80001,
334};
335
305/* 336/*
306 * oh the beauties of C type declarations. 337 * oh the beauties of C type declarations.
307 */ 338 */
@@ -729,7 +760,7 @@ extern struct file_lock *posix_test_lock(struct file *, struct file_lock *);
729extern int posix_lock_file(struct file *, struct file_lock *); 760extern int posix_lock_file(struct file *, struct file_lock *);
730extern int posix_lock_file_wait(struct file *, struct file_lock *); 761extern int posix_lock_file_wait(struct file *, struct file_lock *);
731extern void posix_block_lock(struct file_lock *, struct file_lock *); 762extern void posix_block_lock(struct file_lock *, struct file_lock *);
732extern void posix_unblock_lock(struct file *, struct file_lock *); 763extern int posix_unblock_lock(struct file *, struct file_lock *);
733extern int posix_locks_deadlock(struct file_lock *, struct file_lock *); 764extern int posix_locks_deadlock(struct file_lock *, struct file_lock *);
734extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl); 765extern int flock_lock_file_wait(struct file *filp, struct file_lock *fl);
735extern int __break_lease(struct inode *inode, unsigned int flags); 766extern int __break_lease(struct inode *inode, unsigned int flags);
@@ -1019,6 +1050,7 @@ struct inode_operations {
1019 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t); 1050 ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
1020 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1051 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1021 int (*removexattr) (struct dentry *, const char *); 1052 int (*removexattr) (struct dentry *, const char *);
1053 void (*truncate_range)(struct inode *, loff_t, loff_t);
1022}; 1054};
1023 1055
1024struct seq_file; 1056struct seq_file;
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index b76b558b03d4..528959c52f1b 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -14,7 +14,7 @@
14#define FUSE_KERNEL_VERSION 7 14#define FUSE_KERNEL_VERSION 7
15 15
16/** Minor version number of this interface */ 16/** Minor version number of this interface */
17#define FUSE_KERNEL_MINOR_VERSION 3 17#define FUSE_KERNEL_MINOR_VERSION 5
18 18
19/** The node ID of the root inode */ 19/** The node ID of the root inode */
20#define FUSE_ROOT_ID 1 20#define FUSE_ROOT_ID 1
@@ -53,6 +53,9 @@ struct fuse_kstatfs {
53 __u64 ffree; 53 __u64 ffree;
54 __u32 bsize; 54 __u32 bsize;
55 __u32 namelen; 55 __u32 namelen;
56 __u32 frsize;
57 __u32 padding;
58 __u32 spare[6];
56}; 59};
57 60
58#define FATTR_MODE (1 << 0) 61#define FATTR_MODE (1 << 0)
@@ -105,12 +108,8 @@ enum fuse_opcode {
105 FUSE_CREATE = 35 108 FUSE_CREATE = 35
106}; 109};
107 110
108/* Conservative buffer size for the client */ 111/* The read buffer is required to be at least 8k, but may be much larger */
109#define FUSE_MAX_IN 8192 112#define FUSE_MIN_READ_BUFFER 8192
110
111#define FUSE_NAME_MAX 1024
112#define FUSE_SYMLINK_MAX 4096
113#define FUSE_XATTR_SIZE_MAX 4096
114 113
115struct fuse_entry_out { 114struct fuse_entry_out {
116 __u64 nodeid; /* Inode ID */ 115 __u64 nodeid; /* Inode ID */
@@ -213,6 +212,8 @@ struct fuse_write_out {
213 __u32 padding; 212 __u32 padding;
214}; 213};
215 214
215#define FUSE_COMPAT_STATFS_SIZE 48
216
216struct fuse_statfs_out { 217struct fuse_statfs_out {
217 struct fuse_kstatfs st; 218 struct fuse_kstatfs st;
218}; 219};
@@ -243,9 +244,16 @@ struct fuse_access_in {
243 __u32 padding; 244 __u32 padding;
244}; 245};
245 246
246struct fuse_init_in_out { 247struct fuse_init_in {
248 __u32 major;
249 __u32 minor;
250};
251
252struct fuse_init_out {
247 __u32 major; 253 __u32 major;
248 __u32 minor; 254 __u32 minor;
255 __u32 unused[3];
256 __u32 max_write;
249}; 257};
250 258
251struct fuse_in_header { 259struct fuse_in_header {
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 1056717ee501..68d82ad6b17c 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -22,7 +22,7 @@ int hugetlb_report_meminfo(char *);
22int hugetlb_report_node_meminfo(int, char *); 22int hugetlb_report_node_meminfo(int, char *);
23int is_hugepage_mem_enough(size_t); 23int is_hugepage_mem_enough(size_t);
24unsigned long hugetlb_total_pages(void); 24unsigned long hugetlb_total_pages(void);
25struct page *alloc_huge_page(void); 25struct page *alloc_huge_page(struct vm_area_struct *, unsigned long);
26void free_huge_page(struct page *); 26void free_huge_page(struct page *);
27int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, 27int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma,
28 unsigned long address, int write_access); 28 unsigned long address, int write_access);
@@ -97,7 +97,7 @@ static inline unsigned long hugetlb_total_pages(void)
97#define is_hugepage_only_range(mm, addr, len) 0 97#define is_hugepage_only_range(mm, addr, len) 0
98#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \ 98#define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) \
99 do { } while (0) 99 do { } while (0)
100#define alloc_huge_page() ({ NULL; }) 100#define alloc_huge_page(vma, addr) ({ NULL; })
101#define free_huge_page(p) ({ (void)(p); BUG(); }) 101#define free_huge_page(p) ({ (void)(p); BUG(); })
102#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) 102#define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; })
103 103
diff --git a/include/linux/hwmon-vid.h b/include/linux/hwmon-vid.h
index cd4b7a042b86..f346e4d5381c 100644
--- a/include/linux/hwmon-vid.h
+++ b/include/linux/hwmon-vid.h
@@ -23,14 +23,14 @@
23#ifndef _LINUX_HWMON_VID_H 23#ifndef _LINUX_HWMON_VID_H
24#define _LINUX_HWMON_VID_H 24#define _LINUX_HWMON_VID_H
25 25
26int vid_from_reg(int val, int vrm); 26int vid_from_reg(int val, u8 vrm);
27int vid_which_vrm(void); 27u8 vid_which_vrm(void);
28 28
29/* vrm is the VRM/VRD document version multiplied by 10. 29/* vrm is the VRM/VRD document version multiplied by 10.
30 val is in mV to avoid floating point in the kernel. 30 val is in mV to avoid floating point in the kernel.
31 Returned value is the 4-, 5- or 6-bit VID code. 31 Returned value is the 4-, 5- or 6-bit VID code.
32 Note that only VRM 9.x is supported for now. */ 32 Note that only VRM 9.x is supported for now. */
33static inline int vid_to_reg(int val, int vrm) 33static inline int vid_to_reg(int val, u8 vrm)
34{ 34{
35 switch (vrm) { 35 switch (vrm) {
36 case 91: /* VRM 9.1 */ 36 case 91: /* VRM 9.1 */
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h
index 006c81ef4d50..fb46f8d56999 100644
--- a/include/linux/i2c-id.h
+++ b/include/linux/i2c-id.h
@@ -25,12 +25,6 @@
25 25
26/* 26/*
27 * ---- Driver types ----------------------------------------------------- 27 * ---- Driver types -----------------------------------------------------
28 * device id name + number function description, i2c address(es)
29 *
30 * Range 1000-1999 range is defined in sensors/sensors.h
31 * Range 0x100 - 0x1ff is for V4L2 Common Components
32 * Range 0xf000 - 0xffff is reserved for local experimentation, and should
33 * never be used in official drivers
34 */ 28 */
35 29
36#define I2C_DRIVERID_MSP3400 1 30#define I2C_DRIVERID_MSP3400 1
@@ -110,13 +104,7 @@
110#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */ 104#define I2C_DRIVERID_AKITAIOEXP 74 /* IO Expander on Sharp SL-C1000 */
111#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */ 105#define I2C_DRIVERID_INFRARED 75 /* I2C InfraRed on Video boards */
112 106
113#define I2C_DRIVERID_EXP0 0xF0 /* experimental use id's */
114#define I2C_DRIVERID_EXP1 0xF1
115#define I2C_DRIVERID_EXP2 0xF2
116#define I2C_DRIVERID_EXP3 0xF3
117
118#define I2C_DRIVERID_I2CDEV 900 107#define I2C_DRIVERID_I2CDEV 900
119#define I2C_DRIVERID_I2CPROC 901
120#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */ 108#define I2C_DRIVERID_ARP 902 /* SMBus ARP Client */
121#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */ 109#define I2C_DRIVERID_ALERT 903 /* SMBus Alert Responder Client */
122 110
@@ -131,15 +119,12 @@
131#define I2C_DRIVERID_ADM1021 1008 119#define I2C_DRIVERID_ADM1021 1008
132#define I2C_DRIVERID_ADM9240 1009 120#define I2C_DRIVERID_ADM9240 1009
133#define I2C_DRIVERID_LTC1710 1010 121#define I2C_DRIVERID_LTC1710 1010
134#define I2C_DRIVERID_SIS5595 1011
135#define I2C_DRIVERID_ICSPLL 1012 122#define I2C_DRIVERID_ICSPLL 1012
136#define I2C_DRIVERID_BT869 1013 123#define I2C_DRIVERID_BT869 1013
137#define I2C_DRIVERID_MAXILIFE 1014 124#define I2C_DRIVERID_MAXILIFE 1014
138#define I2C_DRIVERID_MATORB 1015 125#define I2C_DRIVERID_MATORB 1015
139#define I2C_DRIVERID_GL520 1016 126#define I2C_DRIVERID_GL520 1016
140#define I2C_DRIVERID_THMC50 1017 127#define I2C_DRIVERID_THMC50 1017
141#define I2C_DRIVERID_DDCMON 1018
142#define I2C_DRIVERID_VIA686A 1019
143#define I2C_DRIVERID_ADM1025 1020 128#define I2C_DRIVERID_ADM1025 1020
144#define I2C_DRIVERID_LM87 1021 129#define I2C_DRIVERID_LM87 1021
145#define I2C_DRIVERID_PCF8574 1022 130#define I2C_DRIVERID_PCF8574 1022
@@ -151,21 +136,16 @@
151#define I2C_DRIVERID_FSCPOS 1028 136#define I2C_DRIVERID_FSCPOS 1028
152#define I2C_DRIVERID_FSCSCY 1029 137#define I2C_DRIVERID_FSCSCY 1029
153#define I2C_DRIVERID_PCF8591 1030 138#define I2C_DRIVERID_PCF8591 1030
154#define I2C_DRIVERID_SMSC47M1 1031
155#define I2C_DRIVERID_VT1211 1032
156#define I2C_DRIVERID_LM92 1033 139#define I2C_DRIVERID_LM92 1033
157#define I2C_DRIVERID_VT8231 1034
158#define I2C_DRIVERID_SMARTBATT 1035 140#define I2C_DRIVERID_SMARTBATT 1035
159#define I2C_DRIVERID_BMCSENSORS 1036 141#define I2C_DRIVERID_BMCSENSORS 1036
160#define I2C_DRIVERID_FS451 1037 142#define I2C_DRIVERID_FS451 1037
161#define I2C_DRIVERID_W83627HF 1038
162#define I2C_DRIVERID_LM85 1039 143#define I2C_DRIVERID_LM85 1039
163#define I2C_DRIVERID_LM83 1040 144#define I2C_DRIVERID_LM83 1040
164#define I2C_DRIVERID_LM90 1042 145#define I2C_DRIVERID_LM90 1042
165#define I2C_DRIVERID_ASB100 1043 146#define I2C_DRIVERID_ASB100 1043
166#define I2C_DRIVERID_FSCHER 1046 147#define I2C_DRIVERID_FSCHER 1046
167#define I2C_DRIVERID_W83L785TS 1047 148#define I2C_DRIVERID_W83L785TS 1047
168#define I2C_DRIVERID_SMSC47B397 1050
169 149
170/* 150/*
171 * ---- Adapter types ---------------------------------------------------- 151 * ---- Adapter types ----------------------------------------------------
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 5e19a7ba69b2..7863a59bd598 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -105,14 +105,14 @@ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
105 * A driver is capable of handling one or more physical devices present on 105 * A driver is capable of handling one or more physical devices present on
106 * I2C adapters. This information is used to inform the driver of adapter 106 * I2C adapters. This information is used to inform the driver of adapter
107 * events. 107 * events.
108 *
109 * The driver.owner field should be set to the module owner of this driver.
110 * The driver.name field should be set to the name of this driver.
108 */ 111 */
109 112
110struct i2c_driver { 113struct i2c_driver {
111 struct module *owner;
112 char name[32];
113 int id; 114 int id;
114 unsigned int class; 115 unsigned int class;
115 unsigned int flags; /* div., see below */
116 116
117 /* Notifies the driver that a new bus has appeared. This routine 117 /* Notifies the driver that a new bus has appeared. This routine
118 * can be used by the driver to test if the bus meets its conditions 118 * can be used by the driver to test if the bus meets its conditions
@@ -250,18 +250,7 @@ static inline void i2c_set_adapdata (struct i2c_adapter *dev, void *data)
250 dev_set_drvdata (&dev->dev, data); 250 dev_set_drvdata (&dev->dev, data);
251} 251}
252 252
253/*flags for the driver struct: */
254#define I2C_DF_NOTIFY 0x01 /* notify on bus (de/a)ttaches */
255#if 0
256/* this flag is gone -- there is a (optional) driver->detach_adapter
257 * callback now which can be used instead */
258# define I2C_DF_DUMMY 0x02
259#endif
260
261/*flags for the client struct: */ 253/*flags for the client struct: */
262#define I2C_CLIENT_ALLOW_USE 0x01 /* Client allows access */
263#define I2C_CLIENT_ALLOW_MULTIPLE_USE 0x02 /* Allow multiple access-locks */
264 /* on an i2c_client */
265#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ 254#define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */
266#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ 255#define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */
267 /* Must equal I2C_M_TEN below */ 256 /* Must equal I2C_M_TEN below */
@@ -302,26 +291,20 @@ struct i2c_client_address_data {
302extern int i2c_add_adapter(struct i2c_adapter *); 291extern int i2c_add_adapter(struct i2c_adapter *);
303extern int i2c_del_adapter(struct i2c_adapter *); 292extern int i2c_del_adapter(struct i2c_adapter *);
304 293
305extern int i2c_add_driver(struct i2c_driver *); 294extern int i2c_register_driver(struct module *, struct i2c_driver *);
306extern int i2c_del_driver(struct i2c_driver *); 295extern int i2c_del_driver(struct i2c_driver *);
307 296
297static inline int i2c_add_driver(struct i2c_driver *driver)
298{
299 return i2c_register_driver(THIS_MODULE, driver);
300}
301
308extern int i2c_attach_client(struct i2c_client *); 302extern int i2c_attach_client(struct i2c_client *);
309extern int i2c_detach_client(struct i2c_client *); 303extern int i2c_detach_client(struct i2c_client *);
310 304
311/* New function: This is to get an i2c_client-struct for controlling the 305/* Should be used to make sure that client-struct is valid and that it
312 client either by using i2c_control-function or having the 306 is okay to access the i2c-client.
313 client-module export functions that can be used with the i2c_client 307 returns -ENODEV if client has gone in the meantime */
314 -struct. */
315extern struct i2c_client *i2c_get_client(int driver_id, int adapter_id,
316 struct i2c_client *prev);
317
318/* Should be used with new function
319 extern struct i2c_client *i2c_get_client(int,int,struct i2c_client *);
320 to make sure that client-struct is valid and that it is okay to access
321 the i2c-client.
322 returns -EACCES if client doesn't allow use (default)
323 returns -EBUSY if client doesn't allow multiple use (default) and
324 usage_count >0 */
325extern int i2c_use_client(struct i2c_client *); 308extern int i2c_use_client(struct i2c_client *);
326extern int i2c_release_client(struct i2c_client *); 309extern int i2c_release_client(struct i2c_client *);
327 310
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index d79c8a4bc4f8..9ba806796667 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -30,6 +30,7 @@
30#include <linux/string.h> 30#include <linux/string.h>
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/workqueue.h> /* work_struct */ 32#include <linux/workqueue.h> /* work_struct */
33#include <linux/mempool.h>
33 34
34#include <asm/io.h> 35#include <asm/io.h>
35#include <asm/semaphore.h> /* Needed for MUTEX init macros */ 36#include <asm/semaphore.h> /* Needed for MUTEX init macros */
@@ -38,6 +39,355 @@
38#define I2O_QUEUE_EMPTY 0xffffffff 39#define I2O_QUEUE_EMPTY 0xffffffff
39 40
40/* 41/*
42 * Cache strategies
43 */
44
45/* The NULL strategy leaves everything up to the controller. This tends to be a
46 * pessimal but functional choice.
47 */
48#define CACHE_NULL 0
49/* Prefetch data when reading. We continually attempt to load the next 32 sectors
50 * into the controller cache.
51 */
52#define CACHE_PREFETCH 1
53/* Prefetch data when reading. We sometimes attempt to load the next 32 sectors
54 * into the controller cache. When an I/O is less <= 8K we assume its probably
55 * not sequential and don't prefetch (default)
56 */
57#define CACHE_SMARTFETCH 2
58/* Data is written to the cache and then out on to the disk. The I/O must be
59 * physically on the medium before the write is acknowledged (default without
60 * NVRAM)
61 */
62#define CACHE_WRITETHROUGH 17
63/* Data is written to the cache and then out on to the disk. The controller
64 * is permitted to write back the cache any way it wants. (default if battery
65 * backed NVRAM is present). It can be useful to set this for swap regardless of
66 * battery state.
67 */
68#define CACHE_WRITEBACK 18
69/* Optimise for under powered controllers, especially on RAID1 and RAID0. We
70 * write large I/O's directly to disk bypassing the cache to avoid the extra
71 * memory copy hits. Small writes are writeback cached
72 */
73#define CACHE_SMARTBACK 19
74/* Optimise for under powered controllers, especially on RAID1 and RAID0. We
75 * write large I/O's directly to disk bypassing the cache to avoid the extra
76 * memory copy hits. Small writes are writethrough cached. Suitable for devices
77 * lacking battery backup
78 */
79#define CACHE_SMARTTHROUGH 20
80
81/*
82 * Ioctl structures
83 */
84
85#define BLKI2OGRSTRAT _IOR('2', 1, int)
86#define BLKI2OGWSTRAT _IOR('2', 2, int)
87#define BLKI2OSRSTRAT _IOW('2', 3, int)
88#define BLKI2OSWSTRAT _IOW('2', 4, int)
89
90/*
91 * I2O Function codes
92 */
93
94/*
95 * Executive Class
96 */
97#define I2O_CMD_ADAPTER_ASSIGN 0xB3
98#define I2O_CMD_ADAPTER_READ 0xB2
99#define I2O_CMD_ADAPTER_RELEASE 0xB5
100#define I2O_CMD_BIOS_INFO_SET 0xA5
101#define I2O_CMD_BOOT_DEVICE_SET 0xA7
102#define I2O_CMD_CONFIG_VALIDATE 0xBB
103#define I2O_CMD_CONN_SETUP 0xCA
104#define I2O_CMD_DDM_DESTROY 0xB1
105#define I2O_CMD_DDM_ENABLE 0xD5
106#define I2O_CMD_DDM_QUIESCE 0xC7
107#define I2O_CMD_DDM_RESET 0xD9
108#define I2O_CMD_DDM_SUSPEND 0xAF
109#define I2O_CMD_DEVICE_ASSIGN 0xB7
110#define I2O_CMD_DEVICE_RELEASE 0xB9
111#define I2O_CMD_HRT_GET 0xA8
112#define I2O_CMD_ADAPTER_CLEAR 0xBE
113#define I2O_CMD_ADAPTER_CONNECT 0xC9
114#define I2O_CMD_ADAPTER_RESET 0xBD
115#define I2O_CMD_LCT_NOTIFY 0xA2
116#define I2O_CMD_OUTBOUND_INIT 0xA1
117#define I2O_CMD_PATH_ENABLE 0xD3
118#define I2O_CMD_PATH_QUIESCE 0xC5
119#define I2O_CMD_PATH_RESET 0xD7
120#define I2O_CMD_STATIC_MF_CREATE 0xDD
121#define I2O_CMD_STATIC_MF_RELEASE 0xDF
122#define I2O_CMD_STATUS_GET 0xA0
123#define I2O_CMD_SW_DOWNLOAD 0xA9
124#define I2O_CMD_SW_UPLOAD 0xAB
125#define I2O_CMD_SW_REMOVE 0xAD
126#define I2O_CMD_SYS_ENABLE 0xD1
127#define I2O_CMD_SYS_MODIFY 0xC1
128#define I2O_CMD_SYS_QUIESCE 0xC3
129#define I2O_CMD_SYS_TAB_SET 0xA3
130
131/*
132 * Utility Class
133 */
134#define I2O_CMD_UTIL_NOP 0x00
135#define I2O_CMD_UTIL_ABORT 0x01
136#define I2O_CMD_UTIL_CLAIM 0x09
137#define I2O_CMD_UTIL_RELEASE 0x0B
138#define I2O_CMD_UTIL_PARAMS_GET 0x06
139#define I2O_CMD_UTIL_PARAMS_SET 0x05
140#define I2O_CMD_UTIL_EVT_REGISTER 0x13
141#define I2O_CMD_UTIL_EVT_ACK 0x14
142#define I2O_CMD_UTIL_CONFIG_DIALOG 0x10
143#define I2O_CMD_UTIL_DEVICE_RESERVE 0x0D
144#define I2O_CMD_UTIL_DEVICE_RELEASE 0x0F
145#define I2O_CMD_UTIL_LOCK 0x17
146#define I2O_CMD_UTIL_LOCK_RELEASE 0x19
147#define I2O_CMD_UTIL_REPLY_FAULT_NOTIFY 0x15
148
149/*
150 * SCSI Host Bus Adapter Class
151 */
152#define I2O_CMD_SCSI_EXEC 0x81
153#define I2O_CMD_SCSI_ABORT 0x83
154#define I2O_CMD_SCSI_BUSRESET 0x27
155
156/*
157 * Bus Adapter Class
158 */
159#define I2O_CMD_BUS_ADAPTER_RESET 0x85
160#define I2O_CMD_BUS_RESET 0x87
161#define I2O_CMD_BUS_SCAN 0x89
162#define I2O_CMD_BUS_QUIESCE 0x8b
163
164/*
165 * Random Block Storage Class
166 */
167#define I2O_CMD_BLOCK_READ 0x30
168#define I2O_CMD_BLOCK_WRITE 0x31
169#define I2O_CMD_BLOCK_CFLUSH 0x37
170#define I2O_CMD_BLOCK_MLOCK 0x49
171#define I2O_CMD_BLOCK_MUNLOCK 0x4B
172#define I2O_CMD_BLOCK_MMOUNT 0x41
173#define I2O_CMD_BLOCK_MEJECT 0x43
174#define I2O_CMD_BLOCK_POWER 0x70
175
176#define I2O_CMD_PRIVATE 0xFF
177
178/* Command status values */
179
180#define I2O_CMD_IN_PROGRESS 0x01
181#define I2O_CMD_REJECTED 0x02
182#define I2O_CMD_FAILED 0x03
183#define I2O_CMD_COMPLETED 0x04
184
185/* I2O API function return values */
186
187#define I2O_RTN_NO_ERROR 0
188#define I2O_RTN_NOT_INIT 1
189#define I2O_RTN_FREE_Q_EMPTY 2
190#define I2O_RTN_TCB_ERROR 3
191#define I2O_RTN_TRANSACTION_ERROR 4
192#define I2O_RTN_ADAPTER_ALREADY_INIT 5
193#define I2O_RTN_MALLOC_ERROR 6
194#define I2O_RTN_ADPTR_NOT_REGISTERED 7
195#define I2O_RTN_MSG_REPLY_TIMEOUT 8
196#define I2O_RTN_NO_STATUS 9
197#define I2O_RTN_NO_FIRM_VER 10
198#define I2O_RTN_NO_LINK_SPEED 11
199
200/* Reply message status defines for all messages */
201
202#define I2O_REPLY_STATUS_SUCCESS 0x00
203#define I2O_REPLY_STATUS_ABORT_DIRTY 0x01
204#define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 0x02
205#define I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER 0x03
206#define I2O_REPLY_STATUS_ERROR_DIRTY 0x04
207#define I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER 0x05
208#define I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER 0x06
209#define I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY 0x08
210#define I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER 0x09
211#define I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER 0x0A
212#define I2O_REPLY_STATUS_TRANSACTION_ERROR 0x0B
213#define I2O_REPLY_STATUS_PROGRESS_REPORT 0x80
214
215/* Status codes and Error Information for Parameter functions */
216
217#define I2O_PARAMS_STATUS_SUCCESS 0x00
218#define I2O_PARAMS_STATUS_BAD_KEY_ABORT 0x01
219#define I2O_PARAMS_STATUS_BAD_KEY_CONTINUE 0x02
220#define I2O_PARAMS_STATUS_BUFFER_FULL 0x03
221#define I2O_PARAMS_STATUS_BUFFER_TOO_SMALL 0x04
222#define I2O_PARAMS_STATUS_FIELD_UNREADABLE 0x05
223#define I2O_PARAMS_STATUS_FIELD_UNWRITEABLE 0x06
224#define I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS 0x07
225#define I2O_PARAMS_STATUS_INVALID_GROUP_ID 0x08
226#define I2O_PARAMS_STATUS_INVALID_OPERATION 0x09
227#define I2O_PARAMS_STATUS_NO_KEY_FIELD 0x0A
228#define I2O_PARAMS_STATUS_NO_SUCH_FIELD 0x0B
229#define I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP 0x0C
230#define I2O_PARAMS_STATUS_OPERATION_ERROR 0x0D
231#define I2O_PARAMS_STATUS_SCALAR_ERROR 0x0E
232#define I2O_PARAMS_STATUS_TABLE_ERROR 0x0F
233#define I2O_PARAMS_STATUS_WRONG_GROUP_TYPE 0x10
234
235/* DetailedStatusCode defines for Executive, DDM, Util and Transaction error
236 * messages: Table 3-2 Detailed Status Codes.*/
237
238#define I2O_DSC_SUCCESS 0x0000
239#define I2O_DSC_BAD_KEY 0x0002
240#define I2O_DSC_TCL_ERROR 0x0003
241#define I2O_DSC_REPLY_BUFFER_FULL 0x0004
242#define I2O_DSC_NO_SUCH_PAGE 0x0005
243#define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT 0x0006
244#define I2O_DSC_INSUFFICIENT_RESOURCE_HARD 0x0007
245#define I2O_DSC_CHAIN_BUFFER_TOO_LARGE 0x0009
246#define I2O_DSC_UNSUPPORTED_FUNCTION 0x000A
247#define I2O_DSC_DEVICE_LOCKED 0x000B
248#define I2O_DSC_DEVICE_RESET 0x000C
249#define I2O_DSC_INAPPROPRIATE_FUNCTION 0x000D
250#define I2O_DSC_INVALID_INITIATOR_ADDRESS 0x000E
251#define I2O_DSC_INVALID_MESSAGE_FLAGS 0x000F
252#define I2O_DSC_INVALID_OFFSET 0x0010
253#define I2O_DSC_INVALID_PARAMETER 0x0011
254#define I2O_DSC_INVALID_REQUEST 0x0012
255#define I2O_DSC_INVALID_TARGET_ADDRESS 0x0013
256#define I2O_DSC_MESSAGE_TOO_LARGE 0x0014
257#define I2O_DSC_MESSAGE_TOO_SMALL 0x0015
258#define I2O_DSC_MISSING_PARAMETER 0x0016
259#define I2O_DSC_TIMEOUT 0x0017
260#define I2O_DSC_UNKNOWN_ERROR 0x0018
261#define I2O_DSC_UNKNOWN_FUNCTION 0x0019
262#define I2O_DSC_UNSUPPORTED_VERSION 0x001A
263#define I2O_DSC_DEVICE_BUSY 0x001B
264#define I2O_DSC_DEVICE_NOT_AVAILABLE 0x001C
265
266/* DetailedStatusCode defines for Block Storage Operation: Table 6-7 Detailed
267 Status Codes.*/
268
269#define I2O_BSA_DSC_SUCCESS 0x0000
270#define I2O_BSA_DSC_MEDIA_ERROR 0x0001
271#define I2O_BSA_DSC_ACCESS_ERROR 0x0002
272#define I2O_BSA_DSC_DEVICE_FAILURE 0x0003
273#define I2O_BSA_DSC_DEVICE_NOT_READY 0x0004
274#define I2O_BSA_DSC_MEDIA_NOT_PRESENT 0x0005
275#define I2O_BSA_DSC_MEDIA_LOCKED 0x0006
276#define I2O_BSA_DSC_MEDIA_FAILURE 0x0007
277#define I2O_BSA_DSC_PROTOCOL_FAILURE 0x0008
278#define I2O_BSA_DSC_BUS_FAILURE 0x0009
279#define I2O_BSA_DSC_ACCESS_VIOLATION 0x000A
280#define I2O_BSA_DSC_WRITE_PROTECTED 0x000B
281#define I2O_BSA_DSC_DEVICE_RESET 0x000C
282#define I2O_BSA_DSC_VOLUME_CHANGED 0x000D
283#define I2O_BSA_DSC_TIMEOUT 0x000E
284
285/* FailureStatusCodes, Table 3-3 Message Failure Codes */
286
287#define I2O_FSC_TRANSPORT_SERVICE_SUSPENDED 0x81
288#define I2O_FSC_TRANSPORT_SERVICE_TERMINATED 0x82
289#define I2O_FSC_TRANSPORT_CONGESTION 0x83
290#define I2O_FSC_TRANSPORT_FAILURE 0x84
291#define I2O_FSC_TRANSPORT_STATE_ERROR 0x85
292#define I2O_FSC_TRANSPORT_TIME_OUT 0x86
293#define I2O_FSC_TRANSPORT_ROUTING_FAILURE 0x87
294#define I2O_FSC_TRANSPORT_INVALID_VERSION 0x88
295#define I2O_FSC_TRANSPORT_INVALID_OFFSET 0x89
296#define I2O_FSC_TRANSPORT_INVALID_MSG_FLAGS 0x8A
297#define I2O_FSC_TRANSPORT_FRAME_TOO_SMALL 0x8B
298#define I2O_FSC_TRANSPORT_FRAME_TOO_LARGE 0x8C
299#define I2O_FSC_TRANSPORT_INVALID_TARGET_ID 0x8D
300#define I2O_FSC_TRANSPORT_INVALID_INITIATOR_ID 0x8E
301#define I2O_FSC_TRANSPORT_INVALID_INITIATOR_CONTEXT 0x8F
302#define I2O_FSC_TRANSPORT_UNKNOWN_FAILURE 0xFF
303
304/* Device Claim Types */
305#define I2O_CLAIM_PRIMARY 0x01000000
306#define I2O_CLAIM_MANAGEMENT 0x02000000
307#define I2O_CLAIM_AUTHORIZED 0x03000000
308#define I2O_CLAIM_SECONDARY 0x04000000
309
310/* Message header defines for VersionOffset */
311#define I2OVER15 0x0001
312#define I2OVER20 0x0002
313
314/* Default is 1.5 */
315#define I2OVERSION I2OVER15
316
317#define SGL_OFFSET_0 I2OVERSION
318#define SGL_OFFSET_4 (0x0040 | I2OVERSION)
319#define SGL_OFFSET_5 (0x0050 | I2OVERSION)
320#define SGL_OFFSET_6 (0x0060 | I2OVERSION)
321#define SGL_OFFSET_7 (0x0070 | I2OVERSION)
322#define SGL_OFFSET_8 (0x0080 | I2OVERSION)
323#define SGL_OFFSET_9 (0x0090 | I2OVERSION)
324#define SGL_OFFSET_10 (0x00A0 | I2OVERSION)
325#define SGL_OFFSET_11 (0x00B0 | I2OVERSION)
326#define SGL_OFFSET_12 (0x00C0 | I2OVERSION)
327#define SGL_OFFSET(x) (((x)<<4) | I2OVERSION)
328
329/* Transaction Reply Lists (TRL) Control Word structure */
330#define TRL_SINGLE_FIXED_LENGTH 0x00
331#define TRL_SINGLE_VARIABLE_LENGTH 0x40
332#define TRL_MULTIPLE_FIXED_LENGTH 0x80
333
334 /* msg header defines for MsgFlags */
335#define MSG_STATIC 0x0100
336#define MSG_64BIT_CNTXT 0x0200
337#define MSG_MULTI_TRANS 0x1000
338#define MSG_FAIL 0x2000
339#define MSG_FINAL 0x4000
340#define MSG_REPLY 0x8000
341
342 /* minimum size msg */
343#define THREE_WORD_MSG_SIZE 0x00030000
344#define FOUR_WORD_MSG_SIZE 0x00040000
345#define FIVE_WORD_MSG_SIZE 0x00050000
346#define SIX_WORD_MSG_SIZE 0x00060000
347#define SEVEN_WORD_MSG_SIZE 0x00070000
348#define EIGHT_WORD_MSG_SIZE 0x00080000
349#define NINE_WORD_MSG_SIZE 0x00090000
350#define TEN_WORD_MSG_SIZE 0x000A0000
351#define ELEVEN_WORD_MSG_SIZE 0x000B0000
352#define I2O_MESSAGE_SIZE(x) ((x)<<16)
353
354/* special TID assignments */
355#define ADAPTER_TID 0
356#define HOST_TID 1
357
358/* outbound queue defines */
359#define I2O_MAX_OUTBOUND_MSG_FRAMES 128
360#define I2O_OUTBOUND_MSG_FRAME_SIZE 128 /* in 32-bit words */
361
362/* inbound queue definitions */
363#define I2O_MSG_INPOOL_MIN 32
364#define I2O_INBOUND_MSG_FRAME_SIZE 128 /* in 32-bit words */
365
366#define I2O_POST_WAIT_OK 0
367#define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT
368
369#define I2O_CONTEXT_LIST_MIN_LENGTH 15
370#define I2O_CONTEXT_LIST_USED 0x01
371#define I2O_CONTEXT_LIST_DELETED 0x02
372
373/* timeouts */
374#define I2O_TIMEOUT_INIT_OUTBOUND_QUEUE 15
375#define I2O_TIMEOUT_MESSAGE_GET 5
376#define I2O_TIMEOUT_RESET 30
377#define I2O_TIMEOUT_STATUS_GET 5
378#define I2O_TIMEOUT_LCT_GET 360
379#define I2O_TIMEOUT_SCSI_SCB_ABORT 240
380
381/* retries */
382#define I2O_HRT_GET_TRIES 3
383#define I2O_LCT_GET_TRIES 3
384
385/* defines for max_sectors and max_phys_segments */
386#define I2O_MAX_SECTORS 1024
387#define I2O_MAX_SECTORS_LIMITED 128
388#define I2O_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS
389
390/*
41 * Message structures 391 * Message structures
42 */ 392 */
43struct i2o_message { 393struct i2o_message {
@@ -58,6 +408,12 @@ struct i2o_message {
58 u32 body[0]; 408 u32 body[0];
59}; 409};
60 410
411/* MFA and I2O message used by mempool */
412struct i2o_msg_mfa {
413 u32 mfa; /* MFA returned by the controller */
414 struct i2o_message msg; /* I2O message */
415};
416
61/* 417/*
62 * Each I2O device entity has one of these. There is one per device. 418 * Each I2O device entity has one of these. There is one per device.
63 */ 419 */
@@ -130,6 +486,15 @@ struct i2o_dma {
130}; 486};
131 487
132/* 488/*
489 * Contains slab cache and mempool information
490 */
491struct i2o_pool {
492 char *name;
493 kmem_cache_t *slab;
494 mempool_t *mempool;
495};
496
497/*
133 * Contains IO mapped address information 498 * Contains IO mapped address information
134 */ 499 */
135struct i2o_io { 500struct i2o_io {
@@ -174,8 +539,6 @@ struct i2o_controller {
174 void __iomem *irq_status; /* Interrupt status register address */ 539 void __iomem *irq_status; /* Interrupt status register address */
175 void __iomem *irq_mask; /* Interrupt mask register address */ 540 void __iomem *irq_mask; /* Interrupt mask register address */
176 541
177 /* Dynamic LCT related data */
178
179 struct i2o_dma status; /* IOP status block */ 542 struct i2o_dma status; /* IOP status block */
180 543
181 struct i2o_dma hrt; /* HW Resource Table */ 544 struct i2o_dma hrt; /* HW Resource Table */
@@ -188,6 +551,8 @@ struct i2o_controller {
188 struct i2o_io in_queue; /* inbound message queue Host->IOP */ 551 struct i2o_io in_queue; /* inbound message queue Host->IOP */
189 struct i2o_dma out_queue; /* outbound message queue IOP->Host */ 552 struct i2o_dma out_queue; /* outbound message queue IOP->Host */
190 553
554 struct i2o_pool in_msg; /* mempool for inbound messages */
555
191 unsigned int battery:1; /* Has a battery backup */ 556 unsigned int battery:1; /* Has a battery backup */
192 unsigned int io_alloc:1; /* An I/O resource was allocated */ 557 unsigned int io_alloc:1; /* An I/O resource was allocated */
193 unsigned int mem_alloc:1; /* A memory resource was allocated */ 558 unsigned int mem_alloc:1; /* A memory resource was allocated */
@@ -196,7 +561,6 @@ struct i2o_controller {
196 struct resource mem_resource; /* Mem resource allocated to the IOP */ 561 struct resource mem_resource; /* Mem resource allocated to the IOP */
197 562
198 struct device device; 563 struct device device;
199 struct class_device *classdev; /* I2O controller class device */
200 struct i2o_device *exec; /* Executive */ 564 struct i2o_device *exec; /* Executive */
201#if BITS_PER_LONG == 64 565#if BITS_PER_LONG == 64
202 spinlock_t context_list_lock; /* lock for context_list */ 566 spinlock_t context_list_lock; /* lock for context_list */
@@ -247,16 +611,13 @@ struct i2o_sys_tbl {
247extern struct list_head i2o_controllers; 611extern struct list_head i2o_controllers;
248 612
249/* Message functions */ 613/* Message functions */
250static inline u32 i2o_msg_get(struct i2o_controller *, 614static inline struct i2o_message *i2o_msg_get(struct i2o_controller *);
251 struct i2o_message __iomem **); 615extern struct i2o_message *i2o_msg_get_wait(struct i2o_controller *, int);
252extern u32 i2o_msg_get_wait(struct i2o_controller *, 616static inline void i2o_msg_post(struct i2o_controller *, struct i2o_message *);
253 struct i2o_message __iomem **, int); 617static inline int i2o_msg_post_wait(struct i2o_controller *,
254static inline void i2o_msg_post(struct i2o_controller *, u32); 618 struct i2o_message *, unsigned long);
255static inline int i2o_msg_post_wait(struct i2o_controller *, u32, 619extern int i2o_msg_post_wait_mem(struct i2o_controller *, struct i2o_message *,
256 unsigned long); 620 unsigned long, struct i2o_dma *);
257extern int i2o_msg_post_wait_mem(struct i2o_controller *, u32, unsigned long,
258 struct i2o_dma *);
259extern void i2o_msg_nop(struct i2o_controller *, u32);
260static inline void i2o_flush_reply(struct i2o_controller *, u32); 621static inline void i2o_flush_reply(struct i2o_controller *, u32);
261 622
262/* IOP functions */ 623/* IOP functions */
@@ -384,10 +745,10 @@ static inline u16 i2o_sg_tablesize(struct i2o_controller *c, u16 body_size)
384static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr, 745static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr,
385 size_t size, 746 size_t size,
386 enum dma_data_direction direction, 747 enum dma_data_direction direction,
387 u32 __iomem ** sg_ptr) 748 u32 ** sg_ptr)
388{ 749{
389 u32 sg_flags; 750 u32 sg_flags;
390 u32 __iomem *mptr = *sg_ptr; 751 u32 *mptr = *sg_ptr;
391 dma_addr_t dma_addr; 752 dma_addr_t dma_addr;
392 753
393 switch (direction) { 754 switch (direction) {
@@ -405,16 +766,16 @@ static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr,
405 if (!dma_mapping_error(dma_addr)) { 766 if (!dma_mapping_error(dma_addr)) {
406#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 767#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
407 if ((sizeof(dma_addr_t) > 4) && c->pae_support) { 768 if ((sizeof(dma_addr_t) > 4) && c->pae_support) {
408 writel(0x7C020002, mptr++); 769 *mptr++ = cpu_to_le32(0x7C020002);
409 writel(PAGE_SIZE, mptr++); 770 *mptr++ = cpu_to_le32(PAGE_SIZE);
410 } 771 }
411#endif 772#endif
412 773
413 writel(sg_flags | size, mptr++); 774 *mptr++ = cpu_to_le32(sg_flags | size);
414 writel(i2o_dma_low(dma_addr), mptr++); 775 *mptr++ = cpu_to_le32(i2o_dma_low(dma_addr));
415#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 776#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
416 if ((sizeof(dma_addr_t) > 4) && c->pae_support) 777 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
417 writel(i2o_dma_high(dma_addr), mptr++); 778 *mptr++ = cpu_to_le32(i2o_dma_high(dma_addr));
418#endif 779#endif
419 *sg_ptr = mptr; 780 *sg_ptr = mptr;
420 } 781 }
@@ -439,10 +800,10 @@ static inline dma_addr_t i2o_dma_map_single(struct i2o_controller *c, void *ptr,
439static inline int i2o_dma_map_sg(struct i2o_controller *c, 800static inline int i2o_dma_map_sg(struct i2o_controller *c,
440 struct scatterlist *sg, int sg_count, 801 struct scatterlist *sg, int sg_count,
441 enum dma_data_direction direction, 802 enum dma_data_direction direction,
442 u32 __iomem ** sg_ptr) 803 u32 ** sg_ptr)
443{ 804{
444 u32 sg_flags; 805 u32 sg_flags;
445 u32 __iomem *mptr = *sg_ptr; 806 u32 *mptr = *sg_ptr;
446 807
447 switch (direction) { 808 switch (direction) {
448 case DMA_TO_DEVICE: 809 case DMA_TO_DEVICE:
@@ -461,19 +822,19 @@ static inline int i2o_dma_map_sg(struct i2o_controller *c,
461 822
462#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 823#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
463 if ((sizeof(dma_addr_t) > 4) && c->pae_support) { 824 if ((sizeof(dma_addr_t) > 4) && c->pae_support) {
464 writel(0x7C020002, mptr++); 825 *mptr++ = cpu_to_le32(0x7C020002);
465 writel(PAGE_SIZE, mptr++); 826 *mptr++ = cpu_to_le32(PAGE_SIZE);
466 } 827 }
467#endif 828#endif
468 829
469 while (sg_count-- > 0) { 830 while (sg_count-- > 0) {
470 if (!sg_count) 831 if (!sg_count)
471 sg_flags |= 0xC0000000; 832 sg_flags |= 0xC0000000;
472 writel(sg_flags | sg_dma_len(sg), mptr++); 833 *mptr++ = cpu_to_le32(sg_flags | sg_dma_len(sg));
473 writel(i2o_dma_low(sg_dma_address(sg)), mptr++); 834 *mptr++ = cpu_to_le32(i2o_dma_low(sg_dma_address(sg)));
474#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64 835#ifdef CONFIG_I2O_EXT_ADAPTEC_DMA64
475 if ((sizeof(dma_addr_t) > 4) && c->pae_support) 836 if ((sizeof(dma_addr_t) > 4) && c->pae_support)
476 writel(i2o_dma_high(sg_dma_address(sg)), mptr++); 837 *mptr++ = cpu_to_le32(i2o_dma_high(sg_dma_address(sg)));
477#endif 838#endif
478 sg++; 839 sg++;
479 } 840 }
@@ -563,6 +924,64 @@ static inline int i2o_dma_realloc(struct device *dev, struct i2o_dma *addr,
563 return 0; 924 return 0;
564}; 925};
565 926
927/*
928 * i2o_pool_alloc - Allocate an slab cache and mempool
929 * @mempool: pointer to struct i2o_pool to write data into.
930 * @name: name which is used to identify cache
931 * @size: size of each object
932 * @min_nr: minimum number of objects
933 *
934 * First allocates a slab cache with name and size. Then allocates a
935 * mempool which uses the slab cache for allocation and freeing.
936 *
937 * Returns 0 on success or negative error code on failure.
938 */
939static inline int i2o_pool_alloc(struct i2o_pool *pool, const char *name,
940 size_t size, int min_nr)
941{
942 pool->name = kmalloc(strlen(name) + 1, GFP_KERNEL);
943 if (!pool->name)
944 goto exit;
945 strcpy(pool->name, name);
946
947 pool->slab =
948 kmem_cache_create(pool->name, size, 0, SLAB_HWCACHE_ALIGN, NULL,
949 NULL);
950 if (!pool->slab)
951 goto free_name;
952
953 pool->mempool =
954 mempool_create(min_nr, mempool_alloc_slab, mempool_free_slab,
955 pool->slab);
956 if (!pool->mempool)
957 goto free_slab;
958
959 return 0;
960
961 free_slab:
962 kmem_cache_destroy(pool->slab);
963
964 free_name:
965 kfree(pool->name);
966
967 exit:
968 return -ENOMEM;
969};
970
971/*
972 * i2o_pool_free - Free slab cache and mempool again
973 * @mempool: pointer to struct i2o_pool which should be freed
974 *
975 * Note that you have to return all objects to the mempool again before
976 * calling i2o_pool_free().
977 */
978static inline void i2o_pool_free(struct i2o_pool *pool)
979{
980 mempool_destroy(pool->mempool);
981 kmem_cache_destroy(pool->slab);
982 kfree(pool->name);
983};
984
566/* I2O driver (OSM) functions */ 985/* I2O driver (OSM) functions */
567extern int i2o_driver_register(struct i2o_driver *); 986extern int i2o_driver_register(struct i2o_driver *);
568extern void i2o_driver_unregister(struct i2o_driver *); 987extern void i2o_driver_unregister(struct i2o_driver *);
@@ -638,39 +1057,89 @@ extern int i2o_exec_lct_get(struct i2o_controller *);
638#define kobj_to_i2o_device(kobj) to_i2o_device(container_of(kobj, struct device, kobj)) 1057#define kobj_to_i2o_device(kobj) to_i2o_device(container_of(kobj, struct device, kobj))
639 1058
640/** 1059/**
1060 * i2o_out_to_virt - Turn an I2O message to a virtual address
1061 * @c: controller
1062 * @m: message engine value
1063 *
1064 * Turn a receive message from an I2O controller bus address into
1065 * a Linux virtual address. The shared page frame is a linear block
1066 * so we simply have to shift the offset. This function does not
1067 * work for sender side messages as they are ioremap objects
1068 * provided by the I2O controller.
1069 */
1070static inline struct i2o_message *i2o_msg_out_to_virt(struct i2o_controller *c,
1071 u32 m)
1072{
1073 BUG_ON(m < c->out_queue.phys
1074 || m >= c->out_queue.phys + c->out_queue.len);
1075
1076 return c->out_queue.virt + (m - c->out_queue.phys);
1077};
1078
1079/**
1080 * i2o_msg_in_to_virt - Turn an I2O message to a virtual address
1081 * @c: controller
1082 * @m: message engine value
1083 *
1084 * Turn a send message from an I2O controller bus address into
1085 * a Linux virtual address. The shared page frame is a linear block
1086 * so we simply have to shift the offset. This function does not
1087 * work for receive side messages as they are kmalloc objects
1088 * in a different pool.
1089 */
1090static inline struct i2o_message __iomem *i2o_msg_in_to_virt(struct
1091 i2o_controller *c,
1092 u32 m)
1093{
1094 return c->in_queue.virt + m;
1095};
1096
1097/**
641 * i2o_msg_get - obtain an I2O message from the IOP 1098 * i2o_msg_get - obtain an I2O message from the IOP
642 * @c: I2O controller 1099 * @c: I2O controller
643 * @msg: pointer to a I2O message pointer
644 * 1100 *
645 * This function tries to get a message slot. If no message slot is 1101 * This function tries to get a message frame. If no message frame is
646 * available do not wait until one is availabe (see also i2o_msg_get_wait). 1102 * available do not wait until one is availabe (see also i2o_msg_get_wait).
1103 * The returned pointer to the message frame is not in I/O memory, it is
1104 * allocated from a mempool. But because a MFA is allocated from the
1105 * controller too it is guaranteed that i2o_msg_post() will never fail.
647 * 1106 *
648 * On a success the message is returned and the pointer to the message is 1107 * On a success a pointer to the message frame is returned. If the message
649 * set in msg. The returned message is the physical page frame offset 1108 * queue is empty -EBUSY is returned and if no memory is available -ENOMEM
650 * address from the read port (see the i2o spec). If no message is 1109 * is returned.
651 * available returns I2O_QUEUE_EMPTY and msg is leaved untouched.
652 */ 1110 */
653static inline u32 i2o_msg_get(struct i2o_controller *c, 1111static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c)
654 struct i2o_message __iomem ** msg)
655{ 1112{
656 u32 m = readl(c->in_port); 1113 struct i2o_msg_mfa *mmsg = mempool_alloc(c->in_msg.mempool, GFP_ATOMIC);
657 1114 if (!mmsg)
658 if (m != I2O_QUEUE_EMPTY) 1115 return ERR_PTR(-ENOMEM);
659 *msg = c->in_queue.virt + m; 1116
1117 mmsg->mfa = readl(c->in_port);
1118 if (mmsg->mfa == I2O_QUEUE_EMPTY) {
1119 mempool_free(mmsg, c->in_msg.mempool);
1120 return ERR_PTR(-EBUSY);
1121 }
660 1122
661 return m; 1123 return &mmsg->msg;
662}; 1124};
663 1125
664/** 1126/**
665 * i2o_msg_post - Post I2O message to I2O controller 1127 * i2o_msg_post - Post I2O message to I2O controller
666 * @c: I2O controller to which the message should be send 1128 * @c: I2O controller to which the message should be send
667 * @m: the message identifier 1129 * @msg: message returned by i2o_msg_get()
668 * 1130 *
669 * Post the message to the I2O controller. 1131 * Post the message to the I2O controller and return immediately.
670 */ 1132 */
671static inline void i2o_msg_post(struct i2o_controller *c, u32 m) 1133static inline void i2o_msg_post(struct i2o_controller *c,
1134 struct i2o_message *msg)
672{ 1135{
673 writel(m, c->in_port); 1136 struct i2o_msg_mfa *mmsg;
1137
1138 mmsg = container_of(msg, struct i2o_msg_mfa, msg);
1139 memcpy_toio(i2o_msg_in_to_virt(c, mmsg->mfa), msg,
1140 (le32_to_cpu(msg->u.head[0]) >> 16) << 2);
1141 writel(mmsg->mfa, c->in_port);
1142 mempool_free(mmsg, c->in_msg.mempool);
674}; 1143};
675 1144
676/** 1145/**
@@ -685,62 +1154,66 @@ static inline void i2o_msg_post(struct i2o_controller *c, u32 m)
685 * 1154 *
686 * Returns 0 on success or negative error code on failure. 1155 * Returns 0 on success or negative error code on failure.
687 */ 1156 */
688static inline int i2o_msg_post_wait(struct i2o_controller *c, u32 m, 1157static inline int i2o_msg_post_wait(struct i2o_controller *c,
1158 struct i2o_message *msg,
689 unsigned long timeout) 1159 unsigned long timeout)
690{ 1160{
691 return i2o_msg_post_wait_mem(c, m, timeout, NULL); 1161 return i2o_msg_post_wait_mem(c, msg, timeout, NULL);
692}; 1162};
693 1163
694/** 1164/**
695 * i2o_flush_reply - Flush reply from I2O controller 1165 * i2o_msg_nop_mfa - Returns a fetched MFA back to the controller
696 * @c: I2O controller 1166 * @c: I2O controller from which the MFA was fetched
697 * @m: the message identifier 1167 * @mfa: MFA which should be returned
698 * 1168 *
699 * The I2O controller must be informed that the reply message is not needed 1169 * This function must be used for preserved messages, because i2o_msg_nop()
700 * anymore. If you forget to flush the reply, the message frame can't be 1170 * also returns the allocated memory back to the msg_pool mempool.
701 * used by the controller anymore and is therefore lost.
702 */ 1171 */
703static inline void i2o_flush_reply(struct i2o_controller *c, u32 m) 1172static inline void i2o_msg_nop_mfa(struct i2o_controller *c, u32 mfa)
704{ 1173{
705 writel(m, c->out_port); 1174 struct i2o_message __iomem *msg;
1175 u32 nop[3] = {
1176 THREE_WORD_MSG_SIZE | SGL_OFFSET_0,
1177 I2O_CMD_UTIL_NOP << 24 | HOST_TID << 12 | ADAPTER_TID,
1178 0x00000000
1179 };
1180
1181 msg = i2o_msg_in_to_virt(c, mfa);
1182 memcpy_toio(msg, nop, sizeof(nop));
1183 writel(mfa, c->in_port);
706}; 1184};
707 1185
708/** 1186/**
709 * i2o_out_to_virt - Turn an I2O message to a virtual address 1187 * i2o_msg_nop - Returns a message which is not used
710 * @c: controller 1188 * @c: I2O controller from which the message was created
711 * @m: message engine value 1189 * @msg: message which should be returned
712 * 1190 *
713 * Turn a receive message from an I2O controller bus address into 1191 * If you fetch a message via i2o_msg_get, and can't use it, you must
714 * a Linux virtual address. The shared page frame is a linear block 1192 * return the message with this function. Otherwise the MFA is lost as well
715 * so we simply have to shift the offset. This function does not 1193 * as the allocated memory from the mempool.
716 * work for sender side messages as they are ioremap objects
717 * provided by the I2O controller.
718 */ 1194 */
719static inline struct i2o_message *i2o_msg_out_to_virt(struct i2o_controller *c, 1195static inline void i2o_msg_nop(struct i2o_controller *c,
720 u32 m) 1196 struct i2o_message *msg)
721{ 1197{
722 BUG_ON(m < c->out_queue.phys 1198 struct i2o_msg_mfa *mmsg;
723 || m >= c->out_queue.phys + c->out_queue.len); 1199 mmsg = container_of(msg, struct i2o_msg_mfa, msg);
724 1200
725 return c->out_queue.virt + (m - c->out_queue.phys); 1201 i2o_msg_nop_mfa(c, mmsg->mfa);
1202 mempool_free(mmsg, c->in_msg.mempool);
726}; 1203};
727 1204
728/** 1205/**
729 * i2o_msg_in_to_virt - Turn an I2O message to a virtual address 1206 * i2o_flush_reply - Flush reply from I2O controller
730 * @c: controller 1207 * @c: I2O controller
731 * @m: message engine value 1208 * @m: the message identifier
732 * 1209 *
733 * Turn a send message from an I2O controller bus address into 1210 * The I2O controller must be informed that the reply message is not needed
734 * a Linux virtual address. The shared page frame is a linear block 1211 * anymore. If you forget to flush the reply, the message frame can't be
735 * so we simply have to shift the offset. This function does not 1212 * used by the controller anymore and is therefore lost.
736 * work for receive side messages as they are kmalloc objects
737 * in a different pool.
738 */ 1213 */
739static inline struct i2o_message __iomem *i2o_msg_in_to_virt(struct 1214static inline void i2o_flush_reply(struct i2o_controller *c, u32 m)
740 i2o_controller *c,
741 u32 m)
742{ 1215{
743 return c->in_queue.virt + m; 1216 writel(m, c->out_port);
744}; 1217};
745 1218
746/* 1219/*
@@ -779,350 +1252,5 @@ extern void i2o_dump_message(struct i2o_message *);
779extern void i2o_dump_hrt(struct i2o_controller *c); 1252extern void i2o_dump_hrt(struct i2o_controller *c);
780extern void i2o_debug_state(struct i2o_controller *c); 1253extern void i2o_debug_state(struct i2o_controller *c);
781 1254
782/*
783 * Cache strategies
784 */
785
786/* The NULL strategy leaves everything up to the controller. This tends to be a
787 * pessimal but functional choice.
788 */
789#define CACHE_NULL 0
790/* Prefetch data when reading. We continually attempt to load the next 32 sectors
791 * into the controller cache.
792 */
793#define CACHE_PREFETCH 1
794/* Prefetch data when reading. We sometimes attempt to load the next 32 sectors
795 * into the controller cache. When an I/O is less <= 8K we assume its probably
796 * not sequential and don't prefetch (default)
797 */
798#define CACHE_SMARTFETCH 2
799/* Data is written to the cache and then out on to the disk. The I/O must be
800 * physically on the medium before the write is acknowledged (default without
801 * NVRAM)
802 */
803#define CACHE_WRITETHROUGH 17
804/* Data is written to the cache and then out on to the disk. The controller
805 * is permitted to write back the cache any way it wants. (default if battery
806 * backed NVRAM is present). It can be useful to set this for swap regardless of
807 * battery state.
808 */
809#define CACHE_WRITEBACK 18
810/* Optimise for under powered controllers, especially on RAID1 and RAID0. We
811 * write large I/O's directly to disk bypassing the cache to avoid the extra
812 * memory copy hits. Small writes are writeback cached
813 */
814#define CACHE_SMARTBACK 19
815/* Optimise for under powered controllers, especially on RAID1 and RAID0. We
816 * write large I/O's directly to disk bypassing the cache to avoid the extra
817 * memory copy hits. Small writes are writethrough cached. Suitable for devices
818 * lacking battery backup
819 */
820#define CACHE_SMARTTHROUGH 20
821
822/*
823 * Ioctl structures
824 */
825
826#define BLKI2OGRSTRAT _IOR('2', 1, int)
827#define BLKI2OGWSTRAT _IOR('2', 2, int)
828#define BLKI2OSRSTRAT _IOW('2', 3, int)
829#define BLKI2OSWSTRAT _IOW('2', 4, int)
830
831/*
832 * I2O Function codes
833 */
834
835/*
836 * Executive Class
837 */
838#define I2O_CMD_ADAPTER_ASSIGN 0xB3
839#define I2O_CMD_ADAPTER_READ 0xB2
840#define I2O_CMD_ADAPTER_RELEASE 0xB5
841#define I2O_CMD_BIOS_INFO_SET 0xA5
842#define I2O_CMD_BOOT_DEVICE_SET 0xA7
843#define I2O_CMD_CONFIG_VALIDATE 0xBB
844#define I2O_CMD_CONN_SETUP 0xCA
845#define I2O_CMD_DDM_DESTROY 0xB1
846#define I2O_CMD_DDM_ENABLE 0xD5
847#define I2O_CMD_DDM_QUIESCE 0xC7
848#define I2O_CMD_DDM_RESET 0xD9
849#define I2O_CMD_DDM_SUSPEND 0xAF
850#define I2O_CMD_DEVICE_ASSIGN 0xB7
851#define I2O_CMD_DEVICE_RELEASE 0xB9
852#define I2O_CMD_HRT_GET 0xA8
853#define I2O_CMD_ADAPTER_CLEAR 0xBE
854#define I2O_CMD_ADAPTER_CONNECT 0xC9
855#define I2O_CMD_ADAPTER_RESET 0xBD
856#define I2O_CMD_LCT_NOTIFY 0xA2
857#define I2O_CMD_OUTBOUND_INIT 0xA1
858#define I2O_CMD_PATH_ENABLE 0xD3
859#define I2O_CMD_PATH_QUIESCE 0xC5
860#define I2O_CMD_PATH_RESET 0xD7
861#define I2O_CMD_STATIC_MF_CREATE 0xDD
862#define I2O_CMD_STATIC_MF_RELEASE 0xDF
863#define I2O_CMD_STATUS_GET 0xA0
864#define I2O_CMD_SW_DOWNLOAD 0xA9
865#define I2O_CMD_SW_UPLOAD 0xAB
866#define I2O_CMD_SW_REMOVE 0xAD
867#define I2O_CMD_SYS_ENABLE 0xD1
868#define I2O_CMD_SYS_MODIFY 0xC1
869#define I2O_CMD_SYS_QUIESCE 0xC3
870#define I2O_CMD_SYS_TAB_SET 0xA3
871
872/*
873 * Utility Class
874 */
875#define I2O_CMD_UTIL_NOP 0x00
876#define I2O_CMD_UTIL_ABORT 0x01
877#define I2O_CMD_UTIL_CLAIM 0x09
878#define I2O_CMD_UTIL_RELEASE 0x0B
879#define I2O_CMD_UTIL_PARAMS_GET 0x06
880#define I2O_CMD_UTIL_PARAMS_SET 0x05
881#define I2O_CMD_UTIL_EVT_REGISTER 0x13
882#define I2O_CMD_UTIL_EVT_ACK 0x14
883#define I2O_CMD_UTIL_CONFIG_DIALOG 0x10
884#define I2O_CMD_UTIL_DEVICE_RESERVE 0x0D
885#define I2O_CMD_UTIL_DEVICE_RELEASE 0x0F
886#define I2O_CMD_UTIL_LOCK 0x17
887#define I2O_CMD_UTIL_LOCK_RELEASE 0x19
888#define I2O_CMD_UTIL_REPLY_FAULT_NOTIFY 0x15
889
890/*
891 * SCSI Host Bus Adapter Class
892 */
893#define I2O_CMD_SCSI_EXEC 0x81
894#define I2O_CMD_SCSI_ABORT 0x83
895#define I2O_CMD_SCSI_BUSRESET 0x27
896
897/*
898 * Bus Adapter Class
899 */
900#define I2O_CMD_BUS_ADAPTER_RESET 0x85
901#define I2O_CMD_BUS_RESET 0x87
902#define I2O_CMD_BUS_SCAN 0x89
903#define I2O_CMD_BUS_QUIESCE 0x8b
904
905/*
906 * Random Block Storage Class
907 */
908#define I2O_CMD_BLOCK_READ 0x30
909#define I2O_CMD_BLOCK_WRITE 0x31
910#define I2O_CMD_BLOCK_CFLUSH 0x37
911#define I2O_CMD_BLOCK_MLOCK 0x49
912#define I2O_CMD_BLOCK_MUNLOCK 0x4B
913#define I2O_CMD_BLOCK_MMOUNT 0x41
914#define I2O_CMD_BLOCK_MEJECT 0x43
915#define I2O_CMD_BLOCK_POWER 0x70
916
917#define I2O_CMD_PRIVATE 0xFF
918
919/* Command status values */
920
921#define I2O_CMD_IN_PROGRESS 0x01
922#define I2O_CMD_REJECTED 0x02
923#define I2O_CMD_FAILED 0x03
924#define I2O_CMD_COMPLETED 0x04
925
926/* I2O API function return values */
927
928#define I2O_RTN_NO_ERROR 0
929#define I2O_RTN_NOT_INIT 1
930#define I2O_RTN_FREE_Q_EMPTY 2
931#define I2O_RTN_TCB_ERROR 3
932#define I2O_RTN_TRANSACTION_ERROR 4
933#define I2O_RTN_ADAPTER_ALREADY_INIT 5
934#define I2O_RTN_MALLOC_ERROR 6
935#define I2O_RTN_ADPTR_NOT_REGISTERED 7
936#define I2O_RTN_MSG_REPLY_TIMEOUT 8
937#define I2O_RTN_NO_STATUS 9
938#define I2O_RTN_NO_FIRM_VER 10
939#define I2O_RTN_NO_LINK_SPEED 11
940
941/* Reply message status defines for all messages */
942
943#define I2O_REPLY_STATUS_SUCCESS 0x00
944#define I2O_REPLY_STATUS_ABORT_DIRTY 0x01
945#define I2O_REPLY_STATUS_ABORT_NO_DATA_TRANSFER 0x02
946#define I2O_REPLY_STATUS_ABORT_PARTIAL_TRANSFER 0x03
947#define I2O_REPLY_STATUS_ERROR_DIRTY 0x04
948#define I2O_REPLY_STATUS_ERROR_NO_DATA_TRANSFER 0x05
949#define I2O_REPLY_STATUS_ERROR_PARTIAL_TRANSFER 0x06
950#define I2O_REPLY_STATUS_PROCESS_ABORT_DIRTY 0x08
951#define I2O_REPLY_STATUS_PROCESS_ABORT_NO_DATA_TRANSFER 0x09
952#define I2O_REPLY_STATUS_PROCESS_ABORT_PARTIAL_TRANSFER 0x0A
953#define I2O_REPLY_STATUS_TRANSACTION_ERROR 0x0B
954#define I2O_REPLY_STATUS_PROGRESS_REPORT 0x80
955
956/* Status codes and Error Information for Parameter functions */
957
958#define I2O_PARAMS_STATUS_SUCCESS 0x00
959#define I2O_PARAMS_STATUS_BAD_KEY_ABORT 0x01
960#define I2O_PARAMS_STATUS_BAD_KEY_CONTINUE 0x02
961#define I2O_PARAMS_STATUS_BUFFER_FULL 0x03
962#define I2O_PARAMS_STATUS_BUFFER_TOO_SMALL 0x04
963#define I2O_PARAMS_STATUS_FIELD_UNREADABLE 0x05
964#define I2O_PARAMS_STATUS_FIELD_UNWRITEABLE 0x06
965#define I2O_PARAMS_STATUS_INSUFFICIENT_FIELDS 0x07
966#define I2O_PARAMS_STATUS_INVALID_GROUP_ID 0x08
967#define I2O_PARAMS_STATUS_INVALID_OPERATION 0x09
968#define I2O_PARAMS_STATUS_NO_KEY_FIELD 0x0A
969#define I2O_PARAMS_STATUS_NO_SUCH_FIELD 0x0B
970#define I2O_PARAMS_STATUS_NON_DYNAMIC_GROUP 0x0C
971#define I2O_PARAMS_STATUS_OPERATION_ERROR 0x0D
972#define I2O_PARAMS_STATUS_SCALAR_ERROR 0x0E
973#define I2O_PARAMS_STATUS_TABLE_ERROR 0x0F
974#define I2O_PARAMS_STATUS_WRONG_GROUP_TYPE 0x10
975
976/* DetailedStatusCode defines for Executive, DDM, Util and Transaction error
977 * messages: Table 3-2 Detailed Status Codes.*/
978
979#define I2O_DSC_SUCCESS 0x0000
980#define I2O_DSC_BAD_KEY 0x0002
981#define I2O_DSC_TCL_ERROR 0x0003
982#define I2O_DSC_REPLY_BUFFER_FULL 0x0004
983#define I2O_DSC_NO_SUCH_PAGE 0x0005
984#define I2O_DSC_INSUFFICIENT_RESOURCE_SOFT 0x0006
985#define I2O_DSC_INSUFFICIENT_RESOURCE_HARD 0x0007
986#define I2O_DSC_CHAIN_BUFFER_TOO_LARGE 0x0009
987#define I2O_DSC_UNSUPPORTED_FUNCTION 0x000A
988#define I2O_DSC_DEVICE_LOCKED 0x000B
989#define I2O_DSC_DEVICE_RESET 0x000C
990#define I2O_DSC_INAPPROPRIATE_FUNCTION 0x000D
991#define I2O_DSC_INVALID_INITIATOR_ADDRESS 0x000E
992#define I2O_DSC_INVALID_MESSAGE_FLAGS 0x000F
993#define I2O_DSC_INVALID_OFFSET 0x0010
994#define I2O_DSC_INVALID_PARAMETER 0x0011
995#define I2O_DSC_INVALID_REQUEST 0x0012
996#define I2O_DSC_INVALID_TARGET_ADDRESS 0x0013
997#define I2O_DSC_MESSAGE_TOO_LARGE 0x0014
998#define I2O_DSC_MESSAGE_TOO_SMALL 0x0015
999#define I2O_DSC_MISSING_PARAMETER 0x0016
1000#define I2O_DSC_TIMEOUT 0x0017
1001#define I2O_DSC_UNKNOWN_ERROR 0x0018
1002#define I2O_DSC_UNKNOWN_FUNCTION 0x0019
1003#define I2O_DSC_UNSUPPORTED_VERSION 0x001A
1004#define I2O_DSC_DEVICE_BUSY 0x001B
1005#define I2O_DSC_DEVICE_NOT_AVAILABLE 0x001C
1006
1007/* DetailedStatusCode defines for Block Storage Operation: Table 6-7 Detailed
1008 Status Codes.*/
1009
1010#define I2O_BSA_DSC_SUCCESS 0x0000
1011#define I2O_BSA_DSC_MEDIA_ERROR 0x0001
1012#define I2O_BSA_DSC_ACCESS_ERROR 0x0002
1013#define I2O_BSA_DSC_DEVICE_FAILURE 0x0003
1014#define I2O_BSA_DSC_DEVICE_NOT_READY 0x0004
1015#define I2O_BSA_DSC_MEDIA_NOT_PRESENT 0x0005
1016#define I2O_BSA_DSC_MEDIA_LOCKED 0x0006
1017#define I2O_BSA_DSC_MEDIA_FAILURE 0x0007
1018#define I2O_BSA_DSC_PROTOCOL_FAILURE 0x0008
1019#define I2O_BSA_DSC_BUS_FAILURE 0x0009
1020#define I2O_BSA_DSC_ACCESS_VIOLATION 0x000A
1021#define I2O_BSA_DSC_WRITE_PROTECTED 0x000B
1022#define I2O_BSA_DSC_DEVICE_RESET 0x000C
1023#define I2O_BSA_DSC_VOLUME_CHANGED 0x000D
1024#define I2O_BSA_DSC_TIMEOUT 0x000E
1025
1026/* FailureStatusCodes, Table 3-3 Message Failure Codes */
1027
1028#define I2O_FSC_TRANSPORT_SERVICE_SUSPENDED 0x81
1029#define I2O_FSC_TRANSPORT_SERVICE_TERMINATED 0x82
1030#define I2O_FSC_TRANSPORT_CONGESTION 0x83
1031#define I2O_FSC_TRANSPORT_FAILURE 0x84
1032#define I2O_FSC_TRANSPORT_STATE_ERROR 0x85
1033#define I2O_FSC_TRANSPORT_TIME_OUT 0x86
1034#define I2O_FSC_TRANSPORT_ROUTING_FAILURE 0x87
1035#define I2O_FSC_TRANSPORT_INVALID_VERSION 0x88
1036#define I2O_FSC_TRANSPORT_INVALID_OFFSET 0x89
1037#define I2O_FSC_TRANSPORT_INVALID_MSG_FLAGS 0x8A
1038#define I2O_FSC_TRANSPORT_FRAME_TOO_SMALL 0x8B
1039#define I2O_FSC_TRANSPORT_FRAME_TOO_LARGE 0x8C
1040#define I2O_FSC_TRANSPORT_INVALID_TARGET_ID 0x8D
1041#define I2O_FSC_TRANSPORT_INVALID_INITIATOR_ID 0x8E
1042#define I2O_FSC_TRANSPORT_INVALID_INITIATOR_CONTEXT 0x8F
1043#define I2O_FSC_TRANSPORT_UNKNOWN_FAILURE 0xFF
1044
1045/* Device Claim Types */
1046#define I2O_CLAIM_PRIMARY 0x01000000
1047#define I2O_CLAIM_MANAGEMENT 0x02000000
1048#define I2O_CLAIM_AUTHORIZED 0x03000000
1049#define I2O_CLAIM_SECONDARY 0x04000000
1050
1051/* Message header defines for VersionOffset */
1052#define I2OVER15 0x0001
1053#define I2OVER20 0x0002
1054
1055/* Default is 1.5 */
1056#define I2OVERSION I2OVER15
1057
1058#define SGL_OFFSET_0 I2OVERSION
1059#define SGL_OFFSET_4 (0x0040 | I2OVERSION)
1060#define SGL_OFFSET_5 (0x0050 | I2OVERSION)
1061#define SGL_OFFSET_6 (0x0060 | I2OVERSION)
1062#define SGL_OFFSET_7 (0x0070 | I2OVERSION)
1063#define SGL_OFFSET_8 (0x0080 | I2OVERSION)
1064#define SGL_OFFSET_9 (0x0090 | I2OVERSION)
1065#define SGL_OFFSET_10 (0x00A0 | I2OVERSION)
1066#define SGL_OFFSET_11 (0x00B0 | I2OVERSION)
1067#define SGL_OFFSET_12 (0x00C0 | I2OVERSION)
1068#define SGL_OFFSET(x) (((x)<<4) | I2OVERSION)
1069
1070/* Transaction Reply Lists (TRL) Control Word structure */
1071#define TRL_SINGLE_FIXED_LENGTH 0x00
1072#define TRL_SINGLE_VARIABLE_LENGTH 0x40
1073#define TRL_MULTIPLE_FIXED_LENGTH 0x80
1074
1075 /* msg header defines for MsgFlags */
1076#define MSG_STATIC 0x0100
1077#define MSG_64BIT_CNTXT 0x0200
1078#define MSG_MULTI_TRANS 0x1000
1079#define MSG_FAIL 0x2000
1080#define MSG_FINAL 0x4000
1081#define MSG_REPLY 0x8000
1082
1083 /* minimum size msg */
1084#define THREE_WORD_MSG_SIZE 0x00030000
1085#define FOUR_WORD_MSG_SIZE 0x00040000
1086#define FIVE_WORD_MSG_SIZE 0x00050000
1087#define SIX_WORD_MSG_SIZE 0x00060000
1088#define SEVEN_WORD_MSG_SIZE 0x00070000
1089#define EIGHT_WORD_MSG_SIZE 0x00080000
1090#define NINE_WORD_MSG_SIZE 0x00090000
1091#define TEN_WORD_MSG_SIZE 0x000A0000
1092#define ELEVEN_WORD_MSG_SIZE 0x000B0000
1093#define I2O_MESSAGE_SIZE(x) ((x)<<16)
1094
1095/* special TID assignments */
1096#define ADAPTER_TID 0
1097#define HOST_TID 1
1098
1099/* outbound queue defines */
1100#define I2O_MAX_OUTBOUND_MSG_FRAMES 128
1101#define I2O_OUTBOUND_MSG_FRAME_SIZE 128 /* in 32-bit words */
1102
1103#define I2O_POST_WAIT_OK 0
1104#define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT
1105
1106#define I2O_CONTEXT_LIST_MIN_LENGTH 15
1107#define I2O_CONTEXT_LIST_USED 0x01
1108#define I2O_CONTEXT_LIST_DELETED 0x02
1109
1110/* timeouts */
1111#define I2O_TIMEOUT_INIT_OUTBOUND_QUEUE 15
1112#define I2O_TIMEOUT_MESSAGE_GET 5
1113#define I2O_TIMEOUT_RESET 30
1114#define I2O_TIMEOUT_STATUS_GET 5
1115#define I2O_TIMEOUT_LCT_GET 360
1116#define I2O_TIMEOUT_SCSI_SCB_ABORT 240
1117
1118/* retries */
1119#define I2O_HRT_GET_TRIES 3
1120#define I2O_LCT_GET_TRIES 3
1121
1122/* defines for max_sectors and max_phys_segments */
1123#define I2O_MAX_SECTORS 1024
1124#define I2O_MAX_SECTORS_LIMITED 256
1125#define I2O_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS
1126
1127#endif /* __KERNEL__ */ 1255#endif /* __KERNEL__ */
1128#endif /* _I2O_H */ 1256#endif /* _I2O_H */
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index e677f73f13dd..4fab3d0a4bce 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -157,8 +157,7 @@ struct pppox_proto {
157extern int register_pppox_proto(int proto_num, struct pppox_proto *pp); 157extern int register_pppox_proto(int proto_num, struct pppox_proto *pp);
158extern void unregister_pppox_proto(int proto_num); 158extern void unregister_pppox_proto(int proto_num);
159extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */ 159extern void pppox_unbind_sock(struct sock *sk);/* delete ppp-channel binding */
160extern int pppox_channel_ioctl(struct ppp_channel *pc, unsigned int cmd, 160extern int pppox_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg);
161 unsigned long arg);
162 161
163/* PPPoX socket states */ 162/* PPPoX socket states */
164enum { 163enum {
diff --git a/include/linux/inet.h b/include/linux/inet.h
index 3b5e9fdff872..6c5587af118d 100644
--- a/include/linux/inet.h
+++ b/include/linux/inet.h
@@ -45,6 +45,6 @@
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/types.h> 46#include <linux/types.h>
47 47
48extern __u32 in_aton(const char *str); 48extern __be32 in_aton(const char *str);
49#endif 49#endif
50#endif /* _LINUX_INET_H */ 50#endif /* _LINUX_INET_H */
diff --git a/include/linux/input.h b/include/linux/input.h
index 3c5823368ddb..6d4cc3c110d6 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -13,6 +13,7 @@
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
16#else 17#else
17#include <sys/time.h> 18#include <sys/time.h>
18#include <sys/ioctl.h> 19#include <sys/ioctl.h>
@@ -511,6 +512,8 @@ struct input_absinfo {
511#define KEY_FN_S 0x1e3 512#define KEY_FN_S 0x1e3
512#define KEY_FN_B 0x1e4 513#define KEY_FN_B 0x1e4
513 514
515/* We avoid low common keys in module aliases so they don't get huge. */
516#define KEY_MIN_INTERESTING KEY_MUTE
514#define KEY_MAX 0x1ff 517#define KEY_MAX 0x1ff
515 518
516/* 519/*
@@ -793,6 +796,44 @@ struct ff_effect {
793 796
794#define FF_MAX 0x7f 797#define FF_MAX 0x7f
795 798
799struct input_device_id {
800
801 kernel_ulong_t flags;
802
803 struct input_id id;
804
805 kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1];
806 kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1];
807 kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1];
808 kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1];
809 kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1];
810 kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1];
811 kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1];
812 kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1];
813 kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1];
814
815 kernel_ulong_t driver_info;
816};
817
818/*
819 * Structure for hotplug & device<->driver matching.
820 */
821
822#define INPUT_DEVICE_ID_MATCH_BUS 1
823#define INPUT_DEVICE_ID_MATCH_VENDOR 2
824#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
825#define INPUT_DEVICE_ID_MATCH_VERSION 8
826
827#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
828#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
829#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
830#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
831#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
832#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
833#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
834#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
835#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
836
796#ifdef __KERNEL__ 837#ifdef __KERNEL__
797 838
798/* 839/*
@@ -901,49 +942,11 @@ struct input_dev {
901}; 942};
902#define to_input_dev(d) container_of(d, struct input_dev, cdev) 943#define to_input_dev(d) container_of(d, struct input_dev, cdev)
903 944
904/*
905 * Structure for hotplug & device<->driver matching.
906 */
907
908#define INPUT_DEVICE_ID_MATCH_BUS 1
909#define INPUT_DEVICE_ID_MATCH_VENDOR 2
910#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
911#define INPUT_DEVICE_ID_MATCH_VERSION 8
912
913#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
914#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
915#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
916#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
917#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
918#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
919#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
920#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
921#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
922
923#define INPUT_DEVICE_ID_MATCH_DEVICE\ 945#define INPUT_DEVICE_ID_MATCH_DEVICE\
924 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 946 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
925#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ 947#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\
926 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) 948 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
927 949
928struct input_device_id {
929
930 unsigned long flags;
931
932 struct input_id id;
933
934 unsigned long evbit[NBITS(EV_MAX)];
935 unsigned long keybit[NBITS(KEY_MAX)];
936 unsigned long relbit[NBITS(REL_MAX)];
937 unsigned long absbit[NBITS(ABS_MAX)];
938 unsigned long mscbit[NBITS(MSC_MAX)];
939 unsigned long ledbit[NBITS(LED_MAX)];
940 unsigned long sndbit[NBITS(SND_MAX)];
941 unsigned long ffbit[NBITS(FF_MAX)];
942 unsigned long swbit[NBITS(SW_MAX)];
943
944 unsigned long driver_info;
945};
946
947struct input_handle; 950struct input_handle;
948 951
949struct input_handler { 952struct input_handler {
diff --git a/include/linux/ip.h b/include/linux/ip.h
index 33e8a19a1a0f..4b55cf1df732 100644
--- a/include/linux/ip.h
+++ b/include/linux/ip.h
@@ -16,6 +16,7 @@
16 */ 16 */
17#ifndef _LINUX_IP_H 17#ifndef _LINUX_IP_H
18#define _LINUX_IP_H 18#define _LINUX_IP_H
19#include <linux/types.h>
19#include <asm/byteorder.h> 20#include <asm/byteorder.h>
20 21
21#define IPTOS_TOS_MASK 0x1E 22#define IPTOS_TOS_MASK 0x1E
@@ -78,126 +79,6 @@
78#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ 79#define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */
79#define IPOPT_TS_PRESPEC 3 /* specified modules only */ 80#define IPOPT_TS_PRESPEC 3 /* specified modules only */
80 81
81#ifdef __KERNEL__
82#include <linux/config.h>
83#include <linux/types.h>
84#include <net/request_sock.h>
85#include <net/sock.h>
86#include <linux/igmp.h>
87#include <net/flow.h>
88
89struct ip_options {
90 __u32 faddr; /* Saved first hop address */
91 unsigned char optlen;
92 unsigned char srr;
93 unsigned char rr;
94 unsigned char ts;
95 unsigned char is_setbyuser:1, /* Set by setsockopt? */
96 is_data:1, /* Options in __data, rather than skb */
97 is_strictroute:1, /* Strict source route */
98 srr_is_hit:1, /* Packet destination addr was our one */
99 is_changed:1, /* IP checksum more not valid */
100 rr_needaddr:1, /* Need to record addr of outgoing dev */
101 ts_needtime:1, /* Need to record timestamp */
102 ts_needaddr:1; /* Need to record addr of outgoing dev */
103 unsigned char router_alert;
104 unsigned char __pad1;
105 unsigned char __pad2;
106 unsigned char __data[0];
107};
108
109#define optlength(opt) (sizeof(struct ip_options) + opt->optlen)
110
111struct inet_request_sock {
112 struct request_sock req;
113 u32 loc_addr;
114 u32 rmt_addr;
115 u16 rmt_port;
116 u16 snd_wscale : 4,
117 rcv_wscale : 4,
118 tstamp_ok : 1,
119 sack_ok : 1,
120 wscale_ok : 1,
121 ecn_ok : 1,
122 acked : 1;
123 struct ip_options *opt;
124};
125
126static inline struct inet_request_sock *inet_rsk(const struct request_sock *sk)
127{
128 return (struct inet_request_sock *)sk;
129}
130
131struct ipv6_pinfo;
132
133struct inet_sock {
134 /* sk and pinet6 has to be the first two members of inet_sock */
135 struct sock sk;
136#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
137 struct ipv6_pinfo *pinet6;
138#endif
139 /* Socket demultiplex comparisons on incoming packets. */
140 __u32 daddr; /* Foreign IPv4 addr */
141 __u32 rcv_saddr; /* Bound local IPv4 addr */
142 __u16 dport; /* Destination port */
143 __u16 num; /* Local port */
144 __u32 saddr; /* Sending source */
145 __s16 uc_ttl; /* Unicast TTL */
146 __u16 cmsg_flags;
147 struct ip_options *opt;
148 __u16 sport; /* Source port */
149 __u16 id; /* ID counter for DF pkts */
150 __u8 tos; /* TOS */
151 __u8 mc_ttl; /* Multicasting TTL */
152 __u8 pmtudisc;
153 unsigned recverr : 1,
154 freebind : 1,
155 hdrincl : 1,
156 mc_loop : 1;
157 int mc_index; /* Multicast device index */
158 __u32 mc_addr;
159 struct ip_mc_socklist *mc_list; /* Group array */
160 /*
161 * Following members are used to retain the infomation to build
162 * an ip header on each ip fragmentation while the socket is corked.
163 */
164 struct {
165 unsigned int flags;
166 unsigned int fragsize;
167 struct ip_options *opt;
168 struct rtable *rt;
169 int length; /* Total length of all frames */
170 u32 addr;
171 struct flowi fl;
172 } cork;
173};
174
175#define IPCORK_OPT 1 /* ip-options has been held in ipcork.opt */
176#define IPCORK_ALLFRAG 2 /* always fragment (for ipv6 for now) */
177
178static inline struct inet_sock *inet_sk(const struct sock *sk)
179{
180 return (struct inet_sock *)sk;
181}
182
183static inline void __inet_sk_copy_descendant(struct sock *sk_to,
184 const struct sock *sk_from,
185 const int ancestor_size)
186{
187 memcpy(inet_sk(sk_to) + 1, inet_sk(sk_from) + 1,
188 sk_from->sk_prot->obj_size - ancestor_size);
189}
190#if !(defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE))
191static inline void inet_sk_copy_descendant(struct sock *sk_to,
192 const struct sock *sk_from)
193{
194 __inet_sk_copy_descendant(sk_to, sk_from, sizeof(struct inet_sock));
195}
196#endif
197#endif
198
199extern int inet_sk_rebuild_header(struct sock *sk);
200
201struct iphdr { 82struct iphdr {
202#if defined(__LITTLE_ENDIAN_BITFIELD) 83#if defined(__LITTLE_ENDIAN_BITFIELD)
203 __u8 ihl:4, 84 __u8 ihl:4,
@@ -209,14 +90,14 @@ struct iphdr {
209#error "Please fix <asm/byteorder.h>" 90#error "Please fix <asm/byteorder.h>"
210#endif 91#endif
211 __u8 tos; 92 __u8 tos;
212 __u16 tot_len; 93 __be16 tot_len;
213 __u16 id; 94 __be16 id;
214 __u16 frag_off; 95 __be16 frag_off;
215 __u8 ttl; 96 __u8 ttl;
216 __u8 protocol; 97 __u8 protocol;
217 __u16 check; 98 __u16 check;
218 __u32 saddr; 99 __be32 saddr;
219 __u32 daddr; 100 __be32 daddr;
220 /*The options start here. */ 101 /*The options start here. */
221}; 102};
222 103
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index e0b922785d98..93bbed5c6cf4 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -171,12 +171,13 @@ enum {
171}; 171};
172 172
173#ifdef __KERNEL__ 173#ifdef __KERNEL__
174#include <linux/in6.h> /* struct sockaddr_in6 */
175#include <linux/icmpv6.h> 174#include <linux/icmpv6.h>
176#include <net/if_inet6.h> /* struct ipv6_mc_socklist */
177#include <linux/tcp.h> 175#include <linux/tcp.h>
178#include <linux/udp.h> 176#include <linux/udp.h>
179 177
178#include <net/if_inet6.h> /* struct ipv6_mc_socklist */
179#include <net/inet_sock.h>
180
180/* 181/*
181 This structure contains results of exthdrs parsing 182 This structure contains results of exthdrs parsing
182 as offsets from skb->nh. 183 as offsets from skb->nh.
@@ -199,18 +200,17 @@ static inline int inet6_iif(const struct sk_buff *skb)
199 return IP6CB(skb)->iif; 200 return IP6CB(skb)->iif;
200} 201}
201 202
202struct tcp6_request_sock { 203struct inet6_request_sock {
203 struct tcp_request_sock req;
204 struct in6_addr loc_addr; 204 struct in6_addr loc_addr;
205 struct in6_addr rmt_addr; 205 struct in6_addr rmt_addr;
206 struct sk_buff *pktopts; 206 struct sk_buff *pktopts;
207 int iif; 207 int iif;
208}; 208};
209 209
210static inline struct tcp6_request_sock *tcp6_rsk(const struct request_sock *sk) 210struct tcp6_request_sock {
211{ 211 struct tcp_request_sock tcp6rsk_tcp;
212 return (struct tcp6_request_sock *)sk; 212 struct inet6_request_sock tcp6rsk_inet6;
213} 213};
214 214
215/** 215/**
216 * struct ipv6_pinfo - ipv6 private area 216 * struct ipv6_pinfo - ipv6 private area
@@ -298,12 +298,36 @@ struct tcp6_sock {
298 struct ipv6_pinfo inet6; 298 struct ipv6_pinfo inet6;
299}; 299};
300 300
301extern int inet6_sk_rebuild_header(struct sock *sk);
302
301#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 303#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
302static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk) 304static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
303{ 305{
304 return inet_sk(__sk)->pinet6; 306 return inet_sk(__sk)->pinet6;
305} 307}
306 308
309static inline struct inet6_request_sock *
310 inet6_rsk(const struct request_sock *rsk)
311{
312 return (struct inet6_request_sock *)(((u8 *)rsk) +
313 inet_rsk(rsk)->inet6_rsk_offset);
314}
315
316static inline u32 inet6_rsk_offset(struct request_sock *rsk)
317{
318 return rsk->rsk_ops->obj_size - sizeof(struct inet6_request_sock);
319}
320
321static inline struct request_sock *inet6_reqsk_alloc(struct request_sock_ops *ops)
322{
323 struct request_sock *req = reqsk_alloc(ops);
324
325 if (req != NULL)
326 inet_rsk(req)->inet6_rsk_offset = inet6_rsk_offset(req);
327
328 return req;
329}
330
307static inline struct raw6_sock *raw6_sk(const struct sock *sk) 331static inline struct raw6_sock *raw6_sk(const struct sock *sk)
308{ 332{
309 return (struct raw6_sock *)sk; 333 return (struct raw6_sock *)sk;
@@ -323,28 +347,37 @@ static inline void inet_sk_copy_descendant(struct sock *sk_to,
323#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only) 347#define __ipv6_only_sock(sk) (inet6_sk(sk)->ipv6only)
324#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk)) 348#define ipv6_only_sock(sk) ((sk)->sk_family == PF_INET6 && __ipv6_only_sock(sk))
325 349
326#include <linux/tcp.h> 350struct inet6_timewait_sock {
351 struct in6_addr tw_v6_daddr;
352 struct in6_addr tw_v6_rcv_saddr;
353};
327 354
328struct tcp6_timewait_sock { 355struct tcp6_timewait_sock {
329 struct tcp_timewait_sock tw_v6_sk; 356 struct tcp_timewait_sock tcp6tw_tcp;
330 struct in6_addr tw_v6_daddr; 357 struct inet6_timewait_sock tcp6tw_inet6;
331 struct in6_addr tw_v6_rcv_saddr;
332}; 358};
333 359
334static inline struct tcp6_timewait_sock *tcp6_twsk(const struct sock *sk) 360static inline u16 inet6_tw_offset(const struct proto *prot)
335{ 361{
336 return (struct tcp6_timewait_sock *)sk; 362 return prot->twsk_prot->twsk_obj_size -
363 sizeof(struct inet6_timewait_sock);
337} 364}
338 365
339static inline struct in6_addr *__tcp_v6_rcv_saddr(const struct sock *sk) 366static inline struct inet6_timewait_sock *inet6_twsk(const struct sock *sk)
367{
368 return (struct inet6_timewait_sock *)(((u8 *)sk) +
369 inet_twsk(sk)->tw_ipv6_offset);
370}
371
372static inline struct in6_addr *__inet6_rcv_saddr(const struct sock *sk)
340{ 373{
341 return likely(sk->sk_state != TCP_TIME_WAIT) ? 374 return likely(sk->sk_state != TCP_TIME_WAIT) ?
342 &inet6_sk(sk)->rcv_saddr : &tcp6_twsk(sk)->tw_v6_rcv_saddr; 375 &inet6_sk(sk)->rcv_saddr : &inet6_twsk(sk)->tw_v6_rcv_saddr;
343} 376}
344 377
345static inline struct in6_addr *tcp_v6_rcv_saddr(const struct sock *sk) 378static inline struct in6_addr *inet6_rcv_saddr(const struct sock *sk)
346{ 379{
347 return sk->sk_family == AF_INET6 ? __tcp_v6_rcv_saddr(sk) : NULL; 380 return sk->sk_family == AF_INET6 ? __inet6_rcv_saddr(sk) : NULL;
348} 381}
349 382
350static inline int inet_v6_ipv6only(const struct sock *sk) 383static inline int inet_v6_ipv6only(const struct sock *sk)
@@ -361,13 +394,19 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
361 return NULL; 394 return NULL;
362} 395}
363 396
397static inline struct inet6_request_sock *
398 inet6_rsk(const struct request_sock *rsk)
399{
400 return NULL;
401}
402
364static inline struct raw6_sock *raw6_sk(const struct sock *sk) 403static inline struct raw6_sock *raw6_sk(const struct sock *sk)
365{ 404{
366 return NULL; 405 return NULL;
367} 406}
368 407
369#define __tcp_v6_rcv_saddr(__sk) NULL 408#define __inet6_rcv_saddr(__sk) NULL
370#define tcp_v6_rcv_saddr(__sk) NULL 409#define inet6_rcv_saddr(__sk) NULL
371#define tcp_twsk_ipv6only(__sk) 0 410#define tcp_twsk_ipv6only(__sk) 0
372#define inet_v6_ipv6only(__sk) 0 411#define inet_v6_ipv6only(__sk) 0
373#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ 412#endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index f04ba20712a2..6c5d4c898ccb 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -12,7 +12,7 @@
12#include <linux/config.h> 12#include <linux/config.h>
13#include <linux/smp.h> 13#include <linux/smp.h>
14 14
15#if !defined(CONFIG_ARCH_S390) 15#if !defined(CONFIG_S390)
16 16
17#include <linux/linkage.h> 17#include <linux/linkage.h>
18#include <linux/cache.h> 18#include <linux/cache.h>
@@ -221,6 +221,17 @@ extern void note_interrupt(unsigned int irq, irq_desc_t *desc,
221extern int can_request_irq(unsigned int irq, unsigned long irqflags); 221extern int can_request_irq(unsigned int irq, unsigned long irqflags);
222 222
223extern void init_irq_proc(void); 223extern void init_irq_proc(void);
224
225#ifdef CONFIG_AUTO_IRQ_AFFINITY
226extern int select_smp_affinity(unsigned int irq);
227#else
228static inline int
229select_smp_affinity(unsigned int irq)
230{
231 return 1;
232}
233#endif
234
224#endif 235#endif
225 236
226extern hw_irq_controller no_irq_type; /* needed in every arch ? */ 237extern hw_irq_controller no_irq_type; /* needed in every arch ? */
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index dcde7adfdce5..558cb4c26ec9 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -498,6 +498,12 @@ struct transaction_s
498 struct journal_head *t_checkpoint_list; 498 struct journal_head *t_checkpoint_list;
499 499
500 /* 500 /*
501 * Doubly-linked circular list of all buffers submitted for IO while
502 * checkpointing. [j_list_lock]
503 */
504 struct journal_head *t_checkpoint_io_list;
505
506 /*
501 * Doubly-linked circular list of temporary buffers currently undergoing 507 * Doubly-linked circular list of temporary buffers currently undergoing
502 * IO in the log [j_list_lock] 508 * IO in the log [j_list_lock]
503 */ 509 */
@@ -843,7 +849,7 @@ extern void journal_commit_transaction(journal_t *);
843 849
844/* Checkpoint list management */ 850/* Checkpoint list management */
845int __journal_clean_checkpoint_list(journal_t *journal); 851int __journal_clean_checkpoint_list(journal_t *journal);
846void __journal_remove_checkpoint(struct journal_head *); 852int __journal_remove_checkpoint(struct journal_head *);
847void __journal_insert_checkpoint(struct journal_head *, transaction_t *); 853void __journal_insert_checkpoint(struct journal_head *, transaction_t *);
848 854
849/* Buffer IO */ 855/* Buffer IO */
diff --git a/include/linux/key.h b/include/linux/key.h
index 53513a3be53b..4d189e51bc6c 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -193,14 +193,6 @@ struct key_type {
193 */ 193 */
194 int (*instantiate)(struct key *key, const void *data, size_t datalen); 194 int (*instantiate)(struct key *key, const void *data, size_t datalen);
195 195
196 /* duplicate a key of this type (optional)
197 * - the source key will be locked against change
198 * - the new description will be attached
199 * - the quota will have been adjusted automatically from
200 * source->quotalen
201 */
202 int (*duplicate)(struct key *key, const struct key *source);
203
204 /* update a key of this type (optional) 196 /* update a key of this type (optional)
205 * - this method should call key_payload_reserve() to recalculate the 197 * - this method should call key_payload_reserve() to recalculate the
206 * quota consumption 198 * quota consumption
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 7f7403aa4a41..2a8d8da70961 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -23,14 +23,27 @@
23#include <linux/spinlock.h> 23#include <linux/spinlock.h>
24#include <linux/rwsem.h> 24#include <linux/rwsem.h>
25#include <linux/kref.h> 25#include <linux/kref.h>
26#include <linux/kobject_uevent.h>
27#include <linux/kernel.h> 26#include <linux/kernel.h>
28#include <asm/atomic.h> 27#include <asm/atomic.h>
29 28
30#define KOBJ_NAME_LEN 20 29#define KOBJ_NAME_LEN 20
30#define UEVENT_HELPER_PATH_LEN 256
31 31
32/* counter to tag the hotplug event, read only except for the kobject core */ 32/* path to the userspace helper executed on an event */
33extern u64 hotplug_seqnum; 33extern char uevent_helper[];
34
35/* counter to tag the uevent, read only except for the kobject core */
36extern u64 uevent_seqnum;
37
38/* the actions here must match the proper string in lib/kobject_uevent.c */
39typedef int __bitwise kobject_action_t;
40enum kobject_action {
41 KOBJ_ADD = (__force kobject_action_t) 0x01, /* exclusive to core */
42 KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* exclusive to core */
43 KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* device state change */
44 KOBJ_OFFLINE = (__force kobject_action_t) 0x04, /* device offline */
45 KOBJ_ONLINE = (__force kobject_action_t) 0x05, /* device online */
46};
34 47
35struct kobject { 48struct kobject {
36 const char * k_name; 49 const char * k_name;
@@ -87,15 +100,14 @@ struct kobj_type {
87 * of object; multiple ksets can belong to one subsystem. All 100 * of object; multiple ksets can belong to one subsystem. All
88 * ksets of a subsystem share the subsystem's lock. 101 * ksets of a subsystem share the subsystem's lock.
89 * 102 *
90 * Each kset can support hotplugging; if it does, it will be given 103 * Each kset can support specific event variables; it can
91 * the opportunity to filter out specific kobjects from being 104 * supress the event generation or add subsystem specific
92 * reported, as well as to add its own "data" elements to the 105 * variables carried with the event.
93 * environment being passed to the hotplug helper.
94 */ 106 */
95struct kset_hotplug_ops { 107struct kset_uevent_ops {
96 int (*filter)(struct kset *kset, struct kobject *kobj); 108 int (*filter)(struct kset *kset, struct kobject *kobj);
97 const char *(*name)(struct kset *kset, struct kobject *kobj); 109 const char *(*name)(struct kset *kset, struct kobject *kobj);
98 int (*hotplug)(struct kset *kset, struct kobject *kobj, char **envp, 110 int (*uevent)(struct kset *kset, struct kobject *kobj, char **envp,
99 int num_envp, char *buffer, int buffer_size); 111 int num_envp, char *buffer, int buffer_size);
100}; 112};
101 113
@@ -105,7 +117,7 @@ struct kset {
105 struct list_head list; 117 struct list_head list;
106 spinlock_t list_lock; 118 spinlock_t list_lock;
107 struct kobject kobj; 119 struct kobject kobj;
108 struct kset_hotplug_ops * hotplug_ops; 120 struct kset_uevent_ops * uevent_ops;
109}; 121};
110 122
111 123
@@ -153,20 +165,20 @@ struct subsystem {
153 struct rw_semaphore rwsem; 165 struct rw_semaphore rwsem;
154}; 166};
155 167
156#define decl_subsys(_name,_type,_hotplug_ops) \ 168#define decl_subsys(_name,_type,_uevent_ops) \
157struct subsystem _name##_subsys = { \ 169struct subsystem _name##_subsys = { \
158 .kset = { \ 170 .kset = { \
159 .kobj = { .name = __stringify(_name) }, \ 171 .kobj = { .name = __stringify(_name) }, \
160 .ktype = _type, \ 172 .ktype = _type, \
161 .hotplug_ops =_hotplug_ops, \ 173 .uevent_ops =_uevent_ops, \
162 } \ 174 } \
163} 175}
164#define decl_subsys_name(_varname,_name,_type,_hotplug_ops) \ 176#define decl_subsys_name(_varname,_name,_type,_uevent_ops) \
165struct subsystem _varname##_subsys = { \ 177struct subsystem _varname##_subsys = { \
166 .kset = { \ 178 .kset = { \
167 .kobj = { .name = __stringify(_name) }, \ 179 .kobj = { .name = __stringify(_name) }, \
168 .ktype = _type, \ 180 .ktype = _type, \
169 .hotplug_ops =_hotplug_ops, \ 181 .uevent_ops =_uevent_ops, \
170 } \ 182 } \
171} 183}
172 184
@@ -241,15 +253,17 @@ struct subsys_attribute {
241extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); 253extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
242extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *); 254extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
243 255
244#ifdef CONFIG_HOTPLUG 256#if defined(CONFIG_HOTPLUG) & defined(CONFIG_NET)
245void kobject_hotplug(struct kobject *kobj, enum kobject_action action); 257void kobject_uevent(struct kobject *kobj, enum kobject_action action);
246int add_hotplug_env_var(char **envp, int num_envp, int *cur_index, 258
259int add_uevent_var(char **envp, int num_envp, int *cur_index,
247 char *buffer, int buffer_size, int *cur_len, 260 char *buffer, int buffer_size, int *cur_len,
248 const char *format, ...) 261 const char *format, ...)
249 __attribute__((format (printf, 7, 8))); 262 __attribute__((format (printf, 7, 8)));
250#else 263#else
251static inline void kobject_hotplug(struct kobject *kobj, enum kobject_action action) { } 264static inline void kobject_uevent(struct kobject *kobj, enum kobject_action action) { }
252static inline int add_hotplug_env_var(char **envp, int num_envp, int *cur_index, 265
266static inline int add_uevent_var(char **envp, int num_envp, int *cur_index,
253 char *buffer, int buffer_size, int *cur_len, 267 char *buffer, int buffer_size, int *cur_len,
254 const char *format, ...) 268 const char *format, ...)
255{ return 0; } 269{ return 0; }
diff --git a/include/linux/kobject_uevent.h b/include/linux/kobject_uevent.h
deleted file mode 100644
index aa664fe7e561..000000000000
--- a/include/linux/kobject_uevent.h
+++ /dev/null
@@ -1,57 +0,0 @@
1/*
2 * kobject_uevent.h - list of kobject user events that can be generated
3 *
4 * Copyright (C) 2004 IBM Corp.
5 * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
6 *
7 * This file is released under the GPLv2.
8 *
9 */
10
11#ifndef _KOBJECT_EVENT_H_
12#define _KOBJECT_EVENT_H_
13
14#define HOTPLUG_PATH_LEN 256
15
16/* path to the hotplug userspace helper executed on an event */
17extern char hotplug_path[];
18
19/*
20 * If you add an action here, you must also add the proper string to the
21 * lib/kobject_uevent.c file.
22 */
23typedef int __bitwise kobject_action_t;
24enum kobject_action {
25 KOBJ_ADD = (__force kobject_action_t) 0x01, /* add event, for hotplug */
26 KOBJ_REMOVE = (__force kobject_action_t) 0x02, /* remove event, for hotplug */
27 KOBJ_CHANGE = (__force kobject_action_t) 0x03, /* a sysfs attribute file has changed */
28 KOBJ_MOUNT = (__force kobject_action_t) 0x04, /* mount event for block devices */
29 KOBJ_UMOUNT = (__force kobject_action_t) 0x05, /* umount event for block devices */
30 KOBJ_OFFLINE = (__force kobject_action_t) 0x06, /* offline event for hotplug devices */
31 KOBJ_ONLINE = (__force kobject_action_t) 0x07, /* online event for hotplug devices */
32};
33
34
35#ifdef CONFIG_KOBJECT_UEVENT
36int kobject_uevent(struct kobject *kobj,
37 enum kobject_action action,
38 struct attribute *attr);
39int kobject_uevent_atomic(struct kobject *kobj,
40 enum kobject_action action,
41 struct attribute *attr);
42#else
43static inline int kobject_uevent(struct kobject *kobj,
44 enum kobject_action action,
45 struct attribute *attr)
46{
47 return 0;
48}
49static inline int kobject_uevent_atomic(struct kobject *kobj,
50 enum kobject_action action,
51 struct attribute *attr)
52{
53 return 0;
54}
55#endif
56
57#endif
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 41ea7dbc1755..a43c95f8f968 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -124,6 +124,8 @@ enum {
124 ATA_FLAG_DEBUGMSG = (1 << 10), 124 ATA_FLAG_DEBUGMSG = (1 << 10),
125 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ 125 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */
126 126
127 ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */
128
127 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ 129 ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */
128 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ 130 ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */
129 ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ 131 ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */
@@ -136,6 +138,8 @@ enum {
136 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* hueristic */ 138 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* hueristic */
137 ATA_TMOUT_CDB = 30 * HZ, 139 ATA_TMOUT_CDB = 30 * HZ,
138 ATA_TMOUT_CDB_QUICK = 5 * HZ, 140 ATA_TMOUT_CDB_QUICK = 5 * HZ,
141 ATA_TMOUT_INTERNAL = 30 * HZ,
142 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
139 143
140 /* ATA bus states */ 144 /* ATA bus states */
141 BUS_UNKNOWN = 0, 145 BUS_UNKNOWN = 0,
@@ -195,7 +199,7 @@ struct ata_port;
195struct ata_queued_cmd; 199struct ata_queued_cmd;
196 200
197/* typedefs */ 201/* typedefs */
198typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc, unsigned int err_mask); 202typedef int (*ata_qc_cb_t) (struct ata_queued_cmd *qc);
199 203
200struct ata_ioports { 204struct ata_ioports {
201 unsigned long cmd_addr; 205 unsigned long cmd_addr;
@@ -280,9 +284,9 @@ struct ata_queued_cmd {
280 /* DO NOT iterate over __sg manually, use ata_for_each_sg() */ 284 /* DO NOT iterate over __sg manually, use ata_for_each_sg() */
281 struct scatterlist *__sg; 285 struct scatterlist *__sg;
282 286
283 ata_qc_cb_t complete_fn; 287 unsigned int err_mask;
284 288
285 struct completion *waiting; 289 ata_qc_cb_t complete_fn;
286 290
287 void *private_data; 291 void *private_data;
288}; 292};
@@ -331,8 +335,6 @@ struct ata_port {
331 335
332 u8 ctl; /* cache of ATA control register */ 336 u8 ctl; /* cache of ATA control register */
333 u8 last_ctl; /* Cache last written value */ 337 u8 last_ctl; /* Cache last written value */
334 unsigned int bus_state;
335 unsigned int port_state;
336 unsigned int pio_mask; 338 unsigned int pio_mask;
337 unsigned int mwdma_mask; 339 unsigned int mwdma_mask;
338 unsigned int udma_mask; 340 unsigned int udma_mask;
@@ -436,6 +438,8 @@ extern void ata_std_ports(struct ata_ioports *ioaddr);
436extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info, 438extern int ata_pci_init_one (struct pci_dev *pdev, struct ata_port_info **port_info,
437 unsigned int n_ports); 439 unsigned int n_ports);
438extern void ata_pci_remove_one (struct pci_dev *pdev); 440extern void ata_pci_remove_one (struct pci_dev *pdev);
441extern int ata_pci_device_suspend(struct pci_dev *pdev, pm_message_t state);
442extern int ata_pci_device_resume(struct pci_dev *pdev);
439#endif /* CONFIG_PCI */ 443#endif /* CONFIG_PCI */
440extern int ata_device_add(const struct ata_probe_ent *ent); 444extern int ata_device_add(const struct ata_probe_ent *ent);
441extern void ata_host_set_remove(struct ata_host_set *host_set); 445extern void ata_host_set_remove(struct ata_host_set *host_set);
@@ -445,6 +449,10 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
445extern int ata_scsi_error(struct Scsi_Host *host); 449extern int ata_scsi_error(struct Scsi_Host *host);
446extern int ata_scsi_release(struct Scsi_Host *host); 450extern int ata_scsi_release(struct Scsi_Host *host);
447extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 451extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
452extern int ata_scsi_device_resume(struct scsi_device *);
453extern int ata_scsi_device_suspend(struct scsi_device *);
454extern int ata_device_resume(struct ata_port *, struct ata_device *);
455extern int ata_device_suspend(struct ata_port *, struct ata_device *);
448extern int ata_ratelimit(void); 456extern int ata_ratelimit(void);
449 457
450/* 458/*
@@ -478,9 +486,10 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
478extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 486extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
479extern u8 ata_bmdma_status(struct ata_port *ap); 487extern u8 ata_bmdma_status(struct ata_port *ap);
480extern void ata_bmdma_irq_clear(struct ata_port *ap); 488extern void ata_bmdma_irq_clear(struct ata_port *ap);
481extern void ata_qc_complete(struct ata_queued_cmd *qc, unsigned int err_mask); 489extern void ata_qc_complete(struct ata_queued_cmd *qc);
482extern void ata_eng_timeout(struct ata_port *ap); 490extern void ata_eng_timeout(struct ata_port *ap);
483extern void ata_scsi_simulate(u16 *id, struct scsi_cmnd *cmd, 491extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev,
492 struct scsi_cmnd *cmd,
484 void (*done)(struct scsi_cmnd *)); 493 void (*done)(struct scsi_cmnd *));
485extern int ata_std_bios_param(struct scsi_device *sdev, 494extern int ata_std_bios_param(struct scsi_device *sdev,
486 struct block_device *bdev, 495 struct block_device *bdev,
@@ -670,6 +679,7 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
670 qc->cursect = qc->cursg = qc->cursg_ofs = 0; 679 qc->cursect = qc->cursg = qc->cursg_ofs = 0;
671 qc->nsect = 0; 680 qc->nsect = 0;
672 qc->nbytes = qc->curbytes = 0; 681 qc->nbytes = qc->curbytes = 0;
682 qc->err_mask = 0;
673 683
674 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); 684 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno);
675} 685}
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 16d4e5a08e1d..95c8fea293ba 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -172,7 +172,7 @@ extern struct nlm_host *nlm_find_client(void);
172/* 172/*
173 * Server-side lock handling 173 * Server-side lock handling
174 */ 174 */
175int nlmsvc_async_call(struct nlm_rqst *, u32, rpc_action); 175int nlmsvc_async_call(struct nlm_rqst *, u32, const struct rpc_call_ops *);
176u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *, 176u32 nlmsvc_lock(struct svc_rqst *, struct nlm_file *,
177 struct nlm_lock *, int, struct nlm_cookie *); 177 struct nlm_lock *, int, struct nlm_cookie *);
178u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *); 178u32 nlmsvc_unlock(struct nlm_file *, struct nlm_lock *);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 8b67cf837ca9..ed00b278cb93 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -110,14 +110,6 @@ static inline int mpol_equal(struct mempolicy *a, struct mempolicy *b)
110#define mpol_set_vma_default(vma) ((vma)->vm_policy = NULL) 110#define mpol_set_vma_default(vma) ((vma)->vm_policy = NULL)
111 111
112/* 112/*
113 * Hugetlb policy. i386 hugetlb so far works with node numbers
114 * instead of zone lists, so give it special interfaces for now.
115 */
116extern int mpol_first_node(struct vm_area_struct *vma, unsigned long addr);
117extern int mpol_node_valid(int nid, struct vm_area_struct *vma,
118 unsigned long addr);
119
120/*
121 * Tree of shared policies for a shared memory region. 113 * Tree of shared policies for a shared memory region.
122 * Maintain the policies in a pseudo mm that contains vmas. The vmas 114 * Maintain the policies in a pseudo mm that contains vmas. The vmas
123 * carry the policy. As a special twist the pseudo mm is indexed in pages, not 115 * carry the policy. As a special twist the pseudo mm is indexed in pages, not
@@ -156,6 +148,16 @@ extern void numa_default_policy(void);
156extern void numa_policy_init(void); 148extern void numa_policy_init(void);
157extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new); 149extern void numa_policy_rebind(const nodemask_t *old, const nodemask_t *new);
158extern struct mempolicy default_policy; 150extern struct mempolicy default_policy;
151extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
152 unsigned long addr);
153
154extern int policy_zone;
155
156static inline void check_highest_zone(int k)
157{
158 if (k > policy_zone)
159 policy_zone = k;
160}
159 161
160#else 162#else
161 163
@@ -182,17 +184,6 @@ static inline struct mempolicy *mpol_copy(struct mempolicy *old)
182 return NULL; 184 return NULL;
183} 185}
184 186
185static inline int mpol_first_node(struct vm_area_struct *vma, unsigned long a)
186{
187 return numa_node_id();
188}
189
190static inline int
191mpol_node_valid(int nid, struct vm_area_struct *vma, unsigned long a)
192{
193 return 1;
194}
195
196struct shared_policy {}; 187struct shared_policy {};
197 188
198static inline int mpol_set_shared_policy(struct shared_policy *info, 189static inline int mpol_set_shared_policy(struct shared_policy *info,
@@ -232,6 +223,15 @@ static inline void numa_policy_rebind(const nodemask_t *old,
232{ 223{
233} 224}
234 225
226static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
227 unsigned long addr)
228{
229 return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER);
230}
231
232static inline void check_highest_zone(int k)
233{
234}
235#endif /* CONFIG_NUMA */ 235#endif /* CONFIG_NUMA */
236#endif /* __KERNEL__ */ 236#endif /* __KERNEL__ */
237 237
diff --git a/include/linux/mm.h b/include/linux/mm.h
index a06a84d347fb..bc01fff3aa01 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -634,14 +634,38 @@ struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
634int shmem_lock(struct file *file, int lock, struct user_struct *user); 634int shmem_lock(struct file *file, int lock, struct user_struct *user);
635#else 635#else
636#define shmem_nopage filemap_nopage 636#define shmem_nopage filemap_nopage
637#define shmem_lock(a, b, c) ({0;}) /* always in memory, no need to lock */ 637
638#define shmem_set_policy(a, b) (0) 638static inline int shmem_lock(struct file *file, int lock,
639#define shmem_get_policy(a, b) (NULL) 639 struct user_struct *user)
640{
641 return 0;
642}
643
644static inline int shmem_set_policy(struct vm_area_struct *vma,
645 struct mempolicy *new)
646{
647 return 0;
648}
649
650static inline struct mempolicy *shmem_get_policy(struct vm_area_struct *vma,
651 unsigned long addr)
652{
653 return NULL;
654}
640#endif 655#endif
641struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); 656struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags);
657extern int shmem_mmap(struct file *file, struct vm_area_struct *vma);
642 658
643int shmem_zero_setup(struct vm_area_struct *); 659int shmem_zero_setup(struct vm_area_struct *);
644 660
661#ifndef CONFIG_MMU
662extern unsigned long shmem_get_unmapped_area(struct file *file,
663 unsigned long addr,
664 unsigned long len,
665 unsigned long pgoff,
666 unsigned long flags);
667#endif
668
645static inline int can_do_mlock(void) 669static inline int can_do_mlock(void)
646{ 670{
647 if (capable(CAP_IPC_LOCK)) 671 if (capable(CAP_IPC_LOCK))
@@ -690,14 +714,31 @@ static inline void unmap_shared_mapping_range(struct address_space *mapping,
690} 714}
691 715
692extern int vmtruncate(struct inode * inode, loff_t offset); 716extern int vmtruncate(struct inode * inode, loff_t offset);
717extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end);
693extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot); 718extern int install_page(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, struct page *page, pgprot_t prot);
694extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot); 719extern int install_file_pte(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long addr, unsigned long pgoff, pgprot_t prot);
695extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma, unsigned long address, int write_access);
696 720
697static inline int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, unsigned long address, int write_access) 721#ifdef CONFIG_MMU
722extern int __handle_mm_fault(struct mm_struct *mm,struct vm_area_struct *vma,
723 unsigned long address, int write_access);
724
725static inline int handle_mm_fault(struct mm_struct *mm,
726 struct vm_area_struct *vma, unsigned long address,
727 int write_access)
698{ 728{
699 return __handle_mm_fault(mm, vma, address, write_access) & (~VM_FAULT_WRITE); 729 return __handle_mm_fault(mm, vma, address, write_access) &
730 (~VM_FAULT_WRITE);
700} 731}
732#else
733static inline int handle_mm_fault(struct mm_struct *mm,
734 struct vm_area_struct *vma, unsigned long address,
735 int write_access)
736{
737 /* should never happen if there's no MMU */
738 BUG();
739 return VM_FAULT_SIGBUS;
740}
741#endif
701 742
702extern int make_pages_present(unsigned long addr, unsigned long end); 743extern int make_pages_present(unsigned long addr, unsigned long end);
703extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); 744extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
@@ -896,6 +937,8 @@ extern unsigned long do_brk(unsigned long, unsigned long);
896/* filemap.c */ 937/* filemap.c */
897extern unsigned long page_unuse(struct page *); 938extern unsigned long page_unuse(struct page *);
898extern void truncate_inode_pages(struct address_space *, loff_t); 939extern void truncate_inode_pages(struct address_space *, loff_t);
940extern void truncate_inode_pages_range(struct address_space *,
941 loff_t lstart, loff_t lend);
899 942
900/* generic vm_area_ops exported for stackable file systems */ 943/* generic vm_area_ops exported for stackable file systems */
901extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *); 944extern struct page *filemap_nopage(struct vm_area_struct *, unsigned long, int *);
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index 9f22090df7dd..c34f4a2c62f8 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -46,7 +46,6 @@ struct zone_padding {
46 46
47struct per_cpu_pages { 47struct per_cpu_pages {
48 int count; /* number of pages in the list */ 48 int count; /* number of pages in the list */
49 int low; /* low watermark, refill needed */
50 int high; /* high watermark, emptying needed */ 49 int high; /* high watermark, emptying needed */
51 int batch; /* chunk size for buddy add/remove */ 50 int batch; /* chunk size for buddy add/remove */
52 struct list_head list; /* the list of pages */ 51 struct list_head list; /* the list of pages */
@@ -389,6 +388,11 @@ static inline struct zone *next_zone(struct zone *zone)
389#define for_each_zone(zone) \ 388#define for_each_zone(zone) \
390 for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone)) 389 for (zone = pgdat_list->node_zones; zone; zone = next_zone(zone))
391 390
391static inline int populated_zone(struct zone *zone)
392{
393 return (!!zone->present_pages);
394}
395
392static inline int is_highmem_idx(int idx) 396static inline int is_highmem_idx(int idx)
393{ 397{
394 return (idx == ZONE_HIGHMEM); 398 return (idx == ZONE_HIGHMEM);
@@ -398,6 +402,7 @@ static inline int is_normal_idx(int idx)
398{ 402{
399 return (idx == ZONE_NORMAL); 403 return (idx == ZONE_NORMAL);
400} 404}
405
401/** 406/**
402 * is_highmem - helper function to quickly check if a struct zone is a 407 * is_highmem - helper function to quickly check if a struct zone is a
403 * highmem zone or not. This is an attempt to keep references 408 * highmem zone or not. This is an attempt to keep references
@@ -414,6 +419,16 @@ static inline int is_normal(struct zone *zone)
414 return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL; 419 return zone == zone->zone_pgdat->node_zones + ZONE_NORMAL;
415} 420}
416 421
422static inline int is_dma32(struct zone *zone)
423{
424 return zone == zone->zone_pgdat->node_zones + ZONE_DMA32;
425}
426
427static inline int is_dma(struct zone *zone)
428{
429 return zone == zone->zone_pgdat->node_zones + ZONE_DMA;
430}
431
417/* These two functions are used to setup the per zone pages min values */ 432/* These two functions are used to setup the per zone pages min values */
418struct ctl_table; 433struct ctl_table;
419struct file; 434struct file;
@@ -435,7 +450,6 @@ extern struct pglist_data contig_page_data;
435#define NODE_DATA(nid) (&contig_page_data) 450#define NODE_DATA(nid) (&contig_page_data)
436#define NODE_MEM_MAP(nid) mem_map 451#define NODE_MEM_MAP(nid) mem_map
437#define MAX_NODES_SHIFT 1 452#define MAX_NODES_SHIFT 1
438#define pfn_to_nid(pfn) (0)
439 453
440#else /* CONFIG_NEED_MULTIPLE_NODES */ 454#else /* CONFIG_NEED_MULTIPLE_NODES */
441 455
@@ -470,6 +484,10 @@ extern struct pglist_data contig_page_data;
470#define early_pfn_to_nid(nid) (0UL) 484#define early_pfn_to_nid(nid) (0UL)
471#endif 485#endif
472 486
487#ifdef CONFIG_FLATMEM
488#define pfn_to_nid(pfn) (0)
489#endif
490
473#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT) 491#define pfn_to_section_nr(pfn) ((pfn) >> PFN_SECTION_SHIFT)
474#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT) 492#define section_nr_to_pfn(sec) ((sec) << PFN_SECTION_SHIFT)
475 493
@@ -564,11 +582,6 @@ static inline int valid_section_nr(unsigned long nr)
564 return valid_section(__nr_to_section(nr)); 582 return valid_section(__nr_to_section(nr));
565} 583}
566 584
567/*
568 * Given a kernel address, find the home node of the underlying memory.
569 */
570#define kvaddr_to_nid(kaddr) pfn_to_nid(__pa(kaddr) >> PAGE_SHIFT)
571
572static inline struct mem_section *__pfn_to_section(unsigned long pfn) 585static inline struct mem_section *__pfn_to_section(unsigned long pfn)
573{ 586{
574 return __nr_to_section(pfn_to_section_nr(pfn)); 587 return __nr_to_section(pfn_to_section_nr(pfn));
@@ -598,13 +611,14 @@ static inline int pfn_valid(unsigned long pfn)
598 * this restriction. 611 * this restriction.
599 */ 612 */
600#ifdef CONFIG_NUMA 613#ifdef CONFIG_NUMA
601#define pfn_to_nid early_pfn_to_nid 614#define pfn_to_nid(pfn) \
602#endif
603
604#define pfn_to_pgdat(pfn) \
605({ \ 615({ \
606 NODE_DATA(pfn_to_nid(pfn)); \ 616 unsigned long __pfn_to_nid_pfn = (pfn); \
617 page_to_nid(pfn_to_page(__pfn_to_nid_pfn)); \
607}) 618})
619#else
620#define pfn_to_nid(pfn) (0)
621#endif
608 622
609#define early_pfn_valid(pfn) pfn_valid(pfn) 623#define early_pfn_valid(pfn) pfn_valid(pfn)
610void sparse_init(void); 624void sparse_init(void);
@@ -613,12 +627,6 @@ void sparse_init(void);
613#define sparse_index_init(_sec, _nid) do {} while (0) 627#define sparse_index_init(_sec, _nid) do {} while (0)
614#endif /* CONFIG_SPARSEMEM */ 628#endif /* CONFIG_SPARSEMEM */
615 629
616#ifdef CONFIG_NODES_SPAN_OTHER_NODES
617#define early_pfn_in_nid(pfn, nid) (early_pfn_to_nid(pfn) == (nid))
618#else
619#define early_pfn_in_nid(pfn, nid) (1)
620#endif
621
622#ifndef early_pfn_valid 630#ifndef early_pfn_valid
623#define early_pfn_valid(pfn) (1) 631#define early_pfn_valid(pfn) (1)
624#endif 632#endif
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index 368ec8e45bd0..b5c98c43779e 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -10,7 +10,7 @@
10#ifdef MODULE 10#ifdef MODULE
11#define MODULE_PARAM_PREFIX /* empty */ 11#define MODULE_PARAM_PREFIX /* empty */
12#else 12#else
13#define MODULE_PARAM_PREFIX __stringify(KBUILD_MODNAME) "." 13#define MODULE_PARAM_PREFIX KBUILD_MODNAME "."
14#endif 14#endif
15 15
16#ifdef MODULE 16#ifdef MODULE
diff --git a/include/linux/nbd.h b/include/linux/nbd.h
index 090e210e98f0..f95d51fae733 100644
--- a/include/linux/nbd.h
+++ b/include/linux/nbd.h
@@ -37,18 +37,26 @@ enum {
37/* userspace doesn't need the nbd_device structure */ 37/* userspace doesn't need the nbd_device structure */
38#ifdef __KERNEL__ 38#ifdef __KERNEL__
39 39
40#include <linux/wait.h>
41
40/* values for flags field */ 42/* values for flags field */
41#define NBD_READ_ONLY 0x0001 43#define NBD_READ_ONLY 0x0001
42#define NBD_WRITE_NOCHK 0x0002 44#define NBD_WRITE_NOCHK 0x0002
43 45
46struct request;
47
44struct nbd_device { 48struct nbd_device {
45 int flags; 49 int flags;
46 int harderror; /* Code of hard error */ 50 int harderror; /* Code of hard error */
47 struct socket * sock; 51 struct socket * sock;
48 struct file * file; /* If == NULL, device is not ready, yet */ 52 struct file * file; /* If == NULL, device is not ready, yet */
49 int magic; 53 int magic;
54
50 spinlock_t queue_lock; 55 spinlock_t queue_lock;
51 struct list_head queue_head;/* Requests are added here... */ 56 struct list_head queue_head;/* Requests are added here... */
57 struct request *active_req;
58 wait_queue_head_t active_wq;
59
52 struct semaphore tx_lock; 60 struct semaphore tx_lock;
53 struct gendisk *disk; 61 struct gendisk *disk;
54 int blksize; 62 int blksize;
diff --git a/include/linux/net.h b/include/linux/net.h
index d6a41e6577f6..28195a2d8ff0 100644
--- a/include/linux/net.h
+++ b/include/linux/net.h
@@ -107,7 +107,7 @@ enum sock_type {
107struct socket { 107struct socket {
108 socket_state state; 108 socket_state state;
109 unsigned long flags; 109 unsigned long flags;
110 struct proto_ops *ops; 110 const struct proto_ops *ops;
111 struct fasync_struct *fasync_list; 111 struct fasync_struct *fasync_list;
112 struct file *file; 112 struct file *file;
113 struct sock *sk; 113 struct sock *sk;
@@ -260,7 +260,7 @@ SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct ms
260SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \ 260SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \
261 (file, sock, vma)) \ 261 (file, sock, vma)) \
262 \ 262 \
263static struct proto_ops name##_ops = { \ 263static const struct proto_ops name##_ops = { \
264 .family = fam, \ 264 .family = fam, \
265 .owner = THIS_MODULE, \ 265 .owner = THIS_MODULE, \
266 .release = __lock_##name##_release, \ 266 .release = __lock_##name##_release, \
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 936f8b76114e..7fda03d338d1 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -684,6 +684,7 @@ extern int netif_rx(struct sk_buff *skb);
684extern int netif_rx_ni(struct sk_buff *skb); 684extern int netif_rx_ni(struct sk_buff *skb);
685#define HAVE_NETIF_RECEIVE_SKB 1 685#define HAVE_NETIF_RECEIVE_SKB 1
686extern int netif_receive_skb(struct sk_buff *skb); 686extern int netif_receive_skb(struct sk_buff *skb);
687extern int dev_valid_name(const char *name);
687extern int dev_ioctl(unsigned int cmd, void __user *); 688extern int dev_ioctl(unsigned int cmd, void __user *);
688extern int dev_ethtool(struct ifreq *); 689extern int dev_ethtool(struct ifreq *);
689extern unsigned dev_get_flags(const struct net_device *); 690extern unsigned dev_get_flags(const struct net_device *);
@@ -801,12 +802,16 @@ static inline u32 netif_msg_init(int debug_value, int default_msg_enable_bits)
801 return (1 << debug_value) - 1; 802 return (1 << debug_value) - 1;
802} 803}
803 804
804/* Schedule rx intr now? */ 805/* Test if receive needs to be scheduled */
806static inline int __netif_rx_schedule_prep(struct net_device *dev)
807{
808 return !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state);
809}
805 810
811/* Test if receive needs to be scheduled but only if up */
806static inline int netif_rx_schedule_prep(struct net_device *dev) 812static inline int netif_rx_schedule_prep(struct net_device *dev)
807{ 813{
808 return netif_running(dev) && 814 return netif_running(dev) && __netif_rx_schedule_prep(dev);
809 !test_and_set_bit(__LINK_STATE_RX_SCHED, &dev->state);
810} 815}
811 816
812/* Add interface to tail of rx poll list. This assumes that _prep has 817/* Add interface to tail of rx poll list. This assumes that _prep has
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h
index 116fcaced909..668ec946c8e2 100644
--- a/include/linux/netfilter/nfnetlink_conntrack.h
+++ b/include/linux/netfilter/nfnetlink_conntrack.h
@@ -64,6 +64,9 @@ enum ctattr_l4proto {
64 CTA_PROTO_ICMP_ID, 64 CTA_PROTO_ICMP_ID,
65 CTA_PROTO_ICMP_TYPE, 65 CTA_PROTO_ICMP_TYPE,
66 CTA_PROTO_ICMP_CODE, 66 CTA_PROTO_ICMP_CODE,
67 CTA_PROTO_ICMPV6_ID,
68 CTA_PROTO_ICMPV6_TYPE,
69 CTA_PROTO_ICMPV6_CODE,
67 __CTA_PROTO_MAX 70 __CTA_PROTO_MAX
68}; 71};
69#define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1) 72#define CTA_PROTO_MAX (__CTA_PROTO_MAX - 1)
@@ -128,6 +131,4 @@ enum ctattr_help {
128}; 131};
129#define CTA_HELP_MAX (__CTA_HELP_MAX - 1) 132#define CTA_HELP_MAX (__CTA_HELP_MAX - 1)
130 133
131#define CTA_HELP_MAXNAMESIZE 32
132
133#endif /* _IPCONNTRACK_NETLINK_H */ 134#endif /* _IPCONNTRACK_NETLINK_H */
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 2efc046d9e94..c163ba31aab7 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -474,7 +474,11 @@ extern unsigned int ip6t_do_table(struct sk_buff **pskb,
474extern int ip6t_ext_hdr(u8 nexthdr); 474extern int ip6t_ext_hdr(u8 nexthdr);
475/* find specified header and get offset to it */ 475/* find specified header and get offset to it */
476extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 476extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
477 u8 target); 477 int target, unsigned short *fragoff);
478
479extern int ip6_masked_addrcmp(const struct in6_addr *addr1,
480 const struct in6_addr *mask,
481 const struct in6_addr *addr2);
478 482
479#define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1)) 483#define IP6T_ALIGN(s) (((s) + (__alignof__(struct ip6t_entry)-1)) & ~(__alignof__(struct ip6t_entry)-1))
480 484
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 2516adeccecf..547d649b274e 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -38,9 +38,6 @@
38# define NFS_DEBUG 38# define NFS_DEBUG
39#endif 39#endif
40 40
41#define NFS_MAX_FILE_IO_BUFFER_SIZE 32768
42#define NFS_DEF_FILE_IO_BUFFER_SIZE 4096
43
44/* Default timeout values */ 41/* Default timeout values */
45#define NFS_MAX_UDP_TIMEOUT (60*HZ) 42#define NFS_MAX_UDP_TIMEOUT (60*HZ)
46#define NFS_MAX_TCP_TIMEOUT (600*HZ) 43#define NFS_MAX_TCP_TIMEOUT (600*HZ)
@@ -65,6 +62,7 @@
65#define FLUSH_STABLE 4 /* commit to stable storage */ 62#define FLUSH_STABLE 4 /* commit to stable storage */
66#define FLUSH_LOWPRI 8 /* low priority background flush */ 63#define FLUSH_LOWPRI 8 /* low priority background flush */
67#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */ 64#define FLUSH_HIGHPRI 16 /* high priority memory reclaim flush */
65#define FLUSH_NOCOMMIT 32 /* Don't send the NFSv3/v4 COMMIT */
68 66
69#ifdef __KERNEL__ 67#ifdef __KERNEL__
70 68
@@ -394,6 +392,17 @@ extern int nfs_instantiate(struct dentry *dentry, struct nfs_fh *fh, struct nfs_
394extern struct inode_operations nfs_symlink_inode_operations; 392extern struct inode_operations nfs_symlink_inode_operations;
395 393
396/* 394/*
395 * linux/fs/nfs/sysctl.c
396 */
397#ifdef CONFIG_SYSCTL
398extern int nfs_register_sysctl(void);
399extern void nfs_unregister_sysctl(void);
400#else
401#define nfs_register_sysctl() do { } while(0)
402#define nfs_unregister_sysctl() do { } while(0)
403#endif
404
405/*
397 * linux/fs/nfs/unlink.c 406 * linux/fs/nfs/unlink.c
398 */ 407 */
399extern int nfs_async_unlink(struct dentry *); 408extern int nfs_async_unlink(struct dentry *);
@@ -406,10 +415,12 @@ extern int nfs_writepage(struct page *page, struct writeback_control *wbc);
406extern int nfs_writepages(struct address_space *, struct writeback_control *); 415extern int nfs_writepages(struct address_space *, struct writeback_control *);
407extern int nfs_flush_incompatible(struct file *file, struct page *page); 416extern int nfs_flush_incompatible(struct file *file, struct page *page);
408extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int); 417extern int nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
409extern void nfs_writeback_done(struct rpc_task *task); 418extern void nfs_writeback_done(struct rpc_task *task, void *data);
419extern void nfs_writedata_release(void *data);
410 420
411#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4) 421#if defined(CONFIG_NFS_V3) || defined(CONFIG_NFS_V4)
412extern void nfs_commit_done(struct rpc_task *); 422extern void nfs_commit_done(struct rpc_task *, void *data);
423extern void nfs_commit_release(void *data);
413#endif 424#endif
414 425
415/* 426/*
@@ -460,18 +471,33 @@ static inline int nfs_wb_page(struct inode *inode, struct page* page)
460 */ 471 */
461extern mempool_t *nfs_wdata_mempool; 472extern mempool_t *nfs_wdata_mempool;
462 473
463static inline struct nfs_write_data *nfs_writedata_alloc(void) 474static inline struct nfs_write_data *nfs_writedata_alloc(unsigned int pagecount)
464{ 475{
465 struct nfs_write_data *p = mempool_alloc(nfs_wdata_mempool, SLAB_NOFS); 476 struct nfs_write_data *p = mempool_alloc(nfs_wdata_mempool, SLAB_NOFS);
477
466 if (p) { 478 if (p) {
467 memset(p, 0, sizeof(*p)); 479 memset(p, 0, sizeof(*p));
468 INIT_LIST_HEAD(&p->pages); 480 INIT_LIST_HEAD(&p->pages);
481 if (pagecount < NFS_PAGEVEC_SIZE)
482 p->pagevec = &p->page_array[0];
483 else {
484 size_t size = ++pagecount * sizeof(struct page *);
485 p->pagevec = kmalloc(size, GFP_NOFS);
486 if (p->pagevec) {
487 memset(p->pagevec, 0, size);
488 } else {
489 mempool_free(p, nfs_wdata_mempool);
490 p = NULL;
491 }
492 }
469 } 493 }
470 return p; 494 return p;
471} 495}
472 496
473static inline void nfs_writedata_free(struct nfs_write_data *p) 497static inline void nfs_writedata_free(struct nfs_write_data *p)
474{ 498{
499 if (p && (p->pagevec != &p->page_array[0]))
500 kfree(p->pagevec);
475 mempool_free(p, nfs_wdata_mempool); 501 mempool_free(p, nfs_wdata_mempool);
476} 502}
477 503
@@ -481,28 +507,45 @@ static inline void nfs_writedata_free(struct nfs_write_data *p)
481extern int nfs_readpage(struct file *, struct page *); 507extern int nfs_readpage(struct file *, struct page *);
482extern int nfs_readpages(struct file *, struct address_space *, 508extern int nfs_readpages(struct file *, struct address_space *,
483 struct list_head *, unsigned); 509 struct list_head *, unsigned);
484extern void nfs_readpage_result(struct rpc_task *); 510extern void nfs_readpage_result(struct rpc_task *, void *);
511extern void nfs_readdata_release(void *data);
512
485 513
486/* 514/*
487 * Allocate and free nfs_read_data structures 515 * Allocate and free nfs_read_data structures
488 */ 516 */
489extern mempool_t *nfs_rdata_mempool; 517extern mempool_t *nfs_rdata_mempool;
490 518
491static inline struct nfs_read_data *nfs_readdata_alloc(void) 519static inline struct nfs_read_data *nfs_readdata_alloc(unsigned int pagecount)
492{ 520{
493 struct nfs_read_data *p = mempool_alloc(nfs_rdata_mempool, SLAB_NOFS); 521 struct nfs_read_data *p = mempool_alloc(nfs_rdata_mempool, SLAB_NOFS);
494 if (p) 522
523 if (p) {
495 memset(p, 0, sizeof(*p)); 524 memset(p, 0, sizeof(*p));
525 INIT_LIST_HEAD(&p->pages);
526 if (pagecount < NFS_PAGEVEC_SIZE)
527 p->pagevec = &p->page_array[0];
528 else {
529 size_t size = ++pagecount * sizeof(struct page *);
530 p->pagevec = kmalloc(size, GFP_NOFS);
531 if (p->pagevec) {
532 memset(p->pagevec, 0, size);
533 } else {
534 mempool_free(p, nfs_rdata_mempool);
535 p = NULL;
536 }
537 }
538 }
496 return p; 539 return p;
497} 540}
498 541
499static inline void nfs_readdata_free(struct nfs_read_data *p) 542static inline void nfs_readdata_free(struct nfs_read_data *p)
500{ 543{
544 if (p && (p->pagevec != &p->page_array[0]))
545 kfree(p->pagevec);
501 mempool_free(p, nfs_rdata_mempool); 546 mempool_free(p, nfs_rdata_mempool);
502} 547}
503 548
504extern void nfs_readdata_release(struct rpc_task *task);
505
506/* 549/*
507 * linux/fs/nfs3proc.c 550 * linux/fs/nfs3proc.c
508 */ 551 */
diff --git a/include/linux/nfs_idmap.h b/include/linux/nfs_idmap.h
index a0f1f25e0ead..102e56094296 100644
--- a/include/linux/nfs_idmap.h
+++ b/include/linux/nfs_idmap.h
@@ -71,6 +71,8 @@ int nfs_map_name_to_uid(struct nfs4_client *, const char *, size_t, __u32 *);
71int nfs_map_group_to_gid(struct nfs4_client *, const char *, size_t, __u32 *); 71int nfs_map_group_to_gid(struct nfs4_client *, const char *, size_t, __u32 *);
72int nfs_map_uid_to_name(struct nfs4_client *, __u32, char *); 72int nfs_map_uid_to_name(struct nfs4_client *, __u32, char *);
73int nfs_map_gid_to_group(struct nfs4_client *, __u32, char *); 73int nfs_map_gid_to_group(struct nfs4_client *, __u32, char *);
74
75extern unsigned int nfs_idmap_cache_timeout;
74#endif /* __KERNEL__ */ 76#endif /* __KERNEL__ */
75 77
76#endif /* NFS_IDMAP_H */ 78#endif /* NFS_IDMAP_H */
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index da2e077b65e2..66e2ed658527 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -79,9 +79,7 @@ extern void nfs_clear_page_writeback(struct nfs_page *req);
79static inline int 79static inline int
80nfs_lock_request_dontget(struct nfs_page *req) 80nfs_lock_request_dontget(struct nfs_page *req)
81{ 81{
82 if (test_and_set_bit(PG_BUSY, &req->wb_flags)) 82 return !test_and_set_bit(PG_BUSY, &req->wb_flags);
83 return 0;
84 return 1;
85} 83}
86 84
87/* 85/*
@@ -125,9 +123,7 @@ nfs_list_remove_request(struct nfs_page *req)
125static inline int 123static inline int
126nfs_defer_commit(struct nfs_page *req) 124nfs_defer_commit(struct nfs_page *req)
127{ 125{
128 if (test_and_set_bit(PG_NEED_COMMIT, &req->wb_flags)) 126 return !test_and_set_bit(PG_NEED_COMMIT, &req->wb_flags);
129 return 0;
130 return 1;
131} 127}
132 128
133static inline void 129static inline void
@@ -141,9 +137,7 @@ nfs_clear_commit(struct nfs_page *req)
141static inline int 137static inline int
142nfs_defer_reschedule(struct nfs_page *req) 138nfs_defer_reschedule(struct nfs_page *req)
143{ 139{
144 if (test_and_set_bit(PG_NEED_RESCHED, &req->wb_flags)) 140 return !test_and_set_bit(PG_NEED_RESCHED, &req->wb_flags);
145 return 0;
146 return 1;
147} 141}
148 142
149static inline void 143static inline void
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 40718669b9c8..6d6f69ec5675 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -4,6 +4,16 @@
4#include <linux/sunrpc/xprt.h> 4#include <linux/sunrpc/xprt.h>
5#include <linux/nfsacl.h> 5#include <linux/nfsacl.h>
6 6
7/*
8 * To change the maximum rsize and wsize supported by the NFS client, adjust
9 * NFS_MAX_FILE_IO_SIZE. 64KB is a typical maximum, but some servers can
10 * support a megabyte or more. The default is left at 4096 bytes, which is
11 * reasonable for NFS over UDP.
12 */
13#define NFS_MAX_FILE_IO_SIZE (1048576U)
14#define NFS_DEF_FILE_IO_SIZE (4096U)
15#define NFS_MIN_FILE_IO_SIZE (1024U)
16
7struct nfs4_fsid { 17struct nfs4_fsid {
8 __u64 major; 18 __u64 major;
9 __u64 minor; 19 __u64 minor;
@@ -137,7 +147,7 @@ struct nfs_openres {
137 */ 147 */
138struct nfs_open_confirmargs { 148struct nfs_open_confirmargs {
139 const struct nfs_fh * fh; 149 const struct nfs_fh * fh;
140 nfs4_stateid stateid; 150 nfs4_stateid * stateid;
141 struct nfs_seqid * seqid; 151 struct nfs_seqid * seqid;
142}; 152};
143 153
@@ -165,66 +175,62 @@ struct nfs_closeres {
165 * * Arguments to the lock,lockt, and locku call. 175 * * Arguments to the lock,lockt, and locku call.
166 * */ 176 * */
167struct nfs_lowner { 177struct nfs_lowner {
168 __u64 clientid; 178 __u64 clientid;
169 u32 id; 179 u32 id;
170}; 180};
171 181
172struct nfs_lock_opargs { 182struct nfs_lock_args {
183 struct nfs_fh * fh;
184 struct file_lock * fl;
173 struct nfs_seqid * lock_seqid; 185 struct nfs_seqid * lock_seqid;
174 nfs4_stateid * lock_stateid; 186 nfs4_stateid * lock_stateid;
175 struct nfs_seqid * open_seqid; 187 struct nfs_seqid * open_seqid;
176 nfs4_stateid * open_stateid; 188 nfs4_stateid * open_stateid;
177 struct nfs_lowner lock_owner; 189 struct nfs_lowner lock_owner;
178 __u32 reclaim; 190 unsigned char block : 1;
179 __u32 new_lock_owner; 191 unsigned char reclaim : 1;
192 unsigned char new_lock_owner : 1;
180}; 193};
181 194
182struct nfs_locku_opargs { 195struct nfs_lock_res {
196 nfs4_stateid stateid;
197};
198
199struct nfs_locku_args {
200 struct nfs_fh * fh;
201 struct file_lock * fl;
183 struct nfs_seqid * seqid; 202 struct nfs_seqid * seqid;
184 nfs4_stateid * stateid; 203 nfs4_stateid * stateid;
185}; 204};
186 205
187struct nfs_lockargs { 206struct nfs_locku_res {
188 struct nfs_fh * fh; 207 nfs4_stateid stateid;
189 __u32 type;
190 __u64 offset;
191 __u64 length;
192 union {
193 struct nfs_lock_opargs *lock; /* LOCK */
194 struct nfs_lowner *lockt; /* LOCKT */
195 struct nfs_locku_opargs *locku; /* LOCKU */
196 } u;
197}; 208};
198 209
199struct nfs_lock_denied { 210struct nfs_lockt_args {
200 __u64 offset; 211 struct nfs_fh * fh;
201 __u64 length; 212 struct file_lock * fl;
202 __u32 type; 213 struct nfs_lowner lock_owner;
203 struct nfs_lowner owner;
204}; 214};
205 215
206struct nfs_lockres { 216struct nfs_lockt_res {
207 union { 217 struct file_lock * denied; /* LOCK, LOCKT failed */
208 nfs4_stateid stateid;/* LOCK success, LOCKU */
209 struct nfs_lock_denied denied; /* LOCK failed, LOCKT success */
210 } u;
211 const struct nfs_server * server;
212}; 218};
213 219
214struct nfs4_delegreturnargs { 220struct nfs4_delegreturnargs {
215 const struct nfs_fh *fhandle; 221 const struct nfs_fh *fhandle;
216 const nfs4_stateid *stateid; 222 const nfs4_stateid *stateid;
223 const u32 * bitmask;
224};
225
226struct nfs4_delegreturnres {
227 struct nfs_fattr * fattr;
228 const struct nfs_server *server;
217}; 229};
218 230
219/* 231/*
220 * Arguments to the read call. 232 * Arguments to the read call.
221 */ 233 */
222
223#define NFS_READ_MAXIOV (9U)
224#if (NFS_READ_MAXIOV > (MAX_IOVEC -2))
225#error "NFS_READ_MAXIOV is too large"
226#endif
227
228struct nfs_readargs { 234struct nfs_readargs {
229 struct nfs_fh * fh; 235 struct nfs_fh * fh;
230 struct nfs_open_context *context; 236 struct nfs_open_context *context;
@@ -243,11 +249,6 @@ struct nfs_readres {
243/* 249/*
244 * Arguments to the write call. 250 * Arguments to the write call.
245 */ 251 */
246#define NFS_WRITE_MAXIOV (9U)
247#if (NFS_WRITE_MAXIOV > (MAX_IOVEC -2))
248#error "NFS_WRITE_MAXIOV is too large"
249#endif
250
251struct nfs_writeargs { 252struct nfs_writeargs {
252 struct nfs_fh * fh; 253 struct nfs_fh * fh;
253 struct nfs_open_context *context; 254 struct nfs_open_context *context;
@@ -678,6 +679,8 @@ struct nfs4_server_caps_res {
678 679
679struct nfs_page; 680struct nfs_page;
680 681
682#define NFS_PAGEVEC_SIZE (8U)
683
681struct nfs_read_data { 684struct nfs_read_data {
682 int flags; 685 int flags;
683 struct rpc_task task; 686 struct rpc_task task;
@@ -686,13 +689,14 @@ struct nfs_read_data {
686 struct nfs_fattr fattr; /* fattr storage */ 689 struct nfs_fattr fattr; /* fattr storage */
687 struct list_head pages; /* Coalesced read requests */ 690 struct list_head pages; /* Coalesced read requests */
688 struct nfs_page *req; /* multi ops per nfs_page */ 691 struct nfs_page *req; /* multi ops per nfs_page */
689 struct page *pagevec[NFS_READ_MAXIOV]; 692 struct page **pagevec;
690 struct nfs_readargs args; 693 struct nfs_readargs args;
691 struct nfs_readres res; 694 struct nfs_readres res;
692#ifdef CONFIG_NFS_V4 695#ifdef CONFIG_NFS_V4
693 unsigned long timestamp; /* For lease renewal */ 696 unsigned long timestamp; /* For lease renewal */
694#endif 697#endif
695 void (*complete) (struct nfs_read_data *, int); 698 void (*complete) (struct nfs_read_data *, int);
699 struct page *page_array[NFS_PAGEVEC_SIZE + 1];
696}; 700};
697 701
698struct nfs_write_data { 702struct nfs_write_data {
@@ -704,13 +708,14 @@ struct nfs_write_data {
704 struct nfs_writeverf verf; 708 struct nfs_writeverf verf;
705 struct list_head pages; /* Coalesced requests we wish to flush */ 709 struct list_head pages; /* Coalesced requests we wish to flush */
706 struct nfs_page *req; /* multi ops per nfs_page */ 710 struct nfs_page *req; /* multi ops per nfs_page */
707 struct page *pagevec[NFS_WRITE_MAXIOV]; 711 struct page **pagevec;
708 struct nfs_writeargs args; /* argument struct */ 712 struct nfs_writeargs args; /* argument struct */
709 struct nfs_writeres res; /* result struct */ 713 struct nfs_writeres res; /* result struct */
710#ifdef CONFIG_NFS_V4 714#ifdef CONFIG_NFS_V4
711 unsigned long timestamp; /* For lease renewal */ 715 unsigned long timestamp; /* For lease renewal */
712#endif 716#endif
713 void (*complete) (struct nfs_write_data *, int); 717 void (*complete) (struct nfs_write_data *, int);
718 struct page *page_array[NFS_PAGEVEC_SIZE + 1];
714}; 719};
715 720
716struct nfs_access_entry; 721struct nfs_access_entry;
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h
index 130d4f588a37..3f4f7142bbe3 100644
--- a/include/linux/nfsd/xdr.h
+++ b/include/linux/nfsd/xdr.h
@@ -88,10 +88,12 @@ struct nfsd_readdirargs {
88 88
89struct nfsd_attrstat { 89struct nfsd_attrstat {
90 struct svc_fh fh; 90 struct svc_fh fh;
91 struct kstat stat;
91}; 92};
92 93
93struct nfsd_diropres { 94struct nfsd_diropres {
94 struct svc_fh fh; 95 struct svc_fh fh;
96 struct kstat stat;
95}; 97};
96 98
97struct nfsd_readlinkres { 99struct nfsd_readlinkres {
@@ -101,6 +103,7 @@ struct nfsd_readlinkres {
101struct nfsd_readres { 103struct nfsd_readres {
102 struct svc_fh fh; 104 struct svc_fh fh;
103 unsigned long count; 105 unsigned long count;
106 struct kstat stat;
104}; 107};
105 108
106struct nfsd_readdirres { 109struct nfsd_readdirres {
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h
index 3c2a71b43bac..a4322741f8b9 100644
--- a/include/linux/nfsd/xdr3.h
+++ b/include/linux/nfsd/xdr3.h
@@ -126,6 +126,7 @@ struct nfsd3_setaclargs {
126struct nfsd3_attrstat { 126struct nfsd3_attrstat {
127 __u32 status; 127 __u32 status;
128 struct svc_fh fh; 128 struct svc_fh fh;
129 struct kstat stat;
129}; 130};
130 131
131/* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */ 132/* LOOKUP, CREATE, MKDIR, SYMLINK, MKNOD */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 343083fec258..d52999c43336 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -79,13 +79,23 @@
79/* 79/*
80 * Global page accounting. One instance per CPU. Only unsigned longs are 80 * Global page accounting. One instance per CPU. Only unsigned longs are
81 * allowed. 81 * allowed.
82 *
83 * - Fields can be modified with xxx_page_state and xxx_page_state_zone at
84 * any time safely (which protects the instance from modification by
85 * interrupt.
86 * - The __xxx_page_state variants can be used safely when interrupts are
87 * disabled.
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.
90 * In this case, the field should be commented here.
82 */ 91 */
83struct page_state { 92struct page_state {
84 unsigned long nr_dirty; /* Dirty writeable pages */ 93 unsigned long nr_dirty; /* Dirty writeable pages */
85 unsigned long nr_writeback; /* Pages under writeback */ 94 unsigned long nr_writeback; /* Pages under writeback */
86 unsigned long nr_unstable; /* NFS unstable pages */ 95 unsigned long nr_unstable; /* NFS unstable pages */
87 unsigned long nr_page_table_pages;/* Pages used for pagetables */ 96 unsigned long nr_page_table_pages;/* Pages used for pagetables */
88 unsigned long nr_mapped; /* mapped into pagetables */ 97 unsigned long nr_mapped; /* mapped into pagetables.
98 * only modified from process context */
89 unsigned long nr_slab; /* In slab */ 99 unsigned long nr_slab; /* In slab */
90#define GET_PAGE_STATE_LAST nr_slab 100#define GET_PAGE_STATE_LAST nr_slab
91 101
@@ -97,32 +107,40 @@ struct page_state {
97 unsigned long pgpgout; /* Disk writes */ 107 unsigned long pgpgout; /* Disk writes */
98 unsigned long pswpin; /* swap reads */ 108 unsigned long pswpin; /* swap reads */
99 unsigned long pswpout; /* swap writes */ 109 unsigned long pswpout; /* swap writes */
100 unsigned long pgalloc_high; /* page allocations */
101 110
111 unsigned long pgalloc_high; /* page allocations */
102 unsigned long pgalloc_normal; 112 unsigned long pgalloc_normal;
113 unsigned long pgalloc_dma32;
103 unsigned long pgalloc_dma; 114 unsigned long pgalloc_dma;
115
104 unsigned long pgfree; /* page freeings */ 116 unsigned long pgfree; /* page freeings */
105 unsigned long pgactivate; /* pages moved inactive->active */ 117 unsigned long pgactivate; /* pages moved inactive->active */
106 unsigned long pgdeactivate; /* pages moved active->inactive */ 118 unsigned long pgdeactivate; /* pages moved active->inactive */
107 119
108 unsigned long pgfault; /* faults (major+minor) */ 120 unsigned long pgfault; /* faults (major+minor) */
109 unsigned long pgmajfault; /* faults (major only) */ 121 unsigned long pgmajfault; /* faults (major only) */
122
110 unsigned long pgrefill_high; /* inspected in refill_inactive_zone */ 123 unsigned long pgrefill_high; /* inspected in refill_inactive_zone */
111 unsigned long pgrefill_normal; 124 unsigned long pgrefill_normal;
125 unsigned long pgrefill_dma32;
112 unsigned long pgrefill_dma; 126 unsigned long pgrefill_dma;
113 127
114 unsigned long pgsteal_high; /* total highmem pages reclaimed */ 128 unsigned long pgsteal_high; /* total highmem pages reclaimed */
115 unsigned long pgsteal_normal; 129 unsigned long pgsteal_normal;
130 unsigned long pgsteal_dma32;
116 unsigned long pgsteal_dma; 131 unsigned long pgsteal_dma;
132
117 unsigned long pgscan_kswapd_high;/* total highmem pages scanned */ 133 unsigned long pgscan_kswapd_high;/* total highmem pages scanned */
118 unsigned long pgscan_kswapd_normal; 134 unsigned long pgscan_kswapd_normal;
119 135 unsigned long pgscan_kswapd_dma32;
120 unsigned long pgscan_kswapd_dma; 136 unsigned long pgscan_kswapd_dma;
137
121 unsigned long pgscan_direct_high;/* total highmem pages scanned */ 138 unsigned long pgscan_direct_high;/* total highmem pages scanned */
122 unsigned long pgscan_direct_normal; 139 unsigned long pgscan_direct_normal;
140 unsigned long pgscan_direct_dma32;
123 unsigned long pgscan_direct_dma; 141 unsigned long pgscan_direct_dma;
124 unsigned long pginodesteal; /* pages reclaimed via inode freeing */
125 142
143 unsigned long pginodesteal; /* pages reclaimed via inode freeing */
126 unsigned long slabs_scanned; /* slab objects scanned */ 144 unsigned long slabs_scanned; /* slab objects scanned */
127 unsigned long kswapd_steal; /* pages reclaimed by kswapd */ 145 unsigned long kswapd_steal; /* pages reclaimed by kswapd */
128 unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */ 146 unsigned long kswapd_inodesteal;/* reclaimed via kswapd inode freeing */
@@ -136,31 +154,54 @@ struct page_state {
136extern void get_page_state(struct page_state *ret); 154extern void get_page_state(struct page_state *ret);
137extern void get_page_state_node(struct page_state *ret, int node); 155extern void get_page_state_node(struct page_state *ret, int node);
138extern void get_full_page_state(struct page_state *ret); 156extern void get_full_page_state(struct page_state *ret);
139extern unsigned long __read_page_state(unsigned long offset); 157extern unsigned long read_page_state_offset(unsigned long offset);
140extern void __mod_page_state(unsigned long offset, unsigned long delta); 158extern void mod_page_state_offset(unsigned long offset, unsigned long delta);
159extern void __mod_page_state_offset(unsigned long offset, unsigned long delta);
141 160
142#define read_page_state(member) \ 161#define read_page_state(member) \
143 __read_page_state(offsetof(struct page_state, member)) 162 read_page_state_offset(offsetof(struct page_state, member))
144 163
145#define mod_page_state(member, delta) \ 164#define mod_page_state(member, delta) \
146 __mod_page_state(offsetof(struct page_state, member), (delta)) 165 mod_page_state_offset(offsetof(struct page_state, member), (delta))
147 166
148#define inc_page_state(member) mod_page_state(member, 1UL) 167#define __mod_page_state(member, delta) \
149#define dec_page_state(member) mod_page_state(member, 0UL - 1) 168 __mod_page_state_offset(offsetof(struct page_state, member), (delta))
150#define add_page_state(member,delta) mod_page_state(member, (delta)) 169
151#define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta)) 170#define inc_page_state(member) mod_page_state(member, 1UL)
152 171#define dec_page_state(member) mod_page_state(member, 0UL - 1)
153#define mod_page_state_zone(zone, member, delta) \ 172#define add_page_state(member,delta) mod_page_state(member, (delta))
154 do { \ 173#define sub_page_state(member,delta) mod_page_state(member, 0UL - (delta))
155 unsigned offset; \ 174
156 if (is_highmem(zone)) \ 175#define __inc_page_state(member) __mod_page_state(member, 1UL)
157 offset = offsetof(struct page_state, member##_high); \ 176#define __dec_page_state(member) __mod_page_state(member, 0UL - 1)
158 else if (is_normal(zone)) \ 177#define __add_page_state(member,delta) __mod_page_state(member, (delta))
159 offset = offsetof(struct page_state, member##_normal); \ 178#define __sub_page_state(member,delta) __mod_page_state(member, 0UL - (delta))
160 else \ 179
161 offset = offsetof(struct page_state, member##_dma); \ 180#define page_state(member) (*__page_state(offsetof(struct page_state, member)))
162 __mod_page_state(offset, (delta)); \ 181
163 } while (0) 182#define state_zone_offset(zone, member) \
183({ \
184 unsigned offset; \
185 if (is_highmem(zone)) \
186 offset = offsetof(struct page_state, member##_high); \
187 else if (is_normal(zone)) \
188 offset = offsetof(struct page_state, member##_normal); \
189 else if (is_dma32(zone)) \
190 offset = offsetof(struct page_state, member##_dma32); \
191 else \
192 offset = offsetof(struct page_state, member##_dma); \
193 offset; \
194})
195
196#define __mod_page_state_zone(zone, member, delta) \
197 do { \
198 __mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
199 } while (0)
200
201#define mod_page_state_zone(zone, member, delta) \
202 do { \
203 mod_page_state_offset(state_zone_offset(zone, member), (delta)); \
204 } while (0)
164 205
165/* 206/*
166 * Manipulation of page state flags 207 * Manipulation of page state flags
diff --git a/include/linux/parport.h b/include/linux/parport.h
index d2a4d9e1e6d1..f7ff0b0c4031 100644
--- a/include/linux/parport.h
+++ b/include/linux/parport.h
@@ -242,7 +242,6 @@ enum ieee1284_phase {
242 IEEE1284_PH_FWD_IDLE, 242 IEEE1284_PH_FWD_IDLE,
243 IEEE1284_PH_TERMINATE, 243 IEEE1284_PH_TERMINATE,
244 IEEE1284_PH_NEGOTIATION, 244 IEEE1284_PH_NEGOTIATION,
245 IEEE1284_PH_HBUSY_DNA,
246 IEEE1284_PH_REV_IDLE, 245 IEEE1284_PH_REV_IDLE,
247 IEEE1284_PH_HBUSY_DAVAIL, 246 IEEE1284_PH_HBUSY_DAVAIL,
248 IEEE1284_PH_REV_DATA, 247 IEEE1284_PH_REV_DATA,
diff --git a/include/linux/parport_pc.h b/include/linux/parport_pc.h
index c6f762470879..1cc0f6b1a49a 100644
--- a/include/linux/parport_pc.h
+++ b/include/linux/parport_pc.h
@@ -79,13 +79,13 @@ static __inline__ unsigned char parport_pc_read_data(struct parport *p)
79} 79}
80 80
81#ifdef DEBUG_PARPORT 81#ifdef DEBUG_PARPORT
82extern __inline__ void dump_parport_state (char *str, struct parport *p) 82static inline void dump_parport_state (char *str, struct parport *p)
83{ 83{
84 /* here's hoping that reading these ports won't side-effect anything underneath */ 84 /* here's hoping that reading these ports won't side-effect anything underneath */
85 unsigned char ecr = inb (ECONTROL (p)); 85 unsigned char ecr = inb (ECONTROL (p));
86 unsigned char dcr = inb (CONTROL (p)); 86 unsigned char dcr = inb (CONTROL (p));
87 unsigned char dsr = inb (STATUS (p)); 87 unsigned char dsr = inb (STATUS (p));
88 static char *ecr_modes[] = {"SPP", "PS2", "PPFIFO", "ECP", "xXx", "yYy", "TST", "CFG"}; 88 static const char *const ecr_modes[] = {"SPP", "PS2", "PPFIFO", "ECP", "xXx", "yYy", "TST", "CFG"};
89 const struct parport_pc_private *priv = p->physport->private_data; 89 const struct parport_pc_private *priv = p->physport->private_data;
90 int i; 90 int i;
91 91
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 4db67b3b05cc..a213e999de31 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -15,6 +15,7 @@
15#define PCI_CLASS_STORAGE_FLOPPY 0x0102 15#define PCI_CLASS_STORAGE_FLOPPY 0x0102
16#define PCI_CLASS_STORAGE_IPI 0x0103 16#define PCI_CLASS_STORAGE_IPI 0x0103
17#define PCI_CLASS_STORAGE_RAID 0x0104 17#define PCI_CLASS_STORAGE_RAID 0x0104
18#define PCI_CLASS_STORAGE_SAS 0x0107
18#define PCI_CLASS_STORAGE_OTHER 0x0180 19#define PCI_CLASS_STORAGE_OTHER 0x0180
19 20
20#define PCI_BASE_CLASS_NETWORK 0x02 21#define PCI_BASE_CLASS_NETWORK 0x02
@@ -376,6 +377,10 @@
376#define PCI_DEVICE_ID_NS_87560_USB 0x0012 377#define PCI_DEVICE_ID_NS_87560_USB 0x0012
377#define PCI_DEVICE_ID_NS_83815 0x0020 378#define PCI_DEVICE_ID_NS_83815 0x0020
378#define PCI_DEVICE_ID_NS_83820 0x0022 379#define PCI_DEVICE_ID_NS_83820 0x0022
380#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
381#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
382#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
383#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030
379#define PCI_DEVICE_ID_NS_SATURN 0x0035 384#define PCI_DEVICE_ID_NS_SATURN 0x0035
380#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500 385#define PCI_DEVICE_ID_NS_SCx200_BRIDGE 0x0500
381#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501 386#define PCI_DEVICE_ID_NS_SCx200_SMI 0x0501
@@ -389,6 +394,13 @@
389#define PCI_DEVICE_ID_NS_87410 0xd001 394#define PCI_DEVICE_ID_NS_87410 0xd001
390#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d 395#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
391 396
397#define PCI_DEVICE_ID_NS_CS5535_HOST_BRIDGE 0x0028
398#define PCI_DEVICE_ID_NS_CS5535_ISA_BRIDGE 0x002b
399#define PCI_DEVICE_ID_NS_CS5535_IDE 0x002d
400#define PCI_DEVICE_ID_NS_CS5535_AUDIO 0x002e
401#define PCI_DEVICE_ID_NS_CS5535_USB 0x002f
402#define PCI_DEVICE_ID_NS_CS5535_VIDEO 0x0030
403
392#define PCI_VENDOR_ID_TSENG 0x100c 404#define PCI_VENDOR_ID_TSENG 0x100c
393#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202 405#define PCI_DEVICE_ID_TSENG_W32P_2 0x3202
394#define PCI_DEVICE_ID_TSENG_W32P_b 0x3205 406#define PCI_DEVICE_ID_TSENG_W32P_b 0x3205
@@ -491,6 +503,9 @@
491 503
492#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A 504#define PCI_DEVICE_ID_AMD_CS5536_IDE 0x209A
493 505
506#define PCI_DEVICE_ID_AMD_LX_VIDEO 0x2081
507#define PCI_DEVICE_ID_AMD_LX_AES 0x2082
508
494#define PCI_VENDOR_ID_TRIDENT 0x1023 509#define PCI_VENDOR_ID_TRIDENT 0x1023
495#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000 510#define PCI_DEVICE_ID_TRIDENT_4DWAVE_DX 0x2000
496#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001 511#define PCI_DEVICE_ID_TRIDENT_4DWAVE_NX 0x2001
@@ -971,6 +986,7 @@
971#define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a 986#define PCI_DEVICE_ID_NVIDIA_TNT_UNKNOWN 0x002a
972#define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C 987#define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C
973#define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D 988#define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D
989#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034
974#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035 990#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035
975#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036 991#define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036
976#define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037 992#define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h
index 724066778aff..6351c4055ace 100644
--- a/include/linux/pfkeyv2.h
+++ b/include/linux/pfkeyv2.h
@@ -216,6 +216,16 @@ struct sadb_x_nat_t_port {
216} __attribute__((packed)); 216} __attribute__((packed));
217/* sizeof(struct sadb_x_nat_t_port) == 8 */ 217/* sizeof(struct sadb_x_nat_t_port) == 8 */
218 218
219/* Generic LSM security context */
220struct sadb_x_sec_ctx {
221 uint16_t sadb_x_sec_len;
222 uint16_t sadb_x_sec_exttype;
223 uint8_t sadb_x_ctx_alg; /* LSMs: e.g., selinux == 1 */
224 uint8_t sadb_x_ctx_doi;
225 uint16_t sadb_x_ctx_len;
226} __attribute__((packed));
227/* sizeof(struct sadb_sec_ctx) = 8 */
228
219/* Message types */ 229/* Message types */
220#define SADB_RESERVED 0 230#define SADB_RESERVED 0
221#define SADB_GETSPI 1 231#define SADB_GETSPI 1
@@ -325,7 +335,8 @@ struct sadb_x_nat_t_port {
325#define SADB_X_EXT_NAT_T_SPORT 21 335#define SADB_X_EXT_NAT_T_SPORT 21
326#define SADB_X_EXT_NAT_T_DPORT 22 336#define SADB_X_EXT_NAT_T_DPORT 22
327#define SADB_X_EXT_NAT_T_OA 23 337#define SADB_X_EXT_NAT_T_OA 23
328#define SADB_EXT_MAX 23 338#define SADB_X_EXT_SEC_CTX 24
339#define SADB_EXT_MAX 24
329 340
330/* Identity Extension values */ 341/* Identity Extension values */
331#define SADB_IDENTTYPE_RESERVED 0 342#define SADB_IDENTTYPE_RESERVED 0
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index e87b233615b3..d10f35338507 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -429,6 +429,7 @@ enum
429 TCA_NETEM_CORR, 429 TCA_NETEM_CORR,
430 TCA_NETEM_DELAY_DIST, 430 TCA_NETEM_DELAY_DIST,
431 TCA_NETEM_REORDER, 431 TCA_NETEM_REORDER,
432 TCA_NETEM_CORRUPT,
432 __TCA_NETEM_MAX, 433 __TCA_NETEM_MAX,
433}; 434};
434 435
@@ -457,6 +458,12 @@ struct tc_netem_reorder
457 __u32 correlation; 458 __u32 correlation;
458}; 459};
459 460
461struct tc_netem_corrupt
462{
463 __u32 probability;
464 __u32 correlation;
465};
466
460#define NETEM_DIST_SCALE 8192 467#define NETEM_DIST_SCALE 8192
461 468
462#endif 469#endif
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 17e336f40b47..782090c68932 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -41,6 +41,7 @@ extern struct platform_device *platform_device_alloc(const char *name, unsigned
41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 41extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num);
42extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size); 42extern int platform_device_add_data(struct platform_device *pdev, void *data, size_t size);
43extern int platform_device_add(struct platform_device *pdev); 43extern int platform_device_add(struct platform_device *pdev);
44extern void platform_device_del(struct platform_device *pdev);
44extern void platform_device_put(struct platform_device *pdev); 45extern void platform_device_put(struct platform_device *pdev);
45 46
46struct platform_driver { 47struct platform_driver {
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 584d57cb393a..93b0959eb40f 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -162,6 +162,7 @@ struct pnp_card_link {
162 struct pnp_card * card; 162 struct pnp_card * card;
163 struct pnp_card_driver * driver; 163 struct pnp_card_driver * driver;
164 void * driver_data; 164 void * driver_data;
165 pm_message_t pm_state;
165}; 166};
166 167
167static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard) 168static inline void *pnp_get_card_drvdata (struct pnp_card_link *pcard)
@@ -294,6 +295,8 @@ struct pnp_driver {
294 unsigned int flags; 295 unsigned int flags;
295 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id); 296 int (*probe) (struct pnp_dev *dev, const struct pnp_device_id *dev_id);
296 void (*remove) (struct pnp_dev *dev); 297 void (*remove) (struct pnp_dev *dev);
298 int (*suspend) (struct pnp_dev *dev, pm_message_t state);
299 int (*resume) (struct pnp_dev *dev);
297 struct device_driver driver; 300 struct device_driver driver;
298}; 301};
299 302
@@ -306,6 +309,8 @@ struct pnp_card_driver {
306 unsigned int flags; 309 unsigned int flags;
307 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id); 310 int (*probe) (struct pnp_card_link *card, const struct pnp_card_device_id *card_id);
308 void (*remove) (struct pnp_card_link *card); 311 void (*remove) (struct pnp_card_link *card);
312 int (*suspend) (struct pnp_card_link *card, pm_message_t state);
313 int (*resume) (struct pnp_card_link *card);
309 struct pnp_driver link; 314 struct pnp_driver link;
310}; 315};
311 316
@@ -380,6 +385,8 @@ void pnp_init_resource_table(struct pnp_resource_table *table);
380int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode); 385int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode);
381int pnp_auto_config_dev(struct pnp_dev *dev); 386int pnp_auto_config_dev(struct pnp_dev *dev);
382int pnp_validate_config(struct pnp_dev *dev); 387int pnp_validate_config(struct pnp_dev *dev);
388int pnp_start_dev(struct pnp_dev *dev);
389int pnp_stop_dev(struct pnp_dev *dev);
383int pnp_activate_dev(struct pnp_dev *dev); 390int pnp_activate_dev(struct pnp_dev *dev);
384int pnp_disable_dev(struct pnp_dev *dev); 391int pnp_disable_dev(struct pnp_dev *dev);
385void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size); 392void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size);
@@ -423,6 +430,8 @@ static inline void pnp_init_resource_table(struct pnp_resource_table *table) { }
423static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; } 430static inline int pnp_manual_config_dev(struct pnp_dev *dev, struct pnp_resource_table *res, int mode) { return -ENODEV; }
424static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; } 431static inline int pnp_auto_config_dev(struct pnp_dev *dev) { return -ENODEV; }
425static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; } 432static inline int pnp_validate_config(struct pnp_dev *dev) { return -ENODEV; }
433static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; }
434static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; }
426static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } 435static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; }
427static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } 436static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; }
428static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { } 437static inline void pnp_resource_change(struct resource *resource, unsigned long start, unsigned long size) { }
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h
index 13e7c4b62367..b6e0bcad84e1 100644
--- a/include/linux/raid/md.h
+++ b/include/linux/raid/md.h
@@ -71,8 +71,8 @@
71 */ 71 */
72#define MD_PATCHLEVEL_VERSION 3 72#define MD_PATCHLEVEL_VERSION 3
73 73
74extern int register_md_personality (int p_num, mdk_personality_t *p); 74extern int register_md_personality (struct mdk_personality *p);
75extern int unregister_md_personality (int p_num); 75extern int unregister_md_personality (struct mdk_personality *p);
76extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev), 76extern mdk_thread_t * md_register_thread (void (*run) (mddev_t *mddev),
77 mddev_t *mddev, const char *name); 77 mddev_t *mddev, const char *name);
78extern void md_unregister_thread (mdk_thread_t *thread); 78extern void md_unregister_thread (mdk_thread_t *thread);
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index 46629a275ba9..617b9506c760 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -18,62 +18,19 @@
18/* and dm-bio-list.h is not under include/linux because.... ??? */ 18/* and dm-bio-list.h is not under include/linux because.... ??? */
19#include "../../../drivers/md/dm-bio-list.h" 19#include "../../../drivers/md/dm-bio-list.h"
20 20
21#define MD_RESERVED 0UL
22#define LINEAR 1UL
23#define RAID0 2UL
24#define RAID1 3UL
25#define RAID5 4UL
26#define TRANSLUCENT 5UL
27#define HSM 6UL
28#define MULTIPATH 7UL
29#define RAID6 8UL
30#define RAID10 9UL
31#define FAULTY 10UL
32#define MAX_PERSONALITY 11UL
33
34#define LEVEL_MULTIPATH (-4) 21#define LEVEL_MULTIPATH (-4)
35#define LEVEL_LINEAR (-1) 22#define LEVEL_LINEAR (-1)
36#define LEVEL_FAULTY (-5) 23#define LEVEL_FAULTY (-5)
37 24
25/* we need a value for 'no level specified' and 0
26 * means 'raid0', so we need something else. This is
27 * for internal use only
28 */
29#define LEVEL_NONE (-1000000)
30
38#define MaxSector (~(sector_t)0) 31#define MaxSector (~(sector_t)0)
39#define MD_THREAD_NAME_MAX 14 32#define MD_THREAD_NAME_MAX 14
40 33
41static inline int pers_to_level (int pers)
42{
43 switch (pers) {
44 case FAULTY: return LEVEL_FAULTY;
45 case MULTIPATH: return LEVEL_MULTIPATH;
46 case HSM: return -3;
47 case TRANSLUCENT: return -2;
48 case LINEAR: return LEVEL_LINEAR;
49 case RAID0: return 0;
50 case RAID1: return 1;
51 case RAID5: return 5;
52 case RAID6: return 6;
53 case RAID10: return 10;
54 }
55 BUG();
56 return MD_RESERVED;
57}
58
59static inline int level_to_pers (int level)
60{
61 switch (level) {
62 case LEVEL_FAULTY: return FAULTY;
63 case LEVEL_MULTIPATH: return MULTIPATH;
64 case -3: return HSM;
65 case -2: return TRANSLUCENT;
66 case LEVEL_LINEAR: return LINEAR;
67 case 0: return RAID0;
68 case 1: return RAID1;
69 case 4:
70 case 5: return RAID5;
71 case 6: return RAID6;
72 case 10: return RAID10;
73 }
74 return MD_RESERVED;
75}
76
77typedef struct mddev_s mddev_t; 34typedef struct mddev_s mddev_t;
78typedef struct mdk_rdev_s mdk_rdev_t; 35typedef struct mdk_rdev_s mdk_rdev_t;
79 36
@@ -138,14 +95,16 @@ struct mdk_rdev_s
138 atomic_t read_errors; /* number of consecutive read errors that 95 atomic_t read_errors; /* number of consecutive read errors that
139 * we have tried to ignore. 96 * we have tried to ignore.
140 */ 97 */
98 atomic_t corrected_errors; /* number of corrected read errors,
99 * for reporting to userspace and storing
100 * in superblock.
101 */
141}; 102};
142 103
143typedef struct mdk_personality_s mdk_personality_t;
144
145struct mddev_s 104struct mddev_s
146{ 105{
147 void *private; 106 void *private;
148 mdk_personality_t *pers; 107 struct mdk_personality *pers;
149 dev_t unit; 108 dev_t unit;
150 int md_minor; 109 int md_minor;
151 struct list_head disks; 110 struct list_head disks;
@@ -164,6 +123,7 @@ struct mddev_s
164 int chunk_size; 123 int chunk_size;
165 time_t ctime, utime; 124 time_t ctime, utime;
166 int level, layout; 125 int level, layout;
126 char clevel[16];
167 int raid_disks; 127 int raid_disks;
168 int max_disks; 128 int max_disks;
169 sector_t size; /* used size of component devices */ 129 sector_t size; /* used size of component devices */
@@ -183,6 +143,11 @@ struct mddev_s
183 sector_t resync_mismatches; /* count of sectors where 143 sector_t resync_mismatches; /* count of sectors where
184 * parity/replica mismatch found 144 * parity/replica mismatch found
185 */ 145 */
146 /* if zero, use the system-wide default */
147 int sync_speed_min;
148 int sync_speed_max;
149
150 int ok_start_degraded;
186 /* recovery/resync flags 151 /* recovery/resync flags
187 * NEEDED: we might need to start a resync/recover 152 * NEEDED: we might need to start a resync/recover
188 * RUNNING: a thread is running, or about to be started 153 * RUNNING: a thread is running, or about to be started
@@ -265,9 +230,11 @@ static inline void md_sync_acct(struct block_device *bdev, unsigned long nr_sect
265 atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io); 230 atomic_add(nr_sectors, &bdev->bd_contains->bd_disk->sync_io);
266} 231}
267 232
268struct mdk_personality_s 233struct mdk_personality
269{ 234{
270 char *name; 235 char *name;
236 int level;
237 struct list_head list;
271 struct module *owner; 238 struct module *owner;
272 int (*make_request)(request_queue_t *q, struct bio *bio); 239 int (*make_request)(request_queue_t *q, struct bio *bio);
273 int (*run)(mddev_t *mddev); 240 int (*run)(mddev_t *mddev);
@@ -305,8 +272,6 @@ static inline char * mdname (mddev_t * mddev)
305 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX"; 272 return mddev->gendisk ? mddev->gendisk->disk_name : "mdX";
306} 273}
307 274
308extern mdk_rdev_t * find_rdev_nr(mddev_t *mddev, int nr);
309
310/* 275/*
311 * iterates through some rdev ringlist. It's safe to remove the 276 * iterates through some rdev ringlist. It's safe to remove the
312 * current 'rdev'. Dont touch 'tmp' though. 277 * current 'rdev'. Dont touch 'tmp' though.
@@ -366,5 +331,10 @@ do { \
366 __wait_event_lock_irq(wq, condition, lock, cmd); \ 331 __wait_event_lock_irq(wq, condition, lock, cmd); \
367} while (0) 332} while (0)
368 333
334static inline void safe_put_page(struct page *p)
335{
336 if (p) put_page(p);
337}
338
369#endif 339#endif
370 340
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h
index 292b98f2b408..9d5494aaac0f 100644
--- a/include/linux/raid/raid1.h
+++ b/include/linux/raid/raid1.h
@@ -45,6 +45,8 @@ struct r1_private_data_s {
45 45
46 spinlock_t resync_lock; 46 spinlock_t resync_lock;
47 int nr_pending; 47 int nr_pending;
48 int nr_waiting;
49 int nr_queued;
48 int barrier; 50 int barrier;
49 sector_t next_resync; 51 sector_t next_resync;
50 int fullsync; /* set to 1 if a full sync is needed, 52 int fullsync; /* set to 1 if a full sync is needed,
@@ -52,11 +54,12 @@ struct r1_private_data_s {
52 * Cleared when a sync completes. 54 * Cleared when a sync completes.
53 */ 55 */
54 56
55 wait_queue_head_t wait_idle; 57 wait_queue_head_t wait_barrier;
56 wait_queue_head_t wait_resume;
57 58
58 struct pool_info *poolinfo; 59 struct pool_info *poolinfo;
59 60
61 struct page *tmppage;
62
60 mempool_t *r1bio_pool; 63 mempool_t *r1bio_pool;
61 mempool_t *r1buf_pool; 64 mempool_t *r1buf_pool;
62}; 65};
@@ -106,6 +109,13 @@ struct r1bio_s {
106 /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/ 109 /* DO NOT PUT ANY NEW FIELDS HERE - bios array is contiguously alloced*/
107}; 110};
108 111
112/* when we get a read error on a read-only array, we redirect to another
113 * device without failing the first device, or trying to over-write to
114 * correct the read error. To keep track of bad blocks on a per-bio
115 * level, we store IO_BLOCKED in the appropriate 'bios' pointer
116 */
117#define IO_BLOCKED ((struct bio*)1)
118
109/* bits for r1bio.state */ 119/* bits for r1bio.state */
110#define R1BIO_Uptodate 0 120#define R1BIO_Uptodate 0
111#define R1BIO_IsSync 1 121#define R1BIO_IsSync 1
diff --git a/include/linux/raid/raid10.h b/include/linux/raid/raid10.h
index 60708789c8f9..b1103298a8c2 100644
--- a/include/linux/raid/raid10.h
+++ b/include/linux/raid/raid10.h
@@ -35,18 +35,26 @@ struct r10_private_data_s {
35 sector_t chunk_mask; 35 sector_t chunk_mask;
36 36
37 struct list_head retry_list; 37 struct list_head retry_list;
38 /* for use when syncing mirrors: */ 38 /* queue pending writes and submit them on unplug */
39 struct bio_list pending_bio_list;
40
39 41
40 spinlock_t resync_lock; 42 spinlock_t resync_lock;
41 int nr_pending; 43 int nr_pending;
44 int nr_waiting;
45 int nr_queued;
42 int barrier; 46 int barrier;
43 sector_t next_resync; 47 sector_t next_resync;
48 int fullsync; /* set to 1 if a full sync is needed,
49 * (fresh device added).
50 * Cleared when a sync completes.
51 */
44 52
45 wait_queue_head_t wait_idle; 53 wait_queue_head_t wait_barrier;
46 wait_queue_head_t wait_resume;
47 54
48 mempool_t *r10bio_pool; 55 mempool_t *r10bio_pool;
49 mempool_t *r10buf_pool; 56 mempool_t *r10buf_pool;
57 struct page *tmppage;
50}; 58};
51 59
52typedef struct r10_private_data_s conf_t; 60typedef struct r10_private_data_s conf_t;
@@ -96,8 +104,16 @@ struct r10bio_s {
96 } devs[0]; 104 } devs[0];
97}; 105};
98 106
107/* when we get a read error on a read-only array, we redirect to another
108 * device without failing the first device, or trying to over-write to
109 * correct the read error. To keep track of bad blocks on a per-bio
110 * level, we store IO_BLOCKED in the appropriate 'bios' pointer
111 */
112#define IO_BLOCKED ((struct bio*)1)
113
99/* bits for r10bio.state */ 114/* bits for r10bio.state */
100#define R10BIO_Uptodate 0 115#define R10BIO_Uptodate 0
101#define R10BIO_IsSync 1 116#define R10BIO_IsSync 1
102#define R10BIO_IsRecover 2 117#define R10BIO_IsRecover 2
118#define R10BIO_Degraded 3
103#endif 119#endif
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index f025ba6fb14c..394da8207b34 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -126,7 +126,7 @@
126 */ 126 */
127 127
128struct stripe_head { 128struct stripe_head {
129 struct stripe_head *hash_next, **hash_pprev; /* hash pointers */ 129 struct hlist_node hash;
130 struct list_head lru; /* inactive_list or handle_list */ 130 struct list_head lru; /* inactive_list or handle_list */
131 struct raid5_private_data *raid_conf; 131 struct raid5_private_data *raid_conf;
132 sector_t sector; /* sector of this row */ 132 sector_t sector; /* sector of this row */
@@ -152,7 +152,6 @@ struct stripe_head {
152#define R5_Insync 3 /* rdev && rdev->in_sync at start */ 152#define R5_Insync 3 /* rdev && rdev->in_sync at start */
153#define R5_Wantread 4 /* want to schedule a read */ 153#define R5_Wantread 4 /* want to schedule a read */
154#define R5_Wantwrite 5 154#define R5_Wantwrite 5
155#define R5_Syncio 6 /* this io need to be accounted as resync io */
156#define R5_Overlap 7 /* There is a pending overlapping request on this block */ 155#define R5_Overlap 7 /* There is a pending overlapping request on this block */
157#define R5_ReadError 8 /* seen a read error here recently */ 156#define R5_ReadError 8 /* seen a read error here recently */
158#define R5_ReWrite 9 /* have tried to over-write the readerror */ 157#define R5_ReWrite 9 /* have tried to over-write the readerror */
@@ -205,7 +204,7 @@ struct disk_info {
205}; 204};
206 205
207struct raid5_private_data { 206struct raid5_private_data {
208 struct stripe_head **stripe_hashtbl; 207 struct hlist_head *stripe_hashtbl;
209 mddev_t *mddev; 208 mddev_t *mddev;
210 struct disk_info *spare; 209 struct disk_info *spare;
211 int chunk_size, level, algorithm; 210 int chunk_size, level, algorithm;
@@ -228,6 +227,8 @@ struct raid5_private_data {
228 * Cleared when a sync completes. 227 * Cleared when a sync completes.
229 */ 228 */
230 229
230 struct page *spare_page; /* Used when checking P/Q in raid6 */
231
231 /* 232 /*
232 * Free stripes pool 233 * Free stripes pool
233 */ 234 */
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index e0a4faa9610c..953b6df5d037 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -5,6 +5,16 @@ struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev);
5struct super_block *ramfs_get_sb(struct file_system_type *fs_type, 5struct super_block *ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data); 6 int flags, const char *dev_name, void *data);
7 7
8#ifndef CONFIG_MMU
9extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file,
10 unsigned long addr,
11 unsigned long len,
12 unsigned long pgoff,
13 unsigned long flags);
14
15extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma);
16#endif
17
8extern struct file_operations ramfs_file_operations; 18extern struct file_operations ramfs_file_operations;
9extern struct vm_operations_struct generic_file_vm_ops; 19extern struct vm_operations_struct generic_file_vm_ops;
10 20
diff --git a/include/linux/random.h b/include/linux/random.h
index 7b2adb3322d5..5d6456bcdeba 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -52,9 +52,9 @@ extern void get_random_bytes(void *buf, int nbytes);
52void generate_random_uuid(unsigned char uuid_out[16]); 52void generate_random_uuid(unsigned char uuid_out[16]);
53 53
54extern __u32 secure_ip_id(__u32 daddr); 54extern __u32 secure_ip_id(__u32 daddr);
55extern u32 secure_tcp_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport); 55extern u32 secure_ipv4_port_ephemeral(__u32 saddr, __u32 daddr, __u16 dport);
56extern u32 secure_tcpv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr, 56extern u32 secure_ipv6_port_ephemeral(const __u32 *saddr, const __u32 *daddr,
57 __u16 dport); 57 __u16 dport);
58extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr, 58extern __u32 secure_tcp_sequence_number(__u32 saddr, __u32 daddr,
59 __u16 sport, __u16 dport); 59 __u16 sport, __u16 dport);
60extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr, 60extern __u32 secure_tcpv6_sequence_number(__u32 *saddr, __u32 *daddr,
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index 33261f1d2239..9d6fbeef2104 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -71,6 +71,7 @@ void __anon_vma_link(struct vm_area_struct *);
71 * rmap interfaces called when adding or removing pte of page 71 * rmap interfaces called when adding or removing pte of page
72 */ 72 */
73void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long); 73void page_add_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
74void page_add_new_anon_rmap(struct page *, struct vm_area_struct *, unsigned long);
74void page_add_file_rmap(struct page *); 75void page_add_file_rmap(struct page *);
75void page_remove_rmap(struct page *); 76void page_remove_rmap(struct page *);
76 77
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b0ad6f30679e..7da33619d5d0 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -254,25 +254,12 @@ extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long);
254 * The mm counters are not protected by its page_table_lock, 254 * The mm counters are not protected by its page_table_lock,
255 * so must be incremented atomically. 255 * so must be incremented atomically.
256 */ 256 */
257#ifdef ATOMIC64_INIT 257#define set_mm_counter(mm, member, value) atomic_long_set(&(mm)->_##member, value)
258#define set_mm_counter(mm, member, value) atomic64_set(&(mm)->_##member, value) 258#define get_mm_counter(mm, member) ((unsigned long)atomic_long_read(&(mm)->_##member))
259#define get_mm_counter(mm, member) ((unsigned long)atomic64_read(&(mm)->_##member)) 259#define add_mm_counter(mm, member, value) atomic_long_add(value, &(mm)->_##member)
260#define add_mm_counter(mm, member, value) atomic64_add(value, &(mm)->_##member) 260#define inc_mm_counter(mm, member) atomic_long_inc(&(mm)->_##member)
261#define inc_mm_counter(mm, member) atomic64_inc(&(mm)->_##member) 261#define dec_mm_counter(mm, member) atomic_long_dec(&(mm)->_##member)
262#define dec_mm_counter(mm, member) atomic64_dec(&(mm)->_##member) 262typedef atomic_long_t mm_counter_t;
263typedef atomic64_t mm_counter_t;
264#else /* !ATOMIC64_INIT */
265/*
266 * The counters wrap back to 0 at 2^32 * PAGE_SIZE,
267 * that is, at 16TB if using 4kB page size.
268 */
269#define set_mm_counter(mm, member, value) atomic_set(&(mm)->_##member, value)
270#define get_mm_counter(mm, member) ((unsigned long)atomic_read(&(mm)->_##member))
271#define add_mm_counter(mm, member, value) atomic_add(value, &(mm)->_##member)
272#define inc_mm_counter(mm, member) atomic_inc(&(mm)->_##member)
273#define dec_mm_counter(mm, member) atomic_dec(&(mm)->_##member)
274typedef atomic_t mm_counter_t;
275#endif /* !ATOMIC64_INIT */
276 263
277#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */ 264#else /* NR_CPUS < CONFIG_SPLIT_PTLOCK_CPUS */
278/* 265/*
diff --git a/include/linux/security.h b/include/linux/security.h
index f7e0ae018712..ef753654daa5 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -59,6 +59,12 @@ struct sk_buff;
59struct sock; 59struct sock;
60struct sockaddr; 60struct sockaddr;
61struct socket; 61struct socket;
62struct flowi;
63struct dst_entry;
64struct xfrm_selector;
65struct xfrm_policy;
66struct xfrm_state;
67struct xfrm_user_sec_ctx;
62 68
63extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 69extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
64extern int cap_netlink_recv(struct sk_buff *skb); 70extern int cap_netlink_recv(struct sk_buff *skb);
@@ -788,6 +794,52 @@ struct swap_info_struct;
788 * which is used to copy security attributes between local stream sockets. 794 * which is used to copy security attributes between local stream sockets.
789 * @sk_free_security: 795 * @sk_free_security:
790 * Deallocate security structure. 796 * Deallocate security structure.
797 * @sk_getsid:
798 * Retrieve the LSM-specific sid for the sock to enable caching of network
799 * authorizations.
800 *
801 * Security hooks for XFRM operations.
802 *
803 * @xfrm_policy_alloc_security:
804 * @xp contains the xfrm_policy being added to Security Policy Database
805 * used by the XFRM system.
806 * @sec_ctx contains the security context information being provided by
807 * the user-level policy update program (e.g., setkey).
808 * Allocate a security structure to the xp->selector.security field.
809 * The security field is initialized to NULL when the xfrm_policy is
810 * allocated.
811 * Return 0 if operation was successful (memory to allocate, legal context)
812 * @xfrm_policy_clone_security:
813 * @old contains an existing xfrm_policy in the SPD.
814 * @new contains a new xfrm_policy being cloned from old.
815 * Allocate a security structure to the new->selector.security field
816 * that contains the information from the old->selector.security field.
817 * Return 0 if operation was successful (memory to allocate).
818 * @xfrm_policy_free_security:
819 * @xp contains the xfrm_policy
820 * Deallocate xp->selector.security.
821 * @xfrm_state_alloc_security:
822 * @x contains the xfrm_state being added to the Security Association
823 * Database by the XFRM system.
824 * @sec_ctx contains the security context information being provided by
825 * the user-level SA generation program (e.g., setkey or racoon).
826 * Allocate a security structure to the x->sel.security field. The
827 * security field is initialized to NULL when the xfrm_state is
828 * allocated.
829 * Return 0 if operation was successful (memory to allocate, legal context).
830 * @xfrm_state_free_security:
831 * @x contains the xfrm_state.
832 * Deallocate x>sel.security.
833 * @xfrm_policy_lookup:
834 * @xp contains the xfrm_policy for which the access control is being
835 * checked.
836 * @sk_sid contains the sock security label that is used to authorize
837 * access to the policy xp.
838 * @dir contains the direction of the flow (input or output).
839 * Check permission when a sock selects a xfrm_policy for processing
840 * XFRMs on a packet. The hook is called when selecting either a
841 * per-socket policy or a generic xfrm policy.
842 * Return 0 if permission is granted.
791 * 843 *
792 * Security hooks affecting all Key Management operations 844 * Security hooks affecting all Key Management operations
793 * 845 *
@@ -1237,8 +1289,18 @@ struct security_operations {
1237 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len); 1289 int (*socket_getpeersec) (struct socket *sock, char __user *optval, int __user *optlen, unsigned len);
1238 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority); 1290 int (*sk_alloc_security) (struct sock *sk, int family, gfp_t priority);
1239 void (*sk_free_security) (struct sock *sk); 1291 void (*sk_free_security) (struct sock *sk);
1292 unsigned int (*sk_getsid) (struct sock *sk, struct flowi *fl, u8 dir);
1240#endif /* CONFIG_SECURITY_NETWORK */ 1293#endif /* CONFIG_SECURITY_NETWORK */
1241 1294
1295#ifdef CONFIG_SECURITY_NETWORK_XFRM
1296 int (*xfrm_policy_alloc_security) (struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx);
1297 int (*xfrm_policy_clone_security) (struct xfrm_policy *old, struct xfrm_policy *new);
1298 void (*xfrm_policy_free_security) (struct xfrm_policy *xp);
1299 int (*xfrm_state_alloc_security) (struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx);
1300 void (*xfrm_state_free_security) (struct xfrm_state *x);
1301 int (*xfrm_policy_lookup)(struct xfrm_policy *xp, u32 sk_sid, u8 dir);
1302#endif /* CONFIG_SECURITY_NETWORK_XFRM */
1303
1242 /* key management security hooks */ 1304 /* key management security hooks */
1243#ifdef CONFIG_KEYS 1305#ifdef CONFIG_KEYS
1244 int (*key_alloc)(struct key *key); 1306 int (*key_alloc)(struct key *key);
@@ -2679,6 +2741,11 @@ static inline void security_sk_free(struct sock *sk)
2679{ 2741{
2680 return security_ops->sk_free_security(sk); 2742 return security_ops->sk_free_security(sk);
2681} 2743}
2744
2745static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir)
2746{
2747 return security_ops->sk_getsid(sk, fl, dir);
2748}
2682#else /* CONFIG_SECURITY_NETWORK */ 2749#else /* CONFIG_SECURITY_NETWORK */
2683static inline int security_unix_stream_connect(struct socket * sock, 2750static inline int security_unix_stream_connect(struct socket * sock,
2684 struct socket * other, 2751 struct socket * other,
@@ -2795,8 +2862,73 @@ static inline int security_sk_alloc(struct sock *sk, int family, gfp_t priority)
2795static inline void security_sk_free(struct sock *sk) 2862static inline void security_sk_free(struct sock *sk)
2796{ 2863{
2797} 2864}
2865
2866static inline unsigned int security_sk_sid(struct sock *sk, struct flowi *fl, u8 dir)
2867{
2868 return 0;
2869}
2798#endif /* CONFIG_SECURITY_NETWORK */ 2870#endif /* CONFIG_SECURITY_NETWORK */
2799 2871
2872#ifdef CONFIG_SECURITY_NETWORK_XFRM
2873static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
2874{
2875 return security_ops->xfrm_policy_alloc_security(xp, sec_ctx);
2876}
2877
2878static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
2879{
2880 return security_ops->xfrm_policy_clone_security(old, new);
2881}
2882
2883static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2884{
2885 security_ops->xfrm_policy_free_security(xp);
2886}
2887
2888static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2889{
2890 return security_ops->xfrm_state_alloc_security(x, sec_ctx);
2891}
2892
2893static inline void security_xfrm_state_free(struct xfrm_state *x)
2894{
2895 security_ops->xfrm_state_free_security(x);
2896}
2897
2898static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
2899{
2900 return security_ops->xfrm_policy_lookup(xp, sk_sid, dir);
2901}
2902#else /* CONFIG_SECURITY_NETWORK_XFRM */
2903static inline int security_xfrm_policy_alloc(struct xfrm_policy *xp, struct xfrm_user_sec_ctx *sec_ctx)
2904{
2905 return 0;
2906}
2907
2908static inline int security_xfrm_policy_clone(struct xfrm_policy *old, struct xfrm_policy *new)
2909{
2910 return 0;
2911}
2912
2913static inline void security_xfrm_policy_free(struct xfrm_policy *xp)
2914{
2915}
2916
2917static inline int security_xfrm_state_alloc(struct xfrm_state *x, struct xfrm_user_sec_ctx *sec_ctx)
2918{
2919 return 0;
2920}
2921
2922static inline void security_xfrm_state_free(struct xfrm_state *x)
2923{
2924}
2925
2926static inline int security_xfrm_policy_lookup(struct xfrm_policy *xp, u32 sk_sid, u8 dir)
2927{
2928 return 0;
2929}
2930#endif /* CONFIG_SECURITY_NETWORK_XFRM */
2931
2800#ifdef CONFIG_KEYS 2932#ifdef CONFIG_KEYS
2801#ifdef CONFIG_SECURITY 2933#ifdef CONFIG_SECURITY
2802static inline int security_key_alloc(struct key *key) 2934static inline int security_key_alloc(struct key *key)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 8c5d6001a923..483cfc47ec34 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -32,7 +32,6 @@
32 32
33#define HAVE_ALLOC_SKB /* For the drivers to know */ 33#define HAVE_ALLOC_SKB /* For the drivers to know */
34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */ 34#define HAVE_ALIGNABLE_SKB /* Ditto 8) */
35#define SLAB_SKB /* Slabified skbuffs */
36 35
37#define CHECKSUM_NONE 0 36#define CHECKSUM_NONE 0
38#define CHECKSUM_HW 1 37#define CHECKSUM_HW 1
@@ -134,7 +133,7 @@ struct skb_frag_struct {
134 */ 133 */
135struct skb_shared_info { 134struct skb_shared_info {
136 atomic_t dataref; 135 atomic_t dataref;
137 unsigned int nr_frags; 136 unsigned short nr_frags;
138 unsigned short tso_size; 137 unsigned short tso_size;
139 unsigned short tso_segs; 138 unsigned short tso_segs;
140 unsigned short ufo_size; 139 unsigned short ufo_size;
@@ -1239,6 +1238,8 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb,
1239 int hlen, 1238 int hlen,
1240 struct iovec *iov); 1239 struct iovec *iov);
1241extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); 1240extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb);
1241extern void skb_kill_datagram(struct sock *sk, struct sk_buff *skb,
1242 unsigned int flags);
1242extern unsigned int skb_checksum(const struct sk_buff *skb, int offset, 1243extern unsigned int skb_checksum(const struct sk_buff *skb, int offset,
1243 int len, unsigned int csum); 1244 int len, unsigned int csum);
1244extern int skb_copy_bits(const struct sk_buff *skb, int offset, 1245extern int skb_copy_bits(const struct sk_buff *skb, int offset,
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 1739c2d5b95b..9f4019156fd8 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -27,7 +27,6 @@ struct __kernel_sockaddr_storage {
27#include <linux/compiler.h> /* __user */ 27#include <linux/compiler.h> /* __user */
28 28
29extern int sysctl_somaxconn; 29extern int sysctl_somaxconn;
30extern void sock_init(void);
31#ifdef CONFIG_PROC_FS 30#ifdef CONFIG_PROC_FS
32struct seq_file; 31struct seq_file;
33extern void socket_seq_show(struct seq_file *seq); 32extern void socket_seq_show(struct seq_file *seq);
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 0e9682c9def5..799be6747944 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -59,8 +59,7 @@
59/* 59/*
60 * Must define these before including other files, inline functions need them 60 * Must define these before including other files, inline functions need them
61 */ 61 */
62#define LOCK_SECTION_NAME \ 62#define LOCK_SECTION_NAME ".text.lock."KBUILD_BASENAME
63 ".text.lock." __stringify(KBUILD_BASENAME)
64 63
65#define LOCK_SECTION_START(extra) \ 64#define LOCK_SECTION_START(extra) \
66 ".subsection 1\n\t" \ 65 ".subsection 1\n\t" \
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index ab151bbb66df..f147e6b84332 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -49,7 +49,6 @@ struct rpc_clnt {
49 49
50 unsigned int cl_softrtry : 1,/* soft timeouts */ 50 unsigned int cl_softrtry : 1,/* soft timeouts */
51 cl_intr : 1,/* interruptible */ 51 cl_intr : 1,/* interruptible */
52 cl_chatty : 1,/* be verbose */
53 cl_autobind : 1,/* use getport() */ 52 cl_autobind : 1,/* use getport() */
54 cl_oneshot : 1,/* dispose after use */ 53 cl_oneshot : 1,/* dispose after use */
55 cl_dead : 1;/* abandoned */ 54 cl_dead : 1;/* abandoned */
@@ -126,7 +125,8 @@ int rpc_register(u32, u32, int, unsigned short, int *);
126void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); 125void rpc_call_setup(struct rpc_task *, struct rpc_message *, int);
127 126
128int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg, 127int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg,
129 int flags, rpc_action callback, void *clntdata); 128 int flags, const struct rpc_call_ops *tk_ops,
129 void *calldata);
130int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, 130int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg,
131 int flags); 131 int flags);
132void rpc_restart_call(struct rpc_task *); 132void rpc_restart_call(struct rpc_task *);
@@ -134,6 +134,7 @@ void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset);
134void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); 134void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset);
135void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 135void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
136size_t rpc_max_payload(struct rpc_clnt *); 136size_t rpc_max_payload(struct rpc_clnt *);
137void rpc_force_rebind(struct rpc_clnt *);
137int rpc_ping(struct rpc_clnt *clnt, int flags); 138int rpc_ping(struct rpc_clnt *clnt, int flags);
138 139
139static __inline__ 140static __inline__
diff --git a/include/linux/sunrpc/gss_spkm3.h b/include/linux/sunrpc/gss_spkm3.h
index 0beb2cf00a84..336e218c2782 100644
--- a/include/linux/sunrpc/gss_spkm3.h
+++ b/include/linux/sunrpc/gss_spkm3.h
@@ -48,7 +48,7 @@ u32 spkm3_read_token(struct spkm3_ctx *ctx, struct xdr_netobj *read_token, struc
48#define CKSUMTYPE_RSA_MD5 0x0007 48#define CKSUMTYPE_RSA_MD5 0x0007
49 49
50s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body, 50s32 make_checksum(s32 cksumtype, char *header, int hdrlen, struct xdr_buf *body,
51 struct xdr_netobj *cksum); 51 int body_offset, struct xdr_netobj *cksum);
52void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits); 52void asn1_bitstring_len(struct xdr_netobj *in, int *enclen, int *zerobits);
53int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen, 53int decode_asn1_bitstring(struct xdr_netobj *out, char *in, int enclen,
54 int explen); 54 int explen);
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 4d77e90d0b30..8b25629accd8 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -27,6 +27,7 @@ struct rpc_message {
27 struct rpc_cred * rpc_cred; /* Credentials */ 27 struct rpc_cred * rpc_cred; /* Credentials */
28}; 28};
29 29
30struct rpc_call_ops;
30struct rpc_wait_queue; 31struct rpc_wait_queue;
31struct rpc_wait { 32struct rpc_wait {
32 struct list_head list; /* wait queue links */ 33 struct list_head list; /* wait queue links */
@@ -41,6 +42,7 @@ struct rpc_task {
41#ifdef RPC_DEBUG 42#ifdef RPC_DEBUG
42 unsigned long tk_magic; /* 0xf00baa */ 43 unsigned long tk_magic; /* 0xf00baa */
43#endif 44#endif
45 atomic_t tk_count; /* Reference count */
44 struct list_head tk_task; /* global list of tasks */ 46 struct list_head tk_task; /* global list of tasks */
45 struct rpc_clnt * tk_client; /* RPC client */ 47 struct rpc_clnt * tk_client; /* RPC client */
46 struct rpc_rqst * tk_rqstp; /* RPC request */ 48 struct rpc_rqst * tk_rqstp; /* RPC request */
@@ -50,8 +52,6 @@ struct rpc_task {
50 * RPC call state 52 * RPC call state
51 */ 53 */
52 struct rpc_message tk_msg; /* RPC call info */ 54 struct rpc_message tk_msg; /* RPC call info */
53 __u32 * tk_buffer; /* XDR buffer */
54 size_t tk_bufsize;
55 __u8 tk_garb_retry; 55 __u8 tk_garb_retry;
56 __u8 tk_cred_retry; 56 __u8 tk_cred_retry;
57 57
@@ -61,13 +61,12 @@ struct rpc_task {
61 * timeout_fn to be executed by timer bottom half 61 * timeout_fn to be executed by timer bottom half
62 * callback to be executed after waking up 62 * callback to be executed after waking up
63 * action next procedure for async tasks 63 * action next procedure for async tasks
64 * exit exit async task and report to caller 64 * tk_ops caller callbacks
65 */ 65 */
66 void (*tk_timeout_fn)(struct rpc_task *); 66 void (*tk_timeout_fn)(struct rpc_task *);
67 void (*tk_callback)(struct rpc_task *); 67 void (*tk_callback)(struct rpc_task *);
68 void (*tk_action)(struct rpc_task *); 68 void (*tk_action)(struct rpc_task *);
69 void (*tk_exit)(struct rpc_task *); 69 const struct rpc_call_ops *tk_ops;
70 void (*tk_release)(struct rpc_task *);
71 void * tk_calldata; 70 void * tk_calldata;
72 71
73 /* 72 /*
@@ -78,7 +77,6 @@ struct rpc_task {
78 struct timer_list tk_timer; /* kernel timer */ 77 struct timer_list tk_timer; /* kernel timer */
79 unsigned long tk_timeout; /* timeout for rpc_sleep() */ 78 unsigned long tk_timeout; /* timeout for rpc_sleep() */
80 unsigned short tk_flags; /* misc flags */ 79 unsigned short tk_flags; /* misc flags */
81 unsigned char tk_active : 1;/* Task has been activated */
82 unsigned char tk_priority : 2;/* Task priority */ 80 unsigned char tk_priority : 2;/* Task priority */
83 unsigned long tk_runstate; /* Task run status */ 81 unsigned long tk_runstate; /* Task run status */
84 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could 82 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could
@@ -111,6 +109,13 @@ struct rpc_task {
111 109
112typedef void (*rpc_action)(struct rpc_task *); 110typedef void (*rpc_action)(struct rpc_task *);
113 111
112struct rpc_call_ops {
113 void (*rpc_call_prepare)(struct rpc_task *, void *);
114 void (*rpc_call_done)(struct rpc_task *, void *);
115 void (*rpc_release)(void *);
116};
117
118
114/* 119/*
115 * RPC task flags 120 * RPC task flags
116 */ 121 */
@@ -129,7 +134,6 @@ typedef void (*rpc_action)(struct rpc_task *);
129#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER) 134#define RPC_IS_SWAPPER(t) ((t)->tk_flags & RPC_TASK_SWAPPER)
130#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS) 135#define RPC_DO_ROOTOVERRIDE(t) ((t)->tk_flags & RPC_TASK_ROOTCREDS)
131#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED) 136#define RPC_ASSASSINATED(t) ((t)->tk_flags & RPC_TASK_KILLED)
132#define RPC_IS_ACTIVATED(t) ((t)->tk_active)
133#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL) 137#define RPC_DO_CALLBACK(t) ((t)->tk_callback != NULL)
134#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT) 138#define RPC_IS_SOFT(t) ((t)->tk_flags & RPC_TASK_SOFT)
135#define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR) 139#define RPC_TASK_UNINTERRUPTIBLE(t) ((t)->tk_flags & RPC_TASK_NOINTR)
@@ -138,6 +142,7 @@ typedef void (*rpc_action)(struct rpc_task *);
138#define RPC_TASK_QUEUED 1 142#define RPC_TASK_QUEUED 1
139#define RPC_TASK_WAKEUP 2 143#define RPC_TASK_WAKEUP 2
140#define RPC_TASK_HAS_TIMER 3 144#define RPC_TASK_HAS_TIMER 3
145#define RPC_TASK_ACTIVE 4
141 146
142#define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) 147#define RPC_IS_RUNNING(t) (test_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
143#define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate)) 148#define rpc_set_running(t) (set_bit(RPC_TASK_RUNNING, &(t)->tk_runstate))
@@ -168,6 +173,15 @@ typedef void (*rpc_action)(struct rpc_task *);
168 smp_mb__after_clear_bit(); \ 173 smp_mb__after_clear_bit(); \
169 } while (0) 174 } while (0)
170 175
176#define RPC_IS_ACTIVATED(t) (test_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
177#define rpc_set_active(t) (set_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate))
178#define rpc_clear_active(t) \
179 do { \
180 smp_mb__before_clear_bit(); \
181 clear_bit(RPC_TASK_ACTIVE, &(t)->tk_runstate); \
182 smp_mb__after_clear_bit(); \
183 } while(0)
184
171/* 185/*
172 * Task priorities. 186 * Task priorities.
173 * Note: if you change these, you must also change 187 * Note: if you change these, you must also change
@@ -228,11 +242,16 @@ struct rpc_wait_queue {
228/* 242/*
229 * Function prototypes 243 * Function prototypes
230 */ 244 */
231struct rpc_task *rpc_new_task(struct rpc_clnt *, rpc_action, int flags); 245struct rpc_task *rpc_new_task(struct rpc_clnt *, int flags,
246 const struct rpc_call_ops *ops, void *data);
247struct rpc_task *rpc_run_task(struct rpc_clnt *clnt, int flags,
248 const struct rpc_call_ops *ops, void *data);
232struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent); 249struct rpc_task *rpc_new_child(struct rpc_clnt *, struct rpc_task *parent);
233void rpc_init_task(struct rpc_task *, struct rpc_clnt *, 250void rpc_init_task(struct rpc_task *task, struct rpc_clnt *clnt,
234 rpc_action exitfunc, int flags); 251 int flags, const struct rpc_call_ops *ops,
252 void *data);
235void rpc_release_task(struct rpc_task *); 253void rpc_release_task(struct rpc_task *);
254void rpc_exit_task(struct rpc_task *);
236void rpc_killall_tasks(struct rpc_clnt *); 255void rpc_killall_tasks(struct rpc_clnt *);
237int rpc_execute(struct rpc_task *); 256int rpc_execute(struct rpc_task *);
238void rpc_run_child(struct rpc_task *parent, struct rpc_task *child, 257void rpc_run_child(struct rpc_task *parent, struct rpc_task *child,
@@ -247,9 +266,11 @@ struct rpc_task *rpc_wake_up_next(struct rpc_wait_queue *);
247void rpc_wake_up_status(struct rpc_wait_queue *, int); 266void rpc_wake_up_status(struct rpc_wait_queue *, int);
248void rpc_delay(struct rpc_task *, unsigned long); 267void rpc_delay(struct rpc_task *, unsigned long);
249void * rpc_malloc(struct rpc_task *, size_t); 268void * rpc_malloc(struct rpc_task *, size_t);
269void rpc_free(struct rpc_task *);
250int rpciod_up(void); 270int rpciod_up(void);
251void rpciod_down(void); 271void rpciod_down(void);
252void rpciod_wake_up(void); 272void rpciod_wake_up(void);
273int __rpc_wait_for_completion_task(struct rpc_task *task, int (*)(void *));
253#ifdef RPC_DEBUG 274#ifdef RPC_DEBUG
254void rpc_show_tasks(void); 275void rpc_show_tasks(void);
255#endif 276#endif
@@ -259,7 +280,12 @@ void rpc_destroy_mempool(void);
259static inline void rpc_exit(struct rpc_task *task, int status) 280static inline void rpc_exit(struct rpc_task *task, int status)
260{ 281{
261 task->tk_status = status; 282 task->tk_status = status;
262 task->tk_action = NULL; 283 task->tk_action = rpc_exit_task;
284}
285
286static inline int rpc_wait_for_completion_task(struct rpc_task *task)
287{
288 return __rpc_wait_for_completion_task(task, NULL);
263} 289}
264 290
265#ifdef RPC_DEBUG 291#ifdef RPC_DEBUG
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index 5da968729cf8..84c35d42d250 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -91,7 +91,6 @@ struct xdr_buf {
91u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); 91u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len);
92u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); 92u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len);
93u32 * xdr_encode_string(u32 *p, const char *s); 93u32 * xdr_encode_string(u32 *p, const char *s);
94u32 * xdr_decode_string(u32 *p, char **sp, int *lenp, int maxlen);
95u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); 94u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen);
96u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); 95u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *);
97u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); 96u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *);
@@ -135,11 +134,6 @@ xdr_adjust_iovec(struct kvec *iov, u32 *p)
135} 134}
136 135
137/* 136/*
138 * Maximum number of iov's we use.
139 */
140#define MAX_IOVEC (12)
141
142/*
143 * XDR buffer helper functions 137 * XDR buffer helper functions
144 */ 138 */
145extern void xdr_shift_buf(struct xdr_buf *, size_t); 139extern void xdr_shift_buf(struct xdr_buf *, size_t);
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 3b8b6e823c70..6ef99b14ff09 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -79,21 +79,19 @@ struct rpc_rqst {
79 void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */ 79 void (*rq_release_snd_buf)(struct rpc_rqst *); /* release rq_enc_pages */
80 struct list_head rq_list; 80 struct list_head rq_list;
81 81
82 __u32 * rq_buffer; /* XDR encode buffer */
83 size_t rq_bufsize;
84
82 struct xdr_buf rq_private_buf; /* The receive buffer 85 struct xdr_buf rq_private_buf; /* The receive buffer
83 * used in the softirq. 86 * used in the softirq.
84 */ 87 */
85 unsigned long rq_majortimeo; /* major timeout alarm */ 88 unsigned long rq_majortimeo; /* major timeout alarm */
86 unsigned long rq_timeout; /* Current timeout value */ 89 unsigned long rq_timeout; /* Current timeout value */
87 unsigned int rq_retries; /* # of retries */ 90 unsigned int rq_retries; /* # of retries */
88 /*
89 * For authentication (e.g. auth_des)
90 */
91 u32 rq_creddata[2];
92 91
93 /* 92 /*
94 * Partial send handling 93 * Partial send handling
95 */ 94 */
96
97 u32 rq_bytes_sent; /* Bytes we have sent */ 95 u32 rq_bytes_sent; /* Bytes we have sent */
98 96
99 unsigned long rq_xtime; /* when transmitted */ 97 unsigned long rq_xtime; /* when transmitted */
@@ -106,7 +104,10 @@ struct rpc_xprt_ops {
106 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 104 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
107 int (*reserve_xprt)(struct rpc_task *task); 105 int (*reserve_xprt)(struct rpc_task *task);
108 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 106 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
107 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
109 void (*connect)(struct rpc_task *task); 108 void (*connect)(struct rpc_task *task);
109 void * (*buf_alloc)(struct rpc_task *task, size_t size);
110 void (*buf_free)(struct rpc_task *task);
110 int (*send_request)(struct rpc_task *task); 111 int (*send_request)(struct rpc_task *task);
111 void (*set_retrans_timeout)(struct rpc_task *task); 112 void (*set_retrans_timeout)(struct rpc_task *task);
112 void (*timer)(struct rpc_task *task); 113 void (*timer)(struct rpc_task *task);
@@ -253,6 +254,7 @@ int xs_setup_tcp(struct rpc_xprt *xprt, struct rpc_timeout *to);
253#define XPRT_LOCKED (0) 254#define XPRT_LOCKED (0)
254#define XPRT_CONNECTED (1) 255#define XPRT_CONNECTED (1)
255#define XPRT_CONNECTING (2) 256#define XPRT_CONNECTING (2)
257#define XPRT_CLOSE_WAIT (3)
256 258
257static inline void xprt_set_connected(struct rpc_xprt *xprt) 259static inline void xprt_set_connected(struct rpc_xprt *xprt)
258{ 260{
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index a61c04f804b2..5dc94e777fab 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -14,11 +14,7 @@
14typedef struct pbe { 14typedef struct pbe {
15 unsigned long address; /* address of the copy */ 15 unsigned long address; /* address of the copy */
16 unsigned long orig_address; /* original address of page */ 16 unsigned long orig_address; /* original address of page */
17 swp_entry_t swap_address; 17 struct pbe *next;
18
19 struct pbe *next; /* also used as scratch space at
20 * end of page (see link, diskpage)
21 */
22} suspend_pagedir_t; 18} suspend_pagedir_t;
23 19
24#define for_each_pbe(pbe, pblist) \ 20#define for_each_pbe(pbe, pblist) \
@@ -77,6 +73,6 @@ unsigned long get_safe_page(gfp_t gfp_mask);
77 * XXX: We try to keep some more pages free so that I/O operations succeed 73 * XXX: We try to keep some more pages free so that I/O operations succeed
78 * without paging. Might this be more? 74 * without paging. Might this be more?
79 */ 75 */
80#define PAGES_FOR_IO 512 76#define PAGES_FOR_IO 1024
81 77
82#endif /* _LINUX_SWSUSP_H */ 78#endif /* _LINUX_SWSUSP_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 508668f840b6..556617bcf7ac 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -172,7 +172,6 @@ extern void swap_setup(void);
172 172
173/* linux/mm/vmscan.c */ 173/* linux/mm/vmscan.c */
174extern int try_to_free_pages(struct zone **, gfp_t); 174extern int try_to_free_pages(struct zone **, gfp_t);
175extern int zone_reclaim(struct zone *, gfp_t, unsigned int);
176extern int shrink_all_memory(int); 175extern int shrink_all_memory(int);
177extern int vm_swappiness; 176extern int vm_swappiness;
178 177
@@ -210,6 +209,7 @@ extern unsigned int nr_swapfiles;
210extern struct swap_info_struct swap_info[]; 209extern struct swap_info_struct swap_info[];
211extern void si_swapinfo(struct sysinfo *); 210extern void si_swapinfo(struct sysinfo *);
212extern swp_entry_t get_swap_page(void); 211extern swp_entry_t get_swap_page(void);
212extern swp_entry_t get_swap_page_of_type(int type);
213extern int swap_duplicate(swp_entry_t); 213extern int swap_duplicate(swp_entry_t);
214extern int valid_swaphandles(swp_entry_t, unsigned long *); 214extern int valid_swaphandles(swp_entry_t, unsigned long *);
215extern void swap_free(swp_entry_t); 215extern void swap_free(swp_entry_t);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 4be34ef8c2f7..a9b80fc7f0f3 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -124,7 +124,7 @@ enum
124 KERN_OVERFLOWUID=46, /* int: overflow UID */ 124 KERN_OVERFLOWUID=46, /* int: overflow UID */
125 KERN_OVERFLOWGID=47, /* int: overflow GID */ 125 KERN_OVERFLOWGID=47, /* int: overflow GID */
126 KERN_SHMPATH=48, /* string: path to shm fs */ 126 KERN_SHMPATH=48, /* string: path to shm fs */
127 KERN_HOTPLUG=49, /* string: path to hotplug policy agent */ 127 KERN_HOTPLUG=49, /* string: path to uevent helper (deprecated) */
128 KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */ 128 KERN_IEEE_EMULATION_WARNINGS=50, /* int: unimplemented ieee instructions */
129 KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */ 129 KERN_S390_USER_DEBUG_LOGGING=51, /* int: dumps of user faults */
130 KERN_CORE_USES_PID=52, /* int: use core or core.%pid */ 130 KERN_CORE_USES_PID=52, /* int: use core or core.%pid */
@@ -390,6 +390,7 @@ enum
390 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, 390 NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109,
391 NET_TCP_CONG_CONTROL=110, 391 NET_TCP_CONG_CONTROL=110,
392 NET_TCP_ABC=111, 392 NET_TCP_ABC=111,
393 NET_IPV4_IPFRAG_MAX_DIST=112,
393}; 394};
394 395
395enum { 396enum {
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 0e1da6602e05..f2bb2396853f 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -55,22 +55,6 @@ struct tcphdr {
55 __u16 urg_ptr; 55 __u16 urg_ptr;
56}; 56};
57 57
58#define TCP_ACTION_FIN (1 << 7)
59
60enum {
61 TCPF_ESTABLISHED = (1 << 1),
62 TCPF_SYN_SENT = (1 << 2),
63 TCPF_SYN_RECV = (1 << 3),
64 TCPF_FIN_WAIT1 = (1 << 4),
65 TCPF_FIN_WAIT2 = (1 << 5),
66 TCPF_TIME_WAIT = (1 << 6),
67 TCPF_CLOSE = (1 << 7),
68 TCPF_CLOSE_WAIT = (1 << 8),
69 TCPF_LAST_ACK = (1 << 9),
70 TCPF_LISTEN = (1 << 10),
71 TCPF_CLOSING = (1 << 11)
72};
73
74/* 58/*
75 * The union cast uses a gcc extension to avoid aliasing problems 59 * The union cast uses a gcc extension to avoid aliasing problems
76 * (union is compatible to any of its members) 60 * (union is compatible to any of its members)
@@ -254,10 +238,9 @@ struct tcp_sock {
254 __u32 snd_wl1; /* Sequence for window update */ 238 __u32 snd_wl1; /* Sequence for window update */
255 __u32 snd_wnd; /* The window we expect to receive */ 239 __u32 snd_wnd; /* The window we expect to receive */
256 __u32 max_window; /* Maximal window ever seen from peer */ 240 __u32 max_window; /* Maximal window ever seen from peer */
257 __u32 pmtu_cookie; /* Last pmtu seen by socket */
258 __u32 mss_cache; /* Cached effective mss, not including SACKS */ 241 __u32 mss_cache; /* Cached effective mss, not including SACKS */
259 __u16 xmit_size_goal; /* Goal for segmenting output packets */ 242 __u16 xmit_size_goal; /* Goal for segmenting output packets */
260 __u16 ext_header_len; /* Network protocol overhead (IP/IPv6 options) */ 243 /* XXX Two bytes hole, try to pack */
261 244
262 __u32 window_clamp; /* Maximal window to advertise */ 245 __u32 window_clamp; /* Maximal window to advertise */
263 __u32 rcv_ssthresh; /* Current window clamp */ 246 __u32 rcv_ssthresh; /* Current window clamp */
@@ -295,8 +278,6 @@ struct tcp_sock {
295 278
296 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ 279 struct sk_buff_head out_of_order_queue; /* Out of order segments go here */
297 280
298 struct tcp_func *af_specific; /* Operations which are AF_INET{4,6} specific */
299
300 __u32 rcv_wnd; /* Current receiver window */ 281 __u32 rcv_wnd; /* Current receiver window */
301 __u32 rcv_wup; /* rcv_nxt on last window update sent */ 282 __u32 rcv_wup; /* rcv_nxt on last window update sent */
302 __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 283 __u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
diff --git a/include/linux/udf_fs.h b/include/linux/udf_fs.h
index 46e2bb945353..36c684e1b110 100644
--- a/include/linux/udf_fs.h
+++ b/include/linux/udf_fs.h
@@ -13,11 +13,6 @@
13 * http://www.osta.org/ * http://www.ecma.ch/ 13 * http://www.osta.org/ * http://www.ecma.ch/
14 * http://www.iso.org/ 14 * http://www.iso.org/
15 * 15 *
16 * CONTACTS
17 * E-mail regarding any portion of the Linux UDF file system should be
18 * directed to the development team mailing list (run by majordomo):
19 * linux_udf@hpesjro.fc.hp.com
20 *
21 * COPYRIGHT 16 * COPYRIGHT
22 * This file is distributed under the terms of the GNU General Public 17 * This file is distributed under the terms of the GNU General Public
23 * License (GPL). Copies of the GPL can be obtained from: 18 * License (GPL). Copies of the GPL can be obtained from:
diff --git a/include/linux/udf_fs_i.h b/include/linux/udf_fs_i.h
index 62b15a4214e6..1e7508420fcf 100644
--- a/include/linux/udf_fs_i.h
+++ b/include/linux/udf_fs_i.h
@@ -3,11 +3,6 @@
3 * 3 *
4 * This file is intended for the Linux kernel/module. 4 * This file is intended for the Linux kernel/module.
5 * 5 *
6 * CONTACTS
7 * E-mail regarding any portion of the Linux UDF file system should be
8 * directed to the development team mailing list (run by majordomo):
9 * linux_udf@hpesjro.fc.hp.com
10 *
11 * COPYRIGHT 6 * COPYRIGHT
12 * This file is distributed under the terms of the GNU General Public 7 * This file is distributed under the terms of the GNU General Public
13 * License (GPL). Copies of the GPL can be obtained from: 8 * License (GPL). Copies of the GPL can be obtained from:
diff --git a/include/linux/udf_fs_sb.h b/include/linux/udf_fs_sb.h
index 1966a6dbb4b6..b15ff2e99c91 100644
--- a/include/linux/udf_fs_sb.h
+++ b/include/linux/udf_fs_sb.h
@@ -3,11 +3,6 @@
3 * 3 *
4 * This include file is for the Linux kernel/module. 4 * This include file is for the Linux kernel/module.
5 * 5 *
6 * CONTACTS
7 * E-mail regarding any portion of the Linux UDF file system should be
8 * directed to the development team mailing list (run by majordomo):
9 * linux_udf@hpesjro.fc.hp.com
10 *
11 * COPYRIGHT 6 * COPYRIGHT
12 * This file is distributed under the terms of the GNU General Public 7 * This file is distributed under the terms of the GNU General Public
13 * License (GPL). Copies of the GPL can be obtained from: 8 * License (GPL). Copies of the GPL can be obtained from:
diff --git a/include/linux/udp.h b/include/linux/udp.h
index b60e0b4a25c4..85a55658831c 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -35,10 +35,10 @@ struct udphdr {
35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ 35#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
36 36
37#ifdef __KERNEL__ 37#ifdef __KERNEL__
38
39#include <linux/config.h> 38#include <linux/config.h>
40#include <net/sock.h> 39#include <linux/types.h>
41#include <linux/ip.h> 40
41#include <net/inet_sock.h>
42 42
43struct udp_sock { 43struct udp_sock {
44 /* inet_sock has to be the first member */ 44 /* inet_sock has to be the first member */
diff --git a/include/linux/usb.h b/include/linux/usb.h
index d81b050e5955..827cc6de5f5c 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -225,7 +225,7 @@ struct usb_interface_cache {
225 * Device drivers should not attempt to activate configurations. The choice 225 * Device drivers should not attempt to activate configurations. The choice
226 * of which configuration to install is a policy decision based on such 226 * of which configuration to install is a policy decision based on such
227 * considerations as available power, functionality provided, and the user's 227 * considerations as available power, functionality provided, and the user's
228 * desires (expressed through hotplug scripts). However, drivers can call 228 * desires (expressed through userspace tools). However, drivers can call
229 * usb_reset_configuration() to reinitialize the current configuration and 229 * usb_reset_configuration() to reinitialize the current configuration and
230 * all its interfaces. 230 * all its interfaces.
231 */ 231 */
@@ -329,8 +329,6 @@ struct usb_device {
329 struct usb_tt *tt; /* low/full speed dev, highspeed hub */ 329 struct usb_tt *tt; /* low/full speed dev, highspeed hub */
330 int ttport; /* device port on that tt hub */ 330 int ttport; /* device port on that tt hub */
331 331
332 struct semaphore serialize;
333
334 unsigned int toggle[2]; /* one bit for each endpoint 332 unsigned int toggle[2]; /* one bit for each endpoint
335 * ([0] = IN, [1] = OUT) */ 333 * ([0] = IN, [1] = OUT) */
336 334
@@ -349,6 +347,9 @@ struct usb_device {
349 347
350 char **rawdescriptors; /* Raw descriptors for each config */ 348 char **rawdescriptors; /* Raw descriptors for each config */
351 349
350 unsigned short bus_mA; /* Current available from the bus */
351 u8 portnum; /* Parent port number (origin 1) */
352
352 int have_langid; /* whether string_langid is valid */ 353 int have_langid; /* whether string_langid is valid */
353 int string_langid; /* language ID for strings */ 354 int string_langid; /* language ID for strings */
354 355
@@ -377,11 +378,12 @@ struct usb_device {
377extern struct usb_device *usb_get_dev(struct usb_device *dev); 378extern struct usb_device *usb_get_dev(struct usb_device *dev);
378extern void usb_put_dev(struct usb_device *dev); 379extern void usb_put_dev(struct usb_device *dev);
379 380
380extern void usb_lock_device(struct usb_device *udev); 381/* USB device locking */
381extern int usb_trylock_device(struct usb_device *udev); 382#define usb_lock_device(udev) down(&(udev)->dev.sem)
383#define usb_unlock_device(udev) up(&(udev)->dev.sem)
384#define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem)
382extern int usb_lock_device_for_reset(struct usb_device *udev, 385extern int usb_lock_device_for_reset(struct usb_device *udev,
383 struct usb_interface *iface); 386 struct usb_interface *iface);
384extern void usb_unlock_device(struct usb_device *udev);
385 387
386/* USB port reset for device reinitialization */ 388/* USB port reset for device reinitialization */
387extern int usb_reset_device(struct usb_device *dev); 389extern int usb_reset_device(struct usb_device *dev);
@@ -529,10 +531,13 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
529 531
530/* ----------------------------------------------------------------------- */ 532/* ----------------------------------------------------------------------- */
531 533
534struct usb_dynids {
535 spinlock_t lock;
536 struct list_head list;
537};
538
532/** 539/**
533 * struct usb_driver - identifies USB driver to usbcore 540 * struct usb_driver - identifies USB driver to usbcore
534 * @owner: Pointer to the module owner of this driver; initialize
535 * it using THIS_MODULE.
536 * @name: The driver name should be unique among USB drivers, 541 * @name: The driver name should be unique among USB drivers,
537 * and should normally be the same as the module name. 542 * and should normally be the same as the module name.
538 * @probe: Called to see if the driver is willing to manage a particular 543 * @probe: Called to see if the driver is willing to manage a particular
@@ -553,7 +558,11 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
553 * @id_table: USB drivers use ID table to support hotplugging. 558 * @id_table: USB drivers use ID table to support hotplugging.
554 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 559 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
555 * or your driver's probe function will never get called. 560 * or your driver's probe function will never get called.
561 * @dynids: used internally to hold the list of dynamically added device
562 * ids for this driver.
556 * @driver: the driver model core driver structure. 563 * @driver: the driver model core driver structure.
564 * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be
565 * added to this driver by preventing the sysfs file from being created.
557 * 566 *
558 * USB drivers must provide a name, probe() and disconnect() methods, 567 * USB drivers must provide a name, probe() and disconnect() methods,
559 * and an id_table. Other driver fields are optional. 568 * and an id_table. Other driver fields are optional.
@@ -571,8 +580,6 @@ static inline int usb_make_path (struct usb_device *dev, char *buf,
571 * them as necessary, and blocking until the unlinks complete). 580 * them as necessary, and blocking until the unlinks complete).
572 */ 581 */
573struct usb_driver { 582struct usb_driver {
574 struct module *owner;
575
576 const char *name; 583 const char *name;
577 584
578 int (*probe) (struct usb_interface *intf, 585 int (*probe) (struct usb_interface *intf,
@@ -588,7 +595,9 @@ struct usb_driver {
588 595
589 const struct usb_device_id *id_table; 596 const struct usb_device_id *id_table;
590 597
598 struct usb_dynids dynids;
591 struct device_driver driver; 599 struct device_driver driver;
600 unsigned int no_dynamic_id:1;
592}; 601};
593#define to_usb_driver(d) container_of(d, struct usb_driver, driver) 602#define to_usb_driver(d) container_of(d, struct usb_driver, driver)
594 603
@@ -614,7 +623,11 @@ struct usb_class_driver {
614 * use these in module_init()/module_exit() 623 * use these in module_init()/module_exit()
615 * and don't forget MODULE_DEVICE_TABLE(usb, ...) 624 * and don't forget MODULE_DEVICE_TABLE(usb, ...)
616 */ 625 */
617extern int usb_register(struct usb_driver *); 626int usb_register_driver(struct usb_driver *, struct module *);
627static inline int usb_register(struct usb_driver *driver)
628{
629 return usb_register_driver(driver, THIS_MODULE);
630}
618extern void usb_deregister(struct usb_driver *); 631extern void usb_deregister(struct usb_driver *);
619 632
620extern int usb_register_dev(struct usb_interface *intf, 633extern int usb_register_dev(struct usb_interface *intf,
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
new file mode 100644
index 000000000000..b2d08984a9f7
--- /dev/null
+++ b/include/linux/usb_usual.h
@@ -0,0 +1,126 @@
1/*
2 * Interface to the libusual.
3 *
4 * Copyright (c) 2005 Pete Zaitcev <zaitcev@redhat.com>
5 * Copyright (c) 1999-2002 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
6 * Copyright (c) 1999 Michael Gee (michael@linuxspecific.com)
7 */
8
9#ifndef __LINUX_USB_USUAL_H
10#define __LINUX_USB_USUAL_H
11
12#include <linux/config.h>
13
14/* We should do this for cleanliness... But other usb_foo.h do not do this. */
15/* #include <linux/usb.h> */
16
17/*
18 * The flags field, which we store in usb_device_id.driver_info.
19 * It is compatible with the old usb-storage flags in lower 24 bits.
20 */
21
22/*
23 * Static flag definitions. We use this roundabout technique so that the
24 * proc_info() routine can automatically display a message for each flag.
25 */
26#define US_DO_ALL_FLAGS \
27 US_FLAG(SINGLE_LUN, 0x00000001) \
28 /* allow access to only LUN 0 */ \
29 US_FLAG(NEED_OVERRIDE, 0x00000002) \
30 /* unusual_devs entry is necessary */ \
31 US_FLAG(SCM_MULT_TARG, 0x00000004) \
32 /* supports multiple targets */ \
33 US_FLAG(FIX_INQUIRY, 0x00000008) \
34 /* INQUIRY response needs faking */ \
35 US_FLAG(FIX_CAPACITY, 0x00000010) \
36 /* READ CAPACITY response too big */ \
37 US_FLAG(IGNORE_RESIDUE, 0x00000020) \
38 /* reported residue is wrong */ \
39 US_FLAG(BULK32, 0x00000040) \
40 /* Uses 32-byte CBW length */ \
41 US_FLAG(NOT_LOCKABLE, 0x00000080) \
42 /* PREVENT/ALLOW not supported */ \
43 US_FLAG(GO_SLOW, 0x00000100) \
44 /* Need delay after Command phase */ \
45 US_FLAG(NO_WP_DETECT, 0x00000200) \
46 /* Don't check for write-protect */ \
47
48#define US_FLAG(name, value) US_FL_##name = value ,
49enum { US_DO_ALL_FLAGS };
50#undef US_FLAG
51
52/*
53 * The bias field for libusual and friends.
54 */
55#define USB_US_TYPE_NONE 0
56#define USB_US_TYPE_STOR 1 /* usb-storage */
57#define USB_US_TYPE_UB 2 /* ub */
58
59#define USB_US_TYPE(flags) (((flags) >> 24) & 0xFF)
60#define USB_US_ORIG_FLAGS(flags) ((flags) & 0x00FFFFFF)
61
62/*
63 * This is probably not the best place to keep these constants, conceptually.
64 * But it's the only header included into all places which need them.
65 */
66
67/* Sub Classes */
68
69#define US_SC_RBC 0x01 /* Typically, flash devices */
70#define US_SC_8020 0x02 /* CD-ROM */
71#define US_SC_QIC 0x03 /* QIC-157 Tapes */
72#define US_SC_UFI 0x04 /* Floppy */
73#define US_SC_8070 0x05 /* Removable media */
74#define US_SC_SCSI 0x06 /* Transparent */
75#define US_SC_ISD200 0x07 /* ISD200 ATA */
76#define US_SC_MIN US_SC_RBC
77#define US_SC_MAX US_SC_ISD200
78
79#define US_SC_DEVICE 0xff /* Use device's value */
80
81/* Protocols */
82
83#define US_PR_CBI 0x00 /* Control/Bulk/Interrupt */
84#define US_PR_CB 0x01 /* Control/Bulk w/o interrupt */
85#define US_PR_BULK 0x50 /* bulk only */
86#ifdef CONFIG_USB_STORAGE_USBAT
87#define US_PR_USBAT 0x80 /* SCM-ATAPI bridge */
88#endif
89#ifdef CONFIG_USB_STORAGE_SDDR09
90#define US_PR_EUSB_SDDR09 0x81 /* SCM-SCSI bridge for SDDR-09 */
91#endif
92#ifdef CONFIG_USB_STORAGE_SDDR55
93#define US_PR_SDDR55 0x82 /* SDDR-55 (made up) */
94#endif
95#define US_PR_DPCM_USB 0xf0 /* Combination CB/SDDR09 */
96#ifdef CONFIG_USB_STORAGE_FREECOM
97#define US_PR_FREECOM 0xf1 /* Freecom */
98#endif
99#ifdef CONFIG_USB_STORAGE_DATAFAB
100#define US_PR_DATAFAB 0xf2 /* Datafab chipsets */
101#endif
102#ifdef CONFIG_USB_STORAGE_JUMPSHOT
103#define US_PR_JUMPSHOT 0xf3 /* Lexar Jumpshot */
104#endif
105#ifdef CONFIG_USB_STORAGE_ALAUDA
106#define US_PR_ALAUDA 0xf4 /* Alauda chipsets */
107#endif
108
109#define US_PR_DEVICE 0xff /* Use device's value */
110
111/*
112 */
113#ifdef CONFIG_USB_LIBUSUAL
114
115extern struct usb_device_id storage_usb_ids[];
116extern void usb_usual_set_present(int type);
117extern void usb_usual_clear_present(int type);
118extern int usb_usual_check_type(const struct usb_device_id *, int type);
119#else
120
121#define usb_usual_set_present(t) do { } while(0)
122#define usb_usual_clear_present(t) do { } while(0)
123#define usb_usual_check_type(id, t) (0)
124#endif /* CONFIG_USB_LIBUSUAL */
125
126#endif /* __LINUX_USB_USUAL_H */
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 343d883d69c5..b096159086e8 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -53,19 +53,14 @@ struct writeback_control {
53 loff_t start; 53 loff_t start;
54 loff_t end; 54 loff_t end;
55 55
56 unsigned nonblocking:1; /* Don't get stuck on request queues */ 56 unsigned nonblocking:1; /* Don't get stuck on request queues */
57 unsigned encountered_congestion:1; /* An output: a queue is full */ 57 unsigned encountered_congestion:1; /* An output: a queue is full */
58 unsigned for_kupdate:1; /* A kupdate writeback */ 58 unsigned for_kupdate:1; /* A kupdate writeback */
59 unsigned for_reclaim:1; /* Invoked from the page allocator */ 59 unsigned for_reclaim:1; /* Invoked from the page allocator */
60 unsigned for_writepages:1; /* This is a writepages() call */
60}; 61};
61 62
62/* 63/*
63 * ->writepage() return values (make these much larger than a pagesize, in
64 * case some fs is returning number-of-bytes-written from writepage)
65 */
66#define WRITEPAGE_ACTIVATE 0x80000 /* IO was not started: activate page */
67
68/*
69 * fs/fs-writeback.c 64 * fs/fs-writeback.c
70 */ 65 */
71void writeback_inodes(struct writeback_control *wbc); 66void writeback_inodes(struct writeback_control *wbc);
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h
index 0fb077d68441..82fbb758e28f 100644
--- a/include/linux/xfrm.h
+++ b/include/linux/xfrm.h
@@ -27,6 +27,22 @@ struct xfrm_id
27 __u8 proto; 27 __u8 proto;
28}; 28};
29 29
30struct xfrm_sec_ctx {
31 __u8 ctx_doi;
32 __u8 ctx_alg;
33 __u16 ctx_len;
34 __u32 ctx_sid;
35 char ctx_str[0];
36};
37
38/* Security Context Domains of Interpretation */
39#define XFRM_SC_DOI_RESERVED 0
40#define XFRM_SC_DOI_LSM 1
41
42/* Security Context Algorithms */
43#define XFRM_SC_ALG_RESERVED 0
44#define XFRM_SC_ALG_SELINUX 1
45
30/* Selector, used as selector both on policy rules (SPD) and SAs. */ 46/* Selector, used as selector both on policy rules (SPD) and SAs. */
31 47
32struct xfrm_selector 48struct xfrm_selector
@@ -146,6 +162,18 @@ enum {
146 162
147#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE) 163#define XFRM_NR_MSGTYPES (XFRM_MSG_MAX + 1 - XFRM_MSG_BASE)
148 164
165/*
166 * Generic LSM security context for comunicating to user space
167 * NOTE: Same format as sadb_x_sec_ctx
168 */
169struct xfrm_user_sec_ctx {
170 __u16 len;
171 __u16 exttype;
172 __u8 ctx_alg; /* LSMs: e.g., selinux == 1 */
173 __u8 ctx_doi;
174 __u16 ctx_len;
175};
176
149struct xfrm_user_tmpl { 177struct xfrm_user_tmpl {
150 struct xfrm_id id; 178 struct xfrm_id id;
151 __u16 family; 179 __u16 family;
@@ -176,6 +204,7 @@ enum xfrm_attr_type_t {
176 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ 204 XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */
177 XFRMA_SA, 205 XFRMA_SA,
178 XFRMA_POLICY, 206 XFRMA_POLICY,
207 XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */
179 __XFRMA_MAX 208 __XFRMA_MAX
180 209
181#define XFRMA_MAX (__XFRMA_MAX - 1) 210#define XFRMA_MAX (__XFRMA_MAX - 1)