diff options
| author | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 23:58:11 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@athlon.transmeta.com> | 2002-02-04 23:58:11 -0800 |
| commit | 4d6c7b36fcb5b4d3a727a9d84353422bacd173a3 (patch) | |
| tree | 6b7a1138ae79619fdaa5008e53d704344d34ebdf /include | |
| parent | e1e2cfc3fb42dbe54dd94fe97ba17a62cd7a265b (diff) | |
v2.5.0.2 -> v2.5.0.3
- Al Viro: more superblock cleanups
- Jens Axboe: more patches for new block IO layer
- Christoph Hellwig: get rid of the old, long- deprecated SCSI error
handling
Diffstat (limited to 'include')
| -rw-r--r-- | include/asm-arm/mach/irq.h | 2 | ||||
| -rw-r--r-- | include/asm-i386/checksum.h | 48 | ||||
| -rw-r--r-- | include/asm-m68k/machdep.h | 4 | ||||
| -rw-r--r-- | include/asm-m68k/macintosh.h | 4 | ||||
| -rw-r--r-- | include/asm-m68k/sun3ints.h | 3 | ||||
| -rw-r--r-- | include/linux/bio.h | 112 | ||||
| -rw-r--r-- | include/linux/blk.h | 5 | ||||
| -rw-r--r-- | include/linux/blkdev.h | 15 | ||||
| -rw-r--r-- | include/linux/elevator.h | 9 | ||||
| -rw-r--r-- | include/linux/fs.h | 1 | ||||
| -rw-r--r-- | include/linux/i2c-old.h | 190 | ||||
| -rw-r--r-- | include/linux/malloc.h | 7 | ||||
| -rw-r--r-- | include/linux/sched.h | 1 | ||||
| -rw-r--r-- | include/linux/seq_file.h | 5 |
14 files changed, 73 insertions, 333 deletions
diff --git a/include/asm-arm/mach/irq.h b/include/asm-arm/mach/irq.h index 1270097b21d5..4ec067c930e1 100644 --- a/include/asm-arm/mach/irq.h +++ b/include/asm-arm/mach/irq.h @@ -35,7 +35,7 @@ extern struct irqdesc irq_desc[]; extern void (*init_arch_irq)(void); extern int setup_arm_irq(int, struct irqaction *); -extern int get_fiq_list(char *); +extern int show_fiq_list(struct seq_file *, void *); extern void init_FIQ(void); #endif diff --git a/include/asm-i386/checksum.h b/include/asm-i386/checksum.h index df942cf28897..6b9761aa8f37 100644 --- a/include/asm-i386/checksum.h +++ b/include/asm-i386/checksum.h @@ -29,9 +29,9 @@ asmlinkage unsigned int csum_partial_copy_generic( const char *src, char *dst, i /* * Note: when you get a NULL pointer exception here this means someone - * passed in an incorrect kernel address to one of these functions. - * - * If you use these functions directly please don't forget the + * passed in an incorrect kernel address to one of these functions. + * + * If you use these functions directly please don't forget the * verify_area(). */ static __inline__ @@ -66,7 +66,8 @@ unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum); * Arnt Gulbrandsen. */ static inline unsigned short ip_fast_csum(unsigned char * iph, - unsigned int ihl) { + unsigned int ihl) +{ unsigned int sum; __asm__ __volatile__( @@ -109,12 +110,12 @@ static inline unsigned int csum_fold(unsigned int sum) ); return (~sum) >> 16; } - + static inline unsigned long csum_tcpudp_nofold(unsigned long saddr, unsigned long daddr, unsigned short len, unsigned short proto, - unsigned int sum) + unsigned int sum) { __asm__( "addl %1, %0 ;\n" @@ -134,7 +135,7 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, unsigned long daddr, unsigned short len, unsigned short proto, - unsigned int sum) + unsigned int sum) { return csum_fold(csum_tcpudp_nofold(saddr,daddr,len,proto,sum)); } @@ -144,7 +145,8 @@ static inline unsigned short int csum_tcpudp_magic(unsigned long saddr, * in icmp.c */ -static inline unsigned short ip_compute_csum(unsigned char * buff, int len) { +static inline unsigned short ip_compute_csum(unsigned char * buff, int len) +{ return csum_fold (csum_partial(buff, len, 0)); } @@ -153,32 +155,32 @@ static __inline__ unsigned short int csum_ipv6_magic(struct in6_addr *saddr, struct in6_addr *daddr, __u32 len, unsigned short proto, - unsigned int sum) + unsigned int sum) { __asm__( - "addl 0(%1), %0" - "adcl 4(%1), %0" - "adcl 8(%1), %0" - "adcl 12(%1), %0" - "adcl 0(%2), %0" - "adcl 4(%2), %0" - "adcl 8(%2), %0" - "adcl 12(%2), %0" - "adcl %3, %0" - "adcl %4, %0" - "adcl $0, %0" + "addl 0(%1), %0 ;\n" + "adcl 4(%1), %0 ;\n" + "adcl 8(%1), %0 ;\n" + "adcl 12(%1), %0 ;\n" + "adcl 0(%2), %0 ;\n" + "adcl 4(%2), %0 ;\n" + "adcl 8(%2), %0 ;\n" + "adcl 12(%2), %0 ;\n" + "adcl %3, %0 ;\n" + "adcl %4, %0 ;\n" + "adcl $0, %0 ;\n" : "=&r" (sum) - : "r" (saddr), "r" (daddr), + : "r" (saddr), "r" (daddr), "r"(htonl(len)), "r"(htonl(proto)), "0"(sum)); return csum_fold(sum); } -/* +/* * Copy and checksum to user */ #define HAVE_CSUM_COPY_USER -static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst, +static __inline__ unsigned int csum_and_copy_to_user(const char *src, char *dst, int len, int sum, int *err_ptr) { if (access_ok(VERIFY_WRITE, dst, len)) diff --git a/include/asm-m68k/machdep.h b/include/asm-m68k/machdep.h index 8b324a001608..82badf63fdfd 100644 --- a/include/asm-m68k/machdep.h +++ b/include/asm-m68k/machdep.h @@ -1,6 +1,8 @@ #ifndef _M68K_MACHDEP_H #define _M68K_MACHDEP_H +#include <linux/seq_file.h> + struct pt_regs; struct kbd_repeat; struct mktime; @@ -21,7 +23,7 @@ extern int (*mach_request_irq) (unsigned int irq, void (*handler)(int, void *, s extern void (*mach_free_irq) (unsigned int irq, void *dev_id); extern void (*mach_get_model) (char *model); extern int (*mach_get_hardware_list) (char *buffer); -extern int (*mach_get_irq_list) (char *buf); +extern int (*mach_get_irq_list) (struct seq_file *p, void *v); extern void (*mach_process_int) (int irq, struct pt_regs *fp); /* machine dependent timer functions */ extern unsigned long (*mach_gettimeoffset)(void); diff --git a/include/asm-m68k/macintosh.h b/include/asm-m68k/macintosh.h index e71462a8b838..68d1249d3cea 100644 --- a/include/asm-m68k/macintosh.h +++ b/include/asm-m68k/macintosh.h @@ -1,6 +1,8 @@ #ifndef __ASM_MACINTOSH_H #define __ASM_MACINTOSH_H +#include <linux/seq_file.h> + /* * Apple Macintoshisms */ @@ -15,7 +17,7 @@ extern void mac_free_irq(unsigned int, void *); extern void mac_enable_irq(unsigned int); extern void mac_disable_irq(unsigned int); extern int mac_irq_pending(unsigned int); -extern int mac_get_irq_list(char *); +extern int show_mac_interrupts(struct seq_file *, void *); #if 0 extern void mac_default_handler(int irq); #endif diff --git a/include/asm-m68k/sun3ints.h b/include/asm-m68k/sun3ints.h index ee082b5a2a71..408f33f9b440 100644 --- a/include/asm-m68k/sun3ints.h +++ b/include/asm-m68k/sun3ints.h @@ -16,6 +16,7 @@ #include <linux/sched.h> #include <linux/kernel_stat.h> #include <linux/interrupt.h> +#include <linux/seq_file.h> #include <asm/segment.h> #include <asm/intersil.h> #include <asm/oplib.h> @@ -32,7 +33,7 @@ extern void (*sun3_inthandler[]) (int, void *, struct pt_regs *); extern void sun3_free_irq (unsigned int irq, void *dev_id); extern void sun3_enable_interrupts (void); extern void sun3_disable_interrupts (void); -extern int sun3_get_irq_list(char *buf); +extern int show_sun3_interrupts(struct seq_file *, void *); extern void sun3_process_int(int, struct pt_regs *); extern volatile unsigned char* sun3_intreg; diff --git a/include/linux/bio.h b/include/linux/bio.h index 7e58544540ba..07d2823880bc 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -30,26 +30,6 @@ #endif /* - * hash profiling stuff.. - */ -#define BIO_HASH_PROFILING - -#define BLKHASHPROF _IOR(0x12,108,sizeof(struct bio_hash_stats)) -#define BLKHASHCLEAR _IO(0x12,109) - -#define MAX_PROFILE_BUCKETS 64 - -struct bio_hash_stats { - atomic_t nr_lookups; - atomic_t nr_hits; - atomic_t nr_inserts; - atomic_t nr_entries; - atomic_t max_entries; - atomic_t max_bucket_size; - atomic_t bucket_size[MAX_PROFILE_BUCKETS + 1]; -}; - -/* * was unsigned short, but we might as well be ready for > 64kB I/O pages */ struct bio_vec { @@ -58,37 +38,6 @@ struct bio_vec { unsigned int bv_offset; }; -struct bio_vec_list { - unsigned int bvl_cnt; /* how may bio_vec's */ - unsigned int bvl_idx; /* current index into bvl_vec */ - unsigned int bvl_size; /* total size in bytes */ - unsigned int bvl_max; /* max bvl_vecs we can hold, used - as index into pool */ - struct bio_vec bvl_vec[0]; /* the iovec array */ -}; - -typedef struct bio_hash_s { - struct bio_hash_s *next_hash; - struct bio_hash_s **pprev_hash; - unsigned long valid_counter; -} bio_hash_t; - -struct bio_hash_bucket { - rwlock_t lock; - bio_hash_t *hash; -} __attribute__((__aligned__(16))); - -#define BIO_HASH_BITS (bio_hash_bits) -#define BIO_HASH_SIZE (1UL << BIO_HASH_BITS) - -/* - * shamelessly stolen from the list.h implementation - */ -#define hash_entry(ptr, type, member) \ - ((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member))) -#define bio_hash_entry(ptr) \ - hash_entry((ptr), struct bio, bi_hash) - /* * main unit of I/O for the block layer and lower layers (ie drivers and * stacking drivers) @@ -96,26 +45,27 @@ struct bio_hash_bucket { struct bio { sector_t bi_sector; struct bio *bi_next; /* request queue link */ - bio_hash_t bi_hash; atomic_t bi_cnt; /* pin count */ kdev_t bi_dev; /* will be block device */ - struct bio_vec_list *bi_io_vec; unsigned long bi_flags; /* status, command, etc */ unsigned long bi_rw; /* bottom bits READ/WRITE, * top bits priority */ + + unsigned int bi_vcnt; /* how may bio_vec's */ + unsigned int bi_idx; /* current index into bvl_vec */ + unsigned int bi_size; /* total size in bytes */ + unsigned int bi_max; /* max bvl_vecs we can hold, + used as index into pool */ + + struct bio_vec *bi_io_vec; /* the actual vec list */ + int (*bi_end_io)(struct bio *bio, int nr_sectors); void *bi_private; - void *bi_hash_desc; /* cookie for hash */ - void (*bi_destructor)(struct bio *); /* destructor */ }; -#define BIO_SECTOR_BITS 9 -#define BIO_OFFSET_MASK ((1UL << (PAGE_CACHE_SHIFT - BIO_SECTOR_BITS)) - 1) -#define BIO_PAGE_MASK (PAGE_CACHE_SIZE - 1) - /* * bio flags */ @@ -125,8 +75,6 @@ struct bio { #define BIO_PREBUILT 3 /* not merged big */ #define BIO_CLONED 4 /* doesn't own data */ -#define bio_is_hashed(bio) ((bio)->bi_hash.pprev_hash) - /* * bio bi_rw flags * @@ -142,12 +90,13 @@ struct bio { * various member access, note that bio_data should of course not be used * on highmem page vectors */ -#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec->bvl_vec[(idx)])) -#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_io_vec->bvl_idx) +#define bio_iovec_idx(bio, idx) (&((bio)->bi_io_vec[(bio)->bi_idx])) +#define bio_iovec(bio) bio_iovec_idx((bio), (bio)->bi_idx) #define bio_page(bio) bio_iovec((bio))->bv_page -#define bio_size(bio) ((bio)->bi_io_vec->bvl_size) +#define bio_size(bio) ((bio)->bi_size) +#define __bio_offset(bio, idx) bio_iovec_idx((bio), (idx))->bv_offset #define bio_offset(bio) bio_iovec((bio))->bv_offset -#define bio_sectors(bio) (bio_size((bio)) >> BIO_SECTOR_BITS) +#define bio_sectors(bio) (bio_size((bio)) >> 9) #define bio_data(bio) (page_address(bio_page((bio))) + bio_offset((bio))) #define bio_barrier(bio) ((bio)->bi_rw & (1 << BIO_BARRIER)) @@ -170,15 +119,17 @@ struct bio { * permanent PIO fall back, user is probably better off disabling highmem * I/O completely on that queue (see ide-dma for example) */ -#define bio_kmap(bio) kmap(bio_page((bio))) + bio_offset((bio)) -#define bio_kunmap(bio) kunmap(bio_page((bio))) +#define __bio_kmap(bio, idx) (kmap(bio_iovec_idx((bio), (idx))->bv_page) + bio_iovec_idx((bio), (idx))->bv_offset) +#define bio_kmap(bio) __bio_kmap((bio), (bio)->bi_idx) +#define __bio_kunmap(bio, idx) kunmap(bio_iovec_idx((bio), (idx))->bv_page) +#define bio_kunmap(bio) __bio_kunmap((bio), (bio)->bi_idx) #define BIO_CONTIG(bio, nxt) \ (bio_to_phys((bio)) + bio_size((bio)) == bio_to_phys((nxt))) -#define __BIO_PHYS_4G(addr1, addr2) \ - (((addr1) | 0xffffffff) == (((addr2) -1 ) | 0xffffffff)) -#define BIO_PHYS_4G(b1, b2) \ - __BIO_PHYS_4G(bio_to_phys((b1)), bio_to_phys((b2)) + bio_size((b2))) +#define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ + (((addr1) | (mask)) == (((addr2) - 1) | (mask))) +#define BIO_SEG_BOUNDARY(q, b1, b2) \ + __BIO_SEG_BOUNDARY(bvec_to_phys(bio_iovec_idx((b1), (b1)->bi_cnt - 1)), bio_to_phys((b2)) + bio_size((b2)), (q)->seg_boundary_mask) typedef int (bio_end_io_t) (struct bio *, int); typedef void (bio_destructor_t) (struct bio *); @@ -186,8 +137,8 @@ typedef void (bio_destructor_t) (struct bio *); #define bio_io_error(bio) bio_endio((bio), 0, bio_sectors((bio))) #define bio_for_each_segment(bvl, bio, i) \ - for (bvl = bio_iovec((bio)), i = (bio)->bi_io_vec->bvl_idx; \ - i < (bio)->bi_io_vec->bvl_cnt; \ + for (bvl = bio_iovec((bio)), i = (bio)->bi_idx; \ + i < (bio)->bi_vcnt; \ bvl++, i++) /* @@ -209,21 +160,12 @@ typedef void (bio_destructor_t) (struct bio *); extern struct bio *bio_alloc(int, int); extern void bio_put(struct bio *); -/* - * the hash stuff is pretty closely tied to the request queue (needed for - * locking etc anyway, and it's in no way an attempt at a generic hash) - */ -struct request_queue; - -extern inline void bio_hash_remove(struct bio *); -extern inline void bio_hash_add(struct bio *, void *, unsigned int); -extern inline struct bio *bio_hash_find(kdev_t, sector_t, unsigned int); -extern inline int bio_hash_add_unique(struct bio *, void *, unsigned int); -extern void bio_hash_invalidate(struct request_queue *, kdev_t); extern int bio_endio(struct bio *, int, int); extern struct bio *bio_clone(struct bio *, int); -extern struct bio *bio_copy(struct bio *, int); +extern struct bio *bio_copy(struct bio *, int, int); + +extern inline void bio_init(struct bio *); extern int bio_ioctl(kdev_t, unsigned int, unsigned long); diff --git a/include/linux/blk.h b/include/linux/blk.h index 863ace44fde8..71712cbc6619 100644 --- a/include/linux/blk.h +++ b/include/linux/blk.h @@ -83,11 +83,6 @@ void initrd_init(void); static inline void blkdev_dequeue_request(struct request *req) { - if (req->bio) - bio_hash_remove(req->bio); - if (req->biotail) - bio_hash_remove(req->biotail); - list_del(&req->queuelist); } diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index f3e54a537508..6c5bd21cf609 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -127,9 +127,9 @@ struct request_queue unsigned short hardsect_size; unsigned int max_segment_size; - wait_queue_head_t queue_wait; + unsigned long seg_boundary_mask; - unsigned int hash_valid_counter; + wait_queue_head_t queue_wait; }; #define RQ_INACTIVE (-1) @@ -140,6 +140,7 @@ struct request_queue #define QUEUE_FLAG_PLUGGED 0 /* queue is plugged */ #define QUEUE_FLAG_NOSPLIT 1 /* can process bio over several goes */ +#define QUEUE_FLAG_CLUSTER 2 /* cluster several segments into 1 */ #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) @@ -166,11 +167,6 @@ extern inline struct request *elv_next_request(request_queue_t *q) if (rq) { rq->inactive = 0; wmb(); - - if (rq->bio) - bio_hash_remove(rq->bio); - if (rq->biotail) - bio_hash_remove(rq->biotail); } return rq; @@ -187,7 +183,7 @@ extern inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) { struct page *page = bio_page(*bio); - if (page - page->zone->zone_mem_map > q->bounce_pfn) + if ((page - page->zone->zone_mem_map) + (page->zone->zone_start_paddr >> PAGE_SHIFT) < q->bounce_pfn) create_bounce(bio, q->bounce_gfp); } @@ -235,7 +231,7 @@ extern void blk_attempt_remerge(request_queue_t *, struct request *); /* * Access functions for manipulating queue properties */ -extern int blk_init_queue(request_queue_t *, request_fn_proc *, char *); +extern int blk_init_queue(request_queue_t *, request_fn_proc *); extern void blk_cleanup_queue(request_queue_t *); extern void blk_queue_make_request(request_queue_t *, make_request_fn *); extern void blk_queue_bounce_limit(request_queue_t *, unsigned long long); @@ -243,6 +239,7 @@ extern void blk_queue_max_sectors(request_queue_t *q, unsigned short); extern void blk_queue_max_segments(request_queue_t *q, unsigned short); extern void blk_queue_max_segment_size(request_queue_t *q, unsigned int); extern void blk_queue_hardsect_size(request_queue_t *q, unsigned short); +extern void blk_queue_segment_boundary(request_queue_t *q, unsigned long); extern int blk_rq_map_sg(request_queue_t *, struct request *, struct scatterlist *); extern void generic_unplug_device(void *); diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 9d5d644c3b88..df4c50a956ec 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -33,13 +33,6 @@ struct elevator_s elevator_init_fn *elevator_init_fn; elevator_exit_fn *elevator_exit_fn; - - /* - * per-elevator private data - */ - void *elevator_data; - - char queue_name[16]; }; int elevator_noop_merge(request_queue_t *, struct request **, struct list_head *, struct bio *); @@ -66,7 +59,7 @@ typedef struct blkelv_ioctl_arg_s { #define BLKELVGET _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t)) #define BLKELVSET _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t)) -extern int elevator_init(request_queue_t *, elevator_t *, elevator_t, char *); +extern int elevator_init(request_queue_t *, elevator_t *, elevator_t); extern void elevator_exit(request_queue_t *, elevator_t *); /* diff --git a/include/linux/fs.h b/include/linux/fs.h index 95bfc30de8c9..b18bf238c267 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -205,7 +205,6 @@ extern int leases_enable, dir_notify_enable, lease_break_time; extern void update_atime (struct inode *); #define UPDATE_ATIME(inode) update_atime (inode) -extern void bio_hash_init(unsigned long); extern void buffer_init(unsigned long); extern void inode_init(unsigned long); extern void mnt_init(unsigned long); diff --git a/include/linux/i2c-old.h b/include/linux/i2c-old.h deleted file mode 100644 index cc9d9c148661..000000000000 --- a/include/linux/i2c-old.h +++ /dev/null @@ -1,190 +0,0 @@ -#ifndef I2C_H -#define I2C_H - -/* - * linux i2c interface. Works a little bit like the scsi subsystem. - * There are: - * - * i2c the basic control module (like scsi_mod) - * bus driver a driver with a i2c bus (hostadapter driver) - * chip driver a driver for a chip connected - * to a i2c bus (cdrom/hd driver) - * - * A device will be attached to one bus and one chip driver. Every chip - * driver gets a unique ID. - * - * A chip driver can provide a ioctl-like callback for the - * communication with other parts of the kernel (not every i2c chip is - * useful without other devices, a TV card tuner for example). - * - * "i2c internal" parts of the structs: only the i2c module is allowed to - * write to them, for others they are read-only. - * - */ - -#include <linux/version.h> - -#define I2C_BUS_MAX 4 /* max # of bus drivers */ -#define I2C_DRIVER_MAX 8 /* max # of chip drivers */ -#define I2C_DEVICE_MAX 8 /* max # if devices per bus/driver */ - -struct i2c_bus; -struct i2c_driver; -struct i2c_device; - -#define I2C_DRIVERID_MSP3400 1 -#define I2C_DRIVERID_TUNER 2 -#define I2C_DRIVERID_VIDEOTEXT 3 -#define I2C_DRIVERID_VIDEODECODER 4 -#define I2C_DRIVERID_VIDEOENCODER 5 - -#define I2C_BUSID_BT848 1 /* I2C bus on a BT848 */ -#define I2C_BUSID_PARPORT 2 /* Bit banging on a parallel port */ -#define I2C_BUSID_BUZ 3 -#define I2C_BUSID_ZORAN 4 -#define I2C_BUSID_CYBER2000 5 - -/* - * struct for a driver for a i2c chip (tuner, soundprocessor, - * videotext, ... ). - * - * a driver will register within the i2c module. The i2c module will - * callback the driver (i2c_attach) for every device it finds on a i2c - * bus at the specified address. If the driver decides to "accept" - * the, device, it must return a struct i2c_device, and NULL - * otherwise. - * - * i2c_detach = i2c_attach ** -1 - * - * i2c_command will be used to pass commands to the driver in a - * ioctl-line manner. - * - */ - -struct i2c_driver -{ - char name[32]; /* some useful label */ - int id; /* device type ID */ - unsigned char addr_l, addr_h; /* address range of the chip */ - - int (*attach)(struct i2c_device *device); - int (*detach)(struct i2c_device *device); - int (*command)(struct i2c_device *device,unsigned int cmd, void *arg); - - /* i2c internal */ - struct i2c_device *devices[I2C_DEVICE_MAX]; - int devcount; -}; - - -/* - * this holds the informations about a i2c bus available in the system. - * - * a chip with a i2c bus interface (like bt848) registers the bus within - * the i2c module. This struct provides functions to access the i2c bus. - * - * One must hold the spinlock to access the i2c bus (XXX: is the irqsave - * required? Maybe better use a semaphore?). - * [-AC-] having a spinlock_irqsave is only needed if we have drivers wishing - * to bang their i2c bus from an interrupt. - * - * attach/detach_inform is a callback to inform the bus driver about - * attached chip drivers. - * - */ - -/* needed: unsigned long flags */ - -#if LINUX_VERSION_CODE >= 0x020100 -# if 0 -# define LOCK_FLAGS unsigned long flags; -# define LOCK_I2C_BUS(bus) spin_lock_irqsave(&(bus->bus_lock),flags); -# define UNLOCK_I2C_BUS(bus) spin_unlock_irqrestore(&(bus->bus_lock),flags); -# else -# define LOCK_FLAGS -# define LOCK_I2C_BUS(bus) spin_lock(&(bus->bus_lock)); -# define UNLOCK_I2C_BUS(bus) spin_unlock(&(bus->bus_lock)); -# endif -#else -# define LOCK_FLAGS unsigned long flags; -# define LOCK_I2C_BUS(bus) { save_flags(flags); cli(); } -# define UNLOCK_I2C_BUS(bus) { restore_flags(flags); } -#endif - -struct i2c_bus -{ - char name[32]; /* some useful label */ - int id; - void *data; /* free for use by the bus driver */ - -#if LINUX_VERSION_CODE >= 0x020100 - spinlock_t bus_lock; -#endif - - /* attach/detach inform callbacks */ - void (*attach_inform)(struct i2c_bus *bus, int id); - void (*detach_inform)(struct i2c_bus *bus, int id); - - /* Software I2C */ - void (*i2c_setlines)(struct i2c_bus *bus, int ctrl, int data); - int (*i2c_getdataline)(struct i2c_bus *bus); - - /* Hardware I2C */ - int (*i2c_read)(struct i2c_bus *bus, unsigned char addr); - int (*i2c_write)(struct i2c_bus *bus, unsigned char addr, - unsigned char b1, unsigned char b2, int both); - - /* internal data for i2c module */ - struct i2c_device *devices[I2C_DEVICE_MAX]; - int devcount; -}; - - -/* - * This holds per-device data for a i2c device - */ - -struct i2c_device -{ - char name[32]; /* some useful label */ - void *data; /* free for use by the chip driver */ - unsigned char addr; /* chip addr */ - - /* i2c internal */ - struct i2c_bus *bus; - struct i2c_driver *driver; -}; - - -/* ------------------------------------------------------------------- */ -/* i2c module functions */ - -/* register/unregister a i2c bus */ -int i2c_register_bus(struct i2c_bus *bus); -int i2c_unregister_bus(struct i2c_bus *bus); - -/* register/unregister a chip driver */ -int i2c_register_driver(struct i2c_driver *driver); -int i2c_unregister_driver(struct i2c_driver *driver); - -/* send a command to a chip using the ioctl-like callback interface */ -int i2c_control_device(struct i2c_bus *bus, int id, - unsigned int cmd, void *arg); - -/* i2c bus access functions */ -void i2c_start(struct i2c_bus *bus); -void i2c_stop(struct i2c_bus *bus); -void i2c_one(struct i2c_bus *bus); -void i2c_zero(struct i2c_bus *bus); -int i2c_ack(struct i2c_bus *bus); - -int i2c_sendbyte(struct i2c_bus *bus,unsigned char data,int wait_for_ack); -unsigned char i2c_readbyte(struct i2c_bus *bus,int last); - -/* i2c (maybe) hardware functions */ -int i2c_read(struct i2c_bus *bus, unsigned char addr); -int i2c_write(struct i2c_bus *bus, unsigned char addr, - unsigned char b1, unsigned char b2, int both); - -int i2c_init(void); -#endif /* I2C_H */ diff --git a/include/linux/malloc.h b/include/linux/malloc.h deleted file mode 100644 index fc5e144f30a4..000000000000 --- a/include/linux/malloc.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef _LINUX_MALLOC_H -#define _LINUX_MALLOC_H - -#warning linux/malloc.h is deprecated, use linux/slab.h instead. - -#include <linux/slab.h> -#endif /* _LINUX_MALLOC_H */ diff --git a/include/linux/sched.h b/include/linux/sched.h index 97c574fe85d2..3a16560f1c2f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -21,7 +21,6 @@ extern unsigned long event; #include <asm/mmu.h> #include <linux/smp.h> -#include <linux/tty.h> #include <linux/sem.h> #include <linux/signal.h> #include <linux/securebits.h> diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 1cf66cd69e6c..b16ee73b37a2 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h @@ -2,7 +2,11 @@ #define _LINUX_SEQ_FILE_H #ifdef __KERNEL__ +#include <linux/types.h> + struct seq_operations; +struct file; +struct inode; struct seq_file { char *buf; @@ -12,6 +16,7 @@ struct seq_file { loff_t index; struct semaphore sem; struct seq_operations *op; + void *private; }; struct seq_operations { |
